@livetiles/reach-components-react 0.4.0-preview.293 → 0.4.0-preview.296
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/SearchFilter.d.ts +2 -0
- package/en.async.esm.esm.js +45 -0
- package/index.d.ts +3 -1
- package/index.esm.js +1 -1
- package/index.esm2.js +501 -585
- package/index.umd.js +546 -584
- package/package.json +1 -1
package/index.esm2.js
CHANGED
|
@@ -7956,7 +7956,7 @@ var Stringify = stringify$4;
|
|
|
7956
7956
|
var Parse = parse$5;
|
|
7957
7957
|
|
|
7958
7958
|
|
|
7959
|
-
var lib$
|
|
7959
|
+
var lib$4 = {
|
|
7960
7960
|
stringify: Stringify,
|
|
7961
7961
|
parse: Parse
|
|
7962
7962
|
};
|
|
@@ -7969,7 +7969,7 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
7969
7969
|
|
|
7970
7970
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
7971
7971
|
|
|
7972
|
-
var _qs = lib$
|
|
7972
|
+
var _qs = lib$4;
|
|
7973
7973
|
|
|
7974
7974
|
var _qs2 = _interopRequireDefault(_qs);
|
|
7975
7975
|
|
|
@@ -8597,7 +8597,7 @@ function createVersionParts(count) {
|
|
|
8597
8597
|
return output;
|
|
8598
8598
|
}
|
|
8599
8599
|
|
|
8600
|
-
var lib$
|
|
8600
|
+
var lib$3 = {exports: {}};
|
|
8601
8601
|
|
|
8602
8602
|
/**
|
|
8603
8603
|
* The code was extracted from:
|
|
@@ -8681,7 +8681,7 @@ function InvalidTokenError(message) {
|
|
|
8681
8681
|
InvalidTokenError.prototype = new Error();
|
|
8682
8682
|
InvalidTokenError.prototype.name = 'InvalidTokenError';
|
|
8683
8683
|
|
|
8684
|
-
lib$
|
|
8684
|
+
lib$3.exports = function (token,options) {
|
|
8685
8685
|
if (typeof token !== 'string') {
|
|
8686
8686
|
throw new InvalidTokenError('Invalid token specified');
|
|
8687
8687
|
}
|
|
@@ -8695,9 +8695,9 @@ lib$4.exports = function (token,options) {
|
|
|
8695
8695
|
}
|
|
8696
8696
|
};
|
|
8697
8697
|
|
|
8698
|
-
lib$
|
|
8698
|
+
lib$3.exports.InvalidTokenError = InvalidTokenError;
|
|
8699
8699
|
|
|
8700
|
-
var jwtDecode = lib$
|
|
8700
|
+
var jwtDecode = lib$3.exports;
|
|
8701
8701
|
|
|
8702
8702
|
var moment$1 = {exports: {}};
|
|
8703
8703
|
|
|
@@ -48388,7 +48388,7 @@ function __makeTemplateObject$k(cooked, raw) {
|
|
|
48388
48388
|
return cooked;
|
|
48389
48389
|
}
|
|
48390
48390
|
|
|
48391
|
-
var FocusStyles = createGlobalStyle(templateObject_1$4$3 || (templateObject_1$4$3 = __makeTemplateObject$k(["\n // focus style should be visible only when keyboard navigation is activated\n // office ui fabric adds 'ms-Fabric--isFocusVisible' when the user presses keyboard keys, and removes it when the user clicks a mouse button\n\n .ms-Fabric--isFocusVisible .lt-reach {\n a:not(.ms-Button):focus,\n div[data-is-focusable]:not(.ms-PickerPersona-container):focus {\n box-shadow: none;\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n\n div[data-is-focusable][role=\"listbox\"]:focus,\n div[data-is-focusable].ms-Dropdown:focus {\n &::after {\n border: 0;\n }\n }\n\n a[data-round-outline='true']:focus {\n border-radius: 20px;\n }\n\n button:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 2px;\n inset: 0;\n }\n }\n\n button[data-round-outline='true']:focus {\n &::after {\n border-radius: 50%;\n }\n }\n\n button[data-toggle-button='true']:focus {\n &::after {\n border: none;\n border-radius: 12px;\n outline-offset: 3px;\n }\n }\n\n a[data-clickable-overlay]:focus {\n outline: 0 !important;\n\n &::before {\n outline: 2px solid ", ";\n outline-offset: 5px;\n }\n }\n\n input[type='checkbox']:focus + label::before {\n outline: 2px solid ", ";\n }\n\n div.ms-Dropdown-item input[type='checkbox']:focus + label::before,\n button.ms-Dropdown-item:focus::after {\n outline-offset: -2px;\n }\n\n div.ms-ChoiceField-wrapper.is-inFocus {\n &::after {\n outline: 2px solid ", ";\n border: 0;\n }\n }\n\n .ms-SearchBox-clearButton button:focus::after {\n outline-offset: -4px;\n }\n\n .ms-PickerPersona-container:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 0;\n }\n }\n }\n\n .ms-Fabric--isFocusVisible .lt-reach-
|
|
48391
|
+
var FocusStyles = createGlobalStyle(templateObject_1$4$3 || (templateObject_1$4$3 = __makeTemplateObject$k(["\n // focus style should be visible only when keyboard navigation is activated\n // office ui fabric adds 'ms-Fabric--isFocusVisible' when the user presses keyboard keys, and removes it when the user clicks a mouse button\n\n .ms-Fabric--isFocusVisible .lt-reach {\n a:not(.ms-Button):focus,\n div[data-is-focusable]:not(.ms-PickerPersona-container):focus {\n box-shadow: none;\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n\n div[data-is-focusable][role=\"listbox\"]:focus,\n div[data-is-focusable].ms-Dropdown:focus {\n &::after {\n border: 0;\n }\n }\n\n a[data-round-outline='true']:focus {\n border-radius: 20px;\n }\n\n button:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 2px;\n inset: 0;\n }\n }\n\n button[data-round-outline='true']:focus {\n &::after {\n border-radius: 50%;\n }\n }\n\n button[data-toggle-button='true']:focus {\n &::after {\n border: none;\n border-radius: 12px;\n outline-offset: 3px;\n }\n }\n\n a[data-clickable-overlay]:focus {\n outline: 0 !important;\n\n &::before {\n outline: 2px solid ", ";\n outline-offset: 5px;\n }\n }\n\n input[type='checkbox']:focus + label::before {\n outline: 2px solid ", ";\n }\n\n div.ms-Dropdown-item input[type='checkbox']:focus + label::before,\n button.ms-Dropdown-item:focus::after {\n outline-offset: -2px;\n }\n\n div.ms-ChoiceField-wrapper.is-inFocus {\n &::after {\n outline: 2px solid ", ";\n border: 0;\n }\n }\n\n .ms-SearchBox-clearButton button:focus::after {\n outline-offset: -4px;\n }\n\n .ms-PickerPersona-container:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 0;\n }\n }\n }\n\n .ms-Fabric--isFocusVisible .lt-reach-contextual-menu {\n button:focus {\n &::after {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: -2px;\n }\n }\n }\n"], ["\n // focus style should be visible only when keyboard navigation is activated\n // office ui fabric adds 'ms-Fabric--isFocusVisible' when the user presses keyboard keys, and removes it when the user clicks a mouse button\n\n .ms-Fabric--isFocusVisible .lt-reach {\n a:not(.ms-Button):focus,\n div[data-is-focusable]:not(.ms-PickerPersona-container):focus {\n box-shadow: none;\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n\n div[data-is-focusable][role=\"listbox\"]:focus,\n div[data-is-focusable].ms-Dropdown:focus {\n &::after {\n border: 0;\n }\n }\n\n a[data-round-outline='true']:focus {\n border-radius: 20px;\n }\n\n button:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 2px;\n inset: 0;\n }\n }\n\n button[data-round-outline='true']:focus {\n &::after {\n border-radius: 50%;\n }\n }\n\n button[data-toggle-button='true']:focus {\n &::after {\n border: none;\n border-radius: 12px;\n outline-offset: 3px;\n }\n }\n\n a[data-clickable-overlay]:focus {\n outline: 0 !important;\n\n &::before {\n outline: 2px solid ", ";\n outline-offset: 5px;\n }\n }\n\n input[type='checkbox']:focus + label::before {\n outline: 2px solid ", ";\n }\n\n div.ms-Dropdown-item input[type='checkbox']:focus + label::before,\n button.ms-Dropdown-item:focus::after {\n outline-offset: -2px;\n }\n\n div.ms-ChoiceField-wrapper.is-inFocus {\n &::after {\n outline: 2px solid ", ";\n border: 0;\n }\n }\n\n .ms-SearchBox-clearButton button:focus::after {\n outline-offset: -4px;\n }\n\n .ms-PickerPersona-container:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 0;\n }\n }\n }\n\n .ms-Fabric--isFocusVisible .lt-reach-contextual-menu {\n button:focus {\n &::after {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: -2px;\n }\n }\n }\n"])), function (p) {
|
|
48392
48392
|
return p.theme.palette.accent;
|
|
48393
48393
|
}, function (p) {
|
|
48394
48394
|
return p.theme.palette.accent;
|
|
@@ -55141,12 +55141,12 @@ var ToastNotificationHost = function ToastNotificationHost() {
|
|
|
55141
55141
|
}, void 0);
|
|
55142
55142
|
};
|
|
55143
55143
|
|
|
55144
|
-
var ToastGlobalStyles = createGlobalStyle(templateObject_3$
|
|
55144
|
+
var ToastGlobalStyles = createGlobalStyle(templateObject_3$1g || (templateObject_3$1g = __makeTemplateObject$k(["\n .lt-reach .Toastify .Toastify__toast-container {\n ", "\n\n ", "\n }\n\n .Toastify {\n .Toastify__toast-container {\n // This allows us to have wider toasts that do not wrap too soon.\n // Toastify itself will add responsive design at 480px and span the\n // toast the full width...\n max-width: 540px;\n width: auto;\n z-index: 1000001;\n\n @media (max-width: 480px) {\n padding: 0 10px !important;\n }\n }\n\n .Toastify__toast-body {\n display: flex;\n flex: 1 1 540px;\n height: 100%;\n justify-content: center;\n flex-direction: column;\n // IE fix: this is a default value from Toastify but doesn't work properly unless added here too\n min-height: 48px;\n }\n }\n"], ["\n .lt-reach .Toastify .Toastify__toast-container {\n ", "\n\n ", "\n }\n\n .Toastify {\n .Toastify__toast-container {\n // This allows us to have wider toasts that do not wrap too soon.\n // Toastify itself will add responsive design at 480px and span the\n // toast the full width...\n max-width: 540px;\n width: auto;\n z-index: 1000001;\n\n @media (max-width: 480px) {\n padding: 0 10px !important;\n }\n }\n\n .Toastify__toast-body {\n display: flex;\n flex: 1 1 540px;\n height: 100%;\n justify-content: center;\n flex-direction: column;\n // IE fix: this is a default value from Toastify but doesn't work properly unless added here too\n min-height: 48px;\n }\n }\n"])), function (p) {
|
|
55145
55145
|
return !p.chromeless && css$2(templateObject_1$2J || (templateObject_1$2J = __makeTemplateObject$k(["\n top: 4em;\n "], ["\n top: 4em;\n "])));
|
|
55146
55146
|
}, function (p) {
|
|
55147
55147
|
return p.chromeless && css$2(templateObject_2$1Q || (templateObject_2$1Q = __makeTemplateObject$k(["\n @media all and (max-width: ", "px) {\n top: 0.5em;\n right: 0.5em;\n }\n "], ["\n @media all and (max-width: ", "px) {\n top: 0.5em;\n right: 0.5em;\n }\n "])), maxScreenSize.small);
|
|
55148
55148
|
});
|
|
55149
|
-
var templateObject_1$2J, templateObject_2$1Q, templateObject_3$
|
|
55149
|
+
var templateObject_1$2J, templateObject_2$1Q, templateObject_3$1g;
|
|
55150
55150
|
|
|
55151
55151
|
function useKeywordsApi() {
|
|
55152
55152
|
var api = useApi();
|
|
@@ -65307,7 +65307,7 @@ var __importDefault$m = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
65307
65307
|
};
|
|
65308
65308
|
Object.defineProperty(avatar, "__esModule", { value: true });
|
|
65309
65309
|
var styled_1$b = __importDefault$m(require$$0$4);
|
|
65310
|
-
var react_1$
|
|
65310
|
+
var react_1$u = __importStar$d(React__default);
|
|
65311
65311
|
var getSmallAvatar = function (avatar) {
|
|
65312
65312
|
var _a, _b;
|
|
65313
65313
|
if (!avatar)
|
|
@@ -65318,11 +65318,11 @@ var getSmallAvatar = function (avatar) {
|
|
|
65318
65318
|
var Img = styled_1$b.default.img(templateObject_1$2I || (templateObject_1$2I = __makeTemplateObject$j(["\n object-fit: cover;\n width: 32px;\n height: 32px;\n margin-right: 8px;\n"], ["\n object-fit: cover;\n width: 32px;\n height: 32px;\n margin-right: 8px;\n"])));
|
|
65319
65319
|
var Avatar$5 = function (_a) {
|
|
65320
65320
|
var user = _a.user, _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
65321
|
-
var defaultAvatarId = react_1$
|
|
65321
|
+
var defaultAvatarId = react_1$u.useRef(Math.floor(Math.random() * 5) + 1);
|
|
65322
65322
|
var url = user.avatar_url
|
|
65323
65323
|
? getSmallAvatar(user.avatar_url)
|
|
65324
65324
|
: "https://media.giphy.com/avatars/default" + defaultAvatarId.current + ".gif";
|
|
65325
|
-
return react_1$
|
|
65325
|
+
return react_1$u.default.createElement(Img, { src: url, className: className });
|
|
65326
65326
|
};
|
|
65327
65327
|
avatar.default = Avatar$5;
|
|
65328
65328
|
var templateObject_1$2I;
|
|
@@ -65633,17 +65633,17 @@ var __importDefault$l = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
65633
65633
|
};
|
|
65634
65634
|
Object.defineProperty(verifiedBadge, "__esModule", { value: true });
|
|
65635
65635
|
var js_brand_1$6 = dist$2;
|
|
65636
|
-
var react_1$
|
|
65636
|
+
var react_1$t = __importDefault$l(React__default);
|
|
65637
65637
|
var VerifiedBadge = function (_a) {
|
|
65638
65638
|
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 17 : _c, _d = _a.fill, fill = _d === void 0 ? '#15CDFF' : _d;
|
|
65639
|
-
return (react_1$
|
|
65640
|
-
react_1$
|
|
65641
|
-
react_1$
|
|
65642
|
-
react_1$
|
|
65643
|
-
react_1$
|
|
65644
|
-
react_1$
|
|
65645
|
-
react_1$
|
|
65646
|
-
react_1$
|
|
65639
|
+
return (react_1$t.default.createElement("svg", { className: [VerifiedBadge.className, className].join(' '), height: size, width: "19px", viewBox: "0 0 19 17" },
|
|
65640
|
+
react_1$t.default.createElement("path", { className: VerifiedBadge.checkMarkClassName, d: "M9.32727273,9.44126709 L9.32727273,3.03016561 L6.55027155,3.03016561 L6.55027155,10.8150746 L6.55027155,12.188882 L12.1042739,12.188882 L12.1042739,9.44126709 L9.32727273,9.44126709 Z", fill: js_brand_1$6.giphyBlack, transform: "translate(9.327273, 7.609524) scale(-1, 1) rotate(-45.000000) translate(-9.327273, -7.609524) " }),
|
|
65641
|
+
react_1$t.default.createElement("g", { transform: "translate(-532.000000, -466.000000)", fill: fill },
|
|
65642
|
+
react_1$t.default.createElement("g", { transform: "translate(141.000000, 235.000000)" },
|
|
65643
|
+
react_1$t.default.createElement("g", { transform: "translate(264.000000, 0.000000)" },
|
|
65644
|
+
react_1$t.default.createElement("g", { transform: "translate(10.000000, 224.000000)" },
|
|
65645
|
+
react_1$t.default.createElement("g", { transform: "translate(114.000000, 2.500000)" },
|
|
65646
|
+
react_1$t.default.createElement("path", { d: "M15.112432,4.80769231 L16.8814194,6.87556817 L19.4157673,7.90116318 L19.6184416,10.6028916 L21.0594951,12.9065042 L19.6184416,15.2101168 L19.4157673,17.9118452 L16.8814194,18.9374402 L15.112432,21.0053161 L12.4528245,20.3611511 L9.79321699,21.0053161 L8.02422954,18.9374402 L5.48988167,17.9118452 L5.28720734,15.2101168 L3.84615385,12.9065042 L5.28720734,10.6028916 L5.48988167,7.90116318 L8.02422954,6.87556817 L9.79321699,4.80769231 L12.4528245,5.4518573 L15.112432,4.80769231 Z M17.8163503,10.8991009 L15.9282384,9.01098901 L11.5681538,13.3696923 L9.68115218,11.4818515 L7.81302031,13.3499833 L9.7011322,15.2380952 L11.5892441,17.1262071 L17.8163503,10.8991009 Z" }))))))));
|
|
65647
65647
|
};
|
|
65648
65648
|
VerifiedBadge.className = 'giphy-verified-badge';
|
|
65649
65649
|
VerifiedBadge.checkMarkClassName = 'giphy-verified-checkmark';
|
|
@@ -65686,7 +65686,7 @@ var __importDefault$k = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
65686
65686
|
};
|
|
65687
65687
|
Object.defineProperty(attribution$1, "__esModule", { value: true });
|
|
65688
65688
|
var styled_1$a = __importDefault$k(require$$0$4);
|
|
65689
|
-
var react_1$
|
|
65689
|
+
var react_1$s = __importDefault$k(React__default);
|
|
65690
65690
|
var avatar_1$3 = __importDefault$k(avatar);
|
|
65691
65691
|
var user_1$1 = __importDefault$k(user);
|
|
65692
65692
|
var Container$b = styled_1$a.default.div(templateObject_1$2G || (templateObject_1$2G = __makeTemplateObject$h(["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n"], ["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n"])));
|
|
@@ -65697,7 +65697,7 @@ var Attribution$2 = function (_a) {
|
|
|
65697
65697
|
if (!(user === null || user === void 0 ? void 0 : user.username) && !(user === null || user === void 0 ? void 0 : user.display_name)) {
|
|
65698
65698
|
return null;
|
|
65699
65699
|
}
|
|
65700
|
-
return (react_1$
|
|
65700
|
+
return (react_1$s.default.createElement(Container$b, { className: [Attribution$2.className, className].join(' '), onClick: function (e) {
|
|
65701
65701
|
e.preventDefault();
|
|
65702
65702
|
e.stopPropagation();
|
|
65703
65703
|
if (onClick) {
|
|
@@ -65709,8 +65709,8 @@ var Attribution$2 = function (_a) {
|
|
|
65709
65709
|
window.open(url, '_blank');
|
|
65710
65710
|
}
|
|
65711
65711
|
} },
|
|
65712
|
-
react_1$
|
|
65713
|
-
react_1$
|
|
65712
|
+
react_1$s.default.createElement(Avatar$4, { user: user }),
|
|
65713
|
+
react_1$s.default.createElement(user_1$1.default, { user: gif.user })));
|
|
65714
65714
|
};
|
|
65715
65715
|
Attribution$2.className = 'giphy-attribution';
|
|
65716
65716
|
attribution$1.default = Attribution$2;
|
|
@@ -65746,24 +65746,24 @@ var __importDefault$j = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
65746
65746
|
};
|
|
65747
65747
|
Object.defineProperty(overlay, "__esModule", { value: true });
|
|
65748
65748
|
var styled_1$9 = __importDefault$j(require$$0$4);
|
|
65749
|
-
var react_1$
|
|
65749
|
+
var react_1$r = __importStar$c(React__default);
|
|
65750
65750
|
var _1$1 = __importDefault$j(attribution$1);
|
|
65751
65751
|
var Background = styled_1$9.default.div(templateObject_1$2F || (templateObject_1$2F = __makeTemplateObject$g(["\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n cursor: default;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 75px;\n pointer-events: none;\n"], ["\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n cursor: default;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 75px;\n pointer-events: none;\n"])));
|
|
65752
65752
|
var Attribution$1 = styled_1$9.default(_1$1.default)(templateObject_2$1N || (templateObject_2$1N = __makeTemplateObject$g(["\n position: absolute;\n bottom: 10px;\n left: 10px;\n right: 10px;\n"], ["\n position: absolute;\n bottom: 10px;\n left: 10px;\n right: 10px;\n"])));
|
|
65753
|
-
var Container$a = styled_1$9.default.div(templateObject_3$
|
|
65753
|
+
var Container$a = styled_1$9.default.div(templateObject_3$1f || (templateObject_3$1f = __makeTemplateObject$g(["\n transition: opacity 150ms ease-in;\n"], ["\n transition: opacity 150ms ease-in;\n"])));
|
|
65754
65754
|
var AttributionOverlay = function (_a) {
|
|
65755
65755
|
var gif = _a.gif, isHovered = _a.isHovered, onClick = _a.onClick;
|
|
65756
|
-
var hasHovered = react_1$
|
|
65756
|
+
var hasHovered = react_1$r.useRef(isHovered);
|
|
65757
65757
|
if (isHovered) {
|
|
65758
65758
|
// not rendering to avoid loading the avatar until hover
|
|
65759
65759
|
hasHovered.current = true;
|
|
65760
65760
|
}
|
|
65761
|
-
return gif.user && hasHovered.current ? (react_1$
|
|
65762
|
-
react_1$
|
|
65763
|
-
react_1$
|
|
65761
|
+
return gif.user && hasHovered.current ? (react_1$r.default.createElement(Container$a, { style: { opacity: isHovered ? 1 : 0 } },
|
|
65762
|
+
react_1$r.default.createElement(Background, null),
|
|
65763
|
+
react_1$r.default.createElement(Attribution$1, { gif: gif, onClick: onClick }))) : null;
|
|
65764
65764
|
};
|
|
65765
65765
|
overlay.default = AttributionOverlay;
|
|
65766
|
-
var templateObject_1$2F, templateObject_2$1N, templateObject_3$
|
|
65766
|
+
var templateObject_1$2F, templateObject_2$1N, templateObject_3$1f;
|
|
65767
65767
|
|
|
65768
65768
|
var carousel = {};
|
|
65769
65769
|
|
|
@@ -67715,7 +67715,7 @@ var stringify = stringify_1;
|
|
|
67715
67715
|
var parse = parse$1;
|
|
67716
67716
|
var formats = formats$3;
|
|
67717
67717
|
|
|
67718
|
-
var lib$
|
|
67718
|
+
var lib$2 = {
|
|
67719
67719
|
formats: formats,
|
|
67720
67720
|
parse: parse,
|
|
67721
67721
|
stringify: stringify
|
|
@@ -67983,7 +67983,7 @@ Object.defineProperty(api, "__esModule", { value: true });
|
|
|
67983
67983
|
api.GiphyFetch = void 0;
|
|
67984
67984
|
/* eslint-disable no-dupe-class-members */
|
|
67985
67985
|
var js_util_1$8 = dist$3;
|
|
67986
|
-
var qs_1 = __importDefault$i(lib$
|
|
67986
|
+
var qs_1 = __importDefault$i(lib$2);
|
|
67987
67987
|
var gif_1$2 = gif$1;
|
|
67988
67988
|
var request_1 = __importDefault$i(request);
|
|
67989
67989
|
var getType = function (options) { return (options && options.type ? options.type : 'gifs'); };
|
|
@@ -68482,11 +68482,11 @@ var __importStar$b = (commonjsGlobal$7 && commonjsGlobal$7.__importStar) || func
|
|
|
68482
68482
|
return result;
|
|
68483
68483
|
};
|
|
68484
68484
|
Object.defineProperty(observer, "__esModule", { value: true });
|
|
68485
|
-
var react_1$
|
|
68485
|
+
var react_1$q = __importStar$b(React__default);
|
|
68486
68486
|
var Observer$1 = function (_a) {
|
|
68487
68487
|
var children = _a.children, className = _a.className, onVisibleChange = _a.onVisibleChange, config = _a.config;
|
|
68488
|
-
var container = react_1$
|
|
68489
|
-
react_1$
|
|
68488
|
+
var container = react_1$q.useRef(null);
|
|
68489
|
+
react_1$q.useEffect(function () {
|
|
68490
68490
|
var io;
|
|
68491
68491
|
if (container.current) {
|
|
68492
68492
|
io = new IntersectionObserver(function (_a) {
|
|
@@ -68498,7 +68498,7 @@ var Observer$1 = function (_a) {
|
|
|
68498
68498
|
}
|
|
68499
68499
|
return function () { return io === null || io === void 0 ? void 0 : io.disconnect(); };
|
|
68500
68500
|
}, [onVisibleChange, container, config]);
|
|
68501
|
-
return (react_1$
|
|
68501
|
+
return (react_1$q.default.createElement("div", { ref: container, className: className }, children));
|
|
68502
68502
|
};
|
|
68503
68503
|
observer.default = Observer$1;
|
|
68504
68504
|
|
|
@@ -69024,14 +69024,14 @@ Object.defineProperty(carousel, "__esModule", { value: true });
|
|
|
69024
69024
|
var styled_1$8 = __importDefault$f(require$$0$4);
|
|
69025
69025
|
var js_fetch_api_1$1 = dist$1;
|
|
69026
69026
|
var js_util_1$3 = dist$3;
|
|
69027
|
-
var react_1$
|
|
69027
|
+
var react_1$p = __importStar$a(React__default);
|
|
69028
69028
|
var throttle_debounce_1$1 = cjs;
|
|
69029
69029
|
var observer_1$1 = __importDefault$f(observer);
|
|
69030
69030
|
var gif_1$1 = __importDefault$f(gif);
|
|
69031
69031
|
var pingback_context_manager_1$1 = __importDefault$f(pingbackContextManager);
|
|
69032
69032
|
var Container$9 = styled_1$8.default.div(templateObject_1$2E || (templateObject_1$2E = __makeTemplateObject$f(["\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n position: relative;\n"], ["\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n position: relative;\n"])));
|
|
69033
69033
|
var Gif = styled_1$8.default(gif_1$1.default)(templateObject_2$1M || (templateObject_2$1M = __makeTemplateObject$f(["\n position: relative;\n display: inline-block;\n list-style: none;\n margin-left: ", "px;\n /* make sure gifs are fully visible with a scrollbar */\n margin-bottom: 1px;\n\n &:first-of-type {\n margin-left: 0;\n }\n .", " {\n position: absolute;\n top: 0;\n left: 0;\n }\n"], ["\n position: relative;\n display: inline-block;\n list-style: none;\n margin-left: ", "px;\n /* make sure gifs are fully visible with a scrollbar */\n margin-bottom: 1px;\n\n &:first-of-type {\n margin-left: 0;\n }\n .", " {\n position: absolute;\n top: 0;\n left: 0;\n }\n"])), function (props) { return props.ml; }, gif_1$1.default.imgClassName);
|
|
69034
|
-
var Observer = styled_1$8.default(observer_1$1.default)(templateObject_3$
|
|
69034
|
+
var Observer = styled_1$8.default(observer_1$1.default)(templateObject_3$1e || (templateObject_3$1e = __makeTemplateObject$f(["\n display: inline-block;\n"], ["\n display: inline-block;\n"])));
|
|
69035
69035
|
var Loader$2 = styled_1$8.default.div(templateObject_4$Q || (templateObject_4$Q = __makeTemplateObject$f(["\n width: 30px;\n display: inline-block;\n opacity: ", ";\n height: ", "px;\n"], ["\n width: 30px;\n display: inline-block;\n opacity: ", ";\n height: ", "px;\n"])), function (props) { return (props.isFirstLoad ? 0 : 1); }, function (props) { return props.height; });
|
|
69036
69036
|
var defaultProps$1 = Object.freeze({ gutter: 6, user: {}, initialGifs: [] });
|
|
69037
69037
|
var initialState$2 = Object.freeze({
|
|
@@ -69105,22 +69105,22 @@ var Carousel$1 = /** @class */ (function (_super) {
|
|
|
69105
69105
|
var _d = this.state, gifs = _d.gifs, isDoneFetching = _d.isDoneFetching;
|
|
69106
69106
|
var showLoader = !isDoneFetching;
|
|
69107
69107
|
var isFirstLoad = gifs.length === 0;
|
|
69108
|
-
return (react_1$
|
|
69109
|
-
react_1$
|
|
69108
|
+
return (react_1$p.default.createElement(pingback_context_manager_1$1.default, { attributes: { layout_type: 'CAROUSEL' } },
|
|
69109
|
+
react_1$p.default.createElement(Container$9, { className: className },
|
|
69110
69110
|
gifs.map(function (gif) {
|
|
69111
69111
|
var gifWidth = js_util_1$3.getGifWidth(gif, gifHeight);
|
|
69112
|
-
return (react_1$
|
|
69112
|
+
return (react_1$p.default.createElement(Gif, { gif: gif, key: gif.id, tabIndex: tabIndex, width: gifWidth, onGifClick: onGifClick, onGifSeen: onGifSeen, onGifVisible: onGifVisible, onGifRightClick: onGifRightClick, user: user, ml: gutter, overlay: overlay, hideAttribution: hideAttribution, noLink: noLink, borderRadius: borderRadius, backgroundColor: backgroundColor }));
|
|
69113
69113
|
}),
|
|
69114
69114
|
!showLoader && gifs.length === 0 && noResultsMessage,
|
|
69115
|
-
showLoader && (react_1$
|
|
69116
|
-
react_1$
|
|
69115
|
+
showLoader && (react_1$p.default.createElement(Observer, { onVisibleChange: this.onLoaderVisible, config: loaderConfig },
|
|
69116
|
+
react_1$p.default.createElement(Loader$2, { isFirstLoad: isFirstLoad, height: gifHeight }))))));
|
|
69117
69117
|
};
|
|
69118
69118
|
Carousel.className = 'giphy-carousel';
|
|
69119
69119
|
Carousel.defaultProps = defaultProps$1;
|
|
69120
69120
|
return Carousel;
|
|
69121
|
-
}(react_1$
|
|
69121
|
+
}(react_1$p.PureComponent));
|
|
69122
69122
|
carousel.default = Carousel$1;
|
|
69123
|
-
var templateObject_1$2E, templateObject_2$1M, templateObject_3$
|
|
69123
|
+
var templateObject_1$2E, templateObject_2$1M, templateObject_3$1e, templateObject_4$Q;
|
|
69124
69124
|
|
|
69125
69125
|
var grid = {};
|
|
69126
69126
|
|
|
@@ -69136,13 +69136,13 @@ var __importDefault$e = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69136
69136
|
Object.defineProperty(fetchError, "__esModule", { value: true });
|
|
69137
69137
|
var styled_1$7 = __importDefault$e(require$$0$4);
|
|
69138
69138
|
var js_brand_1$5 = dist$2;
|
|
69139
|
-
var react_1$
|
|
69139
|
+
var react_1$o = __importDefault$e(React__default);
|
|
69140
69140
|
var Message$1 = styled_1$7.default.div(templateObject_1$2D || (templateObject_1$2D = __makeTemplateObject$e(["\n color: ", ";\n display: flex;\n justify-content: center;\n margin: 30px 0;\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n a {\n color: ", ";\n cursor: pointer;\n &:hover {\n color: white;\n }\n }\n"], ["\n color: ", ";\n display: flex;\n justify-content: center;\n margin: 30px 0;\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n a {\n color: ", ";\n cursor: pointer;\n &:hover {\n color: white;\n }\n }\n"])), js_brand_1$5.giphyLightGrey, js_brand_1$5.fontFamily.body, js_brand_1$5.giphyBlue);
|
|
69141
69141
|
var FetchError = function (_a) {
|
|
69142
69142
|
var onClick = _a.onClick;
|
|
69143
|
-
return (react_1$
|
|
69143
|
+
return (react_1$o.default.createElement(Message$1, null,
|
|
69144
69144
|
"Error loading GIFs.\u00A0",
|
|
69145
|
-
react_1$
|
|
69145
|
+
react_1$o.default.createElement("a", { onClick: onClick }, "Try again?")));
|
|
69146
69146
|
};
|
|
69147
69147
|
fetchError.default = FetchError;
|
|
69148
69148
|
var templateObject_1$2D;
|
|
@@ -69160,21 +69160,21 @@ Object.defineProperty(loader, "__esModule", { value: true });
|
|
|
69160
69160
|
var core_1$4 = require$$0$1;
|
|
69161
69161
|
var styled_1$6 = __importDefault$d(require$$0$4);
|
|
69162
69162
|
var js_brand_1$4 = dist$2;
|
|
69163
|
-
var react_1$
|
|
69163
|
+
var react_1$n = __importDefault$d(React__default);
|
|
69164
69164
|
var bouncer = core_1$4.keyframes(templateObject_1$2C || (templateObject_1$2C = __makeTemplateObject$d(["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"], ["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"])));
|
|
69165
69165
|
var loaderHeight = 37;
|
|
69166
69166
|
var Loader$1 = styled_1$6.default.div(templateObject_2$1L || (templateObject_2$1L = __makeTemplateObject$d(["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n"], ["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n"])), loaderHeight);
|
|
69167
|
-
var Dot = styled_1$6.default.div(templateObject_3$
|
|
69167
|
+
var Dot = styled_1$6.default.div(templateObject_3$1d || (templateObject_3$1d = __makeTemplateObject$d(["\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n background: ", ";\n animation-delay: ", ";\n"], ["\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n background: ", ";\n animation-delay: ", ";\n"])), loaderHeight, bouncer, function (props) { return props.color; }, function (props) { return props.delay; });
|
|
69168
69168
|
loader.default = (function (_a) {
|
|
69169
69169
|
var _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
69170
|
-
return (react_1$
|
|
69171
|
-
react_1$
|
|
69172
|
-
react_1$
|
|
69173
|
-
react_1$
|
|
69174
|
-
react_1$
|
|
69175
|
-
react_1$
|
|
69170
|
+
return (react_1$n.default.createElement(Loader$1, { className: className },
|
|
69171
|
+
react_1$n.default.createElement(Dot, { color: js_brand_1$4.giphyGreen, delay: "0" }),
|
|
69172
|
+
react_1$n.default.createElement(Dot, { color: js_brand_1$4.giphyBlue, delay: ".1s" }),
|
|
69173
|
+
react_1$n.default.createElement(Dot, { color: js_brand_1$4.giphyPurple, delay: ".2s" }),
|
|
69174
|
+
react_1$n.default.createElement(Dot, { color: js_brand_1$4.giphyRed, delay: ".3s" }),
|
|
69175
|
+
react_1$n.default.createElement(Dot, { color: js_brand_1$4.giphyYellow, delay: ".4s" })));
|
|
69176
69176
|
});
|
|
69177
|
-
var templateObject_1$2C, templateObject_2$1L, templateObject_3$
|
|
69177
|
+
var templateObject_1$2C, templateObject_2$1L, templateObject_3$1d;
|
|
69178
69178
|
|
|
69179
69179
|
var masonryGrid = {};
|
|
69180
69180
|
|
|
@@ -69198,7 +69198,7 @@ var __importStar$9 = (commonjsGlobal$7 && commonjsGlobal$7.__importStar) || func
|
|
|
69198
69198
|
return result;
|
|
69199
69199
|
};
|
|
69200
69200
|
Object.defineProperty(masonryGrid, "__esModule", { value: true });
|
|
69201
|
-
var react_1$
|
|
69201
|
+
var react_1$m = __importStar$9(React__default);
|
|
69202
69202
|
function fillArray(length, columnOffsets) {
|
|
69203
69203
|
if (columnOffsets === void 0) { columnOffsets = []; }
|
|
69204
69204
|
return Array.apply(null, Array(length)).map(function (_, index) { return columnOffsets[index] || 0; });
|
|
@@ -69209,7 +69209,7 @@ var MasonryGrid = function (_a) {
|
|
|
69209
69209
|
function getChildren() {
|
|
69210
69210
|
var columnTarget;
|
|
69211
69211
|
var columnHeights = fillArray(columns, columnOffsets);
|
|
69212
|
-
var result = react_1$
|
|
69212
|
+
var result = react_1$m.default.Children.map(children, function (child, index) {
|
|
69213
69213
|
var style = {
|
|
69214
69214
|
position: 'absolute',
|
|
69215
69215
|
};
|
|
@@ -69228,16 +69228,16 @@ var MasonryGrid = function (_a) {
|
|
|
69228
69228
|
if (height) {
|
|
69229
69229
|
columnHeights[columnTarget] += height + gutter;
|
|
69230
69230
|
}
|
|
69231
|
-
return react_1$
|
|
69231
|
+
return react_1$m.default.cloneElement(child, { style: style });
|
|
69232
69232
|
});
|
|
69233
69233
|
containerStyle.position = 'relative';
|
|
69234
69234
|
containerStyle.width = columns * itemWidth + (columns - 1) * gutter + "px";
|
|
69235
69235
|
containerStyle.height = Math.max.apply(Math, columnHeights) - gutter + "px";
|
|
69236
69236
|
return result;
|
|
69237
69237
|
}
|
|
69238
|
-
return react_1$
|
|
69238
|
+
return react_1$m.default.createElement("div", { style: containerStyle }, getChildren());
|
|
69239
69239
|
};
|
|
69240
|
-
masonryGrid.default = react_1$
|
|
69240
|
+
masonryGrid.default = react_1$m.memo(MasonryGrid);
|
|
69241
69241
|
|
|
69242
69242
|
var __makeTemplateObject$c = (commonjsGlobal$7 && commonjsGlobal$7.__makeTemplateObject) || function (cooked, raw) {
|
|
69243
69243
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
@@ -69331,7 +69331,7 @@ Object.defineProperty(grid, "__esModule", { value: true });
|
|
|
69331
69331
|
var styled_1$5 = __importDefault$c(require$$0$4);
|
|
69332
69332
|
var js_fetch_api_1 = dist$1;
|
|
69333
69333
|
var js_util_1$2 = dist$3;
|
|
69334
|
-
var react_1$
|
|
69334
|
+
var react_1$l = __importStar$8(React__default);
|
|
69335
69335
|
var throttle_debounce_1 = cjs;
|
|
69336
69336
|
var observer_1 = __importDefault$c(observer);
|
|
69337
69337
|
var fetch_error_1 = __importDefault$c(fetchError);
|
|
@@ -69421,13 +69421,13 @@ var Grid$1 = /** @class */ (function (_super) {
|
|
|
69421
69421
|
var isFirstLoad = gifs.length === 0;
|
|
69422
69422
|
// get the height of each grid item
|
|
69423
69423
|
var itemHeights = gifs.map(function (gif) { return js_util_1$2.getGifHeight(gif, gifWidth); });
|
|
69424
|
-
return (react_1$
|
|
69425
|
-
react_1$
|
|
69426
|
-
react_1$
|
|
69424
|
+
return (react_1$l.default.createElement(pingback_context_manager_1.default, { attributes: { layout_type: layoutType } },
|
|
69425
|
+
react_1$l.default.createElement("div", { className: className, style: { width: width } },
|
|
69426
|
+
react_1$l.default.createElement(masonry_grid_1.default, { itemHeights: itemHeights, useTransform: useTransform, itemWidth: gifWidth, columns: columns, gutter: gutter, columnOffsets: columnOffsets }, gifs.map(function (gif) { return (react_1$l.default.createElement(gif_1.default, { gif: gif, tabIndex: tabIndex, key: gif.id, width: gifWidth, onGifClick: onGifClick, onGifSeen: onGifSeen, onGifVisible: onGifVisible, onGifRightClick: onGifRightClick, user: user, overlay: overlay, backgroundColor: backgroundColor, hideAttribution: hideAttribution, noLink: noLink, borderRadius: borderRadius })); })),
|
|
69427
69427
|
!showLoader && gifs.length === 0 && noResultsMessage,
|
|
69428
|
-
isError ? (react_1$
|
|
69429
|
-
react_1$
|
|
69430
|
-
react_1$
|
|
69428
|
+
isError ? (react_1$l.default.createElement(fetch_error_1.default, { onClick: this.onFetch })) : (showLoader && (react_1$l.default.createElement(observer_1.default, { onVisibleChange: this.onLoaderVisible, config: loaderConfig },
|
|
69429
|
+
react_1$l.default.createElement(Loader, { isFirstLoad: isFirstLoad },
|
|
69430
|
+
react_1$l.default.createElement(LoaderVisual, { className: Grid.loaderClassName }))))))));
|
|
69431
69431
|
};
|
|
69432
69432
|
Grid.className = 'giphy-grid';
|
|
69433
69433
|
Grid.loaderClassName = 'loader';
|
|
@@ -69443,27 +69443,27 @@ var Grid$1 = /** @class */ (function (_super) {
|
|
|
69443
69443
|
return null;
|
|
69444
69444
|
};
|
|
69445
69445
|
return Grid;
|
|
69446
|
-
}(react_1$
|
|
69446
|
+
}(react_1$l.PureComponent));
|
|
69447
69447
|
grid.default = Grid$1;
|
|
69448
69448
|
var templateObject_1$2B;
|
|
69449
69449
|
|
|
69450
69450
|
var searchBar = {};
|
|
69451
69451
|
|
|
69452
|
-
var useDebounce$
|
|
69452
|
+
var useDebounce$3 = {};
|
|
69453
69453
|
|
|
69454
69454
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(_tslib);
|
|
69455
69455
|
|
|
69456
69456
|
var useTimeoutFn$2 = {};
|
|
69457
69457
|
|
|
69458
69458
|
Object.defineProperty(useTimeoutFn$2, "__esModule", { value: true });
|
|
69459
|
-
var react_1$
|
|
69459
|
+
var react_1$k = React__default;
|
|
69460
69460
|
function useTimeoutFn$1(fn, ms) {
|
|
69461
69461
|
if (ms === void 0) { ms = 0; }
|
|
69462
|
-
var ready = react_1$
|
|
69463
|
-
var timeout = react_1$
|
|
69464
|
-
var callback = react_1$
|
|
69465
|
-
var isReady = react_1$
|
|
69466
|
-
var set = react_1$
|
|
69462
|
+
var ready = react_1$k.useRef(false);
|
|
69463
|
+
var timeout = react_1$k.useRef();
|
|
69464
|
+
var callback = react_1$k.useRef(fn);
|
|
69465
|
+
var isReady = react_1$k.useCallback(function () { return ready.current; }, []);
|
|
69466
|
+
var set = react_1$k.useCallback(function () {
|
|
69467
69467
|
ready.current = false;
|
|
69468
69468
|
timeout.current && clearTimeout(timeout.current);
|
|
69469
69469
|
timeout.current = setTimeout(function () {
|
|
@@ -69471,16 +69471,16 @@ function useTimeoutFn$1(fn, ms) {
|
|
|
69471
69471
|
callback.current();
|
|
69472
69472
|
}, ms);
|
|
69473
69473
|
}, [ms]);
|
|
69474
|
-
var clear = react_1$
|
|
69474
|
+
var clear = react_1$k.useCallback(function () {
|
|
69475
69475
|
ready.current = null;
|
|
69476
69476
|
timeout.current && clearTimeout(timeout.current);
|
|
69477
69477
|
}, []);
|
|
69478
69478
|
// update ref when function changes
|
|
69479
|
-
react_1$
|
|
69479
|
+
react_1$k.useEffect(function () {
|
|
69480
69480
|
callback.current = fn;
|
|
69481
69481
|
}, [fn]);
|
|
69482
69482
|
// set on mount, clear on unmount
|
|
69483
|
-
react_1$
|
|
69483
|
+
react_1$k.useEffect(function () {
|
|
69484
69484
|
set();
|
|
69485
69485
|
return clear;
|
|
69486
69486
|
}, [ms]);
|
|
@@ -69488,18 +69488,18 @@ function useTimeoutFn$1(fn, ms) {
|
|
|
69488
69488
|
}
|
|
69489
69489
|
useTimeoutFn$2.default = useTimeoutFn$1;
|
|
69490
69490
|
|
|
69491
|
-
Object.defineProperty(useDebounce$
|
|
69491
|
+
Object.defineProperty(useDebounce$3, "__esModule", { value: true });
|
|
69492
69492
|
var tslib_1$9 = require$$0;
|
|
69493
|
-
var react_1$
|
|
69493
|
+
var react_1$j = React__default;
|
|
69494
69494
|
var useTimeoutFn_1 = tslib_1$9.__importDefault(useTimeoutFn$2);
|
|
69495
|
-
function useDebounce$
|
|
69495
|
+
function useDebounce$2(fn, ms, deps) {
|
|
69496
69496
|
if (ms === void 0) { ms = 0; }
|
|
69497
69497
|
if (deps === void 0) { deps = []; }
|
|
69498
69498
|
var _a = useTimeoutFn_1.default(fn, ms), isReady = _a[0], cancel = _a[1], reset = _a[2];
|
|
69499
|
-
react_1$
|
|
69499
|
+
react_1$j.useEffect(reset, deps);
|
|
69500
69500
|
return [isReady, cancel];
|
|
69501
69501
|
}
|
|
69502
|
-
useDebounce$
|
|
69502
|
+
useDebounce$3.default = useDebounce$2;
|
|
69503
69503
|
|
|
69504
69504
|
var context = {};
|
|
69505
69505
|
|
|
@@ -69608,11 +69608,11 @@ theme.initTheme = initTheme;
|
|
|
69608
69608
|
// DRY but kinda ugly
|
|
69609
69609
|
var getSize = function (theme, includeWidth) {
|
|
69610
69610
|
if (includeWidth === void 0) { includeWidth = false; }
|
|
69611
|
-
return core_1$3.css(templateObject_3$
|
|
69611
|
+
return core_1$3.css(templateObject_3$1c || (templateObject_3$1c = __makeTemplateObject$b(["\n height: ", "px;\n ", ";\n @media (", ") {\n height: ", "px;\n ", ";\n }\n"], ["\n height: ", "px;\n ", ";\n @media (", ") {\n height: ", "px;\n ", ";\n }\n"])), theme.searchbarHeight, includeWidth && core_1$3.css(templateObject_1$2A || (templateObject_1$2A = __makeTemplateObject$b(["\n width: ", "px;\n "], ["\n width: ", "px;\n "])), theme.searchbarHeight), theme.condensedMediaQuery, theme.smallSearchbarHeight, includeWidth && core_1$3.css(templateObject_2$1K || (templateObject_2$1K = __makeTemplateObject$b(["\n width: ", "px;\n "], ["\n width: ", "px;\n "])), theme.smallSearchbarHeight));
|
|
69612
69612
|
};
|
|
69613
69613
|
theme.getSize = getSize;
|
|
69614
69614
|
theme.default = styled_1$4.default;
|
|
69615
|
-
var templateObject_1$2A, templateObject_2$1K, templateObject_3$
|
|
69615
|
+
var templateObject_1$2A, templateObject_2$1K, templateObject_3$1c;
|
|
69616
69616
|
|
|
69617
69617
|
(function (exports) {
|
|
69618
69618
|
var __assign = (commonjsGlobal$7 && commonjsGlobal$7.__assign) || function () {
|
|
@@ -69847,7 +69847,7 @@ var __importDefault$a = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69847
69847
|
Object.defineProperty(searchBarChannel, "__esModule", { value: true });
|
|
69848
69848
|
var core_1$2 = require$$0$1;
|
|
69849
69849
|
var js_brand_1$3 = dist$2;
|
|
69850
|
-
var react_1$
|
|
69850
|
+
var react_1$i = __importStar$7(React__default);
|
|
69851
69851
|
var avatar_1$2 = __importDefault$a(avatar);
|
|
69852
69852
|
var verified_badge_1$1 = __importDefault$a(verifiedBadge);
|
|
69853
69853
|
var context_1$4 = context;
|
|
@@ -69857,21 +69857,21 @@ var channelSearchHeight = function (theme) { return theme.searchbarHeight - chan
|
|
|
69857
69857
|
var smallChannelSearchHeight = function (theme) { return theme.smallSearchbarHeight - 3 * 2; };
|
|
69858
69858
|
var animateAvatar = function (h) { return core_1$2.keyframes(templateObject_1$2z || (templateObject_1$2z = __makeTemplateObject$a(["\nto {\n width: ", "px;\n}\n"], ["\nto {\n width: ", "px;\n}\n"])), h); };
|
|
69859
69859
|
var Avatar$3 = theme_1$4.default(avatar_1$2.default)(templateObject_2$1J || (templateObject_2$1J = __makeTemplateObject$a(["\n height: ", "px;\n margin: 0;\n width: 0;\n animation: ", " 100ms ease-in-out forwards;\n @media (", ") {\n height: ", "px;\n animation: ", " 100ms ease-in-out forwards;\n }\n"], ["\n height: ", "px;\n margin: 0;\n width: 0;\n animation: ", " 100ms ease-in-out forwards;\n @media (", ") {\n height: ", "px;\n animation: ", " 100ms ease-in-out forwards;\n }\n"])), function (props) { return channelSearchHeight(props.theme); }, function (props) { return animateAvatar(channelSearchHeight(props.theme)); }, function (props) { return props.theme.condensedMediaQuery; }, function (props) { return smallChannelSearchHeight(props.theme); }, function (props) { return animateAvatar(smallChannelSearchHeight(props.theme)); });
|
|
69860
|
-
var Username = theme_1$4.default.div(templateObject_3$
|
|
69860
|
+
var Username = theme_1$4.default.div(templateObject_3$1b || (templateObject_3$1b = __makeTemplateObject$a(["\n background: ", ";\n display: flex;\n align-items: center;\n padding-left: ", "px;\n"], ["\n background: ", ";\n display: flex;\n align-items: center;\n padding-left: ", "px;\n"])), function (props) { return (props.theme.mode === 'dark' ? js_brand_1$3.giphyCharcoal : js_brand_1$3.giphyWhite); }, channelMargin);
|
|
69861
69861
|
var UsernamePill = theme_1$4.default.div(templateObject_4$P || (templateObject_4$P = __makeTemplateObject$a(["\n background: ", ";\n display: flex;\n padding: 0 4px;\n color: ", ";\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n font-weight: 600;\n font-size: 12px;\n align-items: center;\n height: ", "px;\n @media (", ") {\n display: none;\n }\n"], ["\n background: ", ";\n display: flex;\n padding: 0 4px;\n color: ", ";\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n font-weight: 600;\n font-size: 12px;\n align-items: center;\n height: ", "px;\n @media (", ") {\n display: none;\n }\n"])), js_brand_1$3.giphyWhiteSmoke, js_brand_1$3.giphyDarkCharcoal, function (props) { return channelSearchHeight(props.theme); }, function (props) { return props.theme.condensedMediaQuery; });
|
|
69862
69862
|
var SearchBarChannel = function (_a) {
|
|
69863
69863
|
var _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
69864
|
-
var activeChannel = react_1$
|
|
69865
|
-
return activeChannel ? (react_1$
|
|
69866
|
-
react_1$
|
|
69867
|
-
react_1$
|
|
69868
|
-
react_1$
|
|
69864
|
+
var activeChannel = react_1$i.useContext(context_1$4.SearchContext).activeChannel;
|
|
69865
|
+
return activeChannel ? (react_1$i.default.createElement(Username, { className: className },
|
|
69866
|
+
react_1$i.default.createElement(Avatar$3, { user: activeChannel.user }),
|
|
69867
|
+
react_1$i.default.createElement(UsernamePill, { key: activeChannel.id },
|
|
69868
|
+
react_1$i.default.createElement("div", null,
|
|
69869
69869
|
"@",
|
|
69870
69870
|
activeChannel.user.username),
|
|
69871
|
-
activeChannel.user.is_verified && react_1$
|
|
69871
|
+
activeChannel.user.is_verified && react_1$i.default.createElement(verified_badge_1$1.default, { size: 14 })))) : null;
|
|
69872
69872
|
};
|
|
69873
69873
|
searchBarChannel.default = SearchBarChannel;
|
|
69874
|
-
var templateObject_1$2z, templateObject_2$1J, templateObject_3$
|
|
69874
|
+
var templateObject_1$2z, templateObject_2$1J, templateObject_3$1b, templateObject_4$P;
|
|
69875
69875
|
|
|
69876
69876
|
var searchButton = {};
|
|
69877
69877
|
|
|
@@ -69882,18 +69882,18 @@ var useUnmount$3 = {};
|
|
|
69882
69882
|
var useEffectOnce$3 = {};
|
|
69883
69883
|
|
|
69884
69884
|
Object.defineProperty(useEffectOnce$3, "__esModule", { value: true });
|
|
69885
|
-
var react_1$
|
|
69885
|
+
var react_1$h = React__default;
|
|
69886
69886
|
var useEffectOnce$2 = function (effect) {
|
|
69887
|
-
react_1$
|
|
69887
|
+
react_1$h.useEffect(effect, []);
|
|
69888
69888
|
};
|
|
69889
69889
|
useEffectOnce$3.default = useEffectOnce$2;
|
|
69890
69890
|
|
|
69891
69891
|
Object.defineProperty(useUnmount$3, "__esModule", { value: true });
|
|
69892
69892
|
var tslib_1$8 = require$$0;
|
|
69893
|
-
var react_1$
|
|
69893
|
+
var react_1$g = React__default;
|
|
69894
69894
|
var useEffectOnce_1 = tslib_1$8.__importDefault(useEffectOnce$3);
|
|
69895
69895
|
var useUnmount$2 = function (fn) {
|
|
69896
|
-
var fnRef = react_1$
|
|
69896
|
+
var fnRef = react_1$g.useRef(fn);
|
|
69897
69897
|
// update the ref each render so if it change the newest callback will be invoked
|
|
69898
69898
|
fnRef.current = fn;
|
|
69899
69899
|
useEffectOnce_1.default(function () { return function () { return fnRef.current(); }; });
|
|
@@ -69902,15 +69902,15 @@ useUnmount$3.default = useUnmount$2;
|
|
|
69902
69902
|
|
|
69903
69903
|
Object.defineProperty(useThrottle$3, "__esModule", { value: true });
|
|
69904
69904
|
var tslib_1$7 = require$$0;
|
|
69905
|
-
var react_1$
|
|
69905
|
+
var react_1$f = React__default;
|
|
69906
69906
|
var useUnmount_1 = tslib_1$7.__importDefault(useUnmount$3);
|
|
69907
69907
|
var useThrottle$2 = function (value, ms) {
|
|
69908
69908
|
if (ms === void 0) { ms = 200; }
|
|
69909
|
-
var _a = react_1$
|
|
69910
|
-
var timeout = react_1$
|
|
69911
|
-
var nextValue = react_1$
|
|
69912
|
-
var hasNextValue = react_1$
|
|
69913
|
-
react_1$
|
|
69909
|
+
var _a = react_1$f.useState(value), state = _a[0], setState = _a[1];
|
|
69910
|
+
var timeout = react_1$f.useRef();
|
|
69911
|
+
var nextValue = react_1$f.useRef(null);
|
|
69912
|
+
var hasNextValue = react_1$f.useRef(0);
|
|
69913
|
+
react_1$f.useEffect(function () {
|
|
69914
69914
|
if (!timeout.current) {
|
|
69915
69915
|
setState(value);
|
|
69916
69916
|
var timeoutCallback_1 = function () {
|
|
@@ -69943,20 +69943,20 @@ var __importDefault$9 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69943
69943
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
69944
69944
|
};
|
|
69945
69945
|
Object.defineProperty(searchIcon, "__esModule", { value: true });
|
|
69946
|
-
var react_1$
|
|
69946
|
+
var react_1$e = __importDefault$9(React__default);
|
|
69947
69947
|
var SearchIcon$1 = function (_a) {
|
|
69948
69948
|
var _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
69949
|
-
return (react_1$
|
|
69950
|
-
react_1$
|
|
69951
|
-
react_1$
|
|
69952
|
-
react_1$
|
|
69953
|
-
react_1$
|
|
69954
|
-
react_1$
|
|
69955
|
-
react_1$
|
|
69956
|
-
react_1$
|
|
69957
|
-
react_1$
|
|
69958
|
-
react_1$
|
|
69959
|
-
react_1$
|
|
69949
|
+
return (react_1$e.default.createElement("svg", { viewBox: "0 0 30 30", version: "1.1", className: className },
|
|
69950
|
+
react_1$e.default.createElement("defs", null,
|
|
69951
|
+
react_1$e.default.createElement("path", { d: "M11.5482521,20.4090671 L4.24727698,28.2009189 C3.68084207,28.8054377 2.73159653,28.8363108 2.12707771,28.2698759 C1.5225589,27.703441 1.4916858,26.7541954 2.0581207,26.1496766 L9.40599838,18.3077689 C7.95982241,16.4371424 7.0978836,14.0789715 7.0978836,11.5181818 C7.0978836,5.44914339 11.9392549,0.518181818 17.9252787,0.518181818 C23.9113026,0.518181818 28.7526738,5.44914339 28.7526738,11.5181818 C28.7526738,17.5872202 23.9113026,22.5181818 17.9252787,22.5181818 C15.539851,22.5181818 13.3361963,21.7351359 11.5482521,20.4090671 Z M17.9252787,19.5181818 C22.242011,19.5181818 25.7526738,15.9425536 25.7526738,11.5181818 C25.7526738,7.09381 22.242011,3.51818182 17.9252787,3.51818182 C13.6085464,3.51818182 10.0978836,7.09381 10.0978836,11.5181818 C10.0978836,15.9425536 13.6085464,19.5181818 17.9252787,19.5181818 Z", id: "giphy-search-icon-path-1" })),
|
|
69952
|
+
react_1$e.default.createElement("g", { id: "search", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" },
|
|
69953
|
+
react_1$e.default.createElement("g", { id: "icons/search" },
|
|
69954
|
+
react_1$e.default.createElement("mask", { id: "giphy-search-icon-mask-2", fill: "white" },
|
|
69955
|
+
react_1$e.default.createElement("use", { xlinkHref: "#giphy-search-icon-path-1" })),
|
|
69956
|
+
react_1$e.default.createElement("use", { id: "Mask", fill: "#FFFFFF", fillRule: "nonzero", xlinkHref: "#giphy-search-icon-path-1" }),
|
|
69957
|
+
react_1$e.default.createElement("g", { mask: "url(#giphy-search-icon-mask-2)" },
|
|
69958
|
+
react_1$e.default.createElement("g", { transform: "translate(0.250000, 0.250000)" },
|
|
69959
|
+
react_1$e.default.createElement("g", null)))))));
|
|
69960
69960
|
};
|
|
69961
69961
|
searchIcon.default = SearchIcon$1;
|
|
69962
69962
|
|
|
@@ -69988,7 +69988,7 @@ var __importDefault$8 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69988
69988
|
};
|
|
69989
69989
|
Object.defineProperty(searchButton, "__esModule", { value: true });
|
|
69990
69990
|
var core_1$1 = require$$0$1;
|
|
69991
|
-
var react_1$
|
|
69991
|
+
var react_1$d = __importStar$6(React__default);
|
|
69992
69992
|
var useThrottle_1 = __importDefault$8(useThrottle$3);
|
|
69993
69993
|
var context_1$3 = context;
|
|
69994
69994
|
var search_icon_1 = __importDefault$8(searchIcon);
|
|
@@ -69999,24 +69999,24 @@ var pink = '#FF6666';
|
|
|
69999
69999
|
var strongEasing = 'cubic-bezier(0.920, 0.240, 0.185, 0.730)';
|
|
70000
70000
|
var searchFx = core_1$1.keyframes(templateObject_1$2y || (templateObject_1$2y = __makeTemplateObject$9(["\n 0% {\n transform: rotate(34deg) translate(-10px, 80px);\n };\n \n 100% {\n transform: rotate(34deg) translate(-10px, -20px);\n }\n"], ["\n 0% {\n transform: rotate(34deg) translate(-10px, 80px);\n };\n \n 100% {\n transform: rotate(34deg) translate(-10px, -20px);\n }\n"])));
|
|
70001
70001
|
var plus$1 = core_1$1.keyframes(templateObject_2$1I || (templateObject_2$1I = __makeTemplateObject$9(["\n 0% { \n transform: translate(0px, 0px);\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: translate(10px, -17px);\n opacity: 0;\n }\n"], ["\n 0% { \n transform: translate(0px, 0px);\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: translate(10px, -17px);\n opacity: 0;\n }\n"])));
|
|
70002
|
-
var gradientFade = core_1$1.keyframes(templateObject_3$
|
|
70002
|
+
var gradientFade = core_1$1.keyframes(templateObject_3$1a || (templateObject_3$1a = __makeTemplateObject$9(["\n 0% {\n opacity: 0;\n transform: translateX(-400%);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n transform: translateX(0);\n }\n"], ["\n 0% {\n opacity: 0;\n transform: translateX(-400%);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n transform: translateX(0);\n }\n"])));
|
|
70003
70003
|
var Container$8 = theme_1$3.default.div(templateObject_4$O || (templateObject_4$O = __makeTemplateObject$9(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n display: none;\n }\n ", "\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n display: none;\n }\n ", "\n"])), function (props) { return theme_1$3.getSize(props.theme, true); });
|
|
70004
70004
|
var GradientBox = theme_1$3.default.div(templateObject_5$G || (templateObject_5$G = __makeTemplateObject$9(["\n position: absolute;\n height: 100%;\n width: 100%;\n background: linear-gradient(45deg, ", " 0%, ", " 100%);\n overflow: hidden;\n &:before {\n animation: ", " ", " linear 0s infinite;\n background-image: linear-gradient(45deg, ", " 0%, ", " 50%, ", " 100%);\n background-size: 400%;\n background-position: 0% 100%;\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n width: 400%;\n }\n"], ["\n position: absolute;\n height: 100%;\n width: 100%;\n background: linear-gradient(45deg, ", " 0%, ", " 100%);\n overflow: hidden;\n &:before {\n animation: ", " ", " linear 0s infinite;\n background-image: linear-gradient(45deg, ", " 0%, ", " 50%, ", " 100%);\n background-size: 400%;\n background-position: 0% 100%;\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n width: 400%;\n }\n"])), purp, pink, gradientFade, time, purp, pink, purp);
|
|
70005
70005
|
var Fx = theme_1$3.default.div(templateObject_6$v || (templateObject_6$v = __makeTemplateObject$9(["\n width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;\n &::after {\n content: '+';\n color: white;\n font-family: 'SS Standard';\n font-size: 8px;\n position: absolute;\n top: 65%;\n left: 66%;\n animation: ", " 1s ", " 0s 1 forwards;\n }\n"], ["\n width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;\n &::after {\n content: '+';\n color: white;\n font-family: 'SS Standard';\n font-size: 8px;\n position: absolute;\n top: 65%;\n left: 66%;\n animation: ", " 1s ", " 0s 1 forwards;\n }\n"])), plus$1, strongEasing);
|
|
70006
70006
|
var Scanner = theme_1$3.default.div(templateObject_7$n || (templateObject_7$n = __makeTemplateObject$9(["\n position: absolute;\n width: 200%;\n height: 20px;\n background: rgba(255, 255, 255, 0.5);\n transform: rotate(34deg) translate(-10px, -20px);\n animation: ", " 1s ", " 0s 1;\n filter: blur(1px);\n"], ["\n position: absolute;\n width: 200%;\n height: 20px;\n background: rgba(255, 255, 255, 0.5);\n transform: rotate(34deg) translate(-10px, -20px);\n animation: ", " 1s ", " 0s 1;\n filter: blur(1px);\n"])), searchFx, strongEasing);
|
|
70007
70007
|
var SearchIcon = theme_1$3.default(search_icon_1.default)(templateObject_8$l || (templateObject_8$l = __makeTemplateObject$9(["\n z-index: 1;\n display: flex;\n width: 60%;\n height: 60%;\n"], ["\n z-index: 1;\n display: flex;\n width: 60%;\n height: 60%;\n"])));
|
|
70008
70008
|
var SearchButton = function () {
|
|
70009
|
-
var isFetching = react_1$
|
|
70009
|
+
var isFetching = react_1$d.useContext(context_1$3.SearchContext).isFetching;
|
|
70010
70010
|
// let the animation run by throttling isFetching
|
|
70011
70011
|
var throttledFetch = useThrottle_1.default(isFetching, 1000);
|
|
70012
|
-
return (react_1$
|
|
70013
|
-
react_1$
|
|
70014
|
-
react_1$
|
|
70015
|
-
throttledFetch && (react_1$
|
|
70016
|
-
react_1$
|
|
70012
|
+
return (react_1$d.default.createElement(Container$8, null,
|
|
70013
|
+
react_1$d.default.createElement(GradientBox, null),
|
|
70014
|
+
react_1$d.default.createElement(SearchIcon, null),
|
|
70015
|
+
throttledFetch && (react_1$d.default.createElement(Fx, null,
|
|
70016
|
+
react_1$d.default.createElement(Scanner, null)))));
|
|
70017
70017
|
};
|
|
70018
70018
|
searchButton.default = SearchButton;
|
|
70019
|
-
var templateObject_1$2y, templateObject_2$1I, templateObject_3$
|
|
70019
|
+
var templateObject_1$2y, templateObject_2$1I, templateObject_3$1a, templateObject_4$O, templateObject_5$G, templateObject_6$v, templateObject_7$n, templateObject_8$l;
|
|
70020
70020
|
|
|
70021
70021
|
var __makeTemplateObject$8 = (commonjsGlobal$7 && commonjsGlobal$7.__makeTemplateObject) || function (cooked, raw) {
|
|
70022
70022
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
@@ -70047,44 +70047,44 @@ var __importDefault$7 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
70047
70047
|
Object.defineProperty(searchBar, "__esModule", { value: true });
|
|
70048
70048
|
var core_1 = require$$0$1;
|
|
70049
70049
|
var js_brand_1$2 = dist$2;
|
|
70050
|
-
var react_1$
|
|
70051
|
-
var useDebounce_1
|
|
70050
|
+
var react_1$c = __importStar$5(React__default);
|
|
70051
|
+
var useDebounce_1 = __importDefault$7(useDebounce$3);
|
|
70052
70052
|
var context_1$2 = context;
|
|
70053
70053
|
var search_bar_channel_1 = __importDefault$7(searchBarChannel);
|
|
70054
70054
|
var search_button_1 = __importDefault$7(searchButton);
|
|
70055
70055
|
var theme_1$2 = __importStar$5(theme);
|
|
70056
70056
|
function usePrevious$1(value) {
|
|
70057
|
-
var ref = react_1$
|
|
70058
|
-
react_1$
|
|
70057
|
+
var ref = react_1$c.useRef(value);
|
|
70058
|
+
react_1$c.useEffect(function () {
|
|
70059
70059
|
ref.current = value;
|
|
70060
70060
|
});
|
|
70061
70061
|
return ref.current;
|
|
70062
70062
|
}
|
|
70063
70063
|
var SEARCH_DEBOUNCE = 500;
|
|
70064
70064
|
var Container$7 = theme_1$2.default.div(templateObject_1$2x || (templateObject_1$2x = __makeTemplateObject$8(["\n display: flex;\n background: white;\n ", "\n"], ["\n display: flex;\n background: white;\n ", "\n"])), function (props) { return theme_1$2.getSize(props.theme); });
|
|
70065
|
-
var Input = theme_1$2.default.input(templateObject_3$
|
|
70065
|
+
var Input = theme_1$2.default.input(templateObject_3$19 || (templateObject_3$19 = __makeTemplateObject$8(["\n background: ", ";\n box-sizing: border-box;\n border: 0;\n appearance: none;\n font-weight: normal;\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n outline: 0;\n font-size: 15px;\n padding: 0 10px;\n border-radius: 0;\n text-overflow: ellipsis;\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n min-width: 150px;\n flex: 1;\n ", "\n"], ["\n background: ", ";\n box-sizing: border-box;\n border: 0;\n appearance: none;\n font-weight: normal;\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n outline: 0;\n font-size: 15px;\n padding: 0 10px;\n border-radius: 0;\n text-overflow: ellipsis;\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n min-width: 150px;\n flex: 1;\n ", "\n"])), function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyCharcoal : js_brand_1$2.giphyWhite); }, function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyWhite : js_brand_1$2.giphyBlack); }, function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyLightGrey : js_brand_1$2.giphyLightGrey); }, function (props) {
|
|
70066
70066
|
return props.isUsernameSearch && core_1.css(templateObject_2$1H || (templateObject_2$1H = __makeTemplateObject$8(["\n color: ", ";\n "], ["\n color: ", ";\n "])), js_brand_1$2.giphyIndigo);
|
|
70067
70067
|
});
|
|
70068
70068
|
var SearchBar = function (_a) {
|
|
70069
70069
|
var className = _a.className, _b = _a.placeholder, placeholder = _b === void 0 ? "Search GIPHY" : _b, _c = _a.clear, clear = _c === void 0 ? false : _c, autoFocus = _a.autoFocus;
|
|
70070
|
-
var _d = react_1$
|
|
70070
|
+
var _d = react_1$c.useContext(context_1$2.SearchContext), setSearch = _d.setSearch, activeChannel = _d.activeChannel, setActiveChannel = _d.setActiveChannel, term = _d.term, channelSearch = _d.channelSearch;
|
|
70071
70071
|
// debounce local input
|
|
70072
|
-
var _e = react_1$
|
|
70072
|
+
var _e = react_1$c.useState(term), debouncedTerm = _e[0], setDebouncedInput = _e[1];
|
|
70073
70073
|
// used to see if the last term was a '' before clearing
|
|
70074
70074
|
var lastTerm = usePrevious$1(debouncedTerm);
|
|
70075
70075
|
// set the term when it changes
|
|
70076
|
-
useDebounce_1
|
|
70076
|
+
useDebounce_1.default(function () { return setSearch(debouncedTerm); }, SEARCH_DEBOUNCE, [debouncedTerm]);
|
|
70077
70077
|
// used only to focus the input
|
|
70078
|
-
var inputRef = react_1$
|
|
70078
|
+
var inputRef = react_1$c.useRef(null);
|
|
70079
70079
|
// we'll use this to see when we went from no channel to channel
|
|
70080
70080
|
var previousActiveChannel = usePrevious$1(activeChannel);
|
|
70081
|
-
react_1$
|
|
70081
|
+
react_1$c.useEffect(function () {
|
|
70082
70082
|
var _a;
|
|
70083
70083
|
if (autoFocus) {
|
|
70084
70084
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
70085
70085
|
}
|
|
70086
70086
|
}, [autoFocus]);
|
|
70087
|
-
react_1$
|
|
70087
|
+
react_1$c.useEffect(function () {
|
|
70088
70088
|
var _a;
|
|
70089
70089
|
// if we know have a channel, focus and clear the input
|
|
70090
70090
|
// so the user can search the channel
|
|
@@ -70094,11 +70094,11 @@ var SearchBar = function (_a) {
|
|
|
70094
70094
|
}
|
|
70095
70095
|
}, [debouncedTerm, activeChannel, previousActiveChannel]);
|
|
70096
70096
|
// a pill could have been clicked, update our local term state
|
|
70097
|
-
react_1$
|
|
70097
|
+
react_1$c.useEffect(function () {
|
|
70098
70098
|
setDebouncedInput(term);
|
|
70099
70099
|
}, [term]);
|
|
70100
|
-
var _f = react_1$
|
|
70101
|
-
react_1$
|
|
70100
|
+
var _f = react_1$c.useState(clear), isCleared = _f[0], setCleared = _f[1];
|
|
70101
|
+
react_1$c.useEffect(function () {
|
|
70102
70102
|
setCleared(clear);
|
|
70103
70103
|
}, [clear]);
|
|
70104
70104
|
// key ups to clear the active channel
|
|
@@ -70117,20 +70117,20 @@ var SearchBar = function (_a) {
|
|
|
70117
70117
|
break;
|
|
70118
70118
|
}
|
|
70119
70119
|
};
|
|
70120
|
-
return (react_1$
|
|
70121
|
-
react_1$
|
|
70122
|
-
react_1$
|
|
70120
|
+
return (react_1$c.default.createElement(Container$7, { className: [SearchBar.className, className].join(' ') },
|
|
70121
|
+
react_1$c.default.createElement(search_bar_channel_1.default, null),
|
|
70122
|
+
react_1$c.default.createElement(Input, { isUsernameSearch: !!channelSearch, onChange: function (_a) {
|
|
70123
70123
|
var value = _a.target.value;
|
|
70124
70124
|
if (!isCleared || value !== '') {
|
|
70125
70125
|
setCleared(false);
|
|
70126
70126
|
setDebouncedInput(value);
|
|
70127
70127
|
}
|
|
70128
70128
|
}, value: isCleared ? '' : debouncedTerm, placeholder: activeChannel ? "Search " + activeChannel.display_name : placeholder, autoCapitalize: "off", autoCorrect: "off", autoComplete: "off", ref: inputRef, onKeyUp: onKeyUp }),
|
|
70129
|
-
react_1$
|
|
70129
|
+
react_1$c.default.createElement(search_button_1.default, null)));
|
|
70130
70130
|
};
|
|
70131
70131
|
SearchBar.className = 'giphy-search-bar';
|
|
70132
70132
|
searchBar.default = SearchBar;
|
|
70133
|
-
var templateObject_1$2x, templateObject_2$1H, templateObject_3$
|
|
70133
|
+
var templateObject_1$2x, templateObject_2$1H, templateObject_3$19;
|
|
70134
70134
|
|
|
70135
70135
|
var suggestionBar = {};
|
|
70136
70136
|
|
|
@@ -70142,14 +70142,14 @@ var __importDefault$6 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
70142
70142
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
70143
70143
|
};
|
|
70144
70144
|
Object.defineProperty(trendingIcon, "__esModule", { value: true });
|
|
70145
|
-
var react_1$
|
|
70145
|
+
var react_1$b = __importDefault$6(React__default);
|
|
70146
70146
|
var TrendingIcon$1 = function (_a) {
|
|
70147
70147
|
var _b = _a.size, size = _b === void 0 ? 18 : _b, className = _a.className;
|
|
70148
|
-
return (react_1$
|
|
70149
|
-
react_1$
|
|
70150
|
-
react_1$
|
|
70151
|
-
react_1$
|
|
70152
|
-
react_1$
|
|
70148
|
+
return (react_1$b.default.createElement("svg", { width: size, height: size, viewBox: "0 0 18 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", className: className },
|
|
70149
|
+
react_1$b.default.createElement("g", { id: "trending", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" },
|
|
70150
|
+
react_1$b.default.createElement("g", null,
|
|
70151
|
+
react_1$b.default.createElement("rect", { id: "Rectangle", stroke: "#979797", fill: "#D8D8D8", opacity: "0", x: "0.5", y: "0.5", width: "17", height: "17" }),
|
|
70152
|
+
react_1$b.default.createElement("path", { d: "M12.6093329,3.12057664 L15.156896,3.12057664 L9.64199318,9.04253019 L6.88133868,6.8175119 C6.7544587,6.67603813 6.56616874,6.60087259 6.38404017,6.61897279 C6.2490402,6.63288422 6.11891631,6.69661171 6.02063992,6.79697337 C2.21226835,10.5943119 0.308082561,12.4929812 0.308082561,12.4929812 C0.308082561,12.4929812 0.527106106,12.8074292 0.710953088,13.0215425 C0.833517743,13.1642848 0.975497751,13.3098497 1.13689311,13.4582373 L6.47329888,8.13191205 L9.16381134,10.2953038 C9.40800276,10.5710787 9.68933701,10.7021044 10.019278,10.4570223 L16.0239805,4.04474473 C16.0239805,5.87956383 16.0239805,6.79697337 16.0239805,6.79697337 C16.0239805,6.79697337 16.4320205,6.79697337 17.2481004,6.79697337 L17.2481004,1.80604505 C14.1555887,1.80604505 12.6093329,1.80604505 12.6093329,1.80604505 C12.6093329,1.80604505 12.6093329,2.24422225 12.6093329,3.12057664 Z", id: "Shape", stroke: "#00CCFF", strokeWidth: "0.4", fill: "#00CCFF", fillRule: "nonzero", transform: "translate(8.778091, 7.632141) rotate(-2.000000) translate(-8.778091, -7.632141) " })))));
|
|
70153
70153
|
};
|
|
70154
70154
|
trendingIcon.default = TrendingIcon$1;
|
|
70155
70155
|
|
|
@@ -70182,7 +70182,7 @@ var __importDefault$5 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
70182
70182
|
Object.defineProperty(pills, "__esModule", { value: true });
|
|
70183
70183
|
pills.TrendingSearchPill = pills.ChannelPill = void 0;
|
|
70184
70184
|
var js_brand_1$1 = dist$2;
|
|
70185
|
-
var react_1$
|
|
70185
|
+
var react_1$a = __importStar$4(React__default);
|
|
70186
70186
|
var avatar_1$1 = __importDefault$5(avatar);
|
|
70187
70187
|
var verified_badge_1 = __importDefault$5(verifiedBadge);
|
|
70188
70188
|
var context_1$1 = context;
|
|
@@ -70191,28 +70191,28 @@ var trending_icon_1 = __importDefault$5(trendingIcon);
|
|
|
70191
70191
|
var margin = 9;
|
|
70192
70192
|
var ChannelPillContainer = theme_1$1.default.div(templateObject_1$2w || (templateObject_1$2w = __makeTemplateObject$7(["\n background: ", ";\n display: flex;\n padding-right: 4px;\n align-items: center;\n margin-right: ", "px;\n cursor: pointer;\n"], ["\n background: ", ";\n display: flex;\n padding-right: 4px;\n align-items: center;\n margin-right: ", "px;\n cursor: pointer;\n"])), js_brand_1$1.giphyDarkestGrey, margin);
|
|
70193
70193
|
var TrendingSearchPillContainer = theme_1$1.default.div(templateObject_2$1G || (templateObject_2$1G = __makeTemplateObject$7(["\n background: ", ";\n display: flex;\n padding: 14px;\n align-items: center;\n margin-right: ", "px;\n white-space: nowrap;\n cursor: pointer;\n font-style: italic;\n border-radius: 20px;\n"], ["\n background: ", ";\n display: flex;\n padding: 14px;\n align-items: center;\n margin-right: ", "px;\n white-space: nowrap;\n cursor: pointer;\n font-style: italic;\n border-radius: 20px;\n"])), js_brand_1$1.giphyDarkestGrey, margin);
|
|
70194
|
-
var Avatar$2 = theme_1$1.default(avatar_1$1.default)(templateObject_3$
|
|
70194
|
+
var Avatar$2 = theme_1$1.default(avatar_1$1.default)(templateObject_3$18 || (templateObject_3$18 = __makeTemplateObject$7(["\n ", "\n"], ["\n ", "\n"])), function (props) { return theme_1$1.getSize(props.theme, true); });
|
|
70195
70195
|
var TrendingIcon = theme_1$1.default(trending_icon_1.default)(templateObject_4$N || (templateObject_4$N = __makeTemplateObject$7(["\n margin-right: 2px;\n"], ["\n margin-right: 2px;\n"])));
|
|
70196
70196
|
var ChannelPill = function (_a) {
|
|
70197
70197
|
var channel = _a.channel;
|
|
70198
|
-
var setActiveChannel = react_1$
|
|
70199
|
-
return (react_1$
|
|
70200
|
-
react_1$
|
|
70201
|
-
react_1$
|
|
70198
|
+
var setActiveChannel = react_1$a.useContext(context_1$1.SearchContext).setActiveChannel;
|
|
70199
|
+
return (react_1$a.default.createElement(ChannelPillContainer, { key: channel.id, onClick: function () { return setActiveChannel(channel); } },
|
|
70200
|
+
react_1$a.default.createElement(Avatar$2, { user: channel.user }),
|
|
70201
|
+
react_1$a.default.createElement("div", null,
|
|
70202
70202
|
"@",
|
|
70203
70203
|
channel.user.username),
|
|
70204
|
-
channel.user.is_verified && react_1$
|
|
70204
|
+
channel.user.is_verified && react_1$a.default.createElement(verified_badge_1.default, { size: 14 })));
|
|
70205
70205
|
};
|
|
70206
70206
|
pills.ChannelPill = ChannelPill;
|
|
70207
70207
|
var TrendingSearchPill = function (_a) {
|
|
70208
70208
|
var trendingSearch = _a.trendingSearch;
|
|
70209
|
-
var setSearch = react_1$
|
|
70210
|
-
return (react_1$
|
|
70211
|
-
react_1$
|
|
70209
|
+
var setSearch = react_1$a.useContext(context_1$1.SearchContext).setSearch;
|
|
70210
|
+
return (react_1$a.default.createElement(TrendingSearchPillContainer, { key: trendingSearch, onClick: function () { return setSearch(trendingSearch); } },
|
|
70211
|
+
react_1$a.default.createElement(TrendingIcon, { size: 16 }),
|
|
70212
70212
|
trendingSearch));
|
|
70213
70213
|
};
|
|
70214
70214
|
pills.TrendingSearchPill = TrendingSearchPill;
|
|
70215
|
-
var templateObject_1$2w, templateObject_2$1G, templateObject_3$
|
|
70215
|
+
var templateObject_1$2w, templateObject_2$1G, templateObject_3$18, templateObject_4$N;
|
|
70216
70216
|
|
|
70217
70217
|
var __makeTemplateObject$6 = (commonjsGlobal$7 && commonjsGlobal$7.__makeTemplateObject) || function (cooked, raw) {
|
|
70218
70218
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
@@ -70274,15 +70274,15 @@ var __generator$3 = (commonjsGlobal$7 && commonjsGlobal$7.__generator) || functi
|
|
|
70274
70274
|
}
|
|
70275
70275
|
};
|
|
70276
70276
|
Object.defineProperty(suggestionBar, "__esModule", { value: true });
|
|
70277
|
-
var react_1$
|
|
70277
|
+
var react_1$9 = __importStar$3(React__default);
|
|
70278
70278
|
var context_1 = context;
|
|
70279
70279
|
var theme_1 = __importStar$3(theme);
|
|
70280
70280
|
var pills_1 = pills;
|
|
70281
70281
|
var Container$6 = theme_1.default.div(templateObject_1$2v || (templateObject_1$2v = __makeTemplateObject$6(["\n display: flex;\n color: white;\n flex-direction: row;\n font-family: 'interface';\n font-weight: 600;\n font-size: 14px;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n padding-bottom: 10px;\n ", "\n"], ["\n display: flex;\n color: white;\n flex-direction: row;\n font-family: 'interface';\n font-weight: 600;\n font-size: 14px;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n padding-bottom: 10px;\n ", "\n"])), function (props) { return theme_1.getSize(props.theme); });
|
|
70282
70282
|
var SuggestionBar = function () {
|
|
70283
|
-
var _a = react_1$
|
|
70284
|
-
var _b = react_1$
|
|
70285
|
-
react_1$
|
|
70283
|
+
var _a = react_1$9.useContext(context_1.SearchContext), channelSearch = _a.channelSearch, fetchChannelSearch = _a.fetchChannelSearch, trendingSearches = _a.trendingSearches, activeChannel = _a.activeChannel;
|
|
70284
|
+
var _b = react_1$9.useState([]), channels = _b[0], setChannels = _b[1];
|
|
70285
|
+
react_1$9.useEffect(function () {
|
|
70286
70286
|
var fetchChannels = function () { return __awaiter$3(void 0, void 0, void 0, function () {
|
|
70287
70287
|
var channels;
|
|
70288
70288
|
return __generator$3(this, function (_a) {
|
|
@@ -70303,9 +70303,9 @@ var SuggestionBar = function () {
|
|
|
70303
70303
|
setChannels([]);
|
|
70304
70304
|
}
|
|
70305
70305
|
}, [channelSearch, activeChannel, fetchChannelSearch]);
|
|
70306
|
-
return (react_1$
|
|
70307
|
-
? channels.map(function (channel) { return react_1$
|
|
70308
|
-
: trendingSearches.map(function (trendingSearch) { return (react_1$
|
|
70306
|
+
return (react_1$9.default.createElement(Container$6, null, channels.length > 0
|
|
70307
|
+
? channels.map(function (channel) { return react_1$9.default.createElement(pills_1.ChannelPill, { key: channel.id, channel: channel }); })
|
|
70308
|
+
: trendingSearches.map(function (trendingSearch) { return (react_1$9.default.createElement(pills_1.TrendingSearchPill, { key: trendingSearch, trendingSearch: trendingSearch })); })));
|
|
70309
70309
|
};
|
|
70310
70310
|
suggestionBar.default = SuggestionBar;
|
|
70311
70311
|
var templateObject_1$2v;
|
|
@@ -71777,7 +71777,7 @@ function useTimeoutFn(fn, ms) {
|
|
|
71777
71777
|
return [isReady, clear, set];
|
|
71778
71778
|
}
|
|
71779
71779
|
|
|
71780
|
-
function useDebounce$
|
|
71780
|
+
function useDebounce$1(fn, ms, deps) {
|
|
71781
71781
|
if (ms === void 0) { ms = 0; }
|
|
71782
71782
|
if (deps === void 0) { deps = []; }
|
|
71783
71783
|
var _a = useTimeoutFn(fn, ms), isReady = _a[0], cancel = _a[1], reset = _a[2];
|
|
@@ -73688,14 +73688,14 @@ var useSearchParam = function (param) {
|
|
|
73688
73688
|
var useSearchParamServer = function () { return null; };
|
|
73689
73689
|
var useSearchParam$1 = isBrowser ? useSearchParam : useSearchParamServer;
|
|
73690
73690
|
|
|
73691
|
-
var lib$
|
|
73691
|
+
var lib$1 = {};
|
|
73692
73692
|
|
|
73693
73693
|
var render$1 = {};
|
|
73694
73694
|
|
|
73695
73695
|
Object.defineProperty(render$1, "__esModule", { value: true });
|
|
73696
73696
|
var tslib_1$6 = require$$0;
|
|
73697
|
-
var react_1$
|
|
73698
|
-
var isReact16Plus = parseInt(react_1$
|
|
73697
|
+
var react_1$8 = React__default;
|
|
73698
|
+
var isReact16Plus = parseInt(react_1$8.version.substr(0, react_1$8.version.indexOf('.'))) > 15;
|
|
73699
73699
|
var isFn = function (fn) { return typeof fn === 'function'; };
|
|
73700
73700
|
var render = function (props, data) {
|
|
73701
73701
|
var more = [];
|
|
@@ -73722,10 +73722,10 @@ var render = function (props, data) {
|
|
|
73722
73722
|
if (isFn(children))
|
|
73723
73723
|
return children.apply(void 0, tslib_1$6.__spreadArrays([data], more));
|
|
73724
73724
|
if (comp) {
|
|
73725
|
-
return react_1$
|
|
73725
|
+
return react_1$8.createElement(comp, data);
|
|
73726
73726
|
}
|
|
73727
73727
|
if (children instanceof Array)
|
|
73728
|
-
return isReact16Plus ? children : react_1$
|
|
73728
|
+
return isReact16Plus ? children : react_1$8.createElement.apply(void 0, tslib_1$6.__spreadArrays(['div', null], children));
|
|
73729
73729
|
if (children && (children instanceof Object)) {
|
|
73730
73730
|
if (browser$1$1.env.NODE_ENV !== 'production') {
|
|
73731
73731
|
if (!children.type || ((typeof children.type !== 'string') && (typeof children.type !== 'function') && (typeof children.type !== 'symbol'))) {
|
|
@@ -73735,12 +73735,12 @@ var render = function (props, data) {
|
|
|
73735
73735
|
}
|
|
73736
73736
|
if (typeof children.type === 'string')
|
|
73737
73737
|
return children;
|
|
73738
|
-
return react_1$
|
|
73738
|
+
return react_1$8.cloneElement(children, Object.assign({}, children.props, data));
|
|
73739
73739
|
}
|
|
73740
73740
|
else {
|
|
73741
73741
|
if (typeof children.type === 'string')
|
|
73742
73742
|
return children;
|
|
73743
|
-
return react_1$
|
|
73743
|
+
return react_1$8.cloneElement(children, Object.assign({}, children.props, data));
|
|
73744
73744
|
}
|
|
73745
73745
|
}
|
|
73746
73746
|
return children || null;
|
|
@@ -73829,15 +73829,15 @@ var hookToRenderProp = function (hook, mapPropsToArgs) {
|
|
|
73829
73829
|
};
|
|
73830
73830
|
hookToRenderProp$1.default = hookToRenderProp;
|
|
73831
73831
|
|
|
73832
|
-
Object.defineProperty(lib$
|
|
73833
|
-
lib$
|
|
73832
|
+
Object.defineProperty(lib$1, "__esModule", { value: true });
|
|
73833
|
+
lib$1.hookToRenderProp = lib$1.createEnhancer = lib$1.render = void 0;
|
|
73834
73834
|
var tslib_1$1 = require$$0;
|
|
73835
73835
|
var render_1 = tslib_1$1.__importDefault(render$1);
|
|
73836
|
-
lib$
|
|
73836
|
+
lib$1.render = render_1.default;
|
|
73837
73837
|
var createEnhancer_1 = tslib_1$1.__importDefault(createEnhancer$1);
|
|
73838
|
-
lib$
|
|
73838
|
+
lib$1.createEnhancer = createEnhancer_1.default;
|
|
73839
73839
|
var hookToRenderProp_1 = tslib_1$1.__importDefault(hookToRenderProp$1);
|
|
73840
|
-
lib$
|
|
73840
|
+
lib$1.hookToRenderProp = hookToRenderProp_1.default;
|
|
73841
73841
|
|
|
73842
73842
|
var useScratch = function (params) {
|
|
73843
73843
|
if (params === void 0) { params = {}; }
|
|
@@ -74570,10 +74570,10 @@ function useTitle(title, options) {
|
|
|
74570
74570
|
}
|
|
74571
74571
|
var useTitle$1 = typeof document !== 'undefined' ? useTitle : function (_title) { };
|
|
74572
74572
|
|
|
74573
|
-
var lib
|
|
74573
|
+
var lib = {};
|
|
74574
74574
|
|
|
74575
|
-
Object.defineProperty(lib
|
|
74576
|
-
var easing$1 = lib
|
|
74575
|
+
Object.defineProperty(lib, "__esModule", { value: true });
|
|
74576
|
+
var easing$1 = lib.easing = {
|
|
74577
74577
|
// No easing, no acceleration
|
|
74578
74578
|
linear: function (t) { return t; },
|
|
74579
74579
|
// Accelerates fast, then slows quickly towards end.
|
|
@@ -74979,7 +74979,7 @@ var esm = /*#__PURE__*/Object.freeze({
|
|
|
74979
74979
|
useCounter: useCounter,
|
|
74980
74980
|
useCss: useCss$1,
|
|
74981
74981
|
useCustomCompareEffect: useCustomCompareEffect$1,
|
|
74982
|
-
useDebounce: useDebounce$
|
|
74982
|
+
useDebounce: useDebounce$1,
|
|
74983
74983
|
useDeepCompareEffect: useDeepCompareEffect$1,
|
|
74984
74984
|
useDefault: useDefault$1,
|
|
74985
74985
|
useDrop: useDrop$1,
|
|
@@ -75087,15 +75087,15 @@ var __importDefault$4 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
75087
75087
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
75088
75088
|
};
|
|
75089
75089
|
Object.defineProperty(clipsBranding, "__esModule", { value: true });
|
|
75090
|
-
var react_1$
|
|
75090
|
+
var react_1$7 = __importDefault$4(React__default);
|
|
75091
75091
|
var GIPHYClips = function (_a) {
|
|
75092
75092
|
var onClick = _a.onClick;
|
|
75093
|
-
return (react_1$
|
|
75094
|
-
react_1$
|
|
75095
|
-
react_1$
|
|
75096
|
-
react_1$
|
|
75097
|
-
react_1$
|
|
75098
|
-
react_1$
|
|
75093
|
+
return (react_1$7.default.createElement("svg", { width: "66px", height: "13px", viewBox: "0 0 66 13", onClick: onClick },
|
|
75094
|
+
react_1$7.default.createElement("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd" },
|
|
75095
|
+
react_1$7.default.createElement("g", { transform: "translate(-1060.000000, -462.000000)", fill: "#FFFFFF", fillRule: "nonzero" },
|
|
75096
|
+
react_1$7.default.createElement("g", { transform: "translate(931.000000, 286.375671)" },
|
|
75097
|
+
react_1$7.default.createElement("g", { transform: "translate(86.000000, 136.124329)" },
|
|
75098
|
+
react_1$7.default.createElement("path", { d: "M47.968,49.1962322 C49.588,49.1962322 51.052,48.6202322 51.58,47.5522322 L51.58,43.8202322 L47.476,43.8202322 L47.476,45.6802322 L49.6,45.6802322 L49.6,46.7602322 C49.12,47.1082322 48.424,47.1922322 47.98,47.1922322 C46.288,47.1922322 45.724,45.8602322 45.724,44.7802322 C45.724,43.1362322 46.612,42.3202322 47.98,42.3202322 C48.544,42.3202322 49.288,42.4762322 49.9,43.0522322 L51.28,41.6842322 C50.176,40.5682322 49.144,40.3282322 47.98,40.3282322 C44.824,40.3282322 43.384,42.5842322 43.384,44.7802322 C43.384,46.9762322 44.644,49.1962322 47.968,49.1962322 Z M54.928,48.9682322 L54.928,40.5682322 L52.564,40.5682322 L52.564,48.9682322 L54.928,48.9682322 Z M58.648,48.9682322 L58.648,46.7002322 L60.352,46.7002322 C62.596,46.6762322 63.724,45.3442322 63.724,43.6282322 C63.724,41.9842322 62.608,40.5682322 60.352,40.5682322 L56.272,40.5682322 L56.272,48.9682322 L58.648,48.9682322 Z M60.352,44.6962322 L58.648,44.6962322 L58.648,42.6082322 L60.352,42.6082322 C61,42.6082322 61.348,43.1122322 61.348,43.6642322 C61.348,44.2162322 61.012,44.6962322 60.352,44.6962322 Z M66.796,48.9802322 L66.796,45.8002322 L69.82,45.8002322 L69.82,48.9802322 L72.172,48.9802322 L72.172,40.5802322 L69.82,40.5802322 L69.82,43.7722322 L66.796,43.7722322 L66.796,40.5802322 L64.42,40.5802322 L64.42,48.9802322 L66.796,48.9802322 Z M78.16,48.9682322 L78.16,45.6202322 L81.496,40.6762322 L81.496,40.5682322 L78.82,40.5682322 L77.008,43.4482322 L75.268,40.5682322 L72.592,40.5682322 L72.592,40.6642322 L75.784,45.6202322 L75.784,48.9682322 L78.16,48.9682322 Z M87.796,49.1362322 C88.972,49.1362322 90.088,48.7402322 90.952,47.8882322 L90.028,46.9642322 C89.44,47.5522322 88.576,47.8762322 87.796,47.8762322 C85.624,47.8762322 84.712,46.3522322 84.7,44.8162322 C84.688,43.2682322 85.66,41.6962322 87.796,41.6962322 C88.576,41.6962322 89.368,41.9722322 89.968,42.5602322 L90.868,41.6962322 C90.016,40.8442322 88.924,40.4242322 87.796,40.4242322 C84.796,40.4242322 83.356,42.6202322 83.3679256,44.8282322 C83.38,47.0362322 84.748,49.1362322 87.796,49.1362322 Z M93.028,48.9682322 L93.028,40.5802322 L91.792,40.5802322 L91.792,48.9682322 L93.028,48.9682322 Z M94.252,41.3122322 C94.252,42.3322322 95.788,42.3322322 95.788,41.3122322 C95.788,40.3042322 94.252,40.3042322 94.252,41.3122322 Z M95.632,48.9682322 L95.632,43.0282322 L94.396,43.0282322 L94.396,48.9682322 L95.632,48.9682322 Z M98.188,51.7162322 L98.188,48.1042322 C98.632,48.8362322 99.556,49.1002322 100.276,49.1002322 C102.112,49.1002322 103.264,47.8042322 103.264,46.0162322 C103.264,44.2282322 102.04,42.9442322 100.276,42.9322322 C99.484,42.9322322 98.644,43.2922322 98.188,44.0122322 L98.116,43.0522322 L96.952,43.0522322 L96.952,51.7162322 L98.188,51.7162322 Z M100.156,47.9002322 C99.076,47.9002322 98.296,47.0722322 98.296,46.0162322 C98.296,44.9602322 99.016,44.1322322 100.156,44.1322322 C101.284,44.1322322 102.028,44.9002322 102.028,46.0162322 C102.028,47.1202322 101.236,47.9002322 100.156,47.9002322 Z M106.456,49.1482322 C107.992,49.1482322 108.964,48.3802322 108.976,47.2762322 C108.988,45.7522322 107.56,45.5122322 106.468,45.4162322 C105.712,45.3442322 105.196,45.1522322 105.184,44.6602322 C105.184,44.1922322 105.688,43.9402322 106.444,43.9522322 C107.032,43.9522322 107.536,44.0722322 108.004,44.5042322 L108.7,43.6882322 C108.04,43.1002322 107.332,42.8962322 106.42,42.8962322 C105.316,42.8962322 103.96,43.3882322 103.96,44.6962322 C103.972,46.0042322 105.256,46.3642322 106.372,46.4722322 C107.248,46.5562322 107.752,46.7602322 107.74,47.2882322 C107.728,47.8402322 107.068,48.0562322 106.48,48.0562322 C105.784,48.0442322 104.956,47.7922322 104.404,47.1802322 L103.756,48.0562322 C104.536,48.9322322 105.496,49.1482322 106.456,49.1482322 Z", id: "GIPHYClips" })))))));
|
|
75099
75099
|
};
|
|
75100
75100
|
clipsBranding.default = GIPHYClips;
|
|
75101
75101
|
|
|
@@ -75108,20 +75108,20 @@ var __importDefault$3 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
75108
75108
|
};
|
|
75109
75109
|
Object.defineProperty(attribution, "__esModule", { value: true });
|
|
75110
75110
|
var styled_1$3 = __importDefault$3(require$$0$4);
|
|
75111
|
-
var react_1$
|
|
75111
|
+
var react_1$6 = __importDefault$3(React__default);
|
|
75112
75112
|
var avatar_1 = __importDefault$3(avatar);
|
|
75113
75113
|
var user_1 = __importDefault$3(user);
|
|
75114
75114
|
var clips_branding_1 = __importDefault$3(clipsBranding);
|
|
75115
75115
|
var Container$5 = styled_1$3.default.div(templateObject_1$2u || (templateObject_1$2u = __makeTemplateObject$5(["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n cursor: pointer;\n"])));
|
|
75116
75116
|
var Avatar$1 = styled_1$3.default(avatar_1.default)(templateObject_2$1F || (templateObject_2$1F = __makeTemplateObject$5(["\n flex-shrink: 0;\n"], ["\n flex-shrink: 0;\n"])));
|
|
75117
|
-
var Right = styled_1$3.default.div(templateObject_3$
|
|
75117
|
+
var Right = styled_1$3.default.div(templateObject_3$17 || (templateObject_3$17 = __makeTemplateObject$5(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
75118
75118
|
var Attribution = function (_a) {
|
|
75119
75119
|
var gif = _a.gif, className = _a.className, onClick = _a.onClick;
|
|
75120
75120
|
var user = gif.user;
|
|
75121
75121
|
if (!(user === null || user === void 0 ? void 0 : user.username) && !(user === null || user === void 0 ? void 0 : user.display_name)) {
|
|
75122
75122
|
return null;
|
|
75123
75123
|
}
|
|
75124
|
-
return (react_1$
|
|
75124
|
+
return (react_1$6.default.createElement(Container$5, { className: [Attribution.className, className].join(' '), onClick: function (e) {
|
|
75125
75125
|
e.preventDefault();
|
|
75126
75126
|
e.stopPropagation();
|
|
75127
75127
|
if (onClick) {
|
|
@@ -75133,9 +75133,9 @@ var Attribution = function (_a) {
|
|
|
75133
75133
|
window.open(url, '_blank');
|
|
75134
75134
|
}
|
|
75135
75135
|
} },
|
|
75136
|
-
react_1$
|
|
75137
|
-
react_1$
|
|
75138
|
-
react_1$
|
|
75136
|
+
react_1$6.default.createElement(Avatar$1, { user: user }),
|
|
75137
|
+
react_1$6.default.createElement(Right, null,
|
|
75138
|
+
react_1$6.default.createElement(clips_branding_1.default, { onClick: function (e) {
|
|
75139
75139
|
e.preventDefault();
|
|
75140
75140
|
e.stopPropagation();
|
|
75141
75141
|
if (onClick) {
|
|
@@ -75145,11 +75145,11 @@ var Attribution = function (_a) {
|
|
|
75145
75145
|
window.open(gif.url, '_blank');
|
|
75146
75146
|
}
|
|
75147
75147
|
} }),
|
|
75148
|
-
react_1$
|
|
75148
|
+
react_1$6.default.createElement(user_1.default, { user: user }))));
|
|
75149
75149
|
};
|
|
75150
75150
|
Attribution.className = 'giphy-attribution';
|
|
75151
75151
|
attribution.default = Attribution;
|
|
75152
|
-
var templateObject_1$2u, templateObject_2$1F, templateObject_3$
|
|
75152
|
+
var templateObject_1$2u, templateObject_2$1F, templateObject_3$17;
|
|
75153
75153
|
|
|
75154
75154
|
var volume = {};
|
|
75155
75155
|
|
|
@@ -75220,19 +75220,19 @@ util$1.isBrowser = typeof window !== 'undefined';
|
|
|
75220
75220
|
util$1.isNavigator = typeof navigator !== 'undefined';
|
|
75221
75221
|
|
|
75222
75222
|
Object.defineProperty(useIsomorphicLayoutEffect$1, "__esModule", { value: true });
|
|
75223
|
-
var react_1$
|
|
75223
|
+
var react_1$5 = React__default;
|
|
75224
75224
|
var util_1$1 = util$1;
|
|
75225
|
-
var useIsomorphicLayoutEffect = util_1$1.isBrowser ? react_1$
|
|
75225
|
+
var useIsomorphicLayoutEffect = util_1$1.isBrowser ? react_1$5.useLayoutEffect : react_1$5.useEffect;
|
|
75226
75226
|
useIsomorphicLayoutEffect$1.default = useIsomorphicLayoutEffect;
|
|
75227
75227
|
|
|
75228
75228
|
Object.defineProperty(useRaf$1, "__esModule", { value: true });
|
|
75229
75229
|
var tslib_1 = require$$0;
|
|
75230
|
-
var react_1$
|
|
75230
|
+
var react_1$4 = React__default;
|
|
75231
75231
|
var useIsomorphicLayoutEffect_1 = tslib_1.__importDefault(useIsomorphicLayoutEffect$1);
|
|
75232
75232
|
var useRaf = function (ms, delay) {
|
|
75233
75233
|
if (ms === void 0) { ms = 1e12; }
|
|
75234
75234
|
if (delay === void 0) { delay = 0; }
|
|
75235
|
-
var _a = react_1$
|
|
75235
|
+
var _a = react_1$4.useState(0), elapsed = _a[0], set = _a[1];
|
|
75236
75236
|
useIsomorphicLayoutEffect_1.default(function () {
|
|
75237
75237
|
var raf;
|
|
75238
75238
|
var timerStop;
|
|
@@ -75274,7 +75274,7 @@ var __importDefault$2 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
75274
75274
|
Object.defineProperty(progressBar, "__esModule", { value: true });
|
|
75275
75275
|
var styled_1$2 = __importDefault$2(require$$0$4);
|
|
75276
75276
|
var js_brand_1 = dist$2;
|
|
75277
|
-
var react_1$
|
|
75277
|
+
var react_1$3 = __importDefault$2(React__default);
|
|
75278
75278
|
var useRaf_1 = __importDefault$2(useRaf$1);
|
|
75279
75279
|
var Bar$1 = styled_1$2.default.div(templateObject_1$2t || (templateObject_1$2t = __makeTemplateObject$4(["\n background: ", ";\n height: ", "px;\n position: absolute;\n width: 5px;\n bottom: 0;\n left: 0;\n opacity: 0.95;\n"], ["\n background: ", ";\n height: ", "px;\n position: absolute;\n width: 5px;\n bottom: 0;\n left: 0;\n opacity: 0.95;\n"])), js_brand_1.giphyWhite, function (props) { return props.barHeight; });
|
|
75280
75280
|
var ProgressBar = function (_a) {
|
|
@@ -75292,7 +75292,7 @@ var ProgressBar = function (_a) {
|
|
|
75292
75292
|
barHeight = 4;
|
|
75293
75293
|
}
|
|
75294
75294
|
percentage = duration < 10 && percentage > 98 ? 100 : percentage;
|
|
75295
|
-
return react_1$
|
|
75295
|
+
return react_1$3.default.createElement(Bar$1, { style: { width: percentage + "%" }, barHeight: barHeight, className: "hide-in-percy" });
|
|
75296
75296
|
};
|
|
75297
75297
|
progressBar.default = ProgressBar;
|
|
75298
75298
|
var templateObject_1$2t;
|
|
@@ -75388,7 +75388,7 @@ var __generator$2 = (commonjsGlobal$7 && commonjsGlobal$7.__generator) || functi
|
|
|
75388
75388
|
Object.defineProperty(video, "__esModule", { value: true });
|
|
75389
75389
|
var js_analytics_1 = dist;
|
|
75390
75390
|
var js_util_1$1 = dist$3;
|
|
75391
|
-
var react_1$
|
|
75391
|
+
var react_1$2 = __importStar$2(React__default);
|
|
75392
75392
|
var util_1 = util;
|
|
75393
75393
|
var quartileEvents = [0.25, 0.5, 0.75];
|
|
75394
75394
|
var videoClassName = 'giphy-video';
|
|
@@ -75407,28 +75407,28 @@ var Video = function (_a) {
|
|
|
75407
75407
|
var muted = _a.muted, _e = _a.ccEnabled, ccEnabled = _e === void 0 ? false : _e, _f = _a.ccLanguage, ccLanguage = _f === void 0 ? 'en' : _f, _g = _a.loop, loop = _g === void 0 ? true : _g, onStateChange = _a.onStateChange, onTimeUpdate = _a.onTimeUpdate, onCanPlay = _a.onCanPlay, onFirstPlay = _a.onFirstPlay, onWaiting = _a.onWaiting, onMuted = _a.onMuted, onError = _a.onError, onEnded = _a.onEnded, onLoop = _a.onLoop, onQuartile = _a.onQuartile, onEndFullscreen = _a.onEndFullscreen, setVideoEl = _a.setVideoEl, gif = _a.gif, width = _a.width, height_ = _a.height, _h = _a.volume, volume = _h === void 0 ? 0.7 : _h, _j = _a.className, className = _j === void 0 ? videoClassName : _j;
|
|
75408
75408
|
var height = height_ || js_util_1$1.getGifHeight(gif, width);
|
|
75409
75409
|
// state
|
|
75410
|
-
var _k = react_1$
|
|
75411
|
-
var seek = react_1$
|
|
75410
|
+
var _k = react_1$2.useState(js_util_1$1.getBestVideo(gif.video, width, height)), media = _k[0], setMedia = _k[1];
|
|
75411
|
+
var seek = react_1$2.useRef(0);
|
|
75412
75412
|
if (!media) {
|
|
75413
75413
|
// Not all gif requests have video content
|
|
75414
75414
|
// use { type: 'videos' } for search or trending endpoints
|
|
75415
75415
|
console.warn("GiphyJS No video content for id: " + gif.id);
|
|
75416
75416
|
}
|
|
75417
|
-
var mountTime = react_1$
|
|
75418
|
-
var hasPlayingFired = react_1$
|
|
75419
|
-
var loopNumber = react_1$
|
|
75420
|
-
var waitingCount = react_1$
|
|
75421
|
-
var quartilesFired = react_1$
|
|
75417
|
+
var mountTime = react_1$2.useRef(Date.now());
|
|
75418
|
+
var hasPlayingFired = react_1$2.useRef(false);
|
|
75419
|
+
var loopNumber = react_1$2.useRef(0);
|
|
75420
|
+
var waitingCount = react_1$2.useRef(0);
|
|
75421
|
+
var quartilesFired = react_1$2.useRef(new Set());
|
|
75422
75422
|
// reset the above when the gif.id changes
|
|
75423
|
-
react_1$
|
|
75423
|
+
react_1$2.useEffect(function () {
|
|
75424
75424
|
mountTime.current = Date.now();
|
|
75425
75425
|
hasPlayingFired.current = false;
|
|
75426
75426
|
loopNumber.current = 1;
|
|
75427
75427
|
waitingCount.current = 0;
|
|
75428
75428
|
quartilesFired.current = new Set();
|
|
75429
75429
|
}, [gif.id]);
|
|
75430
|
-
var videoEl = react_1$
|
|
75431
|
-
react_1$
|
|
75430
|
+
var videoEl = react_1$2.useRef(null);
|
|
75431
|
+
react_1$2.useEffect(function () {
|
|
75432
75432
|
// when the width and height change, check if there's a new url
|
|
75433
75433
|
var newMedia = js_util_1$1.getBestVideo(gif.video, width, height);
|
|
75434
75434
|
if (videoEl.current && (media === null || media === void 0 ? void 0 : media.url) && newMedia.url !== media.url) {
|
|
@@ -75441,13 +75441,13 @@ var Video = function (_a) {
|
|
|
75441
75441
|
setMedia(newMedia);
|
|
75442
75442
|
}
|
|
75443
75443
|
}, [width, height_, gif.video, height, media === null || media === void 0 ? void 0 : media.url, gif.id]);
|
|
75444
|
-
react_1$
|
|
75444
|
+
react_1$2.useEffect(function () {
|
|
75445
75445
|
if (videoEl.current && (media === null || media === void 0 ? void 0 : media.url) && seek.current) {
|
|
75446
75446
|
videoEl.current.currentTime = seek.current;
|
|
75447
75447
|
seek.current = 0;
|
|
75448
75448
|
}
|
|
75449
75449
|
}, [media === null || media === void 0 ? void 0 : media.url, seek]);
|
|
75450
|
-
var _onError = react_1$
|
|
75450
|
+
var _onError = react_1$2.useCallback(function () {
|
|
75451
75451
|
var _a;
|
|
75452
75452
|
var el = videoEl.current;
|
|
75453
75453
|
var code = (_a = el === null || el === void 0 ? void 0 : el.error) === null || _a === void 0 ? void 0 : _a.code;
|
|
@@ -75457,7 +75457,7 @@ var Video = function (_a) {
|
|
|
75457
75457
|
onError === null || onError === void 0 ? void 0 : onError(code);
|
|
75458
75458
|
}
|
|
75459
75459
|
}, [onError]);
|
|
75460
|
-
var _onPlaying = react_1$
|
|
75460
|
+
var _onPlaying = react_1$2.useCallback(function () {
|
|
75461
75461
|
onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange('playing');
|
|
75462
75462
|
if (!hasPlayingFired.current) {
|
|
75463
75463
|
hasPlayingFired.current = true;
|
|
@@ -75467,8 +75467,8 @@ var Video = function (_a) {
|
|
|
75467
75467
|
onFirstPlay === null || onFirstPlay === void 0 ? void 0 : onFirstPlay(Date.now() - mountTime.current);
|
|
75468
75468
|
}
|
|
75469
75469
|
}, [onFirstPlay, onStateChange, gif]);
|
|
75470
|
-
var _onPaused = react_1$
|
|
75471
|
-
var _onTimeUpdate = react_1$
|
|
75470
|
+
var _onPaused = react_1$2.useCallback(function () { return onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange('paused'); }, [onStateChange]);
|
|
75471
|
+
var _onTimeUpdate = react_1$2.useCallback(function () {
|
|
75472
75472
|
var el = videoEl.current;
|
|
75473
75473
|
if (el) {
|
|
75474
75474
|
var playhead_1 = el.currentTime;
|
|
@@ -75482,15 +75482,15 @@ var Video = function (_a) {
|
|
|
75482
75482
|
onTimeUpdate === null || onTimeUpdate === void 0 ? void 0 : onTimeUpdate(playhead_1 || 0);
|
|
75483
75483
|
}
|
|
75484
75484
|
}, [onQuartile, onTimeUpdate]);
|
|
75485
|
-
var _onCanPlay = react_1$
|
|
75486
|
-
var _onWaiting = react_1$
|
|
75485
|
+
var _onCanPlay = react_1$2.useCallback(function () { return onCanPlay === null || onCanPlay === void 0 ? void 0 : onCanPlay(); }, [onCanPlay]);
|
|
75486
|
+
var _onWaiting = react_1$2.useCallback(function () {
|
|
75487
75487
|
var el = videoEl.current;
|
|
75488
75488
|
// we get a waiting event after a loop, so ignore the first one while the play head is 0
|
|
75489
75489
|
if ((el === null || el === void 0 ? void 0 : el.currentTime) !== 0 && (el === null || el === void 0 ? void 0 : el.networkState) !== Network.IDLE) {
|
|
75490
75490
|
onWaiting === null || onWaiting === void 0 ? void 0 : onWaiting(++waitingCount.current);
|
|
75491
75491
|
}
|
|
75492
75492
|
}, [onWaiting]);
|
|
75493
|
-
var _onEnded = react_1$
|
|
75493
|
+
var _onEnded = react_1$2.useCallback(function () {
|
|
75494
75494
|
// helps prevent two ended events when changing media
|
|
75495
75495
|
if (!hasPlayingFired.current) {
|
|
75496
75496
|
return;
|
|
@@ -75502,8 +75502,8 @@ var Video = function (_a) {
|
|
|
75502
75502
|
loopNumber.current = loopNumber.current + 1;
|
|
75503
75503
|
onEnded === null || onEnded === void 0 ? void 0 : onEnded();
|
|
75504
75504
|
}, [onEnded, loop, onLoop]);
|
|
75505
|
-
var _onEndFullscreen = react_1$
|
|
75506
|
-
var tryAutoPlayWithSound = react_1$
|
|
75505
|
+
var _onEndFullscreen = react_1$2.useCallback(function () { return onEndFullscreen === null || onEndFullscreen === void 0 ? void 0 : onEndFullscreen(); }, [onEndFullscreen]);
|
|
75506
|
+
var tryAutoPlayWithSound = react_1$2.useCallback(function (videoEl) { return __awaiter$2(void 0, void 0, void 0, function () {
|
|
75507
75507
|
var promisePlay;
|
|
75508
75508
|
return __generator$2(this, function (_a) {
|
|
75509
75509
|
switch (_a.label) {
|
|
@@ -75532,7 +75532,7 @@ var Video = function (_a) {
|
|
|
75532
75532
|
}
|
|
75533
75533
|
});
|
|
75534
75534
|
}); }, [onMuted]);
|
|
75535
|
-
react_1$
|
|
75535
|
+
react_1$2.useEffect(function () {
|
|
75536
75536
|
var el = videoEl.current;
|
|
75537
75537
|
if (el) {
|
|
75538
75538
|
tryAutoPlayWithSound(el);
|
|
@@ -75543,7 +75543,7 @@ var Video = function (_a) {
|
|
|
75543
75543
|
}
|
|
75544
75544
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75545
75545
|
}, []);
|
|
75546
|
-
react_1$
|
|
75546
|
+
react_1$2.useEffect(function () {
|
|
75547
75547
|
var el = videoEl.current;
|
|
75548
75548
|
if (el) {
|
|
75549
75549
|
el.addEventListener('play', _onPlaying);
|
|
@@ -75569,7 +75569,7 @@ var Video = function (_a) {
|
|
|
75569
75569
|
};
|
|
75570
75570
|
}, [_onPlaying, _onPaused, _onError, _onTimeUpdate, _onCanPlay, _onEnded, _onWaiting, _onEndFullscreen]);
|
|
75571
75571
|
var captionSrc = (_d = (_c = (_b = gif.video) === null || _b === void 0 ? void 0 : _b.captions) === null || _c === void 0 ? void 0 : _c[ccLanguage]) === null || _d === void 0 ? void 0 : _d.vtt;
|
|
75572
|
-
return (media === null || media === void 0 ? void 0 : media.url) ? (react_1$
|
|
75572
|
+
return (media === null || media === void 0 ? void 0 : media.url) ? (react_1$2.default.createElement("video", { crossOrigin: "anonymous", draggable: true, className: className, width: width, height: height, muted: muted, autoPlay: true, playsInline: true, ref: videoEl, src: media === null || media === void 0 ? void 0 : media.url }, ccEnabled && captionSrc && (react_1$2.default.createElement("track", { label: "English", kind: "subtitles", srcLang: ccLanguage, src: captionSrc, default: true })))) : null;
|
|
75573
75573
|
};
|
|
75574
75574
|
Video.className = videoClassName;
|
|
75575
75575
|
video.default = Video;
|
|
@@ -75614,7 +75614,7 @@ var __importDefault$1 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
75614
75614
|
Object.defineProperty(video$1, "__esModule", { value: true });
|
|
75615
75615
|
var styled_1$1 = __importDefault$1(require$$0$4);
|
|
75616
75616
|
var js_util_1 = dist$3;
|
|
75617
|
-
var react_1$
|
|
75617
|
+
var react_1$1 = __importStar$1(React__default);
|
|
75618
75618
|
var react_use_1 = require$$3;
|
|
75619
75619
|
var attribution_1 = __importDefault$1(attribution);
|
|
75620
75620
|
var volume_1$1 = volume;
|
|
@@ -75622,7 +75622,7 @@ var progress_bar_1 = __importDefault$1(progressBar);
|
|
|
75622
75622
|
var video_1 = __importDefault$1(video);
|
|
75623
75623
|
var Container$4 = styled_1$1.default.div(templateObject_1$2s || (templateObject_1$2s = __makeTemplateObject$3(["\n position: relative;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: black;\n font-family: interface, helvetica, arial;\n -webkit-font-smoothing: antialiased;\n"], ["\n position: relative;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: black;\n font-family: interface, helvetica, arial;\n -webkit-font-smoothing: antialiased;\n"])));
|
|
75624
75624
|
var Volume = styled_1$1.default.div(templateObject_2$1E || (templateObject_2$1E = __makeTemplateObject$3(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n"])));
|
|
75625
|
-
var Controls = styled_1$1.default.div(templateObject_3$
|
|
75625
|
+
var Controls = styled_1$1.default.div(templateObject_3$16 || (templateObject_3$16 = __makeTemplateObject$3(["\n position: absolute;\n top: 10px;\n right: 10px;\n left: 10px;\n bottom: 0;\n display: flex;\n justify-content: space-between;\n opacity: ", ";\n transition: opacity ease-out 250ms;\n align-items: flex-start;\n"], ["\n position: absolute;\n top: 10px;\n right: 10px;\n left: 10px;\n bottom: 0;\n display: flex;\n justify-content: space-between;\n opacity: ", ";\n transition: opacity ease-out 250ms;\n align-items: flex-start;\n"])), function (props) { return (props.isHovered ? 1 : 0); });
|
|
75626
75626
|
var Title$a = styled_1$1.default.div(templateObject_4$M || (templateObject_4$M = __makeTemplateObject$3(["\n font-size: 26px;\n color: white;\n margin-bottom: 5px;\n font-weight: bold;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n"], ["\n font-size: 26px;\n color: white;\n margin-bottom: 5px;\n font-weight: bold;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n"])));
|
|
75627
75627
|
var TitleContainer$1 = styled_1$1.default.div(templateObject_5$F || (templateObject_5$F = __makeTemplateObject$3(["\n position: relative;\n min-width: 0;\n"], ["\n position: relative;\n min-width: 0;\n"])));
|
|
75628
75628
|
var Gradient = styled_1$1.default.div(templateObject_6$u || (templateObject_6$u = __makeTemplateObject$3(["\n &:before {\n background: linear-gradient(rgba(18, 18, 18, 0.6), rgba(0, 0, 0, 0));\n content: '';\n height: ", "px;\n left: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n &:after {\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n content: '';\n height: ", "px;\n left: 0;\n pointer-events: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n }\n"], ["\n &:before {\n background: linear-gradient(rgba(18, 18, 18, 0.6), rgba(0, 0, 0, 0));\n content: '';\n height: ", "px;\n left: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n &:after {\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n content: '';\n height: ", "px;\n left: 0;\n pointer-events: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n }\n"])), function (props) { return (props.isLargePlayer ? 125 : 75); }, function (props) { return (props.isLargePlayer ? 125 : 75); });
|
|
@@ -75630,20 +75630,20 @@ var LARGE_PLAYER_HEIGHT = 300;
|
|
|
75630
75630
|
var AUTO_HIDE_TIMEOUT = 4000;
|
|
75631
75631
|
var VideoPlayer = function (props) {
|
|
75632
75632
|
var width = props.width, hideMute = props.hideMute, hideAttribution = props.hideAttribution, hideProgressBar = props.hideProgressBar, className = props.className, persistentControls = props.persistentControls, gif = props.gif, Overlay = props.overlay;
|
|
75633
|
-
var _a = react_1$
|
|
75634
|
-
var _b = react_1$
|
|
75635
|
-
var _c = react_1$
|
|
75636
|
-
var _d = react_1$
|
|
75633
|
+
var _a = react_1$1.useState(false), isHovered = _a[0], setIsHovered = _a[1];
|
|
75634
|
+
var _b = react_1$1.useState(null), videoEl = _b[0], _setVideoEl = _b[1];
|
|
75635
|
+
var _c = react_1$1.useState(props.muted), muted = _c[0], setMuted = _c[1];
|
|
75636
|
+
var _d = react_1$1.useState(false), mutedByBrowser = _d[0], setMutedByBrowser = _d[1];
|
|
75637
75637
|
var setVideoEl = props.setVideoEl, onMuted = props.onMuted, onUserMuted = props.onUserMuted;
|
|
75638
75638
|
var height = props.height || js_util_1.getGifHeight(gif, width);
|
|
75639
75639
|
var _e = react_use_1.useTimeoutFn(function () {
|
|
75640
75640
|
setIsHovered(false);
|
|
75641
75641
|
}, AUTO_HIDE_TIMEOUT), cancelHideTimeout = _e[1], resetHideTimeout = _e[2];
|
|
75642
|
-
var combinedOnMuted = react_1$
|
|
75642
|
+
var combinedOnMuted = react_1$1.useCallback(function (args) {
|
|
75643
75643
|
onMuted === null || onMuted === void 0 ? void 0 : onMuted(args);
|
|
75644
75644
|
setMutedByBrowser(args);
|
|
75645
75645
|
}, [setMutedByBrowser, onMuted]);
|
|
75646
|
-
var combinedSetVideoEl = react_1$
|
|
75646
|
+
var combinedSetVideoEl = react_1$1.useCallback(function (args) {
|
|
75647
75647
|
setVideoEl === null || setVideoEl === void 0 ? void 0 : setVideoEl(args);
|
|
75648
75648
|
_setVideoEl(args);
|
|
75649
75649
|
}, [setVideoEl, _setVideoEl]);
|
|
@@ -75656,13 +75656,13 @@ var VideoPlayer = function (props) {
|
|
|
75656
75656
|
setMuted(!muted);
|
|
75657
75657
|
}
|
|
75658
75658
|
};
|
|
75659
|
-
react_1$
|
|
75659
|
+
react_1$1.useEffect(function () {
|
|
75660
75660
|
setMuted(props.muted);
|
|
75661
75661
|
}, [props.muted]);
|
|
75662
75662
|
var showControls = persistentControls || isHovered;
|
|
75663
75663
|
var isLargePlayer = height >= LARGE_PLAYER_HEIGHT;
|
|
75664
75664
|
// Manage auto hide controls
|
|
75665
|
-
react_1$
|
|
75665
|
+
react_1$1.useEffect(function () {
|
|
75666
75666
|
if (showControls) {
|
|
75667
75667
|
resetHideTimeout();
|
|
75668
75668
|
}
|
|
@@ -75671,7 +75671,7 @@ var VideoPlayer = function (props) {
|
|
|
75671
75671
|
}
|
|
75672
75672
|
return function () { return cancelHideTimeout(); };
|
|
75673
75673
|
}, [showControls, cancelHideTimeout, resetHideTimeout]);
|
|
75674
|
-
return (react_1$
|
|
75674
|
+
return (react_1$1.default.createElement(Container$4, { className: className, style: { width: width, height: height }, onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onMouseMove: function () {
|
|
75675
75675
|
setIsHovered(true);
|
|
75676
75676
|
resetHideTimeout();
|
|
75677
75677
|
}, onClick: function (e) {
|
|
@@ -75684,28 +75684,28 @@ var VideoPlayer = function (props) {
|
|
|
75684
75684
|
e.preventDefault();
|
|
75685
75685
|
toggleMute();
|
|
75686
75686
|
} },
|
|
75687
|
-
react_1$
|
|
75688
|
-
showControls && react_1$
|
|
75689
|
-
react_1$
|
|
75690
|
-
react_1$
|
|
75691
|
-
isLargePlayer && (react_1$
|
|
75687
|
+
react_1$1.default.createElement(video_1.default, __assign$3({}, props, { onMuted: combinedOnMuted, setVideoEl: combinedSetVideoEl, muted: muted })),
|
|
75688
|
+
showControls && react_1$1.default.createElement(Gradient, { isLargePlayer: isLargePlayer }),
|
|
75689
|
+
react_1$1.default.createElement(Controls, { isHovered: showControls },
|
|
75690
|
+
react_1$1.default.createElement(TitleContainer$1, null,
|
|
75691
|
+
isLargePlayer && (react_1$1.default.createElement(Title$a, { onClick: function (e) {
|
|
75692
75692
|
e.preventDefault();
|
|
75693
75693
|
e.stopPropagation();
|
|
75694
75694
|
window.open(gif.url, '_blank');
|
|
75695
75695
|
} }, gif.title)),
|
|
75696
|
-
videoEl && !hideAttribution ? react_1$
|
|
75697
|
-
!hideMute && react_1$
|
|
75698
|
-
showControls && !hideProgressBar && videoEl ? react_1$
|
|
75699
|
-
Overlay && react_1$
|
|
75696
|
+
videoEl && !hideAttribution ? react_1$1.default.createElement(attribution_1.default, { gif: gif }) : null),
|
|
75697
|
+
!hideMute && react_1$1.default.createElement(Volume, null, muted || mutedByBrowser ? react_1$1.default.createElement(volume_1$1.VolumeOffIcon, null) : react_1$1.default.createElement(volume_1$1.VolumeOnIcon, null))),
|
|
75698
|
+
showControls && !hideProgressBar && videoEl ? react_1$1.default.createElement(progress_bar_1.default, { videoEl: videoEl }) : null,
|
|
75699
|
+
Overlay && react_1$1.default.createElement(Overlay, { gif: gif, isHovered: isHovered, width: width, height: height })));
|
|
75700
75700
|
};
|
|
75701
75701
|
var VideoWrapper = function (props) {
|
|
75702
75702
|
if (props.overlay && !props.controls) {
|
|
75703
75703
|
console.warn(js_util_1.Logger.PREFIX + ": Overlays only work when controls are enabled");
|
|
75704
75704
|
}
|
|
75705
|
-
return props.controls ? react_1$
|
|
75705
|
+
return props.controls ? react_1$1.default.createElement(VideoPlayer, __assign$3({}, props)) : react_1$1.default.createElement(video_1.default, __assign$3({}, props));
|
|
75706
75706
|
};
|
|
75707
75707
|
video$1.default = VideoWrapper;
|
|
75708
|
-
var templateObject_1$2s, templateObject_2$1E, templateObject_3$
|
|
75708
|
+
var templateObject_1$2s, templateObject_2$1E, templateObject_3$16, templateObject_4$M, templateObject_5$F, templateObject_6$u;
|
|
75709
75709
|
|
|
75710
75710
|
var playPause = {};
|
|
75711
75711
|
|
|
@@ -75777,25 +75777,25 @@ var __importDefault = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) ||
|
|
|
75777
75777
|
};
|
|
75778
75778
|
Object.defineProperty(videoOverlay, "__esModule", { value: true });
|
|
75779
75779
|
var styled_1 = __importDefault(require$$0$4);
|
|
75780
|
-
var react_1
|
|
75780
|
+
var react_1 = __importStar(React__default);
|
|
75781
75781
|
var _1 = __importDefault(video$1);
|
|
75782
75782
|
var volume_1 = volume;
|
|
75783
75783
|
var VideoContainer = styled_1.default.div(templateObject_1$2r || (templateObject_1$2r = __makeTemplateObject$2(["\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n"])));
|
|
75784
75784
|
var VideoStyled = styled_1.default(_1.default)(templateObject_2$1D || (templateObject_2$1D = __makeTemplateObject$2(["\n height: 100%;\n display: inline-block;\n object-fit: fill;\n pointer-events: none;\n background: rgb(0, 0, 0, 0);\n"], ["\n height: 100%;\n display: inline-block;\n object-fit: fill;\n pointer-events: none;\n background: rgb(0, 0, 0, 0);\n"])));
|
|
75785
|
-
var Button$2 = styled_1.default.div(templateObject_3$
|
|
75785
|
+
var Button$2 = styled_1.default.div(templateObject_3$15 || (templateObject_3$15 = __makeTemplateObject$2(["\n position: absolute;\n top: 6px;\n right: 6px;\n cursor: pointer;\n opacity: ", ";\n transition: opacity ease-out 800ms;\n"], ["\n position: absolute;\n top: 6px;\n right: 6px;\n cursor: pointer;\n opacity: ", ";\n transition: opacity ease-out 800ms;\n"])), function (props) { return (props.isHovered ? 1 : 0.8); });
|
|
75786
75786
|
var speakerClassName = 'giphy-video-overlay-button';
|
|
75787
75787
|
var VolumeButton = function (_a) {
|
|
75788
75788
|
var muted = _a.muted, toggleMute = _a.toggleMute, mutedByBrowser = _a.mutedByBrowser, isHovered = _a.isHovered;
|
|
75789
|
-
return (react_1
|
|
75789
|
+
return (react_1.default.createElement(Button$2, { className: speakerClassName, onClick: function (e) {
|
|
75790
75790
|
e.preventDefault();
|
|
75791
75791
|
e.stopPropagation();
|
|
75792
75792
|
toggleMute();
|
|
75793
|
-
}, isHovered: isHovered }, muted || mutedByBrowser || !isHovered ? react_1
|
|
75793
|
+
}, isHovered: isHovered }, muted || mutedByBrowser || !isHovered ? react_1.default.createElement(volume_1.VolumeOffIcon, null) : react_1.default.createElement(volume_1.VolumeOnIcon, null)));
|
|
75794
75794
|
};
|
|
75795
75795
|
var VideoOverlay = function (_a) {
|
|
75796
75796
|
var gif = _a.gif, isHovered = _a.isHovered, hideMuteButton = _a.hideMuteButton, width = _a.width, height = _a.height, className = _a.className, _b = _a.muted, userPrefMuted = _b === void 0 ? false : _b, onUserMuted = _a.onUserMuted;
|
|
75797
|
-
var _c = react_1
|
|
75798
|
-
var _d = react_1
|
|
75797
|
+
var _c = react_1.useState(userPrefMuted), muted = _c[0], setMuted = _c[1];
|
|
75798
|
+
var _d = react_1.useState(false), mutedByBrowser = _d[0], setMutedByBrowser = _d[1];
|
|
75799
75799
|
var toggleMute = function () {
|
|
75800
75800
|
if (mutedByBrowser) {
|
|
75801
75801
|
setMutedByBrowser(false);
|
|
@@ -75806,17 +75806,17 @@ var VideoOverlay = function (_a) {
|
|
|
75806
75806
|
setMuted(!muted);
|
|
75807
75807
|
}
|
|
75808
75808
|
};
|
|
75809
|
-
react_1
|
|
75809
|
+
react_1.useEffect(function () {
|
|
75810
75810
|
setMuted(userPrefMuted);
|
|
75811
75811
|
}, [userPrefMuted, setMuted]);
|
|
75812
75812
|
var props = { toggleMute: toggleMute, muted: muted, mutedByBrowser: mutedByBrowser };
|
|
75813
|
-
return (react_1
|
|
75814
|
-
isHovered && (react_1
|
|
75815
|
-
!hideMuteButton && react_1
|
|
75813
|
+
return (react_1.default.createElement(VideoContainer, { className: className },
|
|
75814
|
+
isHovered && (react_1.default.createElement(VideoStyled, { gif: gif, key: gif.id, loop: true, controls: true, hideAttribution: true, hideMute: true, persistentControls: true, muted: muted, width: width, height: height, onMuted: setMutedByBrowser })),
|
|
75815
|
+
!hideMuteButton && react_1.default.createElement(VolumeButton, __assign$2({}, props, { isHovered: isHovered }))));
|
|
75816
75816
|
};
|
|
75817
75817
|
VideoOverlay.imgClassName = speakerClassName;
|
|
75818
75818
|
videoOverlay.default = VideoOverlay;
|
|
75819
|
-
var templateObject_1$2r, templateObject_2$1D, templateObject_3$
|
|
75819
|
+
var templateObject_1$2r, templateObject_2$1D, templateObject_3$15;
|
|
75820
75820
|
|
|
75821
75821
|
var _args = [
|
|
75822
75822
|
[
|
|
@@ -75999,7 +75999,7 @@ js_util_1.appendGiphySDKRequestHeader("X-GIPHY-SDK-VERSION", version);
|
|
|
75999
75999
|
|
|
76000
76000
|
}(dist$4));
|
|
76001
76001
|
|
|
76002
|
-
function useDebouncedCallback
|
|
76002
|
+
function useDebouncedCallback(callback, delay, options) {
|
|
76003
76003
|
if (options === void 0) { options = {}; }
|
|
76004
76004
|
var maxWait = options.maxWait;
|
|
76005
76005
|
var maxWaitHandler = useRef$1(null);
|
|
@@ -76069,13 +76069,13 @@ function useDebouncedCallback$3(callback, delay, options) {
|
|
|
76069
76069
|
return [debouncedCallback, cancelDebouncedCallback, callPending];
|
|
76070
76070
|
}
|
|
76071
76071
|
|
|
76072
|
-
function valueEquality
|
|
76072
|
+
function valueEquality(left, right) {
|
|
76073
76073
|
return left === right;
|
|
76074
76074
|
}
|
|
76075
|
-
function useDebounce
|
|
76076
|
-
var eq = options && options.equalityFn ? options.equalityFn : valueEquality
|
|
76075
|
+
function useDebounce(value, delay, options) {
|
|
76076
|
+
var eq = options && options.equalityFn ? options.equalityFn : valueEquality;
|
|
76077
76077
|
var _a = useState$2(value), state = _a[0], dispatch = _a[1];
|
|
76078
|
-
var _b = useDebouncedCallback
|
|
76078
|
+
var _b = useDebouncedCallback(useCallback(function (value) { return dispatch(value); }, []), delay, options), callback = _b[0], cancel = _b[1], callPending = _b[2];
|
|
76079
76079
|
var previousValue = useRef$1(value);
|
|
76080
76080
|
useEffect$1(function () {
|
|
76081
76081
|
// We need to use this condition otherwise we will run debounce timer for the first render (including maxWait option)
|
|
@@ -78890,7 +78890,10 @@ var PeoplePicker = function PeoplePicker(props) {
|
|
|
78890
78890
|
inputProps: {
|
|
78891
78891
|
id: props.inputId,
|
|
78892
78892
|
required: props.required,
|
|
78893
|
-
'aria-required': props.required
|
|
78893
|
+
'aria-required': props.required,
|
|
78894
|
+
'aria-label': props.inputAriaLabelResourceKey ? formatMessage({
|
|
78895
|
+
id: props.inputAriaLabelResourceKey
|
|
78896
|
+
}) : null
|
|
78894
78897
|
},
|
|
78895
78898
|
removeButtonAriaLabel: formatMessage({
|
|
78896
78899
|
id: 'AriaLabel.removeUserButton'
|
|
@@ -83528,11 +83531,11 @@ var InternalTopActionButton = function InternalTopActionButton(props) {
|
|
|
83528
83531
|
_styled(InternalTopActionButton).withConfig({
|
|
83529
83532
|
displayName: "TopActionButton",
|
|
83530
83533
|
componentId: "sc-1lam7c6-0"
|
|
83531
|
-
})(templateObject_1$w$
|
|
83534
|
+
})(templateObject_1$w$2 || (templateObject_1$w$2 = __makeTemplateObject$1(["\n && {\n font-size: initial;\n font-weight: bold;\n margin: 0 0 ", "px 0;\n\n display: flex;\n align-items: center;\n align-self: flex-start;\n\n color: ", ";\n }\n\n > i {\n padding-right: 8px;\n }\n"], ["\n && {\n font-size: initial;\n font-weight: bold;\n margin: 0 0 ", "px 0;\n\n display: flex;\n align-items: center;\n align-self: flex-start;\n\n color: ", ";\n }\n\n > i {\n padding-right: 8px;\n }\n"])), spacingS, function (p) {
|
|
83532
83535
|
return p.theme.palette.accent;
|
|
83533
83536
|
});
|
|
83534
83537
|
|
|
83535
|
-
var templateObject_1$w$
|
|
83538
|
+
var templateObject_1$w$2;
|
|
83536
83539
|
|
|
83537
83540
|
_styled(IconButton).withConfig({
|
|
83538
83541
|
displayName: "HeaderMenuButton__MenuButton",
|
|
@@ -83917,9 +83920,9 @@ var SearchBoxLargeScreen = _styled.div.withConfig({
|
|
|
83917
83920
|
var SearchIconSmallScreen = _styled.div.withConfig({
|
|
83918
83921
|
displayName: "ToolbarSearch__SearchIconSmallScreen",
|
|
83919
83922
|
componentId: "sc-1f480ry-1"
|
|
83920
|
-
})(templateObject_2$k$
|
|
83923
|
+
})(templateObject_2$k$1 || (templateObject_2$k$1 = __makeTemplateObject$1(["\n @media (min-width: ", "px) {\n display: none;\n }\n"], ["\n @media (min-width: ", "px) {\n display: none;\n }\n"])), minScreenSize.medium);
|
|
83921
83924
|
|
|
83922
|
-
var templateObject_1$p$2, templateObject_2$k$
|
|
83925
|
+
var templateObject_1$p$2, templateObject_2$k$1;
|
|
83923
83926
|
|
|
83924
83927
|
var Toolbar$1 = function Toolbar(_a) {
|
|
83925
83928
|
var leftSide = _a.leftSide,
|
|
@@ -84160,7 +84163,7 @@ var GifSelector = function GifSelector(_a) {
|
|
|
84160
84163
|
searchText = _d[0],
|
|
84161
84164
|
setSearchText = _d[1];
|
|
84162
84165
|
|
|
84163
|
-
var debouncedSearchText = useDebounce
|
|
84166
|
+
var debouncedSearchText = useDebounce(searchText, 500)[0];
|
|
84164
84167
|
var windowSize = useWindowSize$2();
|
|
84165
84168
|
|
|
84166
84169
|
var _e = usePromise$2(getGifs, null, [debouncedSearchText]),
|
|
@@ -86499,7 +86502,7 @@ var Content$a = _styled.div.withConfig({
|
|
|
86499
86502
|
var SvgContainer = _styled.div.withConfig({
|
|
86500
86503
|
displayName: "PageAlert__SvgContainer",
|
|
86501
86504
|
componentId: "sc-gj7gx6-2"
|
|
86502
|
-
})(templateObject_3$
|
|
86505
|
+
})(templateObject_3$14 || (templateObject_3$14 = __makeTemplateObject$1(["\n margin: 1rem auto;\n width: 100%;\n opacity: 0.7;\n\n > svg {\n height: auto;\n width: 10rem;\n }\n"], ["\n margin: 1rem auto;\n width: 100%;\n opacity: 0.7;\n\n > svg {\n height: auto;\n width: 10rem;\n }\n"])));
|
|
86503
86506
|
|
|
86504
86507
|
var Text = _styled.p.withConfig({
|
|
86505
86508
|
displayName: "PageAlert__Text",
|
|
@@ -86516,7 +86519,7 @@ _styled.div.withConfig({
|
|
|
86516
86519
|
componentId: "sc-gj7gx6-5"
|
|
86517
86520
|
})(templateObject_6$t || (templateObject_6$t = __makeTemplateObject$1(["\n display: flex;\n justify-content: space-around;\n"], ["\n display: flex;\n justify-content: space-around;\n"])));
|
|
86518
86521
|
|
|
86519
|
-
var templateObject_1$2q, templateObject_2$1C, templateObject_3$
|
|
86522
|
+
var templateObject_1$2q, templateObject_2$1C, templateObject_3$14, templateObject_4$L, templateObject_5$E, templateObject_6$t;
|
|
86520
86523
|
var propTypes$1 = {
|
|
86521
86524
|
exports: {}
|
|
86522
86525
|
};
|
|
@@ -87648,9 +87651,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
|
|
|
87648
87651
|
}), void 0);
|
|
87649
87652
|
};
|
|
87650
87653
|
|
|
87651
|
-
var version$1 = "0.4.0-preview.
|
|
87652
|
-
var buildId = "
|
|
87653
|
-
var commitId = "
|
|
87654
|
+
var version$1 = "0.4.0-preview.296";
|
|
87655
|
+
var buildId = "100232";
|
|
87656
|
+
var commitId = "5ea8ee09d59b87e17096043f6b3a556e5df43c0f";
|
|
87654
87657
|
var isCustomerBuild = false;
|
|
87655
87658
|
var buildInfo = {
|
|
87656
87659
|
version: version$1,
|
|
@@ -131514,10 +131517,10 @@ return "@[@"+user.displayName+"]("+user.id+")";}var ContentDisplay=function Cont
|
|
|
131514
131517
|
if(path==null&&port==null){var segments=urlMatch.split('.');if(segments.length<2){return null;}var lastSegment=segments[segments.length-1];var domainName=segments[segments.length-2];if(// all segments must not be empty
|
|
131515
131518
|
segments.some(function(s){return s==='';})||// domainName must at least be 3 characters
|
|
131516
131519
|
domainName.length<3||// last segment may not be a number
|
|
131517
|
-
lastSegment.match(/^\d+$/)){return null;}}if(!linkify.match(urlMatch)){return null;}return {url:"https://"+urlMatch,label:urlMatch};}function transformContent(content){var matches=__spreadArray([],Array.from(getAllMatches(content,regex)));var result=[];var lastStart=0;for(var _i=0,matches_1=matches;_i<matches_1.length;_i++){var match=matches_1[_i];result.push(content.substring(lastStart,match.index));var email=match[2];var urlMatch=match[3];var protocol=match[4];var port=match[6];var path=match[7];var fullMention=match[8];var name_1=match[10];var id=match[11];var hashtag=match[12];var d3Link=match[14];var link=getLink(email,urlMatch,protocol,path,port);result.push(__assign({fullMatch:match[0],isLineBreak:match[1]!=null,hashtag:hashtag,link:d3Link?{url:d3Link}:link},fullMention&&{mention:{name:name_1,id:id}}));lastStart=match.index+match[0].length;}result.push(content.substring(lastStart));return result;}var Mention=function Mention(_a){var userDisplayName=_a.userDisplayName,userId=_a.userId;var _b=useState$2(false),showUserInfo=_b[0],setShowUserInfo=_b[1];var mentionContainer=useRef$1(null);return jsxs(Fragment,{children:[jsx$1(MentionHost,__assign({"data-mention":true,onClick:function(){return setShowUserInfo(true);},ref:mentionContainer},{children:userDisplayName}),void 0),showUserInfo&&jsx$1(Callout,__assign({target:mentionContainer.current,directionalHint:DirectionalHint.bottomCenter,onDismiss:function(){return setShowUserInfo(false);},calloutMaxWidth:300},{children:jsx$1(CalloutContent,{children:jsx$1(UserDetails,{upn:null,id:userId,showAvatar:true},void 0)},void 0)}),void 0)]},void 0);};var MentionHost=_styled.span.withConfig({displayName:"ContentDisplay__MentionHost",componentId:"sc-1yxe01n-0"})(templateObject_1$2n||(templateObject_1$2n=__makeTemplateObject(["\n font-weight: bold;\n cursor: pointer;\n color: ",";\n"],["\n font-weight: bold;\n cursor: pointer;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var CalloutContent=_styled.div.withConfig({displayName:"ContentDisplay__CalloutContent",componentId:"sc-1yxe01n-1"})(templateObject_2$1z||(templateObject_2$1z=__makeTemplateObject(["\n padding: ","px ","px;\n"],["\n padding: ","px ","px;\n"])),spacingM-5,spacingM);var HashtagLink=_styled(Link$2).withConfig({displayName:"ContentDisplay__HashtagLink",componentId:"sc-1yxe01n-2"})(templateObject_3$
|
|
131520
|
+
lastSegment.match(/^\d+$/)){return null;}}if(!linkify.match(urlMatch)){return null;}return {url:"https://"+urlMatch,label:urlMatch};}function transformContent(content){var matches=__spreadArray([],Array.from(getAllMatches(content,regex)));var result=[];var lastStart=0;for(var _i=0,matches_1=matches;_i<matches_1.length;_i++){var match=matches_1[_i];result.push(content.substring(lastStart,match.index));var email=match[2];var urlMatch=match[3];var protocol=match[4];var port=match[6];var path=match[7];var fullMention=match[8];var name_1=match[10];var id=match[11];var hashtag=match[12];var d3Link=match[14];var link=getLink(email,urlMatch,protocol,path,port);result.push(__assign({fullMatch:match[0],isLineBreak:match[1]!=null,hashtag:hashtag,link:d3Link?{url:d3Link}:link},fullMention&&{mention:{name:name_1,id:id}}));lastStart=match.index+match[0].length;}result.push(content.substring(lastStart));return result;}var Mention=function Mention(_a){var userDisplayName=_a.userDisplayName,userId=_a.userId;var _b=useState$2(false),showUserInfo=_b[0],setShowUserInfo=_b[1];var mentionContainer=useRef$1(null);return jsxs(Fragment,{children:[jsx$1(MentionHost,__assign({"data-mention":true,onClick:function(){return setShowUserInfo(true);},ref:mentionContainer},{children:userDisplayName}),void 0),showUserInfo&&jsx$1(Callout,__assign({target:mentionContainer.current,directionalHint:DirectionalHint.bottomCenter,onDismiss:function(){return setShowUserInfo(false);},calloutMaxWidth:300},{children:jsx$1(CalloutContent,{children:jsx$1(UserDetails,{upn:null,id:userId,showAvatar:true},void 0)},void 0)}),void 0)]},void 0);};var MentionHost=_styled.span.withConfig({displayName:"ContentDisplay__MentionHost",componentId:"sc-1yxe01n-0"})(templateObject_1$2n||(templateObject_1$2n=__makeTemplateObject(["\n font-weight: bold;\n cursor: pointer;\n color: ",";\n"],["\n font-weight: bold;\n cursor: pointer;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var CalloutContent=_styled.div.withConfig({displayName:"ContentDisplay__CalloutContent",componentId:"sc-1yxe01n-1"})(templateObject_2$1z||(templateObject_2$1z=__makeTemplateObject(["\n padding: ","px ","px;\n"],["\n padding: ","px ","px;\n"])),spacingM-5,spacingM);var HashtagLink=_styled(Link$2).withConfig({displayName:"ContentDisplay__HashtagLink",componentId:"sc-1yxe01n-2"})(templateObject_3$12||(templateObject_3$12=__makeTemplateObject(["\n && {\n font-weight: bold;\n text-decoration: none;\n }\n"],["\n && {\n font-weight: bold;\n text-decoration: none;\n }\n"])));var templateObject_1$2n,templateObject_2$1z,templateObject_3$12;var NeutralCheckBox=_styled(Checkbox).withConfig({displayName:"NeutralCheckbox__NeutralCheckBox",componentId:"sc-18jxdgn-0"})(templateObject_1$2m||(templateObject_1$2m=__makeTemplateObject(["\n display: inline-block;\n &.is-checked .ms-Checkbox-checkbox {\n border-color: #656565;\n background-color: #919191;\n }\n"],["\n display: inline-block;\n &.is-checked .ms-Checkbox-checkbox {\n border-color: #656565;\n background-color: #919191;\n }\n"])));var templateObject_1$2m;var EventResponseTriggerAction=/** @class */function(){function EventResponseTriggerAction(){this.type=EventResponseTriggerAction.type;}EventResponseTriggerAction.create=function(itemId,response,locationId,onBehalfOfUpn){var dispatch=new EventResponseTriggerAction();dispatch.itemId=itemId;dispatch.response=response;dispatch.locationId=locationId;dispatch.onBehalfOfUpn=onBehalfOfUpn;return dispatch;};EventResponseTriggerAction.type='update_event_response';return EventResponseTriggerAction;}();var RegisterFullSeriesTriggerAction=/** @class */function(){function RegisterFullSeriesTriggerAction(){this.type=RegisterFullSeriesTriggerAction.type;}RegisterFullSeriesTriggerAction.create=function(recurrenceSeriesId,response){var dispatch=new RegisterFullSeriesTriggerAction();dispatch.recurrenceSeriesId=recurrenceSeriesId;dispatch.response=response;return dispatch;};RegisterFullSeriesTriggerAction.type='update_register_button_state';return RegisterFullSeriesTriggerAction;}();var FollowCommentsTriggerAction=/** @class */function(){function FollowCommentsTriggerAction(){this.type=FollowCommentsTriggerAction.type;}FollowCommentsTriggerAction.create=function(itemId,followState){var dispatch=new FollowCommentsTriggerAction();dispatch.itemId=itemId;dispatch.followState=followState;return dispatch;};FollowCommentsTriggerAction.type='update_follow_comments';return FollowCommentsTriggerAction;}();var ForbiddenErrorTriggerAction=/** @class */function(){function ForbiddenErrorTriggerAction(){this.type=ForbiddenErrorTriggerAction.type;}ForbiddenErrorTriggerAction.create=function(){return new ForbiddenErrorTriggerAction();};ForbiddenErrorTriggerAction.type='forbidden_error';return ForbiddenErrorTriggerAction;}();var PromptPublicUserLoginAction=/** @class */function(){function PromptPublicUserLoginAction(){this.type=ForbiddenErrorTriggerAction.type;}PromptPublicUserLoginAction.create=function(){return new ForbiddenErrorTriggerAction();};return PromptPublicUserLoginAction;}();var commentCreatedSubject=new Subject();var onCommentCreated$=commentCreatedSubject.asObservable();function useCommentApi(){var api=useApi();return useMemo(function(){return {createComment:createComment,createEditorComment:createEditorComment,listComments:listComments,getCommentReplies:getCommentReplies,getCommentThread:getCommentThread,getEditorConversations:getEditorConversations,translateComment:translateComment,deleteComment:deleteComment,deleteEditorComment:deleteEditorComment,toggleCommentLike:toggleCommentLike,updateComment:updateComment,onCommentCreated$:onCommentCreated$};function createComment(type,scope,itemId,comment){return api.all(getRoute(scope,itemId,type)).post(comment).then(function(result){commentCreatedSubject.next(itemId);return result.body().data();});}function createEditorComment(itemId,comment){return api.all(getRoute(ConversationScope.Editor,itemId)).post(comment).then(function(result){commentCreatedSubject.next(itemId);return result.body().data();});}function listComments(type,scope,itemId,filter){return api.custom(getRoute(scope,itemId,type,null,filter)).get().then(function(res){return res.body().data();});}function getCommentReplies(type,scope,itemId,commentId,filter){return api.custom(getRoute(scope,itemId,type,commentId,filter,true)).get().then(function(res){return res.body().data();});}function getCommentThread(type,itemId,commentId){return api.custom(type+"/"+itemId+"/comments/"+commentId+"/thread").get().then(function(res){return res.body().data();});}function getEditorConversations(itemId){return api.all(getRoute(ConversationScope.Editor,itemId)).getAll().then(function(res){return res.body().map(function(comment){return comment.data();});});}function translateComment(type,scope,itemId,commentId,targetLanguage){return api.custom(getRoute(scope,itemId,type,commentId)+"/"+(type===ItemResourceTypes.Posts?'content':'contents')+"/"+targetLanguage).get().then(function(res){return res.body().data();});}function deleteComment(type,scope,itemId,commentId){return api// note: commentId is passed as argument for delete method
|
|
131518
131521
|
.all(getRoute(scope,itemId,type)).delete(commentId);}function deleteEditorComment(itemId,commentId){return api// note: commentId is passed as argument for delete method
|
|
131519
131522
|
.all(getRoute(ConversationScope.Editor,itemId)).delete(commentId);}function toggleCommentLike(commentId,isLiked){if(isLiked){return api.custom("comments/"+commentId+"/feedback/like").put({});}else {return api.custom("comments/"+commentId+"/feedback/like").delete();}}function updateComment(scope,itemId,commentId,content,attachments,type){return api.all(getRoute(scope,itemId,type,commentId)).put('',{id:commentId,content:content,parentItemId:itemId,attachments:attachments});}},[api]);}function getRoute(scope,itemId,type,commentId,filter,isThread){var baseRoute='';switch(scope){case ConversationScope.Editor:baseRoute="editor/"+itemId+"/messages";break;case ConversationScope.Public:baseRoute=type+"/"+itemId+"/comments";break;case ConversationScope.Posts:baseRoute=type+"/"+itemId+"/comments";break;default:throw new Error('Cannot determine route for unsupported scope '+scope);}var route=commentId?baseRoute+"/"+commentId:baseRoute;route=isThread?baseRoute+"/"+commentId+"/replies":route;return filter?route+"?"+queryString.stringify(filter):route;}var FollowComments=function FollowComments(props){var user=useCurrentUser();var _a=useManageCurrentUserApi(),getFollowCommentsStatus=_a.getFollowCommentsStatus,toggleFollowComments=_a.toggleFollowComments;var formatMessage=useIntl().formatMessage;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var isSavingRef=useRef$1(false);var currentToastIdRef=useRef$1(null);var onCommentCreated$=useCommentApi().onCommentCreated$;var _b=useNotificationContext(),dismissToast=_b.dismissToast,showToast=_b.showToast,showError=_b.showError;var _c=usePromise$2(function(){return getFollowCommentsStatus(props.itemId,props.type,props.scope);},false),isFollowing=_c[0],setIsFollowing=_c[3];useListener(FollowCommentsTriggerAction.type,function(action){if(action.itemId!==props.itemId){return false;}setIsFollowing(action.followState);return true;},[setIsFollowing,props.itemId]);useEffect$1(function(){var subscription=onCommentCreated$.pipe(filter(function(id){return id===props.itemId;}),tap(function(){return handleCommentCreated();})).subscribe(function(){return null;});return function(){return subscription.unsubscribe();};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131520
|
-
},[isFollowing,props.itemId,props.scope]);var showWarning=isFollowing&&hasDisabledNotificationSettings();var followLabelStringResourceKey=props.scope===ConversationScope.Public?'Comment.followLabel':'Comment.followEditorLabel';return jsxs(Host$W,__assign({className:props.className},{children:[jsx$1(NeutralCheckBox,{checked:isFollowing,onChange:function(_e,checked){return handleOnChange(checked);},label:formatMessage({id:followLabelStringResourceKey})},void 0),showWarning&&jsxs(WarningContainer,__assign({className:"ms-font-m"},{children:[jsx$1(Icon,{className:"ms-fontColor-red",iconName:"warning"},void 0),jsxs(WarningMessage,{children:[jsx$1(FormattedMessage$1,{id:"Profile.notificationSettings.conversationsDisabled"},void 0),!props.hideProfileUrl&&jsxs(Fragment,{children:["\u00A0",jsx$1(Link$2,__assign({to:buildPath('/user')},{children:jsx$1(FormattedMessage$1,{id:"Profile.notificationSettings.conversationsDisabledChangeSettings"},void 0)}),void 0)]},void 0)]},void 0)]}),void 0)]}),void 0);function handleCommentCreated(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,updateFollow(true)];case 1:_a.sent();return [2/*return*/];}});});}function handleOnChange(newFollowState){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,updateFollow(newFollowState)];case 1:_a.sent();if(currentToastIdRef.current){dismissToast(currentToastIdRef.current);}currentToastIdRef.current=showToast(newFollowState?'Comment.followSuccessful':'Comment.unfollowSuccessful');return [2/*return*/];}});});}function updateFollow(newFollowState){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSavingRef.current){return [2/*return*/];}if(newFollowState===isFollowing){return [2/*return*/];}setIsFollowing(newFollowState);isSavingRef.current=true;_a.label=1;case 1:_a.trys.push([1,3,4,5]);return [4/*yield*/,toggleFollowComments(props.itemId,props.type,props.scope,newFollowState)];case 2:_a.sent();return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,5];case 4:isSavingRef.current=false;return [7/*endfinally*/];case 5:return [2/*return*/];}});});}function hasDisabledNotificationSettings(){var notificationSettings=user.notificationTypeSettings||{};return notificationSettings.comments===NotificationType.None;}};var Host$W=_styled.div.withConfig({displayName:"FollowComments__Host",componentId:"sc-1vcax52-0"})(templateObject_1$2l||(templateObject_1$2l=__makeTemplateObject([""],[""])));var WarningContainer=_styled.div.withConfig({displayName:"FollowComments__WarningContainer",componentId:"sc-1vcax52-1"})(templateObject_2$1y||(templateObject_2$1y=__makeTemplateObject(["\n margin-top: ","px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n i {\n font-size: 1.5em;\n margin-right: 7px;\n }\n"],["\n margin-top: ","px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n i {\n font-size: 1.5em;\n margin-right: 7px;\n }\n"])),spacingS);var WarningMessage=_styled.div.withConfig({displayName:"FollowComments__WarningMessage",componentId:"sc-1vcax52-2"})(templateObject_3$
|
|
131523
|
+
},[isFollowing,props.itemId,props.scope]);var showWarning=isFollowing&&hasDisabledNotificationSettings();var followLabelStringResourceKey=props.scope===ConversationScope.Public?'Comment.followLabel':'Comment.followEditorLabel';return jsxs(Host$W,__assign({className:props.className},{children:[jsx$1(NeutralCheckBox,{checked:isFollowing,onChange:function(_e,checked){return handleOnChange(checked);},label:formatMessage({id:followLabelStringResourceKey})},void 0),showWarning&&jsxs(WarningContainer,__assign({className:"ms-font-m"},{children:[jsx$1(Icon,{className:"ms-fontColor-red",iconName:"warning"},void 0),jsxs(WarningMessage,{children:[jsx$1(FormattedMessage$1,{id:"Profile.notificationSettings.conversationsDisabled"},void 0),!props.hideProfileUrl&&jsxs(Fragment,{children:["\u00A0",jsx$1(Link$2,__assign({to:buildPath('/user')},{children:jsx$1(FormattedMessage$1,{id:"Profile.notificationSettings.conversationsDisabledChangeSettings"},void 0)}),void 0)]},void 0)]},void 0)]}),void 0)]}),void 0);function handleCommentCreated(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,updateFollow(true)];case 1:_a.sent();return [2/*return*/];}});});}function handleOnChange(newFollowState){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,updateFollow(newFollowState)];case 1:_a.sent();if(currentToastIdRef.current){dismissToast(currentToastIdRef.current);}currentToastIdRef.current=showToast(newFollowState?'Comment.followSuccessful':'Comment.unfollowSuccessful');return [2/*return*/];}});});}function updateFollow(newFollowState){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSavingRef.current){return [2/*return*/];}if(newFollowState===isFollowing){return [2/*return*/];}setIsFollowing(newFollowState);isSavingRef.current=true;_a.label=1;case 1:_a.trys.push([1,3,4,5]);return [4/*yield*/,toggleFollowComments(props.itemId,props.type,props.scope,newFollowState)];case 2:_a.sent();return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,5];case 4:isSavingRef.current=false;return [7/*endfinally*/];case 5:return [2/*return*/];}});});}function hasDisabledNotificationSettings(){var notificationSettings=user.notificationTypeSettings||{};return notificationSettings.comments===NotificationType.None;}};var Host$W=_styled.div.withConfig({displayName:"FollowComments__Host",componentId:"sc-1vcax52-0"})(templateObject_1$2l||(templateObject_1$2l=__makeTemplateObject([""],[""])));var WarningContainer=_styled.div.withConfig({displayName:"FollowComments__WarningContainer",componentId:"sc-1vcax52-1"})(templateObject_2$1y||(templateObject_2$1y=__makeTemplateObject(["\n margin-top: ","px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n i {\n font-size: 1.5em;\n margin-right: 7px;\n }\n"],["\n margin-top: ","px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n i {\n font-size: 1.5em;\n margin-right: 7px;\n }\n"])),spacingS);var WarningMessage=_styled.div.withConfig({displayName:"FollowComments__WarningMessage",componentId:"sc-1vcax52-2"})(templateObject_3$11||(templateObject_3$11=__makeTemplateObject(["\n flex: 1;\n"],["\n flex: 1;\n"])));var templateObject_1$2l,templateObject_2$1y,templateObject_3$11;// a string of all valid unicode whitespaces
|
|
131521
131524
|
// eslint-disable-next-line max-len
|
|
131522
131525
|
var whitespaces$3='\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';var requireObjectCoercible$6=requireObjectCoercible$c;var whitespaces$2$1=whitespaces$3;var whitespace$1='['+whitespaces$2$1+']';var ltrim$1=RegExp('^'+whitespace$1+whitespace$1+'*');var rtrim$1=RegExp(whitespace$1+whitespace$1+'*$');// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
131523
131526
|
var createMethod$1$1=function(TYPE){return function($this){var string=String(requireObjectCoercible$6($this));if(TYPE&1)string=string.replace(ltrim$1,'');if(TYPE&2)string=string.replace(rtrim$1,'');return string;};};var stringTrim$1={// `String.prototype.{ trimLeft, trimStart }` methods
|
|
@@ -131757,7 +131760,7 @@ suggestionsContainer.style.maxWidth=hostRect.width-4+"px";// this block fixes th
|
|
|
131757
131760
|
// the mention library is not entirely correct, therefore we add our own
|
|
131758
131761
|
// top / bottom values
|
|
131759
131762
|
if(inputBox.top<500){suggestionsContainer.style.top=inputBox.height-10+"px";}else {suggestionsContainer.style.bottom=inputBox.height+"px";suggestionsContainer.style.top='unset';}}function getPlaceholder(){var placeholder=formatMessage({id:placeHolderStringResourceKey||inputPlaceholder},placeHolderStringResourceValues);if(!onCtrlEnter){return placeholder;}var browserHint=formatMessage({id:'PostMessage.inputPlaceholderHint'},{keyName:'CTRL'});return placeholder+" "+browserHint;}});function useMentionsSearch(mentionSearchHandler,handleSearchComplete){var _this=this;var searchSubject=useRef$1(new Subject());useEffect$1(function(){var subscription=searchSubject.current.pipe(debounceTime(500),switchMap(function(args){return __awaiter(_this,void 0,void 0,function(){var users;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,mentionSearchHandler(args.searchText)];case 1:users=_a.sent();args.updateSuggestions(users.map(function(u){return {id:u.id,upn:u.userPrincipalName,displayName:u.displayName,display:'@'+u.displayName};}));return [2/*return*/,users];}});});})).subscribe(function(){return handleSearchComplete();});return function(){subscription&&subscription.unsubscribe();};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131760
|
-
},[]);return function(searchText,updateSuggestions){searchSubject.current.next({searchText:searchText,updateSuggestions:updateSuggestions});};}var Host$V=_styled.div.withConfig({displayName:"CommentInput__Host",componentId:"sc-777bqz-0"})(templateObject_2$1x||(templateObject_2$1x=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n position: relative;\n ","\n\n textarea {\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n }\n\n .comment-input__suggestions {\n @media (max-width: ","px) {\n max-height: 300px;\n overflow-y: auto;\n padding-right: ","px;\n }\n\n &__list {\n background-color: white;\n border: 1px solid rgba(0, 0, 0, 0.15);\n width: 100%;\n }\n &__item {\n padding: 5px 15px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\n &:last-of-type {\n border-bottom: none;\n }\n\n &--focused {\n background-color: ",";\n }\n }\n }\n"],["\n display: flex;\n flex-direction: column;\n position: relative;\n ","\n\n textarea {\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n }\n\n .comment-input__suggestions {\n @media (max-width: ","px) {\n max-height: 300px;\n overflow-y: auto;\n padding-right: ","px;\n }\n\n &__list {\n background-color: white;\n border: 1px solid rgba(0, 0, 0, 0.15);\n width: 100%;\n }\n &__item {\n padding: 5px 15px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\n &:last-of-type {\n border-bottom: none;\n }\n\n &--focused {\n background-color: ",";\n }\n }\n }\n"])),function(p){return p.disableBoxShadow?css$2(templateObject_1$2k||(templateObject_1$2k=__makeTemplateObject(["\n border: 1px solid ",";\n "],["\n border: 1px solid ",";\n "])),function(p){return p.theme.palette.neutralTertiaryAlt;}):CardBorderInline(2,2);},spacingM,maxScreenSize.medium,spacingXxs,defaultPageBackgroundColor);var Buttons$4=_styled.div.withConfig({displayName:"CommentInput__Buttons",componentId:"sc-777bqz-1"})(templateObject_3
|
|
131763
|
+
},[]);return function(searchText,updateSuggestions){searchSubject.current.next({searchText:searchText,updateSuggestions:updateSuggestions});};}var Host$V=_styled.div.withConfig({displayName:"CommentInput__Host",componentId:"sc-777bqz-0"})(templateObject_2$1x||(templateObject_2$1x=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n position: relative;\n ","\n\n textarea {\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n }\n\n .comment-input__suggestions {\n @media (max-width: ","px) {\n max-height: 300px;\n overflow-y: auto;\n padding-right: ","px;\n }\n\n &__list {\n background-color: white;\n border: 1px solid rgba(0, 0, 0, 0.15);\n width: 100%;\n }\n &__item {\n padding: 5px 15px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\n &:last-of-type {\n border-bottom: none;\n }\n\n &--focused {\n background-color: ",";\n }\n }\n }\n"],["\n display: flex;\n flex-direction: column;\n position: relative;\n ","\n\n textarea {\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n }\n\n .comment-input__suggestions {\n @media (max-width: ","px) {\n max-height: 300px;\n overflow-y: auto;\n padding-right: ","px;\n }\n\n &__list {\n background-color: white;\n border: 1px solid rgba(0, 0, 0, 0.15);\n width: 100%;\n }\n &__item {\n padding: 5px 15px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\n &:last-of-type {\n border-bottom: none;\n }\n\n &--focused {\n background-color: ",";\n }\n }\n }\n"])),function(p){return p.disableBoxShadow?css$2(templateObject_1$2k||(templateObject_1$2k=__makeTemplateObject(["\n border: 1px solid ",";\n "],["\n border: 1px solid ",";\n "])),function(p){return p.theme.palette.neutralTertiaryAlt;}):CardBorderInline(2,2);},spacingM,maxScreenSize.medium,spacingXxs,defaultPageBackgroundColor);var Buttons$4=_styled.div.withConfig({displayName:"CommentInput__Buttons",componentId:"sc-777bqz-1"})(templateObject_3$10||(templateObject_3$10=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n padding: ","px ","px;\n background-color: ",";\n\n && button {\n background-color: transparent;\n\n i {\n font-size: 22px;\n }\n }\n"],["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n padding: ","px ","px;\n background-color: ",";\n\n && button {\n background-color: transparent;\n\n i {\n font-size: 22px;\n }\n }\n"])),spacingXxs,spacingS+5,function(p){return p.theme.palette.neutralLighter;});var LeftSide=_styled.div.withConfig({displayName:"CommentInput__LeftSide",componentId:"sc-777bqz-2"})(templateObject_4$J||(templateObject_4$J=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n\n @media (min-width: ","px) {\n gap: ","px;\n }\n"],["\n display: flex;\n gap: ","px;\n\n @media (min-width: ","px) {\n gap: ","px;\n }\n"])),spacingM+5,minScreenSize.medium,spacingS+5);var RightSide=_styled.div.withConfig({displayName:"CommentInput__RightSide",componentId:"sc-777bqz-3"})(templateObject_5$C||(templateObject_5$C=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n margin-left: auto;\n"],["\n display: flex;\n gap: ","px;\n margin-left: auto;\n"])),spacingS);var InputContainer=_styled.div.withConfig({displayName:"CommentInput__InputContainer",componentId:"sc-777bqz-4"})(templateObject_6$r||(templateObject_6$r=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: ","px ","px;\n background-color: ",";\n\n .comment-input {\n &__control {\n background-color: transparent;\n font-size: 14px;\n font-weight: normal;\n border: none;\n }\n &__input {\n /*\n * on small screens the MentionsInput renders a margin-left: -3px directly on the element\n * Use !important to remove the minus margin to match our layout.\n */\n margin: 0 !important;\n padding: 0;\n outline: 0;\n border: 0;\n }\n &__highlighter {\n padding: 0;\n border: 0;\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n\n strong {\n ","\n }\n }\n }\n"],["\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: ","px ","px;\n background-color: ",";\n\n .comment-input {\n &__control {\n background-color: transparent;\n font-size: 14px;\n font-weight: normal;\n border: none;\n }\n &__input {\n /*\n * on small screens the MentionsInput renders a margin-left: -3px directly on the element\n * Use !important to remove the minus margin to match our layout.\n */\n margin: 0 !important;\n padding: 0;\n outline: 0;\n border: 0;\n }\n &__highlighter {\n padding: 0;\n border: 0;\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n\n strong {\n ","\n }\n }\n }\n"])),spacingS,spacingS+5,function(p){return p.theme.palette.white;},spacingM,"background-color: "+defaultPageBackgroundColor+";");var templateObject_1$2k,templateObject_2$1x,templateObject_3$10,templateObject_4$J,templateObject_5$C,templateObject_6$r;var DropTarget=_styled.div.withConfig({displayName:"DropInfo__DropTarget",componentId:"sc-1ky6ew9-0"})(templateObject_1$2j||(templateObject_1$2j=__makeTemplateObject(["\n position: ",";\n top: ",";\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ",";\n\n background-color: ",";\n\n display: flex;\n justify-content: center;\n"],["\n position: ",";\n top: ",";\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ",";\n\n background-color: ",";\n\n display: flex;\n justify-content: center;\n"])),function(_a){var isLarge=_a.isLarge,isActive=_a.isActive;return isLarge&&isActive?'fixed':'absolute';},function(_a){var isLarge=_a.isLarge;return isLarge?headerHeight+"px":'0';},function(_a){var isActive=_a.isActive;return isActive?300:0;},function(_a){var isActive=_a.isActive;return isActive?'rgba(253, 253, 253, 0.95)':'transparent';});var DropInfo=function DropInfo(_a){var isLarge=_a.isLarge;return jsx$1(Host$U,__assign({isLarge:isLarge},{children:jsxs(CenteredContainer,__assign({isLarge:isLarge},{children:[jsx$1(StyledIcon$8,{isLarge:isLarge,iconName:"bulkUpload",className:"ms-fontColor-accent"},void 0),jsx$1(FormattedMessage$1,{id:"Generic.dragToUploadTitle",tagName:"h2"},void 0),jsx$1(FormattedMessage$1,{id:"Generic.dragToUploadDescription",tagName:"p"},void 0)]}),void 0)}),void 0);};var Host$U=_styled.div.withConfig({displayName:"DropInfo__Host",componentId:"sc-1ky6ew9-1"})(templateObject_2$1w||(templateObject_2$1w=__makeTemplateObject(["\n ",";\n ",";\n"],["\n ",";\n ",";\n"])),function(_a){var isLarge=_a.isLarge;return !isLarge&&'display: flex';},function(_a){var isLarge=_a.isLarge;return !isLarge&&'align-items: center';});var CenteredContainer=_styled.div.withConfig({displayName:"DropInfo__CenteredContainer",componentId:"sc-1ky6ew9-2"})(templateObject_3$$||(templateObject_3$$=__makeTemplateObject(["\n position: relative;\n top: ",";\n\n display: flex;\n flex-direction: column;\n align-items: center;\n\n h2 {\n margin-bottom: 0;\n }\n p {\n margin-top: 3px;\n }\n"],["\n position: relative;\n top: ",";\n\n display: flex;\n flex-direction: column;\n align-items: center;\n\n h2 {\n margin-bottom: 0;\n }\n p {\n margin-top: 3px;\n }\n"])),function(_a){var isLarge=_a.isLarge;return isLarge?'20%':0;});var StyledIcon$8=_styled(Icon).withConfig({displayName:"DropInfo__StyledIcon",componentId:"sc-1ky6ew9-3"})(templateObject_4$I||(templateObject_4$I=__makeTemplateObject(["\n font-size: ",";\n"],["\n font-size: ",";\n"])),function(p){return p.isLarge?'100px':'50px';});var templateObject_1$2j,templateObject_2$1w,templateObject_3$$,templateObject_4$I;var hasValidGenericUrlVideoSourcePrefix=function hasValidGenericUrlVideoSourcePrefix(url){return url&&getAdditionalVideoSources().filter(function(s){return url.startsWith(s.prefix);}).length>0;};var VideoUrlParser=/** @class */function(){function VideoUrlParser(url){this.url=url;this.source=null;this.id=null;this.isDirectVideoUrl=false;this.videoProperties=null;this.thumbnailUrl=null;if(hasValidGenericUrlVideoSourcePrefix(this.url)){this.source=VideoSource.GenericUrl;this.id=url;}else if(VideoUrlParser.microsoftStreamRegex.test(this.url)){this.source=VideoSource.MicrosoftStream;this.id=VideoUrlParser.microsoftStreamRegex.exec(this.url)[1];}else if(VideoUrlParser.ytRegex.test(this.url)){this.source=VideoSource.YouTube;this.id=VideoUrlParser.ytRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoDirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoDirectLinkRegex.exec(this.url)[1];this.isDirectVideoUrl=true;}else if(VideoUrlParser.vimeoRedirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRedirectLinkRegex.exec(this.url)[1];}else if(VideoUrlParser.kalturaRegex.test(this.url)){var regexMatches=VideoUrlParser.kalturaRegex.exec(this.url);this.source=VideoSource.Kaltura;this.id=regexMatches[1];this.videoProperties={sp:regexMatches[2],uiconfId:regexMatches[3],partnerId:regexMatches[4],entryId:regexMatches[5]};this.thumbnailUrl="https://cdnsecakmi.kaltura.com/p/"+this.id+"/thumbnail/entry_id/"+this.videoProperties.entryId+"/width/1000";}}//TODO handle the different error messages for cloud and onprem versions, i.e. what sources are permitted (see task 23570)
|
|
131761
131764
|
VideoUrlParser.prototype.isValid=function(features){var _this=this;if(this.source==null||this.id==null){return false;}if(features){var sources=getVideoSources(features);return sources.findIndex(function(s){return s.type===_this.source;})>=0;}return true;};VideoUrlParser.ytRegex=/^.*(?:(?:youtu.be\/)|(?:v\/)|(?:\/u\/\w\/)|(?:embed\/)|(?:watch\?))\??v?=?([^#&?]*).*$/;VideoUrlParser.vimeoRegex=/.*?(?:vimeo.com\/){1}(?:video\/)?(\d+)/;// match first GUID after domain
|
|
131762
131765
|
VideoUrlParser.microsoftStreamRegex=/.*web\.microsoftstream\.com.+?([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i;VideoUrlParser.vimeoDirectLinkRegex=/.*?(?:player\.vimeo\.com\/external\/){1}(\d+)/;VideoUrlParser.vimeoRedirectLinkRegex=/.*?(?:player\.vimeo\.com\/progressive_redirect\/playback\/){1}(\d+)(?:\/.*)/;VideoUrlParser.kalturaRegex=/.+cdnapisec\.kaltura\.com\/p\/([0-9]+)\/sp\/([0-9]+)\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(?:.*entry_id=(.+?(?=&|$)))/;return VideoUrlParser;}();function getVideoSources(features){var sources=[];if(features.editorYouTubeVideos){sources.push({type:VideoSource.YouTube,name:'YouTube'});}if(features.editorVimeoVideos){sources.push({type:VideoSource.Vimeo,name:'Vimeo'});}if(features.editorMicrosoftVideos){sources.push({type:VideoSource.MicrosoftStream,name:'Microsoft Stream'});}if(features.editorKalturaVideos){sources.push({type:VideoSource.Kaltura,name:'Kaltura'});}return sources;}// this is wrapped, because the "appconfig" does not exist in the component library
|
|
131763
131766
|
// we should probably provide a better fix for this => #38316
|
|
@@ -131868,7 +131871,7 @@ storage.set(cacheKey,apiPage_1).then(function(){return null;});if(!cachedPage){o
|
|
|
131868
131871
|
apiItem.fileAccessToken=cachedItem.fileAccessToken;}});observer.next(apiPage_1);observer.complete();return [3/*break*/,4];case 3:err_1=_a.sent();observer.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});})();});}function validateFileAccessTokens(page,modifyFunc){if(!page||!page.items){return;}page.items.forEach(function(item){var isTokenValid=isTokenStillValid(item.fileAccessToken);modifyFunc(isTokenValid,item);});}var NewsApiService=/** @class */function(){function NewsApiService(factory,subscriptionId,storage){var _this=this;this.factory=factory;this.storage=storage;this.trackExternalItem=function(itemId,itemType){return _this.api.custom(itemType+"/"+encodeURIComponent(itemId)+"/external_url/track").get().then(function(result){return result.body().data();});};this.getAllNews=function(filterDefinition,paginationToken){return fetchNewsItems('news',NewsApiService.allNewsCacheKey,_this.api,_this.storage,paginationToken,__assign(__assign({},filterDefinition||{}),{includePromoted:true}));};this.getAllUnreadNews=function(filterDefinition,paginationToken){return fetchNewsItems('news',NewsApiService.allNewsCacheKey,_this.api,_this.storage,paginationToken,__assign(__assign({},filterDefinition||{}),{unreadOnly:true,pageSize:0}));};this.getMyNews=function(filterDefinition,paginationToken){return fetchNewsItems('users/current/news',NewsApiService.newsCacheKey,_this.api,_this.storage,paginationToken,filterDefinition);};this.getMyUnreadNews=function(filterDefinition,paginationToken){return fetchNewsItems('users/current/news/unread',NewsApiService.myUnreadNewsCacheKey,_this.api,_this.storage,paginationToken,filterDefinition,true);};this.getBookmarks=function(filterDefinition){return fetchNewsItems('users/current/bookmarks',NewsApiService.bookmarksCacheKey,_this.api,_this.storage,null,filterDefinition,true);};this.getNewsFromCache=function(){return __awaiter(_this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:return [4/*yield*/,this.storage.getObject(NewsApiService.newsItemsCacheKey)];case 1:return [2/*return*/,(_a=_b.sent())!==null&&_a!==void 0?_a:[]];}});});};this.get=function(newsId){var getFromCache=function getFromCache(id){return __awaiter(_this,void 0,void 0,function(){var cache,hits;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,this.getNewsFromCache()];case 1:cache=_a.sent();hits=cache.filter(function(i){return i.id===id;});return [2/*return*/,hits.length>0?hits[0]:null];}});});};var getFromApi=function getFromApi(id){return from(_this.api.all('news').get(id)).pipe(mergeMap(function(res){return updateItemCache(res.body().data());}));};var updateItemCache=function updateItemCache(item){return __awaiter(_this,void 0,void 0,function(){var fromCache,index,cacheItem,clonedCachedItem,clonedNewItem;return __generator(this,function(_a){switch(_a.label){case 0:if(item.statistics){itemStatisticsCache[item.id]=Promise.resolve(__assign({},item.statistics));}return [4/*yield*/,this.getNewsFromCache()];case 1:fromCache=_a.sent();index=fromCache.findIndex(function(i){return i.id===item.id;});if(index>-1){cacheItem=fromCache[index];if(isTokenStillValid(cacheItem.fileAccessToken)){clonedCachedItem=__assign({},cacheItem);delete clonedCachedItem.fileAccessToken;clonedNewItem=__assign({},item);delete clonedNewItem.fileAccessToken;if(JSON.stringify(clonedCachedItem)===JSON.stringify(clonedNewItem)){return [2/*return*/,null];}}fromCache.splice(index,1,item);}else {fromCache.push(item);}return [4/*yield*/,this.storage.set(NewsApiService.newsItemsCacheKey,fromCache)];case 2:_a.sent();return [2/*return*/,item];}});});};return concat(getFromCache(newsId),getFromApi(newsId)).pipe(filter(function(i){return i!=null;}),catchError(function(err){if(err.response&&err.response.statusCode===404){return of(null);}else {return throwError(err);}}));};this.getImageUrlWithToken=function(token,itemId,subscriptionId,resourceType,imageIdentifier,width,height){if(imageIdentifier===void 0){imageIdentifier='banner';}return _this.factory.createApiUrl("/"+resourceType+"/"+itemId+"/images/"+imageIdentifier+"/"+width+"/"+(height||''),{access_token:token,subscriptionId:subscriptionId});};this.getStatistics=function(newsId){if(!itemStatisticsCache[newsId]){itemStatisticsCache[newsId]=_this.api.custom("news/"+newsId+"/statistics").get().then(function(result){return result.body().data();}).then(function(result){var feedbackCountsKeys=Object.keys(result.feedbackCounts);return {bookmarkCount:result.bookmarkCount,likeCount:result.feedbackCounts[feedbackCountsKeys.find(function(k){return k==='like';})],commentCount:result.commentCount,confirmationCount:result.feedbackCounts[feedbackCountsKeys.find(function(k){return k==='confirm';})],readCount:result.readCount};});}return itemStatisticsCache[newsId];};this.refreshStatistics=function(itemId,delta){return __awaiter(_this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:// update statistics cache with new delta
|
|
131869
131872
|
if(!itemStatisticsCache[itemId]){return [2/*return*/];}return [4/*yield*/,itemStatisticsCache[itemId].then(function(statistics){var updatedStatistics=NewsApiService.getUpdatedStatistics(statistics,delta);_this.tryUpdateStatisticsInCache(itemId,updatedStatistics).then(null,null);itemStatisticsCache[itemId]=Promise.resolve(updatedStatistics);onStatisticsUpdated.next(updatedStatistics);})];case 1:_a.sent();return [2/*return*/];}});});};this.tryUpdateStatisticsInCache=function(newsId,statistics){return __awaiter(_this,void 0,void 0,function(){var fromCache,index,item;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,this.getNewsFromCache()];case 1:fromCache=_a.sent();index=fromCache.findIndex(function(i){return i.id===newsId;});item=fromCache[index];if(!item||!item.statistics){return [2/*return*/];}item.statistics=statistics;fromCache.splice(index,1,item);return [4/*yield*/,this.storage.set(NewsApiService.newsItemsCacheKey,fromCache)];case 2:_a.sent();return [2/*return*/];}});});};this.getExternalItemRoute=function(resourceType,itemId,accessToken){return _this.factory.createApiUrl("/"+resourceType+"/"+encodeURIComponent(itemId)+"/external_url",{access_token:accessToken});};this.api=factory.createApi(false,subscriptionId);}NewsApiService.getUpdatedStatistics=function(curr,delta){var _a,_b,_c,_d,_e,_f;return {bookmarkCount:curr.bookmarkCount+((_a=delta.bookmarkCount)!==null&&_a!==void 0?_a:0),commentCount:curr.commentCount+((_b=delta.commentCount)!==null&&_b!==void 0?_b:0),likeCount:curr.likeCount+((_c=delta.likeCount)!==null&&_c!==void 0?_c:0),confirmationCount:curr.confirmationCount+((_d=delta.confirmationCount)!==null&&_d!==void 0?_d:0),readCount:curr.readCount+((_e=delta.readCount)!==null&&_e!==void 0?_e:0),participantsCount:curr.participantsCount+((_f=delta.participantsCount)!==null&&_f!==void 0?_f:0)};};NewsApiService.bookmarksCacheKey='NewsService::BookmarksV2';NewsApiService.newsItemsCacheKey='NewsService::NewsItems';NewsApiService.newsCacheKey='NewsService::News';NewsApiService.allNewsCacheKey='NewsService::AllNews';NewsApiService.myUnreadNewsCacheKey='NewsService::MyUnreadNews';return NewsApiService;}();function useNewsApi(){var storage=useStorage();var factory=useApiFactory();var identifier=useContext(SubscriptionIdContext).identifier;return useMemo(function(){return new NewsApiService(factory,identifier===null||identifier===void 0?void 0:identifier.id,storage);},[factory,identifier,storage]);}function usePagesApi(){var api=useApi();var createApiUrl=useApiFactory().createApiUrl;return useMemo(function(){return {loadPage:loadPage,loadPageChildren:loadPageChildren,getRootPagesNavigation:getRootPagesNavigation,getPublishedRootPages:getPublishedRootPages,searchPublishedPages:searchPublishedPages,getSubpages:getSubpages,searchPages:searchPages,getDocumentFileUrl:getDocumentFileUrl,searchToc:searchToc};function loadPage(id){return api.all('pages').get(id,{includeNavigationContext:true}).then(function(response){var page=response.body().data();itemStatisticsCache[page.id]=Promise.resolve(__assign({},page.statistics));return page;});}function loadPageChildren(id){return api.all("pages/"+id+"/navigation/children").getAll().then(function(r){return r.body().map(function(g){return g.data();});});}function getRootPagesNavigation(){return api.all('pages').getAll().then(function(r){return r.body().map(function(g){return g.data();});});}function getPublishedRootPages(filter){var rootPagesFilter=__assign(__assign({},filter),{rootPagesOnly:true});return searchPages('pages',rootPagesFilter);}function searchPublishedPages(filter){return searchPages('pages',filter);}function getSubpages(parentId,filter){var subPagesFilter=__assign(__assign({},filter),{parentId:parentId});if(!subPagesFilter.pageSize){// return all subpages & documents
|
|
131870
131873
|
subPagesFilter.pageSize=0;}return searchPages('pages',subPagesFilter);}function searchToc(basePath,searchValue){return searchPages(basePath,{pageSize:100,search:searchValue,searchInTitlesOnly:true});}function searchPages(basePath,filter){if(filter){filter=__assign({},filter);if(!filter.restrictToPageContext){delete filter.pageContextId;}// we never need / want to send this param to the API, only used for the UI
|
|
131871
|
-
delete filter.restrictToPageContext;}var params=__assign(__assign({},filter),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords));return api.all(basePath+"/search").get('',params).then(function(result){return result.body().data();});}function getDocumentFileUrl(basePath,subscriptionId,pageId,fileId,language,token){return createApiUrl("/"+basePath+"/"+pageId+"/"+language+"/documents/"+fileId,{access_token:token,subscriptionId:subscriptionId});}},[api,createApiUrl]);}function usePostsApi(){var searchAccounts=useAccountApi().searchAccounts;var api=useApi();return useMemo(function(){return {createPost:createPost,togglePostLike:togglePostLike,getPosts:getPosts,updatePost:updatePost,deletePost:deletePost,getPost:getPost,getPostThread:getPostThread,translatePost:translatePost,searchPostMentionUsers:searchPostMentionUsers};function createPost(post){return api.all("posts").post(post).then(function(result){return result.body().data();});}function togglePostLike(postId,isLiked){if(isLiked){return api.custom("posts/"+postId+"/feedback/like").put({});}else {return api.custom("posts/"+postId+"/feedback/like").delete();}}function getPosts(filter){var groupIds=[];for(var _i=1;_i<arguments.length;_i++){groupIds[_i-1]=arguments[_i];}var params=__assign(__assign(__assign({},filter),{groupId:groupIds}),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords));return api.custom("posts?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function updatePost(postId,content,attachments,keywords){return api.all('posts').patch(postId,{content:content,attachments:attachments,keywords:keywords}).then(function(result){return result.body().data();});}function deletePost(postId){return api.all("posts").delete(postId);}function getPost(postId){return api.all('posts').get(postId).then(function(result){return result.body().data();});}function getPostThread(postId,threadId){return api.custom("posts/"+postId+"/comments/"+threadId+"/thread").get().then(function(result){return result.body().data();});}function translatePost(postId,language){return api.custom("posts/"+postId+"/content/"+language).get().then(function(res){return res.body().data();});}function searchPostMentionUsers(searchText,postGroupId){return searchAccounts({search:searchText,type:AccountType.User,localOnly:true,groupId:[postGroupId],excludeApiUsers:true});}},[api,searchAccounts]);}function useEmbeddedObjectValidator(){var _this=this;var getPost=usePostsApi().getPost;var getNews=useNewsApi().get;var loadPage=usePagesApi().loadPage;var getEvent=useEventsApi().getEvent;return function(embeddedObject){return __awaiter(_this,void 0,void 0,function(){var _a,item,error_1;return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,11,,12]);_a=embeddedObject.type;switch(_a){case AttachmentType.Post:return [3/*break*/,1];case AttachmentType.News:return [3/*break*/,3];case AttachmentType.Page:return [3/*break*/,5];case AttachmentType.Event:return [3/*break*/,7];}return [3/*break*/,9];case 1:return [4/*yield*/,getPost(embeddedObject.id)];case 2:_b.sent();return [2/*return*/,true];case 3:return [4/*yield*/,getNews(embeddedObject.id).toPromise()];case 4:item=_b.sent();return [2/*return*/,!!item];case 5:return [4/*yield*/,loadPage(embeddedObject.id)];case 6:_b.sent();return [2/*return*/,true];case 7:return [4/*yield*/,getEvent(embeddedObject.id)];case 8:_b.sent();return [2/*return*/,true];case 9:throw Error('Invalid type');case 10:return [3/*break*/,12];case 11:error_1=_b.sent();logger.error(error_1);return [2/*return*/,false];case 12:return [2/*return*/];}});});};}var RichCommentInput=/*#__PURE__*/forwardRef(function(_a,ref){var className=_a.className,buttons=_a.buttons,attachments=_a.attachments,deletedAttachmentUrls=_a.deletedAttachmentUrls,onAttachmentsChange=_a.onAttachmentsChange;_a.onDeleteAttachment;var allowAttachments=_a.allowAttachments,useLargeDropTarget=_a.useLargeDropTarget,disableDragAndDrop=_a.disableDragAndDrop,disableAddGif=_a.disableAddGif,disableAddFiles=_a.disableAddFiles,props=__rest(_a,["className","buttons","attachments","deletedAttachmentUrls","onAttachmentsChange","onDeleteAttachment","allowAttachments","useLargeDropTarget","disableDragAndDrop","disableAddGif","disableAddFiles"]);var onDrop=useCallback(handleDropFiles,[attachments,onAttachmentsChange]);var _b=useDropzone({onDrop:onDrop}),getRootProps=_b.getRootProps,getInputProps=_b.getInputProps,open=_b.open,isDragActive=_b.isDragActive;var inputRef=useRef$1(null);var formatMessage=useIntl().formatMessage;useImperativeHandle(ref,function(){return inputRef.current;},[inputRef]);var user=useCurrentUser();var debouncedOnEmbeddedObjectsOrVideosChange=useDebouncedCallback
|
|
131874
|
+
delete filter.restrictToPageContext;}var params=__assign(__assign({},filter),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords));return api.all(basePath+"/search").get('',params).then(function(result){return result.body().data();});}function getDocumentFileUrl(basePath,subscriptionId,pageId,fileId,language,token){return createApiUrl("/"+basePath+"/"+pageId+"/"+language+"/documents/"+fileId,{access_token:token,subscriptionId:subscriptionId});}},[api,createApiUrl]);}function usePostsApi(){var searchAccounts=useAccountApi().searchAccounts;var api=useApi();return useMemo(function(){return {createPost:createPost,togglePostLike:togglePostLike,getPosts:getPosts,updatePost:updatePost,deletePost:deletePost,getPost:getPost,getPostThread:getPostThread,translatePost:translatePost,searchPostMentionUsers:searchPostMentionUsers};function createPost(post){return api.all("posts").post(post).then(function(result){return result.body().data();});}function togglePostLike(postId,isLiked){if(isLiked){return api.custom("posts/"+postId+"/feedback/like").put({});}else {return api.custom("posts/"+postId+"/feedback/like").delete();}}function getPosts(filter){var groupIds=[];for(var _i=1;_i<arguments.length;_i++){groupIds[_i-1]=arguments[_i];}var params=__assign(__assign(__assign({},filter),{groupId:groupIds}),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords));return api.custom("posts?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function updatePost(postId,content,attachments,keywords){return api.all('posts').patch(postId,{content:content,attachments:attachments,keywords:keywords}).then(function(result){return result.body().data();});}function deletePost(postId){return api.all("posts").delete(postId);}function getPost(postId){return api.all('posts').get(postId).then(function(result){return result.body().data();});}function getPostThread(postId,threadId){return api.custom("posts/"+postId+"/comments/"+threadId+"/thread").get().then(function(result){return result.body().data();});}function translatePost(postId,language){return api.custom("posts/"+postId+"/content/"+language).get().then(function(res){return res.body().data();});}function searchPostMentionUsers(searchText,postGroupId){return searchAccounts({search:searchText,type:AccountType.User,localOnly:true,groupId:[postGroupId],excludeApiUsers:true});}},[api,searchAccounts]);}function useEmbeddedObjectValidator(){var _this=this;var getPost=usePostsApi().getPost;var getNews=useNewsApi().get;var loadPage=usePagesApi().loadPage;var getEvent=useEventsApi().getEvent;return function(embeddedObject){return __awaiter(_this,void 0,void 0,function(){var _a,item,error_1;return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,11,,12]);_a=embeddedObject.type;switch(_a){case AttachmentType.Post:return [3/*break*/,1];case AttachmentType.News:return [3/*break*/,3];case AttachmentType.Page:return [3/*break*/,5];case AttachmentType.Event:return [3/*break*/,7];}return [3/*break*/,9];case 1:return [4/*yield*/,getPost(embeddedObject.id)];case 2:_b.sent();return [2/*return*/,true];case 3:return [4/*yield*/,getNews(embeddedObject.id).toPromise()];case 4:item=_b.sent();return [2/*return*/,!!item];case 5:return [4/*yield*/,loadPage(embeddedObject.id)];case 6:_b.sent();return [2/*return*/,true];case 7:return [4/*yield*/,getEvent(embeddedObject.id)];case 8:_b.sent();return [2/*return*/,true];case 9:throw Error('Invalid type');case 10:return [3/*break*/,12];case 11:error_1=_b.sent();logger.error(error_1);return [2/*return*/,false];case 12:return [2/*return*/];}});});};}var RichCommentInput=/*#__PURE__*/forwardRef(function(_a,ref){var className=_a.className,buttons=_a.buttons,attachments=_a.attachments,deletedAttachmentUrls=_a.deletedAttachmentUrls,onAttachmentsChange=_a.onAttachmentsChange;_a.onDeleteAttachment;var allowAttachments=_a.allowAttachments,useLargeDropTarget=_a.useLargeDropTarget,disableDragAndDrop=_a.disableDragAndDrop,disableAddGif=_a.disableAddGif,disableAddFiles=_a.disableAddFiles,props=__rest(_a,["className","buttons","attachments","deletedAttachmentUrls","onAttachmentsChange","onDeleteAttachment","allowAttachments","useLargeDropTarget","disableDragAndDrop","disableAddGif","disableAddFiles"]);var onDrop=useCallback(handleDropFiles,[attachments,onAttachmentsChange]);var _b=useDropzone({onDrop:onDrop}),getRootProps=_b.getRootProps,getInputProps=_b.getInputProps,open=_b.open,isDragActive=_b.isDragActive;var inputRef=useRef$1(null);var formatMessage=useIntl().formatMessage;useImperativeHandle(ref,function(){return inputRef.current;},[inputRef]);var user=useCurrentUser();var debouncedOnEmbeddedObjectsOrVideosChange=useDebouncedCallback(onEmbeddedObjectsOrVideosChange,500)[0];var validateEmbeddedObject=useEmbeddedObjectValidator();var isGifButtonDisabled=props.disabled||disableAddGif;var isAttachmentsButtonDisabled=props.disabled||disableAddFiles;if(props.disabled||!allowAttachments){return jsx$1(CommentInput,__assign({ref:inputRef,className:className,buttons:buttons},props),void 0);}return jsxs("div",__assign({className:className},{children:[jsx$1("input",__assign({},getInputProps()),void 0),!disableDragAndDrop&&jsx$1(DropTarget,__assign({isActive:isDragActive,isLarge:useLargeDropTarget},getRootProps({onClick:function(e){return e.stopPropagation();}}),{"data-drop-target":true},{children:isDragActive&&jsx$1(DropInfo,{isLarge:useLargeDropTarget},void 0)}),void 0),jsx$1(CommentInput,__assign({},props,{onChange:handleChange,ref:inputRef,buttons:{leftSide:jsxs(Fragment,{children:[jsx$1(GifButton,{disabled:isGifButtonDisabled,onGifClick:handleGifClick},'gifButton'+isGifButtonDisabled),jsx$1(IconButton,{iconProps:{iconName:'Attach'},onClick:open,disabled:isAttachmentsButtonDisabled,"data-button-type":"attach",ariaLabel:formatMessage({id:'AriaLabel.attachmentsButton'})},'attachmentsButton'+isAttachmentsButtonDisabled),buttons.leftSide]},void 0),rightSide:buttons.rightSide}}),void 0)]}),void 0);function handleChange(content){props.onChange(content);debouncedOnEmbeddedObjectsOrVideosChange(content);}function onEmbeddedObjectsOrVideosChange(content){return __awaiter(this,void 0,void 0,function(){var existingAttachments,newAttachments,matchedVideoUrls,_i,matchedVideoUrls_1,matchedUrl,url,id,matchedEmbeddedObjects,_a,matchedEmbeddedObjects_1,matchedEmbeddedObject,url,isValid;return __generator(this,function(_b){switch(_b.label){case 0:existingAttachments=new Set(attachments.map(function(a){return a.url;}));newAttachments=[];matchedVideoUrls=__spreadArray([],Array.from(getAllVideosFromString(content)));for(_i=0,matchedVideoUrls_1=matchedVideoUrls;_i<matchedVideoUrls_1.length;_i++){matchedUrl=matchedVideoUrls_1[_i];url=matchedUrl.url;id=new VideoUrlParser(url).id;if(!existingAttachments.has(url)){newAttachments.push(__assign({id:id},matchedUrl));existingAttachments.add(url);}}matchedEmbeddedObjects=__spreadArray([],Array.from(getEmbeddedObjectsFromString(content)).filter(function(ob){return ob.subscriptionIdentifier===user.subscription.id||ob.subscriptionIdentifier===user.subscription.subscriptionHandle;}));_a=0,matchedEmbeddedObjects_1=matchedEmbeddedObjects;_b.label=1;case 1:if(!(_a<matchedEmbeddedObjects_1.length))return [3/*break*/,4];matchedEmbeddedObject=matchedEmbeddedObjects_1[_a];url=matchedEmbeddedObject.url;if(!(!existingAttachments.has(url)&&!(deletedAttachmentUrls===null||deletedAttachmentUrls===void 0?void 0:deletedAttachmentUrls.includes(url))))return [3/*break*/,3];return [4/*yield*/,validateEmbeddedObject(matchedEmbeddedObject)];case 2:isValid=_b.sent();if(isValid){newAttachments.push(__assign({},matchedEmbeddedObject));existingAttachments.add(url);}_b.label=3;case 3:_a++;return [3/*break*/,1];case 4:if(newAttachments.length!==0){onAttachmentsChange(attachments.concat(newAttachments));}return [2/*return*/];}});});}function handleGifClick(newAttachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){onAttachmentsChange(attachments.filter(function(attachment){return attachment.type!==AttachmentType.Giphy;}).concat(newAttachment));return [2/*return*/];});});}function handleDropFiles(dropResult){return __awaiter(this,void 0,void 0,function(){var newFiles,_i,_a,image,size;return __generator(this,function(_b){switch(_b.label){case 0:newFiles=dropResult.map(function(f){return {id:createId(),file:f,filename:f.name,previewUrl:URL.createObjectURL(f),type:f.type.startsWith('image/')?AttachmentType.Image:AttachmentType.File};});_i=0,_a=newFiles.filter(function(f){return f.type===AttachmentType.Image;});_b.label=1;case 1:if(!(_i<_a.length))return [3/*break*/,4];image=_a[_i];return [4/*yield*/,getImageSize(image.previewUrl)];case 2:size=_b.sent();image.width=size.width;image.height=size.height;_b.label=3;case 3:_i++;return [3/*break*/,1];case 4:onAttachmentsChange(attachments.concat(newFiles));return [2/*return*/];}});});}});var getMicrosoftStreamEmbedVideoUrl=function getMicrosoftStreamEmbedVideoUrl(id,autoPlay){if(autoPlay===void 0){autoPlay=false;}return "https://web.microsoftstream.com/embed/video/"+id+"?autoplay="+autoPlay+"&showInfo=true";};var getMicrosoftStreamVideoUrl=function getMicrosoftStreamVideoUrl(id){return "https://web.microsoftstream.com/video/"+id+"?autoplay=true";};var VideoElementGenerator=/** @class */function(){function VideoElementGenerator(videoInfo,iframeAreaLabel,autoplay,width,videoProperties){this.videoInfo=videoInfo;this.iframeAreaLabel=iframeAreaLabel;this.autoplay=autoplay;this.width=width;this.videoProperties=videoProperties;}VideoElementGenerator.prototype.getYouTubeVideoElement=function(){// <iframe
|
|
131872
131875
|
// src="https://www.youtube.com/embed/{videoId}?ecver=1" frameborder="0" allowfullscreen>
|
|
131873
131876
|
// </iframe>
|
|
131874
131877
|
var iframe=document.createElement('iframe');iframe.setAttribute('aria-label',this.iframeAreaLabel);iframe.setAttribute('src',"https://www.youtube.com/embed/"+this.videoInfo.id+"?rel=0&autoplay="+(this.autoplay?'1':'0'));iframe.setAttribute('frameborder','0');iframe.setAttribute('allowfullscreen','');return iframe;};VideoElementGenerator.prototype.getVimeoVideoElement=function(){// <iframe src="https://player.vimeo.com/video/{videoId}"
|
|
@@ -131887,14 +131890,14 @@ return this.getVideoElement(getMicrosoftStreamEmbedVideoUrl(this.videoInfo.id,th
|
|
|
131887
131890
|
// ></iframe>;
|
|
131888
131891
|
var _a=this.videoProperties||{},sp=_a.sp,uiconfId=_a.uiconfId,partnerId=_a.partnerId,entryId=_a.entryId;var iframe=document.createElement('iframe');iframe.setAttribute('aria-label',this.iframeAreaLabel);iframe.setAttribute('src',"https://cdnapisec.kaltura.com/p/"+this.videoInfo.id+"/sp/"+sp+"/embedIframeJs/uiconf_id/"+uiconfId+"/partner_id/"+partnerId+"?iframeembed=true&playerId=kaltura_player&entry_id="+entryId);iframe.setAttribute('frameborder','0');iframe.setAttribute('allowfullscreen','');return iframe;};VideoElementGenerator.prototype.getGenericURLVideoElement=function(){var _a;// for generic URL videos, we treat the id as the URL
|
|
131889
131892
|
var video=document.createElement('video');video.setAttribute('controls','');var source=document.createElement('source');source.setAttribute('src',(_a=this.videoInfo.url)!==null&&_a!==void 0?_a:this.videoInfo.id);if(this.autoplay){video.setAttribute('autoplay','');}if(this.width){video.setAttribute('width',this.width);}var noVideo=document.createTextNode('Your browser does not support the video tag');video.appendChild(source);video.appendChild(noVideo);return video;};VideoElementGenerator.prototype.getVideoElement=function(src){var iframe=document.createElement('iframe');iframe.setAttribute('src',src);iframe.setAttribute('frameborder','0');iframe.setAttribute('webkitallowfullscreen','');iframe.setAttribute('mozallowfullscreen','');iframe.setAttribute('allowfullscreen','');iframe.setAttribute('aria-label',this.iframeAreaLabel);return iframe;};VideoElementGenerator.prototype.getNotSupportedElement=function(){var content=document.createElement('div');content.innerText="The selected video cannot be played. The source is not supported.";return content;};VideoElementGenerator.getVideoElement=function(videoInfo,autoplay,width,iframeAreaLabel,videoProperties){var generator=new VideoElementGenerator(videoInfo,iframeAreaLabel||'',autoplay,width,videoProperties);switch(videoInfo.source){case VideoSource.YouTube:return generator.getYouTubeVideoElement();case VideoSource.Vimeo:return videoInfo.isDirectUrl?generator.getExternalVimeoVideoElement():generator.getVimeoVideoElement();case VideoSource.MicrosoftStream:return generator.getMicrosoftStreamVideoElement();case VideoSource.GenericUrl:return generator.getGenericURLVideoElement();case VideoSource.Kaltura:return generator.getKalturaVideoElement();default:return generator.getNotSupportedElement();}};VideoElementGenerator.getVideoType=function(videoInfo){switch(videoInfo.source){case VideoSource.YouTube:return 'YouTube';case VideoSource.Vimeo:return 'Vimeo';case VideoSource.MicrosoftStream:return 'Microsoft Stream';case VideoSource.GenericUrl:return 'Generic';case VideoSource.Kaltura:return 'Kaltura';default:return '';}};return VideoElementGenerator;}();var VideoView=function VideoView(_a){var videoInfo=_a.videoInfo,autoplay=_a.autoplay,width=_a.width,className=_a.className;var formatMessage=useIntl().formatMessage;var container=useRef$1();useEffect$1(function(){renderContents();// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131890
|
-
},[videoInfo.id,videoInfo.source]);return jsx$1(Host$T,{className:classNames(className,inlineObjectsClassNames.video,videoInfo.source===VideoSource.YouTube?inlineObjectsClassNames.video+"--youtube":null),ref:container,"data-is-direct-url":!!videoInfo.isDirectUrl,applyBackground:videoInfo.source===VideoSource.Vimeo&&!videoInfo.isDirectUrl},void 0);function renderContents(){var _a;if(!container.current){return;}var videoProperties=(_a=new VideoUrlParser(videoInfo.url))===null||_a===void 0?void 0:_a.videoProperties;var iframeAreaLabel=formatMessage({id:'AriaLabel.videoElementGenerator.videoPreview'},{type:VideoElementGenerator.getVideoType(videoInfo)});container.current.innerHTML='';container.current.appendChild(VideoElementGenerator.getVideoElement(videoInfo,autoplay,width,iframeAreaLabel,videoProperties));}};var Host$T=_styled.div.withConfig({displayName:"VideoView__Host",componentId:"sc-1t89fhn-0"})(templateObject_2$1v||(templateObject_2$1v=__makeTemplateObject(["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"],["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"])),function(p){return p.applyBackground&&css$2(templateObject_1$2i||(templateObject_1$2i=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.black);});var templateObject_1$2i,templateObject_2$1v;var VideoWithThumbnailView=function VideoWithThumbnailView(_a){var videoInfo=_a.videoInfo,videoThumbnailUrl=_a.videoThumbnailUrl,className=_a.className;var _b=useState$2(!videoInfo.isDirectUrl),showPlayer=_b[0],setShowPlayer=_b[1];if(showPlayer){return jsx$1(VideoView,{videoInfo:videoInfo,autoplay:videoInfo.isDirectUrl,className:className},void 0);}if(videoThumbnailUrl){return jsxs(Host$S,__assign({className:className},{children:[jsx$1(StyledImage,{src:videoThumbnailUrl,imageFit:ImageFit.cover,maximizeFrame:true},void 0),jsx$1(PlayButton,{onClick:function(){return setShowPlayer(true);},iconProps:{iconName:'MSNVideosSolid'}},void 0)]}),void 0);}return null;};var Host$S=_styled.div.withConfig({displayName:"VideoWithThumbnailView__Host",componentId:"sc-z8lt34-0"})(templateObject_1$2h||(templateObject_1$2h=__makeTemplateObject(["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"],["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"])));var StyledImage=_styled(Image$1).withConfig({displayName:"VideoWithThumbnailView__StyledImage",componentId:"sc-z8lt34-1"})(templateObject_2$1u||(templateObject_2$1u=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"])));var PlayButton=_styled(IconButton$1).withConfig({displayName:"VideoWithThumbnailView__PlayButton",componentId:"sc-z8lt34-2"})(templateObject_3$
|
|
131893
|
+
},[videoInfo.id,videoInfo.source]);return jsx$1(Host$T,{className:classNames(className,inlineObjectsClassNames.video,videoInfo.source===VideoSource.YouTube?inlineObjectsClassNames.video+"--youtube":null),ref:container,"data-is-direct-url":!!videoInfo.isDirectUrl,applyBackground:videoInfo.source===VideoSource.Vimeo&&!videoInfo.isDirectUrl},void 0);function renderContents(){var _a;if(!container.current){return;}var videoProperties=(_a=new VideoUrlParser(videoInfo.url))===null||_a===void 0?void 0:_a.videoProperties;var iframeAreaLabel=formatMessage({id:'AriaLabel.videoElementGenerator.videoPreview'},{type:VideoElementGenerator.getVideoType(videoInfo)});container.current.innerHTML='';container.current.appendChild(VideoElementGenerator.getVideoElement(videoInfo,autoplay,width,iframeAreaLabel,videoProperties));}};var Host$T=_styled.div.withConfig({displayName:"VideoView__Host",componentId:"sc-1t89fhn-0"})(templateObject_2$1v||(templateObject_2$1v=__makeTemplateObject(["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"],["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"])),function(p){return p.applyBackground&&css$2(templateObject_1$2i||(templateObject_1$2i=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.black);});var templateObject_1$2i,templateObject_2$1v;var VideoWithThumbnailView=function VideoWithThumbnailView(_a){var videoInfo=_a.videoInfo,videoThumbnailUrl=_a.videoThumbnailUrl,className=_a.className;var _b=useState$2(!videoInfo.isDirectUrl),showPlayer=_b[0],setShowPlayer=_b[1];if(showPlayer){return jsx$1(VideoView,{videoInfo:videoInfo,autoplay:videoInfo.isDirectUrl,className:className},void 0);}if(videoThumbnailUrl){return jsxs(Host$S,__assign({className:className},{children:[jsx$1(StyledImage,{src:videoThumbnailUrl,imageFit:ImageFit.cover,maximizeFrame:true},void 0),jsx$1(PlayButton,{onClick:function(){return setShowPlayer(true);},iconProps:{iconName:'MSNVideosSolid'}},void 0)]}),void 0);}return null;};var Host$S=_styled.div.withConfig({displayName:"VideoWithThumbnailView__Host",componentId:"sc-z8lt34-0"})(templateObject_1$2h||(templateObject_1$2h=__makeTemplateObject(["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"],["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"])));var StyledImage=_styled(Image$1).withConfig({displayName:"VideoWithThumbnailView__StyledImage",componentId:"sc-z8lt34-1"})(templateObject_2$1u||(templateObject_2$1u=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"])));var PlayButton=_styled(IconButton$1).withConfig({displayName:"VideoWithThumbnailView__PlayButton",componentId:"sc-z8lt34-2"})(templateObject_3$_||(templateObject_3$_=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"])));var templateObject_1$2h,templateObject_2$1u,templateObject_3$_;var VideoList=function VideoList(_a){var attachments=_a.attachments,onDeleteClick=_a.onDeleteClick,className=_a.className;var formatMessage=useIntl().formatMessage;var videos=attachments.filter(function(a){return a.type===AttachmentType.YouTubeVideo||a.type===AttachmentType.VimeoVideo;});if(videos.length===0){return null;}if(onDeleteClick){return jsx$1(Host$R,__assign({className:className,"data-video-attachment-list":true},{children:videos.map(function(video){return jsx$1(AttachmentHost,__assign({domIdentifier:"video",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":video.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(video);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(VideoPreview,{video:video},void 0)}),video.id);})}),void 0);}var video=videos[0];return jsx$1(PreviewHost$1,__assign({className:className,domIdentifier:"video-url-preview-"+video.id},{children:jsx$1(VideoPreview,{video:video},void 0)}),void 0);};var VideoPreview=function VideoPreview(_a){var video=_a.video;var getVideoThumbnailUrl=useVideosApi().getVideoThumbnailUrl;var token=useCurrentToken();var user=useCurrentUser();var parser=new VideoUrlParser(video.url);var source=video.type===AttachmentType.YouTubeVideo?VideoSource.YouTube:VideoSource.Vimeo;var videoThumbnailUrl=parser.isDirectVideoUrl?getVideoThumbnailUrl(token,user.subscription.id,source,video.id):null;return jsx$1(VideoWithThumbnailView,{videoInfo:{id:video.id,source:source,url:video.url,isDirectUrl:parser.isDirectVideoUrl},videoThumbnailUrl:videoThumbnailUrl},void 0);};var Host$R=_styled.div.withConfig({displayName:"VideoList__Host",componentId:"sc-1cep2pw-0"})(templateObject_1$2g||(templateObject_1$2g=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"])),spacingM);var PreviewHost$1=_styled(AttachmentHost).withConfig({displayName:"VideoList__PreviewHost",componentId:"sc-1cep2pw-1"})(templateObject_2$1t||(templateObject_2$1t=__makeTemplateObject(["\n margin: ","px 0 0 0;\n"],["\n margin: ","px 0 0 0;\n"])),spacingM);var templateObject_1$2g,templateObject_2$1t;var aFunction$1=aFunction$7;var toObject$1=toObject$7;var IndexedObject=indexedObject;var toLength$3=toLength$b;// `Array.prototype.{ reduce, reduceRight }` methods implementation
|
|
131891
131894
|
var createMethod$4=function(IS_RIGHT){return function(that,callbackfn,argumentsLength,memo){aFunction$1(callbackfn);var O=toObject$1(that);var self=IndexedObject(O);var length=toLength$3(O.length);var index=IS_RIGHT?length-1:0;var i=IS_RIGHT?-1:1;if(argumentsLength<2)while(true){if(index in self){memo=self[index];index+=i;break;}index+=i;if(IS_RIGHT?index<0:length<=index){throw TypeError('Reduce of empty array with no initial value');}}for(;IS_RIGHT?index>=0:length>index;index+=i)if(index in self){memo=callbackfn(memo,self[index],index,O);}return memo;};};var arrayReduce={// `Array.prototype.reduce` method
|
|
131892
131895
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
|
|
131893
131896
|
left:createMethod$4(false),// `Array.prototype.reduceRight` method
|
|
131894
131897
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
|
|
131895
131898
|
right:createMethod$4(true)};var DESCRIPTORS$1=descriptors;var fails$j=fails$i;var has$1=has$c;var defineProperty$1=Object.defineProperty;var cache={};var thrower=function(it){throw it;};var arrayMethodUsesToLength$1=function(METHOD_NAME,options){if(has$1(cache,METHOD_NAME))return cache[METHOD_NAME];if(!options)options={};var method=[][METHOD_NAME];var ACCESSORS=has$1(options,'ACCESSORS')?options.ACCESSORS:false;var argument0=has$1(options,0)?options[0]:thrower;var argument1=has$1(options,1)?options[1]:undefined;return cache[METHOD_NAME]=!!method&&!fails$j(function(){if(ACCESSORS&&!DESCRIPTORS$1)return true;var O={length:-1};if(ACCESSORS)defineProperty$1(O,1,{enumerable:true,get:thrower});else O[1]=1;method.call(O,argument0,argument1);});};var $$6=_export;var $reduce=arrayReduce.left;var arrayMethodIsStrict=arrayMethodIsStrict$2;var arrayMethodUsesToLength=arrayMethodUsesToLength$1;var STRICT_METHOD=arrayMethodIsStrict('reduce');var USES_TO_LENGTH=arrayMethodUsesToLength('reduce',{1:0});// `Array.prototype.reduce` method
|
|
131896
131899
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
|
|
131897
|
-
$$6({target:'Array',proto:true,forced:!STRICT_METHOD||!USES_TO_LENGTH},{reduce:function reduce(callbackfn/* , initialValue */){return $reduce(this,callbackfn,arguments.length,arguments.length>1?arguments[1]:undefined);}});var KeywordsInfo=function KeywordsInfo(_a){var keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var flatKeywords=getFlatKeywordList(keywords);var hasKeywords=flatKeywords&&flatKeywords.length>0;if(!hasKeywords){return null;}return jsx$1(Host$Q,__assign({"data-keywords":true},{children:renderKeywords()}),void 0);function renderKeywords(){var keywordsGroupsIds=Object.keys(keywords||[]);return keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].length>0&&jsx$1(KeywordsGroup,{groupId:groupId,groupName:availableKeywordGroups[groupId].name,language:language,keywords:keywords,className:className,filterBaseUrl:filterBaseUrl},groupId);});}};var KeywordsGroup=function KeywordsGroup(_a){var groupId=_a.groupId,groupName=_a.groupName,keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;return jsxs(KeywordsList$1,__assign({className:classNames('ms-fontColor-neutralSecondaryAlt',className)},{children:[jsxs(KeywordsListTitle,{children:[jsx$1(KeywordTitle,{groupName:groupName,language:language},void 0),":"]},void 0),keywords[groupId].map(function(k){var Title=jsx$1(KeywordTitle,{groupName:groupName,keywordName:k.name,language:language},void 0);return jsx$1(KeywordsListItem,{children:filterBaseUrl?jsx$1(NavLink,__assign({"data-keyword":true,className:"ms-fontColor-neutralSecondaryAlt",to:filterBaseUrl+"?"+queryString.stringify({keywords:k.id})},{children:Title}),void 0):jsxs(Fragment,{children:[" ",Title," "]},void 0)},groupName+k.name);})]}),void 0);};var Host$Q=_styled.div.withConfig({displayName:"KeywordsInfo__Host",componentId:"sc-woteiy-0"})(templateObject_1$2f||(templateObject_1$2f=__makeTemplateObject(["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"],["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"])),spacingM,spacingXl);var KeywordsList$1=_styled.dl.withConfig({displayName:"KeywordsInfo__KeywordsList",componentId:"sc-woteiy-1"})(templateObject_2$1s||(templateObject_2$1s=__makeTemplateObject(["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"],["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"])));var KeywordsListTitle=_styled.dt.withConfig({displayName:"KeywordsInfo__KeywordsListTitle",componentId:"sc-woteiy-2"})(templateObject_3$Y||(templateObject_3$Y=__makeTemplateObject(["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"],["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"])));var KeywordsListItem=_styled.dd.withConfig({displayName:"KeywordsInfo__KeywordsListItem",componentId:"sc-woteiy-3"})(templateObject_4$H||(templateObject_4$H=__makeTemplateObject(["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"],["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"])));var Keywords$3=function Keywords(_a){var keywords=_a.item.keywords,filterBaseUrl=_a.filterBaseUrl,className=_a.className,useGridKeywordTitle=_a.useGridKeywordTitle,onClick=_a.onClick;var location=useLocation$1();var currentParamsObject=queryString.parse(location.search);var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var keywordsGroupsIds=Object.keys(keywords||[]);return jsx$1("span",__assign({className:className},{children:keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].map(function(keyword){currentParamsObject.keywords=keyword.id;if(filterBaseUrl){return jsx$1(NavLink,__assign({"data-keyword":true,to:filterBaseUrl+"?"+queryString.stringify(currentParamsObject)},{children:useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:groupId},void 0):jsx$1(KeywordTitle,{keywordName:keyword.name,groupId:groupId,underlined:true},void 0)}),groupId+keyword.id);}return useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:groupId},groupId+keyword.id):jsx$1(KeywordTitle,{keywordName:keyword.name,keywordId:keyword.id,groupId:groupId,onClick:onClick},groupId+keyword.id);});}).reduce(function(result,next){return result.concat(next);},[])}),void 0);};var FlatKeywords=_styled(Keywords$3).withConfig({displayName:"KeywordsInfo__FlatKeywords",componentId:"sc-woteiy-4"})(templateObject_5$B||(templateObject_5$B=__makeTemplateObject(["\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n }\n\n > button {\n &:not(:last-child) {\n > span {\n &::after {\n content: ', ';\n }\n }\n }\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"],["\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n }\n\n > button {\n &:not(:last-child) {\n > span {\n &::after {\n content: ', ';\n }\n }\n }\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$2f,templateObject_2$1s,templateObject_3$Y,templateObject_4$H,templateObject_5$B;var NewsService=/** @class */function(){function NewsService(){}NewsService.getNewsRouteWithRedirect=function(baseRoute,newsId,newsTitle,isExternalContent){var route=!isExternalContent?baseRoute:baseRoute.replace('/news','/redirect/news');return this.getNewsRoute(route,newsId,newsTitle,isExternalContent);};NewsService.getNewsRoute=function(baseRoute,newsId,newsTitle,isExternalContent){var route=baseRoute+"/"+encodeURIComponent(newsId);if(newsTitle){route=route+"/"+slugify(newsTitle,{remove:/[%.#?]/});}return isExternalContent?route+"?"+queryString.stringify({noRedirect:true}):route;};NewsService.getItemContentLanguages=function(item,languages){if(!item){return [];}return NewsService.getContentLanguages(item.contents,languages);};NewsService.getContentLanguages=function(contents,languages,contentValidator){if(!contents){return [];}var allLanguages=Object.keys(contents);if(!allLanguages.length){return [];}var activeLanguages=allLanguages.filter(function(l){return contents[l].active&&languages.find(function(sl){return sl.code===l;})&&(!contentValidator||contentValidator(contents[l]));});if(contentValidator){return activeLanguages;}return activeLanguages.length?activeLanguages:[allLanguages[0]];};NewsService.getLanguageForPublishableItem=function(item,user,contentValidator){if(!user||!item||!item.contents||!user.subscription){return null;}return NewsService.getLanguageForContent(item.contents,user,contentValidator);};NewsService.getLanguageForContent=function(contents,user,contentValidator){if(!contents){return null;}var activeLanguages=NewsService.getContentLanguages(contents,user.subscription.languages,contentValidator);return NewsService.getUserPreferredLanguage(activeLanguages,user);};NewsService.getUserPreferredLanguage=function(languages,user){if(!languages){return null;}var preferredLanguage=getPreferredContentLanguage(user);var subscription=user.subscription;if(languages.find(function(l){return l===preferredLanguage;})){return preferredLanguage;}if(languages.find(function(l){return l===subscription.defaultLanguage;})){return subscription.defaultLanguage;}return languages[0];};return NewsService;}();var ClickableOverlay=function ClickableOverlay(_a){var title=_a.title,itemId=_a.itemId,itemType=_a.itemType,baseRoute=_a.baseRoute,ariaLabelResourceKey=_a.ariaLabelResourceKey,onClick=_a.onClick,openTargetInNewWindow=_a.openTargetInNewWindow,isExternalContent=_a.isExternalContent;var formatMessage=useIntl().formatMessage;var targetRoute=itemType===ItemResourceTypes.Posts||itemType===ItemResourceTypes.Comments?baseRoute:NewsService.getNewsRoute(baseRoute,itemId,title,isExternalContent);if(openTargetInNewWindow){return jsx$1(ExternalLink$1,{href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);}return jsx$1(StyledLink$1,{to:targetRoute,onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);};var Style=css$2(templateObject_1$2e||(templateObject_1$2e=__makeTemplateObject(["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"],["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"])));var StyledLink$1=_styled(Link$4).withConfig({displayName:"ClickableOverlay__StyledLink",componentId:"sc-yfxl9c-0"})(templateObject_2$1r||(templateObject_2$1r=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var ExternalLink$1=_styled.a.withConfig({displayName:"ClickableOverlay__ExternalLink",componentId:"sc-yfxl9c-1"})(templateObject_3$X||(templateObject_3$X=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var templateObject_1$2e,templateObject_2$1r,templateObject_3$X;var PostItemTile=function PostItemTile(_a){var post=_a.post,readOnly=_a.readOnly,backgroundColor=_a.backgroundColor,className=_a.className;var features=useFeatures();var buildPath=useSubscriptionHandlePathBuilder().buildPath;return jsxs(PostHost,__assign({className:className,backgroundColor:backgroundColor},{children:[!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath("/posts/"+post.id),itemId:post.id,itemType:ItemResourceTypes.Posts,ariaLabelResourceKey:"AriaLabel.itemLink"},void 0),jsxs(Header$3,{children:[jsx$1(StyledPersonaCard$3,__assign({upn:post.author.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:post.author.userPrincipalName,text:post.author.displayName,size:PersonaSize.size40,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$2,{children:[jsx$1(PostDisplayName$1,__assign({"data-author":true},{children:post.author.displayName}),void 0),jsx$1(PostDateTime$1,{className:"ms-fontColor-neutralTertiary",value:post.publishingDate},void 0),jsx$1(Modified,{modified:post.modified},void 0)]},void 0)]},void 0),jsx$1(Content$8,{children:jsx$1(ContentDisplay,{content:post.content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag]},void 0)},void 0),features.keywords&&features.postKeywords&&post.keywords&&jsx$1(StyledKeywordsInfo$1,{keywords:post.keywords},void 0)]}),void 0);};var PostHost=_styled.div.withConfig({displayName:"PostItemTile__PostHost",componentId:"sc-yu434m-0"})(templateObject_3$W||(templateObject_3$W=__makeTemplateObject(["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"],["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$2d||(templateObject_1$2d=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$1q||(templateObject_2$1q=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.white);},fontSizeSmall,spacingM);var Header$3=_styled.div.withConfig({displayName:"PostItemTile__Header",componentId:"sc-yu434m-1"})(templateObject_4$G||(templateObject_4$G=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledPersonaCard$3=_styled(PersonaCard).withConfig({displayName:"PostItemTile__StyledPersonaCard",componentId:"sc-yu434m-2"})(templateObject_5$A||(templateObject_5$A=__makeTemplateObject(["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var HeaderMetadata$2=_styled.div.withConfig({displayName:"PostItemTile__HeaderMetadata",componentId:"sc-yu434m-3"})(templateObject_6$q||(templateObject_6$q=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"],["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"])),fontSizeSmall,spacingS);var PostDisplayName$1=_styled.div.withConfig({displayName:"PostItemTile__PostDisplayName",componentId:"sc-yu434m-4"})(templateObject_7$k||(templateObject_7$k=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var PostDateTime$1=_styled(DateTime).withConfig({displayName:"PostItemTile__PostDateTime",componentId:"sc-yu434m-5"})(templateObject_8$i||(templateObject_8$i=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeSmaller);var Content$8=_styled.div.withConfig({displayName:"PostItemTile__Content",componentId:"sc-yu434m-6"})(templateObject_9$e||(templateObject_9$e=__makeTemplateObject(["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var StyledKeywordsInfo$1=_styled(KeywordsInfo).withConfig({displayName:"PostItemTile__StyledKeywordsInfo",componentId:"sc-yu434m-7"})(templateObject_10$c||(templateObject_10$c=__makeTemplateObject(["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"],["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"])),spacingM);var templateObject_1$2d,templateObject_2$1q,templateObject_3$W,templateObject_4$G,templateObject_5$A,templateObject_6$q,templateObject_7$k,templateObject_8$i,templateObject_9$e,templateObject_10$c;var EventLocationLink=function EventLocationLink(_a){var location=_a.location,alternativeCaption=_a.alternativeCaption,className=_a.className;var locationLink=location.url||getGoogleMapsSearchLink(location.locationOnMap);return jsx$1(Fragment,{children:locationLink?jsx$1(TextLink,__assign({url:locationLink,ariaLabel:alternativeCaption||location.name},{children:alternativeCaption||location.name}),void 0):jsx$1("span",__assign({className:className},{children:alternativeCaption||location.name}),void 0)},void 0);};var EventLocationInfo=function EventLocationInfo(_a){var locations=_a.locations,className=_a.className;if(!locations||locations.length===0){return null;}var isMultiLine=locations.length>1;return jsx$1(Host$P,__assign({className:className},{children:jsxs(ListWrapper,__assign({"data-event-locations":true,isMultiLine:isMultiLine},{children:[jsx$1(Label,{resourceKey:"Events.locationsLabel",count:locations.length},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:locations.map(function(l){return jsx$1("li",{children:jsx$1(EventLocationLink,{location:l},void 0)},l.locationId);})}),void 0)]}),void 0)}),void 0);};var EventPeopleInfo=function EventPeopleInfo(_a){var item=_a.item,className=_a.className,hideAnnouncer=_a.hideAnnouncer;var author=item.owner||item.author;var contactsCount=item.contacts&&item.contacts.length;if(hideAnnouncer&&contactsCount===0){return null;}var isMultiLine=contactsCount>1;return jsxs(Host$P,__assign({className:className},{children:[contactsCount>0&&jsxs(Contacts$1,__assign({"data-event-people":"contacts",isMultiLine:isMultiLine,hideAnnouncer:hideAnnouncer},{children:[jsx$1(Label,{resourceKey:"Events.contactsLabel",count:contactsCount},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:item.contacts.map(function(c){return jsx$1("li",{children:jsx$1(EventUser,{user:c,className:"ms-fontColor-accent"},void 0)},c.userPrincipalName);})}),void 0)]}),void 0),!hideAnnouncer&&author&&jsxs(ListWrapper,__assign({"data-event-people":"author",isMultiLine:false},{children:[jsx$1(Label,{resourceKey:"Events.authorLabel"},void 0),jsx$1(EventUser,{user:author,className:"ms-fontColor-accent"},void 0)]}),void 0)]}),void 0);};var EventUser=function EventUser(_a){var user=_a.user,className=_a.className;return jsx$1("div",__assign({className:className},{children:jsx$1(StyledPersonaCard$2,__assign({upn:user.userPrincipalName},{children:user.displayName}),void 0)}),void 0);};var Label=function Label(_a){var resourceKey=_a.resourceKey,count=_a.count;return jsxs("div",{children:[jsx$1(FormattedMessage$1,{id:resourceKey,values:{count:count||1}},void 0),":\u00A0"]},void 0);};var EventChannelsDisplay=function EventChannelsDisplay(_a){var _b;var item=_a.item,language=_a.language,className=_a.className,allowFilterByChannels=_a.allowFilterByChannels,channelBackgroundColor=_a.channelBackgroundColor;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!((_b=item===null||item===void 0?void 0:item.channels)===null||_b===void 0?void 0:_b.length)){return null;}return jsx$1(Channels$2,{channels:item.channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:allowFilterByChannels?function(c){return buildPath("/events?"+queryString.stringify({channels:c}));}:null,channelBackgroundColor:channelBackgroundColor,className:className},void 0);};var Host$P=_styled.div.withConfig({displayName:"EventMetaInfo__Host",componentId:"sc-l9y854-0"})(templateObject_1$2c||(templateObject_1$2c=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"])),fontSizeSmall);var ListWrapper=_styled.div.withConfig({displayName:"EventMetaInfo__ListWrapper",componentId:"sc-l9y854-1"})(templateObject_2$1p||(templateObject_2$1p=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"])),function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?'column':'row';},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine&&'> div:first-child { padding-bottom: 3px }';});var Contacts$1=_styled(ListWrapper).withConfig({displayName:"EventMetaInfo__Contacts",componentId:"sc-l9y854-2"})(templateObject_3$V||(templateObject_3$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),function(p){return !p.hideAnnouncer?spacingXs:0;});var StyledPersonaCard$2=_styled(PersonaCard).withConfig({displayName:"EventMetaInfo__StyledPersonaCard",componentId:"sc-l9y854-3"})(templateObject_4$F||(templateObject_4$F=__makeTemplateObject(["\n text-decoration: underline;\n"],["\n text-decoration: underline;\n"])));var List$2=_styled.ul.withConfig({displayName:"EventMetaInfo__List",componentId:"sc-l9y854-4"})(templateObject_6$p||(templateObject_6$p=__makeTemplateObject(["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"],["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"])),function(_a){var isMultiLine=_a.isMultiLine;return !isMultiLine&&css$2(templateObject_5$z||(templateObject_5$z=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "],["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "])));},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?3:0;});var Channels$2=_styled(ClickableChannelTitles).withConfig({displayName:"EventMetaInfo__Channels",componentId:"sc-l9y854-5"})(templateObject_7$j||(templateObject_7$j=__makeTemplateObject(["\n &&& li {\n margin-top: ","px;\n }\n"],["\n &&& li {\n margin-top: ","px;\n }\n"])),spacingS);var templateObject_1$2c,templateObject_2$1p,templateObject_3$V,templateObject_4$F,templateObject_5$z,templateObject_6$p,templateObject_7$j;var BannerImage=function BannerImage(_a){var imageUrl=_a.imageUrl,children=_a.children,className=_a.className,openImageUrl=_a.openImageUrl;return jsxs(Host$O,__assign({onClick:function(){return openImageUrl&&showPhoto();},className:classNames('bannerImage',className)},{children:[jsx$1(Image$1,{src:imageUrl,imageFit:ImageFit.cover,maximizeFrame:true,alt:""},void 0),children]}),void 0);};var Host$O=_styled.div.withConfig({displayName:"BannerImage__Host",componentId:"sc-1wfmp37-0"})(templateObject_1$2b||(templateObject_1$2b=__makeTemplateObject(["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"],["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"])));var templateObject_1$2b;function useImageEditorApi(){var api=useApi();var _a=useApiFactory(),createApiUrl=_a.createApiUrl,fetchFromApi=_a.fetchFromApi;var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {getImageInfo:getImageInfo,getImageEditorUrl:getImageEditorUrl,getOriginalImageEditorUrlWithToken:getOriginalImageEditorUrlWithToken,getImageEditorUrlWithToken:getImageEditorUrlWithToken,uploadImage:uploadImage};/**
|
|
131900
|
+
$$6({target:'Array',proto:true,forced:!STRICT_METHOD||!USES_TO_LENGTH},{reduce:function reduce(callbackfn/* , initialValue */){return $reduce(this,callbackfn,arguments.length,arguments.length>1?arguments[1]:undefined);}});var KeywordsInfo=function KeywordsInfo(_a){var keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var flatKeywords=getFlatKeywordList(keywords);var hasKeywords=flatKeywords&&flatKeywords.length>0;if(!hasKeywords){return null;}return jsx$1(Host$Q,__assign({"data-keywords":true},{children:renderKeywords()}),void 0);function renderKeywords(){var keywordsGroupsIds=Object.keys(keywords||[]);return keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].length>0&&jsx$1(KeywordsGroup,{groupId:groupId,groupName:availableKeywordGroups[groupId].name,language:language,keywords:keywords,className:className,filterBaseUrl:filterBaseUrl},groupId);});}};var KeywordsGroup=function KeywordsGroup(_a){var groupId=_a.groupId,groupName=_a.groupName,keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;return jsxs(KeywordsList$1,__assign({className:classNames('ms-fontColor-neutralSecondaryAlt',className)},{children:[jsxs(KeywordsListTitle,{children:[jsx$1(KeywordTitle,{groupName:groupName,language:language},void 0),":"]},void 0),keywords[groupId].map(function(k){var Title=jsx$1(KeywordTitle,{groupName:groupName,keywordName:k.name,language:language},void 0);return jsx$1(KeywordsListItem,{children:filterBaseUrl?jsx$1(NavLink,__assign({"data-keyword":true,className:"ms-fontColor-neutralSecondaryAlt",to:filterBaseUrl+"?"+queryString.stringify({keywords:k.id})},{children:Title}),void 0):jsxs(Fragment,{children:[" ",Title," "]},void 0)},groupName+k.name);})]}),void 0);};var Host$Q=_styled.div.withConfig({displayName:"KeywordsInfo__Host",componentId:"sc-woteiy-0"})(templateObject_1$2f||(templateObject_1$2f=__makeTemplateObject(["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"],["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"])),spacingM,spacingXl);var KeywordsList$1=_styled.dl.withConfig({displayName:"KeywordsInfo__KeywordsList",componentId:"sc-woteiy-1"})(templateObject_2$1s||(templateObject_2$1s=__makeTemplateObject(["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"],["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"])));var KeywordsListTitle=_styled.dt.withConfig({displayName:"KeywordsInfo__KeywordsListTitle",componentId:"sc-woteiy-2"})(templateObject_3$Z||(templateObject_3$Z=__makeTemplateObject(["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"],["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"])));var KeywordsListItem=_styled.dd.withConfig({displayName:"KeywordsInfo__KeywordsListItem",componentId:"sc-woteiy-3"})(templateObject_4$H||(templateObject_4$H=__makeTemplateObject(["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"],["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"])));var Keywords$3=function Keywords(_a){var keywords=_a.item.keywords,filterBaseUrl=_a.filterBaseUrl,className=_a.className,useGridKeywordTitle=_a.useGridKeywordTitle,onClick=_a.onClick;var location=useLocation$1();var currentParamsObject=queryString.parse(location.search);var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var keywordsGroupsIds=Object.keys(keywords||[]);return jsx$1("span",__assign({className:className},{children:keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].map(function(keyword){currentParamsObject.keywords=keyword.id;if(filterBaseUrl){return jsx$1(NavLink,__assign({"data-keyword":true,to:filterBaseUrl+"?"+queryString.stringify(currentParamsObject)},{children:useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:groupId},void 0):jsx$1(KeywordTitle,{keywordName:keyword.name,groupId:groupId,underlined:true},void 0)}),groupId+keyword.id);}return useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:groupId},groupId+keyword.id):jsx$1(KeywordTitle,{keywordName:keyword.name,keywordId:keyword.id,groupId:groupId,onClick:onClick},groupId+keyword.id);});}).reduce(function(result,next){return result.concat(next);},[])}),void 0);};var FlatKeywords=_styled(Keywords$3).withConfig({displayName:"KeywordsInfo__FlatKeywords",componentId:"sc-woteiy-4"})(templateObject_5$B||(templateObject_5$B=__makeTemplateObject(["\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n }\n\n > button {\n &:not(:last-child) {\n > span {\n &::after {\n content: ', ';\n }\n }\n }\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"],["\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n }\n\n > button {\n &:not(:last-child) {\n > span {\n &::after {\n content: ', ';\n }\n }\n }\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$2f,templateObject_2$1s,templateObject_3$Z,templateObject_4$H,templateObject_5$B;var NewsService=/** @class */function(){function NewsService(){}NewsService.getNewsRouteWithRedirect=function(baseRoute,newsId,newsTitle,isExternalContent){var route=!isExternalContent?baseRoute:baseRoute.replace('/news','/redirect/news');return this.getNewsRoute(route,newsId,newsTitle,isExternalContent);};NewsService.getNewsRoute=function(baseRoute,newsId,newsTitle,isExternalContent){var route=baseRoute+"/"+encodeURIComponent(newsId);if(newsTitle){route=route+"/"+slugify(newsTitle,{remove:/[%.#?]/});}return isExternalContent?route+"?"+queryString.stringify({noRedirect:true}):route;};NewsService.getItemContentLanguages=function(item,languages){if(!item){return [];}return NewsService.getContentLanguages(item.contents,languages);};NewsService.getContentLanguages=function(contents,languages,contentValidator){if(!contents){return [];}var allLanguages=Object.keys(contents);if(!allLanguages.length){return [];}var activeLanguages=allLanguages.filter(function(l){return contents[l].active&&languages.find(function(sl){return sl.code===l;})&&(!contentValidator||contentValidator(contents[l]));});if(contentValidator){return activeLanguages;}return activeLanguages.length?activeLanguages:[allLanguages[0]];};NewsService.getLanguageForPublishableItem=function(item,user,contentValidator){if(!user||!item||!item.contents||!user.subscription){return null;}return NewsService.getLanguageForContent(item.contents,user,contentValidator);};NewsService.getLanguageForContent=function(contents,user,contentValidator){if(!contents){return null;}var activeLanguages=NewsService.getContentLanguages(contents,user.subscription.languages,contentValidator);return NewsService.getUserPreferredLanguage(activeLanguages,user);};NewsService.getUserPreferredLanguage=function(languages,user){if(!languages){return null;}var preferredLanguage=getPreferredContentLanguage(user);var subscription=user.subscription;if(languages.find(function(l){return l===preferredLanguage;})){return preferredLanguage;}if(languages.find(function(l){return l===subscription.defaultLanguage;})){return subscription.defaultLanguage;}return languages[0];};return NewsService;}();var ClickableOverlay=function ClickableOverlay(_a){var title=_a.title,itemId=_a.itemId,itemType=_a.itemType,baseRoute=_a.baseRoute,ariaLabelResourceKey=_a.ariaLabelResourceKey,onClick=_a.onClick,openTargetInNewWindow=_a.openTargetInNewWindow,isExternalContent=_a.isExternalContent;var formatMessage=useIntl().formatMessage;var targetRoute=itemType===ItemResourceTypes.Posts||itemType===ItemResourceTypes.Comments?baseRoute:NewsService.getNewsRoute(baseRoute,itemId,title,isExternalContent);if(openTargetInNewWindow){return jsx$1(ExternalLink$1,{href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);}return jsx$1(StyledLink$1,{to:targetRoute,onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);};var Style=css$2(templateObject_1$2e||(templateObject_1$2e=__makeTemplateObject(["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"],["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"])));var StyledLink$1=_styled(Link$4).withConfig({displayName:"ClickableOverlay__StyledLink",componentId:"sc-yfxl9c-0"})(templateObject_2$1r||(templateObject_2$1r=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var ExternalLink$1=_styled.a.withConfig({displayName:"ClickableOverlay__ExternalLink",componentId:"sc-yfxl9c-1"})(templateObject_3$Y||(templateObject_3$Y=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var templateObject_1$2e,templateObject_2$1r,templateObject_3$Y;var PostItemTile=function PostItemTile(_a){var post=_a.post,readOnly=_a.readOnly,backgroundColor=_a.backgroundColor,className=_a.className;var features=useFeatures();var buildPath=useSubscriptionHandlePathBuilder().buildPath;return jsxs(PostHost,__assign({className:className,backgroundColor:backgroundColor},{children:[!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath("/posts/"+post.id),itemId:post.id,itemType:ItemResourceTypes.Posts,ariaLabelResourceKey:"AriaLabel.itemLink"},void 0),jsxs(Header$3,{children:[jsx$1(StyledPersonaCard$3,__assign({upn:post.author.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:post.author.userPrincipalName,text:post.author.displayName,size:PersonaSize.size40,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$2,{children:[jsx$1(PostDisplayName$1,__assign({"data-author":true},{children:post.author.displayName}),void 0),jsx$1(PostDateTime$1,{className:"ms-fontColor-neutralTertiary",value:post.publishingDate},void 0),jsx$1(Modified,{modified:post.modified},void 0)]},void 0)]},void 0),jsx$1(Content$8,{children:jsx$1(ContentDisplay,{content:post.content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag]},void 0)},void 0),features.keywords&&features.postKeywords&&post.keywords&&jsx$1(StyledKeywordsInfo$1,{keywords:post.keywords},void 0)]}),void 0);};var PostHost=_styled.div.withConfig({displayName:"PostItemTile__PostHost",componentId:"sc-yu434m-0"})(templateObject_3$X||(templateObject_3$X=__makeTemplateObject(["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"],["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$2d||(templateObject_1$2d=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$1q||(templateObject_2$1q=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.white);},fontSizeSmall,spacingM);var Header$3=_styled.div.withConfig({displayName:"PostItemTile__Header",componentId:"sc-yu434m-1"})(templateObject_4$G||(templateObject_4$G=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledPersonaCard$3=_styled(PersonaCard).withConfig({displayName:"PostItemTile__StyledPersonaCard",componentId:"sc-yu434m-2"})(templateObject_5$A||(templateObject_5$A=__makeTemplateObject(["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var HeaderMetadata$2=_styled.div.withConfig({displayName:"PostItemTile__HeaderMetadata",componentId:"sc-yu434m-3"})(templateObject_6$q||(templateObject_6$q=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"],["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"])),fontSizeSmall,spacingS);var PostDisplayName$1=_styled.div.withConfig({displayName:"PostItemTile__PostDisplayName",componentId:"sc-yu434m-4"})(templateObject_7$k||(templateObject_7$k=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var PostDateTime$1=_styled(DateTime).withConfig({displayName:"PostItemTile__PostDateTime",componentId:"sc-yu434m-5"})(templateObject_8$i||(templateObject_8$i=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeSmaller);var Content$8=_styled.div.withConfig({displayName:"PostItemTile__Content",componentId:"sc-yu434m-6"})(templateObject_9$e||(templateObject_9$e=__makeTemplateObject(["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var StyledKeywordsInfo$1=_styled(KeywordsInfo).withConfig({displayName:"PostItemTile__StyledKeywordsInfo",componentId:"sc-yu434m-7"})(templateObject_10$c||(templateObject_10$c=__makeTemplateObject(["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"],["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"])),spacingM);var templateObject_1$2d,templateObject_2$1q,templateObject_3$X,templateObject_4$G,templateObject_5$A,templateObject_6$q,templateObject_7$k,templateObject_8$i,templateObject_9$e,templateObject_10$c;var EventLocationLink=function EventLocationLink(_a){var location=_a.location,alternativeCaption=_a.alternativeCaption,className=_a.className;var locationLink=location.url||getGoogleMapsSearchLink(location.locationOnMap);return jsx$1(Fragment,{children:locationLink?jsx$1(TextLink,__assign({url:locationLink,ariaLabel:alternativeCaption||location.name},{children:alternativeCaption||location.name}),void 0):jsx$1("span",__assign({className:className},{children:alternativeCaption||location.name}),void 0)},void 0);};var EventLocationInfo=function EventLocationInfo(_a){var locations=_a.locations,className=_a.className;if(!locations||locations.length===0){return null;}var isMultiLine=locations.length>1;return jsx$1(Host$P,__assign({className:className},{children:jsxs(ListWrapper,__assign({"data-event-locations":true,isMultiLine:isMultiLine},{children:[jsx$1(Label,{resourceKey:"Events.locationsLabel",count:locations.length},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:locations.map(function(l){return jsx$1("li",{children:jsx$1(EventLocationLink,{location:l},void 0)},l.locationId);})}),void 0)]}),void 0)}),void 0);};var EventPeopleInfo=function EventPeopleInfo(_a){var item=_a.item,className=_a.className,hideAnnouncer=_a.hideAnnouncer;var author=item.owner||item.author;var contactsCount=item.contacts&&item.contacts.length;if(hideAnnouncer&&contactsCount===0){return null;}var isMultiLine=contactsCount>1;return jsxs(Host$P,__assign({className:className},{children:[contactsCount>0&&jsxs(Contacts$1,__assign({"data-event-people":"contacts",isMultiLine:isMultiLine,hideAnnouncer:hideAnnouncer},{children:[jsx$1(Label,{resourceKey:"Events.contactsLabel",count:contactsCount},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:item.contacts.map(function(c){return jsx$1("li",{children:jsx$1(EventUser,{user:c,className:"ms-fontColor-accent"},void 0)},c.userPrincipalName);})}),void 0)]}),void 0),!hideAnnouncer&&author&&jsxs(ListWrapper,__assign({"data-event-people":"author",isMultiLine:false},{children:[jsx$1(Label,{resourceKey:"Events.authorLabel"},void 0),jsx$1(EventUser,{user:author,className:"ms-fontColor-accent"},void 0)]}),void 0)]}),void 0);};var EventUser=function EventUser(_a){var user=_a.user,className=_a.className;return jsx$1("div",__assign({className:className},{children:jsx$1(StyledPersonaCard$2,__assign({upn:user.userPrincipalName},{children:user.displayName}),void 0)}),void 0);};var Label=function Label(_a){var resourceKey=_a.resourceKey,count=_a.count;return jsxs("div",{children:[jsx$1(FormattedMessage$1,{id:resourceKey,values:{count:count||1}},void 0),":\u00A0"]},void 0);};var EventChannelsDisplay=function EventChannelsDisplay(_a){var _b;var item=_a.item,language=_a.language,className=_a.className,allowFilterByChannels=_a.allowFilterByChannels,channelBackgroundColor=_a.channelBackgroundColor;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!((_b=item===null||item===void 0?void 0:item.channels)===null||_b===void 0?void 0:_b.length)){return null;}return jsx$1(Channels$2,{channels:item.channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:allowFilterByChannels?function(c){return buildPath("/events?"+queryString.stringify({channels:c}));}:null,channelBackgroundColor:channelBackgroundColor,className:className},void 0);};var Host$P=_styled.div.withConfig({displayName:"EventMetaInfo__Host",componentId:"sc-l9y854-0"})(templateObject_1$2c||(templateObject_1$2c=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"])),fontSizeSmall);var ListWrapper=_styled.div.withConfig({displayName:"EventMetaInfo__ListWrapper",componentId:"sc-l9y854-1"})(templateObject_2$1p||(templateObject_2$1p=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"])),function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?'column':'row';},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine&&'> div:first-child { padding-bottom: 3px }';});var Contacts$1=_styled(ListWrapper).withConfig({displayName:"EventMetaInfo__Contacts",componentId:"sc-l9y854-2"})(templateObject_3$W||(templateObject_3$W=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),function(p){return !p.hideAnnouncer?spacingXs:0;});var StyledPersonaCard$2=_styled(PersonaCard).withConfig({displayName:"EventMetaInfo__StyledPersonaCard",componentId:"sc-l9y854-3"})(templateObject_4$F||(templateObject_4$F=__makeTemplateObject(["\n text-decoration: underline;\n"],["\n text-decoration: underline;\n"])));var List$2=_styled.ul.withConfig({displayName:"EventMetaInfo__List",componentId:"sc-l9y854-4"})(templateObject_6$p||(templateObject_6$p=__makeTemplateObject(["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"],["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"])),function(_a){var isMultiLine=_a.isMultiLine;return !isMultiLine&&css$2(templateObject_5$z||(templateObject_5$z=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "],["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "])));},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?3:0;});var Channels$2=_styled(ClickableChannelTitles).withConfig({displayName:"EventMetaInfo__Channels",componentId:"sc-l9y854-5"})(templateObject_7$j||(templateObject_7$j=__makeTemplateObject(["\n &&& li {\n margin-top: ","px;\n }\n"],["\n &&& li {\n margin-top: ","px;\n }\n"])),spacingS);var templateObject_1$2c,templateObject_2$1p,templateObject_3$W,templateObject_4$F,templateObject_5$z,templateObject_6$p,templateObject_7$j;var BannerImage=function BannerImage(_a){var imageUrl=_a.imageUrl,children=_a.children,className=_a.className,openImageUrl=_a.openImageUrl;return jsxs(Host$O,__assign({onClick:function(){return openImageUrl&&showPhoto();},className:classNames('bannerImage',className)},{children:[jsx$1(Image$1,{src:imageUrl,imageFit:ImageFit.cover,maximizeFrame:true,alt:""},void 0),children]}),void 0);};var Host$O=_styled.div.withConfig({displayName:"BannerImage__Host",componentId:"sc-1wfmp37-0"})(templateObject_1$2b||(templateObject_1$2b=__makeTemplateObject(["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"],["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"])));var templateObject_1$2b;function useImageEditorApi(){var api=useApi();var _a=useApiFactory(),createApiUrl=_a.createApiUrl,fetchFromApi=_a.fetchFromApi;var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {getImageInfo:getImageInfo,getImageEditorUrl:getImageEditorUrl,getOriginalImageEditorUrlWithToken:getOriginalImageEditorUrlWithToken,getImageEditorUrlWithToken:getImageEditorUrlWithToken,uploadImage:uploadImage};/**
|
|
131898
131901
|
* Retrieve information on a given image. Does not return the actual image.
|
|
131899
131902
|
*/function getImageInfo(itemId,identifier,resourceType){var path="editor/"+resourceType+"/"+itemId+"/images/"+identifier;return api.custom(path+"/info").get().then(function(res){return res.body().data();});}function getImageEditorUrl(itemId,subscriptionId,identifier,resourceType){return __awaiter(this,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,onRequestToken()];case 1:token=_a.sent();return [2/*return*/,getImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType)];}});});}function getImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType,width,height){var url=width?"/editor/"+resourceType+"/"+itemId+"/images/"+identifier+"/"+width+"/"+(height||''):"/editor/"+resourceType+"/"+itemId+"/images/"+identifier;return createApiUrl(url,{access_token:token,subscriptionId:subscriptionId});}function getOriginalImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType){return createApiUrl("/editor/"+resourceType+"/"+itemId+"/images/"+identifier+"/original",{access_token:token,subscriptionId:subscriptionId});}function uploadImage(subscriptionId,resourceType,newImage){return __awaiter(this,void 0,void 0,function(){var fd,token,config;return __generator(this,function(_a){switch(_a.label){case 0:// validate or set defaults
|
|
131900
131903
|
if(!newImage.identifier){// identifer defaults to 'banner'
|
|
@@ -131902,11 +131905,11 @@ newImage.identifier='banner';}fd=new FormData();fd.append('image',newImage.image
|
|
|
131902
131905
|
// any promise failures are expected be handled from the code consuming the observable
|
|
131903
131906
|
return [4/*yield*/,fetchFromApi("/editor/"+resourceType+"/"+newImage.itemId+"/images/"+newImage.identifier+"/"+newImage.variant,config)];case 2:// error handling is not done here
|
|
131904
131907
|
// any promise failures are expected be handled from the code consuming the observable
|
|
131905
|
-
_a.sent();return [2/*return*/,{itemId:newImage.itemId,identifier:newImage.identifier,mimeType:newImage.image.type,extension:newImage.image.name.split('.').pop()}];}});});}},[api,createApiUrl,fetchFromApi,onRequestToken]);}var PublishableItemBanner=function PublishableItemBanner(props){var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var _a=useVideosApi(),getBannerVideoThumbnailUrl=_a.getBannerVideoThumbnailUrl,getVideoThumbnailUrl=_a.getVideoThumbnailUrl;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;var _b=useState$2(false),showPlayer=_b[0],setShowPlayer=_b[1];var user=useCurrentUser();var features=useFeatures();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var formatMessage=useIntl().formatMessage;useEffect$1(function(){if(props.hidePlayerIfActive){setShowPlayer(false);}},[props.hidePlayerIfActive]);if(!props.token||!props.bannerInfo){return null;}var isImage=props.bannerInfo.type==='image';var imageUrl=getImageUrl(props.useEditorRoutes,isImage,props.width,props.height);var isStreamVideo=props.bannerInfo.videoSource===VideoSource.MicrosoftStream;var streamVideoUrl=isStreamVideo&&getMicrosoftStreamVideoUrl(props.bannerInfo.videoId);var isPlayableVideo=!isImage&&!(isStreamVideo&&env.isNativeMobileApp);if(isPlayableVideo&&showPlayer){return jsx$1(StyledVideoView,{videoInfo:{id:props.bannerInfo.videoId,source:props.bannerInfo.videoSource,url:props.bannerInfo.videoUrl,isDirectUrl:props.bannerInfo.isDirectVideoUrl},autoplay:true,className:props.className},void 0);}return jsxs(StyledBannerImage,__assign({isVideo:!isImage,imageUrl:imageUrl,openImageUrl:props.canOpenImage&&env.isNativeMobileApp?getImageUrl(props.useEditorRoutes,true,'default'):null,className:props.className},{children:[isPlayableVideo&&jsx$1(VideoButtonOverlay,{onClick:handlePlayClick,iconProps:{iconName:'MSNVideosSolid',className:'video-icon'},ariaLabel:formatMessage({id:'Generic.watchVideo'})},void 0),isStreamVideo&&env.isNativeMobileApp&&(features.inAppBrowser?jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,onClick:function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:e.stopPropagation();e.preventDefault();return [4/*yield*/,onOpenExternalLink(streamVideoUrl)];case 1:_a.sent();return [2/*return*/];}});});},ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0):jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0))]}),void 0);function getImageUrl(useEditorRoutes,isImage,width,height){var _a;if(isImage){return useEditorRoutes?getImageEditorUrlWithToken(props.token,props.itemId,user.subscription.id,props.bannerInfo.imageId,props.resourceType):getImageUrlWithToken(props.token,props.itemId,user.subscription.id,props.resourceType,props.bannerInfo.imageId,width,height);}else {return (_a=new VideoUrlParser(props.bannerInfo.videoUrl).thumbnailUrl)!==null&&_a!==void 0?_a:useEditorRoutes?getVideoThumbnailUrl(props.token,user.subscription.id,props.bannerInfo.videoSource,props.bannerInfo.videoId):getBannerVideoThumbnailUrl(props.token,props.itemId,user.subscription.id,props.resourceType);}}function handlePlayClick(e){var _a;e.stopPropagation();e.preventDefault();setShowPlayer(true);(_a=props.onPlayButtonClick)===null||_a===void 0?void 0:_a.call(props);}};var StyledBannerImage=_styled(BannerImage).withConfig({displayName:"PublishableItemBanner__StyledBannerImage",componentId:"sc-bjnycc-0"})(templateObject_2$1o||(templateObject_2$1o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.isVideo&&css$2(templateObject_1$2a||(templateObject_1$2a=__makeTemplateObject(["\n position: relative;\n "],["\n position: relative;\n "])));});var BannerVideoOverlay=css$2(templateObject_3$U||(templateObject_3$U=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"])));var VideoIconStyle=css$2(templateObject_4$E||(templateObject_4$E=__makeTemplateObject(["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"],["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"])));var VideoButtonOverlay=_styled(IconButton$1).withConfig({displayName:"PublishableItemBanner__VideoButtonOverlay",componentId:"sc-bjnycc-1"})(templateObject_5$y||(templateObject_5$y=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"])),BannerVideoOverlay,VideoIconStyle);var VideoLinkOverlay=_styled(ExternalLinkHandler).withConfig({displayName:"PublishableItemBanner__VideoLinkOverlay",componentId:"sc-bjnycc-2"})(templateObject_6$o||(templateObject_6$o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),BannerVideoOverlay);var VideoIcon=_styled(Icon).withConfig({displayName:"PublishableItemBanner__VideoIcon",componentId:"sc-bjnycc-3"})(templateObject_7$i||(templateObject_7$i=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),VideoIconStyle);var StyledVideoView=_styled(VideoView).withConfig({displayName:"PublishableItemBanner__StyledVideoView",componentId:"sc-bjnycc-4"})(templateObject_8$h||(templateObject_8$h=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var templateObject_1$2a,templateObject_2$1o,templateObject_3$U,templateObject_4$E,templateObject_5$y,templateObject_6$o,templateObject_7$i,templateObject_8$h;var EventCardBanner=function EventCardBanner(_a){var item=_a.item,bannerWidth=_a.bannerWidth,bannerHostDefaultWidth=_a.bannerHostDefaultWidth,showPlaceholder=_a.showPlaceholder;if(!item.bannerInfo&&!showPlaceholder){return null;}return jsx$1("div",{children:jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerHostDefaultWidth,showPlaceholder:showPlaceholder},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:item.bannerInfo,width:bannerWidth,token:item.fileAccessToken,resourceType:ItemResourceTypes.Events},void 0)}),void 0)},void 0);};var FeedbackCountButton=function FeedbackCountButton(_a){var className=_a.className,isActive=_a.isActive,activeIconName=_a.activeIconName,count=_a.count,iconName=_a.iconName,onClick=_a.onClick,readOnly=_a.readOnly,tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceKeyValues=_a.tooltipResourceKeyValues,activeTooltipResourceKey=_a.activeTooltipResourceKey,activeTooltipResourceKeyValues=_a.activeTooltipResourceKeyValues,ariaLabel=_a.ariaLabel,feedbackType=_a.feedbackType,highlight=_a.highlight,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,hideTooltip=_a.hideTooltip;var resourceKey=isActive?activeTooltipResourceKey||tooltipResourceKey:tooltipResourceKey;var resourceValues=isActive?activeTooltipResourceKeyValues||tooltipResourceKeyValues:tooltipResourceKeyValues;return jsxs(CountButtonHost,__assign({className:className,"data-feedback":feedbackType,"data-feedback-button-isactive":isActive!==null&&isActive!==void 0?isActive:false,"data-feedback-count":count},{children:[jsx$1(IEMarginFix,{},void 0),jsx$1(PreloadIcons,{icons:[activeIconName,iconName]},void 0),jsx$1(TooltipHost,__assign({resourceKey:resourceKey,values:resourceValues,hidden:hideTooltip},{children:onClick?jsx$1(StyledIconButton$6,__assign({onClick:onClick,iconProps:{iconName:isActive?activeIconName:iconName},"data-feedback-button":feedbackType,disabled:readOnly,highlight:highlight,"data-unread-comment-highlight":highlight,ariaLabel:ariaLabel},{children:jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount},void 0)}),void 0):jsxs(Fragment,{children:[jsx$1(StyledIcon$7,{iconName:isActive?activeIconName:iconName,highlight:highlight,"data-unread-comment-highlight":highlight},void 0),jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount,ariaLabel:ariaLabel},void 0)]},void 0)}),void 0)]}),void 0);};var CountDisplay=function CountDisplay(_a){var count=_a.count,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,ariaLabel=_a.ariaLabel;var shouldNotRenderZeroCount=doNotRenderZeroCount&&!count;if(shouldNotRenderZeroCount){return null;}var shouldHideZeroCount=hideZeroCount&&!count;return jsx$1(CountLabel,__assign({isHidden:shouldHideZeroCount,"aria-label":ariaLabel},{children:count}),void 0);};var TooltipHost=_styled(Tooltip).withConfig({displayName:"FeedbackCountButton__TooltipHost",componentId:"sc-vg1ry1-0"})(templateObject_1$29||(templateObject_1$29=__makeTemplateObject(["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"],["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"])));var CountButtonHost=_styled.div.withConfig({displayName:"FeedbackCountButton__CountButtonHost",componentId:"sc-vg1ry1-1"})(templateObject_2$1n||(templateObject_2$1n=__makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"],["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"])),feedbackButtonHeight);var IEMarginFix=createGlobalStyle(templateObject_3$T||(templateObject_3$T=__makeTemplateObject(["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"],["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"])),CountButtonHost);var StyledIconButton$6=_styled(IconButton).withConfig({displayName:"FeedbackCountButton__StyledIconButton",componentId:"sc-vg1ry1-2"})(templateObject_4$D||(templateObject_4$D=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"],["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StyledIcon$7=_styled(Icon).withConfig({displayName:"FeedbackCountButton__StyledIcon",componentId:"sc-vg1ry1-3"})(templateObject_5$x||(templateObject_5$x=__makeTemplateObject(["\n font-size: 22px;\n user-select: none;\n\n ","\n"],["\n font-size: 22px;\n user-select: none;\n\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var CountLabel=_styled.span.withConfig({displayName:"FeedbackCountButton__CountLabel",componentId:"sc-vg1ry1-4"})(templateObject_8$g||(templateObject_8$g=__makeTemplateObject(["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"],["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"])),function(p){return p.isHidden&&css$2(templateObject_6$n||(templateObject_6$n=__makeTemplateObject(["\n visibility: hidden;\n "],["\n visibility: hidden;\n "])));},function(p){return p.isDisabled&&css$2(templateObject_7$h||(templateObject_7$h=__makeTemplateObject(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.palette.neutralQuaternary);});var PreloadIcons=function PreloadIcons(_a){var icons=_a.icons;return jsx$1(Fragment,{children:icons.filter(function(i){return i;}).map(function(i){return jsx$1(PreloadIcon,{iconName:i},i);})},void 0);};var PreloadIcon=_styled(Icon).withConfig({displayName:"FeedbackCountButton__PreloadIcon",componentId:"sc-vg1ry1-5"})(templateObject_9$d||(templateObject_9$d=__makeTemplateObject(["\n position: fixed;\n left: -500px;\n"],["\n position: fixed;\n left: -500px;\n"])));var templateObject_1$29,templateObject_2$1n,templateObject_3$T,templateObject_4$D,templateObject_5$x,templateObject_6$n,templateObject_7$h,templateObject_8$g,templateObject_9$d;var EventCardCommentCount=function EventCardCommentCount(_a){var item=_a.item;var formatMessage=useIntl().formatMessage;return jsxs(Fragment,{children:[jsx$1(IEFix$1,{},void 0),jsx$1(StyledFeedbackCountButton,{tooltipResourceKey:"Events.numberOfComments",tooltipResourceKeyValues:{count:item.statistics.commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),iconName:"Chat",count:item.statistics.commentCount,feedbackType:"comment",highlight:item.hasNewComments,className:"event-card-comments"},void 0)]},void 0);};var StyledFeedbackCountButton=_styled(FeedbackCountButton).withConfig({displayName:"EventCardCommentCount__StyledFeedbackCountButton",componentId:"sc-3prmx8-0"})(templateObject_1$28||(templateObject_1$28=__makeTemplateObject(["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"],["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"])));var IEFix$1=createGlobalStyle(templateObject_2$1m||(templateObject_2$1m=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"])));var templateObject_1$28,templateObject_2$1m;var EventCancelInformation=function EventCancelInformation(_a){var _b;var item=_a.item,language=_a.language,className=_a.className;var user=useCurrentUser();if(!((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var contents=item.cancelInformation.reasons||{};var reason=contents[language]||contents[NewsService.getUserPreferredLanguage(Object.keys(contents),user)]||Object.values(contents)[0];return jsxs(Host$N,__assign({className:className,"data-event-cancelled-info":true},{children:[jsxs(TitleContainer,{children:[jsx$1(CancelIcon,{iconName:"RemoveEvent"},void 0),jsx$1(Title$9,{id:"Events.cancel.cancelled"},void 0)]},void 0),reason]}),void 0);};var Host$N=_styled.div.withConfig({displayName:"EventCancelInformation__Host",componentId:"sc-rh6578-0"})(templateObject_1$27||(templateObject_1$27=__makeTemplateObject(["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"],["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"])),spacingM,spacingS,fontSizeSmall,function(p){return p.theme.palette.red;});var TitleContainer=_styled.div.withConfig({displayName:"EventCancelInformation__TitleContainer",componentId:"sc-rh6578-1"})(templateObject_2$1l||(templateObject_2$1l=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"])),spacingXs,function(p){return p.theme.palette.redDark;},spacingXs);var CancelIcon=_styled(Icon).withConfig({displayName:"EventCancelInformation__CancelIcon",componentId:"sc-rh6578-2"})(templateObject_3$S||(templateObject_3$S=__makeTemplateObject(["\n font-size: 20px;\n"],["\n font-size: 20px;\n"])));var Title$9=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventCancelInformation__Title",componentId:"sc-rh6578-3"})(templateObject_4$C||(templateObject_4$C=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$27,templateObject_2$1l,templateObject_3$S,templateObject_4$C;var EventUserRegistrationContext=/*#__PURE__*/createContext(null);function getDeadlineInfos(item){var hasDeadline=item.registrationSettings.deadline!=null;var isPastDeadline=hasDeadline&&moment(item.registrationSettings.deadline).isBefore(moment());return {hasDeadline:hasDeadline,isPastDeadline:isPastDeadline};}var EventRegistrationButton=function EventRegistrationButton(_a){var isRegistered=_a.isRegistered,className=_a.className,disabled=_a.disabled,onClick=_a.onClick,showInfoMessage=_a.showInfoMessage,infoMessageResourceKey=_a.infoMessageResourceKey;var formatMessage=useIntl().formatMessage;return jsxs(Host$M,__assign({className:className,"aria-label":formatMessage({id:'Events.registration.sectionLabel'})},{children:[jsx$1(RegisterButton,{text:formatMessage({id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'}),disabled:disabled,"data-event-register-button":!!isRegistered,onClick:function(e){e.preventDefault();onClick();},isRegistered:isRegistered},void 0),showInfoMessage&&jsxs(InfoMessage,__assign({"data-event-register-info":true},{children:[jsx$1(Icon,{iconName:"Info"},void 0),jsx$1(FormattedMessage$1,{id:infoMessageResourceKey},void 0)]}),void 0)]}),void 0);};var Host$M=_styled.div.withConfig({displayName:"EventRegistrationButton__Host",componentId:"sc-rvaf0t-0"})(templateObject_1$26||(templateObject_1$26=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var RegisterButton=_styled(PrimaryButton).withConfig({displayName:"EventRegistrationButton__RegisterButton",componentId:"sc-rvaf0t-1"})(templateObject_4$B||(templateObject_4$B=__makeTemplateObject(["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"],["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"])),function(p){return p.disabled&&css$2(templateObject_2$1k||(templateObject_2$1k=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.neutralQuaternaryAlt);},function(p){return p.isRegistered&&css$2(templateObject_3$R||(templateObject_3$R=__makeTemplateObject(["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "],["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "])),p.theme.palette.red,p.theme.palette.redDark);});var InfoMessage=_styled.span.withConfig({displayName:"EventRegistrationButton__InfoMessage",componentId:"sc-rvaf0t-2"})(templateObject_5$w||(templateObject_5$w=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"])),spacingXs,fontSizeSmall,spacingXs);var templateObject_1$26,templateObject_2$1k,templateObject_3$R,templateObject_4$B,templateObject_5$w;var $$5=_export;var DESCRIPTORS=descriptors;var global$2=global$m;var has=has$c;var isObject$1=isObject$c;var defineProperty=objectDefineProperty.f;var copyConstructorProperties=copyConstructorProperties$2;var NativeSymbol=global$2.Symbol;if(DESCRIPTORS&&typeof NativeSymbol=='function'&&(!('description'in NativeSymbol.prototype)||// Safari 12 bug
|
|
131908
|
+
_a.sent();return [2/*return*/,{itemId:newImage.itemId,identifier:newImage.identifier,mimeType:newImage.image.type,extension:newImage.image.name.split('.').pop()}];}});});}},[api,createApiUrl,fetchFromApi,onRequestToken]);}var PublishableItemBanner=function PublishableItemBanner(props){var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var _a=useVideosApi(),getBannerVideoThumbnailUrl=_a.getBannerVideoThumbnailUrl,getVideoThumbnailUrl=_a.getVideoThumbnailUrl;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;var _b=useState$2(false),showPlayer=_b[0],setShowPlayer=_b[1];var user=useCurrentUser();var features=useFeatures();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var formatMessage=useIntl().formatMessage;useEffect$1(function(){if(props.hidePlayerIfActive){setShowPlayer(false);}},[props.hidePlayerIfActive]);if(!props.token||!props.bannerInfo){return null;}var isImage=props.bannerInfo.type==='image';var imageUrl=getImageUrl(props.useEditorRoutes,isImage,props.width,props.height);var isStreamVideo=props.bannerInfo.videoSource===VideoSource.MicrosoftStream;var streamVideoUrl=isStreamVideo&&getMicrosoftStreamVideoUrl(props.bannerInfo.videoId);var isPlayableVideo=!isImage&&!(isStreamVideo&&env.isNativeMobileApp);if(isPlayableVideo&&showPlayer){return jsx$1(StyledVideoView,{videoInfo:{id:props.bannerInfo.videoId,source:props.bannerInfo.videoSource,url:props.bannerInfo.videoUrl,isDirectUrl:props.bannerInfo.isDirectVideoUrl},autoplay:true,className:props.className},void 0);}return jsxs(StyledBannerImage,__assign({isVideo:!isImage,imageUrl:imageUrl,openImageUrl:props.canOpenImage&&env.isNativeMobileApp?getImageUrl(props.useEditorRoutes,true,'default'):null,className:props.className},{children:[isPlayableVideo&&jsx$1(VideoButtonOverlay,{onClick:handlePlayClick,iconProps:{iconName:'MSNVideosSolid',className:'video-icon'},ariaLabel:formatMessage({id:'Generic.watchVideo'})},void 0),isStreamVideo&&env.isNativeMobileApp&&(features.inAppBrowser?jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,onClick:function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:e.stopPropagation();e.preventDefault();return [4/*yield*/,onOpenExternalLink(streamVideoUrl)];case 1:_a.sent();return [2/*return*/];}});});},ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0):jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0))]}),void 0);function getImageUrl(useEditorRoutes,isImage,width,height){var _a;if(isImage){return useEditorRoutes?getImageEditorUrlWithToken(props.token,props.itemId,user.subscription.id,props.bannerInfo.imageId,props.resourceType):getImageUrlWithToken(props.token,props.itemId,user.subscription.id,props.resourceType,props.bannerInfo.imageId,width,height);}else {return (_a=new VideoUrlParser(props.bannerInfo.videoUrl).thumbnailUrl)!==null&&_a!==void 0?_a:useEditorRoutes?getVideoThumbnailUrl(props.token,user.subscription.id,props.bannerInfo.videoSource,props.bannerInfo.videoId):getBannerVideoThumbnailUrl(props.token,props.itemId,user.subscription.id,props.resourceType);}}function handlePlayClick(e){var _a;e.stopPropagation();e.preventDefault();setShowPlayer(true);(_a=props.onPlayButtonClick)===null||_a===void 0?void 0:_a.call(props);}};var StyledBannerImage=_styled(BannerImage).withConfig({displayName:"PublishableItemBanner__StyledBannerImage",componentId:"sc-bjnycc-0"})(templateObject_2$1o||(templateObject_2$1o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.isVideo&&css$2(templateObject_1$2a||(templateObject_1$2a=__makeTemplateObject(["\n position: relative;\n "],["\n position: relative;\n "])));});var BannerVideoOverlay=css$2(templateObject_3$V||(templateObject_3$V=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"])));var VideoIconStyle=css$2(templateObject_4$E||(templateObject_4$E=__makeTemplateObject(["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"],["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"])));var VideoButtonOverlay=_styled(IconButton$1).withConfig({displayName:"PublishableItemBanner__VideoButtonOverlay",componentId:"sc-bjnycc-1"})(templateObject_5$y||(templateObject_5$y=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"])),BannerVideoOverlay,VideoIconStyle);var VideoLinkOverlay=_styled(ExternalLinkHandler).withConfig({displayName:"PublishableItemBanner__VideoLinkOverlay",componentId:"sc-bjnycc-2"})(templateObject_6$o||(templateObject_6$o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),BannerVideoOverlay);var VideoIcon=_styled(Icon).withConfig({displayName:"PublishableItemBanner__VideoIcon",componentId:"sc-bjnycc-3"})(templateObject_7$i||(templateObject_7$i=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),VideoIconStyle);var StyledVideoView=_styled(VideoView).withConfig({displayName:"PublishableItemBanner__StyledVideoView",componentId:"sc-bjnycc-4"})(templateObject_8$h||(templateObject_8$h=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var templateObject_1$2a,templateObject_2$1o,templateObject_3$V,templateObject_4$E,templateObject_5$y,templateObject_6$o,templateObject_7$i,templateObject_8$h;var EventCardBanner=function EventCardBanner(_a){var item=_a.item,bannerWidth=_a.bannerWidth,bannerHostDefaultWidth=_a.bannerHostDefaultWidth,showPlaceholder=_a.showPlaceholder;if(!item.bannerInfo&&!showPlaceholder){return null;}return jsx$1("div",{children:jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerHostDefaultWidth,showPlaceholder:showPlaceholder},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:item.bannerInfo,width:bannerWidth,token:item.fileAccessToken,resourceType:ItemResourceTypes.Events},void 0)}),void 0)},void 0);};var FeedbackCountButton=function FeedbackCountButton(_a){var className=_a.className,isActive=_a.isActive,activeIconName=_a.activeIconName,count=_a.count,iconName=_a.iconName,onClick=_a.onClick,readOnly=_a.readOnly,tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceKeyValues=_a.tooltipResourceKeyValues,activeTooltipResourceKey=_a.activeTooltipResourceKey,activeTooltipResourceKeyValues=_a.activeTooltipResourceKeyValues,ariaLabel=_a.ariaLabel,feedbackType=_a.feedbackType,highlight=_a.highlight,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,hideTooltip=_a.hideTooltip;var resourceKey=isActive?activeTooltipResourceKey||tooltipResourceKey:tooltipResourceKey;var resourceValues=isActive?activeTooltipResourceKeyValues||tooltipResourceKeyValues:tooltipResourceKeyValues;return jsxs(CountButtonHost,__assign({className:className,"data-feedback":feedbackType,"data-feedback-button-isactive":isActive!==null&&isActive!==void 0?isActive:false,"data-feedback-count":count},{children:[jsx$1(IEMarginFix,{},void 0),jsx$1(PreloadIcons,{icons:[activeIconName,iconName]},void 0),jsx$1(TooltipHost,__assign({resourceKey:resourceKey,values:resourceValues,hidden:hideTooltip},{children:onClick?jsx$1(StyledIconButton$6,__assign({onClick:onClick,iconProps:{iconName:isActive?activeIconName:iconName},"data-feedback-button":feedbackType,disabled:readOnly,highlight:highlight,"data-unread-comment-highlight":highlight,ariaLabel:ariaLabel},{children:jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount},void 0)}),void 0):jsxs(Fragment,{children:[jsx$1(StyledIcon$7,{iconName:isActive?activeIconName:iconName,highlight:highlight,"data-unread-comment-highlight":highlight},void 0),jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount,ariaLabel:ariaLabel},void 0)]},void 0)}),void 0)]}),void 0);};var CountDisplay=function CountDisplay(_a){var count=_a.count,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,ariaLabel=_a.ariaLabel;var shouldNotRenderZeroCount=doNotRenderZeroCount&&!count;if(shouldNotRenderZeroCount){return null;}var shouldHideZeroCount=hideZeroCount&&!count;return jsx$1(CountLabel,__assign({isHidden:shouldHideZeroCount,"aria-label":ariaLabel},{children:count}),void 0);};var TooltipHost=_styled(Tooltip).withConfig({displayName:"FeedbackCountButton__TooltipHost",componentId:"sc-vg1ry1-0"})(templateObject_1$29||(templateObject_1$29=__makeTemplateObject(["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"],["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"])));var CountButtonHost=_styled.div.withConfig({displayName:"FeedbackCountButton__CountButtonHost",componentId:"sc-vg1ry1-1"})(templateObject_2$1n||(templateObject_2$1n=__makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"],["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"])),feedbackButtonHeight);var IEMarginFix=createGlobalStyle(templateObject_3$U||(templateObject_3$U=__makeTemplateObject(["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"],["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"])),CountButtonHost);var StyledIconButton$6=_styled(IconButton).withConfig({displayName:"FeedbackCountButton__StyledIconButton",componentId:"sc-vg1ry1-2"})(templateObject_4$D||(templateObject_4$D=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"],["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StyledIcon$7=_styled(Icon).withConfig({displayName:"FeedbackCountButton__StyledIcon",componentId:"sc-vg1ry1-3"})(templateObject_5$x||(templateObject_5$x=__makeTemplateObject(["\n font-size: 22px;\n user-select: none;\n\n ","\n"],["\n font-size: 22px;\n user-select: none;\n\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var CountLabel=_styled.span.withConfig({displayName:"FeedbackCountButton__CountLabel",componentId:"sc-vg1ry1-4"})(templateObject_8$g||(templateObject_8$g=__makeTemplateObject(["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"],["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"])),function(p){return p.isHidden&&css$2(templateObject_6$n||(templateObject_6$n=__makeTemplateObject(["\n visibility: hidden;\n "],["\n visibility: hidden;\n "])));},function(p){return p.isDisabled&&css$2(templateObject_7$h||(templateObject_7$h=__makeTemplateObject(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.palette.neutralQuaternary);});var PreloadIcons=function PreloadIcons(_a){var icons=_a.icons;return jsx$1(Fragment,{children:icons.filter(function(i){return i;}).map(function(i){return jsx$1(PreloadIcon,{iconName:i},i);})},void 0);};var PreloadIcon=_styled(Icon).withConfig({displayName:"FeedbackCountButton__PreloadIcon",componentId:"sc-vg1ry1-5"})(templateObject_9$d||(templateObject_9$d=__makeTemplateObject(["\n position: fixed;\n left: -500px;\n"],["\n position: fixed;\n left: -500px;\n"])));var templateObject_1$29,templateObject_2$1n,templateObject_3$U,templateObject_4$D,templateObject_5$x,templateObject_6$n,templateObject_7$h,templateObject_8$g,templateObject_9$d;var EventCardCommentCount=function EventCardCommentCount(_a){var item=_a.item;var formatMessage=useIntl().formatMessage;return jsxs(Fragment,{children:[jsx$1(IEFix$1,{},void 0),jsx$1(StyledFeedbackCountButton,{tooltipResourceKey:"Events.numberOfComments",tooltipResourceKeyValues:{count:item.statistics.commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),iconName:"Chat",count:item.statistics.commentCount,feedbackType:"comment",highlight:item.hasNewComments,className:"event-card-comments"},void 0)]},void 0);};var StyledFeedbackCountButton=_styled(FeedbackCountButton).withConfig({displayName:"EventCardCommentCount__StyledFeedbackCountButton",componentId:"sc-3prmx8-0"})(templateObject_1$28||(templateObject_1$28=__makeTemplateObject(["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"],["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"])));var IEFix$1=createGlobalStyle(templateObject_2$1m||(templateObject_2$1m=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"])));var templateObject_1$28,templateObject_2$1m;var EventCancelInformation=function EventCancelInformation(_a){var _b;var item=_a.item,language=_a.language,className=_a.className;var user=useCurrentUser();if(!((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var contents=item.cancelInformation.reasons||{};var reason=contents[language]||contents[NewsService.getUserPreferredLanguage(Object.keys(contents),user)]||Object.values(contents)[0];return jsxs(Host$N,__assign({className:className,"data-event-cancelled-info":true},{children:[jsxs(TitleContainer,{children:[jsx$1(CancelIcon,{iconName:"RemoveEvent"},void 0),jsx$1(Title$9,{id:"Events.cancel.cancelled"},void 0)]},void 0),reason]}),void 0);};var Host$N=_styled.div.withConfig({displayName:"EventCancelInformation__Host",componentId:"sc-rh6578-0"})(templateObject_1$27||(templateObject_1$27=__makeTemplateObject(["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"],["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"])),spacingM,spacingS,fontSizeSmall,function(p){return p.theme.palette.red;});var TitleContainer=_styled.div.withConfig({displayName:"EventCancelInformation__TitleContainer",componentId:"sc-rh6578-1"})(templateObject_2$1l||(templateObject_2$1l=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"])),spacingXs,function(p){return p.theme.palette.redDark;},spacingXs);var CancelIcon=_styled(Icon).withConfig({displayName:"EventCancelInformation__CancelIcon",componentId:"sc-rh6578-2"})(templateObject_3$T||(templateObject_3$T=__makeTemplateObject(["\n font-size: 20px;\n"],["\n font-size: 20px;\n"])));var Title$9=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventCancelInformation__Title",componentId:"sc-rh6578-3"})(templateObject_4$C||(templateObject_4$C=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$27,templateObject_2$1l,templateObject_3$T,templateObject_4$C;var EventUserRegistrationContext=/*#__PURE__*/createContext(null);function getDeadlineInfos(item){var hasDeadline=item.registrationSettings.deadline!=null;var isPastDeadline=hasDeadline&&moment(item.registrationSettings.deadline).isBefore(moment());return {hasDeadline:hasDeadline,isPastDeadline:isPastDeadline};}var EventRegistrationButton=function EventRegistrationButton(_a){var isRegistered=_a.isRegistered,className=_a.className,disabled=_a.disabled,onClick=_a.onClick,showInfoMessage=_a.showInfoMessage,infoMessageResourceKey=_a.infoMessageResourceKey;var formatMessage=useIntl().formatMessage;return jsxs(Host$M,__assign({className:className,"aria-label":formatMessage({id:'Events.registration.sectionLabel'})},{children:[jsx$1(RegisterButton,{text:formatMessage({id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'}),disabled:disabled,"data-event-register-button":!!isRegistered,onClick:function(e){e.preventDefault();onClick();},isRegistered:isRegistered},void 0),showInfoMessage&&jsxs(InfoMessage,__assign({"data-event-register-info":true},{children:[jsx$1(Icon,{iconName:"Info"},void 0),jsx$1(FormattedMessage$1,{id:infoMessageResourceKey},void 0)]}),void 0)]}),void 0);};var Host$M=_styled.div.withConfig({displayName:"EventRegistrationButton__Host",componentId:"sc-rvaf0t-0"})(templateObject_1$26||(templateObject_1$26=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var RegisterButton=_styled(PrimaryButton).withConfig({displayName:"EventRegistrationButton__RegisterButton",componentId:"sc-rvaf0t-1"})(templateObject_4$B||(templateObject_4$B=__makeTemplateObject(["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"],["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"])),function(p){return p.disabled&&css$2(templateObject_2$1k||(templateObject_2$1k=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.neutralQuaternaryAlt);},function(p){return p.isRegistered&&css$2(templateObject_3$S||(templateObject_3$S=__makeTemplateObject(["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "],["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "])),p.theme.palette.red,p.theme.palette.redDark);});var InfoMessage=_styled.span.withConfig({displayName:"EventRegistrationButton__InfoMessage",componentId:"sc-rvaf0t-2"})(templateObject_5$w||(templateObject_5$w=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"])),spacingXs,fontSizeSmall,spacingXs);var templateObject_1$26,templateObject_2$1k,templateObject_3$S,templateObject_4$B,templateObject_5$w;var $$5=_export;var DESCRIPTORS=descriptors;var global$2=global$m;var has=has$c;var isObject$1=isObject$c;var defineProperty=objectDefineProperty.f;var copyConstructorProperties=copyConstructorProperties$2;var NativeSymbol=global$2.Symbol;if(DESCRIPTORS&&typeof NativeSymbol=='function'&&(!('description'in NativeSymbol.prototype)||// Safari 12 bug
|
|
131906
131909
|
NativeSymbol().description!==undefined)){var EmptyStringDescriptionStore={};// wrap Symbol constructor for correct work with undefined description
|
|
131907
131910
|
var SymbolWrapper=function Symbol(){var description=arguments.length<1||arguments[0]===undefined?undefined:String(arguments[0]);var result=this instanceof SymbolWrapper?new NativeSymbol(description)// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
131908
131911
|
:description===undefined?NativeSymbol():NativeSymbol(description);if(description==='')EmptyStringDescriptionStore[result]=true;return result;};copyConstructorProperties(SymbolWrapper,NativeSymbol);var symbolPrototype=SymbolWrapper.prototype=NativeSymbol.prototype;symbolPrototype.constructor=SymbolWrapper;var symbolToString=symbolPrototype.toString;var native=String(NativeSymbol('test'))=='Symbol(test)';var regexp=/^Symbol\((.*)\)[^)]+$/;defineProperty(symbolPrototype,'description',{configurable:true,get:function description(){var symbol=isObject$1(this)?this.valueOf():this;var string=symbolToString.call(symbol);if(has(EmptyStringDescriptionStore,symbol))return '';var desc=native?string.slice(7,-1):string.replace(regexp,'$1');return desc===''?undefined:desc;}});$$5({global:true,forced:true},{Symbol:SymbolWrapper});}function getLocationQuestionId(item){return "location_id_"+item.id;}function getLocationPollDefinitions(item,formatMessage,result,isOnBehalfOf){if(!item.locations||item.locations.length<2){return {};}var locationQuestionId=getLocationQuestionId(item);return {translations:__spreadArray([{language:'en',id:locationQuestionId,text:formatMessage({id:!isOnBehalfOf?'Events.registration.locations.questionTitle':'Events.registration.locations.onBehalfOfQuestionTitle'})}],item.locations.map(function(l){return {language:'en',id:l.locationId,text:l.name};})),question:{questionId:locationQuestionId,isMultiChoice:false,choices:item.locations.map(function(l){return getLocationChoice(locationQuestionId,l,result,formatMessage,isOnBehalfOf);})}};}function getLocationChoice(locationQuestionId,location,result,formatMessage,isOnBehalfOf){var _a,_b,_c,_d,_e;var choice={choiceId:location.locationId};if(!location.maxNumberOfSeats){return choice;}var takenSeats=(_e=(_d=(_c=(_b=(_a=result===null||result===void 0?void 0:result.answers)===null||_a===void 0?void 0:_a.find(function(a){return a.questionId===locationQuestionId;}))===null||_b===void 0?void 0:_b.choices)===null||_c===void 0?void 0:_c.find(function(c){return c.choiceId===location.locationId;}))===null||_d===void 0?void 0:_d.count)!==null&&_e!==void 0?_e:0;var availableSeats=Math.max(location.maxNumberOfSeats-takenSeats,0);choice.description=formatMessage({id:'Events.registration.locations.leftSeats'},{total:location.maxNumberOfSeats,available:availableSeats,b:function(text){return jsx$1("strong",{children:text},void 0);}});if(availableSeats===0){choice.disabled=!isOnBehalfOf;}return choice;}var EventRegistrationLocationSeatsInfo=function EventRegistrationLocationSeatsInfo(_a){var hasAnySeatsLeft=_a.hasAnySeatsLeft,locations=_a.locations,className=_a.className;if(!(locations===null||locations===void 0?void 0:locations.length)){return null;}if(locations.length>1){if(hasAnySeatsLeft){// in this case we don't want to render anything, because it's already rendered by the poll anyway
|
|
131909
|
-
return null;}return jsx$1(MessageContainer,__assign({domIdentifier:"multi-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.noSeatsLeft"},void 0)}),void 0);}var location=locations[0];if(hasAnySeatsLeft){return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-number-of-seats-left",className:className},{children:jsx$1(SeatsInfoMessage,{id:"Events.registration.locations.seatsLeftInLocation",values:{available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);}return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.leftSeats",values:{total:location.maxNumberOfSeats,available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);};var SeatsInfoMessage=_styled(FormattedMessageWithStyle)(templateObject_1$25||(templateObject_1$25=__makeTemplateObject(["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),fontSizeSmall);var NoSeatsMessage=_styled(FormattedMessageWithStyle)(templateObject_2$1j||(templateObject_2$1j=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;},fontSizeSmall);var MessageContainer=function MessageContainer(_a){var domIdentifier=_a.domIdentifier,className=_a.className,children=_a.children;return jsx$1("div",__assign({"data-seats-info":domIdentifier,className:className},{children:children}),void 0);};var templateObject_1$25,templateObject_2$1j;var EventRegistrationInfoDescription=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventRegistrationInfoDescription",componentId:"sc-1shfbk2-0"})(templateObject_1$24||(templateObject_1$24=__makeTemplateObject(["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"])),fontSizeSmall);var templateObject_1$24;var EventRegistrationRegisterStatusInfo=function EventRegistrationRegisterStatusInfo(_a){var isRegistered=_a.isRegistered,onBehalfOfUpn=_a.onBehalfOfUpn,className=_a.className;if(!isRegistered){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:onBehalfOfUpn?'Events.registration.onBehalfOfIsRegistered':'Events.registration.userIsRegistered'},void 0);};var EventRegistrationDeadlineInfo=function EventRegistrationDeadlineInfo(_a){var item=_a.item,isRegistered=_a.isRegistered,className=_a.className;var _b=getDeadlineInfos(item),isPastDeadline=_b.isPastDeadline,hasDeadline=_b.hasDeadline;if(isRegistered||!hasDeadline){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:"Events.registration.deadline.title",values:{isPast:isPastDeadline,deadlineRelative:hasDeadline&&jsx$1(DateTime,{value:item.registrationSettings.deadline,showAsRelative:true},void 0)}},void 0);};var EventUserRegistrationFullSeriesDialog=function EventUserRegistrationFullSeriesDialog(_a){var item=_a.item,visible=_a.visible,isRegistered=_a.isRegistered,onClick=_a.onClick,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;var recurrenceSettingsEndDate=item.recurrenceSettings.endDate;return jsxs(Dialog,__assign({hidden:!visible,modalProps:{isBlocking:false},dialogContentProps:{type:DialogType.normal,title:formatMessage({id:isRegistered?'Events.registration.recurringEvent.deregister':'Events.registration.recurringEvent.register'})},onDismiss:onDismiss},{children:[jsxs(DialogContent$1,__assign({"data-registration-full-series":true},{children:[recurrenceSettingsEndDate&&jsx$1(FormattedMessage$1,{id:"Events.registration.lastOccurrence",values:{date:moment(recurrenceSettingsEndDate).format('L')},tagName:"p"},void 0),jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered',tagName:"p"},void 0)]}),void 0),jsxs(DialogFooter,{children:[jsx$1(DefaultButton,__assign({onClick:onDismiss,"data-button":"cancel"},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0),jsx$1(PrimaryButton,__assign({onClick:function(){return onClick(!isRegistered);},"data-button":"save"},{children:jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'},void 0)}),void 0)]},void 0)]}),void 0);};var DialogContent$1=_styled.div.withConfig({displayName:"EventUserRegistrationFullSeriesDialog__DialogContent",componentId:"sc-8ec3oi-0"})(templateObject_1$23||(templateObject_1$23=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"])));var templateObject_1$23;var feedbackCache={};function useFeedbackApi(){var api=useApi();return useMemo(function(){return {getFeedback:getFeedback,setFeedback:setFeedback,unsetFeedback:unsetFeedback,updatePollAnswers:updatePollAnswers,getPollResult:getPollResult,getLikers:getLikers};function getFeedback(type,itemId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');if(feedbackCache[cacheKey]!=null){return feedbackCache[cacheKey];}return feedbackCache[cacheKey]=api.custom(type+"/"+itemId+"/feedback?"+queryString.stringify({onBehalfOfUpn:onBehalfOfUpn})).get().then(function(result){return result.body().data();});}function setFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).put({}).then(function(){return null;});}function unsetFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).delete().then(function(){return null;});}function updatePollAnswers(type,itemId,answers){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/poll/answers").put(answers).then(function(){return null;});}function getPollResult(type,itemId){return api.custom(type+"/"+itemId+"/feedback/poll/result").get().then(function(result){return result.body().data();});}function getLikers(type,itemId,filter){return api.custom(type+"/"+itemId+"/feedback/likes").get(filter).then(function(result){return result.body().data();});}},[api]);}function useEventRegistrationApi(){var api=useApi();return useMemo(function(){return {setEventRegistration:setEventRegistration,getEventRegistrationResults:getEventRegistrationResults,getParticipants:getParticipants};function setEventRegistration(itemId,response,pollAnswers,locationId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');delete feedbackCache[cacheKey];return api.custom("events/"+itemId+"/feedback/registration").put({response:response,pollAnswers:pollAnswers,locationId:locationId,onBehalfOfUpn:onBehalfOfUpn}).then(function(){return null;});}function getEventRegistrationResults(itemId){return api.custom("events/"+itemId+"/feedback/registration/result").get().then(function(result){return result.body().data();});}function getParticipants(eventId){return api.custom("events/"+eventId+"/feedback/registration/participants").get().then(function(result){return result.body().data();}).then(function(r){return r.participants;});}},[api]);}var EventUserRegistration=function EventUserRegistration(_a){var _b,_c;var disabled=_a.disabled,hideInfoMessage=_a.hideInfoMessage,className=_a.className;var history=useHistory();var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(false),showRegisterFullSeriesDialog=_e[0],setShowRegisterFullSeriesDialog=_e[1];var toastHandleRef=useRef$1(null);var buildPath=useSubscriptionHandlePathBuilder().buildPath;var followPublicPublishableItemComments=useManageCurrentUserApi().followPublicPublishableItemComments;var setEventRegistration=useEventRegistrationApi().setEventRegistration;var _f=useContext(EventUserRegistrationContext),hasPollContext=_f.hasPollContext,submitPoll=_f.submitPoll,answers=_f.answers,hasMissingAnswers=_f.hasMissingAnswers,reset=_f.reset,isLoading=_f.isLoading,onBehalfOfUpn=_f.onBehalfOfUpn,item=_f.item,eventResponse=_f.eventResponse,setEventResponse=_f.setEventResponse,seatsInfo=_f.seatsInfo;var _g=useNotificationContext(),dismissToast=_g.dismissToast,showToast=_g.showToast,showError=_g.showError;useListener(RegisterFullSeriesTriggerAction.type,function(action){if(action.recurrenceSeriesId===item.recurrenceSeriesId){setEventResponse(action.response);}return false;},[]);if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var isRegistered=eventResponse===EventResponse.Registered;var isFullSeriesRegistrationModeEnabled=((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.seriesMode)===SeriesRegistrationMode.FullSeries;var hasPoll=item.poll&&item.poll.questions&&item.poll.questions.length>0||item.locations&&item.locations.length>1;var showInfoMessage=!hideInfoMessage&&isFullSeriesRegistrationModeEnabled&&hasPollContext;return jsxs("div",__assign({className:className},{children:[jsx$1(DeadlineInfo,{item:item,isRegistered:isRegistered},void 0),jsx$1(SeatsInfo,{hasAnySeatsLeft:seatsInfo.hasAnySeatsLeft,locations:seatsInfo.locations},void 0),jsx$1(StatusInfo,{isRegistered:isRegistered,onBehalfOfUpn:onBehalfOfUpn},void 0),jsx$1(EventRegistrationButton,{isRegistered:isRegistered,disabled:isButtonDisabled(),onClick:function(){return handleClick(!isRegistered);},showInfoMessage:showInfoMessage,infoMessageResourceKey:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered'},void 0),showRegisterFullSeriesDialog&&jsx$1(EventUserRegistrationFullSeriesDialog,{item:item,visible:showRegisterFullSeriesDialog,onClick:handleRegisterFullSeriesClick,onDismiss:function(){return setShowRegisterFullSeriesDialog(false);},isRegistered:isRegistered},void 0)]}),void 0);function isButtonDisabled(){if(disabled||isLoading||isSaving){return true;}var isPastDeadline=getDeadlineInfos(item).isPastDeadline;if(isRegistered){return !onBehalfOfUpn&&isPastDeadline;}if(hasMissingAnswers){return true;}if(onBehalfOfUpn){return false;}return !seatsInfo.hasAnySeatsLeft||isPastDeadline;}function handleClick(doRegister){return __awaiter(this,void 0,void 0,function(){var language,contents,targetRoute;return __generator(this,function(_a){switch(_a.label){case 0:if(!doRegister){if(isFullSeriesRegistrationModeEnabled&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}deregister();return [2/*return*/];}if(isFullSeriesRegistrationModeEnabled&&!hasPoll&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}if(hasPoll&&!hasPollContext){language=NewsService.getLanguageForPublishableItem(item,user);contents=item.contents[language];targetRoute=NewsService.getNewsRoute('events',item.id,contents.title);history.push(buildPath(targetRoute));return [2/*return*/];}return [4/*yield*/,register()];case 1:_a.sent();return [2/*return*/];}});});}function handleRegisterFullSeriesClick(doRegister){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:setShowRegisterFullSeriesDialog(false);if(!doRegister)return [3/*break*/,2];return [4/*yield*/,register()];case 1:_b.sent();return [3/*break*/,4];case 2:return [4/*yield*/,deregister()];case 3:_b.sent();_b.label=4;case 4:triggerEvent(RegisterFullSeriesTriggerAction.create(item.recurrenceSeriesId,doRegister?EventResponse.Registered:EventResponse.NotSet));return [2/*return*/];}});});}function register(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,submitPoll(function(){return toggleRegistration(true,answers,onBehalfOfUpn);})];case 1:_a.sent();return [2/*return*/];}});});}function deregister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,toggleRegistration(false,null,onBehalfOfUpn)];case 1:_a.sent();return [4/*yield*/,reset()];case 2:_a.sent();return [2/*return*/];}});});}function toggleRegistration(doRegister,answersToSet,onBehalfOfUpn){return __awaiter(this,void 0,void 0,function(){var newResponse,locationQuestionId_1,locationId,registerOnBehalfOfUserStringResource,error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaving){return [2/*return*/];}setIsSaving(true);_a.label=1;case 1:_a.trys.push([1,3,4,5]);newResponse=doRegister?EventResponse.Registered:EventResponse.NotSet;setEventResponse(newResponse);if(!answersToSet){answersToSet=[];}locationQuestionId_1=getLocationQuestionId(item);locationId=answersToSet.filter(function(a){return a.questionId===locationQuestionId_1;}).map(function(a){return a.choiceIds[0];})[0];answersToSet=answersToSet.filter(function(a){return a.questionId!==locationQuestionId_1;});return [4/*yield*/,setEventRegistration(item.id,newResponse,answersToSet,locationId,onBehalfOfUpn)];case 2:_a.sent();refreshUserDetails();triggerEvent(EventResponseTriggerAction.create(item.id,newResponse,locationId,onBehalfOfUpn));if(doRegister&&!onBehalfOfUpn){followPublicPublishableItemComments(item.id,ItemResourceTypes.Events);triggerEvent(FollowCommentsTriggerAction.create(item.id,true));}dismissToast(toastHandleRef.current);registerOnBehalfOfUserStringResource=isHiddenMail(onBehalfOfUpn)?'Events.registration.onBehalfOfRegistrationSuccess.hiddenMail':'Events.registration.onBehalfOfRegistrationSuccess';toastHandleRef.current=showToast(doRegister?onBehalfOfUpn?registerOnBehalfOfUserStringResource:'Events.registration.registrationSuccess':onBehalfOfUpn?'Events.registration.onBehalfOfDeregistrationSuccess':'Events.registration.deregistrationSuccess',{mail:onBehalfOfUpn});return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setEventResponse(eventResponse);return [3/*break*/,5];case 4:setIsSaving(false);return [7/*endfinally*/];case 5:return [2/*return*/];}});});}};var DeadlineInfo=_styled(EventRegistrationDeadlineInfo).withConfig({displayName:"EventUserRegistration__DeadlineInfo",componentId:"sc-1mvozes-0"})(templateObject_1$22||(templateObject_1$22=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var SeatsInfo=_styled(EventRegistrationLocationSeatsInfo).withConfig({displayName:"EventUserRegistration__SeatsInfo",componentId:"sc-1mvozes-1"})(templateObject_2$1i||(templateObject_2$1i=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var StatusInfo=_styled(EventRegistrationRegisterStatusInfo).withConfig({displayName:"EventUserRegistration__StatusInfo",componentId:"sc-1mvozes-2"})(templateObject_3$Q||(templateObject_3$Q=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var templateObject_1$22,templateObject_2$1i,templateObject_3$Q;var EventCardUserRegistration=function EventCardUserRegistration(_a){var item=_a.item,disabled=_a.disabled,className=_a.className;var _b=useState$2(item.userResponse),eventResponse=_b[0],setEventResponse=_b[1];var isRegistered=eventResponse===EventResponse.Registered;// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131912
|
+
return null;}return jsx$1(MessageContainer,__assign({domIdentifier:"multi-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.noSeatsLeft"},void 0)}),void 0);}var location=locations[0];if(hasAnySeatsLeft){return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-number-of-seats-left",className:className},{children:jsx$1(SeatsInfoMessage,{id:"Events.registration.locations.seatsLeftInLocation",values:{available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);}return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.leftSeats",values:{total:location.maxNumberOfSeats,available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);};var SeatsInfoMessage=_styled(FormattedMessageWithStyle)(templateObject_1$25||(templateObject_1$25=__makeTemplateObject(["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),fontSizeSmall);var NoSeatsMessage=_styled(FormattedMessageWithStyle)(templateObject_2$1j||(templateObject_2$1j=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;},fontSizeSmall);var MessageContainer=function MessageContainer(_a){var domIdentifier=_a.domIdentifier,className=_a.className,children=_a.children;return jsx$1("div",__assign({"data-seats-info":domIdentifier,className:className},{children:children}),void 0);};var templateObject_1$25,templateObject_2$1j;var EventRegistrationInfoDescription=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventRegistrationInfoDescription",componentId:"sc-1shfbk2-0"})(templateObject_1$24||(templateObject_1$24=__makeTemplateObject(["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"])),fontSizeSmall);var templateObject_1$24;var EventRegistrationRegisterStatusInfo=function EventRegistrationRegisterStatusInfo(_a){var isRegistered=_a.isRegistered,onBehalfOfUpn=_a.onBehalfOfUpn,className=_a.className;if(!isRegistered){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:onBehalfOfUpn?'Events.registration.onBehalfOfIsRegistered':'Events.registration.userIsRegistered'},void 0);};var EventRegistrationDeadlineInfo=function EventRegistrationDeadlineInfo(_a){var item=_a.item,isRegistered=_a.isRegistered,className=_a.className;var _b=getDeadlineInfos(item),isPastDeadline=_b.isPastDeadline,hasDeadline=_b.hasDeadline;if(isRegistered||!hasDeadline){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:"Events.registration.deadline.title",values:{isPast:isPastDeadline,deadlineRelative:hasDeadline&&jsx$1(DateTime,{value:item.registrationSettings.deadline,showAsRelative:true},void 0)}},void 0);};var EventUserRegistrationFullSeriesDialog=function EventUserRegistrationFullSeriesDialog(_a){var item=_a.item,visible=_a.visible,isRegistered=_a.isRegistered,onClick=_a.onClick,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;var recurrenceSettingsEndDate=item.recurrenceSettings.endDate;return jsxs(Dialog,__assign({hidden:!visible,modalProps:{isBlocking:false},dialogContentProps:{type:DialogType.normal,title:formatMessage({id:isRegistered?'Events.registration.recurringEvent.deregister':'Events.registration.recurringEvent.register'})},onDismiss:onDismiss},{children:[jsxs(DialogContent$1,__assign({"data-registration-full-series":true},{children:[recurrenceSettingsEndDate&&jsx$1(FormattedMessage$1,{id:"Events.registration.lastOccurrence",values:{date:moment(recurrenceSettingsEndDate).format('L')},tagName:"p"},void 0),jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered',tagName:"p"},void 0)]}),void 0),jsxs(DialogFooter,{children:[jsx$1(DefaultButton,__assign({onClick:onDismiss,"data-button":"cancel"},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0),jsx$1(PrimaryButton,__assign({onClick:function(){return onClick(!isRegistered);},"data-button":"save"},{children:jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'},void 0)}),void 0)]},void 0)]}),void 0);};var DialogContent$1=_styled.div.withConfig({displayName:"EventUserRegistrationFullSeriesDialog__DialogContent",componentId:"sc-8ec3oi-0"})(templateObject_1$23||(templateObject_1$23=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"])));var templateObject_1$23;var feedbackCache={};function useFeedbackApi(){var api=useApi();return useMemo(function(){return {getFeedback:getFeedback,setFeedback:setFeedback,unsetFeedback:unsetFeedback,updatePollAnswers:updatePollAnswers,getPollResult:getPollResult,getLikers:getLikers};function getFeedback(type,itemId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');if(feedbackCache[cacheKey]!=null){return feedbackCache[cacheKey];}return feedbackCache[cacheKey]=api.custom(type+"/"+itemId+"/feedback?"+queryString.stringify({onBehalfOfUpn:onBehalfOfUpn})).get().then(function(result){return result.body().data();});}function setFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).put({}).then(function(){return null;});}function unsetFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).delete().then(function(){return null;});}function updatePollAnswers(type,itemId,answers){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/poll/answers").put(answers).then(function(){return null;});}function getPollResult(type,itemId){return api.custom(type+"/"+itemId+"/feedback/poll/result").get().then(function(result){return result.body().data();});}function getLikers(type,itemId,filter){return api.custom(type+"/"+itemId+"/feedback/likes").get(filter).then(function(result){return result.body().data();});}},[api]);}function useEventRegistrationApi(){var api=useApi();return useMemo(function(){return {setEventRegistration:setEventRegistration,getEventRegistrationResults:getEventRegistrationResults,getParticipants:getParticipants};function setEventRegistration(itemId,response,pollAnswers,locationId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');delete feedbackCache[cacheKey];return api.custom("events/"+itemId+"/feedback/registration").put({response:response,pollAnswers:pollAnswers,locationId:locationId,onBehalfOfUpn:onBehalfOfUpn}).then(function(){return null;});}function getEventRegistrationResults(itemId){return api.custom("events/"+itemId+"/feedback/registration/result").get().then(function(result){return result.body().data();});}function getParticipants(eventId){return api.custom("events/"+eventId+"/feedback/registration/participants").get().then(function(result){return result.body().data();}).then(function(r){return r.participants;});}},[api]);}var EventUserRegistration=function EventUserRegistration(_a){var _b,_c;var disabled=_a.disabled,hideInfoMessage=_a.hideInfoMessage,className=_a.className;var history=useHistory();var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(false),showRegisterFullSeriesDialog=_e[0],setShowRegisterFullSeriesDialog=_e[1];var toastHandleRef=useRef$1(null);var buildPath=useSubscriptionHandlePathBuilder().buildPath;var followPublicPublishableItemComments=useManageCurrentUserApi().followPublicPublishableItemComments;var setEventRegistration=useEventRegistrationApi().setEventRegistration;var _f=useContext(EventUserRegistrationContext),hasPollContext=_f.hasPollContext,submitPoll=_f.submitPoll,answers=_f.answers,hasMissingAnswers=_f.hasMissingAnswers,reset=_f.reset,isLoading=_f.isLoading,onBehalfOfUpn=_f.onBehalfOfUpn,item=_f.item,eventResponse=_f.eventResponse,setEventResponse=_f.setEventResponse,seatsInfo=_f.seatsInfo;var _g=useNotificationContext(),dismissToast=_g.dismissToast,showToast=_g.showToast,showError=_g.showError;useListener(RegisterFullSeriesTriggerAction.type,function(action){if(action.recurrenceSeriesId===item.recurrenceSeriesId){setEventResponse(action.response);}return false;},[]);if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var isRegistered=eventResponse===EventResponse.Registered;var isFullSeriesRegistrationModeEnabled=((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.seriesMode)===SeriesRegistrationMode.FullSeries;var hasPoll=item.poll&&item.poll.questions&&item.poll.questions.length>0||item.locations&&item.locations.length>1;var showInfoMessage=!hideInfoMessage&&isFullSeriesRegistrationModeEnabled&&hasPollContext;return jsxs("div",__assign({className:className},{children:[jsx$1(DeadlineInfo,{item:item,isRegistered:isRegistered},void 0),jsx$1(SeatsInfo,{hasAnySeatsLeft:seatsInfo.hasAnySeatsLeft,locations:seatsInfo.locations},void 0),jsx$1(StatusInfo,{isRegistered:isRegistered,onBehalfOfUpn:onBehalfOfUpn},void 0),jsx$1(EventRegistrationButton,{isRegistered:isRegistered,disabled:isButtonDisabled(),onClick:function(){return handleClick(!isRegistered);},showInfoMessage:showInfoMessage,infoMessageResourceKey:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered'},void 0),showRegisterFullSeriesDialog&&jsx$1(EventUserRegistrationFullSeriesDialog,{item:item,visible:showRegisterFullSeriesDialog,onClick:handleRegisterFullSeriesClick,onDismiss:function(){return setShowRegisterFullSeriesDialog(false);},isRegistered:isRegistered},void 0)]}),void 0);function isButtonDisabled(){if(disabled||isLoading||isSaving){return true;}var isPastDeadline=getDeadlineInfos(item).isPastDeadline;if(isRegistered){return !onBehalfOfUpn&&isPastDeadline;}if(hasMissingAnswers){return true;}if(onBehalfOfUpn){return false;}return !seatsInfo.hasAnySeatsLeft||isPastDeadline;}function handleClick(doRegister){return __awaiter(this,void 0,void 0,function(){var language,contents,targetRoute;return __generator(this,function(_a){switch(_a.label){case 0:if(!doRegister){if(isFullSeriesRegistrationModeEnabled&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}deregister();return [2/*return*/];}if(isFullSeriesRegistrationModeEnabled&&!hasPoll&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}if(hasPoll&&!hasPollContext){language=NewsService.getLanguageForPublishableItem(item,user);contents=item.contents[language];targetRoute=NewsService.getNewsRoute('events',item.id,contents.title);history.push(buildPath(targetRoute));return [2/*return*/];}return [4/*yield*/,register()];case 1:_a.sent();return [2/*return*/];}});});}function handleRegisterFullSeriesClick(doRegister){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:setShowRegisterFullSeriesDialog(false);if(!doRegister)return [3/*break*/,2];return [4/*yield*/,register()];case 1:_b.sent();return [3/*break*/,4];case 2:return [4/*yield*/,deregister()];case 3:_b.sent();_b.label=4;case 4:triggerEvent(RegisterFullSeriesTriggerAction.create(item.recurrenceSeriesId,doRegister?EventResponse.Registered:EventResponse.NotSet));return [2/*return*/];}});});}function register(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,submitPoll(function(){return toggleRegistration(true,answers,onBehalfOfUpn);})];case 1:_a.sent();return [2/*return*/];}});});}function deregister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,toggleRegistration(false,null,onBehalfOfUpn)];case 1:_a.sent();return [4/*yield*/,reset()];case 2:_a.sent();return [2/*return*/];}});});}function toggleRegistration(doRegister,answersToSet,onBehalfOfUpn){return __awaiter(this,void 0,void 0,function(){var newResponse,locationQuestionId_1,locationId,registerOnBehalfOfUserStringResource,error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaving){return [2/*return*/];}setIsSaving(true);_a.label=1;case 1:_a.trys.push([1,3,4,5]);newResponse=doRegister?EventResponse.Registered:EventResponse.NotSet;setEventResponse(newResponse);if(!answersToSet){answersToSet=[];}locationQuestionId_1=getLocationQuestionId(item);locationId=answersToSet.filter(function(a){return a.questionId===locationQuestionId_1;}).map(function(a){return a.choiceIds[0];})[0];answersToSet=answersToSet.filter(function(a){return a.questionId!==locationQuestionId_1;});return [4/*yield*/,setEventRegistration(item.id,newResponse,answersToSet,locationId,onBehalfOfUpn)];case 2:_a.sent();refreshUserDetails();triggerEvent(EventResponseTriggerAction.create(item.id,newResponse,locationId,onBehalfOfUpn));if(doRegister&&!onBehalfOfUpn){followPublicPublishableItemComments(item.id,ItemResourceTypes.Events);triggerEvent(FollowCommentsTriggerAction.create(item.id,true));}dismissToast(toastHandleRef.current);registerOnBehalfOfUserStringResource=isHiddenMail(onBehalfOfUpn)?'Events.registration.onBehalfOfRegistrationSuccess.hiddenMail':'Events.registration.onBehalfOfRegistrationSuccess';toastHandleRef.current=showToast(doRegister?onBehalfOfUpn?registerOnBehalfOfUserStringResource:'Events.registration.registrationSuccess':onBehalfOfUpn?'Events.registration.onBehalfOfDeregistrationSuccess':'Events.registration.deregistrationSuccess',{mail:onBehalfOfUpn});return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setEventResponse(eventResponse);return [3/*break*/,5];case 4:setIsSaving(false);return [7/*endfinally*/];case 5:return [2/*return*/];}});});}};var DeadlineInfo=_styled(EventRegistrationDeadlineInfo).withConfig({displayName:"EventUserRegistration__DeadlineInfo",componentId:"sc-1mvozes-0"})(templateObject_1$22||(templateObject_1$22=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var SeatsInfo=_styled(EventRegistrationLocationSeatsInfo).withConfig({displayName:"EventUserRegistration__SeatsInfo",componentId:"sc-1mvozes-1"})(templateObject_2$1i||(templateObject_2$1i=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var StatusInfo=_styled(EventRegistrationRegisterStatusInfo).withConfig({displayName:"EventUserRegistration__StatusInfo",componentId:"sc-1mvozes-2"})(templateObject_3$R||(templateObject_3$R=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var templateObject_1$22,templateObject_2$1i,templateObject_3$R;var EventCardUserRegistration=function EventCardUserRegistration(_a){var item=_a.item,disabled=_a.disabled,className=_a.className;var _b=useState$2(item.userResponse),eventResponse=_b[0],setEventResponse=_b[1];var isRegistered=eventResponse===EventResponse.Registered;// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131910
131913
|
var seatsInfo=useMemo(getSeatsInfo,[isRegistered,item.id]);return jsx$1(EventUserRegistrationContext.Provider,__assign({value:{hasPollContext:false,item:item,submitPoll:function(savePollAnswers){return savePollAnswers();},reset:function(){return Promise.resolve();},answers:null,hasMissingAnswers:false,onBehalfOfUpn:null,isLoading:false,eventResponse:eventResponse,setEventResponse:setEventResponse,seatsInfo:seatsInfo}},{children:jsx$1(EventUserRegistration,{disabled:disabled,className:className},void 0)}),void 0);function getSeatsInfo(){var _a;if(!item.registrationSettings||!item.registrationSettings.enabled||((_a=item.cancelInformation)===null||_a===void 0?void 0:_a.isCancelled)||isRegistered){return {hasAnySeatsLeft:true};}var locationsWithSeats=item.locations.filter(function(l){return l.maxNumberOfSeats>0;});var hasLocationsWithoutSeats=locationsWithSeats.length!==item.locations.length;if(!locationsWithSeats.length||hasLocationsWithoutSeats){return {hasAnySeatsLeft:true};}var participantsCount=getTotalParticipants();if(locationsWithSeats.length===1){var location_1=locationsWithSeats[0];var seatsLeft=Math.max(location_1.maxNumberOfSeats-participantsCount,0);return {hasAnySeatsLeft:seatsLeft>0,locations:[__assign(__assign({},location_1),{seatsLeft:seatsLeft})]};}// in this case we don't really know if we have any left seats or not
|
|
131911
131914
|
// since to get this information we need to load all results of all items
|
|
131912
131915
|
// we don't want to do this, so we just return "true"
|
|
@@ -131914,7 +131917,7 @@ var seatsInfo=useMemo(getSeatsInfo,[isRegistered,item.id]);return jsx$1(EventUse
|
|
|
131914
131917
|
return {hasAnySeatsLeft:true,locations:undefined};}function getTotalParticipants(){if(item.userResponse!==eventResponse){return (item.statistics.participantsCount||0)+(eventResponse===EventResponse.Registered?1:-1);}return item.statistics.participantsCount||0;}};var pageSize=50;var defaultShimmerCount=7;var LikersList=function LikersList(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,className=_a.className;var getLikers=useFeedbackApi().getLikers;var initialPageSize=Math.min(likersCount,pageSize);var _b=usePromise$2(loadLikers,null,[itemId]),likersInfo=_b[0],isLoading=_b[1],loadNextPage=_b[5];var isInitialLoading=!(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&isLoading;var isLoadingNextPage=(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&isLoading;var scrollContainer=useRef$1(null);return jsxs(Fragment,{children:[jsx$1(LikersListShimmer,__assign({count:Math.min(likersCount,defaultShimmerCount),isLoading:isInitialLoading&&likersCount>0},{children:jsxs(List$1,__assign({className:className,"data-likers-list":true,ref:scrollContainer,onScroll:handleScroll},{children:[likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers.map(function(i){return jsx$1("li",{children:jsx$1(PersonaCard,__assign({upn:i.userPrincipalName},{children:jsx$1(StyledAvatar$2,{"data-liker":i.userPrincipalName,upn:i.userPrincipalName,text:i.displayName},void 0)}),void 0)},i.id);}),isLoadingNextPage&&jsx$1(StyledSpinner$3,{},void 0),likersInfo&&!likersInfo.token&&likersInfo.likers.length>defaultShimmerCount&&jsx$1(UsersLoadedIndicator,{children:jsx$1(FormattedMessage$1,{id:"Generic.finishedLoadingLikers"},void 0)},void 0)]}),void 0)}),void 0),(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&!likersInfo.likers.length&&jsx$1(FormattedMessage$1,{id:"Generic.nobodyLikesThis"},void 0)]},void 0);function loadLikers(likersInfo){if(likersInfo===void 0){likersInfo={likers:[],token:null};}return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getLikers(itemType,itemId,{pageSize:!likersInfo.token?initialPageSize:pageSize,token:likersInfo.token})];case 1:result=_a.sent();return [2/*return*/,{likers:likersInfo.likers.concat(result.items),token:result.paginationToken}];}});});}function handleScroll(){return __awaiter(this,void 0,void 0,function(){var container,err_1;return __generator(this,function(_a){switch(_a.label){case 0:container=scrollContainer.current;if(!container){return [2/*return*/];}// check if we reached the end of the pagination
|
|
131915
131918
|
// or we are already loading the next page
|
|
131916
131919
|
if(likersInfo.token==null||isLoading){return [2/*return*/];}// check if user scrolled enough
|
|
131917
|
-
if(container.scrollHeight-container.scrollTop>container.clientHeight+300){return [2/*return*/];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,loadNextPage(likersInfo)];case 2:_a.sent();return [3/*break*/,4];case 3:err_1=_a.sent();logger.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var StyledAvatar$2=_styled(Avatar).withConfig({displayName:"LikersList__StyledAvatar",componentId:"sc-a990fb-0"})(templateObject_1$21||(templateObject_1$21=__makeTemplateObject(["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"],["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"])));var List$1=_styled.ul.withConfig({displayName:"LikersList__List",componentId:"sc-a990fb-1"})(templateObject_2$1h||(templateObject_2$1h=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"])),defaultShimmerCount*58,spacingS);var StyledSpinner$3=_styled(Spinner).withConfig({displayName:"LikersList__StyledSpinner",componentId:"sc-a990fb-2"})(templateObject_3$P||(templateObject_3$P=__makeTemplateObject(["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"],["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"])),spacingS);var LikersListShimmer=function LikersListShimmer(_a){var count=_a.count,isLoading=_a.isLoading,children=_a.children;return jsx$1(Shimmer,__assign({isDataLoaded:!isLoading,customElementsGroup:Array.from(Array(count)).map(function(_,i){return jsx$1(UserShimmer$1,{},i);})},{children:children}),void 0);};var UserShimmer$1=function UserShimmer(){return jsxs(Fragment,{children:[jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.gap,height:10,width:'100%'}]},void 0),jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.circle,height:48,verticalAlign:'bottom'},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.line,height:18}]},void 0)]},void 0);};var UsersLoadedIndicator=_styled.div.withConfig({displayName:"LikersList__UsersLoadedIndicator",componentId:"sc-a990fb-3"})(templateObject_4$A||(templateObject_4$A=__makeTemplateObject(["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"],["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"])),spacingM);var templateObject_1$21,templateObject_2$1h,templateObject_3$P,templateObject_4$A;_styled.div.withConfig({displayName:"LongPressLikeButton__ButtonHost",componentId:"sc-1n5c9rg-0"})(templateObject_1$20||(templateObject_1$20=__makeTemplateObject(["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"],["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"])));createGlobalStyle(templateObject_2$1g||(templateObject_2$1g=__makeTemplateObject(["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"],["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"])),maxScreenSize.small);var templateObject_1$20,templateObject_2$1g;var HoverLikeButton=function HoverLikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,children=_a.children;var _b=useState$2(false),showCallout=_b[0],setshowCallout=_b[1];var buttonRef=useRef$1(null);var timeout=useRef$1(null);useEffect$1(function(){return function(){return window.clearTimeout(timeout.current);};},[]);return jsxs("div",__assign({ref:buttonRef,onMouseEnter:startOpenCalloutTimer,onMouseLeave:cancelOpenCalloutTimer,onFocus:startOpenCalloutTimer,onBlur:cancelOpenCalloutTimer},{children:[jsx$1("div",{children:children},void 0),showCallout&&jsx$1(LikersCallout,{itemId:itemId,itemType:itemType,target:buttonRef.current,likersCount:likersCount,onDismiss:function(){return setshowCallout(false);}},void 0)]}),void 0);function startOpenCalloutTimer(){if(!likersCount){return;}window.clearTimeout(timeout.current);timeout.current=window.setTimeout(function(){setshowCallout(true);},1000);}function cancelOpenCalloutTimer(){window.clearTimeout(timeout.current);}};var LikersCallout=function LikersCallout(_a){var itemId=_a.itemId,itemType=_a.itemType,onDismiss=_a.onDismiss,target=_a.target,likersCount=_a.likersCount;return jsxs(StyledCallout$1,__assign({target:target,onDismiss:onDismiss,directionalHint:DirectionalHint$1.leftCenter},{children:[jsxs(LikedBy,{children:[jsx$1(FormattedMessage$1,{id:"Generic.likers"},void 0),":"]},void 0),jsx$1(LikersList,{itemId:itemId,itemType:itemType,likersCount:likersCount},void 0)]}),void 0);};var StyledCallout$1=_styled(Callout).withConfig({displayName:"HoverLikeButton__StyledCallout",componentId:"sc-1f0a2ni-0"})(templateObject_1$1$||(templateObject_1$1$=__makeTemplateObject(["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"],["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"])),spacingM,spacingXl);var LikedBy=_styled.span.withConfig({displayName:"HoverLikeButton__LikedBy",componentId:"sc-1f0a2ni-1"})(templateObject_2$1f||(templateObject_2$1f=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$1$,templateObject_2$1f;var LikeButton=function LikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,isActive=_a.isActive,count=_a.count,onClick=_a.onClick,isDemoContent=_a.isDemoContent,doNotRenderZeroCount=_a.doNotRenderZeroCount,readOnly=_a.readOnly,className=_a.className;var features=useFeatures();var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var likeButton=jsx$1(FeedbackCountButton,{className:className,tooltipResourceKey:"Generic.like",activeTooltipResourceKey:"Generic.unlike",ariaLabel:formatMessage({id:isActive?'AriaLabel.unlikeItemButton':'AriaLabel.likeItemButton'}),iconName:"Like",activeIconName:"LikeSolid",isActive:isActive,onClick:onClick,count:count,feedbackType:"like",doNotRenderZeroCount:doNotRenderZeroCount,readOnly:readOnly,hideTooltip:features.showLikers},void 0);if(!features.showLikers||isDemoContent||user.isPublicUser){return likeButton;}return jsx$1(HoverLikeButton,__assign({itemId:itemId,itemType:itemType,likersCount:count},{children:likeButton}),void 0);};function hasFeedbackType(feedbackSettings,feedbackType){return feedbackSettings&&feedbackSettings.feedbackOptions&&feedbackSettings.feedbackOptions.findIndex(function(f){return f===feedbackType;})>-1;}var CardLikeButton=function CardLikeButton(_a){var _b,_c,_d;var item=_a.item,itemResourceType=_a.itemResourceType,className=_a.className;var _e=useState$2(item.isLiked),isLiked=_e[0],setIsLiked=_e[1];var _f=useState$2((_c=(_b=item.statistics)===null||_b===void 0?void 0:_b.likeCount)!==null&&_c!==void 0?_c:0),likeCount=_f[0],setLikeCount=_f[1];var _g=useState$2(false),isSaving=_g[0],setIsSaving=_g[1];var features=useFeatures();var _h=useFeedbackApi(),setFeedback=_h.setFeedback,unsetFeedback=_h.unsetFeedback;var metadata=(_d=item.metadata)!==null&&_d!==void 0?_d:{};var hasLikesEnabled=hasFeedbackType(metadata.feedbackSettings,'like');var showError=useNotificationContext().showError;if(!features.likes||!hasLikesEnabled){return null;}return jsx$1(StyledLikeButton$2,{itemId:item.id,itemType:itemResourceType,isActive:isLiked,count:likeCount,onClick:handleClick,doNotRenderZeroCount:true,className:className,isDemoContent:item.isDemoContent},void 0);function handleClick(){return __awaiter(this,void 0,void 0,function(){var isNowLiked,oldCount;return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving){return [2/*return*/];}isNowLiked=!isLiked;oldCount=likeCount;_b.label=1;case 1:_b.trys.push([1,6,7,8]);setIsSaving(true);setIsLiked(isNowLiked);setLikeCount(isNowLiked?oldCount+1:oldCount-1);if(!isNowLiked)return [3/*break*/,3];return [4/*yield*/,setFeedback(itemResourceType,item.id,'like')];case 2:_b.sent();return [3/*break*/,5];case 3:return [4/*yield*/,unsetFeedback(itemResourceType,item.id,'like')];case 4:_b.sent();_b.label=5;case 5:return [3/*break*/,8];case 6:_b.sent();setIsLiked(!isNowLiked);showError('NewsArticle.setFeedback_error');setLikeCount(oldCount);return [3/*break*/,8];case 7:setIsSaving(false);return [7/*endfinally*/];case 8:return [2/*return*/];}});});}};var StyledLikeButton$2=_styled(LikeButton).withConfig({displayName:"CardLikeButton__StyledLikeButton",componentId:"sc-10mlzn4-0"})(templateObject_1$1_||(templateObject_1$1_=__makeTemplateObject(["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"],["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"])));var templateObject_1$1_;var EventRecurrenceSeriesInfo=function EventRecurrenceSeriesInfo(_a){var _b;var eventItem=_a.eventItem,className=_a.className;if(!(eventItem===null||eventItem===void 0?void 0:eventItem.recurrenceSeriesId)){return null;}var endDate=(_b=eventItem.recurrenceSettings)===null||_b===void 0?void 0:_b.endDate;return jsx$1(Host$L,__assign({className:className},{children:jsx$1(StyledTooltip$3,__assign({resourceKey:"Events.editor.recurrence.iconTooltip",values:{endDate:moment(endDate).format('LL')},hidden:!endDate},{children:jsxs(Container$2,{children:[jsx$1(StyledIcon$6,{iconName:"RecurringEvent"},void 0),jsx$1(FormattedMessage$1,{id:"Events.editor.recurrence.series"},void 0)]},void 0)}),void 0)}),void 0);};var Host$L=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Host",componentId:"sc-12fly5n-0"})(templateObject_1$1Z||(templateObject_1$1Z=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n"],["\n display: flex;\n font-size: ","px;\n"])),fontSizeSmall);var StyledTooltip$3=_styled(Tooltip).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledTooltip",componentId:"sc-12fly5n-1"})(templateObject_2$1e||(templateObject_2$1e=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var Container$2=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Container",componentId:"sc-12fly5n-2"})(templateObject_3$O||(templateObject_3$O=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIcon$6=_styled(Icon).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledIcon",componentId:"sc-12fly5n-3"})(templateObject_4$z||(templateObject_4$z=__makeTemplateObject(["\n font-size: ","px;\n padding-right: ","px;\n"],["\n font-size: ","px;\n padding-right: ","px;\n"])),fontSizeMedium,spacingXs);var templateObject_1$1Z,templateObject_2$1e,templateObject_3$O,templateObject_4$z;var EventRecurrenceSeriesInfoNavLink=function EventRecurrenceSeriesInfoNavLink(_a){var recurrenceSeriesId=_a.recurrenceSeriesId,title=_a.title,children=_a.children,className=_a.className;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!recurrenceSeriesId){return null;}return jsx$1(StyledNavLink$2,__assign({to:buildPath("/events/upcoming?"+queryString.stringify({seriesId:recurrenceSeriesId,seriesTitle:title})),className:className},{children:children}),void 0);};var StyledNavLink$2=_styled(NavLink).withConfig({displayName:"EventRecurrenceSeriesInfoNavLink__StyledNavLink",componentId:"sc-1szm15-0"})(templateObject_1$1Y||(templateObject_1$1Y=__makeTemplateObject(["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"],["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1Y;var EventCard=function EventCard(_a){var _b,_c,_d,_e,_f;var item=_a.item,language=_a.language,styleDefinition=_a.styleDefinition,allowFilterByChannels=_a.allowFilterByChannels,showFeedbackButtons=_a.showFeedbackButtons,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var windowSize=useWindowSize$2();var highlight=!!user.unreadEvents.find(function(e){return e.itemId===item.id||e.itemId===item.recurrenceSeriesId;});var userLanguage=getPreferredContentLanguage(user);var contents=item.contents[language];var targetRoute=NewsService.getNewsRoute(buildPath('/events'),item.id,contents.title);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;var hasNoRegistration=!isCancelled&&!((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.enabled);var hasManyLocationsAndContacts=((_d=item.locations)===null||_d===void 0?void 0:_d.length)+((_e=item.contacts)===null||_e===void 0?void 0:_e.length)>=6;var bannerOnTheLeft=windowSize.width>767;var bannerWidth=bannerOnTheLeft&&hasManyLocationsAndContacts?750:450;return jsxs(Host$K,__assign({className:className,highlight:highlight,styleDefinition:styleDefinition,"data-item-id":item.id,"data-card-highlight":highlight,"data-no-registration":hasNoRegistration,"data-banner":(_f=item.bannerInfo)===null||_f===void 0?void 0:_f.type},{children:[jsx$1(IEFix,{},void 0),!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath('/events'),title:contents.title,itemId:item.id,itemType:ItemResourceTypes.Events},void 0),jsx$1(EventCardBanner,{item:item,bannerWidth:bannerWidth,bannerHostDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerHostWidth,showPlaceholder:!item.bannerInfo&&(styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo)},void 0),jsxs(Content$7,{children:[jsxs(Header$2,__assign({"data-card-header":true},{children:[jsx$1(Dates,{startDate:item.startDate,endDate:item.endDate,isCancelled:isCancelled,className:"event-card-dates"},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"header",targetRoute:targetRoute},void 0)]}),void 0),readOnly?jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0):jsx$1(EventRecurrenceSeriesInfoNavLink,{recurrenceSeriesId:item.recurrenceSeriesId,title:contents.title,children:jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0)},void 0),jsx$1(Title$8,{children:readOnly?contents.title:jsx$1(StyledLink,__assign({to:targetRoute},{children:contents.title}),void 0)},void 0),jsxs(Footer$1,{children:[jsxs(FooterStart,{children:[jsx$1(Locations,{locations:item.locations},void 0),jsx$1(Contacts,{item:item,hideAnnouncer:true},void 0),jsx$1(EventChannelsDisplay,{item:item,language:userLanguage,allowFilterByChannels:allowFilterByChannels,channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor},void 0)]},void 0),jsxs(FooterEnd,{children:[jsx$1(Registration,{item:item,disabled:readOnly},void 0),jsx$1(CancelInfo,{item:item},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"footer",targetRoute:targetRoute},void 0)]},void 0)]},void 0)]},void 0)]}),void 0);};var Host$K=_styled.article.withConfig({displayName:"EventCard__Host",componentId:"sc-19skrau-0"})(templateObject_4$y||(templateObject_4$y=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"],["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"])),function(p){return p.styleDefinition?css$2(templateObject_1$1X||(templateObject_1$1X=__makeTemplateObject(["\n background-color: ",";\n ",";\n "],["\n background-color: ",";\n ",";\n "])),p.styleDefinition.backgroundColor||p.theme.palette.white,!p.styleDefinition.noShadow&&CardBorderInline(2,2)):css$2(templateObject_2$1d||(templateObject_2$1d=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);},maxScreenSize.medium,function(p){return p.highlight&&css$2(templateObject_3$N||(templateObject_3$N=__makeTemplateObject(["\n position: relative;\n\n &::after {\n ",";\n }\n "],["\n position: relative;\n\n &::after {\n ",";\n }\n "])),BannerHighlightStyle$1);},function(p){return p.theme.textColors.default;});var BannerHighlightStyle$1=css$2(templateObject_5$v||(templateObject_5$v=__makeTemplateObject(["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"],["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"])),spacingXs,function(p){return p.theme.palette.accent;});var StyledLink=_styled(Link$4).withConfig({displayName:"EventCard__StyledLink",componentId:"sc-19skrau-1"})(templateObject_6$m||(templateObject_6$m=__makeTemplateObject(["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"],["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"])),function(p){return p.theme.textColors.default;});var Title$8=_styled.h3.withConfig({displayName:"EventCard__Title",componentId:"sc-19skrau-2"})(templateObject_7$g||(templateObject_7$g=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeMedium);var Header$2=_styled.div.withConfig({displayName:"EventCard__Header",componentId:"sc-19skrau-3"})(templateObject_8$f||(templateObject_8$f=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),maxScreenSize.medium,spacingXs);var RecurrenceSeriesInfo$1=_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventCard__RecurrenceSeriesInfo",componentId:"sc-19skrau-4"})(templateObject_9$c||(templateObject_9$c=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var Content$7=_styled.div.withConfig({displayName:"EventCard__Content",componentId:"sc-19skrau-5"})(templateObject_10$b||(templateObject_10$b=__makeTemplateObject(["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"],["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"])),spacingM,function(p){return p.theme.textColors.default;});var Footer$1=_styled.div.withConfig({displayName:"EventCard__Footer",componentId:"sc-19skrau-6"})(templateObject_11$7||(templateObject_11$7=__makeTemplateObject(["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,maxScreenSize.medium);var FooterStart=_styled.div.withConfig({displayName:"EventCard__FooterStart",componentId:"sc-19skrau-7"})(templateObject_12$6||(templateObject_12$6=__makeTemplateObject(["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"],["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"])),spacingXs,spacingS,maxScreenSize.medium);var FooterEnd=_styled.div.withConfig({displayName:"EventCard__FooterEnd",componentId:"sc-19skrau-8"})(templateObject_13$5||(templateObject_13$5=__makeTemplateObject(["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"],["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"])),maxScreenSize.medium,spacingS);var HeaderFeedback=css$2(templateObject_14$5||(templateObject_14$5=__makeTemplateObject(["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"],["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"])),minScreenSize.medium);var FooterFeedback=css$2(templateObject_15$5||(templateObject_15$5=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"])),spacingS,minScreenSize.medium);var FeedbackHost=_styled.div.withConfig({displayName:"EventCard__FeedbackHost",componentId:"sc-19skrau-9"})(templateObject_16$5||(templateObject_16$5=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),function(_a){var isHeader=_a.isHeader;return isHeader?HeaderFeedback:FooterFeedback;});var Feedback=function Feedback(_a){var item=_a.item,type=_a.type,targetRoute=_a.targetRoute;var user=useCurrentUser();var showCommentCount=item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(item.metadata.feedbackSettings,'comment')&&!user.isPublicUser;return jsxs(FeedbackHost,__assign({isHeader:type==='header'},{children:[jsx$1(EventCardLikeButton,{item:item,itemResourceType:ItemResourceTypes.Events},void 0),showCommentCount&&jsx$1(StyledLink,__assign({to:targetRoute+"#comments","aria-hidden":"true"},{children:jsx$1(EventCardCommentCount,{item:item},void 0)}),void 0)]}),void 0);};var EventCardLikeButton=_styled(CardLikeButton).withConfig({displayName:"EventCard__EventCardLikeButton",componentId:"sc-19skrau-10"})(templateObject_17$4||(templateObject_17$4=__makeTemplateObject(["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"],["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"])));var Registration=_styled(EventCardUserRegistration).withConfig({displayName:"EventCard__Registration",componentId:"sc-19skrau-11"})(templateObject_18$3||(templateObject_18$3=__makeTemplateObject(["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"],["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"])),spacingS,minScreenSize.medium);var Dates=_styled(DateTimeRange).withConfig({displayName:"EventCard__Dates",componentId:"sc-19skrau-12"})(templateObject_19$3||(templateObject_19$3=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"],["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"])),fontSizeSmall,function(_a){var isCancelled=_a.isCancelled;return isCancelled?0.4:1;},spacingS);var Locations=_styled(EventLocationInfo).withConfig({displayName:"EventCard__Locations",componentId:"sc-19skrau-13"})(templateObject_20$2||(templateObject_20$2=__makeTemplateObject([""],[""])));var Contacts=_styled(EventPeopleInfo).withConfig({displayName:"EventCard__Contacts",componentId:"sc-19skrau-14"})(templateObject_21$1||(templateObject_21$1=__makeTemplateObject(["\n flex-direction: column;\n"],["\n flex-direction: column;\n"])));var CancelInfo=_styled(EventCancelInformation).withConfig({displayName:"EventCard__CancelInfo",componentId:"sc-19skrau-15"})(templateObject_22$1||(templateObject_22$1=__makeTemplateObject(["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"],["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"])),spacingM,minScreenSize.medium);var IEFix=createGlobalStyle(templateObject_23$1||(templateObject_23$1=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"])));var templateObject_1$1X,templateObject_2$1d,templateObject_3$N,templateObject_4$y,templateObject_5$v,templateObject_6$m,templateObject_7$g,templateObject_8$f,templateObject_9$c,templateObject_10$b,templateObject_11$7,templateObject_12$6,templateObject_13$5,templateObject_14$5,templateObject_15$5,templateObject_16$5,templateObject_17$4,templateObject_18$3,templateObject_19$3,templateObject_20$2,templateObject_21$1,templateObject_22$1,templateObject_23$1;function useExternalContentHandler(){var _this=this;var history=useHistory();var onRequestToken=useContext(AuthenticationContext).onRequestToken;var trackExternalItem=useNewsApi().trackExternalItem;var createApiUrl=useApiFactory().createApiUrl;var currentUser=useCurrentUser();var webAppUrls=useSubscriptionWebAppUrls();var _a=useContext(LinkContext),onOpenExternalLink=_a.onOpenExternalLink,tryGetInternalLink=_a.tryGetInternalLink;var refreshUserDetails=useRefreshUserDetails();return function(item,itemType,openInNewTab){return __awaiter(_this,void 0,void 0,function(){var language,externalContentUrl,internalLink,token;return __generator(this,function(_a){switch(_a.label){case 0:if(!(item===null||item===void 0?void 0:item.useExternalContent)){return [2/*return*/,null];}language=getPreferredContentLanguage(currentUser);externalContentUrl=getExternalContentUrl(item,language);if(!externalContentUrl){return [2/*return*/,null];}internalLink=tryGetInternalLink(externalContentUrl,webAppUrls);if(internalLink){// no API redirect; only the unread & page views tracking
|
|
131920
|
+
if(container.scrollHeight-container.scrollTop>container.clientHeight+300){return [2/*return*/];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,loadNextPage(likersInfo)];case 2:_a.sent();return [3/*break*/,4];case 3:err_1=_a.sent();logger.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var StyledAvatar$2=_styled(Avatar).withConfig({displayName:"LikersList__StyledAvatar",componentId:"sc-a990fb-0"})(templateObject_1$21||(templateObject_1$21=__makeTemplateObject(["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"],["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"])));var List$1=_styled.ul.withConfig({displayName:"LikersList__List",componentId:"sc-a990fb-1"})(templateObject_2$1h||(templateObject_2$1h=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"])),defaultShimmerCount*58,spacingS);var StyledSpinner$3=_styled(Spinner).withConfig({displayName:"LikersList__StyledSpinner",componentId:"sc-a990fb-2"})(templateObject_3$Q||(templateObject_3$Q=__makeTemplateObject(["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"],["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"])),spacingS);var LikersListShimmer=function LikersListShimmer(_a){var count=_a.count,isLoading=_a.isLoading,children=_a.children;return jsx$1(Shimmer,__assign({isDataLoaded:!isLoading,customElementsGroup:Array.from(Array(count)).map(function(_,i){return jsx$1(UserShimmer$1,{},i);})},{children:children}),void 0);};var UserShimmer$1=function UserShimmer(){return jsxs(Fragment,{children:[jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.gap,height:10,width:'100%'}]},void 0),jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.circle,height:48,verticalAlign:'bottom'},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.line,height:18}]},void 0)]},void 0);};var UsersLoadedIndicator=_styled.div.withConfig({displayName:"LikersList__UsersLoadedIndicator",componentId:"sc-a990fb-3"})(templateObject_4$A||(templateObject_4$A=__makeTemplateObject(["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"],["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"])),spacingM);var templateObject_1$21,templateObject_2$1h,templateObject_3$Q,templateObject_4$A;_styled.div.withConfig({displayName:"LongPressLikeButton__ButtonHost",componentId:"sc-1n5c9rg-0"})(templateObject_1$20||(templateObject_1$20=__makeTemplateObject(["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"],["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"])));createGlobalStyle(templateObject_2$1g||(templateObject_2$1g=__makeTemplateObject(["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"],["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"])),maxScreenSize.small);var templateObject_1$20,templateObject_2$1g;var HoverLikeButton=function HoverLikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,children=_a.children;var _b=useState$2(false),showCallout=_b[0],setshowCallout=_b[1];var buttonRef=useRef$1(null);var timeout=useRef$1(null);useEffect$1(function(){return function(){return window.clearTimeout(timeout.current);};},[]);return jsxs("div",__assign({ref:buttonRef,onMouseEnter:startOpenCalloutTimer,onMouseLeave:cancelOpenCalloutTimer,onFocus:startOpenCalloutTimer,onBlur:cancelOpenCalloutTimer},{children:[jsx$1("div",{children:children},void 0),showCallout&&jsx$1(LikersCallout,{itemId:itemId,itemType:itemType,target:buttonRef.current,likersCount:likersCount,onDismiss:function(){return setshowCallout(false);}},void 0)]}),void 0);function startOpenCalloutTimer(){if(!likersCount){return;}window.clearTimeout(timeout.current);timeout.current=window.setTimeout(function(){setshowCallout(true);},1000);}function cancelOpenCalloutTimer(){window.clearTimeout(timeout.current);}};var LikersCallout=function LikersCallout(_a){var itemId=_a.itemId,itemType=_a.itemType,onDismiss=_a.onDismiss,target=_a.target,likersCount=_a.likersCount;return jsxs(StyledCallout$1,__assign({target:target,onDismiss:onDismiss,directionalHint:DirectionalHint$1.leftCenter},{children:[jsxs(LikedBy,{children:[jsx$1(FormattedMessage$1,{id:"Generic.likers"},void 0),":"]},void 0),jsx$1(LikersList,{itemId:itemId,itemType:itemType,likersCount:likersCount},void 0)]}),void 0);};var StyledCallout$1=_styled(Callout).withConfig({displayName:"HoverLikeButton__StyledCallout",componentId:"sc-1f0a2ni-0"})(templateObject_1$1$||(templateObject_1$1$=__makeTemplateObject(["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"],["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"])),spacingM,spacingXl);var LikedBy=_styled.span.withConfig({displayName:"HoverLikeButton__LikedBy",componentId:"sc-1f0a2ni-1"})(templateObject_2$1f||(templateObject_2$1f=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$1$,templateObject_2$1f;var LikeButton=function LikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,isActive=_a.isActive,count=_a.count,onClick=_a.onClick,isDemoContent=_a.isDemoContent,doNotRenderZeroCount=_a.doNotRenderZeroCount,readOnly=_a.readOnly,className=_a.className;var features=useFeatures();var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var likeButton=jsx$1(FeedbackCountButton,{className:className,tooltipResourceKey:"Generic.like",activeTooltipResourceKey:"Generic.unlike",ariaLabel:formatMessage({id:isActive?'AriaLabel.unlikeItemButton':'AriaLabel.likeItemButton'}),iconName:"Like",activeIconName:"LikeSolid",isActive:isActive,onClick:onClick,count:count,feedbackType:"like",doNotRenderZeroCount:doNotRenderZeroCount,readOnly:readOnly,hideTooltip:features.showLikers},void 0);if(!features.showLikers||isDemoContent||user.isPublicUser){return likeButton;}return jsx$1(HoverLikeButton,__assign({itemId:itemId,itemType:itemType,likersCount:count},{children:likeButton}),void 0);};function hasFeedbackType(feedbackSettings,feedbackType){return feedbackSettings&&feedbackSettings.feedbackOptions&&feedbackSettings.feedbackOptions.findIndex(function(f){return f===feedbackType;})>-1;}var CardLikeButton=function CardLikeButton(_a){var _b,_c,_d;var item=_a.item,itemResourceType=_a.itemResourceType,className=_a.className;var _e=useState$2(item.isLiked),isLiked=_e[0],setIsLiked=_e[1];var _f=useState$2((_c=(_b=item.statistics)===null||_b===void 0?void 0:_b.likeCount)!==null&&_c!==void 0?_c:0),likeCount=_f[0],setLikeCount=_f[1];var _g=useState$2(false),isSaving=_g[0],setIsSaving=_g[1];var features=useFeatures();var _h=useFeedbackApi(),setFeedback=_h.setFeedback,unsetFeedback=_h.unsetFeedback;var metadata=(_d=item.metadata)!==null&&_d!==void 0?_d:{};var hasLikesEnabled=hasFeedbackType(metadata.feedbackSettings,'like');var showError=useNotificationContext().showError;if(!features.likes||!hasLikesEnabled){return null;}return jsx$1(StyledLikeButton$2,{itemId:item.id,itemType:itemResourceType,isActive:isLiked,count:likeCount,onClick:handleClick,doNotRenderZeroCount:true,className:className,isDemoContent:item.isDemoContent},void 0);function handleClick(){return __awaiter(this,void 0,void 0,function(){var isNowLiked,oldCount;return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving){return [2/*return*/];}isNowLiked=!isLiked;oldCount=likeCount;_b.label=1;case 1:_b.trys.push([1,6,7,8]);setIsSaving(true);setIsLiked(isNowLiked);setLikeCount(isNowLiked?oldCount+1:oldCount-1);if(!isNowLiked)return [3/*break*/,3];return [4/*yield*/,setFeedback(itemResourceType,item.id,'like')];case 2:_b.sent();return [3/*break*/,5];case 3:return [4/*yield*/,unsetFeedback(itemResourceType,item.id,'like')];case 4:_b.sent();_b.label=5;case 5:return [3/*break*/,8];case 6:_b.sent();setIsLiked(!isNowLiked);showError('NewsArticle.setFeedback_error');setLikeCount(oldCount);return [3/*break*/,8];case 7:setIsSaving(false);return [7/*endfinally*/];case 8:return [2/*return*/];}});});}};var StyledLikeButton$2=_styled(LikeButton).withConfig({displayName:"CardLikeButton__StyledLikeButton",componentId:"sc-10mlzn4-0"})(templateObject_1$1_||(templateObject_1$1_=__makeTemplateObject(["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"],["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"])));var templateObject_1$1_;var EventRecurrenceSeriesInfo=function EventRecurrenceSeriesInfo(_a){var _b;var eventItem=_a.eventItem,className=_a.className;if(!(eventItem===null||eventItem===void 0?void 0:eventItem.recurrenceSeriesId)){return null;}var endDate=(_b=eventItem.recurrenceSettings)===null||_b===void 0?void 0:_b.endDate;return jsx$1(Host$L,__assign({className:className},{children:jsx$1(StyledTooltip$3,__assign({resourceKey:"Events.editor.recurrence.iconTooltip",values:{endDate:moment(endDate).format('LL')},hidden:!endDate},{children:jsxs(Container$2,{children:[jsx$1(StyledIcon$6,{iconName:"RecurringEvent"},void 0),jsx$1(FormattedMessage$1,{id:"Events.editor.recurrence.series"},void 0)]},void 0)}),void 0)}),void 0);};var Host$L=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Host",componentId:"sc-12fly5n-0"})(templateObject_1$1Z||(templateObject_1$1Z=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n"],["\n display: flex;\n font-size: ","px;\n"])),fontSizeSmall);var StyledTooltip$3=_styled(Tooltip).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledTooltip",componentId:"sc-12fly5n-1"})(templateObject_2$1e||(templateObject_2$1e=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var Container$2=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Container",componentId:"sc-12fly5n-2"})(templateObject_3$P||(templateObject_3$P=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIcon$6=_styled(Icon).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledIcon",componentId:"sc-12fly5n-3"})(templateObject_4$z||(templateObject_4$z=__makeTemplateObject(["\n font-size: ","px;\n padding-right: ","px;\n"],["\n font-size: ","px;\n padding-right: ","px;\n"])),fontSizeMedium,spacingXs);var templateObject_1$1Z,templateObject_2$1e,templateObject_3$P,templateObject_4$z;var EventRecurrenceSeriesInfoNavLink=function EventRecurrenceSeriesInfoNavLink(_a){var recurrenceSeriesId=_a.recurrenceSeriesId,title=_a.title,children=_a.children,className=_a.className;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!recurrenceSeriesId){return null;}return jsx$1(StyledNavLink$2,__assign({to:buildPath("/events/upcoming?"+queryString.stringify({seriesId:recurrenceSeriesId,seriesTitle:title})),className:className},{children:children}),void 0);};var StyledNavLink$2=_styled(NavLink).withConfig({displayName:"EventRecurrenceSeriesInfoNavLink__StyledNavLink",componentId:"sc-1szm15-0"})(templateObject_1$1Y||(templateObject_1$1Y=__makeTemplateObject(["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"],["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1Y;var EventCard=function EventCard(_a){var _b,_c,_d,_e,_f;var item=_a.item,language=_a.language,styleDefinition=_a.styleDefinition,allowFilterByChannels=_a.allowFilterByChannels,showFeedbackButtons=_a.showFeedbackButtons,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var windowSize=useWindowSize$2();var highlight=!!user.unreadEvents.find(function(e){return e.itemId===item.id||e.itemId===item.recurrenceSeriesId;});var userLanguage=getPreferredContentLanguage(user);var contents=item.contents[language];var targetRoute=NewsService.getNewsRoute(buildPath('/events'),item.id,contents.title);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;var hasNoRegistration=!isCancelled&&!((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.enabled);var hasManyLocationsAndContacts=((_d=item.locations)===null||_d===void 0?void 0:_d.length)+((_e=item.contacts)===null||_e===void 0?void 0:_e.length)>=6;var bannerOnTheLeft=windowSize.width>767;var bannerWidth=bannerOnTheLeft&&hasManyLocationsAndContacts?750:450;return jsxs(Host$K,__assign({className:className,highlight:highlight,styleDefinition:styleDefinition,"data-item-id":item.id,"data-card-highlight":highlight,"data-no-registration":hasNoRegistration,"data-banner":(_f=item.bannerInfo)===null||_f===void 0?void 0:_f.type},{children:[jsx$1(IEFix,{},void 0),!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath('/events'),title:contents.title,itemId:item.id,itemType:ItemResourceTypes.Events},void 0),jsx$1(EventCardBanner,{item:item,bannerWidth:bannerWidth,bannerHostDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerHostWidth,showPlaceholder:!item.bannerInfo&&(styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo)},void 0),jsxs(Content$7,{children:[jsxs(Header$2,__assign({"data-card-header":true},{children:[jsx$1(Dates,{startDate:item.startDate,endDate:item.endDate,isCancelled:isCancelled,className:"event-card-dates"},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"header",targetRoute:targetRoute},void 0)]}),void 0),readOnly?jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0):jsx$1(EventRecurrenceSeriesInfoNavLink,{recurrenceSeriesId:item.recurrenceSeriesId,title:contents.title,children:jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0)},void 0),jsx$1(Title$8,{children:readOnly?contents.title:jsx$1(StyledLink,__assign({to:targetRoute},{children:contents.title}),void 0)},void 0),jsxs(Footer$1,{children:[jsxs(FooterStart,{children:[jsx$1(Locations,{locations:item.locations},void 0),jsx$1(Contacts,{item:item,hideAnnouncer:true},void 0),jsx$1(EventChannelsDisplay,{item:item,language:userLanguage,allowFilterByChannels:allowFilterByChannels,channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor},void 0)]},void 0),jsxs(FooterEnd,{children:[jsx$1(Registration,{item:item,disabled:readOnly},void 0),jsx$1(CancelInfo,{item:item},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"footer",targetRoute:targetRoute},void 0)]},void 0)]},void 0)]},void 0)]}),void 0);};var Host$K=_styled.article.withConfig({displayName:"EventCard__Host",componentId:"sc-19skrau-0"})(templateObject_4$y||(templateObject_4$y=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"],["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"])),function(p){return p.styleDefinition?css$2(templateObject_1$1X||(templateObject_1$1X=__makeTemplateObject(["\n background-color: ",";\n ",";\n "],["\n background-color: ",";\n ",";\n "])),p.styleDefinition.backgroundColor||p.theme.palette.white,!p.styleDefinition.noShadow&&CardBorderInline(2,2)):css$2(templateObject_2$1d||(templateObject_2$1d=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);},maxScreenSize.medium,function(p){return p.highlight&&css$2(templateObject_3$O||(templateObject_3$O=__makeTemplateObject(["\n position: relative;\n\n &::after {\n ",";\n }\n "],["\n position: relative;\n\n &::after {\n ",";\n }\n "])),BannerHighlightStyle$1);},function(p){return p.theme.textColors.default;});var BannerHighlightStyle$1=css$2(templateObject_5$v||(templateObject_5$v=__makeTemplateObject(["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"],["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"])),spacingXs,function(p){return p.theme.palette.accent;});var StyledLink=_styled(Link$4).withConfig({displayName:"EventCard__StyledLink",componentId:"sc-19skrau-1"})(templateObject_6$m||(templateObject_6$m=__makeTemplateObject(["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"],["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"])),function(p){return p.theme.textColors.default;});var Title$8=_styled.h3.withConfig({displayName:"EventCard__Title",componentId:"sc-19skrau-2"})(templateObject_7$g||(templateObject_7$g=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeMedium);var Header$2=_styled.div.withConfig({displayName:"EventCard__Header",componentId:"sc-19skrau-3"})(templateObject_8$f||(templateObject_8$f=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),maxScreenSize.medium,spacingXs);var RecurrenceSeriesInfo$1=_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventCard__RecurrenceSeriesInfo",componentId:"sc-19skrau-4"})(templateObject_9$c||(templateObject_9$c=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var Content$7=_styled.div.withConfig({displayName:"EventCard__Content",componentId:"sc-19skrau-5"})(templateObject_10$b||(templateObject_10$b=__makeTemplateObject(["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"],["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"])),spacingM,function(p){return p.theme.textColors.default;});var Footer$1=_styled.div.withConfig({displayName:"EventCard__Footer",componentId:"sc-19skrau-6"})(templateObject_11$7||(templateObject_11$7=__makeTemplateObject(["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,maxScreenSize.medium);var FooterStart=_styled.div.withConfig({displayName:"EventCard__FooterStart",componentId:"sc-19skrau-7"})(templateObject_12$6||(templateObject_12$6=__makeTemplateObject(["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"],["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"])),spacingXs,spacingS,maxScreenSize.medium);var FooterEnd=_styled.div.withConfig({displayName:"EventCard__FooterEnd",componentId:"sc-19skrau-8"})(templateObject_13$5||(templateObject_13$5=__makeTemplateObject(["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"],["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"])),maxScreenSize.medium,spacingS);var HeaderFeedback=css$2(templateObject_14$5||(templateObject_14$5=__makeTemplateObject(["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"],["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"])),minScreenSize.medium);var FooterFeedback=css$2(templateObject_15$5||(templateObject_15$5=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"])),spacingS,minScreenSize.medium);var FeedbackHost=_styled.div.withConfig({displayName:"EventCard__FeedbackHost",componentId:"sc-19skrau-9"})(templateObject_16$5||(templateObject_16$5=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),function(_a){var isHeader=_a.isHeader;return isHeader?HeaderFeedback:FooterFeedback;});var Feedback=function Feedback(_a){var item=_a.item,type=_a.type,targetRoute=_a.targetRoute;var user=useCurrentUser();var showCommentCount=item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(item.metadata.feedbackSettings,'comment')&&!user.isPublicUser;return jsxs(FeedbackHost,__assign({isHeader:type==='header'},{children:[jsx$1(EventCardLikeButton,{item:item,itemResourceType:ItemResourceTypes.Events},void 0),showCommentCount&&jsx$1(StyledLink,__assign({to:targetRoute+"#comments","aria-hidden":"true"},{children:jsx$1(EventCardCommentCount,{item:item},void 0)}),void 0)]}),void 0);};var EventCardLikeButton=_styled(CardLikeButton).withConfig({displayName:"EventCard__EventCardLikeButton",componentId:"sc-19skrau-10"})(templateObject_17$4||(templateObject_17$4=__makeTemplateObject(["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"],["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"])));var Registration=_styled(EventCardUserRegistration).withConfig({displayName:"EventCard__Registration",componentId:"sc-19skrau-11"})(templateObject_18$3||(templateObject_18$3=__makeTemplateObject(["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"],["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"])),spacingS,minScreenSize.medium);var Dates=_styled(DateTimeRange).withConfig({displayName:"EventCard__Dates",componentId:"sc-19skrau-12"})(templateObject_19$3||(templateObject_19$3=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"],["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"])),fontSizeSmall,function(_a){var isCancelled=_a.isCancelled;return isCancelled?0.4:1;},spacingS);var Locations=_styled(EventLocationInfo).withConfig({displayName:"EventCard__Locations",componentId:"sc-19skrau-13"})(templateObject_20$2||(templateObject_20$2=__makeTemplateObject([""],[""])));var Contacts=_styled(EventPeopleInfo).withConfig({displayName:"EventCard__Contacts",componentId:"sc-19skrau-14"})(templateObject_21$1||(templateObject_21$1=__makeTemplateObject(["\n flex-direction: column;\n"],["\n flex-direction: column;\n"])));var CancelInfo=_styled(EventCancelInformation).withConfig({displayName:"EventCard__CancelInfo",componentId:"sc-19skrau-15"})(templateObject_22$1||(templateObject_22$1=__makeTemplateObject(["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"],["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"])),spacingM,minScreenSize.medium);var IEFix=createGlobalStyle(templateObject_23$1||(templateObject_23$1=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"])));var templateObject_1$1X,templateObject_2$1d,templateObject_3$O,templateObject_4$y,templateObject_5$v,templateObject_6$m,templateObject_7$g,templateObject_8$f,templateObject_9$c,templateObject_10$b,templateObject_11$7,templateObject_12$6,templateObject_13$5,templateObject_14$5,templateObject_15$5,templateObject_16$5,templateObject_17$4,templateObject_18$3,templateObject_19$3,templateObject_20$2,templateObject_21$1,templateObject_22$1,templateObject_23$1;function useExternalContentHandler(){var _this=this;var history=useHistory();var onRequestToken=useContext(AuthenticationContext).onRequestToken;var trackExternalItem=useNewsApi().trackExternalItem;var createApiUrl=useApiFactory().createApiUrl;var currentUser=useCurrentUser();var webAppUrls=useSubscriptionWebAppUrls();var _a=useContext(LinkContext),onOpenExternalLink=_a.onOpenExternalLink,tryGetInternalLink=_a.tryGetInternalLink;var refreshUserDetails=useRefreshUserDetails();return function(item,itemType,openInNewTab){return __awaiter(_this,void 0,void 0,function(){var language,externalContentUrl,internalLink,token;return __generator(this,function(_a){switch(_a.label){case 0:if(!(item===null||item===void 0?void 0:item.useExternalContent)){return [2/*return*/,null];}language=getPreferredContentLanguage(currentUser);externalContentUrl=getExternalContentUrl(item,language);if(!externalContentUrl){return [2/*return*/,null];}internalLink=tryGetInternalLink(externalContentUrl,webAppUrls);if(internalLink){// no API redirect; only the unread & page views tracking
|
|
131918
131921
|
trackExternalItem(item.id,itemType).then(function(){return refreshUserDetails();},logger.error);history.push(internalLink);return [2/*return*/,true];}return [4/*yield*/,onRequestToken()];case 1:token=_a.sent();if(!token){return [2/*return*/,false];}return [4/*yield*/,redirectToExternalContent(item.id,itemType,token,openInNewTab)];case 2:_a.sent();refreshUserDetails();return [2/*return*/,true];}});});};function redirectToExternalContent(itemId,itemType,token,openNewTab){return __awaiter(this,void 0,void 0,function(){var apiExternalContentRedirectRoute;return __generator(this,function(_a){switch(_a.label){case 0:apiExternalContentRedirectRoute=createApiUrl("/"+itemType+"/"+encodeURIComponent(itemId)+"/external_url",{access_token:token});return [4/*yield*/,onOpenExternalLink(apiExternalContentRedirectRoute,openNewTab)];case 1:_a.sent();return [2/*return*/];}});});}}function useExternalContentClickHandler(){var _this=this;var handleExternalContent=useExternalContentHandler();return function(e,item,itemType){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:if(!item.useExternalContent){return [2/*return*/];}e.stopPropagation();e.preventDefault();return [4/*yield*/,handleExternalContent(item,itemType,true)];case 1:_a.sent();return [2/*return*/];}});});};}function useExternalContentRedirectHandler(item,resourceType,noRedirect){var _this=this;var handleExternalContent=useExternalContentHandler();useEffect$1(function(){if(noRedirect){return;}(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,handleExternalContent(item,resourceType)];case 1:return [2/*return*/,_a.sent()];}});});})();// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131919
131922
|
},[item===null||item===void 0?void 0:item.id]);}function usePagesClickHandler(){var user=useCurrentUser();var userToken=useCurrentToken();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var getDocumentFileUrl=usePagesApi().getDocumentFileUrl;var createApiUrl=useApiFactory().createApiUrl;var handleExternalContent=useExternalContentHandler();var _a=useFileAccessTokenApi(),exchangeShortLivedToken=_a.exchangeShortLivedToken,getPublishableItemShortLivedToken=_a.getPublishableItemShortLivedToken,createDownloadClickHandler=_a.createDownloadClickHandler;return useMemo(function(){return {createPageClickHandler:createPageClickHandler,createDocumentClickHandler:createDocumentClickHandler};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131920
131923
|
},[user.subscription.id,userToken,getDocumentFileUrl,handleExternalContent]);function createPageClickHandler(page,basePath,additionalOnClick,ignoreExternalContent){var _this=this;if(!page.useExternalContent||// we don't want the editor view to open the external page
|
|
@@ -131929,11 +131932,11 @@ return nodes.slice().sort(function(a,b){return compareRootPages(groupPositions,a
|
|
|
131929
131932
|
// we just use the id for that, because this one is always different
|
|
131930
131933
|
var fallbackCompare=function fallbackCompare(){var _a;return ((_a=a.id)===null||_a===void 0?void 0:_a.localeCompare(b===null||b===void 0?void 0:b.id))||0;};if(firstGroupIdOfA===firstGroupIdOfB){return a.position-b.position||fallbackCompare();}return groupPositions[firstGroupIdOfA]-groupPositions[firstGroupIdOfB]||fallbackCompare();}function useInlinePageDocument(documentData,page,basePath){if(basePath===void 0){basePath='pages';}var extension=documentData.extension,fileId=documentData.fileId,originalFileName=documentData.fileName,pageId=documentData.pageId,originalTitle=documentData.title;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var createDocumentClickHandler=usePagesClickHandler().createDocumentClickHandler;var _a=useMemo(function(){var iconName=getFileIconByExtension(extension);var fileUrl=NewsService.getNewsRoute(buildPath(basePath),pageId,null);return {iconName:iconName,fileUrl:fileUrl};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131931
131934
|
},[extension,pageId]),fileUrl=_a.fileUrl,iconName=_a.iconName;var _b=useMemo(function(){if(!(page===null||page===void 0?void 0:page.id)){return {title:originalTitle,fileName:originalFileName};}var _a=getFileInfo(page,user),fileInfo=_a.fileInfo,language=_a.language;var onPageDocumentDownloadClick=createDocumentClickHandler(pageId,fileId,language,fileInfo.shouldOpenInBrowser,page.fileAccessToken,basePath);return {title:getTitle(page,user,formatMessage,language),fileName:fileInfo.fileName,onPageDocumentDownloadClick:onPageDocumentDownloadClick};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131932
|
-
},[page===null||page===void 0?void 0:page.id,createDocumentClickHandler]),fileName=_b.fileName,title=_b.title,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return {fileUrl:fileUrl,iconName:iconName,fileName:fileName,title:title,onPageDocumentDownloadClick:onPageDocumentDownloadClick};}function getFileInfo(page,user){var _a=getContentForPage(page,user),content=_a.content,language=_a.language;return {fileInfo:content===null||content===void 0?void 0:content.fileInfo,language:language};}function getContentForPage(page,user){var language=getLanguageForPage(page,user);return {content:page.contents[language],language:language};}function getLanguageForPage(page,user){if(!user||!page||!page.contents||!user.subscription){return null;}var language=NewsService.getLanguageForContent(page.contents,user,function(c){var _a;return page.pageType!==PageType.Document||((_a=c.fileInfo)===null||_a===void 0?void 0:_a.fileId)!=null;});if(language){return language;}return NewsService.getLanguageForContent(page.contents,user);}function convertToNavigationNode(page){var _a,_b,_c,_d;var parent=(_b=(_a=page===null||page===void 0?void 0:page.navigationContext)===null||_a===void 0?void 0:_a.parent)!==null&&_b!==void 0?_b:{id:page.parentId,contents:{}};return {id:page.id,pageType:page.pageType,parent:parent,position:page.position,status:page.status,groupIds:page.groupIds,hasHiddenAncestor:page.hasHiddenAncestor,isUnlinked:page.isUnlinked,hasPublishedVersion:page.isCurrentPublishedVersion||!!page.publishedVersionId,contents:Object.values(page.contents||{}).filter(function(c){return c.active;}).reduce(function(acc,next){acc[next.language]=next;return acc;},{}),firstChildId:page.firstChildId||((_d=(_c=page.navigationContext)===null||_c===void 0?void 0:_c.children)===null||_d===void 0?void 0:_d[0].id),children:undefined,isSearchMatch:undefined,hasAnyPageChild:undefined,useExternalContent:page.useExternalContent,topLevelFolderName:undefined,uploadToken:undefined};}var HostBaseStyle=function HostBaseStyle(backgroundColor){return css$2(templateObject_3$M||(templateObject_3$M=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n "],["\n ","\n\n display: flex;\n width: 100%;\n "])),function(p){return backgroundColor?css$2(templateObject_1$1W||(templateObject_1$1W=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),backgroundColor||p.theme.palette.white):css$2(templateObject_2$1c||(templateObject_2$1c=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);});};var ContentStyle=css$2(templateObject_4$x||(templateObject_4$x=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n font-size: ","px;\n"],["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n font-size: ","px;\n"])),fontSizeMedium);var MetaInfoStyle=function MetaInfoStyle(marginBottomOnEmpty){return css$2(templateObject_5$u||(templateObject_5$u=__makeTemplateObject(["\n font-size: ","px;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n\n &:empty {\n margin-bottom: ","px;\n }\n"],["\n font-size: ","px;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n\n &:empty {\n margin-bottom: ","px;\n }\n"])),fontSizeSmall,marginBottomOnEmpty||spacingM);};var BorderRadiusStyle=function BorderRadiusStyle(roundedCornerSize,rightSideOnly){var radius=roundedCornerSize||inlinePageBannerRoundedCornerSize;return css$2(templateObject_8$e||(templateObject_8$e=__makeTemplateObject(["\n ","\n "],["\n ","\n "])),rightSideOnly?css$2(templateObject_6$l||(templateObject_6$l=__makeTemplateObject(["\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n "],["\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n "])),radius,radius):css$2(templateObject_7$f||(templateObject_7$f=__makeTemplateObject(["\n border-radius: ","px;\n "],["\n border-radius: ","px;\n "])),radius));};var templateObject_1$1W,templateObject_2$1c,templateObject_3$M,templateObject_4$x,templateObject_5$u,templateObject_6$l,templateObject_7$f,templateObject_8$e;var ExternalContentIcon=function ExternalContentIcon(_a){var tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceValues=_a.tooltipResourceValues,className=_a.className;return jsx$1(StyledTooltip$2,__assign({className:className,resourceKey:tooltipResourceKey,values:{url:tooltipResourceValues},width:400},{children:jsx$1(StyledIcon$5,{iconName:"NavigateExternalInline","data-external-content":true},void 0)}),void 0);};var StyledTooltip$2=_styled(Tooltip).withConfig({displayName:"ExternalContentIcon__StyledTooltip",componentId:"sc-8h84ua-0"})(templateObject_1$1V||(templateObject_1$1V=__makeTemplateObject(["\n display: inline-flex;\n z-index: 1;\n"],["\n display: inline-flex;\n z-index: 1;\n"])));var StyledIcon$5=_styled(Icon).withConfig({displayName:"ExternalContentIcon__StyledIcon",componentId:"sc-8h84ua-1"})(templateObject_2$1b||(templateObject_2$1b=__makeTemplateObject(["\n margin-left: ","px;\n"],["\n margin-left: ","px;\n"])),spacingXs);var templateObject_1$1V,templateObject_2$1b;var Title$7=function Title(_a){var title=_a.title,targetRoute=_a.targetRoute,readOnly=_a.readOnly,openTargetInNewWindow=_a.openTargetInNewWindow,isDownloadLink=_a.isDownloadLink,isExternalContent=_a.isExternalContent,onClick=_a.onClick,resourceKey=_a.resourceKey,resourceValues=_a.resourceValues,className=_a.className;return jsx$1(TitleHost,__assign({className:className,"data-title":true},{children:readOnly?jsx$1("span",{children:title},void 0):isDownloadLink?jsx$1("a",__assign({href:targetRoute,rel:"noopener noreferrer",onClick:onClick},{children:jsx$1("span",{children:title},void 0)}),void 0):openTargetInNewWindow?jsxs("a",__assign({href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick},{children:[jsx$1("span",{children:title},void 0),isExternalContent&&jsx$1(ExternalContentIcon,{tooltipResourceKey:resourceKey,tooltipResourceValues:resourceValues},void 0)]}),void 0):jsxs(Link$4,__assign({to:targetRoute,onClick:onClick},{children:[jsx$1("span",{children:title},void 0),isExternalContent&&jsx$1(ExternalContentIcon,{tooltipResourceKey:resourceKey,tooltipResourceValues:resourceValues},void 0)]}),void 0)}),void 0);};var TitleHost=_styled.h3.withConfig({displayName:"Title__TitleHost",componentId:"sc-1wpb7iz-0"})(templateObject_1$1U||(templateObject_1$1U=__makeTemplateObject(["\n font-size: ","px;\n\n &&& {\n margin: 0 0 ","px 0;\n\n a {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n z-index: 1;\n }\n\n > span {\n z-index: 1;\n }\n }\n }\n"],["\n font-size: ","px;\n\n &&& {\n margin: 0 0 ","px 0;\n\n a {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n z-index: 1;\n }\n\n > span {\n z-index: 1;\n }\n }\n }\n"])),fontSizeMedium,spacingS,function(p){return p.theme.textColors.default;});var templateObject_1$1U;function getBreadcrumbsItems(page,target,handleOnClick,getTitle,formatMessage,hideCurrentPageNode,hideHomeNode){var ancestors=[];var parent=page.navigationContext.parent;while(parent!=null&&parent.id!=null){ancestors.unshift({title:getTitle(parent),id:parent.id});parent=parent.parent;}var parentNode=ancestors.find(function(a){return a.id===page.parentId;});var items=hideHomeNode?[]:[{key:'home',text:formatMessage({id:'Generic.home'}),href:target}];var ancestorItems=ancestors.map(function(node){return {key:node.id,text:node.title,href:NewsService.getNewsRoute(target,node.id,node.title),onClick:handleOnClick};});if(hideCurrentPageNode){return {breadcrumbItems:__spreadArray(__spreadArray([],items),ancestorItems),ancestors:ancestors,parentNode:parentNode};}var currentItem={key:'current',text:getTitle(page),isCurrentItem:true};return {breadcrumbItems:__spreadArray(__spreadArray(__spreadArray([],items),ancestorItems),[currentItem]),ancestors:ancestors,parentNode:parentNode};}var ListItemBreadcrumb=function ListItemBreadcrumb(_a){var page=_a.page,languageOverride=_a.language,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;if(!page||!page.navigationContext){return null;}var breadcrumbItems=getBreadcrumbsItems(page,null,function(){},function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,true,true).breadcrumbItems;return jsx$1(Host$J,__assign({className:className},{children:breadcrumbItems.map(function(b,i){return jsxs(Fragment$1,{children:[i!==0&&jsx$1(RightChevronIcon,{iconName:"ChevronRight"},void 0),jsx$1("span",{children:b.text},void 0)]},b.key);})}),void 0);};var Host$J=_styled.p.withConfig({displayName:"ListItemBreadcrumb__Host",componentId:"sc-c9uoz1-0"})(templateObject_1$1T||(templateObject_1$1T=__makeTemplateObject(["\n padding: 0;\n margin: ","px 0 0;\n font-size: ","px;\n\n color: ",";\n text-align: start;\n\n > span,\n i {\n vertical-align: middle;\n line-height: 1;\n }\n"],["\n padding: 0;\n margin: ","px 0 0;\n font-size: ","px;\n\n color: ",";\n text-align: start;\n\n > span,\n i {\n vertical-align: middle;\n line-height: 1;\n }\n"])),spacingXxs,fontSizeSmall,function(p){return p.theme.palette.neutralTertiary;});var RightChevronIcon=_styled(Icon).withConfig({displayName:"ListItemBreadcrumb__RightChevronIcon",componentId:"sc-c9uoz1-1"})(templateObject_2$1a||(templateObject_2$1a=__makeTemplateObject(["\n &&& {\n font-weight: bold;\n margin: 0 ","px;\n font-size: ","px;\n }\n"],["\n &&& {\n font-weight: bold;\n margin: 0 ","px;\n font-size: ","px;\n }\n"])),spacingXxs,fontSizeSmaller-2);var templateObject_1$1T,templateObject_2$1a;var PageItemTile=function PageItemTile(_a){var _b,_c;var item=_a.item,baseRoute=_a.baseRoute,filterBaseUrl=_a.filterBaseUrl,styleDefinition=_a.styleDefinition,readOnly=_a.readOnly,additionalMetadata=_a.additionalMetadata,buttons=_a.buttons,additionalContent=_a.additionalContent,showBannerPlaceholder=_a.showBannerPlaceholder,showBreadcrumb=_a.showBreadcrumb,showIntro=_a.showIntro,className=_a.className;var user=useCurrentUserContext().user;var intl=useIntl();var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var title=getTitle(item,user,intl.formatMessage);var language=getLanguageForPage(item,user);var content=item.contents[language];var hasKeywords=Object.keys((_b=item.keywords)!==null&&_b!==void 0?_b:[]).length>0;var targetRoute=NewsService.getNewsRoute(baseRoute,item.id,title);var clickHandler=createPageClickHandler(item);var isDocument=item.pageType===PageType.Document;var isEditor=baseRoute.includes('/editor');var preferredContentLanguage=getPreferredContentLanguage(user);var url=item.useExternalContent&&getExternalContentUrl(item,preferredContentLanguage);return jsxs(Host$I,__assign({"data-item-id":item.id,className:className},{children:[!readOnly&&jsx$1(ClickableOverlay,{itemId:item.id,itemType:ItemResourceTypes.Pages,baseRoute:baseRoute,title:title,isExternalContent:item.useExternalContent},void 0),jsxs(Inner$3$1,__assign({styleDefinition:styleDefinition,hasBanner:item.bannerInfo!=null||showBannerPlaceholder||isDocument},{children:[jsx$1(Banner$2,{item:item,language:language,bannerDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerDefaultWidth,applyRoundedCorners:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.applyRoundedCorners,showBannerPlaceholder:showBannerPlaceholder,isEditor:isEditor,bannerFontSize:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerFontSize},void 0),jsxs(Content$6,__assign({padding:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.contentPadding,"data-page-tile-content":true},{children:[jsxs(MetaInfo$3,__assign({paddingRight:showBreadcrumb&&!isDocument&&readOnly?spacingM:0},{children:[showBreadcrumb&&jsx$1(StyledListItemBreadcrumb,{page:item},void 0),!showBreadcrumb&&item.modified&&jsx$1(DateTime,{value:item.modified},void 0),additionalMetadata]}),void 0),jsxs(MainContent,{children:[jsxs(TitleAndIntro,__assign({addDownloadButtonSafetySpace:isDocument},{children:[jsx$1(StyledTitle$1,{title:title,targetRoute:targetRoute,readOnly:readOnly,onClick:clickHandler,fontSize:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.titleFontSize,margin:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.titleMargin,isExternalContent:item.useExternalContent,resourceKey:item.useExternalContent?'ExternalLinkButton.pages.navigateTo':undefined,resourceValues:url!==null&&url!==void 0?url:undefined},void 0),showIntro&&((_c=content.intro)===null||_c===void 0?void 0:_c.length)>0&&jsx$1(Intro$2,{children:content.intro},void 0)]}),void 0),additionalContent]},void 0),hasKeywords&&jsx$1(Keywords$2,{children:jsx$1(FlatKeywords,{item:item,filterBaseUrl:filterBaseUrl},void 0)},void 0),buttons&&jsx$1(Buttons$3,{children:buttons},void 0)]}),void 0)]}),void 0)]}),void 0);};var StyledTitle$1=_styled(Title$7).withConfig({displayName:"PageItemTile__StyledTitle",componentId:"sc-lcm8k6-0"})(templateObject_5$t||(templateObject_5$t=__makeTemplateObject(["\n // for embedded pages we do not pass in a custom font size and we want to truncate the title to 2 lines\n ","\n\n ",";\n\n ",";\n\n display: inline-block;\n max-width: 100%;\n\n a:focus {\n outline-offset: 0 !important;\n }\n"],["\n // for embedded pages we do not pass in a custom font size and we want to truncate the title to 2 lines\n ","\n\n ",";\n\n ",";\n\n display: inline-block;\n max-width: 100%;\n\n a:focus {\n outline-offset: 0 !important;\n }\n"])),function(p){return !p.fontSize&&css$2(templateObject_1$1S||(templateObject_1$1S=__makeTemplateObject(["\n a {\n display: inline-flex;\n }\n\n span {\n ","\n }\n "],["\n a {\n display: inline-flex;\n }\n\n span {\n ","\n }\n "])),LineClamp(2,fontSizeMedium,1.4));},function(p){return p.fontSize&&css$2(templateObject_2$19||(templateObject_2$19=__makeTemplateObject(["\n &&& {\n font-size: ","px;\n line-height: 20px;\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n a {\n display: inline-flex;\n max-width: 100%;\n }\n\n span {\n // we pass a custom font size (smaller) for inline page lists and here we want to keep the title to single line\n display: block;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "],["\n &&& {\n font-size: ","px;\n line-height: 20px;\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n a {\n display: inline-flex;\n max-width: 100%;\n }\n\n span {\n // we pass a custom font size (smaller) for inline page lists and here we want to keep the title to single line\n display: block;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "])),p.fontSize,fontSizeNormal,fontSizeNormal);},function(p){return p.margin?css$2(templateObject_3$L||(templateObject_3$L=__makeTemplateObject(["\n margin: "," !important;\n "],["\n margin: "," !important;\n "])),p.margin):css$2(templateObject_4$w||(templateObject_4$w=__makeTemplateObject(["\n margin: 0 !important;\n "],["\n margin: 0 !important;\n "])));});var Intro$2=_styled.div.withConfig({displayName:"PageItemTile__Intro",componentId:"sc-lcm8k6-1"})(templateObject_6$k||(templateObject_6$k=__makeTemplateObject(["\n margin: ","px 0 ","px;\n ","\n"],["\n margin: ","px 0 ","px;\n ","\n"])),spacingXs-1,spacingS+5,LineClamp(10,fontSizeSmall,1.4));var Host$I=_styled.article.withConfig({displayName:"PageItemTile__Host",componentId:"sc-lcm8k6-2"})(templateObject_7$e||(templateObject_7$e=__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"])));var Inner$3$1=_styled.div.withConfig({displayName:"PageItemTile__Inner",componentId:"sc-lcm8k6-3"})(templateObject_11$6||(templateObject_11$6=__makeTemplateObject(["\n ","\n ","\n ","\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n ","\n ","\n ","\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),function(p){var _a;return HostBaseStyle((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.backgroundColor);},function(p){var _a;return ((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.applyRoundedCorners)&&BorderRadiusStyle();},function(p){var _a;return ((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.height)?css$2(templateObject_8$d||(templateObject_8$d=__makeTemplateObject(["\n height: ","px;\n "],["\n height: ","px;\n "])),p.styleDefinition.height):css$2(templateObject_9$b||(templateObject_9$b=__makeTemplateObject(["\n height: auto;\n min-height: 138px;\n "],["\n height: auto;\n min-height: 138px;\n "])));},function(p){var _a;return p.hasBanner&&css$2(templateObject_10$a||(templateObject_10$a=__makeTemplateObject(["\n [data-page-tile-content] {\n max-width: calc(100% - ","px)};\n }\n "],["\n [data-page-tile-content] {\n max-width: calc(100% - ","px)};\n }\n "])),(_a=p.styleDefinition)===null||_a===void 0?void 0:_a.bannerDefaultWidth);});var Content$6=_styled.div.withConfig({displayName:"PageItemTile__Content",componentId:"sc-lcm8k6-4"})(templateObject_14$4||(templateObject_14$4=__makeTemplateObject(["\n ","\n ","\n\n box-sizing: border-box;\n max-width: 100%;\n"],["\n ","\n ","\n\n box-sizing: border-box;\n max-width: 100%;\n"])),ContentStyle,function(p){return p.padding?css$2(templateObject_12$5||(templateObject_12$5=__makeTemplateObject(["\n padding: ",";\n "],["\n padding: ",";\n "])),p.padding):css$2(templateObject_13$4||(templateObject_13$4=__makeTemplateObject(["\n padding: ","px;\n "],["\n padding: ","px;\n "])),spacingM);});var MetaInfo$3=_styled.div.withConfig({displayName:"PageItemTile__MetaInfo",componentId:"sc-lcm8k6-5"})(templateObject_15$4||(templateObject_15$4=__makeTemplateObject(["\n "," /* font-size of date */\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n color: ",";\n\n padding-left: 2px;\n padding-right: ","px;\n"],["\n "," /* font-size of date */\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n color: ",";\n\n padding-left: 2px;\n padding-right: ","px;\n"])),MetaInfoStyle(17),function(p){return p.theme.textColors.default;},function(p){return p.paddingRight;});var MainContent=_styled.div.withConfig({displayName:"PageItemTile__MainContent",componentId:"sc-lcm8k6-6"})(templateObject_16$4||(templateObject_16$4=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-left: 2px;\n"],["\n display: flex;\n align-items: center;\n padding-left: 2px;\n"])));var DownloadButtonWidth=32;var TitleAndIntro=_styled.div.withConfig({displayName:"PageItemTile__TitleAndIntro",componentId:"sc-lcm8k6-7"})(templateObject_17$3||(templateObject_17$3=__makeTemplateObject(["\n width: calc(\n 100% -\n ","px\n );\n"],["\n width: calc(\n 100% -\n ","px\n );\n"])),function(p){return p.addDownloadButtonSafetySpace?DownloadButtonWidth:0;});var StyledListItemBreadcrumb=_styled(ListItemBreadcrumb).withConfig({displayName:"PageItemTile__StyledListItemBreadcrumb",componentId:"sc-lcm8k6-8"})(templateObject_18$2||(templateObject_18$2=__makeTemplateObject(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n &&& {\n // this is needed because draft.js adds a 1rem margin bottom here somehow (because the breadcrumb is a <p> maybe) and it breaks the view\n margin-bottom: 0;\n }\n"],["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n &&& {\n // this is needed because draft.js adds a 1rem margin bottom here somehow (because the breadcrumb is a <p> maybe) and it breaks the view\n margin-bottom: 0;\n }\n"])));var Keywords$2=_styled.span.withConfig({displayName:"PageItemTile__Keywords",componentId:"sc-lcm8k6-9"})(templateObject_19$2||(templateObject_19$2=__makeTemplateObject(["\n display: block;\n margin-top: auto;\n\n > span {\n font-size: ","px;\n line-height: 20px;\n height: 20px;\n display: inline-block;\n padding: 0 2px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n && {\n a:link,\n a:visited {\n color: "," !important;\n\n &:focus {\n outline-offset: 0 !important;\n }\n }\n }\n"],["\n display: block;\n margin-top: auto;\n\n > span {\n font-size: ","px;\n line-height: 20px;\n height: 20px;\n display: inline-block;\n padding: 0 2px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n && {\n a:link,\n a:visited {\n color: "," !important;\n\n &:focus {\n outline-offset: 0 !important;\n }\n }\n }\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;});var Buttons$3=_styled.div.withConfig({displayName:"PageItemTile__Buttons",componentId:"sc-lcm8k6-10"})(templateObject_20$1||(templateObject_20$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingS);var Banner$2=function Banner(_a){var _b,_c;var item=_a.item,language=_a.language,bannerDefaultWidth=_a.bannerDefaultWidth,bannerFontSize=_a.bannerFontSize,applyRoundedCorners=_a.applyRoundedCorners,showBannerPlaceholder=_a.showBannerPlaceholder,isEditor=_a.isEditor;var bannerInfo=item.bannerInfo;var isDocument=item.pageType===PageType.Document;var fileIcon=getFileIconByExtension(((_c=(_b=item.contents[language])===null||_b===void 0?void 0:_b.fileInfo)===null||_c===void 0?void 0:_c.extension)||'');if(isDocument){return jsx$1(BannerHost$1,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(FileIcon$1,{iconName:fileIcon,fontSize:bannerFontSize,color:getIconColor(fileIcon)},void 0)}),void 0);}if(!bannerInfo&&!showBannerPlaceholder){return null;}if(bannerDefaultWidth<100){return jsx$1(SmallBannerWrapper,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,useEditorRoutes:isEditor,width:200,token:item.fileAccessToken,resourceType:ItemResourceTypes.Pages},void 0)}),void 0);}return jsx$1("div",{children:jsx$1(LargeBannerWrapper,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,useEditorRoutes:isEditor,width:450,token:item.fileAccessToken,resourceType:ItemResourceTypes.Pages},void 0)}),void 0)},void 0);};var BannerHost$1=_styled.div.withConfig({displayName:"PageItemTile__BannerHost",componentId:"sc-lcm8k6-11"})(templateObject_23$2||(templateObject_23$2=__makeTemplateObject(["\n display: flex;\n width: ","px;\n justify-content: center;\n align-items: center;\n background-color: ",";\n\n ","\n\n @media (max-width: ","px) {\n ","\n }\n"],["\n display: flex;\n width: ","px;\n justify-content: center;\n align-items: center;\n background-color: ",";\n\n ","\n\n @media (max-width: ","px) {\n ","\n }\n"])),function(p){return p.defaultWidth;},function(p){return p.theme.palette.neutralQuaternaryAlt;},function(p){return p.applyRoundedCorners&&css$2(templateObject_21$2||(templateObject_21$2=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5));},maxScreenSize.medium,function(p){return p.defaultWidth>100&&css$2(templateObject_22$2||(templateObject_22$2=__makeTemplateObject(["\n width: auto;\n height: 100px;\n "],["\n width: auto;\n height: 100px;\n "])));});var FileIcon$1=_styled(Icon).withConfig({displayName:"PageItemTile__FileIcon",componentId:"sc-lcm8k6-12"})(templateObject_24$1||(templateObject_24$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n"],["\n font-size: ","px;\n color: ",";\n"])),function(p){return p.fontSize||30;},function(p){return p.color||p.theme.textColors.default;});var SmallBannerWrapper=_styled.div.withConfig({displayName:"PageItemTile__SmallBannerWrapper",componentId:"sc-lcm8k6-13"})(templateObject_26$1||(templateObject_26$1=__makeTemplateObject(["\n background-color: ",";\n\n width: ","px;\n height: 100%;\n\n .video-view-container {\n height: 100%;\n }\n\n &&& .video-icon {\n font-size: 35px;\n margin: 0;\n }\n\n ","\n"],["\n background-color: ",";\n\n width: ","px;\n height: 100%;\n\n .video-view-container {\n height: 100%;\n }\n\n &&& .video-icon {\n font-size: 35px;\n margin: 0;\n }\n\n ","\n"])),function(p){return p.theme.palette.accent;},function(p){return p.defaultWidth;},function(p){return p.applyRoundedCorners&&css$2(templateObject_25$1||(templateObject_25$1=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5));});var LargeBannerWrapper=_styled(LeftBannerWrapper).withConfig({displayName:"PageItemTile__LargeBannerWrapper",componentId:"sc-lcm8k6-14"})(templateObject_28$1||(templateObject_28$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.applyRoundedCorners&&css$2(templateObject_27$1||(templateObject_27$1=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5,true));});var templateObject_1$1S,templateObject_2$19,templateObject_3$L,templateObject_4$w,templateObject_5$t,templateObject_6$k,templateObject_7$e,templateObject_8$d,templateObject_9$b,templateObject_10$a,templateObject_11$6,templateObject_12$5,templateObject_13$4,templateObject_14$4,templateObject_15$4,templateObject_16$4,templateObject_17$3,templateObject_18$2,templateObject_19$2,templateObject_20$1,templateObject_21$2,templateObject_22$2,templateObject_23$2,templateObject_24$1,templateObject_25$1,templateObject_26$1,templateObject_27$1,templateObject_28$1;var global$1=global$m;var trim=stringTrim$1.trim;var whitespaces$4=whitespaces$3;var $parseInt=global$1.parseInt;var hex=/^[+-]?0[Xx]/;var FORCED=$parseInt(whitespaces$4+'08')!==8||$parseInt(whitespaces$4+'0x16')!==22;// `parseInt` method
|
|
131935
|
+
},[page===null||page===void 0?void 0:page.id,createDocumentClickHandler]),fileName=_b.fileName,title=_b.title,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return {fileUrl:fileUrl,iconName:iconName,fileName:fileName,title:title,onPageDocumentDownloadClick:onPageDocumentDownloadClick};}function getFileInfo(page,user){var _a=getContentForPage(page,user),content=_a.content,language=_a.language;return {fileInfo:content===null||content===void 0?void 0:content.fileInfo,language:language};}function getContentForPage(page,user){var language=getLanguageForPage(page,user);return {content:page.contents[language],language:language};}function getLanguageForPage(page,user){if(!user||!page||!page.contents||!user.subscription){return null;}var language=NewsService.getLanguageForContent(page.contents,user,function(c){var _a;return page.pageType!==PageType.Document||((_a=c.fileInfo)===null||_a===void 0?void 0:_a.fileId)!=null;});if(language){return language;}return NewsService.getLanguageForContent(page.contents,user);}function convertToNavigationNode(page){var _a,_b,_c,_d;var parent=(_b=(_a=page===null||page===void 0?void 0:page.navigationContext)===null||_a===void 0?void 0:_a.parent)!==null&&_b!==void 0?_b:{id:page.parentId,contents:{}};return {id:page.id,pageType:page.pageType,parent:parent,position:page.position,status:page.status,groupIds:page.groupIds,hasHiddenAncestor:page.hasHiddenAncestor,isUnlinked:page.isUnlinked,hasPublishedVersion:page.isCurrentPublishedVersion||!!page.publishedVersionId,contents:Object.values(page.contents||{}).filter(function(c){return c.active;}).reduce(function(acc,next){acc[next.language]=next;return acc;},{}),firstChildId:page.firstChildId||((_d=(_c=page.navigationContext)===null||_c===void 0?void 0:_c.children)===null||_d===void 0?void 0:_d[0].id),children:undefined,isSearchMatch:undefined,hasAnyPageChild:undefined,useExternalContent:page.useExternalContent,topLevelFolderName:undefined,uploadToken:undefined};}var HostBaseStyle=function HostBaseStyle(backgroundColor){return css$2(templateObject_3$N||(templateObject_3$N=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n "],["\n ","\n\n display: flex;\n width: 100%;\n "])),function(p){return backgroundColor?css$2(templateObject_1$1W||(templateObject_1$1W=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),backgroundColor||p.theme.palette.white):css$2(templateObject_2$1c||(templateObject_2$1c=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);});};var ContentStyle=css$2(templateObject_4$x||(templateObject_4$x=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n font-size: ","px;\n"],["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n font-size: ","px;\n"])),fontSizeMedium);var MetaInfoStyle=function MetaInfoStyle(marginBottomOnEmpty){return css$2(templateObject_5$u||(templateObject_5$u=__makeTemplateObject(["\n font-size: ","px;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n\n &:empty {\n margin-bottom: ","px;\n }\n"],["\n font-size: ","px;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n\n &:empty {\n margin-bottom: ","px;\n }\n"])),fontSizeSmall,marginBottomOnEmpty||spacingM);};var BorderRadiusStyle=function BorderRadiusStyle(roundedCornerSize,rightSideOnly){var radius=roundedCornerSize||inlinePageBannerRoundedCornerSize;return css$2(templateObject_8$e||(templateObject_8$e=__makeTemplateObject(["\n ","\n "],["\n ","\n "])),rightSideOnly?css$2(templateObject_6$l||(templateObject_6$l=__makeTemplateObject(["\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n "],["\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n "])),radius,radius):css$2(templateObject_7$f||(templateObject_7$f=__makeTemplateObject(["\n border-radius: ","px;\n "],["\n border-radius: ","px;\n "])),radius));};var templateObject_1$1W,templateObject_2$1c,templateObject_3$N,templateObject_4$x,templateObject_5$u,templateObject_6$l,templateObject_7$f,templateObject_8$e;var ExternalContentIcon=function ExternalContentIcon(_a){var tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceValues=_a.tooltipResourceValues,className=_a.className;return jsx$1(StyledTooltip$2,__assign({className:className,resourceKey:tooltipResourceKey,values:{url:tooltipResourceValues},width:400},{children:jsx$1(StyledIcon$5,{iconName:"NavigateExternalInline","data-external-content":true},void 0)}),void 0);};var StyledTooltip$2=_styled(Tooltip).withConfig({displayName:"ExternalContentIcon__StyledTooltip",componentId:"sc-8h84ua-0"})(templateObject_1$1V||(templateObject_1$1V=__makeTemplateObject(["\n display: inline-flex;\n z-index: 1;\n"],["\n display: inline-flex;\n z-index: 1;\n"])));var StyledIcon$5=_styled(Icon).withConfig({displayName:"ExternalContentIcon__StyledIcon",componentId:"sc-8h84ua-1"})(templateObject_2$1b||(templateObject_2$1b=__makeTemplateObject(["\n margin-left: ","px;\n"],["\n margin-left: ","px;\n"])),spacingXs);var templateObject_1$1V,templateObject_2$1b;var Title$7=function Title(_a){var title=_a.title,targetRoute=_a.targetRoute,readOnly=_a.readOnly,openTargetInNewWindow=_a.openTargetInNewWindow,isDownloadLink=_a.isDownloadLink,isExternalContent=_a.isExternalContent,onClick=_a.onClick,resourceKey=_a.resourceKey,resourceValues=_a.resourceValues,className=_a.className;return jsx$1(TitleHost,__assign({className:className,"data-title":true},{children:readOnly?jsx$1("span",{children:title},void 0):isDownloadLink?jsx$1("a",__assign({href:targetRoute,rel:"noopener noreferrer",onClick:onClick},{children:jsx$1("span",{children:title},void 0)}),void 0):openTargetInNewWindow?jsxs("a",__assign({href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick},{children:[jsx$1("span",{children:title},void 0),isExternalContent&&jsx$1(ExternalContentIcon,{tooltipResourceKey:resourceKey,tooltipResourceValues:resourceValues},void 0)]}),void 0):jsxs(Link$4,__assign({to:targetRoute,onClick:onClick},{children:[jsx$1("span",{children:title},void 0),isExternalContent&&jsx$1(ExternalContentIcon,{tooltipResourceKey:resourceKey,tooltipResourceValues:resourceValues},void 0)]}),void 0)}),void 0);};var TitleHost=_styled.h3.withConfig({displayName:"Title__TitleHost",componentId:"sc-1wpb7iz-0"})(templateObject_1$1U||(templateObject_1$1U=__makeTemplateObject(["\n font-size: ","px;\n\n &&& {\n margin: 0 0 ","px 0;\n\n a {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n z-index: 1;\n }\n\n > span {\n z-index: 1;\n }\n }\n }\n"],["\n font-size: ","px;\n\n &&& {\n margin: 0 0 ","px 0;\n\n a {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n z-index: 1;\n }\n\n > span {\n z-index: 1;\n }\n }\n }\n"])),fontSizeMedium,spacingS,function(p){return p.theme.textColors.default;});var templateObject_1$1U;function getBreadcrumbsItems(page,target,handleOnClick,getTitle,formatMessage,hideCurrentPageNode,hideHomeNode){var ancestors=[];var parent=page.navigationContext.parent;while(parent!=null&&parent.id!=null){ancestors.unshift({title:getTitle(parent),id:parent.id});parent=parent.parent;}var parentNode=ancestors.find(function(a){return a.id===page.parentId;});var items=hideHomeNode?[]:[{key:'home',text:formatMessage({id:'Generic.home'}),href:target}];var ancestorItems=ancestors.map(function(node){return {key:node.id,text:node.title,href:NewsService.getNewsRoute(target,node.id,node.title),onClick:handleOnClick};});if(hideCurrentPageNode){return {breadcrumbItems:__spreadArray(__spreadArray([],items),ancestorItems),ancestors:ancestors,parentNode:parentNode};}var currentItem={key:'current',text:getTitle(page),isCurrentItem:true};return {breadcrumbItems:__spreadArray(__spreadArray(__spreadArray([],items),ancestorItems),[currentItem]),ancestors:ancestors,parentNode:parentNode};}var ListItemBreadcrumb=function ListItemBreadcrumb(_a){var page=_a.page,languageOverride=_a.language,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;if(!page||!page.navigationContext){return null;}var breadcrumbItems=getBreadcrumbsItems(page,null,function(){},function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,true,true).breadcrumbItems;return jsx$1(Host$J,__assign({className:className},{children:breadcrumbItems.map(function(b,i){return jsxs(Fragment$1,{children:[i!==0&&jsx$1(RightChevronIcon,{iconName:"ChevronRight"},void 0),jsx$1("span",{children:b.text},void 0)]},b.key);})}),void 0);};var Host$J=_styled.p.withConfig({displayName:"ListItemBreadcrumb__Host",componentId:"sc-c9uoz1-0"})(templateObject_1$1T||(templateObject_1$1T=__makeTemplateObject(["\n padding: 0;\n margin: ","px 0 0;\n font-size: ","px;\n\n color: ",";\n text-align: start;\n\n > span,\n i {\n vertical-align: middle;\n line-height: 1;\n }\n"],["\n padding: 0;\n margin: ","px 0 0;\n font-size: ","px;\n\n color: ",";\n text-align: start;\n\n > span,\n i {\n vertical-align: middle;\n line-height: 1;\n }\n"])),spacingXxs,fontSizeSmall,function(p){return p.theme.palette.neutralTertiary;});var RightChevronIcon=_styled(Icon).withConfig({displayName:"ListItemBreadcrumb__RightChevronIcon",componentId:"sc-c9uoz1-1"})(templateObject_2$1a||(templateObject_2$1a=__makeTemplateObject(["\n &&& {\n font-weight: bold;\n margin: 0 ","px;\n font-size: ","px;\n }\n"],["\n &&& {\n font-weight: bold;\n margin: 0 ","px;\n font-size: ","px;\n }\n"])),spacingXxs,fontSizeSmaller-2);var templateObject_1$1T,templateObject_2$1a;var PageItemTile=function PageItemTile(_a){var _b,_c;var item=_a.item,baseRoute=_a.baseRoute,filterBaseUrl=_a.filterBaseUrl,styleDefinition=_a.styleDefinition,readOnly=_a.readOnly,additionalMetadata=_a.additionalMetadata,buttons=_a.buttons,additionalContent=_a.additionalContent,showBannerPlaceholder=_a.showBannerPlaceholder,showBreadcrumb=_a.showBreadcrumb,showIntro=_a.showIntro,className=_a.className;var user=useCurrentUserContext().user;var intl=useIntl();var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var title=getTitle(item,user,intl.formatMessage);var language=getLanguageForPage(item,user);var content=item.contents[language];var hasKeywords=Object.keys((_b=item.keywords)!==null&&_b!==void 0?_b:[]).length>0;var targetRoute=NewsService.getNewsRoute(baseRoute,item.id,title);var clickHandler=createPageClickHandler(item);var isDocument=item.pageType===PageType.Document;var isEditor=baseRoute.includes('/editor');var preferredContentLanguage=getPreferredContentLanguage(user);var url=item.useExternalContent&&getExternalContentUrl(item,preferredContentLanguage);return jsxs(Host$I,__assign({"data-item-id":item.id,className:className},{children:[!readOnly&&jsx$1(ClickableOverlay,{itemId:item.id,itemType:ItemResourceTypes.Pages,baseRoute:baseRoute,title:title,isExternalContent:item.useExternalContent},void 0),jsxs(Inner$3$1,__assign({styleDefinition:styleDefinition,hasBanner:item.bannerInfo!=null||showBannerPlaceholder||isDocument},{children:[jsx$1(Banner$2,{item:item,language:language,bannerDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerDefaultWidth,applyRoundedCorners:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.applyRoundedCorners,showBannerPlaceholder:showBannerPlaceholder,isEditor:isEditor,bannerFontSize:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerFontSize},void 0),jsxs(Content$6,__assign({padding:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.contentPadding,"data-page-tile-content":true},{children:[jsxs(MetaInfo$3,__assign({paddingRight:showBreadcrumb&&!isDocument&&readOnly?spacingM:0},{children:[showBreadcrumb&&jsx$1(StyledListItemBreadcrumb,{page:item},void 0),!showBreadcrumb&&item.modified&&jsx$1(DateTime,{value:item.modified},void 0),additionalMetadata]}),void 0),jsxs(MainContent,{children:[jsxs(TitleAndIntro,__assign({addDownloadButtonSafetySpace:isDocument},{children:[jsx$1(StyledTitle$1,{title:title,targetRoute:targetRoute,readOnly:readOnly,onClick:clickHandler,fontSize:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.titleFontSize,margin:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.titleMargin,isExternalContent:item.useExternalContent,resourceKey:item.useExternalContent?'ExternalLinkButton.pages.navigateTo':undefined,resourceValues:url!==null&&url!==void 0?url:undefined},void 0),showIntro&&((_c=content.intro)===null||_c===void 0?void 0:_c.length)>0&&jsx$1(Intro$2,{children:content.intro},void 0)]}),void 0),additionalContent]},void 0),hasKeywords&&jsx$1(Keywords$2,{children:jsx$1(FlatKeywords,{item:item,filterBaseUrl:filterBaseUrl},void 0)},void 0),buttons&&jsx$1(Buttons$3,{children:buttons},void 0)]}),void 0)]}),void 0)]}),void 0);};var StyledTitle$1=_styled(Title$7).withConfig({displayName:"PageItemTile__StyledTitle",componentId:"sc-lcm8k6-0"})(templateObject_5$t||(templateObject_5$t=__makeTemplateObject(["\n // for embedded pages we do not pass in a custom font size and we want to truncate the title to 2 lines\n ","\n\n ",";\n\n ",";\n\n display: inline-block;\n max-width: 100%;\n\n a:focus {\n outline-offset: 0 !important;\n }\n"],["\n // for embedded pages we do not pass in a custom font size and we want to truncate the title to 2 lines\n ","\n\n ",";\n\n ",";\n\n display: inline-block;\n max-width: 100%;\n\n a:focus {\n outline-offset: 0 !important;\n }\n"])),function(p){return !p.fontSize&&css$2(templateObject_1$1S||(templateObject_1$1S=__makeTemplateObject(["\n a {\n display: inline-flex;\n }\n\n span {\n ","\n }\n "],["\n a {\n display: inline-flex;\n }\n\n span {\n ","\n }\n "])),LineClamp(2,fontSizeMedium,1.4));},function(p){return p.fontSize&&css$2(templateObject_2$19||(templateObject_2$19=__makeTemplateObject(["\n &&& {\n font-size: ","px;\n line-height: 20px;\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n a {\n display: inline-flex;\n max-width: 100%;\n }\n\n span {\n // we pass a custom font size (smaller) for inline page lists and here we want to keep the title to single line\n display: block;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "],["\n &&& {\n font-size: ","px;\n line-height: 20px;\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n a {\n display: inline-flex;\n max-width: 100%;\n }\n\n span {\n // we pass a custom font size (smaller) for inline page lists and here we want to keep the title to single line\n display: block;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "])),p.fontSize,fontSizeNormal,fontSizeNormal);},function(p){return p.margin?css$2(templateObject_3$M||(templateObject_3$M=__makeTemplateObject(["\n margin: "," !important;\n "],["\n margin: "," !important;\n "])),p.margin):css$2(templateObject_4$w||(templateObject_4$w=__makeTemplateObject(["\n margin: 0 !important;\n "],["\n margin: 0 !important;\n "])));});var Intro$2=_styled.div.withConfig({displayName:"PageItemTile__Intro",componentId:"sc-lcm8k6-1"})(templateObject_6$k||(templateObject_6$k=__makeTemplateObject(["\n margin: ","px 0 ","px;\n ","\n"],["\n margin: ","px 0 ","px;\n ","\n"])),spacingXs-1,spacingS+5,LineClamp(10,fontSizeSmall,1.4));var Host$I=_styled.article.withConfig({displayName:"PageItemTile__Host",componentId:"sc-lcm8k6-2"})(templateObject_7$e||(templateObject_7$e=__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"])));var Inner$3$1=_styled.div.withConfig({displayName:"PageItemTile__Inner",componentId:"sc-lcm8k6-3"})(templateObject_11$6||(templateObject_11$6=__makeTemplateObject(["\n ","\n ","\n ","\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n ","\n ","\n ","\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),function(p){var _a;return HostBaseStyle((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.backgroundColor);},function(p){var _a;return ((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.applyRoundedCorners)&&BorderRadiusStyle();},function(p){var _a;return ((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.height)?css$2(templateObject_8$d||(templateObject_8$d=__makeTemplateObject(["\n height: ","px;\n "],["\n height: ","px;\n "])),p.styleDefinition.height):css$2(templateObject_9$b||(templateObject_9$b=__makeTemplateObject(["\n height: auto;\n min-height: 138px;\n "],["\n height: auto;\n min-height: 138px;\n "])));},function(p){var _a;return p.hasBanner&&css$2(templateObject_10$a||(templateObject_10$a=__makeTemplateObject(["\n [data-page-tile-content] {\n max-width: calc(100% - ","px)};\n }\n "],["\n [data-page-tile-content] {\n max-width: calc(100% - ","px)};\n }\n "])),(_a=p.styleDefinition)===null||_a===void 0?void 0:_a.bannerDefaultWidth);});var Content$6=_styled.div.withConfig({displayName:"PageItemTile__Content",componentId:"sc-lcm8k6-4"})(templateObject_14$4||(templateObject_14$4=__makeTemplateObject(["\n ","\n ","\n\n box-sizing: border-box;\n max-width: 100%;\n"],["\n ","\n ","\n\n box-sizing: border-box;\n max-width: 100%;\n"])),ContentStyle,function(p){return p.padding?css$2(templateObject_12$5||(templateObject_12$5=__makeTemplateObject(["\n padding: ",";\n "],["\n padding: ",";\n "])),p.padding):css$2(templateObject_13$4||(templateObject_13$4=__makeTemplateObject(["\n padding: ","px;\n "],["\n padding: ","px;\n "])),spacingM);});var MetaInfo$3=_styled.div.withConfig({displayName:"PageItemTile__MetaInfo",componentId:"sc-lcm8k6-5"})(templateObject_15$4||(templateObject_15$4=__makeTemplateObject(["\n "," /* font-size of date */\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n color: ",";\n\n padding-left: 2px;\n padding-right: ","px;\n"],["\n "," /* font-size of date */\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n color: ",";\n\n padding-left: 2px;\n padding-right: ","px;\n"])),MetaInfoStyle(17),function(p){return p.theme.textColors.default;},function(p){return p.paddingRight;});var MainContent=_styled.div.withConfig({displayName:"PageItemTile__MainContent",componentId:"sc-lcm8k6-6"})(templateObject_16$4||(templateObject_16$4=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-left: 2px;\n"],["\n display: flex;\n align-items: center;\n padding-left: 2px;\n"])));var DownloadButtonWidth=32;var TitleAndIntro=_styled.div.withConfig({displayName:"PageItemTile__TitleAndIntro",componentId:"sc-lcm8k6-7"})(templateObject_17$3||(templateObject_17$3=__makeTemplateObject(["\n width: calc(\n 100% -\n ","px\n );\n"],["\n width: calc(\n 100% -\n ","px\n );\n"])),function(p){return p.addDownloadButtonSafetySpace?DownloadButtonWidth:0;});var StyledListItemBreadcrumb=_styled(ListItemBreadcrumb).withConfig({displayName:"PageItemTile__StyledListItemBreadcrumb",componentId:"sc-lcm8k6-8"})(templateObject_18$2||(templateObject_18$2=__makeTemplateObject(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n &&& {\n // this is needed because draft.js adds a 1rem margin bottom here somehow (because the breadcrumb is a <p> maybe) and it breaks the view\n margin-bottom: 0;\n }\n"],["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n &&& {\n // this is needed because draft.js adds a 1rem margin bottom here somehow (because the breadcrumb is a <p> maybe) and it breaks the view\n margin-bottom: 0;\n }\n"])));var Keywords$2=_styled.span.withConfig({displayName:"PageItemTile__Keywords",componentId:"sc-lcm8k6-9"})(templateObject_19$2||(templateObject_19$2=__makeTemplateObject(["\n display: block;\n margin-top: auto;\n\n > span {\n font-size: ","px;\n line-height: 20px;\n height: 20px;\n display: inline-block;\n padding: 0 2px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n && {\n a:link,\n a:visited {\n color: "," !important;\n\n &:focus {\n outline-offset: 0 !important;\n }\n }\n }\n"],["\n display: block;\n margin-top: auto;\n\n > span {\n font-size: ","px;\n line-height: 20px;\n height: 20px;\n display: inline-block;\n padding: 0 2px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n && {\n a:link,\n a:visited {\n color: "," !important;\n\n &:focus {\n outline-offset: 0 !important;\n }\n }\n }\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;});var Buttons$3=_styled.div.withConfig({displayName:"PageItemTile__Buttons",componentId:"sc-lcm8k6-10"})(templateObject_20$1||(templateObject_20$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingS);var Banner$2=function Banner(_a){var _b,_c;var item=_a.item,language=_a.language,bannerDefaultWidth=_a.bannerDefaultWidth,bannerFontSize=_a.bannerFontSize,applyRoundedCorners=_a.applyRoundedCorners,showBannerPlaceholder=_a.showBannerPlaceholder,isEditor=_a.isEditor;var bannerInfo=item.bannerInfo;var isDocument=item.pageType===PageType.Document;var fileIcon=getFileIconByExtension(((_c=(_b=item.contents[language])===null||_b===void 0?void 0:_b.fileInfo)===null||_c===void 0?void 0:_c.extension)||'');if(isDocument){return jsx$1(BannerHost$1,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(FileIcon$1,{iconName:fileIcon,fontSize:bannerFontSize,color:getIconColor(fileIcon)},void 0)}),void 0);}if(!bannerInfo&&!showBannerPlaceholder){return null;}if(bannerDefaultWidth<100){return jsx$1(SmallBannerWrapper,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,useEditorRoutes:isEditor,width:200,token:item.fileAccessToken,resourceType:ItemResourceTypes.Pages},void 0)}),void 0);}return jsx$1("div",{children:jsx$1(LargeBannerWrapper,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,useEditorRoutes:isEditor,width:450,token:item.fileAccessToken,resourceType:ItemResourceTypes.Pages},void 0)}),void 0)},void 0);};var BannerHost$1=_styled.div.withConfig({displayName:"PageItemTile__BannerHost",componentId:"sc-lcm8k6-11"})(templateObject_23$2||(templateObject_23$2=__makeTemplateObject(["\n display: flex;\n width: ","px;\n justify-content: center;\n align-items: center;\n background-color: ",";\n\n ","\n\n @media (max-width: ","px) {\n ","\n }\n"],["\n display: flex;\n width: ","px;\n justify-content: center;\n align-items: center;\n background-color: ",";\n\n ","\n\n @media (max-width: ","px) {\n ","\n }\n"])),function(p){return p.defaultWidth;},function(p){return p.theme.palette.neutralQuaternaryAlt;},function(p){return p.applyRoundedCorners&&css$2(templateObject_21$2||(templateObject_21$2=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5));},maxScreenSize.medium,function(p){return p.defaultWidth>100&&css$2(templateObject_22$2||(templateObject_22$2=__makeTemplateObject(["\n width: auto;\n height: 100px;\n "],["\n width: auto;\n height: 100px;\n "])));});var FileIcon$1=_styled(Icon).withConfig({displayName:"PageItemTile__FileIcon",componentId:"sc-lcm8k6-12"})(templateObject_24$1||(templateObject_24$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n"],["\n font-size: ","px;\n color: ",";\n"])),function(p){return p.fontSize||30;},function(p){return p.color||p.theme.textColors.default;});var SmallBannerWrapper=_styled.div.withConfig({displayName:"PageItemTile__SmallBannerWrapper",componentId:"sc-lcm8k6-13"})(templateObject_26$1||(templateObject_26$1=__makeTemplateObject(["\n background-color: ",";\n\n width: ","px;\n height: 100%;\n\n .video-view-container {\n height: 100%;\n }\n\n &&& .video-icon {\n font-size: 35px;\n margin: 0;\n }\n\n ","\n"],["\n background-color: ",";\n\n width: ","px;\n height: 100%;\n\n .video-view-container {\n height: 100%;\n }\n\n &&& .video-icon {\n font-size: 35px;\n margin: 0;\n }\n\n ","\n"])),function(p){return p.theme.palette.accent;},function(p){return p.defaultWidth;},function(p){return p.applyRoundedCorners&&css$2(templateObject_25$1||(templateObject_25$1=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5));});var LargeBannerWrapper=_styled(LeftBannerWrapper).withConfig({displayName:"PageItemTile__LargeBannerWrapper",componentId:"sc-lcm8k6-14"})(templateObject_28$1||(templateObject_28$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.applyRoundedCorners&&css$2(templateObject_27$1||(templateObject_27$1=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5,true));});var templateObject_1$1S,templateObject_2$19,templateObject_3$M,templateObject_4$w,templateObject_5$t,templateObject_6$k,templateObject_7$e,templateObject_8$d,templateObject_9$b,templateObject_10$a,templateObject_11$6,templateObject_12$5,templateObject_13$4,templateObject_14$4,templateObject_15$4,templateObject_16$4,templateObject_17$3,templateObject_18$2,templateObject_19$2,templateObject_20$1,templateObject_21$2,templateObject_22$2,templateObject_23$2,templateObject_24$1,templateObject_25$1,templateObject_26$1,templateObject_27$1,templateObject_28$1;var global$1=global$m;var trim=stringTrim$1.trim;var whitespaces$4=whitespaces$3;var $parseInt=global$1.parseInt;var hex=/^[+-]?0[Xx]/;var FORCED=$parseInt(whitespaces$4+'08')!==8||$parseInt(whitespaces$4+'0x16')!==22;// `parseInt` method
|
|
131933
131936
|
// https://tc39.github.io/ecma262/#sec-parseint-string-radix
|
|
131934
131937
|
var numberParseInt=FORCED?function parseInt(string,radix){var S=trim(String(string));return $parseInt(S,radix>>>0||(hex.test(S)?16:10));}:$parseInt;var $$4=_export;var parseIntImplementation=numberParseInt;// `parseInt` method
|
|
131935
131938
|
// https://tc39.github.io/ecma262/#sec-parseint-string-radix
|
|
131936
|
-
$$4({global:true,forced:parseInt!=parseIntImplementation},{parseInt:parseIntImplementation});function getMaxImageWidth(defaultMaxWidth){return defaultMaxWidth!==null&&defaultMaxWidth!==void 0?defaultMaxWidth:maxContentWidth;}function getImageWidth(image){var width=typeof image==='string'?parseInt(image):image===null||image===void 0?void 0:image.width;if(!width||isNaN(width)){return getMaxImageWidth();}return Math.min(width,getMaxImageWidth());}function getNewsCardIcon(item,intl){if(hasFlag(item.knownState,KnownNewsState.Alert)){return {name:'Warning',backgroundColor:'red',tooltipText:intl.formatMessage({id:'NewsArticle.alert'})};}if(hasFlag(item.knownState,KnownNewsState.Unconfirmed)){return {name:'Completed',backgroundColor:'green',tooltipText:intl.formatMessage({id:'NewsArticle.confirmationRequired'})};}return null;}var ItemTileLayoutMode;(function(ItemTileLayoutMode){ItemTileLayoutMode["BannerTopMode"]="bannerTop";ItemTileLayoutMode["BannerLeftMode"]="bannerLeft";})(ItemTileLayoutMode||(ItemTileLayoutMode={}));var NewsItemTile=function NewsItemTile(_a){var item=_a.item,baseRoute=_a.baseRoute,layoutMode=_a.layoutMode,filterBaseUrl=_a.filterBaseUrl,dateLabelResourceKey=_a.dateLabelResourceKey,buttons=_a.buttons,openTargetInNewWindow=_a.openTargetInNewWindow,onClick=_a.onClick,onChannelClick=_a.onChannelClick,onKeywordClick=_a.onKeywordClick,styleDefinition=_a.styleDefinition,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUserContext().user;var token=useCurrentToken();var intl=useIntl();var features=useFeatures();var title=getTitle(item,user,intl.formatMessage);var headline=getHeadline(item,user);var language=NewsService.getLanguageForPublishableItem(item,user);var handleExternalContentClick=useExternalContentClickHandler();var targetRoute=NewsService.getNewsRouteWithRedirect(baseRoute,item.id,title,item.useExternalContent);var hasKeywords=Object.keys(item.keywords).length>0;var content=item.contents[language];var hasIntro=content.intro&&content.intro.length>0;var icon=getNewsCardIcon(item,intl);var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);return jsxs(Host$H,__assign({hasBanner:item.bannerInfo!=null,layoutMode:layoutMode,styleDefinition:styleDefinition,"data-item-id":item.id,className:className},{children:[!readOnly&&jsx$1(ClickableOverlay,{itemId:item.id,itemType:ItemResourceTypes.News,baseRoute:baseRoute,onClick:onClick,title:title,openTargetInNewWindow:openTargetInNewWindow,isExternalContent:item.useExternalContent},void 0),jsx$1(Banner$1$1,{item:item,token:item.fileAccessToken||token,resourceType:ItemResourceTypes.News,layoutMode:layoutMode,bannerDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerDefaultWidth,showPlaceholderIfNoBannerInfo:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo},void 0),jsxs(Content$5,{children:[jsxs(MetaInfoAndIcon,{children:[jsxs(MetaInfo$2,__assign({showChannelsToTheRight:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showChannelsToTheRight},{children:[dateLabelResourceKey&&jsxs(Fragment,{children:[jsx$1(FormattedMessage$1,{id:dateLabelResourceKey},void 0),":\u00A0"]},void 0),jsx$1(DateTime,{value:item.publishingDate},void 0),jsxs(Fragment,{children:["\u2002",jsx$1(StyledClickableChannelTitles,{channels:item.channels.map(function(c){return c.name;}),language:getPreferredContentLanguage(user),channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor,onClick:onChannelClick},void 0)]},void 0)]}),void 0),icon&&jsx$1(NewsCardIcon$1,{children:jsx$1(Tooltip,__assign({text:icon.tooltipText},{children:jsx$1(StyledIcon$4$1,{iconName:icon.name,backgroundColor:icon.backgroundColor},void 0)}),item.id+"-"+icon.name)},void 0)]},void 0),features.contentHeadline&&!!headline&&jsx$1(Headline$2,{children:headline},void 0),jsx$1(StyledTitle$2,{title:title,targetRoute:targetRoute,readOnly:readOnly,openTargetInNewWindow:openTargetInNewWindow,onClick:function(e){if(onClick){onClick(e,true);}else {handleExternalContentClick(e,item,ItemResourceTypes.News);}},isExternalContent:item.useExternalContent,resourceKey:"ExternalLinkButton.news.navigateTo",resourceValues:url},void 0),hasIntro&&jsx$1(Intro$1$1,{children:content.intro},void 0),hasKeywords&&jsx$1(StyledKeywords,{item:item,filterBaseUrl:filterBaseUrl,onClick:onKeywordClick},void 0),buttons&&jsx$1(Footer,__assign({alignItemsToTheRight:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showChannelsToTheRight},{children:buttons}),void 0)]},void 0)]}),void 0);};var Host$H=_styled.article.withConfig({displayName:"NewsItemTile__Host",componentId:"sc-15drgb8-0"})(templateObject_4$v||(templateObject_4$v=__makeTemplateObject(["\n ","\n ",";\n\n ","\n\n ","\n\n ","\n\n position: relative;\n"],["\n ","\n ",";\n\n ","\n\n ","\n\n ","\n\n position: relative;\n"])),function(p){var _a;return HostBaseStyle((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.backgroundColor);},function(p){var _a;return !((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.noShadow)&&CardBorderInline(2,2);},function(p){return p.hasBanner&&css$2(templateObject_1$1R||(templateObject_1$1R=__makeTemplateObject(["\n min-height: 138px;\n "],["\n min-height: 138px;\n "])));},function(p){return (!p.layoutMode||p.layoutMode===ItemTileLayoutMode.BannerLeftMode)&&css$2(templateObject_2$18||(templateObject_2$18=__makeTemplateObject(["\n @media (max-width: ","px) {\n flex-direction: column;\n }\n "],["\n @media (max-width: ","px) {\n flex-direction: column;\n }\n "])),maxScreenSize.medium);},function(p){return p.layoutMode===ItemTileLayoutMode.BannerTopMode&&css$2(templateObject_3$K||(templateObject_3$K=__makeTemplateObject(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])));});var StyledTitle$2=_styled(Title$7).withConfig({displayName:"NewsItemTile__StyledTitle",componentId:"sc-15drgb8-1"})(templateObject_5$s||(templateObject_5$s=__makeTemplateObject(["\n &&& {\n margin-right: auto;\n display: inline-flex;\n }\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n"],["\n &&& {\n margin-right: auto;\n display: inline-flex;\n }\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n"])),fontSizeMedium,fontSizeSmall);var Content$5=_styled.div.withConfig({displayName:"NewsItemTile__Content",componentId:"sc-15drgb8-2"})(templateObject_6$j||(templateObject_6$j=__makeTemplateObject(["\n ","\n padding: ","px;\n"],["\n ","\n padding: ","px;\n"])),ContentStyle,spacingM);var Headline$2=_styled.div.withConfig({displayName:"NewsItemTile__Headline",componentId:"sc-15drgb8-3"})(templateObject_7$d||(templateObject_7$d=__makeTemplateObject(["\n font-size: ","px;\n font-weight: bold;\n margin-bottom: ","px;\n"],["\n font-size: ","px;\n font-weight: bold;\n margin-bottom: ","px;\n"])),fontSizeSmall,spacingS);var Intro$1$1=_styled.p.withConfig({displayName:"NewsItemTile__Intro",componentId:"sc-15drgb8-4"})(templateObject_8$c||(templateObject_8$c=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n"],["\n margin: 0;\n font-size: ","px;\n"])),fontSizeNormal);var MetaInfoAndIcon=_styled.div.withConfig({displayName:"NewsItemTile__MetaInfoAndIcon",componentId:"sc-15drgb8-5"})(templateObject_9$a||(templateObject_9$a=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var MetaInfo$2=_styled.div.withConfig({displayName:"NewsItemTile__MetaInfo",componentId:"sc-15drgb8-6"})(templateObject_11$5||(templateObject_11$5=__makeTemplateObject(["\n ","\n color: ",";\n margin-bottom: ","px;\n\n ","\n"],["\n ","\n color: ",";\n margin-bottom: ","px;\n\n ","\n"])),MetaInfoStyle(),function(p){return p.theme.palette.neutralTertiary;},spacingS,function(p){return p.showChannelsToTheRight&&css$2(templateObject_10$9||(templateObject_10$9=__makeTemplateObject(["\n width: 100%;\n\n time {\n margin-right: auto;\n }\n "],["\n width: 100%;\n\n time {\n margin-right: auto;\n }\n "])));});var NewsCardIcon$1=_styled.div.withConfig({displayName:"NewsItemTile__NewsCardIcon",componentId:"sc-15drgb8-7"})(templateObject_12$4||(templateObject_12$4=__makeTemplateObject(["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"],["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"])));var StyledIcon$4$1=_styled(Icon).withConfig({displayName:"NewsItemTile__StyledIcon",componentId:"sc-15drgb8-8"})(templateObject_13$3||(templateObject_13$3=__makeTemplateObject(["\n font-size: ","px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ","px;\n cursor: pointer;\n\n background-color: ",";\n color: ",";\n"],["\n font-size: ","px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ","px;\n cursor: pointer;\n\n background-color: ",";\n color: ",";\n"])),fontSizeSmaller,spacingXs,function(p){return p.backgroundColor;},function(p){return p.theme.palette.white;});var StyledKeywords=_styled(FlatKeywords).withConfig({displayName:"NewsItemTile__StyledKeywords",componentId:"sc-15drgb8-9"})(templateObject_14$3||(templateObject_14$3=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n && a {\n &,\n :link,\n :visited {\n color: ",";\n }\n }\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n && a {\n &,\n :link,\n :visited {\n color: ",";\n }\n }\n"])),spacingS,fontSizeSmall,function(p){return p.theme.palette.neutralTertiary;});var Footer=_styled.footer.withConfig({displayName:"NewsItemTile__Footer",componentId:"sc-15drgb8-10"})(templateObject_16$3||(templateObject_16$3=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n margin-right: ","px;\n\n i {\n font-size: 22px;\n }\n }\n"],["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n margin-right: ","px;\n\n i {\n font-size: 22px;\n }\n }\n"])),spacingS,function(p){return p.alignItemsToTheRight&&css$2(templateObject_15$3||(templateObject_15$3=__makeTemplateObject(["\n justify-content: flex-end;\n "],["\n justify-content: flex-end;\n "])));},spacingS+5);var Banner$1$1=function Banner(_a){var item=_a.item,token=_a.token,resourceType=_a.resourceType,layoutMode=_a.layoutMode,bannerDefaultWidth=_a.bannerDefaultWidth,showPlaceholderIfNoBannerInfo=_a.showPlaceholderIfNoBannerInfo;var bannerInfo=item.bannerInfo;if(!bannerInfo&&!showPlaceholderIfNoBannerInfo){return null;}var banner=getBanner();return jsx$1("div",{children:banner},void 0);function getBanner(){if(layoutMode===ItemTileLayoutMode.BannerTopMode){return jsx$1(TopBannerWrapper,__assign({showPlaceholder:!bannerInfo&&showPlaceholderIfNoBannerInfo},{children:jsx$1(TopBannerInner,{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,width:getMaxImageWidth(),token:item.fileAccessToken||token,resourceType:resourceType},void 0)},void 0)}),void 0);}return jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerDefaultWidth!==null&&bannerDefaultWidth!==void 0?bannerDefaultWidth:150,showPlaceholder:!bannerInfo&&showPlaceholderIfNoBannerInfo},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,width:getMaxImageWidth(450),token:item.fileAccessToken||token,resourceType:resourceType},void 0)}),void 0);}};var TopBannerWrapper=_styled.div.withConfig({displayName:"NewsItemTile__TopBannerWrapper",componentId:"sc-15drgb8-11"})(templateObject_18$1||(templateObject_18$1=__makeTemplateObject(["\n position: relative;\n width: 100%;\n padding-top: calc(100% * (1 / ","));\n ","\n"],["\n position: relative;\n width: 100%;\n padding-top: calc(100% * (1 / ","));\n ","\n"])),bannerAspectRatio,function(p){return p.showPlaceholder&&css$2(templateObject_17$2||(templateObject_17$2=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.accent);});var TopBannerInner=_styled.div.withConfig({displayName:"NewsItemTile__TopBannerInner",componentId:"sc-15drgb8-12"})(templateObject_19$1||(templateObject_19$1=__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));var StyledClickableChannelTitles=_styled(ClickableChannelTitles).withConfig({displayName:"NewsItemTile__StyledClickableChannelTitles",componentId:"sc-15drgb8-13"})(templateObject_20$3||(templateObject_20$3=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var templateObject_1$1R,templateObject_2$18,templateObject_3$K,templateObject_4$v,templateObject_5$s,templateObject_6$j,templateObject_7$d,templateObject_8$c,templateObject_9$a,templateObject_10$9,templateObject_11$5,templateObject_12$4,templateObject_13$3,templateObject_14$3,templateObject_15$3,templateObject_16$3,templateObject_17$2,templateObject_18$1,templateObject_19$1,templateObject_20$3;var DocumentDownloadButton=function DocumentDownloadButton(_a){var _b;var page=_a.page,basePath=_a.basePath,onClick=_a.onClick,className=_a.className;var formatMessage=useIntl().formatMessage;var currentUser=useCurrentUser();var createDocumentClickHandler=usePagesClickHandler().createDocumentClickHandler;if(page.pageType!==PageType.Document){return null;}var _c=getContentForPage(page,currentUser),content=_c.content,language=_c.language;var fileInfo=content===null||content===void 0?void 0:content.fileInfo;var title=content===null||content===void 0?void 0:content.title;if(!fileInfo||!language){return null;}return jsx$1(StyledTooltip$1,__assign({resourceKey:'Pages.documents.downloadButton.tooltip',values:{fileName:title||fileInfo.fileName},className:className},{children:jsx$1(IconButton,{iconProps:{iconName:'Download'},onClick:createDocumentClickHandler(page.id,fileInfo.fileId,language,fileInfo.shouldOpenInBrowser,(_b=page)===null||_b===void 0?void 0:_b.fileAccessToken,basePath,onClick),ariaLabel:formatMessage({id:'Pages.documents.downloadButton.tooltip'},{fileName:title||fileInfo.fileName})},void 0)}),void 0);};var StyledTooltip$1=_styled(Tooltip).withConfig({displayName:"DocumentDownloadButton__StyledTooltip",componentId:"sc-1lgs2rp-0"})(templateObject_1$1Q||(templateObject_1$1Q=__makeTemplateObject(["\n display: inline-flex;\n\n > button {\n border: 0;\n padding: 0;\n height: 28px; // this is needed for the focus indicator\n\n i {\n color: ",";\n }\n }\n"],["\n display: inline-flex;\n\n > button {\n border: 0;\n padding: 0;\n height: 28px; // this is needed for the focus indicator\n\n i {\n color: ",";\n }\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1Q;var EmbeddedObjectTile=function EmbeddedObjectTile(_a){var _b;var id=_a.id,type=_a.type,readOnly=_a.readOnly,previewTheme=_a.previewTheme,buttons=_a.buttons,groupIds=_a.groupIds,className=_a.className;var getPost=usePostsApi().getPost;var getNews=useNewsApi().get;var loadPage=usePagesApi().loadPage;var getEvent=useEventsApi().getEvent;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _c=usePromise$2(fetchItem),item=_c[0],isLoading=_c[1],error=_c[2];var useDarkTheme=previewTheme==='dark';var palette=useContext(ThemeContext$1).theme.palette;var user=useCurrentUser();var backgroundColor=useDarkTheme?palette.neutralLight:palette.white;if(isLoading){return jsx$1(SpinnerHost,{children:jsx$1(StyledSpinner$2,{size:SpinnerSize.large},void 0)},void 0);}if(((_b=error===null||error===void 0?void 0:error.response)===null||_b===void 0?void 0:_b.statusCode)===403){return jsxs(Host$G,__assign({backgroundColor:backgroundColor,className:className,"data-warning-access-denied":true},{children:[buttons,jsx$1(EmbeddedObjectWarningTile,{iconName:"LockSolid",iconLabel:"Generic.noAccess",messageResourceKey:"Generic.noAccessReason"},void 0)]}),void 0);}if(error||!item){return jsxs(Host$G,__assign({backgroundColor:backgroundColor,className:className,"data-warning-not-found":true},{children:[buttons,jsx$1(EmbeddedObjectWarningTile,{iconName:"AlertSolid",iconLabel:"Generic.itemNotFound",messageResourceKey:"Generic.deletedItemReason"},void 0)]}),void 0);}var itemGroupIds=getItemGroupIds();return jsxs(Fragment,{children:[jsxs(Host$G,__assign({backgroundColor:backgroundColor,className:className,"data-embedded-object-id":id},{children:[buttons,renderEmbeddedObjectTile()]}),void 0),groupIds&&groupIds.every(function(gid){return !itemGroupIds.includes(gid);})&&jsx$1(DifferentGroupWarning,__assign({"data-warning-different-group":true},{children:jsx$1(EmbeddedObjectWarningTile,{messageResourceKey:"Generic.differentGroupWarning"},void 0)}),void 0)]},void 0);function getItemGroupIds(){var _a,_b;var groupIds=(_a=item)===null||_a===void 0?void 0:_a.groupIds;if(groupIds){return groupIds;}var groupId=(_b=item)===null||_b===void 0?void 0:_b.groupId;return groupId?[groupId]:null;}function fetchItem(){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:_a=type;switch(_a){case AttachmentType.Post:return [3/*break*/,1];case AttachmentType.News:return [3/*break*/,3];case AttachmentType.Page:return [3/*break*/,5];case AttachmentType.Event:return [3/*break*/,7];}return [3/*break*/,9];case 1:return [4/*yield*/,getPost(id)];case 2:return [2/*return*/,_b.sent()];case 3:return [4/*yield*/,getNews(id).toPromise()];case 4:return [2/*return*/,_b.sent()];case 5:return [4/*yield*/,loadPage(id)];case 6:return [2/*return*/,_b.sent()];case 7:return [4/*yield*/,getEvent(id)];case 8:return [2/*return*/,_b.sent()];case 9:throw Error('Invalid type');}});});}function renderEmbeddedObjectTile(){var _a;if(type===AttachmentType.Post){return jsx$1(PostItemTile,{post:item,backgroundColor:backgroundColor,readOnly:readOnly},void 0);}if(type===AttachmentType.News){var newsItem=item;return jsx$1(NewsItemTile,{item:newsItem,baseRoute:buildPath('news'),styleDefinition:{backgroundColor:backgroundColor,noShadow:true,channelsBackgroundColor:useDarkTheme&&palette.white},readOnly:readOnly},void 0);}if(type===AttachmentType.Page){var pageItem=item;return jsx$1(StyledPageItemTile$1,{item:pageItem,baseRoute:buildPath('pages'),styleDefinition:{backgroundColor:backgroundColor,bannerDefaultWidth:150,bannerFontSize:60},readOnly:readOnly,isBannerClickable:((_a=pageItem.bannerInfo)===null||_a===void 0?void 0:_a.type)==='video',additionalMetadata:jsx$1(StyledDocumentDownloadButton$3,{page:item,marginRight:readOnly?spacingM:0},void 0),showBreadcrumb:true,showIntro:true},void 0);}var language=NewsService.getLanguageForPublishableItem(item,user);return jsx$1(EventCard,{item:item,language:language,styleDefinition:{backgroundColor:backgroundColor,noShadow:true,channelsBackgroundColor:useDarkTheme&&palette.white,bannerHostWidth:150},readOnly:readOnly},void 0);}};var Host$G=_styled.div.withConfig({displayName:"EmbeddedObjectTile__Host",componentId:"sc-yfh5nh-0"})(templateObject_3$J||(templateObject_3$J=__makeTemplateObject(["\n width: 100%;\n ","\n"],["\n width: 100%;\n ","\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$1P||(templateObject_1$1P=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$17||(templateObject_2$17=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),function(p){return p.theme.palette.white;});});var DifferentGroupWarning=_styled.div.withConfig({displayName:"EmbeddedObjectTile__DifferentGroupWarning",componentId:"sc-yfh5nh-1"})(templateObject_4$u||(templateObject_4$u=__makeTemplateObject(["\n background-color: ",";\n color: ",";\n font-size: ","px;\n"],["\n background-color: ",";\n color: ",";\n font-size: ","px;\n"])),function(p){return p.theme.semanticColors.errorBackground;},function(p){return p.theme.palette.red;},fontSizeSmall);var EmbeddedObjectWarningTile=function EmbeddedObjectWarningTile(_a){var messageResourceKey=_a.messageResourceKey,iconName=_a.iconName,iconLabel=_a.iconLabel;return jsxs(WarningHost,{children:[(iconName||iconLabel)&&jsxs(Title$6,{children:[iconName&&jsx$1(StyleIcon,{iconName:iconName},void 0),iconLabel&&jsx$1(FormattedMessageWithStyle,{id:iconLabel},void 0)]},void 0),jsx$1(FormattedMessageWithStyle,{id:messageResourceKey},void 0)]},void 0);};var WarningHost=_styled.div.withConfig({displayName:"EmbeddedObjectTile__WarningHost",componentId:"sc-yfh5nh-2"})(templateObject_5$r||(templateObject_5$r=__makeTemplateObject(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingM);var Title$6=_styled.div.withConfig({displayName:"EmbeddedObjectTile__Title",componentId:"sc-yfh5nh-3"})(templateObject_6$i||(templateObject_6$i=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-weight: bold;\n font-size: ","px;\n margin-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n font-weight: bold;\n font-size: ","px;\n margin-bottom: ","px;\n"])),fontSizeMedium,spacingS);var SpinnerHost=_styled.div.withConfig({displayName:"EmbeddedObjectTile__SpinnerHost",componentId:"sc-yfh5nh-4"})(templateObject_7$c||(templateObject_7$c=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ","px;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ","px;\n"])),spacingL);var StyledSpinner$2=_styled(Spinner).withConfig({displayName:"EmbeddedObjectTile__StyledSpinner",componentId:"sc-yfh5nh-5"})(templateObject_8$b||(templateObject_8$b=__makeTemplateObject(["\n margin-top: 0;\n margin-bottom: ","px;\n"],["\n margin-top: 0;\n margin-bottom: ","px;\n"])),spacingL);var StyleIcon=_styled(Icon).withConfig({displayName:"EmbeddedObjectTile__StyleIcon",componentId:"sc-yfh5nh-6"})(templateObject_9$9||(templateObject_9$9=__makeTemplateObject(["\n padding-right: ","px;\n"],["\n padding-right: ","px;\n"])),spacingS);var StyledPageItemTile$1=_styled(PageItemTile).withConfig({displayName:"EmbeddedObjectTile__StyledPageItemTile",componentId:"sc-yfh5nh-7"})(templateObject_11$4||(templateObject_11$4=__makeTemplateObject(["\n ","\n\n @media (max-width: ","px) {\n > div {\n flex-direction: column;\n }\n\n [data-page-tile-content] {\n max-width: 100%;\n }\n }\n"],["\n ","\n\n @media (max-width: ","px) {\n > div {\n flex-direction: column;\n }\n\n [data-page-tile-content] {\n max-width: 100%;\n }\n }\n"])),function(p){return p.isBannerClickable&&css$2(templateObject_10$8||(templateObject_10$8=__makeTemplateObject(["\n [data-page-tile-content] {\n position: relative;\n }\n "],["\n [data-page-tile-content] {\n position: relative;\n }\n "])));},maxScreenSize.medium);var StyledDocumentDownloadButton$3=_styled(DocumentDownloadButton).withConfig({displayName:"EmbeddedObjectTile__StyledDocumentDownloadButton",componentId:"sc-yfh5nh-8"})(templateObject_12$3||(templateObject_12$3=__makeTemplateObject(["\n margin-left: auto;\n z-index: 1;\n\n > button i {\n margin: 0;\n color: ",";\n }\n\n margin-right: ","px;\n\n @media (max-width: ","px) {\n margin-right: 0;\n }\n"],["\n margin-left: auto;\n z-index: 1;\n\n > button i {\n margin: 0;\n color: ",";\n }\n\n margin-right: ","px;\n\n @media (max-width: ","px) {\n margin-right: 0;\n }\n"])),function(p){return p.theme.textColors.default;},function(p){return p.marginRight;},maxScreenSize.medium);var templateObject_1$1P,templateObject_2$17,templateObject_3$J,templateObject_4$u,templateObject_5$r,templateObject_6$i,templateObject_7$c,templateObject_8$b,templateObject_9$9,templateObject_10$8,templateObject_11$4,templateObject_12$3;var EmbeddedObjectList=function EmbeddedObjectList(_a){var attachments=_a.attachments,className=_a.className,onDeleteClick=_a.onDeleteClick,previewTheme=_a.previewTheme;var formatMessage=useIntl().formatMessage;var embeddedObjects=attachments.filter(function(f){return f.type===AttachmentType.Post||f.type===AttachmentType.News||f.type===AttachmentType.Page||f.type===AttachmentType.Event;});if(embeddedObjects.length===0){return null;}if(onDeleteClick){return jsx$1(Host$F,__assign({className:className,"data-embedded-object-attachment-list":true},{children:embeddedObjects.map(function(o){return jsx$1(AttachmentHost,__assign({domIdentifier:"embedded-object",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":o.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(o);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(EmbeddedObjectTile,{id:o.id,type:o.type,previewTheme:previewTheme,readOnly:true},o.id)}),o.id);})}),void 0);}return jsx$1(PreviewHost,__assign({className:className,domIdentifier:"embedded-object-preview-"+embeddedObjects[0].id},{children:jsx$1(EmbeddedObjectTile,{id:embeddedObjects[0].id,type:embeddedObjects[0].type,previewTheme:previewTheme},void 0)}),void 0);};var Host$F=_styled.div.withConfig({displayName:"EmbeddedObjectList__Host",componentId:"sc-axja9n-0"})(templateObject_1$1O||(templateObject_1$1O=__makeTemplateObject(["\n display: inline-flex;\n flex-wrap: wrap;\n width: 100%;\n\n > div {\n margin-top: ","px;\n }\n"],["\n display: inline-flex;\n flex-wrap: wrap;\n width: 100%;\n\n > div {\n margin-top: ","px;\n }\n"])),spacingM);var PreviewHost=_styled(AttachmentHost).withConfig({displayName:"EmbeddedObjectList__PreviewHost",componentId:"sc-axja9n-1"})(templateObject_2$16||(templateObject_2$16=__makeTemplateObject(["\n margin: ","px 0 0 0;\n\n /* ensure VFI is still visible for Embedded objects */\n [data-embedded-object-id] {\n a[data-clickable-overlay]:focus {\n &::before {\n outline-offset: -5px !important;\n border-radius: ","px;\n }\n }\n }\n"],["\n margin: ","px 0 0 0;\n\n /* ensure VFI is still visible for Embedded objects */\n [data-embedded-object-id] {\n a[data-clickable-overlay]:focus {\n &::before {\n outline-offset: -5px !important;\n border-radius: ","px;\n }\n }\n }\n"])),spacingM,attachmentRoundedCornerSize);var templateObject_1$1O,templateObject_2$16;var ImageAttachmentList=function ImageAttachmentList(_a){var images=_a.images,onDeleteClick=_a.onDeleteClick,disabled=_a.disabled,imageBackgroundColor=_a.imageBackgroundColor,className=_a.className;if(!images||images.length===0){return null;}return jsx$1(List,__assign({className:className},{children:images.map(function(i){return jsx$1(ListItem$1,{children:jsx$1(ImageAttachmentPreview,{attachment:i,disabled:disabled,onDeleteClick:function(){return onDeleteClick(i);},backgroundColor:imageBackgroundColor},void 0)},i.id);})}),void 0);};var List=_styled.ul.withConfig({displayName:"ImageAttachmentList__List",componentId:"sc-7el1kj-0"})(templateObject_1$1N||(templateObject_1$1N=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n margin: 0;\n padding: 0;\n list-style: none;\n"],["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n margin: 0;\n padding: 0;\n list-style: none;\n"])));var ListItem$1=_styled.li.withConfig({displayName:"ImageAttachmentList__ListItem",componentId:"sc-7el1kj-1"})(templateObject_2$15||(templateObject_2$15=__makeTemplateObject(["\n width: calc(100% - ","px);\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n }\n"],["\n width: calc(100% - ","px);\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n }\n"])),spacingS-5,minScreenSize.medium,spacingS-5);var ImageAttachmentPreview=function ImageAttachmentPreview(_a){var attachment=_a.attachment,onDeleteClick=_a.onDeleteClick,disabled=_a.disabled,backgroundColor=_a.backgroundColor;var formatMessage=useIntl().formatMessage;return jsxs(AttachmentHost,__assign({domIdentifier:"image",backgroundColor:backgroundColor,deleteButton:!disabled&&jsx$1(StyledDeleteAttachmentButton,{iconProps:{iconName:'Delete'},onClick:onDeleteClick,disabled:attachment.isUploadInProgress,ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:[attachment.hasError&&jsx$1(AttachmentOverlay,{children:jsx$1("div",{children:jsx$1(WarningIcon,{iconName:"Warning"},void 0)},void 0)},void 0),attachment.isUploadInProgress&&jsx$1(AttachmentOverlay,{children:jsx$1(CenteredSpinner,{size:SpinnerSize.large},void 0)},void 0),jsx$1(Image$1,{src:attachment.previewUrl,height:225,imageFit:ImageFit.centerCover,title:attachment.filename},void 0)]}),void 0);};var AttachmentOverlay=_styled.div.withConfig({displayName:"ImageAttachmentList__AttachmentOverlay",componentId:"sc-7el1kj-2"})(templateObject_3$I||(templateObject_3$I=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n\n background-color: rgba(146, 146, 146, 0.33);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: ","px;\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n\n background-color: rgba(146, 146, 146, 0.33);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: ","px;\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n"])),attachmentRoundedCornerSize);var CenteredSpinner=_styled(Spinner).withConfig({displayName:"ImageAttachmentList__CenteredSpinner",componentId:"sc-7el1kj-3"})(templateObject_4$t||(templateObject_4$t=__makeTemplateObject(["\n margin-top: auto;\n height: 100%;\n"],["\n margin-top: auto;\n height: 100%;\n"])));var WarningIcon=_styled(Icon).withConfig({displayName:"ImageAttachmentList__WarningIcon",componentId:"sc-7el1kj-4"})(templateObject_5$q||(templateObject_5$q=__makeTemplateObject(["\n font-size: 100px;\n color: ",";\n"],["\n font-size: 100px;\n color: ",";\n"])),function(p){return p.theme.palette.redDark;});var StyledDeleteAttachmentButton=_styled(DeleteAttachmentButton).withConfig({displayName:"ImageAttachmentList__StyledDeleteAttachmentButton",componentId:"sc-7el1kj-5"})(templateObject_6$h||(templateObject_6$h=__makeTemplateObject(["\n && {\n i {\n font-size: ","px;\n margin: 0;\n }\n }\n"],["\n && {\n i {\n font-size: ","px;\n margin: 0;\n }\n }\n"])),fontSizeMedium);var templateObject_1$1N,templateObject_2$15,templateObject_3$I,templateObject_4$t,templateObject_5$q,templateObject_6$h;var AttachmentList=function AttachmentList(_a){var className=_a.className,files=_a.files,onDeleteAttachmentClick=_a.onDeleteAttachmentClick,disabled=_a.disabled,previewTheme=_a.previewTheme,disableVideoPreview=_a.disableVideoPreview,disableEmbeddedObjectPreview=_a.disableEmbeddedObjectPreview;var attachedImages=files.filter(function(f){return f.type===AttachmentType.Image;});var attachedFiles=files.filter(function(f){return f.type===AttachmentType.File;});var palette=useContext(ThemeContext$1).theme.palette;return jsxs(Host$E,__assign({className:className,"data-attachment-list":true},{children:[jsx$1(GifEditList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);},previewTheme:previewTheme},void 0),jsx$1(ImageAttachmentList,{images:attachedImages,disabled:disabled,onDeleteClick:function(i){return onDeleteAttachmentClick(i);},imageBackgroundColor:previewTheme==='dark'?palette.neutralLight:palette.white},void 0),!disableVideoPreview&&jsx$1(VideoList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);}},void 0),!disableEmbeddedObjectPreview&&jsx$1(EmbeddedObjectList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);},previewTheme:previewTheme},void 0),jsx$1(FilesList$1,{files:attachedFiles,onDeleteClick:function(f){return onDeleteAttachmentClick(f);},disabled:disabled},void 0),jsx$1("div",{style:{clear:'both'}},void 0)]}),void 0);};var FilesList$1=_styled(FileAttachmentList).withConfig({displayName:"AttachmentList__FilesList",componentId:"sc-1s0cqp9-0"})(templateObject_1$1M||(templateObject_1$1M=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var Host$E=_styled.div.withConfig({displayName:"AttachmentList__Host",componentId:"sc-1s0cqp9-1"})(templateObject_2$14||(templateObject_2$14=__makeTemplateObject([""],[""])));var templateObject_1$1M,templateObject_2$14;var RichCommentInputWithAttachmentList=/*#__PURE__*/forwardRef(function(props,ref){return jsxs(Fragment,{children:[jsx$1(RichCommentInput,__assign({},props,{ref:ref}),void 0),jsx$1(AttachmentList,{files:props.attachments,disabled:props.disabled,onDeleteAttachmentClick:props.onDeleteAttachment,previewTheme:props.attachmentPreviewTheme,disableVideoPreview:props.disableVideoPreview,disableEmbeddedObjectPreview:props.disableEmbeddedObjectPreview},void 0)]},void 0);});var KeywordPickerGroup=function KeywordPickerGroup(_a){var group=_a.group,keywords=_a.keywords,expanded=_a.expanded,selectedKeywords=_a.selectedKeywords,onChange=_a.onChange,mandatoryKeywordIds=_a.mandatoryKeywordIds;var _b=useState$2(null),isExpanded=_b[0],setIsExpanded=_b[1];var isSelected=!!selectedKeywords.find(function(k){return k.groupId===group.id;});var isCollapsed=!(isExpanded===true||expanded);return jsxs(Host$D,{children:[jsxs(GroupButton,__assign({onClick:toggle,iconProps:{iconName:isCollapsed?'CaretRightSolid8':'CaretDownSolid8'},"aria-expanded":!isCollapsed,"aria-controls":group.name+"-list"},{children:[isSelected&&jsx$1(CheckMarkIcon,{iconName:"CheckMark"},void 0),jsx$1(ButtonLabel,__assign({"data-keyword-group":group.name,isSelected:isSelected},{children:jsx$1(KeywordTitle,{groupName:group.name},void 0)}),void 0)]}),void 0),jsx$1(KeywordsList,__assign({id:group.name+"-list","data-keyword-picker-group-list":true,isCollapsed:isCollapsed},{children:keywords.map(function(k){var checked=isKeywordSelected(k);var disabled=isKeywordDisabled(k);return jsx$1(KeywordItem,__assign({"data-keyword":k.name,"data-is-checked":checked,"data-is-disabled":disabled},{children:jsx$1(Checkbox,{label:k.name,onRenderLabel:function(){return jsx$1(KeywordTitle,{groupName:group.name,keywordName:k.name},void 0);},checked:checked,onChange:function(_e,isChecked){return handleChange(isChecked,k);},disabled:disabled},k.id)}),k.name);})}),void 0)]},void 0);function toggle(){setIsExpanded(!isExpanded);}function isKeywordSelected(keyword){return !!selectedKeywords.find(function(k){return k.id===keyword.id;});}function isKeywordDisabled(keyword){return mandatoryKeywordIds===null||mandatoryKeywordIds===void 0?void 0:mandatoryKeywordIds.some(function(id){return id===keyword.id;});}function handleChange(add,keyword){if(onChange){var result=selectedKeywords.filter(function(k){return keyword.id!==k.id;});if(add){result.push(keyword);}onChange(result);}}};var Host$D=_styled.div.withConfig({displayName:"KeywordPickerGroup__Host",componentId:"sc-pu16jm-0"})(templateObject_1$1L||(templateObject_1$1L=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var GroupButton=_styled(ActionButton).withConfig({displayName:"KeywordPickerGroup__GroupButton",componentId:"sc-pu16jm-1"})(templateObject_2$13||(templateObject_2$13=__makeTemplateObject(["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"],["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"])),fontSizeNormal,fontSizeSmall);var CheckMarkIcon=_styled(Icon).withConfig({displayName:"KeywordPickerGroup__CheckMarkIcon",componentId:"sc-pu16jm-2"})(templateObject_3$H||(templateObject_3$H=__makeTemplateObject(["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"],["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"])));var ButtonLabel=_styled.span.withConfig({displayName:"KeywordPickerGroup__ButtonLabel",componentId:"sc-pu16jm-3"})(templateObject_5$p||(templateObject_5$p=__makeTemplateObject(["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"],["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"])),function(p){return !p.isSelected&&css$2(templateObject_4$s||(templateObject_4$s=__makeTemplateObject(["\n margin-left: 33px; // checkmark icon space\n "],["\n margin-left: 33px; // checkmark icon space\n "])));});var KeywordsList=_styled.ul.withConfig({displayName:"KeywordPickerGroup__KeywordsList",componentId:"sc-pu16jm-4"})(templateObject_7$b||(templateObject_7$b=__makeTemplateObject(["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"],["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"])),function(p){return p.isCollapsed&&css$2(templateObject_6$g||(templateObject_6$g=__makeTemplateObject(["\n display: none;\n "],["\n display: none;\n "])));},spacingX+10);var KeywordItem=_styled.li.withConfig({displayName:"KeywordPickerGroup__KeywordItem",componentId:"sc-pu16jm-5"})(templateObject_8$a||(templateObject_8$a=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"],["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"])));var templateObject_1$1L,templateObject_2$13,templateObject_3$H,templateObject_4$s,templateObject_5$p,templateObject_6$g,templateObject_7$b,templateObject_8$a;var KeywordPicker=function KeywordPicker(_a){var _b;var value=_a.value,onChange=_a.onChange,showSelectionToggle=_a.showSelectionToggle,incomingAvailableKeywords=_a.availableKeywords,mandatoryKeywordIds=_a.mandatoryKeywordIds,className=_a.className;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var _c=useContext(LazySubscriptionContext),allKeywords=_c.allKeywords,selectedKeywordGroups=_c.selectedKeywordGroups;var _d=useState$2(null),searchedKeywords=_d[0],setSearchedKeywords=_d[1];var _e=useState$2(null),searchText=_e[0],setSearchText=_e[1];var selectedKeywords=getSelectedKeywords();var availableKeywords=incomingAvailableKeywords!==null&&incomingAvailableKeywords!==void 0?incomingAvailableKeywords:allKeywords;var visibleKeywords=(_b=searchedKeywords!==null&&searchedKeywords!==void 0?searchedKeywords:availableKeywords)!==null&&_b!==void 0?_b:[];var mandatoryKeywords=mandatoryKeywordIds?availableKeywords.filter(function(k){return mandatoryKeywordIds.includes(k.id);}):[];var noKeywordGroups=(selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.length)===0;var noAvailableKeywords=!noKeywordGroups&&(availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.length)===0;var isEmpty=visibleKeywords.length===0;return jsxs(Host$C,__assign({className:classNames('keyword-picker',className)},{children:[(noKeywordGroups||noAvailableKeywords)&&jsx$1("span",__assign({className:"keyword-picker-empty"},{children:jsx$1(FormattedMessage$1,{id:noKeywordGroups?'KeywordPicker.noGroupsDefined':'KeywordPicker.noAvailableKeywordsForGroup'},void 0)}),void 0),!noKeywordGroups&&!noAvailableKeywords&&jsxs("div",{children:[jsxs(SearchHost,__assign({className:"keyword-picker-search","data-keyword-picker-search":true},{children:[jsx$1(TextField,{onChange:handleSearch,value:searchText||'',placeholder:formatMessage({id:'KeywordPicker.search'})},void 0),searchText&&jsx$1(SearchCancelButton,{iconProps:{iconName:'Cancel'},onClick:function(){return handleSearch(null,null);},"aria-hidden":"true"},void 0)]}),void 0),showSelectionToggle&&jsx$1(StyledToggleAllButtons$1,{toggleAll:handleToggleAll},void 0),jsxs(KeywordPickerTree,__assign({className:"keyword-picker-tree"},{children:[isEmpty&&jsx$1(FormattedMessage$1,{id:"KeywordPicker.emptySearch"},void 0),!isEmpty&&selectedKeywordGroups&&selectedKeywordGroups.sort(function(a,b){return a.name.localeCompare(b.name);}).map(function(g){var keywords=visibleKeywords.filter(function(k){return k.groupId===g.id;});return keywords.length===0?null:jsx$1(KeywordPickerGroup,{expanded:!!searchText,group:g,keywords:keywords,selectedKeywords:selectedKeywords,onChange:onChange,mandatoryKeywordIds:mandatoryKeywordIds},g.id);})]}),void 0)]},void 0)]}),void 0);function getSelectedKeywords(){if(value==null||allKeywords==null){return [];}return value.map(function(k){return typeof k==='string'?allKeywords.find(function(a){return a.id===k;}):k;}).filter(function(k){return k;});}function handleSearch(_,text){var hasSearch=text&&text.length;var keywords=hasSearch?availableKeywords.filter(function(k){return getKeywordTitle(user,k.translations,k.name).toLocaleLowerCase().indexOf(text.toLocaleLowerCase())>=0;}):availableKeywords;setSearchedKeywords(keywords);setSearchText(hasSearch?text:null);}function handleToggleAll(checkAll){onChange(checkAll?availableKeywords:mandatoryKeywords);}};var KeywordPickerTree=_styled.div.withConfig({displayName:"KeywordPicker__KeywordPickerTree",componentId:"sc-1ejjfwa-0"})(templateObject_1$1K||(templateObject_1$1K=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var StyledToggleAllButtons$1=_styled(ToggleAllButtons).withConfig({displayName:"KeywordPicker__StyledToggleAllButtons",componentId:"sc-1ejjfwa-1"})(templateObject_2$12||(templateObject_2$12=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var Host$C=_styled.div.withConfig({displayName:"KeywordPicker__Host",componentId:"sc-1ejjfwa-2"})(templateObject_3$G||(templateObject_3$G=__makeTemplateObject(["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"],["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"])));var SearchHost=_styled.div.withConfig({displayName:"KeywordPicker__SearchHost",componentId:"sc-1ejjfwa-3"})(templateObject_4$r||(templateObject_4$r=__makeTemplateObject(["\n position: relative;\n margin-bottom: 8px;\n"],["\n position: relative;\n margin-bottom: 8px;\n"])));var SearchCancelButton=_styled(IconButton).withConfig({displayName:"KeywordPicker__SearchCancelButton",componentId:"sc-1ejjfwa-4"})(templateObject_5$o||(templateObject_5$o=__makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"],["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"])));var templateObject_1$1K,templateObject_2$12,templateObject_3$G,templateObject_4$r,templateObject_5$o;var AddKeywordsButton=function AddKeywordsButton(_a){var availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,preselectedKeywords=_a.preselectedKeywords,onKeywordsChange=_a.onKeywordsChange,disabled=_a.disabled,keywordPickerTitleResourceKey=_a.keywordPickerTitleResourceKey;var features=useFeatures();var formatMessage=useIntl().formatMessage;var refButton=useRef$1();var _b=useState$2(false),showKeywordsPicker=_b[0],setShowKeywordsPicker=_b[1];var _c=useState$2(preselectedKeywords!==null&&preselectedKeywords!==void 0?preselectedKeywords:[]),selectedKeywords=_c[0],setSelectedKeywords=_c[1];if(!features.keywords){return null;}var calloutTitleId="keywordPickerTitle-"+createId();return jsxs("div",{children:[jsx$1("div",__assign({ref:refButton},{children:jsx$1(IconButton,{iconProps:{iconName:'Tag'},onClick:function(){setShowKeywordsPicker(!showKeywordsPicker);},disabled:disabled,"data-button-type":"keywords",ariaLabel:formatMessage({id:'AriaLabel.keywordsButton'})},void 0)}),void 0),showKeywordsPicker&&(jsxs(Callout,__assign({target:refButton.current,directionalHint:DirectionalHint.bottomCenter,ariaLabelledBy:keywordPickerTitleResourceKey?calloutTitleId:null,calloutWidth:300,styles:{calloutMain:{padding:spacingM}}},{children:[keywordPickerTitleResourceKey&&jsx$1(Title$5,__assign({id:calloutTitleId},{children:jsx$1(FormattedMessage$1,{id:keywordPickerTitleResourceKey},void 0)}),void 0),jsx$1(KeywordPicker,{showSelectionToggle:true,value:selectedKeywords,onChange:function(keywords){return setSelectedKeywords(keywords);},availableKeywords:availableKeywords,mandatoryKeywordIds:mandatoryKeywords===null||mandatoryKeywords===void 0?void 0:mandatoryKeywords.map(function(k){return k.id;})},void 0),jsx$1(Buttons$2,{onDismiss:handleOnDismiss,onSave:handleOnSave},void 0)]}),void 0))]},void 0);function handleOnDismiss(){setShowKeywordsPicker(false);}function handleOnSave(){onKeywordsChange(selectedKeywords);setShowKeywordsPicker(false);}};var Title$5=_styled.div.withConfig({displayName:"AddKeywordsButton__Title",componentId:"sc-l8ish9-0"})(templateObject_1$1J||(templateObject_1$1J=__makeTemplateObject(["\n font-weight: bold;\n margin-bottom: ","px;\n font-size: ","px;\n"],["\n font-weight: bold;\n margin-bottom: ","px;\n font-size: ","px;\n"])),spacingM,fontSizeMedium);var Buttons$2=function Buttons(_a){var onSave=_a.onSave,onDismiss=_a.onDismiss;return jsxs(ButtonsContainer$1,{children:[jsx$1(DefaultButton,__assign({onClick:onDismiss},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0),jsx$1(PrimaryButton,__assign({onClick:onSave},{children:jsx$1(FormattedMessage$1,{id:"Generic.Save"},void 0)}),void 0)]},void 0);};var ButtonsContainer$1=_styled.div.withConfig({displayName:"AddKeywordsButton__ButtonsContainer",componentId:"sc-l8ish9-1"})(templateObject_2$11||(templateObject_2$11=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n margin-top: ","px;\n\n > button {\n flex: 1;\n }\n"],["\n display: flex;\n gap: ","px;\n margin-top: ","px;\n\n > button {\n flex: 1;\n }\n"])),spacingM,spacingM);var templateObject_1$1J,templateObject_2$11;var CreateComment=function CreateComment(_a){var className=_a.className,onPost=_a.onPost,autoFocus=_a.autoFocus,readOnly=_a.readOnly,initialContent=_a.content,allowAttachments=_a.allowAttachments,mentionSearchHandler=_a.mentionSearchHandler,useLargeDropTarget=_a.useLargeDropTarget,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues,_b=_a.focusAfterPost,focusAfterPost=_b===void 0?true:_b,onAttachmentsChanged=_a.onAttachmentsChanged,_c=_a.attachments,attachments=_c===void 0?[]:_c,deletedAttachmentUrls=_a.deletedAttachmentUrls,onDeleteAttachment=_a.onDeleteAttachment,disableDragAndDrop=_a.disableDragAndDrop,allowKeywords=_a.allowKeywords,allowSaveWithoutContent=_a.allowSaveWithoutContent,saveOnEnter=_a.saveOnEnter,saveOnCtrlEnter=_a.saveOnCtrlEnter,keywordSettings=_a.keywordSettings,disableBoxShadow=_a.disableBoxShadow,ariaLabel=_a.ariaLabel;var availableKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.availableKeywords)||[];var defaultKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.defaultKeywords)||[];var mandatoryKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.mandatoryKeywords)||[];var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(initialContent||''),content=_e[0],setContent=_e[1];var _f=useState$2(null),selectedKeywords=_f[0],setSelectedKeywords=_f[1];var inputRef=useRef$1(null);var formatMessage=useIntl().formatMessage;var isReadOnly=readOnly||isSaving;var ignoreRef=useRef$1(false);useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var initialSelectedKeywords=defaultKeywords.concat(mandatoryKeywords);var initialSelectedKeywordIds=initialSelectedKeywords.map(function(k){return k.id;}).join('-');useEffect$1(function(){setSelectedKeywords(initialSelectedKeywords);},[initialSelectedKeywordIds]);return jsx$1("div",__assign({className:className,"data-comment":"create"},{children:jsx$1(RichCommentInputWithAttachmentList,{ref:inputRef,content:content,attachments:attachments,deletedAttachmentUrls:deletedAttachmentUrls,onAttachmentsChange:onAttachmentsChanged,onDeleteAttachment:onDeleteAttachment,onEnter:saveOnEnter&&handleSave,onCtrlEnter:saveOnCtrlEnter&&handleSave,onChange:function(value){return setContent(value);},disabled:isReadOnly,autoFocus:autoFocus,mentionSearchHandler:mentionSearchHandler,allowAttachments:allowAttachments,disableDragAndDrop:disableDragAndDrop,useLargeDropTarget:useLargeDropTarget,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,disableBoxShadow:disableBoxShadow,ariaLabel:ariaLabel,additionalInputControl:selectedKeywords&&jsx$1("div",{children:selectedKeywords.map(function(k){return k.name;})},void 0),buttons:{leftSide:allowKeywords&&jsx$1(AddKeywordsButton,{availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,preselectedKeywords:selectedKeywords,onKeywordsChange:function(keywords){return setSelectedKeywords(keywords);},disabled:isReadOnly,keywordPickerTitleResourceKey:"Post.keywords.title"},void 0),rightSide:jsx$1(IconButton,{iconProps:{iconName:'Send'},disabled:isSaveDisabled(),onClick:handleSave,"data-button-type":"save",ariaLabel:formatMessage({id:'AriaLabel.sendButton'})},'saveButton'+isSaveDisabled())}},void 0)}),void 0);function handleSave(){return __awaiter(this,void 0,void 0,function(){var groupedKeywords;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaveDisabled()){return [2/*return*/];}setIsSaving(true);groupedKeywords=getGroupedKeywords(selectedKeywords);return [4/*yield*/,onPost({content:content.trim()},groupedKeywords)];case 1:_a.sent();setSelectedKeywords(defaultKeywords||[]);if(!ignoreRef.current){setIsSaving(false);setContent('');if(focusAfterPost){inputRef.current.focus();}}return [2/*return*/];}});});}function isSaveDisabled(){return isReadOnly||!canSaveInput(allowSaveWithoutContent,attachments,content);}};var gutter=2;_styled.div.withConfig({displayName:"LegacyPostPhotoGallery__Gallery",componentId:"sc-ir1n2k-0"})(templateObject_1$1I||(templateObject_1$1I=__makeTemplateObject(["\n overflow: hidden;\n\n margin-left: -","px;\n margin-right: -","px;\n"],["\n overflow: hidden;\n\n margin-left: -","px;\n margin-right: -","px;\n"])),gutter,gutter);_styled.a.withConfig({displayName:"LegacyPostPhotoGallery__ImageItem",componentId:"sc-ir1n2k-1"})(templateObject_2$10||(templateObject_2$10=__makeTemplateObject(["\n background-color: #eee;\n box-sizing: border-box;\n float: left;\n margin: ","px;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 200px;\n cursor: pointer;\n\n :hover {\n opacity: 0.9;\n }\n\n > * {\n height: 100%;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n height: 200px;\n }\n\n @media (min-width: ","px) {\n width: calc(25% - ","px);\n height: 150px;\n }\n"],["\n background-color: #eee;\n box-sizing: border-box;\n float: left;\n margin: ","px;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 200px;\n cursor: pointer;\n\n :hover {\n opacity: 0.9;\n }\n\n > * {\n height: 100%;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n height: 200px;\n }\n\n @media (min-width: ","px) {\n width: calc(25% - ","px);\n height: 150px;\n }\n"])),gutter,minScreenSize.small,gutter*2,minScreenSize.medium,gutter*2);var templateObject_1$1I,templateObject_2$10;var ImagesAndFilesList=function ImagesAndFilesList(_a){var item=_a.item,basePath=_a.basePath,imagesGridBackgroundColor=_a.imagesGridBackgroundColor,className=_a.className;var user=useCurrentUser();var _b=useAttachmentsApi(),getImageUrl=_b.getImageUrl,getFileUrl=_b.getFileUrl;var subscriptionId=user.subscription.id;var files=item.attachments.filter(function(a){return a.type===AttachmentType.File;});var images=item.attachments.filter(function(a){return a.type===AttachmentType.Image;});var maxContentWidth=minScreenSize.medium-spacingX;var galleryDetails=useMemo(function(){var galleryImages=images.map(function(a){var _a;return {previewUrl:(_a=a.previewUrl)!==null&&_a!==void 0?_a:getImageUrl(basePath,subscriptionId,item,a.id,maxContentWidth),imageId:a.id,width:a.width,height:a.height};});return {galleryId:createId(),images:galleryImages};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131939
|
+
$$4({global:true,forced:parseInt!=parseIntImplementation},{parseInt:parseIntImplementation});function getMaxImageWidth(defaultMaxWidth){return defaultMaxWidth!==null&&defaultMaxWidth!==void 0?defaultMaxWidth:maxContentWidth;}function getImageWidth(image){var width=typeof image==='string'?parseInt(image):image===null||image===void 0?void 0:image.width;if(!width||isNaN(width)){return getMaxImageWidth();}return Math.min(width,getMaxImageWidth());}function getNewsCardIcon(item,intl){if(hasFlag(item.knownState,KnownNewsState.Alert)){return {name:'Warning',backgroundColor:'red',tooltipText:intl.formatMessage({id:'NewsArticle.alert'})};}if(hasFlag(item.knownState,KnownNewsState.Unconfirmed)){return {name:'Completed',backgroundColor:'green',tooltipText:intl.formatMessage({id:'NewsArticle.confirmationRequired'})};}return null;}var ItemTileLayoutMode;(function(ItemTileLayoutMode){ItemTileLayoutMode["BannerTopMode"]="bannerTop";ItemTileLayoutMode["BannerLeftMode"]="bannerLeft";})(ItemTileLayoutMode||(ItemTileLayoutMode={}));var NewsItemTile=function NewsItemTile(_a){var item=_a.item,baseRoute=_a.baseRoute,layoutMode=_a.layoutMode,filterBaseUrl=_a.filterBaseUrl,dateLabelResourceKey=_a.dateLabelResourceKey,buttons=_a.buttons,openTargetInNewWindow=_a.openTargetInNewWindow,onClick=_a.onClick,onChannelClick=_a.onChannelClick,onKeywordClick=_a.onKeywordClick,styleDefinition=_a.styleDefinition,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUserContext().user;var token=useCurrentToken();var intl=useIntl();var features=useFeatures();var title=getTitle(item,user,intl.formatMessage);var headline=getHeadline(item,user);var language=NewsService.getLanguageForPublishableItem(item,user);var handleExternalContentClick=useExternalContentClickHandler();var targetRoute=NewsService.getNewsRouteWithRedirect(baseRoute,item.id,title,item.useExternalContent);var hasKeywords=Object.keys(item.keywords).length>0;var content=item.contents[language];var hasIntro=content.intro&&content.intro.length>0;var icon=getNewsCardIcon(item,intl);var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);return jsxs(Host$H,__assign({hasBanner:item.bannerInfo!=null,layoutMode:layoutMode,styleDefinition:styleDefinition,"data-item-id":item.id,className:className},{children:[!readOnly&&jsx$1(ClickableOverlay,{itemId:item.id,itemType:ItemResourceTypes.News,baseRoute:baseRoute,onClick:onClick,title:title,openTargetInNewWindow:openTargetInNewWindow,isExternalContent:item.useExternalContent},void 0),jsx$1(Banner$1$1,{item:item,token:item.fileAccessToken||token,resourceType:ItemResourceTypes.News,layoutMode:layoutMode,bannerDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerDefaultWidth,showPlaceholderIfNoBannerInfo:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo},void 0),jsxs(Content$5,{children:[jsxs(MetaInfoAndIcon,{children:[jsxs(MetaInfo$2,__assign({showChannelsToTheRight:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showChannelsToTheRight},{children:[dateLabelResourceKey&&jsxs(Fragment,{children:[jsx$1(FormattedMessage$1,{id:dateLabelResourceKey},void 0),":\u00A0"]},void 0),jsx$1(DateTime,{value:item.publishingDate},void 0),jsxs(Fragment,{children:["\u2002",jsx$1(StyledClickableChannelTitles,{channels:item.channels.map(function(c){return c.name;}),language:getPreferredContentLanguage(user),channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor,onClick:onChannelClick},void 0)]},void 0)]}),void 0),icon&&jsx$1(NewsCardIcon$1,{children:jsx$1(Tooltip,__assign({text:icon.tooltipText},{children:jsx$1(StyledIcon$4$1,{iconName:icon.name,backgroundColor:icon.backgroundColor},void 0)}),item.id+"-"+icon.name)},void 0)]},void 0),features.contentHeadline&&!!headline&&jsx$1(Headline$2,{children:headline},void 0),jsx$1(StyledTitle$2,{title:title,targetRoute:targetRoute,readOnly:readOnly,openTargetInNewWindow:openTargetInNewWindow,onClick:function(e){if(onClick){onClick(e,true);}else {handleExternalContentClick(e,item,ItemResourceTypes.News);}},isExternalContent:item.useExternalContent,resourceKey:"ExternalLinkButton.news.navigateTo",resourceValues:url},void 0),hasIntro&&jsx$1(Intro$1$1,{children:content.intro},void 0),hasKeywords&&jsx$1(StyledKeywords,{item:item,filterBaseUrl:filterBaseUrl,onClick:onKeywordClick},void 0),buttons&&jsx$1(Footer,__assign({alignItemsToTheRight:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showChannelsToTheRight},{children:buttons}),void 0)]},void 0)]}),void 0);};var Host$H=_styled.article.withConfig({displayName:"NewsItemTile__Host",componentId:"sc-15drgb8-0"})(templateObject_4$v||(templateObject_4$v=__makeTemplateObject(["\n ","\n ",";\n\n ","\n\n ","\n\n ","\n\n position: relative;\n"],["\n ","\n ",";\n\n ","\n\n ","\n\n ","\n\n position: relative;\n"])),function(p){var _a;return HostBaseStyle((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.backgroundColor);},function(p){var _a;return !((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.noShadow)&&CardBorderInline(2,2);},function(p){return p.hasBanner&&css$2(templateObject_1$1R||(templateObject_1$1R=__makeTemplateObject(["\n min-height: 138px;\n "],["\n min-height: 138px;\n "])));},function(p){return (!p.layoutMode||p.layoutMode===ItemTileLayoutMode.BannerLeftMode)&&css$2(templateObject_2$18||(templateObject_2$18=__makeTemplateObject(["\n @media (max-width: ","px) {\n flex-direction: column;\n }\n "],["\n @media (max-width: ","px) {\n flex-direction: column;\n }\n "])),maxScreenSize.medium);},function(p){return p.layoutMode===ItemTileLayoutMode.BannerTopMode&&css$2(templateObject_3$L||(templateObject_3$L=__makeTemplateObject(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])));});var StyledTitle$2=_styled(Title$7).withConfig({displayName:"NewsItemTile__StyledTitle",componentId:"sc-15drgb8-1"})(templateObject_5$s||(templateObject_5$s=__makeTemplateObject(["\n &&& {\n margin-right: auto;\n display: inline-flex;\n }\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n"],["\n &&& {\n margin-right: auto;\n display: inline-flex;\n }\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n"])),fontSizeMedium,fontSizeSmall);var Content$5=_styled.div.withConfig({displayName:"NewsItemTile__Content",componentId:"sc-15drgb8-2"})(templateObject_6$j||(templateObject_6$j=__makeTemplateObject(["\n ","\n padding: ","px;\n"],["\n ","\n padding: ","px;\n"])),ContentStyle,spacingM);var Headline$2=_styled.div.withConfig({displayName:"NewsItemTile__Headline",componentId:"sc-15drgb8-3"})(templateObject_7$d||(templateObject_7$d=__makeTemplateObject(["\n font-size: ","px;\n font-weight: bold;\n margin-bottom: ","px;\n"],["\n font-size: ","px;\n font-weight: bold;\n margin-bottom: ","px;\n"])),fontSizeSmall,spacingS);var Intro$1$1=_styled.p.withConfig({displayName:"NewsItemTile__Intro",componentId:"sc-15drgb8-4"})(templateObject_8$c||(templateObject_8$c=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n"],["\n margin: 0;\n font-size: ","px;\n"])),fontSizeNormal);var MetaInfoAndIcon=_styled.div.withConfig({displayName:"NewsItemTile__MetaInfoAndIcon",componentId:"sc-15drgb8-5"})(templateObject_9$a||(templateObject_9$a=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var MetaInfo$2=_styled.div.withConfig({displayName:"NewsItemTile__MetaInfo",componentId:"sc-15drgb8-6"})(templateObject_11$5||(templateObject_11$5=__makeTemplateObject(["\n ","\n color: ",";\n margin-bottom: ","px;\n\n ","\n"],["\n ","\n color: ",";\n margin-bottom: ","px;\n\n ","\n"])),MetaInfoStyle(),function(p){return p.theme.palette.neutralTertiary;},spacingS,function(p){return p.showChannelsToTheRight&&css$2(templateObject_10$9||(templateObject_10$9=__makeTemplateObject(["\n width: 100%;\n\n time {\n margin-right: auto;\n }\n "],["\n width: 100%;\n\n time {\n margin-right: auto;\n }\n "])));});var NewsCardIcon$1=_styled.div.withConfig({displayName:"NewsItemTile__NewsCardIcon",componentId:"sc-15drgb8-7"})(templateObject_12$4||(templateObject_12$4=__makeTemplateObject(["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"],["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"])));var StyledIcon$4$1=_styled(Icon).withConfig({displayName:"NewsItemTile__StyledIcon",componentId:"sc-15drgb8-8"})(templateObject_13$3||(templateObject_13$3=__makeTemplateObject(["\n font-size: ","px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ","px;\n cursor: pointer;\n\n background-color: ",";\n color: ",";\n"],["\n font-size: ","px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ","px;\n cursor: pointer;\n\n background-color: ",";\n color: ",";\n"])),fontSizeSmaller,spacingXs,function(p){return p.backgroundColor;},function(p){return p.theme.palette.white;});var StyledKeywords=_styled(FlatKeywords).withConfig({displayName:"NewsItemTile__StyledKeywords",componentId:"sc-15drgb8-9"})(templateObject_14$3||(templateObject_14$3=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n && a {\n &,\n :link,\n :visited {\n color: ",";\n }\n }\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n && a {\n &,\n :link,\n :visited {\n color: ",";\n }\n }\n"])),spacingS,fontSizeSmall,function(p){return p.theme.palette.neutralTertiary;});var Footer=_styled.footer.withConfig({displayName:"NewsItemTile__Footer",componentId:"sc-15drgb8-10"})(templateObject_16$3||(templateObject_16$3=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n margin-right: ","px;\n\n i {\n font-size: 22px;\n }\n }\n"],["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n margin-right: ","px;\n\n i {\n font-size: 22px;\n }\n }\n"])),spacingS,function(p){return p.alignItemsToTheRight&&css$2(templateObject_15$3||(templateObject_15$3=__makeTemplateObject(["\n justify-content: flex-end;\n "],["\n justify-content: flex-end;\n "])));},spacingS+5);var Banner$1$1=function Banner(_a){var item=_a.item,token=_a.token,resourceType=_a.resourceType,layoutMode=_a.layoutMode,bannerDefaultWidth=_a.bannerDefaultWidth,showPlaceholderIfNoBannerInfo=_a.showPlaceholderIfNoBannerInfo;var bannerInfo=item.bannerInfo;if(!bannerInfo&&!showPlaceholderIfNoBannerInfo){return null;}var banner=getBanner();return jsx$1("div",{children:banner},void 0);function getBanner(){if(layoutMode===ItemTileLayoutMode.BannerTopMode){return jsx$1(TopBannerWrapper,__assign({showPlaceholder:!bannerInfo&&showPlaceholderIfNoBannerInfo},{children:jsx$1(TopBannerInner,{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,width:getMaxImageWidth(),token:item.fileAccessToken||token,resourceType:resourceType},void 0)},void 0)}),void 0);}return jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerDefaultWidth!==null&&bannerDefaultWidth!==void 0?bannerDefaultWidth:150,showPlaceholder:!bannerInfo&&showPlaceholderIfNoBannerInfo},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,width:getMaxImageWidth(450),token:item.fileAccessToken||token,resourceType:resourceType},void 0)}),void 0);}};var TopBannerWrapper=_styled.div.withConfig({displayName:"NewsItemTile__TopBannerWrapper",componentId:"sc-15drgb8-11"})(templateObject_18$1||(templateObject_18$1=__makeTemplateObject(["\n position: relative;\n width: 100%;\n padding-top: calc(100% * (1 / ","));\n ","\n"],["\n position: relative;\n width: 100%;\n padding-top: calc(100% * (1 / ","));\n ","\n"])),bannerAspectRatio,function(p){return p.showPlaceholder&&css$2(templateObject_17$2||(templateObject_17$2=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.accent);});var TopBannerInner=_styled.div.withConfig({displayName:"NewsItemTile__TopBannerInner",componentId:"sc-15drgb8-12"})(templateObject_19$1||(templateObject_19$1=__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));var StyledClickableChannelTitles=_styled(ClickableChannelTitles).withConfig({displayName:"NewsItemTile__StyledClickableChannelTitles",componentId:"sc-15drgb8-13"})(templateObject_20$3||(templateObject_20$3=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var templateObject_1$1R,templateObject_2$18,templateObject_3$L,templateObject_4$v,templateObject_5$s,templateObject_6$j,templateObject_7$d,templateObject_8$c,templateObject_9$a,templateObject_10$9,templateObject_11$5,templateObject_12$4,templateObject_13$3,templateObject_14$3,templateObject_15$3,templateObject_16$3,templateObject_17$2,templateObject_18$1,templateObject_19$1,templateObject_20$3;var DocumentDownloadButton=function DocumentDownloadButton(_a){var _b;var page=_a.page,basePath=_a.basePath,onClick=_a.onClick,className=_a.className;var formatMessage=useIntl().formatMessage;var currentUser=useCurrentUser();var createDocumentClickHandler=usePagesClickHandler().createDocumentClickHandler;if(page.pageType!==PageType.Document){return null;}var _c=getContentForPage(page,currentUser),content=_c.content,language=_c.language;var fileInfo=content===null||content===void 0?void 0:content.fileInfo;var title=content===null||content===void 0?void 0:content.title;if(!fileInfo||!language){return null;}return jsx$1(StyledTooltip$1,__assign({resourceKey:'Pages.documents.downloadButton.tooltip',values:{fileName:title||fileInfo.fileName},className:className},{children:jsx$1(IconButton,{iconProps:{iconName:'Download'},onClick:createDocumentClickHandler(page.id,fileInfo.fileId,language,fileInfo.shouldOpenInBrowser,(_b=page)===null||_b===void 0?void 0:_b.fileAccessToken,basePath,onClick),ariaLabel:formatMessage({id:'Pages.documents.downloadButton.tooltip'},{fileName:title||fileInfo.fileName})},void 0)}),void 0);};var StyledTooltip$1=_styled(Tooltip).withConfig({displayName:"DocumentDownloadButton__StyledTooltip",componentId:"sc-1lgs2rp-0"})(templateObject_1$1Q||(templateObject_1$1Q=__makeTemplateObject(["\n display: inline-flex;\n\n > button {\n border: 0;\n padding: 0;\n height: 28px; // this is needed for the focus indicator\n\n i {\n color: ",";\n }\n }\n"],["\n display: inline-flex;\n\n > button {\n border: 0;\n padding: 0;\n height: 28px; // this is needed for the focus indicator\n\n i {\n color: ",";\n }\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1Q;var EmbeddedObjectTile=function EmbeddedObjectTile(_a){var _b;var id=_a.id,type=_a.type,readOnly=_a.readOnly,previewTheme=_a.previewTheme,buttons=_a.buttons,groupIds=_a.groupIds,className=_a.className;var getPost=usePostsApi().getPost;var getNews=useNewsApi().get;var loadPage=usePagesApi().loadPage;var getEvent=useEventsApi().getEvent;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _c=usePromise$2(fetchItem),item=_c[0],isLoading=_c[1],error=_c[2];var useDarkTheme=previewTheme==='dark';var palette=useContext(ThemeContext$1).theme.palette;var user=useCurrentUser();var backgroundColor=useDarkTheme?palette.neutralLight:palette.white;if(isLoading){return jsx$1(SpinnerHost,{children:jsx$1(StyledSpinner$2,{size:SpinnerSize.large},void 0)},void 0);}if(((_b=error===null||error===void 0?void 0:error.response)===null||_b===void 0?void 0:_b.statusCode)===403){return jsxs(Host$G,__assign({backgroundColor:backgroundColor,className:className,"data-warning-access-denied":true},{children:[buttons,jsx$1(EmbeddedObjectWarningTile,{iconName:"LockSolid",iconLabel:"Generic.noAccess",messageResourceKey:"Generic.noAccessReason"},void 0)]}),void 0);}if(error||!item){return jsxs(Host$G,__assign({backgroundColor:backgroundColor,className:className,"data-warning-not-found":true},{children:[buttons,jsx$1(EmbeddedObjectWarningTile,{iconName:"AlertSolid",iconLabel:"Generic.itemNotFound",messageResourceKey:"Generic.deletedItemReason"},void 0)]}),void 0);}var itemGroupIds=getItemGroupIds();return jsxs(Fragment,{children:[jsxs(Host$G,__assign({backgroundColor:backgroundColor,className:className,"data-embedded-object-id":id},{children:[buttons,renderEmbeddedObjectTile()]}),void 0),groupIds&&groupIds.every(function(gid){return !itemGroupIds.includes(gid);})&&jsx$1(DifferentGroupWarning,__assign({"data-warning-different-group":true},{children:jsx$1(EmbeddedObjectWarningTile,{messageResourceKey:"Generic.differentGroupWarning"},void 0)}),void 0)]},void 0);function getItemGroupIds(){var _a,_b;var groupIds=(_a=item)===null||_a===void 0?void 0:_a.groupIds;if(groupIds){return groupIds;}var groupId=(_b=item)===null||_b===void 0?void 0:_b.groupId;return groupId?[groupId]:null;}function fetchItem(){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:_a=type;switch(_a){case AttachmentType.Post:return [3/*break*/,1];case AttachmentType.News:return [3/*break*/,3];case AttachmentType.Page:return [3/*break*/,5];case AttachmentType.Event:return [3/*break*/,7];}return [3/*break*/,9];case 1:return [4/*yield*/,getPost(id)];case 2:return [2/*return*/,_b.sent()];case 3:return [4/*yield*/,getNews(id).toPromise()];case 4:return [2/*return*/,_b.sent()];case 5:return [4/*yield*/,loadPage(id)];case 6:return [2/*return*/,_b.sent()];case 7:return [4/*yield*/,getEvent(id)];case 8:return [2/*return*/,_b.sent()];case 9:throw Error('Invalid type');}});});}function renderEmbeddedObjectTile(){var _a;if(type===AttachmentType.Post){return jsx$1(PostItemTile,{post:item,backgroundColor:backgroundColor,readOnly:readOnly},void 0);}if(type===AttachmentType.News){var newsItem=item;return jsx$1(NewsItemTile,{item:newsItem,baseRoute:buildPath('news'),styleDefinition:{backgroundColor:backgroundColor,noShadow:true,channelsBackgroundColor:useDarkTheme&&palette.white},readOnly:readOnly},void 0);}if(type===AttachmentType.Page){var pageItem=item;return jsx$1(StyledPageItemTile$1,{item:pageItem,baseRoute:buildPath('pages'),styleDefinition:{backgroundColor:backgroundColor,bannerDefaultWidth:150,bannerFontSize:60},readOnly:readOnly,isBannerClickable:((_a=pageItem.bannerInfo)===null||_a===void 0?void 0:_a.type)==='video',additionalMetadata:jsx$1(StyledDocumentDownloadButton$3,{page:item,marginRight:readOnly?spacingM:0},void 0),showBreadcrumb:true,showIntro:true},void 0);}var language=NewsService.getLanguageForPublishableItem(item,user);return jsx$1(EventCard,{item:item,language:language,styleDefinition:{backgroundColor:backgroundColor,noShadow:true,channelsBackgroundColor:useDarkTheme&&palette.white,bannerHostWidth:150},readOnly:readOnly},void 0);}};var Host$G=_styled.div.withConfig({displayName:"EmbeddedObjectTile__Host",componentId:"sc-yfh5nh-0"})(templateObject_3$K||(templateObject_3$K=__makeTemplateObject(["\n width: 100%;\n ","\n"],["\n width: 100%;\n ","\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$1P||(templateObject_1$1P=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$17||(templateObject_2$17=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),function(p){return p.theme.palette.white;});});var DifferentGroupWarning=_styled.div.withConfig({displayName:"EmbeddedObjectTile__DifferentGroupWarning",componentId:"sc-yfh5nh-1"})(templateObject_4$u||(templateObject_4$u=__makeTemplateObject(["\n background-color: ",";\n color: ",";\n font-size: ","px;\n"],["\n background-color: ",";\n color: ",";\n font-size: ","px;\n"])),function(p){return p.theme.semanticColors.errorBackground;},function(p){return p.theme.palette.red;},fontSizeSmall);var EmbeddedObjectWarningTile=function EmbeddedObjectWarningTile(_a){var messageResourceKey=_a.messageResourceKey,iconName=_a.iconName,iconLabel=_a.iconLabel;return jsxs(WarningHost,{children:[(iconName||iconLabel)&&jsxs(Title$6,{children:[iconName&&jsx$1(StyleIcon,{iconName:iconName},void 0),iconLabel&&jsx$1(FormattedMessageWithStyle,{id:iconLabel},void 0)]},void 0),jsx$1(FormattedMessageWithStyle,{id:messageResourceKey},void 0)]},void 0);};var WarningHost=_styled.div.withConfig({displayName:"EmbeddedObjectTile__WarningHost",componentId:"sc-yfh5nh-2"})(templateObject_5$r||(templateObject_5$r=__makeTemplateObject(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingM);var Title$6=_styled.div.withConfig({displayName:"EmbeddedObjectTile__Title",componentId:"sc-yfh5nh-3"})(templateObject_6$i||(templateObject_6$i=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-weight: bold;\n font-size: ","px;\n margin-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n font-weight: bold;\n font-size: ","px;\n margin-bottom: ","px;\n"])),fontSizeMedium,spacingS);var SpinnerHost=_styled.div.withConfig({displayName:"EmbeddedObjectTile__SpinnerHost",componentId:"sc-yfh5nh-4"})(templateObject_7$c||(templateObject_7$c=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ","px;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ","px;\n"])),spacingL);var StyledSpinner$2=_styled(Spinner).withConfig({displayName:"EmbeddedObjectTile__StyledSpinner",componentId:"sc-yfh5nh-5"})(templateObject_8$b||(templateObject_8$b=__makeTemplateObject(["\n margin-top: 0;\n margin-bottom: ","px;\n"],["\n margin-top: 0;\n margin-bottom: ","px;\n"])),spacingL);var StyleIcon=_styled(Icon).withConfig({displayName:"EmbeddedObjectTile__StyleIcon",componentId:"sc-yfh5nh-6"})(templateObject_9$9||(templateObject_9$9=__makeTemplateObject(["\n padding-right: ","px;\n"],["\n padding-right: ","px;\n"])),spacingS);var StyledPageItemTile$1=_styled(PageItemTile).withConfig({displayName:"EmbeddedObjectTile__StyledPageItemTile",componentId:"sc-yfh5nh-7"})(templateObject_11$4||(templateObject_11$4=__makeTemplateObject(["\n ","\n\n @media (max-width: ","px) {\n > div {\n flex-direction: column;\n }\n\n [data-page-tile-content] {\n max-width: 100%;\n }\n }\n"],["\n ","\n\n @media (max-width: ","px) {\n > div {\n flex-direction: column;\n }\n\n [data-page-tile-content] {\n max-width: 100%;\n }\n }\n"])),function(p){return p.isBannerClickable&&css$2(templateObject_10$8||(templateObject_10$8=__makeTemplateObject(["\n [data-page-tile-content] {\n position: relative;\n }\n "],["\n [data-page-tile-content] {\n position: relative;\n }\n "])));},maxScreenSize.medium);var StyledDocumentDownloadButton$3=_styled(DocumentDownloadButton).withConfig({displayName:"EmbeddedObjectTile__StyledDocumentDownloadButton",componentId:"sc-yfh5nh-8"})(templateObject_12$3||(templateObject_12$3=__makeTemplateObject(["\n margin-left: auto;\n z-index: 1;\n\n > button i {\n margin: 0;\n color: ",";\n }\n\n margin-right: ","px;\n\n @media (max-width: ","px) {\n margin-right: 0;\n }\n"],["\n margin-left: auto;\n z-index: 1;\n\n > button i {\n margin: 0;\n color: ",";\n }\n\n margin-right: ","px;\n\n @media (max-width: ","px) {\n margin-right: 0;\n }\n"])),function(p){return p.theme.textColors.default;},function(p){return p.marginRight;},maxScreenSize.medium);var templateObject_1$1P,templateObject_2$17,templateObject_3$K,templateObject_4$u,templateObject_5$r,templateObject_6$i,templateObject_7$c,templateObject_8$b,templateObject_9$9,templateObject_10$8,templateObject_11$4,templateObject_12$3;var EmbeddedObjectList=function EmbeddedObjectList(_a){var attachments=_a.attachments,className=_a.className,onDeleteClick=_a.onDeleteClick,previewTheme=_a.previewTheme;var formatMessage=useIntl().formatMessage;var embeddedObjects=attachments.filter(function(f){return f.type===AttachmentType.Post||f.type===AttachmentType.News||f.type===AttachmentType.Page||f.type===AttachmentType.Event;});if(embeddedObjects.length===0){return null;}if(onDeleteClick){return jsx$1(Host$F,__assign({className:className,"data-embedded-object-attachment-list":true},{children:embeddedObjects.map(function(o){return jsx$1(AttachmentHost,__assign({domIdentifier:"embedded-object",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":o.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(o);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(EmbeddedObjectTile,{id:o.id,type:o.type,previewTheme:previewTheme,readOnly:true},o.id)}),o.id);})}),void 0);}return jsx$1(PreviewHost,__assign({className:className,domIdentifier:"embedded-object-preview-"+embeddedObjects[0].id},{children:jsx$1(EmbeddedObjectTile,{id:embeddedObjects[0].id,type:embeddedObjects[0].type,previewTheme:previewTheme},void 0)}),void 0);};var Host$F=_styled.div.withConfig({displayName:"EmbeddedObjectList__Host",componentId:"sc-axja9n-0"})(templateObject_1$1O||(templateObject_1$1O=__makeTemplateObject(["\n display: inline-flex;\n flex-wrap: wrap;\n width: 100%;\n\n > div {\n margin-top: ","px;\n }\n"],["\n display: inline-flex;\n flex-wrap: wrap;\n width: 100%;\n\n > div {\n margin-top: ","px;\n }\n"])),spacingM);var PreviewHost=_styled(AttachmentHost).withConfig({displayName:"EmbeddedObjectList__PreviewHost",componentId:"sc-axja9n-1"})(templateObject_2$16||(templateObject_2$16=__makeTemplateObject(["\n margin: ","px 0 0 0;\n\n /* ensure VFI is still visible for Embedded objects */\n [data-embedded-object-id] {\n a[data-clickable-overlay]:focus {\n &::before {\n outline-offset: -5px !important;\n border-radius: ","px;\n }\n }\n }\n"],["\n margin: ","px 0 0 0;\n\n /* ensure VFI is still visible for Embedded objects */\n [data-embedded-object-id] {\n a[data-clickable-overlay]:focus {\n &::before {\n outline-offset: -5px !important;\n border-radius: ","px;\n }\n }\n }\n"])),spacingM,attachmentRoundedCornerSize);var templateObject_1$1O,templateObject_2$16;var ImageAttachmentList=function ImageAttachmentList(_a){var images=_a.images,onDeleteClick=_a.onDeleteClick,disabled=_a.disabled,imageBackgroundColor=_a.imageBackgroundColor,className=_a.className;if(!images||images.length===0){return null;}return jsx$1(List,__assign({className:className},{children:images.map(function(i){return jsx$1(ListItem$1,{children:jsx$1(ImageAttachmentPreview,{attachment:i,disabled:disabled,onDeleteClick:function(){return onDeleteClick(i);},backgroundColor:imageBackgroundColor},void 0)},i.id);})}),void 0);};var List=_styled.ul.withConfig({displayName:"ImageAttachmentList__List",componentId:"sc-7el1kj-0"})(templateObject_1$1N||(templateObject_1$1N=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n margin: 0;\n padding: 0;\n list-style: none;\n"],["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n margin: 0;\n padding: 0;\n list-style: none;\n"])));var ListItem$1=_styled.li.withConfig({displayName:"ImageAttachmentList__ListItem",componentId:"sc-7el1kj-1"})(templateObject_2$15||(templateObject_2$15=__makeTemplateObject(["\n width: calc(100% - ","px);\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n }\n"],["\n width: calc(100% - ","px);\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n }\n"])),spacingS-5,minScreenSize.medium,spacingS-5);var ImageAttachmentPreview=function ImageAttachmentPreview(_a){var attachment=_a.attachment,onDeleteClick=_a.onDeleteClick,disabled=_a.disabled,backgroundColor=_a.backgroundColor;var formatMessage=useIntl().formatMessage;return jsxs(AttachmentHost,__assign({domIdentifier:"image",backgroundColor:backgroundColor,deleteButton:!disabled&&jsx$1(StyledDeleteAttachmentButton,{iconProps:{iconName:'Delete'},onClick:onDeleteClick,disabled:attachment.isUploadInProgress,ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:[attachment.hasError&&jsx$1(AttachmentOverlay,{children:jsx$1("div",{children:jsx$1(WarningIcon,{iconName:"Warning"},void 0)},void 0)},void 0),attachment.isUploadInProgress&&jsx$1(AttachmentOverlay,{children:jsx$1(CenteredSpinner,{size:SpinnerSize.large},void 0)},void 0),jsx$1(Image$1,{src:attachment.previewUrl,height:225,imageFit:ImageFit.centerCover,title:attachment.filename},void 0)]}),void 0);};var AttachmentOverlay=_styled.div.withConfig({displayName:"ImageAttachmentList__AttachmentOverlay",componentId:"sc-7el1kj-2"})(templateObject_3$J||(templateObject_3$J=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n\n background-color: rgba(146, 146, 146, 0.33);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: ","px;\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n\n background-color: rgba(146, 146, 146, 0.33);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: ","px;\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n"])),attachmentRoundedCornerSize);var CenteredSpinner=_styled(Spinner).withConfig({displayName:"ImageAttachmentList__CenteredSpinner",componentId:"sc-7el1kj-3"})(templateObject_4$t||(templateObject_4$t=__makeTemplateObject(["\n margin-top: auto;\n height: 100%;\n"],["\n margin-top: auto;\n height: 100%;\n"])));var WarningIcon=_styled(Icon).withConfig({displayName:"ImageAttachmentList__WarningIcon",componentId:"sc-7el1kj-4"})(templateObject_5$q||(templateObject_5$q=__makeTemplateObject(["\n font-size: 100px;\n color: ",";\n"],["\n font-size: 100px;\n color: ",";\n"])),function(p){return p.theme.palette.redDark;});var StyledDeleteAttachmentButton=_styled(DeleteAttachmentButton).withConfig({displayName:"ImageAttachmentList__StyledDeleteAttachmentButton",componentId:"sc-7el1kj-5"})(templateObject_6$h||(templateObject_6$h=__makeTemplateObject(["\n && {\n i {\n font-size: ","px;\n margin: 0;\n }\n }\n"],["\n && {\n i {\n font-size: ","px;\n margin: 0;\n }\n }\n"])),fontSizeMedium);var templateObject_1$1N,templateObject_2$15,templateObject_3$J,templateObject_4$t,templateObject_5$q,templateObject_6$h;var AttachmentList=function AttachmentList(_a){var className=_a.className,files=_a.files,onDeleteAttachmentClick=_a.onDeleteAttachmentClick,disabled=_a.disabled,previewTheme=_a.previewTheme,disableVideoPreview=_a.disableVideoPreview,disableEmbeddedObjectPreview=_a.disableEmbeddedObjectPreview;var attachedImages=files.filter(function(f){return f.type===AttachmentType.Image;});var attachedFiles=files.filter(function(f){return f.type===AttachmentType.File;});var palette=useContext(ThemeContext$1).theme.palette;return jsxs(Host$E,__assign({className:className,"data-attachment-list":true},{children:[jsx$1(GifEditList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);},previewTheme:previewTheme},void 0),jsx$1(ImageAttachmentList,{images:attachedImages,disabled:disabled,onDeleteClick:function(i){return onDeleteAttachmentClick(i);},imageBackgroundColor:previewTheme==='dark'?palette.neutralLight:palette.white},void 0),!disableVideoPreview&&jsx$1(VideoList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);}},void 0),!disableEmbeddedObjectPreview&&jsx$1(EmbeddedObjectList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);},previewTheme:previewTheme},void 0),jsx$1(FilesList$1,{files:attachedFiles,onDeleteClick:function(f){return onDeleteAttachmentClick(f);},disabled:disabled},void 0),jsx$1("div",{style:{clear:'both'}},void 0)]}),void 0);};var FilesList$1=_styled(FileAttachmentList).withConfig({displayName:"AttachmentList__FilesList",componentId:"sc-1s0cqp9-0"})(templateObject_1$1M||(templateObject_1$1M=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var Host$E=_styled.div.withConfig({displayName:"AttachmentList__Host",componentId:"sc-1s0cqp9-1"})(templateObject_2$14||(templateObject_2$14=__makeTemplateObject([""],[""])));var templateObject_1$1M,templateObject_2$14;var RichCommentInputWithAttachmentList=/*#__PURE__*/forwardRef(function(props,ref){return jsxs(Fragment,{children:[jsx$1(RichCommentInput,__assign({},props,{ref:ref}),void 0),jsx$1(AttachmentList,{files:props.attachments,disabled:props.disabled,onDeleteAttachmentClick:props.onDeleteAttachment,previewTheme:props.attachmentPreviewTheme,disableVideoPreview:props.disableVideoPreview,disableEmbeddedObjectPreview:props.disableEmbeddedObjectPreview},void 0)]},void 0);});var KeywordPickerGroup=function KeywordPickerGroup(_a){var group=_a.group,keywords=_a.keywords,expanded=_a.expanded,selectedKeywords=_a.selectedKeywords,onChange=_a.onChange,mandatoryKeywordIds=_a.mandatoryKeywordIds;var _b=useState$2(null),isExpanded=_b[0],setIsExpanded=_b[1];var isSelected=!!selectedKeywords.find(function(k){return k.groupId===group.id;});var isCollapsed=!(isExpanded===true||expanded);return jsxs(Host$D,{children:[jsxs(GroupButton,__assign({onClick:toggle,iconProps:{iconName:isCollapsed?'CaretRightSolid8':'CaretDownSolid8'},"aria-expanded":!isCollapsed,"aria-controls":group.name+"-list"},{children:[isSelected&&jsx$1(CheckMarkIcon,{iconName:"CheckMark"},void 0),jsx$1(ButtonLabel,__assign({"data-keyword-group":group.name,isSelected:isSelected},{children:jsx$1(KeywordTitle,{groupName:group.name},void 0)}),void 0)]}),void 0),jsx$1(KeywordsList,__assign({id:group.name+"-list","data-keyword-picker-group-list":true,isCollapsed:isCollapsed},{children:keywords.map(function(k){var checked=isKeywordSelected(k);var disabled=isKeywordDisabled(k);return jsx$1(KeywordItem,__assign({"data-keyword":k.name,"data-is-checked":checked,"data-is-disabled":disabled},{children:jsx$1(Checkbox,{label:k.name,onRenderLabel:function(){return jsx$1(KeywordTitle,{groupName:group.name,keywordName:k.name},void 0);},checked:checked,onChange:function(_e,isChecked){return handleChange(isChecked,k);},disabled:disabled},k.id)}),k.name);})}),void 0)]},void 0);function toggle(){setIsExpanded(!isExpanded);}function isKeywordSelected(keyword){return !!selectedKeywords.find(function(k){return k.id===keyword.id;});}function isKeywordDisabled(keyword){return mandatoryKeywordIds===null||mandatoryKeywordIds===void 0?void 0:mandatoryKeywordIds.some(function(id){return id===keyword.id;});}function handleChange(add,keyword){if(onChange){var result=selectedKeywords.filter(function(k){return keyword.id!==k.id;});if(add){result.push(keyword);}onChange(result);}}};var Host$D=_styled.div.withConfig({displayName:"KeywordPickerGroup__Host",componentId:"sc-pu16jm-0"})(templateObject_1$1L||(templateObject_1$1L=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var GroupButton=_styled(ActionButton).withConfig({displayName:"KeywordPickerGroup__GroupButton",componentId:"sc-pu16jm-1"})(templateObject_2$13||(templateObject_2$13=__makeTemplateObject(["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"],["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"])),fontSizeNormal,fontSizeSmall);var CheckMarkIcon=_styled(Icon).withConfig({displayName:"KeywordPickerGroup__CheckMarkIcon",componentId:"sc-pu16jm-2"})(templateObject_3$I||(templateObject_3$I=__makeTemplateObject(["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"],["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"])));var ButtonLabel=_styled.span.withConfig({displayName:"KeywordPickerGroup__ButtonLabel",componentId:"sc-pu16jm-3"})(templateObject_5$p||(templateObject_5$p=__makeTemplateObject(["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"],["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"])),function(p){return !p.isSelected&&css$2(templateObject_4$s||(templateObject_4$s=__makeTemplateObject(["\n margin-left: 33px; // checkmark icon space\n "],["\n margin-left: 33px; // checkmark icon space\n "])));});var KeywordsList=_styled.ul.withConfig({displayName:"KeywordPickerGroup__KeywordsList",componentId:"sc-pu16jm-4"})(templateObject_7$b||(templateObject_7$b=__makeTemplateObject(["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"],["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"])),function(p){return p.isCollapsed&&css$2(templateObject_6$g||(templateObject_6$g=__makeTemplateObject(["\n display: none;\n "],["\n display: none;\n "])));},spacingX+10);var KeywordItem=_styled.li.withConfig({displayName:"KeywordPickerGroup__KeywordItem",componentId:"sc-pu16jm-5"})(templateObject_8$a||(templateObject_8$a=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"],["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"])));var templateObject_1$1L,templateObject_2$13,templateObject_3$I,templateObject_4$s,templateObject_5$p,templateObject_6$g,templateObject_7$b,templateObject_8$a;var KeywordPicker=function KeywordPicker(_a){var _b;var value=_a.value,onChange=_a.onChange,showSelectionToggle=_a.showSelectionToggle,incomingAvailableKeywords=_a.availableKeywords,mandatoryKeywordIds=_a.mandatoryKeywordIds,className=_a.className;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var _c=useContext(LazySubscriptionContext),allKeywords=_c.allKeywords,selectedKeywordGroups=_c.selectedKeywordGroups;var _d=useState$2(null),searchedKeywords=_d[0],setSearchedKeywords=_d[1];var _e=useState$2(null),searchText=_e[0],setSearchText=_e[1];var selectedKeywords=getSelectedKeywords();var availableKeywords=incomingAvailableKeywords!==null&&incomingAvailableKeywords!==void 0?incomingAvailableKeywords:allKeywords;var visibleKeywords=(_b=searchedKeywords!==null&&searchedKeywords!==void 0?searchedKeywords:availableKeywords)!==null&&_b!==void 0?_b:[];var mandatoryKeywords=mandatoryKeywordIds?availableKeywords.filter(function(k){return mandatoryKeywordIds.includes(k.id);}):[];var noKeywordGroups=(selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.length)===0;var noAvailableKeywords=!noKeywordGroups&&(availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.length)===0;var isEmpty=visibleKeywords.length===0;return jsxs(Host$C,__assign({className:classNames('keyword-picker',className)},{children:[(noKeywordGroups||noAvailableKeywords)&&jsx$1("span",__assign({className:"keyword-picker-empty"},{children:jsx$1(FormattedMessage$1,{id:noKeywordGroups?'KeywordPicker.noGroupsDefined':'KeywordPicker.noAvailableKeywordsForGroup'},void 0)}),void 0),!noKeywordGroups&&!noAvailableKeywords&&jsxs("div",{children:[jsxs(SearchHost,__assign({className:"keyword-picker-search","data-keyword-picker-search":true},{children:[jsx$1(TextField,{onChange:handleSearch,value:searchText||'',placeholder:formatMessage({id:'KeywordPicker.search'}),ariaLabel:formatMessage({id:'KeywordPicker.search'})},void 0),searchText&&jsx$1(SearchCancelButton,{iconProps:{iconName:'Cancel'},onClick:function(){return handleSearch(null,null);},"aria-hidden":"true"},void 0)]}),void 0),showSelectionToggle&&jsx$1(StyledToggleAllButtons$1,{toggleAll:handleToggleAll},void 0),jsxs(KeywordPickerTree,__assign({className:"keyword-picker-tree"},{children:[isEmpty&&jsx$1(FormattedMessage$1,{id:"KeywordPicker.emptySearch"},void 0),!isEmpty&&selectedKeywordGroups&&selectedKeywordGroups.sort(function(a,b){return a.name.localeCompare(b.name);}).map(function(g){var keywords=visibleKeywords.filter(function(k){return k.groupId===g.id;});return keywords.length===0?null:jsx$1(KeywordPickerGroup,{expanded:!!searchText,group:g,keywords:keywords,selectedKeywords:selectedKeywords,onChange:onChange,mandatoryKeywordIds:mandatoryKeywordIds},g.id);})]}),void 0)]},void 0)]}),void 0);function getSelectedKeywords(){if(value==null||allKeywords==null){return [];}return value.map(function(k){return typeof k==='string'?allKeywords.find(function(a){return a.id===k;}):k;}).filter(function(k){return k;});}function handleSearch(_,text){var hasSearch=text&&text.length;var keywords=hasSearch?availableKeywords.filter(function(k){return getKeywordTitle(user,k.translations,k.name).toLocaleLowerCase().indexOf(text.toLocaleLowerCase())>=0;}):availableKeywords;setSearchedKeywords(keywords);setSearchText(hasSearch?text:null);}function handleToggleAll(checkAll){onChange(checkAll?availableKeywords:mandatoryKeywords);}};var KeywordPickerTree=_styled.div.withConfig({displayName:"KeywordPicker__KeywordPickerTree",componentId:"sc-1ejjfwa-0"})(templateObject_1$1K||(templateObject_1$1K=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var StyledToggleAllButtons$1=_styled(ToggleAllButtons).withConfig({displayName:"KeywordPicker__StyledToggleAllButtons",componentId:"sc-1ejjfwa-1"})(templateObject_2$12||(templateObject_2$12=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var Host$C=_styled.div.withConfig({displayName:"KeywordPicker__Host",componentId:"sc-1ejjfwa-2"})(templateObject_3$H||(templateObject_3$H=__makeTemplateObject(["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"],["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"])));var SearchHost=_styled.div.withConfig({displayName:"KeywordPicker__SearchHost",componentId:"sc-1ejjfwa-3"})(templateObject_4$r||(templateObject_4$r=__makeTemplateObject(["\n position: relative;\n margin-bottom: 8px;\n"],["\n position: relative;\n margin-bottom: 8px;\n"])));var SearchCancelButton=_styled(IconButton).withConfig({displayName:"KeywordPicker__SearchCancelButton",componentId:"sc-1ejjfwa-4"})(templateObject_5$o||(templateObject_5$o=__makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"],["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"])));var templateObject_1$1K,templateObject_2$12,templateObject_3$H,templateObject_4$r,templateObject_5$o;var AddKeywordsButton=function AddKeywordsButton(_a){var availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,preselectedKeywords=_a.preselectedKeywords,onKeywordsChange=_a.onKeywordsChange,disabled=_a.disabled,keywordPickerTitleResourceKey=_a.keywordPickerTitleResourceKey;var features=useFeatures();var formatMessage=useIntl().formatMessage;var refButton=useRef$1();var _b=useState$2(false),showKeywordsPicker=_b[0],setShowKeywordsPicker=_b[1];var _c=useState$2(preselectedKeywords!==null&&preselectedKeywords!==void 0?preselectedKeywords:[]),selectedKeywords=_c[0],setSelectedKeywords=_c[1];if(!features.keywords){return null;}var calloutTitleId="keywordPickerTitle-"+createId();return jsxs("div",{children:[jsx$1("div",__assign({ref:refButton},{children:jsx$1(IconButton,{iconProps:{iconName:'Tag'},onClick:function(){setShowKeywordsPicker(!showKeywordsPicker);},disabled:disabled,"data-button-type":"keywords",ariaLabel:formatMessage({id:'AriaLabel.keywordsButton'})},void 0)}),void 0),showKeywordsPicker&&(jsxs(Callout,__assign({target:refButton.current,directionalHint:DirectionalHint.bottomCenter,ariaLabelledBy:keywordPickerTitleResourceKey?calloutTitleId:null,calloutWidth:300,styles:{calloutMain:{padding:spacingM}}},{children:[keywordPickerTitleResourceKey&&jsx$1(Title$5,__assign({id:calloutTitleId},{children:jsx$1(FormattedMessage$1,{id:keywordPickerTitleResourceKey},void 0)}),void 0),jsx$1(StyledKeywordPicker$1,{showSelectionToggle:true,value:selectedKeywords,onChange:function(keywords){return setSelectedKeywords(keywords);},availableKeywords:availableKeywords,mandatoryKeywordIds:mandatoryKeywords===null||mandatoryKeywords===void 0?void 0:mandatoryKeywords.map(function(k){return k.id;})},void 0),jsx$1(Buttons$2,{onDismiss:handleOnDismiss,onSave:handleOnSave},void 0)]}),void 0))]},void 0);function handleOnDismiss(){setShowKeywordsPicker(false);}function handleOnSave(){onKeywordsChange(selectedKeywords);setShowKeywordsPicker(false);}};var Title$5=_styled.div.withConfig({displayName:"AddKeywordsButton__Title",componentId:"sc-l8ish9-0"})(templateObject_1$1J||(templateObject_1$1J=__makeTemplateObject(["\n font-weight: bold;\n margin-bottom: ","px;\n font-size: ","px;\n"],["\n font-weight: bold;\n margin-bottom: ","px;\n font-size: ","px;\n"])),spacingM,fontSizeMedium);var Buttons$2=function Buttons(_a){var onSave=_a.onSave,onDismiss=_a.onDismiss;return jsxs(ButtonsContainer$1,{children:[jsx$1(DefaultButton,__assign({onClick:onDismiss},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0),jsx$1(PrimaryButton,__assign({onClick:onSave},{children:jsx$1(FormattedMessage$1,{id:"Generic.Save"},void 0)}),void 0)]},void 0);};var ButtonsContainer$1=_styled.div.withConfig({displayName:"AddKeywordsButton__ButtonsContainer",componentId:"sc-l8ish9-1"})(templateObject_2$11||(templateObject_2$11=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n margin-top: ","px;\n\n > button {\n flex: 1;\n }\n"],["\n display: flex;\n gap: ","px;\n margin-top: ","px;\n\n > button {\n flex: 1;\n }\n"])),spacingM,spacingM);var StyledKeywordPicker$1=_styled(KeywordPicker).withConfig({displayName:"AddKeywordsButton__StyledKeywordPicker",componentId:"sc-l8ish9-2"})(templateObject_3$G||(templateObject_3$G=__makeTemplateObject(["\n max-height: 256px;\n overflow-y: auto;\n"],["\n max-height: 256px;\n overflow-y: auto;\n"])));var templateObject_1$1J,templateObject_2$11,templateObject_3$G;var CreateComment=function CreateComment(_a){var className=_a.className,onPost=_a.onPost,autoFocus=_a.autoFocus,readOnly=_a.readOnly,initialContent=_a.content,allowAttachments=_a.allowAttachments,mentionSearchHandler=_a.mentionSearchHandler,useLargeDropTarget=_a.useLargeDropTarget,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues,_b=_a.focusAfterPost,focusAfterPost=_b===void 0?true:_b,onAttachmentsChanged=_a.onAttachmentsChanged,_c=_a.attachments,attachments=_c===void 0?[]:_c,deletedAttachmentUrls=_a.deletedAttachmentUrls,onDeleteAttachment=_a.onDeleteAttachment,disableDragAndDrop=_a.disableDragAndDrop,allowKeywords=_a.allowKeywords,allowSaveWithoutContent=_a.allowSaveWithoutContent,saveOnEnter=_a.saveOnEnter,saveOnCtrlEnter=_a.saveOnCtrlEnter,keywordSettings=_a.keywordSettings,disableBoxShadow=_a.disableBoxShadow,ariaLabel=_a.ariaLabel;var availableKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.availableKeywords)||[];var defaultKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.defaultKeywords)||[];var mandatoryKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.mandatoryKeywords)||[];var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(initialContent||''),content=_e[0],setContent=_e[1];var _f=useState$2(null),selectedKeywords=_f[0],setSelectedKeywords=_f[1];var inputRef=useRef$1(null);var formatMessage=useIntl().formatMessage;var isReadOnly=readOnly||isSaving;var ignoreRef=useRef$1(false);useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var initialSelectedKeywords=defaultKeywords.concat(mandatoryKeywords);var initialSelectedKeywordIds=initialSelectedKeywords.map(function(k){return k.id;}).join('-');useEffect$1(function(){setSelectedKeywords(initialSelectedKeywords);},[initialSelectedKeywordIds]);return jsx$1("div",__assign({className:className,"data-comment":"create"},{children:jsx$1(RichCommentInputWithAttachmentList,{ref:inputRef,content:content,attachments:attachments,deletedAttachmentUrls:deletedAttachmentUrls,onAttachmentsChange:onAttachmentsChanged,onDeleteAttachment:onDeleteAttachment,onEnter:saveOnEnter&&handleSave,onCtrlEnter:saveOnCtrlEnter&&handleSave,onChange:function(value){return setContent(value);},disabled:isReadOnly,autoFocus:autoFocus,mentionSearchHandler:mentionSearchHandler,allowAttachments:allowAttachments,disableDragAndDrop:disableDragAndDrop,useLargeDropTarget:useLargeDropTarget,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,disableBoxShadow:disableBoxShadow,ariaLabel:ariaLabel,additionalInputControl:selectedKeywords&&jsx$1("div",{children:selectedKeywords.map(function(k){return k.name;})},void 0),buttons:{leftSide:allowKeywords&&jsx$1(AddKeywordsButton,{availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,preselectedKeywords:selectedKeywords,onKeywordsChange:function(keywords){return setSelectedKeywords(keywords);},disabled:isReadOnly,keywordPickerTitleResourceKey:"Post.keywords.title"},void 0),rightSide:jsx$1(IconButton,{iconProps:{iconName:'Send'},disabled:isSaveDisabled(),onClick:handleSave,"data-button-type":"save",ariaLabel:formatMessage({id:'AriaLabel.sendButton'})},'saveButton'+isSaveDisabled())}},void 0)}),void 0);function handleSave(){return __awaiter(this,void 0,void 0,function(){var groupedKeywords;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaveDisabled()){return [2/*return*/];}setIsSaving(true);groupedKeywords=getGroupedKeywords(selectedKeywords);return [4/*yield*/,onPost({content:content.trim()},groupedKeywords)];case 1:_a.sent();setSelectedKeywords(defaultKeywords||[]);if(!ignoreRef.current){setIsSaving(false);setContent('');if(focusAfterPost){inputRef.current.focus();}}return [2/*return*/];}});});}function isSaveDisabled(){return isReadOnly||!canSaveInput(allowSaveWithoutContent,attachments,content);}};var gutter=2;_styled.div.withConfig({displayName:"LegacyPostPhotoGallery__Gallery",componentId:"sc-ir1n2k-0"})(templateObject_1$1I||(templateObject_1$1I=__makeTemplateObject(["\n overflow: hidden;\n\n margin-left: -","px;\n margin-right: -","px;\n"],["\n overflow: hidden;\n\n margin-left: -","px;\n margin-right: -","px;\n"])),gutter,gutter);_styled.a.withConfig({displayName:"LegacyPostPhotoGallery__ImageItem",componentId:"sc-ir1n2k-1"})(templateObject_2$10||(templateObject_2$10=__makeTemplateObject(["\n background-color: #eee;\n box-sizing: border-box;\n float: left;\n margin: ","px;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 200px;\n cursor: pointer;\n\n :hover {\n opacity: 0.9;\n }\n\n > * {\n height: 100%;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n height: 200px;\n }\n\n @media (min-width: ","px) {\n width: calc(25% - ","px);\n height: 150px;\n }\n"],["\n background-color: #eee;\n box-sizing: border-box;\n float: left;\n margin: ","px;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 200px;\n cursor: pointer;\n\n :hover {\n opacity: 0.9;\n }\n\n > * {\n height: 100%;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n height: 200px;\n }\n\n @media (min-width: ","px) {\n width: calc(25% - ","px);\n height: 150px;\n }\n"])),gutter,minScreenSize.small,gutter*2,minScreenSize.medium,gutter*2);var templateObject_1$1I,templateObject_2$10;var ImagesAndFilesList=function ImagesAndFilesList(_a){var item=_a.item,basePath=_a.basePath,imagesGridBackgroundColor=_a.imagesGridBackgroundColor,className=_a.className;var user=useCurrentUser();var _b=useAttachmentsApi(),getImageUrl=_b.getImageUrl,getFileUrl=_b.getFileUrl;var subscriptionId=user.subscription.id;var files=item.attachments.filter(function(a){return a.type===AttachmentType.File;});var images=item.attachments.filter(function(a){return a.type===AttachmentType.Image;});var maxContentWidth=minScreenSize.medium-spacingX;var galleryDetails=useMemo(function(){var galleryImages=images.map(function(a){var _a;return {previewUrl:(_a=a.previewUrl)!==null&&_a!==void 0?_a:getImageUrl(basePath,subscriptionId,item,a.id,maxContentWidth),imageId:a.id,width:a.width,height:a.height};});return {galleryId:createId(),images:galleryImages};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131937
131940
|
},[item.attachments,item.fileAccessToken,item.attachmentContainerId]);if(images.length===0&&files.length===0){return null;}return jsxs("div",__assign({className:className},{children:[jsx$1(PhotoGrid,{images:galleryDetails.images,imageUrlResolver:function(imageId,width,height){return getImageUrl(basePath,subscriptionId,item,imageId,width,height);},gridBackgroundColor:imagesGridBackgroundColor},void 0),jsx$1(FilesList,{files:files,getFileUrl:function(attachmentId,token){return getFileUrl(basePath,subscriptionId,item,attachmentId,token);},fileAccessToken:item.fileAccessToken},void 0)]}),void 0);};var FilesList=_styled(FileAttachmentList).withConfig({displayName:"ImagesAndFilesList__FilesList",componentId:"sc-1wjy8l6-0"})(templateObject_1$1H||(templateObject_1$1H=__makeTemplateObject(["\n :not(:first-child) {\n margin-top: ","px;\n }\n"],["\n :not(:first-child) {\n margin-top: ","px;\n }\n"])),spacingM);var templateObject_1$1H;var EditComment=function EditComment(_a){var content=_a.content,files=_a.files,deletedFileUrls=_a.deletedFileUrls,onSave=_a.onSave,onCancel=_a.onCancel,className=_a.className,mentionSearchHandler=_a.mentionSearchHandler,allowAttachments=_a.allowAttachments,onAttachmentAdded=_a.onAttachmentAdded,onDeleteAttachment=_a.onDeleteAttachment,allowKeywords=_a.allowKeywords,availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,keywords=_a.keywords,allowSaveWithoutContent=_a.allowSaveWithoutContent,saveOnEnter=_a.saveOnEnter,saveOnCtrlEnter=_a.saveOnCtrlEnter,attachmentPreviewTheme=_a.attachmentPreviewTheme,ariaLabel=_a.ariaLabel;var formatMessage=useIntl().formatMessage;var _b=useState$2(content||''),newContent=_b[0],setContent=_b[1];var _c=useState$2(getFlatKeywordList(keywords)||[]),selectedKeywords=_c[0],setSelectedKeywords=_c[1];return jsx$1(RichCommentInputWithAttachmentList,{className:className,content:newContent,attachments:files,deletedAttachmentUrls:deletedFileUrls,autoFocus:true,mentionSearchHandler:mentionSearchHandler,onChange:function(value){return setContent(value);},onEnter:saveOnEnter&&handleSave,onCtrlEnter:saveOnCtrlEnter&&handleSave,onAttachmentsChange:onAttachmentAdded,onDeleteAttachment:onDeleteAttachment,allowAttachments:allowAttachments,disableBoxShadow:true,ariaLabel:ariaLabel,attachmentPreviewTheme:attachmentPreviewTheme,additionalInputControl:selectedKeywords&&jsx$1("div",{children:selectedKeywords.map(function(k){return k.name;})},void 0),buttons:{leftSide:allowKeywords&&jsx$1(AddKeywordsButton,{availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,preselectedKeywords:selectedKeywords,onKeywordsChange:function(keywords){return setSelectedKeywords(keywords);},keywordPickerTitleResourceKey:"Post.keywords.title"},void 0),rightSide:jsxs(Fragment,{children:[jsx$1(IconButton,{iconProps:{iconName:'Cancel'},onClick:onCancel,"data-button":"cancel",ariaLabel:formatMessage({id:'AriaLabel.cancelButton'})},void 0),jsx$1(IconButton,{iconProps:{iconName:'CheckMark'},disabled:!canSaveInput(allowSaveWithoutContent,files,newContent),onClick:handleSave,"data-button":"save",ariaLabel:formatMessage({id:'AriaLabel.sendButton'})},void 0)]},void 0)}},void 0);function handleSave(){var groupedKeywords=getGroupedKeywords(selectedKeywords);onSave(newContent.trim(),groupedKeywords);}};function useAttachmentUploader(initialAttachments,containerId,basePath){var ignoreRef=useRef$1(false);var warningToastHandle=useRef$1();var _a=useAttachmentsApi(),uploadFile=_a.uploadFile,uploadImage=_a.uploadImage;var showToastWarning=useNotificationContext().showToastWarning;useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var user=useCurrentUser();var _b=useState$2(initialAttachments),attachments=_b[0],setAttachments=_b[1];var _c=useState$2([]),deletedAttachmentUrls=_c[0],setDeletedAttachmentUrls=_c[1];// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131938
131941
|
var handleAttachmentCallback=useCallback(handleAttachmentsAdded,[attachments,setAttachments,basePath,containerId]);return [attachments,handleAttachmentCallback,clearAttachments,deletedAttachmentUrls,deleteAttachment];function handleAttachmentsAdded(updatedAttachments){return __awaiter(this,void 0,void 0,function(){var newAttachments,_loop_1,_i,newAttachments_1,newAttachment;return __generator(this,function(_a){newAttachments=updatedAttachments.filter(function(a){return attachments.every(function(old){return old.id!==a.id;});});setAttachments(updatedAttachments.map(function(a){return __assign(__assign({},a),{isUploadInProgress:(a.type===AttachmentType.Image||a.type===AttachmentType.File)&&!!newAttachments.find(function(x){return x.id===a.id;})});}));_loop_1=function(newAttachment){(newAttachment.type===AttachmentType.Image||newAttachment.type===AttachmentType.File)&&uploadAttachment(basePath,newAttachment).then(function(response){if((response===null||response===void 0?void 0:response.status)!==200&&(response===null||response===void 0?void 0:response.status)!==204){throw new Error("Request failed with status "+(response===null||response===void 0?void 0:response.status));}})// todo: add proper error handling when uploading a attachment fails
|
|
131939
131942
|
// => we should display a retry button on the attachment preview
|
|
@@ -131980,9 +131983,9 @@ if(node.querySelector('[data-code-html]')==null){node.innerHTML='';}}};var Heade
|
|
|
131980
131983
|
},[pollResult,isLoadingPollResult]);// If the pollResult and the choice input is rendered with showResults
|
|
131981
131984
|
// at the same time, we miss the animation of the bars when they fill up
|
|
131982
131985
|
// Delay the pollResult a bit so the users sees the animation
|
|
131983
|
-
var delayedFetchPollResult=useDebouncedCallback
|
|
131986
|
+
var delayedFetchPollResult=useDebouncedCallback(fetchPollResults,500)[0];if(isLoading){return null;}var actualQuestions=__spreadArray(__spreadArray([],questionDefinitions),(additionalQuestions===null||additionalQuestions===void 0?void 0:additionalQuestions.questions)||[]);var hasMissingAnswers=!!userAnswers.find(function(a){return a.choiceIds.length===0;});var hasMissingUnsavedAnswer=unsavedQuestionsIds.length>0||userAnswers.some(function(a){return !a.choiceIds.length;});showResult=(showResult||!hasMissingUnsavedAnswer)&&actualQuestions.length>0;return jsx$1(PollUserContext.Provider,__assign({value:{item:item,resourceType:resourceType,questions:actualQuestions,answers:userAnswers,addAnswer:handleAddAnswer,setAnswers:setUserAnswers,pollResult:pollResult,isLoadingPollResult:isLoadingPollResult,showResult:showResult,hasMissingAnswers:hasMissingAnswers,hasMissingUnsavedAnswer:hasMissingUnsavedAnswer,submitPoll:handleSubmitPoll,getQuestionResult:getQuestionResult,reset:reset,onBehalfOfUpn:onBehalfOfUpn,fetchPollResults:fetchPollResults}},{children:jsx$1(PollTranslationContextProvider,__assign({contents:item.contents,language:language,additionalTranslations:additionalQuestions===null||additionalQuestions===void 0?void 0:additionalQuestions.translations},{children:children}),void 0)}),void 0);function handleAddAnswer(questionId,selectedChoiceIds){setUnsavedQuestionsIds(function(a){return __spreadArray(__spreadArray([],a),[questionId]);});setUserAnswers(function(answers){return answers.map(function(a){return a.questionId===questionId?__assign(__assign({},a),{choiceIds:__spreadArray([],selectedChoiceIds)}):a;});});}function handleSubmitPoll(savePollAnswers){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,,3]);setUnsavedQuestionsIds([]);return [4/*yield*/,savePollAnswers()];case 1:_a.sent();delayedFetchPollResult();return [3/*break*/,3];case 2:_a.sent();showError('Generic.error');return [3/*break*/,3];case 3:return [2/*return*/];}});});}function reset(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){setUnsavedQuestionsIds([]);setUserAnswers(createUsersAnswersFromFeedback({records:[]}));fetchPollResults();return [2/*return*/];});});}function loadUserAnswers(){return __awaiter(this,void 0,void 0,function(){var feedback,error_2;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,,3]);return [4/*yield*/,getFeedback(resourceType,itemId,onBehalfOfUpn)];case 1:feedback=_a.sent();return [3/*break*/,3];case 2:error_2=_a.sent();// if we got a 404, the user doesn't exist, in this case we simply treat the feedback as it is not set yet
|
|
131984
131987
|
if((error_2===null||error_2===void 0?void 0:error_2.response.statusCode)!==404){throw error_2;}feedback={records:[]};return [3/*break*/,3];case 3:return [2/*return*/,createUsersAnswersFromFeedback(feedback)];}});});}function createUsersAnswersFromFeedback(feedback){var pollFeedback=feedback.records.find(function(r){return r.type==='poll';});var answers=pollFeedback?pollFeedback.answers:[];return questionDefinitions.map(function(q){return {questionId:q.questionId,choiceIds:answers.filter(function(a){return a.questionId===q.questionId;}).map(function(a){return a.choiceIds;})[0]||[]};}).concat(getAdditionalUserAnswers?getAdditionalUserAnswers(feedback.records)||[]:[]);}function getQuestionResult(questionId){var userSelectedChoices=userAnswers.filter(function(a){return a.questionId===questionId;}).map(function(a){return a.choiceIds;})[0]||[];return {showResults:showResult||unsavedQuestionsIds.every(function(id){return id!==questionId;})&&userSelectedChoices.length>0,userSelectedChoices:userSelectedChoices,totalFeedbackCount:pollResult.totalFeedbackCount,choiceResults:pollResult.answers.filter(function(a){return a.questionId===questionId;}).reduce(function(result,answer){return __spreadArray(__spreadArray([],result),answer.choices);},[]).reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.choiceId]=next.count,_a));},{})};}};var DetailViewSectionPadding=css$2(templateObject_1$1i||(templateObject_1$1i=__makeTemplateObject(["\n padding: ","px ","px 0 ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n padding: ","px ","px 0 ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingXs,spacingM,spacingM,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$1i;var PollResultFeedbackCount=function PollResultFeedbackCount(){var _a=useContext(PollUserContext),showResult=_a.showResult,pollResult=_a.pollResult;if(!showResult){return null;}return jsx$1("div",__assign({className:"ms-fontColor-neutralTertiary","data-poll-result-total-count":pollResult.totalFeedbackCount},{children:jsx$1(FormattedMessage$1,{id:"Polls.editor.totalFeedbackCount",values:{count:pollResult.totalFeedbackCount},tagName:"span"},void 0)}),void 0);};var DetailViewPoll=function DetailViewPoll(){var _a=useDetailViewContext(),item=_a.item,contentLanguage=_a.contentLanguage,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;var features=useFeatures();var getPollResult=useFeedbackApi().getPollResult;if(!features.polls||item==null||item.poll==null||item.poll.questions==null||item.poll.questions.length===0){return null;}return jsx$1(PollUserContextProvider,__assign({item:item,resourceType:resourceType,language:contentLanguage,getPollResults:function(itemId){return getPollResult(resourceType,itemId);}},{children:jsxs(StyledPollDisplay$1,{children:[jsx$1(PollResultFeedbackCount,{},void 0),jsx$1(DetailViewPollsSubmitButton,{isReadOnly:isEditorPreview},void 0),jsx$1(StyledPollResultExport,{},void 0)]},void 0)}),void 0);};var StyledPollResultExport=_styled(DetailViewPollExportButton).withConfig({displayName:"DetailViewPoll__StyledPollResultExport",componentId:"sc-gvqgh8-0"})(templateObject_1$1h||(templateObject_1$1h=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var StyledPollDisplay$1=_styled(PollDisplay).withConfig({displayName:"DetailViewPoll__StyledPollDisplay",componentId:"sc-gvqgh8-1"})(templateObject_2$L||(templateObject_2$L=__makeTemplateObject(["\n ",";\n margin-bottom: ","px;\n\n max-width: 500px;\n"],["\n ",";\n margin-bottom: ","px;\n\n max-width: 500px;\n"])),DetailViewSectionPadding,spacingL);var templateObject_1$1h,templateObject_2$L;var EventDetailViewResponseExportButton=function EventDetailViewResponseExportButton(_a){var className=_a.className;var features=useFeatures();if(!features.events){return null;}return jsx$1(DetailViewCsvExportButton,{className:className,path:"feedback/registration/result/export",stringResource:"Events.registration.exportResultsAsCsv"},void 0);};var FeedbackItemType;(function(FeedbackItemType){FeedbackItemType["comment"]="comment";FeedbackItemType["like"]="like";FeedbackItemType["confirm"]="confirm";FeedbackItemType["poll"]="poll";FeedbackItemType["eventRegistration"]="eventRegistration";})(FeedbackItemType||(FeedbackItemType={}));var EventRegistrationContextProvider=function EventRegistrationContextProvider(_a){var _b;var onBehalfOfUpn=_a.onBehalfOfUpn,children=_a.children;var formatMessage=useIntl().formatMessage;var features=useFeatures();var _c=useDetailViewContext(),item=_c.item,contentLanguage=_c.contentLanguage;var getEventRegistrationResults=useEventRegistrationApi().getEventRegistrationResults;if(!features.events||item==null){return null;}var locationQuestionId=getLocationQuestionId(item);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;return jsx$1(PollUserContextProvider,__assign({item:item,onBehalfOfUpn:onBehalfOfUpn,resourceType:ItemResourceTypes.Events,language:contentLanguage,getAdditionalQuestions:function(result){return getAdditionalQuestions(result);},getAdditionalUserAnswers:extractLocationAnswers,getPollResults:getRegistrationResult,showResult:!!isCancelled},{children:children}),void 0);function getAdditionalQuestions(result){var _a=getLocationPollDefinitions(item,formatMessage,result,!!onBehalfOfUpn),question=_a.question,translations=_a.translations;return {questions:question?[question]:null,translations:translations};}function extractLocationAnswers(records){if(!item.locations||item.locations.length<2){return null;}var eventResponse=records.find(function(r){return r.type===FeedbackItemType.eventRegistration;});return [{questionId:locationQuestionId,choiceIds:eventResponse&&eventResponse.locationId?[eventResponse.locationId]:[]}];}function getRegistrationResult(itemId){return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getEventRegistrationResults(itemId)];case 1:result=_a.sent();return [2/*return*/,{totalFeedbackCount:result.totalFeedbackCount,answers:result.answers.concat([{questionId:locationQuestionId,choices:result.locationAnswers.map(function(l){return {choiceId:l.locationId,count:l.count};})}])}];}});});}};var EventDetailViewUserRegistration=function EventDetailViewUserRegistration(_a){var className=_a.className,hideInfoMessage=_a.hideInfoMessage;var pollUserContext=useContext(PollUserContext);var getFeedback=useFeedbackApi().getFeedback;var item=pollUserContext.item;var isLoadingPollResult=pollUserContext.isLoadingPollResult,pollResult=pollUserContext.pollResult,onBehalfOfUpn=pollUserContext.onBehalfOfUpn;var _b=usePromise$2(getEventResponse,item.userResponse,[item]),eventResponse=_b[0],isLoading=_b[1],setEventResponse=_b[3];// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131985
|
-
var seatsResult=useMemo(getSeatsLeft,[isLoading,isLoadingPollResult,pollResult,item.id]);return jsx$1(EventUserRegistrationContext.Provider,__assign({value:__assign(__assign({},pollUserContext),{hasPollContext:true,eventResponse:eventResponse,setEventResponse:setEventResponse,isLoading:isLoadingPollResult||isLoading,seatsInfo:seatsResult})},{children:jsx$1(EventUserRegistration,{className:className,hideInfoMessage:hideInfoMessage},void 0)}),void 0);function getEventResponse(){return __awaiter(this,void 0,void 0,function(){var feedback,eventRecord;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getFeedback(ItemResourceTypes.Events,item.id,onBehalfOfUpn)];case 1:feedback=_a.sent();eventRecord=feedback&&feedback.records.find(function(r){return r.type==='eventRegistration';});return [2/*return*/,eventRecord?eventRecord.eventResponse:EventResponse.NotSet];}});});}function getSeatsLeft(){var _a,_b,_c,_d;if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_a=item.cancelInformation)===null||_a===void 0?void 0:_a.isCancelled)||!((_b=pollResult===null||pollResult===void 0?void 0:pollResult.answers)===null||_b===void 0?void 0:_b.length)||isLoadingPollResult){return {hasAnySeatsLeft:true};}var locationsWithSeats=item.locations.filter(function(l){return l.maxNumberOfSeats>0;});var hasLocationsWithoutSeats=locationsWithSeats.length!==item.locations.length;if(!locationsWithSeats.length||hasLocationsWithoutSeats){return {hasAnySeatsLeft:true};}var locationAnswers=(_d=(_c=pollResult.answers.find(function(a){return a.questionId===getLocationQuestionId(item);}))===null||_c===void 0?void 0:_c.choices)===null||_d===void 0?void 0:_d.reduce(function(prev,curr){prev[curr.choiceId]=curr.count;return prev;},{});var locationsWithSeatsLeft=locationsWithSeats.map(function(l){return __assign(__assign({},l),{seatsLeft:Math.max(l.maxNumberOfSeats-(locationAnswers[l.locationId]||0),0)});});return {hasAnySeatsLeft:locationsWithSeatsLeft.some(function(l){return l.seatsLeft>0;}),locations:locationsWithSeatsLeft};}};var EventRegistrationRegisterSomeoneElseDialog=function EventRegistrationRegisterSomeoneElseDialog(_a){var show=_a.show,onDismiss=_a.onDismiss,onUpdate=_a.onUpdate;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var features=useFeatures();var _b=useState$2(),onBehalfOfUser=_b[0],setOnBehalfOfUser=_b[1];var item=useDetailViewContext().item;var isGroupAdmin=hasMinRoleInAllGroups(GroupRoles.Admin,user,item);useListener(EventResponseTriggerAction.type,function(action){if(action.itemId!==item.id){return false;}onUpdate({upn:onBehalfOfUser.userPrincipalName,displayName:onBehalfOfUser.displayName,locationId:action.locationId},action.response);onDismiss();return true;},[item.id,onBehalfOfUser===null||onBehalfOfUser===void 0?void 0:onBehalfOfUser.userPrincipalName]);return jsx$1(MobileFullHeightDialog,__assign({hidden:!show,modalProps:{isBlocking:true,className:'dialog-register-user'},dialogContentProps:{type:DialogType.close,title:formatMessage({id:'Events.registration.registerSomeoneElse.title'})},onDismiss:onDismiss},{children:jsxs(Host$s,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$2,{},void 0),jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.peoplePickerLabel"},void 0),jsx$1(StyledPeoplePicker,{accountType:AccountType.User,allowMailItems:isGroupAdmin&&features.userInvitation,localOnly:!isGroupAdmin,includePendingInvitationUsers:true,includePendingRegistrationUsers:true,selectionMode:SelectionMode.single,selectedItems:onBehalfOfUser?[onBehalfOfUser]:[],onChange:function(accounts){return setOnBehalfOfUser(accounts[0]);},placeholderStringResourceKey:"Events.registration.registerSomeoneElse.peoplePickerPlaceholder",excludedItems:[user]},void 0),onBehalfOfUser&&jsxs(EventRegistrationContextProvider,__assign({onBehalfOfUpn:onBehalfOfUser.userPrincipalName},{children:[jsxs(DialogMainContent,__assign({isScrollable:!env.isAnyMobileApp},{children:[!(onBehalfOfUser===null||onBehalfOfUser===void 0?void 0:onBehalfOfUser.id)&&jsx$1(InvitationInfoMessage,{subscriptionName:getSubscriptionName(user.subscription)},void 0),jsx$1(StyledPollDisplay,{},void 0)]}),void 0),jsx$1(DialogFooter,{children:jsxs(Buttons,{children:[jsx$1(CancelButton,{onClick:onDismiss},void 0),jsx$1(EventDetailViewUserRegistration,{hideInfoMessage:true},void 0)]},void 0)},void 0)]}),onBehalfOfUser.userPrincipalName)]}),void 0)}),void 0);};var Host$s=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Host",componentId:"sc-1rziepe-0"})(templateObject_1$1g||(templateObject_1$1g=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: ","px) {\n width: 400px;\n }\n\n .ms-Dialog-action {\n display: block;\n margin: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n @media (min-width: ","px) {\n width: 400px;\n }\n\n .ms-Dialog-action {\n display: block;\n margin: 0;\n }\n"])),minScreenSize.small);var Buttons=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Buttons",componentId:"sc-1rziepe-1"})(templateObject_2$K||(templateObject_2$K=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n margin-right: 4px; /* buttons alignment on the right */\n"],["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n margin-right: 4px; /* buttons alignment on the right */\n"])));var StyledPeoplePicker=_styled(PeoplePicker).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledPeoplePicker",componentId:"sc-1rziepe-2"})(templateObject_3$u||(templateObject_3$u=__makeTemplateObject(["\n margin: ","px 0 ","px 0;\n\n .ms-BasePicker-text {\n padding: 0 !important;\n }\n"],["\n margin: ","px 0 ","px 0;\n\n .ms-BasePicker-text {\n padding: 0 !important;\n }\n"])),spacingS,spacingM);var DialogMainContent=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__DialogMainContent",componentId:"sc-1rziepe-3"})(templateObject_5$i||(templateObject_5$i=__makeTemplateObject(["\n ","\n margin-bottom: auto;\n"],["\n ","\n margin-bottom: auto;\n"])),function(p){return p.isScrollable&&css$2(templateObject_4$j||(templateObject_4$j=__makeTemplateObject(["\n max-height: 300px;\n overflow: auto;\n "],["\n max-height: 300px;\n overflow: auto;\n "])));});var StyledPollDisplay=_styled(PollDisplay).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledPollDisplay",componentId:"sc-1rziepe-4"})(templateObject_6$c||(templateObject_6$c=__makeTemplateObject(["\n max-width: calc(100% - 10px);\n padding-left: 4px; // needed for the focus indicator\n"],["\n max-width: calc(100% - 10px);\n padding-left: 4px; // needed for the focus indicator\n"])));var CancelButton=function CancelButton(_a){var onClick=_a.onClick;return jsx$1(StyledCancelButton,__assign({onClick:onClick},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0);};var InvitationInfoMessage=function InvitationInfoMessage(_a){var subscriptionName=_a.subscriptionName;return jsxs(InfoMessageHost,{children:[jsx$1(InfoIcon,{iconName:"info"},void 0),jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.userWillBeInvited",values:{subscriptionName:subscriptionName}},void 0)]},void 0);};var InfoMessageHost=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__InfoMessageHost",componentId:"sc-1rziepe-5"})(templateObject_7$7||(templateObject_7$7=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n"])),spacingM);var InfoIcon=_styled(Icon).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__InfoIcon",componentId:"sc-1rziepe-6"})(templateObject_8$6||(templateObject_8$6=__makeTemplateObject(["\n padding-right: ","px;\n"],["\n padding-right: ","px;\n"])),spacingS);var StyledCancelButton=_styled(DefaultButton).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledCancelButton",componentId:"sc-1rziepe-7"})(templateObject_9$5||(templateObject_9$5=__makeTemplateObject(["\n && {\n margin-right: ","px;\n }\n"],["\n && {\n margin-right: ","px;\n }\n"])),spacingM);var DialogGlobalStyle$2=createGlobalStyle(templateObject_10$4||(templateObject_10$4=__makeTemplateObject(["\n .dialog-register-user {\n .ms-Overlay {\n background-color: transparent !important;\n }\n\n .ms-Dialog-main {\n box-shadow: none !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n min-height: 466px;\n }\n }\n"],["\n .dialog-register-user {\n .ms-Overlay {\n background-color: transparent !important;\n }\n\n .ms-Dialog-main {\n box-shadow: none !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n min-height: 466px;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$1g,templateObject_2$K,templateObject_3$u,templateObject_4$j,templateObject_5$i,templateObject_6$c,templateObject_7$7,templateObject_8$6,templateObject_9$5,templateObject_10$4;var EventRegistrationRegisterSomeoneElseButton=function EventRegistrationRegisterSomeoneElseButton(_a){var item=_a.item,onRegister=_a.onRegister,onDeregister=_a.onDeregister;var user=useCurrentUser();var _b=useState$2(false),showDialog=_b[0],setShowDialog=_b[1];if(!hasMinRoleInAllGroups(GroupRoles.Author,user,item)){return null;}return jsxs(Fragment,{children:[jsx$1(StyledButton$1,__assign({iconProps:{iconName:'AddFriend'},onClick:function(){return setShowDialog(true);}},{children:jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.title"},void 0)}),void 0),showDialog&&jsx$1(EventRegistrationRegisterSomeoneElseDialog,{onDismiss:handleDismiss,onUpdate:handleUpdate,show:showDialog},void 0)]},void 0);function handleDismiss(){setShowDialog(false);}function handleUpdate(participant,response){if(response===EventResponse.Registered){onRegister===null||onRegister===void 0?void 0:onRegister(participant);}else {onDeregister===null||onDeregister===void 0?void 0:onDeregister(participant);}}};var StyledButton$1=_styled(ActionButton).withConfig({displayName:"EventRegistrationRegisterSomeoneElseButton__StyledButton",componentId:"sc-mgwolr-0"})(templateObject_1$1f||(templateObject_1$1f=__makeTemplateObject(["\n && {\n height: auto;\n padding: 0;\n margin-bottom: ","px;\n border: 0;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n margin-bottom: ","px;\n border: 0;\n }\n"])),spacingS);var templateObject_1$1f;var EventRegistrationDeregisterPersonButton=function EventRegistrationDeregisterPersonButton(_a){var item=_a.item,participant=_a.participant,onDeregistered=_a.onDeregistered;var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var setEventRegistration=useEventRegistrationApi().setEventRegistration;var showToast=useNotificationContext().showToast;var formatMessage=useIntl().formatMessage;var _b=useState$2(false),showDialog=_b[0],setShowDialog=_b[1];if(!hasMinRoleInAllGroups(GroupRoles.Author,user,item)){return null;}return jsxs("div",{children:[jsx$1(Tooltip,__assign({resourceKey:"Events.registration.deRegisterSomeoneElse.title",values:{name:participant.displayName}},{children:jsx$1(IconButton,{iconProps:{iconName:'Delete'},onClick:function(){return setShowDialog(true);},ariaLabel:formatMessage({id:'Events.registration.deRegisterSomeoneElse.title'},{name:participant.displayName})},void 0)}),void 0),showDialog&&jsx$1(ConfirmDialog,{showDialog:showDialog,titleResourceKey:"Events.registration.deRegisterSomeoneElse.confirmTitle",titleResourceValues:{name:participant.displayName},onConfirm:deRegister,onClose:function(){return setShowDialog(false);}},void 0)]},void 0);function deRegister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:onDeregistered();return [4/*yield*/,setEventRegistration(item.id,EventResponse.NotSet,null,null,participant.upn)];case 1:_a.sent();refreshUserDetails();showToast('Events.registration.onBehalfOfDeregistrationSuccess',{mail:participant.displayName});return [2/*return*/];}});});}};var EventRegistrationParticipantsDialog=function EventRegistrationParticipantsDialog(_a){var numberOfParticipants=_a.numberOfParticipants,show=_a.show,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;return jsx$1(MobileFullHeightDialog,__assign({hidden:!show,modalProps:{isBlocking:false,className:'dialog-event-participants'},dialogContentProps:{type:DialogType.close,title:formatMessage({id:'Events.registration.participants'},{count:numberOfParticipants})},onDismiss:onDismiss},{children:jsxs(Host$r,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$1,{},void 0),jsx$1(ParticipantsList,{},void 0)]}),void 0)}),void 0);};var Host$r=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__Host",componentId:"sc-1biaauh-0"})(templateObject_1$1e||(templateObject_1$1e=__makeTemplateObject(["\n @media (min-width: ","px) {\n width: 400px;\n }\n"],["\n @media (min-width: ","px) {\n width: 400px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle$1=createGlobalStyle(templateObject_2$J||(templateObject_2$J=__makeTemplateObject(["\n .dialog-event-participants {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n height: 466px;\n }\n}\n"],["\n .dialog-event-participants {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n height: 466px;\n }\n}\n"])),maxScreenSize.small);var ParticipantsList=function ParticipantsList(){var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var getParticipants=useEventRegistrationApi().getParticipants;var textColors=useContext(ThemeContext$1).theme.textColors;var _a=useContext(PollUserContext),fetchPollResults=_a.fetchPollResults,publishableItem=_a.item;var item=publishableItem;var _b=usePromise$2(getSortedParticipants,[],[item.id]),unfilteredParticipants=_b[0],isLoading=_b[1],setParticipants=_b[3];var handleSearchDebounced=useDebouncedCallback$3(handleSearch,300)[0];var _c=useState$2(),filteredParticipants=_c[0],setFilteredParticipants=_c[1];var participants=filteredParticipants||unfilteredParticipants;return jsxs(ListHost,{children:[jsx$1(EventRegistrationRegisterSomeoneElseButton,{item:item,onDeregister:handleDeregister,onRegister:handleRegister},void 0),jsx$1(SearchArea,{children:jsx$1(StyledSearchBox$1,{placeholder:formatMessage({id:'Events.registration.participants.search.placeholder'}),disabled:isLoading,onChange:function(_,value){return handleSearchDebounced(unfilteredParticipants,value);},iconProps:{style:{color:textColors.default}}},void 0)},void 0),isLoading&&jsx$1(Spinner,{},void 0),jsx$1(ListContainer,__assign({isScrollable:!env.isAnyMobileApp},{children:participants.map(function(p){var showDeregisterButton=p.upn!==user.userPrincipalName;return jsxs(ListRow,{children:[jsx$1(PersonaCardWrapper,__assign({showDeregisterButton:showDeregisterButton},{children:jsx$1(StyledPersonaCard$4,__assign({upn:p.upn},{children:jsx$1(StyledAvatar$3,{upn:p.upn,text:p.displayName,secondaryText:p.location&&formatMessage({id:'Events.registration.participants.location'},{location:p.location})},void 0)}),void 0)}),void 0),showDeregisterButton&&jsx$1(EventRegistrationDeregisterPersonButton,{item:item,participant:p,onDeregistered:function(){return handleDeregister(p);}},void 0)]},p.upn);})}),void 0),!isLoading&&!participants.length&&jsx$1(FormattedMessage$1,{id:"Generic.noResultsFound"},void 0)]},void 0);function getSortedParticipants(){return __awaiter(this,void 0,void 0,function(){var numberOfLocations,locationsMap,participants;return __generator(this,function(_a){switch(_a.label){case 0:numberOfLocations=item===null||item===void 0?void 0:item.locations.length;locationsMap=getLocations();return [4/*yield*/,getParticipants(item.id)];case 1:participants=_a.sent()||[];return [2/*return*/,participants.map(function(p){return __assign(__assign({},p),{location:numberOfLocations>1?locationsMap[p.locationId]||'':''});}).sort(function(a,b){var locationCompare=(locationsMap[a.locationId]||'').localeCompare(locationsMap[b.locationId]||'');if(locationCompare!==0){return locationCompare;}return a.displayName.localeCompare(b.displayName);})];}});});}function getLocations(){var _a;return ((_a=item.locations)===null||_a===void 0?void 0:_a.reduce(function(prev,curr){prev[curr.locationId]=curr.name;return prev;},{}))||{};}function handleSearch(unfilteredParticipants,searchValue){if(!searchValue){setFilteredParticipants(null);return;}var filter=new RegExp(searchValue,'i');setFilteredParticipants(unfilteredParticipants.filter(function(p){return (p.displayName+"|"+p.upn+"|"+p.location).search(filter)>-1;}));}function handleDeregister(participant){setParticipants(function(ps){return ps.filter(function(p){return p.upn!==participant.upn;});});fetchPollResults();setFilteredParticipants(null);}function handleRegister(participant){setParticipants(function(ps){return ps.concat([__assign(__assign({},participant),{location:getLocations()[participant.locationId]||''})]);});fetchPollResults();setFilteredParticipants(null);}};var ListContainer=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListContainer",componentId:"sc-1biaauh-1"})(templateObject_4$i||(templateObject_4$i=__makeTemplateObject(["\n padding: 4px;\n\n ","\n"],["\n padding: 4px;\n\n ","\n"])),function(p){return p.isScrollable&&css$2(templateObject_3$t||(templateObject_3$t=__makeTemplateObject(["\n max-height: 382px;\n overflow: auto;\n "],["\n max-height: 382px;\n overflow: auto;\n "])));});var SearchArea=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__SearchArea",componentId:"sc-1biaauh-2"})(templateObject_5$h||(templateObject_5$h=__makeTemplateObject(["\n margin-bottom: ","px;\n display: flex;\n"],["\n margin-bottom: ","px;\n display: flex;\n"])),spacingM);var StyledSearchBox$1=_styled(SearchBox$1).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledSearchBox",componentId:"sc-1biaauh-3"})(templateObject_6$b||(templateObject_6$b=__makeTemplateObject(["\n flex-grow: 1;\n"],["\n flex-grow: 1;\n"])));var ListRow=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListRow",componentId:"sc-1biaauh-4"})(templateObject_7$6$1||(templateObject_7$6$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n margin-bottom: ","px;\n"])),spacingS);var PersonaCardWrapper=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__PersonaCardWrapper",componentId:"sc-1biaauh-5"})(templateObject_8$5$1||(templateObject_8$5$1=__makeTemplateObject(["\n width: calc(100% - ","px);\n"],["\n width: calc(100% - ","px);\n"])),function(p){return p.showDeregisterButton?32:0;});var StyledPersonaCard$4=_styled(PersonaCard).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledPersonaCard",componentId:"sc-1biaauh-6"})(templateObject_9$4||(templateObject_9$4=__makeTemplateObject(["\n width: 100%;\n\n & > * {\n width: 100%;\n }\n"],["\n width: 100%;\n\n & > * {\n width: 100%;\n }\n"])));var StyledAvatar$3=_styled(Avatar).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledAvatar",componentId:"sc-1biaauh-7"})(templateObject_10$3$1||(templateObject_10$3$1=__makeTemplateObject(["\n .ms-Persona-secondaryText {\n white-space: initial;\n }\n\n height: auto;\n\n > div:first-child {\n align-self: flex-start;\n }\n"],["\n .ms-Persona-secondaryText {\n white-space: initial;\n }\n\n height: auto;\n\n > div:first-child {\n align-self: flex-start;\n }\n"])));var ListHost=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListHost",componentId:"sc-1biaauh-8"})(templateObject_11$2$1||(templateObject_11$2$1=__makeTemplateObject([""],[""])));var templateObject_1$1e,templateObject_2$J,templateObject_3$t,templateObject_4$i,templateObject_5$h,templateObject_6$b,templateObject_7$6$1,templateObject_8$5$1,templateObject_9$4,templateObject_10$3$1,templateObject_11$2$1;var EventRegistrationParticipantsLink=function EventRegistrationParticipantsLink(){var _a;var user=useCurrentUser();var _b=useContext(PollUserContext),pollResult=_b.pollResult,publishableItem=_b.item;var item=publishableItem;var _c=useState$2(false),showParticipants=_c[0],setShowParticipants=_c[1];var palette=useContext(ThemeContext$1).theme.palette;if(user.isPublicUser||(pollResult===null||pollResult===void 0?void 0:pollResult.totalFeedbackCount)==null){return null;}var isUserAuthor=hasMinRoleInAllGroups(GroupRoles.Author,user,item);var canOpenParticipantsDialog=isUserAuthor||pollResult.totalFeedbackCount>0&&((_a=item.registrationSettings)===null||_a===void 0?void 0:_a.showParticipantsToEverybody);return jsxs("div",__assign({"data-poll-result-total-count":pollResult.totalFeedbackCount},{children:[!canOpenParticipantsDialog?jsx$1(NoParticipantsContainer,{children:jsx$1(FormattedMessage$1,{id:"Events.registration.participants.count",values:{count:pollResult.totalFeedbackCount}},void 0)},void 0):jsx$1(ParticipantsButton,__assign({onClick:function(){return setShowParticipants(true);},color:palette.accent},{children:jsx$1(FormattedMessage$1,{id:isUserAuthor?'Events.registration.participants.viewAndManage':'Events.registration.participants.count',values:{count:pollResult.totalFeedbackCount}},void 0)}),void 0),jsx$1(EventRegistrationParticipantsDialog,{numberOfParticipants:pollResult.totalFeedbackCount,show:showParticipants,onDismiss:function(){return setShowParticipants(false);}},void 0)]}),void 0);};var NoParticipantsContainer=_styled.div.withConfig({displayName:"EventRegistrationParticipantsLink__NoParticipantsContainer",componentId:"sc-44nkgi-0"})(templateObject_1$1d||(templateObject_1$1d=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n"],["\n color: ",";\n font-size: ","px;\n"])),function(p){return p.theme.palette.neutralTertiary;},fontSizeSmall);var ParticipantsButton=_styled(ActionButton).withConfig({displayName:"EventRegistrationParticipantsLink__ParticipantsButton",componentId:"sc-44nkgi-1"})(templateObject_2$I||(templateObject_2$I=__makeTemplateObject(["\n && {\n height: auto;\n padding: 0;\n font-size: ","px;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n font-size: ","px;\n }\n"])),fontSizeSmall);var templateObject_1$1d,templateObject_2$I;var EventDetailViewRegistrationPoll=function EventDetailViewRegistrationPoll(){return jsx$1(EventRegistrationContextProvider,{children:jsxs(StyledPollDisplay$1,{children:[jsx$1(EventRegistrationParticipantsLink,{},void 0),jsx$1(StyledEventUserRegistration,{},void 0),jsx$1(StyledResponseExportButton,{},void 0)]},void 0)},void 0);};var StyledEventUserRegistration=_styled(EventDetailViewUserRegistration).withConfig({displayName:"EventDetailViewRegistrationPoll__StyledEventUserRegistration",componentId:"sc-1kxjndz-0"})(templateObject_1$1c||(templateObject_1$1c=__makeTemplateObject(["\n && {\n margin-top: ","px;\n }\n"],["\n && {\n margin-top: ","px;\n }\n"])),spacingS);var StyledResponseExportButton=_styled(EventDetailViewResponseExportButton).withConfig({displayName:"EventDetailViewRegistrationPoll__StyledResponseExportButton",componentId:"sc-1kxjndz-1"})(templateObject_2$H||(templateObject_2$H=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$1c,templateObject_2$H;var EventDetailViewRegistration=function EventDetailViewRegistration(){var item=useDetailViewContext().item;var isRegistrationEnabled=item.registrationSettings&&item.registrationSettings.enabled;if(isRegistrationEnabled){return jsx$1(EventDetailViewRegistrationPoll,{},void 0);}return jsx$1(DetailViewPoll,{},void 0);};var EventDetailViewCancelInformation=function EventDetailViewCancelInformation(){var _a=useDetailViewContext(),item=_a.item,contentLanguage=_a.contentLanguage;return jsx$1(EventCancelInformation,{item:item,language:contentLanguage},void 0);};var classof$a=classofRaw$1;// `IsArray` abstract operation
|
|
131988
|
+
var seatsResult=useMemo(getSeatsLeft,[isLoading,isLoadingPollResult,pollResult,item.id]);return jsx$1(EventUserRegistrationContext.Provider,__assign({value:__assign(__assign({},pollUserContext),{hasPollContext:true,eventResponse:eventResponse,setEventResponse:setEventResponse,isLoading:isLoadingPollResult||isLoading,seatsInfo:seatsResult})},{children:jsx$1(EventUserRegistration,{className:className,hideInfoMessage:hideInfoMessage},void 0)}),void 0);function getEventResponse(){return __awaiter(this,void 0,void 0,function(){var feedback,eventRecord;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getFeedback(ItemResourceTypes.Events,item.id,onBehalfOfUpn)];case 1:feedback=_a.sent();eventRecord=feedback&&feedback.records.find(function(r){return r.type==='eventRegistration';});return [2/*return*/,eventRecord?eventRecord.eventResponse:EventResponse.NotSet];}});});}function getSeatsLeft(){var _a,_b,_c,_d;if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_a=item.cancelInformation)===null||_a===void 0?void 0:_a.isCancelled)||!((_b=pollResult===null||pollResult===void 0?void 0:pollResult.answers)===null||_b===void 0?void 0:_b.length)||isLoadingPollResult){return {hasAnySeatsLeft:true};}var locationsWithSeats=item.locations.filter(function(l){return l.maxNumberOfSeats>0;});var hasLocationsWithoutSeats=locationsWithSeats.length!==item.locations.length;if(!locationsWithSeats.length||hasLocationsWithoutSeats){return {hasAnySeatsLeft:true};}var locationAnswers=(_d=(_c=pollResult.answers.find(function(a){return a.questionId===getLocationQuestionId(item);}))===null||_c===void 0?void 0:_c.choices)===null||_d===void 0?void 0:_d.reduce(function(prev,curr){prev[curr.choiceId]=curr.count;return prev;},{});var locationsWithSeatsLeft=locationsWithSeats.map(function(l){return __assign(__assign({},l),{seatsLeft:Math.max(l.maxNumberOfSeats-(locationAnswers[l.locationId]||0),0)});});return {hasAnySeatsLeft:locationsWithSeatsLeft.some(function(l){return l.seatsLeft>0;}),locations:locationsWithSeatsLeft};}};var EventRegistrationRegisterSomeoneElseDialog=function EventRegistrationRegisterSomeoneElseDialog(_a){var show=_a.show,onDismiss=_a.onDismiss,onUpdate=_a.onUpdate;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var features=useFeatures();var _b=useState$2(),onBehalfOfUser=_b[0],setOnBehalfOfUser=_b[1];var item=useDetailViewContext().item;var isGroupAdmin=hasMinRoleInAllGroups(GroupRoles.Admin,user,item);useListener(EventResponseTriggerAction.type,function(action){if(action.itemId!==item.id){return false;}onUpdate({upn:onBehalfOfUser.userPrincipalName,displayName:onBehalfOfUser.displayName,locationId:action.locationId},action.response);onDismiss();return true;},[item.id,onBehalfOfUser===null||onBehalfOfUser===void 0?void 0:onBehalfOfUser.userPrincipalName]);return jsx$1(MobileFullHeightDialog,__assign({hidden:!show,modalProps:{isBlocking:true,className:'dialog-register-user'},dialogContentProps:{type:DialogType.close,title:formatMessage({id:'Events.registration.registerSomeoneElse.title'})},onDismiss:onDismiss},{children:jsxs(Host$s,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$2,{},void 0),jsx$1("label",__assign({htmlFor:"someoneElse-peoplePicker"},{children:jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.peoplePickerLabel"},void 0)}),void 0),jsx$1(StyledPeoplePicker,{accountType:AccountType.User,allowMailItems:isGroupAdmin&&features.userInvitation,localOnly:!isGroupAdmin,includePendingInvitationUsers:true,includePendingRegistrationUsers:true,selectionMode:SelectionMode.single,selectedItems:onBehalfOfUser?[onBehalfOfUser]:[],onChange:function(accounts){return setOnBehalfOfUser(accounts[0]);},placeholderStringResourceKey:"Events.registration.registerSomeoneElse.peoplePickerPlaceholder",excludedItems:[user],inputId:"someoneElse-peoplePicker"},void 0),onBehalfOfUser&&jsxs(EventRegistrationContextProvider,__assign({onBehalfOfUpn:onBehalfOfUser.userPrincipalName},{children:[jsxs(DialogMainContent,__assign({isScrollable:!env.isAnyMobileApp},{children:[!(onBehalfOfUser===null||onBehalfOfUser===void 0?void 0:onBehalfOfUser.id)&&jsx$1(InvitationInfoMessage,{subscriptionName:getSubscriptionName(user.subscription)},void 0),jsx$1(StyledPollDisplay,{},void 0)]}),void 0),jsx$1(DialogFooter,{children:jsxs(Buttons,{children:[jsx$1(CancelButton,{onClick:onDismiss},void 0),jsx$1(EventDetailViewUserRegistration,{hideInfoMessage:true},void 0)]},void 0)},void 0)]}),onBehalfOfUser.userPrincipalName)]}),void 0)}),void 0);};var Host$s=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Host",componentId:"sc-1rziepe-0"})(templateObject_1$1g||(templateObject_1$1g=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: ","px) {\n width: 400px;\n }\n\n .ms-Dialog-action {\n display: block;\n margin: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n @media (min-width: ","px) {\n width: 400px;\n }\n\n .ms-Dialog-action {\n display: block;\n margin: 0;\n }\n"])),minScreenSize.small);var Buttons=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Buttons",componentId:"sc-1rziepe-1"})(templateObject_2$K||(templateObject_2$K=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n margin-right: 4px; /* buttons alignment on the right */\n"],["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n margin-right: 4px; /* buttons alignment on the right */\n"])));var StyledPeoplePicker=_styled(PeoplePicker).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledPeoplePicker",componentId:"sc-1rziepe-2"})(templateObject_3$u||(templateObject_3$u=__makeTemplateObject(["\n margin: ","px 0 ","px 0;\n\n .ms-BasePicker-text {\n padding: 0 !important;\n }\n"],["\n margin: ","px 0 ","px 0;\n\n .ms-BasePicker-text {\n padding: 0 !important;\n }\n"])),spacingS,spacingM);var DialogMainContent=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__DialogMainContent",componentId:"sc-1rziepe-3"})(templateObject_5$i||(templateObject_5$i=__makeTemplateObject(["\n ","\n margin-bottom: auto;\n"],["\n ","\n margin-bottom: auto;\n"])),function(p){return p.isScrollable&&css$2(templateObject_4$j||(templateObject_4$j=__makeTemplateObject(["\n max-height: 300px;\n overflow: auto;\n "],["\n max-height: 300px;\n overflow: auto;\n "])));});var StyledPollDisplay=_styled(PollDisplay).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledPollDisplay",componentId:"sc-1rziepe-4"})(templateObject_6$c||(templateObject_6$c=__makeTemplateObject(["\n max-width: calc(100% - 10px);\n padding-left: 4px; // needed for the focus indicator\n"],["\n max-width: calc(100% - 10px);\n padding-left: 4px; // needed for the focus indicator\n"])));var CancelButton=function CancelButton(_a){var onClick=_a.onClick;return jsx$1(StyledCancelButton,__assign({onClick:onClick},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0);};var InvitationInfoMessage=function InvitationInfoMessage(_a){var subscriptionName=_a.subscriptionName;return jsxs(InfoMessageHost,{children:[jsx$1(InfoIcon,{iconName:"info"},void 0),jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.userWillBeInvited",values:{subscriptionName:subscriptionName}},void 0)]},void 0);};var InfoMessageHost=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__InfoMessageHost",componentId:"sc-1rziepe-5"})(templateObject_7$7||(templateObject_7$7=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n"])),spacingM);var InfoIcon=_styled(Icon).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__InfoIcon",componentId:"sc-1rziepe-6"})(templateObject_8$6||(templateObject_8$6=__makeTemplateObject(["\n padding-right: ","px;\n"],["\n padding-right: ","px;\n"])),spacingS);var StyledCancelButton=_styled(DefaultButton).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledCancelButton",componentId:"sc-1rziepe-7"})(templateObject_9$5||(templateObject_9$5=__makeTemplateObject(["\n && {\n margin-right: ","px;\n }\n"],["\n && {\n margin-right: ","px;\n }\n"])),spacingM);var DialogGlobalStyle$2=createGlobalStyle(templateObject_10$4||(templateObject_10$4=__makeTemplateObject(["\n .dialog-register-user {\n .ms-Overlay {\n background-color: transparent !important;\n }\n\n .ms-Dialog-main {\n box-shadow: none !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n min-height: 466px;\n }\n }\n"],["\n .dialog-register-user {\n .ms-Overlay {\n background-color: transparent !important;\n }\n\n .ms-Dialog-main {\n box-shadow: none !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n min-height: 466px;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$1g,templateObject_2$K,templateObject_3$u,templateObject_4$j,templateObject_5$i,templateObject_6$c,templateObject_7$7,templateObject_8$6,templateObject_9$5,templateObject_10$4;var EventRegistrationRegisterSomeoneElseButton=function EventRegistrationRegisterSomeoneElseButton(_a){var item=_a.item,onRegister=_a.onRegister,onDeregister=_a.onDeregister;var user=useCurrentUser();var _b=useState$2(false),showDialog=_b[0],setShowDialog=_b[1];if(!hasMinRoleInAllGroups(GroupRoles.Author,user,item)){return null;}return jsxs(Fragment,{children:[jsx$1(StyledButton$1,__assign({iconProps:{iconName:'AddFriend'},onClick:function(){return setShowDialog(true);}},{children:jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.title"},void 0)}),void 0),showDialog&&jsx$1(EventRegistrationRegisterSomeoneElseDialog,{onDismiss:handleDismiss,onUpdate:handleUpdate,show:showDialog},void 0)]},void 0);function handleDismiss(){setShowDialog(false);}function handleUpdate(participant,response){if(response===EventResponse.Registered){onRegister===null||onRegister===void 0?void 0:onRegister(participant);}else {onDeregister===null||onDeregister===void 0?void 0:onDeregister(participant);}}};var StyledButton$1=_styled(ActionButton).withConfig({displayName:"EventRegistrationRegisterSomeoneElseButton__StyledButton",componentId:"sc-mgwolr-0"})(templateObject_1$1f||(templateObject_1$1f=__makeTemplateObject(["\n && {\n height: auto;\n padding: 0;\n margin-bottom: ","px;\n border: 0;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n margin-bottom: ","px;\n border: 0;\n }\n"])),spacingS);var templateObject_1$1f;var EventRegistrationDeregisterPersonButton=function EventRegistrationDeregisterPersonButton(_a){var item=_a.item,participant=_a.participant,onDeregistered=_a.onDeregistered;var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var setEventRegistration=useEventRegistrationApi().setEventRegistration;var showToast=useNotificationContext().showToast;var formatMessage=useIntl().formatMessage;var _b=useState$2(false),showDialog=_b[0],setShowDialog=_b[1];if(!hasMinRoleInAllGroups(GroupRoles.Author,user,item)){return null;}return jsxs("div",{children:[jsx$1(Tooltip,__assign({resourceKey:"Events.registration.deRegisterSomeoneElse.title",values:{name:participant.displayName}},{children:jsx$1(IconButton,{iconProps:{iconName:'Delete'},onClick:function(){return setShowDialog(true);},ariaLabel:formatMessage({id:'Events.registration.deRegisterSomeoneElse.title'},{name:participant.displayName})},void 0)}),void 0),showDialog&&jsx$1(ConfirmDialog,{showDialog:showDialog,titleResourceKey:"Events.registration.deRegisterSomeoneElse.confirmTitle",titleResourceValues:{name:participant.displayName},onConfirm:deRegister,onClose:function(){return setShowDialog(false);}},void 0)]},void 0);function deRegister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:onDeregistered();return [4/*yield*/,setEventRegistration(item.id,EventResponse.NotSet,null,null,participant.upn)];case 1:_a.sent();refreshUserDetails();showToast('Events.registration.onBehalfOfDeregistrationSuccess',{mail:participant.displayName});return [2/*return*/];}});});}};var EventRegistrationParticipantsDialog=function EventRegistrationParticipantsDialog(_a){var numberOfParticipants=_a.numberOfParticipants,show=_a.show,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;return jsx$1(MobileFullHeightDialog,__assign({hidden:!show,modalProps:{isBlocking:false,className:'dialog-event-participants'},dialogContentProps:{type:DialogType.close,title:formatMessage({id:'Events.registration.participants'},{count:numberOfParticipants})},onDismiss:onDismiss},{children:jsxs(Host$r,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$1,{},void 0),jsx$1(ParticipantsList,{},void 0)]}),void 0)}),void 0);};var Host$r=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__Host",componentId:"sc-1biaauh-0"})(templateObject_1$1e||(templateObject_1$1e=__makeTemplateObject(["\n @media (min-width: ","px) {\n width: 400px;\n }\n"],["\n @media (min-width: ","px) {\n width: 400px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle$1=createGlobalStyle(templateObject_2$J||(templateObject_2$J=__makeTemplateObject(["\n .dialog-event-participants {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n height: 466px;\n }\n}\n"],["\n .dialog-event-participants {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n height: 466px;\n }\n}\n"])),maxScreenSize.small);var ParticipantsList=function ParticipantsList(){var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var getParticipants=useEventRegistrationApi().getParticipants;var textColors=useContext(ThemeContext$1).theme.textColors;var _a=useContext(PollUserContext),fetchPollResults=_a.fetchPollResults,publishableItem=_a.item;var item=publishableItem;var _b=usePromise$2(getSortedParticipants,[],[item.id]),unfilteredParticipants=_b[0],isLoading=_b[1],setParticipants=_b[3];var handleSearchDebounced=useDebouncedCallback(handleSearch,300)[0];var _c=useState$2(),filteredParticipants=_c[0],setFilteredParticipants=_c[1];var participants=filteredParticipants||unfilteredParticipants;return jsxs(ListHost,{children:[jsx$1(EventRegistrationRegisterSomeoneElseButton,{item:item,onDeregister:handleDeregister,onRegister:handleRegister},void 0),jsx$1(SearchArea,{children:jsx$1(StyledSearchBox$1,{placeholder:formatMessage({id:'Events.registration.participants.search.placeholder'}),disabled:isLoading,onChange:function(_,value){return handleSearchDebounced(unfilteredParticipants,value);},iconProps:{style:{color:textColors.default}}},void 0)},void 0),isLoading&&jsx$1(Spinner,{},void 0),jsx$1(ListContainer,__assign({isScrollable:!env.isAnyMobileApp},{children:participants.map(function(p){var showDeregisterButton=p.upn!==user.userPrincipalName;return jsxs(ListRow,{children:[jsx$1(PersonaCardWrapper,__assign({showDeregisterButton:showDeregisterButton},{children:jsx$1(StyledPersonaCard$4,__assign({upn:p.upn},{children:jsx$1(StyledAvatar$3,{upn:p.upn,text:p.displayName,secondaryText:p.location&&formatMessage({id:'Events.registration.participants.location'},{location:p.location})},void 0)}),void 0)}),void 0),showDeregisterButton&&jsx$1(EventRegistrationDeregisterPersonButton,{item:item,participant:p,onDeregistered:function(){return handleDeregister(p);}},void 0)]},p.upn);})}),void 0),!isLoading&&!participants.length&&jsx$1(FormattedMessage$1,{id:"Generic.noResultsFound"},void 0)]},void 0);function getSortedParticipants(){return __awaiter(this,void 0,void 0,function(){var numberOfLocations,locationsMap,participants;return __generator(this,function(_a){switch(_a.label){case 0:numberOfLocations=item===null||item===void 0?void 0:item.locations.length;locationsMap=getLocations();return [4/*yield*/,getParticipants(item.id)];case 1:participants=_a.sent()||[];return [2/*return*/,participants.map(function(p){return __assign(__assign({},p),{location:numberOfLocations>1?locationsMap[p.locationId]||'':''});}).sort(function(a,b){var locationCompare=(locationsMap[a.locationId]||'').localeCompare(locationsMap[b.locationId]||'');if(locationCompare!==0){return locationCompare;}return a.displayName.localeCompare(b.displayName);})];}});});}function getLocations(){var _a;return ((_a=item.locations)===null||_a===void 0?void 0:_a.reduce(function(prev,curr){prev[curr.locationId]=curr.name;return prev;},{}))||{};}function handleSearch(unfilteredParticipants,searchValue){if(!searchValue){setFilteredParticipants(null);return;}var filter=new RegExp(searchValue,'i');setFilteredParticipants(unfilteredParticipants.filter(function(p){return (p.displayName+"|"+p.upn+"|"+p.location).search(filter)>-1;}));}function handleDeregister(participant){setParticipants(function(ps){return ps.filter(function(p){return p.upn!==participant.upn;});});fetchPollResults();setFilteredParticipants(null);}function handleRegister(participant){setParticipants(function(ps){return ps.concat([__assign(__assign({},participant),{location:getLocations()[participant.locationId]||''})]);});fetchPollResults();setFilteredParticipants(null);}};var ListContainer=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListContainer",componentId:"sc-1biaauh-1"})(templateObject_4$i||(templateObject_4$i=__makeTemplateObject(["\n padding: 4px;\n\n ","\n"],["\n padding: 4px;\n\n ","\n"])),function(p){return p.isScrollable&&css$2(templateObject_3$t||(templateObject_3$t=__makeTemplateObject(["\n max-height: 382px;\n overflow: auto;\n "],["\n max-height: 382px;\n overflow: auto;\n "])));});var SearchArea=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__SearchArea",componentId:"sc-1biaauh-2"})(templateObject_5$h||(templateObject_5$h=__makeTemplateObject(["\n margin-bottom: ","px;\n display: flex;\n"],["\n margin-bottom: ","px;\n display: flex;\n"])),spacingM);var StyledSearchBox$1=_styled(SearchBox$1).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledSearchBox",componentId:"sc-1biaauh-3"})(templateObject_6$b||(templateObject_6$b=__makeTemplateObject(["\n flex-grow: 1;\n"],["\n flex-grow: 1;\n"])));var ListRow=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListRow",componentId:"sc-1biaauh-4"})(templateObject_7$6$1||(templateObject_7$6$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n margin-bottom: ","px;\n"])),spacingS);var PersonaCardWrapper=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__PersonaCardWrapper",componentId:"sc-1biaauh-5"})(templateObject_8$5$1||(templateObject_8$5$1=__makeTemplateObject(["\n width: calc(100% - ","px);\n"],["\n width: calc(100% - ","px);\n"])),function(p){return p.showDeregisterButton?32:0;});var StyledPersonaCard$4=_styled(PersonaCard).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledPersonaCard",componentId:"sc-1biaauh-6"})(templateObject_9$4||(templateObject_9$4=__makeTemplateObject(["\n width: 100%;\n\n & > * {\n width: 100%;\n }\n"],["\n width: 100%;\n\n & > * {\n width: 100%;\n }\n"])));var StyledAvatar$3=_styled(Avatar).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledAvatar",componentId:"sc-1biaauh-7"})(templateObject_10$3$1||(templateObject_10$3$1=__makeTemplateObject(["\n .ms-Persona-secondaryText {\n white-space: initial;\n }\n\n height: auto;\n\n > div:first-child {\n align-self: flex-start;\n }\n"],["\n .ms-Persona-secondaryText {\n white-space: initial;\n }\n\n height: auto;\n\n > div:first-child {\n align-self: flex-start;\n }\n"])));var ListHost=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListHost",componentId:"sc-1biaauh-8"})(templateObject_11$2$1||(templateObject_11$2$1=__makeTemplateObject([""],[""])));var templateObject_1$1e,templateObject_2$J,templateObject_3$t,templateObject_4$i,templateObject_5$h,templateObject_6$b,templateObject_7$6$1,templateObject_8$5$1,templateObject_9$4,templateObject_10$3$1,templateObject_11$2$1;var EventRegistrationParticipantsLink=function EventRegistrationParticipantsLink(){var _a;var user=useCurrentUser();var _b=useContext(PollUserContext),pollResult=_b.pollResult,publishableItem=_b.item;var item=publishableItem;var _c=useState$2(false),showParticipants=_c[0],setShowParticipants=_c[1];var palette=useContext(ThemeContext$1).theme.palette;if(user.isPublicUser||(pollResult===null||pollResult===void 0?void 0:pollResult.totalFeedbackCount)==null){return null;}var isUserAuthor=hasMinRoleInAllGroups(GroupRoles.Author,user,item);var canOpenParticipantsDialog=isUserAuthor||pollResult.totalFeedbackCount>0&&((_a=item.registrationSettings)===null||_a===void 0?void 0:_a.showParticipantsToEverybody);return jsxs("div",__assign({"data-poll-result-total-count":pollResult.totalFeedbackCount},{children:[!canOpenParticipantsDialog?jsx$1(NoParticipantsContainer,{children:jsx$1(FormattedMessage$1,{id:"Events.registration.participants.count",values:{count:pollResult.totalFeedbackCount}},void 0)},void 0):jsx$1(ParticipantsButton,__assign({onClick:function(){return setShowParticipants(true);},color:palette.accent},{children:jsx$1(FormattedMessage$1,{id:isUserAuthor?'Events.registration.participants.viewAndManage':'Events.registration.participants.count',values:{count:pollResult.totalFeedbackCount}},void 0)}),void 0),jsx$1(EventRegistrationParticipantsDialog,{numberOfParticipants:pollResult.totalFeedbackCount,show:showParticipants,onDismiss:function(){return setShowParticipants(false);}},void 0)]}),void 0);};var NoParticipantsContainer=_styled.div.withConfig({displayName:"EventRegistrationParticipantsLink__NoParticipantsContainer",componentId:"sc-44nkgi-0"})(templateObject_1$1d||(templateObject_1$1d=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n"],["\n color: ",";\n font-size: ","px;\n"])),function(p){return p.theme.palette.neutralTertiary;},fontSizeSmall);var ParticipantsButton=_styled(ActionButton).withConfig({displayName:"EventRegistrationParticipantsLink__ParticipantsButton",componentId:"sc-44nkgi-1"})(templateObject_2$I||(templateObject_2$I=__makeTemplateObject(["\n && {\n height: auto;\n padding: 0;\n font-size: ","px;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n font-size: ","px;\n }\n"])),fontSizeSmall);var templateObject_1$1d,templateObject_2$I;var EventDetailViewRegistrationPoll=function EventDetailViewRegistrationPoll(){return jsx$1(EventRegistrationContextProvider,{children:jsxs(StyledPollDisplay$1,{children:[jsx$1(EventRegistrationParticipantsLink,{},void 0),jsx$1(StyledEventUserRegistration,{},void 0),jsx$1(StyledResponseExportButton,{},void 0)]},void 0)},void 0);};var StyledEventUserRegistration=_styled(EventDetailViewUserRegistration).withConfig({displayName:"EventDetailViewRegistrationPoll__StyledEventUserRegistration",componentId:"sc-1kxjndz-0"})(templateObject_1$1c||(templateObject_1$1c=__makeTemplateObject(["\n && {\n margin-top: ","px;\n }\n"],["\n && {\n margin-top: ","px;\n }\n"])),spacingS);var StyledResponseExportButton=_styled(EventDetailViewResponseExportButton).withConfig({displayName:"EventDetailViewRegistrationPoll__StyledResponseExportButton",componentId:"sc-1kxjndz-1"})(templateObject_2$H||(templateObject_2$H=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$1c,templateObject_2$H;var EventDetailViewRegistration=function EventDetailViewRegistration(){var item=useDetailViewContext().item;var isRegistrationEnabled=item.registrationSettings&&item.registrationSettings.enabled;if(isRegistrationEnabled){return jsx$1(EventDetailViewRegistrationPoll,{},void 0);}return jsx$1(DetailViewPoll,{},void 0);};var EventDetailViewCancelInformation=function EventDetailViewCancelInformation(){var _a=useDetailViewContext(),item=_a.item,contentLanguage=_a.contentLanguage;return jsx$1(EventCancelInformation,{item:item,language:contentLanguage},void 0);};var classof$a=classofRaw$1;// `IsArray` abstract operation
|
|
131986
131989
|
// https://tc39.github.io/ecma262/#sec-isarray
|
|
131987
131990
|
var isArray$3=Array.isArray||function isArray(arg){return classof$a(arg)=='Array';};var $$3=_export;var isArray$2=isArray$3;var nativeReverse$1=[].reverse;var test$3=[1,2];// `Array.prototype.reverse` method
|
|
131988
131991
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reverse
|
|
@@ -132008,7 +132011,7 @@ if(container.current&&location.hash==='#comments'){setTimeout(function(){return
|
|
|
132008
132011
|
if((_a=match.params)===null||_a===void 0?void 0:_a.threadId){history.push(__assign(__assign({},location),{pathname:buildPath("/"+type+"/"+item.id)}));}setThreadId(null);}function hasFeedbackEnabled(feedbackType){return hasFeedbackType(feedbackSettings||{},feedbackType);}function handleOnShowAllComments(){var _a;setThreadId(null);if((_a=match.params)===null||_a===void 0?void 0:_a.threadId){history.push(__assign(__assign({},location),{pathname:buildPath(type+"/"+item.id)}));}}};var StyledFeedbackButtons=_styled(FeedbackButtons).withConfig({displayName:"FeedbackSection__StyledFeedbackButtons",componentId:"sc-3bzj8d-0"})(templateObject_1$15||(templateObject_1$15=__makeTemplateObject(["\n padding-bottom: ",";\n @media (max-width: 500px) {\n margin-bottom: 15px;\n }\n"],["\n padding-bottom: ",";\n @media (max-width: 500px) {\n margin-bottom: 15px;\n }\n"])),function(p){return p.showComments?'15px':'30px';});var templateObject_1$15;var FeedbackButtonLike=function FeedbackButtonLike(_a){var isReadOnly=_a.isReadOnly;var refreshStatistics=useNewsApi().refreshStatistics;var features=useFeatures();var _b=useContext(FeedbackButtonContext),item=_b.item,likeCount=_b.statistics.likeCount,resourceType=_b.resourceType,hasFeedbackEnabled=_b.hasFeedbackEnabled;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var showError=useNotificationContext().showError;var _d=usePromise$2(getLikeState,false,[item.id]),isLiked=_d[0],isLoading=_d[1],setIsLiked=_d[3];var _e=useState$2(false),isSaving=_e[0],setIsSaving=_e[1];if(!features.likes||!hasFeedbackEnabled('like')){return null;}return jsx$1(LikeButton,{itemType:resourceType,itemId:item.id,isActive:isLiked,readOnly:isLoading||isSaving||isReadOnly,count:likeCount,onClick:function(){return handleLikeChanged(!isLiked);},isDemoContent:item.isDemoContent},void 0);function getLikeState(){var _a;return __awaiter(this,void 0,void 0,function(){var hasPublishedVersion,feedbackSummary;return __generator(this,function(_b){switch(_b.label){case 0:hasPublishedVersion=item.publishedVersionId!=null||item.isCurrentPublishedVersion;if(isReadOnly&&!hasPublishedVersion){return [2/*return*/,false];}if(!features.likes||!hasFeedbackEnabled('like')){return [2/*return*/,false];}return [4/*yield*/,getFeedback(resourceType,item.id)];case 1:feedbackSummary=_b.sent();return [2/*return*/,((_a=feedbackSummary.records)===null||_a===void 0?void 0:_a.findIndex(function(r){return r.type==='like';}))>-1];}});});}function handleLikeChanged(isNowLiked){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving||isLoading){return [2/*return*/];}setIsSaving(true);setIsLiked(isNowLiked);return [4/*yield*/,refreshStatistics(item.id,{likeCount:isNowLiked?1:-1})];case 1:_b.sent();_b.label=2;case 2:_b.trys.push([2,7,9,10]);if(!isNowLiked)return [3/*break*/,4];return [4/*yield*/,setFeedback(resourceType,item.id,'like')];case 3:_b.sent();return [3/*break*/,6];case 4:return [4/*yield*/,unsetFeedback(resourceType,item.id,'like')];case 5:_b.sent();_b.label=6;case 6:return [3/*break*/,10];case 7:_b.sent();setIsLiked(!isNowLiked);return [4/*yield*/,refreshStatistics(item.id,{likeCount:isNowLiked?-1:1})];case 8:_b.sent();showError('NewsArticle.setFeedback_error');return [3/*break*/,10];case 9:setIsSaving(false);return [7/*endfinally*/];case 10:return [2/*return*/];}});});}};var FeedbackButtonComments=function FeedbackButtonComments(){var features=useFeatures();var formatMessage=useIntl().formatMessage;var _a=useContext(FeedbackButtonContext),commentCount=_a.statistics.commentCount,resourceType=_a.resourceType,hasFeedbackEnabled=_a.hasFeedbackEnabled;if(!features.comments||!hasFeedbackEnabled('comment')){return null;}return jsx$1(FeedbackCountButton,{count:commentCount,iconName:"Chat",readOnly:true,tooltipResourceKey:resourceType===ItemResourceTypes.Pages?'Page.numberOfComments':'NewsArticle.numberOfComments',tooltipResourceKeyValues:{count:commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),feedbackType:"comment"},void 0);};var FeedbackButtonViews=function FeedbackButtonViews(){var _a=useContext(FeedbackButtonContext),readCount=_a.statistics.readCount,resourceType=_a.resourceType;var formatMessage=useIntl().formatMessage;var resourceKey=getResourceKey();return jsx$1(FeedbackCountButton,{count:readCount,iconName:"View",readOnly:true,tooltipResourceKey:resourceKey,tooltipResourceKeyValues:{count:readCount},ariaLabel:formatMessage({id:resourceKey},{count:readCount}),feedbackType:"view"},void 0);function getResourceKey(){if(resourceType===ItemResourceTypes.Pages){return 'Page.readersTooltip';}if(resourceType===ItemResourceTypes.News){return 'NewsArticle.readersTooltip';}return 'Events.readersTooltip';}};var EventDownloadCalendarFileButton=function EventDownloadCalendarFileButton(_a){var item=_a.item,className=_a.className;var user=useCurrentUser();var createApiUrl=useApiFactory().createApiUrl;var formatMessage=useIntl().formatMessage;return jsx$1(Host$p,__assign({className:className},{children:jsx$1(Tooltip,__assign({resourceKey:"Events.downloadCalendarFile"},{children:jsx$1(DownloadLink,__assign({href:getDownloadUrl(),"aria-label":formatMessage({id:'Events.downloadCalendarFile'})},{children:jsx$1(Icon,{iconName:"AddEvent"},void 0)}),void 0)}),void 0)}),void 0);function getDownloadUrl(){return createApiUrl("/events/"+encodeURI(item.id)+"/export",{access_token:item.fileAccessToken,subscriptionId:user.subscription.id});}};var Host$p=_styled.div.withConfig({displayName:"EventDownloadCalendarFileButton__Host",componentId:"sc-1hjuosf-0"})(templateObject_1$14||(templateObject_1$14=__makeTemplateObject(["\n && {\n > div {\n display: inline-block;\n }\n\n i {\n font-size: 22px;\n }\n }\n"],["\n && {\n > div {\n display: inline-block;\n }\n\n i {\n font-size: 22px;\n }\n }\n"])));var DownloadLink=_styled.a.withConfig({displayName:"EventDownloadCalendarFileButton__DownloadLink",componentId:"sc-1hjuosf-1"})(templateObject_2$B||(templateObject_2$B=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ","px;\n width: ","px;\n color: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ","px;\n width: ","px;\n color: ",";\n"])),feedbackButtonHeight,feedbackButtonHeight,function(p){return p.theme.textColors.default;});var templateObject_1$14,templateObject_2$B;var EventFeedbackButtonDownloadCalendarFile=function EventFeedbackButtonDownloadCalendarFile(){var item=useContext(FeedbackButtonContext).item;return jsx$1(StyledEventDownloadCalendarFileButton,{item:item},void 0);};var StyledEventDownloadCalendarFileButton=_styled(EventDownloadCalendarFileButton).withConfig({displayName:"EventFeedbackButtonDownloadCalendarFile__StyledEventDownloadCalendarFileButton",componentId:"sc-dsznxm-0"})(templateObject_1$13||(templateObject_1$13=__makeTemplateObject(["\n min-width: 60px;\n margin-right: 9px;\n"],["\n min-width: 60px;\n margin-right: 9px;\n"])));var templateObject_1$13;var ShareButton=function ShareButton(_a){var url=_a.url,isReadOnly=_a.isReadOnly,className=_a.className;var copyContainerRef=useRef$1();var _b=useState$2(false),didCopy=_b[0],setDidCopy=_b[1];var onShare=useContext(LinkContext).onShare;var formatMessage=useIntl().formatMessage;return jsx$1(Host$o,__assign({className:className},{children:jsx$1(Tooltip,__assign({resourceKey:"ShareButton.ActionDescription"},{children:jsxs(StyledIconWithCallout,__assign({icon:"Share",onIconClick:function(){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,onShare(url)];case 1:return [2/*return*/,_a.sent()];}});});},onCalloutDismissed:function(){return setDidCopy(false);},directionalHint:DirectionalHint.topAutoEdge,ariaLabel:formatMessage({id:'ShareButton.ActionDescription'}),disabled:isReadOnly},{children:[jsx$1(FormattedMessage$1,{id:"ShareButton.ActionDescription"},void 0),jsxs(CopyContainer,__assign({ref:copyContainerRef},{children:[jsx$1(CopyField,{value:url,readOnly:true,onFocus:handleTextFieldFocus,onMouseUp:function(e){return e.preventDefault();},ariaLabel:formatMessage({id:'AriaLabel.shareButton.copyField'})},void 0),jsx$1(CopyIconButton,{iconProps:{iconName:'Copy'},onClick:copyToClipBoard,ariaLabel:formatMessage({id:'AriaLabel.copyText'})},void 0)]}),void 0),didCopy&&jsx$1(FormattedMessage$1,{id:"ShareButton.CopySuccess"},void 0)]}),void 0)}),void 0)}),void 0);function copyToClipBoard(){var tempTextField=document.createElement('textarea');tempTextField.innerText=url;copyContainerRef.current.appendChild(tempTextField);tempTextField.select();document.execCommand('copy');copyContainerRef.current.removeChild(tempTextField);setDidCopy(true);}function handleTextFieldFocus(event){event.target.select();}};var Host$o=_styled.div.withConfig({displayName:"ShareButton__Host",componentId:"sc-6avyh0-0"})(templateObject_1$12||(templateObject_1$12=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIconWithCallout=_styled(IconWithCallout).withConfig({displayName:"ShareButton__StyledIconWithCallout",componentId:"sc-6avyh0-1"})(templateObject_2$A||(templateObject_2$A=__makeTemplateObject(["\n button {\n height: ","px;\n }\n\n i {\n font-size: ","px;\n }\n"],["\n button {\n height: ","px;\n }\n\n i {\n font-size: ","px;\n }\n"])),feedbackButtonHeight,fontSizeMedium+4);var CopyContainer=_styled.div.withConfig({displayName:"ShareButton__CopyContainer",componentId:"sc-6avyh0-2"})(templateObject_3$p||(templateObject_3$p=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 15px 0;\n"],["\n display: flex;\n align-items: center;\n padding: 15px 0;\n"])));var CopyField=_styled(TextField).withConfig({displayName:"ShareButton__CopyField",componentId:"sc-6avyh0-3"})(templateObject_4$f||(templateObject_4$f=__makeTemplateObject(["\n padding-right: ","px;\n width: 400px;\n"],["\n padding-right: ","px;\n width: 400px;\n"])),spacingS);var CopyIconButton=_styled(IconButton).withConfig({displayName:"ShareButton__CopyIconButton",componentId:"sc-6avyh0-4"})(templateObject_5$e||(templateObject_5$e=__makeTemplateObject(["\n i {\n font-size: ","px;\n }\n"],["\n i {\n font-size: ","px;\n }\n"])),fontSizeMedium+4);var templateObject_1$12,templateObject_2$A,templateObject_3$p,templateObject_4$f,templateObject_5$e;var FeedbackButtonShare=function FeedbackButtonShare(_a){var isReadOnly=_a.isReadOnly;var item=useContext(FeedbackButtonContext).item;return jsx$1(ShareButton,{url:item.permalink,isReadOnly:isReadOnly},void 0);};var ConfirmationStatistics=function ConfirmationStatistics(_a){var count=_a.count;return jsxs(Host$n,{children:[jsx$1(Icon,{iconName:"Accept"},void 0),jsx$1(FormattedMessage$1,{id:'NewsArticle.feedback.statistic.label',values:{count:count}},void 0)]},void 0);};var Host$n=_styled.div.withConfig({displayName:"ConfirmationStatistics__Host",componentId:"sc-1wprhw1-0"})(templateObject_1$11||(templateObject_1$11=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n\n i {\n margin-right: ","px;\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n display: inline-flex;\n align-items: center;\n\n i {\n margin-right: ","px;\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),spacingXs-1,maxScreenSize.medium,fontSizeSmall);var templateObject_1$11;var ConfirmationStatisticsExport=function ConfirmationStatisticsExport(_a){var item=_a.item;var createApiUrl=useApiFactory().createApiUrl;var formatMessage=useIntl().formatMessage;var exchangeShortLivedToken=useFileAccessTokenApi().exchangeShortLivedToken;return jsx$1(Host$m,__assign({resourceKey:"DownloadButton.downloadTooltip"},{children:jsx$1(DownloadButton$1,{onClick:startDownload,iconProps:{iconName:'Download'},"aria-label":formatMessage({id:'AriaLabel.confirmationStatisticsExportButton'})},void 0)}),void 0);function startDownload(){return __awaiter(this,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,exchangeShortLivedToken(item.fileAccessToken)];case 1:token=_a.sent();window.open(getFileUrlWithToken(item.id,token||item.fileAccessToken));return [2/*return*/];}});});}function getFileUrlWithToken(newsId,fileDownloadToken){return createApiUrl("/news/"+newsId+"/statistics/confirmations",{access_token:fileDownloadToken});}};var DownloadButton$1=_styled(IconButton$1).withConfig({displayName:"ConfirmationStatisticsExport__DownloadButton",componentId:"sc-1gesr6p-0"})(templateObject_1$10||(templateObject_1$10=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var Host$m=_styled(Tooltip).withConfig({displayName:"ConfirmationStatisticsExport__Host",componentId:"sc-1gesr6p-1"})(templateObject_2$z||(templateObject_2$z=__makeTemplateObject(["\n && {\n display: inline-flex;\n align-items: center;\n }\n"],["\n && {\n display: inline-flex;\n align-items: center;\n }\n"])));var templateObject_1$10,templateObject_2$z;var FeedbackButtonConfirmations=function FeedbackButtonConfirmations(){var features=useFeatures();var user=useCurrentUser();var _a=useContext(FeedbackButtonContext),item=_a.item,confirmationCount=_a.statistics.confirmationCount,hasFeedbackEnabled=_a.hasFeedbackEnabled;if(!features.confirmation||!hasFeedbackEnabled('confirm')||!hasMinRoleInSomeGroups(GroupRoles.Author,user,item)){return null;}return jsxs(Host$l,{children:[jsx$1(ConfirmationStatistics,{count:confirmationCount},void 0),jsx$1(ConfirmationStatisticsExport,{item:item},void 0)]},void 0);};var Host$l=_styled.span.withConfig({displayName:"FeedbackButtonConfirmations__Host",componentId:"sc-sgky21-0"})(templateObject_1$$||(templateObject_1$$=__makeTemplateObject(["\n margin-left: 30px;\n\n @media all and (max-width: ","px) {\n margin-left: 0;\n width: 100%;\n }\n"],["\n margin-left: 30px;\n\n @media all and (max-width: ","px) {\n margin-left: 0;\n width: 100%;\n }\n"])),maxScreenSize.medium);var templateObject_1$$;var EventDetailViewFeedbackSection=function EventDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage;// Info: We need this check so that in Teams on mobile we don't show the
|
|
132009
132012
|
return jsxs(StyledFeedbackSection$2,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(EventFeedbackButtonDownloadCalendarFile,{},void 0),jsx$1(FeedbackButtonShare,{},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection$2=_styled(FeedbackSection).withConfig({displayName:"EventDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-1m82rje-0"})(templateObject_1$_||(templateObject_1$_=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$_;var EventDetailViewPlugins=function EventDetailViewPlugins(_a){var eventItem=_a.eventItem;return jsx$1(Host$k,{area:ExtensionArea.eventDetailViewSection,eventItem:eventItem},void 0);};var Host$k=_styled(Plugins)(templateObject_1$Z||(templateObject_1$Z=__makeTemplateObject(["\n margin: auto -","px;\n padding: 0 ","px;\n\n @media (min-width: ","px) {\n margin: auto -","px;\n padding: 0 ","px;\n }\n"],["\n margin: auto -","px;\n padding: 0 ","px;\n\n @media (min-width: ","px) {\n margin: auto -","px;\n padding: 0 ","px;\n }\n"])),spacingM,spacingM,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$Z;var DateMode;(function(DateMode){DateMode[DateMode["Published"]=0]="Published";DateMode[DateMode["Modified"]=1]="Modified";})(DateMode||(DateMode={}));var DateInfo$1=function DateInfo(_a){var item=_a.item,dateMode=_a.dateMode,expiryDate=_a.expiryDate,className=_a.className;var features=useFeatures();return jsxs("span",__assign({className:className},{children:[dateMode===DateMode.Modified&&getModifiedInfo(),dateMode===DateMode.Published&&getPublishInfo(),expiryDate&&features.expiryDate&&getArchiveInfo()]}),void 0);function getPublishInfo(){var format=isSameDay(item.publishingDate)?'relative':'absolute';if(!item.publishingDate){if(item.status!==WorkflowStatus.approved){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishWhenApproved"},void 0);}return jsx$1(FormattedMessage$1,{id:"DateInfo.published"},void 0);}var values={start:jsx$1(DateTime,{value:item.publishingDate},void 0)};if(new Date(item.publishingDate)>=new Date()){return jsx$1(FormattedMessage$1,{id:item.status!==WorkflowStatus.approved?"DateInfo.publishOnIfApproved."+format:"DateInfo.publishOn."+format,values:values},void 0);}if(item.status===WorkflowStatus.approved){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishedOn."+format,values:values},void 0);}if(!!item.publishedVersionId){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishedWithPendingEdits."+format,values:values},void 0);}return jsx$1(FormattedMessage$1,{id:"DateInfo.missingApproval."+format,values:values},void 0);}function getArchiveInfo(){var format=isSameDay(expiryDate)?'relative':'absolute';var values={end:jsx$1(DateTime,{value:expiryDate},void 0)};if(new Date(expiryDate)<new Date()){// if already expired
|
|
132010
132013
|
return jsxs("span",{children:[",\u00A0",jsx$1(FormattedMessage$1,{id:"DateInfo.archivedOn."+format,values:values},void 0)]},void 0);}else {// not yet expired
|
|
132011
|
-
return jsxs("span",{children:[",",' ',jsx$1(FormattedMessage$1,{id:"DateInfo.archiveOn."+format,values:values},void 0)]},void 0);}}function getModifiedInfo(){var date=item.modified||item.created||new Date();var format=isSameDay(date)?'relative':'absolute';return jsx$1("span",{children:jsx$1(FormattedMessage$1,{id:"DateInfo.modifiedOn."+format,values:{modified:jsx$1(ModifiedDateTime,{value:date},void 0)}},void 0)},void 0);}};var ModifiedDateTime=_styled(DateTime).withConfig({displayName:"DateInfo__ModifiedDateTime",componentId:"sc-xnzpy3-0"})(templateObject_1$Y||(templateObject_1$Y=__makeTemplateObject(["\n &&& {\n text-decoration: none;\n }\n"],["\n &&& {\n text-decoration: none;\n }\n"])));var templateObject_1$Y;var getAuthor=function getAuthor(item){return item.onBehalfOf||item.owner||item.author||{};};var getRealAuthor=function getRealAuthor(item){return item.owner||item.author||{};};var ItemMetaInfo=function ItemMetaInfo(_a){var item=_a.item,className=_a.className,expiryDate=_a.expiryDate,showChannels=_a.showChannels,dateMode=_a.dateMode,channels=_a.channels,_b=_a.readOnly,readOnly=_b===void 0?true:_b,_c=_a.hideAvatar,hideAvatar=_c===void 0?false:_c,hideDisplayName=_a.hideDisplayName,language=_a.language,buildChannelFilterUrl=_a.buildChannelFilterUrl,_d=_a.clickableAvatar,clickableAvatar=_d===void 0?true:_d;var hasChannels=channels&&channels.length>0;var onBehalfAuthor=getAuthor(item);var realAuthor=getRealAuthor(item);return jsxs(Host$j,__assign({className:className,"data-item-metadata":true},{children:[!hideAvatar&&jsx$1(PersonaCard,__assign({upn:onBehalfAuthor.userPrincipalName,readOnly:!clickableAvatar,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:onBehalfAuthor.userPrincipalName,text:onBehalfAuthor.displayName,secondaryText:onBehalfAuthor.userPrincipalName,hidePersonaDetails:true,coinSize:55},void 0)}),void 0),jsxs(InfoDetailsHost,__assign({"data-meta-info-details":true},{children:[!hideDisplayName&&jsx$1(AuthorContainer,{children:jsx$1(AuthorName$1,{author:onBehalfAuthor,readOnly:readOnly},void 0)},void 0),jsxs(DateAndChannels,{children:[jsx$1(DateInfo$1,{item:item,dateMode:dateMode,expiryDate:expiryDate},void 0),"\u00A0",showChannels&&jsx$1(Fragment,{children:hasChannels?jsx$1(FormattedMessage$1,{id:"NewsMetaInfo.channels",values:{channels:jsxs(Fragment,{children:["\u00A0",jsx$1(Channels$1,{channels:channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:buildChannelFilterUrl},void 0)]},void 0)}},void 0):jsx$1(FormattedMessage$1,{id:"NewsMetaInfo.noChannels"},void 0)},void 0)]},void 0),!hideDisplayName&&realAuthor&&realAuthor.userPrincipalName!==onBehalfAuthor.userPrincipalName&&jsx$1(AuthorContainer,{children:jsx$1(FormattedMessage$1,{id:"MetaInfo.writtenBy",values:{author:jsx$1(AuthorName$1,{author:realAuthor,readOnly:readOnly},void 0)}},void 0)},void 0)]}),void 0)]}),void 0);};var Host$j=_styled.div.withConfig({displayName:"ItemMetaInfo__Host",componentId:"sc-1d6drj8-0"})(templateObject_1$X||(templateObject_1$X=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var InfoDetailsHost=_styled.div.withConfig({displayName:"ItemMetaInfo__InfoDetailsHost",componentId:"sc-1d6drj8-1"})(templateObject_2$y||(templateObject_2$y=__makeTemplateObject(["\n padding-left: 8px;\n display: flex;\n flex-flow: column;\n justify-content: center;\n word-wrap: break-word;\n text-align: left;\n"],["\n padding-left: 8px;\n display: flex;\n flex-flow: column;\n justify-content: center;\n word-wrap: break-word;\n text-align: left;\n"])));var AuthorContainer=_styled.div.withConfig({displayName:"ItemMetaInfo__AuthorContainer",componentId:"sc-1d6drj8-2"})(templateObject_3$o||(templateObject_3$o=__makeTemplateObject(["\n font-style: normal;\n display: inline-block;\n"],["\n font-style: normal;\n display: inline-block;\n"])));var DateAndChannels=_styled.div.withConfig({displayName:"ItemMetaInfo__DateAndChannels",componentId:"sc-1d6drj8-3"})(templateObject_4$e$1||(templateObject_4$e$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var AuthorName$1=function AuthorName(_a){var author=_a.author,readOnly=_a.readOnly;if(!readOnly){return jsx$1(Fragment,{children:author.displayName},void 0);}return jsx$1(PrimaryPersonaCard,__assign({upn:author.userPrincipalName},{children:author.displayName}),void 0);};var PrimaryPersonaCard=_styled(PersonaCard).withConfig({displayName:"ItemMetaInfo__PrimaryPersonaCard",componentId:"sc-1d6drj8-4"})(templateObject_5$d||(templateObject_5$d=__makeTemplateObject(["\n color: ",";\n text-decoration: underline;\n"],["\n color: ",";\n text-decoration: underline;\n"])),function(p){return p.theme.palette.accent;});var Channels$1=_styled(ClickableChannelTitles).withConfig({displayName:"ItemMetaInfo__Channels",componentId:"sc-1d6drj8-5"})(templateObject_6$8$1||(templateObject_6$8$1=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$X,templateObject_2$y,templateObject_3$o,templateObject_4$e$1,templateObject_5$d,templateObject_6$8$1;var PageDetailViewMetaInfo=function PageDetailViewMetaInfo(){var _a=useDetailViewContext(),item=_a.item,userPreferredLanguage=_a.userPreferredLanguage;return jsx$1(DetailMetaInfo$1,{item:item,dateMode:DateMode.Modified,language:userPreferredLanguage},void 0);};var DetailMetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"PageDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-1yz7bl7-0"})(templateObject_1$W||(templateObject_1$W=__makeTemplateObject(["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ","px) {\n font-size: 14px;\n }\n"],["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ","px) {\n font-size: 14px;\n }\n"])),minScreenSize.small);var templateObject_1$W;var PageDetailViewFeedbackSection=function PageDetailViewFeedbackSection(_a){var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType,contentLanguage=_b.contentLanguage;return jsxs(StyledFeedbackSection$1,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:item.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{},void 0)]}),void 0);};var StyledFeedbackSection$1=_styled(FeedbackSection).withConfig({displayName:"PageDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-12s3v5d-0"})(templateObject_1$V||(templateObject_1$V=__makeTemplateObject(["\n ",";\n &[data-comment-section] {\n padding-bottom: ","px;\n\n @media (min-width: ","px) {\n padding-bottom: 0;\n }\n }\n"],["\n ",";\n &[data-comment-section] {\n padding-bottom: ","px;\n\n @media (min-width: ","px) {\n padding-bottom: 0;\n }\n }\n"])),DetailViewSectionPadding,spacingXl+10,minScreenSize.small);var templateObject_1$V;var PageTocSearch=function PageTocSearch(_a){var onSearch=_a.onSearch,onSearchResultChange=_a.onSearchResultChange;var formatMessage=useIntl().formatMessage;var onDebouncedSearch=useDebouncedCallback
|
|
132014
|
+
return jsxs("span",{children:[",",' ',jsx$1(FormattedMessage$1,{id:"DateInfo.archiveOn."+format,values:values},void 0)]},void 0);}}function getModifiedInfo(){var date=item.modified||item.created||new Date();var format=isSameDay(date)?'relative':'absolute';return jsx$1("span",{children:jsx$1(FormattedMessage$1,{id:"DateInfo.modifiedOn."+format,values:{modified:jsx$1(ModifiedDateTime,{value:date},void 0)}},void 0)},void 0);}};var ModifiedDateTime=_styled(DateTime).withConfig({displayName:"DateInfo__ModifiedDateTime",componentId:"sc-xnzpy3-0"})(templateObject_1$Y||(templateObject_1$Y=__makeTemplateObject(["\n &&& {\n text-decoration: none;\n }\n"],["\n &&& {\n text-decoration: none;\n }\n"])));var templateObject_1$Y;var getAuthor=function getAuthor(item){return item.onBehalfOf||item.owner||item.author||{};};var getRealAuthor=function getRealAuthor(item){return item.owner||item.author||{};};var ItemMetaInfo=function ItemMetaInfo(_a){var item=_a.item,className=_a.className,expiryDate=_a.expiryDate,showChannels=_a.showChannels,dateMode=_a.dateMode,channels=_a.channels,_b=_a.readOnly,readOnly=_b===void 0?true:_b,_c=_a.hideAvatar,hideAvatar=_c===void 0?false:_c,hideDisplayName=_a.hideDisplayName,language=_a.language,buildChannelFilterUrl=_a.buildChannelFilterUrl,_d=_a.clickableAvatar,clickableAvatar=_d===void 0?true:_d;var hasChannels=channels&&channels.length>0;var onBehalfAuthor=getAuthor(item);var realAuthor=getRealAuthor(item);return jsxs(Host$j,__assign({className:className,"data-item-metadata":true},{children:[!hideAvatar&&jsx$1(PersonaCard,__assign({upn:onBehalfAuthor.userPrincipalName,readOnly:!clickableAvatar,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:onBehalfAuthor.userPrincipalName,text:onBehalfAuthor.displayName,secondaryText:onBehalfAuthor.userPrincipalName,hidePersonaDetails:true,coinSize:55},void 0)}),void 0),jsxs(InfoDetailsHost,__assign({"data-meta-info-details":true},{children:[!hideDisplayName&&jsx$1(AuthorContainer,{children:jsx$1(AuthorName$1,{author:onBehalfAuthor,readOnly:readOnly},void 0)},void 0),jsxs(DateAndChannels,{children:[jsx$1(DateInfo$1,{item:item,dateMode:dateMode,expiryDate:expiryDate},void 0),"\u00A0",showChannels&&jsx$1(Fragment,{children:hasChannels?jsx$1(FormattedMessage$1,{id:"NewsMetaInfo.channels",values:{channels:jsxs(Fragment,{children:["\u00A0",jsx$1(Channels$1,{channels:channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:buildChannelFilterUrl},void 0)]},void 0)}},void 0):jsx$1(FormattedMessage$1,{id:"NewsMetaInfo.noChannels"},void 0)},void 0)]},void 0),!hideDisplayName&&realAuthor&&realAuthor.userPrincipalName!==onBehalfAuthor.userPrincipalName&&jsx$1(AuthorContainer,{children:jsx$1(FormattedMessage$1,{id:"MetaInfo.writtenBy",values:{author:jsx$1(AuthorName$1,{author:realAuthor,readOnly:readOnly},void 0)}},void 0)},void 0)]}),void 0)]}),void 0);};var Host$j=_styled.div.withConfig({displayName:"ItemMetaInfo__Host",componentId:"sc-1d6drj8-0"})(templateObject_1$X||(templateObject_1$X=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var InfoDetailsHost=_styled.div.withConfig({displayName:"ItemMetaInfo__InfoDetailsHost",componentId:"sc-1d6drj8-1"})(templateObject_2$y||(templateObject_2$y=__makeTemplateObject(["\n padding-left: 8px;\n display: flex;\n flex-flow: column;\n justify-content: center;\n word-wrap: break-word;\n text-align: left;\n"],["\n padding-left: 8px;\n display: flex;\n flex-flow: column;\n justify-content: center;\n word-wrap: break-word;\n text-align: left;\n"])));var AuthorContainer=_styled.div.withConfig({displayName:"ItemMetaInfo__AuthorContainer",componentId:"sc-1d6drj8-2"})(templateObject_3$o||(templateObject_3$o=__makeTemplateObject(["\n font-style: normal;\n display: inline-block;\n"],["\n font-style: normal;\n display: inline-block;\n"])));var DateAndChannels=_styled.div.withConfig({displayName:"ItemMetaInfo__DateAndChannels",componentId:"sc-1d6drj8-3"})(templateObject_4$e$1||(templateObject_4$e$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var AuthorName$1=function AuthorName(_a){var author=_a.author,readOnly=_a.readOnly;if(!readOnly){return jsx$1(Fragment,{children:author.displayName},void 0);}return jsx$1(PrimaryPersonaCard,__assign({upn:author.userPrincipalName},{children:author.displayName}),void 0);};var PrimaryPersonaCard=_styled(PersonaCard).withConfig({displayName:"ItemMetaInfo__PrimaryPersonaCard",componentId:"sc-1d6drj8-4"})(templateObject_5$d||(templateObject_5$d=__makeTemplateObject(["\n color: ",";\n text-decoration: underline;\n"],["\n color: ",";\n text-decoration: underline;\n"])),function(p){return p.theme.palette.accent;});var Channels$1=_styled(ClickableChannelTitles).withConfig({displayName:"ItemMetaInfo__Channels",componentId:"sc-1d6drj8-5"})(templateObject_6$8$1||(templateObject_6$8$1=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$X,templateObject_2$y,templateObject_3$o,templateObject_4$e$1,templateObject_5$d,templateObject_6$8$1;var PageDetailViewMetaInfo=function PageDetailViewMetaInfo(){var _a=useDetailViewContext(),item=_a.item,userPreferredLanguage=_a.userPreferredLanguage;return jsx$1(DetailMetaInfo$1,{item:item,dateMode:DateMode.Modified,language:userPreferredLanguage},void 0);};var DetailMetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"PageDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-1yz7bl7-0"})(templateObject_1$W||(templateObject_1$W=__makeTemplateObject(["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ","px) {\n font-size: 14px;\n }\n"],["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ","px) {\n font-size: 14px;\n }\n"])),minScreenSize.small);var templateObject_1$W;var PageDetailViewFeedbackSection=function PageDetailViewFeedbackSection(_a){var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType,contentLanguage=_b.contentLanguage;return jsxs(StyledFeedbackSection$1,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:item.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{},void 0)]}),void 0);};var StyledFeedbackSection$1=_styled(FeedbackSection).withConfig({displayName:"PageDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-12s3v5d-0"})(templateObject_1$V||(templateObject_1$V=__makeTemplateObject(["\n ",";\n &[data-comment-section] {\n padding-bottom: ","px;\n\n @media (min-width: ","px) {\n padding-bottom: 0;\n }\n }\n"],["\n ",";\n &[data-comment-section] {\n padding-bottom: ","px;\n\n @media (min-width: ","px) {\n padding-bottom: 0;\n }\n }\n"])),DetailViewSectionPadding,spacingXl+10,minScreenSize.small);var templateObject_1$V;var PageTocSearch=function PageTocSearch(_a){var onSearch=_a.onSearch,onSearchResultChange=_a.onSearchResultChange;var formatMessage=useIntl().formatMessage;var onDebouncedSearch=useDebouncedCallback(handleSearch,300)[0];var textColors=useContext(ThemeContext$1).theme.textColors;return jsx$1(StyledSearchBox$2,{"data-toc-search-box":true,onChange:function(_,v){return onDebouncedSearch(v);},placeholder:formatMessage({id:'Pages.pagesTableOfContents.searchFieldPlaceholder'}),onKeyPress:handleKeyPress,iconProps:{style:{color:textColors.default}}},void 0);function handleKeyPress(event){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:if(!(event.key==='Enter'))return [3/*break*/,2];return [4/*yield*/,handleSearch(event.currentTarget.value,true)];case 1:_a.sent();_a.label=2;case 2:return [2/*return*/];}});});}function handleSearch(value,ignoreSearchTextLength){return __awaiter(this,void 0,void 0,function(){var result,allNodesById;return __generator(this,function(_a){switch(_a.label){case 0:if(!value||!ignoreSearchTextLength&&value.trim().length<3){onSearchResultChange(null);return [2/*return*/];}return [4/*yield*/,onSearch(value)];case 1:result=_a.sent();allNodesById={};// the search returns us a flat result of pages, we now have to build up
|
|
132012
132015
|
// an hierarchical tree, with the roots node at the very top
|
|
132013
132016
|
// so we can then pass this in to the actual ToC
|
|
132014
132017
|
result.items.forEach(function(page){var _a;var node=convertToNavigationNode(page);node.isSearchMatch=true;while(true){// if we already have the current node collected
|
|
@@ -132021,7 +132024,7 @@ var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===pag
|
|
|
132021
132024
|
// for this case the blockProps would be an empty object and
|
|
132022
132025
|
// we need to set the showPages and showDocuments to true
|
|
132023
132026
|
var InlinePageListByCurrentPage=function InlinePageListByCurrentPage(_a){var _b=_a.blockProps,props=_b===void 0?{showDocuments:true,showPages:true}:_b;var item=useDetailViewContext().item;var getSubpages=usePagesApi().getSubpages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _c=useItemLoaderByCurrentPage(item.id,defaultPageSize,item.navigationContext,{showPages:props.showPages,showDocuments:props.showDocuments},getAllSubItems,[item===null||item===void 0?void 0:item.id]),items=_c.pageItems,pagingProps=_c.pagingProps;if(items.length===0){return null;}return jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:pagingProps,baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0);function getAllSubItems(id,pageType){return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getSubpages(id,{pageType:pageType})];case 1:result=_a.sent();return [2/*return*/,result.items];}});});}};var InlinePageList=function InlinePageList(_a){var blockProps=_a.blockProps;if(blockProps===null||blockProps===void 0?void 0:blockProps.keywords){return jsx$1(InlinePageListByKeywords,{keywords:blockProps.keywords.split(','),showPages:blockProps.showPages,showDocuments:blockProps.showDocuments},void 0);}if(blockProps===null||blockProps===void 0?void 0:blockProps.pageId){return jsx$1(InlinePageListByPageId,{pageId:blockProps.pageId,showPages:blockProps.showPages,showDocuments:blockProps.showDocuments},void 0);}return jsx$1(InlinePageListByCurrentPage,{blockProps:blockProps},void 0);};var InlinePageListMapper={component:InlinePageList,type:EntityType.InlinePageList,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var pageListId=node.getAttribute('data-page-list-id');if(pageListId==null){return null;}var showChildren=node.getAttribute('data-show-children')==='true';var showDocumentsAttribute=node.getAttribute('data-show-documents');var showPagesAttribute=node.getAttribute('data-show-pages');var pageId=node.getAttribute('data-page-id');var keywords=node.getAttribute('data-keywords');if(!showDocumentsAttribute&&!showPagesAttribute){// ensure backwards compatibility
|
|
132024
|
-
return {id:pageListId,showChildren:showChildren,showPages:true,showDocuments:false,pageId:pageId,keywords:keywords};}var showDocuments=showDocumentsAttribute==='true';var showPages=showPagesAttribute==='true';return {id:pageListId,showChildren:showChildren,showDocuments:showDocuments,showPages:showPages,pageId:pageId,keywords:keywords};}};var PageBreadcrumb=function PageBreadcrumb(_a){var page=_a.page,target=_a.target,languageOverride=_a.language,hideCurrentPageNode=_a.hideCurrentPageNode,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var history=useHistory();if(!page||!page.navigationContext){return null;}var _b=getBreadcrumbsItems(page,target,handleOnClick,function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,hideCurrentPageNode),parentNode=_b.parentNode,breadcrumbItems=_b.breadcrumbItems;return jsxs("div",__assign({className:className},{children:[jsx$1(LargeScreenBreadcrumb,{items:breadcrumbItems,onRenderItem:renderBreadcrumbItem,overflowIndex:1,"data-breadcrumb":true,overflowAriaLabel:formatMessage({id:'AriaLabel.otherPages'}),focusZoneProps:{handleTabKey:1}},void 0),jsx$1(MobileBreadcrumb,{target:target,parentNode:parentNode},void 0)]}),void 0);function renderBreadcrumbItem(item){if(item.key==='home'){return jsx$1(BreadcrumbHomeItem,__assign({to:item.href,"aria-label":item.text,"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0);}if(item.isCurrentItem){return jsx$1(BreadcrumbCurrentItem,__assign({"aria-current":"page"},{children:item.text}),void 0);}return jsx$1(BreadcrumbItem,__assign({to:item.href,"data-page-breadcrumb-node":item.key},{children:item.text}),void 0);}function handleOnClick(e,item){e.stopPropagation();e.preventDefault();history.push({pathname:item.href});}};var MobileBreadcrumb=function MobileBreadcrumb(_a){var target=_a.target,parentNode=_a.parentNode;var formatMessage=useIntl().formatMessage;return jsxs(MobileBreadcrumbHost,__assign({"data-mobile-breadcrumb":true},{children:[jsx$1("li",{children:jsx$1(BreadcrumbHomeItem,__assign({to:target,"aria-label":formatMessage({id:'Generic.home'}),"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0)},void 0),parentNode&&jsxs(ParentNode,{children:[jsx$1(LeftChevronIcon,{iconName:"ChevronLeft"},void 0),jsx$1(BreadcrumbItem,__assign({to:NewsService.getNewsRoute(target,parentNode.id,parentNode.title),"data-page-breadcrumb-parent-node":parentNode.id},{children:parentNode.title}),void 0)]},void 0)]}),void 0);};var MobileBreadcrumbHost=_styled.ul.withConfig({displayName:"PageBreadcrumb__MobileBreadcrumbHost",componentId:"sc-1m4qq1d-0"})(templateObject_1$P||(templateObject_1$P=__makeTemplateObject(["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"],["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"])),fontSizeSmall,maxScreenSize.medium);var ParentNode=_styled.li.withConfig({displayName:"PageBreadcrumb__ParentNode",componentId:"sc-1m4qq1d-1"})(templateObject_2$u||(templateObject_2$u=__makeTemplateObject(["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"],["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"])),spacingM,function(p){return p.theme.palette.accent;});var LeftChevronIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__LeftChevronIcon",componentId:"sc-1m4qq1d-2"})(templateObject_3$l||(templateObject_3$l=__makeTemplateObject(["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"],["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var LargeScreenBreadcrumb=_styled(Breadcrumb).withConfig({displayName:"PageBreadcrumb__LargeScreenBreadcrumb",componentId:"sc-1m4qq1d-3"})(templateObject_4$b$1||(templateObject_4$b$1=__makeTemplateObject(["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.medium);var HomeIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__HomeIcon",componentId:"sc-1m4qq1d-4"})(templateObject_5$a$1||(templateObject_5$a$1=__makeTemplateObject(["\n padding-top: 1px;\n"],["\n padding-top: 1px;\n"])));var BreadcrumbItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbItem",componentId:"sc-1m4qq1d-5"})(templateObject_6$5$1||(templateObject_6$5$1=__makeTemplateObject(["\n padding: 0 ","px;\n color: ",";\n"],["\n padding: 0 ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.accent;});var BreadcrumbHomeItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbHomeItem",componentId:"sc-1m4qq1d-6"})(templateObject_7$3$1||(templateObject_7$3$1=__makeTemplateObject(["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"],["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"])),function(p){return p.theme.palette.accent;},spacingS);var BreadcrumbCurrentItem=_styled.div.withConfig({displayName:"PageBreadcrumb__BreadcrumbCurrentItem",componentId:"sc-1m4qq1d-7"})(templateObject_8$3$1||(templateObject_8$3$1=__makeTemplateObject(["\n padding-left: ","px;\n color: ",";\n"],["\n padding-left: ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$P,templateObject_2$u,templateObject_3$l,templateObject_4$b$1,templateObject_5$a$1,templateObject_6$5$1,templateObject_7$3$1,templateObject_8$3$1;var DetailViewPageDocumentDownload=function DetailViewPageDocumentDownload(){var user=useCurrentUser();var _a=useDetailViewContext(),item=_a.item,preferredContent=_a.content;if(!item){return null;}var content=(preferredContent===null||preferredContent===void 0?void 0:preferredContent.fileInfo)?preferredContent:getContentForPage(item,user).content;if(!(content===null||content===void 0?void 0:content.fileInfo)){return null;}return jsx$1(PageDocumentDownloadButton,{item:item,content:content},void 0);};var PageDocumentDownloadButton=function PageDocumentDownloadButton(_a){var item=_a.item,content=_a.content,basePath=_a.basePath;var _b=useInlinePageDocument({pageId:item.id,fileId:content.fileInfo.fileId,extension:content.fileInfo.extension,title:content.title,fileName:content.fileInfo.fileName},item,basePath),fileUrl=_b.fileUrl,iconName=_b.iconName,title=_b.title,fileName=_b.fileName,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return jsxs(Host$i$1,{children:[jsx$1(FormattedMessage$1,{id:"Pages.documents.buttonDownloadInfo"},void 0),jsx$1(DownloadButton,{fileUrl:fileUrl,fileName:fileName,title:title,fileIconName:iconName,onClick:onPageDocumentDownloadClick},void 0)]},void 0);};var Host$i$1=_styled.div.withConfig({displayName:"DetailViewPageDocumentDownload__Host",componentId:"sc-1gtkslm-0"})(templateObject_1$O||(templateObject_1$O=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var DownloadButton=_styled(InlinePageDocumentDownloadButton).withConfig({displayName:"DetailViewPageDocumentDownload__DownloadButton",componentId:"sc-1gtkslm-1"})(templateObject_2$t||(templateObject_2$t=__makeTemplateObject(["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"],["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"])),spacingS,minScreenSize.medium);var templateObject_1$O,templateObject_2$t;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$N||(templateObject_1$N=__makeTemplateObject(["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"],["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"])));var templateObject_1$N;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$M||(templateObject_1$M=__makeTemplateObject(["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"],["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"])),minScreenSize.small,cardWidthS,minScreenSize.medium,cardWidthM,minScreenSize.large,cardWidthL,minScreenSize.xLarge,cardWidthXL);_styled.article.withConfig({displayName:"Card__Article",componentId:"sc-1m8ygh-1"})(templateObject_3$k||(templateObject_3$k=__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"],["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"])),function(p){return p.highlight&&css$2(templateObject_2$s||(templateObject_2$s=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),spacingXs,function(p){return p.theme.palette.accent;});},spacingM,bannerAspectRatio,spacingM,minScreenSize.small,cardWidthS,bannerAspectRatio,minScreenSize.medium,cardWidthM,bannerAspectRatio,minScreenSize.large,cardWidthL,bannerAspectRatio,minScreenSize.xLarge,cardWidthXL,bannerAspectRatio);var templateObject_1$M,templateObject_2$s,templateObject_3$k;var LanguageSelector=function LanguageSelector(props){var history=useHistory();var currentUser=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var getAllLanguagesLocalized=useLanguageApi().getAllLanguagesLocalized;var intl=useIntl();var formatMessage=intl.formatMessage;var languageDefinitions=usePromise$2(function(){return getAllLanguagesLocalized(intl);})[0];var features=useFeatures();if(languageDefinitions==null){return null;}if(props.chromeless)return jsx$1(ActionButton,__assign({iconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-callout'},className:classNames(props.className,'header-button')},{children:formatMessage({id:"Generic.languages."+props.selectedLanguage})}),void 0);return jsx$1(Tooltip,__assign({resourceKey:"Generic.translate"},{children:jsx$1(LanguageSelectorButton,{menuIconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-callout',isBeakVisible:props.showBeak},className:classNames(props.className,'header-button'),"data-language-selector-button":true,ariaLabel:formatMessage({id:'AriaLabel.autoTranslation'})},void 0)}),void 0);function getContextualMenuItems(){if(props.languages==null){return [];}var menuItems=[];var preferredLanguageItem=getPreferredLanguageItem();if(preferredLanguageItem){menuItems.push(preferredLanguageItem);}var activeLanguagesItems=getActiveLanguagesItems();activeLanguagesItems.sort(function(a,b){return a.text.localeCompare(b.text);});menuItems=menuItems.concat(activeLanguagesItems);if(!props.hideEditLanguagePreferences){var editLanguagePreferencesItem={key:'edit',text:formatMessage({id:'Generic.editLanguagePreferences'}),iconProps:{iconName:'PlayerSettings'},onClick:handleEditLanguagePreferences,className:'lt-reach-languageselector-menu-item'};menuItems.push(editLanguagePreferencesItem);}return menuItems;}function handleEditLanguagePreferences(){if(props.onEditLanguagePreferencesClick){props.onEditLanguagePreferencesClick();}else {history.push(buildPath('/user'));}}function getActiveLanguagesItems(){return props.languages.map(function(l){var fullLanguage=languageDefinitions.find(function(ld){return ld.code===l;});return {key:l,text:fullLanguage.localizedName,iconProps:{iconName:'World'},onClick:function(){return props.onLanguageChange(l.toString());},className:classNames('lt-reach-languageselector-menu-item',l===props.selectedLanguage&&'selected')};});}function getPreferredLanguageItem(){if(!features.automaticTranslation){return null;}if(!props.onTranslateClick){return null;}var preferredContentLanguage=getPreferredContentLanguage(currentUser);var shouldAddPreferredContentLanguage=preferredContentLanguage!=null&&!contentLanguagesWithoutAutomaticTranslation.includes(preferredContentLanguage)&&allAvailableContentLanguages.includes(preferredContentLanguage)&&props.languages.indexOf(preferredContentLanguage)<0;if(!shouldAddPreferredContentLanguage){return null;}return {key:preferredContentLanguage,text:formatMessage({id:'Generic.automaticTranslation'},{language:formatMessage({id:"Generic.languages."+preferredContentLanguage})}),iconProps:{iconName:'Robot'},onClick:function(){return props.onTranslateClick(preferredContentLanguage);},className:classNames('lt-reach-languageselector-menu-item',preferredContentLanguage===props.selectedLanguage&&'selected')};}};var LanguageSelectorButton=_styled(IconButton).withConfig({displayName:"LanguageSelector__LanguageSelectorButton",componentId:"sc-48zwek-0"})(templateObject_1$L||(templateObject_1$L=__makeTemplateObject(["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"],["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"])));var templateObject_1$L;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$K||(templateObject_1$K=__makeTemplateObject(["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"],["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"])),minScreenSize.large+1,maxContentWidth);var templateObject_1$K;var DetailViewBanner=function DetailViewBanner(){var _a=useDetailViewContext(),item=_a.item,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;if(!item.bannerInfo){return null;}return jsx$1(Banner$3,{itemId:item.id,token:item.fileAccessToken,bannerInfo:item.bannerInfo,useEditorRoutes:isEditorPreview,width:getMaxImageWidth(),canOpenImage:true,resourceType:resourceType},void 0);};var Banner$3=_styled(PublishableItemBanner).withConfig({displayName:"DetailViewBanner__Banner",componentId:"sc-1wuqvtw-0"})(templateObject_1$J||(templateObject_1$J=__makeTemplateObject(["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"],["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"])),bannerAspectRatio,minScreenSize.large+1,minScreenSize.large,spacingM,bannerAspectRatio);var templateObject_1$J;var DetailViewIntro=function DetailViewIntro(){var content=useDetailViewContext().content;var hasIntro=content.intro&&content.intro.length>0;if(!hasIntro){return null;}return jsx$1(DetailIntro,{children:content.intro},void 0);};var DetailIntro=_styled.p.withConfig({displayName:"DetailViewIntro__DetailIntro",componentId:"sc-1kubhyf-0"})(templateObject_1$I||(templateObject_1$I=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"],["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,spacingS,spacingS+2,fontSizeMedium+2);var templateObject_1$I;var DetailMainSection=function DetailMainSection(_a){var children=_a.children;return jsx$1(DetailMainStyledSection,__assign({className:"detail-view-main"},{children:children}),void 0);};var DetailMainStyledSection=_styled.section.withConfig({displayName:"DetailViewMainSection__DetailMainStyledSection",componentId:"sc-ifywhg-0"})(templateObject_1$H||(templateObject_1$H=__makeTemplateObject(["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"],["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"])),detailViewSectionPadding-5,detailViewSectionPadding,detailViewSectionPadding,minScreenSize.small,detailViewSectionPaddingLarge-10,detailViewSectionPaddingLarge,detailViewSectionPaddingLarge);var templateObject_1$H;var GutterMarkerIcon=function GutterMarkerIcon(_a){var iconName=_a.iconName,children=_a.children,isActive=_a.isActive,color=_a.color,tooltipResourceKey=_a.tooltipResourceKey,className=_a.className;return jsxs(Host$f$1,__assign({className:className},{children:[jsx$1(IconContainer$1,__assign({isActive:isActive,className:isActive?"ms-bgColor-"+color:'ms-bgColor-white'},{children:isActive&&jsx$1(StyledTooltip,__assign({resourceKey:tooltipResourceKey},{children:jsx$1(StyledIcon$2$1,{className:"ms-fontColor-white",iconName:iconName},void 0)}),void 0)}),void 0),isActive?jsx$1(ActiveContent,__assign({className:"ms-borderColor-"+color},{children:children}),void 0):jsx$1(Content$3,{children:children},void 0)]}),void 0);};var Host$f$1=_styled.div.withConfig({displayName:"GutterMakerIcon__Host",componentId:"sc-aa2cf4-0"})(templateObject_1$G||(templateObject_1$G=__makeTemplateObject(["\n margin: 0;\n display: flex;\n align-content: center;\n"],["\n margin: 0;\n display: flex;\n align-content: center;\n"])));var StyledIcon$2$1=_styled(Icon).withConfig({displayName:"GutterMakerIcon__StyledIcon",componentId:"sc-aa2cf4-1"})(templateObject_2$r||(templateObject_2$r=__makeTemplateObject(["\n font-size: 25px;\n"],["\n font-size: 25px;\n"])));var Content$3=_styled.div.withConfig({displayName:"GutterMakerIcon__Content",componentId:"sc-aa2cf4-2"})(templateObject_3$j||(templateObject_3$j=__makeTemplateObject(["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"],["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"])));var ActiveContent=_styled(Content$3).withConfig({displayName:"GutterMakerIcon__ActiveContent",componentId:"sc-aa2cf4-3"})(templateObject_4$a$1||(templateObject_4$a$1=__makeTemplateObject(["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"],["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"])));var IconContainer$1=_styled.div.withConfig({displayName:"GutterMakerIcon__IconContainer",componentId:"sc-aa2cf4-4"})(templateObject_5$9$1||(templateObject_5$9$1=__makeTemplateObject(["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"])),function(_a){var isActive=_a.isActive;return isActive?'50px':'auto';});var StyledTooltip=_styled(Tooltip).withConfig({displayName:"GutterMakerIcon__StyledTooltip",componentId:"sc-aa2cf4-5"})(templateObject_6$4$1||(templateObject_6$4$1=__makeTemplateObject(["\n && {\n display: inherit;\n }\n"],["\n && {\n display: inherit;\n }\n"])));var templateObject_1$G,templateObject_2$r,templateObject_3$j,templateObject_4$a$1,templateObject_5$9$1,templateObject_6$4$1;var DetailViewTitle=function DetailViewTitle(){var _a=useDetailViewContext(),content=_a.content,item=_a.item;var hasAlert=hasFlag(item.knownState,KnownNewsState.Alert);return jsx$1(GutterMarkerIcon,__assign({iconName:"Warning",isActive:hasAlert,color:"red",tooltipResourceKey:"NewsArticle.alert"},{children:jsx$1(Title$4,__assign({"data-title":true},{children:content.title}),void 0)}),void 0);};var Title$4=_styled.h1.withConfig({displayName:"DetailViewTitle__Title",componentId:"sc-1jbzvna-0"})(templateObject_1$F||(templateObject_1$F=__makeTemplateObject(["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"],["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"])),fontSizeLarge-1,minScreenSize.small);var templateObject_1$F;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$E||(templateObject_1$E=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"],["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"])),fontSizeSmall);var templateObject_1$E;var mappers=[InlineImageMapper,InlineFileMapper,InlineQuoteMapper,InlineGalleryMapper,InlineCodeMapper,InlineVideoMapper,InlineTable,InlineContactMapper,InlinePageListMapper,InlineUrlPreviewMapper];var RichTextViewer=function RichTextViewer(_a){var html=_a.html;return jsx$1(TextViewer,{html:html,componentMappers:mappers},void 0);};var DetailViewBody=function DetailViewBody(){var _a=useDetailViewContext(),content=_a.content,resourceType=_a.resourceType;var bodyHtml=content&&content.body;return jsx$1(DetailBody$1,__assign({className:"lt-reach-detail-view-body","data-item-type":resourceType},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(RichTextViewer,{html:bodyHtml},void 0)},void 0)}),void 0);};var DetailBody$1=_styled.div.withConfig({displayName:"DetailViewBody__DetailBody",componentId:"sc-7b4trq-0"})(templateObject_1$D||(templateObject_1$D=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"])),fontSizeLarge-1,spacingS+2,fontSizeLarge-3,fontSizeLarge-5,spacingS);var templateObject_1$D;var DetailViewKeywords=function DetailViewKeywords(_a){var filterBaseUrl=_a.filterBaseUrl;var features=useFeatures();var _b=useDetailViewContext(),item=_b.item,userPreferredLanguage=_b.userPreferredLanguage;var formatMessage=useIntl().formatMessage;if(!features.keywords){return null;}return jsx$1(Fragment,{children:Object.keys(item.keywords).length>0&&jsx$1(KeywordsSection,__assign({"aria-label":formatMessage({id:'AriaLabel.section.keywords'})},{children:jsx$1(KeywordsInfo,{keywords:item.keywords,language:userPreferredLanguage,filterBaseUrl:filterBaseUrl},void 0)}),void 0)},void 0);};var KeywordsSection=_styled.section.withConfig({displayName:"DetailViewKeywords__KeywordsSection",componentId:"sc-ltysu4-0"})(templateObject_1$C||(templateObject_1$C=__makeTemplateObject(["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),maxScreenSize.medium,fontSizeSmall);var templateObject_1$C;var ConfirmationBox=function ConfirmationBox(_a){var disabled=_a.disabled,checked=_a.checked,onChange=_a.onChange;var formatMessage=useIntl().formatMessage;return jsx$1(Host$e$1,{children:jsx$1(NeutralCheckBox,{disabled:disabled,checked:checked,onChange:function(_,value){return onChange(value);},label:formatMessage({id:checked?'NewsArticle.confirmed':'NewsArticle.confirm'})},void 0)},void 0);};var Host$e$1=_styled.div.withConfig({displayName:"ConfirmationBox__Host",componentId:"sc-1m5alil-0"})(templateObject_1$B||(templateObject_1$B=__makeTemplateObject(["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"],["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"])));var templateObject_1$B;var ConfirmationSection=function ConfirmationSection(_a){var item=_a.item,showDescription=_a.showDescription,readOnly=_a.readOnly,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var _b=useNotificationContext(),dismissToast=_b.dismissToast,showToast=_b.showToast,showError=_b.showError;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var _d=usePromise$2(function(){return getFeedback(ItemResourceTypes.News,item.id);}),summary=_d[0],isLoading=_d[1];var _e=useState$2(null),userChecked=_e[0],setChecked=_e[1];var toastHandle=useRef$1(null);var checked=userChecked!==null?userChecked:summary!=null&&!!summary.records.find(function(r){return r.type==='confirm';});return jsxs(Host$d$1,__assign({isLoading:isLoading,className:className},{children:[showDescription&&jsx$1(FormattedMessage$1,{id:"NewsArticle.confirmationRequiredDescription",tagName:"p"},void 0),jsx$1(StyledGutterMarkerIcon,__assign({iconName:"Completed",isActive:!isLoading&&!checked,color:"green"},{children:readOnly?jsx$1(ConfirmationBox,{checked:checked,disabled:true},void 0):jsx$1(ConfirmationBox,{checked:checked,disabled:checked,onChange:handleClickConfirm},void 0)}),void 0)]}),void 0);function handleClickConfirm(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:setChecked(true);_a.label=1;case 1:_a.trys.push([1,4,,5]);return [4/*yield*/,setFeedback(ItemResourceTypes.News,item.id,'confirm')];case 2:_a.sent();toastHandle.current=showToast('NewsArticle.confirmationSuccessToast',{},jsx$1(DefaultButton,__assign({onClick:handleUndo},{children:jsx$1(FormattedMessage$1,{id:"Generic.undo"},void 0)}),void 0),{autoClose:false});return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:1})];case 3:_a.sent();return [3/*break*/,5];case 4:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setChecked(false);return [3/*break*/,5];case 5:return [2/*return*/];}});});}function handleUndo(){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);dismissToast(toastHandle.current);toastHandle.current=null;return [4/*yield*/,unsetFeedback(ItemResourceTypes.News,item.id,'confirm')];case 1:_a.sent();return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:-1})];case 2:_a.sent();setChecked(false);return [3/*break*/,4];case 3:error_2=_a.sent();logger.error(error_2);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var Host$d$1=_styled.div.withConfig({displayName:"ConfirmationSection__Host",componentId:"sc-1g2fxdb-0"})(templateObject_1$A||(templateObject_1$A=__makeTemplateObject(["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),function(_a){var isLoading=_a.isLoading;return isLoading?0.4:1;},spacingM,minScreenSize.small,spacingS,maxScreenSize.medium,fontSizeSmall);var StyledGutterMarkerIcon=_styled(GutterMarkerIcon).withConfig({displayName:"ConfirmationSection__StyledGutterMarkerIcon",componentId:"sc-1g2fxdb-1"})(templateObject_2$q||(templateObject_2$q=__makeTemplateObject(["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"],["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"])),maxScreenSize.small,spacingM);var templateObject_1$A,templateObject_2$q;var DetailViewConfirmations=function DetailViewConfirmations(){var features=useFeatures();var _a=useDetailViewContext(),item=_a.item,isEditorPreview=_a.isEditorPreview;var formatMessage=useIntl().formatMessage;if(!showConfirmationBox()){return null;}return jsx$1(ConfirmationHost,__assign({"aria-label":formatMessage({id:'NewsArticle.confirmation'})},{children:jsx$1(ConfirmationSection,{item:item,showDescription:true,readOnly:isEditorPreview},void 0)}),void 0);function showConfirmationBox(){return features.confirmation&&item.metadata&&item.metadata.feedbackSettings&&item.metadata.feedbackSettings.feedbackOptions.indexOf('confirm')>=0;}};var ConfirmationHost=_styled.section.withConfig({displayName:"DetailViewConfirmations__ConfirmationHost",componentId:"sc-f8jogv-0"})(templateObject_1$z||(templateObject_1$z=__makeTemplateObject(["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingL,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$z;var DetailViewPageViewTracker=function DetailViewPageViewTracker(){var _a=useDetailViewContext(),resourceType=_a.resourceType,itemId=_a.itemId;usePageViewTracker(resourceType,itemId);return null;};var FeedbackButtonBookmark=function FeedbackButtonBookmark(_a){var isReadOnly=_a.isReadOnly;var _b=useContext(FeedbackButtonContext),item=_b.item,bookmarkCount=_b.statistics.bookmarkCount;return jsxs(CountButtonHost,{children:[jsx$1(BookmarkButton,{item:item,isReadOnly:isReadOnly},void 0),jsx$1(CountLabel,__assign({isDisabled:isReadOnly},{children:bookmarkCount}),void 0)]},void 0);};var NewsDetailViewFeedbackSection=function NewsDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage,isEditorPreview=_c.isEditorPreview;return jsxs(StyledFeedbackSection,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser,isReadOnly:isEditorPreview},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonBookmark,{isReadOnly:isEditorPreview},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection=_styled(FeedbackSection).withConfig({displayName:"NewsDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-pjpy6x-0"})(templateObject_1$y||(templateObject_1$y=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$y;var DetailViewBodyExternalContent=function DetailViewBodyExternalContent(_a){var itemType=_a.itemType;var content=useDetailViewContext().content;var externalUrl=content&&content.externalUrl;return jsx$1(DetailBody,__assign({className:"lt-reach-detail-view-body"},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(FormattedMessageWithStyle,{id:"ExternalLink."+itemType+".navigateTo",tagName:"p",values:{url:jsx$1(ExternalLink$2,__assign({href:externalUrl,className:"ms-fontColor-accent",target:"_blank",rel:"noopener noreferrer"},{children:externalUrl}),void 0)}},void 0)},void 0)}),void 0);};var DetailBody=_styled.div.withConfig({displayName:"DetailViewBodyExternalContent__DetailBody",componentId:"sc-1xjgw89-0"})(templateObject_1$x||(templateObject_1$x=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"])));var templateObject_1$x;var DetailViewHeadline=function DetailViewHeadline(){var content=useDetailViewContext().content;var features=useFeatures();if(!features.contentHeadline||!content.headline){return null;}return jsx$1(Headline$1$1,__assign({"data-detail-view-headline":true},{children:content.headline}),void 0);};var Headline$1$1=_styled.p.withConfig({displayName:"DetailViewHeadline__Headline",componentId:"sc-wsid06-0"})(templateObject_1$w||(templateObject_1$w=__makeTemplateObject(["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"],["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,fontSizeMedium,spacingS);var templateObject_1$w;var StateIcon=function StateIcon(_a){var status=_a.status,isActive=_a.isActive,_b=_a.width,width=_b===void 0?16:_b,activeColor=_a.activeColor;var textColors=useContext(ThemeContext$1).theme.textColors;if(status===WorkflowStatus.draft){return jsx$1(Draft,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}else if(status===WorkflowStatus.rejected){return jsx$1(Draft,{width:width,color:isActive?activeColor:'#b90000'},void 0);}else if(status===WorkflowStatus.ready){return jsx$1(Ready,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}return null;};var Draft=function Draft(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?16.25:_b;var ratio=20/16.25;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 16.25 20",enableBackground:"new 0 0 16.25 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25V0h0.89l5.36,5.361V6.25H10z M11.25,5h2.861L11.25,2.139V5z M10,0H9.25v1.25H10V0z M7.675,1.25H6.1\n\tV0h1.575V1.25z M4.525,1.25H2.95V0h1.575V1.25z M1.25,17.057H0v-1.567h1.25V17.057z M1.25,13.921H0v-1.568h1.25V13.921z\n\t M1.25,10.784H0V9.216h1.25V10.784z M1.25,7.647H0V6.08h1.25V7.647z M1.25,4.512H0V2.943h1.25V4.512z M13.375,\n\t 20h-1.5v-1.25h1.5V20z\n\t M10.375,20h-1.5v-1.25h1.5V20z M7.375,20h-1.5v-1.25h1.5V20z M4.375,20h-1.5v-1.25h1.5V20z M16.25,\n\t 16.964H15v-1.661h1.25V16.964z\n\t M16.25,13.643H15v-1.661h1.25V13.643z M16.25,10.321H15V8.66h1.25V10.321z M16.25,6.25H15V7h1.25V6.25z\n\t M1.25,18.75H0V20h1.25\n\tV18.75z M1.25,0H0v1.25h1.25V0z M16.25,18.75H15V20h1.25V18.75z"},void 0)}),void 0);};var Ready=function Ready(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?18.564:_b;var ratio=20/18.564;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 18.564 20",enableBackground:"new 0 0 18.564 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25v-5H1.25v17.5H10V20H0V0h10.889l5.361,5.361V12.5L15,13.75v-7.5H10z M18.564,14.551L13.125,20\n \tl-2.627-2.637l0.879-0.879l1.748,1.738l4.561-4.551L18.564,14.551z M11.25,5h2.861L11.25,2.139V5z"},void 0)}),void 0);};function useCommonEditorApi(){var api=useApi();return useMemo(function(){return {list:list,getTaskViewCounts:getTaskViewCounts};function list(type,filter,token,sortDefinition){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token},sortDefinition);return api.custom("editor/"+type+"?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function getTaskViewCounts(type,groupId){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,api.custom("editor/"+type+"/taskcounts?"+queryString.stringify({groupId:groupId})).get(groupId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];}});});}},[api]);}var $$2$1=_export;var requireObjectCoercible$1$1=requireObjectCoercible$c;var isRegExp=isRegexp;var getRegExpFlags=regexpFlags$1$1;var wellKnownSymbol$1=wellKnownSymbol$l;var REPLACE$2=wellKnownSymbol$1('replace');var RegExpPrototype$3=RegExp.prototype;// `String.prototype.replaceAll` method
|
|
132027
|
+
return {id:pageListId,showChildren:showChildren,showPages:true,showDocuments:false,pageId:pageId,keywords:keywords};}var showDocuments=showDocumentsAttribute==='true';var showPages=showPagesAttribute==='true';return {id:pageListId,showChildren:showChildren,showDocuments:showDocuments,showPages:showPages,pageId:pageId,keywords:keywords};}};var PageBreadcrumb=function PageBreadcrumb(_a){var page=_a.page,target=_a.target,languageOverride=_a.language,hideCurrentPageNode=_a.hideCurrentPageNode,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var history=useHistory();if(!page||!page.navigationContext){return null;}var _b=getBreadcrumbsItems(page,target,handleOnClick,function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,hideCurrentPageNode),parentNode=_b.parentNode,breadcrumbItems=_b.breadcrumbItems;return jsxs("div",__assign({className:className},{children:[jsx$1(LargeScreenBreadcrumb,{items:breadcrumbItems,onRenderItem:renderBreadcrumbItem,overflowIndex:1,"data-breadcrumb":true,overflowAriaLabel:formatMessage({id:'AriaLabel.otherPages'}),focusZoneProps:{handleTabKey:1}},void 0),jsx$1(MobileBreadcrumb,{target:target,parentNode:parentNode},void 0)]}),void 0);function renderBreadcrumbItem(item){if(item.key==='home'){return jsx$1(BreadcrumbHomeItem,__assign({to:item.href,"aria-label":item.text,"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0);}if(item.isCurrentItem){return jsx$1(BreadcrumbCurrentItem,__assign({"aria-current":"page"},{children:item.text}),void 0);}return jsx$1(BreadcrumbItem,__assign({to:item.href,"data-page-breadcrumb-node":item.key},{children:item.text}),void 0);}function handleOnClick(e,item){e.stopPropagation();e.preventDefault();history.push({pathname:item.href});}};var MobileBreadcrumb=function MobileBreadcrumb(_a){var target=_a.target,parentNode=_a.parentNode;var formatMessage=useIntl().formatMessage;return jsxs(MobileBreadcrumbHost,__assign({"data-mobile-breadcrumb":true},{children:[jsx$1("li",{children:jsx$1(BreadcrumbHomeItem,__assign({to:target,"aria-label":formatMessage({id:'Generic.home'}),"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0)},void 0),parentNode&&jsxs(ParentNode,{children:[jsx$1(LeftChevronIcon,{iconName:"ChevronLeft"},void 0),jsx$1(BreadcrumbItem,__assign({to:NewsService.getNewsRoute(target,parentNode.id,parentNode.title),"data-page-breadcrumb-parent-node":parentNode.id},{children:parentNode.title}),void 0)]},void 0)]}),void 0);};var MobileBreadcrumbHost=_styled.ul.withConfig({displayName:"PageBreadcrumb__MobileBreadcrumbHost",componentId:"sc-1m4qq1d-0"})(templateObject_1$P||(templateObject_1$P=__makeTemplateObject(["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"],["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"])),fontSizeSmall,maxScreenSize.medium);var ParentNode=_styled.li.withConfig({displayName:"PageBreadcrumb__ParentNode",componentId:"sc-1m4qq1d-1"})(templateObject_2$u||(templateObject_2$u=__makeTemplateObject(["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"],["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"])),spacingM,function(p){return p.theme.palette.accent;});var LeftChevronIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__LeftChevronIcon",componentId:"sc-1m4qq1d-2"})(templateObject_3$l||(templateObject_3$l=__makeTemplateObject(["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"],["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var LargeScreenBreadcrumb=_styled(Breadcrumb).withConfig({displayName:"PageBreadcrumb__LargeScreenBreadcrumb",componentId:"sc-1m4qq1d-3"})(templateObject_4$b$1||(templateObject_4$b$1=__makeTemplateObject(["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.medium);var HomeIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__HomeIcon",componentId:"sc-1m4qq1d-4"})(templateObject_5$a$1||(templateObject_5$a$1=__makeTemplateObject(["\n padding-top: 1px;\n"],["\n padding-top: 1px;\n"])));var BreadcrumbItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbItem",componentId:"sc-1m4qq1d-5"})(templateObject_6$5$1||(templateObject_6$5$1=__makeTemplateObject(["\n padding: 0 ","px;\n color: ",";\n"],["\n padding: 0 ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.accent;});var BreadcrumbHomeItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbHomeItem",componentId:"sc-1m4qq1d-6"})(templateObject_7$3$1||(templateObject_7$3$1=__makeTemplateObject(["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"],["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"])),function(p){return p.theme.palette.accent;},spacingS);var BreadcrumbCurrentItem=_styled.div.withConfig({displayName:"PageBreadcrumb__BreadcrumbCurrentItem",componentId:"sc-1m4qq1d-7"})(templateObject_8$3$1||(templateObject_8$3$1=__makeTemplateObject(["\n padding-left: ","px;\n color: ",";\n"],["\n padding-left: ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$P,templateObject_2$u,templateObject_3$l,templateObject_4$b$1,templateObject_5$a$1,templateObject_6$5$1,templateObject_7$3$1,templateObject_8$3$1;var DetailViewPageDocumentDownload=function DetailViewPageDocumentDownload(){var user=useCurrentUser();var _a=useDetailViewContext(),item=_a.item,preferredContent=_a.content;if(!item){return null;}var content=(preferredContent===null||preferredContent===void 0?void 0:preferredContent.fileInfo)?preferredContent:getContentForPage(item,user).content;if(!(content===null||content===void 0?void 0:content.fileInfo)){return null;}return jsx$1(PageDocumentDownloadButton,{item:item,content:content},void 0);};var PageDocumentDownloadButton=function PageDocumentDownloadButton(_a){var item=_a.item,content=_a.content,basePath=_a.basePath;var _b=useInlinePageDocument({pageId:item.id,fileId:content.fileInfo.fileId,extension:content.fileInfo.extension,title:content.title,fileName:content.fileInfo.fileName},item,basePath),fileUrl=_b.fileUrl,iconName=_b.iconName,title=_b.title,fileName=_b.fileName,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return jsxs(Host$i$1,{children:[jsx$1(FormattedMessage$1,{id:"Pages.documents.buttonDownloadInfo"},void 0),jsx$1(DownloadButton,{fileUrl:fileUrl,fileName:fileName,title:title,fileIconName:iconName,onClick:onPageDocumentDownloadClick},void 0)]},void 0);};var Host$i$1=_styled.div.withConfig({displayName:"DetailViewPageDocumentDownload__Host",componentId:"sc-1gtkslm-0"})(templateObject_1$O||(templateObject_1$O=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var DownloadButton=_styled(InlinePageDocumentDownloadButton).withConfig({displayName:"DetailViewPageDocumentDownload__DownloadButton",componentId:"sc-1gtkslm-1"})(templateObject_2$t||(templateObject_2$t=__makeTemplateObject(["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"],["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"])),spacingS,minScreenSize.medium);var templateObject_1$O,templateObject_2$t;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$N||(templateObject_1$N=__makeTemplateObject(["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"],["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"])));var templateObject_1$N;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$M||(templateObject_1$M=__makeTemplateObject(["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"],["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"])),minScreenSize.small,cardWidthS,minScreenSize.medium,cardWidthM,minScreenSize.large,cardWidthL,minScreenSize.xLarge,cardWidthXL);_styled.article.withConfig({displayName:"Card__Article",componentId:"sc-1m8ygh-1"})(templateObject_3$k||(templateObject_3$k=__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"],["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"])),function(p){return p.highlight&&css$2(templateObject_2$s||(templateObject_2$s=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),spacingXs,function(p){return p.theme.palette.accent;});},spacingM,bannerAspectRatio,spacingM,minScreenSize.small,cardWidthS,bannerAspectRatio,minScreenSize.medium,cardWidthM,bannerAspectRatio,minScreenSize.large,cardWidthL,bannerAspectRatio,minScreenSize.xLarge,cardWidthXL,bannerAspectRatio);var templateObject_1$M,templateObject_2$s,templateObject_3$k;var LanguageSelector=function LanguageSelector(props){var history=useHistory();var currentUser=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var getAllLanguagesLocalized=useLanguageApi().getAllLanguagesLocalized;var intl=useIntl();var formatMessage=intl.formatMessage;var languageDefinitions=usePromise$2(function(){return getAllLanguagesLocalized(intl);})[0];var features=useFeatures();if(languageDefinitions==null){return null;}if(props.chromeless)return jsx$1(ActionButton,__assign({iconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-contextual-menu'},className:classNames(props.className,'header-button')},{children:formatMessage({id:"Generic.languages."+props.selectedLanguage})}),void 0);return jsx$1(Tooltip,__assign({resourceKey:"Generic.translate"},{children:jsx$1(LanguageSelectorButton,{menuIconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-contextual-menu',isBeakVisible:props.showBeak},className:classNames(props.className,'header-button'),"data-language-selector-button":true,ariaLabel:formatMessage({id:'AriaLabel.autoTranslation'})},void 0)}),void 0);function getContextualMenuItems(){if(props.languages==null){return [];}var menuItems=[];var preferredLanguageItem=getPreferredLanguageItem();if(preferredLanguageItem){menuItems.push(preferredLanguageItem);}var activeLanguagesItems=getActiveLanguagesItems();activeLanguagesItems.sort(function(a,b){return a.text.localeCompare(b.text);});menuItems=menuItems.concat(activeLanguagesItems);if(!props.hideEditLanguagePreferences){var editLanguagePreferencesItem={key:'edit',text:formatMessage({id:'Generic.editLanguagePreferences'}),iconProps:{iconName:'PlayerSettings'},onClick:handleEditLanguagePreferences,className:'lt-reach-languageselector-menu-item'};menuItems.push(editLanguagePreferencesItem);}return menuItems;}function handleEditLanguagePreferences(){if(props.onEditLanguagePreferencesClick){props.onEditLanguagePreferencesClick();}else {history.push(buildPath('/user'));}}function getActiveLanguagesItems(){return props.languages.map(function(l){var fullLanguage=languageDefinitions.find(function(ld){return ld.code===l;});return {key:l,text:fullLanguage.localizedName,iconProps:{iconName:'World'},onClick:function(){return props.onLanguageChange(l.toString());},className:classNames('lt-reach-languageselector-menu-item',l===props.selectedLanguage&&'selected')};});}function getPreferredLanguageItem(){if(!features.automaticTranslation){return null;}if(!props.onTranslateClick){return null;}var preferredContentLanguage=getPreferredContentLanguage(currentUser);var shouldAddPreferredContentLanguage=preferredContentLanguage!=null&&!contentLanguagesWithoutAutomaticTranslation.includes(preferredContentLanguage)&&allAvailableContentLanguages.includes(preferredContentLanguage)&&props.languages.indexOf(preferredContentLanguage)<0;if(!shouldAddPreferredContentLanguage){return null;}return {key:preferredContentLanguage,text:formatMessage({id:'Generic.automaticTranslation'},{language:formatMessage({id:"Generic.languages."+preferredContentLanguage})}),iconProps:{iconName:'Robot'},onClick:function(){return props.onTranslateClick(preferredContentLanguage);},className:classNames('lt-reach-languageselector-menu-item',preferredContentLanguage===props.selectedLanguage&&'selected')};}};var LanguageSelectorButton=_styled(IconButton).withConfig({displayName:"LanguageSelector__LanguageSelectorButton",componentId:"sc-48zwek-0"})(templateObject_1$L||(templateObject_1$L=__makeTemplateObject(["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"],["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"])));var templateObject_1$L;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$K||(templateObject_1$K=__makeTemplateObject(["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"],["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"])),minScreenSize.large+1,maxContentWidth);var templateObject_1$K;var DetailViewBanner=function DetailViewBanner(){var _a=useDetailViewContext(),item=_a.item,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;if(!item.bannerInfo){return null;}return jsx$1(Banner$3,{itemId:item.id,token:item.fileAccessToken,bannerInfo:item.bannerInfo,useEditorRoutes:isEditorPreview,width:getMaxImageWidth(),canOpenImage:true,resourceType:resourceType},void 0);};var Banner$3=_styled(PublishableItemBanner).withConfig({displayName:"DetailViewBanner__Banner",componentId:"sc-1wuqvtw-0"})(templateObject_1$J||(templateObject_1$J=__makeTemplateObject(["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"],["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"])),bannerAspectRatio,minScreenSize.large+1,minScreenSize.large,spacingM,bannerAspectRatio);var templateObject_1$J;var DetailViewIntro=function DetailViewIntro(){var content=useDetailViewContext().content;var hasIntro=content.intro&&content.intro.length>0;if(!hasIntro){return null;}return jsx$1(DetailIntro,{children:content.intro},void 0);};var DetailIntro=_styled.p.withConfig({displayName:"DetailViewIntro__DetailIntro",componentId:"sc-1kubhyf-0"})(templateObject_1$I||(templateObject_1$I=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"],["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,spacingS,spacingS+2,fontSizeMedium+2);var templateObject_1$I;var DetailMainSection=function DetailMainSection(_a){var children=_a.children;return jsx$1(DetailMainStyledSection,__assign({className:"detail-view-main"},{children:children}),void 0);};var DetailMainStyledSection=_styled.section.withConfig({displayName:"DetailViewMainSection__DetailMainStyledSection",componentId:"sc-ifywhg-0"})(templateObject_1$H||(templateObject_1$H=__makeTemplateObject(["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"],["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"])),detailViewSectionPadding-5,detailViewSectionPadding,detailViewSectionPadding,minScreenSize.small,detailViewSectionPaddingLarge-10,detailViewSectionPaddingLarge,detailViewSectionPaddingLarge);var templateObject_1$H;var GutterMarkerIcon=function GutterMarkerIcon(_a){var iconName=_a.iconName,children=_a.children,isActive=_a.isActive,color=_a.color,tooltipResourceKey=_a.tooltipResourceKey,className=_a.className;return jsxs(Host$f$1,__assign({className:className},{children:[jsx$1(IconContainer$1,__assign({isActive:isActive,className:isActive?"ms-bgColor-"+color:'ms-bgColor-white'},{children:isActive&&jsx$1(StyledTooltip,__assign({resourceKey:tooltipResourceKey},{children:jsx$1(StyledIcon$2$1,{className:"ms-fontColor-white",iconName:iconName},void 0)}),void 0)}),void 0),isActive?jsx$1(ActiveContent,__assign({className:"ms-borderColor-"+color},{children:children}),void 0):jsx$1(Content$3,{children:children},void 0)]}),void 0);};var Host$f$1=_styled.div.withConfig({displayName:"GutterMakerIcon__Host",componentId:"sc-aa2cf4-0"})(templateObject_1$G||(templateObject_1$G=__makeTemplateObject(["\n margin: 0;\n display: flex;\n align-content: center;\n"],["\n margin: 0;\n display: flex;\n align-content: center;\n"])));var StyledIcon$2$1=_styled(Icon).withConfig({displayName:"GutterMakerIcon__StyledIcon",componentId:"sc-aa2cf4-1"})(templateObject_2$r||(templateObject_2$r=__makeTemplateObject(["\n font-size: 25px;\n"],["\n font-size: 25px;\n"])));var Content$3=_styled.div.withConfig({displayName:"GutterMakerIcon__Content",componentId:"sc-aa2cf4-2"})(templateObject_3$j||(templateObject_3$j=__makeTemplateObject(["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"],["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"])));var ActiveContent=_styled(Content$3).withConfig({displayName:"GutterMakerIcon__ActiveContent",componentId:"sc-aa2cf4-3"})(templateObject_4$a$1||(templateObject_4$a$1=__makeTemplateObject(["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"],["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"])));var IconContainer$1=_styled.div.withConfig({displayName:"GutterMakerIcon__IconContainer",componentId:"sc-aa2cf4-4"})(templateObject_5$9$1||(templateObject_5$9$1=__makeTemplateObject(["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"])),function(_a){var isActive=_a.isActive;return isActive?'50px':'auto';});var StyledTooltip=_styled(Tooltip).withConfig({displayName:"GutterMakerIcon__StyledTooltip",componentId:"sc-aa2cf4-5"})(templateObject_6$4$1||(templateObject_6$4$1=__makeTemplateObject(["\n && {\n display: inherit;\n }\n"],["\n && {\n display: inherit;\n }\n"])));var templateObject_1$G,templateObject_2$r,templateObject_3$j,templateObject_4$a$1,templateObject_5$9$1,templateObject_6$4$1;var DetailViewTitle=function DetailViewTitle(){var _a=useDetailViewContext(),content=_a.content,item=_a.item;var hasAlert=hasFlag(item.knownState,KnownNewsState.Alert);return jsx$1(GutterMarkerIcon,__assign({iconName:"Warning",isActive:hasAlert,color:"red",tooltipResourceKey:"NewsArticle.alert"},{children:jsx$1(Title$4,__assign({"data-title":true},{children:content.title}),void 0)}),void 0);};var Title$4=_styled.h1.withConfig({displayName:"DetailViewTitle__Title",componentId:"sc-1jbzvna-0"})(templateObject_1$F||(templateObject_1$F=__makeTemplateObject(["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"],["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"])),fontSizeLarge-1,minScreenSize.small);var templateObject_1$F;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$E||(templateObject_1$E=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"],["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"])),fontSizeSmall);var templateObject_1$E;var mappers=[InlineImageMapper,InlineFileMapper,InlineQuoteMapper,InlineGalleryMapper,InlineCodeMapper,InlineVideoMapper,InlineTable,InlineContactMapper,InlinePageListMapper,InlineUrlPreviewMapper];var RichTextViewer=function RichTextViewer(_a){var html=_a.html;return jsx$1(TextViewer,{html:html,componentMappers:mappers},void 0);};var DetailViewBody=function DetailViewBody(){var _a=useDetailViewContext(),content=_a.content,resourceType=_a.resourceType;var bodyHtml=content&&content.body;return jsx$1(DetailBody$1,__assign({className:"lt-reach-detail-view-body","data-item-type":resourceType},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(RichTextViewer,{html:bodyHtml},void 0)},void 0)}),void 0);};var DetailBody$1=_styled.div.withConfig({displayName:"DetailViewBody__DetailBody",componentId:"sc-7b4trq-0"})(templateObject_1$D||(templateObject_1$D=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"])),fontSizeLarge-1,spacingS+2,fontSizeLarge-3,fontSizeLarge-5,spacingS);var templateObject_1$D;var DetailViewKeywords=function DetailViewKeywords(_a){var filterBaseUrl=_a.filterBaseUrl;var features=useFeatures();var _b=useDetailViewContext(),item=_b.item,userPreferredLanguage=_b.userPreferredLanguage;var formatMessage=useIntl().formatMessage;if(!features.keywords){return null;}return jsx$1(Fragment,{children:Object.keys(item.keywords).length>0&&jsx$1(KeywordsSection,__assign({"aria-label":formatMessage({id:'AriaLabel.section.keywords'})},{children:jsx$1(KeywordsInfo,{keywords:item.keywords,language:userPreferredLanguage,filterBaseUrl:filterBaseUrl},void 0)}),void 0)},void 0);};var KeywordsSection=_styled.section.withConfig({displayName:"DetailViewKeywords__KeywordsSection",componentId:"sc-ltysu4-0"})(templateObject_1$C||(templateObject_1$C=__makeTemplateObject(["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),maxScreenSize.medium,fontSizeSmall);var templateObject_1$C;var ConfirmationBox=function ConfirmationBox(_a){var disabled=_a.disabled,checked=_a.checked,onChange=_a.onChange;var formatMessage=useIntl().formatMessage;return jsx$1(Host$e$1,{children:jsx$1(NeutralCheckBox,{disabled:disabled,checked:checked,onChange:function(_,value){return onChange(value);},label:formatMessage({id:checked?'NewsArticle.confirmed':'NewsArticle.confirm'})},void 0)},void 0);};var Host$e$1=_styled.div.withConfig({displayName:"ConfirmationBox__Host",componentId:"sc-1m5alil-0"})(templateObject_1$B||(templateObject_1$B=__makeTemplateObject(["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"],["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"])));var templateObject_1$B;var ConfirmationSection=function ConfirmationSection(_a){var item=_a.item,showDescription=_a.showDescription,readOnly=_a.readOnly,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var _b=useNotificationContext(),dismissToast=_b.dismissToast,showToast=_b.showToast,showError=_b.showError;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var _d=usePromise$2(function(){return getFeedback(ItemResourceTypes.News,item.id);}),summary=_d[0],isLoading=_d[1];var _e=useState$2(null),userChecked=_e[0],setChecked=_e[1];var toastHandle=useRef$1(null);var checked=userChecked!==null?userChecked:summary!=null&&!!summary.records.find(function(r){return r.type==='confirm';});return jsxs(Host$d$1,__assign({isLoading:isLoading,className:className},{children:[showDescription&&jsx$1(FormattedMessage$1,{id:"NewsArticle.confirmationRequiredDescription",tagName:"p"},void 0),jsx$1(StyledGutterMarkerIcon,__assign({iconName:"Completed",isActive:!isLoading&&!checked,color:"green"},{children:readOnly?jsx$1(ConfirmationBox,{checked:checked,disabled:true},void 0):jsx$1(ConfirmationBox,{checked:checked,disabled:checked,onChange:handleClickConfirm},void 0)}),void 0)]}),void 0);function handleClickConfirm(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:setChecked(true);_a.label=1;case 1:_a.trys.push([1,4,,5]);return [4/*yield*/,setFeedback(ItemResourceTypes.News,item.id,'confirm')];case 2:_a.sent();toastHandle.current=showToast('NewsArticle.confirmationSuccessToast',{},jsx$1(DefaultButton,__assign({onClick:handleUndo},{children:jsx$1(FormattedMessage$1,{id:"Generic.undo"},void 0)}),void 0),{autoClose:false});return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:1})];case 3:_a.sent();return [3/*break*/,5];case 4:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setChecked(false);return [3/*break*/,5];case 5:return [2/*return*/];}});});}function handleUndo(){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);dismissToast(toastHandle.current);toastHandle.current=null;return [4/*yield*/,unsetFeedback(ItemResourceTypes.News,item.id,'confirm')];case 1:_a.sent();return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:-1})];case 2:_a.sent();setChecked(false);return [3/*break*/,4];case 3:error_2=_a.sent();logger.error(error_2);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var Host$d$1=_styled.div.withConfig({displayName:"ConfirmationSection__Host",componentId:"sc-1g2fxdb-0"})(templateObject_1$A||(templateObject_1$A=__makeTemplateObject(["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),function(_a){var isLoading=_a.isLoading;return isLoading?0.4:1;},spacingM,minScreenSize.small,spacingS,maxScreenSize.medium,fontSizeSmall);var StyledGutterMarkerIcon=_styled(GutterMarkerIcon).withConfig({displayName:"ConfirmationSection__StyledGutterMarkerIcon",componentId:"sc-1g2fxdb-1"})(templateObject_2$q||(templateObject_2$q=__makeTemplateObject(["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"],["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"])),maxScreenSize.small,spacingM);var templateObject_1$A,templateObject_2$q;var DetailViewConfirmations=function DetailViewConfirmations(){var features=useFeatures();var _a=useDetailViewContext(),item=_a.item,isEditorPreview=_a.isEditorPreview;var formatMessage=useIntl().formatMessage;if(!showConfirmationBox()){return null;}return jsx$1(ConfirmationHost,__assign({"aria-label":formatMessage({id:'NewsArticle.confirmation'})},{children:jsx$1(ConfirmationSection,{item:item,showDescription:true,readOnly:isEditorPreview},void 0)}),void 0);function showConfirmationBox(){return features.confirmation&&item.metadata&&item.metadata.feedbackSettings&&item.metadata.feedbackSettings.feedbackOptions.indexOf('confirm')>=0;}};var ConfirmationHost=_styled.section.withConfig({displayName:"DetailViewConfirmations__ConfirmationHost",componentId:"sc-f8jogv-0"})(templateObject_1$z||(templateObject_1$z=__makeTemplateObject(["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingL,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$z;var DetailViewPageViewTracker=function DetailViewPageViewTracker(){var _a=useDetailViewContext(),resourceType=_a.resourceType,itemId=_a.itemId;usePageViewTracker(resourceType,itemId);return null;};var FeedbackButtonBookmark=function FeedbackButtonBookmark(_a){var isReadOnly=_a.isReadOnly;var _b=useContext(FeedbackButtonContext),item=_b.item,bookmarkCount=_b.statistics.bookmarkCount;return jsxs(CountButtonHost,{children:[jsx$1(BookmarkButton,{item:item,isReadOnly:isReadOnly},void 0),jsx$1(CountLabel,__assign({isDisabled:isReadOnly},{children:bookmarkCount}),void 0)]},void 0);};var NewsDetailViewFeedbackSection=function NewsDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage,isEditorPreview=_c.isEditorPreview;return jsxs(StyledFeedbackSection,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser,isReadOnly:isEditorPreview},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonBookmark,{isReadOnly:isEditorPreview},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection=_styled(FeedbackSection).withConfig({displayName:"NewsDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-pjpy6x-0"})(templateObject_1$y||(templateObject_1$y=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$y;var DetailViewBodyExternalContent=function DetailViewBodyExternalContent(_a){var itemType=_a.itemType;var content=useDetailViewContext().content;var externalUrl=content&&content.externalUrl;return jsx$1(DetailBody,__assign({className:"lt-reach-detail-view-body"},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(FormattedMessageWithStyle,{id:"ExternalLink."+itemType+".navigateTo",tagName:"p",values:{url:jsx$1(ExternalLink$2,__assign({href:externalUrl,className:"ms-fontColor-accent",target:"_blank",rel:"noopener noreferrer"},{children:externalUrl}),void 0)}},void 0)},void 0)}),void 0);};var DetailBody=_styled.div.withConfig({displayName:"DetailViewBodyExternalContent__DetailBody",componentId:"sc-1xjgw89-0"})(templateObject_1$x||(templateObject_1$x=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"])));var templateObject_1$x;var DetailViewHeadline=function DetailViewHeadline(){var content=useDetailViewContext().content;var features=useFeatures();if(!features.contentHeadline||!content.headline){return null;}return jsx$1(Headline$1$1,__assign({"data-detail-view-headline":true},{children:content.headline}),void 0);};var Headline$1$1=_styled.p.withConfig({displayName:"DetailViewHeadline__Headline",componentId:"sc-wsid06-0"})(templateObject_1$w$1||(templateObject_1$w$1=__makeTemplateObject(["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"],["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,fontSizeMedium,spacingS);var templateObject_1$w$1;var StateIcon=function StateIcon(_a){var status=_a.status,isActive=_a.isActive,_b=_a.width,width=_b===void 0?16:_b,activeColor=_a.activeColor;var textColors=useContext(ThemeContext$1).theme.textColors;if(status===WorkflowStatus.draft){return jsx$1(Draft,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}else if(status===WorkflowStatus.rejected){return jsx$1(Draft,{width:width,color:isActive?activeColor:'#b90000'},void 0);}else if(status===WorkflowStatus.ready){return jsx$1(Ready,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}return null;};var Draft=function Draft(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?16.25:_b;var ratio=20/16.25;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 16.25 20",enableBackground:"new 0 0 16.25 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25V0h0.89l5.36,5.361V6.25H10z M11.25,5h2.861L11.25,2.139V5z M10,0H9.25v1.25H10V0z M7.675,1.25H6.1\n\tV0h1.575V1.25z M4.525,1.25H2.95V0h1.575V1.25z M1.25,17.057H0v-1.567h1.25V17.057z M1.25,13.921H0v-1.568h1.25V13.921z\n\t M1.25,10.784H0V9.216h1.25V10.784z M1.25,7.647H0V6.08h1.25V7.647z M1.25,4.512H0V2.943h1.25V4.512z M13.375,\n\t 20h-1.5v-1.25h1.5V20z\n\t M10.375,20h-1.5v-1.25h1.5V20z M7.375,20h-1.5v-1.25h1.5V20z M4.375,20h-1.5v-1.25h1.5V20z M16.25,\n\t 16.964H15v-1.661h1.25V16.964z\n\t M16.25,13.643H15v-1.661h1.25V13.643z M16.25,10.321H15V8.66h1.25V10.321z M16.25,6.25H15V7h1.25V6.25z\n\t M1.25,18.75H0V20h1.25\n\tV18.75z M1.25,0H0v1.25h1.25V0z M16.25,18.75H15V20h1.25V18.75z"},void 0)}),void 0);};var Ready=function Ready(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?18.564:_b;var ratio=20/18.564;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 18.564 20",enableBackground:"new 0 0 18.564 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25v-5H1.25v17.5H10V20H0V0h10.889l5.361,5.361V12.5L15,13.75v-7.5H10z M18.564,14.551L13.125,20\n \tl-2.627-2.637l0.879-0.879l1.748,1.738l4.561-4.551L18.564,14.551z M11.25,5h2.861L11.25,2.139V5z"},void 0)}),void 0);};function useCommonEditorApi(){var api=useApi();return useMemo(function(){return {list:list,getTaskViewCounts:getTaskViewCounts};function list(type,filter,token,sortDefinition){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token},sortDefinition);return api.custom("editor/"+type+"?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function getTaskViewCounts(type,groupId){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,api.custom("editor/"+type+"/taskcounts?"+queryString.stringify({groupId:groupId})).get(groupId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];}});});}},[api]);}var $$2$1=_export;var requireObjectCoercible$1$1=requireObjectCoercible$c;var isRegExp=isRegexp;var getRegExpFlags=regexpFlags$1$1;var wellKnownSymbol$1=wellKnownSymbol$l;var REPLACE$2=wellKnownSymbol$1('replace');var RegExpPrototype$3=RegExp.prototype;// `String.prototype.replaceAll` method
|
|
132025
132028
|
// https://github.com/tc39/proposal-string-replace-all
|
|
132026
132029
|
$$2$1({target:'String',proto:true},{replaceAll:function replaceAll(searchValue,replaceValue){var O=requireObjectCoercible$1$1(this);var IS_REG_EXP,flags,replacer,string,searchString,template,result,position,index;if(searchValue!=null){IS_REG_EXP=isRegExp(searchValue);if(IS_REG_EXP){flags=String(requireObjectCoercible$1$1('flags'in RegExpPrototype$3?searchValue.flags:getRegExpFlags.call(searchValue)));if(!~flags.indexOf('g'))throw TypeError('`.replaceAll` does not allow non-global regexes');}replacer=searchValue[REPLACE$2];if(replacer!==undefined){return replacer.call(searchValue,O,replaceValue);}}string=String(O);searchString=String(searchValue);if(searchString==='')return replaceAll.call(string,/(?:)/g,replaceValue);template=string.split(searchString);if(typeof replaceValue!=='function'){return template.join(String(replaceValue));}result=template[0];position=result.length;for(index=1;index<template.length;index++){result+=String(replaceValue(searchString,position,string));position+=searchString.length+template[index].length;result+=template[index];}return result;}});_styled.div.withConfig({displayName:"Textarea__Host",componentId:"sc-170lrb4-0"})(templateObject_1$v$1||(templateObject_1$v$1=__makeTemplateObject(["\n display: flex;\n align-items: flex-end;\n position: relative;\n"],["\n display: flex;\n align-items: flex-end;\n position: relative;\n"])));_styled.textarea.withConfig({displayName:"Textarea__StyledTextarea",componentId:"sc-170lrb4-1"})(templateObject_2$p||(templateObject_2$p=__makeTemplateObject(["\n flex: 1 0 auto;\n justify-content: space-between;\n overflow: hidden;\n resize: none;\n min-height: 5px;\n\n ","\n"],["\n flex: 1 0 auto;\n justify-content: space-between;\n overflow: hidden;\n resize: none;\n min-height: 5px;\n\n ","\n"])),InputPlaceholder('font-style: italic'));_styled(IconButton$1).withConfig({displayName:"Textarea__StyledIconButton",componentId:"sc-170lrb4-2"})(templateObject_3$i||(templateObject_3$i=__makeTemplateObject(["\n position: absolute;\n bottom: 2px;\n right: 2px;\n"],["\n position: absolute;\n bottom: 2px;\n right: 2px;\n"])));var templateObject_1$v$1,templateObject_2$p,templateObject_3$i;var InsertFilesDialogHost=_styled.div.withConfig({displayName:"InsertFilesButton__InsertFilesDialogHost",componentId:"sc-1q7gx3n-0"})(templateObject_2$o||(templateObject_2$o=__makeTemplateObject(["\n ","\n\n position: relative;\n padding: ","px;\n text-align: center;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"],["\n ","\n\n position: relative;\n padding: ","px;\n text-align: center;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"])),function(p){return p.isActive&&css$2(templateObject_1$u$1||(templateObject_1$u$1=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n border: 2px black dashed;\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n border: 2px black dashed;\n }\n "])));},spacingM);_styled.p.withConfig({displayName:"InsertFilesButton__DragAndDropText",componentId:"sc-1q7gx3n-1"})(templateObject_3$h||(templateObject_3$h=__makeTemplateObject(["\n font-size: ","px;\n margin: ","px auto 0 auto;\n"],["\n font-size: ","px;\n margin: ","px auto 0 auto;\n"])),fontSizeSmall,spacingS);_styled(DefaultButton).withConfig({displayName:"InsertFilesButton__SelectFileButton",componentId:"sc-1q7gx3n-2"})(templateObject_4$9$1||(templateObject_4$9$1=__makeTemplateObject(["\n margin-top: ","px;\n\n span {\n font-weight: normal;\n }\n"],["\n margin-top: ","px;\n\n span {\n font-weight: normal;\n }\n"])),spacingM);_styled.div.withConfig({displayName:"InsertFilesButton__ButtonsContainer",componentId:"sc-1q7gx3n-3"})(templateObject_5$8$1||(templateObject_5$8$1=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"])));var templateObject_1$u$1,templateObject_2$o,templateObject_3$h,templateObject_4$9$1,templateObject_5$8$1;_styled(InsertFilesDialogHost).withConfig({displayName:"InsertImagesButton__Host",componentId:"sc-63tjy6-0"})(templateObject_1$t$1||(templateObject_1$t$1=__makeTemplateObject(["\n cursor: pointer;\n"],["\n cursor: pointer;\n"])));_styled(PrimaryButton).withConfig({displayName:"InsertImagesButton__StyledButton",componentId:"sc-63tjy6-1"})(templateObject_2$n||(templateObject_2$n=__makeTemplateObject(["\n && {\n display: block;\n margin: 10px auto;\n background-color: transparent;\n color: inherit;\n font-size: large;\n line-height: 2em;\n border: none;\n\n &:hover {\n background-color: transparent;\n color: inherit;\n border: 0;\n }\n }\n"],["\n && {\n display: block;\n margin: 10px auto;\n background-color: transparent;\n color: inherit;\n font-size: large;\n line-height: 2em;\n border: none;\n\n &:hover {\n background-color: transparent;\n color: inherit;\n border: 0;\n }\n }\n"])));_styled.div.withConfig({displayName:"InsertImagesButton__Text",componentId:"sc-63tjy6-2"})(templateObject_3$g||(templateObject_3$g=__makeTemplateObject(["\n max-width: 100%;\n font-size: large;\n"],["\n max-width: 100%;\n font-size: large;\n"])));var templateObject_1$t$1,templateObject_2$n,templateObject_3$g;_styled.div.withConfig({displayName:"InsertVideoDialog__VideoHost",componentId:"sc-12gp7sa-0"})(templateObject_1$s$1||(templateObject_1$s$1=__makeTemplateObject(["\n width: 100%;\n margin-top: ","px;\n\n .video-view-container--youtube {\n &:after {\n padding-bottom: calc(9 / 16 * 100%);\n }\n }\n"],["\n width: 100%;\n margin-top: ","px;\n\n .video-view-container--youtube {\n &:after {\n padding-bottom: calc(9 / 16 * 100%);\n }\n }\n"])),spacingS);_styled(TextField).withConfig({displayName:"InsertVideoDialog__StyledTextField",componentId:"sc-12gp7sa-1"})(templateObject_2$m||(templateObject_2$m=__makeTemplateObject(["\n width: 510px;\n\n label {\n font-weight: normal;\n }\n"],["\n width: 510px;\n\n label {\n font-weight: normal;\n }\n"])));var templateObject_1$s$1,templateObject_2$m;var DateTimePicker=function DateTimePicker(props){var timeField=useRef$1();var formatMessage=useIntl().formatMessage;var _a=useState$2(getTime(props.date)),time=_a[0],setTime=_a[1];var _b=useState$2(false),timeHasFocus=_b[0],setTimeHasFocus=_b[1];var _c=useState$2(null),timeErrorMessageResourceKey=_c[0],setTimeErrorMessageResourceKey=_c[1];var momentMonths=['January','February','March','April','May','June','July','August','September','October','November','December'];var momentWeekdays=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];useEffect$1(function(){// do not update if the user is typing time
|
|
132027
132030
|
if(!timeHasFocus){// We might not know that the time field has the focus after an onBlur from the date field.
|
|
@@ -132035,7 +132038,7 @@ if(!triggerEvenIfUnchanged&&(!newDate&&!props.date||newDate&&newDate.isSame(prop
|
|
|
132035
132038
|
props.onChanged(newDate.toISOString(),validationResult.isInRange);}function handleDateChange(newDate){if(timeField.current){// note: focus event is ignored/not propagated without setTimeout
|
|
132036
132039
|
setTimeout(function(){return timeField.current.focus();},0);}if(!newDate){handleChange(null);}else {// include the current time component when triggering a change.
|
|
132037
132040
|
// newDate is only a Date without time.
|
|
132038
|
-
var newDateOnly=moment(newDate);var timeInMilliseconds=0;if(props.date){var oldDateWithTime=moment(props.date);timeInMilliseconds=oldDateWithTime.diff(oldDateWithTime.clone().startOf('day'));}handleChange(newDateOnly.startOf('day').add(timeInMilliseconds,'ms'));}}function handleTimeBlur(timeString){var newTime=timeString||'00:00';var initialTime=getTime(props.date);if(newTime===initialTime){return;}setTimeHasFocus(false);var timeToday=moment(newTime,'HH:mm');if(!timeToday.isValid()){setTimeErrorMessageResourceKey('DateTimePicker.invalidTime');return;}setTime(timeToday.format('HH:mm'));if(props.date==null){handleChange(timeToday);}else {var timeInMilliseconds=timeToday.diff(moment().startOf('day'));var newValue=moment(props.date).startOf('day').add(timeInMilliseconds,'ms');handleChange(newValue);}}function setTimeError(result){if(result.isInRange||!result.isSameDay){setTimeErrorMessageResourceKey(null);return;}setTimeErrorMessageResourceKey(props.timeValidationResourceKey||props.dateValidationResourceKey);}function isDateTimeInRange(newValue){if(!newValue||!props.minDate&&!props.maxDate){return {isInRange:true,isSameDay:true};}return {isInRange:(!props.minDate||moment(props.minDate).unix()<newValue.unix())&&(!props.maxDate||newValue.unix()<moment(props.maxDate).unix()),isSameDay:isSameDay(newValue,props.minDate||props.maxDate)};}function isSameDay(momentDateTime,otherTime){return momentDateTime&&otherTime&&momentDateTime.isSame(otherTime,'day');}};var IEButtonFix=createGlobalStyle(templateObject_1$r$1||(templateObject_1$r$1=__makeTemplateObject(["\n .browser-name-ie {\n button.ms-DatePicker-goToday {\n left: 15px;\n }\n }\n"],["\n .browser-name-ie {\n button.ms-DatePicker-goToday {\n left: 15px;\n }\n }\n"])));var GlobalDatePickerStyle=createGlobalStyle(templateObject_2$l||(templateObject_2$l=__makeTemplateObject(["\n button.ms-DatePicker-day--today {\n background: "," !important;\n }\n"],["\n button.ms-DatePicker-day--today {\n background: "," !important;\n }\n"])),function(p){return p.theme.palette.accent;});var Host$a$1=_styled.div.withConfig({displayName:"DateTimePicker__Host",componentId:"sc-zzs3p0-0"})(templateObject_3$f$1||(templateObject_3$f$1=__makeTemplateObject(["\n .ms-TextField {\n &.is-disabled {\n opacity: 0.5;\n }\n &-field {\n ","\n }\n\n > &-wrapper {\n > &-fieldGroup {\n background: none;\n > i {\n color: initial;\n }\n }\n }\n }\n\n .ms-TextField:not(:first-of-type) {\n margin-top: 5px;\n }\n"],["\n .ms-TextField {\n &.is-disabled {\n opacity: 0.5;\n }\n &-field {\n ","\n }\n\n > &-wrapper {\n > &-fieldGroup {\n background: none;\n > i {\n color: initial;\n }\n }\n }\n }\n\n .ms-TextField:not(:first-of-type) {\n margin-top: 5px;\n }\n"])),InputPlaceholder("\n color: inherit;\n font-style: italic;\n "));var templateObject_1$r$1,templateObject_2$l,templateObject_3$f$1;var DateRange;(function(DateRange){DateRange[DateRange["TwoYears"]=0]="TwoYears";DateRange[DateRange["OneYear"]=1]="OneYear";DateRange[DateRange["SixMonths"]=2]="SixMonths";DateRange[DateRange["TwoMonths"]=3]="TwoMonths";DateRange[DateRange["OneMonth"]=4]="OneMonth";DateRange[DateRange["SevenDays"]=5]="SevenDays";DateRange[DateRange["YesterDay"]=6]="YesterDay";DateRange[DateRange["Today"]=7]="Today";})(DateRange||(DateRange={}));Object.keys(DateRange).length/2-1;_styled.div.withConfig({displayName:"DateRangeSlider__Host",componentId:"sc-1o5vacm-0"})(templateObject_1$q$1||(templateObject_1$q$1=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n\n .ms-Slider {\n margin-bottom: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n width: 100%;\n\n .ms-Slider {\n margin-bottom: 0;\n }\n"])));_styled.div.withConfig({displayName:"DateRangeSlider__Value",componentId:"sc-1o5vacm-1"})(templateObject_2$k$1||(templateObject_2$k$1=__makeTemplateObject(["\n align-self: flex-end;\n margin-right: 10px;\n"],["\n align-self: flex-end;\n margin-right: 10px;\n"])));_styled.div.withConfig({displayName:"DateRangeSlider__Labels",componentId:"sc-1o5vacm-2"})(templateObject_3$e$1||(templateObject_3$e$1=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin: 0px 10px;\n"],["\n display: flex;\n justify-content: space-between;\n margin: 0px 10px;\n"])));var templateObject_1$q$1,templateObject_2$k$1,templateObject_3$e$1;_styled(IconButton).withConfig({displayName:"ExternalNewsLinkButton__StyledIconButton",componentId:"sc-txzoyq-0"})(templateObject_1$p$1||(templateObject_1$p$1=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$p$1;_styled.div.withConfig({displayName:"CardStyles__Host",componentId:"sc-ovm8js-0"})(templateObject_1$o$1||(templateObject_1$o$1=__makeTemplateObject(["\n display: block;\n padding: 0 ","px ","px ","px;\n flex: 1 1 auto;\n\n &:not([data-banner='image']) {\n position: relative;\n }\n"],["\n display: block;\n padding: 0 ","px ","px ","px;\n flex: 1 1 auto;\n\n &:not([data-banner='image']) {\n position: relative;\n }\n"])),spacingM,spacingM,spacingM);var Intro$3=_styled.p.withConfig({displayName:"CardStyles__Intro",componentId:"sc-ovm8js-1"})(templateObject_2$j$1||(templateObject_2$j$1=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n margin-top: ","px;\n"],["\n margin: 0;\n font-size: ","px;\n margin-top: ","px;\n"])),fontSizeSmall,spacingM-3);var templateObject_1$o$1,templateObject_2$j$1;_styled.p.withConfig({displayName:"NewsCard__Headline",componentId:"sc-rf9b9y-0"})(templateObject_1$n$1||(templateObject_1$n$1=__makeTemplateObject(["\n font-size: ","px;\n font-weight: bold;\n"],["\n font-size: ","px;\n font-weight: bold;\n"])),fontSizeSmall);_styled.h2.withConfig({displayName:"NewsCard__Title",componentId:"sc-rf9b9y-1"})(templateObject_2$i$1||(templateObject_2$i$1=__makeTemplateObject(["\n display: inline-block;\n & + .card-metaInfo {\n padding-top: ","px !important;\n }\n"],["\n display: inline-block;\n & + .card-metaInfo {\n padding-top: ","px !important;\n }\n"])),spacingS);_styled(NavLink).withConfig({displayName:"NewsCard__StyledNavLink",componentId:"sc-rf9b9y-2"})(templateObject_3$d$1||(templateObject_3$d$1=__makeTemplateObject(["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"],["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"])),function(p){return p.theme.textColors.default;});_styled.div.withConfig({displayName:"NewsCard__MetaInfo",componentId:"sc-rf9b9y-3"})(templateObject_4$8$1||(templateObject_4$8$1=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n"],["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n"])));_styled(ClickableChannelTitles).withConfig({displayName:"NewsCard__Channels",componentId:"sc-rf9b9y-4"})(templateObject_5$7$1||(templateObject_5$7$1=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$n$1,templateObject_2$i$1,templateObject_3$d$1,templateObject_4$8$1,templateObject_5$7$1;_styled.div.withConfig({displayName:"EmptyChannelsView__Host",componentId:"sc-b5s0oy-0"})(templateObject_1$m$1||(templateObject_1$m$1=__makeTemplateObject(["\n color: ",";\n text-align: center;\n display: flex;\n flex-direction: column;\n\n > p {\n font-size: 14px;\n margin: 0;\n padding: 3px 0;\n }\n"],["\n color: ",";\n text-align: center;\n display: flex;\n flex-direction: column;\n\n > p {\n font-size: 14px;\n margin: 0;\n padding: 3px 0;\n }\n"])),function(p){return p.theme.palette.neutralTertiary;});_styled(Icon).withConfig({displayName:"EmptyChannelsView__StyledIcon",componentId:"sc-b5s0oy-1"})(templateObject_2$h$1||(templateObject_2$h$1=__makeTemplateObject(["\n font-size: 100px;\n padding: 30px 0;\n"],["\n font-size: 100px;\n padding: 30px 0;\n"])));var templateObject_1$m$1,templateObject_2$h$1;_styled.div.withConfig({displayName:"PromotedNewsItem__Host",componentId:"sc-drndfq-0"})(templateObject_1$l$1||(templateObject_1$l$1=__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__Alert",componentId:"sc-drndfq-1"})(templateObject_2$g$1||(templateObject_2$g$1=__makeTemplateObject(["\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n cursor: pointer;\n width: 100%;\n margin-bottom: 10px;\n border-bottom-width: 4px;\n border-bottom-style: solid;\n"],["\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n cursor: pointer;\n width: 100%;\n margin-bottom: 10px;\n border-bottom-width: 4px;\n border-bottom-style: solid;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__AlertIconOuterContainer",componentId:"sc-drndfq-2"})(templateObject_3$c$1||(templateObject_3$c$1=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__IconContainer",componentId:"sc-drndfq-3"})(templateObject_4$7$1||(templateObject_4$7$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n min-height: 50px;\n height: 100%;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n min-height: 50px;\n height: 100%;\n"])));_styled(Icon).withConfig({displayName:"PromotedNewsItem__StyledIcon",componentId:"sc-drndfq-4"})(templateObject_5$6$1||(templateObject_5$6$1=__makeTemplateObject(["\n font-size: 25px;\n color: white;\n"],["\n font-size: 25px;\n color: white;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__ContentContainer",componentId:"sc-drndfq-5"})(templateObject_6$3$1||(templateObject_6$3$1=__makeTemplateObject(["\n display: flex;\n width: 100%;\n"],["\n display: flex;\n width: 100%;\n"])));_styled(DateTime).withConfig({displayName:"PromotedNewsItem__StyledDate",componentId:"sc-drndfq-6"})(templateObject_7$2$1||(templateObject_7$2$1=__makeTemplateObject(["\n font-size: 0.9em;\n color: #666;\n margin-left: 20px;\n min-width: 150px;\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n font-size: 0.9em;\n color: #666;\n margin-left: 20px;\n min-width: 150px;\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.small);_styled.h2.withConfig({displayName:"PromotedNewsItem__Title",componentId:"sc-drndfq-7"})(templateObject_8$2$1||(templateObject_8$2$1=__makeTemplateObject(["\n font-size: 1.1em;\n margin-top: 0;\n margin-bottom: 0;\n max-width: 1000px;\n\n @media (max-width: ","px) {\n max-width: 700px;\n }\n\n @media (max-width: ","px) {\n max-width: 450px;\n }\n\n @media (max-width: ","px) {\n max-width: 300px;\n }\n\n @media (max-width: ","px) {\n margin-left: 20px;\n max-width: 280px;\n }\n"],["\n font-size: 1.1em;\n margin-top: 0;\n margin-bottom: 0;\n max-width: 1000px;\n\n @media (max-width: ","px) {\n max-width: 700px;\n }\n\n @media (max-width: ","px) {\n max-width: 450px;\n }\n\n @media (max-width: ","px) {\n max-width: 300px;\n }\n\n @media (max-width: ","px) {\n margin-left: 20px;\n max-width: 280px;\n }\n"])),maxScreenSize.xLarge,maxScreenSize.large,maxScreenSize.medium,maxScreenSize.small);_styled.div.withConfig({displayName:"PromotedNewsItem__BookmarkContainer",componentId:"sc-drndfq-8"})(templateObject_9$2$1||(templateObject_9$2$1=__makeTemplateObject(["\n margin-right: 10px;\n align-self: flex-end;\n padding-bottom: 10px;\n"],["\n margin-right: 10px;\n align-self: flex-end;\n padding-bottom: 10px;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__TextContainer",componentId:"sc-drndfq-9"})(templateObject_10$1$1||(templateObject_10$1$1=__makeTemplateObject(["\n display: flex;\n width: 100%;\n align-items: center;\n padding: 10px 0;\n"],["\n display: flex;\n width: 100%;\n align-items: center;\n padding: 10px 0;\n"])));var templateObject_1$l$1,templateObject_2$g$1,templateObject_3$c$1,templateObject_4$7$1,templateObject_5$6$1,templateObject_6$3$1,templateObject_7$2$1,templateObject_8$2$1,templateObject_9$2$1,templateObject_10$1$1;function useTranslateApi(){var api=useApi();return useMemo(function(){return {translateContents:translateContents};function translateContents(type,itemId,language){return api.custom(type+"/"+itemId+"/contents/"+language).get().then(function(res){return res.body().data();});}},[api]);}var $$1$1=_export;var getOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f;var toLength$2=toLength$b;var notARegExp=notARegexp;var requireObjectCoercible$d=requireObjectCoercible$c;var correctIsRegExpLogic=correctIsRegexpLogic;var nativeEndsWith=''.endsWith;var min=Math.min;var CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic('endsWith');// https://github.com/zloirock/core-js/pull/702
|
|
132041
|
+
var newDateOnly=moment(newDate);var timeInMilliseconds=0;if(props.date){var oldDateWithTime=moment(props.date);timeInMilliseconds=oldDateWithTime.diff(oldDateWithTime.clone().startOf('day'));}handleChange(newDateOnly.startOf('day').add(timeInMilliseconds,'ms'));}}function handleTimeBlur(timeString){var newTime=timeString||'00:00';var initialTime=getTime(props.date);if(newTime===initialTime){return;}setTimeHasFocus(false);var timeToday=moment(newTime,'HH:mm');if(!timeToday.isValid()){setTimeErrorMessageResourceKey('DateTimePicker.invalidTime');return;}setTime(timeToday.format('HH:mm'));if(props.date==null){handleChange(timeToday);}else {var timeInMilliseconds=timeToday.diff(moment().startOf('day'));var newValue=moment(props.date).startOf('day').add(timeInMilliseconds,'ms');handleChange(newValue);}}function setTimeError(result){if(result.isInRange||!result.isSameDay){setTimeErrorMessageResourceKey(null);return;}setTimeErrorMessageResourceKey(props.timeValidationResourceKey||props.dateValidationResourceKey);}function isDateTimeInRange(newValue){if(!newValue||!props.minDate&&!props.maxDate){return {isInRange:true,isSameDay:true};}return {isInRange:(!props.minDate||moment(props.minDate).unix()<newValue.unix())&&(!props.maxDate||newValue.unix()<moment(props.maxDate).unix()),isSameDay:isSameDay(newValue,props.minDate||props.maxDate)};}function isSameDay(momentDateTime,otherTime){return momentDateTime&&otherTime&&momentDateTime.isSame(otherTime,'day');}};var IEButtonFix=createGlobalStyle(templateObject_1$r$1||(templateObject_1$r$1=__makeTemplateObject(["\n .browser-name-ie {\n button.ms-DatePicker-goToday {\n left: 15px;\n }\n }\n"],["\n .browser-name-ie {\n button.ms-DatePicker-goToday {\n left: 15px;\n }\n }\n"])));var GlobalDatePickerStyle=createGlobalStyle(templateObject_2$l||(templateObject_2$l=__makeTemplateObject(["\n button.ms-DatePicker-day--today {\n background: "," !important;\n }\n"],["\n button.ms-DatePicker-day--today {\n background: "," !important;\n }\n"])),function(p){return p.theme.palette.accent;});var Host$a$1=_styled.div.withConfig({displayName:"DateTimePicker__Host",componentId:"sc-zzs3p0-0"})(templateObject_3$f$1||(templateObject_3$f$1=__makeTemplateObject(["\n .ms-TextField {\n &.is-disabled {\n opacity: 0.5;\n }\n &-field {\n ","\n }\n\n > &-wrapper {\n > &-fieldGroup {\n background: none;\n > i {\n color: initial;\n }\n }\n }\n }\n\n .ms-TextField:not(:first-of-type) {\n margin-top: 5px;\n }\n"],["\n .ms-TextField {\n &.is-disabled {\n opacity: 0.5;\n }\n &-field {\n ","\n }\n\n > &-wrapper {\n > &-fieldGroup {\n background: none;\n > i {\n color: initial;\n }\n }\n }\n }\n\n .ms-TextField:not(:first-of-type) {\n margin-top: 5px;\n }\n"])),InputPlaceholder("\n color: inherit;\n font-style: italic;\n "));var templateObject_1$r$1,templateObject_2$l,templateObject_3$f$1;var DateRange;(function(DateRange){DateRange[DateRange["TwoYears"]=0]="TwoYears";DateRange[DateRange["OneYear"]=1]="OneYear";DateRange[DateRange["SixMonths"]=2]="SixMonths";DateRange[DateRange["TwoMonths"]=3]="TwoMonths";DateRange[DateRange["OneMonth"]=4]="OneMonth";DateRange[DateRange["SevenDays"]=5]="SevenDays";DateRange[DateRange["YesterDay"]=6]="YesterDay";DateRange[DateRange["Today"]=7]="Today";})(DateRange||(DateRange={}));Object.keys(DateRange).length/2-1;_styled.div.withConfig({displayName:"DateRangeSlider__Host",componentId:"sc-1o5vacm-0"})(templateObject_1$q$1||(templateObject_1$q$1=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n\n .ms-Slider {\n margin-bottom: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n width: 100%;\n\n .ms-Slider {\n margin-bottom: 0;\n }\n"])));_styled.div.withConfig({displayName:"DateRangeSlider__Value",componentId:"sc-1o5vacm-1"})(templateObject_2$k||(templateObject_2$k=__makeTemplateObject(["\n align-self: flex-end;\n margin-right: 10px;\n"],["\n align-self: flex-end;\n margin-right: 10px;\n"])));_styled.div.withConfig({displayName:"DateRangeSlider__Labels",componentId:"sc-1o5vacm-2"})(templateObject_3$e$1||(templateObject_3$e$1=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin: 0px 10px;\n"],["\n display: flex;\n justify-content: space-between;\n margin: 0px 10px;\n"])));var templateObject_1$q$1,templateObject_2$k,templateObject_3$e$1;_styled(IconButton).withConfig({displayName:"ExternalNewsLinkButton__StyledIconButton",componentId:"sc-txzoyq-0"})(templateObject_1$p$1||(templateObject_1$p$1=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$p$1;_styled.div.withConfig({displayName:"CardStyles__Host",componentId:"sc-ovm8js-0"})(templateObject_1$o$1||(templateObject_1$o$1=__makeTemplateObject(["\n display: block;\n padding: 0 ","px ","px ","px;\n flex: 1 1 auto;\n\n &:not([data-banner='image']) {\n position: relative;\n }\n"],["\n display: block;\n padding: 0 ","px ","px ","px;\n flex: 1 1 auto;\n\n &:not([data-banner='image']) {\n position: relative;\n }\n"])),spacingM,spacingM,spacingM);var Intro$3=_styled.p.withConfig({displayName:"CardStyles__Intro",componentId:"sc-ovm8js-1"})(templateObject_2$j$1||(templateObject_2$j$1=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n margin-top: ","px;\n"],["\n margin: 0;\n font-size: ","px;\n margin-top: ","px;\n"])),fontSizeSmall,spacingM-3);var templateObject_1$o$1,templateObject_2$j$1;_styled.p.withConfig({displayName:"NewsCard__Headline",componentId:"sc-rf9b9y-0"})(templateObject_1$n$1||(templateObject_1$n$1=__makeTemplateObject(["\n font-size: ","px;\n font-weight: bold;\n"],["\n font-size: ","px;\n font-weight: bold;\n"])),fontSizeSmall);_styled.h2.withConfig({displayName:"NewsCard__Title",componentId:"sc-rf9b9y-1"})(templateObject_2$i$1||(templateObject_2$i$1=__makeTemplateObject(["\n display: inline-block;\n & + .card-metaInfo {\n padding-top: ","px !important;\n }\n"],["\n display: inline-block;\n & + .card-metaInfo {\n padding-top: ","px !important;\n }\n"])),spacingS);_styled(NavLink).withConfig({displayName:"NewsCard__StyledNavLink",componentId:"sc-rf9b9y-2"})(templateObject_3$d$1||(templateObject_3$d$1=__makeTemplateObject(["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"],["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"])),function(p){return p.theme.textColors.default;});_styled.div.withConfig({displayName:"NewsCard__MetaInfo",componentId:"sc-rf9b9y-3"})(templateObject_4$8$1||(templateObject_4$8$1=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n"],["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n"])));_styled(ClickableChannelTitles).withConfig({displayName:"NewsCard__Channels",componentId:"sc-rf9b9y-4"})(templateObject_5$7$1||(templateObject_5$7$1=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$n$1,templateObject_2$i$1,templateObject_3$d$1,templateObject_4$8$1,templateObject_5$7$1;_styled.div.withConfig({displayName:"EmptyChannelsView__Host",componentId:"sc-b5s0oy-0"})(templateObject_1$m$1||(templateObject_1$m$1=__makeTemplateObject(["\n color: ",";\n text-align: center;\n display: flex;\n flex-direction: column;\n\n > p {\n font-size: 14px;\n margin: 0;\n padding: 3px 0;\n }\n"],["\n color: ",";\n text-align: center;\n display: flex;\n flex-direction: column;\n\n > p {\n font-size: 14px;\n margin: 0;\n padding: 3px 0;\n }\n"])),function(p){return p.theme.palette.neutralTertiary;});_styled(Icon).withConfig({displayName:"EmptyChannelsView__StyledIcon",componentId:"sc-b5s0oy-1"})(templateObject_2$h$1||(templateObject_2$h$1=__makeTemplateObject(["\n font-size: 100px;\n padding: 30px 0;\n"],["\n font-size: 100px;\n padding: 30px 0;\n"])));var templateObject_1$m$1,templateObject_2$h$1;_styled.div.withConfig({displayName:"PromotedNewsItem__Host",componentId:"sc-drndfq-0"})(templateObject_1$l$1||(templateObject_1$l$1=__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__Alert",componentId:"sc-drndfq-1"})(templateObject_2$g$1||(templateObject_2$g$1=__makeTemplateObject(["\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n cursor: pointer;\n width: 100%;\n margin-bottom: 10px;\n border-bottom-width: 4px;\n border-bottom-style: solid;\n"],["\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n cursor: pointer;\n width: 100%;\n margin-bottom: 10px;\n border-bottom-width: 4px;\n border-bottom-style: solid;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__AlertIconOuterContainer",componentId:"sc-drndfq-2"})(templateObject_3$c$1||(templateObject_3$c$1=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__IconContainer",componentId:"sc-drndfq-3"})(templateObject_4$7$1||(templateObject_4$7$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n min-height: 50px;\n height: 100%;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n min-height: 50px;\n height: 100%;\n"])));_styled(Icon).withConfig({displayName:"PromotedNewsItem__StyledIcon",componentId:"sc-drndfq-4"})(templateObject_5$6$1||(templateObject_5$6$1=__makeTemplateObject(["\n font-size: 25px;\n color: white;\n"],["\n font-size: 25px;\n color: white;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__ContentContainer",componentId:"sc-drndfq-5"})(templateObject_6$3$1||(templateObject_6$3$1=__makeTemplateObject(["\n display: flex;\n width: 100%;\n"],["\n display: flex;\n width: 100%;\n"])));_styled(DateTime).withConfig({displayName:"PromotedNewsItem__StyledDate",componentId:"sc-drndfq-6"})(templateObject_7$2$1||(templateObject_7$2$1=__makeTemplateObject(["\n font-size: 0.9em;\n color: #666;\n margin-left: 20px;\n min-width: 150px;\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n font-size: 0.9em;\n color: #666;\n margin-left: 20px;\n min-width: 150px;\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.small);_styled.h2.withConfig({displayName:"PromotedNewsItem__Title",componentId:"sc-drndfq-7"})(templateObject_8$2$1||(templateObject_8$2$1=__makeTemplateObject(["\n font-size: 1.1em;\n margin-top: 0;\n margin-bottom: 0;\n max-width: 1000px;\n\n @media (max-width: ","px) {\n max-width: 700px;\n }\n\n @media (max-width: ","px) {\n max-width: 450px;\n }\n\n @media (max-width: ","px) {\n max-width: 300px;\n }\n\n @media (max-width: ","px) {\n margin-left: 20px;\n max-width: 280px;\n }\n"],["\n font-size: 1.1em;\n margin-top: 0;\n margin-bottom: 0;\n max-width: 1000px;\n\n @media (max-width: ","px) {\n max-width: 700px;\n }\n\n @media (max-width: ","px) {\n max-width: 450px;\n }\n\n @media (max-width: ","px) {\n max-width: 300px;\n }\n\n @media (max-width: ","px) {\n margin-left: 20px;\n max-width: 280px;\n }\n"])),maxScreenSize.xLarge,maxScreenSize.large,maxScreenSize.medium,maxScreenSize.small);_styled.div.withConfig({displayName:"PromotedNewsItem__BookmarkContainer",componentId:"sc-drndfq-8"})(templateObject_9$2$1||(templateObject_9$2$1=__makeTemplateObject(["\n margin-right: 10px;\n align-self: flex-end;\n padding-bottom: 10px;\n"],["\n margin-right: 10px;\n align-self: flex-end;\n padding-bottom: 10px;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__TextContainer",componentId:"sc-drndfq-9"})(templateObject_10$1$1||(templateObject_10$1$1=__makeTemplateObject(["\n display: flex;\n width: 100%;\n align-items: center;\n padding: 10px 0;\n"],["\n display: flex;\n width: 100%;\n align-items: center;\n padding: 10px 0;\n"])));var templateObject_1$l$1,templateObject_2$g$1,templateObject_3$c$1,templateObject_4$7$1,templateObject_5$6$1,templateObject_6$3$1,templateObject_7$2$1,templateObject_8$2$1,templateObject_9$2$1,templateObject_10$1$1;function useTranslateApi(){var api=useApi();return useMemo(function(){return {translateContents:translateContents};function translateContents(type,itemId,language){return api.custom(type+"/"+itemId+"/contents/"+language).get().then(function(res){return res.body().data();});}},[api]);}var $$1$1=_export;var getOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f;var toLength$2=toLength$b;var notARegExp=notARegexp;var requireObjectCoercible$d=requireObjectCoercible$c;var correctIsRegExpLogic=correctIsRegexpLogic;var nativeEndsWith=''.endsWith;var min=Math.min;var CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic('endsWith');// https://github.com/zloirock/core-js/pull/702
|
|
132039
132042
|
var MDN_POLYFILL_BUG=!CORRECT_IS_REGEXP_LOGIC&&!!function(){var descriptor=getOwnPropertyDescriptor(String.prototype,'endsWith');return descriptor&&!descriptor.writable;}();// `String.prototype.endsWith` method
|
|
132040
132043
|
// https://tc39.github.io/ecma262/#sec-string.prototype.endswith
|
|
132041
132044
|
$$1$1({target:'String',proto:true,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{endsWith:function endsWith(searchString/* , endPosition = @length */){var that=String(requireObjectCoercible$d(this));notARegExp(searchString);var endPosition=arguments.length>1?arguments[1]:undefined;var len=toLength$2(that.length);var end=endPosition===undefined?len:min(toLength$2(endPosition),len);var search=String(searchString);return nativeEndsWith?nativeEndsWith.call(that,search,end):that.slice(end-search.length,end)===search;}});var SearchHighlighter=function SearchHighlighter(_a){var highlight=_a.highlight;if(!highlight){return null;}return jsx$1(Fragment,{children:highlight.texts.map(function(t){return jsxs(TextEntry,__assign({highlight:t.type==='hit'},{children:[t.value.startsWith(' ')?jsx$1(Fragment,{children:"\u00A0"},void 0):null,t.value.trim(),t.value.endsWith(' ')?jsx$1(Fragment,{children:"\u00A0"},void 0):null]}),void 0);})},void 0);};var TextEntry=_styled.span.withConfig({displayName:"SearchHighlighter__TextEntry",componentId:"sc-1a25f6p-0"})(templateObject_2$f$1||(templateObject_2$f$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.highlight&&css$2(templateObject_1$k$1||(templateObject_1$k$1=__makeTemplateObject(["\n background-color: yellow;\n "],["\n background-color: yellow;\n "])));});function tryGetHighlight(highlights,preferredLanguage){var _a;if(!highlights){return null;}return (_a=tryGetAllHighlights(highlights,preferredLanguage))===null||_a===void 0?void 0:_a[0];}function tryGetAllHighlights(highlights,preferredLanguage){if(!highlights){return null;}var preferredHighlights=highlights.filter(function(h){return h.language===preferredLanguage;});if(preferredHighlights.length){return preferredHighlights;}var firstHighlight=highlights[0];return highlights.filter(function(h){return h.language===firstHighlight.language;});}var templateObject_1$k$1,templateObject_2$f$1;var PageTitle=function PageTitle(_a){var page=_a.page,title=_a.title,search=_a.search,className=_a.className;var user=useCurrentUser();var isDocument=page.pageType===PageType.Document;var language=getLanguageForPage(page,user);var buildPath=useSubscriptionHandlePathBuilder().buildPath;var handleExternalContentClick=useExternalContentClickHandler();var pageTitle=jsx$1(Fragment,{children:search?jsx$1(TitleHighlight,{search:search,title:title,page:page},void 0):title},void 0);if(page.useExternalContent){var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(page,preferredContentLanguage);var targetRoute=NewsService.getNewsRoute(buildPath('/pages'),page.id,title);return jsx$1(Title$1$1,{children:jsxs(StyledNavLink,__assign({to:targetRoute,onClick:function(e){return handleExternalContentClick(e,page,ItemResourceTypes.Pages);}},{children:[pageTitle,jsx$1(ExternalContentIcon,{tooltipResourceKey:'ExternalLinkButton.pages.navigateTo',tooltipResourceValues:url},void 0)]}),void 0)},void 0);}return jsxs(Title$1$1,__assign({className:className},{children:[isDocument&&jsx$1(FileIcon,{iconName:getFileIconByExtension(page.contents[language].fileInfo.extension)},void 0),pageTitle]}),void 0);};var TitleHighlight=function TitleHighlight(_a){var _b;var search=_a.search,title=_a.title,page=_a.page;var user=useCurrentUser();var preferredLanguage=NewsService.getLanguageForContent(page.contents,user);var titleHighlight=tryGetHighlight((_b=page.searchHighlights)===null||_b===void 0?void 0:_b.title,preferredLanguage);if(titleHighlight){return jsx$1(SearchHighlighter,{highlight:titleHighlight},void 0);}return jsx$1(Highlighter,{searchWords:[search],autoEscape:true,textToHighlight:title},void 0);};var Title$1$1=_styled.h2.withConfig({displayName:"PageTitle__Title",componentId:"sc-gsx6ad-0"})(templateObject_1$j$1||(templateObject_1$j$1=__makeTemplateObject(["\n display: flex;\n margin: ","px 0 ","px 0;\n font-weight: bold;\n font-size: ","px;\n padding: 0;\n"],["\n display: flex;\n margin: ","px 0 ","px 0;\n font-weight: bold;\n font-size: ","px;\n padding: 0;\n"])),spacingS+5,spacingS,fontSizeMedium);var FileIcon=_styled(Icon).withConfig({displayName:"PageTitle__FileIcon",componentId:"sc-gsx6ad-1"})(templateObject_2$e$1||(templateObject_2$e$1=__makeTemplateObject(["\n font-size: ","px;\n margin-right: ","px;\n align-self: flex-start;\n"],["\n font-size: ","px;\n margin-right: ","px;\n align-self: flex-start;\n"])),fontSizeMedium+4,spacingS);var StyledNavLink=_styled(NavLink).withConfig({displayName:"PageTitle__StyledNavLink",componentId:"sc-gsx6ad-2"})(templateObject_3$b$1||(templateObject_3$b$1=__makeTemplateObject(["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"],["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$j$1,templateObject_2$e$1,templateObject_3$b$1;_styled.div.withConfig({displayName:"PageCard__PageModifiedInfo",componentId:"sc-13xtreq-0"})(templateObject_1$i$1||(templateObject_1$i$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n"],["\n font-size: ","px;\n color: ",";\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;});_styled(PageTitle).withConfig({displayName:"PageCard__StyledPageTitle",componentId:"sc-13xtreq-1"})(templateObject_2$d$1||(templateObject_2$d$1=__makeTemplateObject(["\n && {\n margin: 0;\n flex: 1 1 auto;\n }\n"],["\n && {\n margin: 0;\n flex: 1 1 auto;\n }\n"])));_styled(Intro$3).withConfig({displayName:"PageCard__StyledIntro",componentId:"sc-13xtreq-2"})(templateObject_3$a$1||(templateObject_3$a$1=__makeTemplateObject(["\n && {\n margin-top: ","px;\n margin-bottom: ","px;\n }\n"],["\n && {\n margin-top: ","px;\n margin-bottom: ","px;\n }\n"])),spacingS,spacingS);_styled.div.withConfig({displayName:"PageCard__Keywords",componentId:"sc-13xtreq-3"})(templateObject_4$6$1||(templateObject_4$6$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n padding-bottom: ","px;\n"],["\n font-size: ","px;\n color: ",";\n padding-bottom: ","px;\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;},spacingS);_styled.div.withConfig({displayName:"PageCard__Inner",componentId:"sc-13xtreq-4"})(templateObject_5$5$1||(templateObject_5$5$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: ","px 0 ","px 0;\n"],["\n display: flex;\n align-items: center;\n margin: ","px 0 ","px 0;\n"])),spacingM,spacingS);_styled(DocumentDownloadButton).withConfig({displayName:"PageCard__StyledDocumentDownloadButton",componentId:"sc-13xtreq-5"})(templateObject_6$2$1||(templateObject_6$2$1=__makeTemplateObject(["\n align-self: flex-start;\n z-index: 1;\n"],["\n align-self: flex-start;\n z-index: 1;\n"])));var templateObject_1$i$1,templateObject_2$d$1,templateObject_3$a$1,templateObject_4$6$1,templateObject_5$5$1,templateObject_6$2$1;_styled.p.withConfig({displayName:"PageListItemBody__FullContent",componentId:"sc-7voum-0"})(templateObject_1$h$1||(templateObject_1$h$1=__makeTemplateObject(["\n padding: 0;\n margin: 0 0 ","px 0;\n font-size: ","px;\n line-height: 1.5;\n"],["\n padding: 0;\n margin: 0 0 ","px 0;\n font-size: ","px;\n line-height: 1.5;\n"])),spacingM-5,fontSizeSmall);_styled.div.withConfig({displayName:"PageListItemBody__CutContentContainer",componentId:"sc-7voum-1"})(templateObject_2$c$1||(templateObject_2$c$1=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-bottom: ","px;\n"],["\n display: flex;\n flex-direction: column;\n margin-bottom: ","px;\n"])),spacingM-5);_styled.p.withConfig({displayName:"PageListItemBody__CutContent",componentId:"sc-7voum-2"})(templateObject_3$9$1||(templateObject_3$9$1=__makeTemplateObject(["\n padding: 0;\n margin: 0;\n ","\n"],["\n padding: 0;\n margin: 0;\n ","\n"])),LineClamp(5,fontSizeSmall,1.5));_styled(ActionButton).withConfig({displayName:"PageListItemBody__StyledActionButton",componentId:"sc-7voum-3"})(templateObject_4$5$1||(templateObject_4$5$1=__makeTemplateObject(["\n && {\n height: auto;\n margin: 0 0 0 auto;\n padding: ","px ","px 0 ","px;\n font-size: ","px;\n z-index: 1;\n\n &:hover {\n text-decoration: underline;\n }\n }\n"],["\n && {\n height: auto;\n margin: 0 0 0 auto;\n padding: ","px ","px 0 ","px;\n font-size: ","px;\n z-index: 1;\n\n &:hover {\n text-decoration: underline;\n }\n }\n"])),spacingXs,spacingXs,spacingXs,fontSizeSmaller);var templateObject_1$h$1,templateObject_2$c$1,templateObject_3$9$1,templateObject_4$5$1;_styled.div.withConfig({displayName:"PageListItem__Host",componentId:"sc-lz5d51-0"})(templateObject_1$g$1||(templateObject_1$g$1=__makeTemplateObject(["\n ",";\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n\n padding: ","px;\n"],["\n ",";\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n\n padding: ","px;\n"])),CardBorderInline(2,2),spacingM);_styled.div.withConfig({displayName:"PageListItem__Keywords",componentId:"sc-lz5d51-1"})(templateObject_2$b$1||(templateObject_2$b$1=__makeTemplateObject(["\n position: relative;\n font-size: ","px;\n color: ",";\n padding-bottom: ","px;\n\n a {\n position: relative;\n z-index: 1;\n }\n"],["\n position: relative;\n font-size: ","px;\n color: ",";\n padding-bottom: ","px;\n\n a {\n position: relative;\n z-index: 1;\n }\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;},spacingS);_styled.div.withConfig({displayName:"PageListItem__LastUpdated",componentId:"sc-lz5d51-2"})(templateObject_3$8$1||(templateObject_3$8$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n"],["\n font-size: ","px;\n color: ",";\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;});_styled(PageBreadcrumb).withConfig({displayName:"PageListItem__StyledPageBreadcrumb",componentId:"sc-lz5d51-3"})(templateObject_4$4$1||(templateObject_4$4$1=__makeTemplateObject(["\n flex: 1 1 auto;\n width: ","%;\n"],["\n flex: 1 1 auto;\n width: ","%;\n"])),function(p){return p.maxWidth;});_styled.div.withConfig({displayName:"PageListItem__Inner",componentId:"sc-lz5d51-4"})(templateObject_5$4$1||(templateObject_5$4$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n align-items: center;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var templateObject_1$g$1,templateObject_2$b$1,templateObject_3$8$1,templateObject_4$4$1,templateObject_5$4$1;var PagesDetailViewNavigation=function PagesDetailViewNavigation(_a){var basePath=_a.basePath,navigationContext=_a.navigationContext,activePageId=_a.activePageId,className=_a.className;var features=useFeatures();var user=useCurrentUser();if(!features.inPageNavigation){return null;}var currentPage=navigationContext.siblings.find(function(s){return s.id===activePageId;});if(currentPage==null){return null;}// sort by group and position only the root pages
|
|
@@ -132049,7 +132052,7 @@ if(typeof C=='function'&&(C===Array||isArray$4(C.prototype)))C=undefined;else if
|
|
|
132049
132052
|
// https://github.com/tc39/proposal-flatMap
|
|
132050
132053
|
$$h({target:'Array',proto:true},{flatMap:function flatMap(callbackfn/* , thisArg */){var O=toObject(this);var sourceLen=toLength$c(O.length);var A;aFunction(callbackfn);A=arraySpeciesCreate(O,0);A.length=flattenIntoArray(A,O,O,sourceLen,0,1,callbackfn,arguments.length>1?arguments[1]:undefined);return A;}});// this method was added to unscopables after implementation
|
|
132051
132054
|
// in popular engines, so it's moved to a separate module
|
|
132052
|
-
var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));var StreamKnownNewsState;(function(StreamKnownNewsState){StreamKnownNewsState["Unconfirmed"]="UNCONFIRMED";StreamKnownNewsState["Alert"]="ALERT";})(StreamKnownNewsState||(StreamKnownNewsState={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isNews(item){return item.type===StreamItemTypes.News;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}function getGroupedKeywordsFromStream(keywords){var groupedKeywords={};(keywords||[]).forEach(function(k){if(!groupedKeywords[k.groupId]){groupedKeywords[k.groupId]=[];}var keyword=__assign(__assign({},k),{translations:(k.translations||[]).reduce(function(prev,curr){var _a;return __assign(__assign({},prev),(_a={},_a[curr.key]=curr.value,_a));},{})});groupedKeywords[k.groupId].push(keyword);});return groupedKeywords;}function convertProperties(items,user,subscriptionChannels){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywordsFromStream(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(subscriptionChannels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i)),getKnownNewsState(i));});}function getKnownNewsState(item){var _a,_b;if(!isNews(item)){return {};}var state=KnownNewsState.None;if((_a=item.knownNewsState)===null||_a===void 0?void 0:_a.includes(StreamKnownNewsState.Alert)){state|=KnownNewsState.Alert;}if((_b=item.knownNewsState)===null||_b===void 0?void 0:_b.includes(StreamKnownNewsState.Unconfirmed)){state|=KnownNewsState.Unconfirmed;}return {knownState:state};}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));var CHANNELS_CONDITION=function CHANNELS_CONDITION(channels,allChannels){var _a,_b;if(!channels){return '';}var channelIds=(_b=(_a=channels.items)===null||_a===void 0?void 0:_a.map(function(c){var _a;return ((_a=allChannels===null||allChannels===void 0?void 0:allChannels.find(function(uc){return uc.name===c;}))===null||_a===void 0?void 0:_a.id)||"INVALID_CHANNEL_"+c;}))===null||_b===void 0?void 0:_b.map(function(c){return "\""+c+"\"";});if(!(channelIds===null||channelIds===void 0?void 0:channelIds.length)){return '';}if(channels.operator===LogicalOperator.And){var channelConditions=channelIds.map(function(c){return "{ channels: { some: { eq: "+c+" } } }";});return "and: [\n "+channelConditions.join()+"\n ]";}return "channels: { some: { in: ["+channelIds+"] } }";};var KEYWORDS_CONDITION=function KEYWORDS_CONDITION(keywords){var _a;if(!keywords||!((_a=keywords.items)===null||_a===void 0?void 0:_a.length)){return '';}if(keywords.operator===LogicalOperator.And){var keywordConditions=keywords.items.map(function(k){return "{ keywordIds: { some: { eq: \""+k+"\" } } }";});return "and: [\n "+keywordConditions.join()+"\n ]";}return "keywordIds: { some: { in: ["+keywords.items.map(function(k){return "\""+k+"\"";})+"] } }";};var OWNER_CONDITION=function OWNER_CONDITION(owner){if(!owner){return '';}return "or: [\n { author: { userPrincipalName: { eq: \""+owner+"\" } } }\n { owner: { userPrincipalName: { eq: \""+owner+"\" } } }\n { onBehalfOf: { userPrincipalName: { eq: \""+owner+"\" } } }\n ]";};var PUBLISHING_DATE_CONDITION=function PUBLISHING_DATE_CONDITION(beforeDate,afterDate){if(!beforeDate&&!afterDate){return '';}if(beforeDate&&afterDate){return "and: [\n { publishingDate: { gt: \""+afterDate+"\" } }\n { publishingDate: { lt: \""+beforeDate+"\" } }\n ]";}return afterDate?"publishingDate: { gt: \""+afterDate+"\" }":"publishingDate: { lt: \""+beforeDate+"\" }";};var AUTHORS_CONDITION=function AUTHORS_CONDITION(authors){if(!authors||!authors.length){return '';}return "or: [\n { owner: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n { onBehalfOf: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n ]";};gql(templateObject_2$5$1||(templateObject_2$5$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_2$5$1,templateObject_3$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=useRef$1();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsx$1(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsx$1(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxs(Options,{children:[props.allowSelection&&jsx$1(SelectedIconOption,{children:jsx$1(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsx$1(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsx$1(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsx$1(Avatar,{upn:item.owner.userPrincipalName,size:PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled.h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled(IconButton$1).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled.div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled.div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled.div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled(Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=css$2(templateObject_7$l||(templateObject_7$l=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled(Link$4).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$j||(templateObject_8$j=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled.a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsx$1(Option,{children:status===WorkflowStatus.approved?jsx$1("img",{style:{width:'20px'},alt:""},void 0):jsx$1(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsx$1(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$6$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$s,templateObject_7$l,templateObject_8$j,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxs(Fragment,{children:[jsx$1(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsx$1(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsx$1(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled.div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$5$1,templateObject_2$3$1;var EventDates=_styled.div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled.div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled.div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$12||(templateObject_3$12=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$K||(templateObject_4$K=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled(EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$4$1,templateObject_2$2$1,templateObject_3$12,templateObject_4$K,templateObject_5$D;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsx$1(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsx$1(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-callout'},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled(CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled(PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$3$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
|
|
132055
|
+
var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));var StreamKnownNewsState;(function(StreamKnownNewsState){StreamKnownNewsState["Unconfirmed"]="UNCONFIRMED";StreamKnownNewsState["Alert"]="ALERT";})(StreamKnownNewsState||(StreamKnownNewsState={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isNews(item){return item.type===StreamItemTypes.News;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}function getGroupedKeywordsFromStream(keywords){var groupedKeywords={};(keywords||[]).forEach(function(k){if(!groupedKeywords[k.groupId]){groupedKeywords[k.groupId]=[];}var keyword=__assign(__assign({},k),{translations:(k.translations||[]).reduce(function(prev,curr){var _a;return __assign(__assign({},prev),(_a={},_a[curr.key]=curr.value,_a));},{})});groupedKeywords[k.groupId].push(keyword);});return groupedKeywords;}function convertProperties(items,user,subscriptionChannels){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywordsFromStream(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(subscriptionChannels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i)),getKnownNewsState(i));});}function getKnownNewsState(item){var _a,_b;if(!isNews(item)){return {};}var state=KnownNewsState.None;if((_a=item.knownNewsState)===null||_a===void 0?void 0:_a.includes(StreamKnownNewsState.Alert)){state|=KnownNewsState.Alert;}if((_b=item.knownNewsState)===null||_b===void 0?void 0:_b.includes(StreamKnownNewsState.Unconfirmed)){state|=KnownNewsState.Unconfirmed;}return {knownState:state};}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));var CHANNELS_CONDITION=function CHANNELS_CONDITION(channels,allChannels){var _a,_b;if(!channels){return '';}var channelIds=(_b=(_a=channels.items)===null||_a===void 0?void 0:_a.map(function(c){var _a;return ((_a=allChannels===null||allChannels===void 0?void 0:allChannels.find(function(uc){return uc.name===c;}))===null||_a===void 0?void 0:_a.id)||"INVALID_CHANNEL_"+c;}))===null||_b===void 0?void 0:_b.map(function(c){return "\""+c+"\"";});if(!(channelIds===null||channelIds===void 0?void 0:channelIds.length)){return '';}if(channels.operator===LogicalOperator.And){var channelConditions=channelIds.map(function(c){return "{ channels: { some: { eq: "+c+" } } }";});return "and: [\n "+channelConditions.join()+"\n ]";}return "channels: { some: { in: ["+channelIds+"] } }";};var KEYWORDS_CONDITION=function KEYWORDS_CONDITION(keywords){var _a;if(!keywords||!((_a=keywords.items)===null||_a===void 0?void 0:_a.length)){return '';}if(keywords.operator===LogicalOperator.And){var keywordConditions=keywords.items.map(function(k){return "{ keywordIds: { some: { eq: \""+k+"\" } } }";});return "and: [\n "+keywordConditions.join()+"\n ]";}return "keywordIds: { some: { in: ["+keywords.items.map(function(k){return "\""+k+"\"";})+"] } }";};var OWNER_CONDITION=function OWNER_CONDITION(owner){if(!owner){return '';}return "or: [\n { author: { userPrincipalName: { eq: \""+owner+"\" } } }\n { owner: { userPrincipalName: { eq: \""+owner+"\" } } }\n { onBehalfOf: { userPrincipalName: { eq: \""+owner+"\" } } }\n ]";};var PUBLISHING_DATE_CONDITION=function PUBLISHING_DATE_CONDITION(beforeDate,afterDate){if(!beforeDate&&!afterDate){return '';}if(beforeDate&&afterDate){return "and: [\n { publishingDate: { gt: \""+afterDate+"\" } }\n { publishingDate: { lt: \""+beforeDate+"\" } }\n ]";}return afterDate?"publishingDate: { gt: \""+afterDate+"\" }":"publishingDate: { lt: \""+beforeDate+"\" }";};var AUTHORS_CONDITION=function AUTHORS_CONDITION(authors){if(!authors||!authors.length){return '';}return "or: [\n { owner: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n { onBehalfOf: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n ]";};gql(templateObject_2$5$1||(templateObject_2$5$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_2$5$1,templateObject_3$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=useRef$1();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsx$1(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsx$1(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxs(Options,{children:[props.allowSelection&&jsx$1(SelectedIconOption,{children:jsx$1(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsx$1(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsx$1(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsx$1(Avatar,{upn:item.owner.userPrincipalName,size:PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled.h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled(IconButton$1).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled.div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled.div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled.div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled(Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=css$2(templateObject_7$l||(templateObject_7$l=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled(Link$4).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$j||(templateObject_8$j=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled.a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsx$1(Option,{children:status===WorkflowStatus.approved?jsx$1("img",{style:{width:'20px'},alt:""},void 0):jsx$1(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsx$1(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$6$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$s,templateObject_7$l,templateObject_8$j,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxs(Fragment,{children:[jsx$1(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsx$1(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsx$1(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled.div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$5$1,templateObject_2$3$1;var EventDates=_styled.div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled.div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled.div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$K||(templateObject_4$K=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled(EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$4$1,templateObject_2$2$1,templateObject_3$13,templateObject_4$K,templateObject_5$D;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsx$1(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsx$1(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-contextual-menu'},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled(CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled(PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$3$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
|
|
132053
132056
|
return null;});}function deletePermanently(type,ids){var itemIds=ids.join(',');return api.custom("editor/"+type+"/recyclebin?"+queryString.stringify({itemIds:itemIds})).delete();}function bulkSetStatus(type,items){return api.custom("editor/"+type).patch(items).then(function(response){return response.body().map(function(item){return item.data();});});}function setStatus(type,itemId,status,leaseId){return __awaiter(this,void 0,void 0,function(){var path,response,ex_1;return __generator(this,function(_a){switch(_a.label){case 0:path="editor/"+type+"/"+itemId+"/status";if(leaseId!=null){path+='?'+queryString.stringify({leaseId:leaseId});}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,api.custom(path).put(status)];case 2:response=_a.sent();return [2/*return*/,response.body().data()];case 3:ex_1=_a.sent();throw ex_1.response.statusCode===409?{account:ex_1.response.data}:ex_1;case 4:return [2/*return*/];}});});}function removeLease(itemId,leaseId){return api.custom("editor/"+itemId+"/lease?"+queryString.stringify({leaseId:leaseId})).delete();}function keepLeaseAlive(itemId,leaseId,token,subscriptionId){var _this=this;var expireLeaseToken=token;// every 10 seconds
|
|
132054
132057
|
var timer=setInterval(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:// update the lease
|
|
132055
132058
|
return [4/*yield*/,api.custom("editor/"+itemId+"/lease").put({leaseId:leaseId})];case 1:// update the lease
|
|
@@ -132107,9 +132110,9 @@ var NewsDetailViewMetaInfo = function NewsDetailViewMetaInfo() {
|
|
|
132107
132110
|
var DetailMetaInfo = _styled(ItemMetaInfo).withConfig({
|
|
132108
132111
|
displayName: "NewsDetailViewMetaInfo__DetailMetaInfo",
|
|
132109
132112
|
componentId: "sc-1v9a7tf-0"
|
|
132110
|
-
})(templateObject_1$
|
|
132113
|
+
})(templateObject_1$w || (templateObject_1$w = __makeTemplateObject$l(["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ", "px) {\n font-size: 14px;\n }\n"], ["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ", "px) {\n font-size: 14px;\n }\n"])), minScreenSize.small);
|
|
132111
132114
|
|
|
132112
|
-
var templateObject_1$
|
|
132115
|
+
var templateObject_1$w;
|
|
132113
132116
|
|
|
132114
132117
|
var NewsItemContextProvider = function NewsItemContextProvider(_a) {
|
|
132115
132118
|
var itemId = _a.itemId,
|
|
@@ -132215,9 +132218,9 @@ var NewsDetailMainContent = function NewsDetailMainContent(_a) {
|
|
|
132215
132218
|
var Host$i = _styled.div.withConfig({
|
|
132216
132219
|
displayName: "NewsDetail__Host",
|
|
132217
132220
|
componentId: "sc-6rz5th-0"
|
|
132218
|
-
})(templateObject_1$
|
|
132221
|
+
})(templateObject_1$v || (templateObject_1$v = __makeTemplateObject$l([""], [""])));
|
|
132219
132222
|
|
|
132220
|
-
var templateObject_1$
|
|
132223
|
+
var templateObject_1$v;
|
|
132221
132224
|
|
|
132222
132225
|
var anObject$3 = anObject$v;
|
|
132223
132226
|
|
|
@@ -132616,11 +132619,11 @@ var PageTableOfContents = function PageTableOfContents(_a) {
|
|
|
132616
132619
|
}, void 0)]
|
|
132617
132620
|
}, void 0);
|
|
132618
132621
|
};
|
|
132619
|
-
var Host$h = _styled.div(templateObject_1$
|
|
132620
|
-
var PageTableOfContentsButton = _styled(IconButton$1)(templateObject_2$
|
|
132622
|
+
var Host$h = _styled.div(templateObject_1$u || (templateObject_1$u = __makeTemplateObject$l(["\n && {\n margin-top: ", "px;\n }\n"], ["\n && {\n margin-top: ", "px;\n }\n"])), spacingXs);
|
|
132623
|
+
var PageTableOfContentsButton = _styled(IconButton$1)(templateObject_2$j || (templateObject_2$j = __makeTemplateObject$l(["\n && {\n padding: 0;\n margin: 0;\n width: 22px;\n height: 22px;\n\n i {\n font-size: 20px;\n color: ", ";\n }\n }\n"], ["\n && {\n padding: 0;\n margin: 0;\n width: 22px;\n height: 22px;\n\n i {\n font-size: 20px;\n color: ", ";\n }\n }\n"])), function (p) {
|
|
132621
132624
|
return p.theme.textColors.default;
|
|
132622
132625
|
});
|
|
132623
|
-
var templateObject_1$
|
|
132626
|
+
var templateObject_1$u, templateObject_2$j;
|
|
132624
132627
|
|
|
132625
132628
|
var PageDetail = function PageDetail(props) {
|
|
132626
132629
|
var routeMatch = useRouteMatch();
|
|
@@ -132714,12 +132717,12 @@ var PageDetailInternal = function PageDetailInternal(_a) {
|
|
|
132714
132717
|
var Host$g = _styled.div.withConfig({
|
|
132715
132718
|
displayName: "PageDetail__Host",
|
|
132716
132719
|
componentId: "sc-22rpk8-0"
|
|
132717
|
-
})(templateObject_1$
|
|
132720
|
+
})(templateObject_1$t || (templateObject_1$t = __makeTemplateObject$l([""], [""])));
|
|
132718
132721
|
|
|
132719
132722
|
var PageHeader = _styled.div.withConfig({
|
|
132720
132723
|
displayName: "PageDetail__PageHeader",
|
|
132721
132724
|
componentId: "sc-22rpk8-1"
|
|
132722
|
-
})(templateObject_2$
|
|
132725
|
+
})(templateObject_2$i || (templateObject_2$i = __makeTemplateObject$l(["\n display: flex;\n align-items: center;\n margin-bottom: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-bottom: ", "px;\n"])), spacingM);
|
|
132723
132726
|
|
|
132724
132727
|
var ConsumerBreadcrumbWrapper = function ConsumerBreadcrumbWrapper() {
|
|
132725
132728
|
var item = useDetailViewContext().item;
|
|
@@ -132791,7 +132794,7 @@ var InlinePageListWrapper = function InlinePageListWrapper() {
|
|
|
132791
132794
|
return jsx$1(InlinePageList, {}, void 0);
|
|
132792
132795
|
};
|
|
132793
132796
|
|
|
132794
|
-
var templateObject_1$
|
|
132797
|
+
var templateObject_1$t, templateObject_2$i, templateObject_3$f, templateObject_4$e, templateObject_5$b;
|
|
132795
132798
|
|
|
132796
132799
|
var EventDetail = function EventDetail(_a) {
|
|
132797
132800
|
var itemId = _a.itemId,
|
|
@@ -132859,12 +132862,12 @@ var EventDetail = function EventDetail(_a) {
|
|
|
132859
132862
|
var Host$f = _styled.div.withConfig({
|
|
132860
132863
|
displayName: "EventDetail__Host",
|
|
132861
132864
|
componentId: "sc-hrm4yl-0"
|
|
132862
|
-
})(templateObject_1$
|
|
132865
|
+
})(templateObject_1$s || (templateObject_1$s = __makeTemplateObject$l([""], [""])));
|
|
132863
132866
|
|
|
132864
132867
|
var EventDateAndRecurrenceInfo = _styled.div.withConfig({
|
|
132865
132868
|
displayName: "EventDetail__EventDateAndRecurrenceInfo",
|
|
132866
132869
|
componentId: "sc-hrm4yl-1"
|
|
132867
|
-
})(templateObject_2$
|
|
132870
|
+
})(templateObject_2$h || (templateObject_2$h = __makeTemplateObject$l(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"], ["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));
|
|
132868
132871
|
|
|
132869
132872
|
var DatesInfo = _styled(EventDetailViewDatesInfo).withConfig({
|
|
132870
132873
|
displayName: "EventDetail__DatesInfo",
|
|
@@ -132878,7 +132881,7 @@ var EventRecurrenceSeriesInfoLink = _styled.a.withConfig({
|
|
|
132878
132881
|
return p.theme.textColors.default;
|
|
132879
132882
|
}, spacingM);
|
|
132880
132883
|
|
|
132881
|
-
var templateObject_1$
|
|
132884
|
+
var templateObject_1$s, templateObject_2$h, templateObject_3$e, templateObject_4$d;
|
|
132882
132885
|
|
|
132883
132886
|
function useNewsItemClickHandler() {
|
|
132884
132887
|
var user = useCurrentUserContext().user;
|
|
@@ -133085,11 +133088,11 @@ var NewsCompactCard = function NewsCompactCard(_a) {
|
|
|
133085
133088
|
var Host$e = _styled.div.withConfig({
|
|
133086
133089
|
displayName: "NewsCompactCard__Host",
|
|
133087
133090
|
componentId: "sc-16ovog0-0"
|
|
133088
|
-
})(templateObject_1$
|
|
133091
|
+
})(templateObject_1$r || (templateObject_1$r = __makeTemplateObject$l(["\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: ", "px;\n background-color: ", ";\n"], ["\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: ", "px;\n background-color: ", ";\n"])), BannerSize, function (p) {
|
|
133089
133092
|
return p.theme.palette.white;
|
|
133090
133093
|
});
|
|
133091
133094
|
|
|
133092
|
-
var TextStyle = css$2(templateObject_2$
|
|
133095
|
+
var TextStyle = css$2(templateObject_2$g || (templateObject_2$g = __makeTemplateObject$l(["\n font-size: ", "px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n"], ["\n font-size: ", "px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n"])), fontSizeSmall);
|
|
133093
133096
|
|
|
133094
133097
|
var Inner$3 = _styled.div.withConfig({
|
|
133095
133098
|
displayName: "NewsCompactCard__Inner",
|
|
@@ -133183,7 +133186,7 @@ var BannerHost = _styled.div.withConfig({
|
|
|
133183
133186
|
});
|
|
133184
133187
|
});
|
|
133185
133188
|
|
|
133186
|
-
var templateObject_1$
|
|
133189
|
+
var templateObject_1$r, templateObject_2$g, templateObject_3$d, templateObject_4$c, templateObject_5$a, templateObject_6$9, templateObject_7$6, templateObject_8$5, templateObject_9$3, templateObject_10$3, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$2, templateObject_16$1;
|
|
133187
133190
|
|
|
133188
133191
|
var EmptyNewsList = function EmptyNewsList() {
|
|
133189
133192
|
return jsxs(Host$d, {
|
|
@@ -133200,19 +133203,19 @@ var EmptyNewsList = function EmptyNewsList() {
|
|
|
133200
133203
|
var Host$d = _styled.div.withConfig({
|
|
133201
133204
|
displayName: "EmptyNewsList__Host",
|
|
133202
133205
|
componentId: "sc-11ktr8s-0"
|
|
133203
|
-
})(templateObject_1$
|
|
133206
|
+
})(templateObject_1$q || (templateObject_1$q = __makeTemplateObject$l(["\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: auto 0;\n padding: ", "px 0;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: auto 0;\n padding: ", "px 0;\n"])), spacingM);
|
|
133204
133207
|
|
|
133205
133208
|
var StyledIcon$3 = _styled(Icon).withConfig({
|
|
133206
133209
|
displayName: "EmptyNewsList__StyledIcon",
|
|
133207
133210
|
componentId: "sc-11ktr8s-1"
|
|
133208
|
-
})(templateObject_2$
|
|
133211
|
+
})(templateObject_2$f || (templateObject_2$f = __makeTemplateObject$l(["\n font-size: ", "px;\n opacity: 0.8;\n margin-bottom: ", "px;\n"], ["\n font-size: ", "px;\n opacity: 0.8;\n margin-bottom: ", "px;\n"])), fontSizeLarger, spacingM);
|
|
133209
133212
|
|
|
133210
133213
|
var Message = _styled.p.withConfig({
|
|
133211
133214
|
displayName: "EmptyNewsList__Message",
|
|
133212
133215
|
componentId: "sc-11ktr8s-2"
|
|
133213
133216
|
})(templateObject_3$c || (templateObject_3$c = __makeTemplateObject$l(["\n text-align: center;\n padding: 0;\n margin: 0;\n"], ["\n text-align: center;\n padding: 0;\n margin: 0;\n"])));
|
|
133214
133217
|
|
|
133215
|
-
var templateObject_1$
|
|
133218
|
+
var templateObject_1$q, templateObject_2$f, templateObject_3$c;
|
|
133216
133219
|
|
|
133217
133220
|
var ItemLayoutMode;
|
|
133218
133221
|
|
|
@@ -133387,12 +133390,12 @@ var NewsListInternal = function NewsListInternal(_a) {
|
|
|
133387
133390
|
var Host$c = _styled.div.withConfig({
|
|
133388
133391
|
displayName: "NewsList__Host",
|
|
133389
133392
|
componentId: "sc-1d0bzx1-0"
|
|
133390
|
-
})(templateObject_1$
|
|
133393
|
+
})(templateObject_1$p || (templateObject_1$p = __makeTemplateObject$l([""], [""])));
|
|
133391
133394
|
|
|
133392
133395
|
var CompactList = _styled.ul.withConfig({
|
|
133393
133396
|
displayName: "NewsList__CompactList",
|
|
133394
133397
|
componentId: "sc-1d0bzx1-1"
|
|
133395
|
-
})(templateObject_2$
|
|
133398
|
+
})(templateObject_2$e || (templateObject_2$e = __makeTemplateObject$l(["\n margin: 0;\n padding: 0;\n list-style: none;\n\n > li:not(:first-child) {\n margin-top: ", "px;\n }\n"], ["\n margin: 0;\n padding: 0;\n list-style: none;\n\n > li:not(:first-child) {\n margin-top: ", "px;\n }\n"])), spacingS);
|
|
133396
133399
|
|
|
133397
133400
|
var StyledNewsItemTile = _styled(NewsItemTile).withConfig({
|
|
133398
133401
|
displayName: "NewsList__StyledNewsItemTile",
|
|
@@ -133427,7 +133430,7 @@ var ErrorContainer$1 = _styled.p.withConfig({
|
|
|
133427
133430
|
return p.theme.palette.red;
|
|
133428
133431
|
}, spacingM);
|
|
133429
133432
|
|
|
133430
|
-
var templateObject_1$
|
|
133433
|
+
var templateObject_1$p, templateObject_2$e, templateObject_3$b, templateObject_4$b, templateObject_5$9, templateObject_6$8, templateObject_7$5, templateObject_8$4;
|
|
133431
133434
|
|
|
133432
133435
|
var ManageChannels = function ManageChannels(_a) {
|
|
133433
133436
|
var className = _a.className;
|
|
@@ -133593,12 +133596,12 @@ var ManageChannels = function ManageChannels(_a) {
|
|
|
133593
133596
|
var Host$b = _styled.div.withConfig({
|
|
133594
133597
|
displayName: "ManageChannels__Host",
|
|
133595
133598
|
componentId: "sc-yyoxfw-0"
|
|
133596
|
-
})(templateObject_1$
|
|
133599
|
+
})(templateObject_1$o || (templateObject_1$o = __makeTemplateObject$l(["\n padding: ", "px ", "px;\n"], ["\n padding: ", "px ", "px;\n"])), spacingX, spacingM);
|
|
133597
133600
|
|
|
133598
133601
|
var Title$2 = _styled.h3.withConfig({
|
|
133599
133602
|
displayName: "ManageChannels__Title",
|
|
133600
133603
|
componentId: "sc-yyoxfw-1"
|
|
133601
|
-
})(templateObject_2$
|
|
133604
|
+
})(templateObject_2$d || (templateObject_2$d = __makeTemplateObject$l(["\n margin: 0;\n"], ["\n margin: 0;\n"])));
|
|
133602
133605
|
|
|
133603
133606
|
var Description = _styled.span.withConfig({
|
|
133604
133607
|
displayName: "ManageChannels__Description",
|
|
@@ -133666,7 +133669,7 @@ var StyledIconButton = _styled(IconButton$1).withConfig({
|
|
|
133666
133669
|
return p.theme.textColors.default;
|
|
133667
133670
|
});
|
|
133668
133671
|
|
|
133669
|
-
var templateObject_1$
|
|
133672
|
+
var templateObject_1$o, templateObject_2$d, templateObject_3$a, templateObject_4$a, templateObject_5$8, templateObject_6$7, templateObject_7$4, templateObject_8$3;
|
|
133670
133673
|
|
|
133671
133674
|
var NewsGridCard = function NewsGridCard(_a) {
|
|
133672
133675
|
var _b;
|
|
@@ -133777,8 +133780,8 @@ var NewsGridCard = function NewsGridCard(_a) {
|
|
|
133777
133780
|
return NewsService.getNewsRoute(baseRoute, item.id, title);
|
|
133778
133781
|
}
|
|
133779
133782
|
};
|
|
133780
|
-
var Host$a = _styled.div(templateObject_2$
|
|
133781
|
-
return p.showHighlight && css$2(templateObject_1$
|
|
133783
|
+
var Host$a = _styled.div(templateObject_2$c || (templateObject_2$c = __makeTemplateObject$l(["\n display: flex;\n flex-direction: column;\n width: 100%;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n position: relative;\n\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n width: 100%;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n position: relative;\n\n ", "\n"])), function (p) {
|
|
133784
|
+
return p.showHighlight && css$2(templateObject_1$n || (templateObject_1$n = __makeTemplateObject$l(["\n position: relative;\n &::after {\n ", ";\n }\n "], ["\n position: relative;\n &::after {\n ", ";\n }\n "])), BannerHighlightStyle);
|
|
133782
133785
|
});
|
|
133783
133786
|
var BannerHighlightStyle = css$2(templateObject_3$9 || (templateObject_3$9 = __makeTemplateObject$l(["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ", "px;\n display: block;\n background-color: ", ";\n"], ["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ", "px;\n display: block;\n background-color: ", ";\n"])), spacingXs, function (p) {
|
|
133784
133787
|
return p.theme.palette.accent;
|
|
@@ -133805,7 +133808,7 @@ var KeywordsWrapper = _styled.div(templateObject_14$1 || (templateObject_14$1 =
|
|
|
133805
133808
|
return p.theme.palette.neutralTertiary;
|
|
133806
133809
|
});
|
|
133807
133810
|
var StyledChannels$1 = _styled(ChannelList$1)(templateObject_15$1 || (templateObject_15$1 = __makeTemplateObject$l(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), spacingS, spacingM);
|
|
133808
|
-
var templateObject_1$
|
|
133811
|
+
var templateObject_1$n, templateObject_2$c, templateObject_3$9, templateObject_4$9, templateObject_5$7, templateObject_6$6, templateObject_7$3, templateObject_8$2, templateObject_9$2, templateObject_10$2, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;
|
|
133809
133812
|
|
|
133810
133813
|
var ErrorContainer = function ErrorContainer() {
|
|
133811
133814
|
return jsx$1(Host$9, {
|
|
@@ -133818,11 +133821,11 @@ var ErrorContainer = function ErrorContainer() {
|
|
|
133818
133821
|
var Host$9 = _styled.p.withConfig({
|
|
133819
133822
|
displayName: "ErrorContainer__Host",
|
|
133820
133823
|
componentId: "sc-499uwc-0"
|
|
133821
|
-
})(templateObject_1$
|
|
133824
|
+
})(templateObject_1$m || (templateObject_1$m = __makeTemplateObject$l(["\n color: ", ";\n padding: ", "px 0;\n text-align: center;\n"], ["\n color: ", ";\n padding: ", "px 0;\n text-align: center;\n"])), function (p) {
|
|
133822
133825
|
return p.theme.palette.red;
|
|
133823
133826
|
}, spacingM);
|
|
133824
133827
|
|
|
133825
|
-
var templateObject_1$
|
|
133828
|
+
var templateObject_1$m;
|
|
133826
133829
|
|
|
133827
133830
|
var NewsGrid = function NewsGrid(_a) {
|
|
133828
133831
|
var filter = _a.filter,
|
|
@@ -133914,13 +133917,13 @@ var NewsGrid = function NewsGrid(_a) {
|
|
|
133914
133917
|
var Host$8 = _styled.div.withConfig({
|
|
133915
133918
|
displayName: "NewsGrid__Host",
|
|
133916
133919
|
componentId: "sc-8ugpfz-0"
|
|
133917
|
-
})(templateObject_1$
|
|
133920
|
+
})(templateObject_1$l || (templateObject_1$l = __makeTemplateObject$l([""], [""])));
|
|
133918
133921
|
|
|
133919
133922
|
var Inner$2 = _styled.div.withConfig({
|
|
133920
133923
|
displayName: "NewsGrid__Inner",
|
|
133921
133924
|
componentId: "sc-8ugpfz-1"
|
|
133922
133925
|
})(templateObject_3$8 || (templateObject_3$8 = __makeTemplateObject$l(["\n display: flex; // IE fallback\n flex-wrap: wrap;\n\n display: grid;\n gap: ", "px;\n ", "\n"], ["\n display: flex; // IE fallback\n flex-wrap: wrap;\n\n display: grid;\n gap: ", "px;\n ", "\n"])), spacingM, function (p) {
|
|
133923
|
-
return css$2(templateObject_2$
|
|
133926
|
+
return css$2(templateObject_2$b || (templateObject_2$b = __makeTemplateObject$l(["\n grid-template-columns: repeat(", ", minmax(0, 1fr));\n "], ["\n grid-template-columns: repeat(", ", minmax(0, 1fr));\n "])), p.columnCount);
|
|
133924
133927
|
});
|
|
133925
133928
|
|
|
133926
133929
|
_styled(NewsGridCard).withConfig({
|
|
@@ -133930,7 +133933,7 @@ _styled(NewsGridCard).withConfig({
|
|
|
133930
133933
|
return css$2(templateObject_4$8 || (templateObject_4$8 = __makeTemplateObject$l(["\n width: calc(100% / ", " - ", "px);\n "], ["\n width: calc(100% / ", " - ", "px);\n "])), p.columnCount, spacingM);
|
|
133931
133934
|
});
|
|
133932
133935
|
|
|
133933
|
-
var templateObject_1$
|
|
133936
|
+
var templateObject_1$l, templateObject_2$b, templateObject_3$8, templateObject_4$8, templateObject_5$6;
|
|
133934
133937
|
|
|
133935
133938
|
var HeroSlide = function HeroSlide(_a) {
|
|
133936
133939
|
var item = _a.item,
|
|
@@ -134075,7 +134078,7 @@ var Host$7 = _styled.div.withConfig({
|
|
|
134075
134078
|
displayName: "HeroSlide__Host",
|
|
134076
134079
|
componentId: "sc-3yofth-0"
|
|
134077
134080
|
})(templateObject_7$2 || (templateObject_7$2 = __makeTemplateObject$l(["\n position: relative;\n\n ", "\n\n ", "\n \n ", "\n \n ", "\n"], ["\n position: relative;\n\n ", "\n\n ", "\n \n ", "\n \n ", "\n"])), function (p) {
|
|
134078
|
-
return p.width ? css$2(templateObject_1$
|
|
134081
|
+
return p.width ? css$2(templateObject_1$k || (templateObject_1$k = __makeTemplateObject$l(["\n width: ", ";\n "], ["\n width: ", ";\n "])), p.width) : css$2(templateObject_2$a || (templateObject_2$a = __makeTemplateObject$l(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
|
|
134079
134082
|
}, function (p) {
|
|
134080
134083
|
return p.height ? css$2(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject$l(["\n height: ", ";\n "], ["\n height: ", ";\n "])), p.height) : css$2(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject$l(["\n height: 100%;\n "], ["\n height: 100%;\n "])));
|
|
134081
134084
|
}, function (p) {
|
|
@@ -134195,7 +134198,7 @@ var StyledDateTime = _styled(DateTime).withConfig({
|
|
|
134195
134198
|
return p.color ? css$2(templateObject_31 || (templateObject_31 = __makeTemplateObject$l(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.color) : css$2(templateObject_32 || (templateObject_32 = __makeTemplateObject$l(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.theme.textColors.default);
|
|
134196
134199
|
});
|
|
134197
134200
|
|
|
134198
|
-
var templateObject_1$
|
|
134201
|
+
var templateObject_1$k, templateObject_2$a, templateObject_3$7, templateObject_4$7, templateObject_5$5, templateObject_6$5, templateObject_7$2, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33;
|
|
134199
134202
|
|
|
134200
134203
|
var HeroPaging = function HeroPaging(_a) {
|
|
134201
134204
|
var items = _a.items,
|
|
@@ -134316,12 +134319,12 @@ function getWrappedIndex(index, max) {
|
|
|
134316
134319
|
var PagingHost = _styled.div.withConfig({
|
|
134317
134320
|
displayName: "HeroPaging__PagingHost",
|
|
134318
134321
|
componentId: "sc-1y3j8qb-0"
|
|
134319
|
-
})(templateObject_1$
|
|
134322
|
+
})(templateObject_1$j || (templateObject_1$j = __makeTemplateObject$l(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
134320
134323
|
|
|
134321
134324
|
var Paging = _styled.ul.withConfig({
|
|
134322
134325
|
displayName: "HeroPaging__Paging",
|
|
134323
134326
|
componentId: "sc-1y3j8qb-1"
|
|
134324
|
-
})(templateObject_2$
|
|
134327
|
+
})(templateObject_2$9 || (templateObject_2$9 = __makeTemplateObject$l(["\n display: flex;\n width: 100%;\n list-style: none;\n margin: 0 0 ", "px 0;\n padding: 0;\n"], ["\n display: flex;\n width: 100%;\n list-style: none;\n margin: 0 0 ", "px 0;\n padding: 0;\n"])), spacingM);
|
|
134325
134328
|
|
|
134326
134329
|
var PagingItem = _styled.li.withConfig({
|
|
134327
134330
|
displayName: "HeroPaging__PagingItem",
|
|
@@ -134342,7 +134345,7 @@ var PagingArrow = _styled(IconButton).withConfig({
|
|
|
134342
134345
|
componentId: "sc-1y3j8qb-4"
|
|
134343
134346
|
})(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject$l(["\n position: absolute;\n top: 50%;\n\n && {\n padding: 0;\n }\n\n &[data-paging-next] {\n left: 100%;\n transform: translate(-5px, -50%);\n }\n\n &[data-paging-back] {\n right: 100%;\n transform: translate(5px, -50%);\n }\n"], ["\n position: absolute;\n top: 50%;\n\n && {\n padding: 0;\n }\n\n &[data-paging-next] {\n left: 100%;\n transform: translate(-5px, -50%);\n }\n\n &[data-paging-back] {\n right: 100%;\n transform: translate(5px, -50%);\n }\n"])));
|
|
134344
134347
|
|
|
134345
|
-
var templateObject_1$
|
|
134348
|
+
var templateObject_1$j, templateObject_2$9, templateObject_3$6, templateObject_4$6, templateObject_5$4, templateObject_6$4;
|
|
134346
134349
|
|
|
134347
134350
|
var Hero = function Hero(_a) {
|
|
134348
134351
|
var items = _a.items,
|
|
@@ -134409,9 +134412,9 @@ var Hero = function Hero(_a) {
|
|
|
134409
134412
|
var StyledCarousel = _styled(Carousel).withConfig({
|
|
134410
134413
|
displayName: "Hero__StyledCarousel",
|
|
134411
134414
|
componentId: "sc-55ys37-0"
|
|
134412
|
-
})(templateObject_1$
|
|
134415
|
+
})(templateObject_1$i || (templateObject_1$i = __makeTemplateObject$l(["\n .slider-list {\n height: 100% !important;\n\n > li {\n height: 100% !important;\n }\n }\n\n .slider-control-bottomcenter {\n left: ", "px !important;\n right: ", "px !important;\n transform: none !important;\n }\n\n .hero-paging--hidden {\n display: none;\n }\n"], ["\n .slider-list {\n height: 100% !important;\n\n > li {\n height: 100% !important;\n }\n }\n\n .slider-control-bottomcenter {\n left: ", "px !important;\n right: ", "px !important;\n transform: none !important;\n }\n\n .hero-paging--hidden {\n display: none;\n }\n"])), spacingL, spacingL);
|
|
134413
134416
|
|
|
134414
|
-
var templateObject_1$
|
|
134417
|
+
var templateObject_1$i;
|
|
134415
134418
|
|
|
134416
134419
|
var NewsHero = function NewsHero(_a) {
|
|
134417
134420
|
var filter = _a.filter,
|
|
@@ -134564,9 +134567,9 @@ var NewsHero = function NewsHero(_a) {
|
|
|
134564
134567
|
var StyledChannels = _styled(ChannelList$1).withConfig({
|
|
134565
134568
|
displayName: "NewsHero__StyledChannels",
|
|
134566
134569
|
componentId: "sc-i9ar0j-0"
|
|
134567
|
-
})(templateObject_1$
|
|
134570
|
+
})(templateObject_1$h || (templateObject_1$h = __makeTemplateObject$l(["\n [data-channels] {\n justify-content: flex-end;\n }\n"], ["\n [data-channels] {\n justify-content: flex-end;\n }\n"])));
|
|
134568
134571
|
|
|
134569
|
-
var templateObject_1$
|
|
134572
|
+
var templateObject_1$h;
|
|
134570
134573
|
|
|
134571
134574
|
// a string of all valid unicode whitespaces
|
|
134572
134575
|
// eslint-disable-next-line max-len
|
|
@@ -134661,6 +134664,9 @@ var GroupsDropdown = function GroupsDropdown(_a) {
|
|
|
134661
134664
|
var groups = getGroups();
|
|
134662
134665
|
return jsxs(Fragment, {
|
|
134663
134666
|
children: [jsx$1(GlobalDropdownStyles, {}, void 0), jsx$1(StyledDropdown, {
|
|
134667
|
+
ariaLabel: intl.formatMessage({
|
|
134668
|
+
id: 'AriaLabel.editor.groupSelector'
|
|
134669
|
+
}),
|
|
134664
134670
|
options: getOptions(),
|
|
134665
134671
|
onRenderOption: function (option) {
|
|
134666
134672
|
return jsxs(DropdownOption, {
|
|
@@ -134734,7 +134740,7 @@ var GroupsDropdown = function GroupsDropdown(_a) {
|
|
|
134734
134740
|
var StyledDropdown = _styled(Dropdown).withConfig({
|
|
134735
134741
|
displayName: "GroupsDropdown__StyledDropdown",
|
|
134736
134742
|
componentId: "sc-cmsnyu-0"
|
|
134737
|
-
})(templateObject_1$
|
|
134743
|
+
})(templateObject_1$g || (templateObject_1$g = __makeTemplateObject$l(["\n ", "\n\n margin-bottom: ", "px;\n width: 200px;\n min-width: 200px;\n padding: 0;\n\n &&&,\n &&&:hover,\n .ms-Dropdown,\n .ms-Dropdown-title,\n .ms-Dropdown-caretDownWrapper {\n color: ", " !important;\n }\n\n .ms-Dropdown-title {\n background-color: ", ";\n i {\n font-size: ", "px;\n margin: 0 ", "px 0 0;\n }\n }\n\n .ms-Dropdown-caretDownWrapper {\n top: 0;\n\n & > i {\n color: ", " !important;\n }\n }\n"], ["\n ", "\n\n margin-bottom: ", "px;\n width: 200px;\n min-width: 200px;\n padding: 0;\n\n &&&,\n &&&:hover,\n .ms-Dropdown,\n .ms-Dropdown-title,\n .ms-Dropdown-caretDownWrapper {\n color: ", " !important;\n }\n\n .ms-Dropdown-title {\n background-color: ", ";\n i {\n font-size: ", "px;\n margin: 0 ", "px 0 0;\n }\n }\n\n .ms-Dropdown-caretDownWrapper {\n top: 0;\n\n & > i {\n color: ", " !important;\n }\n }\n"])), ToolbarNoBorderDropdownStyles, spacingXs, function (p) {
|
|
134738
134744
|
return p.theme.textColors.onAccent;
|
|
134739
134745
|
}, function (p) {
|
|
134740
134746
|
return p.theme.palette.accent;
|
|
@@ -134745,7 +134751,7 @@ var StyledDropdown = _styled(Dropdown).withConfig({
|
|
|
134745
134751
|
var DropdownOption = _styled.div.withConfig({
|
|
134746
134752
|
displayName: "GroupsDropdown__DropdownOption",
|
|
134747
134753
|
componentId: "sc-cmsnyu-1"
|
|
134748
|
-
})(templateObject_2$
|
|
134754
|
+
})(templateObject_2$8 || (templateObject_2$8 = __makeTemplateObject$l(["\n ", "\n"], ["\n ", "\n"])), ToolbarOptionStyles);
|
|
134749
134755
|
|
|
134750
134756
|
var Title = _styled.div.withConfig({
|
|
134751
134757
|
displayName: "GroupsDropdown__Title",
|
|
@@ -134754,7 +134760,7 @@ var Title = _styled.div.withConfig({
|
|
|
134754
134760
|
|
|
134755
134761
|
var GlobalDropdownStyles = createGlobalStyle(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject$l(["\n .ms-Dropdown-item {\n i {\n width: auto;\n margin: 0 ", "px 0 0;\n }\n }\n"], ["\n .ms-Dropdown-item {\n i {\n width: auto;\n margin: 0 ", "px 0 0;\n }\n }\n"])), spacingS);
|
|
134756
134762
|
|
|
134757
|
-
var templateObject_1$
|
|
134763
|
+
var templateObject_1$g, templateObject_2$8, templateObject_3$5, templateObject_4$5;
|
|
134758
134764
|
|
|
134759
134765
|
var TaskButton = function TaskButton(_a) {
|
|
134760
134766
|
var count = _a.count,
|
|
@@ -134796,9 +134802,9 @@ var TaskButton = function TaskButton(_a) {
|
|
|
134796
134802
|
var ToggleButton = _styled(DefaultButton).withConfig({
|
|
134797
134803
|
displayName: "TaskButton__ToggleButton",
|
|
134798
134804
|
componentId: "sc-8eylsw-0"
|
|
134799
|
-
})(templateObject_1$
|
|
134805
|
+
})(templateObject_1$f || (templateObject_1$f = __makeTemplateObject$l(["\n border-radius: 0;\n padding: 0 ", "px;\n margin-bottom: ", "px;\n font-size: ", "px;\n user-select: none;\n height: ", "px;\n\n display: flex;\n align-items: center;\n\n svg {\n margin-right: ", "px;\n }\n"], ["\n border-radius: 0;\n padding: 0 ", "px;\n margin-bottom: ", "px;\n font-size: ", "px;\n user-select: none;\n height: ", "px;\n\n display: flex;\n align-items: center;\n\n svg {\n margin-right: ", "px;\n }\n"])), spacingS, spacingXs, fontSizeSmall, spacingL + 2, spacingS);
|
|
134800
134806
|
|
|
134801
|
-
var templateObject_1$
|
|
134807
|
+
var templateObject_1$f;
|
|
134802
134808
|
|
|
134803
134809
|
var TaskButtons = function TaskButtons(_a) {
|
|
134804
134810
|
var type = _a.type,
|
|
@@ -134864,9 +134870,9 @@ var TaskButtons = function TaskButtons(_a) {
|
|
|
134864
134870
|
var Host$6 = _styled.div.withConfig({
|
|
134865
134871
|
displayName: "TaskButtons__Host",
|
|
134866
134872
|
componentId: "sc-sw0zei-0"
|
|
134867
|
-
})(templateObject_1$
|
|
134873
|
+
})(templateObject_1$e || (templateObject_1$e = __makeTemplateObject$l(["\n display: flex;\n flex-wrap: wrap;\n\n button {\n border: 1px solid #808080;\n\n &:not(:first-child) {\n border-left: none;\n }\n }\n"], ["\n display: flex;\n flex-wrap: wrap;\n\n button {\n border: 1px solid #808080;\n\n &:not(:first-child) {\n border-left: none;\n }\n }\n"])));
|
|
134868
134874
|
|
|
134869
|
-
var templateObject_1$
|
|
134875
|
+
var templateObject_1$e;
|
|
134870
134876
|
|
|
134871
134877
|
var NewArticleButton = function NewArticleButton(_a) {
|
|
134872
134878
|
var groupId = _a.groupId,
|
|
@@ -135008,12 +135014,12 @@ var NewsEditorDashboard = function NewsEditorDashboard(_a) {
|
|
|
135008
135014
|
}).length;
|
|
135009
135015
|
}
|
|
135010
135016
|
};
|
|
135011
|
-
var MessageBarStyle = createGlobalStyle(templateObject_1$
|
|
135017
|
+
var MessageBarStyle = createGlobalStyle(templateObject_1$d || (templateObject_1$d = __makeTemplateObject$l(["\n .ms-MessageBar {\n margin-bottom: ", "px;\n }\n .ms-MessageBar-text {\n flex: 1 1 0%;\n }\n"], ["\n .ms-MessageBar {\n margin-bottom: ", "px;\n }\n .ms-MessageBar-text {\n flex: 1 1 0%;\n }\n"])), spacingXs);
|
|
135012
135018
|
|
|
135013
135019
|
var StyledEditorListItem = _styled(EditorListItem).withConfig({
|
|
135014
135020
|
displayName: "NewsEditorDashboard__StyledEditorListItem",
|
|
135015
135021
|
componentId: "sc-vv9dzu-0"
|
|
135016
|
-
})(templateObject_2$
|
|
135022
|
+
})(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject$l(["\n :not(:first-child) {\n margin-top: ", "px;\n }\n"], ["\n :not(:first-child) {\n margin-top: ", "px;\n }\n"])), spacingS + 5);
|
|
135017
135023
|
|
|
135018
135024
|
var FiltersAndButtons = _styled.div.withConfig({
|
|
135019
135025
|
displayName: "NewsEditorDashboard__FiltersAndButtons",
|
|
@@ -135035,7 +135041,7 @@ var StyledNewArticleButton = _styled(NewArticleButton).withConfig({
|
|
|
135035
135041
|
componentId: "sc-vv9dzu-4"
|
|
135036
135042
|
})(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n align-self: flex-start;\n"], ["\n margin-bottom: ", "px;\n align-self: flex-start;\n"])), spacingXs);
|
|
135037
135043
|
|
|
135038
|
-
var templateObject_1$
|
|
135044
|
+
var templateObject_1$d, templateObject_2$7, templateObject_3$4, templateObject_4$4, templateObject_5$3, templateObject_6$3;
|
|
135039
135045
|
|
|
135040
135046
|
// NOTE: This component exists in this project and not in the ui/common/toolbar because it uses DetailViewContext placed in feature/content/
|
|
135041
135047
|
// Also a generic component `ToolbarLanguageSelector` in ui/common/toolbar complicates the flow and requires some code duplication
|
|
@@ -135076,9 +135082,9 @@ var ToolbarNewsLanguageSelector = function ToolbarNewsLanguageSelector(_a) {
|
|
|
135076
135082
|
var LanguageMenuButton = _styled(LanguageSelector).withConfig({
|
|
135077
135083
|
displayName: "ToolbarNewsLanguageSelector__LanguageMenuButton",
|
|
135078
135084
|
componentId: "sc-1xe5l19-0"
|
|
135079
|
-
})(templateObject_1$
|
|
135085
|
+
})(templateObject_1$c || (templateObject_1$c = __makeTemplateObject$l(["\n && {\n i {\n font-size: ", "px;\n }\n }\n"], ["\n && {\n i {\n font-size: ", "px;\n }\n }\n"])), fontSizeNormal);
|
|
135080
135086
|
|
|
135081
|
-
var templateObject_1$
|
|
135087
|
+
var templateObject_1$c;
|
|
135082
135088
|
|
|
135083
135089
|
var ToolbarManageNewsItemButton = function ToolbarManageNewsItemButton(_a) {
|
|
135084
135090
|
var onClick = _a.onClick;
|
|
@@ -135204,9 +135210,9 @@ var NewsDetailPreviewInternal = function NewsDetailPreviewInternal() {
|
|
|
135204
135210
|
var Host$5 = _styled.div.withConfig({
|
|
135205
135211
|
displayName: "NewsDetailPreview__Host",
|
|
135206
135212
|
componentId: "sc-17gmqax-0"
|
|
135207
|
-
})(templateObject_1$
|
|
135213
|
+
})(templateObject_1$b || (templateObject_1$b = __makeTemplateObject$l([""], [""])));
|
|
135208
135214
|
|
|
135209
|
-
var templateObject_1$
|
|
135215
|
+
var templateObject_1$b;
|
|
135210
135216
|
|
|
135211
135217
|
var classof = classofRaw$9;
|
|
135212
135218
|
|
|
@@ -135612,14 +135618,14 @@ var ToolbarFilterPanel = function ToolbarFilterPanel(_a) {
|
|
|
135612
135618
|
var Host$4 = _styled.div.withConfig({
|
|
135613
135619
|
displayName: "ToolbarFilterPanel__Host",
|
|
135614
135620
|
componentId: "sc-118p488-0"
|
|
135615
|
-
})(templateObject_1$
|
|
135621
|
+
})(templateObject_1$a || (templateObject_1$a = __makeTemplateObject$l(["\n display: flex;\n align-items: center;\n min-width: 0;\n"], ["\n display: flex;\n align-items: center;\n min-width: 0;\n"])));
|
|
135616
135622
|
|
|
135617
135623
|
var OverflowContainer = _styled.div.withConfig({
|
|
135618
135624
|
displayName: "ToolbarFilterPanel__OverflowContainer",
|
|
135619
135625
|
componentId: "sc-118p488-1"
|
|
135620
|
-
})(templateObject_2$
|
|
135626
|
+
})(templateObject_2$6 || (templateObject_2$6 = __makeTemplateObject$l(["\n display: flex;\n flex: 1 1 auto;\n white-space: nowrap;\n align-items: center;\n overflow: hidden;\n"], ["\n display: flex;\n flex: 1 1 auto;\n white-space: nowrap;\n align-items: center;\n overflow: hidden;\n"])));
|
|
135621
135627
|
|
|
135622
|
-
var templateObject_1$
|
|
135628
|
+
var templateObject_1$a, templateObject_2$6;
|
|
135623
135629
|
|
|
135624
135630
|
var FilterCalloutButton = function FilterCalloutButton(_a) {
|
|
135625
135631
|
var buttonText = _a.buttonText,
|
|
@@ -135682,8 +135688,8 @@ var FilterCalloutButton = function FilterCalloutButton(_a) {
|
|
|
135682
135688
|
var StyledCallout = _styled(Callout).withConfig({
|
|
135683
135689
|
displayName: "FilterCalloutButton__StyledCallout",
|
|
135684
135690
|
componentId: "sc-1bleciq-0"
|
|
135685
|
-
})(templateObject_2$
|
|
135686
|
-
return p.doNotLayer && css$2(templateObject_1$
|
|
135691
|
+
})(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject$l(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
135692
|
+
return p.doNotLayer && css$2(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject$l(["\n z-index: 1;\n top: 1px !important;\n left: -1px !important;\n\n &&& {\n max-width: 100% !important;\n width: 100%;\n }\n "], ["\n z-index: 1;\n top: 1px !important;\n left: -1px !important;\n\n &&& {\n max-width: 100% !important;\n width: 100%;\n }\n "])));
|
|
135687
135693
|
});
|
|
135688
135694
|
|
|
135689
135695
|
var Host$3 = _styled.div.withConfig({
|
|
@@ -135703,7 +135709,7 @@ var ClearFilterButton = _styled(DefaultButton).withConfig({
|
|
|
135703
135709
|
componentId: "sc-1bleciq-3"
|
|
135704
135710
|
})(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject$l(["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"], ["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"])));
|
|
135705
135711
|
|
|
135706
|
-
var templateObject_1$
|
|
135712
|
+
var templateObject_1$9, templateObject_2$5, templateObject_3$3, templateObject_4$3, templateObject_5$2, templateObject_6$2;
|
|
135707
135713
|
|
|
135708
135714
|
var FilterLogicalOperators = function FilterLogicalOperators(_a) {
|
|
135709
135715
|
var onChange = _a.onChange,
|
|
@@ -135750,14 +135756,14 @@ var FilterLogicalOperators = function FilterLogicalOperators(_a) {
|
|
|
135750
135756
|
var StyledChoiceGroup = _styled(ChoiceGroup).withConfig({
|
|
135751
135757
|
displayName: "FilterLogicalOperators__StyledChoiceGroup",
|
|
135752
135758
|
componentId: "sc-10bpjo8-0"
|
|
135753
|
-
})(templateObject_1$
|
|
135759
|
+
})(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n\n .ms-ChoiceField {\n margin-right: ", "px;\n }\n"], ["\n margin-bottom: ", "px;\n\n .ms-ChoiceField {\n margin-right: ", "px;\n }\n"])), spacingM, spacingM);
|
|
135754
135760
|
|
|
135755
135761
|
var Operator = _styled.span.withConfig({
|
|
135756
135762
|
displayName: "FilterLogicalOperators__Operator",
|
|
135757
135763
|
componentId: "sc-10bpjo8-1"
|
|
135758
|
-
})(templateObject_2$
|
|
135764
|
+
})(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject$l(["\n text-transform: capitalize;\n"], ["\n text-transform: capitalize;\n"])));
|
|
135759
135765
|
|
|
135760
|
-
var templateObject_1$
|
|
135766
|
+
var templateObject_1$8, templateObject_2$4;
|
|
135761
135767
|
|
|
135762
135768
|
var ChannelFilter = function ChannelFilter(_a) {
|
|
135763
135769
|
var channels = _a.channels,
|
|
@@ -135783,7 +135789,7 @@ var ChannelFilter = function ChannelFilter(_a) {
|
|
|
135783
135789
|
buttonContent: getButtonContent(),
|
|
135784
135790
|
doNotLayer: true,
|
|
135785
135791
|
ariaLabel: formatMessage({
|
|
135786
|
-
id: '
|
|
135792
|
+
id: 'AriaLabel.channels'
|
|
135787
135793
|
})
|
|
135788
135794
|
}, {
|
|
135789
135795
|
children: jsx$1(ChannelFilterInternal, {
|
|
@@ -135814,12 +135820,12 @@ var ChannelFilter = function ChannelFilter(_a) {
|
|
|
135814
135820
|
var Host$2 = _styled.div.withConfig({
|
|
135815
135821
|
displayName: "ChannelFilter__Host",
|
|
135816
135822
|
componentId: "sc-1ju8xwz-0"
|
|
135817
|
-
})(templateObject_1$
|
|
135823
|
+
})(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), spacingL);
|
|
135818
135824
|
|
|
135819
135825
|
var ChannelsSubTitle = _styled.p.withConfig({
|
|
135820
135826
|
displayName: "ChannelFilter__ChannelsSubTitle",
|
|
135821
135827
|
componentId: "sc-1ju8xwz-1"
|
|
135822
|
-
})(templateObject_2$
|
|
135828
|
+
})(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject$l(["\n font-weight: bold;\n padding: 0;\n margin: 0 0 ", "px 0;\n"], ["\n font-weight: bold;\n padding: 0;\n margin: 0 0 ", "px 0;\n"])), spacingXs + 2);
|
|
135823
135829
|
|
|
135824
135830
|
var StyledFilterCalloutButton = _styled(FilterCalloutButton).withConfig({
|
|
135825
135831
|
displayName: "ChannelFilter__StyledFilterCalloutButton",
|
|
@@ -135925,7 +135931,10 @@ var ChannelFilterInternal = function ChannelFilterInternal(_a) {
|
|
|
135925
135931
|
},
|
|
135926
135932
|
onChange: function (_, value) {
|
|
135927
135933
|
return setChannelSearchTerm(value.toLowerCase());
|
|
135928
|
-
}
|
|
135934
|
+
},
|
|
135935
|
+
ariaLabel: formatMessage({
|
|
135936
|
+
id: 'Generic.search'
|
|
135937
|
+
})
|
|
135929
135938
|
}, void 0)]
|
|
135930
135939
|
}, void 0), jsx$1(Channels, {
|
|
135931
135940
|
children: !allChannels ? jsx$1(ShimmerList$1, {}, void 0) : availableChannels === null || availableChannels === void 0 ? void 0 : availableChannels.filter(function (c) {
|
|
@@ -136045,7 +136054,7 @@ var StyledToggleAllButtons = _styled(ToggleAllButtons).withConfig({
|
|
|
136045
136054
|
componentId: "sc-1ju8xwz-9"
|
|
136046
136055
|
})(templateObject_10 || (templateObject_10 = __makeTemplateObject$l(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])));
|
|
136047
136056
|
|
|
136048
|
-
var templateObject_1$
|
|
136057
|
+
var templateObject_1$7, templateObject_2$3, templateObject_3$2, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10;
|
|
136049
136058
|
|
|
136050
136059
|
function toInteger(dirtyNumber) {
|
|
136051
136060
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
@@ -138990,12 +138999,12 @@ var DateShortcutButton = function DateShortcutButton(_a) {
|
|
|
138990
138999
|
var StyledDateTimePicker = _styled(DateTimePicker).withConfig({
|
|
138991
139000
|
displayName: "PublishingDateFilter__StyledDateTimePicker",
|
|
138992
139001
|
componentId: "sc-zv88cu-0"
|
|
138993
|
-
})(templateObject_1$
|
|
139002
|
+
})(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n\n label {\n font-weight: normal;\n }\n"], ["\n margin-bottom: ", "px;\n\n label {\n font-weight: normal;\n }\n"])), spacingS);
|
|
138994
139003
|
|
|
138995
139004
|
var DatePickerShortcutsLabel = _styled.span.withConfig({
|
|
138996
139005
|
displayName: "PublishingDateFilter__DatePickerShortcutsLabel",
|
|
138997
139006
|
componentId: "sc-zv88cu-1"
|
|
138998
|
-
})(templateObject_2$
|
|
139007
|
+
})(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject$l(["\n font-size: ", "px;\n"], ["\n font-size: ", "px;\n"])), fontSizeSmall);
|
|
138999
139008
|
|
|
139000
139009
|
var DateShortcuts = _styled.div.withConfig({
|
|
139001
139010
|
displayName: "PublishingDateFilter__DateShortcuts",
|
|
@@ -139009,7 +139018,7 @@ var SubTitle$2 = _styled.p.withConfig({
|
|
|
139009
139018
|
componentId: "sc-zv88cu-3"
|
|
139010
139019
|
})(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject$l(["\n font-weight: bold;\n margin-bottom: ", "px;\n"], ["\n font-weight: bold;\n margin-bottom: ", "px;\n"])), spacingXs + 2);
|
|
139011
139020
|
|
|
139012
|
-
var templateObject_1$
|
|
139021
|
+
var templateObject_1$6, templateObject_2$2, templateObject_3$1, templateObject_4$1;
|
|
139013
139022
|
|
|
139014
139023
|
var ClearAllFiltersButton = function ClearAllFiltersButton(_a) {
|
|
139015
139024
|
var onClick = _a.onClick;
|
|
@@ -139116,14 +139125,14 @@ var KeywordsFilterInternal = function KeywordsFilterInternal() {
|
|
|
139116
139125
|
var StyledKeywordPicker = _styled(KeywordPicker).withConfig({
|
|
139117
139126
|
displayName: "KeywordsFilter__StyledKeywordPicker",
|
|
139118
139127
|
componentId: "sc-1aoeg5i-0"
|
|
139119
|
-
})(templateObject_1$
|
|
139128
|
+
})(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n overflow: hidden;\n\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\n padding: 0 4px;\n\n div:last-child {\n margin-bottom: 0;\n }\n }\n"], ["\n margin-bottom: ", "px;\n overflow: hidden;\n\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\n padding: 0 4px;\n\n div:last-child {\n margin-bottom: 0;\n }\n }\n"])), spacingM);
|
|
139120
139129
|
|
|
139121
139130
|
var SubTitle$1 = _styled.p.withConfig({
|
|
139122
139131
|
displayName: "KeywordsFilter__SubTitle",
|
|
139123
139132
|
componentId: "sc-1aoeg5i-1"
|
|
139124
|
-
})(templateObject_2$
|
|
139133
|
+
})(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject$l(["\n font-weight: bold;\n margin-bottom: ", "px;\n"], ["\n font-weight: bold;\n margin-bottom: ", "px;\n"])), spacingXs + 2);
|
|
139125
139134
|
|
|
139126
|
-
var templateObject_1$
|
|
139135
|
+
var templateObject_1$5, templateObject_2$1;
|
|
139127
139136
|
|
|
139128
139137
|
var EmptyFilterSearchResult = function EmptyFilterSearchResult() {
|
|
139129
139138
|
return jsxs(Host$1, {
|
|
@@ -139136,8 +139145,8 @@ var EmptyFilterSearchResult = function EmptyFilterSearchResult() {
|
|
|
139136
139145
|
}, void 0)]
|
|
139137
139146
|
}, void 0);
|
|
139138
139147
|
};
|
|
139139
|
-
var Host$1 = _styled.div(templateObject_1$
|
|
139140
|
-
var templateObject_1$
|
|
139148
|
+
var Host$1 = _styled.div(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject$l(["\n text-align: center;\n i {\n font-size: ", "px;\n }\n"], ["\n text-align: center;\n i {\n font-size: ", "px;\n }\n"])), fontSizeMedium);
|
|
139149
|
+
var templateObject_1$4;
|
|
139141
139150
|
|
|
139142
139151
|
var AuthorToolbarFilter = function AuthorToolbarFilter() {
|
|
139143
139152
|
var _a;
|
|
@@ -139152,7 +139161,7 @@ var AuthorToolbarFilter = function AuthorToolbarFilter() {
|
|
|
139152
139161
|
searchText = _c[0],
|
|
139153
139162
|
setSearchText = _c[1];
|
|
139154
139163
|
|
|
139155
|
-
var debouncedSearchText = useDebounce
|
|
139164
|
+
var debouncedSearchText = useDebounce(searchText.toLowerCase(), 500)[0];
|
|
139156
139165
|
var searchAccounts = useAccountApi().searchAccounts;
|
|
139157
139166
|
var showError = useNotificationContext().showError;
|
|
139158
139167
|
var authorsFromFilter = (_a = filter === null || filter === void 0 ? void 0 : filter.authors) !== null && _a !== void 0 ? _a : [];
|
|
@@ -139189,7 +139198,10 @@ var AuthorToolbarFilter = function AuthorToolbarFilter() {
|
|
|
139189
139198
|
value: searchText,
|
|
139190
139199
|
onChange: function (_, value) {
|
|
139191
139200
|
return setSearchText(value);
|
|
139192
|
-
}
|
|
139201
|
+
},
|
|
139202
|
+
ariaLabel: formatMessage({
|
|
139203
|
+
id: 'Generic.search'
|
|
139204
|
+
})
|
|
139193
139205
|
}, void 0), jsxs(UserList, {
|
|
139194
139206
|
children: [isLoading && !accounts && jsx$1(ShimmerList, {}, void 0), !isLoading && accounts.length === 0 && jsx$1(EmptyFilterSearchResult, {}, void 0), accounts && accounts.map(function (a) {
|
|
139195
139207
|
var checked = isUserSelected(a);
|
|
@@ -139208,7 +139220,10 @@ var AuthorToolbarFilter = function AuthorToolbarFilter() {
|
|
|
139208
139220
|
onChange: function (_, isChecked) {
|
|
139209
139221
|
return handleChange(isChecked, a);
|
|
139210
139222
|
},
|
|
139211
|
-
checked: checked
|
|
139223
|
+
checked: checked,
|
|
139224
|
+
ariaLabel: formatMessage({
|
|
139225
|
+
id: 'AriaLabel.authorFilter.toggleUser'
|
|
139226
|
+
})
|
|
139212
139227
|
}, a.id);
|
|
139213
139228
|
})]
|
|
139214
139229
|
}, void 0)]
|
|
@@ -139343,7 +139358,7 @@ var UserShimmer = function UserShimmer() {
|
|
|
139343
139358
|
var Host = _styled.div.withConfig({
|
|
139344
139359
|
displayName: "AuthorFilter__Host",
|
|
139345
139360
|
componentId: "sc-cnx0p9-0"
|
|
139346
|
-
})(templateObject_1$
|
|
139361
|
+
})(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject$l(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
139347
139362
|
|
|
139348
139363
|
var rowHeight = 40;
|
|
139349
139364
|
var visibleUsers = 9;
|
|
@@ -139351,7 +139366,7 @@ var visibleUsers = 9;
|
|
|
139351
139366
|
var UserList = _styled.div.withConfig({
|
|
139352
139367
|
displayName: "AuthorFilter__UserList",
|
|
139353
139368
|
componentId: "sc-cnx0p9-1"
|
|
139354
|
-
})(templateObject_2
|
|
139369
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject$l(["\n margin: ", "px 0 ", "px;\n max-height: ", "px;\n padding: 4px;\n overflow-y: auto;\n"], ["\n margin: ", "px 0 ", "px;\n max-height: ", "px;\n padding: 4px;\n overflow-y: auto;\n"])), spacingS, spacingM, rowHeight * visibleUsers - 8);
|
|
139355
139370
|
|
|
139356
139371
|
var StyledCheckbox = _styled(Checkbox).withConfig({
|
|
139357
139372
|
displayName: "AuthorFilter__StyledCheckbox",
|
|
@@ -139475,155 +139490,7 @@ var SubTitle = _styled.label.withConfig({
|
|
|
139475
139490
|
componentId: "sc-cnx0p9-6"
|
|
139476
139491
|
})(templateObject_7 || (templateObject_7 = __makeTemplateObject$l(["\n display: block;\n font-weight: bold;\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n display: block;\n font-weight: bold;\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), spacingS + 4, spacingXs + 2);
|
|
139477
139492
|
|
|
139478
|
-
var templateObject_1$
|
|
139479
|
-
|
|
139480
|
-
// `SameValue` abstract operation
|
|
139481
|
-
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
139482
|
-
var sameValue$1 = Object.is || function is(x, y) {
|
|
139483
|
-
// eslint-disable-next-line no-self-compare
|
|
139484
|
-
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
139485
|
-
};
|
|
139486
|
-
|
|
139487
|
-
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
139488
|
-
var anObject = anObject$v;
|
|
139489
|
-
var requireObjectCoercible = requireObjectCoercible$m;
|
|
139490
|
-
var sameValue = sameValue$1;
|
|
139491
|
-
var regExpExec = regexpExecAbstract;
|
|
139492
|
-
|
|
139493
|
-
// @@search logic
|
|
139494
|
-
fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
|
139495
|
-
return [
|
|
139496
|
-
// `String.prototype.search` method
|
|
139497
|
-
// https://tc39.github.io/ecma262/#sec-string.prototype.search
|
|
139498
|
-
function search(regexp) {
|
|
139499
|
-
var O = requireObjectCoercible(this);
|
|
139500
|
-
var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
|
139501
|
-
return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
|
139502
|
-
},
|
|
139503
|
-
// `RegExp.prototype[@@search]` method
|
|
139504
|
-
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
|
|
139505
|
-
function (regexp) {
|
|
139506
|
-
var res = maybeCallNative(nativeSearch, regexp, this);
|
|
139507
|
-
if (res.done) return res.value;
|
|
139508
|
-
|
|
139509
|
-
var rx = anObject(regexp);
|
|
139510
|
-
var S = String(this);
|
|
139511
|
-
|
|
139512
|
-
var previousLastIndex = rx.lastIndex;
|
|
139513
|
-
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
139514
|
-
var result = regExpExec(rx, S);
|
|
139515
|
-
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
139516
|
-
return result === null ? -1 : result.index;
|
|
139517
|
-
}
|
|
139518
|
-
];
|
|
139519
|
-
});
|
|
139520
|
-
|
|
139521
|
-
var lib = {};
|
|
139522
|
-
|
|
139523
|
-
var useDebounce$1 = {};
|
|
139524
|
-
|
|
139525
|
-
var useDebouncedCallback$2 = {};
|
|
139526
|
-
|
|
139527
|
-
Object.defineProperty(useDebouncedCallback$2, "__esModule", { value: true });
|
|
139528
|
-
var react_1$1 = React__default;
|
|
139529
|
-
function useDebouncedCallback$1(callback, delay, options) {
|
|
139530
|
-
if (options === void 0) { options = {}; }
|
|
139531
|
-
var maxWait = options.maxWait;
|
|
139532
|
-
var maxWaitHandler = react_1$1.useRef(null);
|
|
139533
|
-
var maxWaitArgs = react_1$1.useRef([]);
|
|
139534
|
-
var leading = options.leading;
|
|
139535
|
-
var trailing = options.trailing === undefined ? true : options.trailing;
|
|
139536
|
-
var leadingCall = react_1$1.useRef(false);
|
|
139537
|
-
var functionTimeoutHandler = react_1$1.useRef(null);
|
|
139538
|
-
var isComponentUnmounted = react_1$1.useRef(false);
|
|
139539
|
-
var debouncedFunction = react_1$1.useRef(callback);
|
|
139540
|
-
debouncedFunction.current = callback;
|
|
139541
|
-
var cancelDebouncedCallback = react_1$1.useCallback(function () {
|
|
139542
|
-
clearTimeout(functionTimeoutHandler.current);
|
|
139543
|
-
clearTimeout(maxWaitHandler.current);
|
|
139544
|
-
maxWaitHandler.current = null;
|
|
139545
|
-
maxWaitArgs.current = [];
|
|
139546
|
-
functionTimeoutHandler.current = null;
|
|
139547
|
-
leadingCall.current = false;
|
|
139548
|
-
}, []);
|
|
139549
|
-
react_1$1.useEffect(function () { return function () {
|
|
139550
|
-
// we use flag, as we allow to call callPending outside the hook
|
|
139551
|
-
isComponentUnmounted.current = true;
|
|
139552
|
-
}; }, []);
|
|
139553
|
-
var debouncedCallback = react_1$1.useCallback(function () {
|
|
139554
|
-
var args = [];
|
|
139555
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
139556
|
-
args[_i] = arguments[_i];
|
|
139557
|
-
}
|
|
139558
|
-
maxWaitArgs.current = args;
|
|
139559
|
-
clearTimeout(functionTimeoutHandler.current);
|
|
139560
|
-
if (leadingCall.current) {
|
|
139561
|
-
leadingCall.current = false;
|
|
139562
|
-
}
|
|
139563
|
-
if (!functionTimeoutHandler.current && leading && !leadingCall.current) {
|
|
139564
|
-
debouncedFunction.current.apply(debouncedFunction, args);
|
|
139565
|
-
leadingCall.current = true;
|
|
139566
|
-
}
|
|
139567
|
-
functionTimeoutHandler.current = setTimeout(function () {
|
|
139568
|
-
var shouldCallFunction = true;
|
|
139569
|
-
if (leading && leadingCall.current) {
|
|
139570
|
-
shouldCallFunction = false;
|
|
139571
|
-
}
|
|
139572
|
-
cancelDebouncedCallback();
|
|
139573
|
-
if (!isComponentUnmounted.current && trailing && shouldCallFunction) {
|
|
139574
|
-
debouncedFunction.current.apply(debouncedFunction, args);
|
|
139575
|
-
}
|
|
139576
|
-
}, delay);
|
|
139577
|
-
if (maxWait && !maxWaitHandler.current && trailing) {
|
|
139578
|
-
maxWaitHandler.current = setTimeout(function () {
|
|
139579
|
-
var args = maxWaitArgs.current;
|
|
139580
|
-
cancelDebouncedCallback();
|
|
139581
|
-
if (!isComponentUnmounted.current) {
|
|
139582
|
-
debouncedFunction.current.apply(null, args);
|
|
139583
|
-
}
|
|
139584
|
-
}, maxWait);
|
|
139585
|
-
}
|
|
139586
|
-
}, [maxWait, delay, cancelDebouncedCallback, leading, trailing]);
|
|
139587
|
-
var callPending = react_1$1.useCallback(function () {
|
|
139588
|
-
// Call pending callback only if we have anything in our queue
|
|
139589
|
-
if (!functionTimeoutHandler.current) {
|
|
139590
|
-
return;
|
|
139591
|
-
}
|
|
139592
|
-
debouncedFunction.current.apply(null, maxWaitArgs.current);
|
|
139593
|
-
cancelDebouncedCallback();
|
|
139594
|
-
}, [cancelDebouncedCallback]);
|
|
139595
|
-
// At the moment, we use 3 args array so that we save backward compatibility
|
|
139596
|
-
return [debouncedCallback, cancelDebouncedCallback, callPending];
|
|
139597
|
-
}
|
|
139598
|
-
useDebouncedCallback$2.default = useDebouncedCallback$1;
|
|
139599
|
-
|
|
139600
|
-
Object.defineProperty(useDebounce$1, "__esModule", { value: true });
|
|
139601
|
-
var react_1 = React__default;
|
|
139602
|
-
var useDebouncedCallback_1$1 = useDebouncedCallback$2;
|
|
139603
|
-
function valueEquality(left, right) {
|
|
139604
|
-
return left === right;
|
|
139605
|
-
}
|
|
139606
|
-
function useDebounce(value, delay, options) {
|
|
139607
|
-
var eq = options && options.equalityFn ? options.equalityFn : valueEquality;
|
|
139608
|
-
var _a = react_1.useState(value), state = _a[0], dispatch = _a[1];
|
|
139609
|
-
var _b = useDebouncedCallback_1$1.default(react_1.useCallback(function (value) { return dispatch(value); }, []), delay, options), callback = _b[0], cancel = _b[1], callPending = _b[2];
|
|
139610
|
-
var previousValue = react_1.useRef(value);
|
|
139611
|
-
react_1.useEffect(function () {
|
|
139612
|
-
// We need to use this condition otherwise we will run debounce timer for the first render (including maxWait option)
|
|
139613
|
-
if (!eq(previousValue.current, value)) {
|
|
139614
|
-
callback(value);
|
|
139615
|
-
previousValue.current = value;
|
|
139616
|
-
}
|
|
139617
|
-
}, [value, callback, eq]);
|
|
139618
|
-
return [state, cancel, callPending];
|
|
139619
|
-
}
|
|
139620
|
-
useDebounce$1.default = useDebounce;
|
|
139621
|
-
|
|
139622
|
-
Object.defineProperty(lib, "__esModule", { value: true });
|
|
139623
|
-
var useDebounce_1 = useDebounce$1;
|
|
139624
|
-
lib.useDebounce = useDebounce_1.default;
|
|
139625
|
-
var useDebouncedCallback_1 = useDebouncedCallback$2;
|
|
139626
|
-
var useDebouncedCallback = lib.useDebouncedCallback = useDebouncedCallback_1.default;
|
|
139493
|
+
var templateObject_1$3, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
139627
139494
|
|
|
139628
139495
|
var VerticalFilterPanel = function VerticalFilterPanel(_a) {
|
|
139629
139496
|
var filter = _a.filter,
|
|
@@ -139649,51 +139516,11 @@ var VerticalFilterPanelInternal = function VerticalFilterPanelInternal(_a) {
|
|
|
139649
139516
|
className = _a.className,
|
|
139650
139517
|
children = _a.children;
|
|
139651
139518
|
var formatMessage = useIntl().formatMessage;
|
|
139652
|
-
|
|
139653
|
-
var _b = useContext(FilterContext),
|
|
139654
|
-
filter = _b.filter,
|
|
139655
|
-
onChange = _b.onChange;
|
|
139656
|
-
|
|
139657
|
-
var _c = useState$2((filter === null || filter === void 0 ? void 0 : filter.search) || ''),
|
|
139658
|
-
searchText = _c[0],
|
|
139659
|
-
setSearchText = _c[1];
|
|
139660
|
-
|
|
139661
|
-
var _d = useDebouncedCallback(onChange, 500),
|
|
139662
|
-
debouncedOnChange = _d[0],
|
|
139663
|
-
cancelDebounce = _d[1];
|
|
139664
|
-
|
|
139665
|
-
var textColors = useContext(ThemeContext$1).theme.textColors;
|
|
139666
|
-
useEffectOnUpdate(function () {
|
|
139667
|
-
if ((filter === null || filter === void 0 ? void 0 : filter.search) !== searchText) {
|
|
139668
|
-
setSearchText((filter === null || filter === void 0 ? void 0 : filter.search) || '');
|
|
139669
|
-
}
|
|
139670
|
-
}, [filter === null || filter === void 0 ? void 0 : filter.search]);
|
|
139519
|
+
var onChange = useContext(FilterContext).onChange;
|
|
139671
139520
|
return jsxs("div", __assign$g({
|
|
139672
139521
|
className: className
|
|
139673
139522
|
}, {
|
|
139674
|
-
children: [
|
|
139675
|
-
placeholder: formatMessage({
|
|
139676
|
-
id: 'Generic.search'
|
|
139677
|
-
}),
|
|
139678
|
-
value: searchText,
|
|
139679
|
-
onChange: function (_, text) {
|
|
139680
|
-
setSearchText(text);
|
|
139681
|
-
debouncedOnChange(__assign$g(__assign$g({}, filter), {
|
|
139682
|
-
search: text
|
|
139683
|
-
}));
|
|
139684
|
-
},
|
|
139685
|
-
onSearch: function (text) {
|
|
139686
|
-
cancelDebounce();
|
|
139687
|
-
onChange(__assign$g(__assign$g({}, filter), {
|
|
139688
|
-
search: text
|
|
139689
|
-
}));
|
|
139690
|
-
},
|
|
139691
|
-
iconProps: {
|
|
139692
|
-
style: {
|
|
139693
|
-
color: textColors.default
|
|
139694
|
-
}
|
|
139695
|
-
}
|
|
139696
|
-
}, void 0), children, jsxs(ButtonsHost, {
|
|
139523
|
+
children: [children, jsxs(ButtonsHost, {
|
|
139697
139524
|
children: [jsx$1(DefaultButton, {
|
|
139698
139525
|
iconProps: {
|
|
139699
139526
|
iconName: 'ClearFilter'
|
|
@@ -139702,7 +139529,6 @@ var VerticalFilterPanelInternal = function VerticalFilterPanelInternal(_a) {
|
|
|
139702
139529
|
id: 'FilterPanel.clearFilterText'
|
|
139703
139530
|
}),
|
|
139704
139531
|
onClick: function () {
|
|
139705
|
-
setSearchText('');
|
|
139706
139532
|
onChange(null);
|
|
139707
139533
|
}
|
|
139708
139534
|
}, void 0), jsx$1(DefaultButton, {
|
|
@@ -139718,14 +139544,9 @@ var VerticalFilterPanelInternal = function VerticalFilterPanelInternal(_a) {
|
|
|
139718
139544
|
var ButtonsHost = _styled.div.withConfig({
|
|
139719
139545
|
displayName: "VerticalFilterPanel__ButtonsHost",
|
|
139720
139546
|
componentId: "sc-12j7kak-0"
|
|
139721
|
-
})(templateObject_1$
|
|
139722
|
-
|
|
139723
|
-
var StyledSearchBox = _styled(SearchBox$1).withConfig({
|
|
139724
|
-
displayName: "VerticalFilterPanel__StyledSearchBox",
|
|
139725
|
-
componentId: "sc-12j7kak-1"
|
|
139726
|
-
})(templateObject_2 || (templateObject_2 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), spacingL);
|
|
139547
|
+
})(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject$l(["\n display: flex;\n justify-content: flex-end;\n margin-top: 20px;\n\n & > *:not(:first-child) {\n margin-left: 20px;\n }\n"], ["\n display: flex;\n justify-content: flex-end;\n margin-top: 20px;\n\n & > *:not(:first-child) {\n margin-left: 20px;\n }\n"])));
|
|
139727
139548
|
|
|
139728
|
-
var templateObject_1$
|
|
139549
|
+
var templateObject_1$2;
|
|
139729
139550
|
|
|
139730
139551
|
var ToolbarFilterModal = function ToolbarFilterModal(_a) {
|
|
139731
139552
|
var filter = _a.filter,
|
|
@@ -139765,9 +139586,9 @@ var ToolbarFilterModal = function ToolbarFilterModal(_a) {
|
|
|
139765
139586
|
var Inner = _styled.div.withConfig({
|
|
139766
139587
|
displayName: "ToolbarFilterModal__Inner",
|
|
139767
139588
|
componentId: "sc-63ubbe-0"
|
|
139768
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject$l(["\n width: 340px;\n"], ["\n width: 340px;\n"])));
|
|
139589
|
+
})(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject$l(["\n width: 340px;\n"], ["\n width: 340px;\n"])));
|
|
139769
139590
|
|
|
139770
|
-
var templateObject_1;
|
|
139591
|
+
var templateObject_1$1;
|
|
139771
139592
|
|
|
139772
139593
|
var ToolbarFilterModalButton = function ToolbarFilterModalButton(_a) {
|
|
139773
139594
|
var filter = _a.filter,
|
|
@@ -139807,4 +139628,99 @@ var ToolbarFilterModalButton = function ToolbarFilterModalButton(_a) {
|
|
|
139807
139628
|
}
|
|
139808
139629
|
};
|
|
139809
139630
|
|
|
139810
|
-
|
|
139631
|
+
// `SameValue` abstract operation
|
|
139632
|
+
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
139633
|
+
var sameValue$1 = Object.is || function is(x, y) {
|
|
139634
|
+
// eslint-disable-next-line no-self-compare
|
|
139635
|
+
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
139636
|
+
};
|
|
139637
|
+
|
|
139638
|
+
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
139639
|
+
var anObject = anObject$v;
|
|
139640
|
+
var requireObjectCoercible = requireObjectCoercible$m;
|
|
139641
|
+
var sameValue = sameValue$1;
|
|
139642
|
+
var regExpExec = regexpExecAbstract;
|
|
139643
|
+
|
|
139644
|
+
// @@search logic
|
|
139645
|
+
fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
|
139646
|
+
return [
|
|
139647
|
+
// `String.prototype.search` method
|
|
139648
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.search
|
|
139649
|
+
function search(regexp) {
|
|
139650
|
+
var O = requireObjectCoercible(this);
|
|
139651
|
+
var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
|
139652
|
+
return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
|
139653
|
+
},
|
|
139654
|
+
// `RegExp.prototype[@@search]` method
|
|
139655
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
|
|
139656
|
+
function (regexp) {
|
|
139657
|
+
var res = maybeCallNative(nativeSearch, regexp, this);
|
|
139658
|
+
if (res.done) return res.value;
|
|
139659
|
+
|
|
139660
|
+
var rx = anObject(regexp);
|
|
139661
|
+
var S = String(this);
|
|
139662
|
+
|
|
139663
|
+
var previousLastIndex = rx.lastIndex;
|
|
139664
|
+
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
139665
|
+
var result = regExpExec(rx, S);
|
|
139666
|
+
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
139667
|
+
return result === null ? -1 : result.index;
|
|
139668
|
+
}
|
|
139669
|
+
];
|
|
139670
|
+
});
|
|
139671
|
+
|
|
139672
|
+
var SearchFilter = function SearchFilter() {
|
|
139673
|
+
var _a = useContext(FilterContext),
|
|
139674
|
+
filter = _a.filter,
|
|
139675
|
+
onChange = _a.onChange;
|
|
139676
|
+
|
|
139677
|
+
var formatMessage = useIntl().formatMessage;
|
|
139678
|
+
|
|
139679
|
+
var _b = useDebouncedCallback(onChange, 500),
|
|
139680
|
+
debouncedOnChange = _b[0],
|
|
139681
|
+
cancelDebounce = _b[1];
|
|
139682
|
+
|
|
139683
|
+
var textColors = useContext(ThemeContext$1).theme.textColors;
|
|
139684
|
+
|
|
139685
|
+
var _c = useState$2((filter === null || filter === void 0 ? void 0 : filter.search) || ''),
|
|
139686
|
+
searchText = _c[0],
|
|
139687
|
+
setSearchText = _c[1];
|
|
139688
|
+
|
|
139689
|
+
useEffectOnUpdate(function () {
|
|
139690
|
+
if ((filter === null || filter === void 0 ? void 0 : filter.search) !== searchText) {
|
|
139691
|
+
setSearchText((filter === null || filter === void 0 ? void 0 : filter.search) || '');
|
|
139692
|
+
}
|
|
139693
|
+
}, [filter === null || filter === void 0 ? void 0 : filter.search]);
|
|
139694
|
+
return jsx$1(StyledSearchBox, {
|
|
139695
|
+
placeholder: formatMessage({
|
|
139696
|
+
id: 'Generic.search'
|
|
139697
|
+
}),
|
|
139698
|
+
value: searchText,
|
|
139699
|
+
onChange: function (_, text) {
|
|
139700
|
+
setSearchText(text);
|
|
139701
|
+
debouncedOnChange(__assign$g(__assign$g({}, filter), {
|
|
139702
|
+
search: text
|
|
139703
|
+
}));
|
|
139704
|
+
},
|
|
139705
|
+
onSearch: function (text) {
|
|
139706
|
+
cancelDebounce();
|
|
139707
|
+
onChange(__assign$g(__assign$g({}, filter), {
|
|
139708
|
+
search: text
|
|
139709
|
+
}));
|
|
139710
|
+
},
|
|
139711
|
+
iconProps: {
|
|
139712
|
+
style: {
|
|
139713
|
+
color: textColors.default
|
|
139714
|
+
}
|
|
139715
|
+
}
|
|
139716
|
+
}, void 0);
|
|
139717
|
+
};
|
|
139718
|
+
|
|
139719
|
+
var StyledSearchBox = _styled(SearchBox$1).withConfig({
|
|
139720
|
+
displayName: "SearchFilter__StyledSearchBox",
|
|
139721
|
+
componentId: "sc-f84c6g-0"
|
|
139722
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), spacingL);
|
|
139723
|
+
|
|
139724
|
+
var templateObject_1;
|
|
139725
|
+
|
|
139726
|
+
export { Avatar as A, ToolbarFilterModal as B, ToolbarFilterModalButton as C, ChannelFilter as D, EventDetail as E, ChannelToolbarFilter as F, PublishingDateToolbarFilter as G, PublishingDateFilter as H, ItemLayoutMode as I, ClearAllFiltersButton as J, KeywordsFilter as K, KeywordsToolbarFilter as L, ManageChannels as M, NewsDetail as N, AuthorToolbarFilter as O, PropTypes$2 as P, AuthorFilter as Q, ReachContextProvider as R, SearchFilter as S, ThemeContext$1 as T, UserDetails as U, VerticalFilterPanel as V, _assertThisInitialized$b as _, commonjsGlobal$7 as a, _setPrototypeOf$6 as b, commonjsRequire as c, _defineProperty$p as d, _extends$9 as e, minScreenSize as f, PageDetail as g, NewsList as h, NewsGrid as i, useCurrentUser as j, NewsHero as k, NewsEditorDashboard as l, moment$1 as m, Toolbar$1 as n, ToolbarIconButton as o, ToolbarChannelSelector as p, ToolbarMarkAllEventsAsReadButton as q, ToolbarMarkAllNewsAsReadButton as r, ToolbarCloseButton as s, NewsItemContextProvider as t, useWindowSize$2 as u, ToolbarNewsLanguageSelector as v, ToolbarManageNewsItemButton as w, NewsDetailPreview as x, NewsItemPreviewContextProvider as y, ToolbarFilterPanel as z };
|