@e-llm-studio/instant-learning 1.3.0-alpha.90 → 1.3.0-alpha.93

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 (38) hide show
  1. package/dist/cjs/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js +2 -0
  2. package/dist/cjs/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js.map +1 -0
  3. package/dist/cjs/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js +2 -0
  4. package/dist/cjs/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js.map +1 -0
  5. package/dist/cjs/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js +2 -0
  6. package/dist/cjs/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js.map +1 -0
  7. package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
  8. package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +1 -1
  9. package/dist/cjs/features/LearningManagement/Sidebar.js +1 -1
  10. package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
  11. package/dist/cjs/index.js +1 -1
  12. package/dist/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js +2 -0
  13. package/dist/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js.map +1 -0
  14. package/dist/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js +2 -0
  15. package/dist/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js.map +1 -0
  16. package/dist/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js +2 -0
  17. package/dist/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js.map +1 -0
  18. package/dist/features/LearningManagement/LearningManagement.js +1 -1
  19. package/dist/features/LearningManagement/LearningTemplateLayout.js +1 -1
  20. package/dist/features/LearningManagement/Sidebar.js +1 -1
  21. package/dist/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/types/src/features/IL-OTJ/_components/index.d.ts +0 -1
  24. package/dist/types/src/features/IL-OTJ/_components/index.d.ts.map +1 -1
  25. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  26. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts +3 -0
  27. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
  28. package/dist/types/src/features/LearningManagement/types.d.ts +1 -0
  29. package/dist/types/src/features/LearningManagement/types.d.ts.map +1 -1
  30. package/dist/types/src/index.d.ts +0 -1
  31. package/dist/types/src/index.d.ts.map +1 -1
  32. package/package.json +1 -6
  33. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js +0 -2
  34. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +0 -1
  35. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js +0 -2
  36. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +0 -1
  37. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts +0 -4
  38. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("react"),n=require("../../organisms/TextSection/TextSection.js"),o=require("../../organisms/ScopeSection/ScopeSection.js"),s=require("../../organisms/ConditionSection/ConditionSection.js"),d=require("../../organisms/ConfigSection/ConfigSection.js"),a=require("../../InputDataReasoningCard.js"),l=require("../../_svg/ButtonCognitiveIcon.js");exports.BaseTemplate=function(r){var c,p,g,h,v,u,I,E,m,f,b,S,y,x,C,A,_,j,T,N,w,W,D,L,O,M,q,P,R,V,H,B,K,z=r.state,k=r.handlers,F=r.uiState,G=r.customNodes,J=void 0===G?{}:G,Q=t.useState({}),U=Q[0],X=Q[1],Y=t.useState(new Set),Z=Y[0],$=Y[1],ii=function(e){X(function(t){var n;return i.__assign(i.__assign({},t),((n={})[e]=!t[e],n))})},ei=function(i){var e,t=null===(e=z.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(t)&&t.length>0?t:z.citations||[]},ti={marginTop:"-17px",position:"relative",zIndex:1},ni=function(i){return!!F.isAiStreaming||(!!F.isReadOnly||!(!F.activeEditId||F.activeEditId.startsWith(i)))};return e.jsxs("div",i.__assign({className:"base-template-container",style:{display:"flex",flexDirection:"column",gap:"16px",width:"100%"}},{children:[J.top&&e.jsx("div",i.__assign({className:"custom-slot-top"},{children:J.top})),e.jsxs("div",i.__assign({className:"template-section"},{children:[e.jsx(n.TextSection,{id:"base-title",title:F.titleLabel||"Title",fieldName:F.titleLabel||"Title",rows:1,placeholder:"Enter a descriptive title",required:!0,value:z.title||"",onChange:k.onTitleChange,readOnly:ni("base-title"),isOpen:U.title,onToggle:function(){return ii("title")},isHighlighted:(null===(c=F.highlights)||void 0===c?void 0:c.get("title"))||!1,showCognitiveIcon:!!(null===(p=z.citation)||void 0===p?void 0:p.title),tooltipDescription:"Why this ".concat(F.titleLabel||"Title","?"),errorMessage:null===(g=F.validationErrors)||void 0===g?void 0:g.title,enableInlineEdit:!0,setSendMessageInChat:F.setSendMessageInChat,activeEditId:null!==(h=F.activeEditId)&&void 0!==h?h:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(v=F.pendingEditId)&&void 0!==v?v:null,setPendingEditId:F.setPendingEditId}),(null===(u=z.citation)||void 0===u?void 0:u.title)&&e.jsx("div",i.__assign({style:ti},{children:e.jsx(a.InputDataReasoningCard,{isVisible:U.title,citation:z.citation.title,citations:ei("title"),fieldName:F.titleLabel||"Title",fieldValue:z.title||""})}))]})),J.afterTitle&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterTitle})),F.showScope&&e.jsxs("div",i.__assign({className:"template-section"},{children:[e.jsx(o.ScopeSection,{id:"base-scope",title:F.scopeLabel||"",required:!1,scopeData:z.scopeData||{},onScopeChange:k.onScopeChange,openSections:Z,setOpenSections:$,stationOptions:F.stationOptions||[],tierOptions:F.tierOptions||[],tierLabel:F.tierLabel||"Where should this apply?",stationLabel:F.stationLabel||"Which scope should this belong to?",highlights:(null===(I=F.highlights)||void 0===I?void 0:I.get("scope"))||{},isOpen:U.scope,onToggle:function(){return ii("scope")},showCognitiveIcon:!!(null===(E=z.citation)||void 0===E?void 0:E.scope),cognitiveIcon:e.jsx(l.ButtonCognitiveIcon,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(m=F.validationErrors)||void 0===m?void 0:m.station)||(null===(f=F.validationErrors)||void 0===f?void 0:f.tiers),stationErrorMessage:null===(b=F.validationErrors)||void 0===b?void 0:b.station,tierErrorMessage:null===(S=F.validationErrors)||void 0===S?void 0:S.tiers,readOnly:ni("base-scope")}),(null===(y=z.citation)||void 0===y?void 0:y.scope)&&e.jsx("div",i.__assign({style:ti},{children:e.jsx(a.InputDataReasoningCard,{isVisible:U.scope,citation:z.citation.scope,citations:ei("scope"),fieldName:"Scope",fieldValue:(null===(C=null===(x=z.scopeData)||void 0===x?void 0:x.tiers)||void 0===C?void 0:C.join(", "))||""})}))]})),J.afterScope&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterScope})),e.jsxs("div",i.__assign({className:"template-section"},{children:[e.jsx(n.TextSection,{id:"base-description",title:F.descriptionLabel||"Description",fieldName:F.descriptionLabel||"Description",rows:3,placeholder:"Explain the behaviour or learning",required:!0,value:z.description||"",onChange:k.onDescriptionChange,readOnly:ni("base-description"),isOpen:U.description,onToggle:function(){return ii("description")},isHighlighted:(null===(A=F.highlights)||void 0===A?void 0:A.get("description"))||!1,showCognitiveIcon:!!(null===(_=z.citation)||void 0===_?void 0:_.description),tooltipDescription:"Why this ".concat(F.descriptionLabel||"Description","?"),errorMessage:null===(j=F.validationErrors)||void 0===j?void 0:j.description,enableInlineEdit:!0,setSendMessageInChat:F.setSendMessageInChat,activeEditId:null!==(T=F.activeEditId)&&void 0!==T?T:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(N=F.pendingEditId)&&void 0!==N?N:null,setPendingEditId:F.setPendingEditId}),(null===(w=z.citation)||void 0===w?void 0:w.description)&&e.jsx("div",i.__assign({style:ti},{children:e.jsx(a.InputDataReasoningCard,{isVisible:U.description,citation:z.citation.description,citations:ei("description"),fieldName:F.descriptionLabel||"Description",fieldValue:z.description||""})}))]})),J.afterDescription&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterDescription})),e.jsx("div",i.__assign({className:"template-section"},{children:e.jsx(s.ConditionSection,{id:"condition-wta-base",idPrefix:"condition-wta",title:F.whenToApplyLabel||"When to apply",required:!0,dividerRequired:!0,readOnly:ni("condition-wta"),conditions:z.whenToApplyConditions||[],onAdd:k.onAddWhenToApply,onRemove:function(i,e,t){return k.onRemoveWhenToApply(t)},onEdit:function(i,e,t,n){return k.onEditWhenToApply(t,n)},isHighlighted:(null===(W=F.highlights)||void 0===W?void 0:W.get("wta"))||!1,highlightedIds:F.highlightedIds,tooltipDescription:"Why this Condition?",citations:ei("whenToApply"),bordered:!0,addLabel:"Add ".concat(F.whenToApplyLabel||"When to apply"),isAiStreaming:F.isAiStreaming,errorMessage:(null===(D=F.validationErrors)||void 0===D?void 0:D.whenToApply)||F.conflictReason,index:0,tierKey:"base",activeEditId:null!==(L=F.activeEditId)&&void 0!==L?L:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(O=F.pendingEditId)&&void 0!==O?O:null,setPendingEditId:F.setPendingEditId,setSendMessageInChat:F.setSendMessageInChat})})),J.afterWhenToApply&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterWhenToApply})),e.jsx("div",i.__assign({className:"template-section"},{children:e.jsx(s.ConditionSection,{id:"condition-wnta-base",idPrefix:"condition-wnta",title:F.whenNotToApplyLabel||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:ni("condition-wnta"),conditions:z.whenNotToApplyConditions||[],onAdd:k.onAddWhenNotToApply,onRemove:function(i,e,t){return k.onRemoveWhenToApply(t)},onEdit:function(i,e,t,n){return k.onEditWhenNotToApply(t,n)},isHighlighted:(null===(M=F.highlights)||void 0===M?void 0:M.get("wnta"))||!1,highlightedIds:F.highlightedIds,tooltipDescription:"Why this Condition?",citations:ei("whenNotToApply"),bordered:!0,addLabel:"Add ".concat(F.whenNotToApplyLabel||"When NOT to apply"),isAiStreaming:F.isAiStreaming,errorMessage:null===(q=F.validationErrors)||void 0===q?void 0:q.whenNotToApply,index:0,tierKey:"base",activeEditId:null!==(P=F.activeEditId)&&void 0!==P?P:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(R=F.pendingEditId)&&void 0!==R?R:null,setPendingEditId:F.setPendingEditId,setSendMessageInChat:F.setSendMessageInChat})})),J.afterWhenNotToApply&&e.jsx("div",i.__assign({className:"custom-slot"},{children:J.afterWhenNotToApply})),F.showConfiguration&&e.jsxs("div",i.__assign({className:"template-section"},{children:[e.jsx(d.ConfigSection,{id:"base-config",title:F.configLabel||"Configuration",required:!1,highlights:(null===(V=F.highlights)||void 0===V?void 0:V.get("config"))||{},bordered:!0,readOnly:ni("base-config"),onConfigChange:function(i,e){var t;return null===(t=k.onConfigChange)||void 0===t?void 0:t.call(k,i,e)},separationItems:F.separationItems||[],toggles:F.toggles||[],index:0,openSections:Z,setOpenSections:$,activeEditId:null!==(H=F.activeEditId)&&void 0!==H?H:null,setActiveEditId:F.setActiveEditId,pendingEditId:null!==(B=F.pendingEditId)&&void 0!==B?B:null,setPendingEditId:F.setPendingEditId,isAiStreaming:F.isAiStreaming,setSendMessageInChat:F.setSendMessageInChat}),(null===(K=z.citation)||void 0===K?void 0:K.config)&&e.jsx("div",i.__assign({style:ti},{children:e.jsx(a.InputDataReasoningCard,{isVisible:U.config,citation:z.citation.config,citations:ei("config"),fieldName:F.configLabel||"Configuration",fieldValue:"Proposed Configuration"})}))]})),J.bottom&&e.jsx("div",i.__assign({className:"custom-slot-bottom"},{children:J.bottom}))]}))};
