@e-llm-studio/citation 0.0.233 → 0.0.234-beta.1

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.
Files changed (41) hide show
  1. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
  2. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  3. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/helper.js +1 -1
  4. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  5. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  6. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  7. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  8. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  9. package/dist/cjs/features/PromptemonBlockViewer/PromptemonBlockViewer.js +1 -1
  10. package/dist/cjs/features/PromptemonViewer/PromptemonViewer.js +1 -1
  11. package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
  12. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  13. package/dist/features/CognitiveCompare/Guidelines/utils/helper.js +1 -1
  14. package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  15. package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  16. package/dist/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  17. package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  18. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  19. package/dist/features/PromptemonBlockViewer/PromptemonBlockViewer.js +1 -1
  20. package/dist/features/PromptemonViewer/PromptemonViewer.js +1 -1
  21. package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
  22. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
  23. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  24. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +0 -13
  25. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
  26. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +899 -1422
  27. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
  28. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/helper.d.ts.map +1 -1
  29. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
  30. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
  31. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -1
  32. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +1 -2
  33. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
  34. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
  35. package/package.json +2 -2
  36. package/dist/cjs/features/CognitiveCompare/utils/buildComparisonRows.js +0 -2
  37. package/dist/cjs/features/CognitiveCompare/utils/buildComparisonRows.js.map +0 -1
  38. package/dist/features/CognitiveCompare/utils/buildComparisonRows.js +0 -2
  39. package/dist/features/CognitiveCompare/utils/buildComparisonRows.js.map +0 -1
  40. package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.d.ts +0 -11
  41. package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- import{useState as t,useRef as e,useCallback as n,useEffect as i}from"react";import{DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";var c=function(c){var o=c.containerRef,l=c.leftContainerRef,u=c.rightContainerRef;c.svgContainerRef;var a=c.pathRefs,d=c.leftHeaderRef,s=c.rightHeaderRef,v=c.proposedSections,h=c.existingSections,g=c.visibleFields,f=c.leftRefs,p=c.rightRefs,b=c.sectionLeftRefs,y=c.sectionRightRefs,x=c.subSectionLeftRefs,m=c.subSectionRightRefs,R=c.lhsBadgeRefs,C=c.rhsBadgeRefs,A=c.sectionRowRefs,B=c.expandedSections,S=c.expandedSubSections,M=c.connectedSections,I=c.isSideBySide,T=c.activeSideBySideSection,L=c.maintainRelativeOrder,F=c.isGuidelineMode,H=c.cognitiveMap,w=c.getSectionCompareStyle,k=c.getSubSectionCompareStyle,E=c.getDeviationStyleByKey,N=c.isArrowVisible,Y=c.isAnimatingRef,D=c.isSideBySideRef,j=c.sideBySideCacheRef,O=c.sideBySideLineRef,z=c.activeSideBySideSectionRef,P=c.activeSideBySideRightSectionRef,Q=c.connectedLines,X=c.setConnectedLines,q=c.cachedConnectedPositions,G=c.calculateLinesRef,K=c.resizeTimerRef,V=c.scrollLock,J=c.scrollSyncLocked,U=c.handleResizeRef,W=c.activeProposed,Z=c.existingRule,$=c.analysisData,_=c.pendingScrollTargetRef,tt=c.pendingScrollCallbackRef,et=c.resolvedComparisonConfig,nt=c.getFieldData,it=t([]),rt=it[0],ct=it[1],ot=t(null),lt=ot[0],ut=ot[1],at=t([]),dt=at[0],st=at[1],vt=null!=Q?Q:dt,ht=null!=X?X:st,gt=t({width:0,height:0}),ft=gt[0],pt=gt[1],bt=e(!1),yt=e(!1),xt=e(!1),mt=e(null),Rt=e([]),Ct=null!=q?q:Rt,At=function(t,e,n,i,r,c,o){if(Math.abs(i-e)<=1)return c&&o?"M ".concat(t,",").concat(e," L ").concat(n,",").concat(i):c&&!o?"M ".concat(t,",").concat(e," L ").concat(r,",").concat(e):!c&&o?"M ".concat(r,",").concat(e," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i);var l=Math.min(15,Math.abs(r-t),Math.abs(i-e)/2),u=Math.min(15,Math.abs(n-r),Math.abs(i-e)/2),a=i>e?l:-l,d=i>e?u:-u,s=n>r?u:-u;return c&&o?"M ".concat(t,",").concat(e," L ").concat(r-l,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):c&&!o?"M ".concat(t,",").concat(e," L ").concat(r-l,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i):!c&&o?"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i)},Bt=n(function(){var t,e,n,i,c,a,A,N,D,j,O,z,P,Q,X,q,G,K;if(!bt.current&&!Y.current){bt.current=!0;try{if(!o.current)return;var V=function(t){var e=t.split("-"),n=e[0];if(!B[n]&&!1===L)return!1;if(L&&!B["left-".concat(n)]&&!B["right-".concat(n)]&&!B[n])return!1;for(var i=n,r=1;r<e.length-1;r++)if(i+="-".concat(e[r]),!S[i])return!1;return!0},J=o.current.getBoundingClientRect();pt({width:J.width,height:J.height});var U=[];if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;r&&c&&(r.style.height="auto",c.style.height="auto",r.style.minHeight="0px",c.style.minHeight="0px")}),!Y.current){for(var W=0;W<Math.max(v.length,h.length);W++){var Z=null===(t=b.current[W])||void 0===t?void 0:t.current,$=null===(e=y.current[W])||void 0===e?void 0:e.current;Z&&(Z.style.height="auto",Z.style.minHeight="0px"),$&&($.style.height="auto",$.style.minHeight="0px")}L||Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;i&&r&&(i.style.height="auto",r.style.height="auto",i.style.minHeight="0px",r.style.minHeight="0px")}})}var _={};g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=r.getBoundingClientRect(),l=c.getBoundingClientRect();_[i]=Math.max(o.height,l.height)}});var tt={left:{},right:{}},et={};if(!Y.current)if(L){if(I&&null!==T)if("number"==typeof T){var nt=T,it=v[nt],rt=null===(c=b.current[nt])||void 0===c?void 0:c.current;rt&&it&&(it.refIndexes||[]).forEach(function(t){var e,n=h.findIndex(function(e){return e.selfIndex===t}),i=null===(e=y.current[n])||void 0===e?void 0:e.current;if(i&&(B["left-".concat(nt)]||B["right-".concat(n)])){var r=Math.max(rt.getBoundingClientRect().height,i.getBoundingClientRect().height);tt.left[nt]=Math.max(tt.left[nt]||0,r),tt.right[n]=Math.max(tt.right[n]||0,r)}})}else{var ot=T.split(r)[2];if(ot){Z=null===(a=x.current[ot])||void 0===a?void 0:a.current,$=null===(A=m.current[ot])||void 0===A?void 0:A.current;if(Z&&$){lt=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);et[ot]=Math.max(et[ot]||0,lt)}}}}else{Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var c=i.getBoundingClientRect(),o=r.getBoundingClientRect(),l=Math.max(c.height,o.height);et[t]=l,i.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}});for(W=0;W<Math.min(v.length,h.length);W++){var Z=null===(n=b.current[W])||void 0===n?void 0:n.current,$=null===(i=y.current[W])||void 0===i?void 0:i.current;if(Z&&$){var lt=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);tt.left[W]=lt,tt.right[W]=lt}}}if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=_[i];r.style.minHeight="".concat(o,"px"),c.style.minHeight="".concat(o,"px")}}),Y.current||(Object.entries(tt.left).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=b.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(tt.right).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=y.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),L||Object.keys(et).forEach(function(t){var e,n,i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&et[t]){var c=et[t];i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}})),!F){v.forEach(function(t,e){var n,i=t.continuationSourceRowId?v.findIndex(function(e){return e.comparisonRowId===t.continuationSourceRowId}):-1,r=i>=0?i:e,c=null===(n=b.current[r])||void 0===n?void 0:n.current;if(c){var o=function(t,e){if(!L)return h[e]?[e]:[];var n=(t.refIndexes||[]).map(function(t){return h.findIndex(function(e){return e.selfIndex===t})}).filter(function(t){return-1!==t});return!n.length&&h[e]?[e]:Array.from(new Set(n))}(t,e);o.forEach(function(t){var n,o,a,d,s,g,f,p,b,x,m,R,C=null===(n=y.current[t])||void 0===n?void 0:n.current;if(C){var A=c.getBoundingClientRect(),B=C.getBoundingClientRect(),S=A.right-J.left,M=B.left-J.left,F=A.top+18-J.top,k=B.top+18-J.top;if(L&&I&&T===e){var E=null!==(a=null===(o=l.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==a?a:0,N=null!==(s=null===(d=u.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==s?s:0,Y=E+(null!==(f=null===(g=l.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0),D=N+(null!==(b=null===(p=u.current)||void 0===p?void 0:p.clientHeight)&&void 0!==b?b:1/0),j=function(t,e,n){return Math.max(e,Math.min(n,t))};F=j(A.top+18,E,Y)-J.top,k=j(B.top+18,N,D)-J.top}var O=w(r);O&&U.push({id:"line-".concat(r,"-").concat(t),x1:S,y1:F,x2:M,y2:k,style:O,sectionIdx:r,targetRightIdx:t,isSubSection:!1,isMappingContinuation:i>=0,hasCognitive:!!((null===(x=v[r])||void 0===x?void 0:x.cognitiveData)||(null===(m=h[t])||void 0===m?void 0:m.cognitiveData)||(null===(R=v[r])||void 0===R?void 0:R.nodeId)&&H[v[r].nodeId])})}})}})}if(!F&&I&&"string"==typeof T&&T.includes(r)){var at=T.split(r),dt=at[0],st=at[1],vt=at[2],gt=(at[3],"".concat(dt).concat(r).concat(st)),ft=null===(N=R.current[gt])||void 0===N?void 0:N.current,yt=null===(D=C.current[gt])||void 0===D?void 0:D.current;if(ft&&yt){var xt=ft.getBoundingClientRect(),mt=yt.getBoundingClientRect(),Rt=xt.right-J.left,Bt=mt.left-J.left,Mt=xt.top+xt.height/2-J.top,It=mt.top+mt.height/2-J.top;if(L){var Tt=null!==(O=null===(j=l.current)||void 0===j?void 0:j.getBoundingClientRect().top)&&void 0!==O?O:0,Lt=null!==(P=null===(z=u.current)||void 0===z?void 0:z.getBoundingClientRect().top)&&void 0!==P?P:0,Ft=Tt+(null!==(X=null===(Q=l.current)||void 0===Q?void 0:Q.clientHeight)&&void 0!==X?X:1/0),Ht=Lt+(null!==(G=null===(q=u.current)||void 0===q?void 0:q.clientHeight)&&void 0!==G?G:1/0),wt=function(t,e,n){return Math.max(e,Math.min(n,t))};Mt=wt(xt.top+xt.height/2,Tt,Ft)-J.top,It=wt(mt.top+mt.height/2,Lt,Ht)-J.top}var kt=null!==(K=E(dt,st))&&void 0!==K?K:k(vt);kt&&U.push({id:"line-subsec-".concat(gt),x1:Rt,y1:Mt,x2:Bt,y2:It,style:kt,sectionIdx:Number(vt.split("-")[0]),isSubSection:!0,subSectionKeyPath:T})}}if(ct(U),d.current&&s.current){var Et=d.current.getBoundingClientRect(),Nt=s.current.getBoundingClientRect(),Yt=(Et.top+Et.height/2-J.top+Nt.top+Nt.height/2-J.top)/2;ut({x1:Et.right-J.left,x2:Nt.left-J.left,y:Yt})}else ut(null);if(M.size>0){var Dt=[],jt=l.current,Ot=u.current;if(jt&&Ot){var zt=[],Pt=jt.getBoundingClientRect().top,Qt=Ot.getBoundingClientRect().top,Xt=Pt+jt.clientHeight,qt=Qt+Ot.clientHeight,Gt=jt.scrollTop,Kt=Ot.scrollTop,Vt=J.top,Jt=function(t,e,n){return Math.max(e,Math.min(n,t))};M.forEach(function(t){var e,n,i,c,o,l,u,a,d;if(F){var s=null,g=null,f=null;if("string"==typeof t&&t.includes(r)){var p=t.split(r),b=p[0],y=p[1],x=p[2],m="".concat(b).concat(r).concat(y);s=null===(e=R.current[m])||void 0===e?void 0:e.current,f=null!==(n=E(b,y))&&void 0!==n?n:k(x),g=Number((null==x?void 0:x.split("-")[0])||0)}else g=Number(t),s=null===(i=R.current[g])||void 0===i?void 0:i.current,f=w(g);if(!s)return;var A=document.querySelectorAll('[id^="guideline-target-"]');A.forEach(function(e,n){var i=s.getBoundingClientRect(),c=e.getBoundingClientRect(),o=i.right-J.left,l=c.left-J.left-0,u=o+75,a=i.top+i.height/2,d=c.top+c.height/2,v=a-Pt+Gt,h=d-Qt+Kt,g="conn-guide-".concat(t,"-").concat(n),p="";"string"==typeof t&&t.includes(r)?p=(t.split(r)[2]||"").split("-").map(function(t){return Number(t)+1}).join("."):p=String(Number(t)+1);var b=String.fromCharCode(97+n),y=1===A.length?null:"".concat(p,"(").concat(b,")");zt.push({lhsScrollY:v,rhsScrollY:h,x1:o,x2:l,containerTop:Vt,leftIdx:t,rhsArrayIdx:n,styleColor:(null==f?void 0:f.badgeBorder)||"#6366F1",styleBg:(null==f?void 0:f.badgeBg)||"#FFFFFF",styleText:(null==f?void 0:f.badgeText)||"#A16207",styleId:g,centerX:u});var x=Jt(a,Pt,Xt),m=Jt(d,Qt,qt),R=x-Vt,C=m-Vt,B=At(o,R,l,C,u,a>=Pt-4&&a<=Xt+4,d>=Qt-4&&d<=qt+4);Dt.push({id:g,pathD:B,style:f,leftIdx:t,rhsArrayIdx:n,x1:o,x2:l,y1:R,y2:C,centerX:u,matchLabel:y,isGuideline:!0})})}else if("string"==typeof t&&t.includes(r)){var B=t.split(r),S=(b=B[0],y=B[1],x=B[2],B[3],m="".concat(b).concat(r).concat(y),null===(c=R.current[m])||void 0===c?void 0:c.current),M=null===(o=C.current[m])||void 0===o?void 0:o.current;if(!S||!M)return;var I=S.getBoundingClientRect(),T=M.getBoundingClientRect(),H=null!==(l=E(b,y))&&void 0!==l?l:k(x),N=I.right-J.left,Y=T.left-J.left-0,D=N+75,j=I.top+I.height/2,O=T.top+T.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-subsec-".concat(m),X=((x||"").split("-").map(function(t){return Number(t)+1}).join("."),null);zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:t,rhsArrayIdx:t,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:t,rhsArrayIdx:t,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}else if(L){var V=t,U=v[V];if(!(null===(d=null==U?void 0:U.refIndexes)||void 0===d?void 0:d.length))return;U.refIndexes.forEach(function(e,n){var i,r,c=h.findIndex(function(t){return t.selfIndex===e});if(-1!==c){var o=null===(i=R.current[V])||void 0===i?void 0:i.current,l=null===(r=C.current[c])||void 0===r?void 0:r.current;if(o&&l){var u=o.getBoundingClientRect(),a=l.getBoundingClientRect(),d=w(V),s=u.right-J.left,v=a.left-J.left-0,g=s+75,f=u.top+u.height/2,p=a.top+a.height/2,b=f-Pt+Gt,y=p-Qt+Kt,x="conn-".concat(V,"-").concat(c),m=String(Number(t)+1),A=String.fromCharCode(97+n),B=1===U.refIndexes.length?null:"".concat(m,"(").concat(A,")");zt.push({lhsScrollY:b,rhsScrollY:y,x1:s,x2:v,containerTop:Vt,leftIdx:V,rhsArrayIdx:c,styleColor:(null==d?void 0:d.badgeBorder)||"#6366F1",styleBg:(null==d?void 0:d.badgeBg)||"#FFFFFF",styleText:(null==d?void 0:d.badgeText)||"#A16207",styleId:x,centerX:g});var S=Jt(f,Pt,Xt),M=Jt(p,Qt,qt),I=S-Vt,T=M-Vt,L=At(s,I,v,T,g,f>=Pt-4&&f<=Xt+4,p>=Qt-4&&p<=qt+4);Dt.push({id:x,pathD:L,style:d,leftIdx:V,rhsArrayIdx:c,x1:s,x2:v,y1:I,y2:T,matchLabel:B})}}})}else{var W=t,Z=W;S=null===(u=R.current[W])||void 0===u?void 0:u.current,M=null===(a=C.current[Z])||void 0===a?void 0:a.current;if(!S||!M)return;I=S.getBoundingClientRect(),T=M.getBoundingClientRect(),H=w(W),N=I.right-J.left,Y=T.left-J.left-0,D=N+75,j=I.top+I.height/2,O=T.top+T.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-".concat(W,"-").concat(Z),String(Number(t)+1),X=null;zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:W,rhsArrayIdx:Z,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var $,_;q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:W,rhsArrayIdx:Z,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}}),Ct.current=zt}ht(Dt),setTimeout(function(){return St()},10)}else ht([]),Ct.current=[],setTimeout(function(){return St()},10)}catch(t){console.error("Line render safe fail: ",t)}finally{bt.current=!1}}},[g,v,h,H,et,nt,w,E,L,I,T,M,B,S,F]),St=n(function(){var t,e,n,i,r,c,d,s,v,h,g,f,p,b,y,x,m,R,C,A=Ct.current;if(!A.length)return null===(t=a.current["guideline-up-stroke"])||void 0===t||t.setAttribute("visibility","hidden"),null===(e=a.current["guideline-up-badge"])||void 0===e||e.setAttribute("visibility","hidden"),null===(n=a.current["guideline-down-stroke"])||void 0===n||n.setAttribute("visibility","hidden"),void(null===(i=a.current["guideline-down-badge"])||void 0===i||i.setAttribute("visibility","hidden"));if(!Y.current){var B=null!==(c=null===(r=l.current)||void 0===r?void 0:r.scrollTop)&&void 0!==c?c:0,S=null!==(s=null===(d=u.current)||void 0===d?void 0:d.scrollTop)&&void 0!==s?s:0,M=null!==(h=null===(v=l.current)||void 0===v?void 0:v.clientHeight)&&void 0!==h?h:1/0,I=null!==(f=null===(g=u.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0,T=null!==(b=null===(p=l.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==b?b:0,L=null!==(x=null===(y=u.current)||void 0===y?void 0:y.getBoundingClientRect().top)&&void 0!==x?x:0,F=T+M,H=L+I,w=null===(m=o.current)||void 0===m?void 0:m.getBoundingClientRect(),k=null!==(R=null==w?void 0:w.top)&&void 0!==R?R:0,E=null!==(C=null==w?void 0:w.height)&&void 0!==C?C:1/0,N=function(t,e,n){return Math.max(e,Math.min(n,t))},D=0,j=0,O=0,z=0,P="#6366F1",Q="#A16207",X=!1,q=0;if(A.forEach(function(t){var e=t.lhsScrollY-B+T,n=t.rhsScrollY-S+L,i=a.current[t.styleId+"-stroke"],r=a.current[t.styleId+"-bg"],c=a.current[t.styleId+"-btn"],o=a.current[t.styleId+"-number"];if(i||r){var l=N(e,T,F),u=N(n,L,H),d=l-k,s=u-k,v=e>=T-4&&e<=F+4,h=n>=L-4&&n<=H+4,g=!0;X=!0;var f=t.centerX||t.x1+75;0===O&&(O=t.x1,z=d,q=f,P=t.styleColor,t.styleBg,Q=t.styleText||"#A16207"),n<L-4?(D++,g=!1):n>H+4&&(j++,g=!1);var p=At(t.x1,d,t.x2,s,q,v,h);i&&(g&&p?(i.setAttribute("visibility","visible"),i.setAttribute("d",p)):i.setAttribute("visibility","hidden")),r&&(g&&p?(r.setAttribute("visibility","visible"),r.setAttribute("d",p)):r.setAttribute("visibility","hidden")),c&&(v&&g?(c.setAttribute("visibility","visible"),c.setAttribute("y",String(d-12))):c.setAttribute("visibility","hidden")),o&&(v&&g?(o.setAttribute("visibility","visible"),o.setAttribute("transform","translate(".concat(t.x2-42,", ").concat(s,")"))):o.setAttribute("visibility","hidden"))}}),X&&q>0){var G=a.current["guideline-up-stroke"],K=a.current["guideline-up-badge"],V=a.current["guideline-up-arrow"],J=a.current["guideline-up-text"],U=a.current["guideline-up-badge-rect"];if(D>0){var W=Math.max(15,L-k+15),Z=Math.min(15,Math.abs(q-O),Math.max(0,z-W)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z-Z," L ").concat(q,",").concat(W);null==G||G.setAttribute("visibility","visible"),null==G||G.setAttribute("d",$),null==G||G.setAttribute("stroke",P),null==K||K.setAttribute("visibility","visible"),null==K||K.setAttribute("transform","translate(".concat(q,", ").concat(W,")")),V&&V.setAttribute("fill",P),J&&(J.textContent="+".concat(D),J.setAttribute("fill",Q)),U&&U.setAttribute("stroke",P)}else null==G||G.setAttribute("visibility","hidden"),null==K||K.setAttribute("visibility","hidden");var _=a.current["guideline-down-stroke"],tt=a.current["guideline-down-badge"],et=a.current["guideline-down-arrow"],nt=a.current["guideline-down-text"],it=a.current["guideline-down-badge-rect"];if(j>0){var rt=Math.min(E-15,H-k-15);Z=Math.min(15,Math.abs(q-O),Math.max(0,rt-z)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z+Z," L ").concat(q,",").concat(rt);null==_||_.setAttribute("visibility","visible"),null==_||_.setAttribute("d",$),null==_||_.setAttribute("stroke",P),null==tt||tt.setAttribute("visibility","visible"),null==tt||tt.setAttribute("transform","translate(".concat(q,", ").concat(rt,")")),et&&et.setAttribute("fill",P),nt&&(nt.textContent="+".concat(j),nt.setAttribute("fill",Q)),it&&it.setAttribute("stroke",P)}else null==_||_.setAttribute("visibility","hidden"),null==tt||tt.setAttribute("visibility","hidden")}}},[]),Mt=n(function(){Ct.current.length>0&&!Y.current||(null!==mt.current&&clearTimeout(mt.current),mt.current=setTimeout(function(){G.current(),mt.current=null},50))},[]),It=n(function(t){if(null!==_.current&&tt.current&&Math.abs(t.currentTarget.scrollTop-_.current)<=2){var e=tt.current;_.current=null,tt.current=null,e()}if(!xt.current&&!V.current){if(L&&J&&(D.current||M.size>0)){var n=t.currentTarget,i=l.current,c=u.current,a=n===i?c:n===c?i:null;if(n&&a){var d=function(){var t,e,n,i,c,o,l,u,a,d,s,v=z.current,h=P.current;if(null===v)return{leftAnchor:null,rightAnchor:null};if("string"==typeof v&&v.includes(r)){var g=v.split(r),f="".concat(g[0]).concat(r).concat(g[1]);return{leftAnchor:(null===(t=R.current[f])||void 0===t?void 0:t.current)||(null===(e=x.current[g[2]])||void 0===e?void 0:e.current)||(null===(n=b.current[Number(g[2])])||void 0===n?void 0:n.current)||null,rightAnchor:(null===(i=C.current[f])||void 0===i?void 0:i.current)||(null===(c=m.current[g[3]])||void 0===c?void 0:c.current)||(null===(o=y.current[Number(g[3])])||void 0===o?void 0:o.current)||null}}var p=Number(v),B=null!==h?Number(h):p;return{leftAnchor:(null===(l=R.current[p])||void 0===l?void 0:l.current)||(null===(u=A.current[p])||void 0===u?void 0:u.current)||(null===(a=b.current[p])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=C.current[B])||void 0===d?void 0:d.current)||(null===(s=y.current[B])||void 0===s?void 0:s.current)||null}}(),s=d.leftAnchor,v=d.rightAnchor,h=n===i?s:v,g=n===i?v:s,f=null;if(h&&g){var p=h.getBoundingClientRect(),B=g.getBoundingClientRect(),S=a.getBoundingClientRect(),I=p.top+p.height/2;f=B.top-S.top+a.scrollTop+B.height/2-(I-S.top)}else{var T=Math.max(0,n.scrollHeight-n.clientHeight),F=Math.max(0,a.scrollHeight-a.clientHeight);f=T>0?n.scrollTop/T*F:n.scrollTop}var H=Math.max(0,a.scrollHeight-a.clientHeight);f=Math.max(0,Math.min(f,H)),Math.abs(a.scrollTop-f)>1&&(xt.current=!0,a.scrollTop=f,requestAnimationFrame(function(){xt.current=!1}))}}L||Mt(),yt.current||(yt.current=!0,requestAnimationFrame(function(){var t,e,n,i,c,a,d;if(D.current){var s=l.current,v=u.current;if(s&&v&&O.current){if(!j.current){var h=z.current,g=void 0;if("string"==typeof h&&h.includes(r)){var f=h.split(r),p="".concat(f[0]).concat(r).concat(f[1]);g=null===(t=R.current[p])||void 0===t?void 0:t.current}else g=null===(e=R.current[h])||void 0===e?void 0:e.current;if(g){var b=g.getBoundingClientRect();j.current={badgeScreenY:b.top+b.height/2,initialScrollTop:s.scrollTop,leftTop:s.getBoundingClientRect().top,leftBottom:s.getBoundingClientRect().top+s.clientHeight,cTop:null!==(i=null===(n=o.current)||void 0===n?void 0:n.getBoundingClientRect().top)&&void 0!==i?i:0}}}if(j.current){var y=j.current,x=s.scrollTop-y.initialScrollTop,m=y.badgeScreenY-x,C=((c=m,a=y.leftTop,d=y.leftBottom,Math.max(a,Math.min(d,c)))-y.cTop).toString(),A=m>=y.leftTop-4&&m<=y.leftBottom+4;O.current.setAttribute("y1",C),O.current.setAttribute("y2",C),O.current.setAttribute("visibility",A?"visible":"hidden")}}}St(),yt.current=!1}))}},[St,L,J,M,Mt]);return i(function(){G.current=Bt},[Bt]),i(function(){var t=setTimeout(Mt,250),e=function(){return U.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==mt.current&&clearTimeout(mt.current),null!==K.current&&clearTimeout(K.current),window.removeEventListener("resize",e)}},[W,Z,$,g,B,S,v,h,et,Mt,I,T,N,M]),{lines:rt,setLines:ct,overallConnector:lt,setOverallConnector:ut,connectedLines:vt,setConnectedLines:ht,svgDimensions:ft,cachedConnectedPositions:Ct,calculateLines:Bt,calculateLinesRef:G,calculateLinesDebounced:Mt,handleColumnScroll:It}};export{c as useLinesCalculator};
