@copart/ops-tool-kit 1.13.0-beta.24 → 1.13.0-beta.26
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/ops-tool-kit.js +1166 -616
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
47
47
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
48
48
|
|
|
49
49
|
const name$1 = "@copart/ops-tool-kit";
|
|
50
|
-
const version$3 = "1.13.0-beta.
|
|
50
|
+
const version$3 = "1.13.0-beta.26";
|
|
51
51
|
const main$1 = "dist/ops-tool-kit.js";
|
|
52
52
|
const style = "dist/ops-tool-kit.css";
|
|
53
53
|
const files = [
|
|
@@ -290,54 +290,6 @@ function _createClass$2(e, r, t) {
|
|
|
290
290
|
writable: !1
|
|
291
291
|
}), e;
|
|
292
292
|
}
|
|
293
|
-
function _createForOfIteratorHelper(r, e) {
|
|
294
|
-
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
295
|
-
if (!t) {
|
|
296
|
-
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
297
|
-
t && (r = t);
|
|
298
|
-
var n = 0,
|
|
299
|
-
F = function () {};
|
|
300
|
-
return {
|
|
301
|
-
s: F,
|
|
302
|
-
n: function () {
|
|
303
|
-
return n >= r.length ? {
|
|
304
|
-
done: !0
|
|
305
|
-
} : {
|
|
306
|
-
done: !1,
|
|
307
|
-
value: r[n++]
|
|
308
|
-
};
|
|
309
|
-
},
|
|
310
|
-
e: function (r) {
|
|
311
|
-
throw r;
|
|
312
|
-
},
|
|
313
|
-
f: F
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
317
|
-
}
|
|
318
|
-
var o,
|
|
319
|
-
a = !0,
|
|
320
|
-
u = !1;
|
|
321
|
-
return {
|
|
322
|
-
s: function () {
|
|
323
|
-
t = t.call(r);
|
|
324
|
-
},
|
|
325
|
-
n: function () {
|
|
326
|
-
var r = t.next();
|
|
327
|
-
return a = r.done, r;
|
|
328
|
-
},
|
|
329
|
-
e: function (r) {
|
|
330
|
-
u = !0, o = r;
|
|
331
|
-
},
|
|
332
|
-
f: function () {
|
|
333
|
-
try {
|
|
334
|
-
a || null == t.return || t.return();
|
|
335
|
-
} finally {
|
|
336
|
-
if (u) throw o;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
293
|
function _defineProperty$2(e, r, t) {
|
|
342
294
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
343
295
|
value: t,
|
|
@@ -2969,10 +2921,10 @@ var BreadcrumbsProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
2969
2921
|
}(React__namespace.Component);
|
|
2970
2922
|
|
|
2971
2923
|
var _class;
|
|
2972
|
-
var _excluded$
|
|
2924
|
+
var _excluded$6 = ["breadcrumbs"];
|
|
2973
2925
|
var getCrumbProps = function getCrumbProps(props) {
|
|
2974
2926
|
props.breadcrumbs;
|
|
2975
|
-
var crumbProps = _objectWithoutProperties(props, _excluded$
|
|
2927
|
+
var crumbProps = _objectWithoutProperties(props, _excluded$6);
|
|
2976
2928
|
return crumbProps;
|
|
2977
2929
|
};
|
|
2978
2930
|
var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
|
|
@@ -21345,7 +21297,7 @@ FeedbackDialog.defaultProps = {
|
|
|
21345
21297
|
}
|
|
21346
21298
|
};
|
|
21347
21299
|
|
|
21348
|
-
var css_248z$m = ".utilities_ops-app-frame_AppBarComponent_AppBar--root {\n background-color: var(--blue);\n background-color: var(--blue);\n height: 48px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n white-space: nowrap;\n /* padding-top: env(safe-area-inset-top, 0px); */\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--leftItems {\n width: 100%;\n display: flex;\n justify-content: start;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appBarIcons {\n margin: 0 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--copartLogo {\n display: flex;\n align-items: center;\n flex-direction: column;\n margin-left: 5px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--copartLogoNew {\n display: flex;\n margin: 3px 0 0 16px;\n grid-gap: 10px;\n gap: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--moduleName {\n color: white;\n font-size: 11px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items {\n color: white;\n cursor: pointer;\n font-size: 18px;\n display: flex;\n justify-content: center;\n margin: 8px !important;\n position: relative;\n width: 25px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--logout {\n margin-right: 24px !important;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items i {\n color: #fff;\n font-size: 20px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--lightBulbIcon i {\n color: #ffff00;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--language {\n width: auto;\n grid-gap: 4px;\n grid-gap: 5px;\n gap: 5px;\n display: flex;\n font-size: 14px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard {\n width: auto;\n cursor: pointer;\n display: flex;\n align-items: center;\n background: #fff;\n color: #1D5AB9;\n font-weight: 600;\n border-radius: 4px;\n font-size: 14px;\n grid-gap: 8px;\n grid-gap: 8px;\n gap: 8px;\n padding: 2px 8px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard span i {\n color: #1D5AB9;\n font-size: 16px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard .utilities_ops-app-frame_AppBarComponent_AppBar--yardNumber {\n font-size: 14px;\n font-weight: 400;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid .utilities_ops-app-frame_AppBarComponent_AppBar--col {\n display: flex;\n color: white;\n font-size: 13px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid .utilities_ops-app-frame_AppBarComponent_AppBar--col svg {\n color: white;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--logo {\n width: 6rem;\n margin-top: 0rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--text {\n margin-top: 0.6rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--iconText {\n margin-top: 0.4rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchBar,\n.utilities_ops-app-frame_AppBarComponent_AppBar--placeholderDiv {\n margin-top: -0.2rem;\n margin-left: 2rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appBarLeft > img.utilities_ops-app-frame_AppBarComponent_AppBar--logo {\n display: inline;\n display: initial;\n}\n\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-weight: 600;\n src: url(https://fonts.gstatic.com/s/opensans/v18/memnYaGs126MiZpBA-UFUKXGUdhmIqOjjg.woff2)\n format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appTitle {\n color: #fff;\n font-family: 'Open Sans', sans-serif;\n font-weight: 600;\n font-style: italic;\n font-size: 14px;\n position: relative;\n left: 16px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--item {\n display: flex;\n color: white;\n font-size: 13px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon {\n /* margin-left: 10px;\n margin-right: 7px; */\n cursor: pointer;\n display: flex;\n align-items: center;\n background: #fff;\n color: #1D5AB9;\n font-weight: 600;\n border-radius: 4px;\n box-shadow: inset 0px -2px 0px rgba(0, 0, 0, 0.4), 0px 1.6px 3.6px 0px rgba(0, 0, 0, 0.13), 0px 0.3px 0.9px 0px rgba(0, 0, 0, 0.10);\n font-size: 14px;\n grid-gap: 8px;\n gap: 8px;\n margin: 0 8px;\n padding: 6px 20px 7px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon span {\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon span i {\n font-size: 18px;\n color: #1D5AB9;\n}\n\n/* .searchIcon > div {\n margin-left: 7px;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchWrapper i {\n color: #fff;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchWrapper span {\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault {\n color: white;\n cursor: default;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable {\n background-color: white;\n border-radius: 20px;\n margin: 5px;\n padding: 0px 10px;\n height: 25px;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--light {\n border: 1px solid #1d5ab9;\n justify-content: flex-start;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightDefault {\n color: black;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline,\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable {\n background-color: white;\n border-radius: 20px;\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable {\n color: green;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable i {\n color: green;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline {\n color: red;\n margin: 5px 0px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline svg {\n margin-right: 5px;\n margin-left: 5px;\n width: 24px;\n height: 24px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--SpinnerWrapper {\n margin-left: 5px;\n display: inline-flex;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i {\n font-size: 16px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i {\n line-height: unset;\n font-size: 16px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable {\n color: green;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable svg {\n margin-right: 5px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable {\n color: red;\n}\n\n/* .userMenu {\n margin-left: 10px !important;\n margin-right: 5px !important;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag {\n margin: 8px;\n display: flex;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag > div {\n margin-left: 7px;\n font-size: 14px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--feedback {\n margin: 0 !important;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--overflowItems {\n width: 100%;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelp_button {\n cursor: pointer;\n position: relative;\n top: -2px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelp_button i {\n color: #fff;\n font-size: 22px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpDot {\n background-color: #ef5350;\n border-radius: 50%;\n position: absolute;\n top: 3px;\n left: 13px;\n width: 10px;\n height: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip{\n position: absolute;\n background: #fff;\n padding: 8px;\n right: 30px;\n top: -2px;\n border-radius: 2px;\n font-weight: 400;\n font-size: 12px;\n cursor: auto;\n color: #000;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip::before{\n content: \"\";\n position: absolute;\n top: 50%;\n left: 100%;\n margin-top: -5px;\n border-width: 5px;\n border-style: solid;\n border-color: transparent transparent transparent #fff;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip i{\n color: #000;\n font-size: 12px;\n margin-left: 5px;\n position: relative;\n top: 1px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer {\n position: absolute;\n display: flex;\n width: 100vw;\n bottom: 0;\n z-index: 10000;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n position: absolute;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 425px;\n max-width: 425px;\n background-color: white;\n border: 0px solid;\n padding: 20px 30px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide {\n background-color: rgba(0,0,0,.5);\n width: 100%;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--st0{fill:#0075E6;}\n.utilities_ops-app-frame_AppBarComponent_AppBar--st1{fill:#6A819C;}\n.utilities_ops-app-frame_AppBarComponent_AppBar--st2{fill:#FFFFFF;}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHideButton {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 2px;\n right: 510px;\n height: 38px;\n width: 38px;\n background-color: white;\n z-index: 11000;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--profile {\n padding: 5px 7px;\n background: #fff;\n border-radius: 50%;\n font-weight: 600;\n color: #1d5ab9;\n font-size: 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchContainer {\n background: rgba(255, 255, 255, 0.40);\n backdrop-filter: blur(20px);\n position: absolute;\n top: 50px;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 999;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper{\n position: absolute;\n z-index: 10000;\n height: 100vh;\n width: 100vw;\n background-color: rgba(0,0,0,.5);\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 425px;\n max-width: 425px;\n position: absolute;\n right: 0;\n /* height: calc(100vh - 100px); */\n /* padding: 15px; */\n background-color: white;\n overflow-y: auto;\n}\n\n@media only screen and (max-width: 1024px) {\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i,\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i,\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable svg {\n margin-right: 2px;\n }\n\n /* .searchIcon {\n margin-left: 5px;\n margin-right: 2px;\n }\n\n .searchIcon > div {\n margin-left: 2px;\n } */\n\n /* .userMenu {\n margin-left: 3px !important;\n margin-right: 3px !important;\n } */\n\n .utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag {\n margin-left: 3px !important;\n margin-right: 3px !important;\n }\n\n .utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag > div {\n margin-left: 2px;\n }\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper\n{\n position: absolute;\n z-index: 10000;\n height: 100vh;\n top: 100px;\n width: 100vw;\n background-color: rgba(0,0,0,.5);\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv\n{\n width: 425px;\n max-width: 425px;\n position: absolute;\n right: 0;\n /* height: calc(100vh - 100px); */\n background-color: white;\n overflow-y: hidden;\n padding: 10px;\n display: flex;\n flex-direction: column;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar {\n width: 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-thumb {\n background-color: #888;\n border-radius: 10px;\n border: 3px solid #f1f1f1;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-thumb:hover {\n background-color: #555;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeader{\n font-size: 24px;\n font-weight: 700;\n padding-bottom: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsWrapper{\n flex: 1;\n min-height: 0;\n overflow: hidden;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount{\n background-color: #ef5350;\n color: white;\n font-size: 12px;\n width: 1rem;\n border-radius: 50%;\n position: absolute;\n top: -5px;\n left: 11px;\n height: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount.utilities_ops-app-frame_AppBarComponent_AppBar--twoChars {\n width: 1.1rem;\n height: 1.1rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount.utilities_ops-app-frame_AppBarComponent_AppBar--threeChars {\n width: 1.3rem;\n height: 1.3rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--notificationIconWrapper {\n cursor: pointer;\n margin-left: 12px;\n position: relative;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer {\n width: 0px;\n height: 0px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 11px solid white;\n position: absolute;\n bottom: -13px;\n right: 5px;\n}\n\n/* .arrowTipContainer.ideaNoteArrow {\n right: 16px;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpArrow {\n right: 3px;\n bottom: -10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer.utilities_ops-app-frame_AppBarComponent_AppBar--profileArrow {\n bottom: -12px;\n right: 8px;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 10px solid white;\n}\n\n@media (max-width: 1366px) {\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n width: 400px;\n max-width: 400px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv {\n width: 400px;\n max-width: 400px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 400px;\n max-width: 400px;\n}\n}\n\n@media (max-width: 768px) {\n .utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv {\n width: 85%;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount{\n left: 12px;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer {\n right: 5px;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n width: 85% !important;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer iframe {\n width: 85% !important;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHideButton {\n display: none;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 85%;\n }\n}";
|
|
21300
|
+
var css_248z$m = ".utilities_ops-app-frame_AppBarComponent_AppBar--root {\n background-color: var(--blue);\n background-color: var(--blue);\n height: 48px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n white-space: nowrap;\n /* padding-top: env(safe-area-inset-top, 0px); */\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--leftItems {\n width: 100%;\n display: flex;\n justify-content: start;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appBarIcons {\n margin: 0 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--copartLogo {\n display: flex;\n align-items: center;\n flex-direction: column;\n margin-left: 5px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--copartLogoNew {\n display: flex;\n margin: 3px 0 0 16px;\n grid-gap: 10px;\n gap: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--moduleName {\n color: white;\n font-size: 11px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items {\n color: white;\n cursor: pointer;\n font-size: 18px;\n display: flex;\n justify-content: center;\n margin: 8px !important;\n position: relative;\n width: 25px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--logout {\n margin-right: 24px !important;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items i {\n color: #fff;\n font-size: 20px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--lightBulbIcon i {\n color: #ffff00;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--language {\n width: auto;\n grid-gap: 4px;\n grid-gap: 5px;\n gap: 5px;\n display: flex;\n font-size: 14px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard {\n width: auto;\n cursor: pointer;\n display: flex;\n align-items: center;\n background: #fff;\n color: #1D5AB9;\n font-weight: 600;\n border-radius: 4px;\n font-size: 14px;\n grid-gap: 8px;\n grid-gap: 8px;\n gap: 8px;\n padding: 2px 8px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard span i {\n color: #1D5AB9;\n font-size: 16px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard .utilities_ops-app-frame_AppBarComponent_AppBar--yardNumber {\n font-size: 14px;\n font-weight: 400;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid .utilities_ops-app-frame_AppBarComponent_AppBar--col {\n display: flex;\n color: white;\n font-size: 13px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid .utilities_ops-app-frame_AppBarComponent_AppBar--col svg {\n color: white;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--logo {\n width: 6rem;\n margin-top: 0rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--text {\n margin-top: 0.6rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--iconText {\n margin-top: 0.4rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchBar,\n.utilities_ops-app-frame_AppBarComponent_AppBar--placeholderDiv {\n margin-top: -0.2rem;\n margin-left: 2rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appBarLeft > img.utilities_ops-app-frame_AppBarComponent_AppBar--logo {\n display: inline;\n display: initial;\n}\n\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-weight: 600;\n src: url(https://fonts.gstatic.com/s/opensans/v18/memnYaGs126MiZpBA-UFUKXGUdhmIqOjjg.woff2)\n format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appTitle {\n color: #fff;\n font-family: 'Open Sans', sans-serif;\n font-weight: 600;\n font-style: italic;\n font-size: 14px;\n position: relative;\n left: 16px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--item {\n display: flex;\n color: white;\n font-size: 13px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon {\n /* margin-left: 10px;\n margin-right: 7px; */\n cursor: pointer;\n display: flex;\n align-items: center;\n background: #fff;\n color: #1D5AB9;\n font-weight: 600;\n border-radius: 4px;\n box-shadow: inset 0px -2px 0px rgba(0, 0, 0, 0.4), 0px 1.6px 3.6px 0px rgba(0, 0, 0, 0.13), 0px 0.3px 0.9px 0px rgba(0, 0, 0, 0.10);\n font-size: 14px;\n grid-gap: 8px;\n gap: 8px;\n margin: 0 8px;\n padding: 6px 20px 7px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon span {\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon span i {\n font-size: 18px;\n color: #1D5AB9;\n}\n\n/* .searchIcon > div {\n margin-left: 7px;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchWrapper i {\n color: #fff;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchWrapper span {\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault {\n color: white;\n cursor: default;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable {\n background-color: white;\n border-radius: 20px;\n margin: 5px;\n padding: 0px 10px;\n height: 25px;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--light {\n border: 1px solid #1d5ab9;\n justify-content: flex-start;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightDefault {\n color: black;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline,\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable {\n background-color: white;\n border-radius: 20px;\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable {\n color: green;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable i {\n color: green;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline {\n color: red;\n margin: 5px 0px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline svg {\n margin-right: 5px;\n margin-left: 5px;\n width: 24px;\n height: 24px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--SpinnerWrapper {\n margin-left: 5px;\n display: inline-flex;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i {\n font-size: 16px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i {\n line-height: unset;\n font-size: 16px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable {\n color: green;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable svg {\n margin-right: 5px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable {\n color: red;\n}\n\n/* .userMenu {\n margin-left: 10px !important;\n margin-right: 5px !important;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag {\n margin: 8px;\n display: flex;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag > div {\n margin-left: 7px;\n font-size: 14px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--feedback {\n margin: 0 !important;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--overflowItems {\n width: 100%;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelp_button {\n cursor: pointer;\n position: relative;\n top: -2px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelp_button i {\n color: #fff;\n font-size: 22px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpDot {\n background-color: #ef5350;\n border-radius: 50%;\n position: absolute;\n top: 3px;\n left: 13px;\n width: 10px;\n height: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip{\n position: absolute;\n background: #fff;\n padding: 8px;\n right: 30px;\n top: -2px;\n border-radius: 2px;\n font-weight: 400;\n font-size: 12px;\n cursor: auto;\n color: #000;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip::before{\n content: \"\";\n position: absolute;\n top: 50%;\n left: 100%;\n margin-top: -5px;\n border-width: 5px;\n border-style: solid;\n border-color: transparent transparent transparent #fff;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip i{\n color: #000;\n font-size: 12px;\n margin-left: 5px;\n position: relative;\n top: 1px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer {\n position: absolute;\n display: flex;\n width: 100vw;\n bottom: 0;\n z-index: 10000;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n position: absolute;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 425px;\n max-width: 425px;\n background-color: white;\n border: 0px solid;\n padding: 20px 30px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide {\n background-color: rgba(0,0,0,.5);\n width: 100%;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--st0{fill:#0075E6;}\n.utilities_ops-app-frame_AppBarComponent_AppBar--st1{fill:#6A819C;}\n.utilities_ops-app-frame_AppBarComponent_AppBar--st2{fill:#FFFFFF;}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHideButton {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 2px;\n right: 510px;\n height: 38px;\n width: 38px;\n background-color: white;\n z-index: 11000;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--profile {\n padding: 5px 7px;\n background: #fff;\n border-radius: 50%;\n font-weight: 600;\n color: #1d5ab9;\n font-size: 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchContainer {\n background: rgba(255, 255, 255, 0.40);\n backdrop-filter: blur(20px);\n position: absolute;\n top: 50px;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 999;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper{\n position: absolute;\n z-index: 10000;\n height: 100vh;\n width: 100vw;\n background-color: rgba(0,0,0,.5);\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 425px;\n max-width: 425px;\n position: absolute;\n right: 0;\n /* height: calc(100vh - 100px); */\n /* padding: 15px; */\n background-color: white;\n overflow-y: auto;\n}\n\n@media only screen and (max-width: 1024px) {\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i,\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i,\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable svg {\n margin-right: 2px;\n }\n\n /* .searchIcon {\n margin-left: 5px;\n margin-right: 2px;\n }\n\n .searchIcon > div {\n margin-left: 2px;\n } */\n\n /* .userMenu {\n margin-left: 3px !important;\n margin-right: 3px !important;\n } */\n\n .utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag {\n margin-left: 3px !important;\n margin-right: 3px !important;\n }\n\n .utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag > div {\n margin-left: 2px;\n }\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper\n{\n position: absolute;\n z-index: 10000;\n height: 100vh;\n top: 100px;\n width: 100vw;\n background-color: rgba(0,0,0,.5);\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv\n{\n width: 425px;\n max-width: 425px;\n position: absolute;\n right: 0;\n /* height: calc(100vh - 100px); */\n background-color: white;\n overflow-y: hidden;\n padding: 10px;\n display: flex;\n flex-direction: column;\n}\n\n/* Stable marker for NAC sidebar v2 detection — must remain in bundle */\n.g2-notifications-sidebar-v2 {\n display: flex;\n flex-direction: column;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar {\n width: 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-thumb {\n background-color: #888;\n border-radius: 10px;\n border: 3px solid #f1f1f1;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-thumb:hover {\n background-color: #555;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeader{\n font-size: 20px;\n font-weight: 700;\n padding: 0 20px 12px;\n margin: 0 -10px 12px;\n border-bottom: 1px solid #edebe9;\n color: #323130;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeaderCount{\n font-size: 16px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsWrapper{\n flex: 1;\n min-height: 0;\n overflow: hidden;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount{\n background-color: #ef5350;\n color: white;\n font-size: 12px;\n width: 1rem;\n border-radius: 50%;\n position: absolute;\n top: -5px;\n left: 11px;\n height: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount.utilities_ops-app-frame_AppBarComponent_AppBar--twoChars {\n width: 1.1rem;\n height: 1.1rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount.utilities_ops-app-frame_AppBarComponent_AppBar--threeChars {\n width: 1.3rem;\n height: 1.3rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--notificationIconWrapper {\n cursor: pointer;\n margin-left: 12px;\n position: relative;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer {\n width: 0px;\n height: 0px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 11px solid white;\n position: absolute;\n bottom: -13px;\n right: 5px;\n}\n\n/* .arrowTipContainer.ideaNoteArrow {\n right: 16px;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpArrow {\n right: 3px;\n bottom: -10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer.utilities_ops-app-frame_AppBarComponent_AppBar--profileArrow {\n bottom: -12px;\n right: 8px;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 10px solid white;\n}\n\n@media (max-width: 1366px) {\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n width: 400px;\n max-width: 400px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv {\n width: 400px;\n max-width: 400px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 400px;\n max-width: 400px;\n}\n}\n\n@media (max-width: 768px) {\n .utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv {\n width: 85%;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount{\n left: 12px;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer {\n right: 5px;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n width: 85% !important;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer iframe {\n width: 85% !important;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHideButton {\n display: none;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 85%;\n }\n}";
|
|
21349
21301
|
styleInject(css_248z$m);
|
|
21350
21302
|
|
|
21351
21303
|
var LogOutMenu = function LogOutMenu(_ref) {
|
|
@@ -21531,15 +21483,17 @@ var MobileMenu = function MobileMenu(props) {
|
|
|
21531
21483
|
var closeSidebar = props.closeSidebar,
|
|
21532
21484
|
logout = props.logout,
|
|
21533
21485
|
items = props.items,
|
|
21534
|
-
|
|
21486
|
+
_props$bannerNotifica = props.bannerNotifications,
|
|
21487
|
+
bannerNotifications = _props$bannerNotifica === void 0 ? [] : _props$bannerNotifica,
|
|
21535
21488
|
sideBarTopValue = props.sideBarTopValue,
|
|
21536
21489
|
availableStatuses = props.availableStatuses,
|
|
21537
21490
|
currentUserStatus = props.currentUserStatus,
|
|
21538
21491
|
onUserStatusUpdate = props.onUserStatusUpdate;
|
|
21492
|
+
var hasBannerNotifications = bannerNotifications.length > 0;
|
|
21539
21493
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21540
21494
|
className: "utilities_ops-app-frame_AppBarComponent_MobileMenu_MobileMenu--mobileMenuSidebarWrapper",
|
|
21541
21495
|
style: {
|
|
21542
|
-
top:
|
|
21496
|
+
top: hasBannerNotifications ? "".concat(sideBarTopValue, "px") : '48px'
|
|
21543
21497
|
},
|
|
21544
21498
|
onClick: closeSidebar
|
|
21545
21499
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -21579,13 +21533,27 @@ var _styleModuleImportMap$9 = {
|
|
|
21579
21533
|
"logoLink": "utilities_ops-app-frame_AppBarComponent_CopartLogo_CopartLogo--logoLink"
|
|
21580
21534
|
}
|
|
21581
21535
|
};
|
|
21536
|
+
var isEmbeddedPath = function isEmbeddedPath() {
|
|
21537
|
+
return typeof window !== 'undefined' && window.location.pathname.startsWith('/embedded');
|
|
21538
|
+
};
|
|
21582
21539
|
var CopartLogo = function CopartLogo() {
|
|
21583
|
-
var
|
|
21540
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
21541
|
+
history = _ref.history;
|
|
21542
|
+
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
21584
21543
|
var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures;
|
|
21585
21544
|
enableNewToolkitFeatures = enableNewToolkitFeatures || isAuthRoute && !isCoreRoute;
|
|
21586
21545
|
var imageSrc = enableNewToolkitFeatures ? "/images/G2logo.svg" : "https://www.copart.com/images/logo.svg";
|
|
21546
|
+
var handleClick = function handleClick(e) {
|
|
21547
|
+
// Inside embedded shell: SPA navigate home (avoid full reload / blank-page history issues).
|
|
21548
|
+
// Outside embedded: keep default <a href="/"> full navigation.
|
|
21549
|
+
if (history && typeof history.push === 'function' && isEmbeddedPath()) {
|
|
21550
|
+
e.preventDefault();
|
|
21551
|
+
history.push('/');
|
|
21552
|
+
}
|
|
21553
|
+
};
|
|
21587
21554
|
return /*#__PURE__*/React__namespace.createElement("a", {
|
|
21588
|
-
href: "/"
|
|
21555
|
+
href: "/",
|
|
21556
|
+
onClick: handleClick
|
|
21589
21557
|
}, /*#__PURE__*/React__namespace.createElement("img", {
|
|
21590
21558
|
src: imageSrc,
|
|
21591
21559
|
className: _getClassName(enableNewToolkitFeatures ? "CopartLogoNew" : "CopartLogo", _styleModuleImportMap$9, {
|
|
@@ -22517,7 +22485,8 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22517
22485
|
feedbackConfig = _ref.feedbackConfig,
|
|
22518
22486
|
showMihelpDot = _ref.showMihelpDot,
|
|
22519
22487
|
sideBarTopValue = _ref.sideBarTopValue,
|
|
22520
|
-
|
|
22488
|
+
_ref$bannerNotificati = _ref.bannerNotifications,
|
|
22489
|
+
bannerNotifications = _ref$bannerNotificati === void 0 ? [] : _ref$bannerNotificati;
|
|
22521
22490
|
var _useState = React.useState(null),
|
|
22522
22491
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22523
22492
|
helpContent = _useState2[0],
|
|
@@ -23056,11 +23025,11 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
23056
23025
|
className: "utilities_ops-app-frame_Help_Help--backdrop",
|
|
23057
23026
|
onClick: handleBackDropClick,
|
|
23058
23027
|
style: {
|
|
23059
|
-
top:
|
|
23028
|
+
top: bannerNotifications.length ? "".concat(sideBarTopValue, "px") : '48px'
|
|
23060
23029
|
}
|
|
23061
23030
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
23062
23031
|
style: {
|
|
23063
|
-
height: "calc(100dvh - ".concat(
|
|
23032
|
+
height: "calc(100dvh - ".concat(bannerNotifications.length ? sideBarTopValue : 48, "px)")
|
|
23064
23033
|
},
|
|
23065
23034
|
ref: mihelpRef,
|
|
23066
23035
|
className: _getClassName("miHelpSideBar ".concat(!helpContent || isChrome() && overFlowHidden || !isChrome() && showQuestionSection ? 'overFlowHidden' : ''), _styleModuleImportMap$5, {
|
|
@@ -23507,7 +23476,7 @@ var RoleSelector$2 = function RoleSelector(_ref) {
|
|
|
23507
23476
|
}));
|
|
23508
23477
|
};
|
|
23509
23478
|
|
|
23510
|
-
var _excluded$
|
|
23479
|
+
var _excluded$5 = ["selectedYard", "name", "handleChange", "yardOptions", "label"];
|
|
23511
23480
|
var getDescription = function getDescription(yardOptions) {
|
|
23512
23481
|
return function (code) {
|
|
23513
23482
|
return yardOptions[code].yard_number;
|
|
@@ -23523,7 +23492,7 @@ var YardNumberMenu$2 = function YardNumberMenu(_ref) {
|
|
|
23523
23492
|
handleChange = _ref.handleChange,
|
|
23524
23493
|
yardOptions = _ref.yardOptions,
|
|
23525
23494
|
label = _ref.label,
|
|
23526
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
23495
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
23527
23496
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
23528
23497
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--col-1-1"
|
|
23529
23498
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, _extends$1({}, otherProps, {
|
|
@@ -24467,14 +24436,14 @@ var HierarchyMenu = function HierarchyMenu(props) {
|
|
|
24467
24436
|
});
|
|
24468
24437
|
};
|
|
24469
24438
|
|
|
24470
|
-
var _excluded$
|
|
24439
|
+
var _excluded$4 = ["value", "handleChange", "yardOptions", "label", "disabled"];
|
|
24471
24440
|
var YardNumberMenu$1 = function YardNumberMenu(_ref) {
|
|
24472
24441
|
var value = _ref.value,
|
|
24473
24442
|
handleChange = _ref.handleChange,
|
|
24474
24443
|
yardOptions = _ref.yardOptions;
|
|
24475
24444
|
_ref.label;
|
|
24476
24445
|
var disabled = _ref.disabled,
|
|
24477
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
24446
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
24478
24447
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
24479
24448
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--col-1-1"
|
|
24480
24449
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, _extends$1({}, otherProps, {
|
|
@@ -25562,17 +25531,24 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
25562
25531
|
}]);
|
|
25563
25532
|
}(React__default["default"].Component);
|
|
25564
25533
|
|
|
25565
|
-
var css_248z$9 = ".utilities_ops-announcements_Banner--appBarContentBox {\n word-break: break-word;\n word-wrap: anywhere;\n white-space: pre-wrap;\n font-weight: 600;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContent {\n padding: 10px 10px;\n font-size: 13px;\n width: 95%;\n display: flex;\n align-items: center;\n grid-gap: 20px;\n gap: 20px;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBar {\n display: flex;\n color: #6c7a89;\n grid-gap: 8px;\n gap: 8px;\n width: 90%;\n font-size: 12px;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBar b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBox {\n color: white;\n width: 26px;\n min-height: 26px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n /* font-weight: 600; */\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n font-size: 12px;\n color: #201f1e;\n cursor: default;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox * {\n display: inline;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox a {\n text-decoration: underline;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationBarContentBox {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n width: 95%;\n /* font-weight: 600; */\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n font-size: 12px;\n padding: 5px 5px;\n min-height: 20px;\n padding: 4px 5px 3px;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox i {\n font-size: 20px !important;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer {\n display: flex;\n flex-direction: row;\n justify-content: center;\n grid-gap: 10px;\n gap: 10px;\n font-size: 12px;\n align-items: center;\n padding: 0px 10px;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationLeftBtn i {\n position: relative;\n right: -4px;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationCountContainer {\n width: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer {\n display: flex;\n flex-direction: row;\n /* padding: 10px 10px; */\n grid-gap: 5px;\n gap: 5px;\n min-height: 40px;\n width: 100%;\n /* padding-top: env(safe-area-inset-top, 0px);\n position: sticky;\n top: 0; */\n}\n\n.utilities_ops-announcements_Banner--sideBar.utilities_ops-announcements_Banner--notificationContainer {\n padding: 8px 6px;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox {\n color: white;\n width: 52px;\n min-height: 52px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationInfoBox {\n color: white;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n}\n.utilities_ops-announcements_Banner--notificationBarBtn {\n width: 52px;\n min-height: 52px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn {\n width: auto;\n min-height: auto;\n align-items: flex-start;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer i {\n font-size: 22px;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn i {\n font-size: 20px;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar {\n flex-direction: column;\n /* padding: 10px 10px; */\n grid-gap: 0px;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar i {\n font-size: 13px;\n}\n\n.utilities_ops-announcements_Banner--arrowTipContainer {\n width: 0px;\n height: 0px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 13px solid white;\n position: absolute;\n top: 51px;\n right: 50px;\n}\n\n.utilities_ops-announcements_Banner--appBarContentWrapper {\n padding-right: 10px;\n font-size: 12px;\n flex: 1 1 0%;\n min-width: 0;\n display: flex;\n flex-direction: column;\n grid-gap: 4px;\n gap: 4px;\n margin-top: 5px;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideBarNotificationMeta {\n display: flex;\n flex-wrap: wrap;\n min-width: 0;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--appBarContentWrapper {\n padding-left: 10px;\n}\n\n.utilities_ops-announcements_Banner--appBarContentWrapper b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--feedUrl {\n text-decoration: none !important;\n}\n\n.utilities_ops-announcements_Banner--feedUrl i {\n font-size: 14px;\n cursor: pointer;\n color: #1d5ab9;\n left: 2px;\n position: relative;\n top: 2px;\n margin-right: 3px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroup {\n border: 1px solid #e1dfdd;\n border-radius: 8px;\n padding: 12px;\n margin-bottom: 12px;\n background-color: #ffffff;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupHeader {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 10px;\n min-height: 28px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupHeaderWithBack {\n position: relative;\n justify-content: center;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupHeaderTitle {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 8px;\n gap: 8px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationBackBtn {\n position: absolute;\n left: 0;\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: none;\n color: #3261bd;\n cursor: pointer;\n width: 28px;\n height: 28px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationBackBtn i {\n font-size: 18px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIcon {\n width: 20px;\n height: 20px;\n -o-object-fit: contain;\n object-fit: contain;\n -webkit-filter: invert(24%) sepia(100%) saturate(1350%) hue-rotate(201deg) brightness(96%) contrast(93%);\n filter: invert(24%) sepia(100%) saturate(1350%) hue-rotate(201deg) brightness(96%) contrast(93%);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIconPlaceholder {\n width: 20px;\n height: 20px;\n border-radius: 4px;\n background-color: #deecf9;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppName {\n color: #3261bd;\n color: var(--Type-Copart-Neue-Rest, #3261bd);\n font-family: 'Segoe UI', SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n text-transform: uppercase;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupList {\n display: flex;\n flex-direction: column;\n grid-gap: 6px;\n gap: 6px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRow {\n display: flex;\n align-items: flex-start;\n grid-gap: 8px;\n gap: 8px;\n padding: 8px 10px;\n border-radius: 4px;\n min-height: 36px;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowIcon {\n color: white;\n width: 20px;\n height: 20px;\n min-width: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-top: 1px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowContent {\n flex: 1;\n min-width: 0;\n font-size: 12px;\n font-weight: 600;\n color: #201f1e;\n line-height: 1.35;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowText {\n word-break: break-word;\n word-wrap: anywhere;\n white-space: normal;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowText * {\n display: inline;\n word-wrap: inherit;\n word-break: inherit;\n white-space: inherit;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowMeta {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n grid-gap: 4px;\n gap: 4px;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowLink {\n text-decoration: none;\n line-height: 1;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowLink i {\n font-size: 16px;\n color: #1d5ab9;\n cursor: pointer;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowTime {\n font-size: 11px;\n color: #605e5c;\n font-weight: 400;\n white-space: nowrap;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationViewAll {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n grid-gap: 6px;\n gap: 6px;\n width: 100%;\n margin-top: 10px;\n padding: 0;\n border: none;\n background: none;\n color: #0f4cab;\n font-size: 13px;\n font-weight: 600;\n line-height: 1;\n cursor: pointer;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationViewAll i {\n display: inline-flex;\n align-items: center;\n font-size: 16px;\n line-height: 1;\n}\n\n@media (max-width: 1760px) {\n .utilities_ops-announcements_Banner--notificationBarContent input {\n width: 331px !important;\n }\n}\n";
|
|
25534
|
+
var css_248z$9 = ".utilities_ops-announcements_Banner--appBarContentBox {\n word-break: break-word;\n word-wrap: anywhere;\n white-space: pre-wrap;\n font-weight: 600;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContent {\n padding: 10px 10px;\n font-size: 13px;\n width: 95%;\n display: flex;\n align-items: center;\n grid-gap: 20px;\n gap: 20px;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBar {\n display: flex;\n color: #6c7a89;\n grid-gap: 8px;\n gap: 8px;\n width: 90%;\n font-size: 12px;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBar b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBox {\n color: white;\n width: 26px;\n min-height: 26px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n /* font-weight: 600; */\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n font-size: 12px;\n color: #201f1e;\n cursor: default;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox * {\n display: inline;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox a {\n text-decoration: underline;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationBarContentBox {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n width: 95%;\n /* font-weight: 600; */\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n font-size: 12px;\n padding: 5px 5px;\n min-height: 20px;\n padding: 4px 5px 3px;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox i {\n font-size: 20px !important;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer {\n display: flex;\n flex-direction: row;\n justify-content: center;\n grid-gap: 10px;\n gap: 10px;\n font-size: 12px;\n align-items: center;\n padding: 0px 10px;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationLeftBtn i {\n position: relative;\n right: -4px;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationCountContainer {\n width: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer {\n display: flex;\n flex-direction: row;\n /* padding: 10px 10px; */\n grid-gap: 5px;\n gap: 5px;\n min-height: 40px;\n width: 100%;\n /* padding-top: env(safe-area-inset-top, 0px);\n position: sticky;\n top: 0; */\n}\n\n.utilities_ops-announcements_Banner--sideBar.utilities_ops-announcements_Banner--notificationContainer {\n padding: 8px 6px;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox {\n color: white;\n width: 52px;\n min-height: 52px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationInfoBox {\n color: white;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n}\n.utilities_ops-announcements_Banner--notificationBarBtn {\n width: 52px;\n min-height: 52px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn {\n width: auto;\n min-height: auto;\n align-items: flex-start;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer i {\n font-size: 22px;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn i {\n font-size: 20px;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar {\n flex-direction: column;\n /* padding: 10px 10px; */\n grid-gap: 0px;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar i {\n font-size: 13px;\n}\n\n.utilities_ops-announcements_Banner--arrowTipContainer {\n width: 0px;\n height: 0px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 13px solid white;\n position: absolute;\n top: 51px;\n right: 50px;\n}\n\n.utilities_ops-announcements_Banner--appBarContentWrapper {\n padding-right: 10px;\n font-size: 12px;\n flex: 1 1 0%;\n min-width: 0;\n display: flex;\n flex-direction: column;\n grid-gap: 4px;\n gap: 4px;\n margin-top: 5px;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideBarNotificationMeta {\n display: flex;\n flex-wrap: wrap;\n min-width: 0;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--appBarContentWrapper {\n padding-left: 10px;\n}\n\n.utilities_ops-announcements_Banner--appBarContentWrapper b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--feedUrl {\n text-decoration: none !important;\n}\n\n.utilities_ops-announcements_Banner--feedUrl i {\n font-size: 14px;\n cursor: pointer;\n color: #1d5ab9;\n left: 2px;\n position: relative;\n top: 2px;\n margin-right: 3px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationSidebarList {\n display: flex;\n flex-direction: column;\n grid-gap: 8px;\n gap: 8px;\n min-width: 0;\n width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardWrapper {\n position: relative;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardWrapperStacked {\n padding-bottom: 12px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardWrapperExpanded {\n padding-bottom: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardWrapperExpanded .utilities_ops-announcements_Banner--sideNotificationStackContainer {\n opacity: 0;\n visibility: hidden;\n -webkit-transform: none;\n transform: none;\n transition: none;\n pointer-events: none;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedGroup {\n display: flex;\n flex-direction: column;\n grid-gap: 5px;\n gap: 5px;\n min-width: 0;\n width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationSecondaryBody {\n width: 100%;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationAnimateCollapse {\n display: grid;\n grid-template-rows: 0fr;\n opacity: 0;\n transition:\n grid-template-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1),\n opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1);\n transition:\n grid-template-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1),\n opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1),\n -ms-grid-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationAnimateCollapseOpen {\n grid-template-rows: 1fr;\n opacity: 1;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCollapseBody {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationAnimateCollapseInner {\n overflow: hidden;\n min-height: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCollapseBodyWrap,\n.utilities_ops-announcements_Banner--sideNotificationExpandedItemsWrap {\n min-width: 0;\n width: 100%;\n}\n\n/* Nested white notification cards inside the expanded app group container */\n.utilities_ops-announcements_Banner--sideNotificationExpandedItemsList {\n display: flex;\n flex-direction: column;\n grid-gap: 8px;\n gap: 8px;\n min-width: 0;\n width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationItemCard {\n background-color: #ffffff;\n border-radius: 8px;\n padding: 10px 12px;\n min-width: 0;\n width: 100%;\n overflow: hidden;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackContainer {\n position: absolute;\n left: 8px;\n right: 8px;\n bottom: 0;\n height: 16px;\n cursor: pointer;\n z-index: 0;\n opacity: 1;\n -webkit-transform: translateY(0);\n transform: translateY(0);\n transition:\n opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),\n -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n transition:\n opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),\n transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n transition:\n opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),\n transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),\n -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackContainerHidden {\n opacity: 0;\n -webkit-transform: translateY(6px);\n transform: translateY(6px);\n pointer-events: none;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackLayer {\n position: absolute;\n left: 0;\n right: 0;\n height: 8px;\n background-color: #d6e4f7;\n border-radius: 0 0 8px 8px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackLayer1 {\n bottom: 6px;\n background-color: rgba(223, 233, 251, 0.70);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackLayer2 {\n bottom: 0px;\n left: 6px;\n right: 6px;\n background-color: rgba(223, 233, 251, 0.50);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCard {\n position: relative;\n z-index: 1;\n background-color: #DFE9FB;\n border-radius: 8px;\n padding: 12px 14px;\n min-width: 0;\n overflow: hidden;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n grid-gap: 8px;\n gap: 8px;\n margin: 0 -14px 10px;\n padding: 0 14px 10px;\n border-bottom: 1px solid #C7D1E5;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardHeaderLeft {\n display: flex;\n align-items: center;\n grid-gap: 8px;\n gap: 8px;\n min-width: 0;\n flex: 1;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardHeaderRight {\n display: flex;\n align-items: center;\n grid-gap: 6px;\n gap: 6px;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardHeaderTime {\n font-size: 11px;\n color: rgba(0, 0, 0, 0.20);\n font-weight: 600;\n white-space: nowrap;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationChevronBtn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: none;\n color: #000;\n cursor: pointer;\n width: 24px;\n height: 24px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationChevronBtn i,\n.utilities_ops-announcements_Banner--sideNotificationChevronBtn svg {\n font-size: 16px;\n color: #000;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationChevronIcon {\n display: inline-flex;\n transition: -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationChevronIconExpanded {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardPreview {\n font-size: 13px;\n font-weight: 600;\n color: #201f1e;\n line-height: 1.4;\n min-width: 0;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n text-overflow: ellipsis;\n word-break: break-word;\n word-wrap: anywhere;\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardPreview * {\n display: inline;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationMoreBtn {\n display: block;\n margin-top: 8px;\n padding: 0;\n border: none;\n background: none;\n color: #1E54AD;\n font-size: 12px;\n font-weight: 400;\n line-height: 1.2;\n cursor: pointer;\n text-align: left;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationLoadMoreSentinel {\n height: 1px;\n width: 100%;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowMain {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n font-weight: 600;\n color: #201f1e;\n line-height: 1.35;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowText {\n word-break: break-word;\n word-wrap: anywhere;\n white-space: normal;\n display: inline;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowText * {\n white-space: normal;\n word-wrap: anywhere;\n word-break: break-word;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowLink {\n display: inline-flex;\n vertical-align: middle;\n text-decoration: none;\n line-height: 1;\n margin-left: 5px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowLink i {\n font-size: 16px;\n color: #1d5ab9;\n cursor: pointer;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRow {\n display: flex;\n align-items: flex-start;\n grid-gap: 8px;\n gap: 8px;\n min-width: 0;\n width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowAction {\n width: 100%;\n margin-top: 8px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowMeta {\n display: flex;\n grid-gap: 8px;\n gap: 8px;\n flex-shrink: 0;\n align-self: flex-start;\n padding-top: 1px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowTime {\n font-size: 11px;\n color: rgba(0, 0, 0, 0.20);\n font-weight: 600;\n white-space: nowrap;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationDismissBtn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: none;\n cursor: pointer;\n color: #000;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationDismissBtn i {\n font-size: 18px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIconWrap {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n background-color: #ffffff;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIcon {\n width: 16px;\n height: 16px;\n -o-object-fit: contain;\n object-fit: contain;\n -webkit-filter: invert(24%) sepia(100%) saturate(1350%) hue-rotate(201deg) brightness(96%) contrast(93%);\n filter: invert(24%) sepia(100%) saturate(1350%) hue-rotate(201deg) brightness(96%) contrast(93%);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIconPlaceholder {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n background-color: #ffffff;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppName {\n color: #3261bd;\n font-family: 'Segoe UI', SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n text-transform: uppercase;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n@media (max-width: 1760px) {\n .utilities_ops-announcements_Banner--notificationBarContent input {\n width: 331px !important;\n }\n}\n\n.utilities_ops-announcements_Banner--sideNotificationEmptyState {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n grid-gap: 16px;\n gap: 16px;\n margin-top: 75px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationEmptyIcon {\n display: block;\n width: auto;\n height: auto;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationEmptyText {\n font-family: 'Segoe UI', SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, sans-serif;\n font-size: 14px;\n font-weight: 600;\n color: #323130;\n}\n";
|
|
25566
25535
|
styleInject(css_248z$9);
|
|
25567
25536
|
|
|
25568
|
-
|
|
25569
|
-
|
|
25570
|
-
|
|
25571
|
-
|
|
25572
|
-
|
|
25573
|
-
|
|
25574
|
-
|
|
25575
|
-
|
|
25537
|
+
var PREFERENCE_KEY = 'g2-viewedNotifications';
|
|
25538
|
+
|
|
25539
|
+
// Backward-compat bridge for apps still on older toolkit versions that read/write
|
|
25540
|
+
// viewedNotifications via localStorage only. New toolkit uses user preferences as
|
|
25541
|
+
// source of truth but mirrors to localStorage on init and dismiss so mixed-version
|
|
25542
|
+
// apps stay in sync on the same browser.
|
|
25543
|
+
// TODO: Remove LEGACY_LOCAL_STORAGE_KEY, readLegacyLocalStorageMap,
|
|
25544
|
+
// writeLegacyLocalStorageMap, mergeMapsWithLatestDismissed dual-read logic, and
|
|
25545
|
+
// localStorage writes in syncViewedNotificationsStores / addNotificationToViewedList
|
|
25546
|
+
// once all apps have migrated to the latest toolkit.
|
|
25547
|
+
var LEGACY_LOCAL_STORAGE_KEY = 'viewedNotifications';
|
|
25548
|
+
|
|
25549
|
+
/** In-memory map for O(1) dismiss lookups during filterNotifications. */
|
|
25550
|
+
var viewedNotificationsMap = {};
|
|
25551
|
+
var initPromise = null;
|
|
25576
25552
|
function injectDismissedAt(notification) {
|
|
25577
25553
|
return _objectSpread2(_objectSpread2({}, notification), {}, {
|
|
25578
25554
|
dismissedAt: new Date().toISOString()
|
|
@@ -25581,40 +25557,222 @@ function injectDismissedAt(notification) {
|
|
|
25581
25557
|
function getNotificationSignatureToStore(notification) {
|
|
25582
25558
|
return compose(injectDismissedAt, pick$1(['notificationId', 'endsAt', 'startsAt']))(notification);
|
|
25583
25559
|
}
|
|
25584
|
-
function
|
|
25560
|
+
function arrayToMap(entries) {
|
|
25561
|
+
if (!Array.isArray(entries)) return {};
|
|
25562
|
+
return entries.reduce(function (acc, entry) {
|
|
25563
|
+
if (entry !== null && entry !== void 0 && entry.notificationId) {
|
|
25564
|
+
acc[entry.notificationId] = entry;
|
|
25565
|
+
}
|
|
25566
|
+
return acc;
|
|
25567
|
+
}, {});
|
|
25568
|
+
}
|
|
25569
|
+
function mapToPayload(map) {
|
|
25570
|
+
return {
|
|
25571
|
+
viewedNotifications: Object.values(map)
|
|
25572
|
+
};
|
|
25573
|
+
}
|
|
25574
|
+
function normalizePreferenceData(data) {
|
|
25575
|
+
if (!data || _typeof$1(data) !== 'object') return {};
|
|
25576
|
+
if (Array.isArray(data.viewedNotifications)) {
|
|
25577
|
+
return arrayToMap(data.viewedNotifications);
|
|
25578
|
+
}
|
|
25579
|
+
|
|
25580
|
+
// Support legacy object-map shape if ever stored that way.
|
|
25581
|
+
if (!Array.isArray(data.viewedNotifications) && !data.viewedNotifications && Object.values(data).every(function (entry) {
|
|
25582
|
+
return entry && _typeof$1(entry) === 'object' && entry.notificationId;
|
|
25583
|
+
})) {
|
|
25584
|
+
return data;
|
|
25585
|
+
}
|
|
25586
|
+
return {};
|
|
25587
|
+
}
|
|
25588
|
+
function readLegacyLocalStorageMap() {
|
|
25585
25589
|
try {
|
|
25586
|
-
|
|
25590
|
+
var raw = localStorage.getItem(LEGACY_LOCAL_STORAGE_KEY);
|
|
25591
|
+
if (!raw) return {};
|
|
25592
|
+
var parsed = JSON.parse(raw);
|
|
25593
|
+
if (Array.isArray(parsed)) {
|
|
25594
|
+
return arrayToMap(parsed);
|
|
25595
|
+
}
|
|
25596
|
+
if (parsed && _typeof$1(parsed) === 'object') {
|
|
25597
|
+
return parsed;
|
|
25598
|
+
}
|
|
25599
|
+
return {};
|
|
25587
25600
|
} catch (err) {
|
|
25588
25601
|
console.error(err);
|
|
25602
|
+
return {};
|
|
25589
25603
|
}
|
|
25590
25604
|
}
|
|
25591
|
-
|
|
25592
|
-
// Removes entries whose endsAt has already passed.
|
|
25593
|
-
// endsAt is stored as a UTC string without Z (e.g. '2024-01-15 14:30:00'),
|
|
25594
|
-
// matching the end_date_ts_utc format used in generateQuery's Solr filter.
|
|
25595
|
-
// Any entry with endsAt < now will never be returned by the API again, so it
|
|
25596
|
-
// can be safely dropped.
|
|
25597
|
-
function pruneExpiredViewedNotifications() {
|
|
25605
|
+
function writeLegacyLocalStorageMap(map) {
|
|
25598
25606
|
try {
|
|
25599
|
-
|
|
25600
|
-
if (!viewed || _typeof$1(viewed) !== 'object' || Array.isArray(viewed)) return;
|
|
25601
|
-
var entries = Object.entries(viewed);
|
|
25602
|
-
if (!entries.length) return;
|
|
25603
|
-
var now = new Date();
|
|
25604
|
-
var pruned = Object.fromEntries(entries.filter(function (_ref) {
|
|
25605
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
25606
|
-
entry = _ref2[1];
|
|
25607
|
-
if (!entry || !entry.endsAt) return false;
|
|
25608
|
-
var endsAt = new Date(String(entry.endsAt).replace(' ', 'T') + 'Z');
|
|
25609
|
-
return !isNaN(endsAt.getTime()) && endsAt > now;
|
|
25610
|
-
}));
|
|
25611
|
-
// Skip the write if nothing was pruned to avoid unnecessary localStorage I/O
|
|
25612
|
-
if (Object.keys(pruned).length === entries.length) return;
|
|
25613
|
-
localStorage.setItem('viewedNotifications', JSON.stringify(pruned));
|
|
25607
|
+
localStorage.setItem(LEGACY_LOCAL_STORAGE_KEY, JSON.stringify(map));
|
|
25614
25608
|
} catch (err) {
|
|
25615
25609
|
console.error(err);
|
|
25616
25610
|
}
|
|
25617
25611
|
}
|
|
25612
|
+
function getDismissedAtTime(entry) {
|
|
25613
|
+
if (!(entry !== null && entry !== void 0 && entry.dismissedAt)) return 0;
|
|
25614
|
+
var time = new Date(entry.dismissedAt).getTime();
|
|
25615
|
+
return Number.isNaN(time) ? 0 : time;
|
|
25616
|
+
}
|
|
25617
|
+
|
|
25618
|
+
// When preferences and localStorage diverge, keep the most recently dismissed entry.
|
|
25619
|
+
function mergeMapsWithLatestDismissed() {
|
|
25620
|
+
for (var _len = arguments.length, maps = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25621
|
+
maps[_key] = arguments[_key];
|
|
25622
|
+
}
|
|
25623
|
+
return maps.reduce(function (acc, map) {
|
|
25624
|
+
Object.entries(map || {}).forEach(function (_ref) {
|
|
25625
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
25626
|
+
id = _ref2[0],
|
|
25627
|
+
entry = _ref2[1];
|
|
25628
|
+
if (!(entry !== null && entry !== void 0 && entry.notificationId)) return;
|
|
25629
|
+
var existing = acc[id];
|
|
25630
|
+
if (!existing || getDismissedAtTime(entry) >= getDismissedAtTime(existing)) {
|
|
25631
|
+
acc[id] = entry;
|
|
25632
|
+
}
|
|
25633
|
+
});
|
|
25634
|
+
return acc;
|
|
25635
|
+
}, {});
|
|
25636
|
+
}
|
|
25637
|
+
function mapsAreEqual(left, right) {
|
|
25638
|
+
var leftKeys = Object.keys(left);
|
|
25639
|
+
var rightKeys = Object.keys(right);
|
|
25640
|
+
if (leftKeys.length !== rightKeys.length) return false;
|
|
25641
|
+
return leftKeys.every(function (key) {
|
|
25642
|
+
return JSON.stringify(left[key]) === JSON.stringify(right[key]);
|
|
25643
|
+
});
|
|
25644
|
+
}
|
|
25645
|
+
|
|
25646
|
+
// Removes entries whose endsAt has already passed.
|
|
25647
|
+
// endsAt is stored as a UTC string without Z (e.g. '2024-01-15 14:30:00'),
|
|
25648
|
+
// matching the end_date_ts_utc format used in generateQuery's Solr filter.
|
|
25649
|
+
function pruneExpiredViewedNotificationsMap(map) {
|
|
25650
|
+
if (!map || _typeof$1(map) !== 'object') return {};
|
|
25651
|
+
var now = new Date();
|
|
25652
|
+
return Object.fromEntries(Object.entries(map).filter(function (_ref3) {
|
|
25653
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
25654
|
+
entry = _ref4[1];
|
|
25655
|
+
if (!entry || !entry.endsAt) return false;
|
|
25656
|
+
var endsAt = new Date(String(entry.endsAt).replace(' ', 'T') + 'Z');
|
|
25657
|
+
return !isNaN(endsAt.getTime()) && endsAt > now;
|
|
25658
|
+
}));
|
|
25659
|
+
}
|
|
25660
|
+
function persistViewedNotificationsMap(_x) {
|
|
25661
|
+
return _persistViewedNotificationsMap.apply(this, arguments);
|
|
25662
|
+
}
|
|
25663
|
+
function _persistViewedNotificationsMap() {
|
|
25664
|
+
_persistViewedNotificationsMap = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(map) {
|
|
25665
|
+
var _t;
|
|
25666
|
+
return _regenerator().w(function (_context) {
|
|
25667
|
+
while (1) switch (_context.p = _context.n) {
|
|
25668
|
+
case 0:
|
|
25669
|
+
_context.p = 0;
|
|
25670
|
+
_context.n = 1;
|
|
25671
|
+
return fetcher$1.setUserPreferences(PREFERENCE_KEY, mapToPayload(map));
|
|
25672
|
+
case 1:
|
|
25673
|
+
_context.n = 3;
|
|
25674
|
+
break;
|
|
25675
|
+
case 2:
|
|
25676
|
+
_context.p = 2;
|
|
25677
|
+
_t = _context.v;
|
|
25678
|
+
console.error('setUserPreferences viewed notifications error', _t);
|
|
25679
|
+
case 3:
|
|
25680
|
+
return _context.a(2);
|
|
25681
|
+
}
|
|
25682
|
+
}, _callee, null, [[0, 2]]);
|
|
25683
|
+
}));
|
|
25684
|
+
return _persistViewedNotificationsMap.apply(this, arguments);
|
|
25685
|
+
}
|
|
25686
|
+
function syncViewedNotificationsStores(_x2) {
|
|
25687
|
+
return _syncViewedNotificationsStores.apply(this, arguments);
|
|
25688
|
+
}
|
|
25689
|
+
function _syncViewedNotificationsStores() {
|
|
25690
|
+
_syncViewedNotificationsStores = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2(map) {
|
|
25691
|
+
var preferenceMapBeforeSync,
|
|
25692
|
+
_args2 = arguments;
|
|
25693
|
+
return _regenerator().w(function (_context2) {
|
|
25694
|
+
while (1) switch (_context2.n) {
|
|
25695
|
+
case 0:
|
|
25696
|
+
preferenceMapBeforeSync = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
|
|
25697
|
+
writeLegacyLocalStorageMap(map);
|
|
25698
|
+
if (!(preferenceMapBeforeSync && mapsAreEqual(map, preferenceMapBeforeSync))) {
|
|
25699
|
+
_context2.n = 1;
|
|
25700
|
+
break;
|
|
25701
|
+
}
|
|
25702
|
+
return _context2.a(2);
|
|
25703
|
+
case 1:
|
|
25704
|
+
_context2.n = 2;
|
|
25705
|
+
return persistViewedNotificationsMap(map);
|
|
25706
|
+
case 2:
|
|
25707
|
+
return _context2.a(2);
|
|
25708
|
+
}
|
|
25709
|
+
}, _callee2);
|
|
25710
|
+
}));
|
|
25711
|
+
return _syncViewedNotificationsStores.apply(this, arguments);
|
|
25712
|
+
}
|
|
25713
|
+
function setViewedNotificationsMap(map) {
|
|
25714
|
+
viewedNotificationsMap = map;
|
|
25715
|
+
}
|
|
25716
|
+
function isNotificationViewed(notificationId) {
|
|
25717
|
+
return Boolean(viewedNotificationsMap[notificationId]);
|
|
25718
|
+
}
|
|
25719
|
+
function initViewedNotifications() {
|
|
25720
|
+
return _initViewedNotifications.apply(this, arguments);
|
|
25721
|
+
}
|
|
25722
|
+
function _initViewedNotifications() {
|
|
25723
|
+
_initViewedNotifications = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
25724
|
+
return _regenerator().w(function (_context4) {
|
|
25725
|
+
while (1) switch (_context4.n) {
|
|
25726
|
+
case 0:
|
|
25727
|
+
if (!initPromise) {
|
|
25728
|
+
_context4.n = 1;
|
|
25729
|
+
break;
|
|
25730
|
+
}
|
|
25731
|
+
return _context4.a(2, initPromise);
|
|
25732
|
+
case 1:
|
|
25733
|
+
initPromise = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
25734
|
+
var preferenceMap, preferenceData, legacyMap, mergedMap, prunedMap, _t2;
|
|
25735
|
+
return _regenerator().w(function (_context3) {
|
|
25736
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
25737
|
+
case 0:
|
|
25738
|
+
preferenceMap = {};
|
|
25739
|
+
_context3.p = 1;
|
|
25740
|
+
_context3.n = 2;
|
|
25741
|
+
return fetcher$1.getUserPreferences(PREFERENCE_KEY);
|
|
25742
|
+
case 2:
|
|
25743
|
+
preferenceData = _context3.v;
|
|
25744
|
+
preferenceMap = normalizePreferenceData(preferenceData);
|
|
25745
|
+
_context3.n = 4;
|
|
25746
|
+
break;
|
|
25747
|
+
case 3:
|
|
25748
|
+
_context3.p = 3;
|
|
25749
|
+
_t2 = _context3.v;
|
|
25750
|
+
console.error('getUserPreferences viewed notifications error', _t2);
|
|
25751
|
+
case 4:
|
|
25752
|
+
legacyMap = readLegacyLocalStorageMap();
|
|
25753
|
+
mergedMap = mergeMapsWithLatestDismissed(preferenceMap, legacyMap);
|
|
25754
|
+
prunedMap = pruneExpiredViewedNotificationsMap(mergedMap);
|
|
25755
|
+
setViewedNotificationsMap(prunedMap);
|
|
25756
|
+
_context3.n = 5;
|
|
25757
|
+
return syncViewedNotificationsStores(prunedMap, preferenceMap);
|
|
25758
|
+
case 5:
|
|
25759
|
+
return _context3.a(2);
|
|
25760
|
+
}
|
|
25761
|
+
}, _callee3, null, [[1, 3]]);
|
|
25762
|
+
}))();
|
|
25763
|
+
return _context4.a(2, initPromise);
|
|
25764
|
+
}
|
|
25765
|
+
}, _callee4);
|
|
25766
|
+
}));
|
|
25767
|
+
return _initViewedNotifications.apply(this, arguments);
|
|
25768
|
+
}
|
|
25769
|
+
function addNotificationToViewedList(notification) {
|
|
25770
|
+
if (!(notification !== null && notification !== void 0 && notification.notificationId)) return;
|
|
25771
|
+
var nextMap = _objectSpread2(_objectSpread2({}, viewedNotificationsMap), {}, _defineProperty$2({}, notification.notificationId, getNotificationSignatureToStore(notification)));
|
|
25772
|
+
setViewedNotificationsMap(nextMap);
|
|
25773
|
+
writeLegacyLocalStorageMap(nextMap);
|
|
25774
|
+
persistViewedNotificationsMap(nextMap);
|
|
25775
|
+
}
|
|
25618
25776
|
|
|
25619
25777
|
// Parses a UTC date string like '2024-01-15 14:30:00' (no Z suffix) into a Date object.
|
|
25620
25778
|
// startsAt/endsAt come from the API with the T and Z stripped, so we restore them here.
|
|
@@ -25658,12 +25816,29 @@ function filterOutExpiredNotifications(notifications) {
|
|
|
25658
25816
|
return startDate < now && now < endDate;
|
|
25659
25817
|
})(notifications);
|
|
25660
25818
|
}
|
|
25819
|
+
var NOTIFICATION_DISPLAY_LOCATION = {
|
|
25820
|
+
BANNER: 'BANNER',
|
|
25821
|
+
SIDEBAR: 'SIDEBAR'
|
|
25822
|
+
};
|
|
25823
|
+
function getNotificationDisplayLocation(notification) {
|
|
25824
|
+
var value = (notification === null || notification === void 0 ? void 0 : notification.displayLocation) || NOTIFICATION_DISPLAY_LOCATION.BANNER;
|
|
25825
|
+
var normalized = String(value).toUpperCase();
|
|
25826
|
+
return normalized === NOTIFICATION_DISPLAY_LOCATION.SIDEBAR ? NOTIFICATION_DISPLAY_LOCATION.SIDEBAR : NOTIFICATION_DISPLAY_LOCATION.BANNER;
|
|
25827
|
+
}
|
|
25828
|
+
function filterBannerNotifications(notifications) {
|
|
25829
|
+
return (notifications || []).filter(function (notification) {
|
|
25830
|
+
return getNotificationDisplayLocation(notification) === NOTIFICATION_DISPLAY_LOCATION.BANNER;
|
|
25831
|
+
});
|
|
25832
|
+
}
|
|
25833
|
+
function filterSidebarNotifications(notifications) {
|
|
25834
|
+
return (notifications || []).filter(function (notification) {
|
|
25835
|
+
return getNotificationDisplayLocation(notification) === NOTIFICATION_DISPLAY_LOCATION.SIDEBAR;
|
|
25836
|
+
});
|
|
25837
|
+
}
|
|
25661
25838
|
function filterNotifications(notifications) {
|
|
25662
25839
|
try {
|
|
25663
25840
|
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config') || {};
|
|
25664
25841
|
var filterByTargets = coreAppConfig.filterNotificationsByTargets;
|
|
25665
|
-
// filterOutViewedNotifications
|
|
25666
|
-
var viewedNotifications = getViewedNotifications();
|
|
25667
25842
|
// filterOutExpiredNotifications
|
|
25668
25843
|
var now = new Date();
|
|
25669
25844
|
// filterOutNotificationByAudience — only when filterNotificationsByTargets is true;
|
|
@@ -25680,7 +25855,7 @@ function filterNotifications(notifications) {
|
|
|
25680
25855
|
if ((notification === null || notification === void 0 ? void 0 : notification.status) !== 'A') return false;
|
|
25681
25856
|
|
|
25682
25857
|
// filterOutViewedNotifications
|
|
25683
|
-
if (
|
|
25858
|
+
if (isNotificationViewed(notification.notificationId)) return false;
|
|
25684
25859
|
|
|
25685
25860
|
// filterOutExpiredNotifications
|
|
25686
25861
|
var startsAt = notification.startsAt,
|
|
@@ -25732,7 +25907,6 @@ function getPriorityCode(category) {
|
|
|
25732
25907
|
information: 1
|
|
25733
25908
|
}[category.toLowerCase()];
|
|
25734
25909
|
}
|
|
25735
|
-
var MAX_NOTIFICATIONS_PER_APP_GROUP = 5;
|
|
25736
25910
|
function getAppTileIcon(sourceApplication) {
|
|
25737
25911
|
var _storage$getLocalItem;
|
|
25738
25912
|
if (!sourceApplication) return null;
|
|
@@ -25743,44 +25917,45 @@ function getAppTileIcon(sourceApplication) {
|
|
|
25743
25917
|
});
|
|
25744
25918
|
return tile ? tile.faIconUrl || tile.iconUrl : null;
|
|
25745
25919
|
}
|
|
25920
|
+
function getNotificationStartTime(notification) {
|
|
25921
|
+
var startsAt = notification.startsAt,
|
|
25922
|
+
timeZoneType = notification.timeZoneType;
|
|
25923
|
+
if (timeZoneType === 'Recipient TimeZone' || timeZoneType === 'RPTZ') {
|
|
25924
|
+
return startsAt;
|
|
25925
|
+
}
|
|
25926
|
+
return moment.utc(startsAt).local().format('YYYY-MM-DD HH:mm:ss');
|
|
25927
|
+
}
|
|
25928
|
+
function getNotificationTimestamp(notification) {
|
|
25929
|
+
var startTime = getNotificationStartTime(notification);
|
|
25930
|
+
var startDate = moment(startTime);
|
|
25931
|
+
return startDate.isValid() ? startDate.valueOf() : 0;
|
|
25932
|
+
}
|
|
25746
25933
|
function groupNotificationsByApp(notifications) {
|
|
25747
|
-
var maxPerGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MAX_NOTIFICATIONS_PER_APP_GROUP;
|
|
25748
25934
|
var groupMap = new Map();
|
|
25749
|
-
var groupOrder = [];
|
|
25750
25935
|
notifications.forEach(function (notification) {
|
|
25751
25936
|
var appName = notification.sourceApplication || 'Other';
|
|
25752
25937
|
if (!groupMap.has(appName)) {
|
|
25753
25938
|
groupMap.set(appName, []);
|
|
25754
|
-
groupOrder.push(appName);
|
|
25755
25939
|
}
|
|
25756
25940
|
groupMap.get(appName).push(notification);
|
|
25757
25941
|
});
|
|
25758
|
-
|
|
25759
|
-
|
|
25760
|
-
|
|
25942
|
+
return Array.from(groupMap.entries()).map(function (_ref2) {
|
|
25943
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
25944
|
+
appName = _ref3[0],
|
|
25945
|
+
all = _ref3[1];
|
|
25946
|
+
var sorted = _toConsumableArray(all).sort(function (a, b) {
|
|
25947
|
+
return getNotificationTimestamp(b) - getNotificationTimestamp(a);
|
|
25761
25948
|
});
|
|
25762
|
-
});
|
|
25763
|
-
return groupOrder.map(function (appName) {
|
|
25764
|
-
var all = groupMap.get(appName);
|
|
25765
25949
|
return {
|
|
25766
25950
|
appName: appName,
|
|
25767
|
-
totalCount:
|
|
25768
|
-
notifications:
|
|
25769
|
-
|
|
25951
|
+
totalCount: sorted.length,
|
|
25952
|
+
notifications: sorted,
|
|
25953
|
+
latestTimestamp: sorted.length ? getNotificationTimestamp(sorted[0]) : 0
|
|
25770
25954
|
};
|
|
25955
|
+
}).sort(function (a, b) {
|
|
25956
|
+
return b.latestTimestamp - a.latestTimestamp;
|
|
25771
25957
|
});
|
|
25772
25958
|
}
|
|
25773
|
-
function getExpandedAppGroup(notifications, appName) {
|
|
25774
|
-
var appNotifications = notifications.filter(function (notification) {
|
|
25775
|
-
return (notification.sourceApplication || 'Other') === appName;
|
|
25776
|
-
});
|
|
25777
|
-
return {
|
|
25778
|
-
appName: appName,
|
|
25779
|
-
totalCount: appNotifications.length,
|
|
25780
|
-
notifications: appNotifications,
|
|
25781
|
-
hasMore: false
|
|
25782
|
-
};
|
|
25783
|
-
}
|
|
25784
25959
|
function sortNotifications(notifications) {
|
|
25785
25960
|
try {
|
|
25786
25961
|
return _toConsumableArray(notifications).map(function (n) {
|
|
@@ -25828,6 +26003,30 @@ var getTimeDiff = function getTimeDiff(startsAt) {
|
|
|
25828
26003
|
}
|
|
25829
26004
|
return '';
|
|
25830
26005
|
};
|
|
26006
|
+
var getSidebarTimeDiff = function getSidebarTimeDiff(startsAt) {
|
|
26007
|
+
var startDate = moment(startsAt);
|
|
26008
|
+
var todayDate = moment(new Date());
|
|
26009
|
+
var minsDiff = todayDate.diff(startDate, 'minutes');
|
|
26010
|
+
var hoursDiff = todayDate.diff(startDate, 'hours');
|
|
26011
|
+
var daysDiff = todayDate.diff(startDate, 'days');
|
|
26012
|
+
var monthsDiff = todayDate.diff(startDate, 'months');
|
|
26013
|
+
if (minsDiff < 1) {
|
|
26014
|
+
return '1m ago';
|
|
26015
|
+
}
|
|
26016
|
+
if (minsDiff < 60) {
|
|
26017
|
+
return "".concat(minsDiff, "m ago");
|
|
26018
|
+
}
|
|
26019
|
+
if (hoursDiff < 24) {
|
|
26020
|
+
return "".concat(hoursDiff, "h ago");
|
|
26021
|
+
}
|
|
26022
|
+
if (daysDiff <= 30) {
|
|
26023
|
+
return "".concat(daysDiff, "d ago");
|
|
26024
|
+
}
|
|
26025
|
+
if (monthsDiff <= 12) {
|
|
26026
|
+
return "".concat(monthsDiff, "mo ago");
|
|
26027
|
+
}
|
|
26028
|
+
return '';
|
|
26029
|
+
};
|
|
25831
26030
|
var SANITIZE_REGEX = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>|<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi;
|
|
25832
26031
|
var SanitizeNotificationContent = function SanitizeNotificationContent(str) {
|
|
25833
26032
|
SANITIZE_REGEX.lastIndex = 0;
|
|
@@ -25863,7 +26062,7 @@ var useWindowSize = function useWindowSize() {
|
|
|
25863
26062
|
return windowSize;
|
|
25864
26063
|
};
|
|
25865
26064
|
|
|
25866
|
-
var _excluded$
|
|
26065
|
+
var _excluded$3 = ["count", "current", "showNavButtons", "onLeftButtonClick", "onRightButtonClick", "saveActionComponentState", "ActionComponent", "notificationsTopContainerRef", "mobileNotificationsTopContainerRef", "setNotificationHeightFlag", "sidebarExpandedSecondary"];
|
|
25867
26066
|
var alertBackgroundColorMapping = {
|
|
25868
26067
|
alert: '#fab9b9',
|
|
25869
26068
|
warning: '#f5f5cb',
|
|
@@ -25932,13 +26131,13 @@ var Banner = function Banner(props) {
|
|
|
25932
26131
|
notificationsTopContainerRef = props.notificationsTopContainerRef,
|
|
25933
26132
|
mobileNotificationsTopContainerRef = props.mobileNotificationsTopContainerRef,
|
|
25934
26133
|
setNotificationHeightFlag = props.setNotificationHeightFlag,
|
|
25935
|
-
|
|
26134
|
+
sidebarExpandedSecondary = props.sidebarExpandedSecondary,
|
|
26135
|
+
notification = _objectWithoutProperties(props, _excluded$3);
|
|
25936
26136
|
var dismissibleFlag = notification.dismissibleFlag,
|
|
25937
26137
|
onDismiss = notification.onDismiss,
|
|
25938
26138
|
startsAt = notification.startsAt,
|
|
25939
26139
|
timeZoneType = notification.timeZoneType,
|
|
25940
26140
|
showSideBar = notification.showSideBar,
|
|
25941
|
-
isGroupedSideBar = notification.isGroupedSideBar,
|
|
25942
26141
|
action = notification.action,
|
|
25943
26142
|
content = notification.content,
|
|
25944
26143
|
sourceApplication = notification.sourceApplication,
|
|
@@ -25970,6 +26169,8 @@ var Banner = function Banner(props) {
|
|
|
25970
26169
|
}, [expanded]);
|
|
25971
26170
|
var startTime = timeZoneType === "Recipient TimeZone" || timeZoneType === "RPTZ" ? startsAt : moment.utc(startsAt).local().format("YYYY-MM-DD HH:mm:ss");
|
|
25972
26171
|
var timeDiff = getTimeDiff(startTime);
|
|
26172
|
+
var sidebarTimeDiff = sidebarExpandedSecondary ? getSidebarTimeDiff(startTime) : '';
|
|
26173
|
+
var isDismissible = dismissibleFlag === true || dismissibleFlag === "true";
|
|
25973
26174
|
var topNotificationBar = function topNotificationBar() {
|
|
25974
26175
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
25975
26176
|
className: "utilities_ops-announcements_Banner--notificationContainer",
|
|
@@ -26036,10 +26237,10 @@ var Banner = function Banner(props) {
|
|
|
26036
26237
|
onRightButtonClick: onRightButtonClick
|
|
26037
26238
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26038
26239
|
className: "utilities_ops-announcements_Banner--notificationBarBtn",
|
|
26039
|
-
style:
|
|
26240
|
+
style: isDismissible ? {
|
|
26040
26241
|
borderLeft: '2px solid rgb(204, 204, 204)'
|
|
26041
26242
|
} : {}
|
|
26042
|
-
},
|
|
26243
|
+
}, isDismissible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26043
26244
|
onClick: onDismiss
|
|
26044
26245
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
26045
26246
|
style: {
|
|
@@ -26049,112 +26250,54 @@ var Banner = function Banner(props) {
|
|
|
26049
26250
|
variant: "material"
|
|
26050
26251
|
}))));
|
|
26051
26252
|
};
|
|
26052
|
-
var
|
|
26053
|
-
var categoryColor = alertInfoColorMapping[categoryKey];
|
|
26054
|
-
var categoryBackground = alertBackgroundColorMapping[categoryKey];
|
|
26055
|
-
var groupedSideNotificationRow = function groupedSideNotificationRow() {
|
|
26253
|
+
var sidebarExpandedSecondaryRow = function sidebarExpandedSecondaryRow() {
|
|
26056
26254
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26057
|
-
className: "utilities_ops-announcements_Banner--
|
|
26058
|
-
style: {
|
|
26059
|
-
backgroundColor: categoryBackground
|
|
26060
|
-
}
|
|
26061
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26062
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowIcon",
|
|
26063
|
-
style: {
|
|
26064
|
-
backgroundColor: categoryColor
|
|
26065
|
-
}
|
|
26066
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
26067
|
-
name: alertToIconMapping[categoryKey],
|
|
26068
|
-
style: {
|
|
26069
|
-
fontSize: '11px'
|
|
26070
|
-
}
|
|
26071
|
-
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26072
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowContent"
|
|
26073
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26074
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowText",
|
|
26075
|
-
dangerouslySetInnerHTML: {
|
|
26076
|
-
__html: SanitizeNotificationContent(content)
|
|
26077
|
-
}
|
|
26078
|
-
}), action && ActionComponent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26079
|
-
style: {
|
|
26080
|
-
marginTop: '4px'
|
|
26081
|
-
}
|
|
26082
|
-
}, /*#__PURE__*/React__default["default"].createElement(ActionComponent, {
|
|
26083
|
-
notification: notification,
|
|
26084
|
-
saveActionComponentState: saveActionComponentState
|
|
26085
|
-
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26086
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowMeta"
|
|
26087
|
-
}, (feedUrl || link) && /*#__PURE__*/React__default["default"].createElement("a", {
|
|
26088
|
-
href: feedUrl || link,
|
|
26089
|
-
target: "_blank",
|
|
26090
|
-
rel: "noopener noreferrer",
|
|
26091
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowLink"
|
|
26092
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
26093
|
-
name: "open_in_new",
|
|
26094
|
-
variant: "material"
|
|
26095
|
-
})), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26096
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowTime"
|
|
26097
|
-
}, timeDiff)));
|
|
26098
|
-
};
|
|
26099
|
-
var sideNotificationBar = function sideNotificationBar() {
|
|
26100
|
-
return isGroupedSideBar ? groupedSideNotificationRow() : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26101
|
-
className: "utilities_ops-announcements_Banner--notificationContainer utilities_ops-announcements_Banner--sideBar",
|
|
26102
|
-
style: {
|
|
26103
|
-
backgroundColor: categoryBackground
|
|
26104
|
-
}
|
|
26105
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26106
|
-
className: "utilities_ops-announcements_Banner--appBarContentWrapper",
|
|
26107
|
-
style: {
|
|
26108
|
-
borderLeft: "2px solid ".concat(categoryColor)
|
|
26109
|
-
}
|
|
26255
|
+
className: "utilities_ops-announcements_Banner--sideNotificationSecondaryBody"
|
|
26110
26256
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26111
|
-
className: "utilities_ops-announcements_Banner--
|
|
26257
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRow"
|
|
26112
26258
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26113
|
-
className: "utilities_ops-announcements_Banner--
|
|
26114
|
-
style: {
|
|
26115
|
-
backgroundColor: categoryColor
|
|
26116
|
-
}
|
|
26117
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
26118
|
-
name: alertToIconMapping[categoryKey],
|
|
26119
|
-
style: {
|
|
26120
|
-
fontSize: '12px'
|
|
26121
|
-
}
|
|
26122
|
-
})), sourceApplication && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("b", null, sourceApplication), " -"), " ", timeDiff), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26123
|
-
className: "utilities_ops-announcements_Banner--appBarContentBox"
|
|
26259
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowMain"
|
|
26124
26260
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26261
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowText",
|
|
26125
26262
|
dangerouslySetInnerHTML: {
|
|
26126
26263
|
__html: SanitizeNotificationContent(content)
|
|
26127
26264
|
}
|
|
26128
26265
|
}), (feedUrl || link) && /*#__PURE__*/React__default["default"].createElement("a", {
|
|
26129
26266
|
href: feedUrl || link,
|
|
26130
26267
|
target: "_blank",
|
|
26131
|
-
|
|
26268
|
+
rel: "noopener noreferrer",
|
|
26269
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowLink"
|
|
26132
26270
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
26133
26271
|
name: "open_in_new",
|
|
26134
26272
|
variant: "material"
|
|
26135
|
-
}))), action && ActionComponent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26136
|
-
style: {
|
|
26137
|
-
marginBottom: '5px'
|
|
26138
|
-
}
|
|
26139
|
-
}, /*#__PURE__*/React__default["default"].createElement(ActionComponent, {
|
|
26140
|
-
notification: notification,
|
|
26141
|
-
saveActionComponentState: saveActionComponentState
|
|
26142
26273
|
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26143
|
-
className: "utilities_ops-announcements_Banner--
|
|
26144
|
-
|
|
26145
|
-
|
|
26146
|
-
|
|
26147
|
-
|
|
26148
|
-
|
|
26274
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowMeta"
|
|
26275
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26276
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowTime"
|
|
26277
|
+
}, sidebarTimeDiff), isDismissible && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
26278
|
+
type: "button",
|
|
26279
|
+
className: "utilities_ops-announcements_Banner--sideNotificationDismissBtn",
|
|
26280
|
+
onClick: onDismiss,
|
|
26281
|
+
"aria-label": "Dismiss notification"
|
|
26149
26282
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
26150
26283
|
style: {
|
|
26151
|
-
cursor: 'pointer'
|
|
26152
|
-
color: '#8A8886',
|
|
26153
|
-
fontSize: '20px'
|
|
26284
|
+
cursor: 'pointer'
|
|
26154
26285
|
},
|
|
26155
26286
|
name: "close",
|
|
26156
26287
|
variant: "material"
|
|
26157
|
-
}))))
|
|
26288
|
+
})))), action && ActionComponent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26289
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowAction"
|
|
26290
|
+
}, /*#__PURE__*/React__default["default"].createElement(ActionComponent, {
|
|
26291
|
+
notification: notification,
|
|
26292
|
+
saveActionComponentState: saveActionComponentState,
|
|
26293
|
+
displayVariant: "sidebarV2"
|
|
26294
|
+
})));
|
|
26295
|
+
};
|
|
26296
|
+
var sideNotificationBar = function sideNotificationBar() {
|
|
26297
|
+
if (sidebarExpandedSecondary) {
|
|
26298
|
+
return sidebarExpandedSecondaryRow();
|
|
26299
|
+
}
|
|
26300
|
+
return null;
|
|
26158
26301
|
};
|
|
26159
26302
|
var mobileNotificationBar = function mobileNotificationBar() {
|
|
26160
26303
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -26266,111 +26409,253 @@ var _styleModuleImportMap$4 = {
|
|
|
26266
26409
|
"appBarContentWrapper": "utilities_ops-announcements_Banner--appBarContentWrapper",
|
|
26267
26410
|
"sideBarNotificationMeta": "utilities_ops-announcements_Banner--sideBarNotificationMeta",
|
|
26268
26411
|
"feedUrl": "utilities_ops-announcements_Banner--feedUrl",
|
|
26269
|
-
"
|
|
26270
|
-
"
|
|
26271
|
-
"
|
|
26272
|
-
"
|
|
26273
|
-
"
|
|
26412
|
+
"sideNotificationSidebarList": "utilities_ops-announcements_Banner--sideNotificationSidebarList",
|
|
26413
|
+
"sideNotificationCardWrapper": "utilities_ops-announcements_Banner--sideNotificationCardWrapper",
|
|
26414
|
+
"sideNotificationCardWrapperStacked": "utilities_ops-announcements_Banner--sideNotificationCardWrapperStacked",
|
|
26415
|
+
"sideNotificationCardWrapperExpanded": "utilities_ops-announcements_Banner--sideNotificationCardWrapperExpanded",
|
|
26416
|
+
"sideNotificationStackContainer": "utilities_ops-announcements_Banner--sideNotificationStackContainer",
|
|
26417
|
+
"sideNotificationExpandedGroup": "utilities_ops-announcements_Banner--sideNotificationExpandedGroup",
|
|
26418
|
+
"sideNotificationSecondaryBody": "utilities_ops-announcements_Banner--sideNotificationSecondaryBody",
|
|
26419
|
+
"sideNotificationAnimateCollapse": "utilities_ops-announcements_Banner--sideNotificationAnimateCollapse",
|
|
26420
|
+
"sideNotificationAnimateCollapseOpen": "utilities_ops-announcements_Banner--sideNotificationAnimateCollapseOpen",
|
|
26421
|
+
"sideNotificationCollapseBody": "utilities_ops-announcements_Banner--sideNotificationCollapseBody",
|
|
26422
|
+
"sideNotificationAnimateCollapseInner": "utilities_ops-announcements_Banner--sideNotificationAnimateCollapseInner",
|
|
26423
|
+
"sideNotificationCollapseBodyWrap": "utilities_ops-announcements_Banner--sideNotificationCollapseBodyWrap",
|
|
26424
|
+
"sideNotificationExpandedItemsWrap": "utilities_ops-announcements_Banner--sideNotificationExpandedItemsWrap",
|
|
26425
|
+
"sideNotificationExpandedItemsList": "utilities_ops-announcements_Banner--sideNotificationExpandedItemsList",
|
|
26426
|
+
"sideNotificationItemCard": "utilities_ops-announcements_Banner--sideNotificationItemCard",
|
|
26427
|
+
"sideNotificationStackContainerHidden": "utilities_ops-announcements_Banner--sideNotificationStackContainerHidden",
|
|
26428
|
+
"sideNotificationStackLayer": "utilities_ops-announcements_Banner--sideNotificationStackLayer",
|
|
26429
|
+
"sideNotificationStackLayer1": "utilities_ops-announcements_Banner--sideNotificationStackLayer1",
|
|
26430
|
+
"sideNotificationStackLayer2": "utilities_ops-announcements_Banner--sideNotificationStackLayer2",
|
|
26431
|
+
"sideNotificationCard": "utilities_ops-announcements_Banner--sideNotificationCard",
|
|
26432
|
+
"sideNotificationCardHeader": "utilities_ops-announcements_Banner--sideNotificationCardHeader",
|
|
26433
|
+
"sideNotificationCardHeaderLeft": "utilities_ops-announcements_Banner--sideNotificationCardHeaderLeft",
|
|
26434
|
+
"sideNotificationCardHeaderRight": "utilities_ops-announcements_Banner--sideNotificationCardHeaderRight",
|
|
26435
|
+
"sideNotificationCardHeaderTime": "utilities_ops-announcements_Banner--sideNotificationCardHeaderTime",
|
|
26436
|
+
"sideNotificationChevronBtn": "utilities_ops-announcements_Banner--sideNotificationChevronBtn",
|
|
26437
|
+
"sideNotificationChevronIcon": "utilities_ops-announcements_Banner--sideNotificationChevronIcon",
|
|
26438
|
+
"sideNotificationChevronIconExpanded": "utilities_ops-announcements_Banner--sideNotificationChevronIconExpanded",
|
|
26439
|
+
"sideNotificationCardPreview": "utilities_ops-announcements_Banner--sideNotificationCardPreview",
|
|
26440
|
+
"sideNotificationMoreBtn": "utilities_ops-announcements_Banner--sideNotificationMoreBtn",
|
|
26441
|
+
"sideNotificationLoadMoreSentinel": "utilities_ops-announcements_Banner--sideNotificationLoadMoreSentinel",
|
|
26442
|
+
"sideNotificationExpandedRowMain": "utilities_ops-announcements_Banner--sideNotificationExpandedRowMain",
|
|
26443
|
+
"sideNotificationExpandedRowText": "utilities_ops-announcements_Banner--sideNotificationExpandedRowText",
|
|
26444
|
+
"sideNotificationExpandedRowLink": "utilities_ops-announcements_Banner--sideNotificationExpandedRowLink",
|
|
26445
|
+
"sideNotificationExpandedRow": "utilities_ops-announcements_Banner--sideNotificationExpandedRow",
|
|
26446
|
+
"sideNotificationExpandedRowAction": "utilities_ops-announcements_Banner--sideNotificationExpandedRowAction",
|
|
26447
|
+
"sideNotificationExpandedRowMeta": "utilities_ops-announcements_Banner--sideNotificationExpandedRowMeta",
|
|
26448
|
+
"sideNotificationExpandedRowTime": "utilities_ops-announcements_Banner--sideNotificationExpandedRowTime",
|
|
26449
|
+
"sideNotificationDismissBtn": "utilities_ops-announcements_Banner--sideNotificationDismissBtn",
|
|
26450
|
+
"sideNotificationGroupAppIconWrap": "utilities_ops-announcements_Banner--sideNotificationGroupAppIconWrap",
|
|
26274
26451
|
"sideNotificationGroupAppIcon": "utilities_ops-announcements_Banner--sideNotificationGroupAppIcon",
|
|
26275
26452
|
"sideNotificationGroupAppIconPlaceholder": "utilities_ops-announcements_Banner--sideNotificationGroupAppIconPlaceholder",
|
|
26276
26453
|
"sideNotificationGroupAppName": "utilities_ops-announcements_Banner--sideNotificationGroupAppName",
|
|
26277
|
-
"
|
|
26278
|
-
"
|
|
26279
|
-
"
|
|
26280
|
-
"sideNotificationRowContent": "utilities_ops-announcements_Banner--sideNotificationRowContent",
|
|
26281
|
-
"sideNotificationRowText": "utilities_ops-announcements_Banner--sideNotificationRowText",
|
|
26282
|
-
"sideNotificationRowMeta": "utilities_ops-announcements_Banner--sideNotificationRowMeta",
|
|
26283
|
-
"sideNotificationRowLink": "utilities_ops-announcements_Banner--sideNotificationRowLink",
|
|
26284
|
-
"sideNotificationRowTime": "utilities_ops-announcements_Banner--sideNotificationRowTime",
|
|
26285
|
-
"sideNotificationViewAll": "utilities_ops-announcements_Banner--sideNotificationViewAll"
|
|
26454
|
+
"sideNotificationEmptyState": "utilities_ops-announcements_Banner--sideNotificationEmptyState",
|
|
26455
|
+
"sideNotificationEmptyIcon": "utilities_ops-announcements_Banner--sideNotificationEmptyIcon",
|
|
26456
|
+
"sideNotificationEmptyText": "utilities_ops-announcements_Banner--sideNotificationEmptyText"
|
|
26286
26457
|
}
|
|
26287
26458
|
};
|
|
26459
|
+
var EXPANDED_BATCH_SIZE = 15;
|
|
26288
26460
|
var SideNotificationGroup = function SideNotificationGroup(_ref) {
|
|
26289
26461
|
var appName = _ref.appName,
|
|
26290
26462
|
totalCount = _ref.totalCount,
|
|
26291
26463
|
notifications = _ref.notifications,
|
|
26292
|
-
|
|
26293
|
-
|
|
26294
|
-
onBack = _ref.onBack,
|
|
26295
|
-
onViewAll = _ref.onViewAll,
|
|
26464
|
+
isExpanded = _ref.isExpanded,
|
|
26465
|
+
onToggleExpand = _ref.onToggleExpand,
|
|
26296
26466
|
_onDismiss = _ref.onDismiss,
|
|
26467
|
+
scrollContainerRef = _ref.scrollContainerRef,
|
|
26297
26468
|
ActionComponent = _ref.ActionComponent,
|
|
26298
26469
|
saveActionComponentState = _ref.saveActionComponentState;
|
|
26299
26470
|
var appIconUrl = getAppTileIcon(appName);
|
|
26471
|
+
var topNotification = notifications[0];
|
|
26472
|
+
var moreCount = totalCount - 1;
|
|
26473
|
+
var stackLayers = Math.min(moreCount, 2);
|
|
26474
|
+
var topStartTime = topNotification ? getNotificationStartTime(topNotification) : null;
|
|
26475
|
+
var topTimeDiff = topStartTime ? getSidebarTimeDiff(topStartTime) : '';
|
|
26476
|
+
var _useState = React.useState(EXPANDED_BATCH_SIZE),
|
|
26477
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26478
|
+
visibleCount = _useState2[0],
|
|
26479
|
+
setVisibleCount = _useState2[1];
|
|
26480
|
+
var loadMoreRef = React.useRef(null);
|
|
26481
|
+
var totalCountRef = React.useRef(notifications.length);
|
|
26482
|
+
totalCountRef.current = notifications.length;
|
|
26483
|
+
React.useEffect(function () {
|
|
26484
|
+
setVisibleCount(EXPANDED_BATCH_SIZE);
|
|
26485
|
+
}, [isExpanded, notifications.length]);
|
|
26486
|
+
var loadMoreIfNeeded = React.useCallback(function () {
|
|
26487
|
+
var scrollRoot = scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : scrollContainerRef.current;
|
|
26488
|
+
var sentinel = loadMoreRef.current;
|
|
26489
|
+
if (!scrollRoot || !sentinel) {
|
|
26490
|
+
return;
|
|
26491
|
+
}
|
|
26492
|
+
setVisibleCount(function (prev) {
|
|
26493
|
+
if (prev >= totalCountRef.current) {
|
|
26494
|
+
return prev;
|
|
26495
|
+
}
|
|
26496
|
+
var rootRect = scrollRoot.getBoundingClientRect();
|
|
26497
|
+
var sentinelRect = sentinel.getBoundingClientRect();
|
|
26498
|
+
if (sentinelRect.top <= rootRect.bottom + 200) {
|
|
26499
|
+
return Math.min(prev + EXPANDED_BATCH_SIZE, totalCountRef.current);
|
|
26500
|
+
}
|
|
26501
|
+
return prev;
|
|
26502
|
+
});
|
|
26503
|
+
}, [scrollContainerRef]);
|
|
26504
|
+
React.useEffect(function () {
|
|
26505
|
+
if (!isExpanded || visibleCount >= notifications.length) {
|
|
26506
|
+
return undefined;
|
|
26507
|
+
}
|
|
26508
|
+
var scrollRoot = scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : scrollContainerRef.current;
|
|
26509
|
+
var sentinel = loadMoreRef.current;
|
|
26510
|
+
if (!scrollRoot || !sentinel) {
|
|
26511
|
+
return undefined;
|
|
26512
|
+
}
|
|
26513
|
+
var observer = new IntersectionObserver(function (entries) {
|
|
26514
|
+
var _entries$;
|
|
26515
|
+
if ((_entries$ = entries[0]) !== null && _entries$ !== void 0 && _entries$.isIntersecting) {
|
|
26516
|
+
loadMoreIfNeeded();
|
|
26517
|
+
}
|
|
26518
|
+
}, {
|
|
26519
|
+
root: scrollRoot,
|
|
26520
|
+
rootMargin: '200px',
|
|
26521
|
+
threshold: 0
|
|
26522
|
+
});
|
|
26523
|
+
observer.observe(sentinel);
|
|
26524
|
+
scrollRoot.addEventListener('scroll', loadMoreIfNeeded, {
|
|
26525
|
+
passive: true
|
|
26526
|
+
});
|
|
26527
|
+
loadMoreIfNeeded();
|
|
26528
|
+
return function () {
|
|
26529
|
+
observer.disconnect();
|
|
26530
|
+
scrollRoot.removeEventListener('scroll', loadMoreIfNeeded);
|
|
26531
|
+
};
|
|
26532
|
+
}, [isExpanded, notifications.length, visibleCount, scrollContainerRef, loadMoreIfNeeded]);
|
|
26533
|
+
React.useEffect(function () {
|
|
26534
|
+
if (!isExpanded || visibleCount >= notifications.length) {
|
|
26535
|
+
return undefined;
|
|
26536
|
+
}
|
|
26537
|
+
var frameId = requestAnimationFrame(loadMoreIfNeeded);
|
|
26538
|
+
return function () {
|
|
26539
|
+
return cancelAnimationFrame(frameId);
|
|
26540
|
+
};
|
|
26541
|
+
}, [isExpanded, visibleCount, notifications.length, loadMoreIfNeeded]);
|
|
26542
|
+
var handleExpandClick = function handleExpandClick(e) {
|
|
26543
|
+
e.stopPropagation();
|
|
26544
|
+
if (!isExpanded) {
|
|
26545
|
+
onToggleExpand();
|
|
26546
|
+
}
|
|
26547
|
+
};
|
|
26548
|
+
var handleChevronClick = function handleChevronClick(e) {
|
|
26549
|
+
e.stopPropagation();
|
|
26550
|
+
onToggleExpand();
|
|
26551
|
+
};
|
|
26552
|
+
var moreLabel = moreCount === 1 ? '1 more notification' : "".concat(moreCount, " more notifications");
|
|
26553
|
+
var visibleNotifications = notifications.slice(0, visibleCount);
|
|
26554
|
+
var hasMore = visibleCount < notifications.length;
|
|
26555
|
+
var renderHeader = function renderHeader() {
|
|
26556
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26557
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardHeader"
|
|
26558
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26559
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardHeaderLeft"
|
|
26560
|
+
}, appIconUrl ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26561
|
+
className: "utilities_ops-announcements_Banner--sideNotificationGroupAppIconWrap"
|
|
26562
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
26563
|
+
className: "utilities_ops-announcements_Banner--sideNotificationGroupAppIcon",
|
|
26564
|
+
src: appIconUrl,
|
|
26565
|
+
alt: ""
|
|
26566
|
+
})) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26567
|
+
className: "utilities_ops-announcements_Banner--sideNotificationGroupAppIconPlaceholder"
|
|
26568
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26569
|
+
className: "utilities_ops-announcements_Banner--sideNotificationGroupAppName"
|
|
26570
|
+
}, appName, " (", totalCount, ")")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26571
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardHeaderRight"
|
|
26572
|
+
}, !isExpanded && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26573
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardHeaderTime"
|
|
26574
|
+
}, topTimeDiff), /*#__PURE__*/React__default["default"].createElement("button", {
|
|
26575
|
+
type: "button",
|
|
26576
|
+
className: "utilities_ops-announcements_Banner--sideNotificationChevronBtn",
|
|
26577
|
+
onClick: handleChevronClick,
|
|
26578
|
+
"aria-label": isExpanded ? 'Collapse notifications' : 'Expand notifications',
|
|
26579
|
+
"aria-expanded": isExpanded
|
|
26580
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26581
|
+
className: _getClassName("sideNotificationChevronIcon".concat(isExpanded ? ' sideNotificationChevronIconExpanded' : ''), _styleModuleImportMap$4, {
|
|
26582
|
+
"handleMissingStyleName": "warn"
|
|
26583
|
+
})
|
|
26584
|
+
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
26585
|
+
variant: "regular",
|
|
26586
|
+
name: "angle-down",
|
|
26587
|
+
style: {
|
|
26588
|
+
color: '#000'
|
|
26589
|
+
}
|
|
26590
|
+
})))));
|
|
26591
|
+
};
|
|
26300
26592
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26301
|
-
className: "
|
|
26302
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26303
|
-
className: _getClassName("sideNotificationGroupHeader".concat(showBackButton ? ' sideNotificationGroupHeaderWithBack' : ''), _styleModuleImportMap$4, {
|
|
26593
|
+
className: _getClassName("sideNotificationCardWrapper".concat(moreCount > 0 && !isExpanded ? ' sideNotificationCardWrapperStacked' : '').concat(isExpanded ? ' sideNotificationCardWrapperExpanded' : ''), _styleModuleImportMap$4, {
|
|
26304
26594
|
"handleMissingStyleName": "warn"
|
|
26305
26595
|
})
|
|
26306
|
-
},
|
|
26307
|
-
|
|
26308
|
-
className: "
|
|
26309
|
-
|
|
26310
|
-
|
|
26311
|
-
},
|
|
26312
|
-
|
|
26596
|
+
}, moreCount > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26597
|
+
onClick: handleExpandClick,
|
|
26598
|
+
className: _getClassName("sideNotificationStackContainer".concat(isExpanded ? ' sideNotificationStackContainerHidden' : ''), _styleModuleImportMap$4, {
|
|
26599
|
+
"handleMissingStyleName": "warn"
|
|
26600
|
+
})
|
|
26601
|
+
}, Array.from({
|
|
26602
|
+
length: stackLayers
|
|
26603
|
+
}, function (_, i) {
|
|
26604
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26605
|
+
key: i,
|
|
26606
|
+
className: _getClassName("sideNotificationStackLayer sideNotificationStackLayer".concat(stackLayers - i), _styleModuleImportMap$4, {
|
|
26607
|
+
"handleMissingStyleName": "warn"
|
|
26608
|
+
})
|
|
26609
|
+
});
|
|
26313
26610
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26314
|
-
className: "utilities_ops-announcements_Banner--
|
|
26315
|
-
},
|
|
26316
|
-
className: "
|
|
26317
|
-
|
|
26318
|
-
|
|
26319
|
-
}
|
|
26320
|
-
className: "utilities_ops-announcements_Banner--
|
|
26321
|
-
}
|
|
26322
|
-
className: "utilities_ops-announcements_Banner--
|
|
26323
|
-
},
|
|
26324
|
-
className: "utilities_ops-announcements_Banner--
|
|
26325
|
-
},
|
|
26326
|
-
|
|
26327
|
-
|
|
26328
|
-
}
|
|
26611
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCard"
|
|
26612
|
+
}, renderHeader(), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26613
|
+
className: _getClassName("sideNotificationAnimateCollapse sideNotificationCollapseBodyWrap".concat(!isExpanded ? ' sideNotificationAnimateCollapseOpen' : ''), _styleModuleImportMap$4, {
|
|
26614
|
+
"handleMissingStyleName": "warn"
|
|
26615
|
+
})
|
|
26616
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26617
|
+
className: "utilities_ops-announcements_Banner--sideNotificationAnimateCollapseInner"
|
|
26618
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26619
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCollapseBody"
|
|
26620
|
+
}, topNotification && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26621
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardPreview"
|
|
26622
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26623
|
+
dangerouslySetInnerHTML: {
|
|
26624
|
+
__html: SanitizeNotificationContent(topNotification.content)
|
|
26625
|
+
}
|
|
26626
|
+
})), moreCount > 0 && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
26627
|
+
type: "button",
|
|
26628
|
+
className: "utilities_ops-announcements_Banner--sideNotificationMoreBtn",
|
|
26629
|
+
onClick: handleExpandClick
|
|
26630
|
+
}, moreLabel)))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26631
|
+
className: _getClassName("sideNotificationAnimateCollapse sideNotificationExpandedItemsWrap".concat(isExpanded ? ' sideNotificationAnimateCollapseOpen' : ''), _styleModuleImportMap$4, {
|
|
26632
|
+
"handleMissingStyleName": "warn"
|
|
26633
|
+
})
|
|
26634
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26635
|
+
className: "utilities_ops-announcements_Banner--sideNotificationAnimateCollapseInner"
|
|
26636
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26637
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedItemsList"
|
|
26638
|
+
}, visibleNotifications.map(function (notification) {
|
|
26639
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26640
|
+
key: notification.notificationId,
|
|
26641
|
+
className: "utilities_ops-announcements_Banner--sideNotificationItemCard"
|
|
26642
|
+
}, /*#__PURE__*/React__default["default"].createElement(Banner, _extends$1({}, notification, {
|
|
26329
26643
|
showSideBar: true,
|
|
26330
26644
|
isGroupedSideBar: true,
|
|
26645
|
+
sidebarExpandedSecondary: true,
|
|
26331
26646
|
onDismiss: function onDismiss() {
|
|
26332
26647
|
return _onDismiss(notification);
|
|
26333
26648
|
},
|
|
26334
26649
|
ActionComponent: ActionComponent,
|
|
26335
26650
|
saveActionComponentState: saveActionComponentState
|
|
26336
|
-
}));
|
|
26337
|
-
})
|
|
26338
|
-
|
|
26339
|
-
className: "utilities_ops-announcements_Banner--
|
|
26340
|
-
|
|
26341
|
-
}
|
|
26342
|
-
|
|
26343
|
-
|
|
26344
|
-
}), /*#__PURE__*/React__default["default"].createElement("span", null, "View all")));
|
|
26345
|
-
};
|
|
26346
|
-
|
|
26347
|
-
var ESTIMATED_ITEM_HEIGHT = 80;
|
|
26348
|
-
var ESTIMATED_GROUP_HEIGHT = 320;
|
|
26349
|
-
var OVERSCAN = 3;
|
|
26350
|
-
function buildOffsets(count, itemHeights) {
|
|
26351
|
-
var defaultHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ESTIMATED_ITEM_HEIGHT;
|
|
26352
|
-
var offsets = new Array(count + 1);
|
|
26353
|
-
offsets[0] = 0;
|
|
26354
|
-
for (var i = 0; i < count; i++) {
|
|
26355
|
-
offsets[i + 1] = offsets[i] + (itemHeights[i] || defaultHeight) + 12;
|
|
26356
|
-
}
|
|
26357
|
-
return offsets;
|
|
26358
|
-
}
|
|
26359
|
-
|
|
26360
|
-
// Binary search: find the last index whose offset is <= scrollTop
|
|
26361
|
-
function findStartIndex(offsets, scrollTop) {
|
|
26362
|
-
var lo = 0;
|
|
26363
|
-
var hi = offsets.length - 2;
|
|
26364
|
-
while (lo < hi) {
|
|
26365
|
-
var mid = lo + hi + 1 >> 1;
|
|
26366
|
-
if (offsets[mid] <= scrollTop) {
|
|
26367
|
-
lo = mid;
|
|
26368
|
-
} else {
|
|
26369
|
-
hi = mid - 1;
|
|
26370
|
-
}
|
|
26371
|
-
}
|
|
26372
|
-
return lo;
|
|
26373
|
-
}
|
|
26651
|
+
})));
|
|
26652
|
+
}), isExpanded && hasMore && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26653
|
+
ref: loadMoreRef,
|
|
26654
|
+
className: "utilities_ops-announcements_Banner--sideNotificationLoadMoreSentinel",
|
|
26655
|
+
"aria-hidden": "true"
|
|
26656
|
+
}))))));
|
|
26657
|
+
};
|
|
26658
|
+
|
|
26374
26659
|
var Notifications = function Notifications(_ref) {
|
|
26375
26660
|
var notifications = _ref.notifications,
|
|
26376
26661
|
_onDismiss = _ref.onDismiss;
|
|
@@ -26390,16 +26675,12 @@ var Notifications = function Notifications(_ref) {
|
|
|
26390
26675
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
26391
26676
|
last = _useState4[0],
|
|
26392
26677
|
setLast = _useState4[1];
|
|
26393
|
-
var _useState5 = React.useState(
|
|
26678
|
+
var _useState5 = React.useState({}),
|
|
26394
26679
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
26395
|
-
|
|
26396
|
-
|
|
26680
|
+
expandedGroups = _useState6[0],
|
|
26681
|
+
setExpandedGroups = _useState6[1];
|
|
26397
26682
|
var scrollRef = React.useRef(null);
|
|
26398
|
-
var
|
|
26399
|
-
var _useState7 = React.useState(0),
|
|
26400
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
26401
|
-
scrollTop = _useState8[0],
|
|
26402
|
-
setScrollTop = _useState8[1];
|
|
26683
|
+
var notificationIdsRef = React.useRef('');
|
|
26403
26684
|
var onLeftButtonClick = function onLeftButtonClick() {
|
|
26404
26685
|
return i === 0 ? setI(last) : setI(i - 1);
|
|
26405
26686
|
};
|
|
@@ -26407,9 +26688,7 @@ var Notifications = function Notifications(_ref) {
|
|
|
26407
26688
|
return i === last ? setI(0) : setI(i + 1);
|
|
26408
26689
|
};
|
|
26409
26690
|
var resetSidebarView = React.useCallback(function () {
|
|
26410
|
-
|
|
26411
|
-
itemHeightsRef.current = {};
|
|
26412
|
-
setScrollTop(0);
|
|
26691
|
+
setExpandedGroups({});
|
|
26413
26692
|
if (scrollRef.current) {
|
|
26414
26693
|
scrollRef.current.scrollTop = 0;
|
|
26415
26694
|
}
|
|
@@ -26419,14 +26698,24 @@ var Notifications = function Notifications(_ref) {
|
|
|
26419
26698
|
setI(notifications.length - 1);
|
|
26420
26699
|
}
|
|
26421
26700
|
setLast(notifications.length - 1);
|
|
26422
|
-
|
|
26423
|
-
|
|
26424
|
-
|
|
26425
|
-
|
|
26701
|
+
var nextIds = notifications.map(function (n) {
|
|
26702
|
+
return n.notificationId;
|
|
26703
|
+
}).join('|');
|
|
26704
|
+
var structureChanged = nextIds !== notificationIdsRef.current;
|
|
26705
|
+
notificationIdsRef.current = nextIds;
|
|
26706
|
+
if (structureChanged) {
|
|
26707
|
+
setExpandedGroups(function (prev) {
|
|
26708
|
+
var next = {};
|
|
26709
|
+
var appNames = new Set(notifications.map(function (n) {
|
|
26710
|
+
return n.sourceApplication || 'Other';
|
|
26711
|
+
}));
|
|
26712
|
+
Object.keys(prev).forEach(function (appName) {
|
|
26713
|
+
if (prev[appName] && appNames.has(appName)) {
|
|
26714
|
+
next[appName] = true;
|
|
26715
|
+
}
|
|
26716
|
+
});
|
|
26717
|
+
return next;
|
|
26426
26718
|
});
|
|
26427
|
-
if (!stillHasApp) {
|
|
26428
|
-
setExpandedAppName(null);
|
|
26429
|
-
}
|
|
26430
26719
|
}
|
|
26431
26720
|
}, [notifications]);
|
|
26432
26721
|
React.useEffect(function () {
|
|
@@ -26434,87 +26723,13 @@ var Notifications = function Notifications(_ref) {
|
|
|
26434
26723
|
resetSidebarView();
|
|
26435
26724
|
}
|
|
26436
26725
|
}, [sidebarOpen, resetSidebarView]);
|
|
26437
|
-
|
|
26438
|
-
// Virtualizer state for the sidebar list
|
|
26439
|
-
var _useState9 = React.useState(600),
|
|
26440
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
26441
|
-
viewportHeight = _useState0[0],
|
|
26442
|
-
setViewportHeight = _useState0[1];
|
|
26443
|
-
var rafPendingRef = React.useRef(false);
|
|
26444
|
-
var _useState1 = React.useState(0),
|
|
26445
|
-
_useState10 = _slicedToArray(_useState1, 2),
|
|
26446
|
-
forceUpdate = _useState10[1];
|
|
26447
|
-
React.useEffect(function () {
|
|
26448
|
-
var el = scrollRef.current;
|
|
26449
|
-
if (!el) return;
|
|
26450
|
-
var handleScroll = function handleScroll() {
|
|
26451
|
-
return setScrollTop(el.scrollTop);
|
|
26452
|
-
};
|
|
26453
|
-
var ro = new ResizeObserver(function (entries) {
|
|
26454
|
-
var _iterator = _createForOfIteratorHelper(entries),
|
|
26455
|
-
_step;
|
|
26456
|
-
try {
|
|
26457
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
26458
|
-
var entry = _step.value;
|
|
26459
|
-
setViewportHeight(entry.contentRect.height);
|
|
26460
|
-
}
|
|
26461
|
-
} catch (err) {
|
|
26462
|
-
_iterator.e(err);
|
|
26463
|
-
} finally {
|
|
26464
|
-
_iterator.f();
|
|
26465
|
-
}
|
|
26466
|
-
});
|
|
26467
|
-
el.addEventListener('scroll', handleScroll, {
|
|
26468
|
-
passive: true
|
|
26469
|
-
});
|
|
26470
|
-
ro.observe(el);
|
|
26471
|
-
return function () {
|
|
26472
|
-
el.removeEventListener('scroll', handleScroll);
|
|
26473
|
-
ro.disconnect();
|
|
26474
|
-
};
|
|
26475
|
-
}, [showSideBar]);
|
|
26476
|
-
|
|
26477
|
-
// Ref callback: measures rendered item height and triggers a rAF-batched re-render
|
|
26478
|
-
// when the measured height differs from the cached value.
|
|
26479
|
-
var measureItem = React.useCallback(function (index) {
|
|
26480
|
-
return function (node) {
|
|
26481
|
-
if (!node) return;
|
|
26482
|
-
var height = node.getBoundingClientRect().height;
|
|
26483
|
-
if (itemHeightsRef.current[index] === height) return;
|
|
26484
|
-
itemHeightsRef.current[index] = height;
|
|
26485
|
-
if (!rafPendingRef.current) {
|
|
26486
|
-
rafPendingRef.current = true;
|
|
26487
|
-
requestAnimationFrame(function () {
|
|
26488
|
-
rafPendingRef.current = false;
|
|
26489
|
-
forceUpdate(function (n) {
|
|
26490
|
-
return n + 1;
|
|
26491
|
-
});
|
|
26492
|
-
});
|
|
26493
|
-
}
|
|
26494
|
-
};
|
|
26495
|
-
}, []);
|
|
26496
26726
|
var count = notifications.length;
|
|
26497
|
-
var notificationGroups = showSideBar ?
|
|
26498
|
-
var
|
|
26499
|
-
|
|
26500
|
-
|
|
26501
|
-
|
|
26502
|
-
if (scrollRef.current) {
|
|
26503
|
-
scrollRef.current.scrollTop = 0;
|
|
26504
|
-
}
|
|
26505
|
-
};
|
|
26506
|
-
var handleBackToAllApps = function handleBackToAllApps() {
|
|
26507
|
-
resetSidebarView();
|
|
26727
|
+
var notificationGroups = showSideBar ? groupNotificationsByApp(notifications) : [];
|
|
26728
|
+
var toggleGroupExpand = function toggleGroupExpand(appName) {
|
|
26729
|
+
setExpandedGroups(function (prev) {
|
|
26730
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, _defineProperty$2({}, appName, !prev[appName]));
|
|
26731
|
+
});
|
|
26508
26732
|
};
|
|
26509
|
-
var virtualListCount = showSideBar ? notificationGroups.length : count;
|
|
26510
|
-
var estimatedHeight = showSideBar ? ESTIMATED_GROUP_HEIGHT : ESTIMATED_ITEM_HEIGHT;
|
|
26511
|
-
var offsets = buildOffsets(virtualListCount, itemHeightsRef.current, estimatedHeight);
|
|
26512
|
-
var totalHeight = offsets[virtualListCount];
|
|
26513
|
-
var rawStart = findStartIndex(offsets, scrollTop);
|
|
26514
|
-
var startIdx = Math.max(0, rawStart - OVERSCAN);
|
|
26515
|
-
var endRaw = rawStart;
|
|
26516
|
-
while (endRaw < virtualListCount && offsets[endRaw] < scrollTop + viewportHeight) endRaw++;
|
|
26517
|
-
var endIdx = Math.min(virtualListCount - 1, endRaw + OVERSCAN);
|
|
26518
26733
|
var notification = notifications[i];
|
|
26519
26734
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isNil$2(notification) && !showSideBar ? /*#__PURE__*/React__default["default"].createElement(Banner, _extends$1({
|
|
26520
26735
|
current: i + 1,
|
|
@@ -26532,7 +26747,19 @@ var Notifications = function Notifications(_ref) {
|
|
|
26532
26747
|
notificationsTopContainerRef: notificationsTopContainerRef,
|
|
26533
26748
|
mobileNotificationsTopContainerRef: mobileNotificationsTopContainerRef,
|
|
26534
26749
|
setNotificationHeightFlag: setNotificationHeightFlag
|
|
26535
|
-
})) : null,
|
|
26750
|
+
})) : null, showSideBar ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26751
|
+
style: {
|
|
26752
|
+
height: '100%'
|
|
26753
|
+
}
|
|
26754
|
+
}, count === 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26755
|
+
className: "utilities_ops-announcements_Banner--sideNotificationEmptyState"
|
|
26756
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
26757
|
+
className: "utilities_ops-announcements_Banner--sideNotificationEmptyIcon",
|
|
26758
|
+
src: "/assets/icons/no_notification_sidebar.svg",
|
|
26759
|
+
alt: ""
|
|
26760
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26761
|
+
className: "utilities_ops-announcements_Banner--sideNotificationEmptyText"
|
|
26762
|
+
}, "No pending notifications")) : null, count > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26536
26763
|
ref: scrollRef,
|
|
26537
26764
|
style: {
|
|
26538
26765
|
height: '100%',
|
|
@@ -26540,40 +26767,23 @@ var Notifications = function Notifications(_ref) {
|
|
|
26540
26767
|
overflowX: 'hidden'
|
|
26541
26768
|
}
|
|
26542
26769
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26543
|
-
|
|
26544
|
-
|
|
26545
|
-
|
|
26546
|
-
width: '100%'
|
|
26547
|
-
}
|
|
26548
|
-
}, Array.from({
|
|
26549
|
-
length: endIdx - startIdx + 1
|
|
26550
|
-
}, function (_, rel) {
|
|
26551
|
-
var index = startIdx + rel;
|
|
26552
|
-
var group = notificationGroups[index];
|
|
26553
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26770
|
+
className: "utilities_ops-announcements_Banner--sideNotificationSidebarList"
|
|
26771
|
+
}, notificationGroups.map(function (group) {
|
|
26772
|
+
return /*#__PURE__*/React__default["default"].createElement(SideNotificationGroup, {
|
|
26554
26773
|
key: group.appName,
|
|
26555
|
-
ref: measureItem(index),
|
|
26556
|
-
style: {
|
|
26557
|
-
position: 'absolute',
|
|
26558
|
-
top: offsets[index],
|
|
26559
|
-
left: 0,
|
|
26560
|
-
width: '100%'
|
|
26561
|
-
}
|
|
26562
|
-
}, /*#__PURE__*/React__default["default"].createElement(SideNotificationGroup, {
|
|
26563
26774
|
appName: group.appName,
|
|
26564
26775
|
totalCount: group.totalCount,
|
|
26565
26776
|
notifications: group.notifications,
|
|
26566
|
-
|
|
26567
|
-
|
|
26568
|
-
|
|
26569
|
-
onViewAll: function onViewAll() {
|
|
26570
|
-
return handleViewAll(group.appName);
|
|
26777
|
+
isExpanded: Boolean(expandedGroups[group.appName]),
|
|
26778
|
+
onToggleExpand: function onToggleExpand() {
|
|
26779
|
+
return toggleGroupExpand(group.appName);
|
|
26571
26780
|
},
|
|
26572
26781
|
onDismiss: _onDismiss,
|
|
26782
|
+
scrollContainerRef: scrollRef,
|
|
26573
26783
|
ActionComponent: ActionComponent,
|
|
26574
26784
|
saveActionComponentState: saveActionComponentState
|
|
26575
|
-
})
|
|
26576
|
-
}))) : null);
|
|
26785
|
+
});
|
|
26786
|
+
}))) : null) : null);
|
|
26577
26787
|
};
|
|
26578
26788
|
|
|
26579
26789
|
var capitalizeAndReplaceUnderscores = function capitalizeAndReplaceUnderscores(role) {
|
|
@@ -26642,6 +26852,7 @@ var _styleModuleImportMap$3 = {
|
|
|
26642
26852
|
"sideBarWrapper": "utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper",
|
|
26643
26853
|
"innerNotificationDiv": "utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv",
|
|
26644
26854
|
"notificationsHeader": "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeader",
|
|
26855
|
+
"notificationsHeaderCount": "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeaderCount",
|
|
26645
26856
|
"notificationsWrapper": "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsWrapper",
|
|
26646
26857
|
"notificationCount": "utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount",
|
|
26647
26858
|
"twoChars": "utilities_ops-app-frame_AppBarComponent_AppBar--twoChars",
|
|
@@ -27125,7 +27336,7 @@ var notificationIconComp = function notificationIconComp(_ref3) {
|
|
|
27125
27336
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items",
|
|
27126
27337
|
style: _objectSpread2({}, marginStyle),
|
|
27127
27338
|
onClick: function onClick() {
|
|
27128
|
-
return
|
|
27339
|
+
return handleIconClick(ICONS.NOTIFICATIONS);
|
|
27129
27340
|
}
|
|
27130
27341
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
27131
27342
|
name: "bell",
|
|
@@ -27138,7 +27349,7 @@ var notificationIconComp = function notificationIconComp(_ref3) {
|
|
|
27138
27349
|
style: {
|
|
27139
27350
|
fontSize: '10px'
|
|
27140
27351
|
}
|
|
27141
|
-
}, notifications.length)),
|
|
27352
|
+
}, notifications.length)), notificationsVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27142
27353
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer"
|
|
27143
27354
|
}));
|
|
27144
27355
|
};
|
|
@@ -27207,6 +27418,8 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27207
27418
|
props.title;
|
|
27208
27419
|
var getInnovationHubToken = props.getInnovationHubToken,
|
|
27209
27420
|
notifications = props.notifications,
|
|
27421
|
+
_props$bannerNotifica = props.bannerNotifications,
|
|
27422
|
+
bannerNotifications = _props$bannerNotifica === void 0 ? [] : _props$bannerNotifica,
|
|
27210
27423
|
onDismiss = props.onDismiss,
|
|
27211
27424
|
ActionComponent = props.ActionComponent,
|
|
27212
27425
|
saveActionComponentState = props.saveActionComponentState,
|
|
@@ -27223,6 +27436,7 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27223
27436
|
availableStatuses = props.availableStatuses,
|
|
27224
27437
|
currentUserStatus = props.currentUserStatus,
|
|
27225
27438
|
onUserStatusUpdate = props.onUserStatusUpdate;
|
|
27439
|
+
var hasBannerNotifications = bannerNotifications.length > 0;
|
|
27226
27440
|
var _useWindowSize = useWindowSize(),
|
|
27227
27441
|
width = _useWindowSize.width;
|
|
27228
27442
|
_useWindowSize.height;
|
|
@@ -27497,7 +27711,9 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27497
27711
|
color: '#FFF',
|
|
27498
27712
|
fontSize: '16px'
|
|
27499
27713
|
}
|
|
27500
|
-
})), /*#__PURE__*/React__default["default"].createElement(CopartLogo,
|
|
27714
|
+
})), /*#__PURE__*/React__default["default"].createElement(CopartLogo, {
|
|
27715
|
+
history: props.history
|
|
27716
|
+
}), !enableNewToolkitFeatures && !isAuthRoute ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27501
27717
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--moduleName"
|
|
27502
27718
|
}, moduleName) : null), /*#__PURE__*/React__default["default"].createElement(Breadcrumbs, {
|
|
27503
27719
|
history: props.history,
|
|
@@ -27541,7 +27757,7 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27541
27757
|
})), ideaNoteVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27542
27758
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer",
|
|
27543
27759
|
style: {
|
|
27544
|
-
top:
|
|
27760
|
+
top: hasBannerNotifications ? "".concat(sideBarTopValue, "px") : '48px'
|
|
27545
27761
|
}
|
|
27546
27762
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27547
27763
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide",
|
|
@@ -27585,21 +27801,23 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27585
27801
|
feedbackConfig: props.feedbackConfig,
|
|
27586
27802
|
showMihelpDot: showMihelpDot,
|
|
27587
27803
|
sideBarTopValue: sideBarTopValue,
|
|
27588
|
-
|
|
27804
|
+
bannerNotifications: bannerNotifications
|
|
27589
27805
|
}), notificationsVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27590
27806
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper",
|
|
27591
27807
|
style: {
|
|
27592
|
-
top:
|
|
27808
|
+
top: hasBannerNotifications ? "".concat(sideBarTopValue, "px") : '48px'
|
|
27593
27809
|
},
|
|
27594
27810
|
onClick: closeSidebar
|
|
27595
27811
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27596
|
-
className: "utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv",
|
|
27812
|
+
className: "g2-notifications-sidebar-v2 utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv",
|
|
27597
27813
|
style: {
|
|
27598
|
-
height: "calc(100dvh - ".concat(
|
|
27814
|
+
height: "calc(100dvh - ".concat(hasBannerNotifications ? sideBarTopValue : 48, "px)")
|
|
27599
27815
|
}
|
|
27600
27816
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27601
27817
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeader"
|
|
27602
|
-
}, /*#__PURE__*/React__default["default"].createElement("span", null, "Notifications")
|
|
27818
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", null, "Notifications"), (notifications === null || notifications === void 0 ? void 0 : notifications.length) > 0 && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
27819
|
+
className: "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeaderCount"
|
|
27820
|
+
}, " (", notifications.length, ")")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27603
27821
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsWrapper"
|
|
27604
27822
|
}, /*#__PURE__*/React__default["default"].createElement(Notifications, {
|
|
27605
27823
|
notifications: notifications || [],
|
|
@@ -27617,13 +27835,13 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27617
27835
|
})), settingsVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27618
27836
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper",
|
|
27619
27837
|
style: {
|
|
27620
|
-
top:
|
|
27838
|
+
top: hasBannerNotifications ? "".concat(sideBarTopValue, "px") : '48px'
|
|
27621
27839
|
},
|
|
27622
27840
|
onClick: closeSidebar
|
|
27623
27841
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27624
27842
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar",
|
|
27625
27843
|
style: {
|
|
27626
|
-
height: "calc(100dvh - ".concat(
|
|
27844
|
+
height: "calc(100dvh - ".concat(hasBannerNotifications ? sideBarTopValue : 48, "px)")
|
|
27627
27845
|
}
|
|
27628
27846
|
}, !stack || stack === 'c' ? /*#__PURE__*/React__default["default"].createElement(SettingsView$2, {
|
|
27629
27847
|
onSave: onSave,
|
|
@@ -27650,7 +27868,7 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27650
27868
|
closeSidebar: closeSidebar,
|
|
27651
27869
|
logout: onLogoutItemClicked,
|
|
27652
27870
|
items: mobileMenuItems,
|
|
27653
|
-
|
|
27871
|
+
bannerNotifications: bannerNotifications,
|
|
27654
27872
|
sideBarTopValue: sideBarTopValue,
|
|
27655
27873
|
availableStatuses: availableStatuses,
|
|
27656
27874
|
currentUserStatus: currentUserStatus,
|
|
@@ -29490,6 +29708,7 @@ function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
|
|
|
29490
29708
|
notification.dismissibleFlag = notification.dismissal_flag;
|
|
29491
29709
|
notification.feedUrl = notification.feed_url;
|
|
29492
29710
|
notification.notificationId = notification.notification_id;
|
|
29711
|
+
notification.displayLocation = notification.display_location;
|
|
29493
29712
|
notification.sourceApplication = notification.source_application;
|
|
29494
29713
|
notification.sourcePlatform = notification.source_platform;
|
|
29495
29714
|
notification.timeZoneType = notification.timezone_type;
|
|
@@ -29514,9 +29733,6 @@ function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
|
|
|
29514
29733
|
});
|
|
29515
29734
|
compose(updateNotifications, filterNotifications)(modifiedNotifications);
|
|
29516
29735
|
updateAllNotificationsList(modifiedNotifications, true);
|
|
29517
|
-
// Prune expired entries from viewedNotifications after the main logic
|
|
29518
|
-
// settles. Deferred so it never blocks the notifications render.
|
|
29519
|
-
setTimeout(pruneExpiredViewedNotifications, 0);
|
|
29520
29736
|
}).catch(function (e) {
|
|
29521
29737
|
console.log(e);
|
|
29522
29738
|
});
|
|
@@ -30979,48 +31195,67 @@ var AppBar = function AppBar(_ref) {
|
|
|
30979
31195
|
}
|
|
30980
31196
|
if (history.location.pathname !== '/logout' && history.location.pathname !== '/login' && localStorage.getItem('login') && tileConfigAccess) {
|
|
30981
31197
|
if (notificationsSource.includes('Nchan')) {
|
|
30982
|
-
|
|
30983
|
-
|
|
30984
|
-
|
|
30985
|
-
|
|
30986
|
-
|
|
30987
|
-
|
|
30988
|
-
|
|
30989
|
-
|
|
30990
|
-
|
|
30991
|
-
|
|
30992
|
-
|
|
30993
|
-
|
|
30994
|
-
|
|
30995
|
-
|
|
30996
|
-
|
|
30997
|
-
|
|
30998
|
-
|
|
30999
|
-
|
|
31000
|
-
|
|
31198
|
+
var startNchanNotifications = /*#__PURE__*/function () {
|
|
31199
|
+
var _ref6 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
31200
|
+
var client, pingIntervalInSec;
|
|
31201
|
+
return _regenerator().w(function (_context5) {
|
|
31202
|
+
while (1) switch (_context5.n) {
|
|
31203
|
+
case 0:
|
|
31204
|
+
_context5.n = 1;
|
|
31205
|
+
return initViewedNotifications();
|
|
31206
|
+
case 1:
|
|
31207
|
+
fetchG2Notifications(updateNotifications, updateAllNotificationsList);
|
|
31208
|
+
client = startWebSocketConnection(updateNotifications, updateAllNotificationsList, _reConnectSocket, updateUserStatusFromWebSocket, {
|
|
31209
|
+
onOpen: function onOpen() {
|
|
31210
|
+
reconnectingRef.current = false;
|
|
31211
|
+
},
|
|
31212
|
+
onClose: function onClose() {
|
|
31213
|
+
reconnectingRef.current = false;
|
|
31214
|
+
}
|
|
31215
|
+
});
|
|
31216
|
+
if (client) {
|
|
31217
|
+
socketClientRef.current = client;
|
|
31218
|
+
pingIntervalInSec = coreAppConfig.nchanPingIntervalInSec || 30;
|
|
31219
|
+
setPingInterval(setInterval(function () {
|
|
31220
|
+
if (client.readyState === WebSocket.OPEN) {
|
|
31221
|
+
client.send('_ping_');
|
|
31222
|
+
}
|
|
31223
|
+
}, pingIntervalInSec * 1000));
|
|
31224
|
+
setSocketClient(client);
|
|
31225
|
+
}
|
|
31226
|
+
case 2:
|
|
31227
|
+
return _context5.a(2);
|
|
31228
|
+
}
|
|
31229
|
+
}, _callee5);
|
|
31230
|
+
}));
|
|
31231
|
+
return function startNchanNotifications() {
|
|
31232
|
+
return _ref6.apply(this, arguments);
|
|
31233
|
+
};
|
|
31234
|
+
}();
|
|
31235
|
+
startNchanNotifications();
|
|
31001
31236
|
}
|
|
31002
31237
|
var loadUserStatus = /*#__PURE__*/function () {
|
|
31003
|
-
var
|
|
31238
|
+
var _ref7 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
31004
31239
|
var _userStatus$toLowerCa, statuses, userStatus, statusList, statusListLower, isSystemAssignedStatus, isValidStatus, finalStatus, offlineIndex, updatedStatus, _t6, _t7;
|
|
31005
|
-
return _regenerator().w(function (
|
|
31006
|
-
while (1) switch (
|
|
31240
|
+
return _regenerator().w(function (_context6) {
|
|
31241
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
31007
31242
|
case 0:
|
|
31008
|
-
|
|
31009
|
-
|
|
31243
|
+
_context6.p = 0;
|
|
31244
|
+
_context6.n = 1;
|
|
31010
31245
|
return fetchAvailableStatuses();
|
|
31011
31246
|
case 1:
|
|
31012
|
-
statuses =
|
|
31247
|
+
statuses = _context6.v;
|
|
31013
31248
|
setAvailableStatuses(statuses);
|
|
31014
|
-
|
|
31249
|
+
_context6.n = 2;
|
|
31015
31250
|
return fetchUserStatus();
|
|
31016
31251
|
case 2:
|
|
31017
|
-
userStatus =
|
|
31252
|
+
userStatus = _context6.v;
|
|
31018
31253
|
if (!(userStatus === null)) {
|
|
31019
|
-
|
|
31254
|
+
_context6.n = 3;
|
|
31020
31255
|
break;
|
|
31021
31256
|
}
|
|
31022
31257
|
setAvailableStatuses([]);
|
|
31023
|
-
return
|
|
31258
|
+
return _context6.a(2);
|
|
31024
31259
|
case 3:
|
|
31025
31260
|
statusList = statuses.map(function (s) {
|
|
31026
31261
|
return s.status;
|
|
@@ -31032,7 +31267,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
31032
31267
|
isValidStatus = userStatus && (statusListLower.includes(userStatus.toLowerCase()) || isSystemAssignedStatus);
|
|
31033
31268
|
finalStatus = userStatus;
|
|
31034
31269
|
if (isValidStatus) {
|
|
31035
|
-
|
|
31270
|
+
_context6.n = 8;
|
|
31036
31271
|
break;
|
|
31037
31272
|
}
|
|
31038
31273
|
offlineIndex = statusListLower.indexOf('offline');
|
|
@@ -31042,37 +31277,37 @@ var AppBar = function AppBar(_ref) {
|
|
|
31042
31277
|
finalStatus = statuses[0].status;
|
|
31043
31278
|
}
|
|
31044
31279
|
if (!finalStatus) {
|
|
31045
|
-
|
|
31280
|
+
_context6.n = 7;
|
|
31046
31281
|
break;
|
|
31047
31282
|
}
|
|
31048
31283
|
setCurrentUserStatus(finalStatus);
|
|
31049
31284
|
storage$2.setLocalItem('dashboard', finalStatus, 'userAvailability');
|
|
31050
|
-
|
|
31051
|
-
|
|
31285
|
+
_context6.p = 4;
|
|
31286
|
+
_context6.n = 5;
|
|
31052
31287
|
return updateUserStatus(finalStatus);
|
|
31053
31288
|
case 5:
|
|
31054
|
-
updatedStatus =
|
|
31289
|
+
updatedStatus = _context6.v;
|
|
31055
31290
|
setCurrentUserStatus(updatedStatus);
|
|
31056
31291
|
storage$2.setLocalItem('dashboard', updatedStatus, 'userAvailability');
|
|
31057
|
-
|
|
31292
|
+
_context6.n = 7;
|
|
31058
31293
|
break;
|
|
31059
31294
|
case 6:
|
|
31060
|
-
|
|
31061
|
-
_t6 =
|
|
31295
|
+
_context6.p = 6;
|
|
31296
|
+
_t6 = _context6.v;
|
|
31062
31297
|
console.error('Failed to update defaulted user status:', _t6);
|
|
31063
31298
|
showError('Failed to set default user status.');
|
|
31064
31299
|
case 7:
|
|
31065
|
-
|
|
31300
|
+
_context6.n = 9;
|
|
31066
31301
|
break;
|
|
31067
31302
|
case 8:
|
|
31068
31303
|
setCurrentUserStatus(finalStatus);
|
|
31069
31304
|
storage$2.setLocalItem('dashboard', finalStatus, 'userAvailability');
|
|
31070
31305
|
case 9:
|
|
31071
|
-
|
|
31306
|
+
_context6.n = 11;
|
|
31072
31307
|
break;
|
|
31073
31308
|
case 10:
|
|
31074
|
-
|
|
31075
|
-
_t7 =
|
|
31309
|
+
_context6.p = 10;
|
|
31310
|
+
_t7 = _context6.v;
|
|
31076
31311
|
console.error('Failed to load user status:', _t7);
|
|
31077
31312
|
// if (error.message && error.message.includes('available statuses')) {
|
|
31078
31313
|
// showError('Failed to fetch available statuses.')
|
|
@@ -31080,12 +31315,12 @@ var AppBar = function AppBar(_ref) {
|
|
|
31080
31315
|
// showError('Failed to fetch user status.')
|
|
31081
31316
|
// }
|
|
31082
31317
|
case 11:
|
|
31083
|
-
return
|
|
31318
|
+
return _context6.a(2);
|
|
31084
31319
|
}
|
|
31085
|
-
},
|
|
31320
|
+
}, _callee6, null, [[4, 6], [0, 10]]);
|
|
31086
31321
|
}));
|
|
31087
31322
|
return function loadUserStatus() {
|
|
31088
|
-
return
|
|
31323
|
+
return _ref7.apply(this, arguments);
|
|
31089
31324
|
};
|
|
31090
31325
|
}();
|
|
31091
31326
|
if (!isUserStatusHidden()) {
|
|
@@ -31180,8 +31415,10 @@ var AppBar = function AppBar(_ref) {
|
|
|
31180
31415
|
phoneStatus: '',
|
|
31181
31416
|
phoneStatusProcessing: false
|
|
31182
31417
|
} : _storage$chromePlugin;
|
|
31418
|
+
var bannerNotifications = filterBannerNotifications(notifications);
|
|
31419
|
+
var sidebarNotifications = filterSidebarNotifications(notifications);
|
|
31183
31420
|
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(Notifications, {
|
|
31184
|
-
notifications:
|
|
31421
|
+
notifications: bannerNotifications,
|
|
31185
31422
|
onDismiss: dismissNotification,
|
|
31186
31423
|
ActionComponent: ActionComponent,
|
|
31187
31424
|
saveActionComponentState: saveActionComponentState,
|
|
@@ -31218,7 +31455,8 @@ var AppBar = function AppBar(_ref) {
|
|
|
31218
31455
|
showTitle: showTitle,
|
|
31219
31456
|
title: title,
|
|
31220
31457
|
history: history,
|
|
31221
|
-
notifications:
|
|
31458
|
+
notifications: sidebarNotifications,
|
|
31459
|
+
bannerNotifications: bannerNotifications,
|
|
31222
31460
|
onDismiss: dismissNotification,
|
|
31223
31461
|
ActionComponent: ActionComponent,
|
|
31224
31462
|
saveActionComponentState: saveActionComponentState,
|
|
@@ -65194,7 +65432,7 @@ AppFrame.defaultProps = {
|
|
|
65194
65432
|
navItems: []
|
|
65195
65433
|
};
|
|
65196
65434
|
|
|
65197
|
-
var _excluded$
|
|
65435
|
+
var _excluded$2 = ["fromPhone", "toPhone", "appCode", "entityType", "lotAttributes"];
|
|
65198
65436
|
var logOutboundCalls = /*#__PURE__*/function () {
|
|
65199
65437
|
var _ref = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(data) {
|
|
65200
65438
|
var _storage$getLocalItem;
|
|
@@ -65230,7 +65468,7 @@ var CallLogger = React__default["default"].memo(function (_ref2) {
|
|
|
65230
65468
|
entityType = _ref2$entityType === void 0 ? '' : _ref2$entityType,
|
|
65231
65469
|
_ref2$lotAttributes = _ref2.lotAttributes,
|
|
65232
65470
|
lotAttributes = _ref2$lotAttributes === void 0 ? {} : _ref2$lotAttributes,
|
|
65233
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
65471
|
+
props = _objectWithoutProperties(_ref2, _excluded$2);
|
|
65234
65472
|
var _useState = React.useState({
|
|
65235
65473
|
error: null,
|
|
65236
65474
|
success: null
|
|
@@ -68656,32 +68894,96 @@ function ContextualHelp(_ref) {
|
|
|
68656
68894
|
}
|
|
68657
68895
|
|
|
68658
68896
|
var IFRAME_EVENTS = {
|
|
68897
|
+
// app → shell
|
|
68659
68898
|
UPDATE_URI: 'UPDATE_URI',
|
|
68660
68899
|
UPDATE_CRUMBS: 'UPDATE_CRUMBS',
|
|
68661
|
-
SET_NAV_CONFIG: 'SET_NAV_CONFIG',
|
|
68662
68900
|
COUNTS_AVAILABLE: 'COUNTS_AVAILABLE',
|
|
68663
68901
|
UPDATE_NAV_COUNTS: 'UPDATE_NAV_COUNTS',
|
|
68664
|
-
REQUEST_NAV_COUNTS: 'REQUEST_NAV_COUNTS',
|
|
68665
68902
|
NAV_COUNTS_RESPONSE: 'NAV_COUNTS_RESPONSE',
|
|
68903
|
+
SET_NAV_CONFIG: 'SET_NAV_CONFIG',
|
|
68904
|
+
FETCH_REQUEST: 'FETCH_REQUEST',
|
|
68905
|
+
CANCEL_REQUEST: 'CANCEL_REQUEST',
|
|
68906
|
+
STORAGE_GET: 'STORAGE_GET',
|
|
68907
|
+
STORAGE_SET: 'STORAGE_SET',
|
|
68908
|
+
ACCESS_CHECK: 'ACCESS_CHECK',
|
|
68909
|
+
GET_INIT_DATA: 'GET_INIT_DATA',
|
|
68910
|
+
GET_IFRAME_DATA: 'GET_IFRAME_DATA',
|
|
68666
68911
|
SET_APP_ENV: 'SET_APP_ENV',
|
|
68912
|
+
HISTORY_GO: 'HISTORY_GO',
|
|
68913
|
+
SESSION_EXPIRED: 'SESSION_EXPIRED',
|
|
68914
|
+
// shell → app
|
|
68915
|
+
LOAD_URI: 'LOAD_URI',
|
|
68916
|
+
FETCH_RESPONSE: 'FETCH_RESPONSE',
|
|
68917
|
+
STORAGE_RESPONSE: 'STORAGE_RESPONSE',
|
|
68918
|
+
ACCESS_RESPONSE: 'ACCESS_RESPONSE',
|
|
68919
|
+
INIT_DATA: 'INIT_DATA',
|
|
68920
|
+
IFRAME_DATA: 'IFRAME_DATA',
|
|
68667
68921
|
STORAGE_CHANGED: 'STORAGE_CHANGED',
|
|
68668
|
-
|
|
68922
|
+
REQUEST_NAV_COUNTS: 'REQUEST_NAV_COUNTS',
|
|
68923
|
+
CRUMB_CLICKED: 'CRUMB_CLICKED'
|
|
68669
68924
|
};
|
|
68925
|
+
var ALLOWED_ORIGINS = ['.copart.com', '.copart.co.uk', '.copart.ca', '.copartmea.com', '.copart.ie'];
|
|
68926
|
+
function isAllowedOrigin(origin) {
|
|
68927
|
+
try {
|
|
68928
|
+
var hostname = new URL(origin).hostname;
|
|
68929
|
+
return ALLOWED_ORIGINS.some(function (domain) {
|
|
68930
|
+
return hostname === domain.slice(1) || hostname.endsWith(domain);
|
|
68931
|
+
});
|
|
68932
|
+
} catch (_) {
|
|
68933
|
+
return false;
|
|
68934
|
+
}
|
|
68935
|
+
}
|
|
68670
68936
|
|
|
68671
|
-
var _excluded = ["signal"];
|
|
68937
|
+
var _excluded$1 = ["signal"];
|
|
68672
68938
|
var pending = new Map();
|
|
68673
68939
|
var STORAGE_REQUEST_TIMEOUT_MS = 5000;
|
|
68674
68940
|
function requestId() {
|
|
68675
|
-
return
|
|
68941
|
+
return crypto.randomUUID();
|
|
68942
|
+
}
|
|
68943
|
+
|
|
68944
|
+
// The exact origin of the shell that framed us. Learned from the first inbound
|
|
68945
|
+
// message that passes validation (origin is copart + came from window.parent),
|
|
68946
|
+
// then pinned. Used as the targetOrigin for every outbound post() so app→shell
|
|
68947
|
+
// messages (incl. FETCH_REQUEST bodies) are never broadcast to '*'.
|
|
68948
|
+
//
|
|
68949
|
+
// If SHELL_ORIGIN is provided at build time we lock to it up front — there is
|
|
68950
|
+
// only one shell, so this is the tightest option and closes the "any
|
|
68951
|
+
// *.copart.com subdomain" residual entirely. Otherwise we capture-and-lock.
|
|
68952
|
+
var trustedParentOrigin = typeof process !== 'undefined' && process.env && process.env.SHELL_ORIGIN || null;
|
|
68953
|
+
|
|
68954
|
+
/**
|
|
68955
|
+
* Gate every inbound message. event.origin is set by the browser and cannot be
|
|
68956
|
+
* forged by the sender, so a non-copart parent (e.g. a malicious embedder) is
|
|
68957
|
+
* rejected here before it can lock the origin or be processed.
|
|
68958
|
+
* - must come from our direct parent window (single framer),
|
|
68959
|
+
* - must be a copart origin (or the pinned SHELL_ORIGIN if configured),
|
|
68960
|
+
* - once an origin is pinned, only that exact origin is accepted thereafter.
|
|
68961
|
+
*/
|
|
68962
|
+
function isTrustedMessage(event) {
|
|
68963
|
+
if (typeof window !== 'undefined' && event.source !== window.parent) return false;
|
|
68964
|
+
if (trustedParentOrigin) {
|
|
68965
|
+
// Already pinned (via SHELL_ORIGIN or a prior capture): exact match only.
|
|
68966
|
+
return event.origin === trustedParentOrigin;
|
|
68967
|
+
}
|
|
68968
|
+
if (!isAllowedOrigin(event.origin)) return false;
|
|
68969
|
+
// First valid message from a copart parent — pin it.
|
|
68970
|
+
trustedParentOrigin = event.origin;
|
|
68971
|
+
return true;
|
|
68676
68972
|
}
|
|
68677
68973
|
function post(eventType, eventProps) {
|
|
68678
68974
|
if (typeof window === 'undefined' || !window.parent) return;
|
|
68975
|
+
// Never fall back to '*': if we have not yet learned the shell origin, use the
|
|
68976
|
+
// '/' sentinel ("deliver only if same-origin as us") so nothing leaks to a
|
|
68977
|
+
// malicious framer. In practice an inbound message pins the origin before the
|
|
68978
|
+
// app sends anything.
|
|
68979
|
+
var targetOrigin = trustedParentOrigin || '/';
|
|
68679
68980
|
window.parent.postMessage({
|
|
68680
68981
|
eventType: eventType,
|
|
68681
68982
|
eventProps: eventProps || {}
|
|
68682
|
-
},
|
|
68983
|
+
}, targetOrigin);
|
|
68683
68984
|
}
|
|
68684
68985
|
function handleMessage(event) {
|
|
68986
|
+
if (!isTrustedMessage(event)) return;
|
|
68685
68987
|
var data = event.data;
|
|
68686
68988
|
if (!data || !data.eventType) return;
|
|
68687
68989
|
var _data$eventProps = data.eventProps,
|
|
@@ -68694,7 +68996,7 @@ function handleMessage(event) {
|
|
|
68694
68996
|
pendingResponseType = _pending$get.responseType;
|
|
68695
68997
|
pending.delete(id);
|
|
68696
68998
|
switch (data.eventType) {
|
|
68697
|
-
case
|
|
68999
|
+
case IFRAME_EVENTS.FETCH_RESPONSE:
|
|
68698
69000
|
if ('error' in eventProps) {
|
|
68699
69001
|
var _eventProps$error, _eventProps$error2, _eventProps$error3, _eventProps$error4, _eventProps$error5;
|
|
68700
69002
|
var err = new Error(((_eventProps$error = eventProps.error) === null || _eventProps$error === void 0 ? void 0 : _eventProps$error.message) || 'Fetch failed');
|
|
@@ -68708,12 +69010,7 @@ function handleMessage(event) {
|
|
|
68708
69010
|
var _eventProps$result;
|
|
68709
69011
|
var resultData = (_eventProps$result = eventProps.result) === null || _eventProps$result === void 0 ? void 0 : _eventProps$result.data;
|
|
68710
69012
|
if (pendingResponseType === 'arraybuffer') {
|
|
68711
|
-
if (resultData instanceof ArrayBuffer) {
|
|
68712
|
-
console.log('[iframe-bridge/transport] FETCH_RESPONSE binary OK', {
|
|
68713
|
-
requestId: id,
|
|
68714
|
-
byteLength: resultData.byteLength
|
|
68715
|
-
});
|
|
68716
|
-
} else {
|
|
69013
|
+
if (resultData instanceof ArrayBuffer) ; else {
|
|
68717
69014
|
// Shell returned non-binary for a request that expected arraybuffer.
|
|
68718
69015
|
// This means Step 2 (shell) has not been deployed yet, or the shell
|
|
68719
69016
|
// is not forwarding responseType to its own axios call.
|
|
@@ -68727,13 +69024,13 @@ function handleMessage(event) {
|
|
|
68727
69024
|
resolve(eventProps.result);
|
|
68728
69025
|
}
|
|
68729
69026
|
break;
|
|
68730
|
-
case
|
|
69027
|
+
case IFRAME_EVENTS.STORAGE_RESPONSE:
|
|
68731
69028
|
resolve(eventProps.result);
|
|
68732
69029
|
break;
|
|
68733
|
-
case
|
|
69030
|
+
case IFRAME_EVENTS.ACCESS_RESPONSE:
|
|
68734
69031
|
resolve(eventProps.result);
|
|
68735
69032
|
break;
|
|
68736
|
-
case
|
|
69033
|
+
case IFRAME_EVENTS.INIT_DATA:
|
|
68737
69034
|
resolve(eventProps.result);
|
|
68738
69035
|
break;
|
|
68739
69036
|
}
|
|
@@ -68743,13 +69040,10 @@ if (typeof window !== 'undefined') {
|
|
|
68743
69040
|
}
|
|
68744
69041
|
function sendFetchRequest(payload) {
|
|
68745
69042
|
var signal = payload.signal,
|
|
68746
|
-
restPayload = _objectWithoutProperties(payload, _excluded);
|
|
69043
|
+
restPayload = _objectWithoutProperties(payload, _excluded$1);
|
|
68747
69044
|
return new Promise(function (resolve, reject) {
|
|
68748
69045
|
// Reject immediately if the signal is already aborted before we even send
|
|
68749
69046
|
if (signal !== null && signal !== void 0 && signal.aborted) {
|
|
68750
|
-
console.log('[iframe-bridge/transport] FETCH_REQUEST aborted before send', {
|
|
68751
|
-
url: payload.url
|
|
68752
|
-
});
|
|
68753
69047
|
reject(new DOMException('Request aborted', 'AbortError'));
|
|
68754
69048
|
return;
|
|
68755
69049
|
}
|
|
@@ -68760,27 +69054,14 @@ function sendFetchRequest(payload) {
|
|
|
68760
69054
|
reject: reject,
|
|
68761
69055
|
responseType: payload.responseType
|
|
68762
69056
|
});
|
|
68763
|
-
if (payload.responseType || payload.timeout != null || payload.withCredentials != null) {
|
|
68764
|
-
console.log('[iframe-bridge/transport] sending FETCH_REQUEST with extended options', {
|
|
68765
|
-
requestId: id,
|
|
68766
|
-
url: payload.url,
|
|
68767
|
-
responseType: payload.responseType,
|
|
68768
|
-
timeout: payload.timeout,
|
|
68769
|
-
withCredentials: payload.withCredentials
|
|
68770
|
-
});
|
|
68771
|
-
}
|
|
68772
69057
|
|
|
68773
69058
|
// signal cannot be transferred through postMessage — handle abort locally
|
|
68774
69059
|
if (signal) {
|
|
68775
69060
|
var onAbort = function onAbort() {
|
|
68776
69061
|
if (pending.has(id)) {
|
|
68777
69062
|
pending.delete(id);
|
|
68778
|
-
console.log('[iframe-bridge/transport] FETCH_REQUEST aborted mid-flight', {
|
|
68779
|
-
requestId: id,
|
|
68780
|
-
url: payload.url
|
|
68781
|
-
});
|
|
68782
69063
|
// Notify the shell so it can cancel its own request if wired up
|
|
68783
|
-
post(
|
|
69064
|
+
post(IFRAME_EVENTS.CANCEL_REQUEST, {
|
|
68784
69065
|
requestId: id
|
|
68785
69066
|
});
|
|
68786
69067
|
reject(new DOMException('Request aborted', 'AbortError'));
|
|
@@ -68792,7 +69073,7 @@ function sendFetchRequest(payload) {
|
|
|
68792
69073
|
}
|
|
68793
69074
|
|
|
68794
69075
|
// signal is intentionally excluded from the message — it's a non-serialisable DOM object
|
|
68795
|
-
post(
|
|
69076
|
+
post(IFRAME_EVENTS.FETCH_REQUEST, _objectSpread2(_objectSpread2({}, restPayload), {}, {
|
|
68796
69077
|
requestId: id
|
|
68797
69078
|
}));
|
|
68798
69079
|
});
|
|
@@ -68822,7 +69103,7 @@ function sendStorageGet(payload) {
|
|
|
68822
69103
|
_resolve(undefined);
|
|
68823
69104
|
}
|
|
68824
69105
|
});
|
|
68825
|
-
post(
|
|
69106
|
+
post(IFRAME_EVENTS.STORAGE_GET, _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
68826
69107
|
requestId: id
|
|
68827
69108
|
}));
|
|
68828
69109
|
});
|
|
@@ -68852,35 +69133,44 @@ function sendStorageSet(payload) {
|
|
|
68852
69133
|
_resolve2(undefined);
|
|
68853
69134
|
}
|
|
68854
69135
|
});
|
|
68855
|
-
post(
|
|
69136
|
+
post(IFRAME_EVENTS.STORAGE_SET, _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
68856
69137
|
requestId: id
|
|
68857
69138
|
}));
|
|
68858
69139
|
});
|
|
68859
69140
|
}
|
|
68860
69141
|
function getInitData() {
|
|
68861
|
-
return new Promise(function (
|
|
69142
|
+
return new Promise(function (_resolve4) {
|
|
68862
69143
|
var id = requestId();
|
|
68863
69144
|
var timer = setTimeout(function () {
|
|
68864
69145
|
if (pending.has(id)) {
|
|
68865
69146
|
pending.delete(id);
|
|
68866
|
-
|
|
69147
|
+
_resolve4(null);
|
|
68867
69148
|
}
|
|
68868
69149
|
}, 5000);
|
|
68869
69150
|
pending.set(id, {
|
|
68870
69151
|
resolve: function resolve(result) {
|
|
68871
69152
|
clearTimeout(timer);
|
|
68872
|
-
|
|
69153
|
+
_resolve4(result);
|
|
68873
69154
|
},
|
|
68874
69155
|
reject: function reject() {
|
|
68875
69156
|
clearTimeout(timer);
|
|
68876
|
-
|
|
69157
|
+
_resolve4(null);
|
|
68877
69158
|
}
|
|
68878
69159
|
});
|
|
68879
|
-
post(
|
|
69160
|
+
post(IFRAME_EVENTS.GET_INIT_DATA, {
|
|
68880
69161
|
requestId: id
|
|
68881
69162
|
});
|
|
68882
69163
|
});
|
|
68883
69164
|
}
|
|
69165
|
+
|
|
69166
|
+
/**
|
|
69167
|
+
* The shell origin we are pinned to (learned from the handshake or SHELL_ORIGIN).
|
|
69168
|
+
* Null until the first valid inbound message arrives. Used to build absolute
|
|
69169
|
+
* shell URLs (e.g. AppLink opening a shell route in a new tab).
|
|
69170
|
+
*/
|
|
69171
|
+
function getShellOrigin() {
|
|
69172
|
+
return trustedParentOrigin;
|
|
69173
|
+
}
|
|
68884
69174
|
function postHistoryGo(delta) {
|
|
68885
69175
|
post(IFRAME_EVENTS.HISTORY_GO, {
|
|
68886
69176
|
delta: delta
|
|
@@ -68951,6 +69241,7 @@ function sendAppEnv(toolkitEnv) {
|
|
|
68951
69241
|
}
|
|
68952
69242
|
function addMessageListener(callback) {
|
|
68953
69243
|
var handler = function handler(event) {
|
|
69244
|
+
if (!isTrustedMessage(event)) return;
|
|
68954
69245
|
var data = event.data;
|
|
68955
69246
|
if (data && data.eventType) callback(data);
|
|
68956
69247
|
};
|
|
@@ -68973,7 +69264,8 @@ function getInitialUri() {
|
|
|
68973
69264
|
}
|
|
68974
69265
|
return new Promise(function (resolve) {
|
|
68975
69266
|
function onMessage(event) {
|
|
68976
|
-
if (event
|
|
69267
|
+
if (!isTrustedMessage(event)) return;
|
|
69268
|
+
if (event.data && event.data.eventType === IFRAME_EVENTS.LOAD_URI && event.data.eventProps) {
|
|
68977
69269
|
window.removeEventListener('message', onMessage);
|
|
68978
69270
|
clearTimeout(timer);
|
|
68979
69271
|
var _uri = event.data.eventProps.uri;
|
|
@@ -68997,9 +69289,13 @@ function setAppName(name) {
|
|
|
68997
69289
|
_appName = name;
|
|
68998
69290
|
}
|
|
68999
69291
|
function getAppName() {
|
|
69000
|
-
var _window$toolkitEnv;
|
|
69292
|
+
var _window$toolkitEnv, _process$env;
|
|
69001
69293
|
if (_appName) return _appName;
|
|
69002
|
-
|
|
69294
|
+
var envName = ((_window$toolkitEnv = window.toolkitEnv) === null || _window$toolkitEnv === void 0 ? void 0 : _window$toolkitEnv.APP_NAME) || typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.APP_NAME) || '';
|
|
69295
|
+
if (!envName) {
|
|
69296
|
+
console.error('[iframe-bridge] APP_NAME is not configured. Storage namespacing and app resolution will not work correctly.');
|
|
69297
|
+
}
|
|
69298
|
+
return envName;
|
|
69003
69299
|
}
|
|
69004
69300
|
|
|
69005
69301
|
/**
|
|
@@ -69007,7 +69303,7 @@ function getAppName() {
|
|
|
69007
69303
|
* Matches standalone toolkit: permissions are stored as `${appAuthName}:permissions`.
|
|
69008
69304
|
*/
|
|
69009
69305
|
function resolveAppAuthName(appName, getLocalItemFn) {
|
|
69010
|
-
var _window$toolkitEnv2, _process$
|
|
69306
|
+
var _window$toolkitEnv2, _process$env2;
|
|
69011
69307
|
if (!appName) return null;
|
|
69012
69308
|
var portalConfig = typeof getLocalItemFn === 'function' ? getLocalItemFn('opsportal-core:config') : null;
|
|
69013
69309
|
var appTiles = portalConfig && portalConfig.tiles || [];
|
|
@@ -69016,11 +69312,14 @@ function resolveAppAuthName(appName, getLocalItemFn) {
|
|
|
69016
69312
|
});
|
|
69017
69313
|
if (appData !== null && appData !== void 0 && appData.appAuthName) return appData.appAuthName;
|
|
69018
69314
|
if ((_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.APP_AUTH_NAME) return window.toolkitEnv.APP_AUTH_NAME;
|
|
69019
|
-
if (typeof process !== 'undefined' && (_process$
|
|
69315
|
+
if (typeof process !== 'undefined' && (_process$env2 = process.env) !== null && _process$env2 !== void 0 && _process$env2.APP_AUTH_NAME) {
|
|
69020
69316
|
return process.env.APP_AUTH_NAME;
|
|
69021
69317
|
}
|
|
69022
69318
|
return null;
|
|
69023
69319
|
}
|
|
69320
|
+
function nullishCoalesce(primary, fallback) {
|
|
69321
|
+
return primary !== null && primary !== undefined ? primary : fallback;
|
|
69322
|
+
}
|
|
69024
69323
|
function getByPath(obj, path) {
|
|
69025
69324
|
if (obj == null) return undefined;
|
|
69026
69325
|
var parts = path.split('.');
|
|
@@ -69057,34 +69356,21 @@ function setInitCache(initData) {
|
|
|
69057
69356
|
// Shell sends config/coreAppPermissions under shorthand keys; map to canonical keys bridge getters expect
|
|
69058
69357
|
if (initData.config != null && initData['opsportal-core:config'] == null) {
|
|
69059
69358
|
cache.local['opsportal-core:config'] = initData.config;
|
|
69060
|
-
console.log('[iframe-bridge/storage] setInitCache mapped config -> opsportal-core:config');
|
|
69061
69359
|
}
|
|
69062
69360
|
if (initData.coreAppPermissions != null && initData['ops_portal:permissions'] == null) {
|
|
69063
69361
|
cache.local['ops_portal:permissions'] = initData.coreAppPermissions;
|
|
69064
|
-
console.log('[iframe-bridge/storage] setInitCache mapped coreAppPermissions -> ops_portal:permissions', {
|
|
69065
|
-
count: Array.isArray(initData.coreAppPermissions) ? initData.coreAppPermissions.length : 'not-array'
|
|
69066
|
-
});
|
|
69067
69362
|
}
|
|
69068
69363
|
var appPermKeys = Object.keys(initData).filter(function (k) {
|
|
69069
69364
|
return k.endsWith(':permissions') && k !== 'ops_portal:permissions';
|
|
69070
69365
|
});
|
|
69071
69366
|
appPermKeys.forEach(function (k) {
|
|
69072
69367
|
cache.local[k] = initData[k];
|
|
69073
|
-
console.log('[iframe-bridge/storage] setInitCache mapped app permissions', {
|
|
69074
|
-
key: k,
|
|
69075
|
-
count: Array.isArray(initData[k]) ? initData[k].length : 'not-array'
|
|
69076
|
-
});
|
|
69077
69368
|
});
|
|
69078
69369
|
var appConfigKeys = Object.keys(initData).filter(function (k) {
|
|
69079
69370
|
return k.endsWith(':config') && k !== 'opsportal-core:config';
|
|
69080
69371
|
});
|
|
69081
69372
|
appConfigKeys.forEach(function (k) {
|
|
69082
|
-
var _initData$k;
|
|
69083
69373
|
cache.local[k] = initData[k];
|
|
69084
|
-
console.log('[iframe-bridge/storage] setInitCache mapped app config', {
|
|
69085
|
-
key: k,
|
|
69086
|
-
hasRunConfig: Boolean((_initData$k = initData[k]) === null || _initData$k === void 0 ? void 0 : _initData$k.runConfig)
|
|
69087
|
-
});
|
|
69088
69374
|
});
|
|
69089
69375
|
}
|
|
69090
69376
|
function setExtraLocal(key, value) {
|
|
@@ -69094,7 +69380,7 @@ function getInitDataForBootstrap() {
|
|
|
69094
69380
|
return getInitData();
|
|
69095
69381
|
}
|
|
69096
69382
|
function getLocalItem(key, path) {
|
|
69097
|
-
var value = cache.local[key]
|
|
69383
|
+
var value = nullishCoalesce(cache.local[key], cache[key]);
|
|
69098
69384
|
var out = path ? getByPath(value, path) : value;
|
|
69099
69385
|
if (out !== undefined) return out;
|
|
69100
69386
|
if (key === 'login') return cache.login;
|
|
@@ -69109,7 +69395,7 @@ function setLocalItem(key, value, path) {
|
|
|
69109
69395
|
path: path
|
|
69110
69396
|
});
|
|
69111
69397
|
if (path) {
|
|
69112
|
-
var existing = cache.local[key]
|
|
69398
|
+
var existing = nullishCoalesce(cache.local[key], nullishCoalesce(cache[key], {}));
|
|
69113
69399
|
cache.local[key] = setByPath(_objectSpread2({}, existing), path, value);
|
|
69114
69400
|
} else {
|
|
69115
69401
|
cache.local[key] = value;
|
|
@@ -69118,7 +69404,7 @@ function setLocalItem(key, value, path) {
|
|
|
69118
69404
|
}
|
|
69119
69405
|
}
|
|
69120
69406
|
function getSessionItem(key, path) {
|
|
69121
|
-
var value = cache.session[key]
|
|
69407
|
+
var value = nullishCoalesce(cache.session[key], cache[key]);
|
|
69122
69408
|
var out = path ? getByPath(value, path) : value;
|
|
69123
69409
|
if (out !== undefined) return out;
|
|
69124
69410
|
if (key === 'dashboard') return cache.dashboard;
|
|
@@ -69132,7 +69418,7 @@ function setSessionItem(key, value, path) {
|
|
|
69132
69418
|
path: path
|
|
69133
69419
|
});
|
|
69134
69420
|
if (path) {
|
|
69135
|
-
var existing = cache.session[key]
|
|
69421
|
+
var existing = nullishCoalesce(cache.session[key], nullishCoalesce(cache[key], {}));
|
|
69136
69422
|
cache.session[key] = setByPath(_objectSpread2({}, existing), path, value);
|
|
69137
69423
|
} else {
|
|
69138
69424
|
cache.session[key] = value;
|
|
@@ -69174,14 +69460,14 @@ function applyStorageChanged() {
|
|
|
69174
69460
|
if (op === 'set' && key) {
|
|
69175
69461
|
if (scope === 'session') {
|
|
69176
69462
|
if (path) {
|
|
69177
|
-
var existing = cache.session[key]
|
|
69463
|
+
var existing = nullishCoalesce(cache.session[key], {});
|
|
69178
69464
|
cache.session[key] = setByPath(_objectSpread2({}, existing), path, value);
|
|
69179
69465
|
} else {
|
|
69180
69466
|
cache.session[key] = value;
|
|
69181
69467
|
if (key === 'dashboard') cache.dashboard = value;
|
|
69182
69468
|
}
|
|
69183
69469
|
} else if (path) {
|
|
69184
|
-
var _existing = cache.local[key]
|
|
69470
|
+
var _existing = nullishCoalesce(cache.local[key], {});
|
|
69185
69471
|
cache.local[key] = setByPath(_objectSpread2({}, _existing), path, value);
|
|
69186
69472
|
} else {
|
|
69187
69473
|
cache.local[key] = value;
|
|
@@ -69202,7 +69488,7 @@ function removeSessionItemFromCache(key) {
|
|
|
69202
69488
|
function getItem$1(key) {
|
|
69203
69489
|
var APP_NAME = getAppName();
|
|
69204
69490
|
var namespaced = "".concat(APP_NAME, ":").concat(key);
|
|
69205
|
-
return cache.local[namespaced]
|
|
69491
|
+
return nullishCoalesce(cache.local[namespaced], cache[key]);
|
|
69206
69492
|
}
|
|
69207
69493
|
function setItem(key, value) {
|
|
69208
69494
|
var APP_NAME = getAppName();
|
|
@@ -69237,7 +69523,7 @@ function setAppContext() {
|
|
|
69237
69523
|
if (!appAuthName) throw new Error('appAuthName not found');
|
|
69238
69524
|
setSessionItem("".concat(appAuthName, ":miHelpBotContext"), context);
|
|
69239
69525
|
} catch (e) {
|
|
69240
|
-
console.
|
|
69526
|
+
console.error('[iframe-bridge/storage] setAppContext error:', e);
|
|
69241
69527
|
}
|
|
69242
69528
|
}
|
|
69243
69529
|
function clearStorage() {
|
|
@@ -69270,7 +69556,7 @@ var storage$1 = {
|
|
|
69270
69556
|
var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv6 = window.toolkitEnv) !== null && _window$toolkitEnv6 !== void 0 && _window$toolkitEnv6.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
|
|
69271
69557
|
return appAuthName ? getSessionItem("".concat(appAuthName, ":miHelpBotContext")) : {};
|
|
69272
69558
|
} catch (e) {
|
|
69273
|
-
console.
|
|
69559
|
+
console.error('[iframe-bridge/storage] appContext getter error:', e);
|
|
69274
69560
|
return '';
|
|
69275
69561
|
}
|
|
69276
69562
|
},
|
|
@@ -69480,15 +69766,6 @@ function request(config) {
|
|
|
69480
69766
|
timeout = finalConfig.timeout,
|
|
69481
69767
|
withCredentials = finalConfig.withCredentials,
|
|
69482
69768
|
signal = finalConfig.signal;
|
|
69483
|
-
if (responseType || timeout != null || withCredentials != null || signal) {
|
|
69484
|
-
console.log('[iframe-bridge/fetcher] request with extended options', {
|
|
69485
|
-
url: url,
|
|
69486
|
-
responseType: responseType,
|
|
69487
|
-
timeout: timeout,
|
|
69488
|
-
withCredentials: withCredentials,
|
|
69489
|
-
hasSignal: Boolean(signal)
|
|
69490
|
-
});
|
|
69491
|
-
}
|
|
69492
69769
|
return sendFetchRequest({
|
|
69493
69770
|
method: (method || 'get').toLowerCase(),
|
|
69494
69771
|
url: url,
|
|
@@ -69501,13 +69778,6 @@ function request(config) {
|
|
|
69501
69778
|
signal: signal
|
|
69502
69779
|
});
|
|
69503
69780
|
}).then(function (result) {
|
|
69504
|
-
if (result.data instanceof ArrayBuffer) {
|
|
69505
|
-
console.log('[iframe-bridge/fetcher] binary response received', {
|
|
69506
|
-
url: config.url,
|
|
69507
|
-
byteLength: result.data.byteLength,
|
|
69508
|
-
type: 'ArrayBuffer'
|
|
69509
|
-
});
|
|
69510
|
-
}
|
|
69511
69781
|
return applyResponseInterceptors({
|
|
69512
69782
|
data: result.data,
|
|
69513
69783
|
status: result.status,
|
|
@@ -69671,14 +69941,10 @@ Object.assign(fetcher, {
|
|
|
69671
69941
|
return _regenerator().w(function (_context3) {
|
|
69672
69942
|
while (1) switch (_context3.p = _context3.n) {
|
|
69673
69943
|
case 0:
|
|
69674
|
-
|
|
69675
|
-
appName: appName,
|
|
69676
|
-
useAppScopes: useAppScopes
|
|
69677
|
-
});
|
|
69678
|
-
_context3.p = 1;
|
|
69944
|
+
_context3.p = 0;
|
|
69679
69945
|
permissions = [];
|
|
69680
69946
|
if (!useAppScopes) {
|
|
69681
|
-
_context3.n =
|
|
69947
|
+
_context3.n = 1;
|
|
69682
69948
|
break;
|
|
69683
69949
|
}
|
|
69684
69950
|
userAppScopes = Array.isArray(storage$1.userAppScopes) ? storage$1.userAppScopes : [];
|
|
@@ -69686,10 +69952,6 @@ Object.assign(fetcher, {
|
|
|
69686
69952
|
appEntry = Array.isArray(allAppScopesAndFunctions) ? allAppScopesAndFunctions.find(function (s) {
|
|
69687
69953
|
return s.appName === appName;
|
|
69688
69954
|
}) : null;
|
|
69689
|
-
console.log('[iframe-bridge/fetcher] getPermissions (useAppScopes)', {
|
|
69690
|
-
appEntryFound: Boolean(appEntry),
|
|
69691
|
-
userAppScopesCount: userAppScopes.length
|
|
69692
|
-
});
|
|
69693
69955
|
if (appEntry) {
|
|
69694
69956
|
appFunctionsMap = {};
|
|
69695
69957
|
(_appEntry$scopes = appEntry.scopes) === null || _appEntry$scopes === void 0 ? void 0 : _appEntry$scopes.forEach(function (scope) {
|
|
@@ -69711,25 +69973,21 @@ Object.assign(fetcher, {
|
|
|
69711
69973
|
});
|
|
69712
69974
|
permissions = Object.values(appFunctionsMap);
|
|
69713
69975
|
}
|
|
69714
|
-
_context3.n =
|
|
69976
|
+
_context3.n = 3;
|
|
69715
69977
|
break;
|
|
69716
|
-
case
|
|
69978
|
+
case 1:
|
|
69717
69979
|
config = storage$1.getLocalItem('opsportal-core:config') || storage$1.getLocalItem('config');
|
|
69718
69980
|
endpoint = config === null || config === void 0 ? void 0 : (_config$endpoints = config.endpoints) === null || _config$endpoints === void 0 ? void 0 : _config$endpoints.g2AppPermissions;
|
|
69719
69981
|
url = endpoint ? "".concat(endpoint).concat(appName) : "/api/permissions/".concat(appName);
|
|
69720
69982
|
country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
69721
|
-
|
|
69722
|
-
url: url,
|
|
69723
|
-
country: country
|
|
69724
|
-
});
|
|
69725
|
-
_context3.n = 3;
|
|
69983
|
+
_context3.n = 2;
|
|
69726
69984
|
return fetcher.get(url, {
|
|
69727
69985
|
headers: {
|
|
69728
69986
|
country: country,
|
|
69729
69987
|
source: 'OPS_PORTAL'
|
|
69730
69988
|
}
|
|
69731
69989
|
});
|
|
69732
|
-
case
|
|
69990
|
+
case 2:
|
|
69733
69991
|
response = _context3.v;
|
|
69734
69992
|
appDetails = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$applic = _response$data.applications) === null || _response$data$applic === void 0 ? void 0 : _response$data$applic.find(function (app) {
|
|
69735
69993
|
return app.name === appName;
|
|
@@ -69737,15 +69995,11 @@ Object.assign(fetcher, {
|
|
|
69737
69995
|
if (appDetails) {
|
|
69738
69996
|
permissions = appDetails.applicationFunctions;
|
|
69739
69997
|
}
|
|
69740
|
-
case
|
|
69741
|
-
console.log('[iframe-bridge/fetcher] getPermissions stored', {
|
|
69742
|
-
appName: appName,
|
|
69743
|
-
count: permissions.length
|
|
69744
|
-
});
|
|
69998
|
+
case 3:
|
|
69745
69999
|
storage$1.setLocalItem("".concat(appName, ":permissions"), permissions);
|
|
69746
70000
|
return _context3.a(2, permissions);
|
|
69747
|
-
case
|
|
69748
|
-
_context3.p =
|
|
70001
|
+
case 4:
|
|
70002
|
+
_context3.p = 4;
|
|
69749
70003
|
_t = _context3.v;
|
|
69750
70004
|
console.warn('[iframe-bridge/fetcher] getPermissions failed', {
|
|
69751
70005
|
appName: appName,
|
|
@@ -69753,7 +70007,7 @@ Object.assign(fetcher, {
|
|
|
69753
70007
|
});
|
|
69754
70008
|
return _context3.a(2, []);
|
|
69755
70009
|
}
|
|
69756
|
-
}, _callee3, null, [[
|
|
70010
|
+
}, _callee3, null, [[0, 4]]);
|
|
69757
70011
|
}));
|
|
69758
70012
|
function getPermissions(_x2, _x3) {
|
|
69759
70013
|
return _getPermissions.apply(this, arguments);
|
|
@@ -70175,7 +70429,7 @@ function CrumbProvider(_ref) {
|
|
|
70175
70429
|
React.useEffect(function () {
|
|
70176
70430
|
var remove = addMessageListener(function (data) {
|
|
70177
70431
|
var _data$eventProps;
|
|
70178
|
-
if (data.eventType ===
|
|
70432
|
+
if (data.eventType === IFRAME_EVENTS.CRUMB_CLICKED && ((_data$eventProps = data.eventProps) === null || _data$eventProps === void 0 ? void 0 : _data$eventProps.path) != null && navigateRef) {
|
|
70179
70433
|
navigateRef(data.eventProps.path);
|
|
70180
70434
|
}
|
|
70181
70435
|
});
|
|
@@ -70282,6 +70536,283 @@ function Crumb(_ref) {
|
|
|
70282
70536
|
return null;
|
|
70283
70537
|
}
|
|
70284
70538
|
|
|
70539
|
+
/**
|
|
70540
|
+
* Shared navigation classifier for embedded apps.
|
|
70541
|
+
*
|
|
70542
|
+
* Both AppLink (the opt-in component) and the global navigation guard (the
|
|
70543
|
+
* catch-all for raw <a>/window.open/forms) use this so they agree on what is
|
|
70544
|
+
* "internal" (a shell route), "external" (a foreign site), or something we
|
|
70545
|
+
* should leave to the browser.
|
|
70546
|
+
*/
|
|
70547
|
+
|
|
70548
|
+
// Schemes that are not frame navigations we manage — let the browser handle.
|
|
70549
|
+
var SPECIAL_SCHEME = /^(mailto:|tel:|sms:|callto:|blob:|data:|javascript:|about:)/i;
|
|
70550
|
+
|
|
70551
|
+
/**
|
|
70552
|
+
* @param {string} href
|
|
70553
|
+
* @returns {{kind:'internal'|'external'|'special'|'hash'|'ignore', shellPath?:string, absolute?:string, unresolved?:boolean}}
|
|
70554
|
+
* - internal: same origin as the shell → should be driven through the shell router
|
|
70555
|
+
* - external: a different origin → must open in a new tab, never in-frame
|
|
70556
|
+
* - special/hash/ignore: leave to native browser behavior
|
|
70557
|
+
*/
|
|
70558
|
+
function classifyHref(href) {
|
|
70559
|
+
if (href == null || href === '' || typeof href !== 'string') return {
|
|
70560
|
+
kind: 'ignore'
|
|
70561
|
+
};
|
|
70562
|
+
if (SPECIAL_SCHEME.test(href)) return {
|
|
70563
|
+
kind: 'special'
|
|
70564
|
+
};
|
|
70565
|
+
if (href.startsWith('#')) return {
|
|
70566
|
+
kind: 'hash'
|
|
70567
|
+
};
|
|
70568
|
+
var shellOrigin = getShellOrigin();
|
|
70569
|
+
var appOrigin = typeof window !== 'undefined' ? window.location.origin : undefined;
|
|
70570
|
+
var base = shellOrigin || appOrigin;
|
|
70571
|
+
var parsed;
|
|
70572
|
+
try {
|
|
70573
|
+
parsed = new URL(href, base);
|
|
70574
|
+
} catch (_) {
|
|
70575
|
+
return {
|
|
70576
|
+
kind: 'ignore'
|
|
70577
|
+
};
|
|
70578
|
+
}
|
|
70579
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
70580
|
+
return {
|
|
70581
|
+
kind: 'special'
|
|
70582
|
+
};
|
|
70583
|
+
}
|
|
70584
|
+
var shellPath = "".concat(parsed.pathname).concat(parsed.search).concat(parsed.hash);
|
|
70585
|
+
if (shellOrigin) {
|
|
70586
|
+
return parsed.origin === shellOrigin ? {
|
|
70587
|
+
kind: 'internal',
|
|
70588
|
+
shellPath: shellPath,
|
|
70589
|
+
absolute: shellOrigin + shellPath
|
|
70590
|
+
} : {
|
|
70591
|
+
kind: 'external',
|
|
70592
|
+
absolute: parsed.href
|
|
70593
|
+
};
|
|
70594
|
+
}
|
|
70595
|
+
|
|
70596
|
+
// Handshake not complete yet (shell origin unknown). Best effort: a URL on the
|
|
70597
|
+
// app's own origin (which is what a relative path resolves to) is treated as
|
|
70598
|
+
// internal-but-unresolved; the shell path is still correct to route.
|
|
70599
|
+
if (appOrigin && parsed.origin === appOrigin) {
|
|
70600
|
+
return {
|
|
70601
|
+
kind: 'internal',
|
|
70602
|
+
shellPath: shellPath,
|
|
70603
|
+
absolute: parsed.origin + shellPath,
|
|
70604
|
+
unresolved: true
|
|
70605
|
+
};
|
|
70606
|
+
}
|
|
70607
|
+
return {
|
|
70608
|
+
kind: 'external',
|
|
70609
|
+
absolute: parsed.href
|
|
70610
|
+
};
|
|
70611
|
+
}
|
|
70612
|
+
function isModifiedClick(event) {
|
|
70613
|
+
return event.metaKey || event.altKey || event.ctrlKey || event.shiftKey;
|
|
70614
|
+
}
|
|
70615
|
+
|
|
70616
|
+
var _excluded = ["href", "target", "rel", "children", "onClick"];
|
|
70617
|
+
|
|
70618
|
+
/**
|
|
70619
|
+
* AppLink — a drop-in replacement for a plain <a> inside an iframed app.
|
|
70620
|
+
*
|
|
70621
|
+
* Why it exists: an app is rendered inside the shell's iframe. A normal
|
|
70622
|
+
* <a href="..."> click navigates the *iframe itself*, which is wrong in two ways:
|
|
70623
|
+
* 1. Internal/shell links → the iframe full-reloads (and can even render the
|
|
70624
|
+
* shell nested inside the iframe — "shell-in-shell") and the shell URL bar
|
|
70625
|
+
* desyncs, breaking deep-linking and Back.
|
|
70626
|
+
* 2. External links → an arbitrary (possibly malicious) site gets framed
|
|
70627
|
+
* inside our portal chrome.
|
|
70628
|
+
*
|
|
70629
|
+
* AppLink is the opt-in "authored correctly" path; for raw <a>/window.open the
|
|
70630
|
+
* app did NOT convert, installNavigationGuard() is the global catch-all. Both
|
|
70631
|
+
* share classifyHref() so they behave identically.
|
|
70632
|
+
*
|
|
70633
|
+
* Behavior:
|
|
70634
|
+
* - Relative / same-shell-origin href → shell router navigation (no reload).
|
|
70635
|
+
* target="_blank" opens the absolute shell URL in a new tab.
|
|
70636
|
+
* - External href → target defaults to "_blank" + rel="noopener noreferrer".
|
|
70637
|
+
* - mailto:/tel:/hash/etc. and modified/middle clicks → native behavior.
|
|
70638
|
+
*
|
|
70639
|
+
* All other anchor props (className, style, aria-*, onClick, …) are forwarded.
|
|
70640
|
+
*/
|
|
70641
|
+
function AppLink(_ref) {
|
|
70642
|
+
var href = _ref.href,
|
|
70643
|
+
target = _ref.target,
|
|
70644
|
+
rel = _ref.rel,
|
|
70645
|
+
children = _ref.children,
|
|
70646
|
+
onClick = _ref.onClick,
|
|
70647
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
70648
|
+
var result = classifyHref(href);
|
|
70649
|
+
var isInternal = result.kind === 'internal';
|
|
70650
|
+
var isExternal = result.kind === 'external';
|
|
70651
|
+
var shellOrigin = getShellOrigin();
|
|
70652
|
+
var handleClick = function handleClick(event) {
|
|
70653
|
+
if (onClick) onClick(event);
|
|
70654
|
+
if (event.defaultPrevented) return;
|
|
70655
|
+
if (event.button !== 0) return;
|
|
70656
|
+
if (isModifiedClick(event)) return;
|
|
70657
|
+
if (isInternal) {
|
|
70658
|
+
event.preventDefault();
|
|
70659
|
+
if (target === '_blank') {
|
|
70660
|
+
window.open(result.absolute, '_blank', 'noopener,noreferrer');
|
|
70661
|
+
} else {
|
|
70662
|
+
postUpdateUri(result.shellPath, true);
|
|
70663
|
+
}
|
|
70664
|
+
return;
|
|
70665
|
+
}
|
|
70666
|
+
// External: let the resolved target/rel below force a new tab (never in-frame).
|
|
70667
|
+
};
|
|
70668
|
+
var resolvedTarget = isExternal ? target || '_blank' : target;
|
|
70669
|
+
var resolvedRel = resolvedTarget === '_blank' ? rel || 'noopener noreferrer' : rel;
|
|
70670
|
+
|
|
70671
|
+
// href shown on the anchor: absolute shell URL for internal (so hover/copy/
|
|
70672
|
+
// open-in-new-tab work), original href otherwise.
|
|
70673
|
+
var anchorHref = isInternal && shellOrigin ? result.absolute : href;
|
|
70674
|
+
return /*#__PURE__*/React__default["default"].createElement("a", _extends$1({
|
|
70675
|
+
href: anchorHref,
|
|
70676
|
+
target: resolvedTarget,
|
|
70677
|
+
rel: resolvedRel,
|
|
70678
|
+
onClick: handleClick
|
|
70679
|
+
}, rest), children);
|
|
70680
|
+
}
|
|
70681
|
+
|
|
70682
|
+
/**
|
|
70683
|
+
* installNavigationGuard — a global, app-agnostic catch-all that keeps an
|
|
70684
|
+
* embedded app's frame from navigating itself to the wrong place, regardless of
|
|
70685
|
+
* how the app wrote the navigation. AppLink is the opt-in, "authored correctly"
|
|
70686
|
+
* path; this guard covers the code the app did NOT write with AppLink:
|
|
70687
|
+
*
|
|
70688
|
+
* 1. Raw <a href> clicks (any anchor, added anytime) — capture-phase listener.
|
|
70689
|
+
* 2. window.open(url, '_self'/'_top'/'_parent') — wrapped.
|
|
70690
|
+
* 3. <form> submits with a navigating action — capture-phase submit listener.
|
|
70691
|
+
*
|
|
70692
|
+
* Policy (shared with AppLink via classifyHref):
|
|
70693
|
+
* - internal (same origin as shell) → drive the shell router (postUpdateUri),
|
|
70694
|
+
* no iframe reload, shell URL stays in sync. New-tab intents open the
|
|
70695
|
+
* absolute shell URL.
|
|
70696
|
+
* - external (foreign origin) → open in a new tab (noopener), never in-frame.
|
|
70697
|
+
* - special/hash → left to the browser.
|
|
70698
|
+
*
|
|
70699
|
+
* Call once, after bootstrap. Idempotent. Returns an uninstall function.
|
|
70700
|
+
*
|
|
70701
|
+
* NOTE: this is defense-in-depth, not a security boundary. See LIMITATIONS at
|
|
70702
|
+
* the bottom for the vectors it cannot cover (location.assign, meta-refresh,
|
|
70703
|
+
* server redirects), which must be handled by CSP + the shell heartbeat.
|
|
70704
|
+
*/
|
|
70705
|
+
|
|
70706
|
+
var installed = false;
|
|
70707
|
+
function installNavigationGuard() {
|
|
70708
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
70709
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') return function () {};
|
|
70710
|
+
if (installed) return function () {};
|
|
70711
|
+
installed = true;
|
|
70712
|
+
var onBlockedNavigation = options.onBlockedNavigation;
|
|
70713
|
+
var routeInternal = function routeInternal(shellPath, newTab) {
|
|
70714
|
+
if (newTab) {
|
|
70715
|
+
var shellOrigin = getShellOrigin();
|
|
70716
|
+
window.open((shellOrigin || '') + shellPath, '_blank', 'noopener,noreferrer');
|
|
70717
|
+
} else {
|
|
70718
|
+
postUpdateUri(shellPath, true);
|
|
70719
|
+
}
|
|
70720
|
+
if (onBlockedNavigation) onBlockedNavigation({
|
|
70721
|
+
type: 'internal',
|
|
70722
|
+
shellPath: shellPath,
|
|
70723
|
+
newTab: newTab
|
|
70724
|
+
});
|
|
70725
|
+
};
|
|
70726
|
+
var openExternal = function openExternal(absolute) {
|
|
70727
|
+
window.open(absolute, '_blank', 'noopener,noreferrer');
|
|
70728
|
+
if (onBlockedNavigation) onBlockedNavigation({
|
|
70729
|
+
type: 'external',
|
|
70730
|
+
absolute: absolute
|
|
70731
|
+
});
|
|
70732
|
+
};
|
|
70733
|
+
|
|
70734
|
+
// --- 1. Anchor clicks -----------------------------------------------------
|
|
70735
|
+
var onClick = function onClick(event) {
|
|
70736
|
+
if (event.defaultPrevented || event.button !== 0) return;
|
|
70737
|
+
var anchor = event.target && event.target.closest && event.target.closest('a[href]');
|
|
70738
|
+
if (!anchor) return;
|
|
70739
|
+
// Respect an explicit new-tab/native target the browser will handle safely.
|
|
70740
|
+
var target = anchor.getAttribute('target');
|
|
70741
|
+
var href = anchor.getAttribute('href');
|
|
70742
|
+
var result = classifyHref(href);
|
|
70743
|
+
if (result.kind === 'special' || result.kind === 'hash' || result.kind === 'ignore') return;
|
|
70744
|
+
|
|
70745
|
+
// Modifier / middle click on an internal link: let the browser open the real
|
|
70746
|
+
// URL (anchor href is already absolute-to-app; harmless). For external it's
|
|
70747
|
+
// fine too. We only take over the *plain* click.
|
|
70748
|
+
if (isModifiedClick(event)) return;
|
|
70749
|
+
if (result.kind === 'internal') {
|
|
70750
|
+
event.preventDefault();
|
|
70751
|
+
routeInternal(result.shellPath, target === '_blank');
|
|
70752
|
+
return;
|
|
70753
|
+
}
|
|
70754
|
+
if (result.kind === 'external') {
|
|
70755
|
+
// Force new tab even if the app omitted target — never load foreign in-frame.
|
|
70756
|
+
event.preventDefault();
|
|
70757
|
+
openExternal(result.absolute);
|
|
70758
|
+
}
|
|
70759
|
+
};
|
|
70760
|
+
document.addEventListener('click', onClick, true);
|
|
70761
|
+
|
|
70762
|
+
// --- 2. window.open('_self'/'_top'/'_parent') -----------------------------
|
|
70763
|
+
var nativeOpen = window.open;
|
|
70764
|
+
var wrappedOpen = function wrappedOpen(url, name, features) {
|
|
70765
|
+
// Named/new-window targets are real popups — allow natively.
|
|
70766
|
+
var selfNav = name === '_self' || name === '_top' || name === '_parent';
|
|
70767
|
+
if (url != null && selfNav) {
|
|
70768
|
+
var result = classifyHref(String(url));
|
|
70769
|
+
if (result.kind === 'internal') {
|
|
70770
|
+
routeInternal(result.shellPath, false);
|
|
70771
|
+
return null;
|
|
70772
|
+
}
|
|
70773
|
+
if (result.kind === 'external') {
|
|
70774
|
+
return nativeOpen.call(window, result.absolute, '_blank', 'noopener,noreferrer');
|
|
70775
|
+
}
|
|
70776
|
+
}
|
|
70777
|
+
return nativeOpen.call(window, url, name, features);
|
|
70778
|
+
};
|
|
70779
|
+
try {
|
|
70780
|
+
window.open = wrappedOpen;
|
|
70781
|
+
} catch (_) {/* some environments freeze window.open */}
|
|
70782
|
+
|
|
70783
|
+
// --- 3. Form submits ------------------------------------------------------
|
|
70784
|
+
var onSubmit = function onSubmit(event) {
|
|
70785
|
+
if (event.defaultPrevented) return;
|
|
70786
|
+
var form = event.target;
|
|
70787
|
+
if (!form || form.tagName !== 'FORM') return;
|
|
70788
|
+
var action = form.getAttribute('action');
|
|
70789
|
+
// No action → submits to current URL (in-app); let it be. GET/POST both
|
|
70790
|
+
// cause a frame navigation though, so classify the action when present.
|
|
70791
|
+
if (!action) return;
|
|
70792
|
+
var result = classifyHref(action);
|
|
70793
|
+
if (result.kind === 'external') {
|
|
70794
|
+
// Never let a form post navigate the frame to a foreign origin.
|
|
70795
|
+
event.preventDefault();
|
|
70796
|
+
if (onBlockedNavigation) onBlockedNavigation({
|
|
70797
|
+
type: 'external-form-blocked',
|
|
70798
|
+
action: result.absolute
|
|
70799
|
+
});
|
|
70800
|
+
// Intentionally do NOT auto-resubmit externally — a cross-origin form POST
|
|
70801
|
+
// to a new tab is not generally safe/possible. Surface via callback.
|
|
70802
|
+
}
|
|
70803
|
+
// internal form navigation is left to the app's own router/handling.
|
|
70804
|
+
};
|
|
70805
|
+
document.addEventListener('submit', onSubmit, true);
|
|
70806
|
+
return function uninstall() {
|
|
70807
|
+
document.removeEventListener('click', onClick, true);
|
|
70808
|
+
document.removeEventListener('submit', onSubmit, true);
|
|
70809
|
+
try {
|
|
70810
|
+
window.open = nativeOpen;
|
|
70811
|
+
} catch (_) {}
|
|
70812
|
+
installed = false;
|
|
70813
|
+
};
|
|
70814
|
+
}
|
|
70815
|
+
|
|
70285
70816
|
var iframeFacade = {
|
|
70286
70817
|
AppFrame: AppFrame,
|
|
70287
70818
|
CallLogger: CallLogger,
|
|
@@ -70293,6 +70824,8 @@ var iframeFacade = {
|
|
|
70293
70824
|
Crumb: Crumb,
|
|
70294
70825
|
CrumbProvider: CrumbProvider,
|
|
70295
70826
|
useCrumbContext: useCrumbContext,
|
|
70827
|
+
AppLink: AppLink,
|
|
70828
|
+
installNavigationGuard: installNavigationGuard,
|
|
70296
70829
|
bridge: {
|
|
70297
70830
|
postUpdateUri: postUpdateUri,
|
|
70298
70831
|
postUpdateCrumbs: postUpdateCrumbs,
|
|
@@ -70310,6 +70843,7 @@ var iframeFacade = {
|
|
|
70310
70843
|
resolveAppAuthName: resolveAppAuthName,
|
|
70311
70844
|
getInitDataForBootstrap: getInitDataForBootstrap,
|
|
70312
70845
|
sendStorageGet: sendStorageGet,
|
|
70846
|
+
getShellOrigin: getShellOrigin,
|
|
70313
70847
|
IFRAME_EVENTS: IFRAME_EVENTS
|
|
70314
70848
|
}
|
|
70315
70849
|
};
|
|
@@ -70324,7 +70858,8 @@ function registerEarlyLoadUriListener() {
|
|
|
70324
70858
|
window.__IFRAME_EARLY_LOAD_URI_LISTENER_REGISTERED = true;
|
|
70325
70859
|
window.__IFRAME_EARLY_LOAD_URI = null;
|
|
70326
70860
|
window.addEventListener('message', function (event) {
|
|
70327
|
-
if (event.
|
|
70861
|
+
if (!isAllowedOrigin(event.origin)) return;
|
|
70862
|
+
if (event.data && event.data.eventType === IFRAME_EVENTS.LOAD_URI && event.data.eventProps) {
|
|
70328
70863
|
window.__IFRAME_EARLY_LOAD_URI = event.data.eventProps.uri || '/';
|
|
70329
70864
|
}
|
|
70330
70865
|
});
|
|
@@ -70383,7 +70918,6 @@ function _hydrateAppConfig() {
|
|
|
70383
70918
|
_context.n = 4;
|
|
70384
70919
|
break;
|
|
70385
70920
|
}
|
|
70386
|
-
console.log('[Iframe] fetching app config from', configFallbackUri);
|
|
70387
70921
|
_context.n = 3;
|
|
70388
70922
|
return fetcher.getConfig(configFallbackUri);
|
|
70389
70923
|
case 3:
|
|
@@ -70477,12 +71011,12 @@ function bootstrapIframeApp(_x3) {
|
|
|
70477
71011
|
}
|
|
70478
71012
|
function _bootstrapIframeApp() {
|
|
70479
71013
|
_bootstrapIframeApp = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4(options) {
|
|
70480
|
-
var _ref4, _ref4$appName, appName, permissionKeysOption, rootSelector, onInitCache, render, _ref4$standaloneError, standaloneErrorMessage, _ref4$fetchConfigFrom, fetchConfigFromShell, _ref4$configFallbackU, configFallbackUri, validateAppConfig, _ref4$permissionsOnly, permissionsOnlyIfArray, _ref4$autoSendAppEnv, autoSendAppEnv, toolkitEnv, _ref4$mihelpAgentProp, mihelpAgentProps, rootNode, bridge, fetcher, storage, getInitialUri, getInitData, setInitCache, setExtraLocal, sendStorageGet, setAppName, sendAppEnv, resolveAppAuthName, _yield$Promise$all, _yield$Promise$all2, initialUri, initData, getCachedLocalItem, appAuthName, permissionKeys, tasks, _t;
|
|
71014
|
+
var _ref4, _ref4$appName, appName, permissionKeysOption, rootSelector, onInitCache, render, _ref4$standaloneError, standaloneErrorMessage, _ref4$fetchConfigFrom, fetchConfigFromShell, _ref4$configFallbackU, configFallbackUri, validateAppConfig, _ref4$permissionsOnly, permissionsOnlyIfArray, _ref4$autoSendAppEnv, autoSendAppEnv, toolkitEnv, _ref4$mihelpAgentProp, mihelpAgentProps, _ref4$installNavGuard, installNavGuard, rootNode, bridge, fetcher, storage, getInitialUri, getInitData, setInitCache, setExtraLocal, sendStorageGet, setAppName, sendAppEnv, resolveAppAuthName, _yield$Promise$all, _yield$Promise$all2, initialUri, initData, getCachedLocalItem, appAuthName, permissionKeys, tasks, _t;
|
|
70481
71015
|
return _regenerator().w(function (_context4) {
|
|
70482
71016
|
while (1) switch (_context4.p = _context4.n) {
|
|
70483
71017
|
case 0:
|
|
70484
71018
|
registerEarlyLoadUriListener();
|
|
70485
|
-
_ref4 = options || {}, _ref4$appName = _ref4.appName, appName = _ref4$appName === void 0 ? process.env.APP_NAME : _ref4$appName, permissionKeysOption = _ref4.permissionKeys, rootSelector = _ref4.rootSelector, onInitCache = _ref4.onInitCache, render = _ref4.render, _ref4$standaloneError = _ref4.standaloneErrorMessage, standaloneErrorMessage = _ref4$standaloneError === void 0 ? 'This application must be opened from the parent portal.' : _ref4$standaloneError, _ref4$fetchConfigFrom = _ref4.fetchConfigFromShell, fetchConfigFromShell = _ref4$fetchConfigFrom === void 0 ? true : _ref4$fetchConfigFrom, _ref4$configFallbackU = _ref4.configFallbackUri, configFallbackUri = _ref4$configFallbackU === void 0 ? process.env.CONFIG_URI : _ref4$configFallbackU, validateAppConfig = _ref4.validateAppConfig, _ref4$permissionsOnly = _ref4.permissionsOnlyIfArray, permissionsOnlyIfArray = _ref4$permissionsOnly === void 0 ? true : _ref4$permissionsOnly, _ref4$autoSendAppEnv = _ref4.autoSendAppEnv, autoSendAppEnv = _ref4$autoSendAppEnv === void 0 ? true : _ref4$autoSendAppEnv, toolkitEnv = _ref4.toolkitEnv, _ref4$mihelpAgentProp = _ref4.mihelpAgentProps, mihelpAgentProps = _ref4$mihelpAgentProp === void 0 ? null : _ref4$mihelpAgentProp;
|
|
71019
|
+
_ref4 = options || {}, _ref4$appName = _ref4.appName, appName = _ref4$appName === void 0 ? process.env.APP_NAME : _ref4$appName, permissionKeysOption = _ref4.permissionKeys, rootSelector = _ref4.rootSelector, onInitCache = _ref4.onInitCache, render = _ref4.render, _ref4$standaloneError = _ref4.standaloneErrorMessage, standaloneErrorMessage = _ref4$standaloneError === void 0 ? 'This application must be opened from the parent portal.' : _ref4$standaloneError, _ref4$fetchConfigFrom = _ref4.fetchConfigFromShell, fetchConfigFromShell = _ref4$fetchConfigFrom === void 0 ? true : _ref4$fetchConfigFrom, _ref4$configFallbackU = _ref4.configFallbackUri, configFallbackUri = _ref4$configFallbackU === void 0 ? process.env.CONFIG_URI : _ref4$configFallbackU, validateAppConfig = _ref4.validateAppConfig, _ref4$permissionsOnly = _ref4.permissionsOnlyIfArray, permissionsOnlyIfArray = _ref4$permissionsOnly === void 0 ? true : _ref4$permissionsOnly, _ref4$autoSendAppEnv = _ref4.autoSendAppEnv, autoSendAppEnv = _ref4$autoSendAppEnv === void 0 ? true : _ref4$autoSendAppEnv, toolkitEnv = _ref4.toolkitEnv, _ref4$mihelpAgentProp = _ref4.mihelpAgentProps, mihelpAgentProps = _ref4$mihelpAgentProp === void 0 ? null : _ref4$mihelpAgentProp, _ref4$installNavGuard = _ref4.installNavGuard, installNavGuard = _ref4$installNavGuard === void 0 ? true : _ref4$installNavGuard;
|
|
70486
71020
|
if (!(typeof render !== 'function')) {
|
|
70487
71021
|
_context4.n = 1;
|
|
70488
71022
|
break;
|
|
@@ -70504,6 +71038,13 @@ function _bootstrapIframeApp() {
|
|
|
70504
71038
|
renderStandaloneError(rootNode, standaloneErrorMessage);
|
|
70505
71039
|
return _context4.a(2);
|
|
70506
71040
|
case 3:
|
|
71041
|
+
// Global catch-all so raw <a>/window.open('_self')/forms the app did not write
|
|
71042
|
+
// with AppLink still route through the shell (internal) or a new tab (external)
|
|
71043
|
+
// instead of navigating this iframe to the wrong place. Opt out with
|
|
71044
|
+
// installNavGuard: false.
|
|
71045
|
+
if (installNavGuard) {
|
|
71046
|
+
installNavigationGuard();
|
|
71047
|
+
}
|
|
70507
71048
|
bridge = iframeFacade.bridge, fetcher = iframeFacade.fetcher, storage = iframeFacade.storage;
|
|
70508
71049
|
getInitialUri = bridge.getInitialUri, getInitData = bridge.getInitData, setInitCache = bridge.setInitCache, setExtraLocal = bridge.setExtraLocal, sendStorageGet = bridge.sendStorageGet, setAppName = bridge.setAppName, sendAppEnv = bridge.sendAppEnv, resolveAppAuthName = bridge.resolveAppAuthName;
|
|
70509
71050
|
_context4.n = 4;
|
|
@@ -70517,22 +71058,29 @@ function _bootstrapIframeApp() {
|
|
|
70517
71058
|
if (autoSendAppEnv && typeof sendAppEnv === 'function') {
|
|
70518
71059
|
sendAppEnv(toolkitEnv, mihelpAgentProps);
|
|
70519
71060
|
}
|
|
70520
|
-
if (initData) {
|
|
70521
|
-
|
|
70522
|
-
|
|
70523
|
-
} else {
|
|
70524
|
-
console.warn('[Iframe] no initData from shell');
|
|
71061
|
+
if (!initData) {
|
|
71062
|
+
_context4.n = 5;
|
|
71063
|
+
break;
|
|
70525
71064
|
}
|
|
71065
|
+
setInitCache(initData);
|
|
71066
|
+
if (onInitCache) onInitCache(initData);
|
|
71067
|
+
_context4.n = 6;
|
|
71068
|
+
break;
|
|
71069
|
+
case 5:
|
|
71070
|
+
console.error('[Iframe] failed to get initData from shell (handshake timeout)');
|
|
71071
|
+
renderStandaloneError(rootNode, 'Failed to connect to the portal. Please refresh.');
|
|
71072
|
+
return _context4.a(2);
|
|
71073
|
+
case 6:
|
|
70526
71074
|
getCachedLocalItem = function getCachedLocalItem(key) {
|
|
70527
71075
|
return storage.getLocalItem(key);
|
|
70528
71076
|
};
|
|
70529
71077
|
appAuthName = typeof resolveAppAuthName === 'function' ? resolveAppAuthName(appName, getCachedLocalItem) : null;
|
|
70530
71078
|
permissionKeys = permissionKeysOption !== undefined ? permissionKeysOption : appAuthName ? "".concat(appAuthName, ":permissions") : null;
|
|
70531
71079
|
if (!(fetchConfigFromShell && appName)) {
|
|
70532
|
-
_context4.n =
|
|
71080
|
+
_context4.n = 10;
|
|
70533
71081
|
break;
|
|
70534
71082
|
}
|
|
70535
|
-
_context4.p =
|
|
71083
|
+
_context4.p = 7;
|
|
70536
71084
|
tasks = [hydrateAppConfig({
|
|
70537
71085
|
appName: appName,
|
|
70538
71086
|
getCachedLocalItem: getCachedLocalItem,
|
|
@@ -70551,21 +71099,21 @@ function _bootstrapIframeApp() {
|
|
|
70551
71099
|
permissionsOnlyIfArray: permissionsOnlyIfArray
|
|
70552
71100
|
}));
|
|
70553
71101
|
}
|
|
70554
|
-
_context4.n = 6;
|
|
70555
|
-
return Promise.all(tasks);
|
|
70556
|
-
case 6:
|
|
70557
71102
|
_context4.n = 8;
|
|
71103
|
+
return Promise.all(tasks);
|
|
71104
|
+
case 8:
|
|
71105
|
+
_context4.n = 10;
|
|
70558
71106
|
break;
|
|
70559
|
-
case
|
|
70560
|
-
_context4.p =
|
|
71107
|
+
case 9:
|
|
71108
|
+
_context4.p = 9;
|
|
70561
71109
|
_t = _context4.v;
|
|
70562
71110
|
console.warn('[Iframe] failed to fetch app config/permissions from shell:', _t);
|
|
70563
|
-
case
|
|
71111
|
+
case 10:
|
|
70564
71112
|
render(initialUri, rootNode);
|
|
70565
|
-
case
|
|
71113
|
+
case 11:
|
|
70566
71114
|
return _context4.a(2);
|
|
70567
71115
|
}
|
|
70568
|
-
}, _callee4, null, [[
|
|
71116
|
+
}, _callee4, null, [[7, 9]]);
|
|
70569
71117
|
}));
|
|
70570
71118
|
return _bootstrapIframeApp.apply(this, arguments);
|
|
70571
71119
|
}
|
|
@@ -70839,8 +71387,8 @@ function IframeAppShell(_ref) {
|
|
|
70839
71387
|
var appAuthName = resolveAppAuthName(getAppName(), function (key) {
|
|
70840
71388
|
return storage$1.getLocalItem(key);
|
|
70841
71389
|
});
|
|
70842
|
-
var key = permissionKey || (appAuthName ? "".concat(appAuthName, ":permissions") :
|
|
70843
|
-
var ready = Array.isArray(storage$1.getLocalItem(key));
|
|
71390
|
+
var key = permissionKey || (appAuthName ? "".concat(appAuthName, ":permissions") : null);
|
|
71391
|
+
var ready = !key || Array.isArray(storage$1.getLocalItem(key));
|
|
70844
71392
|
React.useEffect(function () {
|
|
70845
71393
|
if (ready && onPermissionsReady) onPermissionsReady();
|
|
70846
71394
|
}, [ready, onPermissionsReady]);
|
|
@@ -82436,6 +82984,7 @@ var index_es = /*#__PURE__*/Object.freeze({
|
|
|
82436
82984
|
});
|
|
82437
82985
|
|
|
82438
82986
|
exports.AppFrame = AppFrame;
|
|
82987
|
+
exports.AppLink = AppLink;
|
|
82439
82988
|
exports.AutoRefresh = AutoRefresh;
|
|
82440
82989
|
exports.CallLogger = CallLogger;
|
|
82441
82990
|
exports.ContextualHelp = ContextualHelp;
|
|
@@ -82447,6 +82996,7 @@ exports.bootstrapIframeApp = bootstrapIframeApp;
|
|
|
82447
82996
|
exports.buildNavCountEntry = buildNavCountEntry;
|
|
82448
82997
|
exports.fetcher = fetcher$1;
|
|
82449
82998
|
exports.iframeFacade = iframeFacade;
|
|
82999
|
+
exports.installNavigationGuard = installNavigationGuard;
|
|
82450
83000
|
exports.normalizeIframePath = normalizeIframePath;
|
|
82451
83001
|
exports.postHistoryGo = postHistoryGo;
|
|
82452
83002
|
exports.storage = storage$2;
|