2
+ //# sourceMappingURL=BaseTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseTemplate.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(t),o=0,a=function(){return"cond-".concat(Date.now(),"-").concat(++o)},l="#CBD5E1",d="#9B8AFB",c="#7C3AED",g="#FDA29B",u="#344054",p="#1E293B",x="#334155",f="#64748B",h="#94A3B8",_="#98A2B3",y="#F04438",m="#8F2C23",b="#5925DC",j="#475569",v="#FFFFFF",w="#F8FAFC",C="#F1F5F9",F="#F9F5FF",k="#17B26A",S="#F04438",z="#64748B",D="6px",E="8px",A="Inter, sans-serif",B={width:38,height:38,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #D0D5DD",borderRadius:D,cursor:"pointer",background:v,flexShrink:0,transition:"background 0.15s"},R={width:"100%",boxSizing:"border-box",padding:"8px 11.5px",border:"1px solid #D0D5DD",borderRadius:D,fontSize:14,fontWeight:400,lineHeight:"100%",fontFamily:A,outline:"none",color:u,background:v},T={display:"flex",alignItems:"center",gap:4,marginBottom:8,color:u,fontSize:14,fontWeight:500,lineHeight:"130%",fontFamily:A},I={background:v,border:"1px solid ".concat(l),borderRadius:E,padding:16},W=n.jsx("span",e.__assign({style:{color:m,fontSize:12,lineHeight:1,display:"inline-flex",transform:"translateY(0.5px)"}},{children:"*"})),H={exact_match:{label:"Exact Match",bg:"#F0FDF4",border:"#BBF7D0",text:"#166534",dot:"#22C55E"},conflict:{label:"Conflict",bg:"#FEF2F2",border:"#FECACA",text:"#991B1B",dot:"#EF4444"},partial_overlap:{label:"Partial Match",bg:"#FFF7ED",border:"#FED7AA",text:"#92400E",dot:"#F97316"},new_field:{label:"New",bg:"#F5F3FF",border:"#DDD6FE",text:"#5925DC",dot:"#7C3AED"}},L=function(e){return e?Array.isArray(e)?e.filter(Boolean).join("\n"):e:""},M=function(e,n){if(!n&&!e)return"exact_match";if(!n)return"new_field";if(!e)return"new_field";var t=function(e){return e.trim().toLowerCase()};if(t(e)===t(n))return"exact_match";var i=new Set(t(e).split(/\s+/)),s=new Set(t(n).split(/\s+/));return Array.from(i).filter(function(e){return s.has(e)}).length/Math.max(i.size,s.size)>=.45?"partial_overlap":"conflict"},N=function(t){var i=t.relation,s=H[i];return n.jsxs("div",e.__assign({style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 9px",borderRadius:20,background:s.bg,border:"1px solid ".concat(s.border),fontSize:10,fontWeight:600,color:s.text,fontFamily:A,whiteSpace:"nowrap",flexShrink:0}},{children:[n.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:s.dot,flexShrink:0}}),s.label]}))},O=r.default.forwardRef(function(t,i){var s=t.label,r=t.value;return n.jsxs("div",e.__assign({ref:i,style:{display:"flex",flexDirection:"column"}},{children:[n.jsx("p",e.__assign({style:{margin:"0 0 5px 0",fontSize:12,color:f,fontFamily:A}},{children:s})),n.jsx("div",e.__assign({style:{flex:1,padding:"9px 12px",borderRadius:E,background:"#FFF3F2",border:"1px solid ".concat("#FECACA"),fontSize:13,lineHeight:"150%",color:r?p:h,fontFamily:A,fontStyle:r?"normal":"italic",wordBreak:"break-word",whiteSpace:"pre-wrap",minHeight:37}},{children:r||"—"}))]}))});O.displayName="FieldCell";var q=function(s){var r=s.formData,o=s.existingData,a=s.onClose,d=s.visible,c=r.whenToApply.map(function(e){return e.text}).filter(Boolean).join("\n"),g=r.whenNotToApply.map(function(e){return e.text}).filter(Boolean).join("\n"),u=L(o.whenToApply),f=L(o.whenNotToApply),h=t.useMemo(function(){return[{label:"Title",proposed:r.name,existing:o.name||"",relation:M(r.name,o.name||"")},{label:"Description",proposed:r.description,existing:o.description||"",relation:M(r.description,o.description||"")},{label:"When to apply",proposed:c,existing:u,relation:M(c,u)},{label:"When NOT to Apply",proposed:g,existing:f,relation:g?M(g,f):f?"new_field":"exact_match"}]},[r.name,r.description,c,g,o.name,o.description,u,f]),_=h.reduce(function(e,n){return e[n.relation]=(e[n.relation]||0)+1,e},{}),y=t.useRef(null),m=t.useRef([]),j=t.useRef([]),w=t.useState([]),C=w[0],F=w[1];m.current=[],j.current=[];var k=t.useCallback(function(){if(y.current){var e=y.current.getBoundingClientRect(),n=[];h.forEach(function(t,i){var s=m.current[i],r=j.current[i];if(s&&r){s.style.height="auto",r.style.height="auto";var o=s.getBoundingClientRect(),a=r.getBoundingClientRect(),l=Math.max(o.height,a.height);s.style.height="".concat(l,"px"),r.style.height="".concat(l,"px");var d=s.getBoundingClientRect(),c=r.getBoundingClientRect(),g=d.top+d.height/2-e.top;n.push({x1:d.right-e.left,y1:g,x2:c.left-e.left,y2:g,relation:t.relation})}}),F(n)}},[h]);return t.useEffect(function(){var e=setTimeout(k,150);window.addEventListener("resize",k);var n=null;return y.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){return k()})})).observe(y.current),function(){clearTimeout(e),window.removeEventListener("resize",k),n&&n.disconnect()}},[k,d]),n.jsxs(n.Fragment,{children:[n.jsx("div",{onClick:a,style:{position:"absolute",inset:0,background:"rgba(15,23,42,0.18)",zIndex:10,opacity:d?1:0,transition:"opacity 0.25s ease",pointerEvents:d?"auto":"none"}}),n.jsxs("div",e.__assign({style:{position:"absolute",inset:0,background:v,zIndex:11,display:"flex",flexDirection:"column",transform:d?"translateX(0)":"translateX(100%)",transition:"transform 0.28s cubic-bezier(0.4,0,0.2,1)",borderRadius:E,overflow:"hidden"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid ".concat(l),flexShrink:0,background:v}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[n.jsx("button",e.__assign({type:"button",onClick:a,style:e.__assign(e.__assign({},B),{width:32,height:32,border:"1px solid ".concat(l),borderRadius:D})},{children:n.jsx(i.ArrowLeft,{size:15,color:x})})),n.jsx("span",e.__assign({style:{fontSize:15,fontWeight:600,color:p,fontFamily:A,letterSpacing:"-0.01em"}},{children:"Category Comparison"}))]})),n.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}},{children:Object.entries(_).map(function(t){var i=t[0],s=t[1];return n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:20,background:H[i].bg,border:"1px solid ".concat(H[i].border),fontSize:11,fontWeight:600,color:H[i].text,fontFamily:A}},{children:[n.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:H[i].dot}}),s," ",H[i].label]}),i)})}))]})),n.jsx("div",e.__assign({style:{flex:1,overflowY:"auto",padding:16}},{children:n.jsxs("div",e.__assign({ref:y,style:{display:"grid",gridTemplateColumns:"1fr 140px 1fr",alignItems:"start",gap:"0",position:"relative"}},{children:[n.jsx("svg",e.__assign({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:C.map(function(t,i){var s=(t.x1+t.x2)/2,r=t.y1,o=H[t.relation];return n.jsxs("g",{children:[n.jsx("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:o.border,strokeWidth:"1.5"}),n.jsx("foreignObject",e.__assign({x:s-70,y:r-14,width:"140",height:"28"},{children:n.jsx("div",e.__assign({style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsx(N,{relation:t.relation})}))}))]},i)})})),n.jsxs("div",e.__assign({style:{border:"1.5px dashed #CBD5E1",borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:14}},{children:[n.jsx("p",e.__assign({style:{margin:"0 0 2px 0",fontSize:13,fontWeight:600,color:p,fontFamily:A}},{children:"Category You're Creating"})),h.map(function(e,t){return n.jsx(O,{ref:function(e){m.current[t]=e},label:e.label,value:e.proposed},t)})]})),n.jsx("div",{}),n.jsxs("div",e.__assign({style:{border:"1.5px dashed #CBD5E1",borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:14}},{children:[n.jsxs("p",e.__assign({style:{margin:"0 0 2px 0",fontSize:13,fontWeight:600,color:b,fontFamily:A,display:"flex",alignItems:"center",gap:5}},{children:[n.jsx(i.Sparkles,{size:13,color:b}),"Existing Category"]})),h.map(function(e,t){return n.jsx(O,{ref:function(e){j.current[t]=e},label:e.label,value:e.existing},t)})]}))]}))}))]}))]})},K=function(t){var s=t.condition,r=t.index,o=t.isEditing,a=t.editText,c=t.onEditStart,p=t.onEditChange,x=t.onEditSave,f=t.onEditCancel,_=t.onRemove,y=t.readOnly,m=t.onBlurContainer,b={width:40,height:38,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:w,borderRight:"1px solid #D0D5DD",color:j,fontSize:14,fontFamily:A};return o?n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12},onBlur:m},{children:[n.jsxs("div",e.__assign({style:{display:"flex",flex:1,alignItems:"center",background:v,border:"1px solid ".concat(d),borderRadius:E,overflow:"hidden"}},{children:[n.jsx("div",e.__assign({style:b},{children:r+1})),n.jsx("input",{type:"text",value:a,onChange:function(e){return p(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Enter"===e.key&&a.trim()?x():"Escape"===e.key&&f()},style:{flex:1,padding:"8px 11.5px",fontSize:14,fontFamily:A,color:u,border:"none",outline:"none",background:"transparent"}})]})),n.jsx("button",e.__assign({type:"button",disabled:!a.trim(),onClick:x,style:e.__assign(e.__assign({},B),{borderRadius:E,opacity:a.trim()?1:.5,cursor:a.trim()?"pointer":"not-allowed",background:a.trim()?v:w})},{children:n.jsx(i.Check,{size:18,color:k})})),n.jsx("button",e.__assign({type:"button",onClick:f,style:e.__assign(e.__assign({},B),{borderRadius:E})},{children:n.jsx(i.X,{size:18,color:S})}))]})):n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",flex:1,alignItems:"center",background:v,border:"1px solid #D0D5DD",borderRadius:E,overflow:"hidden",height:38}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign({},b),{height:"100%"})},{children:r+1})),n.jsx("div",e.__assign({style:{flex:1,padding:"0 11.5px",fontSize:14,fontFamily:A,display:"flex",alignItems:"center",height:"100%"}},{children:s.text?n.jsx("span",e.__assign({style:{color:u}},{children:s.text})):n.jsx("span",e.__assign({style:{color:h}},{children:"Enter condition"}))}))]})),!y&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({type:"button",onClick:c,style:e.__assign(e.__assign({},B),{border:"1px solid ".concat(l),borderRadius:E})},{children:n.jsx(i.Pencil,{size:16,color:z})})),n.jsx("button",e.__assign({type:"button",onClick:_,style:e.__assign(e.__assign({},B),{border:"1px solid ".concat(g),borderRadius:E})},{children:n.jsx(i.Trash2,{size:16,color:S})}))]})]}))},P=function(t){var s=t.title,r=t.required,o=t.isExpanded,a=t.setIsExpanded,d=t.conditions,c=t.prefix,g=t.editingCondKey,p=t.editingCondText,x=t.setEditingCondKey,_=t.setEditingCondText,m=t.onAdd,j=t.onUpdate,v=t.onRemove,w=t.addLabel,C=t.readOnly,F=t.errorMessage,k=t.style,S=d.length>0;return n.jsxs("div",e.__assign({style:e.__assign({border:"1px solid ".concat(l),borderRadius:E,padding:16},k)},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8,cursor:S?"pointer":"default",userSelect:"none"},onClick:function(){S&&a(function(e){return!e})}},{children:[n.jsxs("label",e.__assign({style:e.__assign(e.__assign({},T),{marginBottom:0,cursor:S?"pointer":"default"})},{children:[r&&W,n.jsx("span",{children:s})]})),n.jsx("button",e.__assign({type:"button",style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"flex",alignItems:"center",transform:o?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.2s"}},{children:n.jsx(i.ChevronUp,{size:20,color:S?u:h})}))]})),o&&n.jsxs(n.Fragment,{children:[0===d.length&&n.jsx("p",e.__assign({style:{color:f,fontSize:14,fontStyle:"italic",fontWeight:300,fontFamily:A,margin:"0 0 12px 0"}},{children:"No conditions applied"})),n.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:12,marginBottom:12}},{children:d.map(function(e,t){var i="".concat(c,"_").concat(e.id);return n.jsx(K,{condition:e,index:t,isEditing:g===i,editText:p,onEditStart:function(){x(i),_(e.text)},onEditChange:_,onEditSave:function(){p.trim()&&(j(e.id,p),x(null))},onEditCancel:function(){e.text?x(null):v(e.id)},onRemove:function(){return v(e.id)},readOnly:C,onBlurContainer:function(n){return function(e,n,t){if(!e.currentTarget.contains(e.relatedTarget)){var i="".concat(c,"_").concat(n);p.trim()||t?p.trim()&&j(n,p):v(n),g===i&&x(null)}}(n,e.id,e.text)}},e.id)})})),!C&&n.jsxs("button",e.__assign({type:"button",onClick:m,style:{display:"flex",alignItems:"center",gap:7,color:b,fontSize:14,fontWeight:500,fontFamily:A,background:"none",border:"none",cursor:"pointer",padding:0}},{children:[n.jsx(i.Plus,{size:16}),w]})),F&&n.jsx("p",e.__assign({style:{marginTop:8,color:y,fontSize:12,fontFamily:A,margin:"8px 0 0 0"}},{children:F}))]})]}))},U=function(s){var r=s.state,o=s.handlers,d=s.uiState,m=r.formData,w=r.nameLabel,H=void 0===w?"Category Name":w,L=r.namePlaceholder,M=void 0===L?"Enter category name":L,N=o.setFormData,O=d.readOnly,K=void 0!==O&&O,U=d.isAiStreaming,X=void 0!==U&&U;d.setActiveEditId,d.setSendMessageInChat;var Y=d.validationErrors,V=void 0===Y?{}:Y,Z=d.addExampleBtnRef,G=d.comparisonData,J=void 0===G?null:G,Q=d.onComparisonClose,$=t.useState(null),ee=$[0],ne=$[1],te=t.useState(""),ie=te[0],se=te[1],re=t.useState(null),oe=re[0],ae=re[1],le=t.useState(""),de=le[0],ce=le[1],ge=t.useState(!0),ue=ge[0],pe=ge[1],xe=t.useState(!0),fe=xe[0],he=xe[1],_e=t.useState(null),ye=_e[0],me=_e[1],be=t.useState(""),je=be[0],ve=be[1],we=t.useState(""),Ce=we[0],Fe=we[1],ke=t.useState([]),Se=ke[0],ze=ke[1],De=t.useState(!1),Ee=De[0],Ae=De[1],Be=t.useRef(null),Re=t.useState(!1),Te=Re[0],Ie=Re[1],We=t.useRef(X);t.useEffect(function(){J?requestAnimationFrame(function(){return Ae(!0)}):Ae(!1)},[J]),t.useEffect(function(){We.current&&!X&&Te&&Ie(!1),We.current=X},[X,Te]);var He=K,Le=t.useCallback(function(n,t){return N(function(i){var s;return e.__assign(e.__assign({},i),((s={})[n]=t,s))})},[N]),Me=function(n){var t=a();N(function(i){var s;return e.__assign(e.__assign({},i),((s={})[n]=e.__spreadArray(e.__spreadArray([],i[n],!0),[{id:t,text:""}],!1),s))}),ae("".concat("whenToApply"===n?"wta":"wnta","_").concat(t)),ce(""),"whenToApply"!==n||ue||pe(!0),"whenNotToApply"!==n||fe||he(!0)},Ne=function(n,t,i){return N(function(s){var r;return e.__assign(e.__assign({},s),((r={})[n]=s[n].map(function(n){return n.id===t?e.__assign(e.__assign({},n),{text:i}):n}),r))})},Oe=function(n,t){return N(function(i){var s;return e.__assign(e.__assign({},i),((s={})[n]=i[n].filter(function(e){return e.id!==t}),s))})},qe=function(n){return ze(function(t){return t.includes(n)?t.filter(function(e){return e!==n}):e.__spreadArray(e.__spreadArray([],t,!0),[n],!1)})},Ke=t.useCallback(function(){var n=a();N(function(t){return e.__assign(e.__assign({},t),{occurrences:e.__spreadArray(e.__spreadArray([],t.occurrences||[],!0),[{id:n,title:"",description:""}],!1)})}),me(n),ve(""),Fe(""),ze(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),[n],!1)})},[N]),Pe=t.useCallback(function(){Ae(!1),setTimeout(function(){null==Q||Q()},280)},[Q]),Ue=function(t){return n.jsxs("button",e.__assign({ref:t?void 0:Z,type:"button",disabled:t,onClick:Ke,style:{display:"flex",alignItems:"center",gap:7,padding:"7px 10.5px",background:"none",border:"none",cursor:t?"not-allowed":"pointer",opacity:t?.5:1,transition:"opacity 0.15s"}},{children:[n.jsx(i.Plus,{size:14,color:b}),n.jsx("span",e.__assign({style:{color:b,fontSize:14,fontWeight:500,fontFamily:A}},{children:"Add example"}))]}))};return n.jsxs("div",e.__assign({style:{flex:1,overflowY:"auto",position:"relative"}},{children:[J&&n.jsx(q,{formData:m,existingData:J,onClose:Pe,visible:Ee}),Te&&X&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",color:"#141414",fontSize:13,fontWeight:500,fontStyle:"italic",marginBottom:12,paddingLeft:4,fontFamily:A}},{children:[n.jsx(i.Loader2Icon,{size:16,style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Updating category details..."]})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},I),{marginBottom:12})},{children:[n.jsxs("div",e.__assign({style:{marginBottom:12}},{children:[n.jsxs("label",e.__assign({style:T},{children:[W,n.jsx("span",{children:H})]})),He&&"name"!==ee?n.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12}},{children:n.jsx("div",e.__assign({style:{flex:1,padding:"10px 14px",border:"1px solid #D0D5DD",borderRadius:D,fontSize:14,background:v,minHeight:42,display:"flex",alignItems:"center"}},{children:m.name?n.jsx("span",e.__assign({style:{color:u}},{children:m.name})):n.jsx("span",e.__assign({style:{color:_}},{children:M}))}))})):He&&"name"===ee?n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12}},{children:[n.jsx("input",{type:"text",value:ie,onChange:function(e){return se(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Enter"===e.key?(Le("name",ie),ne(null)):"Escape"===e.key&&ne(null)},placeholder:M,style:e.__assign(e.__assign({},R),{flex:1,width:"auto",border:"1px solid ".concat(c)})}),n.jsx("button",e.__assign({type:"button",onClick:function(){Le("name",ie),ne(null)},style:B},{children:n.jsx(i.Check,{size:18,color:k})})),n.jsx("button",e.__assign({type:"button",onClick:function(){return ne(null)},style:B},{children:n.jsx(i.X,{size:18,color:S})}))]})):n.jsx("input",{type:"text",value:m.name,onChange:function(e){return Le("name",e.target.value)},placeholder:M,disabled:X,style:e.__assign(e.__assign({},R),{opacity:X?.6:1,cursor:X?"not-allowed":"text"})}),(null==V?void 0:V.name)&&n.jsx("p",e.__assign({style:{marginTop:4,color:y,fontSize:12,fontFamily:A,margin:"4px 0 0 0"}},{children:V.name}))]})),n.jsxs("div",e.__assign({style:{marginBottom:12}},{children:[n.jsxs("label",e.__assign({style:T},{children:[W,n.jsx("span",{children:"Category Description"})]})),He&&"description"!==ee?n.jsx("div",e.__assign({style:{display:"flex",alignItems:"flex-start",gap:12}},{children:n.jsx("div",e.__assign({style:{flex:1,padding:"12px 14px",border:"1px solid #D0D5DD",borderRadius:D,fontSize:14,background:v,minHeight:80}},{children:m.description?n.jsx("span",e.__assign({style:{color:u,whiteSpace:"pre-wrap"}},{children:m.description})):n.jsx("span",e.__assign({style:{color:_}},{children:"Describe when this category should be applied"}))}))})):He&&"description"===ee?n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"flex-start",gap:12}},{children:[n.jsx("textarea",{value:ie,onChange:function(e){return se(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Escape"===e.key&&ne(null)},placeholder:"Enter Description",rows:4,style:e.__assign(e.__assign({},R),{flex:1,width:"auto",border:"1px solid ".concat(c),resize:"none",lineHeight:"140%"})}),n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:8}},{children:[n.jsx("button",e.__assign({type:"button",onClick:function(){Le("description",ie),ne(null)},style:B},{children:n.jsx(i.Check,{size:18,color:k})})),n.jsx("button",e.__assign({type:"button",onClick:function(){return ne(null)},style:B},{children:n.jsx(i.X,{size:18,color:S})}))]}))]})):n.jsx("textarea",{value:m.description,onChange:function(e){return Le("description",e.target.value)},placeholder:"Describe when this category should be applied.",disabled:X,style:e.__assign(e.__assign({},R),{height:60,paddingTop:7,paddingBottom:10.5,border:"1px solid ".concat(l),lineHeight:"140%",resize:"none",boxShadow:"0 1px 2px 0 rgba(18,18,23,0.05)",opacity:X?.6:1,cursor:X?"not-allowed":"text"})}),(null==V?void 0:V.description)&&n.jsx("p",e.__assign({style:{marginTop:4,color:y,fontSize:12,fontFamily:A,margin:"4px 0 0 0"}},{children:V.description}))]})),n.jsx(P,{title:"When to Apply",required:!0,isExpanded:ue,setIsExpanded:pe,conditions:m.whenToApply,prefix:"wta",editingCondKey:oe,editingCondText:de,setEditingCondKey:ae,setEditingCondText:ce,onAdd:function(){return Me("whenToApply")},onUpdate:function(e,n){return Ne("whenToApply",e,n)},onRemove:function(e){return Oe("whenToApply",e)},addLabel:"Add When to Apply",readOnly:X||K,errorMessage:null==V?void 0:V.whenToApply,style:{marginBottom:12}}),n.jsx(P,{title:"When NOT to Apply",required:!1,isExpanded:fe,setIsExpanded:he,conditions:m.whenNotToApply,prefix:"wnta",editingCondKey:oe,editingCondText:de,setEditingCondKey:ae,setEditingCondText:ce,onAdd:function(){return Me("whenNotToApply")},onUpdate:function(e,n){return Ne("whenNotToApply",e,n)},onRemove:function(e){return Oe("whenNotToApply",e)},addLabel:"Add When NOT to Apply",readOnly:X||K,errorMessage:null==V?void 0:V.whenNotToApply})]})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},I),{marginTop:12})},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12}},{children:[n.jsxs("div",{children:[n.jsxs("h4",e.__assign({style:{color:p,fontSize:14,fontWeight:500,lineHeight:"120%",letterSpacing:"0.02em",fontFamily:A,margin:"0 0 4px 0"}},{children:["Example (",(m.occurrences||[]).length,")"]})),n.jsx("p",e.__assign({style:{color:f,fontSize:12,fontWeight:300,lineHeight:"120%",letterSpacing:"0.02em",fontFamily:A,margin:0}},{children:"Add real examples to help the system understand this category"}))]}),(m.occurrences||[]).length>0&&!K&&Ue(null!==ye||X)]})),0===(m.occurrences||[]).length?n.jsxs("div",e.__assign({style:{border:"1px solid ".concat(l),borderRadius:E,background:v,padding:"24px 12px 12px",minHeight:181,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}},{children:[n.jsx("div",e.__assign({style:{marginBottom:16}},{children:n.jsxs("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 56 56",fill:"none"},{children:[n.jsx("rect",{x:"4",y:"4",width:"48",height:"48",rx:"24",fill:"#F1F5F9"}),n.jsx("rect",{x:"4",y:"4",width:"48",height:"48",rx:"24",stroke:"#F8FAFC",strokeWidth:"8"}),n.jsx("rect",{width:"24",height:"24",transform:"translate(16 16)",fill:"#F1F5F9"}),n.jsx("path",{d:"M25 19.5V18M21.0607 21.0607L20 20M21.0607 29L20 30.0607M29 21.0607L30.0607 20M19.5 25H18M31.8645 32.1896L29.3727 36.817C29.0881 37.3457 28.9457 37.61 28.7745 37.6769C28.6259 37.7349 28.4585 37.7185 28.324 37.6328C28.1689 37.534 28.0806 37.2471 27.9038 36.6733L24.4452 25.4453C24.3008 24.9765 24.2286 24.7421 24.2867 24.5838C24.3373 24.446 24.446 24.3373 24.5838 24.2867C24.7421 24.2286 24.9765 24.3008 25.4452 24.4452L36.6732 27.9038C37.247 28.0806 37.5339 28.169 37.6327 28.324C37.7185 28.4586 37.7348 28.6259 37.6768 28.7745C37.61 28.9458 37.3456 29.0881 36.817 29.3728L32.1896 31.8645C32.111 31.9068 32.0717 31.9279 32.0374 31.9551C32.0068 31.9792 31.9792 32.0068 31.9551 32.0374C31.9279 32.0717 31.9068 32.111 31.8645 32.1896Z",stroke:"#475569",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))})),n.jsx("p",e.__assign({style:{color:x,fontSize:12,fontWeight:500,lineHeight:"120%",fontFamily:A,margin:"0 0 8px 0"}},{children:"No example added yet"})),n.jsx("p",e.__assign({style:{color:f,fontSize:14,fontWeight:300,lineHeight:"140%",fontFamily:A,margin:"0 0 8px 0",maxWidth:530}},{children:"Add an example to show how this category is used, or generate one using chat."})),!K&&Ue(null!==ye||X)]})):n.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:12}},{children:(m.occurrences||[]).map(function(t,s){var r=Se.includes(t.id);return ye===t.id?n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:12,border:"1px solid ".concat(l),borderRadius:E,background:v,padding:16,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[n.jsxs("div",{children:[n.jsx("label",e.__assign({style:e.__assign(e.__assign({},T),{marginBottom:8})},{children:n.jsx("span",e.__assign({style:{color:x}},{children:"Title/Subject"}))})),n.jsx("input",{type:"text",value:je,onChange:function(e){return ve(e.target.value)},placeholder:"e.g., Follow-up on client feedback from last meeting",style:e.__assign(e.__assign({},R),{border:"1px solid ".concat(l),lineHeight:"140%"})})]}),n.jsxs("div",{children:[n.jsxs("label",e.__assign({style:{display:"flex",alignItems:"center",gap:4,marginBottom:8}},{children:[n.jsx("span",e.__assign({style:{color:x,fontSize:14,fontWeight:500,fontFamily:A}},{children:"Message body"})),W]})),n.jsx("textarea",{ref:function(e){e&&ye===t.id&&!Be.current&&(Be.current=e),e&&(e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px"))},value:Ce,onChange:function(e){Fe(e.target.value),e.target.style.height="auto",e.target.style.height="".concat(e.target.scrollHeight,"px")},placeholder:"e.g., Hi, here's the latest update on the project. Let us know if you have any questions.",rows:1,style:e.__assign(e.__assign({},R),{border:"1px solid ".concat(l),overflow:"hidden",minHeight:60,lineHeight:"140%",resize:"none"})})]}),n.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:4}},{children:[n.jsx("button",e.__assign({type:"button",onClick:function(){t.title||t.description||N(function(n){return e.__assign(e.__assign({},n),{occurrences:(n.occurrences||[]).filter(function(e){return e.id!==t.id})})}),me(null),Be.current=null},style:{padding:"6px 12px",color:j,fontSize:14,fontWeight:500,lineHeight:"140%",fontFamily:A,background:"none",border:"none",cursor:"pointer",borderRadius:D}},{children:"Cancel"})),n.jsx("button",e.__assign({type:"button",disabled:!Ce.trim(),onClick:function(){var n;Ce.trim()&&(n=t.id,N(function(t){return e.__assign(e.__assign({},t),{occurrences:t.occurrences.map(function(t){return t.id===n?e.__assign(e.__assign({},t),{title:je,description:Ce}):t})})}),me(null),Be.current=null,ze(function(e){return e.filter(function(e){return e!==t.id})}))},style:{padding:"6px 12px",borderRadius:D,fontSize:14,fontWeight:500,lineHeight:"140%",fontFamily:A,cursor:Ce.trim()?"pointer":"not-allowed",background:Ce.trim()?F:v,border:"1px solid ".concat(Ce.trim()?F:"#E2E8F0"),color:Ce.trim()?b:h,transition:"background 0.15s"}},{children:"Save"}))]}))]}),t.id):n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",border:"1px solid #E2E8F0",borderRadius:E,background:v,overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:12,padding:12}},{children:[n.jsx("div",e.__assign({style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:C,borderRadius:D,color:j,fontSize:10,fontWeight:500,fontFamily:A}},{children:s+1})),n.jsx("div",e.__assign({style:{flex:1,fontSize:15,fontWeight:500,lineHeight:"140%",fontFamily:A,color:x,wordBreak:"break-word"}},{children:t.title||n.jsx("span",e.__assign({style:{color:h,fontWeight:400,fontSize:14}},{children:"Untitled example"}))})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8,flexShrink:0}},{children:[!K&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({type:"button",disabled:null!==ye||X,onClick:function(){me(t.id),ve(t.title),Fe(t.description),r||qe(t.id)},style:e.__assign(e.__assign({},B),{width:36,height:36,border:"1px solid #E2E8F0",borderRadius:D,opacity:null!==ye||X?.5:1,cursor:null!==ye||X?"not-allowed":"pointer"})},{children:n.jsx(i.Pencil,{size:16,color:z})})),n.jsx("button",e.__assign({type:"button",disabled:null!==ye||X,onClick:function(){return N(function(n){return e.__assign(e.__assign({},n),{occurrences:(n.occurrences||[]).filter(function(e){return e.id!==t.id})})})},style:e.__assign(e.__assign({},B),{width:36,height:36,border:"1px solid ".concat(g),borderRadius:D,opacity:null!==ye||X?.5:1,cursor:null!==ye||X?"not-allowed":"pointer"})},{children:n.jsx(i.Trash2,{size:16,color:S})}))]}),n.jsx("button",e.__assign({type:"button",onClick:function(){return qe(t.id)},style:e.__assign(e.__assign({},B),{width:36,height:36,border:"none",background:"transparent"})},{children:r?n.jsx(i.ChevronUp,{size:20,color:z}):n.jsx(i.ChevronDown,{size:20,color:z})}))]}))]})),r&&n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",padding:"4px 12px 16px"}},{children:[n.jsxs("div",e.__assign({style:{marginBottom:12}},{children:[n.jsx("p",e.__assign({style:{color:f,fontSize:13,lineHeight:"140%",fontFamily:A,margin:"0 0 4px 0"}},{children:"Title/Subject:"})),n.jsx("p",e.__assign({style:{color:p,fontSize:14,fontWeight:300,lineHeight:"150%",fontFamily:A,whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},{children:t.title||n.jsx("span",e.__assign({style:{color:h,fontStyle:"italic"}},{children:"—"}))}))]})),n.jsxs("div",{children:[n.jsx("p",e.__assign({style:{color:f,fontSize:13,lineHeight:"140%",fontFamily:A,margin:"0 0 4px 0"}},{children:"Message body:"})),n.jsx("p",e.__assign({style:{color:p,fontSize:14,fontWeight:300,lineHeight:"150%",fontFamily:A,whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},{children:t.description}))]})]}))]}),t.id)})}))]}))]}))};exports.CreateCategory=U,exports.default=U;
2
+ //# sourceMappingURL=CreateCategory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateCategory.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),t=require("../../organisms/ConditionSection/ConditionSection.js"),o=require("../../organisms/TextSection/TextSection.js");exports.WorkflowComposer=function(l){var r,d,s,u=l.state,a=l.handlers,p=l.uiState,g=(null==p?void 0:p.highlights)||{},h=n.useState({}),c=h[0],v=h[1],y=function(e){v(function(n){var t;return i.__assign(i.__assign({},n),((t={})[e]=!n[e],t))})},T=function(i){var e,n=null===(e=u.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(n)&&n.length>0?n:u.citations};return e.jsx("div",i.__assign({className:"simple-guideline-template"},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e.jsx(o.TextSection,i.__assign({id:"guideline-title",title:"Guideline Title",rows:1,placeholder:"Enter a short, descriptive title for the guideline",required:!0,value:u.guidelineTitle,onChange:a.setGuidelineTitle,readOnly:null==p?void 0:p.isAiStreaming,isOpen:c.guidelineTitle,onToggle:function(){return y("guidelineTitle")},isHighlighted:g.guidelineTitle||!1,tooltipDescription:"Why this Title?",errorMessage:null===(r=null==p?void 0:p.validationErrors)||void 0===r?void 0:r.guidelineTitle},p)),e.jsx(o.TextSection,i.__assign({id:"guideline-description",title:"Guideline Description",rows:4,placeholder:"Describe what this guideline enforces or ensures",required:!0,value:u.guidelineDescription,onChange:a.setGuidelineDescription,readOnly:null==p?void 0:p.isAiStreaming,isOpen:c.guidelineDescription,onToggle:function(){return y("guidelineDescription")},isHighlighted:g.guidelineDescription||!1,tooltipDescription:"Why this Description?",errorMessage:null===(d=null==p?void 0:p.validationErrors)||void 0===d?void 0:d.guidelineDescription},p)),e.jsx(t.ConditionSection,i.__assign({id:"when-to-apply",title:"When to apply",required:!0,dividerRequired:!0,readOnly:null==p?void 0:p.isAiStreaming,conditions:u.whenToApplyConditions||[],onAdd:function(){return a.addWhenToApply()},onRemove:function(i,e,n){return a.removeWhenToApply(n)},onEdit:function(i,e,n,t){return a.editWhenToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wta||!1,highlightedIds:null==p?void 0:p.highlightedIds,tooltipDescription:"Why this Condition?",citations:T("whenToApply"),bordered:!0,addLabel:"Add When to apply",isAiStreaming:null==p?void 0:p.isAiStreaming,errorMessage:null===(s=null==p?void 0:p.validationErrors)||void 0===s?void 0:s.whenToApply},p)),e.jsx(t.ConditionSection,i.__assign({id:"when-not-to-apply",title:"When NOT to apply",required:!1,dividerRequired:!0,readOnly:null==p?void 0:p.isAiStreaming,conditions:u.whenNotToApplyConditions||[],onAdd:function(){return a.addWhenNotToApply()},onRemove:function(i,e,n){return a.removeWhenNotToApply(n)},onEdit:function(i,e,n,t){return a.editWhenNotToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wnta||!1,highlightedIds:null==p?void 0:p.highlightedIds,tooltipDescription:"Why this Condition?",citations:T("whenNotToApply"),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:null==p?void 0:p.isAiStreaming},p))]}))}))};
2
+ //# sourceMappingURL=WorkflowComposer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowComposer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("./store/useLearningTemplateStore.js"),a=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./hooks/useLearningTemplateQueryParams.js"),p=require("./components/ConfirmationModal.js"),g=require("./components/LearningTemplateManagementSkeleton.js"),f=require("./utils/treeUtils.js"),_=require("./store/useEnvStore.js"),S=require("./store/useConfigStore.js"),m=require("./components/ToolTip.js"),v=require("./components/CreateRuleSetLegacyModal.js"),T=require("./store/usePermissionsStore.js"),h=require("./store/useAppSecRolesStore.js"),y=require("./queries/useApprovalQueries.js"),E=require("./queries/useLMSConfigQuery.js"),A=require("./RuleContent/AddScopeModal.js"),b=require("./components/RuleContentSkeleton.js"),L=require("./components/ErrorStateDisplay.js"),C=require("react-router-dom"),R=require("./shared/SuccessToastContent.js"),D=require("./shared/ErrorToastContent.js"),j=require("./RuleContent/RenameScopeModal.js"),I=require("./store/useLMSConfigStore.js"),P=require("./constants.js");exports.default=function(q){var M,w,O,N=this,x=q.userDetails,k=q.llmStudioUrl,B=q.audacyBackendUrl,U=q.ilLabels,H=q.config,Y=q.rbacConfig,G=q.auditLogConfig,F=q.app_integration_id,Q=q.backwardCompatibility,W=void 0!==Q&&Q,K=q.cognitiveCompareCompatibility,z=void 0!==K&&K,V=q.modeId,X=q.modeDetails;s.useLearningTemplateStore(function(e){return e.selectedRuleSetId});var J=s.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),Z=s.useLearningTemplateStore(function(e){return e.error}),$=s.useLearningTemplateStore(function(e){return e.setError}),ee=s.useLearningTemplateStore(function(e){return e.setStations}),te=s.useLearningTemplateStore(function(e){return e.scopeTreeData}),ne=s.useLearningTemplateStore(function(e){return e.setScopeTreeData}),re=n.useState({isOpen:!1,type:"GLOBAL"}),se=re[0],ae=re[1],ie=n.useState(!1),oe=ie[0],le=ie[1],ue=n.useState(!1),ce=ue[0],de=ue[1],pe=n.useState("learnings"),ge=pe[0],fe=pe[1],_e=n.useState(null),Se=_e[0],me=_e[1],ve=n.useState(null),Te=ve[0];ve[1];var he=n.useState(!1),ye=he[0],Ee=he[1],Ae=n.useState(!1),be=Ae[0],Le=Ae[1];n.useRef(null);var Ce=n.useRef(null),Re=n.useRef(!1),De=n.useRef(null),je=u.default();je.user;var Ie=je.setUser,Pe=S.useConfigStore(),qe=Pe.setConfig,Me=Pe.setIlLabels,we=function(){try{return C.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){if(!Re.current){var e=new URLSearchParams(window.location.search),t=e.get(d.QUERY_PARAM_KEYS.RULESET_ID),n=e.get(d.QUERY_PARAM_KEYS.SECTION),r=n&&nt.has(n)?n:"learnings";(null==t?void 0:t.length)&&J&&fe&&(J(t),fe(r),Re.current=!0)}},[null==we?void 0:we.search,fe,J]);var Oe=T.usePermissionsStore(function(e){return e.fetchPermissions}),Ne=T.usePermissionsStore(function(e){return e.hasPermission}),xe=h.useAppSecRolesStore(function(e){return e.setRoles}),ke=_.default(function(e){return e.appsecRbacUrl})===Y.appsecRbacUrl,Be=y.useGetAppSecRolesQuery(Y.applicationId,ke).data,Ue=E.useLMSConfigQuery(null!=F?F:"",W),He=Ue.isLoading,Ye=Ue.isError,Ge=Ue.refetch;Ue.isSuccess;var Fe=n.useState(0),Qe=Fe[0],We=Fe[1];n.useEffect(function(){if(!W&&F&&k){e.__awaiter(N,void 0,void 0,function(){var t,n,r,s,a,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,c.getILInstance(F)];case 1:return t=e.sent(),"number"==typeof(n=null===(i=null===(a=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.learningManagement)||void 0===a?void 0:a.scopeAndHierarchy)||void 0===i?void 0:i.maxHierarchyLevels)&&n>0&&We(n-1),[3,3];case 2:return r=e.sent(),console.error("Failed to fetch IL instance for hierarchy levels:",r),[3,3];case 3:return[2]}})})}},[F,k]),n.useEffect(function(){Be&&xe(Be.map(function(e){return{_id:e._id,name:e.name}}))},[Be,xe]),n.useEffect(function(){var e;console.log("userDetails",x),Ie(x),console.log("llmStudioUrl",k),console.log("audacyBackendUrl",B),_.default.getState().setLlmStudioUrl(k),_.default.getState().setAudacyBackendUrl(B),_.default.getState().setRbacConfig(Y),_.default.getState().setAuditLogConfig(G),_.default.getState().setBaseModeName((null==X?void 0:X.modeNameFromURL)||null),qe(H),Me(U),s.useLearningTemplateStore.getState().setAppIntegrationId(null!=F?F:null),s.useLearningTemplateStore.getState().setBackwardCompatibility(W),s.useLearningTemplateStore.getState().setCognitiveCompareCompatibility(null!=z&&z),s.useLearningTemplateStore.getState().setToken(null!==(e=null==x?void 0:x.accessToken)&&void 0!==e?e:null)},[x,Ie,k,B,Y,G,H,qe,U,Me,F,W,z,X]),n.useEffect(function(){(null==x?void 0:x.accessToken)&&k&&c.fetchTiers()},[F,null==x?void 0:x.accessToken,k]);var Ke=function(t){return void 0===t&&(t=!0),e.__awaiter(N,void 0,void 0,function(){var n,r,a,i,o,l,u,d;return e.__generator(this,function(p){switch(p.label){case 0:t&&le(!0),$(null),p.label=1;case 1:return p.trys.push([1,4,5,6]),[4,Oe(Y.applicationId)];case 2:return p.sent(),n=function(t){if(!T.usePermissionsStore.getState().hasPermission("ilotj.scope.view",t.id))return null;var r=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return e.__assign(e.__assign({},t),{children:r})},[4,c.fetchScopes(F,x.accessToken)];case 3:return(r=p.sent())&&r.data&&r.data.data&&(a=r.data.data,Array.isArray(a)&&(a=a.length>0?a[0]:null),a?(i=n(a))?(me(null),ne({data:i}),Ce.current?(J(Ce.current),fe("learnings"),Ce.current=null):(o=s.useLearningTemplateStore.getState().selectedRuleSetId,l=o?f.findNodeById(i,o):null,o&&l||J(i.id))):(me(null!==(d=a.id)&&void 0!==d?d:null),ne(null)):(me(null),ne(null))),[3,6];case 4:return u=p.sent(),console.error("Failed to fetch rule sets or permissions",u),$("Failed to load data. Please try again later."),[3,6];case 5:return le(!1),[7];case 6:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==x?void 0:x.accessToken)||void 0===e?void 0:e.length)&&ke?Ke(!0):console.warn("Error: Trying to fetch rules without access token",x)},[null==x?void 0:x.accessToken,$,ee,Y.applicationId,ke]);var ze=function(t,n,r){return e.__awaiter(N,void 0,void 0,function(){var n,r,a,i,o,l,u,d;return e.__generator(this,function(p){switch(p.label){case 0:de(!0),p.label=1;case 1:return p.trys.push([1,4,5,6]),[4,c.deleteRuleSet(t,x.accessToken)];case 2:return p.sent(),s.useLearningTemplateStore.getState().selectedRuleSetId===t&&(n=s.useLearningTemplateStore.getState().scopeTreeData,(r=f.findNodePathById((null==n?void 0:n.data)||null,t))&&r.length>1&&(a=r[r.length-2],J(a),fe("learnings"))),[4,Ke(!0)];case 3:return p.sent(),ae(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(o=De.current)||void 0===o||o.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return i=p.sent(),console.error("An error occurred during scope deletion.",i),null===(l=De.current)||void 0===l||l.show({severity:"error",summary:"Delete Failed",detail:(null===(d=null===(u=null==i?void 0:i.response)||void 0===u?void 0:u.data)||void 0===d?void 0:d.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return de(!1),[7];case 6:return[2]}})})},Ve=function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),d.setQueryParams(((n={})[d.QUERY_PARAM_KEYS.SECTION]="learnings"===t?null:t,n[d.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),fe(t),J(e)},Xe=te,Je=Te?{data:{id:Te.stationId,name:Te.stationName,type:"STATION",metrics:{learningsCount:Te.learningsCount,stationsCount:0},children:[]}}:Xe,Ze=!!(null==Je?void 0:Je.data);null===(M=null==Je?void 0:Je.data)||void 0===M||M.type;var $e=T.usePermissionsStore(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",Y.applicationResourceId||"");if(He)return t.jsx("div",e.__assign({className:i.default.learningManagementContainer},{children:t.jsx(b.default,{})}));if(Ye)return t.jsx("div",e.__assign({className:i.default.learningManagementContainer},{children:t.jsx(L.default,{errorMessage:"Failed to load configuration. Please try again.",onRetry:function(){return Ge()},title:"Error Loading Configuration"})}));var et=e.__spreadArray(e.__spreadArray([{type:"GLOBAL",label:"Global",addChildLabel:"".concat(I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".addScope"),"Add Scope")),addChildType:"SCOPE"}],Array.from({length:Qe},function(){return e.__assign({type:"SCOPE",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".scope"),"Scope")},!W&&{addChildLabel:I.dt("".concat(P.MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH,".addSubScope"),"Add Subscope"),addChildType:"SUBSCOPE"})}),!0),W?[]:[{type:"SUBSCOPE",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".subScope"),"Subscope")}],!0),tt=[{id:"learnings",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".treeMenu.submenu.learnings"),"Learnings"),icon:r.BookOpen,badgeKey:"learningsCount"},{id:"access",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".treeMenu.submenu.access"),"Access"),icon:r.Users},{id:"history",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".treeMenu.submenu.changeHistory"),"Change History"),icon:r.History}],nt=new Set(tt.map(function(e){return e.id})),rt=Te?tt.filter(function(e){return"stations"!==e.id}):tt;return t.jsx(m.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:oe?t.jsx(g.default,{}):Z?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:Z})),t.jsx("button",e.__assign({onClick:function(){return Ke(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):Ze?t.jsx(o.default,{onOpenCreateModal:function(){return ae({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return ae({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return ae({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(N,void 0,void 0,function(){var a,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return a=s.useLearningTemplateStore.getState().scopeTreeData,i=f.findNodePathById((null==a?void 0:a.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,ze(t)];case 1:return e.sent(),[3,3];case 2:ae({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return Ne("ilotj.scope.delete",e)},canEditScope:function(e){return Ne("ilotj.scope.edit",e)},canCreateScope:function(e){return Ne("ilotj.scope.create",e)},onSectionSelect:Ve,activeSectionId:ge,scopeTreeData:Je,sectionsConfig:rt,onViewStation:function(e){Ve(e.stationId,"learnings")},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(Ce.current=t),Ke(e)},nodeTypesConfig:et,app_integration_id:F,token:x.accessToken,modeId:V}):t.jsx(l.default,{onCreate:function(){return ae({isOpen:!0,type:"GLOBAL"})},title:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".title"),"No Global Scope has been added!"),desc:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".desc"),"Start by creating a Global scope to define base learnings that apply across all stations."),button:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".createGlobalScope"),"Create Global Scope"),canCreateRule:$e,noAccessTitle:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".noAccessTitle"),"Access Restricted"),noAccessDesc:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".noAccessDesc"),"You do not have access for this application."),requestAccessButton:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".requestAccessButton"),"Request Access"),requestSentButton:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".requestSentButton"),"Request Sent"),onRequestAccess:function(){return e.__awaiter(N,void 0,void 0,function(){var n,r,a,o,l,u,d,p,g;return e.__generator(this,function(e){switch(e.label){case 0:if(!(n=(null===(o=null===(a=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===a?void 0:a.data)||void 0===o?void 0:o.id)||Se))return null===(l=De.current)||void 0===l||l.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(D.default,{message:"Unable to identify the global scope for this access request."})}),[2];Ee(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.requestAccess(n)];case 2:return e.sent(),Le(!0),null===(u=De.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:i.default.successToast,content:t.jsx(R.default,{message:"Access request submitted successfully!"})}),[3,5];case 3:return r=e.sent(),null===(d=De.current)||void 0===d||d.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(D.default,{message:(null===(g=null===(p=null==r?void 0:r.response)||void 0===p?void 0:p.data)||void 0===g?void 0:g.detail)||"Failed to request access. Please try again."})}),[3,5];case 4:return Ee(!1),[7];case 5:return[2]}})})},isRequestingAccess:ye,isAccessRequested:be})})),t.jsx(a.Toast,{ref:De,pt:{root:{style:{zIndex:9999}}}}),W&&se.isOpen&&"DELETE"!==se.type&&"RENAME"!==se.type?t.jsx(v.default,{isOpen:!0,onClose:function(){return ae(e.__assign(e.__assign({},se),{isOpen:!1}))},onSubmit:function(t){return e.__awaiter(N,void 0,void 0,function(){var n,r,a,i,o,l,u,d,p,g,f,_,S,m,v,T,h,y,E,A;return e.__generator(this,function(b){switch(b.label){case 0:de(!0),n=s.useLearningTemplateStore.getState().backwardCompatibility,b.label=1;case 1:return b.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(a=t,i="SCOPE"===se.type&&se.parentId,o=i?"genreRuleSet":se.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:se.parentId||null,scopeName:a,scopeReferenceMetadata:{},applicationMappingId:F}),[4,c.createRuleSet(r,x.accessToken)];case 2:if(l=b.sent(),!(u=null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.scopeId))return[3,10];if(Ce.current=u,d=n&&(null===(v=r.topic)||void 0===v?void 0:v.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==se.type&&se.parentId,!d&&!p)return[3,10];if(!(g=n?null===(h=null===(T=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===T?void 0:T.data)||void 0===h?void 0:h.id:se.parentId))return[3,10];if(!W)return[3,7];b.label=3;case 3:return b.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:g,target_scope_id:u})];case 4:return b.sent(),[3,6];case 5:return f=b.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return b.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:g,target_scope_id:u,application_mapping_id:F||"",is_copy_parent_variant_id:!1})];case 8:return b.sent(),[3,10];case 9:return _=b.sent(),console.error("Failed to inherit rules for the new scope:",_),[3,10];case 10:return[4,Ke(!0)];case 11:return b.sent(),ae(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw S=b.sent(),console.error("An error occurred during scope creation.",S),null===(y=De.current)||void 0===y||y.show({severity:"error",summary:"Creation Failed",detail:(null===(A=null===(E=null==S?void 0:S.response)||void 0===E?void 0:E.data)||void 0===A?void 0:A.message)||"There was an error creating the scope. Please try again."}),S;case 13:return de(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Ze,canCreateGlobal:$e,globalScopeId:null!==(O=null===(w=null==te?void 0:te.data)||void 0===w?void 0:w.id)&&void 0!==O?O:null}):t.jsxs(t.Fragment,{children:[t.jsx(A.default,{isOpen:se.isOpen&&"DELETE"!==se.type&&"RENAME"!==se.type,onClose:function(){return ae(e.__assign(e.__assign({},se),{isOpen:!1}))},onCreate:function(e){e&&(Ce.current=e),Ke(!0)},hasGlobalRuleSet:Ze,parentId:se.parentId}),t.jsx(j.default,{isOpen:se.isOpen&&"RENAME"===se.type,onClose:function(){return ae(e.__assign(e.__assign({},se),{isOpen:!1}))},onSave:function(n){return e.__awaiter(N,void 0,void 0,function(){var r,a,o,l,u,d;return e.__generator(this,function(p){switch(p.label){case 0:de(!0),p.label=1;case 1:return p.trys.push([1,4,5,6]),se.scopeId?(r=s.useLearningTemplateStore.getState().backwardCompatibility,a=r?{scope_id:se.scopeId,scope_name:n}:{scope_id:se.scopeId,scope_type:"Custom",scope_name:n,application_mapping_id:F},[4,c.renameScope(a,x.accessToken)]):[2];case 2:return p.sent(),[4,Ke(!0)];case 3:return p.sent(),ae(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw o=p.sent(),console.error("An error occurred during scope rename.",o),null===(l=De.current)||void 0===l||l.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(D.default,{message:(null===(d=null===(u=null==o?void 0:o.response)||void 0===u?void 0:u.data)||void 0===d?void 0:d.message)||"There was an error renaming the scope. Please try again."})}),o;case 5:return de(!1),[7];case 6:return[2]}})})},initialName:se.initialName})]}),t.jsx(p.default,{isOpen:se.isOpen&&"DELETE"===se.type,onCancel:function(){return ae(e.__assign(e.__assign({},se),{isOpen:!1}))},onConfirm:function(){return ze(se.scopeId,se.initialName,se.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:se.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:ce})]}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("./store/useLearningTemplateStore.js"),a=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./hooks/useLearningTemplateQueryParams.js"),p=require("./components/ConfirmationModal.js"),g=require("./components/LearningTemplateManagementSkeleton.js"),f=require("./utils/treeUtils.js"),_=require("./store/useEnvStore.js"),S=require("./store/useConfigStore.js"),m=require("./components/ToolTip.js"),v=require("./components/CreateRuleSetLegacyModal.js"),T=require("./store/usePermissionsStore.js"),h=require("./store/useAppSecRolesStore.js"),y=require("./queries/useApprovalQueries.js"),A=require("./queries/useLMSConfigQuery.js"),E=require("./RuleContent/AddScopeModal.js"),b=require("./components/RuleContentSkeleton.js"),L=require("./components/ErrorStateDisplay.js"),C=require("react-router-dom"),R=require("./shared/SuccessToastContent.js"),D=require("./shared/ErrorToastContent.js"),j=require("./RuleContent/RenameScopeModal.js"),I=require("./store/useLMSConfigStore.js"),P=require("./constants.js");exports.default=function(q){var M,w,O,N=this,x=q.userDetails,k=q.llmStudioUrl,B=q.audacyBackendUrl,U=q.ilLabels,H=q.config,Y=q.rbacConfig,G=q.auditLogConfig,F=q.app_integration_id,Q=q.backwardCompatibility,W=void 0!==Q&&Q,K=q.cognitiveCompareCompatibility,z=void 0!==K&&K,V=q.modeId,X=q.modeDetails;s.useLearningTemplateStore(function(e){return e.selectedRuleSetId});var J=s.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),Z=s.useLearningTemplateStore(function(e){return e.error}),$=s.useLearningTemplateStore(function(e){return e.setError}),ee=s.useLearningTemplateStore(function(e){return e.setStations}),te=s.useLearningTemplateStore(function(e){return e.scopeTreeData}),ne=s.useLearningTemplateStore(function(e){return e.setScopeTreeData}),re=n.useState({isOpen:!1,type:"GLOBAL"}),se=re[0],ae=re[1],ie=n.useState(!1),oe=ie[0],le=ie[1],ue=n.useState(!1),ce=ue[0],de=ue[1],pe=n.useState("learnings"),ge=pe[0],fe=pe[1],_e=n.useState(null),Se=_e[0],me=_e[1],ve=n.useState(null),Te=ve[0];ve[1];var he=n.useState(!1),ye=he[0],Ae=he[1],Ee=n.useState(!1),be=Ee[0],Le=Ee[1];n.useRef(null);var Ce=n.useRef(null),Re=n.useRef(!1),De=n.useRef(null),je=u.default();je.user;var Ie=je.setUser,Pe=S.useConfigStore(),qe=Pe.setConfig,Me=Pe.setIlLabels,we=function(){try{return C.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){if(!Re.current){var e=new URLSearchParams(window.location.search),t=e.get(d.QUERY_PARAM_KEYS.RULESET_ID),n=e.get(d.QUERY_PARAM_KEYS.SECTION),r=n&&rt.has(n)?n:"learnings";(null==t?void 0:t.length)&&J&&fe&&(J(t),fe(r),Re.current=!0)}},[null==we?void 0:we.search,fe,J]);var Oe=T.usePermissionsStore(function(e){return e.fetchPermissions}),Ne=T.usePermissionsStore(function(e){return e.hasPermission}),xe=h.useAppSecRolesStore(function(e){return e.setRoles}),ke=_.default(function(e){return e.appsecRbacUrl})===Y.appsecRbacUrl,Be=y.useGetAppSecRolesQuery(Y.applicationId,ke).data,Ue=A.useLMSConfigQuery(null!=F?F:"",W),He=Ue.isLoading,Ye=Ue.isError,Ge=Ue.refetch;Ue.isSuccess;var Fe=n.useState(0),Qe=Fe[0],We=Fe[1];n.useEffect(function(){if(!W&&F&&k){e.__awaiter(N,void 0,void 0,function(){var t,n,r,s,a,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,c.getILInstance(F)];case 1:return t=e.sent(),"number"==typeof(n=null===(i=null===(a=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.learningManagement)||void 0===a?void 0:a.scopeAndHierarchy)||void 0===i?void 0:i.maxHierarchyLevels)&&n>0&&We(n-1),[3,3];case 2:return r=e.sent(),console.error("Failed to fetch IL instance for hierarchy levels:",r),[3,3];case 3:return[2]}})})}},[F,k]),n.useEffect(function(){Be&&xe(Be.map(function(e){return{_id:e._id,name:e.name}}))},[Be,xe]),n.useEffect(function(){var e;console.log("userDetails",x),Ie(x),console.log("llmStudioUrl",k),console.log("audacyBackendUrl",B),_.default.getState().setLlmStudioUrl(k),_.default.getState().setAudacyBackendUrl(B),_.default.getState().setRbacConfig(Y),_.default.getState().setAuditLogConfig(G),_.default.getState().setBaseModeName((null==X?void 0:X.modeNameFromURL)||null),qe(H),Me(U),s.useLearningTemplateStore.getState().setAppIntegrationId(null!=F?F:null),s.useLearningTemplateStore.getState().setBackwardCompatibility(W),s.useLearningTemplateStore.getState().setCognitiveCompareCompatibility(null!=z&&z),s.useLearningTemplateStore.getState().setToken(null!==(e=null==x?void 0:x.accessToken)&&void 0!==e?e:null)},[x,Ie,k,B,Y,G,H,qe,U,Me,F,W,z,X]),n.useEffect(function(){(null==x?void 0:x.accessToken)&&k&&c.fetchTiers()},[F,null==x?void 0:x.accessToken,k]);var Ke=function(t){return void 0===t&&(t=!0),e.__awaiter(N,void 0,void 0,function(){var n,r,a,i,o,l,u,d,p,g;return e.__generator(this,function(_){switch(_.label){case 0:t&&le(!0),$(null),_.label=1;case 1:return _.trys.push([1,4,5,6]),[4,Oe(Y.applicationId)];case 2:return _.sent(),n=function(t){var r=T.usePermissionsStore.getState().hasPermission("ilotj.scope.view",t.id),s=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return r||0!==s.length?e.__assign(e.__assign({},t),{hasAccess:r,children:s}):null},[4,c.fetchScopes(F,x.accessToken)];case 3:return(r=_.sent())&&r.data&&r.data.data&&(a=r.data.data,Array.isArray(a)&&(a=a.length>0?a[0]:null),a?(i=n(a))?(me(null),ne({data:i}),Ce.current?(J(Ce.current),fe("learnings"),Ce.current=null):(o=s.useLearningTemplateStore.getState().selectedRuleSetId,l=o?f.findNodeById(i,o):null,o&&l||(u=function(e){if(e.hasAccess)return e;for(var t=0,n=e.children||[];t<n.length;t++){var r=n[t],s=u(r);if(s)return s}return null},d=u(i),J(d?d.id:i.id)))):(me(null!==(g=a.id)&&void 0!==g?g:null),ne(null)):(me(null),ne(null))),[3,6];case 4:return p=_.sent(),console.error("Failed to fetch rule sets or permissions",p),$("Failed to load data. Please try again later."),[3,6];case 5:return le(!1),[7];case 6:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==x?void 0:x.accessToken)||void 0===e?void 0:e.length)&&ke?Ke(!0):console.warn("Error: Trying to fetch rules without access token",x)},[null==x?void 0:x.accessToken,$,ee,Y.applicationId,ke]);var ze=function(t,n,r){return e.__awaiter(N,void 0,void 0,function(){var n,r,a,i,o,l,u,d;return e.__generator(this,function(p){switch(p.label){case 0:de(!0),p.label=1;case 1:return p.trys.push([1,4,5,6]),[4,c.deleteRuleSet(t,x.accessToken)];case 2:return p.sent(),s.useLearningTemplateStore.getState().selectedRuleSetId===t&&(n=s.useLearningTemplateStore.getState().scopeTreeData,(r=f.findNodePathById((null==n?void 0:n.data)||null,t))&&r.length>1&&(a=r[r.length-2],J(a),fe("learnings"))),[4,Ke(!0)];case 3:return p.sent(),ae(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(o=De.current)||void 0===o||o.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return i=p.sent(),console.error("An error occurred during scope deletion.",i),null===(l=De.current)||void 0===l||l.show({severity:"error",summary:"Delete Failed",detail:(null===(d=null===(u=null==i?void 0:i.response)||void 0===u?void 0:u.data)||void 0===d?void 0:d.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return de(!1),[7];case 6:return[2]}})})},Ve=function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),d.setQueryParams(((n={})[d.QUERY_PARAM_KEYS.SECTION]="learnings"===t?null:t,n[d.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),fe(t),J(e),Le(!1)},Xe=te,Je=Te?{data:{id:Te.stationId,name:Te.stationName,type:"STATION",metrics:{learningsCount:Te.learningsCount,stationsCount:0},children:[]}}:Xe,Ze=!!(null==Je?void 0:Je.data);null===(M=null==Je?void 0:Je.data)||void 0===M||M.type;var $e=T.usePermissionsStore(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",Y.applicationResourceId||""),et=function(n){return e.__awaiter(N,void 0,void 0,function(){var r,a,o,l,u,d,p,g,f;return e.__generator(this,function(e){switch(e.label){case 0:if(!(r="string"==typeof n?n:(null===(l=null===(o=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===o?void 0:o.data)||void 0===l?void 0:l.id)||Se))return null===(u=De.current)||void 0===u||u.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(D.default,{message:"Unable to identify the global scope for this access request."})}),[2];Ae(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.requestAccess(r)];case 2:return e.sent(),Le(!0),null===(d=De.current)||void 0===d||d.show({severity:"success",sticky:!1,life:3e3,className:i.default.successToast,content:t.jsx(R.default,{message:"Access request submitted successfully!"})}),[3,5];case 3:return a=e.sent(),null===(p=De.current)||void 0===p||p.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(D.default,{message:(null===(f=null===(g=null==a?void 0:a.response)||void 0===g?void 0:g.data)||void 0===f?void 0:f.detail)||"Failed to request access. Please try again."})}),[3,5];case 4:return Ae(!1),[7];case 5:return[2]}})})};if(He)return t.jsx("div",e.__assign({className:i.default.learningManagementContainer},{children:t.jsx(b.default,{})}));if(Ye)return t.jsx("div",e.__assign({className:i.default.learningManagementContainer},{children:t.jsx(L.default,{errorMessage:"Failed to load configuration. Please try again.",onRetry:function(){return Ge()},title:"Error Loading Configuration"})}));var tt=e.__spreadArray(e.__spreadArray([{type:"GLOBAL",label:"Global",addChildLabel:"".concat(I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".addScope"),"Add Scope")),addChildType:"SCOPE"}],Array.from({length:Qe},function(){return e.__assign({type:"SCOPE",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".scope"),"Scope")},!W&&{addChildLabel:I.dt("".concat(P.MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH,".addSubScope"),"Add Subscope"),addChildType:"SUBSCOPE"})}),!0),W?[]:[{type:"SUBSCOPE",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".subScope"),"Subscope")}],!0),nt=[{id:"learnings",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".treeMenu.submenu.learnings"),"Learnings"),icon:r.BookOpen,badgeKey:"learningsCount"},{id:"access",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".treeMenu.submenu.access"),"Access"),icon:r.Users},{id:"history",label:I.dt("".concat(P.MIDDLE_DRAWER_DT_PATH,".treeMenu.submenu.changeHistory"),"Change History"),icon:r.History}],rt=new Set(nt.map(function(e){return e.id})),st=Te?nt.filter(function(e){return"stations"!==e.id}):nt;return t.jsx(m.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:oe?t.jsx(g.default,{}):Z?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:Z})),t.jsx("button",e.__assign({onClick:function(){return Ke(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):Ze?t.jsx(o.default,{onOpenCreateModal:function(){return ae({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return ae({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return ae({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(N,void 0,void 0,function(){var a,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return a=s.useLearningTemplateStore.getState().scopeTreeData,i=f.findNodePathById((null==a?void 0:a.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,ze(t)];case 1:return e.sent(),[3,3];case 2:ae({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return Ne("ilotj.scope.delete",e)},canEditScope:function(e){return Ne("ilotj.scope.edit",e)},canCreateScope:function(e){return Ne("ilotj.scope.create",e)},onSectionSelect:Ve,activeSectionId:ge,scopeTreeData:Je,sectionsConfig:st,onViewStation:function(e){Ve(e.stationId,"learnings")},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(Ce.current=t),Ke(e)},nodeTypesConfig:tt,app_integration_id:F,token:x.accessToken,modeId:V,onRequestAccess:et,isRequestingAccess:ye,isAccessRequested:be}):t.jsx(l.default,{onCreate:function(){return ae({isOpen:!0,type:"GLOBAL"})},title:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".title"),"No Global Scope has been added!"),desc:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".desc"),"Start by creating a Global scope to define base learnings that apply across all stations."),button:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".createGlobalScope"),"Create Global Scope"),canCreateRule:$e,noAccessTitle:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".noAccessTitle"),"Access Restricted"),noAccessDesc:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".noAccessDesc"),"You do not have access for this application."),requestAccessButton:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".requestAccessButton"),"Request Access"),requestSentButton:I.dt("".concat(P.EMPTY_STATE_DT_PATH,".requestSentButton"),"Request Sent"),onRequestAccess:et,isRequestingAccess:ye,isAccessRequested:be})})),t.jsx(a.Toast,{ref:De,pt:{root:{style:{zIndex:9999}}}}),W&&se.isOpen&&"DELETE"!==se.type&&"RENAME"!==se.type?t.jsx(v.default,{isOpen:!0,onClose:function(){return ae(e.__assign(e.__assign({},se),{isOpen:!1}))},onSubmit:function(t){return e.__awaiter(N,void 0,void 0,function(){var n,r,a,i,o,l,u,d,p,g,f,_,S,m,v,T,h,y,A,E;return e.__generator(this,function(b){switch(b.label){case 0:de(!0),n=s.useLearningTemplateStore.getState().backwardCompatibility,b.label=1;case 1:return b.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(a=t,i="SCOPE"===se.type&&se.parentId,o=i?"genreRuleSet":se.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:se.parentId||null,scopeName:a,scopeReferenceMetadata:{},applicationMappingId:F}),[4,c.createRuleSet(r,x.accessToken)];case 2:if(l=b.sent(),!(u=null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.scopeId))return[3,10];if(Ce.current=u,d=n&&(null===(v=r.topic)||void 0===v?void 0:v.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==se.type&&se.parentId,!d&&!p)return[3,10];if(!(g=n?null===(h=null===(T=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===T?void 0:T.data)||void 0===h?void 0:h.id:se.parentId))return[3,10];if(!W)return[3,7];b.label=3;case 3:return b.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:g,target_scope_id:u})];case 4:return b.sent(),[3,6];case 5:return f=b.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return b.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:g,target_scope_id:u,application_mapping_id:F||"",is_copy_parent_variant_id:!1})];case 8:return b.sent(),[3,10];case 9:return _=b.sent(),console.error("Failed to inherit rules for the new scope:",_),[3,10];case 10:return[4,Ke(!0)];case 11:return b.sent(),ae(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw S=b.sent(),console.error("An error occurred during scope creation.",S),null===(y=De.current)||void 0===y||y.show({severity:"error",summary:"Creation Failed",detail:(null===(E=null===(A=null==S?void 0:S.response)||void 0===A?void 0:A.data)||void 0===E?void 0:E.message)||"There was an error creating the scope. Please try again."}),S;case 13:return de(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Ze,canCreateGlobal:$e,globalScopeId:null!==(O=null===(w=null==te?void 0:te.data)||void 0===w?void 0:w.id)&&void 0!==O?O:null}):t.jsxs(t.Fragment,{children:[t.jsx(E.default,{isOpen:se.isOpen&&"DELETE"!==se.type&&"RENAME"!==se.type,onClose:function(){return ae(e.__assign(e.__assign({},se),{isOpen:!1}))},onCreate:function(e){e&&(Ce.current=e),Ke(!0)},hasGlobalRuleSet:Ze,parentId:se.parentId}),t.jsx(j.default,{isOpen:se.isOpen&&"RENAME"===se.type,onClose:function(){return ae(e.__assign(e.__assign({},se),{isOpen:!1}))},onSave:function(n){return e.__awaiter(N,void 0,void 0,function(){var r,a,o,l,u,d;return e.__generator(this,function(p){switch(p.label){case 0:de(!0),p.label=1;case 1:return p.trys.push([1,4,5,6]),se.scopeId?(r=s.useLearningTemplateStore.getState().backwardCompatibility,a=r?{scope_id:se.scopeId,scope_name:n}:{scope_id:se.scopeId,scope_type:"Custom",scope_name:n,application_mapping_id:F},[4,c.renameScope(a,x.accessToken)]):[2];case 2:return p.sent(),[4,Ke(!0)];case 3:return p.sent(),ae(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw o=p.sent(),console.error("An error occurred during scope rename.",o),null===(l=De.current)||void 0===l||l.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(D.default,{message:(null===(d=null===(u=null==o?void 0:o.response)||void 0===u?void 0:u.data)||void 0===d?void 0:d.message)||"There was an error renaming the scope. Please try again."})}),o;case 5:return de(!1),[7];case 6:return[2]}})})},initialName:se.initialName})]}),t.jsx(p.default,{isOpen:se.isOpen&&"DELETE"===se.type,onCancel:function(){return ae(e.__assign(e.__assign({},se),{isOpen:!1}))},onConfirm:function(){return ze(se.scopeId,se.initialName,se.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:se.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:ce})]}))})};
2
2
  //# sourceMappingURL=LearningManagement.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),o=require("./RuleContent/RuleContent.js"),i=require("./StationsContent/StationsContent.js"),a=require("./RBAC/AccessManagementPanel.js");require("appsec-ui"),require("./store/useAuthStore.js"),require("./store/usePermissionsStore.js");var r=require("./store/useEnvStore.js"),s=require("./styles/LearningTemplateLayout.module.css.js"),u=require("./utils/treeUtils.js"),l=require("./SidebarWrapper.js"),d=require("./store/useLearningTemplateStore.js"),c=require("./components/StationOnboarding/StationOnboardModal.js"),p=require("./AuditLog/AuditLog.js");exports.default=function(S){var f,g,m=S.onOpenCreateModal,v=S.onRefreshRuleSets,C=S.scopeTreeData,j=S.onAddChild,q=S.onRenameChild,T=S.onDeleteChild,h=S.canDeleteScope,R=S.canEditScope,I=S.canCreateScope,L=S.onSectionSelect,x=S.onViewStation,_=S.activeSectionId,A=void 0===_?"learnings":_,M=S.sectionsConfig,O=S.nodeTypesConfig,D=S.app_integration_id,y=S.token,b=S.modeId,w=d.useLearningTemplateStore(function(e){return e.isStationModalOpen}),k=d.useLearningTemplateStore(function(e){return e.setStationModalOpen}),N=d.useLearningTemplateStore(function(e){return e.isStationOnboardModalTriggered}),B=d.useLearningTemplateStore(function(e){return e.setIsStationOnboardModalTriggered}),E=d.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),U=d.useLearningTemplateStore(function(e){return e.rawAuditRuleData}),P=r.default(function(e){return e.auditLogConfig});d.useLearningTemplateStore(function(e){return e.ruleData});var V=E?u.findNodeById((null==C?void 0:C.data)||null,E):null;return Boolean((null===(f=null==C?void 0:C.data)||void 0===f?void 0:f.id)&&E===C.data.id),t.useEffect(function(){N&&k(!0)},[N,k,B]),n.jsxs("div",e.__assign({className:s.default.container},{children:[n.jsx(l.default,{onOpenCreateModal:m,onRefreshRuleSets:v,scopeTreeData:C,onAddChild:j,onRenameChild:q,onDeleteChild:T,canDeleteScope:h,canEditScope:R,canCreateScope:I,onSectionSelect:L,activeSectionId:A,sectionsConfig:M,nodeTypesConfig:O}),n.jsx("div",e.__assign({id:"rule-template-layout-content",className:"".concat(s.default.content," relative flex-1 overflow-hidden")},{children:"stations"===A?n.jsx(i.default,{scopeId:E||"",scopeName:(null==V?void 0:V.name)||"Unknown Scope",stationsCount:null===(g=null==V?void 0:V.metrics)||void 0===g?void 0:g.stationsCount,stations:u.mapScopeChildrenToStations(V),onViewStation:x}):"access"===A?n.jsx(a.default,{selectedRuleSetId:E,scopeName:(null==V?void 0:V.name)||"Unknown Scope",useApplicationModuleForScopeAccess:!1}):"history"===A?(null==P?void 0:P.configId)?n.jsx(p.default,{configId:P.configId,scopeId:E||void 0,scopeName:(null==V?void 0:V.name)||"Unknown Scope",ruleData:U}):null:n.jsx(o.default,{onRefreshRuleSets:v,app_integration_id:D,token:y,modeId:b})})),n.jsx(c.default,{isOpen:w,onClose:function(){k(!1),B(!1)},onBoardStation:function(e){v(!0,e)},app_integration_id:D,token:y})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),o=require("./RuleContent/RuleContent.js"),s=require("./StationsContent/StationsContent.js"),i=require("./RBAC/AccessManagementPanel.js");require("appsec-ui"),require("./store/useAuthStore.js"),require("./store/usePermissionsStore.js");var a=require("./store/useEnvStore.js"),r=require("./styles/LearningTemplateLayout.module.css.js"),c=require("./utils/treeUtils.js"),u=require("./SidebarWrapper.js"),l=require("./store/useLearningTemplateStore.js"),d=require("./components/StationOnboarding/StationOnboardModal.js"),S=require("./AuditLog/AuditLog.js"),p=require("./components/EmptyLearningState.js"),T=require("./store/useLMSConfigStore.js"),f=require("./constants.js");exports.default=function(A){var g,m,v=A.onOpenCreateModal,q=A.onRefreshRuleSets,_=A.scopeTreeData,C=A.onAddChild,j=A.onRenameChild,R=A.onDeleteChild,h=A.canDeleteScope,D=A.canEditScope,E=A.canCreateScope,M=A.onSectionSelect,L=A.onViewStation,P=A.activeSectionId,x=void 0===P?"learnings":P,I=A.sectionsConfig,O=A.nodeTypesConfig,w=A.app_integration_id,y=A.token,b=A.modeId,B=A.onRequestAccess,Y=A.isRequestingAccess,k=A.isAccessRequested,H=l.useLearningTemplateStore(function(e){return e.isStationModalOpen}),N=l.useLearningTemplateStore(function(e){return e.setStationModalOpen}),U=l.useLearningTemplateStore(function(e){return e.isStationOnboardModalTriggered}),V=l.useLearningTemplateStore(function(e){return e.setIsStationOnboardModalTriggered}),F=l.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),W=l.useLearningTemplateStore(function(e){return e.rawAuditRuleData}),z=a.default(function(e){return e.auditLogConfig});l.useLearningTemplateStore(function(e){return e.ruleData});var G=F?c.findNodeById((null==_?void 0:_.data)||null,F):null;return Boolean((null===(g=null==_?void 0:_.data)||void 0===g?void 0:g.id)&&F===_.data.id),n.useEffect(function(){U&&N(!0)},[U,N,V]),t.jsxs("div",e.__assign({className:r.default.container},{children:[t.jsx(u.default,{onOpenCreateModal:v,onRefreshRuleSets:q,scopeTreeData:_,onAddChild:C,onRenameChild:j,onDeleteChild:R,canDeleteScope:h,canEditScope:D,canCreateScope:E,onSectionSelect:M,activeSectionId:x,sectionsConfig:I,nodeTypesConfig:O}),t.jsx("div",e.__assign({id:"rule-template-layout-content",className:"".concat(r.default.content," relative flex-1 overflow-hidden")},{children:"stations"===x?t.jsx(s.default,{scopeId:F||"",scopeName:(null==G?void 0:G.name)||"Unknown Scope",stationsCount:null===(m=null==G?void 0:G.metrics)||void 0===m?void 0:m.stationsCount,stations:c.mapScopeChildrenToStations(G),onViewStation:L}):"access"===x?t.jsx(i.default,{selectedRuleSetId:F,scopeName:(null==G?void 0:G.name)||"Unknown Scope",useApplicationModuleForScopeAccess:!1}):"history"===x?(null==z?void 0:z.configId)?t.jsx(S.default,{configId:z.configId,scopeId:F||void 0,scopeName:(null==G?void 0:G.name)||"Unknown Scope",ruleData:W}):null:G&&!1===G.hasAccess?t.jsx(p.default,{onCreate:function(){},title:T.dt("".concat(f.EMPTY_STATE_DT_PATH,".noAccessTitle"),"Access Restricted"),desc:T.dt("".concat(f.EMPTY_STATE_DT_PATH,".noAccessDesc"),"You do not have access to view this ".concat(null==G?void 0:G.name," learnings.")),button:"",canCreateRule:!1,noAccessTitle:T.dt("".concat(f.EMPTY_STATE_DT_PATH,".noAccessTitle"),"Access Restricted"),noAccessDesc:T.dt("".concat(f.EMPTY_STATE_DT_PATH,".noAccessDesc"),"You do not have access to view this ".concat(null==G?void 0:G.name," learnings.")),requestAccessButton:T.dt("".concat(f.EMPTY_STATE_DT_PATH,".requestAccessButton"),"Request Access"),requestSentButton:T.dt("".concat(f.EMPTY_STATE_DT_PATH,".requestSentButton"),"Request Sent"),onRequestAccess:function(){return null==B?void 0:B(F)},isRequestingAccess:Y,isAccessRequested:k}):t.jsx(o.default,{onRefreshRuleSets:q,app_integration_id:w,token:y,modeId:b})})),t.jsx(d.default,{isOpen:H,onClose:function(){N(!1),V(!1)},onBoardStation:function(e){q(!0,e)},app_integration_id:w,token:y})]}))};
