@viswa-test/test-citation 0.0.235 → 0.0.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
- package/dist/cjs/utils/tagHelper.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SvgConnectors.js +1 -1
- package/dist/features/CognitiveCompare/components/connectedLines.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
- package/dist/types/src/CitationAccordionTest.d.ts +1 -0
- package/dist/types/src/CitationAccordionTest.d.ts.map +1 -0
- package/dist/types/src/DeviationSummaryTest.d.ts.map +1 -1
- package/dist/types/src/MockDeviationSummary.d.ts +1 -0
- package/dist/types/src/MockDeviationSummary.d.ts.map +1 -0
- package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +9 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +27546 -1239
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts +2 -1
- package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +2 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +28 -9
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.d.ts +7 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +7 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +8 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
- package/dist/types/src/utils/tagHelper.d.ts +1 -1
- package/dist/types/src/utils/tagHelper.d.ts.map +1 -1
- package/dist/utils/tagHelper.js +1 -1
- package/package.json +5 -5
- package/dist/types/src/constants/deviationData.d.ts +0 -887
- package/dist/types/src/constants/deviationData.d.ts.map +0 -1
- package/dist/types/src/constants/treeData.d.ts +0 -732
- package/dist/types/src/constants/treeData.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts +0 -8
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("react"),i=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw"),c=require("remark-gfm");function d(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=d(r),g=d(a),h=d(l),p=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},f=[p(d(c).default)],v=[p(h.default)],x=u.default.memo(function(a){var l=a.content,c=a.overlayContent,d=a.sxStyles,h=a.deviationBadges,p=void 0===h?[]:h,x=a.highlights,m=void 0===x?[]:x;a.maintainRelativeOrder;var _=a.highlightBg,b=a.suppressHighlightBg,y=void 0!==b&&b,B=a.collisionKey,E=r.useRef(null),j=!!c,C=r.useMemo(function(){return p.reduce(function(e,t){var r;return n.__assign(n.__assign({},e),((r={})[t.id]=t,r))},{})},[p]),k=r.useRef({badgeMap:C,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y});k.current={badgeMap:C,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y};var S=function(e,t){return u.default.Children.map(e,function(e){var r;if(!u.default.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?S(e.props.children,t):e.props.children,o=u.default.cloneElement(e,n.__assign(n.__assign({},e.props),{children:i}));return t(o)})},F=r.useMemo(function(){return{mark:function(t){var r,i,o,a,s=t.children,l=n.__rest(t,["children"]),c=k.current,d=c.badgeMap,u=c.highlightBg,g=c.hideHighlightBg,h=c.suppressHighlightBg,p=l["data-badge-id"],f=p?d[p]:null,v=l["data-highlight-color"],x=null!==(a=null!==(i=null!=v?v:null===(r=null==f?void 0:f.style)||void 0===r?void 0:r.highlightBg)&&void 0!==i?i:null===(o=null==f?void 0:f.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:u,m="true"===l["data-is-suggested-deviation-fix"]||h;return e.jsx("span",n.__assign({style:n.__assign(n.__assign(n.__assign({},m?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),g?{color:"transparent"}:{})},{children:s}))},span:function(r){var a,s,l,c,d,u,g=r.children,h=n.__rest(r,["children"]),p=k.current.badgeMap,f=h["data-badge-id"];if(!f)return e.jsx("span",n.__assign({},h,{children:g}));var v=p[f];if(!v)return e.jsx("span",n.__assign({},h,{children:g}));var x="number"==typeof v.stackIndex?v.stackIndex:0,m="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return e.jsxs(t.Box,n.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[e.jsxs(t.Box,n.__assign({ref:v.badgeRef,className:"deviation-badge","data-side":v.side||"right",sx:n.__assign(n.__assign({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=v.style)||void 0===s?void 0:s.badgeText)||i.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=v.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===v.side?{right:"-16px",transform:"".concat(m," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(m," translateX(calc(-100% - 8px))")}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[e.jsxs(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onClick&&v.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:e.jsx(o.EllipsisVertical,{size:12,color:(null===(u=v.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),g]}))},table:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:i}))},thead:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"thead"},{children:i}))},tbody:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tbody"},{children:i}))},tr:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:i}))},th:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:i}))},td:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:i}))},code:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var t=n.children;return e.jsx(e.Fragment,{children:t})},deleted:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},o,{children:i}))},ol:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},o,{children:i}))},li:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"li",sx:{mb:.5,display:"list-item"}},o,{children:i}))}}},[]),w=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g," ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},M=function(n){return n.replace(/[\.,;:]/g," ")},A=r.useMemo(function(){return p.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[p]),T=r.useMemo(function(){var e=w(l||""),t=y?M(e):e,r=(p||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:w((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||_}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var s=null!==(r=a[1])&&void 0!==r?r:"",l=null!==(i=a[2])&&void 0!==i?i:"",c=null!==(o=a[3])&&void 0!==o?o:"";return l?s+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+l+"</mark>"+c:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var s="",l="";r.forEach(function(n){s+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),l="</span>"+l}),a=s+o+l}return""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&y){var c=M(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,u=1;u<i.length;u++)d=s.mixHexColors(d,i[u].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var c=new Set(Object.keys(i));(m||[]).forEach(function(n){if(n){var r=w(n);if(r&&!c.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&y){var s=M(r);-1!==(i=t.indexOf(s))&&(o=!0)}if(-1!==i){var l=e.slice(0,i);(l.match(/</g)||[]).length===(l.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:_||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var d=[],u={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=d;i<o.length;i++){var a=o[i],s=a.start,l=a.end,c=t<l&&r>l&&t>=s,g=t<s&&r>s&&r<=l;if(t>=s&&r<=l){n.orphaned=!0,u[e]=a.matchIdx;break}c&&(t=l),g&&(r=s)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&d.push({start:t,end:r,matchIdx:e})});var g={};Object.entries(u).forEach(function(n){var e=n[0],t=n[1],r=Number(e);g[t]||(g[t]=[]),g[t].push(r)});var h=a.map(function(e,t){return n.__assign(n.__assign({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return h.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),u=Math.max(d,t.end-e);if(!(d>=u)){var g=s.mixHexColors(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,u),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",g,t.badges||[]),c=u}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,g[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[l,p,m,_,y]),z=r.useMemo(function(){return c?w(c||""):""},[c]),O=!!c,q={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},I=n.__assign(n.__assign(n.__assign(n.__assign({},d),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),O?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),P=n.__assign(n.__assign(n.__assign({},d),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return r.useLayoutEffect(function(){if(E.current){var n=function(){var n=Array.from(E.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=E.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,s=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=s})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(E.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[T,B,A]),e.jsxs(t.Box,n.__assign({ref:E,sx:{position:"relative",display:"grid"}},{children:[e.jsx(t.Typography,n.__assign({component:"div",sx:n.__assign(n.__assign({},I),{padding:"3px"})},{children:e.jsx(g.default,n.__assign({components:F,remarkPlugins:f,rehypePlugins:v},{children:T.replace(/#{3}/g,"")}))})),O&&e.jsx(t.Typography,n.__assign({component:"div",sx:P},{children:e.jsx(g.default,n.__assign({components:F,remarkPlugins:f,rehypePlugins:v},{children:z}))}))]}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=x;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("react"),i=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw");function c(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var d,u=c(r),g=c(a),h=[(d=c(l).default,"function"==typeof d?d:(null==d?void 0:d.default)||d)],p=u.default.memo(function(a){var l=a.content,c=a.overlayContent,d=a.sxStyles,p=a.deviationBadges,f=void 0===p?[]:p,v=a.highlights,x=void 0===v?[]:v;a.maintainRelativeOrder;var m=a.highlightBg,_=a.suppressHighlightBg,b=void 0!==_&&_,y=a.collisionKey,B=r.useRef(null),E=!!c,j=r.useMemo(function(){return f.reduce(function(e,t){var r;return n.__assign(n.__assign({},e),((r={})[t.id]=t,r))},{})},[f]),C=r.useRef({badgeMap:j,highlightBg:m,hideHighlightBg:E,suppressHighlightBg:b});C.current={badgeMap:j,highlightBg:m,hideHighlightBg:E,suppressHighlightBg:b};var S=function(e,t){return u.default.Children.map(e,function(e){var r;if(!u.default.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?S(e.props.children,t):e.props.children,o=u.default.cloneElement(e,n.__assign(n.__assign({},e.props),{children:i}));return t(o)})},k=r.useMemo(function(){return{mark:function(t){var r,i,o,a,s=t.children,l=n.__rest(t,["children"]),c=C.current,d=c.badgeMap,u=c.highlightBg,g=c.hideHighlightBg,h=c.suppressHighlightBg,p=l["data-badge-id"],f=p?d[p]:null,v=l["data-highlight-color"],x=null!==(a=null!==(i=null!=v?v:null===(r=null==f?void 0:f.style)||void 0===r?void 0:r.highlightBg)&&void 0!==i?i:null===(o=null==f?void 0:f.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:u,m="true"===l["data-is-suggested-deviation-fix"]||h;return e.jsx("span",n.__assign({style:n.__assign(n.__assign(n.__assign({},m?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),g?{color:"transparent"}:{})},{children:s}))},span:function(r){var a,s,l,c,d,u,g=r.children,h=n.__rest(r,["children"]),p=C.current.badgeMap,f=h["data-badge-id"];if(!f)return e.jsx("span",n.__assign({},h,{children:g}));var v=p[f];if(!v)return e.jsx("span",n.__assign({},h,{children:g}));var x="number"==typeof v.stackIndex?v.stackIndex:0,m="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return e.jsxs(t.Box,n.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[e.jsxs(t.Box,n.__assign({ref:v.badgeRef,className:"deviation-badge","data-side":v.side||"right",sx:n.__assign(n.__assign({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=v.style)||void 0===s?void 0:s.badgeText)||i.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=v.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===v.side?{right:"-16px",transform:"".concat(m," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(m," translateX(calc(-100% - 8px))")}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[e.jsxs(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onClick&&v.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:e.jsx(o.EllipsisVertical,{size:12,color:(null===(u=v.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),g]}))},table:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:i}))},thead:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"thead"},{children:i}))},tbody:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tbody"},{children:i}))},tr:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:i}))},th:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:i}))},td:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:i}))},code:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var t=n.children;return e.jsx(e.Fragment,{children:t})},deleted:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},o,{children:i}))},ol:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},o,{children:i}))},li:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"li",sx:{mb:.5,display:"list-item"}},o,{children:i}))}}},[]),F=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g," ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},w=function(n){return n.replace(/[\.,;:]/g," ")},M=r.useMemo(function(){return f.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[f]),A=r.useMemo(function(){var e=F(l||""),t=b?w(e):e,r=(f||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:F((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||m}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var s=null!==(r=a[1])&&void 0!==r?r:"",l=null!==(i=a[2])&&void 0!==i?i:"",c=null!==(o=a[3])&&void 0!==o?o:"";return l?s+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+l+"</mark>"+c:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var s="",l="";r.forEach(function(n){s+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),l="</span>"+l}),a=s+o+l}return""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&b){var c=w(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,u=1;u<i.length;u++)d=s.mixHexColors(d,i[u].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var c=new Set(Object.keys(i));(x||[]).forEach(function(n){if(n){var r=F(n);if(r&&!c.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&b){var s=w(r);-1!==(i=t.indexOf(s))&&(o=!0)}if(-1!==i){var l=e.slice(0,i);(l.match(/</g)||[]).length===(l.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:m||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var d=[],u={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=d;i<o.length;i++){var a=o[i],s=a.start,l=a.end,c=t<l&&r>l&&t>=s,g=t<s&&r>s&&r<=l;if(t>=s&&r<=l){n.orphaned=!0,u[e]=a.matchIdx;break}c&&(t=l),g&&(r=s)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&d.push({start:t,end:r,matchIdx:e})});var g={};Object.entries(u).forEach(function(n){var e=n[0],t=n[1],r=Number(e);g[t]||(g[t]=[]),g[t].push(r)});var h=a.map(function(e,t){return n.__assign(n.__assign({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return h.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),u=Math.max(d,t.end-e);if(!(d>=u)){var g=s.mixHexColors(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,u),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",g,t.badges||[]),c=u}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,g[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[l,f,x,m,b]),T=r.useMemo(function(){return c?F(c||""):""},[c]),z=!!c,O={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},q=n.__assign(n.__assign(n.__assign(n.__assign({},d),O),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),z?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),I=n.__assign(n.__assign(n.__assign({},d),O),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return r.useLayoutEffect(function(){if(B.current){var n=function(){var n=Array.from(B.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=B.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,s=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=s})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(B.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[A,y,M]),e.jsxs(t.Box,n.__assign({ref:B,sx:{position:"relative",display:"grid"}},{children:[e.jsx(t.Typography,n.__assign({component:"div",sx:n.__assign(n.__assign({},q),{padding:"3px"})},{children:e.jsx(g.default,n.__assign({components:k,rehypePlugins:h},{children:A.replace(/#{3}/g,"")}))})),z&&e.jsx(t.Typography,n.__assign({component:"div",sx:I},{children:e.jsx(g.default,n.__assign({components:k,rehypePlugins:h},{children:T}))}))]}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=p;
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),n=require("react"),t=require("react-markdown"),i=require("rehype-raw"),l=require("./utils/citationData.utils.js"),c=require("./GptWebCitation.module.css.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(t),u=a(i);exports.default=function(t){var i=t.content,a=t.activeHighlightIndex,o=t.onHighlightCountChange,h=n.useRef(null),d=n.useMemo(function(){var e,r=i.match(/id=["']highlighted-\d+["']/g);if(null==r?void 0:r.length)return r.length;var n=i.match(/<a\b[^>]*>/gi);return null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0},[i]),f=n.useMemo(function(){return/id=["']highlighted-\d+["']/.test(i)},[i]);n.useEffect(function(){null==o||o(d)},[d,o]),n.useEffect(function(){var e;if(h.current){var r=h.current.querySelector("#highlighted-".concat(a));if(r)r.scrollIntoView({behavior:"smooth",block:"center"});else null===(e=h.current.querySelectorAll("a[href]")[a])||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[a,i]);var g=n.useMemo(function(){var n=-1;return{span:function(n){n.node;var t=e.__rest(n,["node"]),i=t.id;if(null==i?void 0:i.startsWith("highlighted-")){var l=Number(i.replace("highlighted-",""))===a;return r.jsx("span",e.__assign({},t,{id:i,className:"".concat(c.default.highlight).concat(l?" ".concat(c.default.highlightActive):"")}))}return r.jsx("span",e.__assign({},t))},a:function(t){var i,s=t.children,u=t.href,o=t.title,h=t.className;if(!u)return r.jsx(r.Fragment,{children:s});n+=1;var d=!f&&n===a,g=null!==(i=l.sanitizeExternalUrl(u))&&void 0!==i?i:"#";return r.jsx("a",e.__assign({href:g,title:o,target:"_blank",rel:"noreferrer",className:"".concat(c.default.citationLink).concat(d?" ".concat(c.default.citationLinkActive):"").concat(h?" ".concat(h):"")},{children:s}))},code:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("code",e.__assign({},i,{children:t}))},ol:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("ol",e.__assign({},i,{children:t}))},ul:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("ul",e.__assign({},i,{children:t}))},li:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("li",e.__assign({},i,{children:t}))},p:function(n){var t=n.children,i=e.__rest(n,["children"]);return r.jsx("p",e.__assign({},i,{children:t}))}}},[a,f,i]);return r.jsx("div",e.__assign({ref:h,className:c.default.markdownBody},{children:r.jsx(s.default,e.__assign({rehypePlugins:[u.default],components:g},{children:i}))}))};
|
|
2
|
+
//# sourceMappingURL=GptWebCitationMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GptWebCitationMarkdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("@lexical/react/LexicalComposer"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("@lexical/react/LexicalComposer"),n=require("@lexical/react/LexicalHistoryPlugin"),r=require("@lexical/react/LexicalOnChangePlugin"),l=require("@lexical/react/LexicalTabIndentationPlugin"),o=require("@lexical/list"),a=require("@lexical/react/LexicalListPlugin"),u=require("@lexical/react/LexicalLinkPlugin"),s=require("@lexical/link"),d=require("@lexical/rich-text"),c=require("@lexical/react/LexicalTablePlugin"),g=require("@lexical/table"),p=require("lexical");require("./components/EditorToolbar/components/ToolbarButton/ToolbarButton.css.js");var x=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("./components/EditorContainer/EditorContainer.js"),m=require("./components/EditorToolbar/EditorToolbar.js"),h=require("./plugins/LayoutPlugin.js"),C=require("./theme/theme.js");require("./theme/theme.css.js"),require("./Editor.css.js");var N=require("./components/Context/ContextMenu.js"),q=require("@lexical/mark"),j=require("./plugins/CommentPlugin/HTMLNode.js"),v=require("./constants/editorConfig.js"),S=require("./plugins/InitialHtml.js"),T=require("./plugins/InsertNode.js"),y=require("./plugins/DeleteNode.js"),b=require("./plugins/HighlightNode.js"),L=require("@lexical/react/LexicalComposerContext"),P=require("./plugins/UpdateNode.js"),I=require("./plugins/ManualNode.js"),E=require("./plugins/PreservedNode.js"),R=require("./plugins/InvisibleNode.js");function _(e){console.log(e)}function B({onEditBlocked:e}){const[i]=L.useLexicalComposerContext();return t.useEffect(()=>{const t=e=>{let t=e;for(;t;){if(["preserved","insert","delete"].includes(t.getType()))return t;if(["update","manual"].includes(t.getType())&&t.getStatus()&&"pending"===t.getStatus())return t;t=t.getParent()}return!1};function n(e){let t=e;for(;t;){if((t instanceof P.UpdateNode||t instanceof I.ManualNode)&&"pending"===t.getStatus())return t.getId();t=t.getParent()}return null}return i.registerCommand(p.KEY_DOWN_COMMAND,i=>{const r=p.$getSelection();if(!p.$isRangeSelection(r))return!1;const l=r.getNodes().find(e=>!!t(e));if(l)return i.preventDefault(),null==e||e(n(l)||""),!0;if(r.isCollapsed()){const l=r.anchor.getNode(),o=t(l);if(o){const t=o?n(o):"";return null==e||e(t||""),i.preventDefault(),!0}if("Backspace"===i.key){const t=l.getPreviousSibling(),o=t&&(["delete","insert","preserved"].includes(t.getType())||["update","manual"].includes(t.getType())&&t.getStatus()&&"pending"===t.getStatus())?t:null;if(0===r.anchor.offset&&o)return null==e||e(n(o)||""),i.preventDefault(),!0}else if("Delete"===i.key){const t=l.getNextSibling(),o=t&&(["delete","insert","preserved"].includes(t.getType())||["update","manual"].includes(t.getType())&&t.getStatus()&&"pending"===t.getStatus())?t:null,a=l.getTextContent().length;if(r.anchor.offset===a&&o)return null==e||e(n(o)||""),i.preventDefault(),!0}}return!1},p.COMMAND_PRIORITY_CRITICAL)},[i]),null}exports.default=function({minHeight:L,height:M,placeholder:k,onFocus:H,onBlur:D,onChange:O,onToolbarButtonClick:A,toolbarConfig:w=v.DEFAULT_TOOLBAR_CONFIG,editorRef:$,editorState:F,initialString:U,customToolbar:W,plugins:Y,nodes:V,dynamicHeight:G,artifactContext:K,commentsPanelState:Q,mode:X,doNotShowBorderInViewMode:z,onEditBlocked:J}){var Z,ee,te;const ie=t.useRef(null),ne={namespace:"MyEditor",theme:C.default,onError:_,nodes:[p.TextNode,o.ListNode,o.ListItemNode,s.LinkNode,d.QuoteNode,d.HeadingNode,g.TableNode,g.TableRowNode,g.TableCellNode,q.MarkNode,j.default,T.InsertNode,y.DeleteNode,P.UpdateNode,E.PreservedNode,I.ManualNode,R.InvisibleNode,b.HighlightSpanNode,b.HighlightButtonNode],editorState:F},[re,le]=t.useState(null),[oe,ae]=t.useState(!1),{customStyles:ue}=x.useRequirementAI(),se=e=>{var t;null===(t=$.current)||void 0===t||t.update(()=>{const t=p.$getSelection();p.$isRangeSelection(t)&&t.getNodes().forEach(t=>{p.$isTextNode(t)&&t.setStyle(`color: ${e}`)})})};return document.getElementById("lexical_editor_wrapper"),e.jsxs(e.Fragment,{children:[(null===(Z=null==ue?void 0:ue.textEditorStyles)||void 0===Z?void 0:Z.themeStyles)&&e.jsx("style",{children:null===(ee=null==ue?void 0:ue.textEditorStyles)||void 0===ee?void 0:ee.themeStyles}),e.jsxs("div",{ref:ie,className:"w-full lexical_editor_wrapper "+(z&&"readOnly"===X?"":"lexical_editor_wrapper_box"),id:"lexical_editor_wrapper",onContextMenu:e=>{var t;e.preventDefault(),null===(t=$.current)||void 0===t||t.update(()=>{const t=p.$getSelection();p.$isRangeSelection(t)&&!t.isCollapsed()?(ae(!0),le({x:e.clientX,y:e.clientY})):(ae(!1),le(null))})},style:{minHeight:L,height:M,...null===(te=null==ue?void 0:ue.textEditorStyles)||void 0===te?void 0:te.textArea},children:[e.jsxs(i.LexicalComposer,{initialConfig:ne,children:[" ","edit"===X&&e.jsx(B,{onEditBlocked:J}),"edit"===X&&e.jsx(m.default,{onToolbarButtonClick:A,editorWrapperRef:ie,toolbarConfig:w,customToolbar:W,editorRef:$}),e.jsx(f.default,{placeholder:k}),e.jsx(l.TabIndentationPlugin,{}),e.jsx(n.HistoryPlugin,{}),e.jsx(a.ListPlugin,{}),e.jsx(u.LinkPlugin,{}),e.jsx(c.TablePlugin,{}),e.jsx(h.LayoutPlugin,{onFocus:H,onBlur:D,editorRef:$}),e.jsx(r.OnChangePlugin,{ignoreSelectionChange:!0,ignoreHistoryMergeTagChange:!0,onChange:(e,t,i)=>{O&&O(e,t,i)}}),U&&e.jsx(S.InitialHtml,{initialValue:U.value,initialFormat:U.type,mode:X}),Y&&Y]}),re&&oe&&"edit"===X&&e.jsx(N.default,{position:re,options:[{label:"Change Color to Red",action:()=>se("red")},{label:"Change Color to Blue",action:()=>se("blue")}],onClose:()=>{le(null)}})]})]})};
|
|
2
2
|
//# sourceMappingURL=Editor.js.map
|
package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lexical");class
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lexical");class s extends t.ElementNode{static getType(){return"manual"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("manual");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__manual-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("manual");return t.id=this.__id,t.dataset.status=this.__status,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{manual:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"manual",version:1,id:this.__id,status:this.__status}}canInsertTextBefore(){return"pending"!==this.__status}canInsertTextAfter(){return"pending"!==this.__status}}function e(t){var e;return{node:new s(t.id||crypto.randomUUID(),null!==(e=t.dataset.status)&&void 0!==e?e:"")}}exports.ManualNode=s;
|
|
2
2
|
//# sourceMappingURL=ManualNode.js.map
|
package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lexical");class e extends t.ElementNode{static getType(){return"update"}static clone(t){return new e(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),e="",s){super(s),this.__id=t,this.__status=e}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("upt");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__update-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("upt");return t.id=this.__id,{element:t}}updateDOM(t,e){return t.__id!==this.__id&&(e.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?e.dataset.status=this.__status:delete e.dataset.status,e.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{upt:()=>({conversion:s,priority:1})}}static importJSON(t){var s;return new e(t.id,null!==(s=t.status)&&void 0!==s?s:"")}exportJSON(){return{...super.exportJSON(),type:"update",version:1,id:this.__id,status:this.__status}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lexical");class e extends t.ElementNode{static getType(){return"update"}static clone(t){return new e(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),e="",s){super(s),this.__id=t,this.__status=e}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("upt");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__update-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("upt");return t.id=this.__id,t.dataset.status=this.__status,{element:t}}updateDOM(t,e){return t.__id!==this.__id&&(e.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?e.dataset.status=this.__status:delete e.dataset.status,e.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{upt:()=>({conversion:s,priority:1})}}static importJSON(t){var s;return new e(t.id,null!==(s=t.status)&&void 0!==s?s:"")}exportJSON(){return{...super.exportJSON(),type:"update",version:1,id:this.__id,status:this.__status}}canInsertTextBefore(){return"pending"!==this.__status}canInsertTextAfter(){return"pending"!==this.__status}}function s(t){var s;return{node:new e(t.id||crypto.randomUUID(),null!==(s=t.dataset.status)&&void 0!==s?s:"")}}exports.UpdateNode=e;
|
|
2
2
|
//# sourceMappingURL=UpdateNode.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e='.PlaygroundEditorTheme__ltr{text-align:left}.PlaygroundEditorTheme__rtl{text-align:right}.PlaygroundEditorTheme__paragraph{font-family:Inter,sans-serif;line-height:28px;margin:0 0 8px;position:relative}.PlaygroundEditorTheme__paragraph:last-child{margin-bottom:0}.PlaygroundEditorTheme__quote{border-left:4px solid #ced0d4;color:#65676b;font-size:15px;margin:0 0 10px 20px;padding-left:16px}.PlaygroundEditorTheme__h1{font-family:Inter,sans-serif;font-size:24px;margin:12px 0 4px;padding:0}.PlaygroundEditorTheme__h2{font-size:20px}.PlaygroundEditorTheme__h2,.PlaygroundEditorTheme__h3{font-family:Inter,sans-serif;margin:10px 0 0;padding:0}.PlaygroundEditorTheme__h3{font-size:18px;text-transform:uppercase}.PlaygroundEditorTheme__textBold{font-family:Inter,sans-serif;font-weight:700}.PlaygroundEditorTheme__textItalic{font-style:italic}.PlaygroundEditorTheme__textUnderline{text-decoration:underline}.PlaygroundEditorTheme__textStrikethrough{text-decoration:line-through}.PlaygroundEditorTheme__textUnderlineStrikethrough{text-decoration:underline line-through}.PlaygroundEditorTheme__textSubscript{font-size:.8em;vertical-align:sub!important}.PlaygroundEditorTheme__textSuperscript{font-size:.8em;vertical-align:super}.PlaygroundEditorTheme__textCode{background-color:#f0f2f5;font-family:Menlo,Consolas,Monaco,monospace;font-size:94%;padding:1px .25rem}.PlaygroundEditorTheme__hashtag{background-color:#5890ff26;border-bottom:1px solid #5890ff4d}.PlaygroundEditorTheme__link{color:#216fdb;text-decoration:none}.PlaygroundEditorTheme__link:hover{text-decoration:underline}.PlaygroundEditorTheme__code{background-color:#f0f2f5;display:block;font-family:Menlo,Consolas,Monaco,monospace;font-size:13px;line-height:1.53;margin:8px 0;overflow-x:auto;padding:8px 8px 8px 52px;position:relative;tab-size:2}.PlaygroundEditorTheme__code:before{background-color:#eee;border-right:1px solid #ccc;color:#777;content:attr(data-gutter);left:0;min-width:25px;padding:8px;position:absolute;text-align:right;top:0;white-space:pre-wrap}.PlaygroundEditorTheme__code:after{color:#00000080;content:attr(data-highlight-language);font-size:10px;padding:3px;position:absolute;right:3px;text-transform:uppercase;top:0}.PlaygroundEditorTheme__table{border-collapse:collapse;border-spacing:0;max-width:100%;overflow-y:scroll;table-layout:fixed;width:100%}.PlaygroundEditorTheme__tableCell{border:1px solid #000;min-width:75px;padding:6px 8px;text-align:start;vertical-align:top}.PlaygroundEditorTheme__tableCellHeader{background-color:#f2f3f5;text-align:start}.PlaygroundEditorTheme__characterLimit{background-color:#fbb!important;display:inline}.PlaygroundEditorTheme__ul{list-style-type:disc}.PlaygroundEditorTheme__ol1,.PlaygroundEditorTheme__ul{list-style-position:outside;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol1{list-style-type:decimal}.PlaygroundEditorTheme__ol2{list-style-position:outside;list-style-type:upper-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol3{list-style-position:outside;list-style-type:lower-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol4{list-style-position:outside;list-style-type:upper-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol5{list-style-position:outside;list-style-type:lower-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__listItem{display:list-item;margin:8px 24px 8px 8px;padding:0 8px}.PlaygroundEditorTheme__nestedListItem{list-style-type:inherit;margin-left:16px}ol .PlaygroundEditorTheme__nestedListItem{list-style-type:none}.PlaygroundEditorTheme__listItemChecked,.PlaygroundEditorTheme__listItemUnchecked{list-style-type:none;margin-left:8px;margin-right:8px;outline:none;padding-left:24px;padding-right:24px;position:relative}.PlaygroundEditorTheme__listItemChecked{text-decoration:line-through}.PlaygroundEditorTheme__listItemChecked:before,.PlaygroundEditorTheme__listItemUnchecked:before{background-size:cover;content:"";cursor:pointer;display:block;height:16px;left:0;position:absolute;top:2px;width:16px}.PlaygroundEditorTheme__listItemChecked[dir=rtl]:before,.PlaygroundEditorTheme__listItemUnchecked[dir=rtl]:before{left:auto;right:0}.PlaygroundEditorTheme__listItemChecked:focus:before,.PlaygroundEditorTheme__listItemUnchecked:focus:before{border-radius:2px;box-shadow:0 0 0 2px #a6cdfe}.PlaygroundEditorTheme__tokenComment{color:#708090}.PlaygroundEditorTheme__tokenPunctuation{color:#999}.PlaygroundEditorTheme__tokenProperty{color:#905}.PlaygroundEditorTheme__tokenSelector{color:#690}.PlaygroundEditorTheme__tokenOperator{color:#9a6e3a}.PlaygroundEditorTheme__tokenAttr{color:#07a}.PlaygroundEditorTheme__tokenVariable{color:#e90}.PlaygroundEditorTheme__tokenFunction{color:#dd4a68}.PlaygroundEditorTheme__mark{background:#ffd40024;border-bottom:2px solid #ffd4004d;padding-bottom:2px}.PlaygroundEditorTheme__markOverlap{background:#ffd4004d;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__mark.selected{background:#ffd40080;border-bottom:2px solid #ffd400}.PlaygroundEditorTheme__markOverlap.selected{background:#ffd400b3;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__embedBlock{user-select:none}.PlaygroundEditorTheme__embedBlockFocus{outline:2px solid #3c84f4}.PlaygroundEditorTheme__highlight-button{display:none}.PlaygroundEditorTheme__insert-node{background-color:#8cbeff;text-decoration:none}.PlaygroundEditorTheme__delete-node{text-decoration:line-through;text-decoration-color:#dc2626}[class^=PlaygroundEditorTheme__update-node]>.PlaygroundEditorTheme__insert-node{background-color:#f3e8ff}.PlaygroundEditorTheme__manual-node-accepted,[class^=PlaygroundEditorTheme__manual-node]>.PlaygroundEditorTheme__insert-node{background-color:#8cbeff}.PlaygroundEditorTheme__manual-node-rejected{text-decoration:underline;text-decoration-color:red}.PlaygroundEditorTheme__update-node-accepted{background-color:#f3e8ff;-webkit-box-decoration-break:clone;box-decoration-break:clone;display:inline}';!function(){if("undefined"==typeof document)return;const o=document.createElement("style");o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(e));const r=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r&&r.appendChild(o)}(),exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e='.PlaygroundEditorTheme__ltr{text-align:left}.PlaygroundEditorTheme__rtl{text-align:right}.PlaygroundEditorTheme__paragraph{font-family:Inter,sans-serif;line-height:28px;margin:0 0 8px;position:relative}.PlaygroundEditorTheme__paragraph:last-child{margin-bottom:0}.PlaygroundEditorTheme__quote{border-left:4px solid #ced0d4;color:#65676b;font-size:15px;margin:0 0 10px 20px;padding-left:16px}.PlaygroundEditorTheme__h1{font-family:Inter,sans-serif;font-size:24px;margin:12px 0 4px;padding:0}.PlaygroundEditorTheme__h2{font-size:20px}.PlaygroundEditorTheme__h2,.PlaygroundEditorTheme__h3{font-family:Inter,sans-serif;margin:10px 0 0;padding:0}.PlaygroundEditorTheme__h3{font-size:18px;text-transform:uppercase}.PlaygroundEditorTheme__textBold{font-family:Inter,sans-serif;font-weight:700}.PlaygroundEditorTheme__textItalic{font-style:italic}.PlaygroundEditorTheme__textUnderline{text-decoration:underline}.PlaygroundEditorTheme__textStrikethrough{text-decoration:line-through}.PlaygroundEditorTheme__textUnderlineStrikethrough{text-decoration:underline line-through}.PlaygroundEditorTheme__textSubscript{font-size:.8em;vertical-align:sub!important}.PlaygroundEditorTheme__textSuperscript{font-size:.8em;vertical-align:super}.PlaygroundEditorTheme__textCode{background-color:#f0f2f5;font-family:Menlo,Consolas,Monaco,monospace;font-size:94%;padding:1px .25rem}.PlaygroundEditorTheme__hashtag{background-color:#5890ff26;border-bottom:1px solid #5890ff4d}.PlaygroundEditorTheme__link{color:#216fdb;text-decoration:none}.PlaygroundEditorTheme__link:hover{text-decoration:underline}.PlaygroundEditorTheme__code{background-color:#f0f2f5;display:block;font-family:Menlo,Consolas,Monaco,monospace;font-size:13px;line-height:1.53;margin:8px 0;overflow-x:auto;padding:8px 8px 8px 52px;position:relative;tab-size:2}.PlaygroundEditorTheme__code:before{background-color:#eee;border-right:1px solid #ccc;color:#777;content:attr(data-gutter);left:0;min-width:25px;padding:8px;position:absolute;text-align:right;top:0;white-space:pre-wrap}.PlaygroundEditorTheme__code:after{color:#00000080;content:attr(data-highlight-language);font-size:10px;padding:3px;position:absolute;right:3px;text-transform:uppercase;top:0}.PlaygroundEditorTheme__table{border-collapse:collapse;border-spacing:0;max-width:100%;overflow-y:scroll;table-layout:fixed;width:100%}.PlaygroundEditorTheme__tableCell{border:1px solid #000;min-width:75px;padding:6px 8px;text-align:start;vertical-align:top}.PlaygroundEditorTheme__tableCellHeader{background-color:#f2f3f5;text-align:start}.PlaygroundEditorTheme__characterLimit{background-color:#fbb!important;display:inline}.PlaygroundEditorTheme__ul{list-style-type:disc}.PlaygroundEditorTheme__ol1,.PlaygroundEditorTheme__ul{list-style-position:outside;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol1{list-style-type:decimal}.PlaygroundEditorTheme__ol2{list-style-position:outside;list-style-type:upper-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol3{list-style-position:outside;list-style-type:lower-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol4{list-style-position:outside;list-style-type:upper-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol5{list-style-position:outside;list-style-type:lower-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__listItem{display:list-item;margin:8px 24px 8px 8px;padding:0 8px}.PlaygroundEditorTheme__nestedListItem{list-style-type:inherit;margin-left:16px}ol .PlaygroundEditorTheme__nestedListItem{list-style-type:none}.PlaygroundEditorTheme__listItemChecked,.PlaygroundEditorTheme__listItemUnchecked{list-style-type:none;margin-left:8px;margin-right:8px;outline:none;padding-left:24px;padding-right:24px;position:relative}.PlaygroundEditorTheme__listItemChecked{text-decoration:line-through}.PlaygroundEditorTheme__listItemChecked:before,.PlaygroundEditorTheme__listItemUnchecked:before{background-size:cover;content:"";cursor:pointer;display:block;height:16px;left:0;position:absolute;top:2px;width:16px}.PlaygroundEditorTheme__listItemChecked[dir=rtl]:before,.PlaygroundEditorTheme__listItemUnchecked[dir=rtl]:before{left:auto;right:0}.PlaygroundEditorTheme__listItemChecked:focus:before,.PlaygroundEditorTheme__listItemUnchecked:focus:before{border-radius:2px;box-shadow:0 0 0 2px #a6cdfe}.PlaygroundEditorTheme__tokenComment{color:#708090}.PlaygroundEditorTheme__tokenPunctuation{color:#999}.PlaygroundEditorTheme__tokenProperty{color:#905}.PlaygroundEditorTheme__tokenSelector{color:#690}.PlaygroundEditorTheme__tokenOperator{color:#9a6e3a}.PlaygroundEditorTheme__tokenAttr{color:#07a}.PlaygroundEditorTheme__tokenVariable{color:#e90}.PlaygroundEditorTheme__tokenFunction{color:#dd4a68}.PlaygroundEditorTheme__mark{background:#ffd40024;border-bottom:2px solid #ffd4004d;padding-bottom:2px}.PlaygroundEditorTheme__markOverlap{background:#ffd4004d;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__mark.selected{background:#ffd40080;border-bottom:2px solid #ffd400}.PlaygroundEditorTheme__markOverlap.selected{background:#ffd400b3;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__embedBlock{user-select:none}.PlaygroundEditorTheme__embedBlockFocus{outline:2px solid #3c84f4}.PlaygroundEditorTheme__highlight-button{display:none}.PlaygroundEditorTheme__insert-node{background-color:#8cbeff;text-decoration:none}.PlaygroundEditorTheme__delete-node{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}[class^=PlaygroundEditorTheme__update-node]>.PlaygroundEditorTheme__insert-node{background-color:#f3e8ff}.PlaygroundEditorTheme__manual-node-accepted,[class^=PlaygroundEditorTheme__manual-node]>.PlaygroundEditorTheme__insert-node{background-color:#8cbeff}.PlaygroundEditorTheme__manual-node-rejected{background-color:#fff;text-decoration:underline;text-decoration-color:red}.PlaygroundEditorTheme__update-node-accepted{background-color:#f3e8ff;-webkit-box-decoration-break:clone;box-decoration-break:clone;display:inline}';!function(){if("undefined"==typeof document)return;const o=document.createElement("style");o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(e));const r=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r&&r.appendChild(o)}(),exports.default=e;
|
|
2
2
|
//# sourceMappingURL=theme.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Editor/constants/editorConfig.js"),n=require("./Editor/Editor.js"),o=require("../../store/ref.context.js"),a=require("@lexical/html"),l=require("turndown"),i=require("turndown-plugin-gfm"),u=require("../UnsavedChangesPopup/UnsavedChangesPopup.js"),s=require("../../../../utils/tagHelper.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=new(c(l).default)({headingStyle:"atx",codeBlockStyle:"fenced"});d.keep(["ins","del","mark"]),d.keep(e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r}),d.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),d.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),d.use(i.tables);const h=e=>(e||"").replace(/\r\n/g,"\n").trim(),p=t.forwardRef(({type:l,value:i,handleUpdateState:c,onBlur:p,placeholder:f,minHeight:g,height:E,mode:m,doNotShowBorderInViewMode:v,onEditBlocked:S,onSaveUnsavedChanges:A,onDiscardUnsavedChanges:y,isSavingUnsavedChanges:$=!1},b)=>{const w=t.useRef(null),[x,q]=t.useState({type:l,value:i}),[C,N]=t.useState(0),[R,T]=t.useState(!1),B=t.useRef(i),j=t.useRef(i),I=t.useRef(Boolean(i)),{contentRef:L,setContentRef:_}=o.useRefStore();t.useEffect(()=>{q(e=>({...e,value:i})),B.current=i,j.current=i,I.current=Boolean(i),T(!1)},[i]),t.useImperativeHandle(b,()=>({requestClose:()=>!("edit"===m&&h(B.current)!==h(j.current))||(T(!0),!1)}),[m]);return t.useEffect(()=>{const e=()=>{L&&L.current&&N(L.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[L]),e.jsxs("div",{style:{position:"relative",width:"100%",height:E,minHeight:g},children:[R&&e.jsx(u.UnsavedChangesPopup,{isSaving:$,onSave:async()=>{await(null==A?void 0:A()),B.current=j.current,T(!1)},onDiscard:()=>{j.current=B.current,null==y||y(),T(!1)}}),e.jsx(n.default,{minHeight:g,height:E,placeholder:f||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=a.$generateHtmlFromNodes(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const n=["upt","manual","ins","del","preserved"];function o(e,t){const r=e.cloneNode(!0),a=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${a.size}%%`;a.set(n,o(e,t)),e.replaceWith(n)});let l=t.turndown(r.innerHTML);a.forEach((e,t)=>{l=l.replace(t,e)});const i=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),u=e.tagName.toLowerCase();return i?`<${u} ${i}>${l}</${u}>`:`<${u}>${l}</${u}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const l=[];r.querySelectorAll("invisible").forEach((e,t)=>{l.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const i=[];r.querySelectorAll(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Editor/constants/editorConfig.js"),n=require("./Editor/Editor.js"),o=require("../../store/ref.context.js"),a=require("@lexical/html"),l=require("turndown"),i=require("turndown-plugin-gfm"),u=require("../UnsavedChangesPopup/UnsavedChangesPopup.js"),s=require("../../../../utils/tagHelper.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=new(c(l).default)({headingStyle:"atx",codeBlockStyle:"fenced"});d.keep(["ins","del","mark"]),d.keep(e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r}),d.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),d.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),d.use(i.tables);const h=e=>(e||"").replace(/\r\n/g,"\n").trim(),p=t.forwardRef(({type:l,value:i,handleUpdateState:c,onBlur:p,placeholder:f,minHeight:g,height:E,mode:m,doNotShowBorderInViewMode:v,onEditBlocked:S,onSaveUnsavedChanges:A,onDiscardUnsavedChanges:y,isSavingUnsavedChanges:$=!1},b)=>{const w=t.useRef(null),[x,q]=t.useState({type:l,value:i}),[C,N]=t.useState(0),[R,T]=t.useState(!1),B=t.useRef(i),j=t.useRef(i),I=t.useRef(Boolean(i)),{contentRef:L,setContentRef:_}=o.useRefStore();t.useEffect(()=>{q(e=>({...e,value:i})),B.current=i,j.current=i,I.current=Boolean(i),T(!1)},[i]),t.useImperativeHandle(b,()=>({requestClose:()=>!("edit"===m&&h(B.current)!==h(j.current))||(T(!0),!1)}),[m]);return t.useEffect(()=>{const e=()=>{L&&L.current&&N(L.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[L]),e.jsxs("div",{style:{position:"relative",width:"100%",height:E,minHeight:g},children:[R&&e.jsx(u.UnsavedChangesPopup,{isSaving:$,onSave:async()=>{await(null==A?void 0:A()),B.current=j.current,T(!1)},onDiscard:()=>{j.current=B.current,null==y||y(),T(!1)}}),e.jsx(n.default,{minHeight:g,height:E,placeholder:f||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=a.$generateHtmlFromNodes(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const n=["upt","manual","ins","del","preserved"];function o(e,t){const r=e.cloneNode(!0),a=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${a.size}%%`;a.set(n,o(e,t)),e.replaceWith(n)});let l=t.turndown(r.innerHTML);a.forEach((e,t)=>{l=l.replace(t,e)});const i=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),u=e.tagName.toLowerCase();return i?`<${u} ${i}>${l}</${u}>`:`<${u}>${l}</${u}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const l=[];r.querySelectorAll("invisible").forEach((e,t)=>{l.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const i=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{i.push(o(e,d)),e.replaceWith(r.createTextNode(`%%REVIEW_${i.length-1}%%`))})});const u=[];r.querySelectorAll("table").forEach((e,t)=>{u.push(e.outerHTML);const n=r.createElement("p");n.textContent=`%%TABLE_${t}%%`,e.replaceWith(n)});let h=d.turndown(r.body.innerHTML);for(let e=i.length-1;e>=0;e--)h=h.replace(`%%REVIEW\\_${e}%%`,` ${i[e]} `);l.forEach((e,t)=>{h=h.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),u.forEach((e,t)=>{h=h.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),h=h.replace(/\*{4}([^*]+)\*{4}/g,"**$1**");["upt","manual","del","ins","preserved"].forEach(e=>{h=s.mergeTagAcrossParagraphs(h,e)}),h=s.unescapeTagIds(h,["manual","upt"]),I.current&&(B.current=h,I.current=!1),j.current=h,((e,t)=>{c(e,t)})("prompt",h)})},toolbarConfig:r.DEFAULT_TOOLBAR_CONFIG,editorRef:w,mode:m,initialString:{type:x.type,value:x.value},dynamicHeight:C,onBlur:p,doNotShowBorderInViewMode:v||!1,onEditBlocked:S})]})});p.displayName="RichTextEditor",exports.default=p;
|
|
2
2
|
//# sourceMappingURL=RichTextEditor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),i=require("../Popups/PopupDefaults.js"),t=require("react-markdown"),c=require("rehype-raw"),n=require("./CitationComponent.module.css.js"),l=require("lucide-react"),s=require("../icons/cognitiveBrain.svg.js"),d=require("../icons/aiMagic.svg.js"),r=require("./CitationAnchor.js"),o=require("../../../../../service/redlineService.js"),u=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=m(a),f=m(t),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),i=require("../Popups/PopupDefaults.js"),t=require("react-markdown"),c=require("rehype-raw"),n=require("./CitationComponent.module.css.js"),l=require("lucide-react"),s=require("../icons/cognitiveBrain.svg.js"),d=require("../icons/aiMagic.svg.js"),r=require("./CitationAnchor.js"),o=require("../../../../../service/redlineService.js"),u=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=m(a),f=m(t),p=m(c);const _=({text:a,item:i})=>e.jsx(f.default,{rehypePlugins:[p.default],components:{ol:({children:a})=>e.jsx("ol",{className:n.default["md-ol"],children:a}),ul:({children:a})=>e.jsx("ul",{className:n.default["md-ul"],children:a}),li:({children:a})=>e.jsx("li",{className:n.default["md-li"],children:a}),a:({node:a,href:t,children:c})=>e.jsx(r.default,{href:t,children:c,metaData:{citations:i.citations,docData:i.docData}})},children:a.replace(/<br\s*\/?>/gi,"\n")});var j=a.memo(function({item:t,title:c="Cognitive Decisioning AI",relevanceScore:r=0,showRelevanceScore:m=!0,reason:f="No reasoning provided.",impact:p="No Impact provided.",explaination:j="No explaination provided.",gap:h="None",onClose:v=()=>{},onActionTrigger:N,showResolveBtns:b=!1,sections:y,leftIcon:g,scoreIcon:I,className:C,customStyles:A={},actions:k,disableAllActions:R=!1,actionBtnDisabledStyle:q={},onBackClick:B,isImpactNeeded:D=!0,cognitiveTitle:H="Cognitive Integrity",labels:$={},redlineId:T,aiReasonId:w}){const L=a.useMemo(()=>{const e=Number(r);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[r]),M=a.useMemo(()=>{const e=$&&$.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a})(h)?e:h},[h]),P=$&&$.impact||"Impact",S=$&&$.explanation||"Explaination",E=$&&$.decisionFactors||"Decision Making Factors",U=$&&$.gaps||"Gaps in Decision",F=$&&$.accept||"Accept",G=$&&$.reject||"Reject",W=$&&$.backAriaLabel||"Go back",{redlineDcoumentId:O,redlineConfig:z,updateRedlineDataParent:J}=u.useRequirementAI(),K=async e=>{var a,i;null==N||N({status:"loading",action:e,metadata:{redlineId:T,aiReasonId:w}});try{const{updated_reqai:t}=await o.resolveRedline({documentId:O,userEmail:null==z?void 0:z.userEmail,userName:null==z?void 0:z.userName,redlineId:null!=T?T:"",action:e,baseApiUrl:null==z?void 0:z.baseApiUrl,redlineConfigId:null!==(a=null==z?void 0:z.redlineConfigId)&&void 0!==a?a:""},null!==(i=null==z?void 0:z.token)&&void 0!==i?i:"");await(null==J?void 0:J(t)),null==N||N({status:"success",action:e,metadata:{redlineId:T,aiReasonId:w}})}catch(a){null==N||N({status:"failed",action:e,metadata:{redlineId:T,aiReasonId:w}})}},Q=k||[{id:"reject",label:G,onClick:()=>K("reject"),className:n.default["btn-reject"]},{id:"accept",label:F,onClick:()=>K("accept"),className:n.default["btn-accept"]}];return e.jsxs("div",{className:`${n.default["cite-acc"]} ${C||""}`,style:{...i.default.CitationAccordionDefaults.container,...null==A?void 0:A.container},children:[B&&e.jsxs("div",{className:n.default["cite-acc__backHeader"],children:[e.jsx("button",{type:"button",className:n.default["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),B&&B()},"aria-label":W,children:"‹"}),e.jsx("span",{className:n.default["cite-acc__backTitle"],children:H})]}),e.jsx("div",{className:n.default["cite-body"],children:y&&y.length>0?y.map(a=>!1===a.show?null:e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],style:{...i.default.CitationAccordionDefaults.innerHeader,...null==A?void 0:A.innerHeader},children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:a.title})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),v&&v()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...i.default.CitationAccordionDefaults.innerBody,...null==A?void 0:A.innerBody},children:"string"==typeof a.content?e.jsx(_,{text:a.content,item:a.item||t||{}}):a.content})]},a.id||a.title)):e.jsxs(e.Fragment,{children:[D&&e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:P})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),v&&v()},children:e.jsx(l.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(_,{text:p||"",item:t||{}})})]}),e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:S})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(_,{text:j||"",item:{}})})]}),b&&e.jsx("div",{className:n.default["cite-acc__btn-container"],children:Q.map(a=>{const i=R||a.disabled;return e.jsx("button",{className:a.className,onClick:i?void 0:a.onClick,disabled:i,style:{...a.style,...i?{opacity:.5,cursor:"not-allowed",...q,...a.disabledStyle}:{}},children:a.label},a.id)})}),e.jsxs("div",{className:n.default["cite-acc__header"],children:[e.jsxs("div",{className:n.default["cite-acc__headerLeft"],children:[e.jsx("span",{className:n.default["cite-acc__titleIcon"],children:g?"function"==typeof g?x.default.createElement(g):g:e.jsx(s.ReactComponent,{})}),e.jsx("div",{className:n.default["cite-acc__title"],children:c})]}),e.jsx("div",{className:n.default["cite-acc__headerRight"],children:m&&e.jsxs("span",{className:n.default["cite-acc__scoreBadge"],children:[I?"function"==typeof I?x.default.createElement(I):I:e.jsx(d.ReactComponent,{}),e.jsxs("span",{className:n.default["cite-acc__scoreText"],children:[L,"%"]})]})})]}),e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:E})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(_,{text:f||"",item:t||{}})})]}),e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${n.default["cite-acc__explain-body_border"]}`,children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:U})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(_,{text:M||"",item:t||{}})})]})]})})]})},(e,a)=>e.disableAllActions===a.disableAllActions&&(e.redlineId===a.redlineId&&(e.aiReasonId===a.aiReasonId&&(e.relevanceScore===a.relevanceScore&&(e.reason===a.reason&&(e.impact===a.impact&&(e.explaination===a.explaination&&e.gap===a.gap)))))));exports.default=j;
|
|
2
2
|
//# sourceMappingURL=CognitiveComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),n=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),s=require("@mui/material"),r=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),a=require("../../../../../service/redlineService.js"),d=require("../../ai-reasoning/AiReasonMarkdownWrapper.js");const c=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],p=({toneIndex:i,configs:n=c})=>{const o=Math.min(i,n.length-1),{color:t,angle:l,arcD:s}=n[o]||n[1]||n[0],r=(l-90)*Math.PI/180,a=11+9*Math.cos(r),d=13+9*Math.sin(r);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:s,stroke:t,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:a,y2:d,stroke:t,strokeWidth:"2",strokeLinecap:"round"})]})},x=({type:i,customStyles:n={}})=>{const o={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...n},t=o[i]||o.Medium;return e.jsx("div",{style:t,children:i})},u=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},v={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},m={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},y={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},h={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},f={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},j={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},C={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},b={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},I={display:"flex",gap:8,marginBottom:18},k={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},w={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},B={borderTop:"0.5px solid #eee",padding:"14px 0px"},T={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},A={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},R={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},D={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},E={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},z={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},W={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},L={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},M={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0};function H({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:t,historyIconSmall:l,onHistoryClick:s,historyTootipTitle:r}){const a="20px";return e.jsxs("div",{style:{...M,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:a,height:a,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),n&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>n(e),children:[o&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:a,height:a,flexShrink:0},children:o}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),s&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>s(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:a,height:a,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]})]})}function _({onAssignClick:i,onOpenCognitive:o,cognitiveIconSmall:t,cognitiveTootipTitle:l,historyIconSmall:s,onHistoryClick:r,historyTootipTitle:a}){const[d,c]=n.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!d),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),d&&e.jsx(H,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:o?e=>{c(!1),o&&o(e)}:void 0,cognitiveIconSmall:t,cognitiveTootipTitle:l,historyIconSmall:s,onHistoryClick:r,historyTootipTitle:a})]})}function q({users:i,onClick:n}){const o=i.length;return e.jsxs("div",{onClick:n,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),o>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",o-1]})]})}exports.AssignMenu=H,exports.DisplayUsers=q,exports.KebabMenu=_,exports.default=function({onClose:M,aiReason:H,onActionTrigger:F,onIterate:N,initialTone:O,onRegenerate:P,labels:U={},toneLevelsConfig:$=u,toneColorsConfig:G=g,dialConfigs:K=c,actions:V,disableAllActions:X=!1,customStyles:J={},severityChipStyles:Q={},customIcons:Y={},onOpenCognitive:Z,onHistoryClick:ee,historyIconSmall:ie,historyTootipTitle:ne,showTone:oe=!0,cognitiveSectionStyle:te={},cognitiveScoreBadgeStyle:le={},cognitiveScoreTextStyle:se={},cognitiveStyles:re={},cognitiveClassNames:ae={},cognitiveTitle:de="Cognitive Integrity",cognitiveTootipTitle:ce="Cognitive Decisioning",cognitiveLeftIcon:pe,cognitiveIconSmall:xe,showCognitiveRightArrow:ue=!0,isStreaming:ge,onAssignClick:ve,assignedUsers:me,onReviewUsersClick:ye,redlineId:he,aiReasonId:fe}){var je,Se,Ce,be,Ie,ke,we,Be,Te,Ae,Re,De,Ee,ze,We,Le,Me,He,_e;let qe=$.findIndex(e=>e===O);-1===qe&&(qe=1);const[Fe,Ne]=n.useState(!0),[Oe,Pe]=n.useState(!1),[Ue,$e]=n.useState(!1),[Ge,Ke]=n.useState(qe),[Ve]=n.useState(qe),Xe=$[Ge],Je=G[Xe]||"#BA7517",Qe=Ge!==Ve,Ye=[{id:"iterate",icon:Y.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:U.btnIterate||"Iterate",color:"#64748B",onClick:N},{id:"accept",icon:Y.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:U.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:Y.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:U.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:Ze,redlineConfig:ei,updateRedlineDataParent:ii}=r.useRequirementAI(),ni=V||Ye;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...v,...null===(je=null==J?void 0:J.DeviationSummaryStyles)||void 0===je?void 0:je.root},children:[e.jsxs("div",{style:{...m,...null===(Se=null==J?void 0:J.DeviationSummaryStyles)||void 0===Se?void 0:Se.header,marginBottom:Ue?"16px":"12px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:Y.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...y,...null===(Ce=null==J?void 0:J.DeviationSummaryStyles)||void 0===Ce?void 0:Ce.title},children:U.summaryHeader||"Summary"})]}),me&&me.length>0&&e.jsx(q,{users:me,onClick:e=>{e.stopPropagation(),null==ye||ye()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(ve||Z)&&e.jsx(_,{onAssignClick:ve,onOpenCognitive:Z,cognitiveIconSmall:xe,cognitiveTootipTitle:ce,historyIconSmall:ie,onHistoryClick:ee,historyTootipTitle:ne}),e.jsx("button",{onClick:M,style:{...w,...null===(be=null==J?void 0:J.DeviationSummaryStyles)||void 0===be?void 0:be.closeBtn,color:"#64748B"},children:"✕"})]})]}),e.jsx(s.Tooltip,{title:null===(Ie=null==H?void 0:H.redlining_details)||void 0===Ie?void 0:Ie.redline_title,children:e.jsx("p",{style:{...h,...null===(ke=null==J?void 0:J.DeviationSummaryStyles)||void 0===ke?void 0:ke.bodyText},children:null===(we=null==H?void 0:H.redlining_details)||void 0===we?void 0:we.redline_title})}),e.jsx("p",{style:{...f,...null===(Be=null==J?void 0:J.DeviationSummaryStyles)||void 0===Be?void 0:Be.summary},children:null===(Te=null==H?void 0:H.redlining_details)||void 0===Te?void 0:Te.redline_summary}),e.jsxs("div",{style:{...j,...null===(Ae=null==J?void 0:J.DeviationSummaryStyles)||void 0===Ae?void 0:Ae.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>Ne(!Fe),style:{...C,...null===(Re=null==J?void 0:J.DeviationSummaryStyles)||void 0===Re?void 0:Re.impactToggle},children:[e.jsx("span",{style:{...b,...null===(De=null==J?void 0:J.DeviationSummaryStyles)||void 0===De?void 0:De.impactToggleLabel},children:U.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Fe?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(x,{type:(null==H?void 0:H.severity)||"Medium",customStyles:Q})]}),Fe&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...S,...null===(Ee=null==J?void 0:J.DeviationSummaryStyles)||void 0===Ee?void 0:Ee.impactText},children:e.jsx(d.AiReasonMarkdownWrapper,{message:`${null!==(We=null===(ze=null==H?void 0:H.redlining_details)||void 0===ze?void 0:ze.redline_impact)&&void 0!==We?We:U.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Le=null==J?void 0:J.DeviationSummaryStyles)||void 0===Le?void 0:Le.impactMarkdown})})})]}),e.jsx("div",{style:{...I,...null===(Me=null==J?void 0:J.DeviationSummaryStyles)||void 0===Me?void 0:Me.actionContainer},children:ni.map(i=>{var n,o;const t=X||i.disabled,l=t?{cursor:"not-allowed",opacity:.5,...null===(n=null==J?void 0:J.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...k,...null===(o=null==J?void 0:J.DeviationSummaryStyles)||void 0===o?void 0:o.actionBtn,color:i.color,...i.style,...l},onClick:t?void 0:()=>{var e;i.useLabel?(async e=>{var i,n,o;null==F||F({status:"loading",action:e,metadata:{redlineId:he,aiReasonId:fe}});try{const{updated_reqai:t}=await a.resolveRedline({documentId:Ze,userEmail:null==ei?void 0:ei.userEmail,userName:null==ei?void 0:ei.userName,redlineId:null!==(i=null==H?void 0:H.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==ei?void 0:ei.baseApiUrl,redlineConfigId:null!==(n=null==ei?void 0:ei.redlineConfigId)&&void 0!==n?n:""},null!==(o=null==ei?void 0:ei.token)&&void 0!==o?o:"");await(null==ii?void 0:ii(t)),null==F||F({status:"success",action:e,metadata:{redlineId:he,aiReasonId:fe}})}catch(e){null==F||F({status:"failed",action:null,metadata:{redlineId:he,aiReasonId:fe}})}})(i.id.toLowerCase()):null===(e=i.onClick)||void 0===e||e.call(i)},disabled:t,children:[i.icon,i.label]},i.id)})}),oe&&e.jsxs("div",{style:{...B,...null===(He=null==J?void 0:J.DeviationSummaryStyles)||void 0===He?void 0:He.toneContainer},children:[e.jsxs("button",{onClick:()=>Pe(!Oe),style:{...T,...null===(_e=null==J?void 0:J.DeviationSummaryStyles)||void 0===_e?void 0:_e.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(p,{toneIndex:Ge,configs:K}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:U.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Oe?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),Oe&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:U.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(o.ToneToggle,{isDirty:Qe,onToneChange:e=>{Ke(e)},toneColor:Je,toneIndex:Ge,onClickRegenerate:()=>null==P?void 0:P(Xe),toneLabels:$,isStreaming:ge,aiReason:H})]})]}),Z&&e.jsxs("div",{className:null==ae?void 0:ae.section,onClick:e=>{e.stopPropagation(),Z&&Z(e)},style:{...A,...null==re?void 0:re.section,...te},children:[e.jsxs("div",{className:null==ae?void 0:ae.headerLeft,style:{...R,...null==re?void 0:re.headerLeft},children:[e.jsx("span",{className:null==ae?void 0:ae.titleIcon,style:{...D,...null==re?void 0:re.titleIcon},children:null!=pe?pe:e.jsx(t.ReactComponent,{})}),e.jsx("div",{className:null==ae?void 0:ae.cognitiveTitle,style:{...E,...null==re?void 0:re.cognitiveTitle},children:de})]}),e.jsxs("div",{className:null==ae?void 0:ae.headerRight,style:{...z,...null==re?void 0:re.headerRight},children:[void 0!==(null==H?void 0:H.relevance_score)&&null!==(null==H?void 0:H.relevance_score)?e.jsxs("span",{className:null==ae?void 0:ae.scoreBadge,style:{...W,...null==re?void 0:re.scoreBadge,...le},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ae?void 0:ae.scoreText,style:{...L,...null==re?void 0:re.scoreText,...se},children:[Math.round(Number(H.relevance_score)),"%"]})]}):null,ue&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),t=require("react"),n=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var o=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),r=require("@mui/material"),s=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../../../../../service/redlineService.js"),a=require("../../ai-reasoning/AiReasonMarkdownWrapper.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=c(t);const x=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],g=({toneIndex:i,configs:t=x})=>{const n=Math.min(i,t.length-1),{color:o,angle:l,arcD:r}=t[n]||t[1]||t[0],s=(l-90)*Math.PI/180,d=11+9*Math.cos(s),a=13+9*Math.sin(s);return e.jsxs("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:r,stroke:o,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:"11",y1:"13",x2:d,y2:a,stroke:o,strokeWidth:"2",strokeLinecap:"round"})]})},u=({type:i,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[i]||n.Medium;return e.jsx("div",{style:o,children:i})},h=["Lenient","Balanced","Aggressive"],v={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},m={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},y={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},f={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},j={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},w={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},S={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},b={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},C={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},k={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},I={display:"flex",gap:8,marginBottom:18},T={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},B={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},A={borderTop:"0.5px solid #eee",padding:"14px 0px"},E={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},R={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},W={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},L={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},F={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},z={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},M={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},H={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},_=t.memo(function({onAssignClick:i,onOpenCognitive:t,cognitiveIconSmall:n,cognitiveTootipTitle:o,historyIconSmall:l,onHistoryClick:r,historyTootipTitle:s}){const d="20px";return e.jsxs("div",{style:{...H,minWidth:"200px"},children:[e.jsxs("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:i,children:[e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"})]})}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),t&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>t(e),children:[n&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:n}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),r&&e.jsxs("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>r(e),children:[l&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:d,height:d,flexShrink:0},children:l}),e.jsx("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s})]})]})}),O=t.memo(function({onAssignClick:i,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d}){const[a,c]=t.useState(!1);return e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsx("button",{onClick:()=>c(!a),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),a&&e.jsx(_,{onAssignClick:i?()=>{c(!1),i&&i()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:s,historyTootipTitle:d})]})}),q=t.memo(function({users:i,onClick:t}){const n=i.length;return e.jsxs("div",{onClick:t,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e.jsx("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==i?void 0:i[0].length)>9?(null==i?void 0:i[0].slice(0,9))+"...":null==i?void 0:i[0]}),n>1&&e.jsxs("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",n-1]})]})}),P=t.memo(function({steps:i}){if(!(null==i?void 0:i.length))return null;const t=i.length>=3;return e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e.jsx("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:t?"6px 8px":"8px 10px",background:"#F8FAFC",gap:t?4:8,overflow:"hidden"},children:i.map((n,o)=>{const l=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(o),r=o===i.length-1;return e.jsxs(p.default.Fragment,{children:[e.jsxs("div",{title:n.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:t?4:6,overflow:"hidden"},children:[(s=n.status,"approved"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===s?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m15 9-6 6"}),e.jsx("path",{d:"m9 9 6 6"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"16",height:t?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),e.jsx("span",{style:{minWidth:0,color:"#475569",fontSize:t?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),n.initials&&e.jsx("span",{style:{width:t?20:22,height:t?20:22,minWidth:t?20:22,borderRadius:"50%",background:l.bg,color:l.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:t?9:10,fontWeight:700,lineHeight:1},children:n.initials})]}),!r&&e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t?"14":"18",height:t?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:t?14:18},children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"m12 5 7 7-7 7"})]})]},n.id);var s})})})});var N=t.memo(function({onClose:c,aiReason:p,onActionTrigger:H,onIterate:_,initialTone:N,onRegenerate:$,labels:V={},toneLevelsConfig:U=h,toneColorsConfig:G=v,dialConfigs:K=x,actions:X,disableAllActions:J=!1,customStyles:Q={},severityChipStyles:Y={},customIcons:Z={},onOpenCognitive:ee,onHistoryClick:ie,historyIconSmall:te,historyTootipTitle:ne,showTone:oe=!0,cognitiveSectionStyle:le={},cognitiveScoreBadgeStyle:re={},cognitiveScoreTextStyle:se={},cognitiveStyles:de={},cognitiveClassNames:ae={},cognitiveTitle:ce="Cognitive Integrity",cognitiveTootipTitle:pe="Cognitive Decisioning",cognitiveLeftIcon:xe,cognitiveIconSmall:ge,showCognitiveRightArrow:ue=!0,isStreaming:he,onAssignClick:ve,assignedUsers:me,onReviewUsersClick:ye,redlineId:fe,aiReasonId:je,displayVariant:we="default",reviewTitle:Se,reviewSubtitle:be,reviewStatusIcon:Ce=e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[e.jsx("path",{d:"M5 22h14"}),e.jsx("path",{d:"M5 2h14"}),e.jsx("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),e.jsx("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:ke=[],showReviewProgress:Ie=!1,showOriginalText:Te=!1,originalText:Be,originalTextHeader:Ae="Original text",hideSummaryText:Ee=!1,hideSeverityChip:Re=!1}){var We,Le,De,Fe,ze,Me,He,_e,Oe,qe,Pe,Ne,$e,Ve,Ue,Ge,Ke,Xe,Je,Qe;let Ye=U.findIndex(e=>e===N);-1===Ye&&(Ye=1);const[Ze,ei]=t.useState(!0),[ii,ti]=t.useState(!1),[ni,oi]=t.useState(!1),[li,ri]=t.useState(Ye),[si]=t.useState(Ye),[di,ai]=t.useState(!0),ci="review"===we,pi=U[li],xi=G[pi]||"#BA7517",gi=li!==si,ui=[{id:"iterate",icon:Z.iterateIcon||e.jsx(i.PenLine,{size:16,color:"#64748B"}),label:V.btnIterate||"Iterate",color:"#64748B",onClick:_},{id:"accept",icon:Z.acceptIcon||e.jsx(i.CheckCircle,{size:16,color:"#10B981"}),label:V.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:Z.rejectIcon||e.jsx(i.XCircle,{size:16,color:"#DC2626"}),label:V.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:hi,redlineConfig:vi,updateRedlineDataParent:mi}=s.useRequirementAI(),yi=async e=>{var i,t,n;null==H||H({status:"loading",action:e,metadata:{redlineId:fe,aiReasonId:je}});try{const{updated_reqai:o}=await d.resolveRedline({documentId:hi,userEmail:null==vi?void 0:vi.userEmail,userName:null==vi?void 0:vi.userName,redlineId:null!==(i=null==p?void 0:p.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==vi?void 0:vi.baseApiUrl,redlineConfigId:null!==(t=null==vi?void 0:vi.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==vi?void 0:vi.token)&&void 0!==n?n:"");await(null==mi?void 0:mi(o)),null==H||H({status:"success",action:e,metadata:{redlineId:fe,aiReasonId:je}})}catch(i){null==H||H({status:"failed",action:e,metadata:{redlineId:fe,aiReasonId:je}})}},fi=X||ui;return e.jsxs("div",{onClick:e=>{e.stopPropagation()},style:{...m,...null===(We=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===We?void 0:We.root},children:[e.jsxs("div",{style:{...y,...null===(Le=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Le?void 0:Le.header,marginBottom:ci?14:ni?"16px":"12px",...ci&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[ci?e.jsxs("div",{style:{minWidth:0,flex:"1 1 auto"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:Ce||Z.summaryIcon||"⏳"}),e.jsx("span",{children:Se||"Redline In Review"})]}),e.jsx("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:be||(null===(De=null==p?void 0:p.redlining_details)||void 0===De?void 0:De.redline_title)})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{children:Z.summaryIcon||e.jsx(i.Info,{size:16,color:"#E24B4A"})}),e.jsx("span",{style:{...f,...null===(Fe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Fe?void 0:Fe.title},children:V.summaryHeader||"Summary"})]}),me&&me.length>0&&e.jsx(q,{users:me,onClick:e=>{e.stopPropagation(),null==ye||ye()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(ve||ee||ie)&&e.jsx(O,{onAssignClick:ve,onOpenCognitive:ee,cognitiveIconSmall:ge,cognitiveTootipTitle:pe,historyIconSmall:te,onHistoryClick:ie,historyTootipTitle:ne}),e.jsx("button",{onClick:c,style:{...B,...null===(ze=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===ze?void 0:ze.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),ci&&Ie&&ke.length>0&&e.jsx(P,{steps:ke}),!Ee&&!ci&&e.jsx(e.Fragment,{children:e.jsx(r.Tooltip,{title:null===(Me=null==p?void 0:p.redlining_details)||void 0===Me?void 0:Me.redline_title,children:e.jsx("p",{style:{...j,...null===(He=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===He?void 0:He.bodyText},children:null===(_e=null==p?void 0:p.redlining_details)||void 0===_e?void 0:_e.redline_title})})}),e.jsx("p",{style:{...w,...null===(Oe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.summary},children:null===(qe=null==p?void 0:p.redlining_details)||void 0===qe?void 0:qe.redline_summary}),e.jsxs("div",{style:{...S,...null===(Pe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.impactContainer},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("button",{onClick:()=>ei(!Ze),style:{...C,...null===(Ne=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ne?void 0:Ne.impactToggle},children:[e.jsx("span",{style:{...k,...null===($e=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===$e?void 0:$e.impactToggleLabel},children:V.impactHeader||"Impact"}),e.jsx("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ze?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#E24B4A"})})]}),e.jsx(u,{type:(null==p?void 0:p.severity)||"Medium",customStyles:Y})]}),Ze&&e.jsx(e.Fragment,{children:e.jsx("div",{style:{...b,...null===(Ve=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.impactText},children:e.jsx(a.AiReasonMarkdownWrapper,{message:`${null!==(Ge=null===(Ue=null==p?void 0:p.redlining_details)||void 0===Ue?void 0:Ue.redline_impact)&&void 0!==Ge?Ge:V.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Ke=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Ke?void 0:Ke.impactMarkdown})})})]}),ci&&Te&&e.jsxs("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e.jsxs("button",{onClick:()=>ai(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[e.jsx("span",{children:Ae}),e.jsx(i.ChevronDown,{size:18,color:"#1E293B",style:{transform:di?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),di&&e.jsxs("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Be||"","”"]})]}),e.jsx("div",{style:{...I,...null===(Xe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.actionContainer},children:fi.map(i=>{var t,n;const o=J||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e.jsxs("button",{style:{...T,...null===(n=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{if(i.onClick){return void(!0===await i.onClick()&&i.useLabel&&await yi(i.id.toLowerCase()))}i.useLabel&&await yi(i.id.toLowerCase())},disabled:o,children:[i.icon,i.label]},i.id)})}),oe&&e.jsxs("div",{style:{...A,...null===(Je=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Je?void 0:Je.toneContainer},children:[e.jsxs("button",{onClick:()=>ti(!ii),style:{...E,...null===(Qe=null==Q?void 0:Q.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.toneToggleBtn},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(g,{toneIndex:li,configs:K}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:V.toneHeader||"Redline Tone"})]}),e.jsx("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ii?"rotate(180deg)":"rotate(0deg)"},children:e.jsx(i.ChevronDown,{size:16,color:"#111"})})]}),ii&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:V.toneDescription||"Controls how assertively AI is redlining"}),e.jsx(n.ToneToggle,{isDirty:gi,onToneChange:e=>{ri(e)},toneColor:xi,toneIndex:li,onClickRegenerate:()=>null==$?void 0:$(pi),toneLabels:U,isStreaming:he,aiReason:p})]})]}),ee&&e.jsxs("div",{className:null==ae?void 0:ae.section,onClick:e=>{e.stopPropagation(),ee&&ee(e)},style:{...R,...null==de?void 0:de.section,...le},children:[e.jsxs("div",{className:null==ae?void 0:ae.headerLeft,style:{...W,...null==de?void 0:de.headerLeft},children:[e.jsx("span",{className:null==ae?void 0:ae.titleIcon,style:{...L,...null==de?void 0:de.titleIcon},children:null!=xe?xe:e.jsx(o.ReactComponent,{})}),e.jsx("div",{className:null==ae?void 0:ae.cognitiveTitle,style:{...D,...null==de?void 0:de.cognitiveTitle},children:ce})]}),e.jsxs("div",{className:null==ae?void 0:ae.headerRight,style:{...F,...null==de?void 0:de.headerRight},children:[void 0!==(null==p?void 0:p.relevance_score)&&null!==(null==p?void 0:p.relevance_score)?e.jsxs("span",{className:null==ae?void 0:ae.scoreBadge,style:{...z,...null==de?void 0:de.scoreBadge,...re},children:[e.jsx(l.ReactComponent,{}),e.jsxs("span",{className:null==ae?void 0:ae.scoreText,style:{...M,...null==de?void 0:de.scoreText,...se},children:[Math.round(Number(p.relevance_score)),"%"]})]}):null,ue&&e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(i.ChevronRight,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});exports.AssignMenu=_,exports.DisplayUsers=q,exports.KebabMenu=O,exports.default=N;
|
|
2
2
|
//# sourceMappingURL=DeviationSummary.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react");const i={popup:{width:400,background:"#fff",borderRadius:20,padding:20,boxShadow:"0 20px 60px rgba(0,0,0,0.18), 0 8px 20px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",alignItems:"center",gap:10},content:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,width:"100%"},icon:{width:40,height:40,borderRadius:"50%",background:"#FEF2F2",color:"#DC2626",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},message:{margin:0,color:"#6B7280",fontFamily:"Inter",fontSize:15,lineHeight:1.6,flex:1},cross:{alignSelf:"start",cursor:"pointer"}};exports.default=function({message:s,onClose:r}){return e.jsx("div",{style:i.popup,children:e.jsxs("div",{style:i.content,children:[e.jsx("div",{style:i.icon,children:e.jsx(t.Lock,{size:15,strokeWidth:2.2})}),e.jsx("p",{style:i.message,children:s}),e.jsx("div",{style:i.cross,onClick:r,children:e.jsx(t.X,{size:20,strokeWidth:2.2})})]})})};
|
|
2
|
+
//# sourceMappingURL=EditBlockPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditBlockPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),n=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),l=require("../../../../../service/redlineService.js");const t={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};exports.default=function({onClose:d,editorInfo:o,headerText:r,btnsConfig:s,labelText:a,onActionTrigger:c,aiReason:u=null}){var v,p;const{redlineDcoumentId:x,redlineConfig:f,updateRedlineDataParent:b}=n.useRequirementAI(),g=async e=>{var i,n,t;null==c||c({status:"loading",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}});try{const{updated_reqai:d}=await l.resolveRedline({documentId:x,userEmail:null==f?void 0:f.userEmail,userName:null==f?void 0:f.userName,redlineId:null!==(i=null==u?void 0:u.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==f?void 0:f.baseApiUrl,redlineConfigId:null!==(n=null==f?void 0:f.redlineConfigId)&&void 0!==n?n:""},null!==(t=null==f?void 0:f.token)&&void 0!==t?t:"");await(null==b?void 0:b(d)),null==c||c({status:"success",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}})}catch(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),n=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),l=require("../../../../../service/redlineService.js");const t={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};exports.default=function({onClose:d,editorInfo:o,headerText:r,btnsConfig:s,labelText:a,onActionTrigger:c,aiReason:u=null}){var v,p;const{redlineDcoumentId:x,redlineConfig:f,updateRedlineDataParent:b}=n.useRequirementAI(),g=async e=>{var i,n,t;null==c||c({status:"loading",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}});try{const{updated_reqai:d}=await l.resolveRedline({documentId:x,userEmail:null==f?void 0:f.userEmail,userName:null==f?void 0:f.userName,redlineId:null!==(i=null==u?void 0:u.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==f?void 0:f.baseApiUrl,redlineConfigId:null!==(n=null==f?void 0:f.redlineConfigId)&&void 0!==n?n:""},null!==(t=null==f?void 0:f.token)&&void 0!==t?t:"");await(null==b?void 0:b(d)),null==c||c({status:"success",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}})}catch(i){null==c||c({status:"failed",action:e,metadata:{redlineId:null==u?void 0:u.redline_id,aiReasonId:null==u?void 0:u.id}})}};return e.jsxs("div",{style:t.popup,children:[e.jsxs("div",{style:t.header,children:[e.jsx("span",{style:t.title,children:r||"Manually Edited"}),e.jsx("button",{onClick:d,style:t.closeButton,"aria-label":"Close",children:"✕"})]}),e.jsxs("div",{style:t.content,children:[e.jsxs("div",{style:t.labelRow,children:[e.jsx(i.UserPen,{}),e.jsx("span",{style:t.label,children:a||"Edited By"})]}),e.jsx("div",{style:t.editorInfo,children:o}),e.jsx("div",{style:t.divider}),e.jsxs("div",{style:t.actions,children:[null==s?void 0:s.map(i=>e.jsxs("button",{style:{...t.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==u?void 0:u.redline_id,id:null==u?void 0:u.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(v=null==u?void 0:u.redlining_details)||void 0===v?void 0:v.status)||"rejected"===(null===(p=null==u?void 0:u.redlining_details)||void 0===p?void 0:p.status))&&e.jsxs("div",{style:t.resolveActions,children:[e.jsxs("button",{style:{...t.actionBtn,...(null==u?void 0:u.resolving)?t.actionBtnDisabled:{}},disabled:null==u?void 0:u.resolving,onClick:()=>g("accept"),children:[e.jsx(i.CheckCircle,{size:16,color:"#10B981"})," ","Adopt"]}),e.jsxs("button",{style:{...t.actionBtn,...(null==u?void 0:u.resolving)?t.actionBtnDisabled:{}},onClick:()=>g("reject"),disabled:null==u?void 0:u.resolving,children:[e.jsx(i.XCircle,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})};
|
|
2
2
|
//# sourceMappingURL=ManualEditPopup.js.map
|
package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),o=require("./PopupDefaults.js"),r=require("@mui/material"),n=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),s=require("./DeviationSummary.js"),l=require("../../../../../service/redlineService.js"),a=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function d(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}const c=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),u=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),x=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),h=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),p=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),f=({open:t})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),j=({color:t="#3b82f6"})=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M1.5 3.5v4h4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:t,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),b=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function g({title:t,open:i,onToggle:o,children:r}){return e.jsxs("div",{children:[e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:t}),e.jsx(f,{open:i})]}),e.jsx("div",{style:{maxHeight:i?100:0,opacity:i?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:i&&e.jsx(e.Fragment,{children:r})})]})}function v({icon:t,label:i,onClick:o,customStyle:r={},disabled:n=!1,disabledStyle:s={}}){const l={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:n?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:n?.5:1,...r,...n?s:{}};return e.jsxs("button",{onClick:n?void 0:o,disabled:n,style:l,onMouseEnter:e=>{n||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:e=>{n||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[t,i]})}exports.ApprovedIcon=c,exports.ChevronIcon=f,exports.CloseIcon=x,exports.HistoryIcon=j,exports.IterateIcon=b,exports.RedlineCard=function({status:f,onClose:y,impactText:m,secondText:C,actionTakenByName:I,actionTakenAtTime:R="NA",onHistory:w,onIterate:B,onActionTrigger:L,disableAllActions:S=!1,impactTitle:W="Impact",customConfigs:T={},customStyles:M={},secondaryTitle:D,onAssignClick:A,onReviewUsersClick:U,assignedUsers:q,redlineId:z,aiReasonId:N}){const[H,E]=i.useState(!0),[F,P]=i.useState(!0),[O,$]=i.useState(!1);i.useState(!1);const{redlineDcoumentId:_,redlineConfig:V,updateRedlineDataParent:Y}=a.useRequirementAI(),G={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e.jsx(h,{}),StatusIcon:e.jsx(c,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e.jsx(j,{}),label:"History",onClick:w},{icon:e.jsx(t.Undo2,{size:17}),label:"Revert",useLabel:!0},{icon:e.jsx(b,{}),label:"Iterate",onClick:B}],fallbackText:"No original text available"},J={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e.jsx(p,{}),StatusIcon:e.jsx(u,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e.jsx(j,{color:"#3b82f6"}),label:"History",onClick:w},{icon:e.jsx(k,{}),label:"Reinstate",useLabel:!0},{icon:e.jsx(b,{}),label:"Iterate",onClick:B}],fallbackText:"No rejected recommendation available"},K={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e.jsx(h,{}),StatusIcon:e.jsx(t.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e.jsx(j,{}),label:"History",onClick:w},{icon:e.jsx(b,{}),label:"Iterate",onClick:B}],fallbackText:"No reverted redline available"};let Q;Q="accepted"===f?G:"rejected"===f?J:K;const X={...Q,...T[f]||{}};return e.jsxs("div",{style:{...o.default.RedlineCardDefaults.root,animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":o.default.RedlineCardDefaults.root.animation,...M.root},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.header,background:X.headerBg,borderBottom:`1.5px solid ${X.headerBorder}`,...M.header},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:X.StatusIcon}),e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:15,fontWeight:700,color:X.titleColor,letterSpacing:"-0.01em"},children:X.label}),e.jsx(r.Tooltip,{title:D,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:D})})]}),q&&q.length>0&&e.jsx(s.DisplayUsers,{users:q,onClick:e=>{e.stopPropagation(),null==U||U()}})]}),e.jsx("button",{onClick:()=>{$(!0),y()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e.jsx(x,{})})]}),e.jsxs("div",{style:{...o.default.RedlineCardDefaults.body,...M.body},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.meta,...M.meta},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[X.UserIcon,e.jsx("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:X.metaLabel})]}),e.jsxs("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e.jsx(r.Tooltip,{title:I,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:I})}),e.jsx("span",{children:d(R)})]})]}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(g,{title:W,open:H,onToggle:()=>E(e=>!e),children:e.jsx("div",{style:{...o.default.RedlineCardDefaults.impactText,...M.impactText},children:e.jsx(n.AiReasonMarkdownWrapper,{message:`${m||""} [View chat](chat_citation$all)`,customStyles:M.impactMarkdown})})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(g,{title:X.secondTitle,open:F,onToggle:()=>P(e=>!e),children:C?e.jsx("div",{style:{...o.default.RedlineCardDefaults.secondSection,background:X.secondBg,border:`1.5px solid ${X.secondBorder}`,...M.secondSection},children:C}):e.jsxs("div",{style:{...o.default.RedlineCardDefaults.fallbackSectionStyle,...M.fallbackSectionStyle},children:[X.fallbackText," "]})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.actionsContainer,...M.actionsContainer},children:X.actions.map(t=>e.jsx(v,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i;null==L||L({status:"loading",action:e,metadata:{redlineId:z,aiReasonId:N}});try{const{updated_reqai:o}=await l.resolveRedline({documentId:_,userEmail:null==V?void 0:V.userEmail,userName:null==V?void 0:V.userName,redlineId:null!=z?z:"",action:e,baseApiUrl:null==V?void 0:V.baseApiUrl,redlineConfigId:null!==(t=null==V?void 0:V.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==V?void 0:V.token)&&void 0!==i?i:"");await(null==Y?void 0:Y(o)),null==L||L({status:"success",action:e,metadata:{redlineId:z,aiReasonId:N}})}catch(e){null==L||L({status:"failed",action:null,metadata:{redlineId:z,aiReasonId:N}})}})(t.label.toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...M.actionBtn},disabled:S||t.disabled,disabledStyle:M.actionBtnDisabled},t.label))})]})]})},exports.ReinstateIcon=k,exports.RejectedIcon=u,exports.UserApprovedIcon=h,exports.UserRejectedIcon=p,exports.formatDate=d;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),o=require("./PopupDefaults.js"),n=require("@mui/material"),r=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),s=require("./DeviationSummary.js"),l=require("../../../../../service/redlineService.js"),a=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function d(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}const c=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),u=()=>e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),x=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),h=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),p=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),f=({open:t})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),g=({color:t="#3b82f6"})=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M1.5 3.5v4h4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:t,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),j=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function b({title:t,open:i,onToggle:o,children:n}){return e.jsxs("div",{children:[e.jsxs("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:t}),e.jsx(f,{open:i})]}),e.jsx("div",{style:{maxHeight:i?100:0,opacity:i?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:i&&e.jsx(e.Fragment,{children:n})})]})}function v({icon:t,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:s={}}){const l={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?s:{}};return e.jsxs("button",{onClick:r?void 0:o,disabled:r,style:l,onMouseEnter:e=>{r||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[t,i]})}exports.ApprovedIcon=c,exports.ChevronIcon=f,exports.CloseIcon=x,exports.HistoryIcon=g,exports.IterateIcon=k,exports.RedlineCard=function({status:f,onClose:y,impactText:m,secondText:C,actionTakenByName:I,actionTakenAtTime:R="NA",onHistory:S,onIterate:w,onActionTrigger:B,disableAllActions:T=!1,impactTitle:L="Impact",customConfigs:W={},customStyles:M={},secondaryTitle:D,onAssignClick:A,onReviewUsersClick:U,assignedUsers:q,redlineId:z,aiReasonId:H,cognitiveIconSmall:N,cognitiveTootipTitle:O="Cognitive Decisioning",historyIconSmall:E,onHistoryClick:F,historyTootipTitle:P,onOpenCognitive:$}){const[_,K]=i.useState(!0),[V,Y]=i.useState(!0),[G,J]=i.useState(!1);i.useState(!1);const{redlineDcoumentId:Q,redlineConfig:X,updateRedlineDataParent:Z}=a.useRequirementAI(),ee={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e.jsx(h,{}),StatusIcon:e.jsx(c,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e.jsx(g,{}),label:"History",onClick:S},{icon:e.jsx(t.Undo2,{size:17}),label:"Revert",useLabel:!0},{icon:e.jsx(k,{}),label:"Iterate",onClick:w}],fallbackText:"No original text available"},te={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e.jsx(p,{}),StatusIcon:e.jsx(u,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e.jsx(g,{color:"#3b82f6"}),label:"History",onClick:S},{icon:e.jsx(j,{}),label:"Reinstate",useLabel:!0},{icon:e.jsx(k,{}),label:"Iterate",onClick:w}],fallbackText:"No rejected recommendation available"},ie={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e.jsx(h,{}),StatusIcon:e.jsx(t.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e.jsx(g,{}),label:"History",onClick:S},{icon:e.jsx(k,{}),label:"Iterate",onClick:w}],fallbackText:"No reverted redline available"};let oe;oe="accepted"===f?ee:"rejected"===f?te:ie;const ne={...oe,...W[f]||{}};return e.jsxs("div",{style:{...o.default.RedlineCardDefaults.root,animation:G?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":o.default.RedlineCardDefaults.root.animation,...M.root},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.header,background:ne.headerBg,borderBottom:`1.5px solid ${ne.headerBorder}`,...M.header},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:ne.StatusIcon}),e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:15,fontWeight:700,color:ne.titleColor,letterSpacing:"-0.01em"},children:ne.label}),e.jsx(n.Tooltip,{title:D,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:D})})]}),q&&q.length>0&&e.jsx(s.DisplayUsers,{users:q,onClick:e=>{e.stopPropagation(),null==U||U()}})]}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(A||$||F)&&e.jsx(s.KebabMenu,{onAssignClick:A,onOpenCognitive:$,cognitiveIconSmall:N,cognitiveTootipTitle:O,historyIconSmall:E,onHistoryClick:F,historyTootipTitle:P}),e.jsx("button",{onClick:()=>{J(!0),y()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e.jsx(x,{})})]})]}),e.jsxs("div",{style:{...o.default.RedlineCardDefaults.body,...M.body},children:[e.jsxs("div",{style:{...o.default.RedlineCardDefaults.meta,...M.meta},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[ne.UserIcon,e.jsx("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:ne.metaLabel})]}),e.jsxs("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e.jsx(n.Tooltip,{title:I,children:e.jsx("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:I})}),e.jsx("span",{children:d(R)})]})]}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(b,{title:L,open:_,onToggle:()=>K(e=>!e),children:e.jsx("div",{style:{...o.default.RedlineCardDefaults.impactText,...M.impactText},children:e.jsx(r.AiReasonMarkdownWrapper,{message:`${m||""} [View chat](chat_citation$all)`,customStyles:M.impactMarkdown})})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.divider,...M.divider}}),e.jsx(b,{title:ne.secondTitle,open:V,onToggle:()=>Y(e=>!e),children:C?e.jsx("div",{style:{...o.default.RedlineCardDefaults.secondSection,background:ne.secondBg,border:`1.5px solid ${ne.secondBorder}`,...M.secondSection},children:C}):e.jsxs("div",{style:{...o.default.RedlineCardDefaults.fallbackSectionStyle,...M.fallbackSectionStyle},children:[ne.fallbackText," "]})}),e.jsx("div",{style:{...o.default.RedlineCardDefaults.actionsContainer,...M.actionsContainer},children:ne.actions.map(t=>e.jsx(v,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i;null==B||B({status:"loading",action:e,metadata:{redlineId:z,aiReasonId:H}});try{const{updated_reqai:o}=await l.resolveRedline({documentId:Q,userEmail:null==X?void 0:X.userEmail,userName:null==X?void 0:X.userName,redlineId:null!=z?z:"",action:e,baseApiUrl:null==X?void 0:X.baseApiUrl,redlineConfigId:null!==(t=null==X?void 0:X.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==X?void 0:X.token)&&void 0!==i?i:"");await(null==Z?void 0:Z(o)),null==B||B({status:"success",action:e,metadata:{redlineId:z,aiReasonId:H}})}catch(t){null==B||B({status:"failed",action:e,metadata:{redlineId:z,aiReasonId:H}})}})(t.label.toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...M.actionBtn},disabled:T||t.disabled,disabledStyle:M.actionBtnDisabled},t.label))})]})]})},exports.ReinstateIcon=j,exports.RejectedIcon=u,exports.UserApprovedIcon=h,exports.UserRejectedIcon=p,exports.formatDate=d;
|
|
2
2
|
//# sourceMappingURL=RedlineStatusCard.js.map
|