@e-llm-studio/federated-dashboard-components 2.2.9-rca-test-16 → 2.2.9-rca-test-17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ExecutiveDashboard/api/insightsApi.js +1 -1
- package/dist/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
- package/dist/ExecutiveDashboard/components/Graph/axisDomain.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/AgReport.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/CommentsThread.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/DrillTable.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/InsightTabs.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/KpiChart.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/L1Report.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/NeedsAttention.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/ReportDrawer.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/agPrimitives.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/drillDay.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/insightsErrors.js +2 -0
- package/dist/ExecutiveDashboard/components/Insights/insightsErrors.js.map +1 -0
- package/dist/ExecutiveDashboard/components/Insights/insightsFormat.js +1 -1
- package/dist/ExecutiveDashboard/components/Insights/insightsUtils.js +1 -1
- package/dist/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.js +1 -1
- package/dist/ExecutiveDashboard/components/Table/TableCard.js +1 -1
- package/dist/HumanIntelligence/HumanChangesTableWrapper.js +1 -1
- package/dist/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.js +1 -1
- package/dist/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.js +1 -1
- package/dist/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js +1 -1
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js +2 -0
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js.map +1 -0
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js +2 -0
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js.map +1 -0
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js +2 -0
- package/dist/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js.map +1 -0
- package/dist/HumanIntelligence/hooks/accessToken.js +2 -0
- package/dist/HumanIntelligence/hooks/accessToken.js.map +1 -0
- package/dist/HumanIntelligence/hooks/useHumanChangesData.js +1 -1
- package/dist/HumanIntelligence/utils/inlineMarkup.js +1 -1
- package/dist/cjs/ExecutiveDashboard/api/insightsApi.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Graph/LineChart.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Graph/axisDomain.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/AgReport.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/CommentsThread.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/DrillTable.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/InsightTabs.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/KpiChart.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/L1Report.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/NeedsAttention.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/ReportDrawer.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/agPrimitives.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/drillDay.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/insightsErrors.js +2 -0
- package/dist/cjs/ExecutiveDashboard/components/Insights/insightsErrors.js.map +1 -0
- package/dist/cjs/ExecutiveDashboard/components/Insights/insightsFormat.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Insights/insightsUtils.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.js +1 -1
- package/dist/cjs/ExecutiveDashboard/components/Table/TableCard.js +1 -1
- package/dist/cjs/HumanIntelligence/HumanChangesTableWrapper.js +1 -1
- package/dist/cjs/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.js +1 -1
- package/dist/cjs/HumanIntelligence/components/HumanChangesSummary/HumanChangesSummary.js +1 -1
- package/dist/cjs/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js +1 -1
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js +2 -0
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.js.map +1 -0
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js +2 -0
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.module.css.js.map +1 -0
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js +2 -0
- package/dist/cjs/HumanIntelligence/components/ReviewLearningConditionsModal/parser.js.map +1 -0
- package/dist/cjs/HumanIntelligence/hooks/accessToken.js +2 -0
- package/dist/cjs/HumanIntelligence/hooks/accessToken.js.map +1 -0
- package/dist/cjs/HumanIntelligence/hooks/useHumanChangesData.js +1 -1
- package/dist/cjs/HumanIntelligence/utils/inlineMarkup.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/ExecutiveDashboard/TestExecutiveDashboard.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/api/insightsApi.d.ts +9 -0
- package/dist/types/ExecutiveDashboard/api/insightsApi.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Graph/LineChart.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Graph/axisDomain.d.ts +4 -4
- package/dist/types/ExecutiveDashboard/components/Graph/axisDomain.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts +2 -0
- package/dist/types/ExecutiveDashboard/components/Graph/types.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/AgReport.d.ts +18 -3
- package/dist/types/ExecutiveDashboard/components/Insights/AgReport.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/CommentsThread.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/DrillTable.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/InsightTabs.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/KpiChart.d.ts +28 -2
- package/dist/types/ExecutiveDashboard/components/Insights/KpiChart.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/L1Report.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/NeedsAttention.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/ReportDrawer.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/agPrimitives.d.ts +7 -1
- package/dist/types/ExecutiveDashboard/components/Insights/agPrimitives.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/drillDay.d.ts +9 -4
- package/dist/types/ExecutiveDashboard/components/Insights/drillDay.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Insights/insightsErrors.d.ts +11 -0
- package/dist/types/ExecutiveDashboard/components/Insights/insightsErrors.d.ts.map +1 -0
- package/dist/types/ExecutiveDashboard/components/Insights/insightsFormat.d.ts +38 -0
- package/dist/types/ExecutiveDashboard/components/Insights/insightsFormat.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/RcaDecisionComponent/RcaDecisionComponent.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/components/Table/TableCard.d.ts +6 -1
- package/dist/types/ExecutiveDashboard/components/Table/TableCard.d.ts.map +1 -1
- package/dist/types/ExecutiveDashboard/types/insights.d.ts +10 -0
- package/dist/types/ExecutiveDashboard/types/insights.d.ts.map +1 -1
- package/dist/types/HumanIntelligence/HumanChangesTableWrapper.d.ts.map +1 -1
- package/dist/types/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.d.ts +2 -0
- package/dist/types/HumanIntelligence/components/CognitiveDecisioning/CognitiveDecisioning.d.ts.map +1 -1
- package/dist/types/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.d.ts +2 -0
- package/dist/types/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.d.ts.map +1 -1
- package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.d.ts +5 -0
- package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/ReviewLearningConditionsModal.d.ts.map +1 -0
- package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/parser.d.ts +20 -0
- package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/parser.d.ts.map +1 -0
- package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/types.d.ts +45 -0
- package/dist/types/HumanIntelligence/components/ReviewLearningConditionsModal/types.d.ts.map +1 -0
- package/dist/types/HumanIntelligence/hooks/accessToken.d.ts +13 -0
- package/dist/types/HumanIntelligence/hooks/accessToken.d.ts.map +1 -0
- package/dist/types/HumanIntelligence/hooks/useHumanChangesData.d.ts +12 -4
- package/dist/types/HumanIntelligence/hooks/useHumanChangesData.d.ts.map +1 -1
- package/dist/types/HumanIntelligence/utils/inlineMarkup.d.ts +2 -0
- package/dist/types/HumanIntelligence/utils/inlineMarkup.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),a=require("./HumanChangesSummary.module.css.js"),r=require("../../utils/inlineMarkup.js");exports.HumanChangesSummary=function(i){var l=i.label,n=void 0===l?"HUMAN CHANGES SUMMARY":l,t=i.children,u=i.className,c=e.__rest(i,["label","children","className"]);return s.jsxs("div",e.__assign({className:"".concat(a.default.summaryContainer," ").concat(u||"").trim()},c,{children:[s.jsx("h3",e.__assign({className:a.default.label},{children:n})),s.jsx("div",e.__assign({className:a.default.summaryText},{children:r.renderInlineMarkup(t,{classNames:{mark:a.default.highlight},stripUnknownTags:!0})}))]}))};
|
|
2
2
|
//# sourceMappingURL=HumanChangesSummary.js.map
|
package/dist/cjs/HumanIntelligence/components/HumanIntelligenceCard/HumanIntelligenceCard.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),a=require("./HumanIntelligenceCard.module.css.js"),i=require("../PatternDetails/PatternDetails.js"),s=require("../HumanChangesSummary/HumanChangesSummary.js"),t=require("../CognitiveDecisioning/CognitiveDecisioning.js");exports.HumanIntelligenceCard=function(r){var l=r.patternDetails,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),a=require("./HumanIntelligenceCard.module.css.js"),i=require("../PatternDetails/PatternDetails.js"),s=require("../HumanChangesSummary/HumanChangesSummary.js"),t=require("../CognitiveDecisioning/CognitiveDecisioning.js");exports.HumanIntelligenceCard=function(r){var l=r.patternDetails,c=r.humanChangesSummary;r.analysisAccordion;var g=r.cognitiveDecisioning,o=r.humanIntelligentConfigId,u=r.baseUrl,m=r.accessToken,d=r.agentConfig,C=r.children,h=r.className,_=e.__rest(r,["patternDetails","humanChangesSummary","analysisAccordion","cognitiveDecisioning","humanIntelligentConfigId","baseUrl","accessToken","agentConfig","children","className"]);return n.jsxs("div",e.__assign({className:"".concat(a.default.cardContainer," ").concat(h||"").trim()},_,{children:[l&&n.jsx(i.PatternDetails,e.__assign({label:l.label},{children:l.content})),l&&c&&n.jsx("div",{className:a.default.separator}),c&&n.jsx(s.HumanChangesSummary,e.__assign({label:c.label},{children:c.content})),g&&n.jsx(t.CognitiveDecisioning,{data:e.__assign(e.__assign({},g),{humanIntelligentConfigId:g.humanIntelligentConfigId||o,baseUrl:g.baseUrl||u,accessToken:g.accessToken||m,agentConfig:g.agentConfig||d}),changeLogs:g.changeLogs,defaultOpen:!1}),C]}))};
|
|
2
2
|
//# sourceMappingURL=HumanIntelligenceCard.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),s=require("react"),t=require("lucide-react"),a=require("./parser.js"),i=require("./ReviewLearningConditionsModal.module.css.js"),l=function(l){var r=l.isOpen,c=l.onClose,o=l.onContinue,d=l.summary,u=l.inferredLearning,f=l.isLoading,g=void 0!==f&&f,_=s.useState([]),p=_[0],h=_[1],m=s.useState(""),x=m[0],j=m[1],v=s.useState(null),b=(v[0],v[1]),N=s.useState("");N[0];var C=N[1];if(s.useEffect(function(){if(r){var e=a.parseSuggestedRule(d);h(e.categories),j(e.ruleAction||"New rule."),b(null),C("")}},[r,d]),!r)return null;var y=(null==u?void 0:u.trim())||x||"",k=p.filter(function(e){return"configurable"===e.type}).flatMap(function(e){return e.options||[]}),S=k.length>0&&k.every(function(e){return e.selected});return n.jsx("div",e.__assign({className:i.default.overlay,onClick:c,role:"dialog","aria-modal":"true","aria-labelledby":"review-learning-title"},{children:n.jsxs("div",e.__assign({className:i.default.modal,onClick:function(e){return e.stopPropagation()}},{children:[n.jsxs("div",e.__assign({className:i.default.header},{children:[n.jsx("h2",e.__assign({id:"review-learning-title",className:i.default.title},{children:"Review learning conditions"})),n.jsx("p",e.__assign({className:i.default.subtitle},{children:"We identified these conditions from the recurring pattern. Deselect anything that should not be included in the learning."})),n.jsx("button",e.__assign({type:"button",className:i.default.closeButton,onClick:c,"aria-label":"Close dialog"},{children:n.jsx(t.X,{size:18})}))]})),n.jsxs("div",e.__assign({className:i.default.body},{children:[Boolean(y)&&n.jsxs("div",e.__assign({className:i.default.inferredCard},{children:[n.jsx("div",e.__assign({className:i.default.inferredLabel},{children:"Inferred Learning"})),n.jsx("p",e.__assign({className:i.default.inferredText},{children:y}))]})),n.jsx("div",e.__assign({className:i.default.selectAllRow},{children:n.jsxs("button",e.__assign({type:"button",className:i.default.selectAllControl,onClick:function(){var n=!S;console.log("Select all toggled",{shouldSelectAll:n}),h(function(s){return s.map(function(s){return"configurable"!==s.type?s:e.__assign(e.__assign({},s),{options:s.options.map(function(s){return e.__assign(e.__assign({},s),{selected:n})})})})})},"aria-pressed":S},{children:[n.jsx("span",e.__assign({className:"".concat(i.default.selectAllCheckbox," ").concat(S?i.default.selectAllCheckboxChecked:"")},{children:S&&n.jsx(t.Check,{size:12,strokeWidth:3})})),n.jsx("span",{children:"Select all"})]}))})),p.map(function(s,a){if("configurable"!==s.type)return null;var l=(s.options||[]).filter(function(e){return e.selected}).length;return s.tag,n.jsxs("div",e.__assign({className:i.default.categorySection},{children:[n.jsxs("div",e.__assign({className:i.default.categoryHeader},{children:[n.jsx("span",e.__assign({className:i.default.categoryLabel},{children:s.label})),n.jsxs("span",e.__assign({className:i.default.categoryCount},{children:[l," selected"]}))]})),n.jsx("div",e.__assign({className:i.default.pillsRow},{children:(s.options||[]).map(function(s){return n.jsxs("button",e.__assign({type:"button",className:"".concat(i.default.pill," ").concat(s.selected?i.default.pillSelected:i.default.pillDeselected),onClick:function(){return function(n,s){h(function(t){return t.map(function(t,a){return a!==n?t:e.__assign(e.__assign({},t),{options:t.options.map(function(n){return n.id===s?e.__assign(e.__assign({},n),{selected:!n.selected}):n})})})})}(a,s.id)}},{children:[s.selected&&n.jsx(t.Check,{size:13,strokeWidth:2.5,className:i.default.checkIcon}),n.jsx("span",{children:s.value})]}),s.id)})}))]}),s.tag||"cat-".concat(a))})]})),n.jsxs("div",e.__assign({className:i.default.footer},{children:[n.jsx("button",e.__assign({type:"button",className:i.default.cancelButton,onClick:c,disabled:g},{children:"Cancel"})),n.jsx("button",e.__assign({type:"button",className:i.default.continueButton,onClick:function(){var e=a.buildDraftMessage(p,x);o(e)},disabled:g},{children:g?"Preparing...":"Continue to Generate Learning"}))]}))]}))}))};exports.ReviewLearningConditionsModal=l,exports.default=l;
|
|
2
|
+
//# sourceMappingURL=ReviewLearningConditionsModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReviewLearningConditionsModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default={overlay:"ReviewLearningConditionsModal-module_overlay__7x4JS",fadeIn:"ReviewLearningConditionsModal-module_fadeIn__M5tiM",modal:"ReviewLearningConditionsModal-module_modal__b6vcs",slideUp:"ReviewLearningConditionsModal-module_slideUp__I1z5s",header:"ReviewLearningConditionsModal-module_header__H37IG",title:"ReviewLearningConditionsModal-module_title__IxeAR",subtitle:"ReviewLearningConditionsModal-module_subtitle__UfjDL",closeButton:"ReviewLearningConditionsModal-module_closeButton__P1hJi",body:"ReviewLearningConditionsModal-module_body__ZXzL-",inferredCard:"ReviewLearningConditionsModal-module_inferredCard__JFTxd",inferredLabel:"ReviewLearningConditionsModal-module_inferredLabel__saLT7",inferredText:"ReviewLearningConditionsModal-module_inferredText__WNLhx",categorySection:"ReviewLearningConditionsModal-module_categorySection__AILgJ",categoryHeader:"ReviewLearningConditionsModal-module_categoryHeader__LaW5a",categoryLabel:"ReviewLearningConditionsModal-module_categoryLabel__H4Nn9",categoryCount:"ReviewLearningConditionsModal-module_categoryCount__opzUO",selectAllRow:"ReviewLearningConditionsModal-module_selectAllRow__-H8PS",selectAllControl:"ReviewLearningConditionsModal-module_selectAllControl__NUtrJ",selectAllCheckbox:"ReviewLearningConditionsModal-module_selectAllCheckbox__eOk-V",selectAllCheckboxChecked:"ReviewLearningConditionsModal-module_selectAllCheckboxChecked__BG0OE",pillsRow:"ReviewLearningConditionsModal-module_pillsRow__DLqtd",pill:"ReviewLearningConditionsModal-module_pill__qPAoB",pillSelected:"ReviewLearningConditionsModal-module_pillSelected__hd3EE",pillDeselected:"ReviewLearningConditionsModal-module_pillDeselected__Fkbfn",checkIcon:"ReviewLearningConditionsModal-module_checkIcon__yWJ7l",addButton:"ReviewLearningConditionsModal-module_addButton__kpXy1",addInputContainer:"ReviewLearningConditionsModal-module_addInputContainer__rkGYe",addInput:"ReviewLearningConditionsModal-module_addInput__lIcIg",addConfirmButton:"ReviewLearningConditionsModal-module_addConfirmButton__HczRO",addCancelButton:"ReviewLearningConditionsModal-module_addCancelButton__XigwV",footer:"ReviewLearningConditionsModal-module_footer__7FiJ7",cancelButton:"ReviewLearningConditionsModal-module_cancelButton__OqwLc",continueButton:"ReviewLearningConditionsModal-module_continueButton__dNBHk"};
|
|
2
|
+
//# sourceMappingURL=ReviewLearningConditionsModal.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReviewLearningConditionsModal.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";function e(e){return e?e.replace(/[_-]+/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}).trim():""}function t(e){return e?e.replace(/<[^>]+>/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim():""}function n(e){for(var t,n,r,l={},c=/([a-zA-Z_:][-\w:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;null!==(r=c.exec(e));)l[r[1].toLowerCase()]=null!==(n=null!==(t=r[2])&&void 0!==t?t:r[3])&&void 0!==n?n:"";return l}function r(e){var t,n,r=(e.options||[]).filter(function(e){return e.selected}).map(function(e){return e.value.trim()}).filter(Boolean);return 0===r.length?"":1===r.length?r[0]:(t=r).length<=1?null!==(n=t[0])&&void 0!==n?n:"":2===t.length?"".concat(t[0]," and ").concat(t[1]):"".concat(t.slice(0,-1).join(", "),", and ").concat(t[t.length-1])}Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildDraftMessage=function(e,t){void 0===t&&(t="New rule.");var n="";if(t&&(n+="<p><b>RULE ACTION</b><br>".concat(t,"</p>")),e&&e.length>0){n+="<p><b>SUGGESTED RULE</b></p><ul>";for(var l=0,c=e;l<c.length;l++){var o=c[l],a=o.label?"".concat(o.label,": "):"";if("static"!==o.type){var i=r(o);i&&(n+="<li>".concat(a).concat(i,".</li>"))}else o.text&&(n+="<li>".concat(a).concat(o.text,"</li>"))}n+="</ul>"}return n},exports.formatTagLabel=e,exports.parseSuggestedRule=function(r){if(!r||"string"!=typeof r)return{categories:[],ruleAction:""};var l="New rule.",c=r.match(/<rule_action>\s*<p>\s*<b>RULE ACTION<\/b>\s*<br\s*\/?>\s*([\s\S]*?)\s*<\/p>\s*<\/rule_action>/i)||r.match(/<rule_action>([\s\S]*?)<\/rule_action>/i);c&&c[1]&&(l=t(c[1]).replace(/^RULE ACTION\s*/i,"").trim());for(var o,a=r.match(/<suggested_rule>([\s\S]*?)<\/suggested_rule>/i),i=a?a[1]:r,s=[],u=/<condition\b([^>]*)>([\s\S]*?)<\/condition>/gi,p=0;null!==(o=u.exec(i));){var g=n(o[1]),f=o[2],b=f.indexOf(":"),d=b>-1?t(f.slice(0,b)):"",v=b>-1?f.slice(b+1):f,h=g.id||d.toLowerCase().replace(/[\s-]+/g,"_").replace(/[^a-z0-9_]/g,"")||"condition_".concat(p);if(p+=1,"configurable"===g.type||"static"!==g.type&&/<option\b/i.test(v)){for(var _=[],x=/<option\b([^>]*)>([\s\S]*?)<\/option>/gi,m=void 0;null!==(m=x.exec(v));){var S=t(m[2]);S&&_.push({id:"".concat(h,"_").concat(_.length),value:S,selected:!1})}0!==_.length&&s.push({tag:h,label:d||e(h),type:"configurable",options:_})}else s.push({tag:h,label:d,type:"static",text:t(v),options:[]})}return{categories:s,ruleAction:l}};
|
|
2
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=e.createContext(void 0);exports.AccessTokenContext=t,exports.authHeader=function(e){return e?{Authorization:"Bearer ".concat(e)}:{}},exports.useAccessToken=function(r){var o=e.useContext(t);return null!=r?r:o};
|
|
2
|
+
//# sourceMappingURL=accessToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessToken.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react");function r(e,t){var r,n,a;return{id:null!==(r=e.humanChangeId)&&void 0!==r?r:"row_".concat(t),humanChangeId:e.humanChangeId,humanChangeScopeId:e.humanChangeScopeId,intentId:e.intentId,scopeId:e.scopeId,scopeName:e.scopeName,level:e.level,title:null!==(a=null!==(n=e.title)&&void 0!==n?n:e.summary)&&void 0!==a?a:"—",summary:e.summary,frequency:e.occurrenceFrequency,reviewStatus:e.reviewStatus,impactLabel:e.impactLabel,kpi:e.kpi,blastRadius:e.blastRadius,hasChildren:e.hasChildren,childrenCount:e.childrenCount,cognitiveDecisioning:e.cognitiveDecisioning,raw:e}}var n=new Map;exports.useBusinessContextData=function(r){var a=this,s=r.baseUrl,o=r.humanIntelligentConfigId,i=r.agentConfig,u=r.skip,c=void 0!==u&&u,l=t.useState(""),d=l[0],f=l[1],h=t.useState(!1),g=h[0],v=h[1],p=t.useState(null),m=p[0],y=p[1],_=t.useState(0),b=_[0],S=_[1],w=t.useCallback(function(){return S(function(e){return e+1})},[]);return t.useEffect(function(){var t=!0;if(c||!s||!o||!i)return f(""),v(!1),void y(null);return e.__awaiter(a,void 0,void 0,function(){var r,a,u,c,l,d=this;return e.__generator(this,function(h){switch(h.label){case 0:v(!0),y(null),r={humanIntelligentConfigId:o,agentConfig:i},a="business-context:".concat(s,":").concat(JSON.stringify(r)),h.label=1;case 1:return h.trys.push([1,3,4,5]),n.has(a)||(u=fetch("".concat(s,"/federated/human_change_config_filters/business-context"),{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify(r)}).then(function(t){return e.__awaiter(d,void 0,void 0,function(){var r,n;return e.__generator(this,function(e){switch(e.label){case 0:if(!t.ok)throw new Error("Failed to fetch business context: ".concat(t.statusText));return[4,t.json()];case 1:if((r=e.sent()).success&&r.data&&r.data.business_context)return[2,r.data.business_context];throw new Error((null===(n=r.error)||void 0===n?void 0:n.errorMessage)||"Invalid API response format")}})})}).catch(function(e){throw n.delete(a),e}),n.set(a,u)),[4,n.get(a)];case 2:return c=h.sent(),t?(f(c),[3,5]):[2];case 3:return l=h.sent(),t&&(console.error("Error fetching business context:",l),y(l.message||"An error occurred while fetching business context."),f("")),[3,5];case 4:return t&&v(!1),[7];case 5:return[2]}})}),function(){t=!1}},[s,o,i,c,b]),{data:d,loading:g,error:m,refetch:w}},exports.useCitationChangelogs=function(r){var n=this,a=r.baseUrl,s=r.configId,o=r.changeLogIds,i=r.skip,u=void 0!==i&&i,c=t.useState([]),l=c[0],d=c[1],f=t.useState(!1),h=f[0],g=f[1],v=t.useState(null),p=v[0],m=v[1],y=t.useState(0),_=y[0],b=y[1],S=t.useCallback(function(){return b(function(e){return e+1})},[]),w=t.useState(null),C=w[0],I=w[1],x=t.useState(!0),A=x[0],E=x[1],N=t.useState(!1),O=N[0],j=N[1],k=t.useState(null),T=k[0],P=k[1],J=t.useRef(!1);t.useEffect(function(){if(d([]),I(null),E(!0),m(null),P(null),!u&&a&&s&&0!==o.length){var t=!0;return e.__awaiter(n,void 0,void 0,function(){var r,n,i,u,c,l,f;return e.__generator(this,function(e){switch(e.label){case 0:g(!0),J.current=!0,e.label=1;case 1:return e.trys.push([1,4,5,6]),r={configId:s,changeLogIds:o,orderBy:"latestFirst",pageSize:15},[4,fetch("".concat(a,"/changelog/audit-log/fetch-by-ids"),{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify(r)})];case 2:if(!(n=e.sent()).ok)throw new Error("Failed to fetch changelogs: ".concat(n.statusText));return[4,n.json()];case 3:if(i=e.sent(),!t)return[2];if(!1===i.success)throw new Error((null===(f=i.error)||void 0===f?void 0:f.errorMessage)||i.error||"Invalid API response format");return u=i.data||i,c=Array.isArray(u.items)?u.items:Array.isArray(u)?u:[],d(c),I(u.nextCursor||null),E(!!u.hasNext),[3,6];case 4:return l=e.sent(),t&&(console.error("Error fetching changelogs:",l),m(l.message||"An error occurred while fetching changelogs.")),[3,6];case 5:return t&&(g(!1),J.current=!1),[7];case 6:return[2]}})}),function(){t=!1}}g(!1)},[a,s,JSON.stringify(o),u,_]);var M=t.useCallback(function(){return e.__awaiter(n,void 0,void 0,function(){var t,r,n,i,c,l,f;return e.__generator(this,function(h){switch(h.label){case 0:if(u||!a||!s||0===o.length||!A||J.current)return[2];J.current=!0,j(!0),P(null),h.label=1;case 1:return h.trys.push([1,4,5,6]),t={configId:s,changeLogIds:o,orderBy:"latestFirst",pageSize:15},C&&(t.cursor=C),[4,fetch("".concat(a,"/changelog/audit-log/fetch-by-ids"),{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify(t)})];case 2:if(!(r=h.sent()).ok)throw new Error("Failed to fetch changelogs: ".concat(r.statusText));return[4,r.json()];case 3:if(!1===(n=h.sent()).success)throw new Error((null===(f=n.error)||void 0===f?void 0:f.errorMessage)||n.error||"Invalid API response format");return i=n.data||n,c=Array.isArray(i.items)?i.items:Array.isArray(i)?i:[],d(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),c,!0)}),I(i.nextCursor||null),E(!!i.hasNext),[3,6];case 4:return l=h.sent(),console.error("Error fetching next changelogs page:",l),P(l.message||"Failed to fetch more logs."),[3,6];case 5:return j(!1),J.current=!1,[7];case 6:return[2]}})})},[a,s,JSON.stringify(o),u,A,C]);return{data:l,loading:h,error:p,fetchNextPage:M,hasNextPage:A,isFetchingNextPage:O,fetchNextPageError:T,refetch:S}},exports.useCitationSegments=function(r){var a=this,s=r.baseUrl,o=r.humanIntelligentConfigId,i=r.segmentIds,u=r.skip,c=void 0!==u&&u,l=t.useState([]),d=l[0],f=l[1],h=t.useState(!1),g=h[0],v=h[1],p=t.useState(null),m=p[0],y=p[1],_=t.useState(0),b=_[0],S=_[1],w=t.useCallback(function(){return S(function(e){return e+1})},[]);return t.useEffect(function(){var t=!0;if(c||!s||!o||0===(null==i?void 0:i.length))return f([]),v(!1),void y(null);return e.__awaiter(a,void 0,void 0,function(){var r,a,u,c,l,d=this;return e.__generator(this,function(h){switch(h.label){case 0:v(!0),y(null),r={humanIntelligentConfigId:o,segment_ids:i},a="segment-details:".concat(s,":").concat(JSON.stringify(r)),h.label=1;case 1:return h.trys.push([1,3,4,5]),n.has(a)||(u=fetch("".concat(s,"/federated/human_change_config_filters/segment-details"),{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify(r)}).then(function(t){return e.__awaiter(d,void 0,void 0,function(){var r,n;return e.__generator(this,function(e){switch(e.label){case 0:if(!t.ok)throw new Error("Failed to fetch segment details: ".concat(t.statusText));return[4,t.json()];case 1:if((r=e.sent()).success&&r.data&&Array.isArray(r.data.segments))return[2,r.data.segments];throw new Error((null===(n=r.error)||void 0===n?void 0:n.errorMessage)||"Invalid API response format")}})})}).catch(function(e){throw n.delete(a),e}),n.set(a,u)),[4,n.get(a)];case 2:return c=h.sent(),t?(f(c),[3,5]):[2];case 3:return l=h.sent(),t&&(console.error("Error fetching citation segments:",l),y(l.message||"An error occurred while fetching citation data."),f([])),[3,5];case 4:return t&&v(!1),[7];case 5:return[2]}})}),function(){t=!1}},[s,o,JSON.stringify(i),c,b]),{data:d,loading:g,error:m,refetch:w}},exports.useHumanChangesData=function(n){var a=this,s=n.baseUrl,o=n.endpoint,i=n.humanChangeConfigId,u=n.eventId,c=n.filters,l=n.pageSize,d=void 0===l?12:l,f=t.useState([]),h=f[0],g=f[1],v=t.useState(!1),p=v[0],m=v[1],y=t.useState(!1),_=y[0],b=y[1],S=t.useState(null),w=S[0],C=S[1],I=t.useState(!0),x=I[0],A=I[1],E=t.useRef(void 0),N=t.useRef(0),O=t.useRef(null),j=s&&o?"".concat(s).concat(o):void 0,k=t.useCallback(function(t){return e.__awaiter(a,void 0,void 0,function(){var n,a,s,o,l,f,h,v,p,y,_,S,w;return e.__generator(this,function(I){switch(I.label){case 0:if(!j||!i)return[2];null===(w=O.current)||void 0===w||w.abort(),n=new AbortController,O.current=n,a=++N.current,t.append?b(!0):m(!0),C(null),I.label=1;case 1:return I.trys.push([1,4,5,6]),s={humanIntelligentConfigId:i,filters:c,pageSize:d},u&&(s.event_id=u),t.append&&E.current&&(s.cursor=E.current),[4,fetch(j,{method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s),signal:n.signal})];case 2:if(!(o=I.sent()).ok)throw new Error("Request failed: ".concat(o.status," ").concat(o.statusText));return[4,o.json()];case 3:if(l=I.sent(),a!==N.current)return[2];if(!1===(null==l?void 0:l.success))throw new Error("string"==typeof l.error?l.error:"Fetching human changes failed.");return f=function(e){var t,r;return null!==(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.humanChanges)&&void 0!==r?r:[]}(l),h=f.map(r),v=function(e,t){var r,n,a,s=null!==(n=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.nextCursor)&&void 0!==n?n:null,o=null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.pageSize;return{nextCursor:s,hasMore:!!s&&t>0&&("number"==typeof o?t>=o:t>0)}}(l,f.length),p=v.nextCursor,y=v.hasMore,_=!p||p!==E.current,E.current=null!=p?p:void 0,g(function(r){return t.append?e.__spreadArray(e.__spreadArray([],r,!0),h,!0):h}),A(y&&_),[3,6];case 4:return S=I.sent(),n.signal.aborted||a!==N.current?[2]:(C(S),t.append||g([]),A(!1),[3,6]);case 5:return n.signal.aborted||a!==N.current||(m(!1),b(!1)),O.current===n&&(O.current=null),[7];case 6:return[2]}})})},[j,i,u,JSON.stringify(c),d]);t.useEffect(function(){E.current=void 0,A(!0),k({append:!1})},[j,i,u,JSON.stringify(c),d]),t.useEffect(function(){return function(){var e;return null===(e=O.current)||void 0===e?void 0:e.abort()}},[]);var T=t.useCallback(function(){p||_||!x||k({append:!0})},[p,_,x,k]),P=t.useCallback(function(){E.current=void 0,A(!0),k({append:!1})},[k]);return{rows:h,loading:p,loadingMore:_,hasMore:x,fetchMore:T,refetch:P,error:w}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react"),n=require("./accessToken.js");function r(e,t){var n,r,a;return{id:null!==(n=e.humanChangeId)&&void 0!==n?n:"row_".concat(t),humanChangeId:e.humanChangeId,humanChangeScopeId:e.humanChangeScopeId,intentId:e.intentId,scopeId:e.scopeId,scopeName:e.scopeName,level:e.level,title:null!==(a=null!==(r=e.title)&&void 0!==r?r:e.summary)&&void 0!==a?a:"—",summary:e.summary,frequency:e.occurrenceFrequency,reviewStatus:e.reviewStatus,impactLabel:e.impactLabel,kpi:e.kpi,blastRadius:e.blastRadius,hasChildren:e.hasChildren,childrenCount:e.childrenCount,cognitiveDecisioning:e.cognitiveDecisioning,raw:e}}var a=new Map;exports.useBusinessContextData=function(r){var s=this,o=r.baseUrl,i=r.accessToken,u=r.humanIntelligentConfigId,c=r.agentConfig,l=r.skip,d=void 0!==l&&l,f=n.useAccessToken(i),h=t.useState(""),g=h[0],v=h[1],p=t.useState(!1),_=p[0],m=p[1],y=t.useState(null),b=y[0],S=y[1],w=t.useState(0),C=w[0],I=w[1],x=t.useCallback(function(){return I(function(e){return e+1})},[]);return t.useEffect(function(){var t=!0;if(d||!o||!u||!c)return v(""),m(!1),void S(null);return e.__awaiter(s,void 0,void 0,function(){var r,s,i,l,d,h=this;return e.__generator(this,function(g){switch(g.label){case 0:m(!0),S(null),r={humanIntelligentConfigId:u,agentConfig:c},s="business-context:".concat(o,":").concat(JSON.stringify(r)),g.label=1;case 1:return g.trys.push([1,3,4,5]),a.has(s)||(i=fetch("".concat(o,"/federated/human_change_config_filters/business-context"),{method:"POST",headers:e.__assign({"Content-Type":"application/json",accept:"application/json"},n.authHeader(f)),body:JSON.stringify(r)}).then(function(t){return e.__awaiter(h,void 0,void 0,function(){var n,r;return e.__generator(this,function(e){switch(e.label){case 0:if(!t.ok)throw new Error("Failed to fetch business context: ".concat(t.statusText));return[4,t.json()];case 1:if((n=e.sent()).success&&n.data&&n.data.business_context)return[2,n.data.business_context];throw new Error((null===(r=n.error)||void 0===r?void 0:r.errorMessage)||"Invalid API response format")}})})}).catch(function(e){throw a.delete(s),e}),a.set(s,i)),[4,a.get(s)];case 2:return l=g.sent(),t?(v(l),[3,5]):[2];case 3:return d=g.sent(),t&&(console.error("Error fetching business context:",d),S(d.message||"An error occurred while fetching business context."),v("")),[3,5];case 4:return t&&m(!1),[7];case 5:return[2]}})}),function(){t=!1}},[o,f,u,c,d,C]),{data:g,loading:_,error:b,refetch:x}},exports.useCitationChangelogs=function(r){var a=this,s=r.baseUrl,o=r.accessToken,i=r.configId,u=r.changeLogIds,c=r.skip,l=void 0!==c&&c,d=n.useAccessToken(o),f=t.useState([]),h=f[0],g=f[1],v=t.useState(!1),p=v[0],_=v[1],m=t.useState(null),y=m[0],b=m[1],S=t.useState(0),w=S[0],C=S[1],I=t.useCallback(function(){return C(function(e){return e+1})},[]),x=t.useState(null),k=x[0],A=x[1],T=t.useState(!0),E=T[0],N=T[1],j=t.useState(!1),O=j[0],P=j[1],J=t.useState(null),M=J[0],F=J[1],R=t.useRef(!1);t.useEffect(function(){if(g([]),A(null),N(!0),b(null),F(null),!l&&s&&i&&0!==u.length){var t=!0;return e.__awaiter(a,void 0,void 0,function(){var r,a,o,c,l,f,h;return e.__generator(this,function(v){switch(v.label){case 0:_(!0),R.current=!0,v.label=1;case 1:return v.trys.push([1,4,5,6]),r={configId:i,changeLogIds:u,orderBy:"latestFirst",pageSize:15},[4,fetch("".concat(s,"/changelog/audit-log/fetch-by-ids"),{method:"POST",headers:e.__assign({"Content-Type":"application/json",accept:"application/json"},n.authHeader(d)),body:JSON.stringify(r)})];case 2:if(!(a=v.sent()).ok)throw new Error("Failed to fetch changelogs: ".concat(a.statusText));return[4,a.json()];case 3:if(o=v.sent(),!t)return[2];if(!1===o.success)throw new Error((null===(h=o.error)||void 0===h?void 0:h.errorMessage)||o.error||"Invalid API response format");return c=o.data||o,l=Array.isArray(c.items)?c.items:Array.isArray(c)?c:[],g(l),A(c.nextCursor||null),N(!!c.hasNext),[3,6];case 4:return f=v.sent(),t&&(console.error("Error fetching changelogs:",f),b(f.message||"An error occurred while fetching changelogs.")),[3,6];case 5:return t&&(_(!1),R.current=!1),[7];case 6:return[2]}})}),function(){t=!1}}_(!1)},[s,d,i,JSON.stringify(u),l,w]);var q=t.useCallback(function(){return e.__awaiter(a,void 0,void 0,function(){var t,r,a,o,c,f,h;return e.__generator(this,function(v){switch(v.label){case 0:if(l||!s||!i||0===u.length||!E||R.current)return[2];R.current=!0,P(!0),F(null),v.label=1;case 1:return v.trys.push([1,4,5,6]),t={configId:i,changeLogIds:u,orderBy:"latestFirst",pageSize:15},k&&(t.cursor=k),[4,fetch("".concat(s,"/changelog/audit-log/fetch-by-ids"),{method:"POST",headers:e.__assign({"Content-Type":"application/json",accept:"application/json"},n.authHeader(d)),body:JSON.stringify(t)})];case 2:if(!(r=v.sent()).ok)throw new Error("Failed to fetch changelogs: ".concat(r.statusText));return[4,r.json()];case 3:if(!1===(a=v.sent()).success)throw new Error((null===(h=a.error)||void 0===h?void 0:h.errorMessage)||a.error||"Invalid API response format");return o=a.data||a,c=Array.isArray(o.items)?o.items:Array.isArray(o)?o:[],g(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),c,!0)}),A(o.nextCursor||null),N(!!o.hasNext),[3,6];case 4:return f=v.sent(),console.error("Error fetching next changelogs page:",f),F(f.message||"Failed to fetch more logs."),[3,6];case 5:return P(!1),R.current=!1,[7];case 6:return[2]}})})},[s,d,i,JSON.stringify(u),l,E,k]);return{data:h,loading:p,error:y,fetchNextPage:q,hasNextPage:E,isFetchingNextPage:O,fetchNextPageError:M,refetch:I}},exports.useCitationSegments=function(r){var s=this,o=r.baseUrl,i=r.accessToken,u=r.humanIntelligentConfigId,c=r.segmentIds,l=r.skip,d=void 0!==l&&l,f=n.useAccessToken(i),h=t.useState([]),g=h[0],v=h[1],p=t.useState(!1),_=p[0],m=p[1],y=t.useState(null),b=y[0],S=y[1],w=t.useState(0),C=w[0],I=w[1],x=t.useCallback(function(){return I(function(e){return e+1})},[]);return t.useEffect(function(){var t=!0;if(d||!o||!u||0===(null==c?void 0:c.length))return v([]),m(!1),void S(null);return e.__awaiter(s,void 0,void 0,function(){var r,s,i,l,d,h=this;return e.__generator(this,function(g){switch(g.label){case 0:m(!0),S(null),r={humanIntelligentConfigId:u,segment_ids:c},s="segment-details:".concat(o,":").concat(JSON.stringify(r)),g.label=1;case 1:return g.trys.push([1,3,4,5]),a.has(s)||(i=fetch("".concat(o,"/federated/human_change_config_filters/segment-details"),{method:"POST",headers:e.__assign({"Content-Type":"application/json",accept:"application/json"},n.authHeader(f)),body:JSON.stringify(r)}).then(function(t){return e.__awaiter(h,void 0,void 0,function(){var n,r;return e.__generator(this,function(e){switch(e.label){case 0:if(!t.ok)throw new Error("Failed to fetch segment details: ".concat(t.statusText));return[4,t.json()];case 1:if((n=e.sent()).success&&n.data&&Array.isArray(n.data.segments))return[2,n.data.segments];throw new Error((null===(r=n.error)||void 0===r?void 0:r.errorMessage)||"Invalid API response format")}})})}).catch(function(e){throw a.delete(s),e}),a.set(s,i)),[4,a.get(s)];case 2:return l=g.sent(),t?(v(l),[3,5]):[2];case 3:return d=g.sent(),t&&(console.error("Error fetching citation segments:",d),S(d.message||"An error occurred while fetching citation data."),v([])),[3,5];case 4:return t&&m(!1),[7];case 5:return[2]}})}),function(){t=!1}},[o,f,u,JSON.stringify(c),d,C]),{data:g,loading:_,error:b,refetch:x}},exports.useHumanChangesData=function(a){var s=this,o=a.baseUrl,i=a.endpoint,u=a.accessToken,c=a.humanChangeConfigId,l=a.eventId,d=a.filters,f=a.pageSize,h=void 0===f?12:f,g=n.useAccessToken(u),v=t.useState([]),p=v[0],_=v[1],m=t.useState(!1),y=m[0],b=m[1],S=t.useState(!1),w=S[0],C=S[1],I=t.useState(null),x=I[0],k=I[1],A=t.useState(!0),T=A[0],E=A[1],N=t.useRef(void 0),j=t.useRef(0),O=t.useRef(null),P=o&&i?"".concat(o).concat(i):void 0,J=t.useCallback(function(t){return e.__awaiter(s,void 0,void 0,function(){var a,s,o,i,u,f,v,p,m,y,S,w,I;return e.__generator(this,function(x){switch(x.label){case 0:if(!P||!c)return[2];null===(I=O.current)||void 0===I||I.abort(),a=new AbortController,O.current=a,s=++j.current,t.append?C(!0):b(!0),k(null),x.label=1;case 1:return x.trys.push([1,4,5,6]),o={humanIntelligentConfigId:c,filters:d,pageSize:h},l&&(o.event_id=l),t.append&&N.current&&(o.cursor=N.current),[4,fetch(P,{method:"POST",headers:e.__assign({accept:"application/json","Content-Type":"application/json"},n.authHeader(g)),body:JSON.stringify(o),signal:a.signal})];case 2:if(!(i=x.sent()).ok)throw new Error("Request failed: ".concat(i.status," ").concat(i.statusText));return[4,i.json()];case 3:if(u=x.sent(),s!==j.current)return[2];if(!1===(null==u?void 0:u.success))throw new Error("string"==typeof u.error?u.error:"Fetching human changes failed.");return f=function(e){var t,n;return null!==(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.humanChanges)&&void 0!==n?n:[]}(u),v=f.map(r),p=function(e,t){var n,r,a,s=null!==(r=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.nextCursor)&&void 0!==r?r:null,o=null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.pageSize;return{nextCursor:s,hasMore:!!s&&t>0&&("number"==typeof o?t>=o:t>0)}}(u,f.length),m=p.nextCursor,y=p.hasMore,S=!m||m!==N.current,N.current=null!=m?m:void 0,_(function(n){return t.append?e.__spreadArray(e.__spreadArray([],n,!0),v,!0):v}),E(y&&S),[3,6];case 4:return w=x.sent(),a.signal.aborted||s!==j.current?[2]:(k(w),t.append||_([]),E(!1),[3,6]);case 5:return a.signal.aborted||s!==j.current||(b(!1),C(!1)),O.current===a&&(O.current=null),[7];case 6:return[2]}})})},[P,g,c,l,JSON.stringify(d),h]);t.useEffect(function(){N.current=void 0,E(!0),J({append:!1})},[P,g,c,l,JSON.stringify(d),h]),t.useEffect(function(){return function(){var e;return null===(e=O.current)||void 0===e?void 0:e.abort()}},[]);var M=t.useCallback(function(){y||w||!T||J({append:!0})},[y,w,T,J]),F=t.useCallback(function(){N.current=void 0,E(!0),J({append:!1})},[J]);return{rows:p,loading:y,loadingMore:w,hasMore:T,fetchMore:M,refetch:F,error:x}};
|
|
2
2
|
//# sourceMappingURL=useHumanChangesData.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(require("react")),a=new Set(["b","strong","i","em","u","s","del","ins","mark","code","small","sub","sup","span","br","p","ul","ol","li"]),r={condition:"span",option:"span"},i=new Set(["id","type","total","rank","count","pct","label"]),l=new Set(["br"]),s=new Set(["summary_payload","summary_context","what_happened","impact","where_it_applies","exemptions","tier","caution","rule_recommendation","rule_action","suggested_rule"]),o=new Set(["ul","ol"]),u={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function c(e){return e.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,function(e,t){if("#"===t[0]){var n="x"===t[1]||"X"===t[1]?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Number.isFinite(n)&&n>0?String.fromCodePoint(n):e}var a=u[t.toLowerCase()];return void 0===a?e:a})}var d=/<(\/?)([a-zA-Z][a-zA-Z0-9]*)([^>]*)>/g,p=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;function f(e){var t,n,a,r,l={};for(p.lastIndex=0;r=p.exec(e);){var s=null===(t=r[1])||void 0===t?void 0:t.toLowerCase();s&&i.has(s)&&(l["data-".concat(s)]=c(null!==(a=null!==(n=r[2])&&void 0!==n?n:r[3])&&void 0!==a?a:""))}return l}exports.renderInlineMarkup=function(t,i){if(void 0===i&&(i={}),"string"!=typeof t)return t;if(!/[<&]/.test(t))return t;var u,p=i.classNames,g=void 0===p?{}:p,h=i.stripUnknownTags,v=void 0!==h&&h,_={tag:null,attrs:{},children:[]},m=[_],x=function(){return m[m.length-1]},y=0,b=0,w=function(e){var t;e&&(o.has(null!==(t=x().tag)&&void 0!==t?t:"")&&!e.trim()||x().children.push(c(e)))},A=function(){var t=m.pop(),a=t.tag,i=r[a],l=g[a],s=e.__assign(e.__assign(e.__assign({key:"".concat(a,"-").concat(b++)},l?{className:l}:{}),i?{"data-tag":a}:{}),t.attrs);x().children.push(n.default.createElement.apply(n.default,e.__spreadArray([null!=i?i:a,s],t.children,!1)))};for(d.lastIndex=0;u=d.exec(t);){var k=u[0],S=u[1],z=u[2],I=u[3],Z=void 0===I?"":I,C=z.toLowerCase(),j=a.has(C)||C in r;if(j||!s.has(C)&&!v){if(j)if(w(t.slice(y,u.index)),y=u.index+k.length,l.has(C))x().children.push(n.default.createElement(C,{key:"".concat(C,"-").concat(b++)}));else if(S){for(var q=-1,E=m.length-1;E>0;E--)if(m[E].tag===C){q=E;break}if(q>0)for(;m.length>q;)A()}else m.push({tag:C,attrs:C in r?f(Z):{},children:[]}),/\/\s*$/.test(Z)&&A()}else w(t.slice(y,u.index)),y=u.index+k.length}for(w(t.slice(y));m.length>1;)A();var F=_.children;return F.length?1===F.length&&"string"==typeof F[0]?F[0]:n.default.createElement.apply(n.default,e.__spreadArray([n.default.Fragment,null],F,!1)):""};
|
|
2
2
|
//# sourceMappingURL=inlineMarkup.js.map
|