@livetiles/reach-components-react 0.4.0-preview.217 → 0.4.0-preview.220
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/en.async.esm.esm.js +2 -0
- package/index.esm2.js +2436 -46
- package/index.umd.js +2438 -46
- package/package.json +1 -1
package/index.esm2.js
CHANGED
|
@@ -1194,16 +1194,16 @@ var userAgent$5 = engineUserAgent$4;
|
|
|
1194
1194
|
var process$7 = global$r.process;
|
|
1195
1195
|
var versions$5 = process$7 && process$7.versions;
|
|
1196
1196
|
var v8$4 = versions$5 && versions$5.v8;
|
|
1197
|
-
var match$
|
|
1197
|
+
var match$7, version$a;
|
|
1198
1198
|
|
|
1199
1199
|
if (v8$4) {
|
|
1200
|
-
match$
|
|
1201
|
-
version$a = match$
|
|
1200
|
+
match$7 = v8$4.split('.');
|
|
1201
|
+
version$a = match$7[0] + match$7[1];
|
|
1202
1202
|
} else if (userAgent$5) {
|
|
1203
|
-
match$
|
|
1204
|
-
if (!match$
|
|
1205
|
-
match$
|
|
1206
|
-
if (match$
|
|
1203
|
+
match$7 = userAgent$5.match(/Edge\/(\d+)/);
|
|
1204
|
+
if (!match$7 || match$7[1] >= 74) {
|
|
1205
|
+
match$7 = userAgent$5.match(/Chrome\/(\d+)/);
|
|
1206
|
+
if (match$7) version$a = match$7[1];
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
1209
|
|
|
@@ -41498,17 +41498,17 @@ var userAgent$4 = engineUserAgent$3;
|
|
|
41498
41498
|
var process$1$3 = global$2$3.process;
|
|
41499
41499
|
var versions$3 = process$1$3 && process$1$3.versions;
|
|
41500
41500
|
var v8$3 = versions$3 && versions$3.v8;
|
|
41501
|
-
var match$
|
|
41501
|
+
var match$6, version$7;
|
|
41502
41502
|
|
|
41503
41503
|
if (v8$3) {
|
|
41504
|
-
match$
|
|
41505
|
-
version$7 = match$
|
|
41504
|
+
match$6 = v8$3.split('.');
|
|
41505
|
+
version$7 = match$6[0] + match$6[1];
|
|
41506
41506
|
} else if (userAgent$4) {
|
|
41507
|
-
match$
|
|
41507
|
+
match$6 = userAgent$4.match(/Edge\/(\d+)/);
|
|
41508
41508
|
|
|
41509
|
-
if (!match$
|
|
41510
|
-
match$
|
|
41511
|
-
if (match$
|
|
41509
|
+
if (!match$6 || match$6[1] >= 74) {
|
|
41510
|
+
match$6 = userAgent$4.match(/Chrome\/(\d+)/);
|
|
41511
|
+
if (match$6) version$7 = match$6[1];
|
|
41512
41512
|
}
|
|
41513
41513
|
}
|
|
41514
41514
|
|
|
@@ -49733,17 +49733,17 @@ var userAgent$3 = engineUserAgent$2;
|
|
|
49733
49733
|
var process$2$2 = global$4$2.process;
|
|
49734
49734
|
var versions$2 = process$2$2 && process$2$2.versions;
|
|
49735
49735
|
var v8$2 = versions$2 && versions$2.v8;
|
|
49736
|
-
var match$
|
|
49736
|
+
var match$5, version$6;
|
|
49737
49737
|
|
|
49738
49738
|
if (v8$2) {
|
|
49739
|
-
match$
|
|
49740
|
-
version$6 = match$
|
|
49739
|
+
match$5 = v8$2.split('.');
|
|
49740
|
+
version$6 = match$5[0] + match$5[1];
|
|
49741
49741
|
} else if (userAgent$3) {
|
|
49742
|
-
match$
|
|
49742
|
+
match$5 = userAgent$3.match(/Edge\/(\d+)/);
|
|
49743
49743
|
|
|
49744
|
-
if (!match$
|
|
49745
|
-
match$
|
|
49746
|
-
if (match$
|
|
49744
|
+
if (!match$5 || match$5[1] >= 74) {
|
|
49745
|
+
match$5 = userAgent$3.match(/Chrome\/(\d+)/);
|
|
49746
|
+
if (match$5) version$6 = match$5[1];
|
|
49747
49747
|
}
|
|
49748
49748
|
}
|
|
49749
49749
|
|
|
@@ -66234,7 +66234,7 @@ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
|
66234
66234
|
var booleanValueOf = Boolean.prototype.valueOf;
|
|
66235
66235
|
var objectToString = Object.prototype.toString;
|
|
66236
66236
|
var functionToString$2 = Function.prototype.toString;
|
|
66237
|
-
var match$
|
|
66237
|
+
var match$4 = String.prototype.match;
|
|
66238
66238
|
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
66239
66239
|
var gOPS = Object.getOwnPropertySymbols;
|
|
66240
66240
|
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
|
@@ -66410,7 +66410,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
66410
66410
|
if (isString$1(obj)) {
|
|
66411
66411
|
return markBoxed(inspect(String(obj)));
|
|
66412
66412
|
}
|
|
66413
|
-
if (!isDate(obj) && !isRegExp$8(obj)) {
|
|
66413
|
+
if (!isDate$1(obj) && !isRegExp$8(obj)) {
|
|
66414
66414
|
var ys = arrObjKeys(obj, inspect);
|
|
66415
66415
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
66416
66416
|
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
|
@@ -66436,7 +66436,7 @@ function quote(s) {
|
|
|
66436
66436
|
}
|
|
66437
66437
|
|
|
66438
66438
|
function isArray$8(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
66439
|
-
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
66439
|
+
function isDate$1(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
66440
66440
|
function isRegExp$8(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
66441
66441
|
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
66442
66442
|
function isString$1(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
@@ -66483,7 +66483,7 @@ function toStr(obj) {
|
|
|
66483
66483
|
|
|
66484
66484
|
function nameOf(f) {
|
|
66485
66485
|
if (f.name) { return f.name; }
|
|
66486
|
-
var m = match$
|
|
66486
|
+
var m = match$4.call(functionToString$2.call(f), /^function\s*([\w$]+)/);
|
|
66487
66487
|
if (m) { return m[1]; }
|
|
66488
66488
|
return null;
|
|
66489
66489
|
}
|
|
@@ -71018,7 +71018,7 @@ var clipboardToIE11Formatting = {
|
|
|
71018
71018
|
|
|
71019
71019
|
var defaultMessage = "Copy to clipboard: #{key}, Enter";
|
|
71020
71020
|
|
|
71021
|
-
function format(message) {
|
|
71021
|
+
function format$1(message) {
|
|
71022
71022
|
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
|
|
71023
71023
|
return message.replace(/#{\s*key\s*}/g, copyKey);
|
|
71024
71024
|
}
|
|
@@ -71097,7 +71097,7 @@ function copy(text, options) {
|
|
|
71097
71097
|
} catch (err) {
|
|
71098
71098
|
debug && console.error("unable to copy using clipboardData: ", err);
|
|
71099
71099
|
debug && console.error("falling back to prompt");
|
|
71100
|
-
message = format("message" in options ? options.message : defaultMessage);
|
|
71100
|
+
message = format$1("message" in options ? options.message : defaultMessage);
|
|
71101
71101
|
window.prompt(message, text);
|
|
71102
71102
|
}
|
|
71103
71103
|
} finally {
|
|
@@ -80314,17 +80314,17 @@ var userAgent$2 = engineUserAgent$1;
|
|
|
80314
80314
|
var process$2$1 = global$2$1.process;
|
|
80315
80315
|
var versions$1 = process$2$1 && process$2$1.versions;
|
|
80316
80316
|
var v8$1 = versions$1 && versions$1.v8;
|
|
80317
|
-
var match$
|
|
80317
|
+
var match$3, version$2;
|
|
80318
80318
|
|
|
80319
80319
|
if (v8$1) {
|
|
80320
|
-
match$
|
|
80321
|
-
version$2 = match$
|
|
80320
|
+
match$3 = v8$1.split('.');
|
|
80321
|
+
version$2 = match$3[0] + match$3[1];
|
|
80322
80322
|
} else if (userAgent$2) {
|
|
80323
|
-
match$
|
|
80323
|
+
match$3 = userAgent$2.match(/Edge\/(\d+)/);
|
|
80324
80324
|
|
|
80325
|
-
if (!match$
|
|
80326
|
-
match$
|
|
80327
|
-
if (match$
|
|
80325
|
+
if (!match$3 || match$3[1] >= 74) {
|
|
80326
|
+
match$3 = userAgent$2.match(/Chrome\/(\d+)/);
|
|
80327
|
+
if (match$3) version$2 = match$3[1];
|
|
80328
80328
|
}
|
|
80329
80329
|
}
|
|
80330
80330
|
|
|
@@ -87472,9 +87472,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
|
|
|
87472
87472
|
}), void 0);
|
|
87473
87473
|
};
|
|
87474
87474
|
|
|
87475
|
-
var version$1 = "0.4.0-preview.
|
|
87476
|
-
var buildId = "
|
|
87477
|
-
var commitId = "
|
|
87475
|
+
var version$1 = "0.4.0-preview.220";
|
|
87476
|
+
var buildId = "98559";
|
|
87477
|
+
var commitId = "7ad59dc49b9a9178bb883160dd9f17eb211b740e";
|
|
87478
87478
|
var isCustomerBuild = false;
|
|
87479
87479
|
var buildInfo = {
|
|
87480
87480
|
version: version$1,
|
|
@@ -131619,7 +131619,7 @@ promise=Promise$1.resolve(undefined);then=promise.then;notify$1=function(){then.
|
|
|
131619
131619
|
// - setTimeout
|
|
131620
131620
|
}else {notify$1=function(){// strange IE + webpack dev server bug - use .call(global)
|
|
131621
131621
|
macrotask.call(global$6,flush);};}}var microtask$1=queueMicrotask||function(fn){var task={fn:fn,next:undefined};if(last)last.next=task;if(!head){head=task;notify$1();}last=task;};var newPromiseCapability$2={};var aFunction$4=aFunction$7;var PromiseCapability=function(C){var resolve,reject;this.promise=new C(function($$resolve,$$reject){if(resolve!==undefined||reject!==undefined)throw TypeError('Bad Promise constructor');resolve=$$resolve;reject=$$reject;});this.resolve=aFunction$4(resolve);this.reject=aFunction$4(reject);};// 25.4.1.5 NewPromiseCapability(C)
|
|
131622
|
-
newPromiseCapability$2.f=function(C){return new PromiseCapability(C);};var anObject$2$1=anObject$h;var isObject$3=isObject$c;var newPromiseCapability$1=newPromiseCapability$2;var promiseResolve$1=function(C,x){anObject$2$1(C);if(isObject$3(x)&&x.constructor===C)return x;var promiseCapability=newPromiseCapability$1.f(C);var resolve=promiseCapability.resolve;resolve(x);return promiseCapability.promise;};var global$5=global$m;var hostReportErrors$1=function(a,b){var console=global$5.console;if(console&&console.error){arguments.length===1?console.error(a):console.error(a,b);}};var perform$1=function(exec){try{return {error:false,value:exec()};}catch(error){return {error:true,value:error};}};var global$4=global$m;var userAgent=engineUserAgent;var process$1=global$4.process;var versions=process$1&&process$1.versions;var v8=versions&&versions.v8;var match,version;if(v8){match=v8.split('.');version=match[0]+match[1];}else if(userAgent){match=userAgent.match(/Edge\/(\d+)/);if(!match||match[1]>=74){match=userAgent.match(/Chrome\/(\d+)/);if(match)version=match[1];}}var engineV8Version=version&&+version;var $$9=_export;var global$3=global$m;var getBuiltIn=getBuiltIn$6;var NativePromise=nativePromiseConstructor;var redefine$a=redefine$9.exports;var redefineAll=redefineAll$2;var setToStringTag=setToStringTag$5;var setSpecies=setSpecies$2;var isObject$2=isObject$c;var aFunction$3=aFunction$7;var anInstance=anInstance$3;var classof$1=classofRaw$1;var inspectSource=inspectSource$3;var iterate=iterate$2.exports;var checkCorrectnessOfIteration=checkCorrectnessOfIteration$1;var speciesConstructor=speciesConstructor$2;var task=task$1.set;var microtask=microtask$1;var promiseResolve=promiseResolve$1;var hostReportErrors=hostReportErrors$1;var newPromiseCapabilityModule=newPromiseCapability$2;var perform=perform$1;var InternalStateModule=internalState;var isForced=isForced_1;var wellKnownSymbol$2=wellKnownSymbol$l;var V8_VERSION=engineV8Version;var SPECIES$1=wellKnownSymbol$2('species');var PROMISE='Promise';var getInternalState=InternalStateModule.get;var setInternalState=InternalStateModule.set;var getInternalPromiseState=InternalStateModule.getterFor(PROMISE);var PromiseConstructor=NativePromise;var TypeError$1=global$3.TypeError;var document$1=global$3.document;var process$4=global$3.process;var $fetch=getBuiltIn('fetch');var newPromiseCapability=newPromiseCapabilityModule.f;var newGenericPromiseCapability=newPromiseCapability;var IS_NODE=classof$1(process$4)=='process';var DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$3.dispatchEvent);var UNHANDLED_REJECTION='unhandledrejection';var REJECTION_HANDLED='rejectionhandled';var PENDING=0;var FULFILLED=1;var REJECTED=2;var HANDLED=1;var UNHANDLED=2;var Internal,OwnPromiseCapability,PromiseWrapper,nativeThen;var FORCED$2=isForced(PROMISE,function(){var GLOBAL_CORE_JS_PROMISE=inspectSource(PromiseConstructor)!==String(PromiseConstructor);if(!GLOBAL_CORE_JS_PROMISE){// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
131622
|
+
newPromiseCapability$2.f=function(C){return new PromiseCapability(C);};var anObject$2$1=anObject$h;var isObject$3=isObject$c;var newPromiseCapability$1=newPromiseCapability$2;var promiseResolve$1=function(C,x){anObject$2$1(C);if(isObject$3(x)&&x.constructor===C)return x;var promiseCapability=newPromiseCapability$1.f(C);var resolve=promiseCapability.resolve;resolve(x);return promiseCapability.promise;};var global$5=global$m;var hostReportErrors$1=function(a,b){var console=global$5.console;if(console&&console.error){arguments.length===1?console.error(a):console.error(a,b);}};var perform$1=function(exec){try{return {error:false,value:exec()};}catch(error){return {error:true,value:error};}};var global$4=global$m;var userAgent=engineUserAgent;var process$1=global$4.process;var versions=process$1&&process$1.versions;var v8=versions&&versions.v8;var match$2,version;if(v8){match$2=v8.split('.');version=match$2[0]+match$2[1];}else if(userAgent){match$2=userAgent.match(/Edge\/(\d+)/);if(!match$2||match$2[1]>=74){match$2=userAgent.match(/Chrome\/(\d+)/);if(match$2)version=match$2[1];}}var engineV8Version=version&&+version;var $$9=_export;var global$3=global$m;var getBuiltIn=getBuiltIn$6;var NativePromise=nativePromiseConstructor;var redefine$a=redefine$9.exports;var redefineAll=redefineAll$2;var setToStringTag=setToStringTag$5;var setSpecies=setSpecies$2;var isObject$2=isObject$c;var aFunction$3=aFunction$7;var anInstance=anInstance$3;var classof$1=classofRaw$1;var inspectSource=inspectSource$3;var iterate=iterate$2.exports;var checkCorrectnessOfIteration=checkCorrectnessOfIteration$1;var speciesConstructor=speciesConstructor$2;var task=task$1.set;var microtask=microtask$1;var promiseResolve=promiseResolve$1;var hostReportErrors=hostReportErrors$1;var newPromiseCapabilityModule=newPromiseCapability$2;var perform=perform$1;var InternalStateModule=internalState;var isForced=isForced_1;var wellKnownSymbol$2=wellKnownSymbol$l;var V8_VERSION=engineV8Version;var SPECIES$1=wellKnownSymbol$2('species');var PROMISE='Promise';var getInternalState=InternalStateModule.get;var setInternalState=InternalStateModule.set;var getInternalPromiseState=InternalStateModule.getterFor(PROMISE);var PromiseConstructor=NativePromise;var TypeError$1=global$3.TypeError;var document$1=global$3.document;var process$4=global$3.process;var $fetch=getBuiltIn('fetch');var newPromiseCapability=newPromiseCapabilityModule.f;var newGenericPromiseCapability=newPromiseCapability;var IS_NODE=classof$1(process$4)=='process';var DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$3.dispatchEvent);var UNHANDLED_REJECTION='unhandledrejection';var REJECTION_HANDLED='rejectionhandled';var PENDING=0;var FULFILLED=1;var REJECTED=2;var HANDLED=1;var UNHANDLED=2;var Internal,OwnPromiseCapability,PromiseWrapper,nativeThen;var FORCED$2=isForced(PROMISE,function(){var GLOBAL_CORE_JS_PROMISE=inspectSource(PromiseConstructor)!==String(PromiseConstructor);if(!GLOBAL_CORE_JS_PROMISE){// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
131623
131623
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
131624
131624
|
// We can't detect it synchronously, so just check versions
|
|
131625
131625
|
if(V8_VERSION===66)return true;// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
@@ -131661,7 +131661,7 @@ function search(regexp){var O=requireObjectCoercible$3(this);var searcher=regexp
|
|
|
131661
131661
|
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
|
|
131662
131662
|
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 $$8=_export;var assign=objectAssign;// `Object.assign` method
|
|
131663
131663
|
// https://tc39.github.io/ecma262/#sec-object.assign
|
|
131664
|
-
$$8({target:'Object',stat:true,forced:Object.assign!==assign},{assign:assign});var defaultPageSize$2=10;function fetchNewsItems(path,cacheKey,api,storage,paginationToken,filterDefinition,isArray){var _this=this;var _a,_b;if(isArray===void 0){isArray=false;}var hasSimpleFilters=filterDefinition.beforeDate!=null||((_a=filterDefinition.keywords)===null||_a===void 0?void 0:_a.length)>0||filterDefinition.author!=null||filterDefinition.owner!=null||filterDefinition.bookmarksOnly!=null||filterDefinition.source!=null||filterDefinition.state!=null||filterDefinition.groupId!=null||filterDefinition.includePromoted!=null||filterDefinition.unreadOnly!=null;var isSearchActive=filterDefinition.search&&filterDefinition.search.length>0;var hasChannels=((_b=filterDefinition===null||filterDefinition===void 0?void 0:filterDefinition.channels)===null||_b===void 0?void 0:_b.length)>0;var pageSize=filterDefinition.pageSize;var hasAnyFilteringApplied=hasChannels||hasSimpleFilters||isSearchActive;// Note: caching is done only for the first page (paginationToken == null)
|
|
131664
|
+
$$8({target:'Object',stat:true,forced:Object.assign!==assign},{assign:assign});var defaultPageSize$2=10;function fetchNewsItems(path,cacheKey,api,storage,paginationToken,filterDefinition,isArray){var _this=this;var _a,_b;if(isArray===void 0){isArray=false;}var hasSimpleFilters=filterDefinition.beforeDate!=null||filterDefinition.afterDate!=null||((_a=filterDefinition.keywords)===null||_a===void 0?void 0:_a.length)>0||filterDefinition.author!=null||filterDefinition.owner!=null||filterDefinition.bookmarksOnly!=null||filterDefinition.source!=null||filterDefinition.state!=null||filterDefinition.groupId!=null||filterDefinition.includePromoted!=null||filterDefinition.unreadOnly!=null;var isSearchActive=filterDefinition.search&&filterDefinition.search.length>0;var hasChannels=((_b=filterDefinition===null||filterDefinition===void 0?void 0:filterDefinition.channels)===null||_b===void 0?void 0:_b.length)>0;var pageSize=filterDefinition.pageSize;var hasAnyFilteringApplied=hasChannels||hasSimpleFilters||isSearchActive;// Note: caching is done only for the first page (paginationToken == null)
|
|
131665
131665
|
var canCache=!hasAnyFilteringApplied&&paginationToken==null;if(isSearchActive){filterDefinition.search=filterDefinition.search.trim();}if(!hasAnyFilteringApplied){filterDefinition=null;}var params=Object.assign({},{token:paginationToken,pageSize:pageSize!==null&&pageSize!==void 0?pageSize:defaultPageSize$2},__assign(__assign(__assign({},filterDefinition),getCommaSeparatedChannelsString(filterDefinition===null||filterDefinition===void 0?void 0:filterDefinition.channels)),getCommaSeparatedKeywordsString(filterDefinition===null||filterDefinition===void 0?void 0:filterDefinition.keywords)));var endpoint=api.all(path);var apiLoader=isArray?endpoint.getAll(params).then(function(res){return {items:res.body().map(function(r){return r.data();})};}):endpoint.get('',params).then(function(res){return res.body().data();});if(!canCache){return from(apiLoader);}return new Observable(function(observer){(function(){return __awaiter(_this,void 0,void 0,function(){var cachedPage,apiPage_1,err_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);return [4/*yield*/,storage.getObject(cacheKey)];case 1:cachedPage=_a.sent();if(cachedPage){validateFileAccessTokens(cachedPage,function(isTokenValid,item){if(!isTokenValid){// prevent executing requests resulting in 401 if we already know the token is not valid anymore
|
|
131666
131666
|
item.fileAccessToken=null;}});observer.next(cachedPage);}return [4/*yield*/,apiLoader];case 2:apiPage_1=_a.sent();// no need to wait for updating the cache
|
|
131667
131667
|
storage.set(cacheKey,apiPage_1).then(function(){return null;});if(!cachedPage){observer.next(apiPage_1);observer.complete();return [2/*return*/];}validateFileAccessTokens(cachedPage,function(isTokenValid,cachedItem){var apiItem=apiPage_1.items.find(function(i){return i.id===cachedItem.id;});if(apiItem&&isTokenValid){// prevent reload of the image if the old token is still valid
|
|
@@ -131840,7 +131840,7 @@ var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===pag
|
|
|
131840
131840
|
// for this case the blockProps would be an empty object and
|
|
131841
131841
|
// we need to set the showPages and showDocuments to true
|
|
131842
131842
|
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
|
|
131843
|
-
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$Q||(templateObject_1$Q=__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$e||(templateObject_4$e=__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$Q,templateObject_2$w,templateObject_3$n,templateObject_4$e,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$P||(templateObject_1$P=__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$P,templateObject_2$v;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$O||(templateObject_1$O=__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$O;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$N||(templateObject_1$N=__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$N,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$M||(templateObject_1$M=__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$M;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$L||(templateObject_1$L=__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$L;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$K||(templateObject_1$K=__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$K;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$J||(templateObject_1$J=__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$J;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$I||(templateObject_1$I=__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$I;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$H||(templateObject_1$H=__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$d$1||(templateObject_4$d$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$H,templateObject_2$t,templateObject_3$l,templateObject_4$d$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$G||(templateObject_1$G=__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$G;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$F||(templateObject_1$F=__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$F;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$E||(templateObject_1$E=__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$E;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$D||(templateObject_1$D=__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$D;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$C||(templateObject_1$C=__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$C;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$B||(templateObject_1$B=__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$B,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$A||(templateObject_1$A=__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$A;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$z||(templateObject_1$z=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$z;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$y||(templateObject_1$y=__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$y;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$x||(templateObject_1$x=__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$x;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 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={}));var BaseFilterDefinitionImpl=/** @class */function(){function BaseFilterDefinitionImpl(){}return BaseFilterDefinitionImpl;}();__spreadArray(__spreadArray([],Object.keys(new BaseFilterDefinitionImpl())),['hideChrome','teams']);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$w||(templateObject_1$w=__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$1||(templateObject_5$a$1=__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$c$1||(templateObject_4$c$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$w,templateObject_2$r,templateObject_3$k,templateObject_4$c$1,templateObject_5$a$1,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:"keyword-picker"},{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",__assign({className:className},{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$v||(templateObject_1$v=__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$b$1||(templateObject_4$b$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$v,templateObject_2$q,templateObject_3$j,templateObject_4$b$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
|
|
131843
|
+
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$Q||(templateObject_1$Q=__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$e||(templateObject_4$e=__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$Q,templateObject_2$w,templateObject_3$n,templateObject_4$e,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$P||(templateObject_1$P=__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$P,templateObject_2$v;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$O||(templateObject_1$O=__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$O;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$N||(templateObject_1$N=__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$N,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$M||(templateObject_1$M=__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$M;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$L||(templateObject_1$L=__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$L;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$K||(templateObject_1$K=__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$K;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$J||(templateObject_1$J=__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$J;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$I||(templateObject_1$I=__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$I;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$H||(templateObject_1$H=__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$d$1||(templateObject_4$d$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$H,templateObject_2$t,templateObject_3$l,templateObject_4$d$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$G||(templateObject_1$G=__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$G;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$F||(templateObject_1$F=__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$F;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$E||(templateObject_1$E=__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$E;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$D||(templateObject_1$D=__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$D;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$C||(templateObject_1$C=__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$C;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$B||(templateObject_1$B=__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$B,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$A||(templateObject_1$A=__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$A;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$z||(templateObject_1$z=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$z;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$y||(templateObject_1$y=__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$y;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$x||(templateObject_1$x=__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$x;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 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={}));var BaseFilterDefinitionImpl=/** @class */function(){function BaseFilterDefinitionImpl(){}return BaseFilterDefinitionImpl;}();__spreadArray(__spreadArray([],Object.keys(new BaseFilterDefinitionImpl())),['hideChrome','teams']);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$w||(templateObject_1$w=__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$1||(templateObject_5$a$1=__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$c$1||(templateObject_4$c$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$w,templateObject_2$r,templateObject_3$k,templateObject_4$c$1,templateObject_5$a$1,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$v||(templateObject_1$v=__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$b$1||(templateObject_4$b$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$v,templateObject_2$q,templateObject_3$j,templateObject_4$b$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
|
|
131844
131844
|
// https://github.com/tc39/proposal-string-replace-all
|
|
131845
131845
|
$$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$u||(templateObject_1$u=__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$u,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$t||(templateObject_1$t=__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$a$1||(templateObject_4$a$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$t,templateObject_2$o,templateObject_3$h,templateObject_4$a$1,templateObject_5$8$1;_styled(InsertFilesDialogHost).withConfig({displayName:"InsertImagesButton__Host",componentId:"sc-63tjy6-0"})(templateObject_1$s||(templateObject_1$s=__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$s,templateObject_2$n,templateObject_3$g;_styled.div.withConfig({displayName:"InsertVideoDialog__VideoHost",componentId:"sc-12gp7sa-0"})(templateObject_1$r||(templateObject_1$r=__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$r,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
|
|
131846
131846
|
if(!timeHasFocus){// We might not know that the time field has the focus after an onBlur from the date field.
|
|
@@ -135371,6 +135371,36 @@ function addMonths(dirtyDate, dirtyAmount) {
|
|
|
135371
135371
|
}
|
|
135372
135372
|
}
|
|
135373
135373
|
|
|
135374
|
+
/**
|
|
135375
|
+
* @name addMilliseconds
|
|
135376
|
+
* @category Millisecond Helpers
|
|
135377
|
+
* @summary Add the specified number of milliseconds to the given date.
|
|
135378
|
+
*
|
|
135379
|
+
* @description
|
|
135380
|
+
* Add the specified number of milliseconds to the given date.
|
|
135381
|
+
*
|
|
135382
|
+
* ### v2.0.0 breaking changes:
|
|
135383
|
+
*
|
|
135384
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
135385
|
+
*
|
|
135386
|
+
* @param {Date|Number} date - the date to be changed
|
|
135387
|
+
* @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
|
135388
|
+
* @returns {Date} the new date with the milliseconds added
|
|
135389
|
+
* @throws {TypeError} 2 arguments required
|
|
135390
|
+
*
|
|
135391
|
+
* @example
|
|
135392
|
+
* // Add 750 milliseconds to 10 July 2014 12:45:30.000:
|
|
135393
|
+
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
|
135394
|
+
* //=> Thu Jul 10 2014 12:45:30.750
|
|
135395
|
+
*/
|
|
135396
|
+
|
|
135397
|
+
function addMilliseconds(dirtyDate, dirtyAmount) {
|
|
135398
|
+
requiredArgs(2, arguments);
|
|
135399
|
+
var timestamp = toDate(dirtyDate).getTime();
|
|
135400
|
+
var amount = toInteger(dirtyAmount);
|
|
135401
|
+
return new Date(timestamp + amount);
|
|
135402
|
+
}
|
|
135403
|
+
|
|
135374
135404
|
/**
|
|
135375
135405
|
* @name startOfWeek
|
|
135376
135406
|
* @category Week Helpers
|
|
@@ -135423,6 +135453,23 @@ function startOfWeek(dirtyDate, dirtyOptions) {
|
|
|
135423
135453
|
return date;
|
|
135424
135454
|
}
|
|
135425
135455
|
|
|
135456
|
+
/**
|
|
135457
|
+
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
|
135458
|
+
* They usually appear for dates that denote time before the timezones were introduced
|
|
135459
|
+
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
|
135460
|
+
* and GMT+01:00:00 after that date)
|
|
135461
|
+
*
|
|
135462
|
+
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
|
135463
|
+
* which would lead to incorrect calculations.
|
|
135464
|
+
*
|
|
135465
|
+
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
|
135466
|
+
*/
|
|
135467
|
+
function getTimezoneOffsetInMilliseconds(date) {
|
|
135468
|
+
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
135469
|
+
utcDate.setUTCFullYear(date.getFullYear());
|
|
135470
|
+
return date.getTime() - utcDate.getTime();
|
|
135471
|
+
}
|
|
135472
|
+
|
|
135426
135473
|
/**
|
|
135427
135474
|
* @name startOfDay
|
|
135428
135475
|
* @category Day Helpers
|
|
@@ -135453,6 +135500,117 @@ function startOfDay(dirtyDate) {
|
|
|
135453
135500
|
return date;
|
|
135454
135501
|
}
|
|
135455
135502
|
|
|
135503
|
+
/**
|
|
135504
|
+
* @name isDate
|
|
135505
|
+
* @category Common Helpers
|
|
135506
|
+
* @summary Is the given value a date?
|
|
135507
|
+
*
|
|
135508
|
+
* @description
|
|
135509
|
+
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
|
|
135510
|
+
*
|
|
135511
|
+
* ### v2.0.0 breaking changes:
|
|
135512
|
+
*
|
|
135513
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
135514
|
+
*
|
|
135515
|
+
* @param {*} value - the value to check
|
|
135516
|
+
* @returns {boolean} true if the given value is a date
|
|
135517
|
+
* @throws {TypeError} 1 arguments required
|
|
135518
|
+
*
|
|
135519
|
+
* @example
|
|
135520
|
+
* // For a valid date:
|
|
135521
|
+
* const result = isDate(new Date())
|
|
135522
|
+
* //=> true
|
|
135523
|
+
*
|
|
135524
|
+
* @example
|
|
135525
|
+
* // For an invalid date:
|
|
135526
|
+
* const result = isDate(new Date(NaN))
|
|
135527
|
+
* //=> true
|
|
135528
|
+
*
|
|
135529
|
+
* @example
|
|
135530
|
+
* // For some value:
|
|
135531
|
+
* const result = isDate('2014-02-31')
|
|
135532
|
+
* //=> false
|
|
135533
|
+
*
|
|
135534
|
+
* @example
|
|
135535
|
+
* // For an object:
|
|
135536
|
+
* const result = isDate({})
|
|
135537
|
+
* //=> false
|
|
135538
|
+
*/
|
|
135539
|
+
|
|
135540
|
+
function isDate(value) {
|
|
135541
|
+
requiredArgs(1, arguments);
|
|
135542
|
+
return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
135543
|
+
}
|
|
135544
|
+
|
|
135545
|
+
/**
|
|
135546
|
+
* @name isValid
|
|
135547
|
+
* @category Common Helpers
|
|
135548
|
+
* @summary Is the given date valid?
|
|
135549
|
+
*
|
|
135550
|
+
* @description
|
|
135551
|
+
* Returns false if argument is Invalid Date and true otherwise.
|
|
135552
|
+
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
|
135553
|
+
* Invalid Date is a Date, whose time value is NaN.
|
|
135554
|
+
*
|
|
135555
|
+
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
135556
|
+
*
|
|
135557
|
+
* ### v2.0.0 breaking changes:
|
|
135558
|
+
*
|
|
135559
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
135560
|
+
*
|
|
135561
|
+
* - Now `isValid` doesn't throw an exception
|
|
135562
|
+
* if the first argument is not an instance of Date.
|
|
135563
|
+
* Instead, argument is converted beforehand using `toDate`.
|
|
135564
|
+
*
|
|
135565
|
+
* Examples:
|
|
135566
|
+
*
|
|
135567
|
+
* | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
|
|
135568
|
+
* |---------------------------|---------------|---------------|
|
|
135569
|
+
* | `new Date()` | `true` | `true` |
|
|
135570
|
+
* | `new Date('2016-01-01')` | `true` | `true` |
|
|
135571
|
+
* | `new Date('')` | `false` | `false` |
|
|
135572
|
+
* | `new Date(1488370835081)` | `true` | `true` |
|
|
135573
|
+
* | `new Date(NaN)` | `false` | `false` |
|
|
135574
|
+
* | `'2016-01-01'` | `TypeError` | `false` |
|
|
135575
|
+
* | `''` | `TypeError` | `false` |
|
|
135576
|
+
* | `1488370835081` | `TypeError` | `true` |
|
|
135577
|
+
* | `NaN` | `TypeError` | `false` |
|
|
135578
|
+
*
|
|
135579
|
+
* We introduce this change to make *date-fns* consistent with ECMAScript behavior
|
|
135580
|
+
* that try to coerce arguments to the expected type
|
|
135581
|
+
* (which is also the case with other *date-fns* functions).
|
|
135582
|
+
*
|
|
135583
|
+
* @param {*} date - the date to check
|
|
135584
|
+
* @returns {Boolean} the date is valid
|
|
135585
|
+
* @throws {TypeError} 1 argument required
|
|
135586
|
+
*
|
|
135587
|
+
* @example
|
|
135588
|
+
* // For the valid date:
|
|
135589
|
+
* const result = isValid(new Date(2014, 1, 31))
|
|
135590
|
+
* //=> true
|
|
135591
|
+
*
|
|
135592
|
+
* @example
|
|
135593
|
+
* // For the value, convertable into a date:
|
|
135594
|
+
* const result = isValid(1393804800000)
|
|
135595
|
+
* //=> true
|
|
135596
|
+
*
|
|
135597
|
+
* @example
|
|
135598
|
+
* // For the invalid date:
|
|
135599
|
+
* const result = isValid(new Date(''))
|
|
135600
|
+
* //=> false
|
|
135601
|
+
*/
|
|
135602
|
+
|
|
135603
|
+
function isValid(dirtyDate) {
|
|
135604
|
+
requiredArgs(1, arguments);
|
|
135605
|
+
|
|
135606
|
+
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
|
135607
|
+
return false;
|
|
135608
|
+
}
|
|
135609
|
+
|
|
135610
|
+
var date = toDate(dirtyDate);
|
|
135611
|
+
return !isNaN(Number(date));
|
|
135612
|
+
}
|
|
135613
|
+
|
|
135456
135614
|
/**
|
|
135457
135615
|
* @name endOfDay
|
|
135458
135616
|
* @category Day Helpers
|
|
@@ -135597,6 +135755,2200 @@ function endOfWeek(dirtyDate, dirtyOptions) {
|
|
|
135597
135755
|
return date;
|
|
135598
135756
|
}
|
|
135599
135757
|
|
|
135758
|
+
var formatDistanceLocale = {
|
|
135759
|
+
lessThanXSeconds: {
|
|
135760
|
+
one: 'less than a second',
|
|
135761
|
+
other: 'less than {{count}} seconds'
|
|
135762
|
+
},
|
|
135763
|
+
xSeconds: {
|
|
135764
|
+
one: '1 second',
|
|
135765
|
+
other: '{{count}} seconds'
|
|
135766
|
+
},
|
|
135767
|
+
halfAMinute: 'half a minute',
|
|
135768
|
+
lessThanXMinutes: {
|
|
135769
|
+
one: 'less than a minute',
|
|
135770
|
+
other: 'less than {{count}} minutes'
|
|
135771
|
+
},
|
|
135772
|
+
xMinutes: {
|
|
135773
|
+
one: '1 minute',
|
|
135774
|
+
other: '{{count}} minutes'
|
|
135775
|
+
},
|
|
135776
|
+
aboutXHours: {
|
|
135777
|
+
one: 'about 1 hour',
|
|
135778
|
+
other: 'about {{count}} hours'
|
|
135779
|
+
},
|
|
135780
|
+
xHours: {
|
|
135781
|
+
one: '1 hour',
|
|
135782
|
+
other: '{{count}} hours'
|
|
135783
|
+
},
|
|
135784
|
+
xDays: {
|
|
135785
|
+
one: '1 day',
|
|
135786
|
+
other: '{{count}} days'
|
|
135787
|
+
},
|
|
135788
|
+
aboutXWeeks: {
|
|
135789
|
+
one: 'about 1 week',
|
|
135790
|
+
other: 'about {{count}} weeks'
|
|
135791
|
+
},
|
|
135792
|
+
xWeeks: {
|
|
135793
|
+
one: '1 week',
|
|
135794
|
+
other: '{{count}} weeks'
|
|
135795
|
+
},
|
|
135796
|
+
aboutXMonths: {
|
|
135797
|
+
one: 'about 1 month',
|
|
135798
|
+
other: 'about {{count}} months'
|
|
135799
|
+
},
|
|
135800
|
+
xMonths: {
|
|
135801
|
+
one: '1 month',
|
|
135802
|
+
other: '{{count}} months'
|
|
135803
|
+
},
|
|
135804
|
+
aboutXYears: {
|
|
135805
|
+
one: 'about 1 year',
|
|
135806
|
+
other: 'about {{count}} years'
|
|
135807
|
+
},
|
|
135808
|
+
xYears: {
|
|
135809
|
+
one: '1 year',
|
|
135810
|
+
other: '{{count}} years'
|
|
135811
|
+
},
|
|
135812
|
+
overXYears: {
|
|
135813
|
+
one: 'over 1 year',
|
|
135814
|
+
other: 'over {{count}} years'
|
|
135815
|
+
},
|
|
135816
|
+
almostXYears: {
|
|
135817
|
+
one: 'almost 1 year',
|
|
135818
|
+
other: 'almost {{count}} years'
|
|
135819
|
+
}
|
|
135820
|
+
};
|
|
135821
|
+
|
|
135822
|
+
var formatDistance = function (token, count, options) {
|
|
135823
|
+
var result;
|
|
135824
|
+
var tokenValue = formatDistanceLocale[token];
|
|
135825
|
+
|
|
135826
|
+
if (typeof tokenValue === 'string') {
|
|
135827
|
+
result = tokenValue;
|
|
135828
|
+
} else if (count === 1) {
|
|
135829
|
+
result = tokenValue.one;
|
|
135830
|
+
} else {
|
|
135831
|
+
result = tokenValue.other.replace('{{count}}', count.toString());
|
|
135832
|
+
}
|
|
135833
|
+
|
|
135834
|
+
if (options !== null && options !== void 0 && options.addSuffix) {
|
|
135835
|
+
if (options.comparison && options.comparison > 0) {
|
|
135836
|
+
return 'in ' + result;
|
|
135837
|
+
} else {
|
|
135838
|
+
return result + ' ago';
|
|
135839
|
+
}
|
|
135840
|
+
}
|
|
135841
|
+
|
|
135842
|
+
return result;
|
|
135843
|
+
};
|
|
135844
|
+
|
|
135845
|
+
var formatDistance$1 = formatDistance;
|
|
135846
|
+
|
|
135847
|
+
function buildFormatLongFn(args) {
|
|
135848
|
+
return function () {
|
|
135849
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
135850
|
+
// TODO: Remove String()
|
|
135851
|
+
var width = options.width ? String(options.width) : args.defaultWidth;
|
|
135852
|
+
var format = args.formats[width] || args.formats[args.defaultWidth];
|
|
135853
|
+
return format;
|
|
135854
|
+
};
|
|
135855
|
+
}
|
|
135856
|
+
|
|
135857
|
+
var dateFormats = {
|
|
135858
|
+
full: 'EEEE, MMMM do, y',
|
|
135859
|
+
long: 'MMMM do, y',
|
|
135860
|
+
medium: 'MMM d, y',
|
|
135861
|
+
short: 'MM/dd/yyyy'
|
|
135862
|
+
};
|
|
135863
|
+
var timeFormats = {
|
|
135864
|
+
full: 'h:mm:ss a zzzz',
|
|
135865
|
+
long: 'h:mm:ss a z',
|
|
135866
|
+
medium: 'h:mm:ss a',
|
|
135867
|
+
short: 'h:mm a'
|
|
135868
|
+
};
|
|
135869
|
+
var dateTimeFormats = {
|
|
135870
|
+
full: "{{date}} 'at' {{time}}",
|
|
135871
|
+
long: "{{date}} 'at' {{time}}",
|
|
135872
|
+
medium: '{{date}}, {{time}}',
|
|
135873
|
+
short: '{{date}}, {{time}}'
|
|
135874
|
+
};
|
|
135875
|
+
var formatLong = {
|
|
135876
|
+
date: buildFormatLongFn({
|
|
135877
|
+
formats: dateFormats,
|
|
135878
|
+
defaultWidth: 'full'
|
|
135879
|
+
}),
|
|
135880
|
+
time: buildFormatLongFn({
|
|
135881
|
+
formats: timeFormats,
|
|
135882
|
+
defaultWidth: 'full'
|
|
135883
|
+
}),
|
|
135884
|
+
dateTime: buildFormatLongFn({
|
|
135885
|
+
formats: dateTimeFormats,
|
|
135886
|
+
defaultWidth: 'full'
|
|
135887
|
+
})
|
|
135888
|
+
};
|
|
135889
|
+
var formatLong$1 = formatLong;
|
|
135890
|
+
|
|
135891
|
+
var formatRelativeLocale = {
|
|
135892
|
+
lastWeek: "'last' eeee 'at' p",
|
|
135893
|
+
yesterday: "'yesterday at' p",
|
|
135894
|
+
today: "'today at' p",
|
|
135895
|
+
tomorrow: "'tomorrow at' p",
|
|
135896
|
+
nextWeek: "eeee 'at' p",
|
|
135897
|
+
other: 'P'
|
|
135898
|
+
};
|
|
135899
|
+
|
|
135900
|
+
var formatRelative = function (token, _date, _baseDate, _options) {
|
|
135901
|
+
return formatRelativeLocale[token];
|
|
135902
|
+
};
|
|
135903
|
+
|
|
135904
|
+
var formatRelative$1 = formatRelative;
|
|
135905
|
+
|
|
135906
|
+
function buildLocalizeFn(args) {
|
|
135907
|
+
return function (dirtyIndex, dirtyOptions) {
|
|
135908
|
+
var options = dirtyOptions || {};
|
|
135909
|
+
var context = options.context ? String(options.context) : 'standalone';
|
|
135910
|
+
var valuesArray;
|
|
135911
|
+
|
|
135912
|
+
if (context === 'formatting' && args.formattingValues) {
|
|
135913
|
+
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
135914
|
+
var width = options.width ? String(options.width) : defaultWidth;
|
|
135915
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
135916
|
+
} else {
|
|
135917
|
+
var _defaultWidth = args.defaultWidth;
|
|
135918
|
+
|
|
135919
|
+
var _width = options.width ? String(options.width) : args.defaultWidth;
|
|
135920
|
+
|
|
135921
|
+
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
|
135922
|
+
}
|
|
135923
|
+
|
|
135924
|
+
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!
|
|
135925
|
+
|
|
135926
|
+
return valuesArray[index];
|
|
135927
|
+
};
|
|
135928
|
+
}
|
|
135929
|
+
|
|
135930
|
+
var eraValues = {
|
|
135931
|
+
narrow: ['B', 'A'],
|
|
135932
|
+
abbreviated: ['BC', 'AD'],
|
|
135933
|
+
wide: ['Before Christ', 'Anno Domini']
|
|
135934
|
+
};
|
|
135935
|
+
var quarterValues = {
|
|
135936
|
+
narrow: ['1', '2', '3', '4'],
|
|
135937
|
+
abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
|
|
135938
|
+
wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
|
|
135939
|
+
}; // Note: in English, the names of days of the week and months are capitalized.
|
|
135940
|
+
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
|
|
135941
|
+
// Generally, formatted dates should look like they are in the middle of a sentence,
|
|
135942
|
+
// e.g. in Spanish language the weekdays and months should be in the lowercase.
|
|
135943
|
+
|
|
135944
|
+
var monthValues = {
|
|
135945
|
+
narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
|
|
135946
|
+
abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
135947
|
+
wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
|
135948
|
+
};
|
|
135949
|
+
var dayValues = {
|
|
135950
|
+
narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
|
135951
|
+
short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
|
135952
|
+
abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
135953
|
+
wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
|
|
135954
|
+
};
|
|
135955
|
+
var dayPeriodValues = {
|
|
135956
|
+
narrow: {
|
|
135957
|
+
am: 'a',
|
|
135958
|
+
pm: 'p',
|
|
135959
|
+
midnight: 'mi',
|
|
135960
|
+
noon: 'n',
|
|
135961
|
+
morning: 'morning',
|
|
135962
|
+
afternoon: 'afternoon',
|
|
135963
|
+
evening: 'evening',
|
|
135964
|
+
night: 'night'
|
|
135965
|
+
},
|
|
135966
|
+
abbreviated: {
|
|
135967
|
+
am: 'AM',
|
|
135968
|
+
pm: 'PM',
|
|
135969
|
+
midnight: 'midnight',
|
|
135970
|
+
noon: 'noon',
|
|
135971
|
+
morning: 'morning',
|
|
135972
|
+
afternoon: 'afternoon',
|
|
135973
|
+
evening: 'evening',
|
|
135974
|
+
night: 'night'
|
|
135975
|
+
},
|
|
135976
|
+
wide: {
|
|
135977
|
+
am: 'a.m.',
|
|
135978
|
+
pm: 'p.m.',
|
|
135979
|
+
midnight: 'midnight',
|
|
135980
|
+
noon: 'noon',
|
|
135981
|
+
morning: 'morning',
|
|
135982
|
+
afternoon: 'afternoon',
|
|
135983
|
+
evening: 'evening',
|
|
135984
|
+
night: 'night'
|
|
135985
|
+
}
|
|
135986
|
+
};
|
|
135987
|
+
var formattingDayPeriodValues = {
|
|
135988
|
+
narrow: {
|
|
135989
|
+
am: 'a',
|
|
135990
|
+
pm: 'p',
|
|
135991
|
+
midnight: 'mi',
|
|
135992
|
+
noon: 'n',
|
|
135993
|
+
morning: 'in the morning',
|
|
135994
|
+
afternoon: 'in the afternoon',
|
|
135995
|
+
evening: 'in the evening',
|
|
135996
|
+
night: 'at night'
|
|
135997
|
+
},
|
|
135998
|
+
abbreviated: {
|
|
135999
|
+
am: 'AM',
|
|
136000
|
+
pm: 'PM',
|
|
136001
|
+
midnight: 'midnight',
|
|
136002
|
+
noon: 'noon',
|
|
136003
|
+
morning: 'in the morning',
|
|
136004
|
+
afternoon: 'in the afternoon',
|
|
136005
|
+
evening: 'in the evening',
|
|
136006
|
+
night: 'at night'
|
|
136007
|
+
},
|
|
136008
|
+
wide: {
|
|
136009
|
+
am: 'a.m.',
|
|
136010
|
+
pm: 'p.m.',
|
|
136011
|
+
midnight: 'midnight',
|
|
136012
|
+
noon: 'noon',
|
|
136013
|
+
morning: 'in the morning',
|
|
136014
|
+
afternoon: 'in the afternoon',
|
|
136015
|
+
evening: 'in the evening',
|
|
136016
|
+
night: 'at night'
|
|
136017
|
+
}
|
|
136018
|
+
};
|
|
136019
|
+
|
|
136020
|
+
var ordinalNumber = function (dirtyNumber, _options) {
|
|
136021
|
+
var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
|
|
136022
|
+
// if they are different for different grammatical genders,
|
|
136023
|
+
// use `options.unit`.
|
|
136024
|
+
//
|
|
136025
|
+
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
|
|
136026
|
+
// 'day', 'hour', 'minute', 'second'.
|
|
136027
|
+
|
|
136028
|
+
var rem100 = number % 100;
|
|
136029
|
+
|
|
136030
|
+
if (rem100 > 20 || rem100 < 10) {
|
|
136031
|
+
switch (rem100 % 10) {
|
|
136032
|
+
case 1:
|
|
136033
|
+
return number + 'st';
|
|
136034
|
+
|
|
136035
|
+
case 2:
|
|
136036
|
+
return number + 'nd';
|
|
136037
|
+
|
|
136038
|
+
case 3:
|
|
136039
|
+
return number + 'rd';
|
|
136040
|
+
}
|
|
136041
|
+
}
|
|
136042
|
+
|
|
136043
|
+
return number + 'th';
|
|
136044
|
+
};
|
|
136045
|
+
|
|
136046
|
+
var localize = {
|
|
136047
|
+
ordinalNumber: ordinalNumber,
|
|
136048
|
+
era: buildLocalizeFn({
|
|
136049
|
+
values: eraValues,
|
|
136050
|
+
defaultWidth: 'wide'
|
|
136051
|
+
}),
|
|
136052
|
+
quarter: buildLocalizeFn({
|
|
136053
|
+
values: quarterValues,
|
|
136054
|
+
defaultWidth: 'wide',
|
|
136055
|
+
argumentCallback: function (quarter) {
|
|
136056
|
+
return quarter - 1;
|
|
136057
|
+
}
|
|
136058
|
+
}),
|
|
136059
|
+
month: buildLocalizeFn({
|
|
136060
|
+
values: monthValues,
|
|
136061
|
+
defaultWidth: 'wide'
|
|
136062
|
+
}),
|
|
136063
|
+
day: buildLocalizeFn({
|
|
136064
|
+
values: dayValues,
|
|
136065
|
+
defaultWidth: 'wide'
|
|
136066
|
+
}),
|
|
136067
|
+
dayPeriod: buildLocalizeFn({
|
|
136068
|
+
values: dayPeriodValues,
|
|
136069
|
+
defaultWidth: 'wide',
|
|
136070
|
+
formattingValues: formattingDayPeriodValues,
|
|
136071
|
+
defaultFormattingWidth: 'wide'
|
|
136072
|
+
})
|
|
136073
|
+
};
|
|
136074
|
+
var localize$1 = localize;
|
|
136075
|
+
|
|
136076
|
+
function buildMatchFn(args) {
|
|
136077
|
+
return function (string) {
|
|
136078
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
136079
|
+
var width = options.width;
|
|
136080
|
+
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
136081
|
+
var matchResult = string.match(matchPattern);
|
|
136082
|
+
|
|
136083
|
+
if (!matchResult) {
|
|
136084
|
+
return null;
|
|
136085
|
+
}
|
|
136086
|
+
|
|
136087
|
+
var matchedString = matchResult[0];
|
|
136088
|
+
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
136089
|
+
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
|
|
136090
|
+
return pattern.test(matchedString);
|
|
136091
|
+
}) : findKey(parsePatterns, function (pattern) {
|
|
136092
|
+
return pattern.test(matchedString);
|
|
136093
|
+
});
|
|
136094
|
+
var value;
|
|
136095
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
136096
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
136097
|
+
var rest = string.slice(matchedString.length);
|
|
136098
|
+
return {
|
|
136099
|
+
value: value,
|
|
136100
|
+
rest: rest
|
|
136101
|
+
};
|
|
136102
|
+
};
|
|
136103
|
+
}
|
|
136104
|
+
|
|
136105
|
+
function findKey(object, predicate) {
|
|
136106
|
+
for (var key in object) {
|
|
136107
|
+
if (object.hasOwnProperty(key) && predicate(object[key])) {
|
|
136108
|
+
return key;
|
|
136109
|
+
}
|
|
136110
|
+
}
|
|
136111
|
+
|
|
136112
|
+
return undefined;
|
|
136113
|
+
}
|
|
136114
|
+
|
|
136115
|
+
function findIndex(array, predicate) {
|
|
136116
|
+
for (var key = 0; key < array.length; key++) {
|
|
136117
|
+
if (predicate(array[key])) {
|
|
136118
|
+
return key;
|
|
136119
|
+
}
|
|
136120
|
+
}
|
|
136121
|
+
|
|
136122
|
+
return undefined;
|
|
136123
|
+
}
|
|
136124
|
+
|
|
136125
|
+
function buildMatchPatternFn(args) {
|
|
136126
|
+
return function (string) {
|
|
136127
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
136128
|
+
var matchResult = string.match(args.matchPattern);
|
|
136129
|
+
if (!matchResult) return null;
|
|
136130
|
+
var matchedString = matchResult[0];
|
|
136131
|
+
var parseResult = string.match(args.parsePattern);
|
|
136132
|
+
if (!parseResult) return null;
|
|
136133
|
+
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
136134
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
136135
|
+
var rest = string.slice(matchedString.length);
|
|
136136
|
+
return {
|
|
136137
|
+
value: value,
|
|
136138
|
+
rest: rest
|
|
136139
|
+
};
|
|
136140
|
+
};
|
|
136141
|
+
}
|
|
136142
|
+
|
|
136143
|
+
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
136144
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
|
136145
|
+
var matchEraPatterns = {
|
|
136146
|
+
narrow: /^(b|a)/i,
|
|
136147
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
136148
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
136149
|
+
};
|
|
136150
|
+
var parseEraPatterns = {
|
|
136151
|
+
any: [/^b/i, /^(a|c)/i]
|
|
136152
|
+
};
|
|
136153
|
+
var matchQuarterPatterns = {
|
|
136154
|
+
narrow: /^[1234]/i,
|
|
136155
|
+
abbreviated: /^q[1234]/i,
|
|
136156
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
136157
|
+
};
|
|
136158
|
+
var parseQuarterPatterns = {
|
|
136159
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
136160
|
+
};
|
|
136161
|
+
var matchMonthPatterns = {
|
|
136162
|
+
narrow: /^[jfmasond]/i,
|
|
136163
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
136164
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
136165
|
+
};
|
|
136166
|
+
var parseMonthPatterns = {
|
|
136167
|
+
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
|
|
136168
|
+
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
|
|
136169
|
+
};
|
|
136170
|
+
var matchDayPatterns = {
|
|
136171
|
+
narrow: /^[smtwf]/i,
|
|
136172
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
136173
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
136174
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
136175
|
+
};
|
|
136176
|
+
var parseDayPatterns = {
|
|
136177
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
136178
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
136179
|
+
};
|
|
136180
|
+
var matchDayPeriodPatterns = {
|
|
136181
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
136182
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
136183
|
+
};
|
|
136184
|
+
var parseDayPeriodPatterns = {
|
|
136185
|
+
any: {
|
|
136186
|
+
am: /^a/i,
|
|
136187
|
+
pm: /^p/i,
|
|
136188
|
+
midnight: /^mi/i,
|
|
136189
|
+
noon: /^no/i,
|
|
136190
|
+
morning: /morning/i,
|
|
136191
|
+
afternoon: /afternoon/i,
|
|
136192
|
+
evening: /evening/i,
|
|
136193
|
+
night: /night/i
|
|
136194
|
+
}
|
|
136195
|
+
};
|
|
136196
|
+
var match = {
|
|
136197
|
+
ordinalNumber: buildMatchPatternFn({
|
|
136198
|
+
matchPattern: matchOrdinalNumberPattern,
|
|
136199
|
+
parsePattern: parseOrdinalNumberPattern,
|
|
136200
|
+
valueCallback: function (value) {
|
|
136201
|
+
return parseInt(value, 10);
|
|
136202
|
+
}
|
|
136203
|
+
}),
|
|
136204
|
+
era: buildMatchFn({
|
|
136205
|
+
matchPatterns: matchEraPatterns,
|
|
136206
|
+
defaultMatchWidth: 'wide',
|
|
136207
|
+
parsePatterns: parseEraPatterns,
|
|
136208
|
+
defaultParseWidth: 'any'
|
|
136209
|
+
}),
|
|
136210
|
+
quarter: buildMatchFn({
|
|
136211
|
+
matchPatterns: matchQuarterPatterns,
|
|
136212
|
+
defaultMatchWidth: 'wide',
|
|
136213
|
+
parsePatterns: parseQuarterPatterns,
|
|
136214
|
+
defaultParseWidth: 'any',
|
|
136215
|
+
valueCallback: function (index) {
|
|
136216
|
+
return index + 1;
|
|
136217
|
+
}
|
|
136218
|
+
}),
|
|
136219
|
+
month: buildMatchFn({
|
|
136220
|
+
matchPatterns: matchMonthPatterns,
|
|
136221
|
+
defaultMatchWidth: 'wide',
|
|
136222
|
+
parsePatterns: parseMonthPatterns,
|
|
136223
|
+
defaultParseWidth: 'any'
|
|
136224
|
+
}),
|
|
136225
|
+
day: buildMatchFn({
|
|
136226
|
+
matchPatterns: matchDayPatterns,
|
|
136227
|
+
defaultMatchWidth: 'wide',
|
|
136228
|
+
parsePatterns: parseDayPatterns,
|
|
136229
|
+
defaultParseWidth: 'any'
|
|
136230
|
+
}),
|
|
136231
|
+
dayPeriod: buildMatchFn({
|
|
136232
|
+
matchPatterns: matchDayPeriodPatterns,
|
|
136233
|
+
defaultMatchWidth: 'any',
|
|
136234
|
+
parsePatterns: parseDayPeriodPatterns,
|
|
136235
|
+
defaultParseWidth: 'any'
|
|
136236
|
+
})
|
|
136237
|
+
};
|
|
136238
|
+
var match$1 = match;
|
|
136239
|
+
|
|
136240
|
+
/**
|
|
136241
|
+
* @type {Locale}
|
|
136242
|
+
* @category Locales
|
|
136243
|
+
* @summary English locale (United States).
|
|
136244
|
+
* @language English
|
|
136245
|
+
* @iso-639-2 eng
|
|
136246
|
+
* @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
|
|
136247
|
+
* @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
|
|
136248
|
+
*/
|
|
136249
|
+
var locale = {
|
|
136250
|
+
code: 'en-US',
|
|
136251
|
+
formatDistance: formatDistance$1,
|
|
136252
|
+
formatLong: formatLong$1,
|
|
136253
|
+
formatRelative: formatRelative$1,
|
|
136254
|
+
localize: localize$1,
|
|
136255
|
+
match: match$1,
|
|
136256
|
+
options: {
|
|
136257
|
+
weekStartsOn: 0
|
|
136258
|
+
/* Sunday */
|
|
136259
|
+
,
|
|
136260
|
+
firstWeekContainsDate: 1
|
|
136261
|
+
}
|
|
136262
|
+
};
|
|
136263
|
+
var defaultLocale = locale;
|
|
136264
|
+
|
|
136265
|
+
/**
|
|
136266
|
+
* @name subMilliseconds
|
|
136267
|
+
* @category Millisecond Helpers
|
|
136268
|
+
* @summary Subtract the specified number of milliseconds from the given date.
|
|
136269
|
+
*
|
|
136270
|
+
* @description
|
|
136271
|
+
* Subtract the specified number of milliseconds from the given date.
|
|
136272
|
+
*
|
|
136273
|
+
* ### v2.0.0 breaking changes:
|
|
136274
|
+
*
|
|
136275
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
136276
|
+
*
|
|
136277
|
+
* @param {Date|Number} date - the date to be changed
|
|
136278
|
+
* @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
|
136279
|
+
* @returns {Date} the new date with the milliseconds subtracted
|
|
136280
|
+
* @throws {TypeError} 2 arguments required
|
|
136281
|
+
*
|
|
136282
|
+
* @example
|
|
136283
|
+
* // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
|
|
136284
|
+
* const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
|
136285
|
+
* //=> Thu Jul 10 2014 12:45:29.250
|
|
136286
|
+
*/
|
|
136287
|
+
|
|
136288
|
+
function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
136289
|
+
requiredArgs(2, arguments);
|
|
136290
|
+
var amount = toInteger(dirtyAmount);
|
|
136291
|
+
return addMilliseconds(dirtyDate, -amount);
|
|
136292
|
+
}
|
|
136293
|
+
|
|
136294
|
+
function addLeadingZeros(number, targetLength) {
|
|
136295
|
+
var sign = number < 0 ? '-' : '';
|
|
136296
|
+
var output = Math.abs(number).toString();
|
|
136297
|
+
|
|
136298
|
+
while (output.length < targetLength) {
|
|
136299
|
+
output = '0' + output;
|
|
136300
|
+
}
|
|
136301
|
+
|
|
136302
|
+
return sign + output;
|
|
136303
|
+
}
|
|
136304
|
+
|
|
136305
|
+
/*
|
|
136306
|
+
* | | Unit | | Unit |
|
|
136307
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
136308
|
+
* | a | AM, PM | A* | |
|
|
136309
|
+
* | d | Day of month | D | |
|
|
136310
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
136311
|
+
* | m | Minute | M | Month |
|
|
136312
|
+
* | s | Second | S | Fraction of second |
|
|
136313
|
+
* | y | Year (abs) | Y | |
|
|
136314
|
+
*
|
|
136315
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
136316
|
+
*/
|
|
136317
|
+
|
|
136318
|
+
var formatters$2 = {
|
|
136319
|
+
// Year
|
|
136320
|
+
y: function (date, token) {
|
|
136321
|
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
|
136322
|
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
136323
|
+
// |----------|-------|----|-------|-------|-------|
|
|
136324
|
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
136325
|
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
136326
|
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
136327
|
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
136328
|
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
136329
|
+
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
136330
|
+
|
|
136331
|
+
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
136332
|
+
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
|
136333
|
+
},
|
|
136334
|
+
// Month
|
|
136335
|
+
M: function (date, token) {
|
|
136336
|
+
var month = date.getUTCMonth();
|
|
136337
|
+
return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
136338
|
+
},
|
|
136339
|
+
// Day of the month
|
|
136340
|
+
d: function (date, token) {
|
|
136341
|
+
return addLeadingZeros(date.getUTCDate(), token.length);
|
|
136342
|
+
},
|
|
136343
|
+
// AM or PM
|
|
136344
|
+
a: function (date, token) {
|
|
136345
|
+
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
|
136346
|
+
|
|
136347
|
+
switch (token) {
|
|
136348
|
+
case 'a':
|
|
136349
|
+
case 'aa':
|
|
136350
|
+
return dayPeriodEnumValue.toUpperCase();
|
|
136351
|
+
|
|
136352
|
+
case 'aaa':
|
|
136353
|
+
return dayPeriodEnumValue;
|
|
136354
|
+
|
|
136355
|
+
case 'aaaaa':
|
|
136356
|
+
return dayPeriodEnumValue[0];
|
|
136357
|
+
|
|
136358
|
+
case 'aaaa':
|
|
136359
|
+
default:
|
|
136360
|
+
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
|
136361
|
+
}
|
|
136362
|
+
},
|
|
136363
|
+
// Hour [1-12]
|
|
136364
|
+
h: function (date, token) {
|
|
136365
|
+
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
|
|
136366
|
+
},
|
|
136367
|
+
// Hour [0-23]
|
|
136368
|
+
H: function (date, token) {
|
|
136369
|
+
return addLeadingZeros(date.getUTCHours(), token.length);
|
|
136370
|
+
},
|
|
136371
|
+
// Minute
|
|
136372
|
+
m: function (date, token) {
|
|
136373
|
+
return addLeadingZeros(date.getUTCMinutes(), token.length);
|
|
136374
|
+
},
|
|
136375
|
+
// Second
|
|
136376
|
+
s: function (date, token) {
|
|
136377
|
+
return addLeadingZeros(date.getUTCSeconds(), token.length);
|
|
136378
|
+
},
|
|
136379
|
+
// Fraction of second
|
|
136380
|
+
S: function (date, token) {
|
|
136381
|
+
var numberOfDigits = token.length;
|
|
136382
|
+
var milliseconds = date.getUTCMilliseconds();
|
|
136383
|
+
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
136384
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
136385
|
+
}
|
|
136386
|
+
};
|
|
136387
|
+
var formatters$3 = formatters$2;
|
|
136388
|
+
|
|
136389
|
+
var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
|
|
136390
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136391
|
+
|
|
136392
|
+
function getUTCDayOfYear(dirtyDate) {
|
|
136393
|
+
requiredArgs(1, arguments);
|
|
136394
|
+
var date = toDate(dirtyDate);
|
|
136395
|
+
var timestamp = date.getTime();
|
|
136396
|
+
date.setUTCMonth(0, 1);
|
|
136397
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
136398
|
+
var startOfYearTimestamp = date.getTime();
|
|
136399
|
+
var difference = timestamp - startOfYearTimestamp;
|
|
136400
|
+
return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
|
|
136401
|
+
}
|
|
136402
|
+
|
|
136403
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136404
|
+
|
|
136405
|
+
function startOfUTCISOWeek(dirtyDate) {
|
|
136406
|
+
requiredArgs(1, arguments);
|
|
136407
|
+
var weekStartsOn = 1;
|
|
136408
|
+
var date = toDate(dirtyDate);
|
|
136409
|
+
var day = date.getUTCDay();
|
|
136410
|
+
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
136411
|
+
date.setUTCDate(date.getUTCDate() - diff);
|
|
136412
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
136413
|
+
return date;
|
|
136414
|
+
}
|
|
136415
|
+
|
|
136416
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136417
|
+
|
|
136418
|
+
function getUTCISOWeekYear(dirtyDate) {
|
|
136419
|
+
requiredArgs(1, arguments);
|
|
136420
|
+
var date = toDate(dirtyDate);
|
|
136421
|
+
var year = date.getUTCFullYear();
|
|
136422
|
+
var fourthOfJanuaryOfNextYear = new Date(0);
|
|
136423
|
+
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
|
|
136424
|
+
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
136425
|
+
var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
|
|
136426
|
+
var fourthOfJanuaryOfThisYear = new Date(0);
|
|
136427
|
+
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
|
136428
|
+
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
136429
|
+
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
|
|
136430
|
+
|
|
136431
|
+
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
136432
|
+
return year + 1;
|
|
136433
|
+
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
136434
|
+
return year;
|
|
136435
|
+
} else {
|
|
136436
|
+
return year - 1;
|
|
136437
|
+
}
|
|
136438
|
+
}
|
|
136439
|
+
|
|
136440
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136441
|
+
|
|
136442
|
+
function startOfUTCISOWeekYear(dirtyDate) {
|
|
136443
|
+
requiredArgs(1, arguments);
|
|
136444
|
+
var year = getUTCISOWeekYear(dirtyDate);
|
|
136445
|
+
var fourthOfJanuary = new Date(0);
|
|
136446
|
+
fourthOfJanuary.setUTCFullYear(year, 0, 4);
|
|
136447
|
+
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
|
|
136448
|
+
var date = startOfUTCISOWeek(fourthOfJanuary);
|
|
136449
|
+
return date;
|
|
136450
|
+
}
|
|
136451
|
+
|
|
136452
|
+
var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
|
|
136453
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136454
|
+
|
|
136455
|
+
function getUTCISOWeek(dirtyDate) {
|
|
136456
|
+
requiredArgs(1, arguments);
|
|
136457
|
+
var date = toDate(dirtyDate);
|
|
136458
|
+
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
|
|
136459
|
+
// because the number of milliseconds in a week is not constant
|
|
136460
|
+
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
136461
|
+
|
|
136462
|
+
return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
|
|
136463
|
+
}
|
|
136464
|
+
|
|
136465
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136466
|
+
|
|
136467
|
+
function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
136468
|
+
requiredArgs(1, arguments);
|
|
136469
|
+
var options = dirtyOptions || {};
|
|
136470
|
+
var locale = options.locale;
|
|
136471
|
+
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
|
136472
|
+
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
136473
|
+
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
136474
|
+
|
|
136475
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
136476
|
+
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
136477
|
+
}
|
|
136478
|
+
|
|
136479
|
+
var date = toDate(dirtyDate);
|
|
136480
|
+
var day = date.getUTCDay();
|
|
136481
|
+
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
136482
|
+
date.setUTCDate(date.getUTCDate() - diff);
|
|
136483
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
136484
|
+
return date;
|
|
136485
|
+
}
|
|
136486
|
+
|
|
136487
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136488
|
+
|
|
136489
|
+
function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
136490
|
+
requiredArgs(1, arguments);
|
|
136491
|
+
var date = toDate(dirtyDate, dirtyOptions);
|
|
136492
|
+
var year = date.getUTCFullYear();
|
|
136493
|
+
var options = dirtyOptions || {};
|
|
136494
|
+
var locale = options.locale;
|
|
136495
|
+
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
|
136496
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
136497
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
136498
|
+
|
|
136499
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
136500
|
+
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
136501
|
+
}
|
|
136502
|
+
|
|
136503
|
+
var firstWeekOfNextYear = new Date(0);
|
|
136504
|
+
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
|
136505
|
+
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
136506
|
+
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
|
|
136507
|
+
var firstWeekOfThisYear = new Date(0);
|
|
136508
|
+
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
136509
|
+
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
136510
|
+
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
|
|
136511
|
+
|
|
136512
|
+
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
136513
|
+
return year + 1;
|
|
136514
|
+
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
136515
|
+
return year;
|
|
136516
|
+
} else {
|
|
136517
|
+
return year - 1;
|
|
136518
|
+
}
|
|
136519
|
+
}
|
|
136520
|
+
|
|
136521
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136522
|
+
|
|
136523
|
+
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
136524
|
+
requiredArgs(1, arguments);
|
|
136525
|
+
var options = dirtyOptions || {};
|
|
136526
|
+
var locale = options.locale;
|
|
136527
|
+
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
|
136528
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
136529
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
|
136530
|
+
var year = getUTCWeekYear(dirtyDate, dirtyOptions);
|
|
136531
|
+
var firstWeek = new Date(0);
|
|
136532
|
+
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
136533
|
+
firstWeek.setUTCHours(0, 0, 0, 0);
|
|
136534
|
+
var date = startOfUTCWeek(firstWeek, dirtyOptions);
|
|
136535
|
+
return date;
|
|
136536
|
+
}
|
|
136537
|
+
|
|
136538
|
+
var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
|
|
136539
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
136540
|
+
|
|
136541
|
+
function getUTCWeek(dirtyDate, options) {
|
|
136542
|
+
requiredArgs(1, arguments);
|
|
136543
|
+
var date = toDate(dirtyDate);
|
|
136544
|
+
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
|
|
136545
|
+
// because the number of milliseconds in a week is not constant
|
|
136546
|
+
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
136547
|
+
|
|
136548
|
+
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
136549
|
+
}
|
|
136550
|
+
|
|
136551
|
+
var dayPeriodEnum = {
|
|
136552
|
+
am: 'am',
|
|
136553
|
+
pm: 'pm',
|
|
136554
|
+
midnight: 'midnight',
|
|
136555
|
+
noon: 'noon',
|
|
136556
|
+
morning: 'morning',
|
|
136557
|
+
afternoon: 'afternoon',
|
|
136558
|
+
evening: 'evening',
|
|
136559
|
+
night: 'night'
|
|
136560
|
+
};
|
|
136561
|
+
/*
|
|
136562
|
+
* | | Unit | | Unit |
|
|
136563
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
136564
|
+
* | a | AM, PM | A* | Milliseconds in day |
|
|
136565
|
+
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
136566
|
+
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
136567
|
+
* | d | Day of month | D | Day of year |
|
|
136568
|
+
* | e | Local day of week | E | Day of week |
|
|
136569
|
+
* | f | | F* | Day of week in month |
|
|
136570
|
+
* | g* | Modified Julian day | G | Era |
|
|
136571
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
136572
|
+
* | i! | ISO day of week | I! | ISO week of year |
|
|
136573
|
+
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
136574
|
+
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
136575
|
+
* | l* | (deprecated) | L | Stand-alone month |
|
|
136576
|
+
* | m | Minute | M | Month |
|
|
136577
|
+
* | n | | N | |
|
|
136578
|
+
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
|
136579
|
+
* | p! | Long localized time | P! | Long localized date |
|
|
136580
|
+
* | q | Stand-alone quarter | Q | Quarter |
|
|
136581
|
+
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
136582
|
+
* | s | Second | S | Fraction of second |
|
|
136583
|
+
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
136584
|
+
* | u | Extended year | U* | Cyclic year |
|
|
136585
|
+
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
136586
|
+
* | w | Local week of year | W* | Week of month |
|
|
136587
|
+
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
136588
|
+
* | y | Year (abs) | Y | Local week-numbering year |
|
|
136589
|
+
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
136590
|
+
*
|
|
136591
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
136592
|
+
*
|
|
136593
|
+
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
136594
|
+
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
|
136595
|
+
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
136596
|
+
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
136597
|
+
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
136598
|
+
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
136599
|
+
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
136600
|
+
* for universal ISO week-numbering date, whereas
|
|
136601
|
+
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
136602
|
+
* for week-numbering date specific to the locale.
|
|
136603
|
+
* - `P` is long localized date format
|
|
136604
|
+
* - `p` is long localized time format
|
|
136605
|
+
*/
|
|
136606
|
+
|
|
136607
|
+
var formatters = {
|
|
136608
|
+
// Era
|
|
136609
|
+
G: function (date, token, localize) {
|
|
136610
|
+
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
|
136611
|
+
|
|
136612
|
+
switch (token) {
|
|
136613
|
+
// AD, BC
|
|
136614
|
+
case 'G':
|
|
136615
|
+
case 'GG':
|
|
136616
|
+
case 'GGG':
|
|
136617
|
+
return localize.era(era, {
|
|
136618
|
+
width: 'abbreviated'
|
|
136619
|
+
});
|
|
136620
|
+
// A, B
|
|
136621
|
+
|
|
136622
|
+
case 'GGGGG':
|
|
136623
|
+
return localize.era(era, {
|
|
136624
|
+
width: 'narrow'
|
|
136625
|
+
});
|
|
136626
|
+
// Anno Domini, Before Christ
|
|
136627
|
+
|
|
136628
|
+
case 'GGGG':
|
|
136629
|
+
default:
|
|
136630
|
+
return localize.era(era, {
|
|
136631
|
+
width: 'wide'
|
|
136632
|
+
});
|
|
136633
|
+
}
|
|
136634
|
+
},
|
|
136635
|
+
// Year
|
|
136636
|
+
y: function (date, token, localize) {
|
|
136637
|
+
// Ordinal number
|
|
136638
|
+
if (token === 'yo') {
|
|
136639
|
+
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
136640
|
+
|
|
136641
|
+
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
136642
|
+
return localize.ordinalNumber(year, {
|
|
136643
|
+
unit: 'year'
|
|
136644
|
+
});
|
|
136645
|
+
}
|
|
136646
|
+
|
|
136647
|
+
return formatters$3.y(date, token);
|
|
136648
|
+
},
|
|
136649
|
+
// Local week-numbering year
|
|
136650
|
+
Y: function (date, token, localize, options) {
|
|
136651
|
+
var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
136652
|
+
|
|
136653
|
+
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
|
|
136654
|
+
|
|
136655
|
+
if (token === 'YY') {
|
|
136656
|
+
var twoDigitYear = weekYear % 100;
|
|
136657
|
+
return addLeadingZeros(twoDigitYear, 2);
|
|
136658
|
+
} // Ordinal number
|
|
136659
|
+
|
|
136660
|
+
|
|
136661
|
+
if (token === 'Yo') {
|
|
136662
|
+
return localize.ordinalNumber(weekYear, {
|
|
136663
|
+
unit: 'year'
|
|
136664
|
+
});
|
|
136665
|
+
} // Padding
|
|
136666
|
+
|
|
136667
|
+
|
|
136668
|
+
return addLeadingZeros(weekYear, token.length);
|
|
136669
|
+
},
|
|
136670
|
+
// ISO week-numbering year
|
|
136671
|
+
R: function (date, token) {
|
|
136672
|
+
var isoWeekYear = getUTCISOWeekYear(date); // Padding
|
|
136673
|
+
|
|
136674
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
|
136675
|
+
},
|
|
136676
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
136677
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
136678
|
+
// | Year | `y` | `u` |
|
|
136679
|
+
// |------|-----|-----|
|
|
136680
|
+
// | AC 1 | 1 | 1 |
|
|
136681
|
+
// | BC 1 | 1 | 0 |
|
|
136682
|
+
// | BC 2 | 2 | -1 |
|
|
136683
|
+
// Also `yy` always returns the last two digits of a year,
|
|
136684
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
136685
|
+
u: function (date, token) {
|
|
136686
|
+
var year = date.getUTCFullYear();
|
|
136687
|
+
return addLeadingZeros(year, token.length);
|
|
136688
|
+
},
|
|
136689
|
+
// Quarter
|
|
136690
|
+
Q: function (date, token, localize) {
|
|
136691
|
+
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
136692
|
+
|
|
136693
|
+
switch (token) {
|
|
136694
|
+
// 1, 2, 3, 4
|
|
136695
|
+
case 'Q':
|
|
136696
|
+
return String(quarter);
|
|
136697
|
+
// 01, 02, 03, 04
|
|
136698
|
+
|
|
136699
|
+
case 'QQ':
|
|
136700
|
+
return addLeadingZeros(quarter, 2);
|
|
136701
|
+
// 1st, 2nd, 3rd, 4th
|
|
136702
|
+
|
|
136703
|
+
case 'Qo':
|
|
136704
|
+
return localize.ordinalNumber(quarter, {
|
|
136705
|
+
unit: 'quarter'
|
|
136706
|
+
});
|
|
136707
|
+
// Q1, Q2, Q3, Q4
|
|
136708
|
+
|
|
136709
|
+
case 'QQQ':
|
|
136710
|
+
return localize.quarter(quarter, {
|
|
136711
|
+
width: 'abbreviated',
|
|
136712
|
+
context: 'formatting'
|
|
136713
|
+
});
|
|
136714
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
136715
|
+
|
|
136716
|
+
case 'QQQQQ':
|
|
136717
|
+
return localize.quarter(quarter, {
|
|
136718
|
+
width: 'narrow',
|
|
136719
|
+
context: 'formatting'
|
|
136720
|
+
});
|
|
136721
|
+
// 1st quarter, 2nd quarter, ...
|
|
136722
|
+
|
|
136723
|
+
case 'QQQQ':
|
|
136724
|
+
default:
|
|
136725
|
+
return localize.quarter(quarter, {
|
|
136726
|
+
width: 'wide',
|
|
136727
|
+
context: 'formatting'
|
|
136728
|
+
});
|
|
136729
|
+
}
|
|
136730
|
+
},
|
|
136731
|
+
// Stand-alone quarter
|
|
136732
|
+
q: function (date, token, localize) {
|
|
136733
|
+
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
136734
|
+
|
|
136735
|
+
switch (token) {
|
|
136736
|
+
// 1, 2, 3, 4
|
|
136737
|
+
case 'q':
|
|
136738
|
+
return String(quarter);
|
|
136739
|
+
// 01, 02, 03, 04
|
|
136740
|
+
|
|
136741
|
+
case 'qq':
|
|
136742
|
+
return addLeadingZeros(quarter, 2);
|
|
136743
|
+
// 1st, 2nd, 3rd, 4th
|
|
136744
|
+
|
|
136745
|
+
case 'qo':
|
|
136746
|
+
return localize.ordinalNumber(quarter, {
|
|
136747
|
+
unit: 'quarter'
|
|
136748
|
+
});
|
|
136749
|
+
// Q1, Q2, Q3, Q4
|
|
136750
|
+
|
|
136751
|
+
case 'qqq':
|
|
136752
|
+
return localize.quarter(quarter, {
|
|
136753
|
+
width: 'abbreviated',
|
|
136754
|
+
context: 'standalone'
|
|
136755
|
+
});
|
|
136756
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
136757
|
+
|
|
136758
|
+
case 'qqqqq':
|
|
136759
|
+
return localize.quarter(quarter, {
|
|
136760
|
+
width: 'narrow',
|
|
136761
|
+
context: 'standalone'
|
|
136762
|
+
});
|
|
136763
|
+
// 1st quarter, 2nd quarter, ...
|
|
136764
|
+
|
|
136765
|
+
case 'qqqq':
|
|
136766
|
+
default:
|
|
136767
|
+
return localize.quarter(quarter, {
|
|
136768
|
+
width: 'wide',
|
|
136769
|
+
context: 'standalone'
|
|
136770
|
+
});
|
|
136771
|
+
}
|
|
136772
|
+
},
|
|
136773
|
+
// Month
|
|
136774
|
+
M: function (date, token, localize) {
|
|
136775
|
+
var month = date.getUTCMonth();
|
|
136776
|
+
|
|
136777
|
+
switch (token) {
|
|
136778
|
+
case 'M':
|
|
136779
|
+
case 'MM':
|
|
136780
|
+
return formatters$3.M(date, token);
|
|
136781
|
+
// 1st, 2nd, ..., 12th
|
|
136782
|
+
|
|
136783
|
+
case 'Mo':
|
|
136784
|
+
return localize.ordinalNumber(month + 1, {
|
|
136785
|
+
unit: 'month'
|
|
136786
|
+
});
|
|
136787
|
+
// Jan, Feb, ..., Dec
|
|
136788
|
+
|
|
136789
|
+
case 'MMM':
|
|
136790
|
+
return localize.month(month, {
|
|
136791
|
+
width: 'abbreviated',
|
|
136792
|
+
context: 'formatting'
|
|
136793
|
+
});
|
|
136794
|
+
// J, F, ..., D
|
|
136795
|
+
|
|
136796
|
+
case 'MMMMM':
|
|
136797
|
+
return localize.month(month, {
|
|
136798
|
+
width: 'narrow',
|
|
136799
|
+
context: 'formatting'
|
|
136800
|
+
});
|
|
136801
|
+
// January, February, ..., December
|
|
136802
|
+
|
|
136803
|
+
case 'MMMM':
|
|
136804
|
+
default:
|
|
136805
|
+
return localize.month(month, {
|
|
136806
|
+
width: 'wide',
|
|
136807
|
+
context: 'formatting'
|
|
136808
|
+
});
|
|
136809
|
+
}
|
|
136810
|
+
},
|
|
136811
|
+
// Stand-alone month
|
|
136812
|
+
L: function (date, token, localize) {
|
|
136813
|
+
var month = date.getUTCMonth();
|
|
136814
|
+
|
|
136815
|
+
switch (token) {
|
|
136816
|
+
// 1, 2, ..., 12
|
|
136817
|
+
case 'L':
|
|
136818
|
+
return String(month + 1);
|
|
136819
|
+
// 01, 02, ..., 12
|
|
136820
|
+
|
|
136821
|
+
case 'LL':
|
|
136822
|
+
return addLeadingZeros(month + 1, 2);
|
|
136823
|
+
// 1st, 2nd, ..., 12th
|
|
136824
|
+
|
|
136825
|
+
case 'Lo':
|
|
136826
|
+
return localize.ordinalNumber(month + 1, {
|
|
136827
|
+
unit: 'month'
|
|
136828
|
+
});
|
|
136829
|
+
// Jan, Feb, ..., Dec
|
|
136830
|
+
|
|
136831
|
+
case 'LLL':
|
|
136832
|
+
return localize.month(month, {
|
|
136833
|
+
width: 'abbreviated',
|
|
136834
|
+
context: 'standalone'
|
|
136835
|
+
});
|
|
136836
|
+
// J, F, ..., D
|
|
136837
|
+
|
|
136838
|
+
case 'LLLLL':
|
|
136839
|
+
return localize.month(month, {
|
|
136840
|
+
width: 'narrow',
|
|
136841
|
+
context: 'standalone'
|
|
136842
|
+
});
|
|
136843
|
+
// January, February, ..., December
|
|
136844
|
+
|
|
136845
|
+
case 'LLLL':
|
|
136846
|
+
default:
|
|
136847
|
+
return localize.month(month, {
|
|
136848
|
+
width: 'wide',
|
|
136849
|
+
context: 'standalone'
|
|
136850
|
+
});
|
|
136851
|
+
}
|
|
136852
|
+
},
|
|
136853
|
+
// Local week of year
|
|
136854
|
+
w: function (date, token, localize, options) {
|
|
136855
|
+
var week = getUTCWeek(date, options);
|
|
136856
|
+
|
|
136857
|
+
if (token === 'wo') {
|
|
136858
|
+
return localize.ordinalNumber(week, {
|
|
136859
|
+
unit: 'week'
|
|
136860
|
+
});
|
|
136861
|
+
}
|
|
136862
|
+
|
|
136863
|
+
return addLeadingZeros(week, token.length);
|
|
136864
|
+
},
|
|
136865
|
+
// ISO week of year
|
|
136866
|
+
I: function (date, token, localize) {
|
|
136867
|
+
var isoWeek = getUTCISOWeek(date);
|
|
136868
|
+
|
|
136869
|
+
if (token === 'Io') {
|
|
136870
|
+
return localize.ordinalNumber(isoWeek, {
|
|
136871
|
+
unit: 'week'
|
|
136872
|
+
});
|
|
136873
|
+
}
|
|
136874
|
+
|
|
136875
|
+
return addLeadingZeros(isoWeek, token.length);
|
|
136876
|
+
},
|
|
136877
|
+
// Day of the month
|
|
136878
|
+
d: function (date, token, localize) {
|
|
136879
|
+
if (token === 'do') {
|
|
136880
|
+
return localize.ordinalNumber(date.getUTCDate(), {
|
|
136881
|
+
unit: 'date'
|
|
136882
|
+
});
|
|
136883
|
+
}
|
|
136884
|
+
|
|
136885
|
+
return formatters$3.d(date, token);
|
|
136886
|
+
},
|
|
136887
|
+
// Day of year
|
|
136888
|
+
D: function (date, token, localize) {
|
|
136889
|
+
var dayOfYear = getUTCDayOfYear(date);
|
|
136890
|
+
|
|
136891
|
+
if (token === 'Do') {
|
|
136892
|
+
return localize.ordinalNumber(dayOfYear, {
|
|
136893
|
+
unit: 'dayOfYear'
|
|
136894
|
+
});
|
|
136895
|
+
}
|
|
136896
|
+
|
|
136897
|
+
return addLeadingZeros(dayOfYear, token.length);
|
|
136898
|
+
},
|
|
136899
|
+
// Day of week
|
|
136900
|
+
E: function (date, token, localize) {
|
|
136901
|
+
var dayOfWeek = date.getUTCDay();
|
|
136902
|
+
|
|
136903
|
+
switch (token) {
|
|
136904
|
+
// Tue
|
|
136905
|
+
case 'E':
|
|
136906
|
+
case 'EE':
|
|
136907
|
+
case 'EEE':
|
|
136908
|
+
return localize.day(dayOfWeek, {
|
|
136909
|
+
width: 'abbreviated',
|
|
136910
|
+
context: 'formatting'
|
|
136911
|
+
});
|
|
136912
|
+
// T
|
|
136913
|
+
|
|
136914
|
+
case 'EEEEE':
|
|
136915
|
+
return localize.day(dayOfWeek, {
|
|
136916
|
+
width: 'narrow',
|
|
136917
|
+
context: 'formatting'
|
|
136918
|
+
});
|
|
136919
|
+
// Tu
|
|
136920
|
+
|
|
136921
|
+
case 'EEEEEE':
|
|
136922
|
+
return localize.day(dayOfWeek, {
|
|
136923
|
+
width: 'short',
|
|
136924
|
+
context: 'formatting'
|
|
136925
|
+
});
|
|
136926
|
+
// Tuesday
|
|
136927
|
+
|
|
136928
|
+
case 'EEEE':
|
|
136929
|
+
default:
|
|
136930
|
+
return localize.day(dayOfWeek, {
|
|
136931
|
+
width: 'wide',
|
|
136932
|
+
context: 'formatting'
|
|
136933
|
+
});
|
|
136934
|
+
}
|
|
136935
|
+
},
|
|
136936
|
+
// Local day of week
|
|
136937
|
+
e: function (date, token, localize, options) {
|
|
136938
|
+
var dayOfWeek = date.getUTCDay();
|
|
136939
|
+
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
136940
|
+
|
|
136941
|
+
switch (token) {
|
|
136942
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
136943
|
+
case 'e':
|
|
136944
|
+
return String(localDayOfWeek);
|
|
136945
|
+
// Padded numerical value
|
|
136946
|
+
|
|
136947
|
+
case 'ee':
|
|
136948
|
+
return addLeadingZeros(localDayOfWeek, 2);
|
|
136949
|
+
// 1st, 2nd, ..., 7th
|
|
136950
|
+
|
|
136951
|
+
case 'eo':
|
|
136952
|
+
return localize.ordinalNumber(localDayOfWeek, {
|
|
136953
|
+
unit: 'day'
|
|
136954
|
+
});
|
|
136955
|
+
|
|
136956
|
+
case 'eee':
|
|
136957
|
+
return localize.day(dayOfWeek, {
|
|
136958
|
+
width: 'abbreviated',
|
|
136959
|
+
context: 'formatting'
|
|
136960
|
+
});
|
|
136961
|
+
// T
|
|
136962
|
+
|
|
136963
|
+
case 'eeeee':
|
|
136964
|
+
return localize.day(dayOfWeek, {
|
|
136965
|
+
width: 'narrow',
|
|
136966
|
+
context: 'formatting'
|
|
136967
|
+
});
|
|
136968
|
+
// Tu
|
|
136969
|
+
|
|
136970
|
+
case 'eeeeee':
|
|
136971
|
+
return localize.day(dayOfWeek, {
|
|
136972
|
+
width: 'short',
|
|
136973
|
+
context: 'formatting'
|
|
136974
|
+
});
|
|
136975
|
+
// Tuesday
|
|
136976
|
+
|
|
136977
|
+
case 'eeee':
|
|
136978
|
+
default:
|
|
136979
|
+
return localize.day(dayOfWeek, {
|
|
136980
|
+
width: 'wide',
|
|
136981
|
+
context: 'formatting'
|
|
136982
|
+
});
|
|
136983
|
+
}
|
|
136984
|
+
},
|
|
136985
|
+
// Stand-alone local day of week
|
|
136986
|
+
c: function (date, token, localize, options) {
|
|
136987
|
+
var dayOfWeek = date.getUTCDay();
|
|
136988
|
+
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
136989
|
+
|
|
136990
|
+
switch (token) {
|
|
136991
|
+
// Numerical value (same as in `e`)
|
|
136992
|
+
case 'c':
|
|
136993
|
+
return String(localDayOfWeek);
|
|
136994
|
+
// Padded numerical value
|
|
136995
|
+
|
|
136996
|
+
case 'cc':
|
|
136997
|
+
return addLeadingZeros(localDayOfWeek, token.length);
|
|
136998
|
+
// 1st, 2nd, ..., 7th
|
|
136999
|
+
|
|
137000
|
+
case 'co':
|
|
137001
|
+
return localize.ordinalNumber(localDayOfWeek, {
|
|
137002
|
+
unit: 'day'
|
|
137003
|
+
});
|
|
137004
|
+
|
|
137005
|
+
case 'ccc':
|
|
137006
|
+
return localize.day(dayOfWeek, {
|
|
137007
|
+
width: 'abbreviated',
|
|
137008
|
+
context: 'standalone'
|
|
137009
|
+
});
|
|
137010
|
+
// T
|
|
137011
|
+
|
|
137012
|
+
case 'ccccc':
|
|
137013
|
+
return localize.day(dayOfWeek, {
|
|
137014
|
+
width: 'narrow',
|
|
137015
|
+
context: 'standalone'
|
|
137016
|
+
});
|
|
137017
|
+
// Tu
|
|
137018
|
+
|
|
137019
|
+
case 'cccccc':
|
|
137020
|
+
return localize.day(dayOfWeek, {
|
|
137021
|
+
width: 'short',
|
|
137022
|
+
context: 'standalone'
|
|
137023
|
+
});
|
|
137024
|
+
// Tuesday
|
|
137025
|
+
|
|
137026
|
+
case 'cccc':
|
|
137027
|
+
default:
|
|
137028
|
+
return localize.day(dayOfWeek, {
|
|
137029
|
+
width: 'wide',
|
|
137030
|
+
context: 'standalone'
|
|
137031
|
+
});
|
|
137032
|
+
}
|
|
137033
|
+
},
|
|
137034
|
+
// ISO day of week
|
|
137035
|
+
i: function (date, token, localize) {
|
|
137036
|
+
var dayOfWeek = date.getUTCDay();
|
|
137037
|
+
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
137038
|
+
|
|
137039
|
+
switch (token) {
|
|
137040
|
+
// 2
|
|
137041
|
+
case 'i':
|
|
137042
|
+
return String(isoDayOfWeek);
|
|
137043
|
+
// 02
|
|
137044
|
+
|
|
137045
|
+
case 'ii':
|
|
137046
|
+
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
137047
|
+
// 2nd
|
|
137048
|
+
|
|
137049
|
+
case 'io':
|
|
137050
|
+
return localize.ordinalNumber(isoDayOfWeek, {
|
|
137051
|
+
unit: 'day'
|
|
137052
|
+
});
|
|
137053
|
+
// Tue
|
|
137054
|
+
|
|
137055
|
+
case 'iii':
|
|
137056
|
+
return localize.day(dayOfWeek, {
|
|
137057
|
+
width: 'abbreviated',
|
|
137058
|
+
context: 'formatting'
|
|
137059
|
+
});
|
|
137060
|
+
// T
|
|
137061
|
+
|
|
137062
|
+
case 'iiiii':
|
|
137063
|
+
return localize.day(dayOfWeek, {
|
|
137064
|
+
width: 'narrow',
|
|
137065
|
+
context: 'formatting'
|
|
137066
|
+
});
|
|
137067
|
+
// Tu
|
|
137068
|
+
|
|
137069
|
+
case 'iiiiii':
|
|
137070
|
+
return localize.day(dayOfWeek, {
|
|
137071
|
+
width: 'short',
|
|
137072
|
+
context: 'formatting'
|
|
137073
|
+
});
|
|
137074
|
+
// Tuesday
|
|
137075
|
+
|
|
137076
|
+
case 'iiii':
|
|
137077
|
+
default:
|
|
137078
|
+
return localize.day(dayOfWeek, {
|
|
137079
|
+
width: 'wide',
|
|
137080
|
+
context: 'formatting'
|
|
137081
|
+
});
|
|
137082
|
+
}
|
|
137083
|
+
},
|
|
137084
|
+
// AM or PM
|
|
137085
|
+
a: function (date, token, localize) {
|
|
137086
|
+
var hours = date.getUTCHours();
|
|
137087
|
+
var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
|
137088
|
+
|
|
137089
|
+
switch (token) {
|
|
137090
|
+
case 'a':
|
|
137091
|
+
case 'aa':
|
|
137092
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137093
|
+
width: 'abbreviated',
|
|
137094
|
+
context: 'formatting'
|
|
137095
|
+
});
|
|
137096
|
+
|
|
137097
|
+
case 'aaa':
|
|
137098
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137099
|
+
width: 'abbreviated',
|
|
137100
|
+
context: 'formatting'
|
|
137101
|
+
}).toLowerCase();
|
|
137102
|
+
|
|
137103
|
+
case 'aaaaa':
|
|
137104
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137105
|
+
width: 'narrow',
|
|
137106
|
+
context: 'formatting'
|
|
137107
|
+
});
|
|
137108
|
+
|
|
137109
|
+
case 'aaaa':
|
|
137110
|
+
default:
|
|
137111
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137112
|
+
width: 'wide',
|
|
137113
|
+
context: 'formatting'
|
|
137114
|
+
});
|
|
137115
|
+
}
|
|
137116
|
+
},
|
|
137117
|
+
// AM, PM, midnight, noon
|
|
137118
|
+
b: function (date, token, localize) {
|
|
137119
|
+
var hours = date.getUTCHours();
|
|
137120
|
+
var dayPeriodEnumValue;
|
|
137121
|
+
|
|
137122
|
+
if (hours === 12) {
|
|
137123
|
+
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
137124
|
+
} else if (hours === 0) {
|
|
137125
|
+
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
137126
|
+
} else {
|
|
137127
|
+
dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
|
137128
|
+
}
|
|
137129
|
+
|
|
137130
|
+
switch (token) {
|
|
137131
|
+
case 'b':
|
|
137132
|
+
case 'bb':
|
|
137133
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137134
|
+
width: 'abbreviated',
|
|
137135
|
+
context: 'formatting'
|
|
137136
|
+
});
|
|
137137
|
+
|
|
137138
|
+
case 'bbb':
|
|
137139
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137140
|
+
width: 'abbreviated',
|
|
137141
|
+
context: 'formatting'
|
|
137142
|
+
}).toLowerCase();
|
|
137143
|
+
|
|
137144
|
+
case 'bbbbb':
|
|
137145
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137146
|
+
width: 'narrow',
|
|
137147
|
+
context: 'formatting'
|
|
137148
|
+
});
|
|
137149
|
+
|
|
137150
|
+
case 'bbbb':
|
|
137151
|
+
default:
|
|
137152
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137153
|
+
width: 'wide',
|
|
137154
|
+
context: 'formatting'
|
|
137155
|
+
});
|
|
137156
|
+
}
|
|
137157
|
+
},
|
|
137158
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
137159
|
+
B: function (date, token, localize) {
|
|
137160
|
+
var hours = date.getUTCHours();
|
|
137161
|
+
var dayPeriodEnumValue;
|
|
137162
|
+
|
|
137163
|
+
if (hours >= 17) {
|
|
137164
|
+
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
137165
|
+
} else if (hours >= 12) {
|
|
137166
|
+
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
137167
|
+
} else if (hours >= 4) {
|
|
137168
|
+
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
137169
|
+
} else {
|
|
137170
|
+
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
137171
|
+
}
|
|
137172
|
+
|
|
137173
|
+
switch (token) {
|
|
137174
|
+
case 'B':
|
|
137175
|
+
case 'BB':
|
|
137176
|
+
case 'BBB':
|
|
137177
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137178
|
+
width: 'abbreviated',
|
|
137179
|
+
context: 'formatting'
|
|
137180
|
+
});
|
|
137181
|
+
|
|
137182
|
+
case 'BBBBB':
|
|
137183
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137184
|
+
width: 'narrow',
|
|
137185
|
+
context: 'formatting'
|
|
137186
|
+
});
|
|
137187
|
+
|
|
137188
|
+
case 'BBBB':
|
|
137189
|
+
default:
|
|
137190
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
137191
|
+
width: 'wide',
|
|
137192
|
+
context: 'formatting'
|
|
137193
|
+
});
|
|
137194
|
+
}
|
|
137195
|
+
},
|
|
137196
|
+
// Hour [1-12]
|
|
137197
|
+
h: function (date, token, localize) {
|
|
137198
|
+
if (token === 'ho') {
|
|
137199
|
+
var hours = date.getUTCHours() % 12;
|
|
137200
|
+
if (hours === 0) hours = 12;
|
|
137201
|
+
return localize.ordinalNumber(hours, {
|
|
137202
|
+
unit: 'hour'
|
|
137203
|
+
});
|
|
137204
|
+
}
|
|
137205
|
+
|
|
137206
|
+
return formatters$3.h(date, token);
|
|
137207
|
+
},
|
|
137208
|
+
// Hour [0-23]
|
|
137209
|
+
H: function (date, token, localize) {
|
|
137210
|
+
if (token === 'Ho') {
|
|
137211
|
+
return localize.ordinalNumber(date.getUTCHours(), {
|
|
137212
|
+
unit: 'hour'
|
|
137213
|
+
});
|
|
137214
|
+
}
|
|
137215
|
+
|
|
137216
|
+
return formatters$3.H(date, token);
|
|
137217
|
+
},
|
|
137218
|
+
// Hour [0-11]
|
|
137219
|
+
K: function (date, token, localize) {
|
|
137220
|
+
var hours = date.getUTCHours() % 12;
|
|
137221
|
+
|
|
137222
|
+
if (token === 'Ko') {
|
|
137223
|
+
return localize.ordinalNumber(hours, {
|
|
137224
|
+
unit: 'hour'
|
|
137225
|
+
});
|
|
137226
|
+
}
|
|
137227
|
+
|
|
137228
|
+
return addLeadingZeros(hours, token.length);
|
|
137229
|
+
},
|
|
137230
|
+
// Hour [1-24]
|
|
137231
|
+
k: function (date, token, localize) {
|
|
137232
|
+
var hours = date.getUTCHours();
|
|
137233
|
+
if (hours === 0) hours = 24;
|
|
137234
|
+
|
|
137235
|
+
if (token === 'ko') {
|
|
137236
|
+
return localize.ordinalNumber(hours, {
|
|
137237
|
+
unit: 'hour'
|
|
137238
|
+
});
|
|
137239
|
+
}
|
|
137240
|
+
|
|
137241
|
+
return addLeadingZeros(hours, token.length);
|
|
137242
|
+
},
|
|
137243
|
+
// Minute
|
|
137244
|
+
m: function (date, token, localize) {
|
|
137245
|
+
if (token === 'mo') {
|
|
137246
|
+
return localize.ordinalNumber(date.getUTCMinutes(), {
|
|
137247
|
+
unit: 'minute'
|
|
137248
|
+
});
|
|
137249
|
+
}
|
|
137250
|
+
|
|
137251
|
+
return formatters$3.m(date, token);
|
|
137252
|
+
},
|
|
137253
|
+
// Second
|
|
137254
|
+
s: function (date, token, localize) {
|
|
137255
|
+
if (token === 'so') {
|
|
137256
|
+
return localize.ordinalNumber(date.getUTCSeconds(), {
|
|
137257
|
+
unit: 'second'
|
|
137258
|
+
});
|
|
137259
|
+
}
|
|
137260
|
+
|
|
137261
|
+
return formatters$3.s(date, token);
|
|
137262
|
+
},
|
|
137263
|
+
// Fraction of second
|
|
137264
|
+
S: function (date, token) {
|
|
137265
|
+
return formatters$3.S(date, token);
|
|
137266
|
+
},
|
|
137267
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
137268
|
+
X: function (date, token, _localize, options) {
|
|
137269
|
+
var originalDate = options._originalDate || date;
|
|
137270
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
137271
|
+
|
|
137272
|
+
if (timezoneOffset === 0) {
|
|
137273
|
+
return 'Z';
|
|
137274
|
+
}
|
|
137275
|
+
|
|
137276
|
+
switch (token) {
|
|
137277
|
+
// Hours and optional minutes
|
|
137278
|
+
case 'X':
|
|
137279
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
137280
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
137281
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
137282
|
+
// so this token always has the same output as `XX`
|
|
137283
|
+
|
|
137284
|
+
case 'XXXX':
|
|
137285
|
+
case 'XX':
|
|
137286
|
+
// Hours and minutes without `:` delimiter
|
|
137287
|
+
return formatTimezone(timezoneOffset);
|
|
137288
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
137289
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
137290
|
+
// so this token always has the same output as `XXX`
|
|
137291
|
+
|
|
137292
|
+
case 'XXXXX':
|
|
137293
|
+
case 'XXX': // Hours and minutes with `:` delimiter
|
|
137294
|
+
|
|
137295
|
+
default:
|
|
137296
|
+
return formatTimezone(timezoneOffset, ':');
|
|
137297
|
+
}
|
|
137298
|
+
},
|
|
137299
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
137300
|
+
x: function (date, token, _localize, options) {
|
|
137301
|
+
var originalDate = options._originalDate || date;
|
|
137302
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
137303
|
+
|
|
137304
|
+
switch (token) {
|
|
137305
|
+
// Hours and optional minutes
|
|
137306
|
+
case 'x':
|
|
137307
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
137308
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
137309
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
137310
|
+
// so this token always has the same output as `xx`
|
|
137311
|
+
|
|
137312
|
+
case 'xxxx':
|
|
137313
|
+
case 'xx':
|
|
137314
|
+
// Hours and minutes without `:` delimiter
|
|
137315
|
+
return formatTimezone(timezoneOffset);
|
|
137316
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
137317
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
137318
|
+
// so this token always has the same output as `xxx`
|
|
137319
|
+
|
|
137320
|
+
case 'xxxxx':
|
|
137321
|
+
case 'xxx': // Hours and minutes with `:` delimiter
|
|
137322
|
+
|
|
137323
|
+
default:
|
|
137324
|
+
return formatTimezone(timezoneOffset, ':');
|
|
137325
|
+
}
|
|
137326
|
+
},
|
|
137327
|
+
// Timezone (GMT)
|
|
137328
|
+
O: function (date, token, _localize, options) {
|
|
137329
|
+
var originalDate = options._originalDate || date;
|
|
137330
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
137331
|
+
|
|
137332
|
+
switch (token) {
|
|
137333
|
+
// Short
|
|
137334
|
+
case 'O':
|
|
137335
|
+
case 'OO':
|
|
137336
|
+
case 'OOO':
|
|
137337
|
+
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
|
137338
|
+
// Long
|
|
137339
|
+
|
|
137340
|
+
case 'OOOO':
|
|
137341
|
+
default:
|
|
137342
|
+
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
|
137343
|
+
}
|
|
137344
|
+
},
|
|
137345
|
+
// Timezone (specific non-location)
|
|
137346
|
+
z: function (date, token, _localize, options) {
|
|
137347
|
+
var originalDate = options._originalDate || date;
|
|
137348
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
137349
|
+
|
|
137350
|
+
switch (token) {
|
|
137351
|
+
// Short
|
|
137352
|
+
case 'z':
|
|
137353
|
+
case 'zz':
|
|
137354
|
+
case 'zzz':
|
|
137355
|
+
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
|
137356
|
+
// Long
|
|
137357
|
+
|
|
137358
|
+
case 'zzzz':
|
|
137359
|
+
default:
|
|
137360
|
+
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
|
137361
|
+
}
|
|
137362
|
+
},
|
|
137363
|
+
// Seconds timestamp
|
|
137364
|
+
t: function (date, token, _localize, options) {
|
|
137365
|
+
var originalDate = options._originalDate || date;
|
|
137366
|
+
var timestamp = Math.floor(originalDate.getTime() / 1000);
|
|
137367
|
+
return addLeadingZeros(timestamp, token.length);
|
|
137368
|
+
},
|
|
137369
|
+
// Milliseconds timestamp
|
|
137370
|
+
T: function (date, token, _localize, options) {
|
|
137371
|
+
var originalDate = options._originalDate || date;
|
|
137372
|
+
var timestamp = originalDate.getTime();
|
|
137373
|
+
return addLeadingZeros(timestamp, token.length);
|
|
137374
|
+
}
|
|
137375
|
+
};
|
|
137376
|
+
|
|
137377
|
+
function formatTimezoneShort(offset, dirtyDelimiter) {
|
|
137378
|
+
var sign = offset > 0 ? '-' : '+';
|
|
137379
|
+
var absOffset = Math.abs(offset);
|
|
137380
|
+
var hours = Math.floor(absOffset / 60);
|
|
137381
|
+
var minutes = absOffset % 60;
|
|
137382
|
+
|
|
137383
|
+
if (minutes === 0) {
|
|
137384
|
+
return sign + String(hours);
|
|
137385
|
+
}
|
|
137386
|
+
|
|
137387
|
+
var delimiter = dirtyDelimiter || '';
|
|
137388
|
+
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
137389
|
+
}
|
|
137390
|
+
|
|
137391
|
+
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
|
137392
|
+
if (offset % 60 === 0) {
|
|
137393
|
+
var sign = offset > 0 ? '-' : '+';
|
|
137394
|
+
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
137395
|
+
}
|
|
137396
|
+
|
|
137397
|
+
return formatTimezone(offset, dirtyDelimiter);
|
|
137398
|
+
}
|
|
137399
|
+
|
|
137400
|
+
function formatTimezone(offset, dirtyDelimiter) {
|
|
137401
|
+
var delimiter = dirtyDelimiter || '';
|
|
137402
|
+
var sign = offset > 0 ? '-' : '+';
|
|
137403
|
+
var absOffset = Math.abs(offset);
|
|
137404
|
+
var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
|
|
137405
|
+
var minutes = addLeadingZeros(absOffset % 60, 2);
|
|
137406
|
+
return sign + hours + delimiter + minutes;
|
|
137407
|
+
}
|
|
137408
|
+
|
|
137409
|
+
var formatters$1 = formatters;
|
|
137410
|
+
|
|
137411
|
+
function dateLongFormatter(pattern, formatLong) {
|
|
137412
|
+
switch (pattern) {
|
|
137413
|
+
case 'P':
|
|
137414
|
+
return formatLong.date({
|
|
137415
|
+
width: 'short'
|
|
137416
|
+
});
|
|
137417
|
+
|
|
137418
|
+
case 'PP':
|
|
137419
|
+
return formatLong.date({
|
|
137420
|
+
width: 'medium'
|
|
137421
|
+
});
|
|
137422
|
+
|
|
137423
|
+
case 'PPP':
|
|
137424
|
+
return formatLong.date({
|
|
137425
|
+
width: 'long'
|
|
137426
|
+
});
|
|
137427
|
+
|
|
137428
|
+
case 'PPPP':
|
|
137429
|
+
default:
|
|
137430
|
+
return formatLong.date({
|
|
137431
|
+
width: 'full'
|
|
137432
|
+
});
|
|
137433
|
+
}
|
|
137434
|
+
}
|
|
137435
|
+
|
|
137436
|
+
function timeLongFormatter(pattern, formatLong) {
|
|
137437
|
+
switch (pattern) {
|
|
137438
|
+
case 'p':
|
|
137439
|
+
return formatLong.time({
|
|
137440
|
+
width: 'short'
|
|
137441
|
+
});
|
|
137442
|
+
|
|
137443
|
+
case 'pp':
|
|
137444
|
+
return formatLong.time({
|
|
137445
|
+
width: 'medium'
|
|
137446
|
+
});
|
|
137447
|
+
|
|
137448
|
+
case 'ppp':
|
|
137449
|
+
return formatLong.time({
|
|
137450
|
+
width: 'long'
|
|
137451
|
+
});
|
|
137452
|
+
|
|
137453
|
+
case 'pppp':
|
|
137454
|
+
default:
|
|
137455
|
+
return formatLong.time({
|
|
137456
|
+
width: 'full'
|
|
137457
|
+
});
|
|
137458
|
+
}
|
|
137459
|
+
}
|
|
137460
|
+
|
|
137461
|
+
function dateTimeLongFormatter(pattern, formatLong) {
|
|
137462
|
+
var matchResult = pattern.match(/(P+)(p+)?/);
|
|
137463
|
+
var datePattern = matchResult[1];
|
|
137464
|
+
var timePattern = matchResult[2];
|
|
137465
|
+
|
|
137466
|
+
if (!timePattern) {
|
|
137467
|
+
return dateLongFormatter(pattern, formatLong);
|
|
137468
|
+
}
|
|
137469
|
+
|
|
137470
|
+
var dateTimeFormat;
|
|
137471
|
+
|
|
137472
|
+
switch (datePattern) {
|
|
137473
|
+
case 'P':
|
|
137474
|
+
dateTimeFormat = formatLong.dateTime({
|
|
137475
|
+
width: 'short'
|
|
137476
|
+
});
|
|
137477
|
+
break;
|
|
137478
|
+
|
|
137479
|
+
case 'PP':
|
|
137480
|
+
dateTimeFormat = formatLong.dateTime({
|
|
137481
|
+
width: 'medium'
|
|
137482
|
+
});
|
|
137483
|
+
break;
|
|
137484
|
+
|
|
137485
|
+
case 'PPP':
|
|
137486
|
+
dateTimeFormat = formatLong.dateTime({
|
|
137487
|
+
width: 'long'
|
|
137488
|
+
});
|
|
137489
|
+
break;
|
|
137490
|
+
|
|
137491
|
+
case 'PPPP':
|
|
137492
|
+
default:
|
|
137493
|
+
dateTimeFormat = formatLong.dateTime({
|
|
137494
|
+
width: 'full'
|
|
137495
|
+
});
|
|
137496
|
+
break;
|
|
137497
|
+
}
|
|
137498
|
+
|
|
137499
|
+
return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
|
|
137500
|
+
}
|
|
137501
|
+
|
|
137502
|
+
var longFormatters = {
|
|
137503
|
+
p: timeLongFormatter,
|
|
137504
|
+
P: dateTimeLongFormatter
|
|
137505
|
+
};
|
|
137506
|
+
var longFormatters$1 = longFormatters;
|
|
137507
|
+
|
|
137508
|
+
var protectedDayOfYearTokens = ['D', 'DD'];
|
|
137509
|
+
var protectedWeekYearTokens = ['YY', 'YYYY'];
|
|
137510
|
+
function isProtectedDayOfYearToken(token) {
|
|
137511
|
+
return protectedDayOfYearTokens.indexOf(token) !== -1;
|
|
137512
|
+
}
|
|
137513
|
+
function isProtectedWeekYearToken(token) {
|
|
137514
|
+
return protectedWeekYearTokens.indexOf(token) !== -1;
|
|
137515
|
+
}
|
|
137516
|
+
function throwProtectedError(token, format, input) {
|
|
137517
|
+
if (token === 'YYYY') {
|
|
137518
|
+
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
137519
|
+
} else if (token === 'YY') {
|
|
137520
|
+
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
137521
|
+
} else if (token === 'D') {
|
|
137522
|
+
throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
137523
|
+
} else if (token === 'DD') {
|
|
137524
|
+
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
137525
|
+
}
|
|
137526
|
+
}
|
|
137527
|
+
|
|
137528
|
+
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
|
|
137529
|
+
// (one of the certain letters followed by `o`)
|
|
137530
|
+
// - (\w)\1* matches any sequences of the same letter
|
|
137531
|
+
// - '' matches two quote characters in a row
|
|
137532
|
+
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
|
|
137533
|
+
// except a single quote symbol, which ends the sequence.
|
|
137534
|
+
// Two quote characters do not end the sequence.
|
|
137535
|
+
// If there is no matching single quote
|
|
137536
|
+
// then the sequence will continue until the end of the string.
|
|
137537
|
+
// - . matches any single character unmatched by previous parts of the RegExps
|
|
137538
|
+
|
|
137539
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
|
|
137540
|
+
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
|
|
137541
|
+
|
|
137542
|
+
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
137543
|
+
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
137544
|
+
var doubleQuoteRegExp = /''/g;
|
|
137545
|
+
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
137546
|
+
/**
|
|
137547
|
+
* @name format
|
|
137548
|
+
* @category Common Helpers
|
|
137549
|
+
* @summary Format the date.
|
|
137550
|
+
*
|
|
137551
|
+
* @description
|
|
137552
|
+
* Return the formatted date string in the given format. The result may vary by locale.
|
|
137553
|
+
*
|
|
137554
|
+
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
137555
|
+
* > See: https://git.io/fxCyr
|
|
137556
|
+
*
|
|
137557
|
+
* The characters wrapped between two single quotes characters (') are escaped.
|
|
137558
|
+
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
137559
|
+
* (see the last example)
|
|
137560
|
+
*
|
|
137561
|
+
* Format of the string is based on Unicode Technical Standard #35:
|
|
137562
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
137563
|
+
* with a few additions (see note 7 below the table).
|
|
137564
|
+
*
|
|
137565
|
+
* Accepted patterns:
|
|
137566
|
+
* | Unit | Pattern | Result examples | Notes |
|
|
137567
|
+
* |---------------------------------|---------|-----------------------------------|-------|
|
|
137568
|
+
* | Era | G..GGG | AD, BC | |
|
|
137569
|
+
* | | GGGG | Anno Domini, Before Christ | 2 |
|
|
137570
|
+
* | | GGGGG | A, B | |
|
|
137571
|
+
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
|
|
137572
|
+
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
|
|
137573
|
+
* | | yy | 44, 01, 00, 17 | 5 |
|
|
137574
|
+
* | | yyy | 044, 001, 1900, 2017 | 5 |
|
|
137575
|
+
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
|
|
137576
|
+
* | | yyyyy | ... | 3,5 |
|
|
137577
|
+
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
|
|
137578
|
+
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
|
|
137579
|
+
* | | YY | 44, 01, 00, 17 | 5,8 |
|
|
137580
|
+
* | | YYY | 044, 001, 1900, 2017 | 5 |
|
|
137581
|
+
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
|
|
137582
|
+
* | | YYYYY | ... | 3,5 |
|
|
137583
|
+
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
|
|
137584
|
+
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
|
|
137585
|
+
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
|
|
137586
|
+
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
|
|
137587
|
+
* | | RRRRR | ... | 3,5,7 |
|
|
137588
|
+
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
|
|
137589
|
+
* | | uu | -43, 01, 1900, 2017 | 5 |
|
|
137590
|
+
* | | uuu | -043, 001, 1900, 2017 | 5 |
|
|
137591
|
+
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
|
|
137592
|
+
* | | uuuuu | ... | 3,5 |
|
|
137593
|
+
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
|
|
137594
|
+
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
|
|
137595
|
+
* | | QQ | 01, 02, 03, 04 | |
|
|
137596
|
+
* | | QQQ | Q1, Q2, Q3, Q4 | |
|
|
137597
|
+
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
|
|
137598
|
+
* | | QQQQQ | 1, 2, 3, 4 | 4 |
|
|
137599
|
+
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
|
|
137600
|
+
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
|
|
137601
|
+
* | | qq | 01, 02, 03, 04 | |
|
|
137602
|
+
* | | qqq | Q1, Q2, Q3, Q4 | |
|
|
137603
|
+
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
|
|
137604
|
+
* | | qqqqq | 1, 2, 3, 4 | 4 |
|
|
137605
|
+
* | Month (formatting) | M | 1, 2, ..., 12 | |
|
|
137606
|
+
* | | Mo | 1st, 2nd, ..., 12th | 7 |
|
|
137607
|
+
* | | MM | 01, 02, ..., 12 | |
|
|
137608
|
+
* | | MMM | Jan, Feb, ..., Dec | |
|
|
137609
|
+
* | | MMMM | January, February, ..., December | 2 |
|
|
137610
|
+
* | | MMMMM | J, F, ..., D | |
|
|
137611
|
+
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
|
|
137612
|
+
* | | Lo | 1st, 2nd, ..., 12th | 7 |
|
|
137613
|
+
* | | LL | 01, 02, ..., 12 | |
|
|
137614
|
+
* | | LLL | Jan, Feb, ..., Dec | |
|
|
137615
|
+
* | | LLLL | January, February, ..., December | 2 |
|
|
137616
|
+
* | | LLLLL | J, F, ..., D | |
|
|
137617
|
+
* | Local week of year | w | 1, 2, ..., 53 | |
|
|
137618
|
+
* | | wo | 1st, 2nd, ..., 53th | 7 |
|
|
137619
|
+
* | | ww | 01, 02, ..., 53 | |
|
|
137620
|
+
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
|
|
137621
|
+
* | | Io | 1st, 2nd, ..., 53th | 7 |
|
|
137622
|
+
* | | II | 01, 02, ..., 53 | 7 |
|
|
137623
|
+
* | Day of month | d | 1, 2, ..., 31 | |
|
|
137624
|
+
* | | do | 1st, 2nd, ..., 31st | 7 |
|
|
137625
|
+
* | | dd | 01, 02, ..., 31 | |
|
|
137626
|
+
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
|
|
137627
|
+
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
|
|
137628
|
+
* | | DD | 01, 02, ..., 365, 366 | 9 |
|
|
137629
|
+
* | | DDD | 001, 002, ..., 365, 366 | |
|
|
137630
|
+
* | | DDDD | ... | 3 |
|
|
137631
|
+
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
|
137632
|
+
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
137633
|
+
* | | EEEEE | M, T, W, T, F, S, S | |
|
|
137634
|
+
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
137635
|
+
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
|
|
137636
|
+
* | | io | 1st, 2nd, ..., 7th | 7 |
|
|
137637
|
+
* | | ii | 01, 02, ..., 07 | 7 |
|
|
137638
|
+
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
|
|
137639
|
+
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
|
|
137640
|
+
* | | iiiii | M, T, W, T, F, S, S | 7 |
|
|
137641
|
+
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
|
|
137642
|
+
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
|
|
137643
|
+
* | | eo | 2nd, 3rd, ..., 1st | 7 |
|
|
137644
|
+
* | | ee | 02, 03, ..., 01 | |
|
|
137645
|
+
* | | eee | Mon, Tue, Wed, ..., Sun | |
|
|
137646
|
+
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
137647
|
+
* | | eeeee | M, T, W, T, F, S, S | |
|
|
137648
|
+
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
137649
|
+
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
|
|
137650
|
+
* | | co | 2nd, 3rd, ..., 1st | 7 |
|
|
137651
|
+
* | | cc | 02, 03, ..., 01 | |
|
|
137652
|
+
* | | ccc | Mon, Tue, Wed, ..., Sun | |
|
|
137653
|
+
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
137654
|
+
* | | ccccc | M, T, W, T, F, S, S | |
|
|
137655
|
+
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
137656
|
+
* | AM, PM | a..aa | AM, PM | |
|
|
137657
|
+
* | | aaa | am, pm | |
|
|
137658
|
+
* | | aaaa | a.m., p.m. | 2 |
|
|
137659
|
+
* | | aaaaa | a, p | |
|
|
137660
|
+
* | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
|
|
137661
|
+
* | | bbb | am, pm, noon, midnight | |
|
|
137662
|
+
* | | bbbb | a.m., p.m., noon, midnight | 2 |
|
|
137663
|
+
* | | bbbbb | a, p, n, mi | |
|
|
137664
|
+
* | Flexible day period | B..BBB | at night, in the morning, ... | |
|
|
137665
|
+
* | | BBBB | at night, in the morning, ... | 2 |
|
|
137666
|
+
* | | BBBBB | at night, in the morning, ... | |
|
|
137667
|
+
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
|
|
137668
|
+
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
|
|
137669
|
+
* | | hh | 01, 02, ..., 11, 12 | |
|
|
137670
|
+
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
|
|
137671
|
+
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
|
|
137672
|
+
* | | HH | 00, 01, 02, ..., 23 | |
|
|
137673
|
+
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
|
|
137674
|
+
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
|
|
137675
|
+
* | | KK | 01, 02, ..., 11, 00 | |
|
|
137676
|
+
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
|
|
137677
|
+
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
|
|
137678
|
+
* | | kk | 24, 01, 02, ..., 23 | |
|
|
137679
|
+
* | Minute | m | 0, 1, ..., 59 | |
|
|
137680
|
+
* | | mo | 0th, 1st, ..., 59th | 7 |
|
|
137681
|
+
* | | mm | 00, 01, ..., 59 | |
|
|
137682
|
+
* | Second | s | 0, 1, ..., 59 | |
|
|
137683
|
+
* | | so | 0th, 1st, ..., 59th | 7 |
|
|
137684
|
+
* | | ss | 00, 01, ..., 59 | |
|
|
137685
|
+
* | Fraction of second | S | 0, 1, ..., 9 | |
|
|
137686
|
+
* | | SS | 00, 01, ..., 99 | |
|
|
137687
|
+
* | | SSS | 000, 001, ..., 999 | |
|
|
137688
|
+
* | | SSSS | ... | 3 |
|
|
137689
|
+
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
|
|
137690
|
+
* | | XX | -0800, +0530, Z | |
|
|
137691
|
+
* | | XXX | -08:00, +05:30, Z | |
|
|
137692
|
+
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
|
|
137693
|
+
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
|
|
137694
|
+
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
|
|
137695
|
+
* | | xx | -0800, +0530, +0000 | |
|
|
137696
|
+
* | | xxx | -08:00, +05:30, +00:00 | 2 |
|
|
137697
|
+
* | | xxxx | -0800, +0530, +0000, +123456 | |
|
|
137698
|
+
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
|
|
137699
|
+
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
|
|
137700
|
+
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
|
|
137701
|
+
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
|
|
137702
|
+
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
|
|
137703
|
+
* | Seconds timestamp | t | 512969520 | 7 |
|
|
137704
|
+
* | | tt | ... | 3,7 |
|
|
137705
|
+
* | Milliseconds timestamp | T | 512969520900 | 7 |
|
|
137706
|
+
* | | TT | ... | 3,7 |
|
|
137707
|
+
* | Long localized date | P | 04/29/1453 | 7 |
|
|
137708
|
+
* | | PP | Apr 29, 1453 | 7 |
|
|
137709
|
+
* | | PPP | April 29th, 1453 | 7 |
|
|
137710
|
+
* | | PPPP | Friday, April 29th, 1453 | 2,7 |
|
|
137711
|
+
* | Long localized time | p | 12:00 AM | 7 |
|
|
137712
|
+
* | | pp | 12:00:00 AM | 7 |
|
|
137713
|
+
* | | ppp | 12:00:00 AM GMT+2 | 7 |
|
|
137714
|
+
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
|
|
137715
|
+
* | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
|
|
137716
|
+
* | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
|
|
137717
|
+
* | | PPPppp | April 29th, 1453 at ... | 7 |
|
|
137718
|
+
* | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
|
|
137719
|
+
* Notes:
|
|
137720
|
+
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
|
|
137721
|
+
* are the same as "stand-alone" units, but are different in some languages.
|
|
137722
|
+
* "Formatting" units are declined according to the rules of the language
|
|
137723
|
+
* in the context of a date. "Stand-alone" units are always nominative singular:
|
|
137724
|
+
*
|
|
137725
|
+
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
|
|
137726
|
+
*
|
|
137727
|
+
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
|
|
137728
|
+
*
|
|
137729
|
+
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
|
|
137730
|
+
* the single quote characters (see below).
|
|
137731
|
+
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
|
|
137732
|
+
* the output will be the same as default pattern for this unit, usually
|
|
137733
|
+
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
|
|
137734
|
+
* are marked with "2" in the last column of the table.
|
|
137735
|
+
*
|
|
137736
|
+
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
|
|
137737
|
+
*
|
|
137738
|
+
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
|
|
137739
|
+
*
|
|
137740
|
+
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
|
|
137741
|
+
*
|
|
137742
|
+
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
|
|
137743
|
+
*
|
|
137744
|
+
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
|
|
137745
|
+
*
|
|
137746
|
+
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
|
|
137747
|
+
* The output will be padded with zeros to match the length of the pattern.
|
|
137748
|
+
*
|
|
137749
|
+
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
|
|
137750
|
+
*
|
|
137751
|
+
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
|
|
137752
|
+
* These tokens represent the shortest form of the quarter.
|
|
137753
|
+
*
|
|
137754
|
+
* 5. The main difference between `y` and `u` patterns are B.C. years:
|
|
137755
|
+
*
|
|
137756
|
+
* | Year | `y` | `u` |
|
|
137757
|
+
* |------|-----|-----|
|
|
137758
|
+
* | AC 1 | 1 | 1 |
|
|
137759
|
+
* | BC 1 | 1 | 0 |
|
|
137760
|
+
* | BC 2 | 2 | -1 |
|
|
137761
|
+
*
|
|
137762
|
+
* Also `yy` always returns the last two digits of a year,
|
|
137763
|
+
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
|
|
137764
|
+
*
|
|
137765
|
+
* | Year | `yy` | `uu` |
|
|
137766
|
+
* |------|------|------|
|
|
137767
|
+
* | 1 | 01 | 01 |
|
|
137768
|
+
* | 14 | 14 | 14 |
|
|
137769
|
+
* | 376 | 76 | 376 |
|
|
137770
|
+
* | 1453 | 53 | 1453 |
|
|
137771
|
+
*
|
|
137772
|
+
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
|
|
137773
|
+
* except local week-numbering years are dependent on `options.weekStartsOn`
|
|
137774
|
+
* and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
|
|
137775
|
+
* and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
|
|
137776
|
+
*
|
|
137777
|
+
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
|
|
137778
|
+
* so right now these tokens fall back to GMT timezones.
|
|
137779
|
+
*
|
|
137780
|
+
* 7. These patterns are not in the Unicode Technical Standard #35:
|
|
137781
|
+
* - `i`: ISO day of week
|
|
137782
|
+
* - `I`: ISO week of year
|
|
137783
|
+
* - `R`: ISO week-numbering year
|
|
137784
|
+
* - `t`: seconds timestamp
|
|
137785
|
+
* - `T`: milliseconds timestamp
|
|
137786
|
+
* - `o`: ordinal number modifier
|
|
137787
|
+
* - `P`: long localized date
|
|
137788
|
+
* - `p`: long localized time
|
|
137789
|
+
*
|
|
137790
|
+
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
137791
|
+
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
|
|
137792
|
+
*
|
|
137793
|
+
* 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
|
|
137794
|
+
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
|
|
137795
|
+
*
|
|
137796
|
+
* ### v2.0.0 breaking changes:
|
|
137797
|
+
*
|
|
137798
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
137799
|
+
*
|
|
137800
|
+
* - The second argument is now required for the sake of explicitness.
|
|
137801
|
+
*
|
|
137802
|
+
* ```javascript
|
|
137803
|
+
* // Before v2.0.0
|
|
137804
|
+
* format(new Date(2016, 0, 1))
|
|
137805
|
+
*
|
|
137806
|
+
* // v2.0.0 onward
|
|
137807
|
+
* format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
|
|
137808
|
+
* ```
|
|
137809
|
+
*
|
|
137810
|
+
* - New format string API for `format` function
|
|
137811
|
+
* which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
|
|
137812
|
+
* See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
|
|
137813
|
+
*
|
|
137814
|
+
* - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
|
|
137815
|
+
*
|
|
137816
|
+
* @param {Date|Number} date - the original date
|
|
137817
|
+
* @param {String} format - the string of tokens
|
|
137818
|
+
* @param {Object} [options] - an object with options.
|
|
137819
|
+
* @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
|
|
137820
|
+
* @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
|
|
137821
|
+
* @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
|
|
137822
|
+
* @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
|
|
137823
|
+
* see: https://git.io/fxCyr
|
|
137824
|
+
* @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
|
|
137825
|
+
* see: https://git.io/fxCyr
|
|
137826
|
+
* @returns {String} the formatted date string
|
|
137827
|
+
* @throws {TypeError} 2 arguments required
|
|
137828
|
+
* @throws {RangeError} `date` must not be Invalid Date
|
|
137829
|
+
* @throws {RangeError} `options.locale` must contain `localize` property
|
|
137830
|
+
* @throws {RangeError} `options.locale` must contain `formatLong` property
|
|
137831
|
+
* @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
|
|
137832
|
+
* @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
|
|
137833
|
+
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
|
|
137834
|
+
* @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
|
|
137835
|
+
* @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
|
|
137836
|
+
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
|
|
137837
|
+
* @throws {RangeError} format string contains an unescaped latin alphabet character
|
|
137838
|
+
*
|
|
137839
|
+
* @example
|
|
137840
|
+
* // Represent 11 February 2014 in middle-endian format:
|
|
137841
|
+
* var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
|
|
137842
|
+
* //=> '02/11/2014'
|
|
137843
|
+
*
|
|
137844
|
+
* @example
|
|
137845
|
+
* // Represent 2 July 2014 in Esperanto:
|
|
137846
|
+
* import { eoLocale } from 'date-fns/locale/eo'
|
|
137847
|
+
* var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
|
|
137848
|
+
* locale: eoLocale
|
|
137849
|
+
* })
|
|
137850
|
+
* //=> '2-a de julio 2014'
|
|
137851
|
+
*
|
|
137852
|
+
* @example
|
|
137853
|
+
* // Escape string by single quote characters:
|
|
137854
|
+
* var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
|
|
137855
|
+
* //=> "3 o'clock"
|
|
137856
|
+
*/
|
|
137857
|
+
|
|
137858
|
+
function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
137859
|
+
requiredArgs(2, arguments);
|
|
137860
|
+
var formatStr = String(dirtyFormatStr);
|
|
137861
|
+
var options = dirtyOptions || {};
|
|
137862
|
+
var locale = options.locale || defaultLocale;
|
|
137863
|
+
var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
|
|
137864
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
137865
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
137866
|
+
|
|
137867
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
137868
|
+
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
137869
|
+
}
|
|
137870
|
+
|
|
137871
|
+
var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
|
|
137872
|
+
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
137873
|
+
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
137874
|
+
|
|
137875
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
137876
|
+
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
137877
|
+
}
|
|
137878
|
+
|
|
137879
|
+
if (!locale.localize) {
|
|
137880
|
+
throw new RangeError('locale must contain localize property');
|
|
137881
|
+
}
|
|
137882
|
+
|
|
137883
|
+
if (!locale.formatLong) {
|
|
137884
|
+
throw new RangeError('locale must contain formatLong property');
|
|
137885
|
+
}
|
|
137886
|
+
|
|
137887
|
+
var originalDate = toDate(dirtyDate);
|
|
137888
|
+
|
|
137889
|
+
if (!isValid(originalDate)) {
|
|
137890
|
+
throw new RangeError('Invalid time value');
|
|
137891
|
+
} // Convert the date in system timezone to the same date in UTC+00:00 timezone.
|
|
137892
|
+
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
|
|
137893
|
+
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
|
|
137894
|
+
|
|
137895
|
+
|
|
137896
|
+
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
|
|
137897
|
+
var utcDate = subMilliseconds(originalDate, timezoneOffset);
|
|
137898
|
+
var formatterOptions = {
|
|
137899
|
+
firstWeekContainsDate: firstWeekContainsDate,
|
|
137900
|
+
weekStartsOn: weekStartsOn,
|
|
137901
|
+
locale: locale,
|
|
137902
|
+
_originalDate: originalDate
|
|
137903
|
+
};
|
|
137904
|
+
var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
|
|
137905
|
+
var firstCharacter = substring[0];
|
|
137906
|
+
|
|
137907
|
+
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
|
137908
|
+
var longFormatter = longFormatters$1[firstCharacter];
|
|
137909
|
+
return longFormatter(substring, locale.formatLong, formatterOptions);
|
|
137910
|
+
}
|
|
137911
|
+
|
|
137912
|
+
return substring;
|
|
137913
|
+
}).join('').match(formattingTokensRegExp).map(function (substring) {
|
|
137914
|
+
// Replace two single quote characters with one single quote character
|
|
137915
|
+
if (substring === "''") {
|
|
137916
|
+
return "'";
|
|
137917
|
+
}
|
|
137918
|
+
|
|
137919
|
+
var firstCharacter = substring[0];
|
|
137920
|
+
|
|
137921
|
+
if (firstCharacter === "'") {
|
|
137922
|
+
return cleanEscapedString(substring);
|
|
137923
|
+
}
|
|
137924
|
+
|
|
137925
|
+
var formatter = formatters$1[firstCharacter];
|
|
137926
|
+
|
|
137927
|
+
if (formatter) {
|
|
137928
|
+
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
|
|
137929
|
+
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
|
137930
|
+
}
|
|
137931
|
+
|
|
137932
|
+
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
|
|
137933
|
+
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
|
137934
|
+
}
|
|
137935
|
+
|
|
137936
|
+
return formatter(utcDate, substring, locale.localize, formatterOptions);
|
|
137937
|
+
}
|
|
137938
|
+
|
|
137939
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
137940
|
+
throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
|
|
137941
|
+
}
|
|
137942
|
+
|
|
137943
|
+
return substring;
|
|
137944
|
+
}).join('');
|
|
137945
|
+
return result;
|
|
137946
|
+
}
|
|
137947
|
+
|
|
137948
|
+
function cleanEscapedString(input) {
|
|
137949
|
+
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
137950
|
+
}
|
|
137951
|
+
|
|
135600
137952
|
var PublishingDateFilter = function PublishingDateFilter() {
|
|
135601
137953
|
var publishingDateRef = useRef$1();
|
|
135602
137954
|
var formatMessage = useIntl().formatMessage;
|
|
@@ -135612,6 +137964,7 @@ var PublishingDateFilter = function PublishingDateFilter() {
|
|
|
135612
137964
|
var today = new Date();
|
|
135613
137965
|
var startOfToday = startOfDay(today);
|
|
135614
137966
|
var endOfToday = endOfDay(today);
|
|
137967
|
+
var isActive = (filter === null || filter === void 0 ? void 0 : filter.beforeDate) || (filter === null || filter === void 0 ? void 0 : filter.afterDate);
|
|
135615
137968
|
return jsxs("div", __assign$g({
|
|
135616
137969
|
ref: publishingDateRef
|
|
135617
137970
|
}, {
|
|
@@ -135619,13 +137972,13 @@ var PublishingDateFilter = function PublishingDateFilter() {
|
|
|
135619
137972
|
iconProps: {
|
|
135620
137973
|
iconName: showDates ? 'ChevronUp' : 'ChevronDown'
|
|
135621
137974
|
},
|
|
135622
|
-
text: formatMessage({
|
|
137975
|
+
text: isActive ? getButtonText() : formatMessage({
|
|
135623
137976
|
id: 'FilterPanel.publishingDate'
|
|
135624
137977
|
}),
|
|
135625
137978
|
onClick: function () {
|
|
135626
137979
|
return setShowDates(!showDates);
|
|
135627
137980
|
},
|
|
135628
|
-
isActive:
|
|
137981
|
+
isActive: isActive
|
|
135629
137982
|
}, void 0), showDates && jsx$1(Callout, __assign$g({
|
|
135630
137983
|
target: publishingDateRef.current,
|
|
135631
137984
|
onDismiss: function () {
|
|
@@ -135659,8 +138012,7 @@ var PublishingDateFilter = function PublishingDateFilter() {
|
|
|
135659
138012
|
noDateResourceKey: "MetadataEditor.noDate",
|
|
135660
138013
|
selectDateResourceKey: "FilterPanel.publishingDatePlaceholder",
|
|
135661
138014
|
onChanged: handleEndDateChange,
|
|
135662
|
-
minDate: filter === null || filter === void 0 ? void 0 : filter.afterDate
|
|
135663
|
-
maxDate: today.toString()
|
|
138015
|
+
minDate: filter === null || filter === void 0 ? void 0 : filter.afterDate
|
|
135664
138016
|
}, void 0), jsxs(DateShortcuts, {
|
|
135665
138017
|
children: [jsx$1(FormattedMessage$1, {
|
|
135666
138018
|
id: "FilterPanel.publishingDateShortcuts"
|
|
@@ -135734,6 +138086,25 @@ var PublishingDateFilter = function PublishingDateFilter() {
|
|
|
135734
138086
|
afterDate: null
|
|
135735
138087
|
}));
|
|
135736
138088
|
}
|
|
138089
|
+
|
|
138090
|
+
function getButtonText() {
|
|
138091
|
+
var start = format(new Date(filter.afterDate), 'P');
|
|
138092
|
+
var end = format(new Date(filter.beforeDate), 'P');
|
|
138093
|
+
|
|
138094
|
+
if (!filter.afterDate) {
|
|
138095
|
+
return formatMessage({
|
|
138096
|
+
id: 'FilterPanel.publishingDateBefore'
|
|
138097
|
+
}) + " " + end;
|
|
138098
|
+
}
|
|
138099
|
+
|
|
138100
|
+
if (!filter.beforeDate) {
|
|
138101
|
+
return formatMessage({
|
|
138102
|
+
id: 'FilterPanel.publishingDateAfter'
|
|
138103
|
+
}) + " " + start;
|
|
138104
|
+
}
|
|
138105
|
+
|
|
138106
|
+
return start + " - " + end;
|
|
138107
|
+
}
|
|
135737
138108
|
};
|
|
135738
138109
|
|
|
135739
138110
|
var DateShortcutButton = function DateShortcutButton(_a) {
|
|
@@ -135815,7 +138186,7 @@ var ToolbarFilterCalloutButton = function ToolbarFilterCalloutButton(_a) {
|
|
|
135815
138186
|
iconProps: {
|
|
135816
138187
|
iconName: showCallout ? 'ChevronUp' : 'ChevronDown'
|
|
135817
138188
|
},
|
|
135818
|
-
text: buttonText,
|
|
138189
|
+
text: !buttonContent ? buttonText : undefined,
|
|
135819
138190
|
onClick: function () {
|
|
135820
138191
|
return setShowCallout(!showCallout);
|
|
135821
138192
|
},
|
|
@@ -135880,6 +138251,7 @@ var KeywordsFilter = function KeywordsFilter() {
|
|
|
135880
138251
|
buttonText: formatMessage({
|
|
135881
138252
|
id: 'FilterPanel.keywordFilter'
|
|
135882
138253
|
}),
|
|
138254
|
+
buttonContent: getButtonContent(),
|
|
135883
138255
|
handleClearFilter: function () {
|
|
135884
138256
|
return onChange(__assign$g(__assign$g({}, filter), {
|
|
135885
138257
|
keywords: null
|
|
@@ -135897,12 +138269,30 @@ var KeywordsFilter = function KeywordsFilter() {
|
|
|
135897
138269
|
showSelectionToggle: true
|
|
135898
138270
|
}, void 0)
|
|
135899
138271
|
}), void 0);
|
|
138272
|
+
|
|
138273
|
+
function getButtonContent() {
|
|
138274
|
+
var _a;
|
|
138275
|
+
|
|
138276
|
+
var keywordsLength = (_a = filter === null || filter === void 0 ? void 0 : filter.keywords) === null || _a === void 0 ? void 0 : _a.length;
|
|
138277
|
+
|
|
138278
|
+
if (!keywordsLength) {
|
|
138279
|
+
return undefined;
|
|
138280
|
+
}
|
|
138281
|
+
|
|
138282
|
+
return jsxs(Fragment, {
|
|
138283
|
+
children: [jsx$1(KeywordTitle, {
|
|
138284
|
+
keywordName: filter.keywords[0].name
|
|
138285
|
+
}, void 0), "\u00A0", keywordsLength > 1 && jsxs(Fragment, {
|
|
138286
|
+
children: ["(+", keywordsLength - 1, ")\u00A0"]
|
|
138287
|
+
}, void 0)]
|
|
138288
|
+
}, void 0);
|
|
138289
|
+
}
|
|
135900
138290
|
};
|
|
135901
138291
|
|
|
135902
138292
|
var StyledKeywordPicker = _styled(KeywordPicker).withConfig({
|
|
135903
138293
|
displayName: "KeywordsFilter__StyledKeywordPicker",
|
|
135904
138294
|
componentId: "sc-1aoeg5i-0"
|
|
135905
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject$l(["\n margin-bottom: 20px;\n"], ["\n margin-bottom: 20px;\n"])));
|
|
138295
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject$l(["\n margin-bottom: 20px;\n\n .keyword-picker-tree div:last-child {\n margin-bottom: 0;\n }\n"], ["\n margin-bottom: 20px;\n\n .keyword-picker-tree div:last-child {\n margin-bottom: 0;\n }\n"])));
|
|
135906
138296
|
|
|
135907
138297
|
var templateObject_1;
|
|
135908
138298
|
|