@livetiles/reach-components-react 0.4.0-preview.252 → 0.4.0-preview.254
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/ToolbarFilterModal.d.ts +7 -0
- package/ToolbarFilterModalButton.d.ts +3 -0
- package/VerticalFilterPanel.d.ts +7 -0
- package/en.async.esm.esm.js +2 -0
- package/index.d.ts +15 -1
- package/index.esm.js +1 -1
- package/index.esm2.js +723 -391
- package/index.umd.js +726 -389
- package/package.json +1 -1
package/index.esm2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as jsx$1, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import require$$0$6 from 'events';
|
|
3
3
|
import * as React$d from 'react';
|
|
4
|
-
import React__default, { useContext, createContext, useMemo,
|
|
4
|
+
import React__default, { useContext, createContext, useMemo, useRef as useRef$1, useEffect as useEffect$1, useState as useState$2, useCallback, useReducer, Children, isValidElement, cloneElement, Component, lazy as lazy$1, Suspense, forwardRef, createElement as createElement$a, useLayoutEffect, useImperativeHandle, Fragment as Fragment$1 } from 'react';
|
|
5
5
|
import { PersonaInitialsColor, MessageBarType, loadTheme, IconButton as IconButton$1, Link as Link$3, MessageBar, ActionButton as ActionButton$1, TextField, PrimaryButton, DefaultButton, Icon, Image as Image$1, Spinner as Spinner$1, Toggle, ChoiceGroup as ChoiceGroup$1, Persona, Checkbox, Label as Label$2, Dropdown as Dropdown$1, ProgressIndicator, Shimmer, ShimmerElementsGroup, ShimmerElementType, DirectionalHint, PersonaSize, TooltipHost as TooltipHost$1, DialogType, Dialog as Dialog$1, DialogFooter, SelectionMode, NormalPeoplePicker, FocusTrapCallout, SpinnerSize, SearchBox as SearchBox$1, ResponsiveMode, ImageFit, Layer as Layer$1, initializeIcons, TagPicker, Breadcrumb, CommandBarButton, DatePicker, DayOfWeek } from 'office-ui-fabric-react';
|
|
6
6
|
import * as ReactRouterDom from 'react-router-dom';
|
|
7
7
|
import { useHistory, useRouteMatch, useLocation as useLocation$1, Link as Link$4, NavLink, MemoryRouter, Switch, Route } from 'react-router-dom';
|
|
@@ -7956,7 +7956,7 @@ var Stringify = stringify$4;
|
|
|
7956
7956
|
var Parse = parse$5;
|
|
7957
7957
|
|
|
7958
7958
|
|
|
7959
|
-
var lib$
|
|
7959
|
+
var lib$5 = {
|
|
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$5;
|
|
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$4 = {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$4.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$3.exports = function (token,options) {
|
|
|
8695
8695
|
}
|
|
8696
8696
|
};
|
|
8697
8697
|
|
|
8698
|
-
lib$
|
|
8698
|
+
lib$4.exports.InvalidTokenError = InvalidTokenError;
|
|
8699
8699
|
|
|
8700
|
-
var jwtDecode = lib$
|
|
8700
|
+
var jwtDecode = lib$4.exports;
|
|
8701
8701
|
|
|
8702
8702
|
var moment$1 = {exports: {}};
|
|
8703
8703
|
|
|
@@ -13355,10 +13355,10 @@ var requireObjectCoercible$4$5 = function (it) {
|
|
|
13355
13355
|
|
|
13356
13356
|
|
|
13357
13357
|
var IndexedObject$1$3 = indexedObject$6;
|
|
13358
|
-
var requireObjectCoercible$3$
|
|
13358
|
+
var requireObjectCoercible$3$6 = requireObjectCoercible$4$5;
|
|
13359
13359
|
|
|
13360
13360
|
var toIndexedObject$4$4 = function (it) {
|
|
13361
|
-
return IndexedObject$1$3(requireObjectCoercible$3$
|
|
13361
|
+
return IndexedObject$1$3(requireObjectCoercible$3$6(it));
|
|
13362
13362
|
};
|
|
13363
13363
|
|
|
13364
13364
|
var check$7 = function (it) {
|
|
@@ -14157,7 +14157,7 @@ var aPossiblePrototype$1$4 = function (it) {
|
|
|
14157
14157
|
return it;
|
|
14158
14158
|
};
|
|
14159
14159
|
|
|
14160
|
-
var anObject$3$
|
|
14160
|
+
var anObject$3$7 = anObject$8$5;
|
|
14161
14161
|
var aPossiblePrototype$5 = aPossiblePrototype$1$4; // `Object.setPrototypeOf` method
|
|
14162
14162
|
// https://tc39.github.io/ecma262/#sec-object.setprototypeof
|
|
14163
14163
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
@@ -14178,7 +14178,7 @@ var objectSetPrototypeOf$4 = Object.setPrototypeOf || ('__proto__' in {} ? funct
|
|
|
14178
14178
|
}
|
|
14179
14179
|
|
|
14180
14180
|
return function setPrototypeOf(O, proto) {
|
|
14181
|
-
anObject$3$
|
|
14181
|
+
anObject$3$7(O);
|
|
14182
14182
|
aPossiblePrototype$5(proto);
|
|
14183
14183
|
if (CORRECT_SETTER) setter.call(O, proto);else O.__proto__ = proto;
|
|
14184
14184
|
return O;
|
|
@@ -18302,11 +18302,11 @@ for (var COLLECTION_NAME$3 in DOMIterables$3) {
|
|
|
18302
18302
|
}
|
|
18303
18303
|
}
|
|
18304
18304
|
|
|
18305
|
-
var anObject$3$
|
|
18305
|
+
var anObject$3$6 = anObject$9$3; // `RegExp.prototype.flags` getter implementation
|
|
18306
18306
|
// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
|
|
18307
18307
|
|
|
18308
18308
|
var regexpFlags$1$5 = function () {
|
|
18309
|
-
var that = anObject$3$
|
|
18309
|
+
var that = anObject$3$6(this);
|
|
18310
18310
|
var result = '';
|
|
18311
18311
|
if (that.global) result += 'g';
|
|
18312
18312
|
if (that.ignoreCase) result += 'i';
|
|
@@ -18603,11 +18603,11 @@ var speciesConstructor$1$4 = function (O, defaultConstructor) {
|
|
|
18603
18603
|
};
|
|
18604
18604
|
|
|
18605
18605
|
var toInteger$1$6 = toInteger$4$4;
|
|
18606
|
-
var requireObjectCoercible$3$
|
|
18606
|
+
var requireObjectCoercible$3$5 = requireObjectCoercible$6$3; // `String.prototype.{ codePointAt, at }` methods implementation
|
|
18607
18607
|
|
|
18608
18608
|
var createMethod$1$4 = function (CONVERT_TO_STRING) {
|
|
18609
18609
|
return function ($this, pos) {
|
|
18610
|
-
var S = String(requireObjectCoercible$3$
|
|
18610
|
+
var S = String(requireObjectCoercible$3$5($this));
|
|
18611
18611
|
var position = toInteger$1$6(pos);
|
|
18612
18612
|
var size = S.length;
|
|
18613
18613
|
var first, second;
|
|
@@ -18656,7 +18656,7 @@ var regexpExecAbstract$5 = function (R, S) {
|
|
|
18656
18656
|
return regexpExec$1$5.call(R, S);
|
|
18657
18657
|
};
|
|
18658
18658
|
|
|
18659
|
-
var fixRegExpWellKnownSymbolLogic$1$
|
|
18659
|
+
var fixRegExpWellKnownSymbolLogic$1$4 = fixRegexpWellKnownSymbolLogic$5;
|
|
18660
18660
|
var isRegExp$b = isRegexp$5;
|
|
18661
18661
|
var anObject$1$6 = anObject$9$3;
|
|
18662
18662
|
var requireObjectCoercible$2$6 = requireObjectCoercible$6$3;
|
|
@@ -18674,7 +18674,7 @@ var SUPPORTS_Y$3 = !fails$o(function () {
|
|
|
18674
18674
|
return !RegExp(MAX_UINT32$3, 'y');
|
|
18675
18675
|
}); // @@split logic
|
|
18676
18676
|
|
|
18677
|
-
fixRegExpWellKnownSymbolLogic$1$
|
|
18677
|
+
fixRegExpWellKnownSymbolLogic$1$4('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
|
|
18678
18678
|
var internalSplit;
|
|
18679
18679
|
|
|
18680
18680
|
if ('abbc'.split(/(b)*/)[1] == 'c' || 'test'.split(/(?:)/, -1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || '.'.split(/()()/).length > 1 || ''.split(/.?/).length) {
|
|
@@ -19082,6 +19082,18 @@ function useBeforeUnload$2(onBeforeUnload, deps) {
|
|
|
19082
19082
|
}, [handleBeforeUnload]);
|
|
19083
19083
|
}
|
|
19084
19084
|
|
|
19085
|
+
function useEffectOnUpdate(effect, deps) {
|
|
19086
|
+
var isFirstRun = useRef$1(true);
|
|
19087
|
+
useEffect$1(function () {
|
|
19088
|
+
if (isFirstRun.current) {
|
|
19089
|
+
isFirstRun.current = false;
|
|
19090
|
+
return;
|
|
19091
|
+
}
|
|
19092
|
+
|
|
19093
|
+
return effect(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19094
|
+
}, deps);
|
|
19095
|
+
}
|
|
19096
|
+
|
|
19085
19097
|
function usePerformanceTimer() {
|
|
19086
19098
|
var stateRef = useRef$1({
|
|
19087
19099
|
start: 0,
|
|
@@ -25136,15 +25148,15 @@ var anObject$4$4 = function (it) {
|
|
|
25136
25148
|
|
|
25137
25149
|
var DESCRIPTORS$1$4 = descriptors$4;
|
|
25138
25150
|
var IE8_DOM_DEFINE$5 = ie8DomDefine$4;
|
|
25139
|
-
var anObject$3$
|
|
25151
|
+
var anObject$3$5 = anObject$4$4;
|
|
25140
25152
|
var toPrimitive$7 = toPrimitive$2$4;
|
|
25141
25153
|
var nativeDefineProperty$4 = Object.defineProperty; // `Object.defineProperty` method
|
|
25142
25154
|
// https://tc39.github.io/ecma262/#sec-object.defineproperty
|
|
25143
25155
|
|
|
25144
25156
|
objectDefineProperty$4.f = DESCRIPTORS$1$4 ? nativeDefineProperty$4 : function defineProperty(O, P, Attributes) {
|
|
25145
|
-
anObject$3$
|
|
25157
|
+
anObject$3$5(O);
|
|
25146
25158
|
P = toPrimitive$7(P, true);
|
|
25147
|
-
anObject$3$
|
|
25159
|
+
anObject$3$5(Attributes);
|
|
25148
25160
|
if (IE8_DOM_DEFINE$5) try {
|
|
25149
25161
|
return nativeDefineProperty$4(O, P, Attributes);
|
|
25150
25162
|
} catch (error) {
|
|
@@ -25835,7 +25847,7 @@ var fixRegexpWellKnownSymbolLogic$4 = function (KEY, length, exec, sham) {
|
|
|
25835
25847
|
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
25836
25848
|
|
|
25837
25849
|
|
|
25838
|
-
var sameValue$1$
|
|
25850
|
+
var sameValue$1$4 = Object.is || function is(x, y) {
|
|
25839
25851
|
// eslint-disable-next-line no-self-compare
|
|
25840
25852
|
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
25841
25853
|
};
|
|
@@ -25867,7 +25879,7 @@ var regexpExecAbstract$4 = function (R, S) {
|
|
|
25867
25879
|
var fixRegExpWellKnownSymbolLogic$7 = fixRegexpWellKnownSymbolLogic$4;
|
|
25868
25880
|
var anObject$m = anObject$4$4;
|
|
25869
25881
|
var requireObjectCoercible$i = requireObjectCoercible$2$5;
|
|
25870
|
-
var sameValue$
|
|
25882
|
+
var sameValue$5 = sameValue$1$4;
|
|
25871
25883
|
var regExpExec$6 = regexpExecAbstract$4; // @@search logic
|
|
25872
25884
|
|
|
25873
25885
|
fixRegExpWellKnownSymbolLogic$7('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
|
@@ -25885,9 +25897,9 @@ fixRegExpWellKnownSymbolLogic$7('search', 1, function (SEARCH, nativeSearch, may
|
|
|
25885
25897
|
var rx = anObject$m(regexp);
|
|
25886
25898
|
var S = String(this);
|
|
25887
25899
|
var previousLastIndex = rx.lastIndex;
|
|
25888
|
-
if (!sameValue$
|
|
25900
|
+
if (!sameValue$5(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
25889
25901
|
var result = regExpExec$6(rx, S);
|
|
25890
|
-
if (!sameValue$
|
|
25902
|
+
if (!sameValue$5(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
25891
25903
|
return result === null ? -1 : result.index;
|
|
25892
25904
|
}];
|
|
25893
25905
|
});
|
|
@@ -40450,10 +40462,10 @@ var requireObjectCoercible$4$3 = function (it) {
|
|
|
40450
40462
|
|
|
40451
40463
|
|
|
40452
40464
|
var IndexedObject$5 = indexedObject$3;
|
|
40453
|
-
var requireObjectCoercible$3$
|
|
40465
|
+
var requireObjectCoercible$3$4 = requireObjectCoercible$4$3;
|
|
40454
40466
|
|
|
40455
40467
|
var toIndexedObject$3$3 = function (it) {
|
|
40456
|
-
return IndexedObject$5(requireObjectCoercible$3$
|
|
40468
|
+
return IndexedObject$5(requireObjectCoercible$3$4(it));
|
|
40457
40469
|
};
|
|
40458
40470
|
|
|
40459
40471
|
var isObject$8$3 = function (it) {
|
|
@@ -41223,16 +41235,16 @@ var checkCorrectnessOfIteration$1$3 = function (exec, SKIP_CLOSING) {
|
|
|
41223
41235
|
return ITERATION_SUPPORT;
|
|
41224
41236
|
};
|
|
41225
41237
|
|
|
41226
|
-
var anObject$3$
|
|
41238
|
+
var anObject$3$4 = anObject$8$3;
|
|
41227
41239
|
var aFunction$3$3 = aFunction$5$3;
|
|
41228
41240
|
var wellKnownSymbol$5$3 = wellKnownSymbol$d$3;
|
|
41229
41241
|
var SPECIES$2$3 = wellKnownSymbol$5$3('species'); // `SpeciesConstructor` abstract operation
|
|
41230
41242
|
// https://tc39.github.io/ecma262/#sec-speciesconstructor
|
|
41231
41243
|
|
|
41232
41244
|
var speciesConstructor$1$3 = function (O, defaultConstructor) {
|
|
41233
|
-
var C = anObject$3$
|
|
41245
|
+
var C = anObject$3$4(O).constructor;
|
|
41234
41246
|
var S;
|
|
41235
|
-
return C === undefined || (S = anObject$3$
|
|
41247
|
+
return C === undefined || (S = anObject$3$4(C)[SPECIES$2$3]) == undefined ? defaultConstructor : aFunction$3$3(S);
|
|
41236
41248
|
};
|
|
41237
41249
|
|
|
41238
41250
|
var getBuiltIn$2$3 = getBuiltIn$5$3;
|
|
@@ -53600,22 +53612,22 @@ var addToUnscopables$4 = addToUnscopables$2$2;
|
|
|
53600
53612
|
addToUnscopables$4('flatMap'); // `SameValue` abstract operation
|
|
53601
53613
|
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
53602
53614
|
|
|
53603
|
-
var sameValue$1$
|
|
53615
|
+
var sameValue$1$3 = Object.is || function is(x, y) {
|
|
53604
53616
|
// eslint-disable-next-line no-self-compare
|
|
53605
53617
|
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
53606
53618
|
};
|
|
53607
53619
|
|
|
53608
53620
|
var fixRegExpWellKnownSymbolLogic$2$2 = fixRegexpWellKnownSymbolLogic$3;
|
|
53609
|
-
var anObject$3$
|
|
53610
|
-
var requireObjectCoercible$3$
|
|
53611
|
-
var sameValue$
|
|
53612
|
-
var regExpExec$1$
|
|
53621
|
+
var anObject$3$3 = anObject$f$1;
|
|
53622
|
+
var requireObjectCoercible$3$3 = requireObjectCoercible$b$1;
|
|
53623
|
+
var sameValue$4 = sameValue$1$3;
|
|
53624
|
+
var regExpExec$1$3 = regexpExecAbstract$3; // @@search logic
|
|
53613
53625
|
|
|
53614
53626
|
fixRegExpWellKnownSymbolLogic$2$2('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
|
53615
53627
|
return [// `String.prototype.search` method
|
|
53616
53628
|
// https://tc39.github.io/ecma262/#sec-string.prototype.search
|
|
53617
53629
|
function search(regexp) {
|
|
53618
|
-
var O = requireObjectCoercible$3$
|
|
53630
|
+
var O = requireObjectCoercible$3$3(this);
|
|
53619
53631
|
var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
|
53620
53632
|
return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
|
53621
53633
|
}, // `RegExp.prototype[@@search]` method
|
|
@@ -53623,12 +53635,12 @@ fixRegExpWellKnownSymbolLogic$2$2('search', 1, function (SEARCH, nativeSearch, m
|
|
|
53623
53635
|
function (regexp) {
|
|
53624
53636
|
var res = maybeCallNative(nativeSearch, regexp, this);
|
|
53625
53637
|
if (res.done) return res.value;
|
|
53626
|
-
var rx = anObject$3$
|
|
53638
|
+
var rx = anObject$3$3(regexp);
|
|
53627
53639
|
var S = String(this);
|
|
53628
53640
|
var previousLastIndex = rx.lastIndex;
|
|
53629
|
-
if (!sameValue$
|
|
53630
|
-
var result = regExpExec$1$
|
|
53631
|
-
if (!sameValue$
|
|
53641
|
+
if (!sameValue$4(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
53642
|
+
var result = regExpExec$1$3(rx, S);
|
|
53643
|
+
if (!sameValue$4(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
53632
53644
|
return result === null ? -1 : result.index;
|
|
53633
53645
|
}];
|
|
53634
53646
|
});
|
|
@@ -53917,14 +53929,14 @@ var defaultTheme = {
|
|
|
53917
53929
|
semanticColors: semanticColors,
|
|
53918
53930
|
textColors: textColors
|
|
53919
53931
|
};
|
|
53920
|
-
var fixRegExpWellKnownSymbolLogic$1$
|
|
53932
|
+
var fixRegExpWellKnownSymbolLogic$1$3 = fixRegexpWellKnownSymbolLogic$3;
|
|
53921
53933
|
var anObject$2$3 = anObject$f$1;
|
|
53922
53934
|
var toLength$1$2 = toLength$a$1;
|
|
53923
53935
|
var requireObjectCoercible$2$3 = requireObjectCoercible$b$1;
|
|
53924
53936
|
var advanceStringIndex$1$3 = advanceStringIndex$3$1;
|
|
53925
53937
|
var regExpExec$5 = regexpExecAbstract$3; // @@match logic
|
|
53926
53938
|
|
|
53927
|
-
fixRegExpWellKnownSymbolLogic$1$
|
|
53939
|
+
fixRegExpWellKnownSymbolLogic$1$3('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
|
53928
53940
|
return [// `String.prototype.match` method
|
|
53929
53941
|
// https://tc39.github.io/ecma262/#sec-string.prototype.match
|
|
53930
53942
|
function match(regexp) {
|
|
@@ -65244,7 +65256,7 @@ var __importDefault$m = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
65244
65256
|
};
|
|
65245
65257
|
Object.defineProperty(avatar, "__esModule", { value: true });
|
|
65246
65258
|
var styled_1$b = __importDefault$m(require$$0$4);
|
|
65247
|
-
var react_1$
|
|
65259
|
+
var react_1$w = __importStar$d(React__default);
|
|
65248
65260
|
var getSmallAvatar = function (avatar) {
|
|
65249
65261
|
var _a, _b;
|
|
65250
65262
|
if (!avatar)
|
|
@@ -65255,11 +65267,11 @@ var getSmallAvatar = function (avatar) {
|
|
|
65255
65267
|
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"])));
|
|
65256
65268
|
var Avatar$5 = function (_a) {
|
|
65257
65269
|
var user = _a.user, _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
65258
|
-
var defaultAvatarId = react_1$
|
|
65270
|
+
var defaultAvatarId = react_1$w.useRef(Math.floor(Math.random() * 5) + 1);
|
|
65259
65271
|
var url = user.avatar_url
|
|
65260
65272
|
? getSmallAvatar(user.avatar_url)
|
|
65261
65273
|
: "https://media.giphy.com/avatars/default" + defaultAvatarId.current + ".gif";
|
|
65262
|
-
return react_1$
|
|
65274
|
+
return react_1$w.default.createElement(Img, { src: url, className: className });
|
|
65263
65275
|
};
|
|
65264
65276
|
avatar.default = Avatar$5;
|
|
65265
65277
|
var templateObject_1$2I;
|
|
@@ -65570,17 +65582,17 @@ var __importDefault$l = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
65570
65582
|
};
|
|
65571
65583
|
Object.defineProperty(verifiedBadge, "__esModule", { value: true });
|
|
65572
65584
|
var js_brand_1$6 = dist$2;
|
|
65573
|
-
var react_1$
|
|
65585
|
+
var react_1$v = __importDefault$l(React__default);
|
|
65574
65586
|
var VerifiedBadge = function (_a) {
|
|
65575
65587
|
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;
|
|
65576
|
-
return (react_1$
|
|
65577
|
-
react_1$
|
|
65578
|
-
react_1$
|
|
65579
|
-
react_1$
|
|
65580
|
-
react_1$
|
|
65581
|
-
react_1$
|
|
65582
|
-
react_1$
|
|
65583
|
-
react_1$
|
|
65588
|
+
return (react_1$v.default.createElement("svg", { className: [VerifiedBadge.className, className].join(' '), height: size, width: "19px", viewBox: "0 0 19 17" },
|
|
65589
|
+
react_1$v.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) " }),
|
|
65590
|
+
react_1$v.default.createElement("g", { transform: "translate(-532.000000, -466.000000)", fill: fill },
|
|
65591
|
+
react_1$v.default.createElement("g", { transform: "translate(141.000000, 235.000000)" },
|
|
65592
|
+
react_1$v.default.createElement("g", { transform: "translate(264.000000, 0.000000)" },
|
|
65593
|
+
react_1$v.default.createElement("g", { transform: "translate(10.000000, 224.000000)" },
|
|
65594
|
+
react_1$v.default.createElement("g", { transform: "translate(114.000000, 2.500000)" },
|
|
65595
|
+
react_1$v.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" }))))))));
|
|
65584
65596
|
};
|
|
65585
65597
|
VerifiedBadge.className = 'giphy-verified-badge';
|
|
65586
65598
|
VerifiedBadge.checkMarkClassName = 'giphy-verified-checkmark';
|
|
@@ -65623,7 +65635,7 @@ var __importDefault$k = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
65623
65635
|
};
|
|
65624
65636
|
Object.defineProperty(attribution$1, "__esModule", { value: true });
|
|
65625
65637
|
var styled_1$a = __importDefault$k(require$$0$4);
|
|
65626
|
-
var react_1$
|
|
65638
|
+
var react_1$u = __importDefault$k(React__default);
|
|
65627
65639
|
var avatar_1$3 = __importDefault$k(avatar);
|
|
65628
65640
|
var user_1$1 = __importDefault$k(user);
|
|
65629
65641
|
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"])));
|
|
@@ -65634,7 +65646,7 @@ var Attribution$2 = function (_a) {
|
|
|
65634
65646
|
if (!(user === null || user === void 0 ? void 0 : user.username) && !(user === null || user === void 0 ? void 0 : user.display_name)) {
|
|
65635
65647
|
return null;
|
|
65636
65648
|
}
|
|
65637
|
-
return (react_1$
|
|
65649
|
+
return (react_1$u.default.createElement(Container$b, { className: [Attribution$2.className, className].join(' '), onClick: function (e) {
|
|
65638
65650
|
e.preventDefault();
|
|
65639
65651
|
e.stopPropagation();
|
|
65640
65652
|
if (onClick) {
|
|
@@ -65646,8 +65658,8 @@ var Attribution$2 = function (_a) {
|
|
|
65646
65658
|
window.open(url, '_blank');
|
|
65647
65659
|
}
|
|
65648
65660
|
} },
|
|
65649
|
-
react_1$
|
|
65650
|
-
react_1$
|
|
65661
|
+
react_1$u.default.createElement(Avatar$4, { user: user }),
|
|
65662
|
+
react_1$u.default.createElement(user_1$1.default, { user: gif.user })));
|
|
65651
65663
|
};
|
|
65652
65664
|
Attribution$2.className = 'giphy-attribution';
|
|
65653
65665
|
attribution$1.default = Attribution$2;
|
|
@@ -65683,21 +65695,21 @@ var __importDefault$j = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
65683
65695
|
};
|
|
65684
65696
|
Object.defineProperty(overlay, "__esModule", { value: true });
|
|
65685
65697
|
var styled_1$9 = __importDefault$j(require$$0$4);
|
|
65686
|
-
var react_1$
|
|
65698
|
+
var react_1$t = __importStar$c(React__default);
|
|
65687
65699
|
var _1$1 = __importDefault$j(attribution$1);
|
|
65688
65700
|
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"])));
|
|
65689
65701
|
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"])));
|
|
65690
65702
|
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"])));
|
|
65691
65703
|
var AttributionOverlay = function (_a) {
|
|
65692
65704
|
var gif = _a.gif, isHovered = _a.isHovered, onClick = _a.onClick;
|
|
65693
|
-
var hasHovered = react_1$
|
|
65705
|
+
var hasHovered = react_1$t.useRef(isHovered);
|
|
65694
65706
|
if (isHovered) {
|
|
65695
65707
|
// not rendering to avoid loading the avatar until hover
|
|
65696
65708
|
hasHovered.current = true;
|
|
65697
65709
|
}
|
|
65698
|
-
return gif.user && hasHovered.current ? (react_1$
|
|
65699
|
-
react_1$
|
|
65700
|
-
react_1$
|
|
65710
|
+
return gif.user && hasHovered.current ? (react_1$t.default.createElement(Container$a, { style: { opacity: isHovered ? 1 : 0 } },
|
|
65711
|
+
react_1$t.default.createElement(Background, null),
|
|
65712
|
+
react_1$t.default.createElement(Attribution$1, { gif: gif, onClick: onClick }))) : null;
|
|
65701
65713
|
};
|
|
65702
65714
|
overlay.default = AttributionOverlay;
|
|
65703
65715
|
var templateObject_1$2F, templateObject_2$1N, templateObject_3$1f;
|
|
@@ -67652,7 +67664,7 @@ var stringify = stringify_1;
|
|
|
67652
67664
|
var parse = parse$1;
|
|
67653
67665
|
var formats = formats$3;
|
|
67654
67666
|
|
|
67655
|
-
var lib$
|
|
67667
|
+
var lib$3 = {
|
|
67656
67668
|
formats: formats,
|
|
67657
67669
|
parse: parse,
|
|
67658
67670
|
stringify: stringify
|
|
@@ -67920,7 +67932,7 @@ Object.defineProperty(api, "__esModule", { value: true });
|
|
|
67920
67932
|
api.GiphyFetch = void 0;
|
|
67921
67933
|
/* eslint-disable no-dupe-class-members */
|
|
67922
67934
|
var js_util_1$8 = dist$3;
|
|
67923
|
-
var qs_1 = __importDefault$i(lib$
|
|
67935
|
+
var qs_1 = __importDefault$i(lib$3);
|
|
67924
67936
|
var gif_1$2 = gif$1;
|
|
67925
67937
|
var request_1 = __importDefault$i(request);
|
|
67926
67938
|
var getType = function (options) { return (options && options.type ? options.type : 'gifs'); };
|
|
@@ -68419,11 +68431,11 @@ var __importStar$b = (commonjsGlobal$7 && commonjsGlobal$7.__importStar) || func
|
|
|
68419
68431
|
return result;
|
|
68420
68432
|
};
|
|
68421
68433
|
Object.defineProperty(observer, "__esModule", { value: true });
|
|
68422
|
-
var react_1$
|
|
68434
|
+
var react_1$s = __importStar$b(React__default);
|
|
68423
68435
|
var Observer$1 = function (_a) {
|
|
68424
68436
|
var children = _a.children, className = _a.className, onVisibleChange = _a.onVisibleChange, config = _a.config;
|
|
68425
|
-
var container = react_1$
|
|
68426
|
-
react_1$
|
|
68437
|
+
var container = react_1$s.useRef(null);
|
|
68438
|
+
react_1$s.useEffect(function () {
|
|
68427
68439
|
var io;
|
|
68428
68440
|
if (container.current) {
|
|
68429
68441
|
io = new IntersectionObserver(function (_a) {
|
|
@@ -68435,7 +68447,7 @@ var Observer$1 = function (_a) {
|
|
|
68435
68447
|
}
|
|
68436
68448
|
return function () { return io === null || io === void 0 ? void 0 : io.disconnect(); };
|
|
68437
68449
|
}, [onVisibleChange, container, config]);
|
|
68438
|
-
return (react_1$
|
|
68450
|
+
return (react_1$s.default.createElement("div", { ref: container, className: className }, children));
|
|
68439
68451
|
};
|
|
68440
68452
|
observer.default = Observer$1;
|
|
68441
68453
|
|
|
@@ -68961,7 +68973,7 @@ Object.defineProperty(carousel, "__esModule", { value: true });
|
|
|
68961
68973
|
var styled_1$8 = __importDefault$f(require$$0$4);
|
|
68962
68974
|
var js_fetch_api_1$1 = dist$1;
|
|
68963
68975
|
var js_util_1$3 = dist$3;
|
|
68964
|
-
var react_1$
|
|
68976
|
+
var react_1$r = __importStar$a(React__default);
|
|
68965
68977
|
var throttle_debounce_1$1 = cjs;
|
|
68966
68978
|
var observer_1$1 = __importDefault$f(observer);
|
|
68967
68979
|
var gif_1$1 = __importDefault$f(gif);
|
|
@@ -69042,20 +69054,20 @@ var Carousel$1 = /** @class */ (function (_super) {
|
|
|
69042
69054
|
var _d = this.state, gifs = _d.gifs, isDoneFetching = _d.isDoneFetching;
|
|
69043
69055
|
var showLoader = !isDoneFetching;
|
|
69044
69056
|
var isFirstLoad = gifs.length === 0;
|
|
69045
|
-
return (react_1$
|
|
69046
|
-
react_1$
|
|
69057
|
+
return (react_1$r.default.createElement(pingback_context_manager_1$1.default, { attributes: { layout_type: 'CAROUSEL' } },
|
|
69058
|
+
react_1$r.default.createElement(Container$9, { className: className },
|
|
69047
69059
|
gifs.map(function (gif) {
|
|
69048
69060
|
var gifWidth = js_util_1$3.getGifWidth(gif, gifHeight);
|
|
69049
|
-
return (react_1$
|
|
69061
|
+
return (react_1$r.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 }));
|
|
69050
69062
|
}),
|
|
69051
69063
|
!showLoader && gifs.length === 0 && noResultsMessage,
|
|
69052
|
-
showLoader && (react_1$
|
|
69053
|
-
react_1$
|
|
69064
|
+
showLoader && (react_1$r.default.createElement(Observer, { onVisibleChange: this.onLoaderVisible, config: loaderConfig },
|
|
69065
|
+
react_1$r.default.createElement(Loader$2, { isFirstLoad: isFirstLoad, height: gifHeight }))))));
|
|
69054
69066
|
};
|
|
69055
69067
|
Carousel.className = 'giphy-carousel';
|
|
69056
69068
|
Carousel.defaultProps = defaultProps$1;
|
|
69057
69069
|
return Carousel;
|
|
69058
|
-
}(react_1$
|
|
69070
|
+
}(react_1$r.PureComponent));
|
|
69059
69071
|
carousel.default = Carousel$1;
|
|
69060
69072
|
var templateObject_1$2E, templateObject_2$1M, templateObject_3$1e, templateObject_4$Q;
|
|
69061
69073
|
|
|
@@ -69073,13 +69085,13 @@ var __importDefault$e = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69073
69085
|
Object.defineProperty(fetchError, "__esModule", { value: true });
|
|
69074
69086
|
var styled_1$7 = __importDefault$e(require$$0$4);
|
|
69075
69087
|
var js_brand_1$5 = dist$2;
|
|
69076
|
-
var react_1$
|
|
69088
|
+
var react_1$q = __importDefault$e(React__default);
|
|
69077
69089
|
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);
|
|
69078
69090
|
var FetchError = function (_a) {
|
|
69079
69091
|
var onClick = _a.onClick;
|
|
69080
|
-
return (react_1$
|
|
69092
|
+
return (react_1$q.default.createElement(Message$1, null,
|
|
69081
69093
|
"Error loading GIFs.\u00A0",
|
|
69082
|
-
react_1$
|
|
69094
|
+
react_1$q.default.createElement("a", { onClick: onClick }, "Try again?")));
|
|
69083
69095
|
};
|
|
69084
69096
|
fetchError.default = FetchError;
|
|
69085
69097
|
var templateObject_1$2D;
|
|
@@ -69097,19 +69109,19 @@ Object.defineProperty(loader, "__esModule", { value: true });
|
|
|
69097
69109
|
var core_1$4 = require$$0$1;
|
|
69098
69110
|
var styled_1$6 = __importDefault$d(require$$0$4);
|
|
69099
69111
|
var js_brand_1$4 = dist$2;
|
|
69100
|
-
var react_1$
|
|
69112
|
+
var react_1$p = __importDefault$d(React__default);
|
|
69101
69113
|
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"])));
|
|
69102
69114
|
var loaderHeight = 37;
|
|
69103
69115
|
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);
|
|
69104
69116
|
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; });
|
|
69105
69117
|
loader.default = (function (_a) {
|
|
69106
69118
|
var _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
69107
|
-
return (react_1$
|
|
69108
|
-
react_1$
|
|
69109
|
-
react_1$
|
|
69110
|
-
react_1$
|
|
69111
|
-
react_1$
|
|
69112
|
-
react_1$
|
|
69119
|
+
return (react_1$p.default.createElement(Loader$1, { className: className },
|
|
69120
|
+
react_1$p.default.createElement(Dot, { color: js_brand_1$4.giphyGreen, delay: "0" }),
|
|
69121
|
+
react_1$p.default.createElement(Dot, { color: js_brand_1$4.giphyBlue, delay: ".1s" }),
|
|
69122
|
+
react_1$p.default.createElement(Dot, { color: js_brand_1$4.giphyPurple, delay: ".2s" }),
|
|
69123
|
+
react_1$p.default.createElement(Dot, { color: js_brand_1$4.giphyRed, delay: ".3s" }),
|
|
69124
|
+
react_1$p.default.createElement(Dot, { color: js_brand_1$4.giphyYellow, delay: ".4s" })));
|
|
69113
69125
|
});
|
|
69114
69126
|
var templateObject_1$2C, templateObject_2$1L, templateObject_3$1d;
|
|
69115
69127
|
|
|
@@ -69135,7 +69147,7 @@ var __importStar$9 = (commonjsGlobal$7 && commonjsGlobal$7.__importStar) || func
|
|
|
69135
69147
|
return result;
|
|
69136
69148
|
};
|
|
69137
69149
|
Object.defineProperty(masonryGrid, "__esModule", { value: true });
|
|
69138
|
-
var react_1$
|
|
69150
|
+
var react_1$o = __importStar$9(React__default);
|
|
69139
69151
|
function fillArray(length, columnOffsets) {
|
|
69140
69152
|
if (columnOffsets === void 0) { columnOffsets = []; }
|
|
69141
69153
|
return Array.apply(null, Array(length)).map(function (_, index) { return columnOffsets[index] || 0; });
|
|
@@ -69146,7 +69158,7 @@ var MasonryGrid = function (_a) {
|
|
|
69146
69158
|
function getChildren() {
|
|
69147
69159
|
var columnTarget;
|
|
69148
69160
|
var columnHeights = fillArray(columns, columnOffsets);
|
|
69149
|
-
var result = react_1$
|
|
69161
|
+
var result = react_1$o.default.Children.map(children, function (child, index) {
|
|
69150
69162
|
var style = {
|
|
69151
69163
|
position: 'absolute',
|
|
69152
69164
|
};
|
|
@@ -69165,16 +69177,16 @@ var MasonryGrid = function (_a) {
|
|
|
69165
69177
|
if (height) {
|
|
69166
69178
|
columnHeights[columnTarget] += height + gutter;
|
|
69167
69179
|
}
|
|
69168
|
-
return react_1$
|
|
69180
|
+
return react_1$o.default.cloneElement(child, { style: style });
|
|
69169
69181
|
});
|
|
69170
69182
|
containerStyle.position = 'relative';
|
|
69171
69183
|
containerStyle.width = columns * itemWidth + (columns - 1) * gutter + "px";
|
|
69172
69184
|
containerStyle.height = Math.max.apply(Math, columnHeights) - gutter + "px";
|
|
69173
69185
|
return result;
|
|
69174
69186
|
}
|
|
69175
|
-
return react_1$
|
|
69187
|
+
return react_1$o.default.createElement("div", { style: containerStyle }, getChildren());
|
|
69176
69188
|
};
|
|
69177
|
-
masonryGrid.default = react_1$
|
|
69189
|
+
masonryGrid.default = react_1$o.memo(MasonryGrid);
|
|
69178
69190
|
|
|
69179
69191
|
var __makeTemplateObject$c = (commonjsGlobal$7 && commonjsGlobal$7.__makeTemplateObject) || function (cooked, raw) {
|
|
69180
69192
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
@@ -69268,7 +69280,7 @@ Object.defineProperty(grid, "__esModule", { value: true });
|
|
|
69268
69280
|
var styled_1$5 = __importDefault$c(require$$0$4);
|
|
69269
69281
|
var js_fetch_api_1 = dist$1;
|
|
69270
69282
|
var js_util_1$2 = dist$3;
|
|
69271
|
-
var react_1$
|
|
69283
|
+
var react_1$n = __importStar$8(React__default);
|
|
69272
69284
|
var throttle_debounce_1 = cjs;
|
|
69273
69285
|
var observer_1 = __importDefault$c(observer);
|
|
69274
69286
|
var fetch_error_1 = __importDefault$c(fetchError);
|
|
@@ -69358,13 +69370,13 @@ var Grid$1 = /** @class */ (function (_super) {
|
|
|
69358
69370
|
var isFirstLoad = gifs.length === 0;
|
|
69359
69371
|
// get the height of each grid item
|
|
69360
69372
|
var itemHeights = gifs.map(function (gif) { return js_util_1$2.getGifHeight(gif, gifWidth); });
|
|
69361
|
-
return (react_1$
|
|
69362
|
-
react_1$
|
|
69363
|
-
react_1$
|
|
69373
|
+
return (react_1$n.default.createElement(pingback_context_manager_1.default, { attributes: { layout_type: layoutType } },
|
|
69374
|
+
react_1$n.default.createElement("div", { className: className, style: { width: width } },
|
|
69375
|
+
react_1$n.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$n.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 })); })),
|
|
69364
69376
|
!showLoader && gifs.length === 0 && noResultsMessage,
|
|
69365
|
-
isError ? (react_1$
|
|
69366
|
-
react_1$
|
|
69367
|
-
react_1$
|
|
69377
|
+
isError ? (react_1$n.default.createElement(fetch_error_1.default, { onClick: this.onFetch })) : (showLoader && (react_1$n.default.createElement(observer_1.default, { onVisibleChange: this.onLoaderVisible, config: loaderConfig },
|
|
69378
|
+
react_1$n.default.createElement(Loader, { isFirstLoad: isFirstLoad },
|
|
69379
|
+
react_1$n.default.createElement(LoaderVisual, { className: Grid.loaderClassName }))))))));
|
|
69368
69380
|
};
|
|
69369
69381
|
Grid.className = 'giphy-grid';
|
|
69370
69382
|
Grid.loaderClassName = 'loader';
|
|
@@ -69380,27 +69392,27 @@ var Grid$1 = /** @class */ (function (_super) {
|
|
|
69380
69392
|
return null;
|
|
69381
69393
|
};
|
|
69382
69394
|
return Grid;
|
|
69383
|
-
}(react_1$
|
|
69395
|
+
}(react_1$n.PureComponent));
|
|
69384
69396
|
grid.default = Grid$1;
|
|
69385
69397
|
var templateObject_1$2B;
|
|
69386
69398
|
|
|
69387
69399
|
var searchBar = {};
|
|
69388
69400
|
|
|
69389
|
-
var useDebounce$
|
|
69401
|
+
var useDebounce$5 = {};
|
|
69390
69402
|
|
|
69391
69403
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(_tslib);
|
|
69392
69404
|
|
|
69393
69405
|
var useTimeoutFn$2 = {};
|
|
69394
69406
|
|
|
69395
69407
|
Object.defineProperty(useTimeoutFn$2, "__esModule", { value: true });
|
|
69396
|
-
var react_1$
|
|
69408
|
+
var react_1$m = React__default;
|
|
69397
69409
|
function useTimeoutFn$1(fn, ms) {
|
|
69398
69410
|
if (ms === void 0) { ms = 0; }
|
|
69399
|
-
var ready = react_1$
|
|
69400
|
-
var timeout = react_1$
|
|
69401
|
-
var callback = react_1$
|
|
69402
|
-
var isReady = react_1$
|
|
69403
|
-
var set = react_1$
|
|
69411
|
+
var ready = react_1$m.useRef(false);
|
|
69412
|
+
var timeout = react_1$m.useRef();
|
|
69413
|
+
var callback = react_1$m.useRef(fn);
|
|
69414
|
+
var isReady = react_1$m.useCallback(function () { return ready.current; }, []);
|
|
69415
|
+
var set = react_1$m.useCallback(function () {
|
|
69404
69416
|
ready.current = false;
|
|
69405
69417
|
timeout.current && clearTimeout(timeout.current);
|
|
69406
69418
|
timeout.current = setTimeout(function () {
|
|
@@ -69408,16 +69420,16 @@ function useTimeoutFn$1(fn, ms) {
|
|
|
69408
69420
|
callback.current();
|
|
69409
69421
|
}, ms);
|
|
69410
69422
|
}, [ms]);
|
|
69411
|
-
var clear = react_1$
|
|
69423
|
+
var clear = react_1$m.useCallback(function () {
|
|
69412
69424
|
ready.current = null;
|
|
69413
69425
|
timeout.current && clearTimeout(timeout.current);
|
|
69414
69426
|
}, []);
|
|
69415
69427
|
// update ref when function changes
|
|
69416
|
-
react_1$
|
|
69428
|
+
react_1$m.useEffect(function () {
|
|
69417
69429
|
callback.current = fn;
|
|
69418
69430
|
}, [fn]);
|
|
69419
69431
|
// set on mount, clear on unmount
|
|
69420
|
-
react_1$
|
|
69432
|
+
react_1$m.useEffect(function () {
|
|
69421
69433
|
set();
|
|
69422
69434
|
return clear;
|
|
69423
69435
|
}, [ms]);
|
|
@@ -69425,18 +69437,18 @@ function useTimeoutFn$1(fn, ms) {
|
|
|
69425
69437
|
}
|
|
69426
69438
|
useTimeoutFn$2.default = useTimeoutFn$1;
|
|
69427
69439
|
|
|
69428
|
-
Object.defineProperty(useDebounce$
|
|
69440
|
+
Object.defineProperty(useDebounce$5, "__esModule", { value: true });
|
|
69429
69441
|
var tslib_1$9 = require$$0;
|
|
69430
|
-
var react_1$
|
|
69442
|
+
var react_1$l = React__default;
|
|
69431
69443
|
var useTimeoutFn_1 = tslib_1$9.__importDefault(useTimeoutFn$2);
|
|
69432
|
-
function useDebounce$
|
|
69444
|
+
function useDebounce$4(fn, ms, deps) {
|
|
69433
69445
|
if (ms === void 0) { ms = 0; }
|
|
69434
69446
|
if (deps === void 0) { deps = []; }
|
|
69435
69447
|
var _a = useTimeoutFn_1.default(fn, ms), isReady = _a[0], cancel = _a[1], reset = _a[2];
|
|
69436
|
-
react_1$
|
|
69448
|
+
react_1$l.useEffect(reset, deps);
|
|
69437
69449
|
return [isReady, cancel];
|
|
69438
69450
|
}
|
|
69439
|
-
useDebounce$
|
|
69451
|
+
useDebounce$5.default = useDebounce$4;
|
|
69440
69452
|
|
|
69441
69453
|
var context = {};
|
|
69442
69454
|
|
|
@@ -69784,7 +69796,7 @@ var __importDefault$a = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69784
69796
|
Object.defineProperty(searchBarChannel, "__esModule", { value: true });
|
|
69785
69797
|
var core_1$2 = require$$0$1;
|
|
69786
69798
|
var js_brand_1$3 = dist$2;
|
|
69787
|
-
var react_1$
|
|
69799
|
+
var react_1$k = __importStar$7(React__default);
|
|
69788
69800
|
var avatar_1$2 = __importDefault$a(avatar);
|
|
69789
69801
|
var verified_badge_1$1 = __importDefault$a(verifiedBadge);
|
|
69790
69802
|
var context_1$4 = context;
|
|
@@ -69798,14 +69810,14 @@ var Username = theme_1$4.default.div(templateObject_3$1b || (templateObject_3$1b
|
|
|
69798
69810
|
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; });
|
|
69799
69811
|
var SearchBarChannel = function (_a) {
|
|
69800
69812
|
var _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
69801
|
-
var activeChannel = react_1$
|
|
69802
|
-
return activeChannel ? (react_1$
|
|
69803
|
-
react_1$
|
|
69804
|
-
react_1$
|
|
69805
|
-
react_1$
|
|
69813
|
+
var activeChannel = react_1$k.useContext(context_1$4.SearchContext).activeChannel;
|
|
69814
|
+
return activeChannel ? (react_1$k.default.createElement(Username, { className: className },
|
|
69815
|
+
react_1$k.default.createElement(Avatar$3, { user: activeChannel.user }),
|
|
69816
|
+
react_1$k.default.createElement(UsernamePill, { key: activeChannel.id },
|
|
69817
|
+
react_1$k.default.createElement("div", null,
|
|
69806
69818
|
"@",
|
|
69807
69819
|
activeChannel.user.username),
|
|
69808
|
-
activeChannel.user.is_verified && react_1$
|
|
69820
|
+
activeChannel.user.is_verified && react_1$k.default.createElement(verified_badge_1$1.default, { size: 14 })))) : null;
|
|
69809
69821
|
};
|
|
69810
69822
|
searchBarChannel.default = SearchBarChannel;
|
|
69811
69823
|
var templateObject_1$2z, templateObject_2$1J, templateObject_3$1b, templateObject_4$P;
|
|
@@ -69819,18 +69831,18 @@ var useUnmount$3 = {};
|
|
|
69819
69831
|
var useEffectOnce$3 = {};
|
|
69820
69832
|
|
|
69821
69833
|
Object.defineProperty(useEffectOnce$3, "__esModule", { value: true });
|
|
69822
|
-
var react_1$
|
|
69834
|
+
var react_1$j = React__default;
|
|
69823
69835
|
var useEffectOnce$2 = function (effect) {
|
|
69824
|
-
react_1$
|
|
69836
|
+
react_1$j.useEffect(effect, []);
|
|
69825
69837
|
};
|
|
69826
69838
|
useEffectOnce$3.default = useEffectOnce$2;
|
|
69827
69839
|
|
|
69828
69840
|
Object.defineProperty(useUnmount$3, "__esModule", { value: true });
|
|
69829
69841
|
var tslib_1$8 = require$$0;
|
|
69830
|
-
var react_1$
|
|
69842
|
+
var react_1$i = React__default;
|
|
69831
69843
|
var useEffectOnce_1 = tslib_1$8.__importDefault(useEffectOnce$3);
|
|
69832
69844
|
var useUnmount$2 = function (fn) {
|
|
69833
|
-
var fnRef = react_1$
|
|
69845
|
+
var fnRef = react_1$i.useRef(fn);
|
|
69834
69846
|
// update the ref each render so if it change the newest callback will be invoked
|
|
69835
69847
|
fnRef.current = fn;
|
|
69836
69848
|
useEffectOnce_1.default(function () { return function () { return fnRef.current(); }; });
|
|
@@ -69839,15 +69851,15 @@ useUnmount$3.default = useUnmount$2;
|
|
|
69839
69851
|
|
|
69840
69852
|
Object.defineProperty(useThrottle$3, "__esModule", { value: true });
|
|
69841
69853
|
var tslib_1$7 = require$$0;
|
|
69842
|
-
var react_1$
|
|
69854
|
+
var react_1$h = React__default;
|
|
69843
69855
|
var useUnmount_1 = tslib_1$7.__importDefault(useUnmount$3);
|
|
69844
69856
|
var useThrottle$2 = function (value, ms) {
|
|
69845
69857
|
if (ms === void 0) { ms = 200; }
|
|
69846
|
-
var _a = react_1$
|
|
69847
|
-
var timeout = react_1$
|
|
69848
|
-
var nextValue = react_1$
|
|
69849
|
-
var hasNextValue = react_1$
|
|
69850
|
-
react_1$
|
|
69858
|
+
var _a = react_1$h.useState(value), state = _a[0], setState = _a[1];
|
|
69859
|
+
var timeout = react_1$h.useRef();
|
|
69860
|
+
var nextValue = react_1$h.useRef(null);
|
|
69861
|
+
var hasNextValue = react_1$h.useRef(0);
|
|
69862
|
+
react_1$h.useEffect(function () {
|
|
69851
69863
|
if (!timeout.current) {
|
|
69852
69864
|
setState(value);
|
|
69853
69865
|
var timeoutCallback_1 = function () {
|
|
@@ -69880,20 +69892,20 @@ var __importDefault$9 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69880
69892
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
69881
69893
|
};
|
|
69882
69894
|
Object.defineProperty(searchIcon, "__esModule", { value: true });
|
|
69883
|
-
var react_1$
|
|
69895
|
+
var react_1$g = __importDefault$9(React__default);
|
|
69884
69896
|
var SearchIcon$1 = function (_a) {
|
|
69885
69897
|
var _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
69886
|
-
return (react_1$
|
|
69887
|
-
react_1$
|
|
69888
|
-
react_1$
|
|
69889
|
-
react_1$
|
|
69890
|
-
react_1$
|
|
69891
|
-
react_1$
|
|
69892
|
-
react_1$
|
|
69893
|
-
react_1$
|
|
69894
|
-
react_1$
|
|
69895
|
-
react_1$
|
|
69896
|
-
react_1$
|
|
69898
|
+
return (react_1$g.default.createElement("svg", { viewBox: "0 0 30 30", version: "1.1", className: className },
|
|
69899
|
+
react_1$g.default.createElement("defs", null,
|
|
69900
|
+
react_1$g.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" })),
|
|
69901
|
+
react_1$g.default.createElement("g", { id: "search", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" },
|
|
69902
|
+
react_1$g.default.createElement("g", { id: "icons/search" },
|
|
69903
|
+
react_1$g.default.createElement("mask", { id: "giphy-search-icon-mask-2", fill: "white" },
|
|
69904
|
+
react_1$g.default.createElement("use", { xlinkHref: "#giphy-search-icon-path-1" })),
|
|
69905
|
+
react_1$g.default.createElement("use", { id: "Mask", fill: "#FFFFFF", fillRule: "nonzero", xlinkHref: "#giphy-search-icon-path-1" }),
|
|
69906
|
+
react_1$g.default.createElement("g", { mask: "url(#giphy-search-icon-mask-2)" },
|
|
69907
|
+
react_1$g.default.createElement("g", { transform: "translate(0.250000, 0.250000)" },
|
|
69908
|
+
react_1$g.default.createElement("g", null)))))));
|
|
69897
69909
|
};
|
|
69898
69910
|
searchIcon.default = SearchIcon$1;
|
|
69899
69911
|
|
|
@@ -69925,7 +69937,7 @@ var __importDefault$8 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69925
69937
|
};
|
|
69926
69938
|
Object.defineProperty(searchButton, "__esModule", { value: true });
|
|
69927
69939
|
var core_1$1 = require$$0$1;
|
|
69928
|
-
var react_1$
|
|
69940
|
+
var react_1$f = __importStar$6(React__default);
|
|
69929
69941
|
var useThrottle_1 = __importDefault$8(useThrottle$3);
|
|
69930
69942
|
var context_1$3 = context;
|
|
69931
69943
|
var search_icon_1 = __importDefault$8(searchIcon);
|
|
@@ -69943,14 +69955,14 @@ var Fx = theme_1$3.default.div(templateObject_6$v || (templateObject_6$v = __mak
|
|
|
69943
69955
|
var Scanner = theme_1$3.default.div(templateObject_7$o || (templateObject_7$o = __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);
|
|
69944
69956
|
var SearchIcon = theme_1$3.default(search_icon_1.default)(templateObject_8$m || (templateObject_8$m = __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"])));
|
|
69945
69957
|
var SearchButton = function () {
|
|
69946
|
-
var isFetching = react_1$
|
|
69958
|
+
var isFetching = react_1$f.useContext(context_1$3.SearchContext).isFetching;
|
|
69947
69959
|
// let the animation run by throttling isFetching
|
|
69948
69960
|
var throttledFetch = useThrottle_1.default(isFetching, 1000);
|
|
69949
|
-
return (react_1$
|
|
69950
|
-
react_1$
|
|
69951
|
-
react_1$
|
|
69952
|
-
throttledFetch && (react_1$
|
|
69953
|
-
react_1$
|
|
69961
|
+
return (react_1$f.default.createElement(Container$8, null,
|
|
69962
|
+
react_1$f.default.createElement(GradientBox, null),
|
|
69963
|
+
react_1$f.default.createElement(SearchIcon, null),
|
|
69964
|
+
throttledFetch && (react_1$f.default.createElement(Fx, null,
|
|
69965
|
+
react_1$f.default.createElement(Scanner, null)))));
|
|
69954
69966
|
};
|
|
69955
69967
|
searchButton.default = SearchButton;
|
|
69956
69968
|
var templateObject_1$2y, templateObject_2$1I, templateObject_3$1a, templateObject_4$O, templateObject_5$G, templateObject_6$v, templateObject_7$o, templateObject_8$m;
|
|
@@ -69984,15 +69996,15 @@ var __importDefault$7 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
69984
69996
|
Object.defineProperty(searchBar, "__esModule", { value: true });
|
|
69985
69997
|
var core_1 = require$$0$1;
|
|
69986
69998
|
var js_brand_1$2 = dist$2;
|
|
69987
|
-
var react_1$
|
|
69988
|
-
var useDebounce_1 = __importDefault$7(useDebounce$
|
|
69999
|
+
var react_1$e = __importStar$5(React__default);
|
|
70000
|
+
var useDebounce_1$1 = __importDefault$7(useDebounce$5);
|
|
69989
70001
|
var context_1$2 = context;
|
|
69990
70002
|
var search_bar_channel_1 = __importDefault$7(searchBarChannel);
|
|
69991
70003
|
var search_button_1 = __importDefault$7(searchButton);
|
|
69992
70004
|
var theme_1$2 = __importStar$5(theme);
|
|
69993
70005
|
function usePrevious$1(value) {
|
|
69994
|
-
var ref = react_1$
|
|
69995
|
-
react_1$
|
|
70006
|
+
var ref = react_1$e.useRef(value);
|
|
70007
|
+
react_1$e.useEffect(function () {
|
|
69996
70008
|
ref.current = value;
|
|
69997
70009
|
});
|
|
69998
70010
|
return ref.current;
|
|
@@ -70004,24 +70016,24 @@ var Input = theme_1$2.default.input(templateObject_3$19 || (templateObject_3$19
|
|
|
70004
70016
|
});
|
|
70005
70017
|
var SearchBar = function (_a) {
|
|
70006
70018
|
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;
|
|
70007
|
-
var _d = react_1$
|
|
70019
|
+
var _d = react_1$e.useContext(context_1$2.SearchContext), setSearch = _d.setSearch, activeChannel = _d.activeChannel, setActiveChannel = _d.setActiveChannel, term = _d.term, channelSearch = _d.channelSearch;
|
|
70008
70020
|
// debounce local input
|
|
70009
|
-
var _e = react_1$
|
|
70021
|
+
var _e = react_1$e.useState(term), debouncedTerm = _e[0], setDebouncedInput = _e[1];
|
|
70010
70022
|
// used to see if the last term was a '' before clearing
|
|
70011
70023
|
var lastTerm = usePrevious$1(debouncedTerm);
|
|
70012
70024
|
// set the term when it changes
|
|
70013
|
-
useDebounce_1.default(function () { return setSearch(debouncedTerm); }, SEARCH_DEBOUNCE, [debouncedTerm]);
|
|
70025
|
+
useDebounce_1$1.default(function () { return setSearch(debouncedTerm); }, SEARCH_DEBOUNCE, [debouncedTerm]);
|
|
70014
70026
|
// used only to focus the input
|
|
70015
|
-
var inputRef = react_1$
|
|
70027
|
+
var inputRef = react_1$e.useRef(null);
|
|
70016
70028
|
// we'll use this to see when we went from no channel to channel
|
|
70017
70029
|
var previousActiveChannel = usePrevious$1(activeChannel);
|
|
70018
|
-
react_1$
|
|
70030
|
+
react_1$e.useEffect(function () {
|
|
70019
70031
|
var _a;
|
|
70020
70032
|
if (autoFocus) {
|
|
70021
70033
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
70022
70034
|
}
|
|
70023
70035
|
}, [autoFocus]);
|
|
70024
|
-
react_1$
|
|
70036
|
+
react_1$e.useEffect(function () {
|
|
70025
70037
|
var _a;
|
|
70026
70038
|
// if we know have a channel, focus and clear the input
|
|
70027
70039
|
// so the user can search the channel
|
|
@@ -70031,11 +70043,11 @@ var SearchBar = function (_a) {
|
|
|
70031
70043
|
}
|
|
70032
70044
|
}, [debouncedTerm, activeChannel, previousActiveChannel]);
|
|
70033
70045
|
// a pill could have been clicked, update our local term state
|
|
70034
|
-
react_1$
|
|
70046
|
+
react_1$e.useEffect(function () {
|
|
70035
70047
|
setDebouncedInput(term);
|
|
70036
70048
|
}, [term]);
|
|
70037
|
-
var _f = react_1$
|
|
70038
|
-
react_1$
|
|
70049
|
+
var _f = react_1$e.useState(clear), isCleared = _f[0], setCleared = _f[1];
|
|
70050
|
+
react_1$e.useEffect(function () {
|
|
70039
70051
|
setCleared(clear);
|
|
70040
70052
|
}, [clear]);
|
|
70041
70053
|
// key ups to clear the active channel
|
|
@@ -70054,16 +70066,16 @@ var SearchBar = function (_a) {
|
|
|
70054
70066
|
break;
|
|
70055
70067
|
}
|
|
70056
70068
|
};
|
|
70057
|
-
return (react_1$
|
|
70058
|
-
react_1$
|
|
70059
|
-
react_1$
|
|
70069
|
+
return (react_1$e.default.createElement(Container$7, { className: [SearchBar.className, className].join(' ') },
|
|
70070
|
+
react_1$e.default.createElement(search_bar_channel_1.default, null),
|
|
70071
|
+
react_1$e.default.createElement(Input, { isUsernameSearch: !!channelSearch, onChange: function (_a) {
|
|
70060
70072
|
var value = _a.target.value;
|
|
70061
70073
|
if (!isCleared || value !== '') {
|
|
70062
70074
|
setCleared(false);
|
|
70063
70075
|
setDebouncedInput(value);
|
|
70064
70076
|
}
|
|
70065
70077
|
}, value: isCleared ? '' : debouncedTerm, placeholder: activeChannel ? "Search " + activeChannel.display_name : placeholder, autoCapitalize: "off", autoCorrect: "off", autoComplete: "off", ref: inputRef, onKeyUp: onKeyUp }),
|
|
70066
|
-
react_1$
|
|
70078
|
+
react_1$e.default.createElement(search_button_1.default, null)));
|
|
70067
70079
|
};
|
|
70068
70080
|
SearchBar.className = 'giphy-search-bar';
|
|
70069
70081
|
searchBar.default = SearchBar;
|
|
@@ -70079,14 +70091,14 @@ var __importDefault$6 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
70079
70091
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
70080
70092
|
};
|
|
70081
70093
|
Object.defineProperty(trendingIcon, "__esModule", { value: true });
|
|
70082
|
-
var react_1$
|
|
70094
|
+
var react_1$d = __importDefault$6(React__default);
|
|
70083
70095
|
var TrendingIcon$1 = function (_a) {
|
|
70084
70096
|
var _b = _a.size, size = _b === void 0 ? 18 : _b, className = _a.className;
|
|
70085
|
-
return (react_1$
|
|
70086
|
-
react_1$
|
|
70087
|
-
react_1$
|
|
70088
|
-
react_1$
|
|
70089
|
-
react_1$
|
|
70097
|
+
return (react_1$d.default.createElement("svg", { width: size, height: size, viewBox: "0 0 18 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", className: className },
|
|
70098
|
+
react_1$d.default.createElement("g", { id: "trending", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" },
|
|
70099
|
+
react_1$d.default.createElement("g", null,
|
|
70100
|
+
react_1$d.default.createElement("rect", { id: "Rectangle", stroke: "#979797", fill: "#D8D8D8", opacity: "0", x: "0.5", y: "0.5", width: "17", height: "17" }),
|
|
70101
|
+
react_1$d.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) " })))));
|
|
70090
70102
|
};
|
|
70091
70103
|
trendingIcon.default = TrendingIcon$1;
|
|
70092
70104
|
|
|
@@ -70119,7 +70131,7 @@ var __importDefault$5 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
70119
70131
|
Object.defineProperty(pills, "__esModule", { value: true });
|
|
70120
70132
|
pills.TrendingSearchPill = pills.ChannelPill = void 0;
|
|
70121
70133
|
var js_brand_1$1 = dist$2;
|
|
70122
|
-
var react_1$
|
|
70134
|
+
var react_1$c = __importStar$4(React__default);
|
|
70123
70135
|
var avatar_1$1 = __importDefault$5(avatar);
|
|
70124
70136
|
var verified_badge_1 = __importDefault$5(verifiedBadge);
|
|
70125
70137
|
var context_1$1 = context;
|
|
@@ -70132,20 +70144,20 @@ var Avatar$2 = theme_1$1.default(avatar_1$1.default)(templateObject_3$18 || (tem
|
|
|
70132
70144
|
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"])));
|
|
70133
70145
|
var ChannelPill = function (_a) {
|
|
70134
70146
|
var channel = _a.channel;
|
|
70135
|
-
var setActiveChannel = react_1$
|
|
70136
|
-
return (react_1$
|
|
70137
|
-
react_1$
|
|
70138
|
-
react_1$
|
|
70147
|
+
var setActiveChannel = react_1$c.useContext(context_1$1.SearchContext).setActiveChannel;
|
|
70148
|
+
return (react_1$c.default.createElement(ChannelPillContainer, { key: channel.id, onClick: function () { return setActiveChannel(channel); } },
|
|
70149
|
+
react_1$c.default.createElement(Avatar$2, { user: channel.user }),
|
|
70150
|
+
react_1$c.default.createElement("div", null,
|
|
70139
70151
|
"@",
|
|
70140
70152
|
channel.user.username),
|
|
70141
|
-
channel.user.is_verified && react_1$
|
|
70153
|
+
channel.user.is_verified && react_1$c.default.createElement(verified_badge_1.default, { size: 14 })));
|
|
70142
70154
|
};
|
|
70143
70155
|
pills.ChannelPill = ChannelPill;
|
|
70144
70156
|
var TrendingSearchPill = function (_a) {
|
|
70145
70157
|
var trendingSearch = _a.trendingSearch;
|
|
70146
|
-
var setSearch = react_1$
|
|
70147
|
-
return (react_1$
|
|
70148
|
-
react_1$
|
|
70158
|
+
var setSearch = react_1$c.useContext(context_1$1.SearchContext).setSearch;
|
|
70159
|
+
return (react_1$c.default.createElement(TrendingSearchPillContainer, { key: trendingSearch, onClick: function () { return setSearch(trendingSearch); } },
|
|
70160
|
+
react_1$c.default.createElement(TrendingIcon, { size: 16 }),
|
|
70149
70161
|
trendingSearch));
|
|
70150
70162
|
};
|
|
70151
70163
|
pills.TrendingSearchPill = TrendingSearchPill;
|
|
@@ -70211,15 +70223,15 @@ var __generator$3 = (commonjsGlobal$7 && commonjsGlobal$7.__generator) || functi
|
|
|
70211
70223
|
}
|
|
70212
70224
|
};
|
|
70213
70225
|
Object.defineProperty(suggestionBar, "__esModule", { value: true });
|
|
70214
|
-
var react_1$
|
|
70226
|
+
var react_1$b = __importStar$3(React__default);
|
|
70215
70227
|
var context_1 = context;
|
|
70216
70228
|
var theme_1 = __importStar$3(theme);
|
|
70217
70229
|
var pills_1 = pills;
|
|
70218
70230
|
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); });
|
|
70219
70231
|
var SuggestionBar = function () {
|
|
70220
|
-
var _a = react_1$
|
|
70221
|
-
var _b = react_1$
|
|
70222
|
-
react_1$
|
|
70232
|
+
var _a = react_1$b.useContext(context_1.SearchContext), channelSearch = _a.channelSearch, fetchChannelSearch = _a.fetchChannelSearch, trendingSearches = _a.trendingSearches, activeChannel = _a.activeChannel;
|
|
70233
|
+
var _b = react_1$b.useState([]), channels = _b[0], setChannels = _b[1];
|
|
70234
|
+
react_1$b.useEffect(function () {
|
|
70223
70235
|
var fetchChannels = function () { return __awaiter$3(void 0, void 0, void 0, function () {
|
|
70224
70236
|
var channels;
|
|
70225
70237
|
return __generator$3(this, function (_a) {
|
|
@@ -70240,9 +70252,9 @@ var SuggestionBar = function () {
|
|
|
70240
70252
|
setChannels([]);
|
|
70241
70253
|
}
|
|
70242
70254
|
}, [channelSearch, activeChannel, fetchChannelSearch]);
|
|
70243
|
-
return (react_1$
|
|
70244
|
-
? channels.map(function (channel) { return react_1$
|
|
70245
|
-
: trendingSearches.map(function (trendingSearch) { return (react_1$
|
|
70255
|
+
return (react_1$b.default.createElement(Container$6, null, channels.length > 0
|
|
70256
|
+
? channels.map(function (channel) { return react_1$b.default.createElement(pills_1.ChannelPill, { key: channel.id, channel: channel }); })
|
|
70257
|
+
: trendingSearches.map(function (trendingSearch) { return (react_1$b.default.createElement(pills_1.TrendingSearchPill, { key: trendingSearch, trendingSearch: trendingSearch })); })));
|
|
70246
70258
|
};
|
|
70247
70259
|
suggestionBar.default = SuggestionBar;
|
|
70248
70260
|
var templateObject_1$2v;
|
|
@@ -71714,7 +71726,7 @@ function useTimeoutFn(fn, ms) {
|
|
|
71714
71726
|
return [isReady, clear, set];
|
|
71715
71727
|
}
|
|
71716
71728
|
|
|
71717
|
-
function useDebounce$
|
|
71729
|
+
function useDebounce$3(fn, ms, deps) {
|
|
71718
71730
|
if (ms === void 0) { ms = 0; }
|
|
71719
71731
|
if (deps === void 0) { deps = []; }
|
|
71720
71732
|
var _a = useTimeoutFn(fn, ms), isReady = _a[0], cancel = _a[1], reset = _a[2];
|
|
@@ -73625,14 +73637,14 @@ var useSearchParam = function (param) {
|
|
|
73625
73637
|
var useSearchParamServer = function () { return null; };
|
|
73626
73638
|
var useSearchParam$1 = isBrowser ? useSearchParam : useSearchParamServer;
|
|
73627
73639
|
|
|
73628
|
-
var lib$
|
|
73640
|
+
var lib$2 = {};
|
|
73629
73641
|
|
|
73630
73642
|
var render$1 = {};
|
|
73631
73643
|
|
|
73632
73644
|
Object.defineProperty(render$1, "__esModule", { value: true });
|
|
73633
73645
|
var tslib_1$6 = require$$0;
|
|
73634
|
-
var react_1$
|
|
73635
|
-
var isReact16Plus = parseInt(react_1$
|
|
73646
|
+
var react_1$a = React__default;
|
|
73647
|
+
var isReact16Plus = parseInt(react_1$a.version.substr(0, react_1$a.version.indexOf('.'))) > 15;
|
|
73636
73648
|
var isFn = function (fn) { return typeof fn === 'function'; };
|
|
73637
73649
|
var render = function (props, data) {
|
|
73638
73650
|
var more = [];
|
|
@@ -73659,10 +73671,10 @@ var render = function (props, data) {
|
|
|
73659
73671
|
if (isFn(children))
|
|
73660
73672
|
return children.apply(void 0, tslib_1$6.__spreadArrays([data], more));
|
|
73661
73673
|
if (comp) {
|
|
73662
|
-
return react_1$
|
|
73674
|
+
return react_1$a.createElement(comp, data);
|
|
73663
73675
|
}
|
|
73664
73676
|
if (children instanceof Array)
|
|
73665
|
-
return isReact16Plus ? children : react_1$
|
|
73677
|
+
return isReact16Plus ? children : react_1$a.createElement.apply(void 0, tslib_1$6.__spreadArrays(['div', null], children));
|
|
73666
73678
|
if (children && (children instanceof Object)) {
|
|
73667
73679
|
if (browser$1$1.env.NODE_ENV !== 'production') {
|
|
73668
73680
|
if (!children.type || ((typeof children.type !== 'string') && (typeof children.type !== 'function') && (typeof children.type !== 'symbol'))) {
|
|
@@ -73672,12 +73684,12 @@ var render = function (props, data) {
|
|
|
73672
73684
|
}
|
|
73673
73685
|
if (typeof children.type === 'string')
|
|
73674
73686
|
return children;
|
|
73675
|
-
return react_1$
|
|
73687
|
+
return react_1$a.cloneElement(children, Object.assign({}, children.props, data));
|
|
73676
73688
|
}
|
|
73677
73689
|
else {
|
|
73678
73690
|
if (typeof children.type === 'string')
|
|
73679
73691
|
return children;
|
|
73680
|
-
return react_1$
|
|
73692
|
+
return react_1$a.cloneElement(children, Object.assign({}, children.props, data));
|
|
73681
73693
|
}
|
|
73682
73694
|
}
|
|
73683
73695
|
return children || null;
|
|
@@ -73766,15 +73778,15 @@ var hookToRenderProp = function (hook, mapPropsToArgs) {
|
|
|
73766
73778
|
};
|
|
73767
73779
|
hookToRenderProp$1.default = hookToRenderProp;
|
|
73768
73780
|
|
|
73769
|
-
Object.defineProperty(lib$
|
|
73770
|
-
lib$
|
|
73781
|
+
Object.defineProperty(lib$2, "__esModule", { value: true });
|
|
73782
|
+
lib$2.hookToRenderProp = lib$2.createEnhancer = lib$2.render = void 0;
|
|
73771
73783
|
var tslib_1$1 = require$$0;
|
|
73772
73784
|
var render_1 = tslib_1$1.__importDefault(render$1);
|
|
73773
|
-
lib$
|
|
73785
|
+
lib$2.render = render_1.default;
|
|
73774
73786
|
var createEnhancer_1 = tslib_1$1.__importDefault(createEnhancer$1);
|
|
73775
|
-
lib$
|
|
73787
|
+
lib$2.createEnhancer = createEnhancer_1.default;
|
|
73776
73788
|
var hookToRenderProp_1 = tslib_1$1.__importDefault(hookToRenderProp$1);
|
|
73777
|
-
lib$
|
|
73789
|
+
lib$2.hookToRenderProp = hookToRenderProp_1.default;
|
|
73778
73790
|
|
|
73779
73791
|
var useScratch = function (params) {
|
|
73780
73792
|
if (params === void 0) { params = {}; }
|
|
@@ -74507,10 +74519,10 @@ function useTitle(title, options) {
|
|
|
74507
74519
|
}
|
|
74508
74520
|
var useTitle$1 = typeof document !== 'undefined' ? useTitle : function (_title) { };
|
|
74509
74521
|
|
|
74510
|
-
var lib = {};
|
|
74522
|
+
var lib$1 = {};
|
|
74511
74523
|
|
|
74512
|
-
Object.defineProperty(lib, "__esModule", { value: true });
|
|
74513
|
-
var easing$1 = lib.easing = {
|
|
74524
|
+
Object.defineProperty(lib$1, "__esModule", { value: true });
|
|
74525
|
+
var easing$1 = lib$1.easing = {
|
|
74514
74526
|
// No easing, no acceleration
|
|
74515
74527
|
linear: function (t) { return t; },
|
|
74516
74528
|
// Accelerates fast, then slows quickly towards end.
|
|
@@ -74916,7 +74928,7 @@ var esm = /*#__PURE__*/Object.freeze({
|
|
|
74916
74928
|
useCounter: useCounter,
|
|
74917
74929
|
useCss: useCss$1,
|
|
74918
74930
|
useCustomCompareEffect: useCustomCompareEffect$1,
|
|
74919
|
-
useDebounce: useDebounce$
|
|
74931
|
+
useDebounce: useDebounce$3,
|
|
74920
74932
|
useDeepCompareEffect: useDeepCompareEffect$1,
|
|
74921
74933
|
useDefault: useDefault$1,
|
|
74922
74934
|
useDrop: useDrop$1,
|
|
@@ -75024,15 +75036,15 @@ var __importDefault$4 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
75024
75036
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
75025
75037
|
};
|
|
75026
75038
|
Object.defineProperty(clipsBranding, "__esModule", { value: true });
|
|
75027
|
-
var react_1$
|
|
75039
|
+
var react_1$9 = __importDefault$4(React__default);
|
|
75028
75040
|
var GIPHYClips = function (_a) {
|
|
75029
75041
|
var onClick = _a.onClick;
|
|
75030
|
-
return (react_1$
|
|
75031
|
-
react_1$
|
|
75032
|
-
react_1$
|
|
75033
|
-
react_1$
|
|
75034
|
-
react_1$
|
|
75035
|
-
react_1$
|
|
75042
|
+
return (react_1$9.default.createElement("svg", { width: "66px", height: "13px", viewBox: "0 0 66 13", onClick: onClick },
|
|
75043
|
+
react_1$9.default.createElement("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd" },
|
|
75044
|
+
react_1$9.default.createElement("g", { transform: "translate(-1060.000000, -462.000000)", fill: "#FFFFFF", fillRule: "nonzero" },
|
|
75045
|
+
react_1$9.default.createElement("g", { transform: "translate(931.000000, 286.375671)" },
|
|
75046
|
+
react_1$9.default.createElement("g", { transform: "translate(86.000000, 136.124329)" },
|
|
75047
|
+
react_1$9.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" })))))));
|
|
75036
75048
|
};
|
|
75037
75049
|
clipsBranding.default = GIPHYClips;
|
|
75038
75050
|
|
|
@@ -75045,7 +75057,7 @@ var __importDefault$3 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
75045
75057
|
};
|
|
75046
75058
|
Object.defineProperty(attribution, "__esModule", { value: true });
|
|
75047
75059
|
var styled_1$3 = __importDefault$3(require$$0$4);
|
|
75048
|
-
var react_1$
|
|
75060
|
+
var react_1$8 = __importDefault$3(React__default);
|
|
75049
75061
|
var avatar_1 = __importDefault$3(avatar);
|
|
75050
75062
|
var user_1 = __importDefault$3(user);
|
|
75051
75063
|
var clips_branding_1 = __importDefault$3(clipsBranding);
|
|
@@ -75058,7 +75070,7 @@ var Attribution = function (_a) {
|
|
|
75058
75070
|
if (!(user === null || user === void 0 ? void 0 : user.username) && !(user === null || user === void 0 ? void 0 : user.display_name)) {
|
|
75059
75071
|
return null;
|
|
75060
75072
|
}
|
|
75061
|
-
return (react_1$
|
|
75073
|
+
return (react_1$8.default.createElement(Container$5, { className: [Attribution.className, className].join(' '), onClick: function (e) {
|
|
75062
75074
|
e.preventDefault();
|
|
75063
75075
|
e.stopPropagation();
|
|
75064
75076
|
if (onClick) {
|
|
@@ -75070,9 +75082,9 @@ var Attribution = function (_a) {
|
|
|
75070
75082
|
window.open(url, '_blank');
|
|
75071
75083
|
}
|
|
75072
75084
|
} },
|
|
75073
|
-
react_1$
|
|
75074
|
-
react_1$
|
|
75075
|
-
react_1$
|
|
75085
|
+
react_1$8.default.createElement(Avatar$1, { user: user }),
|
|
75086
|
+
react_1$8.default.createElement(Right, null,
|
|
75087
|
+
react_1$8.default.createElement(clips_branding_1.default, { onClick: function (e) {
|
|
75076
75088
|
e.preventDefault();
|
|
75077
75089
|
e.stopPropagation();
|
|
75078
75090
|
if (onClick) {
|
|
@@ -75082,7 +75094,7 @@ var Attribution = function (_a) {
|
|
|
75082
75094
|
window.open(gif.url, '_blank');
|
|
75083
75095
|
}
|
|
75084
75096
|
} }),
|
|
75085
|
-
react_1$
|
|
75097
|
+
react_1$8.default.createElement(user_1.default, { user: user }))));
|
|
75086
75098
|
};
|
|
75087
75099
|
Attribution.className = 'giphy-attribution';
|
|
75088
75100
|
attribution.default = Attribution;
|
|
@@ -75157,19 +75169,19 @@ util$1.isBrowser = typeof window !== 'undefined';
|
|
|
75157
75169
|
util$1.isNavigator = typeof navigator !== 'undefined';
|
|
75158
75170
|
|
|
75159
75171
|
Object.defineProperty(useIsomorphicLayoutEffect$1, "__esModule", { value: true });
|
|
75160
|
-
var react_1$
|
|
75172
|
+
var react_1$7 = React__default;
|
|
75161
75173
|
var util_1$1 = util$1;
|
|
75162
|
-
var useIsomorphicLayoutEffect = util_1$1.isBrowser ? react_1$
|
|
75174
|
+
var useIsomorphicLayoutEffect = util_1$1.isBrowser ? react_1$7.useLayoutEffect : react_1$7.useEffect;
|
|
75163
75175
|
useIsomorphicLayoutEffect$1.default = useIsomorphicLayoutEffect;
|
|
75164
75176
|
|
|
75165
75177
|
Object.defineProperty(useRaf$1, "__esModule", { value: true });
|
|
75166
75178
|
var tslib_1 = require$$0;
|
|
75167
|
-
var react_1$
|
|
75179
|
+
var react_1$6 = React__default;
|
|
75168
75180
|
var useIsomorphicLayoutEffect_1 = tslib_1.__importDefault(useIsomorphicLayoutEffect$1);
|
|
75169
75181
|
var useRaf = function (ms, delay) {
|
|
75170
75182
|
if (ms === void 0) { ms = 1e12; }
|
|
75171
75183
|
if (delay === void 0) { delay = 0; }
|
|
75172
|
-
var _a = react_1$
|
|
75184
|
+
var _a = react_1$6.useState(0), elapsed = _a[0], set = _a[1];
|
|
75173
75185
|
useIsomorphicLayoutEffect_1.default(function () {
|
|
75174
75186
|
var raf;
|
|
75175
75187
|
var timerStop;
|
|
@@ -75211,7 +75223,7 @@ var __importDefault$2 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
75211
75223
|
Object.defineProperty(progressBar, "__esModule", { value: true });
|
|
75212
75224
|
var styled_1$2 = __importDefault$2(require$$0$4);
|
|
75213
75225
|
var js_brand_1 = dist$2;
|
|
75214
|
-
var react_1$
|
|
75226
|
+
var react_1$5 = __importDefault$2(React__default);
|
|
75215
75227
|
var useRaf_1 = __importDefault$2(useRaf$1);
|
|
75216
75228
|
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; });
|
|
75217
75229
|
var ProgressBar = function (_a) {
|
|
@@ -75229,7 +75241,7 @@ var ProgressBar = function (_a) {
|
|
|
75229
75241
|
barHeight = 4;
|
|
75230
75242
|
}
|
|
75231
75243
|
percentage = duration < 10 && percentage > 98 ? 100 : percentage;
|
|
75232
|
-
return react_1$
|
|
75244
|
+
return react_1$5.default.createElement(Bar$1, { style: { width: percentage + "%" }, barHeight: barHeight, className: "hide-in-percy" });
|
|
75233
75245
|
};
|
|
75234
75246
|
progressBar.default = ProgressBar;
|
|
75235
75247
|
var templateObject_1$2t;
|
|
@@ -75325,7 +75337,7 @@ var __generator$2 = (commonjsGlobal$7 && commonjsGlobal$7.__generator) || functi
|
|
|
75325
75337
|
Object.defineProperty(video, "__esModule", { value: true });
|
|
75326
75338
|
var js_analytics_1 = dist;
|
|
75327
75339
|
var js_util_1$1 = dist$3;
|
|
75328
|
-
var react_1$
|
|
75340
|
+
var react_1$4 = __importStar$2(React__default);
|
|
75329
75341
|
var util_1 = util;
|
|
75330
75342
|
var quartileEvents = [0.25, 0.5, 0.75];
|
|
75331
75343
|
var videoClassName = 'giphy-video';
|
|
@@ -75344,28 +75356,28 @@ var Video = function (_a) {
|
|
|
75344
75356
|
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;
|
|
75345
75357
|
var height = height_ || js_util_1$1.getGifHeight(gif, width);
|
|
75346
75358
|
// state
|
|
75347
|
-
var _k = react_1$
|
|
75348
|
-
var seek = react_1$
|
|
75359
|
+
var _k = react_1$4.useState(js_util_1$1.getBestVideo(gif.video, width, height)), media = _k[0], setMedia = _k[1];
|
|
75360
|
+
var seek = react_1$4.useRef(0);
|
|
75349
75361
|
if (!media) {
|
|
75350
75362
|
// Not all gif requests have video content
|
|
75351
75363
|
// use { type: 'videos' } for search or trending endpoints
|
|
75352
75364
|
console.warn("GiphyJS No video content for id: " + gif.id);
|
|
75353
75365
|
}
|
|
75354
|
-
var mountTime = react_1$
|
|
75355
|
-
var hasPlayingFired = react_1$
|
|
75356
|
-
var loopNumber = react_1$
|
|
75357
|
-
var waitingCount = react_1$
|
|
75358
|
-
var quartilesFired = react_1$
|
|
75366
|
+
var mountTime = react_1$4.useRef(Date.now());
|
|
75367
|
+
var hasPlayingFired = react_1$4.useRef(false);
|
|
75368
|
+
var loopNumber = react_1$4.useRef(0);
|
|
75369
|
+
var waitingCount = react_1$4.useRef(0);
|
|
75370
|
+
var quartilesFired = react_1$4.useRef(new Set());
|
|
75359
75371
|
// reset the above when the gif.id changes
|
|
75360
|
-
react_1$
|
|
75372
|
+
react_1$4.useEffect(function () {
|
|
75361
75373
|
mountTime.current = Date.now();
|
|
75362
75374
|
hasPlayingFired.current = false;
|
|
75363
75375
|
loopNumber.current = 1;
|
|
75364
75376
|
waitingCount.current = 0;
|
|
75365
75377
|
quartilesFired.current = new Set();
|
|
75366
75378
|
}, [gif.id]);
|
|
75367
|
-
var videoEl = react_1$
|
|
75368
|
-
react_1$
|
|
75379
|
+
var videoEl = react_1$4.useRef(null);
|
|
75380
|
+
react_1$4.useEffect(function () {
|
|
75369
75381
|
// when the width and height change, check if there's a new url
|
|
75370
75382
|
var newMedia = js_util_1$1.getBestVideo(gif.video, width, height);
|
|
75371
75383
|
if (videoEl.current && (media === null || media === void 0 ? void 0 : media.url) && newMedia.url !== media.url) {
|
|
@@ -75378,13 +75390,13 @@ var Video = function (_a) {
|
|
|
75378
75390
|
setMedia(newMedia);
|
|
75379
75391
|
}
|
|
75380
75392
|
}, [width, height_, gif.video, height, media === null || media === void 0 ? void 0 : media.url, gif.id]);
|
|
75381
|
-
react_1$
|
|
75393
|
+
react_1$4.useEffect(function () {
|
|
75382
75394
|
if (videoEl.current && (media === null || media === void 0 ? void 0 : media.url) && seek.current) {
|
|
75383
75395
|
videoEl.current.currentTime = seek.current;
|
|
75384
75396
|
seek.current = 0;
|
|
75385
75397
|
}
|
|
75386
75398
|
}, [media === null || media === void 0 ? void 0 : media.url, seek]);
|
|
75387
|
-
var _onError = react_1$
|
|
75399
|
+
var _onError = react_1$4.useCallback(function () {
|
|
75388
75400
|
var _a;
|
|
75389
75401
|
var el = videoEl.current;
|
|
75390
75402
|
var code = (_a = el === null || el === void 0 ? void 0 : el.error) === null || _a === void 0 ? void 0 : _a.code;
|
|
@@ -75394,7 +75406,7 @@ var Video = function (_a) {
|
|
|
75394
75406
|
onError === null || onError === void 0 ? void 0 : onError(code);
|
|
75395
75407
|
}
|
|
75396
75408
|
}, [onError]);
|
|
75397
|
-
var _onPlaying = react_1$
|
|
75409
|
+
var _onPlaying = react_1$4.useCallback(function () {
|
|
75398
75410
|
onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange('playing');
|
|
75399
75411
|
if (!hasPlayingFired.current) {
|
|
75400
75412
|
hasPlayingFired.current = true;
|
|
@@ -75404,8 +75416,8 @@ var Video = function (_a) {
|
|
|
75404
75416
|
onFirstPlay === null || onFirstPlay === void 0 ? void 0 : onFirstPlay(Date.now() - mountTime.current);
|
|
75405
75417
|
}
|
|
75406
75418
|
}, [onFirstPlay, onStateChange, gif]);
|
|
75407
|
-
var _onPaused = react_1$
|
|
75408
|
-
var _onTimeUpdate = react_1$
|
|
75419
|
+
var _onPaused = react_1$4.useCallback(function () { return onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange('paused'); }, [onStateChange]);
|
|
75420
|
+
var _onTimeUpdate = react_1$4.useCallback(function () {
|
|
75409
75421
|
var el = videoEl.current;
|
|
75410
75422
|
if (el) {
|
|
75411
75423
|
var playhead_1 = el.currentTime;
|
|
@@ -75419,15 +75431,15 @@ var Video = function (_a) {
|
|
|
75419
75431
|
onTimeUpdate === null || onTimeUpdate === void 0 ? void 0 : onTimeUpdate(playhead_1 || 0);
|
|
75420
75432
|
}
|
|
75421
75433
|
}, [onQuartile, onTimeUpdate]);
|
|
75422
|
-
var _onCanPlay = react_1$
|
|
75423
|
-
var _onWaiting = react_1$
|
|
75434
|
+
var _onCanPlay = react_1$4.useCallback(function () { return onCanPlay === null || onCanPlay === void 0 ? void 0 : onCanPlay(); }, [onCanPlay]);
|
|
75435
|
+
var _onWaiting = react_1$4.useCallback(function () {
|
|
75424
75436
|
var el = videoEl.current;
|
|
75425
75437
|
// we get a waiting event after a loop, so ignore the first one while the play head is 0
|
|
75426
75438
|
if ((el === null || el === void 0 ? void 0 : el.currentTime) !== 0 && (el === null || el === void 0 ? void 0 : el.networkState) !== Network.IDLE) {
|
|
75427
75439
|
onWaiting === null || onWaiting === void 0 ? void 0 : onWaiting(++waitingCount.current);
|
|
75428
75440
|
}
|
|
75429
75441
|
}, [onWaiting]);
|
|
75430
|
-
var _onEnded = react_1$
|
|
75442
|
+
var _onEnded = react_1$4.useCallback(function () {
|
|
75431
75443
|
// helps prevent two ended events when changing media
|
|
75432
75444
|
if (!hasPlayingFired.current) {
|
|
75433
75445
|
return;
|
|
@@ -75439,8 +75451,8 @@ var Video = function (_a) {
|
|
|
75439
75451
|
loopNumber.current = loopNumber.current + 1;
|
|
75440
75452
|
onEnded === null || onEnded === void 0 ? void 0 : onEnded();
|
|
75441
75453
|
}, [onEnded, loop, onLoop]);
|
|
75442
|
-
var _onEndFullscreen = react_1$
|
|
75443
|
-
var tryAutoPlayWithSound = react_1$
|
|
75454
|
+
var _onEndFullscreen = react_1$4.useCallback(function () { return onEndFullscreen === null || onEndFullscreen === void 0 ? void 0 : onEndFullscreen(); }, [onEndFullscreen]);
|
|
75455
|
+
var tryAutoPlayWithSound = react_1$4.useCallback(function (videoEl) { return __awaiter$2(void 0, void 0, void 0, function () {
|
|
75444
75456
|
var promisePlay;
|
|
75445
75457
|
return __generator$2(this, function (_a) {
|
|
75446
75458
|
switch (_a.label) {
|
|
@@ -75469,7 +75481,7 @@ var Video = function (_a) {
|
|
|
75469
75481
|
}
|
|
75470
75482
|
});
|
|
75471
75483
|
}); }, [onMuted]);
|
|
75472
|
-
react_1$
|
|
75484
|
+
react_1$4.useEffect(function () {
|
|
75473
75485
|
var el = videoEl.current;
|
|
75474
75486
|
if (el) {
|
|
75475
75487
|
tryAutoPlayWithSound(el);
|
|
@@ -75480,7 +75492,7 @@ var Video = function (_a) {
|
|
|
75480
75492
|
}
|
|
75481
75493
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75482
75494
|
}, []);
|
|
75483
|
-
react_1$
|
|
75495
|
+
react_1$4.useEffect(function () {
|
|
75484
75496
|
var el = videoEl.current;
|
|
75485
75497
|
if (el) {
|
|
75486
75498
|
el.addEventListener('play', _onPlaying);
|
|
@@ -75506,7 +75518,7 @@ var Video = function (_a) {
|
|
|
75506
75518
|
};
|
|
75507
75519
|
}, [_onPlaying, _onPaused, _onError, _onTimeUpdate, _onCanPlay, _onEnded, _onWaiting, _onEndFullscreen]);
|
|
75508
75520
|
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;
|
|
75509
|
-
return (media === null || media === void 0 ? void 0 : media.url) ? (react_1$
|
|
75521
|
+
return (media === null || media === void 0 ? void 0 : media.url) ? (react_1$4.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$4.default.createElement("track", { label: "English", kind: "subtitles", srcLang: ccLanguage, src: captionSrc, default: true })))) : null;
|
|
75510
75522
|
};
|
|
75511
75523
|
Video.className = videoClassName;
|
|
75512
75524
|
video.default = Video;
|
|
@@ -75551,7 +75563,7 @@ var __importDefault$1 = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) |
|
|
|
75551
75563
|
Object.defineProperty(video$1, "__esModule", { value: true });
|
|
75552
75564
|
var styled_1$1 = __importDefault$1(require$$0$4);
|
|
75553
75565
|
var js_util_1 = dist$3;
|
|
75554
|
-
var react_1$
|
|
75566
|
+
var react_1$3 = __importStar$1(React__default);
|
|
75555
75567
|
var react_use_1 = require$$3;
|
|
75556
75568
|
var attribution_1 = __importDefault$1(attribution);
|
|
75557
75569
|
var volume_1$1 = volume;
|
|
@@ -75567,20 +75579,20 @@ var LARGE_PLAYER_HEIGHT = 300;
|
|
|
75567
75579
|
var AUTO_HIDE_TIMEOUT = 4000;
|
|
75568
75580
|
var VideoPlayer = function (props) {
|
|
75569
75581
|
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;
|
|
75570
|
-
var _a = react_1$
|
|
75571
|
-
var _b = react_1$
|
|
75572
|
-
var _c = react_1$
|
|
75573
|
-
var _d = react_1$
|
|
75582
|
+
var _a = react_1$3.useState(false), isHovered = _a[0], setIsHovered = _a[1];
|
|
75583
|
+
var _b = react_1$3.useState(null), videoEl = _b[0], _setVideoEl = _b[1];
|
|
75584
|
+
var _c = react_1$3.useState(props.muted), muted = _c[0], setMuted = _c[1];
|
|
75585
|
+
var _d = react_1$3.useState(false), mutedByBrowser = _d[0], setMutedByBrowser = _d[1];
|
|
75574
75586
|
var setVideoEl = props.setVideoEl, onMuted = props.onMuted, onUserMuted = props.onUserMuted;
|
|
75575
75587
|
var height = props.height || js_util_1.getGifHeight(gif, width);
|
|
75576
75588
|
var _e = react_use_1.useTimeoutFn(function () {
|
|
75577
75589
|
setIsHovered(false);
|
|
75578
75590
|
}, AUTO_HIDE_TIMEOUT), cancelHideTimeout = _e[1], resetHideTimeout = _e[2];
|
|
75579
|
-
var combinedOnMuted = react_1$
|
|
75591
|
+
var combinedOnMuted = react_1$3.useCallback(function (args) {
|
|
75580
75592
|
onMuted === null || onMuted === void 0 ? void 0 : onMuted(args);
|
|
75581
75593
|
setMutedByBrowser(args);
|
|
75582
75594
|
}, [setMutedByBrowser, onMuted]);
|
|
75583
|
-
var combinedSetVideoEl = react_1$
|
|
75595
|
+
var combinedSetVideoEl = react_1$3.useCallback(function (args) {
|
|
75584
75596
|
setVideoEl === null || setVideoEl === void 0 ? void 0 : setVideoEl(args);
|
|
75585
75597
|
_setVideoEl(args);
|
|
75586
75598
|
}, [setVideoEl, _setVideoEl]);
|
|
@@ -75593,13 +75605,13 @@ var VideoPlayer = function (props) {
|
|
|
75593
75605
|
setMuted(!muted);
|
|
75594
75606
|
}
|
|
75595
75607
|
};
|
|
75596
|
-
react_1$
|
|
75608
|
+
react_1$3.useEffect(function () {
|
|
75597
75609
|
setMuted(props.muted);
|
|
75598
75610
|
}, [props.muted]);
|
|
75599
75611
|
var showControls = persistentControls || isHovered;
|
|
75600
75612
|
var isLargePlayer = height >= LARGE_PLAYER_HEIGHT;
|
|
75601
75613
|
// Manage auto hide controls
|
|
75602
|
-
react_1$
|
|
75614
|
+
react_1$3.useEffect(function () {
|
|
75603
75615
|
if (showControls) {
|
|
75604
75616
|
resetHideTimeout();
|
|
75605
75617
|
}
|
|
@@ -75608,7 +75620,7 @@ var VideoPlayer = function (props) {
|
|
|
75608
75620
|
}
|
|
75609
75621
|
return function () { return cancelHideTimeout(); };
|
|
75610
75622
|
}, [showControls, cancelHideTimeout, resetHideTimeout]);
|
|
75611
|
-
return (react_1$
|
|
75623
|
+
return (react_1$3.default.createElement(Container$4, { className: className, style: { width: width, height: height }, onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onMouseMove: function () {
|
|
75612
75624
|
setIsHovered(true);
|
|
75613
75625
|
resetHideTimeout();
|
|
75614
75626
|
}, onClick: function (e) {
|
|
@@ -75621,25 +75633,25 @@ var VideoPlayer = function (props) {
|
|
|
75621
75633
|
e.preventDefault();
|
|
75622
75634
|
toggleMute();
|
|
75623
75635
|
} },
|
|
75624
|
-
react_1$
|
|
75625
|
-
showControls && react_1$
|
|
75626
|
-
react_1$
|
|
75627
|
-
react_1$
|
|
75628
|
-
isLargePlayer && (react_1$
|
|
75636
|
+
react_1$3.default.createElement(video_1.default, __assign$3({}, props, { onMuted: combinedOnMuted, setVideoEl: combinedSetVideoEl, muted: muted })),
|
|
75637
|
+
showControls && react_1$3.default.createElement(Gradient, { isLargePlayer: isLargePlayer }),
|
|
75638
|
+
react_1$3.default.createElement(Controls, { isHovered: showControls },
|
|
75639
|
+
react_1$3.default.createElement(TitleContainer$1, null,
|
|
75640
|
+
isLargePlayer && (react_1$3.default.createElement(Title$9, { onClick: function (e) {
|
|
75629
75641
|
e.preventDefault();
|
|
75630
75642
|
e.stopPropagation();
|
|
75631
75643
|
window.open(gif.url, '_blank');
|
|
75632
75644
|
} }, gif.title)),
|
|
75633
|
-
videoEl && !hideAttribution ? react_1$
|
|
75634
|
-
!hideMute && react_1$
|
|
75635
|
-
showControls && !hideProgressBar && videoEl ? react_1$
|
|
75636
|
-
Overlay && react_1$
|
|
75645
|
+
videoEl && !hideAttribution ? react_1$3.default.createElement(attribution_1.default, { gif: gif }) : null),
|
|
75646
|
+
!hideMute && react_1$3.default.createElement(Volume, null, muted || mutedByBrowser ? react_1$3.default.createElement(volume_1$1.VolumeOffIcon, null) : react_1$3.default.createElement(volume_1$1.VolumeOnIcon, null))),
|
|
75647
|
+
showControls && !hideProgressBar && videoEl ? react_1$3.default.createElement(progress_bar_1.default, { videoEl: videoEl }) : null,
|
|
75648
|
+
Overlay && react_1$3.default.createElement(Overlay, { gif: gif, isHovered: isHovered, width: width, height: height })));
|
|
75637
75649
|
};
|
|
75638
75650
|
var VideoWrapper = function (props) {
|
|
75639
75651
|
if (props.overlay && !props.controls) {
|
|
75640
75652
|
console.warn(js_util_1.Logger.PREFIX + ": Overlays only work when controls are enabled");
|
|
75641
75653
|
}
|
|
75642
|
-
return props.controls ? react_1$
|
|
75654
|
+
return props.controls ? react_1$3.default.createElement(VideoPlayer, __assign$3({}, props)) : react_1$3.default.createElement(video_1.default, __assign$3({}, props));
|
|
75643
75655
|
};
|
|
75644
75656
|
video$1.default = VideoWrapper;
|
|
75645
75657
|
var templateObject_1$2s, templateObject_2$1E, templateObject_3$16, templateObject_4$M, templateObject_5$F, templateObject_6$u;
|
|
@@ -75714,7 +75726,7 @@ var __importDefault = (commonjsGlobal$7 && commonjsGlobal$7.__importDefault) ||
|
|
|
75714
75726
|
};
|
|
75715
75727
|
Object.defineProperty(videoOverlay, "__esModule", { value: true });
|
|
75716
75728
|
var styled_1 = __importDefault(require$$0$4);
|
|
75717
|
-
var react_1 = __importStar(React__default);
|
|
75729
|
+
var react_1$2 = __importStar(React__default);
|
|
75718
75730
|
var _1 = __importDefault(video$1);
|
|
75719
75731
|
var volume_1 = volume;
|
|
75720
75732
|
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"])));
|
|
@@ -75723,16 +75735,16 @@ var Button$2 = styled_1.default.div(templateObject_3$15 || (templateObject_3$15
|
|
|
75723
75735
|
var speakerClassName = 'giphy-video-overlay-button';
|
|
75724
75736
|
var VolumeButton = function (_a) {
|
|
75725
75737
|
var muted = _a.muted, toggleMute = _a.toggleMute, mutedByBrowser = _a.mutedByBrowser, isHovered = _a.isHovered;
|
|
75726
|
-
return (react_1.default.createElement(Button$2, { className: speakerClassName, onClick: function (e) {
|
|
75738
|
+
return (react_1$2.default.createElement(Button$2, { className: speakerClassName, onClick: function (e) {
|
|
75727
75739
|
e.preventDefault();
|
|
75728
75740
|
e.stopPropagation();
|
|
75729
75741
|
toggleMute();
|
|
75730
|
-
}, isHovered: isHovered }, muted || mutedByBrowser || !isHovered ? react_1.default.createElement(volume_1.VolumeOffIcon, null) : react_1.default.createElement(volume_1.VolumeOnIcon, null)));
|
|
75742
|
+
}, isHovered: isHovered }, muted || mutedByBrowser || !isHovered ? react_1$2.default.createElement(volume_1.VolumeOffIcon, null) : react_1$2.default.createElement(volume_1.VolumeOnIcon, null)));
|
|
75731
75743
|
};
|
|
75732
75744
|
var VideoOverlay = function (_a) {
|
|
75733
75745
|
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;
|
|
75734
|
-
var _c = react_1.useState(userPrefMuted), muted = _c[0], setMuted = _c[1];
|
|
75735
|
-
var _d = react_1.useState(false), mutedByBrowser = _d[0], setMutedByBrowser = _d[1];
|
|
75746
|
+
var _c = react_1$2.useState(userPrefMuted), muted = _c[0], setMuted = _c[1];
|
|
75747
|
+
var _d = react_1$2.useState(false), mutedByBrowser = _d[0], setMutedByBrowser = _d[1];
|
|
75736
75748
|
var toggleMute = function () {
|
|
75737
75749
|
if (mutedByBrowser) {
|
|
75738
75750
|
setMutedByBrowser(false);
|
|
@@ -75743,13 +75755,13 @@ var VideoOverlay = function (_a) {
|
|
|
75743
75755
|
setMuted(!muted);
|
|
75744
75756
|
}
|
|
75745
75757
|
};
|
|
75746
|
-
react_1.useEffect(function () {
|
|
75758
|
+
react_1$2.useEffect(function () {
|
|
75747
75759
|
setMuted(userPrefMuted);
|
|
75748
75760
|
}, [userPrefMuted, setMuted]);
|
|
75749
75761
|
var props = { toggleMute: toggleMute, muted: muted, mutedByBrowser: mutedByBrowser };
|
|
75750
|
-
return (react_1.default.createElement(VideoContainer, { className: className },
|
|
75751
|
-
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 })),
|
|
75752
|
-
!hideMuteButton && react_1.default.createElement(VolumeButton, __assign$2({}, props, { isHovered: isHovered }))));
|
|
75762
|
+
return (react_1$2.default.createElement(VideoContainer, { className: className },
|
|
75763
|
+
isHovered && (react_1$2.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 })),
|
|
75764
|
+
!hideMuteButton && react_1$2.default.createElement(VolumeButton, __assign$2({}, props, { isHovered: isHovered }))));
|
|
75753
75765
|
};
|
|
75754
75766
|
VideoOverlay.imgClassName = speakerClassName;
|
|
75755
75767
|
videoOverlay.default = VideoOverlay;
|
|
@@ -75936,7 +75948,7 @@ js_util_1.appendGiphySDKRequestHeader("X-GIPHY-SDK-VERSION", version);
|
|
|
75936
75948
|
|
|
75937
75949
|
}(dist$4));
|
|
75938
75950
|
|
|
75939
|
-
function useDebouncedCallback(callback, delay, options) {
|
|
75951
|
+
function useDebouncedCallback$3(callback, delay, options) {
|
|
75940
75952
|
if (options === void 0) { options = {}; }
|
|
75941
75953
|
var maxWait = options.maxWait;
|
|
75942
75954
|
var maxWaitHandler = useRef$1(null);
|
|
@@ -76006,13 +76018,13 @@ function useDebouncedCallback(callback, delay, options) {
|
|
|
76006
76018
|
return [debouncedCallback, cancelDebouncedCallback, callPending];
|
|
76007
76019
|
}
|
|
76008
76020
|
|
|
76009
|
-
function valueEquality(left, right) {
|
|
76021
|
+
function valueEquality$1(left, right) {
|
|
76010
76022
|
return left === right;
|
|
76011
76023
|
}
|
|
76012
|
-
function useDebounce(value, delay, options) {
|
|
76013
|
-
var eq = options && options.equalityFn ? options.equalityFn : valueEquality;
|
|
76024
|
+
function useDebounce$2(value, delay, options) {
|
|
76025
|
+
var eq = options && options.equalityFn ? options.equalityFn : valueEquality$1;
|
|
76014
76026
|
var _a = useState$2(value), state = _a[0], dispatch = _a[1];
|
|
76015
|
-
var _b = useDebouncedCallback(useCallback(function (value) { return dispatch(value); }, []), delay, options), callback = _b[0], cancel = _b[1], callPending = _b[2];
|
|
76027
|
+
var _b = useDebouncedCallback$3(useCallback(function (value) { return dispatch(value); }, []), delay, options), callback = _b[0], cancel = _b[1], callPending = _b[2];
|
|
76016
76028
|
var previousValue = useRef$1(value);
|
|
76017
76029
|
useEffect$1(function () {
|
|
76018
76030
|
// We need to use this condition otherwise we will run debounce timer for the first render (including maxWait option)
|
|
@@ -79501,7 +79513,7 @@ var fixRegexpWellKnownSymbolLogic$2 = function (KEY, length, exec, sham) {
|
|
|
79501
79513
|
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
79502
79514
|
|
|
79503
79515
|
|
|
79504
|
-
var sameValue$1$
|
|
79516
|
+
var sameValue$1$2 = Object.is || function is(x, y) {
|
|
79505
79517
|
// eslint-disable-next-line no-self-compare
|
|
79506
79518
|
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
79507
79519
|
};
|
|
@@ -79533,8 +79545,8 @@ var regexpExecAbstract$2 = function (R, S) {
|
|
|
79533
79545
|
var fixRegExpWellKnownSymbolLogic$2$1 = fixRegexpWellKnownSymbolLogic$2;
|
|
79534
79546
|
var anObject$6$1 = anObject$e$1;
|
|
79535
79547
|
var requireObjectCoercible$4$1 = requireObjectCoercible$9$1;
|
|
79536
|
-
var sameValue$
|
|
79537
|
-
var regExpExec$1$
|
|
79548
|
+
var sameValue$3 = sameValue$1$2;
|
|
79549
|
+
var regExpExec$1$2 = regexpExecAbstract$2; // @@search logic
|
|
79538
79550
|
|
|
79539
79551
|
fixRegExpWellKnownSymbolLogic$2$1('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
|
79540
79552
|
return [// `String.prototype.search` method
|
|
@@ -79551,18 +79563,18 @@ fixRegExpWellKnownSymbolLogic$2$1('search', 1, function (SEARCH, nativeSearch, m
|
|
|
79551
79563
|
var rx = anObject$6$1(regexp);
|
|
79552
79564
|
var S = String(this);
|
|
79553
79565
|
var previousLastIndex = rx.lastIndex;
|
|
79554
|
-
if (!sameValue$
|
|
79555
|
-
var result = regExpExec$1$
|
|
79556
|
-
if (!sameValue$
|
|
79566
|
+
if (!sameValue$3(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
79567
|
+
var result = regExpExec$1$2(rx, S);
|
|
79568
|
+
if (!sameValue$3(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
79557
79569
|
return result === null ? -1 : result.index;
|
|
79558
79570
|
}];
|
|
79559
79571
|
});
|
|
79560
79572
|
var toInteger$1$2 = toInteger$4$1;
|
|
79561
|
-
var requireObjectCoercible$3$
|
|
79573
|
+
var requireObjectCoercible$3$2 = requireObjectCoercible$9$1; // `String.prototype.{ codePointAt, at }` methods implementation
|
|
79562
79574
|
|
|
79563
79575
|
var createMethod$1$2 = function (CONVERT_TO_STRING) {
|
|
79564
79576
|
return function ($this, pos) {
|
|
79565
|
-
var S = String(requireObjectCoercible$3$
|
|
79577
|
+
var S = String(requireObjectCoercible$3$2($this));
|
|
79566
79578
|
var position = toInteger$1$2(pos);
|
|
79567
79579
|
var size = S.length;
|
|
79568
79580
|
var first, second;
|
|
@@ -79587,7 +79599,7 @@ var advanceStringIndex$2$1 = function (S, index, unicode) {
|
|
|
79587
79599
|
return index + (unicode ? charAt$3(S, index).length : 1);
|
|
79588
79600
|
};
|
|
79589
79601
|
|
|
79590
|
-
var fixRegExpWellKnownSymbolLogic$1$
|
|
79602
|
+
var fixRegExpWellKnownSymbolLogic$1$2 = fixRegexpWellKnownSymbolLogic$2;
|
|
79591
79603
|
var anObject$5$1 = anObject$e$1;
|
|
79592
79604
|
var toObject$3$1 = toObject$7$1;
|
|
79593
79605
|
var toLength$4$1 = toLength$8$1;
|
|
@@ -79606,7 +79618,7 @@ var maybeToString$1 = function (it) {
|
|
|
79606
79618
|
}; // @@replace logic
|
|
79607
79619
|
|
|
79608
79620
|
|
|
79609
|
-
fixRegExpWellKnownSymbolLogic$1$
|
|
79621
|
+
fixRegExpWellKnownSymbolLogic$1$2('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
|
|
79610
79622
|
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
|
|
79611
79623
|
var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
|
|
79612
79624
|
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
|
@@ -79959,7 +79971,7 @@ var callWithSafeIterationClosing$1$1 = function (iterator, fn, value, ENTRIES) {
|
|
|
79959
79971
|
}
|
|
79960
79972
|
};
|
|
79961
79973
|
|
|
79962
|
-
var anObject$3$
|
|
79974
|
+
var anObject$3$2 = anObject$e$1;
|
|
79963
79975
|
var isArrayIteratorMethod$3 = isArrayIteratorMethod$1$1;
|
|
79964
79976
|
var toLength$3$1 = toLength$8$1;
|
|
79965
79977
|
var bind$3$1 = functionBindContext$1;
|
|
@@ -79983,7 +79995,7 @@ var iterate$1$1 = iterate$2$1.exports = function (iterable, fn, that, AS_ENTRIES
|
|
|
79983
79995
|
|
|
79984
79996
|
if (isArrayIteratorMethod$3(iterFn)) {
|
|
79985
79997
|
for (index = 0, length = toLength$3$1(iterable.length); length > index; index++) {
|
|
79986
|
-
result = AS_ENTRIES ? boundFunction(anObject$3$
|
|
79998
|
+
result = AS_ENTRIES ? boundFunction(anObject$3$2(step = iterable[index])[0], step[1]) : boundFunction(iterable[index]);
|
|
79987
79999
|
if (result && result instanceof Result$1) return result;
|
|
79988
80000
|
}
|
|
79989
80001
|
|
|
@@ -83473,7 +83485,7 @@ var ChannelTitle = function ChannelTitle(_a) {
|
|
|
83473
83485
|
var Host$g$2 = _styled.span.withConfig({
|
|
83474
83486
|
displayName: "ChannelTitle__Host",
|
|
83475
83487
|
componentId: "sc-1lqd4of-0"
|
|
83476
|
-
})(templateObject_1$u$
|
|
83488
|
+
})(templateObject_1$u$2 || (templateObject_1$u$2 = __makeTemplateObject$1(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
|
|
83477
83489
|
|
|
83478
83490
|
function isChannel$1(value) {
|
|
83479
83491
|
return value.id != null;
|
|
@@ -83507,7 +83519,7 @@ function getChannelDisplayName(allChannels, channelOrName, user, language) {
|
|
|
83507
83519
|
return language && translations[language] || translations[user.subscription.defaultLanguage] || channel.name;
|
|
83508
83520
|
}
|
|
83509
83521
|
|
|
83510
|
-
var templateObject_1$u$
|
|
83522
|
+
var templateObject_1$u$2;
|
|
83511
83523
|
|
|
83512
83524
|
_styled(ChannelTitle).withConfig({
|
|
83513
83525
|
displayName: "ChannelItem__StyledChannelTitle",
|
|
@@ -84009,7 +84021,7 @@ var GifSelector = function GifSelector(_a) {
|
|
|
84009
84021
|
searchText = _d[0],
|
|
84010
84022
|
setSearchText = _d[1];
|
|
84011
84023
|
|
|
84012
|
-
var debouncedSearchText = useDebounce(searchText, 500)[0];
|
|
84024
|
+
var debouncedSearchText = useDebounce$2(searchText, 500)[0];
|
|
84013
84025
|
var windowSize = useWindowSize$2();
|
|
84014
84026
|
|
|
84015
84027
|
var _e = usePromise$2(getGifs, null, [debouncedSearchText]),
|
|
@@ -87489,9 +87501,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
|
|
|
87489
87501
|
}), void 0);
|
|
87490
87502
|
};
|
|
87491
87503
|
|
|
87492
|
-
var version$1 = "0.4.0-preview.
|
|
87493
|
-
var buildId = "
|
|
87494
|
-
var commitId = "
|
|
87504
|
+
var version$1 = "0.4.0-preview.254";
|
|
87505
|
+
var buildId = "99446";
|
|
87506
|
+
var commitId = "00cb8cad9b2eef3f51f022c697ed67fb851aeeba";
|
|
87495
87507
|
var isCustomerBuild = false;
|
|
87496
87508
|
var buildInfo = {
|
|
87497
87509
|
version: version$1,
|
|
@@ -131618,8 +131630,8 @@ setSpecies$1('RegExp');var redefine$1$1=redefine$9.exports;var anObject$4=anObje
|
|
|
131618
131630
|
var INCORRECT_NAME$1=nativeToString$1.name!=TO_STRING$1;// `RegExp.prototype.toString` method
|
|
131619
131631
|
// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
|
|
131620
131632
|
if(NOT_GENERIC$1||INCORRECT_NAME$1){redefine$1$1(RegExp.prototype,TO_STRING$1,function toString(){var R=anObject$4(this);var p=String(R.source);var rf=R.flags;var f=String(rf===undefined&&R instanceof RegExp&&!('flags'in RegExpPrototype$1)?flags$1.call(R):rf);return '/'+p+'/'+f;},{unsafe:true});}// Sources: https://webapps.stackexchange.com/questions/54443/format-for-id-of-youtube-video
|
|
131621
|
-
var videoRegex=/((https?:\/\/)?((www\.)?)?)(((youtube\.com|youtu\.?be)\/[^\s]{11,}.*?)|((vimeo\.com)\/(?:video\/)?[\d]{3,})|((player\.vimeo\.com\/external)\/(\S+)))/g;function getAllVideosFromString(content){var matches,url,type;return __generator(this,function(_a){switch(_a.label){case 0:videoRegex.lastIndex=0;_a.label=1;case 1:matches=videoRegex.exec(content);url=matches===null||matches===void 0?void 0:matches[0];if(!url){return [3/*break*/,3];}type=matches.filter(function(m){return !!m;}).some(function(m){return m.indexOf('vimeo')>-1;})?AttachmentType.VimeoVideo:AttachmentType.YouTubeVideo;return [4/*yield*/,{url:url,type:type}];case 2:_a.sent();return [3/*break*/,1];case 3:return [2/*return*/];}});}function getEmbeddedObjectsFromString(content){var embeddedObjectRegex,matches,url,subscriptionIdentifier,type,id;return __generator(this,function(_a){switch(_a.label){case 0:embeddedObjectRegex=new RegExp("/([^/]{3,})(/(redirect/)?(news|events|pages|posts)/([^\\s/?]+).*?)",'g');_a.label=1;case 1:matches=embeddedObjectRegex.exec(content);url=matches===null||matches===void 0?void 0:matches[2];if(!url){return [3/*break*/,3];}subscriptionIdentifier=matches[1];type=AttachmentType.News;switch(matches[4]){case'news':type=AttachmentType.News;break;case'events':type=AttachmentType.Event;break;case'pages':type=AttachmentType.Page;break;case'posts':type=AttachmentType.Post;break;default:type=AttachmentType.News;}id=matches[5];return [4/*yield*/,{url:url,subscriptionIdentifier:subscriptionIdentifier,type:type,id:id}];case 2:_a.sent();return [3/*break*/,1];case 3:return [2/*return*/];}});}var global$8=global$m;var nativePromiseConstructor=global$8.Promise;var iterate$2={exports:{}};var anObject$3=anObject$h;var isArrayIteratorMethod=isArrayIteratorMethod$2;var toLength$5=toLength$b;var bind$3=functionBindContext;var getIteratorMethod=getIteratorMethod$4;var callWithSafeIterationClosing=callWithSafeIterationClosing$2;var Result=function(stopped,result){this.stopped=stopped;this.result=result;};var iterate$1=iterate$2.exports=function(iterable,fn,that,AS_ENTRIES,IS_ITERATOR){var boundFunction=bind$3(fn,that,AS_ENTRIES?2:1);var iterator,iterFn,index,length,result,next,step;if(IS_ITERATOR){iterator=iterable;}else {iterFn=getIteratorMethod(iterable);if(typeof iterFn!='function')throw TypeError('Target is not iterable');// optimisation for array iterators
|
|
131622
|
-
if(isArrayIteratorMethod(iterFn)){for(index=0,length=toLength$5(iterable.length);length>index;index++){result=AS_ENTRIES?boundFunction(anObject$3(step=iterable[index])[0],step[1]):boundFunction(iterable[index]);if(result&&result instanceof Result)return result;}return new Result(false);}iterator=iterFn.call(iterable);}next=iterator.next;while(!(step=next.call(iterator)).done){result=callWithSafeIterationClosing(iterator,boundFunction,step.value,AS_ENTRIES);if(typeof result=='object'&&result&&result instanceof Result)return result;}return new Result(false);};iterate$1.stop=function(result){return new Result(true,result);};var wellKnownSymbol$3=wellKnownSymbol$l;var ITERATOR=wellKnownSymbol$3('iterator');var SAFE_CLOSING=false;try{var called=0;var iteratorWithReturn={next:function(){return {done:!!called++};},'return':function(){SAFE_CLOSING=true;}};iteratorWithReturn[ITERATOR]=function(){return this;};// eslint-disable-next-line no-throw-literal
|
|
131633
|
+
var videoRegex=/((https?:\/\/)?((www\.)?)?)(((youtube\.com|youtu\.?be)\/[^\s]{11,}.*?)|((vimeo\.com)\/(?:video\/)?[\d]{3,})|((player\.vimeo\.com\/external)\/(\S+)))/g;function getAllVideosFromString(content){var matches,url,type;return __generator(this,function(_a){switch(_a.label){case 0:videoRegex.lastIndex=0;_a.label=1;case 1:matches=videoRegex.exec(content);url=matches===null||matches===void 0?void 0:matches[0];if(!url){return [3/*break*/,3];}type=matches.filter(function(m){return !!m;}).some(function(m){return m.indexOf('vimeo')>-1;})?AttachmentType.VimeoVideo:AttachmentType.YouTubeVideo;return [4/*yield*/,{url:url,type:type}];case 2:_a.sent();return [3/*break*/,1];case 3:return [2/*return*/];}});}function getEmbeddedObjectsFromString(content){var embeddedObjectRegex,matches,url,subscriptionIdentifier,type,id;return __generator(this,function(_a){switch(_a.label){case 0:embeddedObjectRegex=new RegExp("/([^/]{3,})(/(redirect/)?(news|events|pages|posts)/([^\\s/?]+).*?)",'g');_a.label=1;case 1:matches=embeddedObjectRegex.exec(content);url=matches===null||matches===void 0?void 0:matches[2];if(!url){return [3/*break*/,3];}subscriptionIdentifier=matches[1];type=AttachmentType.News;switch(matches[4]){case'news':type=AttachmentType.News;break;case'events':type=AttachmentType.Event;break;case'pages':type=AttachmentType.Page;break;case'posts':type=AttachmentType.Post;break;default:type=AttachmentType.News;}id=matches[5];return [4/*yield*/,{url:url,subscriptionIdentifier:subscriptionIdentifier,type:type,id:id}];case 2:_a.sent();return [3/*break*/,1];case 3:return [2/*return*/];}});}var global$8=global$m;var nativePromiseConstructor=global$8.Promise;var iterate$2={exports:{}};var anObject$3$1=anObject$h;var isArrayIteratorMethod=isArrayIteratorMethod$2;var toLength$5=toLength$b;var bind$3=functionBindContext;var getIteratorMethod=getIteratorMethod$4;var callWithSafeIterationClosing=callWithSafeIterationClosing$2;var Result=function(stopped,result){this.stopped=stopped;this.result=result;};var iterate$1=iterate$2.exports=function(iterable,fn,that,AS_ENTRIES,IS_ITERATOR){var boundFunction=bind$3(fn,that,AS_ENTRIES?2:1);var iterator,iterFn,index,length,result,next,step;if(IS_ITERATOR){iterator=iterable;}else {iterFn=getIteratorMethod(iterable);if(typeof iterFn!='function')throw TypeError('Target is not iterable');// optimisation for array iterators
|
|
131634
|
+
if(isArrayIteratorMethod(iterFn)){for(index=0,length=toLength$5(iterable.length);length>index;index++){result=AS_ENTRIES?boundFunction(anObject$3$1(step=iterable[index])[0],step[1]):boundFunction(iterable[index]);if(result&&result instanceof Result)return result;}return new Result(false);}iterator=iterFn.call(iterable);}next=iterator.next;while(!(step=next.call(iterator)).done){result=callWithSafeIterationClosing(iterator,boundFunction,step.value,AS_ENTRIES);if(typeof result=='object'&&result&&result instanceof Result)return result;}return new Result(false);};iterate$1.stop=function(result){return new Result(true,result);};var wellKnownSymbol$3=wellKnownSymbol$l;var ITERATOR=wellKnownSymbol$3('iterator');var SAFE_CLOSING=false;try{var called=0;var iteratorWithReturn={next:function(){return {done:!!called++};},'return':function(){SAFE_CLOSING=true;}};iteratorWithReturn[ITERATOR]=function(){return this;};// eslint-disable-next-line no-throw-literal
|
|
131623
131635
|
Array.from(iteratorWithReturn,function(){throw 2;});}catch(error){/* empty */}var checkCorrectnessOfIteration$1=function(exec,SKIP_CLOSING){if(!SKIP_CLOSING&&!SAFE_CLOSING)return false;var ITERATION_SUPPORT=false;try{var object={};object[ITERATOR]=function(){return {next:function(){return {done:ITERATION_SUPPORT=true};}};};exec(object);}catch(error){/* empty */}return ITERATION_SUPPORT;};var getBuiltIn$1=getBuiltIn$6;var engineUserAgent=getBuiltIn$1('navigator','userAgent')||'';var userAgent$1=engineUserAgent;var engineIsIos=/(iphone|ipod|ipad).*applewebkit/i.test(userAgent$1);var global$7=global$m;var fails$3$1=fails$i;var classof$3=classofRaw$1;var bind$2=functionBindContext;var html=html$2;var createElement=documentCreateElement$1;var IS_IOS$1=engineIsIos;var location$1=global$7.location;var set=global$7.setImmediate;var clear=global$7.clearImmediate;var process$3=global$7.process;var MessageChannel$1=global$7.MessageChannel;var Dispatch=global$7.Dispatch;var counter=0;var queue={};var ONREADYSTATECHANGE='onreadystatechange';var defer,channel,port;var run=function(id){// eslint-disable-next-line no-prototype-builtins
|
|
131624
131636
|
if(queue.hasOwnProperty(id)){var fn=queue[id];delete queue[id];fn();}};var runner=function(id){return function(){run(id);};};var listener=function(event){run(event.data);};var post=function(id){// old engines have not location.origin
|
|
131625
131637
|
global$7.postMessage(id+'',location$1.protocol+'//'+location$1.host);};// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
@@ -131686,13 +131698,13 @@ var STRICT_METHOD$1=arrayMethodIsStrict$1('sort');var FORCED$1=FAILS_ON_UNDEFINE
|
|
|
131686
131698
|
// https://tc39.github.io/ecma262/#sec-array.prototype.sort
|
|
131687
131699
|
$$8({target:'Array',proto:true,forced:FORCED$1},{sort:function sort(comparefn){return comparefn===undefined?nativeSort.call(toObject$3(this)):nativeSort.call(toObject$3(this),aFunction$2(comparefn));}});var SortFieldsDefinitionBuilder=/** @class */function(){function SortFieldsDefinitionBuilder(){this.sort=[];}SortFieldsDefinitionBuilder.prototype.addSortField=function(field,direction){this.sort.push(field+":"+SortFieldsDefinitionBuilder.getSortDirectionAsString(direction));return this;};SortFieldsDefinitionBuilder.getSortDirectionAsString=function(direction){return direction===SortDirection.asc?'asc':'desc';};return SortFieldsDefinitionBuilder;}();var EventSortFieldsDefinitionBuilder=/** @class */function(_super){__extends(EventSortFieldsDefinitionBuilder,_super);function EventSortFieldsDefinitionBuilder(){return _super!==null&&_super.apply(this,arguments)||this;}EventSortFieldsDefinitionBuilder.create=function(){return new EventSortFieldsDefinitionBuilder();};return EventSortFieldsDefinitionBuilder;}(SortFieldsDefinitionBuilder);EventSortFieldsDefinitionBuilder.create().addSortField('startDate',SortDirection.desc);EventSortFieldsDefinitionBuilder.create().addSortField('publishingDate',SortDirection.desc);var ItemType;(function(ItemType){ItemType[ItemType["None"]=0]="None";ItemType[ItemType["News"]=1]="News";ItemType[ItemType["Post"]=2]="Post";ItemType[ItemType["Page"]=4]="Page";ItemType[ItemType["Event"]=8]="Event";})(ItemType||(ItemType={}));// `SameValue` abstract operation
|
|
131688
131700
|
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
131689
|
-
var sameValue$1=Object.is||function is(x,y){// eslint-disable-next-line no-self-compare
|
|
131690
|
-
return x===y?x!==0||1/x===1/y:x!=x&&y!=y;};var fixRegExpWellKnownSymbolLogic$1=fixRegexpWellKnownSymbolLogic$1;var anObject$1$1=anObject$h;var requireObjectCoercible$3=requireObjectCoercible$c;var sameValue=sameValue$1;var regExpExec$1=regexpExecAbstract$1;// @@search logic
|
|
131691
|
-
fixRegExpWellKnownSymbolLogic$1('search',1,function(SEARCH,nativeSearch,maybeCallNative){return [// `String.prototype.search` method
|
|
131701
|
+
var sameValue$1$1=Object.is||function is(x,y){// eslint-disable-next-line no-self-compare
|
|
131702
|
+
return x===y?x!==0||1/x===1/y:x!=x&&y!=y;};var fixRegExpWellKnownSymbolLogic$1$1=fixRegexpWellKnownSymbolLogic$1;var anObject$1$1=anObject$h;var requireObjectCoercible$3$1=requireObjectCoercible$c;var sameValue$2=sameValue$1$1;var regExpExec$1$1=regexpExecAbstract$1;// @@search logic
|
|
131703
|
+
fixRegExpWellKnownSymbolLogic$1$1('search',1,function(SEARCH,nativeSearch,maybeCallNative){return [// `String.prototype.search` method
|
|
131692
131704
|
// https://tc39.github.io/ecma262/#sec-string.prototype.search
|
|
131693
|
-
function search(regexp){var O=requireObjectCoercible$3(this);var searcher=regexp==undefined?undefined:regexp[SEARCH];return searcher!==undefined?searcher.call(regexp,O):new RegExp(regexp)[SEARCH](String(O));},// `RegExp.prototype[@@search]` method
|
|
131705
|
+
function search(regexp){var O=requireObjectCoercible$3$1(this);var searcher=regexp==undefined?undefined:regexp[SEARCH];return searcher!==undefined?searcher.call(regexp,O):new RegExp(regexp)[SEARCH](String(O));},// `RegExp.prototype[@@search]` method
|
|
131694
131706
|
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
|
|
131695
|
-
function(regexp){var res=maybeCallNative(nativeSearch,regexp,this);if(res.done)return res.value;var rx=anObject$1$1(regexp);var S=String(this);var previousLastIndex=rx.lastIndex;if(!sameValue(previousLastIndex,0))rx.lastIndex=0;var result=regExpExec$1(rx,S);if(!sameValue(rx.lastIndex,previousLastIndex))rx.lastIndex=previousLastIndex;return result===null?-1:result.index;}];});var $$7=_export;var assign=objectAssign;// `Object.assign` method
|
|
131707
|
+
function(regexp){var res=maybeCallNative(nativeSearch,regexp,this);if(res.done)return res.value;var rx=anObject$1$1(regexp);var S=String(this);var previousLastIndex=rx.lastIndex;if(!sameValue$2(previousLastIndex,0))rx.lastIndex=0;var result=regExpExec$1$1(rx,S);if(!sameValue$2(rx.lastIndex,previousLastIndex))rx.lastIndex=previousLastIndex;return result===null?-1:result.index;}];});var $$7=_export;var assign=objectAssign;// `Object.assign` method
|
|
131696
131708
|
// https://tc39.github.io/ecma262/#sec-object.assign
|
|
131697
131709
|
$$7({target:'Object',stat:true,forced:Object.assign!==assign},{assign:assign});var fixRegExpWellKnownSymbolLogic$4=fixRegexpWellKnownSymbolLogic$1;var anObject$i=anObject$h;var toObject$2=toObject$7;var toLength$4=toLength$b;var toInteger$5=toInteger$4;var requireObjectCoercible$2$1=requireObjectCoercible$c;var advanceStringIndex$4=advanceStringIndex$3;var regExpExec$3=regexpExecAbstract$1;var max$1=Math.max;var min$2=Math.min;var floor=Math.floor;var SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d\d?|<[^>]*>)/g;var SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d\d?)/g;var maybeToString=function(it){return it===undefined?it:String(it);};// @@replace logic
|
|
131698
131710
|
fixRegExpWellKnownSymbolLogic$4('replace',2,function(REPLACE,nativeReplace,maybeCallNative,reason){var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;var REPLACE_KEEPS_$0=reason.REPLACE_KEEPS_$0;var UNSAFE_SUBSTITUTE=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?'$':'$0';return [// `String.prototype.replace` method
|
|
@@ -131713,7 +131725,7 @@ storage.set(cacheKey,apiPage_1).then(function(){return null;});if(!cachedPage){o
|
|
|
131713
131725
|
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
|
|
131714
131726
|
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
|
|
131715
131727
|
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
|
|
131716
|
-
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;_a.allowKeywords;var defaultKeywords=_a.defaultKeywords,availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,showKeywordsPicker=_a.showKeywordsPicker,onKeywordsChange=_a.onKeywordsChange,disableAddGif=_a.disableAddGif,disableAddFiles=_a.disableAddFiles,props=__rest(_a,["className","buttons","attachments","deletedAttachmentUrls","onAttachmentsChange","onDeleteAttachment","allowAttachments","useLargeDropTarget","disableDragAndDrop","allowKeywords","defaultKeywords","availableKeywords","mandatoryKeywords","showKeywordsPicker","onKeywordsChange","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 jsxs(Fragment,{children:[jsx$1(CommentInput,__assign({ref:inputRef,className:className,buttons:buttons},props),void 0),showKeywordsPicker&&!props.disabled&&jsx$1(KeywordsPicker,{defaultKeywords:defaultKeywords,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,onChangeKeywords:onKeywordsChange},void 0)]},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: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]},void 0)}),void 0),showKeywordsPicker&&!props.disabled&&jsx$1(KeywordsPicker,{defaultKeywords:defaultKeywords,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,onChangeKeywords:onKeywordsChange},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
|
|
131728
|
+
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;_a.allowKeywords;var defaultKeywords=_a.defaultKeywords,availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,showKeywordsPicker=_a.showKeywordsPicker,onKeywordsChange=_a.onKeywordsChange,disableAddGif=_a.disableAddGif,disableAddFiles=_a.disableAddFiles,props=__rest(_a,["className","buttons","attachments","deletedAttachmentUrls","onAttachmentsChange","onDeleteAttachment","allowAttachments","useLargeDropTarget","disableDragAndDrop","allowKeywords","defaultKeywords","availableKeywords","mandatoryKeywords","showKeywordsPicker","onKeywordsChange","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$3(onEmbeddedObjectsOrVideosChange,500)[0];var validateEmbeddedObject=useEmbeddedObjectValidator();var isGifButtonDisabled=props.disabled||disableAddGif;var isAttachmentsButtonDisabled=props.disabled||disableAddFiles;if(props.disabled||!allowAttachments){return jsxs(Fragment,{children:[jsx$1(CommentInput,__assign({ref:inputRef,className:className,buttons:buttons},props),void 0),showKeywordsPicker&&!props.disabled&&jsx$1(KeywordsPicker,{defaultKeywords:defaultKeywords,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,onChangeKeywords:onKeywordsChange},void 0)]},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: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]},void 0)}),void 0),showKeywordsPicker&&!props.disabled&&jsx$1(KeywordsPicker,{defaultKeywords:defaultKeywords,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,onChangeKeywords:onKeywordsChange},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
|
|
131717
131729
|
// src="https://www.youtube.com/embed/{videoId}?ecver=1" frameborder="0" allowfullscreen>
|
|
131718
131730
|
// </iframe>
|
|
131719
131731
|
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}"
|
|
@@ -131826,9 +131838,9 @@ if(node.querySelector('[data-code-html]')==null){node.innerHTML='';}}};var Heade
|
|
|
131826
131838
|
},[pollResult,isLoadingPollResult]);// If the pollResult and the choice input is rendered with showResults
|
|
131827
131839
|
// at the same time, we miss the animation of the bars when they fill up
|
|
131828
131840
|
// Delay the pollResult a bit so the users sees the animation
|
|
131829
|
-
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
|
|
131841
|
+
var delayedFetchPollResult=useDebouncedCallback$3(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
|
|
131830
131842
|
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$1k||(templateObject_1$1k=__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$1k;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$1j||(templateObject_1$1j=__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$N||(templateObject_2$N=__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$1j,templateObject_2$N;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
|
|
131831
|
-
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$u,__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$u=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Host",componentId:"sc-1rziepe-0"})(templateObject_1$1i||(templateObject_1$1i=__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$M||(templateObject_2$M=__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$w||(templateObject_3$w=__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$k||(templateObject_5$k=__makeTemplateObject(["\n ","\n margin-bottom: auto;\n"],["\n ","\n margin-bottom: auto;\n"])),function(p){return p.isScrollable&&css$2(templateObject_4$l||(templateObject_4$l=__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$d||(templateObject_6$d=__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$8||(templateObject_7$8=__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$7||(templateObject_8$7=__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$1i,templateObject_2$M,templateObject_3$w,templateObject_4$l,templateObject_5$k,templateObject_6$d,templateObject_7$8,templateObject_8$7,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$1h||(templateObject_1$1h=__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$1h;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$t,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$1,{},void 0),jsx$1(ParticipantsList,{},void 0)]}),void 0)}),void 0);};var Host$t=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__Host",componentId:"sc-1biaauh-0"})(templateObject_1$1g||(templateObject_1$1g=__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$L||(templateObject_2$L=__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$k||(templateObject_4$k=__makeTemplateObject(["\n padding: 4px;\n\n ","\n"],["\n padding: 4px;\n\n ","\n"])),function(p){return p.isScrollable&&css$2(templateObject_3$v||(templateObject_3$v=__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$j||(templateObject_5$j=__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$c||(templateObject_6$c=__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$7||(templateObject_7$7=__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$6||(templateObject_8$6=__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||(templateObject_10$3=__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$1g,templateObject_2$L,templateObject_3$v,templateObject_4$k,templateObject_5$j,templateObject_6$c,templateObject_7$7,templateObject_8$6,templateObject_9$4,templateObject_10$3,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$1f||(templateObject_1$1f=__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$K||(templateObject_2$K=__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$1f,templateObject_2$K;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$1e||(templateObject_1$1e=__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$J||(templateObject_2$J=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$1e,templateObject_2$J;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
|
|
131843
|
+
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$u,__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$u=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Host",componentId:"sc-1rziepe-0"})(templateObject_1$1i||(templateObject_1$1i=__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$M||(templateObject_2$M=__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$w||(templateObject_3$w=__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$k||(templateObject_5$k=__makeTemplateObject(["\n ","\n margin-bottom: auto;\n"],["\n ","\n margin-bottom: auto;\n"])),function(p){return p.isScrollable&&css$2(templateObject_4$l||(templateObject_4$l=__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$d||(templateObject_6$d=__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$8||(templateObject_7$8=__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$7||(templateObject_8$7=__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$1i,templateObject_2$M,templateObject_3$w,templateObject_4$l,templateObject_5$k,templateObject_6$d,templateObject_7$8,templateObject_8$7,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$1h||(templateObject_1$1h=__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$1h;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$t,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$1,{},void 0),jsx$1(ParticipantsList,{},void 0)]}),void 0)}),void 0);};var Host$t=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__Host",componentId:"sc-1biaauh-0"})(templateObject_1$1g||(templateObject_1$1g=__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$L||(templateObject_2$L=__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$k||(templateObject_4$k=__makeTemplateObject(["\n padding: 4px;\n\n ","\n"],["\n padding: 4px;\n\n ","\n"])),function(p){return p.isScrollable&&css$2(templateObject_3$v||(templateObject_3$v=__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$j||(templateObject_5$j=__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$c||(templateObject_6$c=__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$7||(templateObject_7$7=__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$6||(templateObject_8$6=__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||(templateObject_10$3=__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$1g,templateObject_2$L,templateObject_3$v,templateObject_4$k,templateObject_5$j,templateObject_6$c,templateObject_7$7,templateObject_8$6,templateObject_9$4,templateObject_10$3,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$1f||(templateObject_1$1f=__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$K||(templateObject_2$K=__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$1f,templateObject_2$K;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$1e||(templateObject_1$1e=__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$J||(templateObject_2$J=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$1e,templateObject_2$J;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
|
|
131832
131844
|
// https://tc39.github.io/ecma262/#sec-isarray
|
|
131833
131845
|
var isArray$3=Array.isArray||function isArray(arg){return classof$a(arg)=='Array';};var $$3=_export;var isArray$2=isArray$3;var nativeReverse=[].reverse;var test=[1,2];// `Array.prototype.reverse` method
|
|
131834
131846
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reverse
|
|
@@ -131854,7 +131866,7 @@ if(container.current&&location.hash==='#comments'){setTimeout(function(){return
|
|
|
131854
131866
|
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$17||(templateObject_1$17=__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$17;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$r,__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$r=_styled.div.withConfig({displayName:"EventDownloadCalendarFileButton__Host",componentId:"sc-1hjuosf-0"})(templateObject_1$16||(templateObject_1$16=__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$D||(templateObject_2$D=__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$16,templateObject_2$D;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$15||(templateObject_1$15=__makeTemplateObject(["\n min-width: 60px;\n margin-right: 9px;\n"],["\n min-width: 60px;\n margin-right: 9px;\n"])));var templateObject_1$15;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$q,__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$q=_styled.div.withConfig({displayName:"ShareButton__Host",componentId:"sc-6avyh0-0"})(templateObject_1$14||(templateObject_1$14=__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$C||(templateObject_2$C=__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$r||(templateObject_3$r=__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$h||(templateObject_4$h=__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$g||(templateObject_5$g=__makeTemplateObject(["\n i {\n font-size: ","px;\n }\n"],["\n i {\n font-size: ","px;\n }\n"])),fontSizeMedium+4);var templateObject_1$14,templateObject_2$C,templateObject_3$r,templateObject_4$h,templateObject_5$g;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$p,{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$p=_styled.div.withConfig({displayName:"ConfirmationStatistics__Host",componentId:"sc-1wprhw1-0"})(templateObject_1$13||(templateObject_1$13=__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$13;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$o,__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$12||(templateObject_1$12=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var Host$o=_styled(Tooltip).withConfig({displayName:"ConfirmationStatisticsExport__Host",componentId:"sc-1gesr6p-1"})(templateObject_2$B||(templateObject_2$B=__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$12,templateObject_2$B;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$n,{children:[jsx$1(ConfirmationStatistics,{count:confirmationCount},void 0),jsx$1(ConfirmationStatisticsExport,{item:item},void 0)]},void 0);};var Host$n=_styled.span.withConfig({displayName:"FeedbackButtonConfirmations__Host",componentId:"sc-sgky21-0"})(templateObject_1$11||(templateObject_1$11=__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$11;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
|
|
131855
131867
|
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$10||(templateObject_1$10=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$10;var EventDetailViewPlugins=function EventDetailViewPlugins(_a){var eventItem=_a.eventItem;return jsx$1(Host$m,{area:ExtensionArea.eventDetailViewSection,eventItem:eventItem},void 0);};var Host$m=_styled(Plugins)(templateObject_1$$||(templateObject_1$$=__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$$;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
|
|
131856
131868
|
return jsxs("span",{children:[",\u00A0",jsx$1(FormattedMessage$1,{id:"DateInfo.archivedOn."+format,values:values},void 0)]},void 0);}else {// not yet expired
|
|
131857
|
-
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$_||(templateObject_1$_=__makeTemplateObject(["\n &&& {\n text-decoration: none;\n }\n"],["\n &&& {\n text-decoration: none;\n }\n"])));var templateObject_1$_;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$l,__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$l=_styled.div.withConfig({displayName:"ItemMetaInfo__Host",componentId:"sc-1d6drj8-0"})(templateObject_1$Z||(templateObject_1$Z=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var InfoDetailsHost=_styled.div.withConfig({displayName:"ItemMetaInfo__InfoDetailsHost",componentId:"sc-1d6drj8-1"})(templateObject_2$A||(templateObject_2$A=__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$q||(templateObject_3$q=__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$g||(templateObject_4$g=__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$f||(templateObject_5$f=__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$9||(templateObject_6$9=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$Z,templateObject_2$A,templateObject_3$q,templateObject_4$g,templateObject_5$f,templateObject_6$9;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$Y||(templateObject_1$Y=__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$Y;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$X||(templateObject_1$X=__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$X;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,{"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
|
|
131869
|
+
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$_||(templateObject_1$_=__makeTemplateObject(["\n &&& {\n text-decoration: none;\n }\n"],["\n &&& {\n text-decoration: none;\n }\n"])));var templateObject_1$_;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$l,__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$l=_styled.div.withConfig({displayName:"ItemMetaInfo__Host",componentId:"sc-1d6drj8-0"})(templateObject_1$Z||(templateObject_1$Z=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var InfoDetailsHost=_styled.div.withConfig({displayName:"ItemMetaInfo__InfoDetailsHost",componentId:"sc-1d6drj8-1"})(templateObject_2$A||(templateObject_2$A=__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$q||(templateObject_3$q=__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$g||(templateObject_4$g=__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$f||(templateObject_5$f=__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$9||(templateObject_6$9=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$Z,templateObject_2$A,templateObject_3$q,templateObject_4$g,templateObject_5$f,templateObject_6$9;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$Y||(templateObject_1$Y=__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$Y;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$X||(templateObject_1$X=__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$X;var PageTocSearch=function PageTocSearch(_a){var onSearch=_a.onSearch,onSearchResultChange=_a.onSearchResultChange;var formatMessage=useIntl().formatMessage;var onDebouncedSearch=useDebouncedCallback$3(handleSearch,300)[0];var textColors=useContext(ThemeContext$1).theme.textColors;return jsx$1(StyledSearchBox,{"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
|
|
131858
131870
|
// an hierarchical tree, with the roots node at the very top
|
|
131859
131871
|
// so we can then pass this in to the actual ToC
|
|
131860
131872
|
result.items.forEach(function(page){var _a;var node=convertToNavigationNode(page);node.isSearchMatch=true;while(true){// if we already have the current node collected
|
|
@@ -131869,7 +131881,7 @@ var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===pag
|
|
|
131869
131881
|
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
|
|
131870
131882
|
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$R||(templateObject_1$R=__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$w||(templateObject_2$w=__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$n||(templateObject_3$n=__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$d||(templateObject_4$d=__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$c||(templateObject_5$c=__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$6$1||(templateObject_6$6$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$4$1||(templateObject_7$4$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$4$1||(templateObject_8$4$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$R,templateObject_2$w,templateObject_3$n,templateObject_4$d,templateObject_5$c,templateObject_6$6$1,templateObject_7$4$1,templateObject_8$4$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$k,{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$k=_styled.div.withConfig({displayName:"DetailViewPageDocumentDownload__Host",componentId:"sc-1gtkslm-0"})(templateObject_1$Q||(templateObject_1$Q=__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$v||(templateObject_2$v=__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$Q,templateObject_2$v;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$P||(templateObject_1$P=__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$P;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$O||(templateObject_1$O=__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$m||(templateObject_3$m=__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$u||(templateObject_2$u=__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$O,templateObject_2$u,templateObject_3$m;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$N||(templateObject_1$N=__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$N;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$M||(templateObject_1$M=__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$M;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$L||(templateObject_1$L=__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$L;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$K||(templateObject_1$K=__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$K;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$J||(templateObject_1$J=__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$J;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$h$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$h$1=_styled.div.withConfig({displayName:"GutterMakerIcon__Host",componentId:"sc-aa2cf4-0"})(templateObject_1$I||(templateObject_1$I=__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$t||(templateObject_2$t=__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$l||(templateObject_3$l=__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$c$1||(templateObject_4$c$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$b||(templateObject_5$b=__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$5$1||(templateObject_6$5$1=__makeTemplateObject(["\n && {\n display: inherit;\n }\n"],["\n && {\n display: inherit;\n }\n"])));var templateObject_1$I,templateObject_2$t,templateObject_3$l,templateObject_4$c$1,templateObject_5$b,templateObject_6$5$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$H||(templateObject_1$H=__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$H;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$G||(templateObject_1$G=__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$G;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$F||(templateObject_1$F=__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$F;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$E||(templateObject_1$E=__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$E;var ConfirmationBox=function ConfirmationBox(_a){var disabled=_a.disabled,checked=_a.checked,onChange=_a.onChange;var formatMessage=useIntl().formatMessage;return jsx$1(Host$g$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$g$1=_styled.div.withConfig({displayName:"ConfirmationBox__Host",componentId:"sc-1m5alil-0"})(templateObject_1$D||(templateObject_1$D=__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$D;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$f$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$f$1=_styled.div.withConfig({displayName:"ConfirmationSection__Host",componentId:"sc-1g2fxdb-0"})(templateObject_1$C||(templateObject_1$C=__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$s||(templateObject_2$s=__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$C,templateObject_2$s;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$B||(templateObject_1$B=__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$B;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$A||(templateObject_1$A=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$A;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$z||(templateObject_1$z=__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$z;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$y||(templateObject_1$y=__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$y;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 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$e$1,{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$e$1=_styled.div.withConfig({displayName:"KeywordPickerGroup__Host",componentId:"sc-pu16jm-0"})(templateObject_1$x||(templateObject_1$x=__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$r||(templateObject_2$r=__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$k||(templateObject_3$k=__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$a||(templateObject_5$a=__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$b$1||(templateObject_4$b$1=__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$3$1||(templateObject_7$3$1=__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$4$1||(templateObject_6$4$1=__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$3$1||(templateObject_8$3$1=__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$x,templateObject_2$r,templateObject_3$k,templateObject_4$b$1,templateObject_5$a,templateObject_6$4$1,templateObject_7$3$1,templateObject_8$3$1;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$d$1,__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,{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$w||(templateObject_1$w=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var StyledToggleAllButtons=_styled(ToggleAllButtons).withConfig({displayName:"KeywordPicker__StyledToggleAllButtons",componentId:"sc-1ejjfwa-1"})(templateObject_2$q||(templateObject_2$q=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var Host$d$1=_styled.div.withConfig({displayName:"KeywordPicker__Host",componentId:"sc-1ejjfwa-2"})(templateObject_3$j||(templateObject_3$j=__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$a$1||(templateObject_4$a$1=__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$9$1||(templateObject_5$9$1=__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$w,templateObject_2$q,templateObject_3$j,templateObject_4$a$1,templateObject_5$9$1;var $$2=_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
|
|
131871
131883
|
// https://github.com/tc39/proposal-string-replace-all
|
|
131872
|
-
$$2({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||(templateObject_1$v=__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,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||(templateObject_1$u=__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,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
|
|
131884
|
+
$$2({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||(templateObject_1$v=__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,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
|
|
131873
131885
|
if(!timeHasFocus){// We might not know that the time field has the focus after an onBlur from the date field.
|
|
131874
131886
|
// In this case only update the _time_ component if it has changed. Which is not the case for changes
|
|
131875
131887
|
// from the date field
|
|
@@ -131953,9 +131965,9 @@ var NewsDetailViewMetaInfo = function NewsDetailViewMetaInfo() {
|
|
|
131953
131965
|
var DetailMetaInfo = _styled(ItemMetaInfo).withConfig({
|
|
131954
131966
|
displayName: "NewsDetailViewMetaInfo__DetailMetaInfo",
|
|
131955
131967
|
componentId: "sc-1v9a7tf-0"
|
|
131956
|
-
})(templateObject_1$
|
|
131968
|
+
})(templateObject_1$u || (templateObject_1$u = __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);
|
|
131957
131969
|
|
|
131958
|
-
var templateObject_1$
|
|
131970
|
+
var templateObject_1$u;
|
|
131959
131971
|
|
|
131960
131972
|
var NewsItemContextProvider = function NewsItemContextProvider(_a) {
|
|
131961
131973
|
var itemId = _a.itemId,
|
|
@@ -132061,16 +132073,16 @@ var NewsDetailMainContent = function NewsDetailMainContent(_a) {
|
|
|
132061
132073
|
var Host$h = _styled.div.withConfig({
|
|
132062
132074
|
displayName: "NewsDetail__Host",
|
|
132063
132075
|
componentId: "sc-6rz5th-0"
|
|
132064
|
-
})(templateObject_1$
|
|
132076
|
+
})(templateObject_1$t || (templateObject_1$t = __makeTemplateObject$l([""], [""])));
|
|
132065
132077
|
|
|
132066
|
-
var templateObject_1$
|
|
132078
|
+
var templateObject_1$t;
|
|
132067
132079
|
|
|
132068
|
-
var anObject$
|
|
132080
|
+
var anObject$3 = anObject$v;
|
|
132069
132081
|
|
|
132070
132082
|
// `RegExp.prototype.flags` getter implementation
|
|
132071
132083
|
// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
|
|
132072
132084
|
var regexpFlags$1 = function () {
|
|
132073
|
-
var that = anObject$
|
|
132085
|
+
var that = anObject$3(this);
|
|
132074
132086
|
var result = '';
|
|
132075
132087
|
if (that.global) result += 'g';
|
|
132076
132088
|
if (that.ignoreCase) result += 'i';
|
|
@@ -132325,12 +132337,12 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
|
|
|
132325
132337
|
};
|
|
132326
132338
|
|
|
132327
132339
|
var toInteger$1 = toInteger$e;
|
|
132328
|
-
var requireObjectCoercible$
|
|
132340
|
+
var requireObjectCoercible$3 = requireObjectCoercible$m;
|
|
132329
132341
|
|
|
132330
132342
|
// `String.prototype.{ codePointAt, at }` methods implementation
|
|
132331
132343
|
var createMethod$1 = function (CONVERT_TO_STRING) {
|
|
132332
132344
|
return function ($this, pos) {
|
|
132333
|
-
var S = String(requireObjectCoercible$
|
|
132345
|
+
var S = String(requireObjectCoercible$3($this));
|
|
132334
132346
|
var position = toInteger$1(pos);
|
|
132335
132347
|
var size = S.length;
|
|
132336
132348
|
var first, second;
|
|
@@ -132382,20 +132394,20 @@ var regexpExecAbstract = function (R, S) {
|
|
|
132382
132394
|
return regexpExec.call(R, S);
|
|
132383
132395
|
};
|
|
132384
132396
|
|
|
132385
|
-
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
132386
|
-
var anObject$
|
|
132397
|
+
var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
|
|
132398
|
+
var anObject$2 = anObject$v;
|
|
132387
132399
|
var toLength = toLength$l;
|
|
132388
|
-
var requireObjectCoercible$
|
|
132400
|
+
var requireObjectCoercible$2 = requireObjectCoercible$m;
|
|
132389
132401
|
var advanceStringIndex = advanceStringIndex$1;
|
|
132390
|
-
var regExpExec = regexpExecAbstract;
|
|
132402
|
+
var regExpExec$1 = regexpExecAbstract;
|
|
132391
132403
|
|
|
132392
132404
|
// @@match logic
|
|
132393
|
-
fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
|
132405
|
+
fixRegExpWellKnownSymbolLogic$1('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
|
132394
132406
|
return [
|
|
132395
132407
|
// `String.prototype.match` method
|
|
132396
132408
|
// https://tc39.github.io/ecma262/#sec-string.prototype.match
|
|
132397
132409
|
function match(regexp) {
|
|
132398
|
-
var O = requireObjectCoercible$
|
|
132410
|
+
var O = requireObjectCoercible$2(this);
|
|
132399
132411
|
var matcher = regexp == undefined ? undefined : regexp[MATCH];
|
|
132400
132412
|
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
|
|
132401
132413
|
},
|
|
@@ -132405,17 +132417,17 @@ fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCal
|
|
|
132405
132417
|
var res = maybeCallNative(nativeMatch, regexp, this);
|
|
132406
132418
|
if (res.done) return res.value;
|
|
132407
132419
|
|
|
132408
|
-
var rx = anObject$
|
|
132420
|
+
var rx = anObject$2(regexp);
|
|
132409
132421
|
var S = String(this);
|
|
132410
132422
|
|
|
132411
|
-
if (!rx.global) return regExpExec(rx, S);
|
|
132423
|
+
if (!rx.global) return regExpExec$1(rx, S);
|
|
132412
132424
|
|
|
132413
132425
|
var fullUnicode = rx.unicode;
|
|
132414
132426
|
rx.lastIndex = 0;
|
|
132415
132427
|
var A = [];
|
|
132416
132428
|
var n = 0;
|
|
132417
132429
|
var result;
|
|
132418
|
-
while ((result = regExpExec(rx, S)) !== null) {
|
|
132430
|
+
while ((result = regExpExec$1(rx, S)) !== null) {
|
|
132419
132431
|
var matchStr = String(result[0]);
|
|
132420
132432
|
A[n] = matchStr;
|
|
132421
132433
|
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
@@ -132462,11 +132474,11 @@ var PageTableOfContents = function PageTableOfContents(_a) {
|
|
|
132462
132474
|
}, void 0)]
|
|
132463
132475
|
}, void 0);
|
|
132464
132476
|
};
|
|
132465
|
-
var Host$g = _styled.div(templateObject_1$
|
|
132477
|
+
var Host$g = _styled.div(templateObject_1$s || (templateObject_1$s = __makeTemplateObject$l(["\n && {\n margin-top: ", "px;\n }\n"], ["\n && {\n margin-top: ", "px;\n }\n"])), spacingXs);
|
|
132466
132478
|
var PageTableOfContentsButton = _styled(IconButton$1)(templateObject_2$h || (templateObject_2$h = __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) {
|
|
132467
132479
|
return p.theme.textColors.default;
|
|
132468
132480
|
});
|
|
132469
|
-
var templateObject_1$
|
|
132481
|
+
var templateObject_1$s, templateObject_2$h;
|
|
132470
132482
|
|
|
132471
132483
|
var PageDetail = function PageDetail(props) {
|
|
132472
132484
|
var routeMatch = useRouteMatch();
|
|
@@ -132560,7 +132572,7 @@ var PageDetailInternal = function PageDetailInternal(_a) {
|
|
|
132560
132572
|
var Host$f = _styled.div.withConfig({
|
|
132561
132573
|
displayName: "PageDetail__Host",
|
|
132562
132574
|
componentId: "sc-22rpk8-0"
|
|
132563
|
-
})(templateObject_1$
|
|
132575
|
+
})(templateObject_1$r || (templateObject_1$r = __makeTemplateObject$l([""], [""])));
|
|
132564
132576
|
|
|
132565
132577
|
var PageHeader = _styled.div.withConfig({
|
|
132566
132578
|
displayName: "PageDetail__PageHeader",
|
|
@@ -132637,7 +132649,7 @@ var InlinePageListWrapper = function InlinePageListWrapper() {
|
|
|
132637
132649
|
return jsx$1(InlinePageList, {}, void 0);
|
|
132638
132650
|
};
|
|
132639
132651
|
|
|
132640
|
-
var templateObject_1$
|
|
132652
|
+
var templateObject_1$r, templateObject_2$g, templateObject_3$e, templateObject_4$c, templateObject_5$9;
|
|
132641
132653
|
|
|
132642
132654
|
var EventDetail = function EventDetail(_a) {
|
|
132643
132655
|
var itemId = _a.itemId,
|
|
@@ -132705,7 +132717,7 @@ var EventDetail = function EventDetail(_a) {
|
|
|
132705
132717
|
var Host$e = _styled.div.withConfig({
|
|
132706
132718
|
displayName: "EventDetail__Host",
|
|
132707
132719
|
componentId: "sc-hrm4yl-0"
|
|
132708
|
-
})(templateObject_1$
|
|
132720
|
+
})(templateObject_1$q || (templateObject_1$q = __makeTemplateObject$l([""], [""])));
|
|
132709
132721
|
|
|
132710
132722
|
var EventDateAndRecurrenceInfo = _styled.div.withConfig({
|
|
132711
132723
|
displayName: "EventDetail__EventDateAndRecurrenceInfo",
|
|
@@ -132724,7 +132736,7 @@ var EventRecurrenceSeriesInfoLink = _styled.a.withConfig({
|
|
|
132724
132736
|
return p.theme.textColors.default;
|
|
132725
132737
|
}, spacingM);
|
|
132726
132738
|
|
|
132727
|
-
var templateObject_1$
|
|
132739
|
+
var templateObject_1$q, templateObject_2$f, templateObject_3$d, templateObject_4$b;
|
|
132728
132740
|
|
|
132729
132741
|
function useNewsItemClickHandler() {
|
|
132730
132742
|
var user = useCurrentUserContext().user;
|
|
@@ -132931,7 +132943,7 @@ var NewsCompactCard = function NewsCompactCard(_a) {
|
|
|
132931
132943
|
var Host$d = _styled.div.withConfig({
|
|
132932
132944
|
displayName: "NewsCompactCard__Host",
|
|
132933
132945
|
componentId: "sc-16ovog0-0"
|
|
132934
|
-
})(templateObject_1$
|
|
132946
|
+
})(templateObject_1$p || (templateObject_1$p = __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) {
|
|
132935
132947
|
return p.theme.palette.white;
|
|
132936
132948
|
});
|
|
132937
132949
|
|
|
@@ -133029,7 +133041,7 @@ var BannerHost = _styled.div.withConfig({
|
|
|
133029
133041
|
});
|
|
133030
133042
|
});
|
|
133031
133043
|
|
|
133032
|
-
var templateObject_1$
|
|
133044
|
+
var templateObject_1$p, templateObject_2$e, templateObject_3$c, templateObject_4$a, templateObject_5$8, templateObject_6$7, templateObject_7$4, templateObject_8$4, templateObject_9$2, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$2, templateObject_16$1;
|
|
133033
133045
|
|
|
133034
133046
|
var EmptyNewsList = function EmptyNewsList() {
|
|
133035
133047
|
return jsxs(Host$c, {
|
|
@@ -133046,7 +133058,7 @@ var EmptyNewsList = function EmptyNewsList() {
|
|
|
133046
133058
|
var Host$c = _styled.div.withConfig({
|
|
133047
133059
|
displayName: "EmptyNewsList__Host",
|
|
133048
133060
|
componentId: "sc-11ktr8s-0"
|
|
133049
|
-
})(templateObject_1$
|
|
133061
|
+
})(templateObject_1$o || (templateObject_1$o = __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);
|
|
133050
133062
|
|
|
133051
133063
|
var StyledIcon$3 = _styled(Icon).withConfig({
|
|
133052
133064
|
displayName: "EmptyNewsList__StyledIcon",
|
|
@@ -133058,7 +133070,7 @@ var Message = _styled.p.withConfig({
|
|
|
133058
133070
|
componentId: "sc-11ktr8s-2"
|
|
133059
133071
|
})(templateObject_3$b || (templateObject_3$b = __makeTemplateObject$l(["\n text-align: center;\n padding: 0;\n margin: 0;\n"], ["\n text-align: center;\n padding: 0;\n margin: 0;\n"])));
|
|
133060
133072
|
|
|
133061
|
-
var templateObject_1$
|
|
133073
|
+
var templateObject_1$o, templateObject_2$d, templateObject_3$b;
|
|
133062
133074
|
|
|
133063
133075
|
var ItemLayoutMode;
|
|
133064
133076
|
|
|
@@ -133225,7 +133237,7 @@ var NewsListInternal = function NewsListInternal(_a) {
|
|
|
133225
133237
|
var Host$b = _styled.div.withConfig({
|
|
133226
133238
|
displayName: "NewsList__Host",
|
|
133227
133239
|
componentId: "sc-1d0bzx1-0"
|
|
133228
|
-
})(templateObject_1$
|
|
133240
|
+
})(templateObject_1$n || (templateObject_1$n = __makeTemplateObject$l([""], [""])));
|
|
133229
133241
|
|
|
133230
133242
|
var CompactList = _styled.ul.withConfig({
|
|
133231
133243
|
displayName: "NewsList__CompactList",
|
|
@@ -133265,7 +133277,7 @@ var ErrorContainer$1 = _styled.p.withConfig({
|
|
|
133265
133277
|
return p.theme.palette.red;
|
|
133266
133278
|
}, spacingM);
|
|
133267
133279
|
|
|
133268
|
-
var templateObject_1$
|
|
133280
|
+
var templateObject_1$n, templateObject_2$c, templateObject_3$a, templateObject_4$9, templateObject_5$7, templateObject_6$6, templateObject_7$3, templateObject_8$3;
|
|
133269
133281
|
|
|
133270
133282
|
var ManageChannels = function ManageChannels(_a) {
|
|
133271
133283
|
var className = _a.className;
|
|
@@ -133431,7 +133443,7 @@ var ManageChannels = function ManageChannels(_a) {
|
|
|
133431
133443
|
var Host$a = _styled.div.withConfig({
|
|
133432
133444
|
displayName: "ManageChannels__Host",
|
|
133433
133445
|
componentId: "sc-yyoxfw-0"
|
|
133434
|
-
})(templateObject_1$
|
|
133446
|
+
})(templateObject_1$m || (templateObject_1$m = __makeTemplateObject$l(["\n padding: ", "px ", "px;\n"], ["\n padding: ", "px ", "px;\n"])), spacingX, spacingM);
|
|
133435
133447
|
|
|
133436
133448
|
var Title$2 = _styled.h3.withConfig({
|
|
133437
133449
|
displayName: "ManageChannels__Title",
|
|
@@ -133504,7 +133516,7 @@ var StyledIconButton = _styled(IconButton$1).withConfig({
|
|
|
133504
133516
|
return p.theme.textColors.default;
|
|
133505
133517
|
});
|
|
133506
133518
|
|
|
133507
|
-
var templateObject_1$
|
|
133519
|
+
var templateObject_1$m, templateObject_2$b, templateObject_3$9, templateObject_4$8, templateObject_5$6, templateObject_6$5, templateObject_7$2, templateObject_8$2;
|
|
133508
133520
|
|
|
133509
133521
|
var NewsGridCard = function NewsGridCard(_a) {
|
|
133510
133522
|
var _b;
|
|
@@ -133612,7 +133624,7 @@ var NewsGridCard = function NewsGridCard(_a) {
|
|
|
133612
133624
|
}
|
|
133613
133625
|
};
|
|
133614
133626
|
var Host$9 = _styled.div(templateObject_2$a || (templateObject_2$a = __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) {
|
|
133615
|
-
return p.showHighlight && css$2(templateObject_1$
|
|
133627
|
+
return p.showHighlight && css$2(templateObject_1$l || (templateObject_1$l = __makeTemplateObject$l(["\n position: relative;\n &::after {\n ", ";\n }\n "], ["\n position: relative;\n &::after {\n ", ";\n }\n "])), BannerHighlightStyle);
|
|
133616
133628
|
});
|
|
133617
133629
|
var BannerHighlightStyle = css$2(templateObject_3$8 || (templateObject_3$8 = __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) {
|
|
133618
133630
|
return p.theme.palette.accent;
|
|
@@ -133639,7 +133651,7 @@ var KeywordsWrapper = _styled.div(templateObject_14$1 || (templateObject_14$1 =
|
|
|
133639
133651
|
return p.theme.palette.neutralTertiary;
|
|
133640
133652
|
});
|
|
133641
133653
|
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);
|
|
133642
|
-
var templateObject_1$
|
|
133654
|
+
var templateObject_1$l, templateObject_2$a, templateObject_3$8, templateObject_4$7, templateObject_5$5, templateObject_6$4, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;
|
|
133643
133655
|
|
|
133644
133656
|
var ErrorContainer = function ErrorContainer() {
|
|
133645
133657
|
return jsx$1(Host$8, {
|
|
@@ -133652,11 +133664,11 @@ var ErrorContainer = function ErrorContainer() {
|
|
|
133652
133664
|
var Host$8 = _styled.p.withConfig({
|
|
133653
133665
|
displayName: "ErrorContainer__Host",
|
|
133654
133666
|
componentId: "sc-499uwc-0"
|
|
133655
|
-
})(templateObject_1$
|
|
133667
|
+
})(templateObject_1$k || (templateObject_1$k = __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) {
|
|
133656
133668
|
return p.theme.palette.red;
|
|
133657
133669
|
}, spacingM);
|
|
133658
133670
|
|
|
133659
|
-
var templateObject_1$
|
|
133671
|
+
var templateObject_1$k;
|
|
133660
133672
|
|
|
133661
133673
|
var NewsGrid = function NewsGrid(_a) {
|
|
133662
133674
|
var filter = _a.filter,
|
|
@@ -133744,7 +133756,7 @@ var NewsGrid = function NewsGrid(_a) {
|
|
|
133744
133756
|
var Host$7 = _styled.div.withConfig({
|
|
133745
133757
|
displayName: "NewsGrid__Host",
|
|
133746
133758
|
componentId: "sc-8ugpfz-0"
|
|
133747
|
-
})(templateObject_1$
|
|
133759
|
+
})(templateObject_1$j || (templateObject_1$j = __makeTemplateObject$l([""], [""])));
|
|
133748
133760
|
|
|
133749
133761
|
var Inner$1 = _styled.div.withConfig({
|
|
133750
133762
|
displayName: "NewsGrid__Inner",
|
|
@@ -133760,7 +133772,7 @@ _styled(NewsGridCard).withConfig({
|
|
|
133760
133772
|
return css$2(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject$l(["\n width: calc(100% / ", " - ", "px);\n "], ["\n width: calc(100% / ", " - ", "px);\n "])), p.columnCount, spacingM);
|
|
133761
133773
|
});
|
|
133762
133774
|
|
|
133763
|
-
var templateObject_1$
|
|
133775
|
+
var templateObject_1$j, templateObject_2$9, templateObject_3$7, templateObject_4$6, templateObject_5$4;
|
|
133764
133776
|
|
|
133765
133777
|
var HeroSlide = function HeroSlide(_a) {
|
|
133766
133778
|
var item = _a.item,
|
|
@@ -133905,7 +133917,7 @@ var Host$6 = _styled.div.withConfig({
|
|
|
133905
133917
|
displayName: "HeroSlide__Host",
|
|
133906
133918
|
componentId: "sc-3yofth-0"
|
|
133907
133919
|
})(templateObject_7 || (templateObject_7 = __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) {
|
|
133908
|
-
return p.width ? css$2(templateObject_1$
|
|
133920
|
+
return p.width ? css$2(templateObject_1$i || (templateObject_1$i = __makeTemplateObject$l(["\n width: ", ";\n "], ["\n width: ", ";\n "])), p.width) : css$2(templateObject_2$8 || (templateObject_2$8 = __makeTemplateObject$l(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
|
|
133909
133921
|
}, function (p) {
|
|
133910
133922
|
return p.height ? css$2(templateObject_3$6 || (templateObject_3$6 = __makeTemplateObject$l(["\n height: ", ";\n "], ["\n height: ", ";\n "])), p.height) : css$2(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject$l(["\n height: 100%;\n "], ["\n height: 100%;\n "])));
|
|
133911
133923
|
}, function (p) {
|
|
@@ -134025,7 +134037,7 @@ var StyledDateTime = _styled(DateTime).withConfig({
|
|
|
134025
134037
|
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);
|
|
134026
134038
|
});
|
|
134027
134039
|
|
|
134028
|
-
var templateObject_1$
|
|
134040
|
+
var templateObject_1$i, templateObject_2$8, templateObject_3$6, templateObject_4$5, templateObject_5$3, templateObject_6$3, templateObject_7, templateObject_8, templateObject_9, templateObject_10, 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;
|
|
134029
134041
|
|
|
134030
134042
|
var HeroPaging = function HeroPaging(_a) {
|
|
134031
134043
|
var items = _a.items,
|
|
@@ -134146,7 +134158,7 @@ function getWrappedIndex(index, max) {
|
|
|
134146
134158
|
var PagingHost = _styled.div.withConfig({
|
|
134147
134159
|
displayName: "HeroPaging__PagingHost",
|
|
134148
134160
|
componentId: "sc-1y3j8qb-0"
|
|
134149
|
-
})(templateObject_1$
|
|
134161
|
+
})(templateObject_1$h || (templateObject_1$h = __makeTemplateObject$l(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
134150
134162
|
|
|
134151
134163
|
var Paging = _styled.ul.withConfig({
|
|
134152
134164
|
displayName: "HeroPaging__Paging",
|
|
@@ -134172,7 +134184,7 @@ var PagingArrow = _styled(IconButton).withConfig({
|
|
|
134172
134184
|
componentId: "sc-1y3j8qb-4"
|
|
134173
134185
|
})(templateObject_6$2 || (templateObject_6$2 = __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"])));
|
|
134174
134186
|
|
|
134175
|
-
var templateObject_1$
|
|
134187
|
+
var templateObject_1$h, templateObject_2$7, templateObject_3$5, templateObject_4$4, templateObject_5$2, templateObject_6$2;
|
|
134176
134188
|
|
|
134177
134189
|
var Hero = function Hero(_a) {
|
|
134178
134190
|
var items = _a.items,
|
|
@@ -134239,9 +134251,9 @@ var Hero = function Hero(_a) {
|
|
|
134239
134251
|
var StyledCarousel = _styled(Carousel).withConfig({
|
|
134240
134252
|
displayName: "Hero__StyledCarousel",
|
|
134241
134253
|
componentId: "sc-55ys37-0"
|
|
134242
|
-
})(templateObject_1$
|
|
134254
|
+
})(templateObject_1$g || (templateObject_1$g = __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);
|
|
134243
134255
|
|
|
134244
|
-
var templateObject_1$
|
|
134256
|
+
var templateObject_1$g;
|
|
134245
134257
|
|
|
134246
134258
|
var NewsHero = function NewsHero(_a) {
|
|
134247
134259
|
var filter = _a.filter,
|
|
@@ -134394,15 +134406,15 @@ var NewsHero = function NewsHero(_a) {
|
|
|
134394
134406
|
var StyledChannels = _styled(ChannelList$1).withConfig({
|
|
134395
134407
|
displayName: "NewsHero__StyledChannels",
|
|
134396
134408
|
componentId: "sc-i9ar0j-0"
|
|
134397
|
-
})(templateObject_1$
|
|
134409
|
+
})(templateObject_1$f || (templateObject_1$f = __makeTemplateObject$l(["\n [data-channels] {\n justify-content: flex-end;\n }\n"], ["\n [data-channels] {\n justify-content: flex-end;\n }\n"])));
|
|
134398
134410
|
|
|
134399
|
-
var templateObject_1$
|
|
134411
|
+
var templateObject_1$f;
|
|
134400
134412
|
|
|
134401
134413
|
// a string of all valid unicode whitespaces
|
|
134402
134414
|
// eslint-disable-next-line max-len
|
|
134403
134415
|
var whitespaces$2 = '\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';
|
|
134404
134416
|
|
|
134405
|
-
var requireObjectCoercible = requireObjectCoercible$m;
|
|
134417
|
+
var requireObjectCoercible$1 = requireObjectCoercible$m;
|
|
134406
134418
|
var whitespaces$1 = whitespaces$2;
|
|
134407
134419
|
|
|
134408
134420
|
var whitespace = '[' + whitespaces$1 + ']';
|
|
@@ -134412,7 +134424,7 @@ var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
|
134412
134424
|
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
134413
134425
|
var createMethod = function (TYPE) {
|
|
134414
134426
|
return function ($this) {
|
|
134415
|
-
var string = String(requireObjectCoercible($this));
|
|
134427
|
+
var string = String(requireObjectCoercible$1($this));
|
|
134416
134428
|
if (TYPE & 1) string = string.replace(ltrim, '');
|
|
134417
134429
|
if (TYPE & 2) string = string.replace(rtrim, '');
|
|
134418
134430
|
return string;
|
|
@@ -134457,7 +134469,7 @@ $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
|
|
134457
134469
|
});
|
|
134458
134470
|
|
|
134459
134471
|
var redefine = redefine$k.exports;
|
|
134460
|
-
var anObject = anObject$v;
|
|
134472
|
+
var anObject$1 = anObject$v;
|
|
134461
134473
|
var fails = fails$w;
|
|
134462
134474
|
var flags = regexpFlags$1;
|
|
134463
134475
|
|
|
@@ -134473,7 +134485,7 @@ var INCORRECT_NAME = nativeToString.name != TO_STRING;
|
|
|
134473
134485
|
// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
|
|
134474
134486
|
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
134475
134487
|
redefine(RegExp.prototype, TO_STRING, function toString() {
|
|
134476
|
-
var R = anObject(this);
|
|
134488
|
+
var R = anObject$1(this);
|
|
134477
134489
|
var p = String(R.source);
|
|
134478
134490
|
var rf = R.flags;
|
|
134479
134491
|
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
|
|
@@ -134564,7 +134576,7 @@ var GroupsDropdown = function GroupsDropdown(_a) {
|
|
|
134564
134576
|
var StyledDropdown = _styled(Dropdown).withConfig({
|
|
134565
134577
|
displayName: "GroupsDropdown__StyledDropdown",
|
|
134566
134578
|
componentId: "sc-cmsnyu-0"
|
|
134567
|
-
})(templateObject_1$
|
|
134579
|
+
})(templateObject_1$e || (templateObject_1$e = __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) {
|
|
134568
134580
|
return p.theme.textColors.onAccent;
|
|
134569
134581
|
}, function (p) {
|
|
134570
134582
|
return p.theme.palette.accent;
|
|
@@ -134584,7 +134596,7 @@ var Title = _styled.div.withConfig({
|
|
|
134584
134596
|
|
|
134585
134597
|
var GlobalDropdownStyles = createGlobalStyle(templateObject_4$3 || (templateObject_4$3 = __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);
|
|
134586
134598
|
|
|
134587
|
-
var templateObject_1$
|
|
134599
|
+
var templateObject_1$e, templateObject_2$6, templateObject_3$4, templateObject_4$3;
|
|
134588
134600
|
|
|
134589
134601
|
var TaskButton = function TaskButton(_a) {
|
|
134590
134602
|
var count = _a.count,
|
|
@@ -134626,9 +134638,9 @@ var TaskButton = function TaskButton(_a) {
|
|
|
134626
134638
|
var ToggleButton = _styled(DefaultButton).withConfig({
|
|
134627
134639
|
displayName: "TaskButton__ToggleButton",
|
|
134628
134640
|
componentId: "sc-8eylsw-0"
|
|
134629
|
-
})(templateObject_1$
|
|
134641
|
+
})(templateObject_1$d || (templateObject_1$d = __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);
|
|
134630
134642
|
|
|
134631
|
-
var templateObject_1$
|
|
134643
|
+
var templateObject_1$d;
|
|
134632
134644
|
|
|
134633
134645
|
var TaskButtons = function TaskButtons(_a) {
|
|
134634
134646
|
var type = _a.type,
|
|
@@ -134694,9 +134706,9 @@ var TaskButtons = function TaskButtons(_a) {
|
|
|
134694
134706
|
var Host$5 = _styled.div.withConfig({
|
|
134695
134707
|
displayName: "TaskButtons__Host",
|
|
134696
134708
|
componentId: "sc-sw0zei-0"
|
|
134697
|
-
})(templateObject_1$
|
|
134709
|
+
})(templateObject_1$c || (templateObject_1$c = __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"])));
|
|
134698
134710
|
|
|
134699
|
-
var templateObject_1$
|
|
134711
|
+
var templateObject_1$c;
|
|
134700
134712
|
|
|
134701
134713
|
var NewArticleButton = function NewArticleButton(_a) {
|
|
134702
134714
|
var groupId = _a.groupId,
|
|
@@ -134838,7 +134850,7 @@ var NewsEditorDashboard = function NewsEditorDashboard(_a) {
|
|
|
134838
134850
|
}).length;
|
|
134839
134851
|
}
|
|
134840
134852
|
};
|
|
134841
|
-
var MessageBarStyle = createGlobalStyle(templateObject_1$
|
|
134853
|
+
var MessageBarStyle = createGlobalStyle(templateObject_1$b || (templateObject_1$b = __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);
|
|
134842
134854
|
|
|
134843
134855
|
var StyledEditorListItem = _styled(EditorListItem).withConfig({
|
|
134844
134856
|
displayName: "NewsEditorDashboard__StyledEditorListItem",
|
|
@@ -134865,7 +134877,7 @@ var StyledNewArticleButton = _styled(NewArticleButton).withConfig({
|
|
|
134865
134877
|
componentId: "sc-vv9dzu-4"
|
|
134866
134878
|
})(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n align-self: flex-start;\n"], ["\n margin-bottom: ", "px;\n align-self: flex-start;\n"])), spacingXs);
|
|
134867
134879
|
|
|
134868
|
-
var templateObject_1$
|
|
134880
|
+
var templateObject_1$b, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1;
|
|
134869
134881
|
|
|
134870
134882
|
// NOTE: This component exists in this project and not in the ui/common/toolbar because it uses DetailViewContext placed in feature/content/
|
|
134871
134883
|
// Also a generic component `ToolbarLanguageSelector` in ui/common/toolbar complicates the flow and requires some code duplication
|
|
@@ -134906,9 +134918,9 @@ var ToolbarNewsLanguageSelector = function ToolbarNewsLanguageSelector(_a) {
|
|
|
134906
134918
|
var LanguageMenuButton = _styled(LanguageSelector).withConfig({
|
|
134907
134919
|
displayName: "ToolbarNewsLanguageSelector__LanguageMenuButton",
|
|
134908
134920
|
componentId: "sc-1xe5l19-0"
|
|
134909
|
-
})(templateObject_1$
|
|
134921
|
+
})(templateObject_1$a || (templateObject_1$a = __makeTemplateObject$l(["\n && {\n i {\n font-size: ", "px;\n }\n }\n"], ["\n && {\n i {\n font-size: ", "px;\n }\n }\n"])), fontSizeNormal);
|
|
134910
134922
|
|
|
134911
|
-
var templateObject_1$
|
|
134923
|
+
var templateObject_1$a;
|
|
134912
134924
|
|
|
134913
134925
|
var ToolbarManageNewsItemButton = function ToolbarManageNewsItemButton(_a) {
|
|
134914
134926
|
var onClick = _a.onClick;
|
|
@@ -135034,9 +135046,9 @@ var NewsDetailPreviewInternal = function NewsDetailPreviewInternal() {
|
|
|
135034
135046
|
var Host$4 = _styled.div.withConfig({
|
|
135035
135047
|
displayName: "NewsDetailPreview__Host",
|
|
135036
135048
|
componentId: "sc-17gmqax-0"
|
|
135037
|
-
})(templateObject_1$
|
|
135049
|
+
})(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject$l([""], [""])));
|
|
135038
135050
|
|
|
135039
|
-
var templateObject_1$
|
|
135051
|
+
var templateObject_1$9;
|
|
135040
135052
|
|
|
135041
135053
|
var FilterContext = /*#__PURE__*/createContext(null);
|
|
135042
135054
|
var FilterContextProvider = function FilterContextProvider(_a) {
|
|
@@ -135070,9 +135082,9 @@ var ToolbarFilterPanel = function ToolbarFilterPanel(_a) {
|
|
|
135070
135082
|
var Host$3 = _styled.div.withConfig({
|
|
135071
135083
|
displayName: "ToolbarFilterPanel__Host",
|
|
135072
135084
|
componentId: "sc-118p488-0"
|
|
135073
|
-
})(templateObject_1$
|
|
135085
|
+
})(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject$l(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
135074
135086
|
|
|
135075
|
-
var templateObject_1$
|
|
135087
|
+
var templateObject_1$8;
|
|
135076
135088
|
|
|
135077
135089
|
var ToolbarFilterCalloutButton = function ToolbarFilterCalloutButton(_a) {
|
|
135078
135090
|
var buttonText = _a.buttonText,
|
|
@@ -135131,7 +135143,7 @@ var ToolbarFilterCalloutButton = function ToolbarFilterCalloutButton(_a) {
|
|
|
135131
135143
|
var Host$2 = _styled.div.withConfig({
|
|
135132
135144
|
displayName: "ToolbarFilterCalloutButton__Host",
|
|
135133
135145
|
componentId: "sc-fu36ma-0"
|
|
135134
|
-
})(templateObject_1$
|
|
135146
|
+
})(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject$l(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
135135
135147
|
|
|
135136
135148
|
var Button = _styled(ActionButton).withConfig({
|
|
135137
135149
|
displayName: "ToolbarFilterCalloutButton__Button",
|
|
@@ -135145,7 +135157,7 @@ var ClearFilterButton = _styled(DefaultButton).withConfig({
|
|
|
135145
135157
|
componentId: "sc-fu36ma-2"
|
|
135146
135158
|
})(templateObject_4$1 || (templateObject_4$1 = __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"])));
|
|
135147
135159
|
|
|
135148
|
-
var templateObject_1$
|
|
135160
|
+
var templateObject_1$7, templateObject_2$4, templateObject_3$2, templateObject_4$1;
|
|
135149
135161
|
|
|
135150
135162
|
var FilterLogicalOperators = function FilterLogicalOperators(_a) {
|
|
135151
135163
|
var onChange = _a.onChange,
|
|
@@ -135192,14 +135204,14 @@ var FilterLogicalOperators = function FilterLogicalOperators(_a) {
|
|
|
135192
135204
|
var StyledChoiceGroup = _styled(ChoiceGroup).withConfig({
|
|
135193
135205
|
displayName: "FilterLogicalOperators__StyledChoiceGroup",
|
|
135194
135206
|
componentId: "sc-10bpjo8-0"
|
|
135195
|
-
})(templateObject_1$
|
|
135207
|
+
})(templateObject_1$6 || (templateObject_1$6 = __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);
|
|
135196
135208
|
|
|
135197
135209
|
var Operator = _styled.span.withConfig({
|
|
135198
135210
|
displayName: "FilterLogicalOperators__Operator",
|
|
135199
135211
|
componentId: "sc-10bpjo8-1"
|
|
135200
135212
|
})(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject$l(["\n text-transform: capitalize;\n"], ["\n text-transform: capitalize;\n"])));
|
|
135201
135213
|
|
|
135202
|
-
var templateObject_1$
|
|
135214
|
+
var templateObject_1$6, templateObject_2$3;
|
|
135203
135215
|
|
|
135204
135216
|
var ChannelFilter = function ChannelFilter(_a) {
|
|
135205
135217
|
var _b, _c, _d, _f, _g, _h;
|
|
@@ -135350,7 +135362,7 @@ var visibleChannels = 8;
|
|
|
135350
135362
|
var Channels = _styled.div.withConfig({
|
|
135351
135363
|
displayName: "ChannelFilter__Channels",
|
|
135352
135364
|
componentId: "sc-1ju8xwz-0"
|
|
135353
|
-
})(templateObject_1$
|
|
135365
|
+
})(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n max-height: ", "px;\n overflow-y: auto;\n"], ["\n margin-bottom: ", "px;\n max-height: ", "px;\n overflow-y: auto;\n"])), spacingM, channelRowHeight * visibleChannels);
|
|
135354
135366
|
|
|
135355
135367
|
var StyledCheckbox$1 = _styled(Checkbox).withConfig({
|
|
135356
135368
|
displayName: "ChannelFilter__StyledCheckbox",
|
|
@@ -135362,7 +135374,7 @@ var StyledTextField$1 = _styled(TextField).withConfig({
|
|
|
135362
135374
|
componentId: "sc-1ju8xwz-2"
|
|
135363
135375
|
})(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject$l(["\n padding-bottom: ", "px;\n"], ["\n padding-bottom: ", "px;\n"])), spacingM);
|
|
135364
135376
|
|
|
135365
|
-
var templateObject_1$
|
|
135377
|
+
var templateObject_1$5, templateObject_2$2, templateObject_3$1;
|
|
135366
135378
|
|
|
135367
135379
|
function toInteger(dirtyNumber) {
|
|
135368
135380
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
@@ -138283,7 +138295,7 @@ var DateShortcutButton = function DateShortcutButton(_a) {
|
|
|
138283
138295
|
var StyledDateTimePicker = _styled(DateTimePicker).withConfig({
|
|
138284
138296
|
displayName: "PublishingDateFilter__StyledDateTimePicker",
|
|
138285
138297
|
componentId: "sc-zv88cu-0"
|
|
138286
|
-
})(templateObject_1$
|
|
138298
|
+
})(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), spacingS);
|
|
138287
138299
|
|
|
138288
138300
|
var DateShortcuts = _styled.div.withConfig({
|
|
138289
138301
|
displayName: "PublishingDateFilter__DateShortcuts",
|
|
@@ -138292,7 +138304,7 @@ var DateShortcuts = _styled.div.withConfig({
|
|
|
138292
138304
|
return p.theme.palette.themePrimary;
|
|
138293
138305
|
});
|
|
138294
138306
|
|
|
138295
|
-
var templateObject_1$
|
|
138307
|
+
var templateObject_1$4, templateObject_2$1;
|
|
138296
138308
|
|
|
138297
138309
|
var ClearAllFiltersButton = function ClearAllFiltersButton(_a) {
|
|
138298
138310
|
var onClick = _a.onClick;
|
|
@@ -138375,9 +138387,9 @@ var KeywordsFilter = function KeywordsFilter() {
|
|
|
138375
138387
|
var StyledKeywordPicker = _styled(KeywordPicker).withConfig({
|
|
138376
138388
|
displayName: "KeywordsFilter__StyledKeywordPicker",
|
|
138377
138389
|
componentId: "sc-1aoeg5i-0"
|
|
138378
|
-
})(templateObject_1$
|
|
138390
|
+
})(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n overflow: hidden;\n\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\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\n div:last-child {\n margin-bottom: 0;\n }\n }\n"])), spacingM);
|
|
138379
138391
|
|
|
138380
|
-
var templateObject_1$
|
|
138392
|
+
var templateObject_1$3;
|
|
138381
138393
|
|
|
138382
138394
|
var EmptyFilterSearchResult = function EmptyFilterSearchResult() {
|
|
138383
138395
|
return jsxs(Host$1, {
|
|
@@ -138390,8 +138402,8 @@ var EmptyFilterSearchResult = function EmptyFilterSearchResult() {
|
|
|
138390
138402
|
}, void 0)]
|
|
138391
138403
|
}, void 0);
|
|
138392
138404
|
};
|
|
138393
|
-
var Host$1 = _styled.div(templateObject_1$
|
|
138394
|
-
var templateObject_1$
|
|
138405
|
+
var Host$1 = _styled.div(templateObject_1$2 || (templateObject_1$2 = __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);
|
|
138406
|
+
var templateObject_1$2;
|
|
138395
138407
|
|
|
138396
138408
|
var AuthorFilter = function AuthorFilter() {
|
|
138397
138409
|
var _a;
|
|
@@ -138406,7 +138418,7 @@ var AuthorFilter = function AuthorFilter() {
|
|
|
138406
138418
|
searchText = _c[0],
|
|
138407
138419
|
setSearchText = _c[1];
|
|
138408
138420
|
|
|
138409
|
-
var debouncedSearchText = useDebounce(searchText.toLowerCase(), 500)[0];
|
|
138421
|
+
var debouncedSearchText = useDebounce$2(searchText.toLowerCase(), 500)[0];
|
|
138410
138422
|
var searchAccounts = useAccountApi().searchAccounts;
|
|
138411
138423
|
var showError = useNotificationContext().showError;
|
|
138412
138424
|
var authorsFromFilter = (_a = filter === null || filter === void 0 ? void 0 : filter.authors) !== null && _a !== void 0 ? _a : [];
|
|
@@ -138597,7 +138609,7 @@ var UserShimmer = function UserShimmer() {
|
|
|
138597
138609
|
var Host = _styled.div.withConfig({
|
|
138598
138610
|
displayName: "AuthorFilter__Host",
|
|
138599
138611
|
componentId: "sc-cnx0p9-0"
|
|
138600
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject$l(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
138612
|
+
})(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject$l(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
138601
138613
|
|
|
138602
138614
|
var rowHeight = 40;
|
|
138603
138615
|
var visibleUsers = 9;
|
|
@@ -138627,6 +138639,326 @@ var StyledAvatar = _styled(Avatar).withConfig({
|
|
|
138627
138639
|
componentId: "sc-cnx0p9-5"
|
|
138628
138640
|
})(templateObject_6 || (templateObject_6 = __makeTemplateObject$l(["\n .ms-Persona-primaryText {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 105px;\n }\n"], ["\n .ms-Persona-primaryText {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 105px;\n }\n"])));
|
|
138629
138641
|
|
|
138630
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
138642
|
+
var templateObject_1$1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
138643
|
+
|
|
138644
|
+
// `SameValue` abstract operation
|
|
138645
|
+
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
138646
|
+
var sameValue$1 = Object.is || function is(x, y) {
|
|
138647
|
+
// eslint-disable-next-line no-self-compare
|
|
138648
|
+
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
138649
|
+
};
|
|
138650
|
+
|
|
138651
|
+
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
138652
|
+
var anObject = anObject$v;
|
|
138653
|
+
var requireObjectCoercible = requireObjectCoercible$m;
|
|
138654
|
+
var sameValue = sameValue$1;
|
|
138655
|
+
var regExpExec = regexpExecAbstract;
|
|
138656
|
+
|
|
138657
|
+
// @@search logic
|
|
138658
|
+
fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
|
138659
|
+
return [
|
|
138660
|
+
// `String.prototype.search` method
|
|
138661
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.search
|
|
138662
|
+
function search(regexp) {
|
|
138663
|
+
var O = requireObjectCoercible(this);
|
|
138664
|
+
var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
|
138665
|
+
return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
|
138666
|
+
},
|
|
138667
|
+
// `RegExp.prototype[@@search]` method
|
|
138668
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
|
|
138669
|
+
function (regexp) {
|
|
138670
|
+
var res = maybeCallNative(nativeSearch, regexp, this);
|
|
138671
|
+
if (res.done) return res.value;
|
|
138672
|
+
|
|
138673
|
+
var rx = anObject(regexp);
|
|
138674
|
+
var S = String(this);
|
|
138675
|
+
|
|
138676
|
+
var previousLastIndex = rx.lastIndex;
|
|
138677
|
+
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
138678
|
+
var result = regExpExec(rx, S);
|
|
138679
|
+
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
138680
|
+
return result === null ? -1 : result.index;
|
|
138681
|
+
}
|
|
138682
|
+
];
|
|
138683
|
+
});
|
|
138684
|
+
|
|
138685
|
+
var lib = {};
|
|
138686
|
+
|
|
138687
|
+
var useDebounce$1 = {};
|
|
138688
|
+
|
|
138689
|
+
var useDebouncedCallback$2 = {};
|
|
138690
|
+
|
|
138691
|
+
Object.defineProperty(useDebouncedCallback$2, "__esModule", { value: true });
|
|
138692
|
+
var react_1$1 = React__default;
|
|
138693
|
+
function useDebouncedCallback$1(callback, delay, options) {
|
|
138694
|
+
if (options === void 0) { options = {}; }
|
|
138695
|
+
var maxWait = options.maxWait;
|
|
138696
|
+
var maxWaitHandler = react_1$1.useRef(null);
|
|
138697
|
+
var maxWaitArgs = react_1$1.useRef([]);
|
|
138698
|
+
var leading = options.leading;
|
|
138699
|
+
var trailing = options.trailing === undefined ? true : options.trailing;
|
|
138700
|
+
var leadingCall = react_1$1.useRef(false);
|
|
138701
|
+
var functionTimeoutHandler = react_1$1.useRef(null);
|
|
138702
|
+
var isComponentUnmounted = react_1$1.useRef(false);
|
|
138703
|
+
var debouncedFunction = react_1$1.useRef(callback);
|
|
138704
|
+
debouncedFunction.current = callback;
|
|
138705
|
+
var cancelDebouncedCallback = react_1$1.useCallback(function () {
|
|
138706
|
+
clearTimeout(functionTimeoutHandler.current);
|
|
138707
|
+
clearTimeout(maxWaitHandler.current);
|
|
138708
|
+
maxWaitHandler.current = null;
|
|
138709
|
+
maxWaitArgs.current = [];
|
|
138710
|
+
functionTimeoutHandler.current = null;
|
|
138711
|
+
leadingCall.current = false;
|
|
138712
|
+
}, []);
|
|
138713
|
+
react_1$1.useEffect(function () { return function () {
|
|
138714
|
+
// we use flag, as we allow to call callPending outside the hook
|
|
138715
|
+
isComponentUnmounted.current = true;
|
|
138716
|
+
}; }, []);
|
|
138717
|
+
var debouncedCallback = react_1$1.useCallback(function () {
|
|
138718
|
+
var args = [];
|
|
138719
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
138720
|
+
args[_i] = arguments[_i];
|
|
138721
|
+
}
|
|
138722
|
+
maxWaitArgs.current = args;
|
|
138723
|
+
clearTimeout(functionTimeoutHandler.current);
|
|
138724
|
+
if (leadingCall.current) {
|
|
138725
|
+
leadingCall.current = false;
|
|
138726
|
+
}
|
|
138727
|
+
if (!functionTimeoutHandler.current && leading && !leadingCall.current) {
|
|
138728
|
+
debouncedFunction.current.apply(debouncedFunction, args);
|
|
138729
|
+
leadingCall.current = true;
|
|
138730
|
+
}
|
|
138731
|
+
functionTimeoutHandler.current = setTimeout(function () {
|
|
138732
|
+
var shouldCallFunction = true;
|
|
138733
|
+
if (leading && leadingCall.current) {
|
|
138734
|
+
shouldCallFunction = false;
|
|
138735
|
+
}
|
|
138736
|
+
cancelDebouncedCallback();
|
|
138737
|
+
if (!isComponentUnmounted.current && trailing && shouldCallFunction) {
|
|
138738
|
+
debouncedFunction.current.apply(debouncedFunction, args);
|
|
138739
|
+
}
|
|
138740
|
+
}, delay);
|
|
138741
|
+
if (maxWait && !maxWaitHandler.current && trailing) {
|
|
138742
|
+
maxWaitHandler.current = setTimeout(function () {
|
|
138743
|
+
var args = maxWaitArgs.current;
|
|
138744
|
+
cancelDebouncedCallback();
|
|
138745
|
+
if (!isComponentUnmounted.current) {
|
|
138746
|
+
debouncedFunction.current.apply(null, args);
|
|
138747
|
+
}
|
|
138748
|
+
}, maxWait);
|
|
138749
|
+
}
|
|
138750
|
+
}, [maxWait, delay, cancelDebouncedCallback, leading, trailing]);
|
|
138751
|
+
var callPending = react_1$1.useCallback(function () {
|
|
138752
|
+
// Call pending callback only if we have anything in our queue
|
|
138753
|
+
if (!functionTimeoutHandler.current) {
|
|
138754
|
+
return;
|
|
138755
|
+
}
|
|
138756
|
+
debouncedFunction.current.apply(null, maxWaitArgs.current);
|
|
138757
|
+
cancelDebouncedCallback();
|
|
138758
|
+
}, [cancelDebouncedCallback]);
|
|
138759
|
+
// At the moment, we use 3 args array so that we save backward compatibility
|
|
138760
|
+
return [debouncedCallback, cancelDebouncedCallback, callPending];
|
|
138761
|
+
}
|
|
138762
|
+
useDebouncedCallback$2.default = useDebouncedCallback$1;
|
|
138763
|
+
|
|
138764
|
+
Object.defineProperty(useDebounce$1, "__esModule", { value: true });
|
|
138765
|
+
var react_1 = React__default;
|
|
138766
|
+
var useDebouncedCallback_1$1 = useDebouncedCallback$2;
|
|
138767
|
+
function valueEquality(left, right) {
|
|
138768
|
+
return left === right;
|
|
138769
|
+
}
|
|
138770
|
+
function useDebounce(value, delay, options) {
|
|
138771
|
+
var eq = options && options.equalityFn ? options.equalityFn : valueEquality;
|
|
138772
|
+
var _a = react_1.useState(value), state = _a[0], dispatch = _a[1];
|
|
138773
|
+
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];
|
|
138774
|
+
var previousValue = react_1.useRef(value);
|
|
138775
|
+
react_1.useEffect(function () {
|
|
138776
|
+
// We need to use this condition otherwise we will run debounce timer for the first render (including maxWait option)
|
|
138777
|
+
if (!eq(previousValue.current, value)) {
|
|
138778
|
+
callback(value);
|
|
138779
|
+
previousValue.current = value;
|
|
138780
|
+
}
|
|
138781
|
+
}, [value, callback, eq]);
|
|
138782
|
+
return [state, cancel, callPending];
|
|
138783
|
+
}
|
|
138784
|
+
useDebounce$1.default = useDebounce;
|
|
138785
|
+
|
|
138786
|
+
Object.defineProperty(lib, "__esModule", { value: true });
|
|
138787
|
+
var useDebounce_1 = useDebounce$1;
|
|
138788
|
+
lib.useDebounce = useDebounce_1.default;
|
|
138789
|
+
var useDebouncedCallback_1 = useDebouncedCallback$2;
|
|
138790
|
+
var useDebouncedCallback = lib.useDebouncedCallback = useDebouncedCallback_1.default;
|
|
138791
|
+
|
|
138792
|
+
var VerticalFilterPanel = function VerticalFilterPanel(_a) {
|
|
138793
|
+
var filter = _a.filter,
|
|
138794
|
+
onChange = _a.onChange,
|
|
138795
|
+
onDismiss = _a.onDismiss,
|
|
138796
|
+
className = _a.className,
|
|
138797
|
+
children = _a.children;
|
|
138798
|
+
return jsx$1(FilterContextProvider, __assign$g({
|
|
138799
|
+
filter: filter,
|
|
138800
|
+
onChange: onChange
|
|
138801
|
+
}, {
|
|
138802
|
+
children: jsx$1(VerticalFilterPanelInternal, __assign$g({
|
|
138803
|
+
className: className,
|
|
138804
|
+
onDismiss: onDismiss
|
|
138805
|
+
}, {
|
|
138806
|
+
children: children
|
|
138807
|
+
}), void 0)
|
|
138808
|
+
}), void 0);
|
|
138809
|
+
};
|
|
138810
|
+
|
|
138811
|
+
var VerticalFilterPanelInternal = function VerticalFilterPanelInternal(_a) {
|
|
138812
|
+
var onDismiss = _a.onDismiss,
|
|
138813
|
+
className = _a.className,
|
|
138814
|
+
children = _a.children;
|
|
138815
|
+
var formatMessage = useIntl().formatMessage;
|
|
138816
|
+
|
|
138817
|
+
var _b = useContext(FilterContext),
|
|
138818
|
+
filter = _b.filter,
|
|
138819
|
+
onChange = _b.onChange;
|
|
138820
|
+
|
|
138821
|
+
var _c = useState$2((filter === null || filter === void 0 ? void 0 : filter.search) || ''),
|
|
138822
|
+
searchText = _c[0],
|
|
138823
|
+
setSearchText = _c[1];
|
|
138824
|
+
|
|
138825
|
+
var _d = useDebouncedCallback(onChange, 500),
|
|
138826
|
+
debouncedOnChange = _d[0],
|
|
138827
|
+
cancelDebounce = _d[1];
|
|
138828
|
+
|
|
138829
|
+
var textColors = useContext(ThemeContext$1).theme.textColors;
|
|
138830
|
+
useEffectOnUpdate(function () {
|
|
138831
|
+
if ((filter === null || filter === void 0 ? void 0 : filter.search) !== searchText) {
|
|
138832
|
+
setSearchText((filter === null || filter === void 0 ? void 0 : filter.search) || '');
|
|
138833
|
+
}
|
|
138834
|
+
}, [filter === null || filter === void 0 ? void 0 : filter.search]);
|
|
138835
|
+
return jsxs("div", __assign$g({
|
|
138836
|
+
className: className
|
|
138837
|
+
}, {
|
|
138838
|
+
children: [jsx$1(SearchBox$1, {
|
|
138839
|
+
placeholder: formatMessage({
|
|
138840
|
+
id: 'Generic.search'
|
|
138841
|
+
}),
|
|
138842
|
+
value: searchText,
|
|
138843
|
+
onChange: function (_, text) {
|
|
138844
|
+
setSearchText(text);
|
|
138845
|
+
debouncedOnChange({
|
|
138846
|
+
search: text
|
|
138847
|
+
});
|
|
138848
|
+
},
|
|
138849
|
+
onSearch: function (text) {
|
|
138850
|
+
cancelDebounce();
|
|
138851
|
+
onChange({
|
|
138852
|
+
search: text
|
|
138853
|
+
});
|
|
138854
|
+
},
|
|
138855
|
+
iconProps: {
|
|
138856
|
+
style: {
|
|
138857
|
+
color: textColors.default
|
|
138858
|
+
}
|
|
138859
|
+
}
|
|
138860
|
+
}, void 0), children, jsxs(ButtonsHost, {
|
|
138861
|
+
children: [jsx$1(DefaultButton, {
|
|
138862
|
+
iconProps: {
|
|
138863
|
+
iconName: 'ClearFilter'
|
|
138864
|
+
},
|
|
138865
|
+
text: formatMessage({
|
|
138866
|
+
id: 'FilterPanel.clearFilterText'
|
|
138867
|
+
}),
|
|
138868
|
+
onClick: function () {
|
|
138869
|
+
setSearchText('');
|
|
138870
|
+
onChange(null);
|
|
138871
|
+
}
|
|
138872
|
+
}, void 0), jsx$1(DefaultButton, {
|
|
138873
|
+
text: formatMessage({
|
|
138874
|
+
id: 'Generic.close'
|
|
138875
|
+
}),
|
|
138876
|
+
onClick: onDismiss
|
|
138877
|
+
}, void 0)]
|
|
138878
|
+
}, void 0)]
|
|
138879
|
+
}), void 0);
|
|
138880
|
+
};
|
|
138881
|
+
|
|
138882
|
+
var ButtonsHost = _styled.div.withConfig({
|
|
138883
|
+
displayName: "VerticalFilterPanel__ButtonsHost",
|
|
138884
|
+
componentId: "sc-12j7kak-0"
|
|
138885
|
+
})(templateObject_1 || (templateObject_1 = __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"])));
|
|
138886
|
+
|
|
138887
|
+
var templateObject_1;
|
|
138888
|
+
|
|
138889
|
+
var ToolbarFilterModal = function ToolbarFilterModal(_a) {
|
|
138890
|
+
var filter = _a.filter,
|
|
138891
|
+
onChange = _a.onChange,
|
|
138892
|
+
isOpen = _a.isOpen,
|
|
138893
|
+
onDismiss = _a.onDismiss,
|
|
138894
|
+
children = _a.children;
|
|
138895
|
+
var formatMessage = useIntl().formatMessage;
|
|
138896
|
+
return jsx$1(Dialog, __assign$g({
|
|
138897
|
+
hidden: !isOpen,
|
|
138898
|
+
onDismiss: onDismiss,
|
|
138899
|
+
modalProps: {
|
|
138900
|
+
isBlocking: true
|
|
138901
|
+
},
|
|
138902
|
+
dialogContentProps: {
|
|
138903
|
+
title: formatMessage({
|
|
138904
|
+
id: 'FilterPanel.filterModal.title'
|
|
138905
|
+
}),
|
|
138906
|
+
showCloseButton: false
|
|
138907
|
+
},
|
|
138908
|
+
styles: {
|
|
138909
|
+
main: {
|
|
138910
|
+
minWidth: '340px !important'
|
|
138911
|
+
}
|
|
138912
|
+
}
|
|
138913
|
+
}, {
|
|
138914
|
+
children: jsx$1(VerticalFilterPanel, __assign$g({
|
|
138915
|
+
filter: filter,
|
|
138916
|
+
onChange: onChange,
|
|
138917
|
+
onDismiss: onDismiss
|
|
138918
|
+
}, {
|
|
138919
|
+
children: children
|
|
138920
|
+
}), void 0)
|
|
138921
|
+
}), void 0);
|
|
138922
|
+
};
|
|
138923
|
+
|
|
138924
|
+
var ToolbarFilterModalButton = function ToolbarFilterModalButton(_a) {
|
|
138925
|
+
var filter = _a.filter,
|
|
138926
|
+
onChange = _a.onChange,
|
|
138927
|
+
children = _a.children;
|
|
138928
|
+
|
|
138929
|
+
var _b = useState$2(false),
|
|
138930
|
+
isOpen = _b[0],
|
|
138931
|
+
setIsOpen = _b[1];
|
|
138932
|
+
|
|
138933
|
+
return jsxs(Fragment, {
|
|
138934
|
+
children: [jsx$1(ActionButton, {
|
|
138935
|
+
iconProps: {
|
|
138936
|
+
iconName: hasFilter() ? 'FilterSolid' : 'Filter'
|
|
138937
|
+
},
|
|
138938
|
+
onClick: function () {
|
|
138939
|
+
return setIsOpen(true);
|
|
138940
|
+
}
|
|
138941
|
+
}, void 0), jsx$1(ToolbarFilterModal, __assign$g({
|
|
138942
|
+
isOpen: isOpen,
|
|
138943
|
+
onDismiss: function () {
|
|
138944
|
+
return setIsOpen(false);
|
|
138945
|
+
},
|
|
138946
|
+
filter: filter,
|
|
138947
|
+
onChange: onChange
|
|
138948
|
+
}, {
|
|
138949
|
+
children: children
|
|
138950
|
+
}), void 0)]
|
|
138951
|
+
}, void 0);
|
|
138952
|
+
|
|
138953
|
+
function hasFilter() {
|
|
138954
|
+
if (filter == null) {
|
|
138955
|
+
return false;
|
|
138956
|
+
}
|
|
138957
|
+
|
|
138958
|
+
return Object.values(filter).filter(function (f) {
|
|
138959
|
+
return f != null && f !== '';
|
|
138960
|
+
}).length > 0;
|
|
138961
|
+
}
|
|
138962
|
+
};
|
|
138631
138963
|
|
|
138632
|
-
export { Avatar as A,
|
|
138964
|
+
export { Avatar as A, ToolbarFilterModal as B, ToolbarFilterModalButton as C, ChannelFilter as D, EventDetail as E, PublishingDateFilter as F, ClearAllFiltersButton as G, AuthorFilter as H, ItemLayoutMode as I, KeywordsFilter as K, ManageChannels as M, NewsDetail as N, PropTypes$2 as P, ReachContextProvider as R, 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 };
|