2
2
  //# sourceMappingURL=LearningTemplateLayout.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),a=require("react"),r=require("lucide-react"),s=require("./styles/Sidebar.module.css.js"),n=require("./components/SidebarSearch.js"),i=require("./components/ScopeTree/TreeSidebar.js"),o=require("./store/useLMSConfigStore.js"),c=require("./constants.js"),d=require("./store/useLearningTemplateStore.js");exports.default=function(l){var u=l.scopeTreeData,S=l.selectedRuleSetId,h=l.onAddChild,p=l.onRenameChild,C=l.onDeleteChild,j=l.canDeleteScope,f=l.canEditScope,g=l.canCreateScope,m=l.onSectionSelect,_=l.activeSectionId,b=l.onOnboardStation,v=l.sectionsConfig,x=l.nodeTypesConfig,q=l.searchPlaceholder,T=void 0===q?o.dt("".concat(c.MIDDLE_DRAWER_DT_PATH,".treeMenu.search"),"Search for Scopes.."):q,D=a.useState(""),y=D[0],R=D[1],I=a.useState(0),N=I[0],A=I[1],E=d.useLearningTemplateStore.getState().backwardCompatibility;return t.jsxs("div",e.__assign({className:s.default.sidebar},{children:[t.jsxs(t.Fragment,{children:[t.jsx(n.default,{value:y,onChange:R,placeholder:T,searchCount:N}),t.jsx("div",{className:s.default.divider}),t.jsx("div",e.__assign({className:s.default.content},{children:u&&t.jsx(i.TreeSidebar,{data:u.data,onAddChild:h,onRenameChild:p,onDeleteChild:C,canDeleteScope:j,canEditScope:f,canCreateScope:g,onSectionSelect:m,selectedRuleSetId:S,activeSectionId:_,searchQuery:y,onSearchCountChange:A,sectionsConfig:v,nodeTypesConfig:x})}))]}),b&&E&&t.jsx("div",e.__assign({className:s.default.createButtonContainer},{children:t.jsxs("button",e.__assign({className:s.default.createButton,onClick:b},{children:[t.jsx(r.Plus,{size:16}),"Onboard a station"]}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),a=require("react"),r=require("./styles/Sidebar.module.css.js"),n=require("./components/SidebarSearch.js"),o=require("./components/ScopeTree/TreeSidebar.js"),s=require("./store/useLMSConfigStore.js"),i=require("./constants.js"),c=require("./store/useLearningTemplateStore.js");exports.default=function(d){var l=d.scopeTreeData,u=d.selectedRuleSetId,S=d.onAddChild,h=d.onRenameChild,p=d.onDeleteChild,C=d.canDeleteScope,j=d.canEditScope,f=d.canCreateScope,g=d.onSectionSelect,m=d.activeSectionId;d.onOnboardStation;var v=d.sectionsConfig,b=d.nodeTypesConfig,T=d.searchPlaceholder,q=void 0===T?s.dt("".concat(i.MIDDLE_DRAWER_DT_PATH,".treeMenu.search"),"Search for Scopes.."):T,x=a.useState(""),D=x[0],_=x[1],y=a.useState(0),R=y[0],I=y[1];return c.useLearningTemplateStore.getState().backwardCompatibility,t.jsx("div",e.__assign({className:r.default.sidebar},{children:t.jsxs(t.Fragment,{children:[t.jsx(n.default,{value:D,onChange:_,placeholder:q,searchCount:R}),t.jsx("div",{className:r.default.divider}),t.jsx("div",e.__assign({className:r.default.content},{children:l&&t.jsx(o.TreeSidebar,{data:l.data,onAddChild:S,onRenameChild:h,onDeleteChild:p,canDeleteScope:C,canEditScope:j,canCreateScope:f,onSectionSelect:g,selectedRuleSetId:u,activeSectionId:m,searchQuery:D,onSearchCountChange:I,sectionsConfig:v,nodeTypesConfig:b})}))]})}))};