1
+ import{useState as t,useRef as e,useCallback as n,useEffect as i}from"react";import{DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";var c=function(c){var l=c.containerRef,o=c.leftContainerRef,u=c.rightContainerRef;c.svgContainerRef;var a=c.pathRefs,d=c.leftHeaderRef,s=c.rightHeaderRef,v=c.proposedSections,h=c.existingSections,g=c.visibleFields,f=c.leftRefs,p=c.rightRefs,b=c.sectionLeftRefs,y=c.sectionRightRefs,x=c.subSectionLeftRefs,m=c.subSectionRightRefs,R=c.lhsBadgeRefs,C=c.rhsBadgeRefs,A=c.sectionRowRefs,B=c.expandedSections,S=c.expandedSubSections,M=c.connectedSections,T=c.isSideBySide,I=c.activeSideBySideSection,L=c.maintainRelativeOrder,F=c.isGuidelineMode,H=c.cognitiveMap,w=c.getSectionCompareStyle,k=c.getSubSectionCompareStyle,E=c.getDeviationStyleByKey,N=c.isArrowVisible,Y=c.isAnimatingRef,D=c.isSideBySideRef,j=c.sideBySideCacheRef,O=c.sideBySideLineRef,z=c.activeSideBySideSectionRef,P=c.activeSideBySideRightSectionRef,Q=c.connectedLines,X=c.setConnectedLines,q=c.cachedConnectedPositions,G=c.calculateLinesRef,K=c.resizeTimerRef,V=c.scrollLock,J=c.scrollSyncLocked,U=c.handleResizeRef,W=c.activeProposed,Z=c.existingRule,$=c.analysisData,_=c.pendingScrollTargetRef,tt=c.pendingScrollCallbackRef,et=c.resolvedComparisonConfig,nt=c.getFieldData,it=t([]),rt=it[0],ct=it[1],lt=t(null),ot=lt[0],ut=lt[1],at=t([]),dt=at[0],st=at[1],vt=null!=Q?Q:dt,ht=null!=X?X:st,gt=t({width:0,height:0}),ft=gt[0],pt=gt[1],bt=e(!1),yt=e(!1),xt=e(!1),mt=e(null),Rt=e([]),Ct=null!=q?q:Rt,At=function(t,e,n,i,r,c,l){if(Math.abs(i-e)<=1)return c&&l?"M ".concat(t,",").concat(e," L ").concat(n,",").concat(i):c&&!l?"M ".concat(t,",").concat(e," L ").concat(r,",").concat(e):!c&&l?"M ".concat(r,",").concat(e," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i);var o=Math.min(15,Math.abs(r-t),Math.abs(i-e)/2),u=Math.min(15,Math.abs(n-r),Math.abs(i-e)/2),a=i>e?o:-o,d=i>e?u:-u,s=n>r?u:-u;return c&&l?"M ".concat(t,",").concat(e," L ").concat(r-o,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):c&&!l?"M ".concat(t,",").concat(e," L ").concat(r-o,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i):!c&&l?"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i)},Bt=n(function(){var t,e,n,i,c,a,A,N,D,j,O,z,P,Q,X,q,G,K;if(!bt.current&&!Y.current){bt.current=!0;try{if(!l.current)return;var V=function(t){var e=t.split("-"),n=e[0];if(!B[n]&&!1===L)return!1;if(L&&!B["left-".concat(n)]&&!B["right-".concat(n)]&&!B[n])return!1;for(var i=n,r=1;r<e.length-1;r++)if(i+="-".concat(e[r]),!S[i])return!1;return!0},J=l.current.getBoundingClientRect();pt({width:J.width,height:J.height});var U=[];if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;r&&c&&(r.style.height="auto",c.style.height="auto",r.style.minHeight="0px",c.style.minHeight="0px")}),!Y.current){for(var W=0;W<Math.max(v.length,h.length);W++){var Z=null===(t=b.current[W])||void 0===t?void 0:t.current,$=null===(e=y.current[W])||void 0===e?void 0:e.current;Z&&(Z.style.height="auto",Z.style.minHeight="0px"),$&&($.style.height="auto",$.style.minHeight="0px")}L||Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;i&&r&&(i.style.height="auto",r.style.height="auto",i.style.minHeight="0px",r.style.minHeight="0px")}})}var _={};g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var l=r.getBoundingClientRect(),o=c.getBoundingClientRect();_[i]=Math.max(l.height,o.height)}});var tt={left:{},right:{}},et={};if(!Y.current)if(L){if(T&&null!==I)if("number"==typeof I){var nt=I,it=v[nt],rt=null===(c=b.current[nt])||void 0===c?void 0:c.current;rt&&it&&(it.refIndexes||[]).forEach(function(t){var e,n=h.findIndex(function(e){return e.selfIndex===t}),i=null===(e=y.current[n])||void 0===e?void 0:e.current;if(i&&(B["left-".concat(nt)]||B["right-".concat(n)])){var r=Math.max(rt.getBoundingClientRect().height,i.getBoundingClientRect().height);tt.left[nt]=Math.max(tt.left[nt]||0,r),tt.right[n]=Math.max(tt.right[n]||0,r)}})}else{var lt=I.split(r)[2];if(lt){Z=null===(a=x.current[lt])||void 0===a?void 0:a.current,$=null===(A=m.current[lt])||void 0===A?void 0:A.current;if(Z&&$){ot=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);et[lt]=Math.max(et[lt]||0,ot)}}}}else{Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var c=i.getBoundingClientRect(),l=r.getBoundingClientRect(),o=Math.max(c.height,l.height);et[t]=o,i.style.minHeight="".concat(o,"px"),r.style.minHeight="".concat(o,"px")}}});for(W=0;W<Math.min(v.length,h.length);W++){var Z=null===(n=b.current[W])||void 0===n?void 0:n.current,$=null===(i=y.current[W])||void 0===i?void 0:i.current;if(Z&&$){var ot=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);tt.left[W]=ot,tt.right[W]=ot}}}if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var l=_[i];r.style.minHeight="".concat(l,"px"),c.style.minHeight="".concat(l,"px")}}),Y.current||(Object.entries(tt.left).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=b.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(tt.right).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=y.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),L||Object.keys(et).forEach(function(t){var e,n,i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&et[t]){var c=et[t];i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}})),!F){v.forEach(function(t,e){var n,i=null===(n=b.current[e])||void 0===n?void 0:n.current;if(i){var r=function(t,e){var n=(t.refIndexes||[]).map(function(t){return h.findIndex(function(e){return e.selfIndex===t})}).filter(function(t){return-1!==t});return!n.length&&h[e]?[e]:Array.from(new Set(n))}(t,e);r.forEach(function(n){var r,c,l,a,d,s,v,g,f,p,b=null===(r=y.current[n])||void 0===r?void 0:r.current;if(b){var x=i.getBoundingClientRect(),m=b.getBoundingClientRect(),R=x.right-J.left,C=m.left-J.left,A=x.top+18-J.top,B=m.top+18-J.top;if(L&&T&&I===e){var S=null!==(l=null===(c=o.current)||void 0===c?void 0:c.getBoundingClientRect().top)&&void 0!==l?l:0,M=null!==(d=null===(a=u.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==d?d:0,F=S+(null!==(v=null===(s=o.current)||void 0===s?void 0:s.clientHeight)&&void 0!==v?v:1/0),k=M+(null!==(f=null===(g=u.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0),E=function(t,e,n){return Math.max(e,Math.min(n,t))};A=E(x.top+18,S,F)-J.top,B=E(m.top+18,M,k)-J.top}var N=w(e);N&&U.push({id:"line-".concat(e,"-").concat(n),x1:R,y1:A,x2:C,y2:B,style:N,sectionIdx:e,targetRightIdx:n,isSubSection:!1,hasCognitive:!!((null==t?void 0:t.cognitiveData)||(null===(p=h[n])||void 0===p?void 0:p.cognitiveData)||(null==t?void 0:t.nodeId)&&H[t.nodeId])})}})}})}if(!F&&T&&"string"==typeof I&&I.includes(r)){var at=I.split(r),dt=at[0],st=at[1],vt=at[2],gt=(at[3],"".concat(dt).concat(r).concat(st)),ft=null===(N=R.current[gt])||void 0===N?void 0:N.current,yt=null===(D=C.current[gt])||void 0===D?void 0:D.current;if(ft&&yt){var xt=ft.getBoundingClientRect(),mt=yt.getBoundingClientRect(),Rt=xt.right-J.left,Bt=mt.left-J.left,Mt=xt.top+xt.height/2-J.top,Tt=mt.top+mt.height/2-J.top;if(L){var It=null!==(O=null===(j=o.current)||void 0===j?void 0:j.getBoundingClientRect().top)&&void 0!==O?O:0,Lt=null!==(P=null===(z=u.current)||void 0===z?void 0:z.getBoundingClientRect().top)&&void 0!==P?P:0,Ft=It+(null!==(X=null===(Q=o.current)||void 0===Q?void 0:Q.clientHeight)&&void 0!==X?X:1/0),Ht=Lt+(null!==(G=null===(q=u.current)||void 0===q?void 0:q.clientHeight)&&void 0!==G?G:1/0),wt=function(t,e,n){return Math.max(e,Math.min(n,t))};Mt=wt(xt.top+xt.height/2,It,Ft)-J.top,Tt=wt(mt.top+mt.height/2,Lt,Ht)-J.top}var kt=null!==(K=E(dt,st))&&void 0!==K?K:k(vt);kt&&U.push({id:"line-subsec-".concat(gt),x1:Rt,y1:Mt,x2:Bt,y2:Tt,style:kt,sectionIdx:Number(vt.split("-")[0]),isSubSection:!0,subSectionKeyPath:I})}}if(ct(U),d.current&&s.current){var Et=d.current.getBoundingClientRect(),Nt=s.current.getBoundingClientRect(),Yt=(Et.top+Et.height/2-J.top+Nt.top+Nt.height/2-J.top)/2;ut({x1:Et.right-J.left,x2:Nt.left-J.left,y:Yt})}else ut(null);if(M.size>0){var Dt=[],jt=o.current,Ot=u.current;if(jt&&Ot){var zt=[],Pt=jt.getBoundingClientRect().top,Qt=Ot.getBoundingClientRect().top,Xt=Pt+jt.clientHeight,qt=Qt+Ot.clientHeight,Gt=jt.scrollTop,Kt=Ot.scrollTop,Vt=J.top,Jt=function(t,e,n){return Math.max(e,Math.min(n,t))};M.forEach(function(t){var e,n,i,c,l,o,u,a,d;if(F){var s=null,g=null,f=null;if("string"==typeof t&&t.includes(r)){var p=t.split(r),b=p[0],y=p[1],x=p[2],m="".concat(b).concat(r).concat(y);s=null===(e=R.current[m])||void 0===e?void 0:e.current,f=null!==(n=E(b,y))&&void 0!==n?n:k(x),g=Number((null==x?void 0:x.split("-")[0])||0)}else g=Number(t),s=null===(i=R.current[g])||void 0===i?void 0:i.current,f=w(g);if(!s)return;var A=document.querySelectorAll('[id^="guideline-target-"]');A.forEach(function(e,n){var i=s.getBoundingClientRect(),c=e.getBoundingClientRect(),l=i.right-J.left,o=c.left-J.left-0,u=l+75,a=i.top+i.height/2,d=c.top+c.height/2,v=a-Pt+Gt,h=d-Qt+Kt,g="conn-guide-".concat(t,"-").concat(n),p="";"string"==typeof t&&t.includes(r)?p=(t.split(r)[2]||"").split("-").map(function(t){return Number(t)+1}).join("."):p=String(Number(t)+1);var b=String.fromCharCode(97+n),y=1===A.length?null:"".concat(p,"(").concat(b,")");zt.push({lhsScrollY:v,rhsScrollY:h,x1:l,x2:o,containerTop:Vt,leftIdx:t,rhsArrayIdx:n,styleColor:(null==f?void 0:f.badgeBorder)||"#6366F1",styleBg:(null==f?void 0:f.badgeBg)||"#FFFFFF",styleText:(null==f?void 0:f.badgeText)||"#A16207",styleId:g,centerX:u});var x=Jt(a,Pt,Xt),m=Jt(d,Qt,qt),R=x-Vt,C=m-Vt,B=At(l,R,o,C,u,a>=Pt-4&&a<=Xt+4,d>=Qt-4&&d<=qt+4);Dt.push({id:g,pathD:B,style:f,leftIdx:t,rhsArrayIdx:n,x1:l,x2:o,y1:R,y2:C,centerX:u,matchLabel:y,isGuideline:!0})})}else if("string"==typeof t&&t.includes(r)){var B=t.split(r),S=(b=B[0],y=B[1],x=B[2],B[3],m="".concat(b).concat(r).concat(y),null===(c=R.current[m])||void 0===c?void 0:c.current),M=null===(l=C.current[m])||void 0===l?void 0:l.current;if(!S||!M)return;var T=S.getBoundingClientRect(),I=M.getBoundingClientRect(),H=null!==(o=E(b,y))&&void 0!==o?o:k(x),N=T.right-J.left,Y=I.left-J.left-0,D=N+75,j=T.top+T.height/2,O=I.top+I.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-subsec-".concat(m),X=((x||"").split("-").map(function(t){return Number(t)+1}).join("."),null);zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:t,rhsArrayIdx:t,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:t,rhsArrayIdx:t,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}else if(L){var V=t,U=v[V];if(!(null===(d=null==U?void 0:U.refIndexes)||void 0===d?void 0:d.length))return;U.refIndexes.forEach(function(e,n){var i,r,c=h.findIndex(function(t){return t.selfIndex===e});if(-1!==c){var l=null===(i=R.current[V])||void 0===i?void 0:i.current,o=null===(r=C.current[c])||void 0===r?void 0:r.current;if(l&&o){var u=l.getBoundingClientRect(),a=o.getBoundingClientRect(),d=w(V),s=u.right-J.left,v=a.left-J.left-0,g=s+75,f=u.top+u.height/2,p=a.top+a.height/2,b=f-Pt+Gt,y=p-Qt+Kt,x="conn-".concat(V,"-").concat(c),m=String(Number(t)+1),A=String.fromCharCode(97+n),B=1===U.refIndexes.length?null:"".concat(m,"(").concat(A,")");zt.push({lhsScrollY:b,rhsScrollY:y,x1:s,x2:v,containerTop:Vt,leftIdx:V,rhsArrayIdx:c,styleColor:(null==d?void 0:d.badgeBorder)||"#6366F1",styleBg:(null==d?void 0:d.badgeBg)||"#FFFFFF",styleText:(null==d?void 0:d.badgeText)||"#A16207",styleId:x,centerX:g});var S=Jt(f,Pt,Xt),M=Jt(p,Qt,qt),T=S-Vt,I=M-Vt,L=At(s,T,v,I,g,f>=Pt-4&&f<=Xt+4,p>=Qt-4&&p<=qt+4);Dt.push({id:x,pathD:L,style:d,leftIdx:V,rhsArrayIdx:c,x1:s,x2:v,y1:T,y2:I,matchLabel:B})}}})}else{var W=t,Z=W;S=null===(u=R.current[W])||void 0===u?void 0:u.current,M=null===(a=C.current[Z])||void 0===a?void 0:a.current;if(!S||!M)return;T=S.getBoundingClientRect(),I=M.getBoundingClientRect(),H=w(W),N=T.right-J.left,Y=I.left-J.left-0,D=N+75,j=T.top+T.height/2,O=I.top+I.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-".concat(W,"-").concat(Z),String(Number(t)+1),X=null;zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:W,rhsArrayIdx:Z,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var $,_;q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:W,rhsArrayIdx:Z,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}}),Ct.current=zt}ht(Dt),setTimeout(function(){return St()},10)}else ht([]),Ct.current=[],setTimeout(function(){return St()},10)}catch(t){console.error("Line render safe fail: ",t)}finally{bt.current=!1}}},[g,v,h,H,et,nt,w,E,L,T,I,M,B,S,F]),St=n(function(){var t,e,n,i,r,c,d,s,v,h,g,f,p,b,y,x,m,R,C,A=Ct.current;if(!A.length)return null===(t=a.current["guideline-up-stroke"])||void 0===t||t.setAttribute("visibility","hidden"),null===(e=a.current["guideline-up-badge"])||void 0===e||e.setAttribute("visibility","hidden"),null===(n=a.current["guideline-down-stroke"])||void 0===n||n.setAttribute("visibility","hidden"),void(null===(i=a.current["guideline-down-badge"])||void 0===i||i.setAttribute("visibility","hidden"));if(!Y.current){var B=null!==(c=null===(r=o.current)||void 0===r?void 0:r.scrollTop)&&void 0!==c?c:0,S=null!==(s=null===(d=u.current)||void 0===d?void 0:d.scrollTop)&&void 0!==s?s:0,M=null!==(h=null===(v=o.current)||void 0===v?void 0:v.clientHeight)&&void 0!==h?h:1/0,T=null!==(f=null===(g=u.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0,I=null!==(b=null===(p=o.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==b?b:0,L=null!==(x=null===(y=u.current)||void 0===y?void 0:y.getBoundingClientRect().top)&&void 0!==x?x:0,F=I+M,H=L+T,w=null===(m=l.current)||void 0===m?void 0:m.getBoundingClientRect(),k=null!==(R=null==w?void 0:w.top)&&void 0!==R?R:0,E=null!==(C=null==w?void 0:w.height)&&void 0!==C?C:1/0,N=function(t,e,n){return Math.max(e,Math.min(n,t))},D=0,j=0,O=0,z=0,P="#6366F1",Q="#A16207",X=!1,q=0;if(A.forEach(function(t){var e=t.lhsScrollY-B+I,n=t.rhsScrollY-S+L,i=a.current[t.styleId+"-stroke"],r=a.current[t.styleId+"-bg"],c=a.current[t.styleId+"-btn"],l=a.current[t.styleId+"-number"];if(i||r){var o=N(e,I,F),u=N(n,L,H),d=o-k,s=u-k,v=e>=I-4&&e<=F+4,h=n>=L-4&&n<=H+4,g=!0;X=!0;var f=t.centerX||t.x1+75;0===O&&(O=t.x1,z=d,q=f,P=t.styleColor,t.styleBg,Q=t.styleText||"#A16207"),n<L-4?(D++,g=!1):n>H+4&&(j++,g=!1);var p=At(t.x1,d,t.x2,s,q,v,h);i&&(g&&p?(i.setAttribute("visibility","visible"),i.setAttribute("d",p)):i.setAttribute("visibility","hidden")),r&&(g&&p?(r.setAttribute("visibility","visible"),r.setAttribute("d",p)):r.setAttribute("visibility","hidden")),c&&(v&&g?(c.setAttribute("visibility","visible"),c.setAttribute("y",String(d-12))):c.setAttribute("visibility","hidden")),l&&(v&&g?(l.setAttribute("visibility","visible"),l.setAttribute("transform","translate(".concat(t.x2-42,", ").concat(s,")"))):l.setAttribute("visibility","hidden"))}}),X&&q>0){var G=a.current["guideline-up-stroke"],K=a.current["guideline-up-badge"],V=a.current["guideline-up-arrow"],J=a.current["guideline-up-text"],U=a.current["guideline-up-badge-rect"];if(D>0){var W=Math.max(15,L-k+15),Z=Math.min(15,Math.abs(q-O),Math.max(0,z-W)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z-Z," L ").concat(q,",").concat(W);null==G||G.setAttribute("visibility","visible"),null==G||G.setAttribute("d",$),null==G||G.setAttribute("stroke",P),null==K||K.setAttribute("visibility","visible"),null==K||K.setAttribute("transform","translate(".concat(q,", ").concat(W,")")),V&&V.setAttribute("fill",P),J&&(J.textContent="+".concat(D),J.setAttribute("fill",Q)),U&&U.setAttribute("stroke",P)}else null==G||G.setAttribute("visibility","hidden"),null==K||K.setAttribute("visibility","hidden");var _=a.current["guideline-down-stroke"],tt=a.current["guideline-down-badge"],et=a.current["guideline-down-arrow"],nt=a.current["guideline-down-text"],it=a.current["guideline-down-badge-rect"];if(j>0){var rt=Math.min(E-15,H-k-15);Z=Math.min(15,Math.abs(q-O),Math.max(0,rt-z)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z+Z," L ").concat(q,",").concat(rt);null==_||_.setAttribute("visibility","visible"),null==_||_.setAttribute("d",$),null==_||_.setAttribute("stroke",P),null==tt||tt.setAttribute("visibility","visible"),null==tt||tt.setAttribute("transform","translate(".concat(q,", ").concat(rt,")")),et&&et.setAttribute("fill",P),nt&&(nt.textContent="+".concat(j),nt.setAttribute("fill",Q)),it&&it.setAttribute("stroke",P)}else null==_||_.setAttribute("visibility","hidden"),null==tt||tt.setAttribute("visibility","hidden")}}},[]),Mt=n(function(){Ct.current.length>0&&!Y.current||(null!==mt.current&&clearTimeout(mt.current),mt.current=setTimeout(function(){G.current(),mt.current=null},50))},[]),Tt=n(function(t){if(null!==_.current&&tt.current&&Math.abs(t.currentTarget.scrollTop-_.current)<=2){var e=tt.current;_.current=null,tt.current=null,e()}if(!xt.current&&!V.current){if(L&&J&&(D.current||M.size>0)){var n=t.currentTarget,i=o.current,c=u.current,a=n===i?c:n===c?i:null;if(n&&a){var d=function(){var t,e,n,i,c,l,o,u,a,d,s,v=z.current,h=P.current;if(null===v)return{leftAnchor:null,rightAnchor:null};if("string"==typeof v&&v.includes(r)){var g=v.split(r),f="".concat(g[0]).concat(r).concat(g[1]);return{leftAnchor:(null===(t=R.current[f])||void 0===t?void 0:t.current)||(null===(e=x.current[g[2]])||void 0===e?void 0:e.current)||(null===(n=b.current[Number(g[2])])||void 0===n?void 0:n.current)||null,rightAnchor:(null===(i=C.current[f])||void 0===i?void 0:i.current)||(null===(c=m.current[g[3]])||void 0===c?void 0:c.current)||(null===(l=y.current[Number(g[3])])||void 0===l?void 0:l.current)||null}}var p=Number(v),B=null!==h?Number(h):p;return{leftAnchor:(null===(o=R.current[p])||void 0===o?void 0:o.current)||(null===(u=A.current[p])||void 0===u?void 0:u.current)||(null===(a=b.current[p])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=C.current[B])||void 0===d?void 0:d.current)||(null===(s=y.current[B])||void 0===s?void 0:s.current)||null}}(),s=d.leftAnchor,v=d.rightAnchor,h=n===i?s:v,g=n===i?v:s,f=null;if(h&&g){var p=h.getBoundingClientRect(),B=g.getBoundingClientRect(),S=a.getBoundingClientRect(),T=p.top+p.height/2;f=B.top-S.top+a.scrollTop+B.height/2-(T-S.top)}else{var I=Math.max(0,n.scrollHeight-n.clientHeight),F=Math.max(0,a.scrollHeight-a.clientHeight);f=I>0?n.scrollTop/I*F:n.scrollTop}var H=Math.max(0,a.scrollHeight-a.clientHeight);f=Math.max(0,Math.min(f,H)),Math.abs(a.scrollTop-f)>1&&(xt.current=!0,a.scrollTop=f,requestAnimationFrame(function(){xt.current=!1}))}}L||Mt(),yt.current||(yt.current=!0,requestAnimationFrame(function(){var t,e,n,i,c,a,d;if(D.current){var s=o.current,v=u.current;if(s&&v&&O.current){if(!j.current){var h=z.current,g=void 0;if("string"==typeof h&&h.includes(r)){var f=h.split(r),p="".concat(f[0]).concat(r).concat(f[1]);g=null===(t=R.current[p])||void 0===t?void 0:t.current}else g=null===(e=R.current[h])||void 0===e?void 0:e.current;if(g){var b=g.getBoundingClientRect();j.current={badgeScreenY:b.top+b.height/2,initialScrollTop:s.scrollTop,leftTop:s.getBoundingClientRect().top,leftBottom:s.getBoundingClientRect().top+s.clientHeight,cTop:null!==(i=null===(n=l.current)||void 0===n?void 0:n.getBoundingClientRect().top)&&void 0!==i?i:0}}}if(j.current){var y=j.current,x=s.scrollTop-y.initialScrollTop,m=y.badgeScreenY-x,C=((c=m,a=y.leftTop,d=y.leftBottom,Math.max(a,Math.min(d,c)))-y.cTop).toString(),A=m>=y.leftTop-4&&m<=y.leftBottom+4;O.current.setAttribute("y1",C),O.current.setAttribute("y2",C),O.current.setAttribute("visibility",A?"visible":"hidden")}}}St(),yt.current=!1}))}},[St,L,J,M,Mt]);return i(function(){G.current=Bt},[Bt]),i(function(){var t=setTimeout(Mt,250),e=function(){return U.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==mt.current&&clearTimeout(mt.current),null!==K.current&&clearTimeout(K.current),window.removeEventListener("resize",e)}},[W,Z,$,g,B,S,v,h,et,Mt,T,I,N,M]),{lines:rt,setLines:ct,overallConnector:ot,setOverallConnector:ut,connectedLines:vt,setConnectedLines:ht,svgDimensions:ft,cachedConnectedPositions:Ct,calculateLines:Bt,calculateLinesRef:G,calculateLinesDebounced:Mt,handleColumnScroll:Tt}};export{c as useLinesCalculator};
2
2
  //# sourceMappingURL=useLinesCalculator.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as r,Fragment as o,jsx as t}from"react/jsx-runtime";import{useState as i,useRef as n,useEffect as l}from"react";import{Box as a,Typography as d,Tooltip as s,Dialog as c,IconButton as f,Chip as h}from"@mui/material";import g from"@mui/icons-material/Close";import m from"@mui/icons-material/Fullscreen";import u from"@monaco-editor/react";import*as p from"monaco-editor";import b from"@mui/icons-material/DarkMode";import x from"@mui/icons-material/LightMode";var v={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},k={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},w=function(r){var o=r.isDarkMode,i=r.onChange;return t(a,e({onClick:function(){return i(!o)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:o?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:o?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:o?"flex-end":"flex-start"}},{children:t(a,e({sx:{width:18,height:18,borderRadius:"50%",bgcolor:o?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t(o?b:x,{sx:{fontSize:11,color:"#fff"}})}))}))},C=function(i){var d=i.content,s=i.selectedTag,c=i.highlightVariable,f=i.isDarkMode,h=i.height,g=void 0===h?250:h,m=i.fontSize,b=void 0===m?12:m,x=n(),w=n();return l(function(){if(s&&x.current&&w.current){var e=x.current,r=e.getModel();if(r){for(var o=r.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var n=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(n&&n[1].trim().toLowerCase()===s.toLowerCase()){t=i+1;break}}if(t>0){var l=t,a="</".concat(s.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(a)){l=i+1;break}e.setSelection(new w.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var d=e.deltaDecorations([],[{range:new w.current.Range(t,1,l,o[l-1].length+1),options:{isWholeLine:!0,className:"promptemon-highlight",inlineClassName:"promptemon-highlight"}}]);setTimeout(function(){return e.deltaDecorations(d,[])},2e3)}}}},[s]),l(function(){if(c&&x.current&&w.current){var e=x.current,r=e.getModel();if(r){for(var o=r.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var n=o[i].indexOf(c);-1!==n;)t.push(new p.Range(i+1,n+1,i+1,n+c.length+1)),n=o[i].indexOf(c,n+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var l=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(l,[])},2e3)}}}},[c]),l(function(){w.current&&w.current.editor.setTheme(f?"promptemonDark":"promptemonLight")},[f]),r(o,{children:[t("style",{children:"\n .promptemon-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),r(a,e({sx:{width:"100%",height:g,display:"flex",flexDirection:"column"}},{children:[t(a,{sx:{width:"100%",height:20,bgcolor:f?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),t(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:t(u,{onMount:function(e,r){x.current=e,w.current=r,r.editor.defineTheme("promptemonDark",v),r.editor.defineTheme("promptemonLight",k),r.editor.setTheme(f?"promptemonDark":"promptemonLight"),r.languages.register({id:"promptemonLang"}),r.languages.setMonarchTokensProvider("promptemonLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),r.languages.registerFoldingRangeProvider("promptemonLang",{provideFoldingRanges:function(e){var r=e.getLinesContent(),o=[],t=[];return r.forEach(function(e,r){var i=r+1,n=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),l=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(n&&!e.includes("/>")&&t.push({tag:n[1],start:i}),l)for(var a=l[1],d=t.length-1;d>=0;d--)if(t[d].tag===a){o.push({start:t[d].start,end:i}),t.splice(d,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonDark",v),e.editor.defineTheme("promptemonLight",k),e.editor.setTheme(f?"promptemonDark":"promptemonLight")},theme:f?"promptemonDark":"promptemonLight",value:d,language:"promptemonLang",onChange:function(){},options:{fontSize:b,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),t(a,{sx:{width:"100%",height:20,bgcolor:f?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},y=function(n){var l=n.title,u=n.description,p=n.content,b=n.height,x=void 0===b?250:b,v=n.selectedTag,k=n.highlightVariable,y=i(!0),F=y[0],L=y[1],z=i(!1),D=z[0],B=z[1];return r(o,{children:[r(a,e({sx:{border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:[r(a,e({sx:{px:1.5,py:.75,bgcolor:"#f9fafb",borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(d,e({sx:{fontSize:"0.72rem",color:"#374151",fontWeight:600}},{children:l})),r(a,e({sx:{display:"flex",alignItems:"center",gap:.75}},{children:[t(w,{isDarkMode:F,onChange:L}),t(s,e({title:"Fullscreen",placement:"top"},{children:t(a,e({onClick:function(){return B(!0)},sx:{cursor:"pointer",display:"flex",alignItems:"center",p:.3,borderRadius:"4px","&:hover":{bgcolor:"#e5e7eb"}}},{children:t(m,{sx:{fontSize:"0.9rem",color:"#6b7280"}})}))}))]}))]})),t(a,e({sx:{height:x,bgcolor:F?"#030202":"#fff"}},{children:t(C,{content:p,selectedTag:v,highlightVariable:k,isDarkMode:F,height:x,fontSize:12})}))]})),r(c,e({open:D,onClose:function(){return B(!1)},maxWidth:!1,PaperProps:{sx:{width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"}}},{children:[r(a,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[t(d,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:l})),t(f,e({size:"small",onClick:function(){return B(!1)}},{children:t(g,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),r(a,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[u&&r(a,e({sx:{width:"35%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[r(a,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[t(h,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}}),t(d,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:l}))]})),t(a,e({sx:{flex:1,p:2,overflowY:"auto"}},{children:r(a,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[t(d,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),t(d,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:u}))]}))}))]})),r(a,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[r(a,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(d,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),t(w,{isDarkMode:F,onChange:L})]})),t(a,e({sx:{flex:1,minHeight:0,p:1.5}},{children:t(C,{content:p,selectedTag:v,highlightVariable:k,isDarkMode:F,height:"100%",fontSize:13})}))]}))]}))]}))]})};export{y as default};
