@e-llm-studio/instant-learning 0.0.172 → 0.0.174

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../../../../../node_modules/tslib/tslib.es6.mjs.js"),e=require("react/jsx-runtime"),n=require("react"),t=require("../../InputDataReasoningCard.js"),o=require("../../organisms/ConditionSection/ConditionSection.js"),l=require("../../organisms/ConfigSection/ConfigSection.js"),a=require("../../organisms/ScopeSection/ScopeSection.js"),r=require("../../organisms/TextSection/TextSection.js"),s=require("../../AccordianSection.js"),d=require("../../_svg/ButtonCognitiveIcon.js");function c(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var u=c(n),v=function(n){var t=n.children,o=n.onAddVariant,l=u.default.Children.toArray(t);return e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[l.map(function(i,n){return e.jsxs(u.default.Fragment,{children:[i,e.jsx("div",{style:{width:"2px",height:"20px",backgroundColor:"#E2E8F0",marginLeft:"30px"}})]},n)}),e.jsx("div",i.__assign({onClick:o,style:{padding:"8px 16px",border:"1px solid #E2E8F0",borderRadius:"8px",color:"#475569",fontSize:"14px",fontWeight:"500",cursor:"pointer",backgroundColor:"#FFFFFF",userSelect:"none"}},{children:"Add Variant"}))]}))};exports.CreateRule=function(c){var p,g,h,f,y,x,_,T,D,C,j,m=c.state,O=c.handlers,S=c.uiState,b=(null==S?void 0:S.highlights)||new Map,A=b.get("global_0")||{},V=n.useState({}),R=V[0],w=V[1],I=n.useState(null),E=I[0],q=I[1],W=u.default.useRef(null==S?void 0:S.defaultVariantOpen),N=u.default.useRef(m.variantsByTier);u.default.useEffect(function(){var i,e,n,t,o=null,l=!1;W.current!==(null==S?void 0:S.defaultVariantOpen)&&(l=!0,W.current=null==S?void 0:S.defaultVariantOpen),m.variantsByTier,N.current,l&&(null===(e=null===(i=null==S?void 0:S.tierOptions)||void 0===i?void 0:i.filter(function(i){var e,n;return null===(n=null===(e=m.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===e||e.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=m.variantsByTier)||void 0===e?void 0:e[n])||[]).forEach(function(i,e){(null==S?void 0:S.defaultVariantOpen)===e&&(o="".concat(n,"-variant-").concat(e)),(null==S?void 0:S.autoScrollVariantIndex)===e&&(o="".concat(n,"-variant-").concat(e))})}),o&&q(o)),null===E&&(null==S?void 0:S.defaultVariantOpen)>=0&&(null===(t=null===(n=null==S?void 0:S.tierOptions)||void 0===n?void 0:n.filter(function(i){var e,n;return null===(n=null===(e=m.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===t||t.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=m.variantsByTier)||void 0===e?void 0:e[n])||[])[S.defaultVariantOpen]&&q("".concat(n,"-variant-").concat(S.defaultVariantOpen))})),N.current=m.variantsByTier},[m.variantsByTier,null==S?void 0:S.defaultVariantOpen,null===(p=m.scopeData)||void 0===p?void 0:p.tiers,null==S?void 0:S.tierOptions,null==S?void 0:S.autoScrollVariantIndex]);var F=function(e){w(function(n){var t;return i.__assign(i.__assign({},n),((t={})[e]=!n[e],t))})},B=function(i){var e,n=null===(e=m.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(n)&&n.length>0?n:m.citations},L={marginTop:"-17px",position:"relative",zIndex:1},M=function(i){i&&i.scrollIntoView({behavior:"smooth",block:"center"})};return console.log("CreateRule state:",m),console.log("CreateRule uiState:",S),e.jsxs("div",i.__assign({className:"traffic-manager-template"},{children:[e.jsx(s.default,i.__assign({title:{type:"other",label:(null==S?void 0:S.setupLabel)||"Rule Setup"},footerData:{ruleTitle:m.ruleTitle,stations:[m.scopeData.station],tiers:null===(g=m.scopeData)||void 0===g?void 0:g.tiers},defaultOpen:"Create"===(null==S?void 0:S.usedFor),readOnly:"Create"!==(null==S?void 0:S.usedFor)},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e.jsx(r.TextSection,i.__assign({id:"rule-title",title:S.ruleTitle||"Rule Title",rows:1,placeholder:"Enter a short, descriptive title for the rule",required:!0,value:m.ruleTitle,onChange:O.setRuleTitle,readOnly:"Create"!==(null==S?void 0:S.usedFor),isOpen:R.ruleTitle,onToggle:function(){return F("ruleTitle")},isHighlighted:A.ruleTitle||!1,showCognitiveIcon:m.citation.ruleTitle,tooltipDescription:"Why this Title?",errorMessage:null===(h=S.validationErrors)||void 0===h?void 0:h.ruleTitle},S)),m.citation.ruleTitle&&e.jsx("div",i.__assign({style:L},{children:e.jsx(t.InputDataReasoningCard,{isVisible:R.ruleTitle,citation:m.citation.ruleTitle,citations:B("ruleTitle"),fieldName:"Rule Title",fieldValue:m.ruleTitle})})),e.jsx(a.ScopeSection,i.__assign({id:"scope",title:S.scopeTitle||"Scope",required:!0,scopeData:m.scopeData,onScopeChange:O.onScopeChange,tierLabel:"Which tiers should this rule apply to?",stationLabel:"Which rule set should this rule belong to?",highlights:A,isOpen:R.scopeData,onToggle:function(){return F("scopeData")},showCognitiveIcon:m.citation.scopeData,cognitiveIcon:e.jsx(d.ButtonCognitiveIcon,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(f=S.validationErrors)||void 0===f?void 0:f.station)||(null===(y=S.validationErrors)||void 0===y?void 0:y.tiers),stationErrorMessage:null===(x=S.validationErrors)||void 0===x?void 0:x.station,tierErrorMessage:null===(_=S.validationErrors)||void 0===_?void 0:_.tiers,readOnly:"Create"!==(null==S?void 0:S.usedFor)},S)),m.citation.scopeData&&e.jsx("div",i.__assign({style:L},{children:e.jsx(t.InputDataReasoningCard,{isVisible:R.scopeData,citation:m.citation.scopeData,citations:B("scopeData"),fieldName:"Scope",fieldValue:null===(D=null===(T=m.scopeData)||void 0===T?void 0:T.tiers)||void 0===D?void 0:D.join(", ")})}))]}))})),null===(j=null===(C=null==S?void 0:S.tierOptions)||void 0===C?void 0:C.filter(function(i){var e,n;return null===(n=null===(e=m.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===j?void 0:j.map(function(n,a,d){var c,u,p,g,h=n.toLowerCase().replace(/ /g,"_"),f=(null===(c=m.variantsByTier)||void 0===c?void 0:c[h])||[],y=f.length,x=!1;if(1===y){var _=f[0],T=!(null===(u=null==_?void 0:_.ruleDescription)||void 0===u?void 0:u.trim()),D=(null===(p=null==_?void 0:_.whenToApplyConditions)||void 0===p?void 0:p.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1,C=(null===(g=null==_?void 0:_.whenNotToApplyConditions)||void 0===g?void 0:g.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1;T&&!D&&!C&&(x=!0)}var j=x?void 0:"".concat(y," ").concat(1===y?"variant":"variants"," configured for this tier"),A=!((null==S?void 0:S.defaultTierOpen)>=0)||a===S.defaultTierOpen;return console.log("Rendering tier : ",n),e.jsx(s.default,i.__assign({variant:"tier-header",title:{type:"other",label:n},subtitle:j,defaultOpen:A,footerData:{description:"Variants for ".concat(n)}},{children:e.jsx(v,i.__assign({onAddVariant:function(){var i;return null===(i=O.addNewVariant)||void 0===i?void 0:i.call(O,h)}},{children:f.map(function(n,a){var d,c,u,v,p,g,y,x,_,T=n.variantType||"default",D="".concat(h,"-variant-").concat(a),C=!0===n.is_variant;(null==S?void 0:S.defaultVariantOpen)>=0&&S.defaultVariantOpen;var j="".concat(h,"_").concat(a),m=b.get(j)||{},A=(null===(c=null===(d=S.separationItemsByTier)||void 0===d?void 0:d[h])||void 0===c?void 0:c.get(a))||[],V=(null===(v=null===(u=S.togglesByTier)||void 0===u?void 0:u[h])||void 0===v?void 0:v.get(a))||[],w=(null==S?void 0:S.autoScrollVariantIndex)===a||!0===n.is_variant;return console.log("Rendering ".concat(h," variant ").concat(a,":"),n),console.log("Rendering Variant : ",n),e.jsx("div",i.__assign({ref:w?M:null,style:{width:"100%"}},{children:e.jsx(s.default,i.__assign({title:{type:T,label:n.isReadOnly&&f.length>1?"".concat(a?"Variant "+a:"Default"):(null==S?void 0:S.behaviourLabel)?null==S?void 0:S.behaviourLabel:0==a?"Default":"Variant "+a,isNewVariant:C},defaultOpen:!0,expanded:E===D,onToggle:function(){var i,e=E===D;q(e?null:D),null===(i=null==S?void 0:S.setActiveVariantAccordionIndex)||void 0===i||i.call(S,e?null:a)},variant:"rule-behavior",footerData:{ruleTitle:T,description:n.ruleDescription||""}},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e.jsx(r.TextSection,i.__assign({id:"rule-description-".concat(h,"-").concat(a),title:S.ruleDescriptionTitle||"Rule Description",rows:2,placeholder:"Explain the rule behaviour",required:!0,readOnly:n.isReadOnly,value:n.ruleDescription||"",onChange:function(i){return O.setRuleDescription(h,a,i)},isOpen:R["ruleDescription-".concat(h,"-").concat(a)],onToggle:function(){return F("ruleDescription-".concat(h,"-").concat(a))},isHighlighted:m.ruleDescription||!1,showCognitiveIcon:null===(p=n.reasoning)||void 0===p?void 0:p.ruleDescription,tooltipDescription:"Why this Description?",errorMessage:null===(g=S.validationErrors)||void 0===g?void 0:g["ruleDescription-".concat(h,"-").concat(a)]},S)),(null===(y=n.reasoning)||void 0===y?void 0:y.ruleDescription)&&e.jsx("div",i.__assign({style:L},{children:e.jsx(t.InputDataReasoningCard,{isVisible:R["ruleDescription-".concat(h,"-").concat(a)],citation:n.reasoning.ruleDescription,citations:B("ruleDescription_".concat(h,"_").concat(a)),fieldName:"Rule Description",fieldValue:n.ruleDescription})})),e.jsx(o.ConditionSection,i.__assign({id:"when-to-apply-".concat(h,"-").concat(a),title:S.whenToApplyTitle||"When to apply",required:!0,dividerRequired:!0,readOnly:n.isReadOnly,conditions:n.whenToApplyConditions||[],onAdd:function(){return O.addWhenToApply(h,a)},onRemove:function(i,e,n){return O.removeWhenToApply(i,e,n)},onEdit:function(i,e,n,t){return O.editWhenToApply(i,e,n,t)},index:a,tierKey:h,isHighlighted:m.wta||!1,highlightedIds:null==S?void 0:S.highlightedIds,tooltipDescription:"Why this Condition?",citations:B("whenToApply_".concat(h,"_").concat(a)),bordered:!0,addLabel:"Add When to apply",isAiStreaming:S.isAiStreaming,errorMessage:null===(x=S.validationErrors)||void 0===x?void 0:x["whenToApply-".concat(h,"-").concat(a)]},S)),e.jsx(o.ConditionSection,i.__assign({id:"when-not-to-apply-".concat(h,"-").concat(a),title:S.whenNotToApplyTitle||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:n.isReadOnly,conditions:n.whenNotToApplyConditions||[],onAdd:function(){return O.addWhenNotToApply(h,a)},onRemove:function(i,e,n){return O.removeWhenNotToApply(i,e,n)},onEdit:function(i,e,n,t){return O.editWhenNotToApply(i,e,n,t)},index:a,tierKey:h,isHighlighted:m.wnta||!1,highlightedIds:null==S?void 0:S.highlightedIds,tooltipDescription:"Why this Condition?",citations:B("whenNotToApply_".concat(h,"_").concat(a)),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:S.isAiStreaming},S)),e.jsx(l.ConfigSection,i.__assign({id:"config-".concat(h,"-").concat(a),title:S.configTitle||"Configuration",required:!1,highlights:m,bordered:!0,readOnly:n.isReadOnly,onConfigChange:function(i,e){return O.onConfigChange(h,a,i,e)},separationItems:A,toggles:V,index:a},S)),(null===(_=n.reasoning)||void 0===_?void 0:_.configData)&&e.jsx("div",i.__assign({style:L},{children:e.jsx(t.InputDataReasoningCard,{citation:n.reasoning.configData,citations:B("configData_".concat(h,"_").concat(a)),fieldName:"Configuration",fieldValue:"Proposed Configuration"})}))]}))}),D)}),"".concat(h,"-variant-").concat(a))})}))}),"tier-".concat(a))})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../../../../../node_modules/tslib/tslib.es6.mjs.js"),e=require("react/jsx-runtime"),n=require("react"),t=require("../../InputDataReasoningCard.js"),o=require("../../organisms/ConditionSection/ConditionSection.js"),l=require("../../organisms/ConfigSection/ConfigSection.js"),a=require("../../organisms/ScopeSection/ScopeSection.js"),r=require("../../organisms/TextSection/TextSection.js"),s=require("../../AccordianSection.js"),d=require("../../_svg/ButtonCognitiveIcon.js");function c(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var u=c(n),v=function(n){var t=n.children,o=n.onAddVariant,l=n.isDisabled,a=u.default.Children.toArray(t);return e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},{children:[a.map(function(i,n){return e.jsxs(u.default.Fragment,{children:[i,e.jsx("div",{style:{width:"2px",height:"20px",backgroundColor:"#E2E8F0",marginLeft:"30px"}})]},n)}),e.jsx("div",i.__assign({onClick:l?void 0:o,style:{padding:"8px 16px",border:"1px solid #E2E8F0",borderRadius:"8px",color:l?"#94a3b8":"#475569",fontSize:"14px",fontWeight:"500",cursor:l?"not-allowed":"pointer",backgroundColor:l?"#f8fafc":"#FFFFFF",opacity:l?.7:1,userSelect:"none",transition:"all 0.2s ease"}},{children:"Add Variant"}))]}))};exports.CreateRule=function(c){var p,g,h,f,y,x,_,T,D,C,m,S=c.state,A=c.handlers,j=c.uiState,O=(null==j?void 0:j.highlights)||new Map,b=O.get("global_0")||{},V=n.useState({}),R=V[0],I=V[1],w=n.useState(null),E=w[0],q=w[1],W=u.default.useRef(null==j?void 0:j.defaultVariantOpen),N=u.default.useRef(S.variantsByTier);u.default.useEffect(function(){var i,e,n,t,o=null,l=!1;W.current!==(null==j?void 0:j.defaultVariantOpen)&&(l=!0,W.current=null==j?void 0:j.defaultVariantOpen),S.variantsByTier,N.current,l&&(null===(e=null===(i=null==j?void 0:j.tierOptions)||void 0===i?void 0:i.filter(function(i){var e,n;return null===(n=null===(e=S.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===e||e.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=S.variantsByTier)||void 0===e?void 0:e[n])||[]).forEach(function(i,e){(null==j?void 0:j.defaultVariantOpen)===e&&(o="".concat(n,"-variant-").concat(e)),(null==j?void 0:j.autoScrollVariantIndex)===e&&(o="".concat(n,"-variant-").concat(e))})}),o&&q(o)),null===E&&(null==j?void 0:j.defaultVariantOpen)>=0&&(null===(t=null===(n=null==j?void 0:j.tierOptions)||void 0===n?void 0:n.filter(function(i){var e,n;return null===(n=null===(e=S.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===t||t.forEach(function(i){var e,n=i.toLowerCase().replace(/ /g,"_");((null===(e=S.variantsByTier)||void 0===e?void 0:e[n])||[])[j.defaultVariantOpen]&&q("".concat(n,"-variant-").concat(j.defaultVariantOpen))})),N.current=S.variantsByTier},[S.variantsByTier,null==j?void 0:j.defaultVariantOpen,null===(p=S.scopeData)||void 0===p?void 0:p.tiers,null==j?void 0:j.tierOptions,null==j?void 0:j.autoScrollVariantIndex]);var F=function(e){I(function(n){var t;return i.__assign(i.__assign({},n),((t={})[e]=!n[e],t))})},B=function(i){var e,n=null===(e=S.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(n)&&n.length>0?n:S.citations},L={marginTop:"-17px",position:"relative",zIndex:1},M=function(i){i&&i.scrollIntoView({behavior:"smooth",block:"center"})};return console.log("CreateRule state:",S),console.log("CreateRule uiState:",j),e.jsxs("div",i.__assign({className:"traffic-manager-template"},{children:[e.jsx(s.default,i.__assign({title:{type:"other",label:(null==j?void 0:j.setupLabel)||"Rule Setup"},footerData:{ruleTitle:S.ruleTitle,stations:[S.scopeData.station],tiers:null===(g=S.scopeData)||void 0===g?void 0:g.tiers},defaultOpen:"Create"===(null==j?void 0:j.usedFor),readOnly:"Create"!==(null==j?void 0:j.usedFor)},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e.jsx(r.TextSection,i.__assign({id:"rule-title",title:j.ruleTitle||"Rule Title",rows:1,placeholder:"Enter a short, descriptive title for the rule",required:!0,value:S.ruleTitle,onChange:A.setRuleTitle,readOnly:"Create"!==(null==j?void 0:j.usedFor)||(null==j?void 0:j.isAiStreaming),isOpen:R.ruleTitle,onToggle:function(){return F("ruleTitle")},isHighlighted:b.ruleTitle||!1,showCognitiveIcon:S.citation.ruleTitle,tooltipDescription:"Why this Title?",errorMessage:null===(h=j.validationErrors)||void 0===h?void 0:h.ruleTitle},j)),S.citation.ruleTitle&&e.jsx("div",i.__assign({style:L},{children:e.jsx(t.InputDataReasoningCard,{isVisible:R.ruleTitle,citation:S.citation.ruleTitle,citations:B("ruleTitle"),fieldName:"Rule Title",fieldValue:S.ruleTitle})})),e.jsx(a.ScopeSection,i.__assign({id:"scope",title:j.scopeTitle||"Scope",required:!0,scopeData:S.scopeData,onScopeChange:A.onScopeChange,tierLabel:"Which tiers should this rule apply to?",stationLabel:"Which rule set should this rule belong to?",highlights:b,isOpen:R.scopeData,onToggle:function(){return F("scopeData")},showCognitiveIcon:S.citation.scopeData,cognitiveIcon:e.jsx(d.ButtonCognitiveIcon,{}),tooltipDescription:"Why this Scope?",errorMessage:(null===(f=j.validationErrors)||void 0===f?void 0:f.station)||(null===(y=j.validationErrors)||void 0===y?void 0:y.tiers),stationErrorMessage:null===(x=j.validationErrors)||void 0===x?void 0:x.station,tierErrorMessage:null===(_=j.validationErrors)||void 0===_?void 0:_.tiers,readOnly:"Create"!==(null==j?void 0:j.usedFor)||(null==j?void 0:j.isAiStreaming)},j)),S.citation.scopeData&&e.jsx("div",i.__assign({style:L},{children:e.jsx(t.InputDataReasoningCard,{isVisible:R.scopeData,citation:S.citation.scopeData,citations:B("scopeData"),fieldName:"Scope",fieldValue:null===(D=null===(T=S.scopeData)||void 0===T?void 0:T.tiers)||void 0===D?void 0:D.join(", ")})}))]}))})),null===(m=null===(C=null==j?void 0:j.tierOptions)||void 0===C?void 0:C.filter(function(i){var e,n;return null===(n=null===(e=S.scopeData)||void 0===e?void 0:e.tiers)||void 0===n?void 0:n.includes(i)}))||void 0===m?void 0:m.map(function(n,a,d){var c,u,p,g,h=n.toLowerCase().replace(/ /g,"_"),f=(null===(c=S.variantsByTier)||void 0===c?void 0:c[h])||[],y=f.length,x=!1;if(1===y){var _=f[0],T=!(null===(u=null==_?void 0:_.ruleDescription)||void 0===u?void 0:u.trim()),D=(null===(p=null==_?void 0:_.whenToApplyConditions)||void 0===p?void 0:p.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1,C=(null===(g=null==_?void 0:_.whenNotToApplyConditions)||void 0===g?void 0:g.some(function(i){return(null==i?void 0:i.text)&&""!==i.text.trim()}))||!1;T&&!D&&!C&&(x=!0)}var m=x?void 0:"".concat(y," ").concat(1===y?"variant":"variants"," configured for this tier"),b=!((null==j?void 0:j.defaultTierOpen)>=0)||a===j.defaultTierOpen;return console.log("Rendering tier : ",n),e.jsx(s.default,i.__assign({variant:"tier-header",title:{type:"other",label:n},subtitle:m,defaultOpen:b,footerData:{description:"Variants for ".concat(n)}},{children:e.jsx(v,i.__assign({onAddVariant:function(){var i;return null===(i=A.addNewVariant)||void 0===i?void 0:i.call(A,h)},isDisabled:null==j?void 0:j.isAiStreaming},{children:f.map(function(n,a){var d,c,u,v,p,g,y,x,_,T=n.variantType||"default",D="".concat(h,"-variant-").concat(a),C=!0===n.is_variant;(null==j?void 0:j.defaultVariantOpen)>=0&&j.defaultVariantOpen;var m="".concat(h,"_").concat(a),S=O.get(m)||{},b=(null===(c=null===(d=j.separationItemsByTier)||void 0===d?void 0:d[h])||void 0===c?void 0:c.get(a))||[],V=(null===(v=null===(u=j.togglesByTier)||void 0===u?void 0:u[h])||void 0===v?void 0:v.get(a))||[],I=(null==j?void 0:j.autoScrollVariantIndex)===a||!0===n.is_variant;return console.log("Rendering ".concat(h," variant ").concat(a,":"),n),console.log("Rendering Variant : ",n),console.log("Open Accordion ID:",E,"Current Variant ID:",D),console.log("Active variant accordion index in UI state:",null==j?void 0:j.activeVariantAccordionIndex),console.log("Default open for this variant:",null==j?void 0:j.defaultVariantOpen),console.log("UI State:",j),e.jsx("div",i.__assign({ref:I?M:null,style:{width:"100%"}},{children:e.jsx(s.default,i.__assign({title:{type:T,label:n.isReadOnly&&f.length>1?"".concat(a?"Variant "+a:"Default"):(null==j?void 0:j.behaviourLabel)?null==j?void 0:j.behaviourLabel:0==a?"Default":"Variant "+a,isNewVariant:C},defaultOpen:!0,expanded:E===D,onToggle:function(){var i,e=E===D;console.log("is closing:",e),q(e?null:D),null===(i=null==j?void 0:j.setActiveVariantAccordionIndex)||void 0===i||i.call(j,e?null:a)},variant:"rule-behavior",footerData:{ruleTitle:T,description:n.ruleDescription||""}},{children:e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e.jsx(r.TextSection,i.__assign({id:"rule-description-".concat(h,"-").concat(a),title:j.ruleDescriptionTitle||"Rule Description",rows:2,placeholder:"Explain the rule behaviour",required:!0,readOnly:n.isReadOnly||(null==j?void 0:j.isAiStreaming),value:n.ruleDescription||"",onChange:function(i){return A.setRuleDescription(h,a,i)},isOpen:R["ruleDescription-".concat(h,"-").concat(a)],onToggle:function(){return F("ruleDescription-".concat(h,"-").concat(a))},isHighlighted:S.ruleDescription||!1,showCognitiveIcon:null===(p=n.reasoning)||void 0===p?void 0:p.ruleDescription,tooltipDescription:"Why this Description?",errorMessage:null===(g=j.validationErrors)||void 0===g?void 0:g["ruleDescription-".concat(h,"-").concat(a)]},j)),(null===(y=n.reasoning)||void 0===y?void 0:y.ruleDescription)&&e.jsx("div",i.__assign({style:L},{children:e.jsx(t.InputDataReasoningCard,{isVisible:R["ruleDescription-".concat(h,"-").concat(a)],citation:n.reasoning.ruleDescription,citations:B("ruleDescription_".concat(h,"_").concat(a)),fieldName:"Rule Description",fieldValue:n.ruleDescription})})),e.jsx(o.ConditionSection,i.__assign({id:"when-to-apply-".concat(h,"-").concat(a),title:j.whenToApplyTitle||"When to apply",required:!0,dividerRequired:!0,readOnly:n.isReadOnly||(null==j?void 0:j.isAiStreaming),conditions:n.whenToApplyConditions||[],onAdd:function(){return A.addWhenToApply(h,a)},onRemove:function(i,e,n){return A.removeWhenToApply(i,e,n)},onEdit:function(i,e,n,t){return A.editWhenToApply(i,e,n,t)},index:a,tierKey:h,isHighlighted:S.wta||!1,highlightedIds:null==j?void 0:j.highlightedIds,tooltipDescription:"Why this Condition?",citations:B("whenToApply_".concat(h,"_").concat(a)),bordered:!0,addLabel:"Add When to apply",isAiStreaming:j.isAiStreaming,errorMessage:null===(x=j.validationErrors)||void 0===x?void 0:x["whenToApply-".concat(h,"-").concat(a)]},j)),e.jsx(o.ConditionSection,i.__assign({id:"when-not-to-apply-".concat(h,"-").concat(a),title:j.whenNotToApplyTitle||"When NOT to apply",required:!1,dividerRequired:!0,readOnly:n.isReadOnly||(null==j?void 0:j.isAiStreaming),conditions:n.whenNotToApplyConditions||[],onAdd:function(){return A.addWhenNotToApply(h,a)},onRemove:function(i,e,n){return A.removeWhenNotToApply(i,e,n)},onEdit:function(i,e,n,t){return A.editWhenNotToApply(i,e,n,t)},index:a,tierKey:h,isHighlighted:S.wnta||!1,highlightedIds:null==j?void 0:j.highlightedIds,tooltipDescription:"Why this Condition?",citations:B("whenNotToApply_".concat(h,"_").concat(a)),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:j.isAiStreaming},j)),e.jsx(l.ConfigSection,i.__assign({id:"config-".concat(h,"-").concat(a),title:j.configTitle||"Configuration",required:!1,highlights:S,bordered:!0,readOnly:n.isReadOnly||(null==j?void 0:j.isAiStreaming),onConfigChange:function(i,e){return A.onConfigChange(h,a,i,e)},separationItems:b,toggles:V,index:a},j)),(null===(_=n.reasoning)||void 0===_?void 0:_.configData)&&e.jsx("div",i.__assign({style:L},{children:e.jsx(t.InputDataReasoningCard,{citation:n.reasoning.configData,citations:B("configData_".concat(h,"_").concat(a)),fieldName:"Configuration",fieldValue:"Proposed Configuration"})}))]}))}),D)}),"".concat(h,"-variant-").concat(a))})}))}),"tier-".concat(a))})]}))};
2
2
  //# sourceMappingURL=CreateRule.js.map