2
2
  //# sourceMappingURL=Sidebar.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),o=require("lucide-react"),t=require("../../styles/ScopeTree.module.css.js"),r=require("./TreeNodeHeader.js"),l=require("./TreeAddAction.js"),d=require("../../store/useLMSConfigStore.js"),a=require("../../constants.js"),s=require("../../store/useLearningTemplateStore.js"),c=require("./TreeSectionItem.js"),u=function(p){var h,v,m,f,_,g=p.node,C=p.depth,T=void 0===C?0:C,D=p.nodePath,b=void 0===D?[]:D,y=p.expandedNodeIds,A=p.activeSelection,x=p.onToggleExpand,L=p.onSectionSelect,S=p.onNodeOptionsClick,E=p.onAddChild,j=p.onRenameChild,N=p.onDeleteChild,R=p.canDeleteScope,w=p.canEditScope,P=p.canCreateScope,I=p.searchQuery,M=p.sectionsConfig,k=void 0===M?[]:M,q=p.nodeTypesConfig,V=void 0===q?[]:q,H=p.forceVisible,W=void 0!==H&&H,O=p.compactView,Y=void 0!==O&&O,Q=e.__spreadArray(e.__spreadArray([],b,!0),[g.id],!1),K=y.has(g.id),U=s.useLearningTemplateStore.getState().backwardCompatibility,X=U||Y,z=d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scope")),F=!!A&&A.nodePath[A.nodePath.length-1]===g.id,J=!!A&&(A.nodePath.includes(g.id)&&!F),B=d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scopeDisplayLimit.applyToLevels"),""),G=function(){if(U)return[2];if(!B)return null;try{var e=JSON.parse(B);return Array.isArray(e)?e.map(Number):null}catch(e){return null}}(),Z=T+1,$=null===G||G.includes(Z),ee=(U||"true"===d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scopeDisplayLimit.enabled"),"false"))&&$,ne=U?7:parseInt(d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scopeDisplayLimit.count"),"7"),10)||7,ie=g.children||[],oe=ee&&!I&&ie.length>ne,te=i.useRef(null);i.useEffect(function(){F&&te.current&&te.current.scrollIntoView({behavior:"smooth",block:"nearest"})},[F]);var re=function(e,n){if(!n)return!0;var i=n.toLowerCase();return!!e.name.toLowerCase().includes(i)||!!e.children&&e.children.some(function(e){return re(e,n)})};if(!W&&!re(g,I||""))return null;var le=T>=V.length-1?V[V.length-1]:V[T],de=!!(null==le?void 0:le.addChildType),ae=X?k.filter(function(e){return"learnings"!==e.id&&"stations"!==e.id}).filter(function(e){return!e.isVisible||e.isVisible(g,T)}).map(function(e){return{label:e.label,icon:e.icon,onClick:function(){return L(Q,e.id)}}}):[],se=!R||R(g.id),ce=!w||w(g.id),ue=!P||P(g.id),pe=g.children&&g.children.length>0,he=!se||pe,ve=se?pe?"This scope cannot be deleted because other scopes inherit learnings from it.":void 0:"You do not have permission to delete this scope.",me=ue?void 0:"You do not have permission to add a scope here.",fe=!I||g.name.toLowerCase().includes(I.toLowerCase()),_e=function(e){return n.jsx(u,{node:e,depth:T+1,nodePath:Q,expandedNodeIds:y,activeSelection:A,onToggleExpand:x,onSectionSelect:L,onNodeOptionsClick:S,onAddChild:E,onRenameChild:j,onDeleteChild:N,canDeleteScope:R,canEditScope:w,canCreateScope:P,searchQuery:I,forceVisible:fe,sectionsConfig:k,nodeTypesConfig:V,compactView:X},e.id)};return n.jsxs("div",e.__assign({ref:te,className:t.default.nodeWrapper,style:{"--tree-depth":T}},{children:[n.jsx(r.TreeNodeHeader,{nodeType:g.type,name:g.name,isExpanded:K,isSelected:F,isAncestor:J,isExpandable:!!pe,childrenCount:null===(h=g.children)||void 0===h?void 0:h.length,learningsCount:X?null===(v=g.metrics)||void 0===v?void 0:v.learningsCount:void 0,isCompactView:X,onToggleExpand:function(e){e.stopPropagation(),x(g.id)},onClick:function(){L(Q,"learnings")},searchQuery:I,menuOptions:e.__spreadArray(e.__spreadArray(e.__spreadArray([],de&&"station"!==(null===(m=null==g?void 0:g.type)||void 0===m?void 0:m.toLowerCase())?[{label:le.addChildLabel||"Add Child",icon:o.Plus,onClick:function(){return null==E?void 0:E(g.id,le.addChildType,g.name)},disabled:!ue,tooltip:me}]:[],!0),[{label:"".concat(d.dt("".concat(a.MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH,".rename"),"Rename")),icon:o.Pencil,onClick:function(){return null==j?void 0:j(g.id,g.name)},disabled:!ce||"station"===(null===(f=null==g?void 0:g.type)||void 0===f?void 0:f.toLocaleLowerCase()),tooltip:ce?void 0:"You do not have permission to rename this scope."},{label:"station"===(null===(_=null==g?void 0:g.type)||void 0===_?void 0:_.toLowerCase())?"Delete Station":U?"Delete Scope":"".concat(d.dt("".concat(a.MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH,".delete"),"Delete ".concat((null==le?void 0:le.label)||"Node"),{scope:z})),icon:o.Trash2,onClick:function(){var e;return null==N?void 0:N(g.id,g.name,(null===(e=g.metrics)||void 0===e?void 0:e.learningsCount)||0)},disabled:he,tooltip:ve,className:"text-red-500 hover:text-red-600 hover:bg-red-50"}],!1),ae,!0)}),K&&n.jsxs("div",e.__assign({className:t.default.childrenWrapper},{children:[!X&&k.filter(function(e){return!e.isVisible||e.isVisible(g,T)}).map(function(e){var i;return n.jsx(c.TreeSectionItem,{icon:e.icon,label:e.label,badgeCount:e.badgeKey?null===(i=g.metrics)||void 0===i?void 0:i[e.badgeKey]:void 0,isActive:F&&(null==A?void 0:A.sectionId)===e.id,onClick:function(){return L(Q,e.id)}},"".concat(g.id,"-").concat(e.id))}),oe?n.jsxs(n.Fragment,{children:[n.jsx("div",e.__assign({className:t.default.scopeScrollContainer,style:{maxHeight:"calc(var(--scope-row-height, 40px) * ".concat(ne,")"),overflowY:"scroll"}},{children:ie.map(_e)})),n.jsx("button",e.__assign({type:"button",className:t.default.addAction,onClick:function(e){e.stopPropagation(),L(Q,"stations")}},{children:n.jsx("span",e.__assign({style:{paddingLeft:"15px"}},{children:n.jsxs("span",e.__assign({style:{paddingLeft:"15px",display:"flex",alignItems:"center"}},{children:[d.interpolate(d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scopeDisplayLimit.viewMoreText"),U?"View all {count} stations":"Show all {count} scopes"),{count:ie.length}),n.jsx(o.MoveRight,{size:14,style:{marginLeft:"6px",flexShrink:0}})]}))}))}))]}):ie.map(_e),de&&!X&&n.jsx(l.TreeAddAction,{label:le.addChildLabel||"Add Child",onAdd:function(){return null==E?void 0:E(g.id,le.addChildType,g.name)},disabled:!ue,tooltip:me})]}))]}))};exports.TreeNode=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),o=require("lucide-react"),t=require("../../styles/ScopeTree.module.css.js"),r=require("./TreeNodeHeader.js"),l=require("./TreeAddAction.js"),d=require("../../store/useLMSConfigStore.js"),a=require("../../constants.js"),s=require("../../store/useLearningTemplateStore.js"),c=require("./TreeSectionItem.js"),u=function(p){var h,v,m,f,_,g=p.node,C=p.depth,T=void 0===C?0:C,D=p.nodePath,b=void 0===D?[]:D,y=p.expandedNodeIds,A=p.activeSelection,x=p.onToggleExpand,L=p.onSectionSelect,S=p.onNodeOptionsClick,E=p.onAddChild,j=p.onRenameChild,N=p.onDeleteChild,R=p.canDeleteScope,w=p.canEditScope,P=p.canCreateScope,I=p.searchQuery,M=p.sectionsConfig,k=void 0===M?[]:M,q=p.nodeTypesConfig,V=void 0===q?[]:q,H=p.forceVisible,W=void 0!==H&&H,O=p.compactView,Y=void 0!==O&&O,Q=e.__spreadArray(e.__spreadArray([],b,!0),[g.id],!1),K=y.has(g.id),U=s.useLearningTemplateStore.getState().backwardCompatibility,X=U||Y,z=d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scope")),F=!!A&&A.nodePath[A.nodePath.length-1]===g.id,J=!!A&&(A.nodePath.includes(g.id)&&!F),B=d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scopeDisplayLimit.applyToLevels"),""),G=function(){if(U)return[2];if(!B)return null;try{var e=JSON.parse(B);return Array.isArray(e)?e.map(Number):null}catch(e){return null}}(),Z=T+1,$=null===G||G.includes(Z),ee=(U||"true"===d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scopeDisplayLimit.enabled"),"false"))&&$,ne=U?7:parseInt(d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scopeDisplayLimit.count"),"7"),10)||7,ie=g.children||[],oe=ee&&!I&&ie.length>ne,te=i.useRef(null);i.useEffect(function(){F&&te.current&&te.current.scrollIntoView({behavior:"smooth",block:"nearest"})},[F]);var re=function(e,n){if(!n)return!0;var i=n.toLowerCase();return!!e.name.toLowerCase().includes(i)||!!e.children&&e.children.some(function(e){return re(e,n)})};if(!W&&!re(g,I||""))return null;var le=T>=V.length-1?V[V.length-1]:V[T],de=!!(null==le?void 0:le.addChildType),ae=X?k.filter(function(e){return"learnings"!==e.id&&"stations"!==e.id}).filter(function(e){return!e.isVisible||e.isVisible(g,T)}).map(function(e){return{label:e.label,icon:e.icon,onClick:function(){return L(Q,e.id)}}}):[],se=!R||R(g.id),ce=!w||w(g.id),ue=!P||P(g.id),pe=g.children&&g.children.length>0,he=!se||pe,ve=se?pe?"This scope cannot be deleted because other scopes inherit learnings from it.":void 0:"You do not have permission to delete this scope.",me=ue?void 0:"You do not have permission to add a scope here.",fe=!I||g.name.toLowerCase().includes(I.toLowerCase()),_e=function(e){return n.jsx(u,{node:e,depth:T+1,nodePath:Q,expandedNodeIds:y,activeSelection:A,onToggleExpand:x,onSectionSelect:L,onNodeOptionsClick:S,onAddChild:E,onRenameChild:j,onDeleteChild:N,canDeleteScope:R,canEditScope:w,canCreateScope:P,searchQuery:I,forceVisible:fe,sectionsConfig:k,nodeTypesConfig:V,compactView:X},e.id)};return n.jsxs("div",e.__assign({ref:te,className:t.default.nodeWrapper,style:{"--tree-depth":T}},{children:[n.jsx(r.TreeNodeHeader,{nodeType:g.type,name:g.name,isExpanded:K,isSelected:F,isAncestor:J,isExpandable:!!pe,childrenCount:null===(h=g.children)||void 0===h?void 0:h.length,learningsCount:X?null===(v=g.metrics)||void 0===v?void 0:v.learningsCount:void 0,isCompactView:X,onToggleExpand:function(e){e.stopPropagation(),x(g.id)},onClick:function(){L(Q,"learnings")},searchQuery:I,menuOptions:!1===g.hasAccess?[]:e.__spreadArray(e.__spreadArray(e.__spreadArray([],de&&"station"!==(null===(m=null==g?void 0:g.type)||void 0===m?void 0:m.toLowerCase())?[{label:le.addChildLabel||"Add Child",icon:o.Plus,onClick:function(){return null==E?void 0:E(g.id,le.addChildType,g.name)},disabled:!ue,tooltip:me}]:[],!0),[{label:"".concat(d.dt("".concat(a.MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH,".rename"),"Rename")),icon:o.Pencil,onClick:function(){return null==j?void 0:j(g.id,g.name)},disabled:!ce||"station"===(null===(f=null==g?void 0:g.type)||void 0===f?void 0:f.toLocaleLowerCase()),tooltip:ce?void 0:"You do not have permission to rename this scope."},{label:"station"===(null===(_=null==g?void 0:g.type)||void 0===_?void 0:_.toLowerCase())?"Delete Station":U?"Delete Scope":"".concat(d.dt("".concat(a.MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH,".delete"),"Delete ".concat((null==le?void 0:le.label)||"Node"),{scope:z})),icon:o.Trash2,onClick:function(){var e;return null==N?void 0:N(g.id,g.name,(null===(e=g.metrics)||void 0===e?void 0:e.learningsCount)||0)},disabled:he,tooltip:ve,className:"text-red-500 hover:text-red-600 hover:bg-red-50"}],!1),ae,!0)}),K&&n.jsxs("div",e.__assign({className:t.default.childrenWrapper},{children:[!X&&k.filter(function(e){return!e.isVisible||e.isVisible(g,T)}).map(function(e){var i;return n.jsx(c.TreeSectionItem,{icon:e.icon,label:e.label,badgeCount:e.badgeKey?null===(i=g.metrics)||void 0===i?void 0:i[e.badgeKey]:void 0,isActive:F&&(null==A?void 0:A.sectionId)===e.id,onClick:function(){return L(Q,e.id)}},"".concat(g.id,"-").concat(e.id))}),oe?n.jsxs(n.Fragment,{children:[n.jsx("div",e.__assign({className:t.default.scopeScrollContainer,style:{maxHeight:"calc(var(--scope-row-height, 40px) * ".concat(ne,")"),overflowY:"scroll"}},{children:ie.map(_e)})),n.jsx("button",e.__assign({type:"button",className:t.default.addAction,onClick:function(e){e.stopPropagation(),L(Q,"stations")}},{children:n.jsx("span",e.__assign({style:{paddingLeft:"15px"}},{children:n.jsxs("span",e.__assign({style:{paddingLeft:"15px",display:"flex",alignItems:"center"}},{children:[d.interpolate(d.dt("".concat(a.MIDDLE_DRAWER_DT_PATH,".scopeDisplayLimit.viewMoreText"),U?"View all {count} stations":"Show all {count} scopes"),{count:ie.length}),n.jsx(o.MoveRight,{size:14,style:{marginLeft:"6px",flexShrink:0}})]}))}))}))]}):ie.map(_e),de&&!X&&n.jsx(l.TreeAddAction,{label:le.addChildLabel||"Add Child",onAdd:function(){return null==E?void 0:E(g.id,le.addChildType,g.name)},disabled:!ue,tooltip:me})]}))]}))};exports.TreeNode=u;