1
+ import{__assign as e}from"tslib";import{jsxs as r,Fragment as o,jsx as t}from"react/jsx-runtime";import{useState as i,useRef as n,useEffect as l}from"react";import{Box as a,Typography as d,Tooltip as s,Dialog as c,IconButton as f,Chip as h}from"@mui/material";import g from"@mui/icons-material/Close";import m from"@mui/icons-material/Fullscreen";import u from"@monaco-editor/react";import p from"@mui/icons-material/DarkMode";import b from"@mui/icons-material/LightMode";var x={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},v={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},k=function(r){var o=r.isDarkMode,i=r.onChange;return t(a,e({onClick:function(){return i(!o)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:o?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:o?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:o?"flex-end":"flex-start"}},{children:t(a,e({sx:{width:18,height:18,borderRadius:"50%",bgcolor:o?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t(o?p:b,{sx:{fontSize:11,color:"#fff"}})}))}))},w=function(i){var d=i.content,s=i.selectedTag,c=i.highlightVariable,f=i.isDarkMode,h=i.height,g=void 0===h?250:h,m=i.fontSize,p=void 0===m?12:m,b=n(),k=n();return l(function(){if(s&&b.current&&k.current){var e=b.current,r=e.getModel();if(r){for(var o=r.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var n=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(n&&n[1].trim().toLowerCase()===s.toLowerCase()){t=i+1;break}}if(t>0){var l=t,a="</".concat(s.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(a)){l=i+1;break}e.setSelection(new k.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var d=e.deltaDecorations([],[{range:new k.current.Range(t,1,l,o[l-1].length+1),options:{isWholeLine:!0,className:"promptemon-highlight",inlineClassName:"promptemon-highlight"}}]);setTimeout(function(){return e.deltaDecorations(d,[])},2e3)}}}},[s]),l(function(){if(c&&b.current&&k.current){var e=b.current,r=e.getModel();if(r){for(var o=r.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var n=o[i].indexOf(c);-1!==n;)t.push(new k.current.Range(i+1,n+1,i+1,n+c.length+1)),n=o[i].indexOf(c,n+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var l=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(l,[])},2e3)}}}},[c]),l(function(){k.current&&k.current.editor.setTheme(f?"promptemonDark":"promptemonLight")},[f]),r(o,{children:[t("style",{children:"\n .promptemon-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),r(a,e({sx:{width:"100%",height:g,display:"flex",flexDirection:"column"}},{children:[t(a,{sx:{width:"100%",height:20,bgcolor:f?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),t(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:t(u,{onMount:function(e,r){b.current=e,k.current=r,r.editor.defineTheme("promptemonDark",x),r.editor.defineTheme("promptemonLight",v),r.editor.setTheme(f?"promptemonDark":"promptemonLight"),r.languages.register({id:"promptemonLang"}),r.languages.setMonarchTokensProvider("promptemonLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),r.languages.registerFoldingRangeProvider("promptemonLang",{provideFoldingRanges:function(e){var r=e.getLinesContent(),o=[],t=[];return r.forEach(function(e,r){var i=r+1,n=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),l=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(n&&!e.includes("/>")&&t.push({tag:n[1],start:i}),l)for(var a=l[1],d=t.length-1;d>=0;d--)if(t[d].tag===a){o.push({start:t[d].start,end:i}),t.splice(d,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonDark",x),e.editor.defineTheme("promptemonLight",v),e.editor.setTheme(f?"promptemonDark":"promptemonLight")},theme:f?"promptemonDark":"promptemonLight",value:d,language:"promptemonLang",onChange:function(){},options:{fontSize:p,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),t(a,{sx:{width:"100%",height:20,bgcolor:f?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},C=function(n){var l=n.title,u=n.description,p=n.content,b=n.height,x=void 0===b?250:b,v=n.selectedTag,C=n.highlightVariable,y=i(!0),F=y[0],L=y[1],z=i(!1),D=z[0],B=z[1];return r(o,{children:[r(a,e({sx:{border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:[r(a,e({sx:{px:1.5,py:.75,bgcolor:"#f9fafb",borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(d,e({sx:{fontSize:"0.72rem",color:"#374151",fontWeight:600}},{children:l})),r(a,e({sx:{display:"flex",alignItems:"center",gap:.75}},{children:[t(k,{isDarkMode:F,onChange:L}),t(s,e({title:"Fullscreen",placement:"top"},{children:t(a,e({onClick:function(){return B(!0)},sx:{cursor:"pointer",display:"flex",alignItems:"center",p:.3,borderRadius:"4px","&:hover":{bgcolor:"#e5e7eb"}}},{children:t(m,{sx:{fontSize:"0.9rem",color:"#6b7280"}})}))}))]}))]})),t(a,e({sx:{height:x,bgcolor:F?"#030202":"#fff"}},{children:t(w,{content:p,selectedTag:v,highlightVariable:C,isDarkMode:F,height:x,fontSize:12})}))]})),r(c,e({open:D,onClose:function(){return B(!1)},maxWidth:!1,PaperProps:{sx:{width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"}}},{children:[r(a,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[t(d,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:l})),t(f,e({size:"small",onClick:function(){return B(!1)}},{children:t(g,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),r(a,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[u&&r(a,e({sx:{width:"35%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[r(a,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[t(h,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}}),t(d,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:l}))]})),t(a,e({sx:{flex:1,p:2,overflowY:"auto"}},{children:r(a,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[t(d,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),t(d,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:u}))]}))}))]})),r(a,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[r(a,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(d,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),t(k,{isDarkMode:F,onChange:L})]})),t(a,e({sx:{flex:1,minHeight:0,p:1.5}},{children:t(w,{content:p,selectedTag:v,highlightVariable:C,isDarkMode:F,height:"100%",fontSize:13})}))]}))]}))]}))]})};export{C as default};
2
2
  //# sourceMappingURL=PromptemonBlockViewer.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as o,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as r,useRef as l,useEffect as d}from"react";import{Box as a,Stack as c,IconButton as s,Typography as u,Button as f,Tooltip as p,Chip as h,TextField as g,Accordion as m,AccordionSummary as x,AccordionDetails as b,Select as v,MenuItem as y,Divider as w,Dialog as S}from"@mui/material";import z from"@mui/icons-material/ExpandMore";import C from"@mui/icons-material/EditOutlined";import _ from"@mui/icons-material/Close";import k from"@mui/icons-material/ArrowBack";import I from"@mui/icons-material/NavigateBefore";import W from"@mui/icons-material/NavigateNext";import R from"@mui/icons-material/InfoOutlined";import A from"@mui/icons-material/AutoFixHighOutlined";import B from"@mui/icons-material/Check";import F from"@mui/icons-material/Add";import L from"@mui/icons-material/DeleteOutline";import D from"@monaco-editor/react";import*as M from"monaco-editor";import T from"@mui/icons-material/DarkMode";import V from"@mui/icons-material/LightMode";var E={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},O={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},P=function(n){var i=n.description,c=r(!1),s=c[0],f=c[1],p=r(!1),h=p[0],g=p[1],m=l(null);return d(function(){var e=m.current;e&&g(e.scrollHeight>e.clientHeight+1)},[i,s]),o(a,e({sx:{mt:1.5,border:"1px solid #e5e7eb",borderRadius:2,bgcolor:"#fff",display:"flex",flexDirection:"column",px:1.25,py:1}},{children:[t(u,e({ref:m,component:"div",sx:e({fontSize:11,color:"#6b7280",lineHeight:1.5,overflowY:s?"auto":"hidden",maxHeight:s?"calc(1.6em * 5)":"calc(1.6em * 3)",whiteSpace:"normal",display:s?"block":"-webkit-box"},s?{}:{WebkitBoxOrient:"vertical",WebkitLineClamp:3})},{children:i})),h&&t(u,e({component:"span",onClick:function(){return f(function(e){return!e})},sx:{mt:.75,alignSelf:"flex-end",fontSize:10,color:"#7c3aed",cursor:"pointer",fontWeight:500}},{children:s?"View less":"View more"}))]}))},j=function(n){var i=n.value,l=n.onChange,d=n.onDelete,f=r(!1),p=f[0],h=f[1];return o(a,e({sx:{display:"flex",alignItems:"flex-start",gap:1,p:1,border:"1px solid #e5e7eb",borderRadius:"8px",bgcolor:"#fff"}},{children:[t(a,e({sx:{width:18,height:18,borderRadius:"4px",bgcolor:"#f1f5f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,color:"#64748b",flexShrink:0,mt:.1}},{children:"a"})),p?t(g,{autoFocus:!0,value:i,onChange:function(e){return l(e.target.value)},onBlur:function(){return h(!1)},size:"small",fullWidth:!0,multiline:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:12.5}}}):t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55,flex:1}},{children:i})),o(c,e({direction:"row",gap:.25,sx:{flexShrink:0}},{children:[t(s,e({size:"small",onClick:function(){return h(!0)},sx:{color:"#6b7280"}},{children:t(C,{sx:{fontSize:14}})})),t(s,e({size:"small",onClick:d,sx:{color:"#dc2626"}},{children:t(L,{sx:{fontSize:14}})}))]}))]}))},N=function(n){var o=n.isDarkMode,i=n.onChange;return t(a,e({onClick:function(){return i(!o)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:o?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:o?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:o?"flex-end":"flex-start"}},{children:t(a,e({sx:{width:18,height:18,borderRadius:"50%",bgcolor:o?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t(o?T:V,{sx:{fontSize:11,color:"#fff"}})}))}))},G=function(n){var r=n.content,c=n.selectedTag,s=n.highlightVariable,u=n.isDarkMode,f=n.height,p=void 0===f?250:f,h=n.fontSize,g=void 0===h?12:h,m=l(),x=l();return d(function(){if(c&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var r=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(r&&r[1].trim().toLowerCase()===c.toLowerCase()){t=i+1;break}}if(t>0){var l=t,d="</".concat(c.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(d)){l=i+1;break}e.setSelection(new x.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var a=e.deltaDecorations([],[{range:new x.current.Range(t,1,l,o[l-1].length+1),options:{isWholeLine:!0,className:"promptemon-viewer-highlight",inlineClassName:"promptemon-viewer-highlight"}}]);setTimeout(function(){return e.deltaDecorations(a,[])},2e3)}}}},[c]),d(function(){if(s&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var r=o[i].indexOf(s);-1!==r;)t.push(new M.Range(i+1,r+1,i+1,r+s.length+1)),r=o[i].indexOf(s,r+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var l=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-viewer-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(l,[])},2e3)}}}},[s]),d(function(){x.current&&x.current.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},[u]),o(i,{children:[t("style",{children:"\n .promptemon-viewer-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-viewer-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),o(a,e({sx:{width:"100%",height:p,display:"flex",flexDirection:"column"}},{children:[t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),t(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:t(D,{onMount:function(e,n){m.current=e,x.current=n,n.editor.defineTheme("promptemonViewerDark",E),n.editor.defineTheme("promptemonViewerLight",O),n.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight"),n.languages.register({id:"promptemonViewerLang"}),n.languages.setMonarchTokensProvider("promptemonViewerLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),n.languages.registerFoldingRangeProvider("promptemonViewerLang",{provideFoldingRanges:function(e){var n=e.getLinesContent(),o=[],t=[];return n.forEach(function(e,n){var i=n+1,r=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),l=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(r&&!e.includes("/>")&&t.push({tag:r[1],start:i}),l)for(var d=l[1],a=t.length-1;a>=0;a--)if(t[a].tag===d){o.push({start:t[a].start,end:i}),t.splice(a,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonViewerDark",E),e.editor.defineTheme("promptemonViewerLight",O),e.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},theme:u?"promptemonViewerDark":"promptemonViewerLight",value:r,language:"promptemonViewerLang",onChange:function(){},options:{fontSize:g,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},H=function(i){var l,d,k,I,W=i.block,A=i.isExtracted,D=i.isSaved,M=i.showEditMode,T=i.onBlockUpdate,V=i.onTagSelect,E=i.onVariableSelect,O=i.categories,N=i.subCategories,G=i.selectedCategoryId,H=i.selectedSubCategoryId,Z=i.onCategoryChange,U=i.onSubCategoryChange,Y=r(!0),q=Y[0],J=Y[1],K=r(!0),Q=K[0],X=K[1],$=r(!0),ee=$[0],ne=$[1],oe=r(!0),te=oe[0],ie=oe[1],re=r(!1),le=re[0],de=re[1],ae=r(!0),ce=ae[0],se=ae[1],ue=r(!0),fe=ue[0],pe=ue[1],he=r(!1),ge=he[0],me=he[1],xe=r(!1),be=xe[0],ve=xe[1],ye=r(!1),we=ye[0],Se=ye[1],ze=r((null==W?void 0:W.title)||""),Ce=ze[0],_e=ze[1],ke=r((null==W?void 0:W.short_description)||""),Ie=ke[0],We=ke[1],Re=r((null==W?void 0:W.members)||[]),Ae=Re[0],Be=Re[1],Fe=r(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Le=Fe[0],De=Fe[1],Me=r(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Te=Me[0],Ve=Me[1],Ee=r(!1),Oe=Ee[0],Pe=Ee[1],je=r(""),Ne=je[0],Ge=je[1],He=r(""),Ze=He[0],Ue=He[1],Ye={boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"8px !important",mb:1.5,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 12px 0"}},qe={minHeight:44,px:2,borderRadius:2,"&.Mui-expanded":{minHeight:44},"& .MuiAccordionSummary-content":{my:"10px"}};return o(a,e({sx:{width:820,flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden",borderRight:"1px solid #e5e7eb"}},{children:[o(a,e({sx:{px:2.5,py:2,borderBottom:"1px solid #e5e7eb"}},{children:[o(c,e({direction:"row",alignItems:"center",justifyContent:"space-between"},{children:[o(c,e({direction:"row",alignItems:"center",gap:1,sx:{flex:1,minWidth:0}},{children:[t(p,e({title:"Functional Prompt Block",placement:"top"},{children:t(h,{label:"FPB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:11,height:22,borderRadius:1}})})),we?t(g,{value:Ce,onChange:function(e){return _e(e.target.value)},size:"small",fullWidth:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:15,fontWeight:700,py:.5}}}):t(u,e({sx:{fontWeight:700,fontSize:15,color:"#111827"}},{children:(null==W?void 0:W.title)||"—"}))]})),we?o(c,e({direction:"row",gap:.5},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){return Se(!1)}},{children:t(_,{sx:{fontSize:16}})})),t(s,e({size:"small",sx:{color:"#16a34a"},onClick:function(){T(e(e({},W),{title:Ce,short_description:Ie,members:Ae,when_to_apply:Le,when_not_to_apply:Te})),Se(!1)}},{children:t(B,{sx:{fontSize:16}})}))]})):!D&&M&&t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){_e((null==W?void 0:W.title)||""),We((null==W?void 0:W.short_description)||""),Be((null==W?void 0:W.members)||[]),De(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Ve(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Se(!0)}},{children:t(C,{sx:{fontSize:16}})}))]})),we&&t(u,e({sx:{fontSize:11,color:"#5928ed",mt:.5}},{children:"Editing — changes won't be saved until you confirm"})),we?t(g,{value:Ie,onChange:function(e){return We(e.target.value)},size:"small",fullWidth:!0,multiline:!0,minRows:3,sx:{mt:1.5,"& .MuiOutlinedInput-input":{fontSize:12}}}):t(P,{description:(null==W?void 0:W.short_description)||"—"}),o(a,e({sx:{mt:1.5,border:"0.5px solid #d1d5db",borderRadius:"8px",display:"flex",overflow:"hidden"}},{children:[t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #d1d5db",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total APBs :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(l=null==W?void 0:W.members)||void 0===l?void 0:l.length)||0}))]}))})),t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total Lines :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(d=null==W?void 0:W.members)||void 0===d?void 0:d.reduce(function(e,n){var o,t;return e+((null!==(o=n.end_line)&&void 0!==o?o:0)-(null!==(t=n.start_line)&&void 0!==t?t:0)+1)},0))||0}))]}))}))]}))]})),o(a,e({sx:{flex:1,overflow:"auto",px:2,py:2,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-thumb":{bgcolor:"#e5e7eb",borderRadius:2}}},{children:[o(m,e({expanded:q,onChange:function(){return J(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Categories"}))})),t(b,e({sx:{pt:0,px:2,pb:2}},{children:o(c,e({gap:1.5},{children:[o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Category"})),we?t(v,e({fullWidth:!0,size:"small",value:G,onChange:function(e){Z(e.target.value),U("")},sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:O.map(function(n){return t(y,e({value:n.category_id},{children:n.category_name}),n.category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(k=O.find(function(e){return e.category_id===G}))||void 0===k?void 0:k.category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]}),o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Sub-Category"})),we?t(v,e({fullWidth:!0,size:"small",value:H,onChange:function(e){return U(e.target.value)},disabled:!G,sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:N.filter(function(e){return e.category_id===G}).map(function(n){return t(y,e({value:n.sub_category_id},{children:n.sub_category_name}),n.sub_category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(I=N.find(function(e){return e.sub_category_id===H}))||void 0===I?void 0:I.sub_category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]})]}))}))]})),o(m,e({expanded:Q,onChange:function(){return X(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Atomic Prompt Blocks (APBs)"}))})),o(b,e({sx:{pt:0,px:1,pb:2}},{children:[t(c,e({gap:1},{children:(we?Ae:(null==W?void 0:W.members)||[]).map(function(n,i){return o(a,e({sx:{px:2,py:1,borderRadius:2,bgcolor:"#fff"}},{children:[o(a,e({sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:1,gap:1}},{children:[o(u,e({sx:{fontSize:14,fontWeight:500,color:"#111827"}},{children:[i+1,". ",n.section_name]})),we?t(s,e({size:"small",onClick:function(){return Be(function(e){return e.filter(function(e,n){return n!==i})})},sx:{color:"#dc2626",flexShrink:0}},{children:t(L,{sx:{fontSize:16}})})):t(a,e({onClick:function(){return V(n.section_name.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join("_"))},sx:{fontSize:14,color:"#475569",cursor:"pointer",flexShrink:0}},{children:"↗"}))]})),t(u,e({sx:{fontSize:12,lineHeight:1.5,color:"#64748b"}},{children:n.reason_for_inclusion})),A&&(r=n.segments||[],0===r.length?null:t(a,e({sx:{mt:1}},{children:t(a,e({sx:{display:"flex",flexWrap:"wrap",gap:1}},{children:r.map(function(e,n){return t(h,{clickable:!0,onClick:function(){return E(e.segmentized_text)},label:e.segmentized_text,sx:{borderRadius:1,bgcolor:"#eff6ff",color:"#3b82f6",border:"1px dashed #bfdbfe"}},n)})}))}))),t(w,{sx:{mt:2}})]}),i);var r})})),we&&o(a,e({onClick:function(){Ge(""),Ue(""),Pe(!0)},sx:{mt:1,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:1,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:13,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:16}})," Add APB"]}))]}))]})),o(m,e({expanded:ee,onChange:function(){return ne(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Applicability ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• When to apply / When not to apply"}))]}))})),o(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[o(m,e({expanded:te,onChange:function(){return ie(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:1,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 8px 0"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:o(c,e({gap:.75},{children:[(we?Le:Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:["— Not yet available"]).map(function(n,i){return we?t(j,{value:n,onChange:function(e){return De(function(n){return n.map(function(n,o){return o===i?e:n})})},onDelete:function(){return De(function(e){return e.filter(function(e,n){return n!==i})})}},i):o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)}),we&&o(a,e({onClick:function(){return De(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When to Apply"]}))]}))}))]})),o(m,e({expanded:le,onChange:function(){return de(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important","&:before":{display:"none"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When NOT to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:we?o(c,e({gap:.75},{children:[Te.map(function(e,n){return t(j,{value:e,onChange:function(e){return Ve(function(o){return o.map(function(o,t){return t===n?e:o})})},onDelete:function(){return Ve(function(e){return e.filter(function(e,o){return o!==n})})}},n)}),o(a,e({onClick:function(){return Ve(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When NOT to Apply"]}))]})):Array.isArray(null==W?void 0:W.when_not_to_apply)||(null==W?void 0:W.when_not_to_apply)?t(c,e({gap:.75},{children:(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:[W.when_not_to_apply]).map(function(n,i){return o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)})})):t(u,e({sx:{fontSize:12.5,color:"#9ca3af",fontStyle:"italic"}},{children:"No conditions defined yet."}))}))]}))]}))]})),o(m,e({expanded:ce,onChange:function(){return se(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Specifications ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• Strict Rules / Input / Output"}))]}))})),t(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[{label:"Guidelines",expanded:fe,setExpanded:pe,content:null==W?void 0:W.additional_guidelines},{label:"Input",expanded:ge,setExpanded:me,content:null},{label:"Output",expanded:be,setExpanded:ve,content:null}].map(function(n,i){var r=n.label,l=n.expanded,d=n.setExpanded,a=n.content;return o(m,e({expanded:l,onChange:function(){return d(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:i<2?1:0,"&:before":{display:"none"},"&.Mui-expanded":{margin:i<2?"0 0 8px 0":0}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:r})),"Guidelines"!==r&&t(R,{sx:{fontSize:13,color:"#9ca3af"}})]}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:t(u,e({sx:{fontSize:12.5,color:a?"#374151":"#9ca3af",fontStyle:a?"normal":"italic"}},{children:a||"No ".concat(r.toLowerCase()," defined yet.")}))}))]}),r)})}))]}))]})),o(S,e({open:Oe,onClose:function(){return Pe(!1)},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:"12px"}}},{children:[o(a,e({sx:{px:3,py:2,display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e5e7eb"}},{children:[t(u,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Add new APB"})),t(s,e({size:"small",onClick:function(){return Pe(!1)}},{children:t(_,{sx:{fontSize:"1.1rem",color:"#6b7280"}})}))]})),o(a,e({sx:{px:3,py:2.5,display:"flex",flexDirection:"column",gap:2}},{children:[o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Title"})),t(g,{fullWidth:!0,size:"small",placeholder:"Specify the title of APB",value:Ne,onChange:function(e){return Ge(e.target.value)}})]}),o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Description"})),t(g,{fullWidth:!0,size:"small",multiline:!0,minRows:3,placeholder:"Describe the APB",value:Ze,onChange:function(e){return Ue(e.target.value)}})]})]})),o(a,e({sx:{px:3,py:2,display:"flex",justifyContent:"flex-end",gap:1,borderTop:"1px solid #e5e7eb"}},{children:[t(f,e({variant:"outlined",onClick:function(){return Pe(!1)},sx:{textTransform:"none",borderColor:"#d1d5db",color:"#374151"}},{children:"Cancel"})),t(f,e({variant:"contained",onClick:function(){Be(function(e){return n(n([],e,!0),[{section_name:Ne,reason_for_inclusion:Ze,content:""}],!1)}),Pe(!1)},sx:{textTransform:"none",bgcolor:"#5928ed","&:hover":{bgcolor:"#4c1d95"}}},{children:"Save"}))]}))]}))]}))},Z=function(n){var i,l,d,p,h,g=n.block,m=n.onBlockUpdate,x=n.isExtracting,b=n.isExtracted,v=n.onExtractSegments,y=n.isSaving,w=n.isSaved,S=n.onSave,z=n.onBack,C=n.title,R=void 0===C?"FPB Promptemon":C,B=n.categories,F=n.subCategories,L=n.selectedCategoryId,D=n.selectedSubCategoryId,M=n.onCategoryChange,T=n.onSubCategoryChange,V=n.showEditMode,E=void 0===V||V,O=n.showExtractSegments,P=void 0===O||O,j=r(1),Z=j[0],U=j[1],Y=r(!0),q=Y[0],J=Y[1],K=r(""),Q=K[0],X=K[1],$=r(""),ee=$[0],ne=$[1],oe=(null===(i=null==g?void 0:g.members)||void 0===i?void 0:i.map(function(e){if(!b||!e.segments||0===e.segments.length)return e.content||"";var n=e.content||"";return e.segments.forEach(function(e){e.raw_text&&e.segmentized_text&&(n=n.split(e.raw_text).join(e.segmentized_text))}),n}).join("\n\n"))||"";return o(a,e({sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"#fff",overflow:"hidden"}},{children:[o(a,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(k,{sx:{fontSize:18}})})),t(u,e({sx:{fontSize:14,fontWeight:600,color:"#111827"}},{children:R}))]})),o(a,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[t(f,e({variant:"contained",size:"small",disabled:!b||y||w,onClick:S,sx:{textTransform:"none",fontSize:"0.78rem",fontWeight:600,bgcolor:"#5928ed",px:2,py:.6,"&:hover":{bgcolor:"#4c1d95"},"&.Mui-disabled":{bgcolor:"#5928ed",color:"#fff",opacity:.4}}},{children:y?"Saving...":w?"Saved ✓":"Save FPB"})),t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(_,{sx:{fontSize:18}})}))]}))]})),o(a,e({sx:{display:"flex",flex:1,overflow:"hidden"}},{children:[t(H,{block:g,isExtracted:b,isSaved:w,showEditMode:E,onBlockUpdate:m,onTagSelect:function(e){X(""),setTimeout(function(){return X(e)},50)},onVariableSelect:function(e){ne(""),setTimeout(function(){return ne(e)},50)},categories:B,subCategories:F,selectedCategoryId:L,selectedSubCategoryId:D,onCategoryChange:M,onSubCategoryChange:T}),o(a,e({sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5}},{children:[o(a,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[o(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:[(null==g?void 0:g.title)||"—"," APBs"]})),o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(s,e({size:"small",onClick:function(){return U(function(e){return Math.max(1,e-1)})},disabled:1===Z,sx:{color:"#6b7280",p:.4}},{children:t(I,{sx:{fontSize:16}})})),o(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:[Z," of ",(null===(l=null==g?void 0:g.members)||void 0===l?void 0:l.length)||0]})),t(s,e({size:"small",onClick:function(){return U(function(e){var n;return Math.min((null===(n=null==g?void 0:g.members)||void 0===n?void 0:n.length)||0,e+1)})},disabled:Z===((null===(d=null==g?void 0:g.members)||void 0===d?void 0:d.length)||0),sx:{color:"#6b7280",p:.4}},{children:t(W,{sx:{fontSize:16}})}))]}))]})),t(c,e({direction:"row",alignItems:"center",gap:1.5},{children:P&&(b?o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:"Show Segments"})),t(a,e({sx:{width:36,height:20,borderRadius:"10px",bgcolor:"#7c3aed",display:"flex",alignItems:"center",px:.3,cursor:"pointer"}},{children:t(a,{sx:{width:14,height:14,borderRadius:"50%",bgcolor:"#fff",ml:"auto"}})}))]})):o(a,e({onClick:v,sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.85,borderRadius:1.5,bgcolor:"#7c3aed",cursor:x?"default":"pointer","&:hover":{bgcolor:"#6d28d9"},userSelect:"none",opacity:x?.7:1}},{children:[t(A,{sx:{fontSize:15,color:"#fff"}}),t(u,e({sx:{fontSize:13,fontWeight:600,color:"#fff"}},{children:x?"Extracting...":"Extract Segments"}))]})))}))]})),o(a,e({sx:{flex:1,minHeight:0,position:"relative"}},{children:[x&&t(a,e({sx:{position:"absolute",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0,0,0,0.6)",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1}},{children:t(u,e({sx:{color:"#fff",fontSize:14,fontWeight:600}},{children:"Extracting segments..."}))})),o(a,e({sx:{border:"1px solid #30363d",borderRadius:1,overflow:"hidden",height:"100%"}},{children:[o(a,e({sx:{px:2,py:1,borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:1,bgcolor:"#161b22",flexShrink:0}},{children:[t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#ff5f57"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#febc2e"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#28c840"}}),o(u,e({sx:{ml:1,fontSize:11,color:"#8b949e",fontFamily:"monospace"}},{children:[(null===(h=null===(p=null==g?void 0:g.members)||void 0===p?void 0:p[Z-1])||void 0===h?void 0:h.section_name)||"—",".xml"]})),t(a,{sx:{flex:1}}),t(N,{isDarkMode:q,onChange:J})]})),t(G,{content:oe,selectedTag:Q,highlightVariable:ee,isDarkMode:q,height:"100%",fontSize:14})]}))]}))]}))]}))]}))};export{Z as default};
1
+ import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as o,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as r,useRef as l,useEffect as d}from"react";import{Box as a,Stack as c,IconButton as s,Typography as u,Button as f,Tooltip as p,Chip as h,TextField as g,Accordion as m,AccordionSummary as x,AccordionDetails as b,Select as v,MenuItem as y,Divider as w,Dialog as S}from"@mui/material";import z from"@mui/icons-material/ExpandMore";import C from"@mui/icons-material/EditOutlined";import _ from"@mui/icons-material/Close";import k from"@mui/icons-material/ArrowBack";import I from"@mui/icons-material/NavigateBefore";import W from"@mui/icons-material/NavigateNext";import R from"@mui/icons-material/InfoOutlined";import A from"@mui/icons-material/AutoFixHighOutlined";import B from"@mui/icons-material/Check";import F from"@mui/icons-material/Add";import L from"@mui/icons-material/DeleteOutline";import D from"@monaco-editor/react";import M from"@mui/icons-material/DarkMode";import T from"@mui/icons-material/LightMode";var V={base:"vs-dark",inherit:!0,rules:[{token:"tag",foreground:"714be3",fontStyle:"bold"},{token:"attribute.name",foreground:"87CEFA"},{token:"attribute.value",foreground:"98FB98"},{token:"variable",foreground:"00FFFF"},{token:"delimiter",foreground:"888888"},{token:"white",foreground:"AAAAAA"}],colors:{"editor.foreground":"#FFFFFF","editor.background":"#030202","editorLineNumber.foreground":"#858585","editorCursor.foreground":"#FFFFFF","editorIndentGuide.background":"#404040","editorIndentGuide.activeBackground":"#707070"}},E={base:"vs",inherit:!0,rules:[{token:"tag",foreground:"5928ED",fontStyle:"bold"},{token:"attribute.name",foreground:"AF00DB"},{token:"attribute.value",foreground:"008000"},{token:"variable",foreground:"B000B0"},{token:"delimiter",foreground:"808080"},{token:"white",foreground:"000000"}],colors:{"editor.foreground":"#000000","editor.background":"#FFFFFF","editorLineNumber.foreground":"#999999","editorCursor.foreground":"#000000","editorIndentGuide.background":"#CCCCCC","editorIndentGuide.activeBackground":"#999999"}},O=function(n){var i=n.description,c=r(!1),s=c[0],f=c[1],p=r(!1),h=p[0],g=p[1],m=l(null);return d(function(){var e=m.current;e&&g(e.scrollHeight>e.clientHeight+1)},[i,s]),o(a,e({sx:{mt:1.5,border:"1px solid #e5e7eb",borderRadius:2,bgcolor:"#fff",display:"flex",flexDirection:"column",px:1.25,py:1}},{children:[t(u,e({ref:m,component:"div",sx:e({fontSize:11,color:"#6b7280",lineHeight:1.5,overflowY:s?"auto":"hidden",maxHeight:s?"calc(1.6em * 5)":"calc(1.6em * 3)",whiteSpace:"normal",display:s?"block":"-webkit-box"},s?{}:{WebkitBoxOrient:"vertical",WebkitLineClamp:3})},{children:i})),h&&t(u,e({component:"span",onClick:function(){return f(function(e){return!e})},sx:{mt:.75,alignSelf:"flex-end",fontSize:10,color:"#7c3aed",cursor:"pointer",fontWeight:500}},{children:s?"View less":"View more"}))]}))},P=function(n){var i=n.value,l=n.onChange,d=n.onDelete,f=r(!1),p=f[0],h=f[1];return o(a,e({sx:{display:"flex",alignItems:"flex-start",gap:1,p:1,border:"1px solid #e5e7eb",borderRadius:"8px",bgcolor:"#fff"}},{children:[t(a,e({sx:{width:18,height:18,borderRadius:"4px",bgcolor:"#f1f5f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,color:"#64748b",flexShrink:0,mt:.1}},{children:"a"})),p?t(g,{autoFocus:!0,value:i,onChange:function(e){return l(e.target.value)},onBlur:function(){return h(!1)},size:"small",fullWidth:!0,multiline:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:12.5}}}):t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55,flex:1}},{children:i})),o(c,e({direction:"row",gap:.25,sx:{flexShrink:0}},{children:[t(s,e({size:"small",onClick:function(){return h(!0)},sx:{color:"#6b7280"}},{children:t(C,{sx:{fontSize:14}})})),t(s,e({size:"small",onClick:d,sx:{color:"#dc2626"}},{children:t(L,{sx:{fontSize:14}})}))]}))]}))},j=function(n){var o=n.isDarkMode,i=n.onChange;return t(a,e({onClick:function(){return i(!o)},sx:{width:52,height:24,borderRadius:"12px",bgcolor:o?"#5928ed":"#f0f0f0",border:"1px solid",borderColor:o?"#5928ed":"#d1d5db",display:"flex",alignItems:"center",px:.4,cursor:"pointer",transition:"all 0.2s",justifyContent:o?"flex-end":"flex-start"}},{children:t(a,e({sx:{width:18,height:18,borderRadius:"50%",bgcolor:o?"#1e1e2e":"#f59e0b",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"}},{children:t(o?M:T,{sx:{fontSize:11,color:"#fff"}})}))}))},N=function(n){var r=n.content,c=n.selectedTag,s=n.highlightVariable,u=n.isDarkMode,f=n.height,p=void 0===f?250:f,h=n.fontSize,g=void 0===h?12:h,m=l(),x=l();return d(function(){if(c&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=-1,i=0;i<o.length;i++){var r=o[i].match(/<([^\s>\/]+(?:\s[^\s>\/]+)*)/);if(r&&r[1].trim().toLowerCase()===c.toLowerCase()){t=i+1;break}}if(t>0){var l=t,d="</".concat(c.toLowerCase(),">");for(i=t;i<o.length;i++)if(o[i].toLowerCase().includes(d)){l=i+1;break}e.setSelection(new x.current.Selection(t,1,t,1)),e.trigger(null,"editor.unfold",{}),e.revealLineInCenterIfOutsideViewport(t);var a=e.deltaDecorations([],[{range:new x.current.Range(t,1,l,o[l-1].length+1),options:{isWholeLine:!0,className:"promptemon-viewer-highlight",inlineClassName:"promptemon-viewer-highlight"}}]);setTimeout(function(){return e.deltaDecorations(a,[])},2e3)}}}},[c]),d(function(){if(s&&m.current&&x.current){var e=m.current,n=e.getModel();if(n){for(var o=n.getValue().split("\n"),t=[],i=0;i<o.length;i++)for(var r=o[i].indexOf(s);-1!==r;)t.push(new x.current.Range(i+1,r+1,i+1,r+s.length+1)),r=o[i].indexOf(s,r+1);if(0!==t.length){e.revealLineInCenterIfOutsideViewport(t[0].startLineNumber);var l=e.deltaDecorations([],t.map(function(e){return{range:e,options:{inlineClassName:"promptemon-viewer-variable-highlight"}}}));setTimeout(function(){return e.deltaDecorations(l,[])},2e3)}}}},[s]),d(function(){x.current&&x.current.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},[u]),o(i,{children:[t("style",{children:"\n .promptemon-viewer-highlight { background-color: rgba(89, 40, 237, 0.15); }\n .promptemon-viewer-variable-highlight { background-color: rgba(0, 255, 255, 0.2); border-radius: 2px; }\n "}),o(a,e({sx:{width:"100%",height:p,display:"flex",flexDirection:"column"}},{children:[t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderTopLeftRadius:8,borderTopRightRadius:8}}),t(a,e({sx:{flex:1,minHeight:0,overflow:"hidden"}},{children:t(D,{onMount:function(e,n){m.current=e,x.current=n,n.editor.defineTheme("promptemonViewerDark",V),n.editor.defineTheme("promptemonViewerLight",E),n.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight"),n.languages.register({id:"promptemonViewerLang"}),n.languages.setMonarchTokensProvider("promptemonViewerLang",{tokenizer:{root:[[/(<)([a-zA-Z0-9\-]+)(\s*)/,["delimiter","tag","white"],"@tagBody"],[/(<\/)([a-zA-Z0-9\-]+)(\s*)(>)/,["delimiter","tag","white","delimiter"]],[/{{[^}]+}}/,"variable"]],tagBody:[[/[a-zA-Z0-9\:\-]+(?=\=)/,"attribute.name"],[/=/,"delimiter"],[/(".*?"|'.*?')/,"attribute.value"],[/\s+/,"white"],[/(\/?>)/,{token:"delimiter",next:"@pop"}]]}}),n.languages.registerFoldingRangeProvider("promptemonViewerLang",{provideFoldingRanges:function(e){var n=e.getLinesContent(),o=[],t=[];return n.forEach(function(e,n){var i=n+1,r=e.match(/<([a-zA-Z0-9\-]+)(\s[^>]*)?>/),l=e.match(/<\/([a-zA-Z0-9\-]+)>/);if(r&&!e.includes("/>")&&t.push({tag:r[1],start:i}),l)for(var d=l[1],a=t.length-1;a>=0;a--)if(t[a].tag===d){o.push({start:t[a].start,end:i}),t.splice(a,1);break}}),o}})},beforeMount:function(e){e.editor.defineTheme("promptemonViewerDark",V),e.editor.defineTheme("promptemonViewerLight",E),e.editor.setTheme(u?"promptemonViewerDark":"promptemonViewerLight")},theme:u?"promptemonViewerDark":"promptemonViewerLight",value:r,language:"promptemonViewerLang",onChange:function(){},options:{fontSize:g,minimap:{enabled:!1},wordWrap:"on",lineNumbers:"on",readOnly:!0,domReadOnly:!0,scrollBeyondLastLine:!1,padding:{top:4,bottom:12},folding:!0,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:8}}})})),t(a,{sx:{width:"100%",height:20,bgcolor:u?"#030202":"#fff",borderBottomLeftRadius:8,borderBottomRightRadius:8}})]}))]})},G=function(i){var l,d,k,I,W=i.block,A=i.isExtracted,D=i.isSaved,M=i.showEditMode,T=i.onBlockUpdate,V=i.onTagSelect,E=i.onVariableSelect,j=i.categories,N=i.subCategories,G=i.selectedCategoryId,H=i.selectedSubCategoryId,Z=i.onCategoryChange,U=i.onSubCategoryChange,Y=r(!0),q=Y[0],J=Y[1],K=r(!0),Q=K[0],X=K[1],$=r(!0),ee=$[0],ne=$[1],oe=r(!0),te=oe[0],ie=oe[1],re=r(!1),le=re[0],de=re[1],ae=r(!0),ce=ae[0],se=ae[1],ue=r(!0),fe=ue[0],pe=ue[1],he=r(!1),ge=he[0],me=he[1],xe=r(!1),be=xe[0],ve=xe[1],ye=r(!1),we=ye[0],Se=ye[1],ze=r((null==W?void 0:W.title)||""),Ce=ze[0],_e=ze[1],ke=r((null==W?void 0:W.short_description)||""),Ie=ke[0],We=ke[1],Re=r((null==W?void 0:W.members)||[]),Ae=Re[0],Be=Re[1],Fe=r(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Le=Fe[0],De=Fe[1],Me=r(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Te=Me[0],Ve=Me[1],Ee=r(!1),Oe=Ee[0],Pe=Ee[1],je=r(""),Ne=je[0],Ge=je[1],He=r(""),Ze=He[0],Ue=He[1],Ye={boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"8px !important",mb:1.5,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 12px 0"}},qe={minHeight:44,px:2,borderRadius:2,"&.Mui-expanded":{minHeight:44},"& .MuiAccordionSummary-content":{my:"10px"}};return o(a,e({sx:{width:820,flexShrink:0,display:"flex",flexDirection:"column",overflow:"hidden",borderRight:"1px solid #e5e7eb"}},{children:[o(a,e({sx:{px:2.5,py:2,borderBottom:"1px solid #e5e7eb"}},{children:[o(c,e({direction:"row",alignItems:"center",justifyContent:"space-between"},{children:[o(c,e({direction:"row",alignItems:"center",gap:1,sx:{flex:1,minWidth:0}},{children:[t(p,e({title:"Functional Prompt Block",placement:"top"},{children:t(h,{label:"FPB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:11,height:22,borderRadius:1}})})),we?t(g,{value:Ce,onChange:function(e){return _e(e.target.value)},size:"small",fullWidth:!0,sx:{"& .MuiOutlinedInput-input":{fontSize:15,fontWeight:700,py:.5}}}):t(u,e({sx:{fontWeight:700,fontSize:15,color:"#111827"}},{children:(null==W?void 0:W.title)||"—"}))]})),we?o(c,e({direction:"row",gap:.5},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){return Se(!1)}},{children:t(_,{sx:{fontSize:16}})})),t(s,e({size:"small",sx:{color:"#16a34a"},onClick:function(){T(e(e({},W),{title:Ce,short_description:Ie,members:Ae,when_to_apply:Le,when_not_to_apply:Te})),Se(!1)}},{children:t(B,{sx:{fontSize:16}})}))]})):!D&&M&&t(s,e({size:"small",sx:{color:"#6b7280"},onClick:function(){_e((null==W?void 0:W.title)||""),We((null==W?void 0:W.short_description)||""),Be((null==W?void 0:W.members)||[]),De(Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:[]),Ve(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:(null==W?void 0:W.when_not_to_apply)?[W.when_not_to_apply]:[]),Se(!0)}},{children:t(C,{sx:{fontSize:16}})}))]})),we&&t(u,e({sx:{fontSize:11,color:"#5928ed",mt:.5}},{children:"Editing — changes won't be saved until you confirm"})),we?t(g,{value:Ie,onChange:function(e){return We(e.target.value)},size:"small",fullWidth:!0,multiline:!0,minRows:3,sx:{mt:1.5,"& .MuiOutlinedInput-input":{fontSize:12}}}):t(O,{description:(null==W?void 0:W.short_description)||"—"}),o(a,e({sx:{mt:1.5,border:"0.5px solid #d1d5db",borderRadius:"8px",display:"flex",overflow:"hidden"}},{children:[t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #d1d5db",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total APBs :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(l=null==W?void 0:W.members)||void 0===l?void 0:l.length)||0}))]}))})),t(a,e({sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",p:.5}},{children:o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:10,color:"#87898d"}},{children:"Total Lines :"})),t(u,e({sx:{fontSize:10,fontWeight:700,color:"#5f5f5f"}},{children:(null===(d=null==W?void 0:W.members)||void 0===d?void 0:d.reduce(function(e,n){var o,t;return e+((null!==(o=n.end_line)&&void 0!==o?o:0)-(null!==(t=n.start_line)&&void 0!==t?t:0)+1)},0))||0}))]}))}))]}))]})),o(a,e({sx:{flex:1,overflow:"auto",px:2,py:2,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-thumb":{bgcolor:"#e5e7eb",borderRadius:2}}},{children:[o(m,e({expanded:q,onChange:function(){return J(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Categories"}))})),t(b,e({sx:{pt:0,px:2,pb:2}},{children:o(c,e({gap:1.5},{children:[o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Category"})),we?t(v,e({fullWidth:!0,size:"small",value:G,onChange:function(e){Z(e.target.value),U("")},sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:j.map(function(n){return t(y,e({value:n.category_id},{children:n.category_name}),n.category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(k=j.find(function(e){return e.category_id===G}))||void 0===k?void 0:k.category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]}),o(a,{children:[t(u,e({sx:{fontSize:12,color:"#6b7280",mb:.5}},{children:"Sub-Category"})),we?t(v,e({fullWidth:!0,size:"small",value:H,onChange:function(e){return U(e.target.value)},disabled:!G,sx:{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}},{children:N.filter(function(e){return e.category_id===G}).map(function(n){return t(y,e({value:n.sub_category_id},{children:n.sub_category_name}),n.sub_category_id)})})):t(g,{fullWidth:!0,size:"small",value:(null===(I=N.find(function(e){return e.sub_category_id===H}))||void 0===I?void 0:I.sub_category_name)||"—",InputProps:{readOnly:!0},sx:{"& .MuiOutlinedInput-root":{fontSize:13,borderRadius:1.5,"& fieldset":{borderColor:"#e5e7eb"}}}})]})]}))}))]})),o(m,e({expanded:Q,onChange:function(){return X(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:"Atomic Prompt Blocks (APBs)"}))})),o(b,e({sx:{pt:0,px:1,pb:2}},{children:[t(c,e({gap:1},{children:(we?Ae:(null==W?void 0:W.members)||[]).map(function(n,i){return o(a,e({sx:{px:2,py:1,borderRadius:2,bgcolor:"#fff"}},{children:[o(a,e({sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:1,gap:1}},{children:[o(u,e({sx:{fontSize:14,fontWeight:500,color:"#111827"}},{children:[i+1,". ",n.section_name]})),we?t(s,e({size:"small",onClick:function(){return Be(function(e){return e.filter(function(e,n){return n!==i})})},sx:{color:"#dc2626",flexShrink:0}},{children:t(L,{sx:{fontSize:16}})})):t(a,e({onClick:function(){return V(n.section_name.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join("_"))},sx:{fontSize:14,color:"#475569",cursor:"pointer",flexShrink:0}},{children:"↗"}))]})),t(u,e({sx:{fontSize:12,lineHeight:1.5,color:"#64748b"}},{children:n.reason_for_inclusion})),A&&(r=n.segments||[],0===r.length?null:t(a,e({sx:{mt:1}},{children:t(a,e({sx:{display:"flex",flexWrap:"wrap",gap:1}},{children:r.map(function(e,n){return t(h,{clickable:!0,onClick:function(){return E(e.segmentized_text)},label:e.segmentized_text,sx:{borderRadius:1,bgcolor:"#eff6ff",color:"#3b82f6",border:"1px dashed #bfdbfe"}},n)})}))}))),t(w,{sx:{mt:2}})]}),i);var r})})),we&&o(a,e({onClick:function(){Ge(""),Ue(""),Pe(!0)},sx:{mt:1,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:1,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:13,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:16}})," Add APB"]}))]}))]})),o(m,e({expanded:ee,onChange:function(){return ne(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Applicability ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• When to apply / When not to apply"}))]}))})),o(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[o(m,e({expanded:te,onChange:function(){return ie(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:1,"&:before":{display:"none"},"&.Mui-expanded":{margin:"0 0 8px 0"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:o(c,e({gap:.75},{children:[(we?Le:Array.isArray(null==W?void 0:W.when_to_apply)?W.when_to_apply:(null==W?void 0:W.when_to_apply)?[W.when_to_apply]:["— Not yet available"]).map(function(n,i){return we?t(P,{value:n,onChange:function(e){return De(function(n){return n.map(function(n,o){return o===i?e:n})})},onDelete:function(){return De(function(e){return e.filter(function(e,n){return n!==i})})}},i):o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)}),we&&o(a,e({onClick:function(){return De(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When to Apply"]}))]}))}))]})),o(m,e({expanded:le,onChange:function(){return de(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important","&:before":{display:"none"}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:"When NOT to Apply this FPB"}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:we?o(c,e({gap:.75},{children:[Te.map(function(e,n){return t(P,{value:e,onChange:function(e){return Ve(function(o){return o.map(function(o,t){return t===n?e:o})})},onDelete:function(){return Ve(function(e){return e.filter(function(e,o){return o!==n})})}},n)}),o(a,e({onClick:function(){return Ve(function(e){return n(n([],e,!0),[""],!1)})},sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:.75,border:"1px dashed #d1d5db",borderRadius:1.5,cursor:"pointer",color:"#5928ed",fontSize:12.5,fontWeight:600,"&:hover":{bgcolor:"#f5f0ff"}}},{children:[t(F,{sx:{fontSize:15}})," Add When NOT to Apply"]}))]})):Array.isArray(null==W?void 0:W.when_not_to_apply)||(null==W?void 0:W.when_not_to_apply)?t(c,e({gap:.75},{children:(Array.isArray(null==W?void 0:W.when_not_to_apply)?W.when_not_to_apply:[W.when_not_to_apply]).map(function(n,i){return o(c,e({direction:"row",gap:1,alignItems:"flex-start"},{children:[o(u,e({sx:{fontSize:12,color:"#374151",fontWeight:700,mt:.1}},{children:[i+1,"."]})),t(u,e({sx:{fontSize:12.5,color:"#374151",lineHeight:1.55}},{children:n}))]}),i)})})):t(u,e({sx:{fontSize:12.5,color:"#9ca3af",fontStyle:"italic"}},{children:"No conditions defined yet."}))}))]}))]}))]})),o(m,e({expanded:ce,onChange:function(){return se(function(e){return!e})},sx:Ye,disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:18}}),sx:qe},{children:o(u,e({sx:{fontSize:14,fontWeight:600,color:"#374151",display:"flex",alignItems:"center",flexDirection:"row"}},{children:["Specifications ",t("span",e({style:{color:"#94a3b8",fontWeight:400,fontSize:10,marginLeft:"12px"}},{children:"• Strict Rules / Input / Output"}))]}))})),t(b,e({sx:{pt:0,px:1.5,pb:1.5}},{children:[{label:"Guidelines",expanded:fe,setExpanded:pe,content:null==W?void 0:W.additional_guidelines},{label:"Input",expanded:ge,setExpanded:me,content:null},{label:"Output",expanded:be,setExpanded:ve,content:null}].map(function(n,i){var r=n.label,l=n.expanded,d=n.setExpanded,a=n.content;return o(m,e({expanded:l,onChange:function(){return d(function(e){return!e})},sx:{boxShadow:"none",border:"1px solid #e5e7eb",borderRadius:"6px !important",mb:i<2?1:0,"&:before":{display:"none"},"&.Mui-expanded":{margin:i<2?"0 0 8px 0":0}},disableGutters:!0},{children:[t(x,e({expandIcon:t(z,{sx:{fontSize:16}}),sx:e(e({},qe),{bgcolor:"#f9fafb",borderRadius:"6px"})},{children:o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(u,e({sx:{fontSize:12.5,fontWeight:500,color:"#374151"}},{children:r})),"Guidelines"!==r&&t(R,{sx:{fontSize:13,color:"#9ca3af"}})]}))})),t(b,e({sx:{pt:.5,px:2,pb:1.5}},{children:t(u,e({sx:{fontSize:12.5,color:a?"#374151":"#9ca3af",fontStyle:a?"normal":"italic"}},{children:a||"No ".concat(r.toLowerCase()," defined yet.")}))}))]}),r)})}))]}))]})),o(S,e({open:Oe,onClose:function(){return Pe(!1)},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:"12px"}}},{children:[o(a,e({sx:{px:3,py:2,display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e5e7eb"}},{children:[t(u,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Add new APB"})),t(s,e({size:"small",onClick:function(){return Pe(!1)}},{children:t(_,{sx:{fontSize:"1.1rem",color:"#6b7280"}})}))]})),o(a,e({sx:{px:3,py:2.5,display:"flex",flexDirection:"column",gap:2}},{children:[o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Title"})),t(g,{fullWidth:!0,size:"small",placeholder:"Specify the title of APB",value:Ne,onChange:function(e){return Ge(e.target.value)}})]}),o(a,{children:[t(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151",mb:.75}},{children:"Description"})),t(g,{fullWidth:!0,size:"small",multiline:!0,minRows:3,placeholder:"Describe the APB",value:Ze,onChange:function(e){return Ue(e.target.value)}})]})]})),o(a,e({sx:{px:3,py:2,display:"flex",justifyContent:"flex-end",gap:1,borderTop:"1px solid #e5e7eb"}},{children:[t(f,e({variant:"outlined",onClick:function(){return Pe(!1)},sx:{textTransform:"none",borderColor:"#d1d5db",color:"#374151"}},{children:"Cancel"})),t(f,e({variant:"contained",onClick:function(){Be(function(e){return n(n([],e,!0),[{section_name:Ne,reason_for_inclusion:Ze,content:""}],!1)}),Pe(!1)},sx:{textTransform:"none",bgcolor:"#5928ed","&:hover":{bgcolor:"#4c1d95"}}},{children:"Save"}))]}))]}))]}))},H=function(n){var i,l,d,p,h,g=n.block,m=n.onBlockUpdate,x=n.isExtracting,b=n.isExtracted,v=n.onExtractSegments,y=n.isSaving,w=n.isSaved,S=n.onSave,z=n.onBack,C=n.title,R=void 0===C?"FPB Promptemon":C,B=n.categories,F=n.subCategories,L=n.selectedCategoryId,D=n.selectedSubCategoryId,M=n.onCategoryChange,T=n.onSubCategoryChange,V=n.showEditMode,E=void 0===V||V,O=n.showExtractSegments,P=void 0===O||O,H=r(1),Z=H[0],U=H[1],Y=r(!0),q=Y[0],J=Y[1],K=r(""),Q=K[0],X=K[1],$=r(""),ee=$[0],ne=$[1],oe=(null===(i=null==g?void 0:g.members)||void 0===i?void 0:i.map(function(e){if(!b||!e.segments||0===e.segments.length)return e.content||"";var n=e.content||"";return e.segments.forEach(function(e){e.raw_text&&e.segmentized_text&&(n=n.split(e.raw_text).join(e.segmentized_text))}),n}).join("\n\n"))||"";return o(a,e({sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"#fff",overflow:"hidden"}},{children:[o(a,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(k,{sx:{fontSize:18}})})),t(u,e({sx:{fontSize:14,fontWeight:600,color:"#111827"}},{children:R}))]})),o(a,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[t(f,e({variant:"contained",size:"small",disabled:!b||y||w,onClick:S,sx:{textTransform:"none",fontSize:"0.78rem",fontWeight:600,bgcolor:"#5928ed",px:2,py:.6,"&:hover":{bgcolor:"#4c1d95"},"&.Mui-disabled":{bgcolor:"#5928ed",color:"#fff",opacity:.4}}},{children:y?"Saving...":w?"Saved ✓":"Save FPB"})),t(s,e({size:"small",sx:{color:"#6b7280"},onClick:z},{children:t(_,{sx:{fontSize:18}})}))]}))]})),o(a,e({sx:{display:"flex",flex:1,overflow:"hidden"}},{children:[t(G,{block:g,isExtracted:b,isSaved:w,showEditMode:E,onBlockUpdate:m,onTagSelect:function(e){X(""),setTimeout(function(){return X(e)},50)},onVariableSelect:function(e){ne(""),setTimeout(function(){return ne(e)},50)},categories:B,subCategories:F,selectedCategoryId:L,selectedSubCategoryId:D,onCategoryChange:M,onSubCategoryChange:T}),o(a,e({sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5}},{children:[o(a,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[o(c,e({direction:"row",alignItems:"center",gap:1},{children:[o(u,e({sx:{fontSize:13,fontWeight:600,color:"#374151"}},{children:[(null==g?void 0:g.title)||"—"," APBs"]})),o(c,e({direction:"row",alignItems:"center",gap:.5},{children:[t(s,e({size:"small",onClick:function(){return U(function(e){return Math.max(1,e-1)})},disabled:1===Z,sx:{color:"#6b7280",p:.4}},{children:t(I,{sx:{fontSize:16}})})),o(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:[Z," of ",(null===(l=null==g?void 0:g.members)||void 0===l?void 0:l.length)||0]})),t(s,e({size:"small",onClick:function(){return U(function(e){var n;return Math.min((null===(n=null==g?void 0:g.members)||void 0===n?void 0:n.length)||0,e+1)})},disabled:Z===((null===(d=null==g?void 0:g.members)||void 0===d?void 0:d.length)||0),sx:{color:"#6b7280",p:.4}},{children:t(W,{sx:{fontSize:16}})}))]}))]})),t(c,e({direction:"row",alignItems:"center",gap:1.5},{children:P&&(b?o(c,e({direction:"row",alignItems:"center",gap:1},{children:[t(u,e({sx:{fontSize:12.5,color:"#6b7280"}},{children:"Show Segments"})),t(a,e({sx:{width:36,height:20,borderRadius:"10px",bgcolor:"#7c3aed",display:"flex",alignItems:"center",px:.3,cursor:"pointer"}},{children:t(a,{sx:{width:14,height:14,borderRadius:"50%",bgcolor:"#fff",ml:"auto"}})}))]})):o(a,e({onClick:v,sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.85,borderRadius:1.5,bgcolor:"#7c3aed",cursor:x?"default":"pointer","&:hover":{bgcolor:"#6d28d9"},userSelect:"none",opacity:x?.7:1}},{children:[t(A,{sx:{fontSize:15,color:"#fff"}}),t(u,e({sx:{fontSize:13,fontWeight:600,color:"#fff"}},{children:x?"Extracting...":"Extract Segments"}))]})))}))]})),o(a,e({sx:{flex:1,minHeight:0,position:"relative"}},{children:[x&&t(a,e({sx:{position:"absolute",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0,0,0,0.6)",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1}},{children:t(u,e({sx:{color:"#fff",fontSize:14,fontWeight:600}},{children:"Extracting segments..."}))})),o(a,e({sx:{border:"1px solid #30363d",borderRadius:1,overflow:"hidden",height:"100%"}},{children:[o(a,e({sx:{px:2,py:1,borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:1,bgcolor:"#161b22",flexShrink:0}},{children:[t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#ff5f57"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#febc2e"}}),t(a,{sx:{width:12,height:12,borderRadius:"50%",bgcolor:"#28c840"}}),o(u,e({sx:{ml:1,fontSize:11,color:"#8b949e",fontFamily:"monospace"}},{children:[(null===(h=null===(p=null==g?void 0:g.members)||void 0===p?void 0:p[Z-1])||void 0===h?void 0:h.section_name)||"—",".xml"]})),t(a,{sx:{flex:1}}),t(j,{isDarkMode:q,onChange:J})]})),t(N,{content:oe,selectedTag:Q,highlightVariable:ee,isDarkMode:q,height:"100%",fontSize:14})]}))]}))]}))]}))]}))};export{H as default};
2
2
  //# sourceMappingURL=PromptemonViewer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,oBAAoB,+CAkNzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAOA,QAAA,MAAM,oBAAoB,+CAkNzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAcf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAucD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwNjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAcf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAuaD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwNjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAEL,qBAAqB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AA6BlC,QAAA,MAAM,gBAAgB,qWA6BnB,qBAAqB,4CAy7FvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAEL,qBAAqB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AA6BlC,QAAA,MAAM,gBAAgB,qWA6BnB,qBAAqB,4CAm7FvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
@@ -191,11 +191,6 @@ export type SectionBlock = {
191
191
  contentId?: string;
192
192
  parentContentId?: string | null;
193
193
  refContentIds?: string[];
194
- layoutKey?: string;
195
- comparisonRowId?: string;
196
- isMappingContinuation?: boolean;
197
- continuationSourceRowId?: string;
198
- isMultipleMapping?: boolean;
199
194
  title: string;
200
195
  content: string;
201
196
  change_history?: string;
@@ -230,14 +225,6 @@ export type Row = {
230
225
  left?: SectionBlock;
231
226
  right?: SectionBlock;
232
227
  };
233
- export type ComparisonRow = {
234
- id: string;
235
- nodeId: string;
236
- left: SectionBlock;
237
- right: SectionBlock;
238
- leftOrdinal: number;
239
- rightOrdinal: number;
240
- };
241
228
  export interface CognitivePopupConfig {
242
229
  tabs?: {
243
230
  deviation?: {
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,0BAA0B,EAAE;QAC1B,OAAO,EAAE;YACP,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;QACF,MAAM,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GACV,uBAAuB,GACvB;gBAAE,KAAK,EAAE,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;aAAE,CAAC;SAC1D,CAAC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