2
2
  //# sourceMappingURL=TreeNode.js.map
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/InstantLearning/InstantLearning.js"),t=require("./features/WtaWnta/WtaWnta.js"),r=require("./features/DocumentLearning/DocumentLearning.js"),n=require("./features/IL-OTJ/ILOTJ.js"),a=require("./features/IL-OTJ/_components/atoms/Button/Button.js"),o=require("./features/IL-OTJ/_components/atoms/Dropdown/Dropdown.js"),s=require("./features/IL-OTJ/_components/atoms/Toggle/Toggle.js"),i=require("./features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),p=require("./features/IL-OTJ/_components/molecules/Condition/ConditionList.js"),u=require("./features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js"),c=require("./features/IL-OTJ/_components/molecules/SeperationRow/SeparationRow.js"),T=require("./features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js"),g=require("./features/IL-OTJ/_components/organisms/TextSection/TextSection.js"),m=require("./features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.js"),x=require("./features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.js"),f=require("./features/IL-OTJ/_components/templates/TrafficManager/TrafficManagerTemplate.js"),l=require("./features/IL-OTJ/_components/templates/Testing/Testing.js"),d=require("./features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js"),L=require("./features/IL-OTJ/helpers/utils.js"),I=require("./features/IL-OTJ/store/CitationsContext.js"),S=require("./features/IL-OTJ/ILOTJTest.js"),j=require("./features/LearningManagement/LearningManagement.js"),O=require("./features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js"),q=require("./features/LSCGuidelinesCart/GuidelinesLandingPage.js");require("./features/LearningManagement/LearningManagementTest.js"),exports.InstantLearning=e.default,exports.WtaWnta=t.default,exports.BookLearning=r.default,exports.ILOTJ=n.default,exports.Button=a.Button,exports.Dropdown=o.Dropdown,exports.Toggle=s.Toggle,exports.Textarea=i.Textarea,exports.ConditionList=p.ConditionList,exports.SectionWrapper=u.SectionWrapper,exports.SeparationRow=c.SeparationRow,exports.ConfigSection=T.ConfigSection,exports.TextSection=g.TextSection,exports.ScopeSection=m.ScopeSection,exports.ConditionSection=x.ConditionSection,exports.TrafficManagerTemplate=f.TrafficManagerTemplate,exports.Testing=l.Testing,Object.defineProperty(exports,"TemplateList",{enumerable:!0,get:function(){return d.TemplateList}}),exports.TemplateMap=d.TemplateMap,exports.extractAndParseResponse=L.extractAndParseResponse,exports.extractAndParseWithProperty=L.extractAndParseWithProperty,exports.extractTextFromChildren=L.extractTextFromChildren,exports.extractVariantIds=L.extractVariantIds,exports.parseValidationData=L.parseValidationData,exports.useHeaderObserver=L.useHeaderObserver,exports.CitationProvider=I.CitationProvider,exports.useCitations=I.useCitations,exports.dummyDat=S.dummyDat,exports.getVariantInfo=S.getVariantInfo,exports.LearningManagement=j.default,exports.TeachMePlugin=O.default,exports.TemplateRegistry=O.TemplateRegistry,exports.GuidelineLandingPage=q.GuidelineLandingPage;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/InstantLearning/InstantLearning.js"),t=require("./features/WtaWnta/WtaWnta.js"),r=require("./features/DocumentLearning/DocumentLearning.js"),o=require("./features/IL-OTJ/ILOTJ.js"),n=require("./features/IL-OTJ/_components/atoms/Button/Button.js"),a=require("./features/IL-OTJ/_components/atoms/Dropdown/Dropdown.js"),s=require("./features/IL-OTJ/_components/atoms/Toggle/Toggle.js"),i=require("./features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),p=require("./features/IL-OTJ/_components/molecules/Condition/ConditionList.js"),u=require("./features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js"),c=require("./features/IL-OTJ/_components/molecules/SeperationRow/SeparationRow.js"),T=require("./features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js"),m=require("./features/IL-OTJ/_components/organisms/TextSection/TextSection.js"),x=require("./features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.js"),f=require("./features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.js"),g=require("./features/IL-OTJ/_components/templates/TrafficManager/TrafficManagerTemplate.js"),l=require("./features/IL-OTJ/_components/templates/Testing/Testing.js"),L=require("./features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js"),d=require("./features/IL-OTJ/helpers/utils.js"),I=require("./features/IL-OTJ/store/CitationsContext.js"),S=require("./features/IL-OTJ/ILOTJTest.js"),j=require("./features/LearningManagement/LearningManagement.js"),O=require("./features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js");require("./features/LearningManagement/LearningManagementTest.js"),exports.InstantLearning=e.default,exports.WtaWnta=t.default,exports.BookLearning=r.default,exports.ILOTJ=o.default,exports.Button=n.Button,exports.Dropdown=a.Dropdown,exports.Toggle=s.Toggle,exports.Textarea=i.Textarea,exports.ConditionList=p.ConditionList,exports.SectionWrapper=u.SectionWrapper,exports.SeparationRow=c.SeparationRow,exports.ConfigSection=T.ConfigSection,exports.TextSection=m.TextSection,exports.ScopeSection=x.ScopeSection,exports.ConditionSection=f.ConditionSection,exports.TrafficManagerTemplate=g.TrafficManagerTemplate,exports.Testing=l.Testing,Object.defineProperty(exports,"TemplateList",{enumerable:!0,get:function(){return L.TemplateList}}),exports.TemplateMap=L.TemplateMap,exports.extractAndParseResponse=d.extractAndParseResponse,exports.extractAndParseWithProperty=d.extractAndParseWithProperty,exports.extractTextFromChildren=d.extractTextFromChildren,exports.extractVariantIds=d.extractVariantIds,exports.parseValidationData=d.parseValidationData,exports.useHeaderObserver=d.useHeaderObserver,exports.CitationProvider=I.CitationProvider,exports.useCitations=I.useCitations,exports.dummyDat=S.dummyDat,exports.getVariantInfo=S.getVariantInfo,exports.LearningManagement=j.default,exports.TeachMePlugin=O.default,exports.TemplateRegistry=O.TemplateRegistry;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as i}from"tslib";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import{TextSection as o}from"../../organisms/TextSection/TextSection.js";import{ScopeSection as d}from"../../organisms/ScopeSection/ScopeSection.js";import{ConditionSection as l}from"../../organisms/ConditionSection/ConditionSection.js";import{ConfigSection as s}from"../../organisms/ConfigSection/ConfigSection.js";import{InputDataReasoningCard as a}from"../../InputDataReasoningCard.js";import{ButtonCognitiveIcon as r}from"../../_svg/ButtonCognitiveIcon.js";var c=function(c){var p,h,g,v,u,m,I,f,E,b,y,A,S,C,T,N,w,W,L,O,D,M,x,P,R,j,q,V,H,K,z,B,_,k=c.state,F=c.handlers,G=c.uiState,J=c.customNodes,Q=void 0===J?{}:J,U=n({}),X=U[0],Y=U[1],Z=n(new Set),$=Z[0],ii=Z[1],ei=function(e){Y(function(t){var n;return i(i({},t),((n={})[e]=!t[e],n))})},ti=function(i){var e,t=null===(e=k.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(t)&&t.length>0?t:k.citations||[]},ni={marginTop:"-17px",position:"relative",zIndex:1},oi=function(i){return!!G.isAiStreaming||(!!G.isReadOnly||!(!G.activeEditId||G.activeEditId.startsWith(i)))};return e("div",i({className:"base-template-container",style:{display:"flex",flexDirection:"column",gap:"16px",width:"100%"}},{children:[Q.top&&t("div",i({className:"custom-slot-top"},{children:Q.top})),e("div",i({className:"template-section"},{children:[t(o,{id:"base-title",title:G.titleLabel||"Title",fieldName:G.titleLabel||"Title",rows:1,placeholder:"Enter a descriptive title",required:!0,value:k.title||"",onChange:F.onTitleChange,readOnly:oi("base-title"),isOpen:X.title,onToggle:function(){return ei("title")},isHighlighted:(null===(p=G.highlights)||void 0===p?void 0:p.get("title"))||!1,showCognitiveIcon:!!(null===(h=k.citation)||void 0===h?void 0:h.title),tooltipDescription:"Why this ".concat(G.titleLabel||"Title","?"),errorMessage:null===(g=G.validationErrors)||void 0===g?void 0:g.title,enableInlineEdit:!0,setSendMessageInChat:G.setSendMessageInChat,activeEditId:null!==(v=G.activeEditId)&&void 0!==v?v:null,setActiveEditId:G.setActiveEditId,pendingEditId:null!==(u=G.pendingEditId)&&void 0!==u?u:null,setPendingEditId:G.setPendingEditId}),(null===(m=k.citation)||void 0===m?void 0:m.title)&&t("div",i({style:ni},{children:t(a,{isVisible:X.title,citation:k.citation.title,citations:ti("title"),fieldName:G.titleLabel||"Title",fieldValue:k.title||""})}))]})),Q.afterTitle&&t("div",i({className:"custom-slot"},{children:Q.afterTitle})),G.showScope&&e("div",i({className:"template-section"},{children:[t(d,{id:"base-scope",title:G.scopeLabel||"",required:!1,scopeData:k.scopeData||{},onScopeChange:F.onScopeChange,openSections:$,setOpenSections:ii,stationOptions:G.stationOptions||[],tierOptions:G.tierOptions||[],tierLabel:G.tierLabel||"Where should this apply?",stationLabel:G.stationLabel||"Which scope should this belong to?",highlights:(null===(I=G.highlights)||void 0===I?void 0:I.get("scope"))||{},isOpen:X.scope,onToggle:function(){return ei("scope")},showCognitiveIcon:!!(null===(f=k.citation)||void 0===f?void 0:f.scope),cognitiveIcon:t(r,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(E=G.validationErrors)||void 0===E?void 0:E.station)||(null===(b=G.validationErrors)||void 0===b?void 0:b.tiers),stationErrorMessage:null===(y=G.validationErrors)||void 0===y?void 0:y.station,tierErrorMessage:null===(A=G.validationErrors)||void 0===A?void 0:A.tiers,readOnly:oi("base-scope")}),(null===(S=k.citation)||void 0===S?void 0:S.scope)&&t("div",i({style:ni},{children:t(a,{isVisible:X.scope,citation:k.citation.scope,citations:ti("scope"),fieldName:"Scope",fieldValue:(null===(T=null===(C=k.scopeData)||void 0===C?void 0:C.tiers)||void 0===T?void 0:T.join(", "))||""})}))]})),Q.afterScope&&t("div",i({className:"custom-slot"},{children:Q.afterScope})),e("div",i({className:"template-section"},{children:[t(o,{id:"base-description",title:G.descriptionLabel||"Description",fieldName:G.descriptionLabel||"Description",rows:3,placeholder:"Explain the behaviour or learning",required:!0,value:k.description||"",onChange:F.onDescriptionChange,readOnly:oi("base-description"),isOpen:X.description,onToggle:function(){return ei("description")},isHighlighted:(null===(N=G.highlights)||void 0===N?void 0:N.get("description"))||!1,showCognitiveIcon:!!(null===(w=k.citation)||void 0===w?void 0:w.description),tooltipDescription:"Why this ".concat(G.descriptionLabel||"Description","?"),errorMessage:null===(W=G.validationErrors)||void 0===W?void 0:W.description,enableInlineEdit:!0,setSendMessageInChat:G.setSendMessageInChat,activeEditId:null!==(L=G.activeEditId)&&void 0!==L?L:null,setActiveEditId:G.setActiveEditId,pendingEditId:null!==(O=G.pendingEditId)&&void 0!==O?O:null,setPendingEditId:G.setPendingEditId}),(null===(D=k.citation)||void 0===D?void 0:D.description)&&t("div",i({style:ni},{children:t(a,{isVisible:X.description,citation:k.citation.description,citations:ti("description"),fieldName:G.descriptionLabel||"Description",fieldValue:k.description||""})}))]})),Q.afterDescription&&t("div",i({className:"custom-slot"},{children:Q.afterDescription})),t("div",i({className:"template-section"},{children:t(l,{id:"condition-wta-base",idPrefix:"condition-wta",title:G.whenToApplyLabel||"When to apply",required:!0,dividerRequired:!0,readOnly:oi("condition-wta"),conditions:k.whenToApplyConditions||[],onAdd:F.onAddWhenToApply,onRemove:function(i,e,t){return F.onRemoveWhenToApply(t)},onEdit:function(i,e,t,n){return F.onEditWhenToApply(t,n)},isHighlighted:(null===(M=G.highlights)||void 0===M?void 0:M.get("wta"))||!1,highlightedIds:G.highlightedIds,tooltipDescription:"Why this Condition?",citations:ti("whenToApply"),bordered:!0,addLabel:"Add ".concat(G.whenToApplyLabel||"When to apply"),isAiStreaming:G.isAiStreaming,errorMessage:(null===(x=G.validationErrors)||void 0===x?void 0:x.whenToApply)||G.conflictReason,index:0,tierKey:"base",activeEditId:null!==(P=G.activeEditId)&&void 0!==P?P:null,setActiveEditId:G.setActiveEditId,pendingEditId:null!==(R=G.pendingEditId)&&void 0!==R?R:null,setPendingEditId:G.setPendingEditId,setSendMessageInChat:G.setSendMessageInChat})})),Q.afterWhenToApply&&t("div",i({className:"custom-slot"},{children:Q.afterWhenToApply})),t("div",i({className:"template-section"},{children:t(l,{id:"condition-wnta-base",idPrefix:"condition-wnta",title:G.whenNotToApplyLabel||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:oi("condition-wnta"),conditions:k.whenNotToApplyConditions||[],onAdd:F.onAddWhenNotToApply,onRemove:function(i,e,t){return F.onRemoveWhenToApply(t)},onEdit:function(i,e,t,n){return F.onEditWhenNotToApply(t,n)},isHighlighted:(null===(j=G.highlights)||void 0===j?void 0:j.get("wnta"))||!1,highlightedIds:G.highlightedIds,tooltipDescription:"Why this Condition?",citations:ti("whenNotToApply"),bordered:!0,addLabel:"Add ".concat(G.whenNotToApplyLabel||"When NOT to apply"),isAiStreaming:G.isAiStreaming,errorMessage:null===(q=G.validationErrors)||void 0===q?void 0:q.whenNotToApply,index:0,tierKey:"base",activeEditId:null!==(V=G.activeEditId)&&void 0!==V?V:null,setActiveEditId:G.setActiveEditId,pendingEditId:null!==(H=G.pendingEditId)&&void 0!==H?H:null,setPendingEditId:G.setPendingEditId,setSendMessageInChat:G.setSendMessageInChat})})),Q.afterWhenNotToApply&&t("div",i({className:"custom-slot"},{children:Q.afterWhenNotToApply})),G.showConfiguration&&e("div",i({className:"template-section"},{children:[t(s,{id:"base-config",title:G.configLabel||"Configuration",required:!1,highlights:(null===(K=G.highlights)||void 0===K?void 0:K.get("config"))||{},bordered:!0,readOnly:oi("base-config"),onConfigChange:function(i,e){var t;return null===(t=F.onConfigChange)||void 0===t?void 0:t.call(F,i,e)},separationItems:G.separationItems||[],toggles:G.toggles||[],index:0,openSections:$,setOpenSections:ii,activeEditId:null!==(z=G.activeEditId)&&void 0!==z?z:null,setActiveEditId:G.setActiveEditId,pendingEditId:null!==(B=G.pendingEditId)&&void 0!==B?B:null,setPendingEditId:G.setPendingEditId,isAiStreaming:G.isAiStreaming,setSendMessageInChat:G.setSendMessageInChat}),(null===(_=k.citation)||void 0===_?void 0:_.config)&&t("div",i({style:ni},{children:t(a,{isVisible:X.config,citation:k.citation.config,citations:ti("config"),fieldName:G.configLabel||"Configuration",fieldValue:"Proposed Configuration"})}))]})),Q.bottom&&t("div",i({className:"custom-slot-bottom"},{children:Q.bottom}))]}))};export{c as BaseTemplate};
2
+ //# sourceMappingURL=BaseTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseTemplate.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__assign as e,__spreadArray as t}from"tslib";import{jsx as n,jsxs as i,Fragment as o}from"react/jsx-runtime";import r,{useState as l,useRef as a,useEffect as d,useCallback as c,useMemo as s}from"react";import{Loader2Icon as p,Check as u,X as f,Pencil as h,Trash2 as g,ChevronUp as y,ChevronDown as x,ArrowLeft as m,Sparkles as b,Plus as v}from"lucide-react";var w=0,C=function(){return"cond-".concat(Date.now(),"-").concat(++w)},F="#CBD5E1",k="#9B8AFB",S="#7C3AED",z="#FDA29B",D="#344054",E="#1E293B",A="#334155",B="#64748B",R="#94A3B8",T="#98A2B3",I="#F04438",W="#8F2C23",H="#5925DC",j="#475569",L="#FFFFFF",M="#F8FAFC",N="#F1F5F9",_="#F9F5FF",O="#17B26A",K="#F04438",q="#64748B",U="6px",Y="8px",P="Inter, sans-serif",X={width:38,height:38,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #D0D5DD",borderRadius:U,cursor:"pointer",background:L,flexShrink:0,transition:"background 0.15s"},V={width:"100%",boxSizing:"border-box",padding:"8px 11.5px",border:"1px solid #D0D5DD",borderRadius:U,fontSize:14,fontWeight:400,lineHeight:"100%",fontFamily:P,outline:"none",color:D,background:L},Z={display:"flex",alignItems:"center",gap:4,marginBottom:8,color:D,fontSize:14,fontWeight:500,lineHeight:"130%",fontFamily:P},G={background:L,border:"1px solid ".concat(F),borderRadius:Y,padding:16},J=n("span",e({style:{color:W,fontSize:12,lineHeight:1,display:"inline-flex",transform:"translateY(0.5px)"}},{children:"*"})),Q={exact_match:{label:"Exact Match",bg:"#F0FDF4",border:"#BBF7D0",text:"#166534",dot:"#22C55E"},conflict:{label:"Conflict",bg:"#FEF2F2",border:"#FECACA",text:"#991B1B",dot:"#EF4444"},partial_overlap:{label:"Partial Match",bg:"#FFF7ED",border:"#FED7AA",text:"#92400E",dot:"#F97316"},new_field:{label:"New",bg:"#F5F3FF",border:"#DDD6FE",text:"#5925DC",dot:"#7C3AED"}},$=function(e){return e?Array.isArray(e)?e.filter(Boolean).join("\n"):e:""},ee=function(e,t){if(!t&&!e)return"exact_match";if(!t)return"new_field";if(!e)return"new_field";var n=function(e){return e.trim().toLowerCase()};if(n(e)===n(t))return"exact_match";var i=new Set(n(e).split(/\s+/)),o=new Set(n(t).split(/\s+/));return Array.from(i).filter(function(e){return o.has(e)}).length/Math.max(i.size,o.size)>=.45?"partial_overlap":"conflict"},te=function(t){var o=t.relation,r=Q[o];return i("div",e({style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 9px",borderRadius:20,background:r.bg,border:"1px solid ".concat(r.border),fontSize:10,fontWeight:600,color:r.text,fontFamily:P,whiteSpace:"nowrap",flexShrink:0}},{children:[n("span",{style:{width:5,height:5,borderRadius:"50%",background:r.dot,flexShrink:0}}),r.label]}))},ne=r.forwardRef(function(t,o){var r=t.label,l=t.value;return i("div",e({ref:o,style:{display:"flex",flexDirection:"column"}},{children:[n("p",e({style:{margin:"0 0 5px 0",fontSize:12,color:B,fontFamily:P}},{children:r})),n("div",e({style:{flex:1,padding:"9px 12px",borderRadius:Y,background:"#FFF3F2",border:"1px solid ".concat("#FECACA"),fontSize:13,lineHeight:"150%",color:l?E:R,fontFamily:P,fontStyle:l?"normal":"italic",wordBreak:"break-word",whiteSpace:"pre-wrap",minHeight:37}},{children:l||"—"}))]}))});ne.displayName="FieldCell";var ie=function(t){var r=t.formData,p=t.existingData,u=t.onClose,f=t.visible,h=r.whenToApply.map(function(e){return e.text}).filter(Boolean).join("\n"),g=r.whenNotToApply.map(function(e){return e.text}).filter(Boolean).join("\n"),y=$(p.whenToApply),x=$(p.whenNotToApply),v=s(function(){return[{label:"Title",proposed:r.name,existing:p.name||"",relation:ee(r.name,p.name||"")},{label:"Description",proposed:r.description,existing:p.description||"",relation:ee(r.description,p.description||"")},{label:"When to apply",proposed:h,existing:y,relation:ee(h,y)},{label:"When NOT to Apply",proposed:g,existing:x,relation:g?ee(g,x):x?"new_field":"exact_match"}]},[r.name,r.description,h,g,p.name,p.description,y,x]),w=v.reduce(function(e,t){return e[t.relation]=(e[t.relation]||0)+1,e},{}),C=a(null),k=a([]),S=a([]),z=l([]),D=z[0],B=z[1];k.current=[],S.current=[];var R=c(function(){if(C.current){var e=C.current.getBoundingClientRect(),t=[];v.forEach(function(n,i){var o=k.current[i],r=S.current[i];if(o&&r){o.style.height="auto",r.style.height="auto";var l=o.getBoundingClientRect(),a=r.getBoundingClientRect(),d=Math.max(l.height,a.height);o.style.height="".concat(d,"px"),r.style.height="".concat(d,"px");var c=o.getBoundingClientRect(),s=r.getBoundingClientRect(),p=c.top+c.height/2-e.top;t.push({x1:c.right-e.left,y1:p,x2:s.left-e.left,y2:p,relation:n.relation})}}),B(t)}},[v]);return d(function(){var e=setTimeout(R,150);window.addEventListener("resize",R);var t=null;return C.current&&(t=new ResizeObserver(function(){window.requestAnimationFrame(function(){return R()})})).observe(C.current),function(){clearTimeout(e),window.removeEventListener("resize",R),t&&t.disconnect()}},[R,f]),i(o,{children:[n("div",{onClick:u,style:{position:"absolute",inset:0,background:"rgba(15,23,42,0.18)",zIndex:10,opacity:f?1:0,transition:"opacity 0.25s ease",pointerEvents:f?"auto":"none"}}),i("div",e({style:{position:"absolute",inset:0,background:L,zIndex:11,display:"flex",flexDirection:"column",transform:f?"translateX(0)":"translateX(100%)",transition:"transform 0.28s cubic-bezier(0.4,0,0.2,1)",borderRadius:Y,overflow:"hidden"}},{children:[i("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid ".concat(F),flexShrink:0,background:L}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[n("button",e({type:"button",onClick:u,style:e(e({},X),{width:32,height:32,border:"1px solid ".concat(F),borderRadius:U})},{children:n(m,{size:15,color:A})})),n("span",e({style:{fontSize:15,fontWeight:600,color:E,fontFamily:P,letterSpacing:"-0.01em"}},{children:"Category Comparison"}))]})),n("div",e({style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}},{children:Object.entries(w).map(function(t){var o=t[0],r=t[1];return i("div",e({style:{display:"flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:20,background:Q[o].bg,border:"1px solid ".concat(Q[o].border),fontSize:11,fontWeight:600,color:Q[o].text,fontFamily:P}},{children:[n("span",{style:{width:5,height:5,borderRadius:"50%",background:Q[o].dot}}),r," ",Q[o].label]}),o)})}))]})),n("div",e({style:{flex:1,overflowY:"auto",padding:16}},{children:i("div",e({ref:C,style:{display:"grid",gridTemplateColumns:"1fr 140px 1fr",alignItems:"start",gap:"0",position:"relative"}},{children:[n("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:D.map(function(t,o){var r=(t.x1+t.x2)/2,l=t.y1,a=Q[t.relation];return i("g",{children:[n("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:a.border,strokeWidth:"1.5"}),n("foreignObject",e({x:r-70,y:l-14,width:"140",height:"28"},{children:n("div",e({style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n(te,{relation:t.relation})}))}))]},o)})})),i("div",e({style:{border:"1.5px dashed #CBD5E1",borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:14}},{children:[n("p",e({style:{margin:"0 0 2px 0",fontSize:13,fontWeight:600,color:E,fontFamily:P}},{children:"Category You're Creating"})),v.map(function(e,t){return n(ne,{ref:function(e){k.current[t]=e},label:e.label,value:e.proposed},t)})]})),n("div",{}),i("div",e({style:{border:"1.5px dashed #CBD5E1",borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:14}},{children:[i("p",e({style:{margin:"0 0 2px 0",fontSize:13,fontWeight:600,color:H,fontFamily:P,display:"flex",alignItems:"center",gap:5}},{children:[n(b,{size:13,color:H}),"Existing Category"]})),v.map(function(e,t){return n(ne,{ref:function(e){S.current[t]=e},label:e.label,value:e.existing},t)})]}))]}))}))]}))]})},oe=function(t){var r=t.condition,l=t.index,a=t.isEditing,d=t.editText,c=t.onEditStart,s=t.onEditChange,p=t.onEditSave,y=t.onEditCancel,x=t.onRemove,m=t.readOnly,b=t.onBlurContainer,v={width:40,height:38,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:M,borderRight:"1px solid #D0D5DD",color:j,fontSize:14,fontFamily:P};return i("div",a?e({style:{display:"flex",alignItems:"center",gap:12},onBlur:b},{children:[i("div",e({style:{display:"flex",flex:1,alignItems:"center",background:L,border:"1px solid ".concat(k),borderRadius:Y,overflow:"hidden"}},{children:[n("div",e({style:v},{children:l+1})),n("input",{type:"text",value:d,onChange:function(e){return s(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Enter"===e.key&&d.trim()?p():"Escape"===e.key&&y()},style:{flex:1,padding:"8px 11.5px",fontSize:14,fontFamily:P,color:D,border:"none",outline:"none",background:"transparent"}})]})),n("button",e({type:"button",disabled:!d.trim(),onClick:p,style:e(e({},X),{borderRadius:Y,opacity:d.trim()?1:.5,cursor:d.trim()?"pointer":"not-allowed",background:d.trim()?L:M})},{children:n(u,{size:18,color:O})})),n("button",e({type:"button",onClick:y,style:e(e({},X),{borderRadius:Y})},{children:n(f,{size:18,color:K})}))]}):e({style:{display:"flex",alignItems:"center",gap:12}},{children:[i("div",e({style:{display:"flex",flex:1,alignItems:"center",background:L,border:"1px solid #D0D5DD",borderRadius:Y,overflow:"hidden",height:38}},{children:[n("div",e({style:e(e({},v),{height:"100%"})},{children:l+1})),n("div",e({style:{flex:1,padding:"0 11.5px",fontSize:14,fontFamily:P,display:"flex",alignItems:"center",height:"100%"}},{children:r.text?n("span",e({style:{color:D}},{children:r.text})):n("span",e({style:{color:R}},{children:"Enter condition"}))}))]})),!m&&i(o,{children:[n("button",e({type:"button",onClick:c,style:e(e({},X),{border:"1px solid ".concat(F),borderRadius:Y})},{children:n(h,{size:16,color:q})})),n("button",e({type:"button",onClick:x,style:e(e({},X),{border:"1px solid ".concat(z),borderRadius:Y})},{children:n(g,{size:16,color:K})}))]})]}))},re=function(t){var r=t.title,l=t.required,a=t.isExpanded,d=t.setIsExpanded,c=t.conditions,s=t.prefix,p=t.editingCondKey,u=t.editingCondText,f=t.setEditingCondKey,h=t.setEditingCondText,g=t.onAdd,x=t.onUpdate,m=t.onRemove,b=t.addLabel,w=t.readOnly,C=t.errorMessage,k=t.style,S=c.length>0;return i("div",e({style:e({border:"1px solid ".concat(F),borderRadius:Y,padding:16},k)},{children:[i("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8,cursor:S?"pointer":"default",userSelect:"none"},onClick:function(){S&&d(function(e){return!e})}},{children:[i("label",e({style:e(e({},Z),{marginBottom:0,cursor:S?"pointer":"default"})},{children:[l&&J,n("span",{children:r})]})),n("button",e({type:"button",style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"flex",alignItems:"center",transform:a?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.2s"}},{children:n(y,{size:20,color:S?D:R})}))]})),a&&i(o,{children:[0===c.length&&n("p",e({style:{color:B,fontSize:14,fontStyle:"italic",fontWeight:300,fontFamily:P,margin:"0 0 12px 0"}},{children:"No conditions applied"})),n("div",e({style:{display:"flex",flexDirection:"column",gap:12,marginBottom:12}},{children:c.map(function(e,t){var i="".concat(s,"_").concat(e.id);return n(oe,{condition:e,index:t,isEditing:p===i,editText:u,onEditStart:function(){f(i),h(e.text)},onEditChange:h,onEditSave:function(){u.trim()&&(x(e.id,u),f(null))},onEditCancel:function(){e.text?f(null):m(e.id)},onRemove:function(){return m(e.id)},readOnly:w,onBlurContainer:function(t){return function(e,t,n){if(!e.currentTarget.contains(e.relatedTarget)){var i="".concat(s,"_").concat(t);u.trim()||n?u.trim()&&x(t,u):m(t),p===i&&f(null)}}(t,e.id,e.text)}},e.id)})})),!w&&i("button",e({type:"button",onClick:g,style:{display:"flex",alignItems:"center",gap:7,color:H,fontSize:14,fontWeight:500,fontFamily:P,background:"none",border:"none",cursor:"pointer",padding:0}},{children:[n(v,{size:16}),b]})),C&&n("p",e({style:{marginTop:8,color:I,fontSize:12,fontFamily:P,margin:"8px 0 0 0"}},{children:C}))]})]}))},le=function(r){var s=r.state,m=r.handlers,b=r.uiState,w=s.formData,k=s.nameLabel,W=void 0===k?"Category Name":k,M=s.namePlaceholder,Q=void 0===M?"Enter category name":M,$=m.setFormData,ee=b.readOnly,te=void 0!==ee&&ee,ne=b.isAiStreaming,oe=void 0!==ne&&ne;b.setActiveEditId,b.setSendMessageInChat;var le=b.validationErrors,ae=void 0===le?{}:le,de=b.addExampleBtnRef,ce=b.comparisonData,se=void 0===ce?null:ce,pe=b.onComparisonClose,ue=l(null),fe=ue[0],he=ue[1],ge=l(""),ye=ge[0],xe=ge[1],me=l(null),be=me[0],ve=me[1],we=l(""),Ce=we[0],Fe=we[1],ke=l(!0),Se=ke[0],ze=ke[1],De=l(!0),Ee=De[0],Ae=De[1],Be=l(null),Re=Be[0],Te=Be[1],Ie=l(""),We=Ie[0],He=Ie[1],je=l(""),Le=je[0],Me=je[1],Ne=l([]),_e=Ne[0],Oe=Ne[1],Ke=l(!1),qe=Ke[0],Ue=Ke[1],Ye=a(null),Pe=l(!1),Xe=Pe[0],Ve=Pe[1],Ze=a(oe);d(function(){se?requestAnimationFrame(function(){return Ue(!0)}):Ue(!1)},[se]),d(function(){Ze.current&&!oe&&Xe&&Ve(!1),Ze.current=oe},[oe,Xe]);var Ge=te,Je=c(function(t,n){return $(function(i){var o;return e(e({},i),((o={})[t]=n,o))})},[$]),Qe=function(n){var i=C();$(function(o){var r;return e(e({},o),((r={})[n]=t(t([],o[n],!0),[{id:i,text:""}],!1),r))}),ve("".concat("whenToApply"===n?"wta":"wnta","_").concat(i)),Fe(""),"whenToApply"!==n||Se||ze(!0),"whenNotToApply"!==n||Ee||Ae(!0)},$e=function(t,n,i){return $(function(o){var r;return e(e({},o),((r={})[t]=o[t].map(function(t){return t.id===n?e(e({},t),{text:i}):t}),r))})},et=function(t,n){return $(function(i){var o;return e(e({},i),((o={})[t]=i[t].filter(function(e){return e.id!==n}),o))})},tt=function(e){return Oe(function(n){return n.includes(e)?n.filter(function(t){return t!==e}):t(t([],n,!0),[e],!1)})},nt=c(function(){var n=C();$(function(i){return e(e({},i),{occurrences:t(t([],i.occurrences||[],!0),[{id:n,title:"",description:""}],!1)})}),Te(n),He(""),Me(""),Oe(function(e){return t(t([],e,!0),[n],!1)})},[$]),it=c(function(){Ue(!1),setTimeout(function(){null==pe||pe()},280)},[pe]),ot=function(t){return i("button",e({ref:t?void 0:de,type:"button",disabled:t,onClick:nt,style:{display:"flex",alignItems:"center",gap:7,padding:"7px 10.5px",background:"none",border:"none",cursor:t?"not-allowed":"pointer",opacity:t?.5:1,transition:"opacity 0.15s"}},{children:[n(v,{size:14,color:H}),n("span",e({style:{color:H,fontSize:14,fontWeight:500,fontFamily:P}},{children:"Add example"}))]}))};return i("div",e({style:{flex:1,overflowY:"auto",position:"relative"}},{children:[se&&n(ie,{formData:w,existingData:se,onClose:it,visible:qe}),Xe&&oe&&i("div",e({style:{display:"flex",alignItems:"center",color:"#141414",fontSize:13,fontWeight:500,fontStyle:"italic",marginBottom:12,paddingLeft:4,fontFamily:P}},{children:[n(p,{size:16,style:{marginRight:8,animation:"spin 1s linear infinite"}}),"Updating category details..."]})),i("div",e({style:e(e({},G),{marginBottom:12})},{children:[i("div",e({style:{marginBottom:12}},{children:[i("label",e({style:Z},{children:[J,n("span",{children:W})]})),Ge&&"name"!==fe?n("div",e({style:{display:"flex",alignItems:"center",gap:12}},{children:n("div",e({style:{flex:1,padding:"10px 14px",border:"1px solid #D0D5DD",borderRadius:U,fontSize:14,background:L,minHeight:42,display:"flex",alignItems:"center"}},{children:w.name?n("span",e({style:{color:D}},{children:w.name})):n("span",e({style:{color:T}},{children:Q}))}))})):Ge&&"name"===fe?i("div",e({style:{display:"flex",alignItems:"center",gap:12}},{children:[n("input",{type:"text",value:ye,onChange:function(e){return xe(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Enter"===e.key?(Je("name",ye),he(null)):"Escape"===e.key&&he(null)},placeholder:Q,style:e(e({},V),{flex:1,width:"auto",border:"1px solid ".concat(S)})}),n("button",e({type:"button",onClick:function(){Je("name",ye),he(null)},style:X},{children:n(u,{size:18,color:O})})),n("button",e({type:"button",onClick:function(){return he(null)},style:X},{children:n(f,{size:18,color:K})}))]})):n("input",{type:"text",value:w.name,onChange:function(e){return Je("name",e.target.value)},placeholder:Q,disabled:oe,style:e(e({},V),{opacity:oe?.6:1,cursor:oe?"not-allowed":"text"})}),(null==ae?void 0:ae.name)&&n("p",e({style:{marginTop:4,color:I,fontSize:12,fontFamily:P,margin:"4px 0 0 0"}},{children:ae.name}))]})),i("div",e({style:{marginBottom:12}},{children:[i("label",e({style:Z},{children:[J,n("span",{children:"Category Description"})]})),Ge&&"description"!==fe?n("div",e({style:{display:"flex",alignItems:"flex-start",gap:12}},{children:n("div",e({style:{flex:1,padding:"12px 14px",border:"1px solid #D0D5DD",borderRadius:U,fontSize:14,background:L,minHeight:80}},{children:w.description?n("span",e({style:{color:D,whiteSpace:"pre-wrap"}},{children:w.description})):n("span",e({style:{color:T}},{children:"Describe when this category should be applied"}))}))})):Ge&&"description"===fe?i("div",e({style:{display:"flex",alignItems:"flex-start",gap:12}},{children:[n("textarea",{value:ye,onChange:function(e){return xe(e.target.value)},autoFocus:!0,onKeyDown:function(e){"Escape"===e.key&&he(null)},placeholder:"Enter Description",rows:4,style:e(e({},V),{flex:1,width:"auto",border:"1px solid ".concat(S),resize:"none",lineHeight:"140%"})}),i("div",e({style:{display:"flex",flexDirection:"column",gap:8}},{children:[n("button",e({type:"button",onClick:function(){Je("description",ye),he(null)},style:X},{children:n(u,{size:18,color:O})})),n("button",e({type:"button",onClick:function(){return he(null)},style:X},{children:n(f,{size:18,color:K})}))]}))]})):n("textarea",{value:w.description,onChange:function(e){return Je("description",e.target.value)},placeholder:"Describe when this category should be applied.",disabled:oe,style:e(e({},V),{height:60,paddingTop:7,paddingBottom:10.5,border:"1px solid ".concat(F),lineHeight:"140%",resize:"none",boxShadow:"0 1px 2px 0 rgba(18,18,23,0.05)",opacity:oe?.6:1,cursor:oe?"not-allowed":"text"})}),(null==ae?void 0:ae.description)&&n("p",e({style:{marginTop:4,color:I,fontSize:12,fontFamily:P,margin:"4px 0 0 0"}},{children:ae.description}))]})),n(re,{title:"When to Apply",required:!0,isExpanded:Se,setIsExpanded:ze,conditions:w.whenToApply,prefix:"wta",editingCondKey:be,editingCondText:Ce,setEditingCondKey:ve,setEditingCondText:Fe,onAdd:function(){return Qe("whenToApply")},onUpdate:function(e,t){return $e("whenToApply",e,t)},onRemove:function(e){return et("whenToApply",e)},addLabel:"Add When to Apply",readOnly:oe||te,errorMessage:null==ae?void 0:ae.whenToApply,style:{marginBottom:12}}),n(re,{title:"When NOT to Apply",required:!1,isExpanded:Ee,setIsExpanded:Ae,conditions:w.whenNotToApply,prefix:"wnta",editingCondKey:be,editingCondText:Ce,setEditingCondKey:ve,setEditingCondText:Fe,onAdd:function(){return Qe("whenNotToApply")},onUpdate:function(e,t){return $e("whenNotToApply",e,t)},onRemove:function(e){return et("whenNotToApply",e)},addLabel:"Add When NOT to Apply",readOnly:oe||te,errorMessage:null==ae?void 0:ae.whenNotToApply})]})),i("div",e({style:e(e({},G),{marginTop:12})},{children:[i("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12}},{children:[i("div",{children:[i("h4",e({style:{color:E,fontSize:14,fontWeight:500,lineHeight:"120%",letterSpacing:"0.02em",fontFamily:P,margin:"0 0 4px 0"}},{children:["Example (",(w.occurrences||[]).length,")"]})),n("p",e({style:{color:B,fontSize:12,fontWeight:300,lineHeight:"120%",letterSpacing:"0.02em",fontFamily:P,margin:0}},{children:"Add real examples to help the system understand this category"}))]}),(w.occurrences||[]).length>0&&!te&&ot(null!==Re||oe)]})),0===(w.occurrences||[]).length?i("div",e({style:{border:"1px solid ".concat(F),borderRadius:Y,background:L,padding:"24px 12px 12px",minHeight:181,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}},{children:[n("div",e({style:{marginBottom:16}},{children:i("svg",e({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 56 56",fill:"none"},{children:[n("rect",{x:"4",y:"4",width:"48",height:"48",rx:"24",fill:"#F1F5F9"}),n("rect",{x:"4",y:"4",width:"48",height:"48",rx:"24",stroke:"#F8FAFC",strokeWidth:"8"}),n("rect",{width:"24",height:"24",transform:"translate(16 16)",fill:"#F1F5F9"}),n("path",{d:"M25 19.5V18M21.0607 21.0607L20 20M21.0607 29L20 30.0607M29 21.0607L30.0607 20M19.5 25H18M31.8645 32.1896L29.3727 36.817C29.0881 37.3457 28.9457 37.61 28.7745 37.6769C28.6259 37.7349 28.4585 37.7185 28.324 37.6328C28.1689 37.534 28.0806 37.2471 27.9038 36.6733L24.4452 25.4453C24.3008 24.9765 24.2286 24.7421 24.2867 24.5838C24.3373 24.446 24.446 24.3373 24.5838 24.2867C24.7421 24.2286 24.9765 24.3008 25.4452 24.4452L36.6732 27.9038C37.247 28.0806 37.5339 28.169 37.6327 28.324C37.7185 28.4586 37.7348 28.6259 37.6768 28.7745C37.61 28.9458 37.3456 29.0881 36.817 29.3728L32.1896 31.8645C32.111 31.9068 32.0717 31.9279 32.0374 31.9551C32.0068 31.9792 31.9792 32.0068 31.9551 32.0374C31.9279 32.0717 31.9068 32.111 31.8645 32.1896Z",stroke:"#475569",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))})),n("p",e({style:{color:A,fontSize:12,fontWeight:500,lineHeight:"120%",fontFamily:P,margin:"0 0 8px 0"}},{children:"No example added yet"})),n("p",e({style:{color:B,fontSize:14,fontWeight:300,lineHeight:"140%",fontFamily:P,margin:"0 0 8px 0",maxWidth:530}},{children:"Add an example to show how this category is used, or generate one using chat."})),!te&&ot(null!==Re||oe)]})):n("div",e({style:{display:"flex",flexDirection:"column",gap:12}},{children:(w.occurrences||[]).map(function(t,r){var l=_e.includes(t.id);return Re===t.id?i("div",e({style:{display:"flex",flexDirection:"column",gap:12,border:"1px solid ".concat(F),borderRadius:Y,background:L,padding:16,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[i("div",{children:[n("label",e({style:e(e({},Z),{marginBottom:8})},{children:n("span",e({style:{color:A}},{children:"Title/Subject"}))})),n("input",{type:"text",value:We,onChange:function(e){return He(e.target.value)},placeholder:"e.g., Follow-up on client feedback from last meeting",style:e(e({},V),{border:"1px solid ".concat(F),lineHeight:"140%"})})]}),i("div",{children:[i("label",e({style:{display:"flex",alignItems:"center",gap:4,marginBottom:8}},{children:[n("span",e({style:{color:A,fontSize:14,fontWeight:500,fontFamily:P}},{children:"Message body"})),J]})),n("textarea",{ref:function(e){e&&Re===t.id&&!Ye.current&&(Ye.current=e),e&&(e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px"))},value:Le,onChange:function(e){Me(e.target.value),e.target.style.height="auto",e.target.style.height="".concat(e.target.scrollHeight,"px")},placeholder:"e.g., Hi, here's the latest update on the project. Let us know if you have any questions.",rows:1,style:e(e({},V),{border:"1px solid ".concat(F),overflow:"hidden",minHeight:60,lineHeight:"140%",resize:"none"})})]}),i("div",e({style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:4}},{children:[n("button",e({type:"button",onClick:function(){t.title||t.description||$(function(n){return e(e({},n),{occurrences:(n.occurrences||[]).filter(function(e){return e.id!==t.id})})}),Te(null),Ye.current=null},style:{padding:"6px 12px",color:j,fontSize:14,fontWeight:500,lineHeight:"140%",fontFamily:P,background:"none",border:"none",cursor:"pointer",borderRadius:U}},{children:"Cancel"})),n("button",e({type:"button",disabled:!Le.trim(),onClick:function(){var n;Le.trim()&&(n=t.id,$(function(t){return e(e({},t),{occurrences:t.occurrences.map(function(t){return t.id===n?e(e({},t),{title:We,description:Le}):t})})}),Te(null),Ye.current=null,Oe(function(e){return e.filter(function(e){return e!==t.id})}))},style:{padding:"6px 12px",borderRadius:U,fontSize:14,fontWeight:500,lineHeight:"140%",fontFamily:P,cursor:Le.trim()?"pointer":"not-allowed",background:Le.trim()?_:L,border:"1px solid ".concat(Le.trim()?_:"#E2E8F0"),color:Le.trim()?H:R,transition:"background 0.15s"}},{children:"Save"}))]}))]}),t.id):i("div",e({style:{display:"flex",flexDirection:"column",border:"1px solid #E2E8F0",borderRadius:Y,background:L,overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:12,padding:12}},{children:[n("div",e({style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:N,borderRadius:U,color:j,fontSize:10,fontWeight:500,fontFamily:P}},{children:r+1})),n("div",e({style:{flex:1,fontSize:15,fontWeight:500,lineHeight:"140%",fontFamily:P,color:A,wordBreak:"break-word"}},{children:t.title||n("span",e({style:{color:R,fontWeight:400,fontSize:14}},{children:"Untitled example"}))})),i("div",e({style:{display:"flex",alignItems:"center",gap:8,flexShrink:0}},{children:[!te&&i(o,{children:[n("button",e({type:"button",disabled:null!==Re||oe,onClick:function(){Te(t.id),He(t.title),Me(t.description),l||tt(t.id)},style:e(e({},X),{width:36,height:36,border:"1px solid #E2E8F0",borderRadius:U,opacity:null!==Re||oe?.5:1,cursor:null!==Re||oe?"not-allowed":"pointer"})},{children:n(h,{size:16,color:q})})),n("button",e({type:"button",disabled:null!==Re||oe,onClick:function(){return $(function(n){return e(e({},n),{occurrences:(n.occurrences||[]).filter(function(e){return e.id!==t.id})})})},style:e(e({},X),{width:36,height:36,border:"1px solid ".concat(z),borderRadius:U,opacity:null!==Re||oe?.5:1,cursor:null!==Re||oe?"not-allowed":"pointer"})},{children:n(g,{size:16,color:K})}))]}),n("button",e({type:"button",onClick:function(){return tt(t.id)},style:e(e({},X),{width:36,height:36,border:"none",background:"transparent"})},{children:n(l?y:x,{size:20,color:q})}))]}))]})),l&&i("div",e({style:{display:"flex",flexDirection:"column",padding:"4px 12px 16px"}},{children:[i("div",e({style:{marginBottom:12}},{children:[n("p",e({style:{color:B,fontSize:13,lineHeight:"140%",fontFamily:P,margin:"0 0 4px 0"}},{children:"Title/Subject:"})),n("p",e({style:{color:E,fontSize:14,fontWeight:300,lineHeight:"150%",fontFamily:P,whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},{children:t.title||n("span",e({style:{color:R,fontStyle:"italic"}},{children:"—"}))}))]})),i("div",{children:[n("p",e({style:{color:B,fontSize:13,lineHeight:"140%",fontFamily:P,margin:"0 0 4px 0"}},{children:"Message body:"})),n("p",e({style:{color:E,fontSize:14,fontWeight:300,lineHeight:"150%",fontFamily:P,whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},{children:t.description}))]})]}))]}),t.id)})}))]}))]}))};export{le as CreateCategory,le as default};
2
+ //# sourceMappingURL=CreateCategory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateCategory.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__assign as i}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useState as t}from"react";import{ConditionSection as o}from"../../organisms/ConditionSection/ConditionSection.js";import{TextSection as l}from"../../organisms/TextSection/TextSection.js";var r=function(r){var d,s,u,a=r.state,p=r.handlers,h=r.uiState,g=(null==h?void 0:h.highlights)||{},c=t({}),v=c[0],y=c[1],m=function(e){y(function(n){var t;return i(i({},n),((t={})[e]=!n[e],t))})},A=function(i){var e,n=null===(e=a.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(n)&&n.length>0?n:a.citations};return e("div",i({className:"simple-guideline-template"},{children:n("div",i({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e(l,i({id:"guideline-title",title:"Guideline Title",rows:1,placeholder:"Enter a short, descriptive title for the guideline",required:!0,value:a.guidelineTitle,onChange:p.setGuidelineTitle,readOnly:null==h?void 0:h.isAiStreaming,isOpen:v.guidelineTitle,onToggle:function(){return m("guidelineTitle")},isHighlighted:g.guidelineTitle||!1,tooltipDescription:"Why this Title?",errorMessage:null===(d=null==h?void 0:h.validationErrors)||void 0===d?void 0:d.guidelineTitle},h)),e(l,i({id:"guideline-description",title:"Guideline Description",rows:4,placeholder:"Describe what this guideline enforces or ensures",required:!0,value:a.guidelineDescription,onChange:p.setGuidelineDescription,readOnly:null==h?void 0:h.isAiStreaming,isOpen:v.guidelineDescription,onToggle:function(){return m("guidelineDescription")},isHighlighted:g.guidelineDescription||!1,tooltipDescription:"Why this Description?",errorMessage:null===(s=null==h?void 0:h.validationErrors)||void 0===s?void 0:s.guidelineDescription},h)),e(o,i({id:"when-to-apply",title:"When to apply",required:!0,dividerRequired:!0,readOnly:null==h?void 0:h.isAiStreaming,conditions:a.whenToApplyConditions||[],onAdd:function(){return p.addWhenToApply()},onRemove:function(i,e,n){return p.removeWhenToApply(n)},onEdit:function(i,e,n,t){return p.editWhenToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wta||!1,highlightedIds:null==h?void 0:h.highlightedIds,tooltipDescription:"Why this Condition?",citations:A("whenToApply"),bordered:!0,addLabel:"Add When to apply",isAiStreaming:null==h?void 0:h.isAiStreaming,errorMessage:null===(u=null==h?void 0:h.validationErrors)||void 0===u?void 0:u.whenToApply},h)),e(o,i({id:"when-not-to-apply",title:"When NOT to apply",required:!1,dividerRequired:!0,readOnly:null==h?void 0:h.isAiStreaming,conditions:a.whenNotToApplyConditions||[],onAdd:function(){return p.addWhenNotToApply()},onRemove:function(i,e,n){return p.removeWhenNotToApply(n)},onEdit:function(i,e,n,t){return p.editWhenNotToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wnta||!1,highlightedIds:null==h?void 0:h.highlightedIds,tooltipDescription:"Why this Condition?",citations:A("whenNotToApply"),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:null==h?void 0:h.isAiStreaming},h))]}))}))};export{r as WorkflowComposer};
2
+ //# sourceMappingURL=WorkflowComposer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowComposer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as t,__awaiter as n,__generator as r}from"tslib";import{jsx as o,jsxs as s,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as c,useEffect as l}from"react";import{BookOpen as u,Users as d,History as p}from"lucide-react";import{useLearningTemplateStore as m}from"./store/useLearningTemplateStore.js";import{Toast as f}from"primereact/toast";import v from"./styles/LearningTemplateManagement.module.css.js";import g from"./LearningTemplateLayout.js";import h from"./components/EmptyLearningState.js";import S from"./store/useAuthStore.js";import{fetchTiers as y,getILInstance as b,fetchScopes as C,inheritScope as T,inheritScopeBackwardCompatible as A,createRuleSet as L,renameScope as E,deleteRuleSet as I,requestAccess as R}from"./apis/scopeApis.js";import{QUERY_PARAM_KEYS as w,setQueryParams as O}from"./hooks/useLearningTemplateQueryParams.js";import j from"./components/ConfirmationModal.js";import N from"./components/LearningTemplateManagementSkeleton.js";import{findNodeById as _,findNodePathById as D}from"./utils/treeUtils.js";import k from"./store/useEnvStore.js";import{useConfigStore as M}from"./store/useConfigStore.js";import{TooltipProvider as B}from"./components/ToolTip.js";import P from"./components/CreateRuleSetLegacyModal.js";import{usePermissionsStore as U}from"./store/usePermissionsStore.js";import{useAppSecRolesStore as q}from"./store/useAppSecRolesStore.js";import{useGetAppSecRolesQuery as G}from"./queries/useApprovalQueries.js";import{useLMSConfigQuery as F}from"./queries/useLMSConfigQuery.js";import x from"./RuleContent/AddScopeModal.js";import H from"./components/RuleContentSkeleton.js";import Q from"./components/ErrorStateDisplay.js";import{useLocation as z}from"react-router-dom";import K from"./shared/SuccessToastContent.js";import V from"./shared/ErrorToastContent.js";import W from"./RuleContent/RenameScopeModal.js";import{dt as Y}from"./store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as J,MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH as X,EMPTY_STATE_DT_PATH as Z}from"./constants.js";function $($){var ee,te,ne,re=this,oe=$.userDetails,se=$.llmStudioUrl,ie=$.audacyBackendUrl,ae=$.ilLabels,ce=$.config,le=$.rbacConfig,ue=$.auditLogConfig,de=$.app_integration_id,pe=$.backwardCompatibility,me=void 0!==pe&&pe,fe=$.cognitiveCompareCompatibility,ve=void 0!==fe&&fe,ge=$.modeId,he=$.modeDetails;m(function(e){return e.selectedRuleSetId});var Se=m(function(e){return e.setSelectedRuleSetId}),ye=m(function(e){return e.error}),be=m(function(e){return e.setError}),Ce=m(function(e){return e.setStations}),Te=m(function(e){return e.scopeTreeData}),Ae=m(function(e){return e.setScopeTreeData}),Le=a({isOpen:!1,type:"GLOBAL"}),Ee=Le[0],Ie=Le[1],Re=a(!1),we=Re[0],Oe=Re[1],je=a(!1),Ne=je[0],_e=je[1],De=a("learnings"),ke=De[0],Me=De[1],Be=a(null),Pe=Be[0],Ue=Be[1],qe=a(null),Ge=qe[0];qe[1];var Fe=a(!1),xe=Fe[0],He=Fe[1],Qe=a(!1),ze=Qe[0],Ke=Qe[1];c(null);var Ve=c(null),We=c(!1),Ye=c(null),Je=S();Je.user;var Xe=Je.setUser,Ze=M(),$e=Ze.setConfig,et=Ze.setIlLabels,tt=function(){try{return z()}catch(e){return{search:""}}}();l(function(){if(!We.current){var e=new URLSearchParams(window.location.search),t=e.get(w.RULESET_ID),n=e.get(w.SECTION),r=n&&At.has(n)?n:"learnings";(null==t?void 0:t.length)&&Se&&Me&&(Se(t),Me(r),We.current=!0)}},[null==tt?void 0:tt.search,Me,Se]);var nt=U(function(e){return e.fetchPermissions}),rt=U(function(e){return e.hasPermission}),ot=q(function(e){return e.setRoles}),st=k(function(e){return e.appsecRbacUrl})===le.appsecRbacUrl,it=G(le.applicationId,st).data,at=F(null!=de?de:"",me),ct=at.isLoading,lt=at.isError,ut=at.refetch;at.isSuccess;var dt=a(0),pt=dt[0],mt=dt[1];l(function(){if(!me&&de&&se){n(re,void 0,void 0,function(){var e,t,n,o,s,i;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,b(de)];case 1:return e=r.sent(),"number"==typeof(t=null===(i=null===(s=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.learningManagement)||void 0===s?void 0:s.scopeAndHierarchy)||void 0===i?void 0:i.maxHierarchyLevels)&&t>0&&mt(t-1),[3,3];case 2:return n=r.sent(),console.error("Failed to fetch IL instance for hierarchy levels:",n),[3,3];case 3:return[2]}})})}},[de,se]),l(function(){it&&ot(it.map(function(e){return{_id:e._id,name:e.name}}))},[it,ot]),l(function(){var e;console.log("userDetails",oe),Xe(oe),console.log("llmStudioUrl",se),console.log("audacyBackendUrl",ie),k.getState().setLlmStudioUrl(se),k.getState().setAudacyBackendUrl(ie),k.getState().setRbacConfig(le),k.getState().setAuditLogConfig(ue),k.getState().setBaseModeName((null==he?void 0:he.modeNameFromURL)||null),$e(ce),et(ae),m.getState().setAppIntegrationId(null!=de?de:null),m.getState().setBackwardCompatibility(me),m.getState().setCognitiveCompareCompatibility(null!=ve&&ve),m.getState().setToken(null!==(e=null==oe?void 0:oe.accessToken)&&void 0!==e?e:null)},[oe,Xe,se,ie,le,ue,ce,$e,ae,et,de,me,ve,he]),l(function(){(null==oe?void 0:oe.accessToken)&&se&&y()},[de,null==oe?void 0:oe.accessToken,se]);var ft=function(t){return void 0===t&&(t=!0),n(re,void 0,void 0,function(){var n,o,s,i,a,c,l,u;return r(this,function(r){switch(r.label){case 0:t&&Oe(!0),be(null),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,nt(le.applicationId)];case 2:return r.sent(),n=function(t){if(!U.getState().hasPermission("ilotj.scope.view",t.id))return null;var r=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return e(e({},t),{children:r})},[4,C(de,oe.accessToken)];case 3:return(o=r.sent())&&o.data&&o.data.data&&(s=o.data.data,Array.isArray(s)&&(s=s.length>0?s[0]:null),s?(i=n(s))?(Ue(null),Ae({data:i}),Ve.current?(Se(Ve.current),Me("learnings"),Ve.current=null):(a=m.getState().selectedRuleSetId,c=a?_(i,a):null,a&&c||Se(i.id))):(Ue(null!==(u=s.id)&&void 0!==u?u:null),Ae(null)):(Ue(null),Ae(null))),[3,6];case 4:return l=r.sent(),console.error("Failed to fetch rule sets or permissions",l),be("Failed to load data. Please try again later."),[3,6];case 5:return Oe(!1),[7];case 6:return[2]}})})};l(function(){var e;(null===(e=null==oe?void 0:oe.accessToken)||void 0===e?void 0:e.length)&&st?ft(!0):console.warn("Error: Trying to fetch rules without access token",oe)},[null==oe?void 0:oe.accessToken,be,Ce,le.applicationId,st]);var vt=function(t,o,s){return n(re,void 0,void 0,function(){var n,o,s,i,a,c,l,u;return r(this,function(r){switch(r.label){case 0:_e(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,I(t,oe.accessToken)];case 2:return r.sent(),m.getState().selectedRuleSetId===t&&(n=m.getState().scopeTreeData,(o=D((null==n?void 0:n.data)||null,t))&&o.length>1&&(s=o[o.length-2],Se(s),Me("learnings"))),[4,ft(!0)];case 3:return r.sent(),Ie(function(t){return e(e({},t),{isOpen:!1})}),null===(a=Ye.current)||void 0===a||a.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return i=r.sent(),console.error("An error occurred during scope deletion.",i),null===(c=Ye.current)||void 0===c||c.show({severity:"error",summary:"Delete Failed",detail:(null===(u=null===(l=null==i?void 0:i.response)||void 0===l?void 0:l.data)||void 0===u?void 0:u.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return _e(!1),[7];case 6:return[2]}})})},gt=function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),O(((n={})[w.SECTION]="learnings"===t?null:t,n[w.RULESET_ID]=e,n)),Me(t),Se(e)},ht=Te,St=Ge?{data:{id:Ge.stationId,name:Ge.stationName,type:"STATION",metrics:{learningsCount:Ge.learningsCount,stationsCount:0},children:[]}}:ht,yt=!!(null==St?void 0:St.data);null===(ee=null==St?void 0:St.data)||void 0===ee||ee.type;var bt=U(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",le.applicationResourceId||"");if(ct)return o("div",e({className:v.learningManagementContainer},{children:o(H,{})}));if(lt)return o("div",e({className:v.learningManagementContainer},{children:o(Q,{errorMessage:"Failed to load configuration. Please try again.",onRetry:function(){return ut()},title:"Error Loading Configuration"})}));var Ct=t(t([{type:"GLOBAL",label:"Global",addChildLabel:"".concat(Y("".concat(J,".addScope"),"Add Scope")),addChildType:"SCOPE"}],Array.from({length:pt},function(){return e({type:"SCOPE",label:Y("".concat(J,".scope"),"Scope")},!me&&{addChildLabel:Y("".concat(X,".addSubScope"),"Add Subscope"),addChildType:"SUBSCOPE"})}),!0),me?[]:[{type:"SUBSCOPE",label:Y("".concat(J,".subScope"),"Subscope")}],!0),Tt=[{id:"learnings",label:Y("".concat(J,".treeMenu.submenu.learnings"),"Learnings"),icon:u,badgeKey:"learningsCount"},{id:"access",label:Y("".concat(J,".treeMenu.submenu.access"),"Access"),icon:d},{id:"history",label:Y("".concat(J,".treeMenu.submenu.changeHistory"),"Change History"),icon:p}],At=new Set(Tt.map(function(e){return e.id})),Lt=Ge?Tt.filter(function(e){return"stations"!==e.id}):Tt;return o(B,{children:s("div",e({className:v.learningManagementContainer},{children:[o("div",e({className:v.mainWrapper},{children:we?o(N,{}):ye?s("div",e({className:v.errorContainer},{children:[o("div",e({className:v.errorTitle},{children:"Error Loading Data"})),o("p",e({className:v.errorDesc},{children:ye})),o("button",e({onClick:function(){return ft(!0)},className:v.tryAgainBtn},{children:"Try Again"}))]})):yt?o(g,{onOpenCreateModal:function(){return Ie({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return Ie({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return Ie({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(e,t,o){return n(re,void 0,void 0,function(){var n,s,i;return r(this,function(r){switch(r.label){case 0:return n=m.getState().scopeTreeData,s=D((null==n?void 0:n.data)||null,e),i=!!s&&3===s.length,0!==o?[3,2]:[4,vt(e)];case 1:return r.sent(),[3,3];case 2:Ie({isOpen:!0,type:"DELETE",scopeId:e,initialName:t,isSubscope:i}),r.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return rt("ilotj.scope.delete",e)},canEditScope:function(e){return rt("ilotj.scope.edit",e)},canCreateScope:function(e){return rt("ilotj.scope.create",e)},onSectionSelect:gt,activeSectionId:ke,scopeTreeData:St,sectionsConfig:Lt,onViewStation:function(e){gt(e.stationId,"learnings")},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(Ve.current=t),ft(e)},nodeTypesConfig:Ct,app_integration_id:de,token:oe.accessToken,modeId:ge}):o(h,{onCreate:function(){return Ie({isOpen:!0,type:"GLOBAL"})},title:Y("".concat(Z,".title"),"No Global Scope has been added!"),desc:Y("".concat(Z,".desc"),"Start by creating a Global scope to define base learnings that apply across all stations."),button:Y("".concat(Z,".createGlobalScope"),"Create Global Scope"),canCreateRule:bt,noAccessTitle:Y("".concat(Z,".noAccessTitle"),"Access Restricted"),noAccessDesc:Y("".concat(Z,".noAccessDesc"),"You do not have access for this application."),requestAccessButton:Y("".concat(Z,".requestAccessButton"),"Request Access"),requestSentButton:Y("".concat(Z,".requestSentButton"),"Request Sent"),onRequestAccess:function(){return n(re,void 0,void 0,function(){var e,t,n,s,i,a,c,l,u;return r(this,function(r){switch(r.label){case 0:if(!(e=(null===(s=null===(n=m.getState().scopeTreeData)||void 0===n?void 0:n.data)||void 0===s?void 0:s.id)||Pe))return null===(i=Ye.current)||void 0===i||i.show({severity:"error",sticky:!1,className:v.errorToast,content:o(V,{message:"Unable to identify the global scope for this access request."})}),[2];He(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,R(e)];case 2:return r.sent(),Ke(!0),null===(a=Ye.current)||void 0===a||a.show({severity:"success",sticky:!1,life:3e3,className:v.successToast,content:o(K,{message:"Access request submitted successfully!"})}),[3,5];case 3:return t=r.sent(),null===(c=Ye.current)||void 0===c||c.show({severity:"error",sticky:!1,className:v.errorToast,content:o(V,{message:(null===(u=null===(l=null==t?void 0:t.response)||void 0===l?void 0:l.data)||void 0===u?void 0:u.detail)||"Failed to request access. Please try again."})}),[3,5];case 4:return He(!1),[7];case 5:return[2]}})})},isRequestingAccess:xe,isAccessRequested:ze})})),o(f,{ref:Ye,pt:{root:{style:{zIndex:9999}}}}),me&&Ee.isOpen&&"DELETE"!==Ee.type&&"RENAME"!==Ee.type?o(P,{isOpen:!0,onClose:function(){return Ie(e(e({},Ee),{isOpen:!1}))},onSubmit:function(t){return n(re,void 0,void 0,function(){var n,o,s,i,a,c,l,u,d,p,f,v,g,h,S,y,b,C,E,I;return r(this,function(r){switch(r.label){case 0:_e(!0),n=m.getState().backwardCompatibility,r.label=1;case 1:return r.trys.push([1,12,13,14]),o=void 0,n&&"object"==typeof t?o=t:(s=t,i="SCOPE"===Ee.type&&Ee.parentId,a=i?"genreRuleSet":Ee.type,o={topic:a,scope_reference_id:null,scopeDescription:"demo",parentScopeId:Ee.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:de}),[4,L(o,oe.accessToken)];case 2:if(c=r.sent(),!(l=null===(h=null==c?void 0:c.data)||void 0===h?void 0:h.scopeId))return[3,10];if(Ve.current=l,u=n&&(null===(S=o.topic)||void 0===S?void 0:S.toLowerCase().includes("genre")),d=!n&&"GLOBAL"!==Ee.type&&Ee.parentId,!u&&!d)return[3,10];if(!(p=n?null===(b=null===(y=m.getState().scopeTreeData)||void 0===y?void 0:y.data)||void 0===b?void 0:b.id:Ee.parentId))return[3,10];if(!me)return[3,7];r.label=3;case 3:return r.trys.push([3,5,,6]),[4,A({source_scope_id:p,target_scope_id:l})];case 4:return r.sent(),[3,6];case 5:return f=r.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return r.trys.push([7,9,,10]),[4,T({source_scope_id:p,target_scope_id:l,application_mapping_id:de||"",is_copy_parent_variant_id:!1})];case 8:return r.sent(),[3,10];case 9:return v=r.sent(),console.error("Failed to inherit rules for the new scope:",v),[3,10];case 10:return[4,ft(!0)];case 11:return r.sent(),Ie(function(t){return e(e({},t),{isOpen:!1})}),[3,14];case 12:throw g=r.sent(),console.error("An error occurred during scope creation.",g),null===(C=Ye.current)||void 0===C||C.show({severity:"error",summary:"Creation Failed",detail:(null===(I=null===(E=null==g?void 0:g.response)||void 0===E?void 0:E.data)||void 0===I?void 0:I.message)||"There was an error creating the scope. Please try again."}),g;case 13:return _e(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:yt,canCreateGlobal:bt,globalScopeId:null!==(ne=null===(te=null==Te?void 0:Te.data)||void 0===te?void 0:te.id)&&void 0!==ne?ne:null}):s(i,{children:[o(x,{isOpen:Ee.isOpen&&"DELETE"!==Ee.type&&"RENAME"!==Ee.type,onClose:function(){return Ie(e(e({},Ee),{isOpen:!1}))},onCreate:function(e){e&&(Ve.current=e),ft(!0)},hasGlobalRuleSet:yt,parentId:Ee.parentId}),o(W,{isOpen:Ee.isOpen&&"RENAME"===Ee.type,onClose:function(){return Ie(e(e({},Ee),{isOpen:!1}))},onSave:function(t){return n(re,void 0,void 0,function(){var n,s,i,a,c,l;return r(this,function(r){switch(r.label){case 0:_e(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),Ee.scopeId?(n=m.getState().backwardCompatibility,s=n?{scope_id:Ee.scopeId,scope_name:t}:{scope_id:Ee.scopeId,scope_type:"Custom",scope_name:t,application_mapping_id:de},[4,E(s,oe.accessToken)]):[2];case 2:return r.sent(),[4,ft(!0)];case 3:return r.sent(),Ie(function(t){return e(e({},t),{isOpen:!1})}),[3,6];case 4:throw i=r.sent(),console.error("An error occurred during scope rename.",i),null===(a=Ye.current)||void 0===a||a.show({severity:"error",sticky:!1,className:v.errorToast,content:o(V,{message:(null===(l=null===(c=null==i?void 0:i.response)||void 0===c?void 0:c.data)||void 0===l?void 0:l.message)||"There was an error renaming the scope. Please try again."})}),i;case 5:return _e(!1),[7];case 6:return[2]}})})},initialName:Ee.initialName})]}),o(j,{isOpen:Ee.isOpen&&"DELETE"===Ee.type,onCancel:function(){return Ie(e(e({},Ee),{isOpen:!1}))},onConfirm:function(){return vt(Ee.scopeId,Ee.initialName,Ee.isSubscope)},title:"Delete Scope",description:s(i,{children:["Deleting ",o("span",e({className:v.highlight},{children:Ee.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:Ne})]}))})}export{$ as default};
1
+ import{__assign as e,__spreadArray as t,__awaiter as n,__generator as r}from"tslib";import{jsx as o,jsxs as s,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as c,useEffect as l}from"react";import{BookOpen as u,Users as d,History as p}from"lucide-react";import{useLearningTemplateStore as m}from"./store/useLearningTemplateStore.js";import{Toast as f}from"primereact/toast";import v from"./styles/LearningTemplateManagement.module.css.js";import g from"./LearningTemplateLayout.js";import h from"./components/EmptyLearningState.js";import S from"./store/useAuthStore.js";import{fetchTiers as y,getILInstance as b,fetchScopes as C,inheritScope as T,inheritScopeBackwardCompatible as A,createRuleSet as L,renameScope as E,deleteRuleSet as I,requestAccess as R}from"./apis/scopeApis.js";import{QUERY_PARAM_KEYS as w,setQueryParams as O}from"./hooks/useLearningTemplateQueryParams.js";import j from"./components/ConfirmationModal.js";import N from"./components/LearningTemplateManagementSkeleton.js";import{findNodeById as _,findNodePathById as D}from"./utils/treeUtils.js";import k from"./store/useEnvStore.js";import{useConfigStore as M}from"./store/useConfigStore.js";import{TooltipProvider as B}from"./components/ToolTip.js";import P from"./components/CreateRuleSetLegacyModal.js";import{usePermissionsStore as q}from"./store/usePermissionsStore.js";import{useAppSecRolesStore as U}from"./store/useAppSecRolesStore.js";import{useGetAppSecRolesQuery as G}from"./queries/useApprovalQueries.js";import{useLMSConfigQuery as F}from"./queries/useLMSConfigQuery.js";import x from"./RuleContent/AddScopeModal.js";import H from"./components/RuleContentSkeleton.js";import Q from"./components/ErrorStateDisplay.js";import{useLocation as z}from"react-router-dom";import K from"./shared/SuccessToastContent.js";import V from"./shared/ErrorToastContent.js";import W from"./RuleContent/RenameScopeModal.js";import{dt as Y}from"./store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as J,MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH as X,EMPTY_STATE_DT_PATH as Z}from"./constants.js";function $($){var ee,te,ne,re=this,oe=$.userDetails,se=$.llmStudioUrl,ie=$.audacyBackendUrl,ae=$.ilLabels,ce=$.config,le=$.rbacConfig,ue=$.auditLogConfig,de=$.app_integration_id,pe=$.backwardCompatibility,me=void 0!==pe&&pe,fe=$.cognitiveCompareCompatibility,ve=void 0!==fe&&fe,ge=$.modeId,he=$.modeDetails;m(function(e){return e.selectedRuleSetId});var Se=m(function(e){return e.setSelectedRuleSetId}),ye=m(function(e){return e.error}),be=m(function(e){return e.setError}),Ce=m(function(e){return e.setStations}),Te=m(function(e){return e.scopeTreeData}),Ae=m(function(e){return e.setScopeTreeData}),Le=a({isOpen:!1,type:"GLOBAL"}),Ee=Le[0],Ie=Le[1],Re=a(!1),we=Re[0],Oe=Re[1],je=a(!1),Ne=je[0],_e=je[1],De=a("learnings"),ke=De[0],Me=De[1],Be=a(null),Pe=Be[0],qe=Be[1],Ue=a(null),Ge=Ue[0];Ue[1];var Fe=a(!1),xe=Fe[0],He=Fe[1],Qe=a(!1),ze=Qe[0],Ke=Qe[1];c(null);var Ve=c(null),We=c(!1),Ye=c(null),Je=S();Je.user;var Xe=Je.setUser,Ze=M(),$e=Ze.setConfig,et=Ze.setIlLabels,tt=function(){try{return z()}catch(e){return{search:""}}}();l(function(){if(!We.current){var e=new URLSearchParams(window.location.search),t=e.get(w.RULESET_ID),n=e.get(w.SECTION),r=n&&Lt.has(n)?n:"learnings";(null==t?void 0:t.length)&&Se&&Me&&(Se(t),Me(r),We.current=!0)}},[null==tt?void 0:tt.search,Me,Se]);var nt=q(function(e){return e.fetchPermissions}),rt=q(function(e){return e.hasPermission}),ot=U(function(e){return e.setRoles}),st=k(function(e){return e.appsecRbacUrl})===le.appsecRbacUrl,it=G(le.applicationId,st).data,at=F(null!=de?de:"",me),ct=at.isLoading,lt=at.isError,ut=at.refetch;at.isSuccess;var dt=a(0),pt=dt[0],mt=dt[1];l(function(){if(!me&&de&&se){n(re,void 0,void 0,function(){var e,t,n,o,s,i;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,b(de)];case 1:return e=r.sent(),"number"==typeof(t=null===(i=null===(s=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.learningManagement)||void 0===s?void 0:s.scopeAndHierarchy)||void 0===i?void 0:i.maxHierarchyLevels)&&t>0&&mt(t-1),[3,3];case 2:return n=r.sent(),console.error("Failed to fetch IL instance for hierarchy levels:",n),[3,3];case 3:return[2]}})})}},[de,se]),l(function(){it&&ot(it.map(function(e){return{_id:e._id,name:e.name}}))},[it,ot]),l(function(){var e;console.log("userDetails",oe),Xe(oe),console.log("llmStudioUrl",se),console.log("audacyBackendUrl",ie),k.getState().setLlmStudioUrl(se),k.getState().setAudacyBackendUrl(ie),k.getState().setRbacConfig(le),k.getState().setAuditLogConfig(ue),k.getState().setBaseModeName((null==he?void 0:he.modeNameFromURL)||null),$e(ce),et(ae),m.getState().setAppIntegrationId(null!=de?de:null),m.getState().setBackwardCompatibility(me),m.getState().setCognitiveCompareCompatibility(null!=ve&&ve),m.getState().setToken(null!==(e=null==oe?void 0:oe.accessToken)&&void 0!==e?e:null)},[oe,Xe,se,ie,le,ue,ce,$e,ae,et,de,me,ve,he]),l(function(){(null==oe?void 0:oe.accessToken)&&se&&y()},[de,null==oe?void 0:oe.accessToken,se]);var ft=function(t){return void 0===t&&(t=!0),n(re,void 0,void 0,function(){var n,o,s,i,a,c,l,u,d,p;return r(this,function(r){switch(r.label){case 0:t&&Oe(!0),be(null),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,nt(le.applicationId)];case 2:return r.sent(),n=function(t){var r=q.getState().hasPermission("ilotj.scope.view",t.id),o=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return r||0!==o.length?e(e({},t),{hasAccess:r,children:o}):null},[4,C(de,oe.accessToken)];case 3:return(o=r.sent())&&o.data&&o.data.data&&(s=o.data.data,Array.isArray(s)&&(s=s.length>0?s[0]:null),s?(i=n(s))?(qe(null),Ae({data:i}),Ve.current?(Se(Ve.current),Me("learnings"),Ve.current=null):(a=m.getState().selectedRuleSetId,c=a?_(i,a):null,a&&c||(l=function(e){if(e.hasAccess)return e;for(var t=0,n=e.children||[];t<n.length;t++){var r=n[t],o=l(r);if(o)return o}return null},u=l(i),Se(u?u.id:i.id)))):(qe(null!==(p=s.id)&&void 0!==p?p:null),Ae(null)):(qe(null),Ae(null))),[3,6];case 4:return d=r.sent(),console.error("Failed to fetch rule sets or permissions",d),be("Failed to load data. Please try again later."),[3,6];case 5:return Oe(!1),[7];case 6:return[2]}})})};l(function(){var e;(null===(e=null==oe?void 0:oe.accessToken)||void 0===e?void 0:e.length)&&st?ft(!0):console.warn("Error: Trying to fetch rules without access token",oe)},[null==oe?void 0:oe.accessToken,be,Ce,le.applicationId,st]);var vt=function(t,o,s){return n(re,void 0,void 0,function(){var n,o,s,i,a,c,l,u;return r(this,function(r){switch(r.label){case 0:_e(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,I(t,oe.accessToken)];case 2:return r.sent(),m.getState().selectedRuleSetId===t&&(n=m.getState().scopeTreeData,(o=D((null==n?void 0:n.data)||null,t))&&o.length>1&&(s=o[o.length-2],Se(s),Me("learnings"))),[4,ft(!0)];case 3:return r.sent(),Ie(function(t){return e(e({},t),{isOpen:!1})}),null===(a=Ye.current)||void 0===a||a.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return i=r.sent(),console.error("An error occurred during scope deletion.",i),null===(c=Ye.current)||void 0===c||c.show({severity:"error",summary:"Delete Failed",detail:(null===(u=null===(l=null==i?void 0:i.response)||void 0===l?void 0:l.data)||void 0===u?void 0:u.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return _e(!1),[7];case 6:return[2]}})})},gt=function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),O(((n={})[w.SECTION]="learnings"===t?null:t,n[w.RULESET_ID]=e,n)),Me(t),Se(e),Ke(!1)},ht=Te,St=Ge?{data:{id:Ge.stationId,name:Ge.stationName,type:"STATION",metrics:{learningsCount:Ge.learningsCount,stationsCount:0},children:[]}}:ht,yt=!!(null==St?void 0:St.data);null===(ee=null==St?void 0:St.data)||void 0===ee||ee.type;var bt=q(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",le.applicationResourceId||""),Ct=function(e){return n(re,void 0,void 0,function(){var t,n,s,i,a,c,l,u,d;return r(this,function(r){switch(r.label){case 0:if(!(t="string"==typeof e?e:(null===(i=null===(s=m.getState().scopeTreeData)||void 0===s?void 0:s.data)||void 0===i?void 0:i.id)||Pe))return null===(a=Ye.current)||void 0===a||a.show({severity:"error",sticky:!1,className:v.errorToast,content:o(V,{message:"Unable to identify the global scope for this access request."})}),[2];He(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,R(t)];case 2:return r.sent(),Ke(!0),null===(c=Ye.current)||void 0===c||c.show({severity:"success",sticky:!1,life:3e3,className:v.successToast,content:o(K,{message:"Access request submitted successfully!"})}),[3,5];case 3:return n=r.sent(),null===(l=Ye.current)||void 0===l||l.show({severity:"error",sticky:!1,className:v.errorToast,content:o(V,{message:(null===(d=null===(u=null==n?void 0:n.response)||void 0===u?void 0:u.data)||void 0===d?void 0:d.detail)||"Failed to request access. Please try again."})}),[3,5];case 4:return He(!1),[7];case 5:return[2]}})})};if(ct)return o("div",e({className:v.learningManagementContainer},{children:o(H,{})}));if(lt)return o("div",e({className:v.learningManagementContainer},{children:o(Q,{errorMessage:"Failed to load configuration. Please try again.",onRetry:function(){return ut()},title:"Error Loading Configuration"})}));var Tt=t(t([{type:"GLOBAL",label:"Global",addChildLabel:"".concat(Y("".concat(J,".addScope"),"Add Scope")),addChildType:"SCOPE"}],Array.from({length:pt},function(){return e({type:"SCOPE",label:Y("".concat(J,".scope"),"Scope")},!me&&{addChildLabel:Y("".concat(X,".addSubScope"),"Add Subscope"),addChildType:"SUBSCOPE"})}),!0),me?[]:[{type:"SUBSCOPE",label:Y("".concat(J,".subScope"),"Subscope")}],!0),At=[{id:"learnings",label:Y("".concat(J,".treeMenu.submenu.learnings"),"Learnings"),icon:u,badgeKey:"learningsCount"},{id:"access",label:Y("".concat(J,".treeMenu.submenu.access"),"Access"),icon:d},{id:"history",label:Y("".concat(J,".treeMenu.submenu.changeHistory"),"Change History"),icon:p}],Lt=new Set(At.map(function(e){return e.id})),Et=Ge?At.filter(function(e){return"stations"!==e.id}):At;return o(B,{children:s("div",e({className:v.learningManagementContainer},{children:[o("div",e({className:v.mainWrapper},{children:we?o(N,{}):ye?s("div",e({className:v.errorContainer},{children:[o("div",e({className:v.errorTitle},{children:"Error Loading Data"})),o("p",e({className:v.errorDesc},{children:ye})),o("button",e({onClick:function(){return ft(!0)},className:v.tryAgainBtn},{children:"Try Again"}))]})):yt?o(g,{onOpenCreateModal:function(){return Ie({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return Ie({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return Ie({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(e,t,o){return n(re,void 0,void 0,function(){var n,s,i;return r(this,function(r){switch(r.label){case 0:return n=m.getState().scopeTreeData,s=D((null==n?void 0:n.data)||null,e),i=!!s&&3===s.length,0!==o?[3,2]:[4,vt(e)];case 1:return r.sent(),[3,3];case 2:Ie({isOpen:!0,type:"DELETE",scopeId:e,initialName:t,isSubscope:i}),r.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return rt("ilotj.scope.delete",e)},canEditScope:function(e){return rt("ilotj.scope.edit",e)},canCreateScope:function(e){return rt("ilotj.scope.create",e)},onSectionSelect:gt,activeSectionId:ke,scopeTreeData:St,sectionsConfig:Et,onViewStation:function(e){gt(e.stationId,"learnings")},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(Ve.current=t),ft(e)},nodeTypesConfig:Tt,app_integration_id:de,token:oe.accessToken,modeId:ge,onRequestAccess:Ct,isRequestingAccess:xe,isAccessRequested:ze}):o(h,{onCreate:function(){return Ie({isOpen:!0,type:"GLOBAL"})},title:Y("".concat(Z,".title"),"No Global Scope has been added!"),desc:Y("".concat(Z,".desc"),"Start by creating a Global scope to define base learnings that apply across all stations."),button:Y("".concat(Z,".createGlobalScope"),"Create Global Scope"),canCreateRule:bt,noAccessTitle:Y("".concat(Z,".noAccessTitle"),"Access Restricted"),noAccessDesc:Y("".concat(Z,".noAccessDesc"),"You do not have access for this application."),requestAccessButton:Y("".concat(Z,".requestAccessButton"),"Request Access"),requestSentButton:Y("".concat(Z,".requestSentButton"),"Request Sent"),onRequestAccess:Ct,isRequestingAccess:xe,isAccessRequested:ze})})),o(f,{ref:Ye,pt:{root:{style:{zIndex:9999}}}}),me&&Ee.isOpen&&"DELETE"!==Ee.type&&"RENAME"!==Ee.type?o(P,{isOpen:!0,onClose:function(){return Ie(e(e({},Ee),{isOpen:!1}))},onSubmit:function(t){return n(re,void 0,void 0,function(){var n,o,s,i,a,c,l,u,d,p,f,v,g,h,S,y,b,C,E,I;return r(this,function(r){switch(r.label){case 0:_e(!0),n=m.getState().backwardCompatibility,r.label=1;case 1:return r.trys.push([1,12,13,14]),o=void 0,n&&"object"==typeof t?o=t:(s=t,i="SCOPE"===Ee.type&&Ee.parentId,a=i?"genreRuleSet":Ee.type,o={topic:a,scope_reference_id:null,scopeDescription:"demo",parentScopeId:Ee.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:de}),[4,L(o,oe.accessToken)];case 2:if(c=r.sent(),!(l=null===(h=null==c?void 0:c.data)||void 0===h?void 0:h.scopeId))return[3,10];if(Ve.current=l,u=n&&(null===(S=o.topic)||void 0===S?void 0:S.toLowerCase().includes("genre")),d=!n&&"GLOBAL"!==Ee.type&&Ee.parentId,!u&&!d)return[3,10];if(!(p=n?null===(b=null===(y=m.getState().scopeTreeData)||void 0===y?void 0:y.data)||void 0===b?void 0:b.id:Ee.parentId))return[3,10];if(!me)return[3,7];r.label=3;case 3:return r.trys.push([3,5,,6]),[4,A({source_scope_id:p,target_scope_id:l})];case 4:return r.sent(),[3,6];case 5:return f=r.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return r.trys.push([7,9,,10]),[4,T({source_scope_id:p,target_scope_id:l,application_mapping_id:de||"",is_copy_parent_variant_id:!1})];case 8:return r.sent(),[3,10];case 9:return v=r.sent(),console.error("Failed to inherit rules for the new scope:",v),[3,10];case 10:return[4,ft(!0)];case 11:return r.sent(),Ie(function(t){return e(e({},t),{isOpen:!1})}),[3,14];case 12:throw g=r.sent(),console.error("An error occurred during scope creation.",g),null===(C=Ye.current)||void 0===C||C.show({severity:"error",summary:"Creation Failed",detail:(null===(I=null===(E=null==g?void 0:g.response)||void 0===E?void 0:E.data)||void 0===I?void 0:I.message)||"There was an error creating the scope. Please try again."}),g;case 13:return _e(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:yt,canCreateGlobal:bt,globalScopeId:null!==(ne=null===(te=null==Te?void 0:Te.data)||void 0===te?void 0:te.id)&&void 0!==ne?ne:null}):s(i,{children:[o(x,{isOpen:Ee.isOpen&&"DELETE"!==Ee.type&&"RENAME"!==Ee.type,onClose:function(){return Ie(e(e({},Ee),{isOpen:!1}))},onCreate:function(e){e&&(Ve.current=e),ft(!0)},hasGlobalRuleSet:yt,parentId:Ee.parentId}),o(W,{isOpen:Ee.isOpen&&"RENAME"===Ee.type,onClose:function(){return Ie(e(e({},Ee),{isOpen:!1}))},onSave:function(t){return n(re,void 0,void 0,function(){var n,s,i,a,c,l;return r(this,function(r){switch(r.label){case 0:_e(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),Ee.scopeId?(n=m.getState().backwardCompatibility,s=n?{scope_id:Ee.scopeId,scope_name:t}:{scope_id:Ee.scopeId,scope_type:"Custom",scope_name:t,application_mapping_id:de},[4,E(s,oe.accessToken)]):[2];case 2:return r.sent(),[4,ft(!0)];case 3:return r.sent(),Ie(function(t){return e(e({},t),{isOpen:!1})}),[3,6];case 4:throw i=r.sent(),console.error("An error occurred during scope rename.",i),null===(a=Ye.current)||void 0===a||a.show({severity:"error",sticky:!1,className:v.errorToast,content:o(V,{message:(null===(l=null===(c=null==i?void 0:i.response)||void 0===c?void 0:c.data)||void 0===l?void 0:l.message)||"There was an error renaming the scope. Please try again."})}),i;case 5:return _e(!1),[7];case 6:return[2]}})})},initialName:Ee.initialName})]}),o(j,{isOpen:Ee.isOpen&&"DELETE"===Ee.type,onCancel:function(){return Ie(e(e({},Ee),{isOpen:!1}))},onConfirm:function(){return vt(Ee.scopeId,Ee.initialName,Ee.isSubscope)},title:"Delete Scope",description:s(i,{children:["Deleting ",o("span",e({className:v.highlight},{children:Ee.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:Ne})]}))})}export{$ as default};
2
2
  //# sourceMappingURL=LearningManagement.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useEffect as t}from"react";import i from"./RuleContent/RuleContent.js";import r from"./StationsContent/StationsContent.js";import a from"./RBAC/AccessManagementPanel.js";import"appsec-ui";import"./store/useAuthStore.js";import"./store/usePermissionsStore.js";import s from"./store/useEnvStore.js";import d from"./styles/LearningTemplateLayout.module.css.js";import{findNodeById as l,mapScopeChildrenToStations as c}from"./utils/treeUtils.js";import u from"./SidebarWrapper.js";import{useLearningTemplateStore as p}from"./store/useLearningTemplateStore.js";import m from"./components/StationOnboarding/StationOnboardModal.js";import f from"./AuditLog/AuditLog.js";var S=function(S){var g,v,C=S.onOpenCreateModal,h=S.onRefreshRuleSets,R=S.scopeTreeData,j=S.onAddChild,I=S.onRenameChild,A=S.onDeleteChild,D=S.canDeleteScope,M=S.canEditScope,O=S.canCreateScope,T=S.onSectionSelect,w=S.onViewStation,b=S.activeSectionId,k=void 0===b?"learnings":b,y=S.sectionsConfig,L=S.nodeTypesConfig,_=S.app_integration_id,N=S.token,U=S.modeId,x=p(function(e){return e.isStationModalOpen}),B=p(function(e){return e.setStationModalOpen}),E=p(function(e){return e.isStationOnboardModalTriggered}),P=p(function(e){return e.setIsStationOnboardModalTriggered}),V=p(function(e){return e.selectedRuleSetId}),F=p(function(e){return e.rawAuditRuleData}),W=s(function(e){return e.auditLogConfig});p(function(e){return e.ruleData});var q=V?l((null==R?void 0:R.data)||null,V):null;return Boolean((null===(g=null==R?void 0:R.data)||void 0===g?void 0:g.id)&&V===R.data.id),t(function(){E&&B(!0)},[E,B,P]),o("div",e({className:d.container},{children:[n(u,{onOpenCreateModal:C,onRefreshRuleSets:h,scopeTreeData:R,onAddChild:j,onRenameChild:I,onDeleteChild:A,canDeleteScope:D,canEditScope:M,canCreateScope:O,onSectionSelect:T,activeSectionId:k,sectionsConfig:y,nodeTypesConfig:L}),n("div",e({id:"rule-template-layout-content",className:"".concat(d.content," relative flex-1 overflow-hidden")},{children:"stations"===k?n(r,{scopeId:V||"",scopeName:(null==q?void 0:q.name)||"Unknown Scope",stationsCount:null===(v=null==q?void 0:q.metrics)||void 0===v?void 0:v.stationsCount,stations:c(q),onViewStation:w}):"access"===k?n(a,{selectedRuleSetId:V,scopeName:(null==q?void 0:q.name)||"Unknown Scope",useApplicationModuleForScopeAccess:!1}):"history"===k?(null==W?void 0:W.configId)?n(f,{configId:W.configId,scopeId:V||void 0,scopeName:(null==q?void 0:q.name)||"Unknown Scope",ruleData:F}):null:n(i,{onRefreshRuleSets:h,app_integration_id:_,token:N,modeId:U})})),n(m,{isOpen:x,onClose:function(){B(!1),P(!1)},onBoardStation:function(e){h(!0,e)},app_integration_id:_,token:N})]}))};export{S as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useEffect as n}from"react";import s from"./RuleContent/RuleContent.js";import i from"./StationsContent/StationsContent.js";import c from"./RBAC/AccessManagementPanel.js";import"appsec-ui";import"./store/useAuthStore.js";import"./store/usePermissionsStore.js";import a from"./store/useEnvStore.js";import r from"./styles/LearningTemplateLayout.module.css.js";import{findNodeById as l,mapScopeChildrenToStations as u}from"./utils/treeUtils.js";import d from"./SidebarWrapper.js";import{useLearningTemplateStore as p}from"./store/useLearningTemplateStore.js";import m from"./components/StationOnboarding/StationOnboardModal.js";import f from"./AuditLog/AuditLog.js";import S from"./components/EmptyLearningState.js";import{dt as v}from"./store/useLMSConfigStore.js";import{EMPTY_STATE_DT_PATH as g}from"./constants.js";var A=function(A){var C,R,h=A.onOpenCreateModal,j=A.onRefreshRuleSets,q=A.scopeTreeData,D=A.onAddChild,I=A.onRenameChild,T=A.onDeleteChild,M=A.canDeleteScope,w=A.canEditScope,O=A.canCreateScope,L=A.onSectionSelect,b=A.onViewStation,y=A.activeSectionId,B=void 0===y?"learnings":y,k=A.sectionsConfig,_=A.nodeTypesConfig,N=A.app_integration_id,E=A.token,U=A.modeId,x=A.onRequestAccess,P=A.isRequestingAccess,V=A.isAccessRequested,Y=p(function(e){return e.isStationModalOpen}),F=p(function(e){return e.setStationModalOpen}),W=p(function(e){return e.isStationOnboardModalTriggered}),z=p(function(e){return e.setIsStationOnboardModalTriggered}),G=p(function(e){return e.selectedRuleSetId}),H=p(function(e){return e.rawAuditRuleData}),J=a(function(e){return e.auditLogConfig});p(function(e){return e.ruleData});var K=G?l((null==q?void 0:q.data)||null,G):null;return Boolean((null===(C=null==q?void 0:q.data)||void 0===C?void 0:C.id)&&G===q.data.id),n(function(){W&&F(!0)},[W,F,z]),t("div",e({className:r.container},{children:[o(d,{onOpenCreateModal:h,onRefreshRuleSets:j,scopeTreeData:q,onAddChild:D,onRenameChild:I,onDeleteChild:T,canDeleteScope:M,canEditScope:w,canCreateScope:O,onSectionSelect:L,activeSectionId:B,sectionsConfig:k,nodeTypesConfig:_}),o("div",e({id:"rule-template-layout-content",className:"".concat(r.content," relative flex-1 overflow-hidden")},{children:"stations"===B?o(i,{scopeId:G||"",scopeName:(null==K?void 0:K.name)||"Unknown Scope",stationsCount:null===(R=null==K?void 0:K.metrics)||void 0===R?void 0:R.stationsCount,stations:u(K),onViewStation:b}):"access"===B?o(c,{selectedRuleSetId:G,scopeName:(null==K?void 0:K.name)||"Unknown Scope",useApplicationModuleForScopeAccess:!1}):"history"===B?(null==J?void 0:J.configId)?o(f,{configId:J.configId,scopeId:G||void 0,scopeName:(null==K?void 0:K.name)||"Unknown Scope",ruleData:H}):null:K&&!1===K.hasAccess?o(S,{onCreate:function(){},title:v("".concat(g,".noAccessTitle"),"Access Restricted"),desc:v("".concat(g,".noAccessDesc"),"You do not have access to view this ".concat(null==K?void 0:K.name," learnings.")),button:"",canCreateRule:!1,noAccessTitle:v("".concat(g,".noAccessTitle"),"Access Restricted"),noAccessDesc:v("".concat(g,".noAccessDesc"),"You do not have access to view this ".concat(null==K?void 0:K.name," learnings.")),requestAccessButton:v("".concat(g,".requestAccessButton"),"Request Access"),requestSentButton:v("".concat(g,".requestSentButton"),"Request Sent"),onRequestAccess:function(){return null==x?void 0:x(G)},isRequestingAccess:P,isAccessRequested:V}):o(s,{onRefreshRuleSets:j,app_integration_id:N,token:E,modeId:U})})),o(m,{isOpen:Y,onClose:function(){F(!1),z(!1)},onBoardStation:function(e){j(!0,e)},app_integration_id:N,token:E})]}))};export{A as default};
2
2
  //# sourceMappingURL=LearningTemplateLayout.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as o,Fragment as t,jsx as a}from"react/jsx-runtime";import{useState as n}from"react";import{Plus as r}from"lucide-react";import c from"./styles/Sidebar.module.css.js";import i from"./components/SidebarSearch.js";import{TreeSidebar as s}from"./components/ScopeTree/TreeSidebar.js";import{dt as d}from"./store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as l}from"./constants.js";import{useLearningTemplateStore as m}from"./store/useLearningTemplateStore.js";var p=function(p){var S=p.scopeTreeData,h=p.selectedRuleSetId,C=p.onAddChild,f=p.onRenameChild,u=p.onDeleteChild,v=p.canDeleteScope,b=p.canEditScope,g=p.canCreateScope,j=p.onSectionSelect,T=p.activeSectionId,y=p.onOnboardStation,D=p.sectionsConfig,N=p.nodeTypesConfig,I=p.searchPlaceholder,R=void 0===I?d("".concat(l,".treeMenu.search"),"Search for Scopes.."):I,k=n(""),x=k[0],A=k[1],B=n(0),E=B[0],L=B[1],M=m.getState().backwardCompatibility;return o("div",e({className:c.sidebar},{children:[o(t,{children:[a(i,{value:x,onChange:A,placeholder:R,searchCount:E}),a("div",{className:c.divider}),a("div",e({className:c.content},{children:S&&a(s,{data:S.data,onAddChild:C,onRenameChild:f,onDeleteChild:u,canDeleteScope:v,canEditScope:b,canCreateScope:g,onSectionSelect:j,selectedRuleSetId:h,activeSectionId:T,searchQuery:x,onSearchCountChange:L,sectionsConfig:D,nodeTypesConfig:N})}))]}),y&&M&&a("div",e({className:c.createButtonContainer},{children:o("button",e({className:c.createButton,onClick:y},{children:[a(r,{size:16}),"Onboard a station"]}))}))]}))};export{p as default};
1
+ import{__assign as e}from"tslib";import{jsx as o,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as a}from"react";import n from"./styles/Sidebar.module.css.js";import c from"./components/SidebarSearch.js";import{TreeSidebar as i}from"./components/ScopeTree/TreeSidebar.js";import{dt as s}from"./store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as d}from"./constants.js";import{useLearningTemplateStore as l}from"./store/useLearningTemplateStore.js";var m=function(m){var S=m.scopeTreeData,p=m.selectedRuleSetId,h=m.onAddChild,C=m.onRenameChild,f=m.onDeleteChild,u=m.canDeleteScope,v=m.canEditScope,g=m.canCreateScope,b=m.onSectionSelect,j=m.activeSectionId;m.onOnboardStation;var T=m.sectionsConfig,y=m.nodeTypesConfig,D=m.searchPlaceholder,I=void 0===D?s("".concat(d,".treeMenu.search"),"Search for Scopes.."):D,R=a(""),N=R[0],x=R[1],A=a(0),E=A[0],L=A[1];return l.getState().backwardCompatibility,o("div",e({className:n.sidebar},{children:t(r,{children:[o(c,{value:N,onChange:x,placeholder:I,searchCount:E}),o("div",{className:n.divider}),o("div",e({className:n.content},{children:S&&o(i,{data:S.data,onAddChild:h,onRenameChild:C,onDeleteChild:f,canDeleteScope:u,canEditScope:v,canCreateScope:g,onSectionSelect:b,selectedRuleSetId:p,activeSectionId:j,searchQuery:N,onSearchCountChange:L,sectionsConfig:T,nodeTypesConfig:y})}))]})}))};export{m as default};
2
2
  //# sourceMappingURL=Sidebar.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e,__assign as o}from"tslib";import{jsxs as n,jsx as i,Fragment as t}from"react/jsx-runtime";import{useRef as l,useEffect as d}from"react";import{Plus as r,Pencil as a,Trash2 as c,MoveRight as s}from"lucide-react";import p from"../../styles/ScopeTree.module.css.js";import{TreeNodeHeader as u}from"./TreeNodeHeader.js";import{TreeAddAction as m}from"./TreeAddAction.js";import{dt as h,interpolate as v}from"../../store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as f,MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH as C}from"../../constants.js";import{useLearningTemplateStore as g}from"../../store/useLearningTemplateStore.js";import{TreeSectionItem as b}from"./TreeSectionItem.js";var y=function(S){var L,x,w,T,N,k=S.node,A=S.depth,D=void 0===A?0:A,V=S.nodePath,j=void 0===V?[]:V,E=S.expandedNodeIds,I=S.activeSelection,P=S.onToggleExpand,O=S.onSectionSelect,Y=S.onNodeOptionsClick,Q=S.onAddChild,R=S.onRenameChild,H=S.onDeleteChild,K=S.canDeleteScope,M=S.canEditScope,W=S.canCreateScope,z=S.searchQuery,J=S.sectionsConfig,q=void 0===J?[]:J,B=S.nodeTypesConfig,F=void 0===B?[]:B,G=S.forceVisible,U=void 0!==G&&G,X=S.compactView,Z=void 0!==X&&X,$=e(e([],j,!0),[k.id],!1),_=E.has(k.id),ee=g.getState().backwardCompatibility,oe=ee||Z,ne=h("".concat(f,".scope")),ie=!!I&&I.nodePath[I.nodePath.length-1]===k.id,te=!!I&&(I.nodePath.includes(k.id)&&!ie),le=h("".concat(f,".scopeDisplayLimit.applyToLevels"),""),de=function(){if(ee)return[2];if(!le)return null;try{var e=JSON.parse(le);return Array.isArray(e)?e.map(Number):null}catch(e){return null}}(),re=D+1,ae=null===de||de.includes(re),ce=(ee||"true"===h("".concat(f,".scopeDisplayLimit.enabled"),"false"))&&ae,se=ee?7:parseInt(h("".concat(f,".scopeDisplayLimit.count"),"7"),10)||7,pe=k.children||[],ue=ce&&!z&&pe.length>se,me=l(null);d(function(){ie&&me.current&&me.current.scrollIntoView({behavior:"smooth",block:"nearest"})},[ie]);var he=function(e,o){if(!o)return!0;var n=o.toLowerCase();return!!e.name.toLowerCase().includes(n)||!!e.children&&e.children.some(function(e){return he(e,o)})};if(!U&&!he(k,z||""))return null;var ve=D>=F.length-1?F[F.length-1]:F[D],fe=!!(null==ve?void 0:ve.addChildType),Ce=oe?q.filter(function(e){return"learnings"!==e.id&&"stations"!==e.id}).filter(function(e){return!e.isVisible||e.isVisible(k,D)}).map(function(e){return{label:e.label,icon:e.icon,onClick:function(){return O($,e.id)}}}):[],ge=!K||K(k.id),be=!M||M(k.id),ye=!W||W(k.id),Se=k.children&&k.children.length>0,Le=!ge||Se,xe=ge?Se?"This scope cannot be deleted because other scopes inherit learnings from it.":void 0:"You do not have permission to delete this scope.",we=ye?void 0:"You do not have permission to add a scope here.",Te=!z||k.name.toLowerCase().includes(z.toLowerCase()),Ne=function(e){return i(y,{node:e,depth:D+1,nodePath:$,expandedNodeIds:E,activeSelection:I,onToggleExpand:P,onSectionSelect:O,onNodeOptionsClick:Y,onAddChild:Q,onRenameChild:R,onDeleteChild:H,canDeleteScope:K,canEditScope:M,canCreateScope:W,searchQuery:z,forceVisible:Te,sectionsConfig:q,nodeTypesConfig:F,compactView:oe},e.id)};return n("div",o({ref:me,className:p.nodeWrapper,style:{"--tree-depth":D}},{children:[i(u,{nodeType:k.type,name:k.name,isExpanded:_,isSelected:ie,isAncestor:te,isExpandable:!!Se,childrenCount:null===(L=k.children)||void 0===L?void 0:L.length,learningsCount:oe?null===(x=k.metrics)||void 0===x?void 0:x.learningsCount:void 0,isCompactView:oe,onToggleExpand:function(e){e.stopPropagation(),P(k.id)},onClick:function(){O($,"learnings")},searchQuery:z,menuOptions:e(e(e([],fe&&"station"!==(null===(w=null==k?void 0:k.type)||void 0===w?void 0:w.toLowerCase())?[{label:ve.addChildLabel||"Add Child",icon:r,onClick:function(){return null==Q?void 0:Q(k.id,ve.addChildType,k.name)},disabled:!ye,tooltip:we}]:[],!0),[{label:"".concat(h("".concat(C,".rename"),"Rename")),icon:a,onClick:function(){return null==R?void 0:R(k.id,k.name)},disabled:!be||"station"===(null===(T=null==k?void 0:k.type)||void 0===T?void 0:T.toLocaleLowerCase()),tooltip:be?void 0:"You do not have permission to rename this scope."},{label:"station"===(null===(N=null==k?void 0:k.type)||void 0===N?void 0:N.toLowerCase())?"Delete Station":ee?"Delete Scope":"".concat(h("".concat(C,".delete"),"Delete ".concat((null==ve?void 0:ve.label)||"Node"),{scope:ne})),icon:c,onClick:function(){var e;return null==H?void 0:H(k.id,k.name,(null===(e=k.metrics)||void 0===e?void 0:e.learningsCount)||0)},disabled:Le,tooltip:xe,className:"text-red-500 hover:text-red-600 hover:bg-red-50"}],!1),Ce,!0)}),_&&n("div",o({className:p.childrenWrapper},{children:[!oe&&q.filter(function(e){return!e.isVisible||e.isVisible(k,D)}).map(function(e){var o;return i(b,{icon:e.icon,label:e.label,badgeCount:e.badgeKey?null===(o=k.metrics)||void 0===o?void 0:o[e.badgeKey]:void 0,isActive:ie&&(null==I?void 0:I.sectionId)===e.id,onClick:function(){return O($,e.id)}},"".concat(k.id,"-").concat(e.id))}),ue?n(t,{children:[i("div",o({className:p.scopeScrollContainer,style:{maxHeight:"calc(var(--scope-row-height, 40px) * ".concat(se,")"),overflowY:"scroll"}},{children:pe.map(Ne)})),i("button",o({type:"button",className:p.addAction,onClick:function(e){e.stopPropagation(),O($,"stations")}},{children:i("span",o({style:{paddingLeft:"15px"}},{children:n("span",o({style:{paddingLeft:"15px",display:"flex",alignItems:"center"}},{children:[v(h("".concat(f,".scopeDisplayLimit.viewMoreText"),ee?"View all {count} stations":"Show all {count} scopes"),{count:pe.length}),i(s,{size:14,style:{marginLeft:"6px",flexShrink:0}})]}))}))}))]}):pe.map(Ne),fe&&!oe&&i(m,{label:ve.addChildLabel||"Add Child",onAdd:function(){return null==Q?void 0:Q(k.id,ve.addChildType,k.name)},disabled:!ye,tooltip:we})]}))]}))};export{y as TreeNode};
1
+ import{__spreadArray as e,__assign as o}from"tslib";import{jsxs as n,jsx as i,Fragment as t}from"react/jsx-runtime";import{useRef as l,useEffect as d}from"react";import{Plus as r,Pencil as a,Trash2 as c,MoveRight as s}from"lucide-react";import p from"../../styles/ScopeTree.module.css.js";import{TreeNodeHeader as u}from"./TreeNodeHeader.js";import{TreeAddAction as m}from"./TreeAddAction.js";import{dt as h,interpolate as v}from"../../store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as f,MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH as C}from"../../constants.js";import{useLearningTemplateStore as g}from"../../store/useLearningTemplateStore.js";import{TreeSectionItem as b}from"./TreeSectionItem.js";var y=function(S){var L,x,w,T,A,N=S.node,k=S.depth,D=void 0===k?0:k,V=S.nodePath,j=void 0===V?[]:V,E=S.expandedNodeIds,I=S.activeSelection,P=S.onToggleExpand,O=S.onSectionSelect,Y=S.onNodeOptionsClick,Q=S.onAddChild,R=S.onRenameChild,H=S.onDeleteChild,K=S.canDeleteScope,M=S.canEditScope,W=S.canCreateScope,z=S.searchQuery,J=S.sectionsConfig,q=void 0===J?[]:J,B=S.nodeTypesConfig,F=void 0===B?[]:B,G=S.forceVisible,U=void 0!==G&&G,X=S.compactView,Z=void 0!==X&&X,$=e(e([],j,!0),[N.id],!1),_=E.has(N.id),ee=g.getState().backwardCompatibility,oe=ee||Z,ne=h("".concat(f,".scope")),ie=!!I&&I.nodePath[I.nodePath.length-1]===N.id,te=!!I&&(I.nodePath.includes(N.id)&&!ie),le=h("".concat(f,".scopeDisplayLimit.applyToLevels"),""),de=function(){if(ee)return[2];if(!le)return null;try{var e=JSON.parse(le);return Array.isArray(e)?e.map(Number):null}catch(e){return null}}(),re=D+1,ae=null===de||de.includes(re),ce=(ee||"true"===h("".concat(f,".scopeDisplayLimit.enabled"),"false"))&&ae,se=ee?7:parseInt(h("".concat(f,".scopeDisplayLimit.count"),"7"),10)||7,pe=N.children||[],ue=ce&&!z&&pe.length>se,me=l(null);d(function(){ie&&me.current&&me.current.scrollIntoView({behavior:"smooth",block:"nearest"})},[ie]);var he=function(e,o){if(!o)return!0;var n=o.toLowerCase();return!!e.name.toLowerCase().includes(n)||!!e.children&&e.children.some(function(e){return he(e,o)})};if(!U&&!he(N,z||""))return null;var ve=D>=F.length-1?F[F.length-1]:F[D],fe=!!(null==ve?void 0:ve.addChildType),Ce=oe?q.filter(function(e){return"learnings"!==e.id&&"stations"!==e.id}).filter(function(e){return!e.isVisible||e.isVisible(N,D)}).map(function(e){return{label:e.label,icon:e.icon,onClick:function(){return O($,e.id)}}}):[],ge=!K||K(N.id),be=!M||M(N.id),ye=!W||W(N.id),Se=N.children&&N.children.length>0,Le=!ge||Se,xe=ge?Se?"This scope cannot be deleted because other scopes inherit learnings from it.":void 0:"You do not have permission to delete this scope.",we=ye?void 0:"You do not have permission to add a scope here.",Te=!z||N.name.toLowerCase().includes(z.toLowerCase()),Ae=function(e){return i(y,{node:e,depth:D+1,nodePath:$,expandedNodeIds:E,activeSelection:I,onToggleExpand:P,onSectionSelect:O,onNodeOptionsClick:Y,onAddChild:Q,onRenameChild:R,onDeleteChild:H,canDeleteScope:K,canEditScope:M,canCreateScope:W,searchQuery:z,forceVisible:Te,sectionsConfig:q,nodeTypesConfig:F,compactView:oe},e.id)};return n("div",o({ref:me,className:p.nodeWrapper,style:{"--tree-depth":D}},{children:[i(u,{nodeType:N.type,name:N.name,isExpanded:_,isSelected:ie,isAncestor:te,isExpandable:!!Se,childrenCount:null===(L=N.children)||void 0===L?void 0:L.length,learningsCount:oe?null===(x=N.metrics)||void 0===x?void 0:x.learningsCount:void 0,isCompactView:oe,onToggleExpand:function(e){e.stopPropagation(),P(N.id)},onClick:function(){O($,"learnings")},searchQuery:z,menuOptions:!1===N.hasAccess?[]:e(e(e([],fe&&"station"!==(null===(w=null==N?void 0:N.type)||void 0===w?void 0:w.toLowerCase())?[{label:ve.addChildLabel||"Add Child",icon:r,onClick:function(){return null==Q?void 0:Q(N.id,ve.addChildType,N.name)},disabled:!ye,tooltip:we}]:[],!0),[{label:"".concat(h("".concat(C,".rename"),"Rename")),icon:a,onClick:function(){return null==R?void 0:R(N.id,N.name)},disabled:!be||"station"===(null===(T=null==N?void 0:N.type)||void 0===T?void 0:T.toLocaleLowerCase()),tooltip:be?void 0:"You do not have permission to rename this scope."},{label:"station"===(null===(A=null==N?void 0:N.type)||void 0===A?void 0:A.toLowerCase())?"Delete Station":ee?"Delete Scope":"".concat(h("".concat(C,".delete"),"Delete ".concat((null==ve?void 0:ve.label)||"Node"),{scope:ne})),icon:c,onClick:function(){var e;return null==H?void 0:H(N.id,N.name,(null===(e=N.metrics)||void 0===e?void 0:e.learningsCount)||0)},disabled:Le,tooltip:xe,className:"text-red-500 hover:text-red-600 hover:bg-red-50"}],!1),Ce,!0)}),_&&n("div",o({className:p.childrenWrapper},{children:[!oe&&q.filter(function(e){return!e.isVisible||e.isVisible(N,D)}).map(function(e){var o;return i(b,{icon:e.icon,label:e.label,badgeCount:e.badgeKey?null===(o=N.metrics)||void 0===o?void 0:o[e.badgeKey]:void 0,isActive:ie&&(null==I?void 0:I.sectionId)===e.id,onClick:function(){return O($,e.id)}},"".concat(N.id,"-").concat(e.id))}),ue?n(t,{children:[i("div",o({className:p.scopeScrollContainer,style:{maxHeight:"calc(var(--scope-row-height, 40px) * ".concat(se,")"),overflowY:"scroll"}},{children:pe.map(Ae)})),i("button",o({type:"button",className:p.addAction,onClick:function(e){e.stopPropagation(),O($,"stations")}},{children:i("span",o({style:{paddingLeft:"15px"}},{children:n("span",o({style:{paddingLeft:"15px",display:"flex",alignItems:"center"}},{children:[v(h("".concat(f,".scopeDisplayLimit.viewMoreText"),ee?"View all {count} stations":"Show all {count} scopes"),{count:pe.length}),i(s,{size:14,style:{marginLeft:"6px",flexShrink:0}})]}))}))}))]}):pe.map(Ae),fe&&!oe&&i(m,{label:ve.addChildLabel||"Add Child",onAdd:function(){return null==Q?void 0:Q(N.id,ve.addChildType,N.name)},disabled:!ye,tooltip:we})]}))]}))};export{y as TreeNode};
2
2
  //# sourceMappingURL=TreeNode.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{default as InstantLearning}from"./features/InstantLearning/InstantLearning.js";export{default as WtaWnta}from"./features/WtaWnta/WtaWnta.js";export{default as BookLearning}from"./features/DocumentLearning/DocumentLearning.js";export{default as ILOTJ}from"./features/IL-OTJ/ILOTJ.js";export{Button}from"./features/IL-OTJ/_components/atoms/Button/Button.js";export{Dropdown}from"./features/IL-OTJ/_components/atoms/Dropdown/Dropdown.js";export{Toggle}from"./features/IL-OTJ/_components/atoms/Toggle/Toggle.js";export{Textarea}from"./features/IL-OTJ/_components/atoms/Textarea/Textarea.js";export{ConditionList}from"./features/IL-OTJ/_components/molecules/Condition/ConditionList.js";export{SectionWrapper}from"./features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js";export{SeparationRow}from"./features/IL-OTJ/_components/molecules/SeperationRow/SeparationRow.js";export{ConfigSection}from"./features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js";export{TextSection}from"./features/IL-OTJ/_components/organisms/TextSection/TextSection.js";export{ScopeSection}from"./features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.js";export{ConditionSection}from"./features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.js";export{TrafficManagerTemplate}from"./features/IL-OTJ/_components/templates/TrafficManager/TrafficManagerTemplate.js";export{Testing}from"./features/IL-OTJ/_components/templates/Testing/Testing.js";export{TemplateList,TemplateMap}from"./features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";export{extractAndParseResponse,extractAndParseWithProperty,extractTextFromChildren,extractVariantIds,parseValidationData,useHeaderObserver}from"./features/IL-OTJ/helpers/utils.js";export{CitationProvider,useCitations}from"./features/IL-OTJ/store/CitationsContext.js";export{dummyDat,getVariantInfo}from"./features/IL-OTJ/ILOTJTest.js";export{default as LearningManagement}from"./features/LearningManagement/LearningManagement.js";export{default as TeachMePlugin,TemplateRegistry}from"./features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";export{GuidelineLandingPage}from"./features/LSCGuidelinesCart/GuidelinesLandingPage.js";import"./features/LearningManagement/LearningManagementTest.js";
1
+ export{default as InstantLearning}from"./features/InstantLearning/InstantLearning.js";export{default as WtaWnta}from"./features/WtaWnta/WtaWnta.js";export{default as BookLearning}from"./features/DocumentLearning/DocumentLearning.js";export{default as ILOTJ}from"./features/IL-OTJ/ILOTJ.js";export{Button}from"./features/IL-OTJ/_components/atoms/Button/Button.js";export{Dropdown}from"./features/IL-OTJ/_components/atoms/Dropdown/Dropdown.js";export{Toggle}from"./features/IL-OTJ/_components/atoms/Toggle/Toggle.js";export{Textarea}from"./features/IL-OTJ/_components/atoms/Textarea/Textarea.js";export{ConditionList}from"./features/IL-OTJ/_components/molecules/Condition/ConditionList.js";export{SectionWrapper}from"./features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js";export{SeparationRow}from"./features/IL-OTJ/_components/molecules/SeperationRow/SeparationRow.js";export{ConfigSection}from"./features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js";export{TextSection}from"./features/IL-OTJ/_components/organisms/TextSection/TextSection.js";export{ScopeSection}from"./features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.js";export{ConditionSection}from"./features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.js";export{TrafficManagerTemplate}from"./features/IL-OTJ/_components/templates/TrafficManager/TrafficManagerTemplate.js";export{Testing}from"./features/IL-OTJ/_components/templates/Testing/Testing.js";export{TemplateList,TemplateMap}from"./features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";export{extractAndParseResponse,extractAndParseWithProperty,extractTextFromChildren,extractVariantIds,parseValidationData,useHeaderObserver}from"./features/IL-OTJ/helpers/utils.js";export{CitationProvider,useCitations}from"./features/IL-OTJ/store/CitationsContext.js";export{dummyDat,getVariantInfo}from"./features/IL-OTJ/ILOTJTest.js";export{default as LearningManagement}from"./features/LearningManagement/LearningManagement.js";export{default as TeachMePlugin,TemplateRegistry}from"./features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import"./features/LearningManagement/LearningManagementTest.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -17,6 +17,5 @@ export * from '../store/CitationsContext';
17
17
  export * from '../ILOTJTest';
18
18
  export * from '../../LearningManagement/LearningManagement';
19
19
  export * from '../../IL-OTJ/ValueTypeWrappers/TeachMePlugin';
20
- export * from '../../LSCGuidelinesCart/GuidelinesLandingPage';
21
20
  export * from '../../../../src/features/LearningManagement/LearningManagementTest';
22
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/IL-OTJ/_components/index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AAKjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAI1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAI7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,kBAAkB,CAAA;AAChC,cAAc,2BAA2B,CAAA;AACzC,cAAc,cAAc,CAAA;AAC5B,cAAc,6CAA6C,CAAA;AAC3D,cAAc,8CAA8C,CAAA;AAC5D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,oEAAoE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/IL-OTJ/_components/index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AAKjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAI1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAI7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,kBAAkB,CAAA;AAChC,cAAc,2BAA2B,CAAA;AACzC,cAAc,cAAc,CAAA;AAC5B,cAAc,6CAA6C,CAAA;AAC3D,cAAc,8CAA8C,CAAA;AAC5D,cAAc,oEAAoE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"LearningManagement.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/LearningManagement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAWrC,OAAoB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAmC9E,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,uBAAuB;IAC/B,WAAW,EAAE,IAAI,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,GAAG,CAAC;IACZ,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAA;IACD,MAAM,CAAC,EAAC,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,WAAW,CAAC,EAAE;QACZ,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;QACxB,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH;AAED;;;GAGG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,qBAA2B,EAC3B,6BAAmC,EACnC,MAAM,EACN,WAAW,GACZ,EAAE,uBAAuB,qBAwtBzB;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"LearningManagement.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/LearningManagement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAWrC,OAAoB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAmC9E,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,uBAAuB;IAC/B,WAAW,EAAE,IAAI,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,GAAG,CAAC;IACZ,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAA;IACD,MAAM,CAAC,EAAC,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,WAAW,CAAC,EAAE;QACZ,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;QACxB,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH;AAED;;;GAGG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,qBAA2B,EAC3B,6BAAmC,EACnC,MAAM,EACN,WAAW,GACZ,EAAE,uBAAuB,qBAwuBzB;AAED,eAAe,kBAAkB,CAAC"}
@@ -19,6 +19,9 @@ interface LearningTemplateLayoutProps {
19
19
  app_integration_id?: string;
20
20
  token: string;
21
21
  modeId?: string;
22
+ onRequestAccess?: (scopeId: string) => void;
23
+ isRequestingAccess?: boolean;
24
+ isAccessRequested?: boolean;
22
25
  }
23
26
  /**
24
27
  * Layout component for Learning Template Management.
@@ -1 +1 @@
1
- {"version":3,"file":"LearningTemplateLayout.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/LearningTemplateLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAQzC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK7F,UAAU,2BAA2B;IACnC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,iGAAiG;IACjG,iBAAiB,EAAE,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9F,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IACrF,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAC,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA0GjE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"LearningTemplateLayout.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/LearningTemplateLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAQzC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQ7F,UAAU,2BAA2B;IACnC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,iGAAiG;IACjG,iBAAiB,EAAE,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9F,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IACrF,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAC,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA4HjE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -192,6 +192,7 @@ export interface ScopeTreeNode {
192
192
  name: string;
193
193
  type: TreeNodeType;
194
194
  metrics: NodeMetrics;
195
+ hasAccess?: boolean;
195
196
  children: ScopeTreeNode[];
196
197
  }
197
198
  export interface ScopesTreeResponse {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/types.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/types.ts"],"names":[],"mappings":"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"}
@@ -5,5 +5,4 @@ export { default as ILOTJ } from "./features/IL-OTJ/ILOTJ";
5
5
  export * from "./features/IL-OTJ/_components/index";
6
6
  export { default as LearningManagement } from "./features/LearningManagement/LearningManagement";
7
7
  export { default as TeachMePlugin } from "./features/IL-OTJ/ValueTypeWrappers/TeachMePlugin";
8
- export { default as GuidelineLandingPage } from "./features/LSCGuidelinesCart/GuidelinesLandingPage";
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC1D,cAAc,qCAAqC,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAC,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,OAAO,IAAI,aAAa,EAAC,MAAM,mDAAmD,CAAC;AAC5F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,oDAAoD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC1D,cAAc,qCAAqC,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAC,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,OAAO,IAAI,aAAa,EAAC,MAAM,mDAAmD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/instant-learning",
3
- "version": "1.3.0-alpha.90",
3
+ "version": "1.3.0-alpha.93",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -94,11 +94,6 @@
94
94
  "import": "./dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js",
95
95
  "require": "./dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js",
96
96
  "types": "./dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts"
97
- },
98
- "./GuidelineLandingPage": {
99
- "import": "./dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js",
100
- "require": "./dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js",
101
- "types": "./dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts"
102
97
  }
103
98
  },
104
99
  "devDependencies": {
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("lucide-react"),n=[{id:"1",name:"Agent Guidelines",description:"No description available",addedOn:"Added on - 5:15 PM | 12/06/26",inCart:!0},{id:"2",name:"Agent Guideline 2",description:"Define the agent's role using only four elements: agent name, one-line job description, primary responsibility, and...",addedOn:"Added on - 5:15 PM | 18/06/26",inCart:!1},{id:"3",name:"Guideline 2",description:"Add only information directly relevant to the user's request. Do not introduce assumptions, unrelated context, or unsu...",addedOn:"Added on - 5:15 PM | 12/04/26",inCart:!1},{id:"4",name:"Response Format Guide",description:"Structure answers with clear headings, concise paragraphs, and bullet points when appropriate. Prioritize readability a...",addedOn:"Added on - 5:15 PM | 22/03/26",inCart:!1}],s=[{id:"1",name:"Agent Guidelines",description:"No description available",addedOn:"Added on - 4:15 PM | 12/03/26"}],r={page:{height:"100%",width:"100%",background:"#ffffff",fontFamily:"Inter, sans-serif"},main:{height:"100%",overflow:"auto",padding:40},headerSection:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,justifyContent:"space-between",alignItems:"flex-start"},intro:{minWidth:280,flex:"1 1 0%"},title:{fontSize:30,fontWeight:700,lineHeight:"38px",color:"#6D35F2",margin:0},description:{marginTop:8,fontSize:19,lineHeight:"28px",color:"#1F2937"},debugLink:{marginTop:12,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:500,color:"#53657D",background:"none",border:"none",padding:0,cursor:"pointer"},addButton:{display:"inline-flex",height:44,minWidth:210,flexShrink:0,alignItems:"center",justifyContent:"center",gap:12,borderRadius:6,background:"#4438F5",padding:"0 20px",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer",marginLeft:"auto"},bodySection:{marginTop:48,display:"grid",width:"100%",gridTemplateColumns:"minmax(0,1fr) minmax(300px,360px)",alignItems:"start",gap:24},librarySection:{minWidth:0},libraryTabs:{display:"flex",borderBottom:"1px solid #EAECF0"},tab:{position:"relative",display:"inline-flex",height:40,alignItems:"center",gap:8,padding:"0 16px",fontSize:14,fontWeight:500,background:"none",border:"none",cursor:"pointer",color:"#B5BDC8"},tabActive:{color:"#1F2937",boxShadow:"inset 0 -3px 0 0 #6D5BFF"},libraryGrid:{marginTop:24,display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:20},card:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:20,boxShadow:"0 1px 2px rgba(16,24,40,0.04)"},cardTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cardTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cardTitle:{fontSize:15,fontWeight:600,lineHeight:"24px",color:"#1F2937",margin:0},cardTopIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cardDescription:{marginTop:8,fontSize:13,lineHeight:"19px",color:"#667085"},cardDate:{marginTop:12,fontSize:12,color:"#98A2B3"},cardActions:{marginTop:16},cardAddButton:{display:"inline-flex",height:36,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #4438F5",background:"#ffffff",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},cardAddedButton:{display:"inline-flex",height:36,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #EAE7FF",background:"#EDE9FE",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},showMore:{marginTop:28,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:600,color:"#5B2CF4",background:"none",border:"none",cursor:"pointer"},cartSection:{display:"flex",width:"100%",flexDirection:"column",borderRadius:12,border:"1px solid #5B2CF4",background:"#F5F1FF",padding:28,fontFamily:"Inter, sans-serif",boxShadow:"0 1px 4px rgba(16,24,40,0.04)"},cartHeaderRow:{display:"flex",alignItems:"center",gap:12},cartTitle:{fontSize:18,fontWeight:700,color:"#1F2937",margin:0},cartBadge:{display:"inline-flex",height:24,alignItems:"center",borderRadius:9999,background:"#EDE7FF",padding:"0 12px",fontSize:12,fontWeight:600,color:"#5B2CF4",whiteSpace:"nowrap"},cartDescription:{marginTop:4,fontSize:13,color:"#667085"},cartBody:{marginTop:24,minHeight:280,flex:"1 1 0%",overflow:"hidden"},cartList:{maxHeight:420,overflowY:"auto",paddingRight:8,display:"flex",flexDirection:"column",gap:16},cartItem:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:16},cartItemTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cartItemTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cartCheckbox:{display:"inline-flex",height:18,width:18,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:4,background:"#4438F5",color:"#ffffff"},cartItemName:{fontSize:14,fontWeight:600,color:"#1F2937",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},cartItemIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cartItemDescription:{marginTop:8,fontSize:13,color:"#667085"},cartItemDate:{marginTop:8,fontSize:12,color:"#98A2B3"},proceedButton:{marginTop:24,display:"inline-flex",height:44,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,background:"#4438F5",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer"}};function o(){return i.jsx("div",e.__assign({style:r.page},{children:i.jsxs("main",e.__assign({style:r.main},{children:[i.jsxs("section",e.__assign({style:r.headerSection},{children:[i.jsxs("div",e.__assign({style:r.intro},{children:[i.jsx("h1",e.__assign({style:r.title},{children:"Add Guidelines"})),i.jsx("p",e.__assign({style:r.description},{children:"Add guidelines that shape how your agent behaves, responds, and interprets."})),i.jsxs("button",e.__assign({type:"button",style:r.debugLink},{children:[i.jsx("span",{children:"Know more about debug mode"}),i.jsx(t.CircleHelp,{size:18,strokeWidth:2})]}))]})),i.jsxs("button",e.__assign({type:"button",style:r.addButton},{children:[i.jsx(t.Plus,{size:20,strokeWidth:2.4}),i.jsx("span",{children:"Add Guideline"})]}))]})),i.jsxs("section",e.__assign({style:r.bodySection},{children:[i.jsxs("section",e.__assign({style:r.librarySection},{children:[i.jsxs("div",e.__assign({style:r.libraryTabs},{children:[i.jsxs("button",e.__assign({type:"button",style:e.__assign(e.__assign({},r.tab),r.tabActive)},{children:[i.jsx(t.UserCheck,{size:18,strokeWidth:2}),i.jsx("span",{children:"Saved"})]})),i.jsxs("button",e.__assign({type:"button",style:r.tab},{children:[i.jsx(t.Clock3,{size:18,strokeWidth:2}),i.jsx("span",{children:"Recently used"})]})),i.jsxs("button",e.__assign({type:"button",style:r.tab},{children:[i.jsx(t.ShoppingBag,{size:18,strokeWidth:2}),i.jsx("span",{children:"Marketplace"})]}))]})),i.jsx("div",e.__assign({style:r.libraryGrid},{children:n.map(function(n){return i.jsxs("div",e.__assign({style:r.card},{children:[i.jsxs("div",e.__assign({style:r.cardTop},{children:[i.jsxs("div",e.__assign({style:r.cardTopLeft},{children:[i.jsx(t.BookOpen,{size:18,strokeWidth:2,color:"#6D5BFF"}),i.jsx("p",e.__assign({style:r.cardTitle},{children:n.name}))]})),i.jsxs("div",e.__assign({style:r.cardTopIcons},{children:[i.jsx(t.Eye,{size:16,strokeWidth:2}),i.jsx(t.MoreVertical,{size:16,strokeWidth:2}),i.jsx(t.UserCheck,{size:16,strokeWidth:2})]}))]})),i.jsx("p",e.__assign({style:r.cardDescription},{children:n.description})),i.jsx("p",e.__assign({style:r.cardDate},{children:n.addedOn})),i.jsx("div",e.__assign({style:r.cardActions},{children:n.inCart?i.jsxs("button",e.__assign({type:"button",style:r.cardAddedButton},{children:[i.jsx(t.Check,{size:16,strokeWidth:2.4}),i.jsx("span",{children:"Added to Cart"})]})):i.jsxs("button",e.__assign({type:"button",style:r.cardAddButton},{children:[i.jsx(t.Plus,{size:16,strokeWidth:2.4}),i.jsx("span",{children:"Add to Cart"})]}))}))]}),n.id)})})),i.jsxs("button",e.__assign({type:"button",style:r.showMore},{children:[i.jsx("span",{children:"Show more guidelines (12)"}),i.jsx(t.ChevronDown,{size:16,strokeWidth:2.4})]}))]})),i.jsxs("section",e.__assign({style:r.cartSection},{children:[i.jsxs("div",e.__assign({style:r.cartHeaderRow},{children:[i.jsx("p",e.__assign({style:r.cartTitle},{children:"Guideline Cart"})),i.jsx("span",e.__assign({style:r.cartBadge},{children:"1 Selected"}))]})),i.jsx("p",e.__assign({style:r.cartDescription},{children:"Guidelines added to your current session"})),i.jsx("div",e.__assign({style:r.cartBody},{children:i.jsx("div",e.__assign({style:r.cartList},{children:s.map(function(n){return i.jsxs("div",e.__assign({style:r.cartItem},{children:[i.jsxs("div",e.__assign({style:r.cartItemTop},{children:[i.jsxs("div",e.__assign({style:r.cartItemTopLeft},{children:[i.jsx("span",e.__assign({style:r.cartCheckbox},{children:i.jsx(t.Check,{size:12,strokeWidth:3})})),i.jsx("p",e.__assign({style:r.cartItemName},{children:n.name}))]})),i.jsxs("div",e.__assign({style:r.cartItemIcons},{children:[i.jsx(t.Eye,{size:16,strokeWidth:2}),i.jsx(t.X,{size:16,strokeWidth:2})]}))]})),i.jsx("p",e.__assign({style:r.cartItemDescription},{children:n.description})),i.jsx("p",e.__assign({style:r.cartItemDate},{children:n.addedOn}))]}),n.id)})}))})),i.jsx("button",e.__assign({type:"button",style:r.proceedButton},{children:i.jsx("span",{children:"Proceed with Selected"})}))]}))]}))]}))}))}exports.GuidelineLandingPage=o,exports.default=o;
2
- //# sourceMappingURL=GuidelinesLandingPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidelinesLandingPage.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{CircleHelp as n,Plus as r,UserCheck as o,Clock3 as d,ShoppingBag as a,BookOpen as l,Eye as s,MoreVertical as c,Check as p,ChevronDown as h,X as f}from"lucide-react";var g=[{id:"1",name:"Agent Guidelines",description:"No description available",addedOn:"Added on - 5:15 PM | 12/06/26",inCart:!0},{id:"2",name:"Agent Guideline 2",description:"Define the agent's role using only four elements: agent name, one-line job description, primary responsibility, and...",addedOn:"Added on - 5:15 PM | 18/06/26",inCart:!1},{id:"3",name:"Guideline 2",description:"Add only information directly relevant to the user's request. Do not introduce assumptions, unrelated context, or unsu...",addedOn:"Added on - 5:15 PM | 12/04/26",inCart:!1},{id:"4",name:"Response Format Guide",description:"Structure answers with clear headings, concise paragraphs, and bullet points when appropriate. Prioritize readability a...",addedOn:"Added on - 5:15 PM | 22/03/26",inCart:!1}],u=[{id:"1",name:"Agent Guidelines",description:"No description available",addedOn:"Added on - 4:15 PM | 12/03/26"}],m={page:{height:"100%",width:"100%",background:"#ffffff",fontFamily:"Inter, sans-serif"},main:{height:"100%",overflow:"auto",padding:40},headerSection:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,justifyContent:"space-between",alignItems:"flex-start"},intro:{minWidth:280,flex:"1 1 0%"},title:{fontSize:30,fontWeight:700,lineHeight:"38px",color:"#6D35F2",margin:0},description:{marginTop:8,fontSize:19,lineHeight:"28px",color:"#1F2937"},debugLink:{marginTop:12,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:500,color:"#53657D",background:"none",border:"none",padding:0,cursor:"pointer"},addButton:{display:"inline-flex",height:44,minWidth:210,flexShrink:0,alignItems:"center",justifyContent:"center",gap:12,borderRadius:6,background:"#4438F5",padding:"0 20px",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer",marginLeft:"auto"},bodySection:{marginTop:48,display:"grid",width:"100%",gridTemplateColumns:"minmax(0,1fr) minmax(300px,360px)",alignItems:"start",gap:24},librarySection:{minWidth:0},libraryTabs:{display:"flex",borderBottom:"1px solid #EAECF0"},tab:{position:"relative",display:"inline-flex",height:40,alignItems:"center",gap:8,padding:"0 16px",fontSize:14,fontWeight:500,background:"none",border:"none",cursor:"pointer",color:"#B5BDC8"},tabActive:{color:"#1F2937",boxShadow:"inset 0 -3px 0 0 #6D5BFF"},libraryGrid:{marginTop:24,display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:20},card:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:20,boxShadow:"0 1px 2px rgba(16,24,40,0.04)"},cardTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cardTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cardTitle:{fontSize:15,fontWeight:600,lineHeight:"24px",color:"#1F2937",margin:0},cardTopIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cardDescription:{marginTop:8,fontSize:13,lineHeight:"19px",color:"#667085"},cardDate:{marginTop:12,fontSize:12,color:"#98A2B3"},cardActions:{marginTop:16},cardAddButton:{display:"inline-flex",height:36,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #4438F5",background:"#ffffff",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},cardAddedButton:{display:"inline-flex",height:36,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #EAE7FF",background:"#EDE9FE",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},showMore:{marginTop:28,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:600,color:"#5B2CF4",background:"none",border:"none",cursor:"pointer"},cartSection:{display:"flex",width:"100%",flexDirection:"column",borderRadius:12,border:"1px solid #5B2CF4",background:"#F5F1FF",padding:28,fontFamily:"Inter, sans-serif",boxShadow:"0 1px 4px rgba(16,24,40,0.04)"},cartHeaderRow:{display:"flex",alignItems:"center",gap:12},cartTitle:{fontSize:18,fontWeight:700,color:"#1F2937",margin:0},cartBadge:{display:"inline-flex",height:24,alignItems:"center",borderRadius:9999,background:"#EDE7FF",padding:"0 12px",fontSize:12,fontWeight:600,color:"#5B2CF4",whiteSpace:"nowrap"},cartDescription:{marginTop:4,fontSize:13,color:"#667085"},cartBody:{marginTop:24,minHeight:280,flex:"1 1 0%",overflow:"hidden"},cartList:{maxHeight:420,overflowY:"auto",paddingRight:8,display:"flex",flexDirection:"column",gap:16},cartItem:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:16},cartItemTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cartItemTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cartCheckbox:{display:"inline-flex",height:18,width:18,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:4,background:"#4438F5",color:"#ffffff"},cartItemName:{fontSize:14,fontWeight:600,color:"#1F2937",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},cartItemIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cartItemDescription:{marginTop:8,fontSize:13,color:"#667085"},cartItemDate:{marginTop:8,fontSize:12,color:"#98A2B3"},proceedButton:{marginTop:24,display:"inline-flex",height:44,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,background:"#4438F5",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer"}};function y(){return t("div",e({style:m.page},{children:i("main",e({style:m.main},{children:[i("section",e({style:m.headerSection},{children:[i("div",e({style:m.intro},{children:[t("h1",e({style:m.title},{children:"Add Guidelines"})),t("p",e({style:m.description},{children:"Add guidelines that shape how your agent behaves, responds, and interprets."})),i("button",e({type:"button",style:m.debugLink},{children:[t("span",{children:"Know more about debug mode"}),t(n,{size:18,strokeWidth:2})]}))]})),i("button",e({type:"button",style:m.addButton},{children:[t(r,{size:20,strokeWidth:2.4}),t("span",{children:"Add Guideline"})]}))]})),i("section",e({style:m.bodySection},{children:[i("section",e({style:m.librarySection},{children:[i("div",e({style:m.libraryTabs},{children:[i("button",e({type:"button",style:e(e({},m.tab),m.tabActive)},{children:[t(o,{size:18,strokeWidth:2}),t("span",{children:"Saved"})]})),i("button",e({type:"button",style:m.tab},{children:[t(d,{size:18,strokeWidth:2}),t("span",{children:"Recently used"})]})),i("button",e({type:"button",style:m.tab},{children:[t(a,{size:18,strokeWidth:2}),t("span",{children:"Marketplace"})]}))]})),t("div",e({style:m.libraryGrid},{children:g.map(function(n){return i("div",e({style:m.card},{children:[i("div",e({style:m.cardTop},{children:[i("div",e({style:m.cardTopLeft},{children:[t(l,{size:18,strokeWidth:2,color:"#6D5BFF"}),t("p",e({style:m.cardTitle},{children:n.name}))]})),i("div",e({style:m.cardTopIcons},{children:[t(s,{size:16,strokeWidth:2}),t(c,{size:16,strokeWidth:2}),t(o,{size:16,strokeWidth:2})]}))]})),t("p",e({style:m.cardDescription},{children:n.description})),t("p",e({style:m.cardDate},{children:n.addedOn})),t("div",e({style:m.cardActions},{children:n.inCart?i("button",e({type:"button",style:m.cardAddedButton},{children:[t(p,{size:16,strokeWidth:2.4}),t("span",{children:"Added to Cart"})]})):i("button",e({type:"button",style:m.cardAddButton},{children:[t(r,{size:16,strokeWidth:2.4}),t("span",{children:"Add to Cart"})]}))}))]}),n.id)})})),i("button",e({type:"button",style:m.showMore},{children:[t("span",{children:"Show more guidelines (12)"}),t(h,{size:16,strokeWidth:2.4})]}))]})),i("section",e({style:m.cartSection},{children:[i("div",e({style:m.cartHeaderRow},{children:[t("p",e({style:m.cartTitle},{children:"Guideline Cart"})),t("span",e({style:m.cartBadge},{children:"1 Selected"}))]})),t("p",e({style:m.cartDescription},{children:"Guidelines added to your current session"})),t("div",e({style:m.cartBody},{children:t("div",e({style:m.cartList},{children:u.map(function(n){return i("div",e({style:m.cartItem},{children:[i("div",e({style:m.cartItemTop},{children:[i("div",e({style:m.cartItemTopLeft},{children:[t("span",e({style:m.cartCheckbox},{children:t(p,{size:12,strokeWidth:3})})),t("p",e({style:m.cartItemName},{children:n.name}))]})),i("div",e({style:m.cartItemIcons},{children:[t(s,{size:16,strokeWidth:2}),t(f,{size:16,strokeWidth:2})]}))]})),t("p",e({style:m.cartItemDescription},{children:n.description})),t("p",e({style:m.cartItemDate},{children:n.addedOn}))]}),n.id)})}))})),t("button",e({type:"button",style:m.proceedButton},{children:t("span",{children:"Proceed with Selected"})}))]}))]}))]}))}))}export{y as GuidelineLandingPage,y as default};
2
- //# sourceMappingURL=GuidelinesLandingPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidelinesLandingPage.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function GuidelineLandingPage(): import("react").JSX.Element;
3
- export default GuidelineLandingPage;
4
- //# sourceMappingURL=GuidelinesLandingPage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidelinesLandingPage.d.ts","sourceRoot":"","sources":["../../../../../src/features/LSCGuidelinesCart/GuidelinesLandingPage.tsx"],"names":[],"mappings":";AAmZA,wBAAgB,oBAAoB,gCA0HnC;AAED,eAAe,oBAAoB,CAAC"}