@myrmidon/cadmus-core 0.0.23 → 0.3.0

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.
Files changed (67) hide show
  1. package/README.md +24 -24
  2. package/esm2020/lib/cadmus-core.module.mjs +20 -0
  3. package/esm2020/lib/datation.mjs +521 -0
  4. package/esm2020/lib/guards/pending-changes.guard.mjs +24 -0
  5. package/esm2020/lib/historical-date.mjs +299 -0
  6. package/esm2020/lib/models.mjs +11 -0
  7. package/esm2020/lib/pipes/sort.pipe.mjs +42 -0
  8. package/esm2020/lib/services/gravatar.service.mjs +30 -0
  9. package/esm2020/lib/services/library-route.service.mjs +211 -0
  10. package/esm2020/lib/services/text-layer.service.mjs +682 -0
  11. package/{esm2015/lib/text-range.js → esm2020/lib/text-range.mjs} +1 -1
  12. package/esm2020/lib/token-location.mjs +74 -0
  13. package/esm2020/lib/token-point.mjs +65 -0
  14. package/esm2020/lib/validators/cadmus-validators.mjs +61 -0
  15. package/{esm2015/lib/validators/password.validator.js → esm2020/lib/validators/password.validator.mjs} +6 -6
  16. package/{esm2015/myrmidon-cadmus-core.js → esm2020/myrmidon-cadmus-core.mjs} +0 -0
  17. package/esm2020/public-api.mjs +19 -0
  18. package/fesm2015/{myrmidon-cadmus-core.js → myrmidon-cadmus-core.mjs} +154 -536
  19. package/fesm2015/myrmidon-cadmus-core.mjs.map +1 -0
  20. package/fesm2020/myrmidon-cadmus-core.mjs +2127 -0
  21. package/fesm2020/myrmidon-cadmus-core.mjs.map +1 -0
  22. package/lib/cadmus-core.module.d.ts +8 -0
  23. package/lib/datation.d.ts +2 -2
  24. package/lib/guards/pending-changes.guard.d.ts +3 -0
  25. package/lib/historical-date.d.ts +7 -7
  26. package/lib/models.d.ts +1 -18
  27. package/lib/pipes/sort.pipe.d.ts +3 -0
  28. package/lib/services/gravatar.service.d.ts +3 -0
  29. package/lib/services/library-route.service.d.ts +10 -7
  30. package/lib/services/text-layer.service.d.ts +9 -6
  31. package/lib/text-range.d.ts +1 -1
  32. package/lib/token-location.d.ts +1 -1
  33. package/lib/token-point.d.ts +1 -1
  34. package/lib/validators/cadmus-validators.d.ts +11 -0
  35. package/lib/validators/password.validator.d.ts +2 -4
  36. package/myrmidon-cadmus-core.d.ts +1 -0
  37. package/package.json +21 -9
  38. package/public-api.d.ts +0 -6
  39. package/bundles/myrmidon-cadmus-core.umd.js +0 -2943
  40. package/bundles/myrmidon-cadmus-core.umd.js.map +0 -1
  41. package/esm2015/lib/cadmus-core.module.js +0 -14
  42. package/esm2015/lib/datation.js +0 -520
  43. package/esm2015/lib/guards/pending-changes.guard.js +0 -22
  44. package/esm2015/lib/historical-date.js +0 -297
  45. package/esm2015/lib/models.js +0 -11
  46. package/esm2015/lib/pipes/sort.pipe.js +0 -37
  47. package/esm2015/lib/roman-number.js +0 -155
  48. package/esm2015/lib/services/env.service.js +0 -76
  49. package/esm2015/lib/services/env.service.provider.js +0 -31
  50. package/esm2015/lib/services/error.service.js +0 -38
  51. package/esm2015/lib/services/gravatar.service.js +0 -28
  52. package/esm2015/lib/services/library-route.service.js +0 -208
  53. package/esm2015/lib/services/local-storage.service.js +0 -99
  54. package/esm2015/lib/services/text-layer.service.js +0 -680
  55. package/esm2015/lib/token-location.js +0 -74
  56. package/esm2015/lib/token-point.js +0 -65
  57. package/esm2015/lib/utils.js +0 -36
  58. package/esm2015/lib/validators/cadmus-validators.js +0 -40
  59. package/esm2015/public-api.js +0 -25
  60. package/fesm2015/myrmidon-cadmus-core.js.map +0 -1
  61. package/lib/roman-number.d.ts +0 -34
  62. package/lib/services/env.service.d.ts +0 -52
  63. package/lib/services/env.service.provider.d.ts +0 -15
  64. package/lib/services/error.service.d.ts +0 -13
  65. package/lib/services/local-storage.service.d.ts +0 -32
  66. package/lib/utils.d.ts +0 -4
  67. package/myrmidon-cadmus-core.metadata.json +0 -1
@@ -1,166 +1,11 @@
1
+ import { RomanNumber, NgToolsModule } from '@myrmidon/ng-tools';
1
2
  import * as i0 from '@angular/core';
2
3
  import { Injectable, Pipe, Inject, NgModule } from '@angular/core';
3
- import { throwError } from 'rxjs';
4
4
  import * as gravatar from 'gravatar';
5
5
  import * as rangy from 'rangy';
6
6
  import { CommonModule } from '@angular/common';
7
7
  import { HttpClientModule } from '@angular/common/http';
8
8
 
9
- /**
10
- * Roman number converter.
11
- */
12
- class RomanNumber {
13
- /**
14
- * Convert the specified numeric value to a Roman number.
15
- *
16
- * @param value The value.
17
- * @param allowBar True to allow bar on letters. A bar on a letter
18
- * multiplies its value by 1000.
19
- * @param allowPrefix True to allow prefix notation.
20
- * @param ancient True to use the ancient preferred notation, i.e.
21
- * the preferred epigraphical notation (IIII instead of IV, VIIII instead of IX).
22
- */
23
- static toRoman(value, allowBar = true, allowPrefix = true, ancient = false) {
24
- if (value <= 0) {
25
- return '';
26
- }
27
- let place = allowBar ? 0 : 6;
28
- const sb = [];
29
- while (value > 0) {
30
- while (value >= this._postVal[place]) {
31
- sb.push(this._postAlpha[place]);
32
- value -= this._postVal[place];
33
- }
34
- if (allowPrefix) {
35
- if (value >= this._preVal[place]) {
36
- sb.push(this._preAlpha[place]);
37
- value -= this._preVal[place];
38
- }
39
- }
40
- place++;
41
- }
42
- if (ancient) {
43
- let s = sb.join('');
44
- s = s.replace('IV', 'IIII');
45
- return s.replace('IX', 'VIII');
46
- }
47
- return sb.join('');
48
- }
49
- static isLower(c) {
50
- return c.toLowerCase() === c;
51
- }
52
- static isUpper(c) {
53
- return c.toUpperCase() === c;
54
- }
55
- static isCaseEqual(c1, c2) {
56
- return ((this.isLower(c1) && this.isLower(c2)) ||
57
- (this.isUpper(c1) && this.isUpper(c2)));
58
- }
59
- static getRomanDigitValue(digit) {
60
- const i = this._romanDigits.indexOf(digit.toUpperCase());
61
- if (i === -1) {
62
- return 0;
63
- }
64
- return this.isLower(digit)
65
- ? this._romanValues[i] * 1000
66
- : this._romanValues[i];
67
- }
68
- /**
69
- * Convert the specified Roman number to a numeric value.
70
- *
71
- * @param roman: The Roman number.
72
- * @param allowBar: True to allow bar-on-letter notation.
73
- */
74
- static fromRoman(roman, allowBar = true) {
75
- if (!roman) {
76
- return 0;
77
- }
78
- let result = 0;
79
- if (!allowBar) {
80
- roman = roman.toUpperCase();
81
- }
82
- for (let index = 0; index < roman.length; index++) {
83
- // if the previous value was a sub-digit, it had to be subtracted instead
84
- // of added; thus, subtract it twice (once to compensate for the wrong addition,
85
- // and once to subtract from this value) from the current digit value
86
- result += this.getRomanDigitValue(roman[index]);
87
- if (index > 0) {
88
- const i = this._romanDigits.indexOf(roman[index]);
89
- if (roman[index - 1].toUpperCase() ===
90
- this._romanSubdigits[i].toUpperCase() &&
91
- this.isCaseEqual(roman[index - 1], roman[index])) {
92
- // tslint:disable-next-line:no-bitwise
93
- result -= this.getRomanDigitValue(this._romanSubdigits[i]) << 1;
94
- }
95
- }
96
- }
97
- return result;
98
- }
99
- }
100
- RomanNumber._postVal = [
101
- 1000000,
102
- 500000,
103
- 100000,
104
- 50000,
105
- 10000,
106
- 5000,
107
- 1000,
108
- 500,
109
- 100,
110
- 50,
111
- 10,
112
- 5,
113
- 1,
114
- ];
115
- RomanNumber._postAlpha = [
116
- 'm',
117
- 'd',
118
- 'c',
119
- 'l',
120
- 'x',
121
- 'v',
122
- 'M',
123
- 'D',
124
- 'C',
125
- 'L',
126
- 'X',
127
- 'V',
128
- 'I',
129
- ];
130
- RomanNumber._preVal = [
131
- 900000,
132
- 400000,
133
- 90000,
134
- 40000,
135
- 9000,
136
- 4000,
137
- 900,
138
- 400,
139
- 90,
140
- 40,
141
- 9,
142
- 4,
143
- 1,
144
- ];
145
- RomanNumber._preAlpha = [
146
- 'cm',
147
- 'cd',
148
- 'xc',
149
- 'xl',
150
- 'ix',
151
- 'iv',
152
- 'CM',
153
- 'CD',
154
- 'XC',
155
- 'XL',
156
- 'IX',
157
- 'IV',
158
- 'I',
159
- ];
160
- RomanNumber._romanDigits = 'IVXLCDM';
161
- RomanNumber._romanSubdigits = ' IIXXCC';
162
- RomanNumber._romanValues = [1, 5, 10, 50, 100, 500, 1000];
163
-
164
9
  /**
165
10
  * Default options for formatting a datation.
166
11
  */
@@ -194,7 +39,8 @@ class Datation {
194
39
  * Create a new datation, optionally setting its data.
195
40
  * @param datation The optional data to be copied into the newly created datation.
196
41
  */
197
- constructor(datation = null) {
42
+ constructor(datation) {
43
+ this.value = 0;
198
44
  if (datation) {
199
45
  this.copyFrom(datation);
200
46
  }
@@ -274,13 +120,13 @@ class Datation {
274
120
  */
275
121
  static parse(text, options = DATATION_FORMAT_OPTIONS) {
276
122
  if (!text) {
277
- return undefined;
123
+ return null;
278
124
  }
279
125
  const datation = new Datation();
280
126
  const datationRegex = this.getParserRegex(options);
281
127
  const m = datationRegex.exec(text);
282
128
  if (!m) {
283
- return undefined;
129
+ return null;
284
130
  }
285
131
  // about
286
132
  if (m[1]) {
@@ -391,10 +237,10 @@ class Datation {
391
237
  if (this.isSpan) {
392
238
  result += 0.5;
393
239
  }
394
- if (this.month > 0 && this.month <= 12) {
240
+ if (this.month && this.month > 0 && this.month <= 12) {
395
241
  result += this.month / 12;
396
242
  }
397
- if (this.day > 0 && this.day <= 31) {
243
+ if (this.day && this.day > 0 && this.day <= 31) {
398
244
  result += this.day / (12 * 31);
399
245
  }
400
246
  return result;
@@ -602,34 +448,34 @@ class Datation {
602
448
  }
603
449
  break;
604
450
  case 'd':
605
- if (this.day > 0) {
451
+ if (this.day) {
606
452
  sb.push(this.day.toString());
607
453
  }
608
454
  break;
609
455
  case 'dd':
610
- if (this.day > 0) {
456
+ if (this.day) {
611
457
  sb.push(this.day.toString().padStart(2, '0'));
612
458
  }
613
459
  break;
614
460
  case 'ddd':
615
- if (this.day > 0) {
461
+ if (this.month && this.day) {
616
462
  const date = new Date(this.value, this.month, this.day);
617
463
  const dow = date.getDay();
618
464
  sb.push(options.dayNames[dow]);
619
465
  }
620
466
  break;
621
467
  case 'M':
622
- if (this.month > 0) {
468
+ if (this.month) {
623
469
  sb.push(this.month.toString());
624
470
  }
625
471
  break;
626
472
  case 'MM':
627
- if (this.month > 0) {
473
+ if (this.month) {
628
474
  sb.push(this.month.toString().padStart(2, '0'));
629
475
  }
630
476
  break;
631
477
  case 'MMM':
632
- if (this.month > 0) {
478
+ if (this.month) {
633
479
  sb.push(options.monthNames[this.month - 1]);
634
480
  }
635
481
  break;
@@ -694,7 +540,7 @@ var HistoricalDateType;
694
540
  * A historical date, including 0, 1, or 2 datation points.
695
541
  */
696
542
  class HistoricalDate {
697
- constructor(date = null) {
543
+ constructor(date) {
698
544
  if (!date) {
699
545
  this.a = new Datation();
700
546
  // B=undefined for a single point
@@ -710,7 +556,7 @@ class HistoricalDate {
710
556
  * Parse the specified text representing a historical datation.
711
557
  * @param text The text to be parsed.
712
558
  * @param options The datation formatter options.
713
- * @return The datation, or null if invalid.
559
+ * @return The datation, or undefined if invalid.
714
560
  */
715
561
  static parse(text, options = DATATION_FORMAT_OPTIONS) {
716
562
  if (!text) {
@@ -737,7 +583,7 @@ class HistoricalDate {
737
583
  '(?:\\s*\\{?:([^)]+)\\})?\\s*$', 'gi');
738
584
  const m1 = tailRegexp.exec(s1);
739
585
  // if 1st has no era try integration from 2nd
740
- if (m1 && m1[1]) {
586
+ if (m1 && m1[1] && s2) {
741
587
  // get era from 2nd (if 2nd hasn't it too, give up and AD will be assumed)
742
588
  const m2 = tailRegexp.exec(s2);
743
589
  if (m2 && m2[1]) {
@@ -758,7 +604,9 @@ class HistoricalDate {
758
604
  }
759
605
  }
760
606
  date.setStartPoint(Datation.parse(s1, options));
761
- date.setEndPoint(Datation.parse(s2, options));
607
+ if (s2) {
608
+ date.setEndPoint(Datation.parse(s2, options));
609
+ }
762
610
  }
763
611
  else {
764
612
  // here we have a s2, even if empty. When empty, it represents
@@ -815,12 +663,13 @@ class HistoricalDate {
815
663
  * @returns Error message if invalid, or null if valid.
816
664
  */
817
665
  validate() {
666
+ var _a;
818
667
  if (!this.a) {
819
668
  return 'Missing point A';
820
669
  }
821
670
  if (this.getDateType() === HistoricalDateType.range) {
822
671
  const av = this.a.getSortValue();
823
- const bv = this.b.getSortValue();
672
+ const bv = ((_a = this.b) === null || _a === void 0 ? void 0 : _a.getSortValue()) || 0;
824
673
  if (av && bv && av >= bv) {
825
674
  return 'Point A is past point B';
826
675
  }
@@ -838,7 +687,7 @@ class HistoricalDate {
838
687
  if (this.a.isUndefined()) {
839
688
  return this.b.getSortValue() - APPROX_DELTA;
840
689
  }
841
- if (this.b.isUndefined()) {
690
+ if (!this.b || this.b.isUndefined()) {
842
691
  return this.a.getSortValue() + APPROX_DELTA;
843
692
  }
844
693
  return (this.a.getSortValue() + this.b.getSortValue()) / 2;
@@ -904,7 +753,7 @@ class HistoricalDate {
904
753
  break;
905
754
  case HistoricalDateType.range:
906
755
  // min is missing: terminus ante
907
- if (this.a.isUndefined()) {
756
+ if (this.a.isUndefined() && this.b) {
908
757
  year = Math.trunc((this.b.isCentury
909
758
  ? this.centuryToYear(this.b.value)
910
759
  : this.b.value) - (useTerminusSpan ? APPROX_DELTA : 0));
@@ -946,12 +795,12 @@ class HistoricalDate {
946
795
  about = this.a.isApproximate;
947
796
  break;
948
797
  }
949
- if (!this.b.isUndefined()) {
798
+ if (this.b && !this.b.isUndefined()) {
950
799
  about = this.b.isApproximate;
951
800
  }
952
801
  break;
953
802
  }
954
- return about;
803
+ return about ? true : false;
955
804
  }
956
805
  /**
957
806
  * True if any value (either in point or in range) has an about flag.
@@ -967,12 +816,12 @@ class HistoricalDate {
967
816
  dubious = this.a.isDubious;
968
817
  break;
969
818
  }
970
- if (!this.b.isUndefined()) {
819
+ if (this.b && !this.b.isUndefined()) {
971
820
  dubious = this.b.isDubious;
972
821
  }
973
822
  break;
974
823
  }
975
- return dubious;
824
+ return dubious ? true : false;
976
825
  }
977
826
  }
978
827
 
@@ -1079,7 +928,7 @@ class TokenPoint {
1079
928
  }
1080
929
  toString() {
1081
930
  let s = `${this.y}.${this.x}`;
1082
- if (this.at > 0 && this.run > 0) {
931
+ if (this.at && this.run) {
1083
932
  s += `@${this.at}`;
1084
933
  if (this.run !== 1) {
1085
934
  s += `x${this.run}`;
@@ -1111,7 +960,7 @@ class TokenPoint {
1111
960
  }
1112
961
 
1113
962
  class TokenLocation {
1114
- constructor(primary, secondary = null) {
963
+ constructor(primary, secondary) {
1115
964
  this.primary = primary;
1116
965
  this.secondary = secondary;
1117
966
  }
@@ -1130,7 +979,7 @@ class TokenLocation {
1130
979
  if (pair.length === 0) {
1131
980
  return null;
1132
981
  }
1133
- return new TokenLocation(TokenPoint.parse(pair[0]), pair.length > 1 ? TokenPoint.parse(pair[1]) : null);
982
+ return new TokenLocation(TokenPoint.parse(pair[0]), pair.length > 1 ? TokenPoint.parse(pair[1]) || undefined : undefined);
1134
983
  }
1135
984
  isRange() {
1136
985
  // note that != checks for both null and undefined, whereas !== does not
@@ -1183,42 +1032,6 @@ class TokenLocation {
1183
1032
  }
1184
1033
  }
1185
1034
 
1186
- /**
1187
- * Deep-copy an object.
1188
- */
1189
- function deepCopy(obj) {
1190
- let copy;
1191
- // handle the 3 simple types, and null or undefined
1192
- if (null == obj || 'object' !== typeof obj) {
1193
- return obj;
1194
- }
1195
- // handle date
1196
- if (obj instanceof Date) {
1197
- copy = new Date();
1198
- copy.setTime(obj.getTime());
1199
- return copy;
1200
- }
1201
- // handle array
1202
- if (obj instanceof Array) {
1203
- copy = [];
1204
- for (let i = 0, len = obj.length; i < len; i++) {
1205
- copy[i] = deepCopy(obj[i]);
1206
- }
1207
- return copy;
1208
- }
1209
- // handle object
1210
- if (obj instanceof Object) {
1211
- copy = {};
1212
- for (const attr in obj) {
1213
- if (obj.hasOwnProperty(attr)) {
1214
- copy[attr] = deepCopy(obj[attr]);
1215
- }
1216
- }
1217
- return copy;
1218
- }
1219
- throw new Error('Unable to copy object!');
1220
- }
1221
-
1222
1035
  class PendingChangesGuard {
1223
1036
  canDeactivate(component) {
1224
1037
  // if there are no pending changes, just allow deactivation; else confirm first
@@ -1232,12 +1045,14 @@ class PendingChangesGuard {
1232
1045
  'Press Cancel to go back and save, OK to continue.');
1233
1046
  }
1234
1047
  }
1235
- PendingChangesGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function PendingChangesGuard_Factory() { return new PendingChangesGuard(); }, token: PendingChangesGuard, providedIn: "root" });
1236
- PendingChangesGuard.decorators = [
1237
- { type: Injectable, args: [{
1238
- providedIn: 'root'
1239
- },] }
1240
- ];
1048
+ PendingChangesGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: PendingChangesGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1049
+ PendingChangesGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: PendingChangesGuard, providedIn: 'root' });
1050
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: PendingChangesGuard, decorators: [{
1051
+ type: Injectable,
1052
+ args: [{
1053
+ providedIn: 'root',
1054
+ }]
1055
+ }] });
1241
1056
 
1242
1057
  /**
1243
1058
  * Sort pipe. Use like *ngFor="let i of items | sort:'propname'".
@@ -1266,153 +1081,18 @@ class SortPipe {
1266
1081
  else if (a[propName] > b[propName]) {
1267
1082
  return 1;
1268
1083
  }
1084
+ return 0;
1269
1085
  });
1270
1086
  }
1271
1087
  }
1272
- SortPipe.decorators = [
1273
- { type: Pipe, args: [{
1274
- name: 'sort',
1275
- },] }
1276
- ];
1277
-
1278
- /**
1279
- * Environment variables service. This requires EnvServiceProvider.
1280
- * See https://www.jvandemo.com/how-to-use-environment-variables-to-configure-your-angular-application-without-a-rebuild/.
1281
- *
1282
- * To use this service:
1283
- * 1. ensure to add env.js from your app's src folder to the app's assets
1284
- * ("src/env.js" under architect/build/options/assets);
1285
- * 2. add the EnvServiceProvider to your app's providers array;
1286
- * 3. ensure to include env.js in the head of your index.html:
1287
- * <script src="env.js"></script>.
1288
- *
1289
- * The env.js file should include all your environment-dependent settings,
1290
- * e.g.:
1291
- *
1292
- * (function (window) {
1293
- * window.__env = window.__env || {};
1294
- * window.__env.apiUrl = 'http://localhost:60200/api/';
1295
- * }(this));
1296
- */
1297
- class EnvService {
1298
- constructor() {
1299
- this._map = new Map();
1300
- }
1301
- /**
1302
- * Get the value for the specified key. If the key is not found,
1303
- * defValue will be returned.
1304
- *
1305
- * @param key The key.
1306
- * @param defValue The default value to return if key is not found.
1307
- */
1308
- get(key, defValue) {
1309
- if (this._map.has(key)) {
1310
- return this._map.get(key);
1311
- }
1312
- return defValue;
1313
- }
1314
- /**
1315
- * Enumerate all the keys in this store.
1316
- */
1317
- getKeys() {
1318
- return this._map.keys();
1319
- }
1320
- /**
1321
- * Set a value with the specified key.
1322
- *
1323
- * @param key The key.
1324
- * @param value The value.
1325
- */
1326
- set(key, value) {
1327
- this._map.set(key, value);
1328
- }
1329
- /**
1330
- * Delete the value with the specified key, if any.
1331
- *
1332
- * @param key The key.
1333
- */
1334
- delete(key) {
1335
- this._map.delete(key);
1336
- }
1337
- /**
1338
- * Clear this store.
1339
- */
1340
- clear() {
1341
- this._map.clear();
1342
- }
1343
- }
1344
- EnvService.ɵprov = i0.ɵɵdefineInjectable({ factory: function EnvService_Factory() { return new EnvService(); }, token: EnvService, providedIn: "root" });
1345
- EnvService.decorators = [
1346
- { type: Injectable, args: [{
1347
- providedIn: 'root',
1348
- },] }
1349
- ];
1350
- EnvService.ctorParameters = () => [];
1351
-
1352
- // https://www.jvandemo.com/how-to-use-environment-variables-to-configure-your-angular-application-without-a-rebuild/
1353
- /**
1354
- * This function creates an instance of EnvService, and copies
1355
- * all the properties from window.__env object into it.
1356
- */
1357
- const EnvServiceFactory = () => {
1358
- const env = new EnvService();
1359
- // read environment variables from browser window
1360
- const browserWindow = window || {};
1361
- const browserWindowEnv = browserWindow['__env'] || {};
1362
- // assign environment variables from browser window to env;
1363
- // in the current implementation, properties from env.js
1364
- // overwrite defaults (if any) from the EnvService.
1365
- for (const key in browserWindowEnv) {
1366
- if (browserWindowEnv.hasOwnProperty(key)) {
1367
- env.set(key, browserWindowEnv[key]);
1368
- }
1369
- }
1370
- return env;
1371
- };
1372
- /**
1373
- * A provider recipe for the EnvService.
1374
- * This must be registered in the applications providers array.
1375
- */
1376
- const EnvServiceProvider = {
1377
- provide: EnvService,
1378
- useFactory: EnvServiceFactory,
1379
- deps: [],
1380
- };
1381
-
1382
- // https://angular.io/guide/http
1383
- /**
1384
- * Error handler for services. To use this in your service, pipe a catchError
1385
- * operator with its argument equal to the handleError method of this service.
1386
- * Note: pipe this method after retry, if using it.
1387
- */
1388
- class ErrorService {
1389
- /**
1390
- * Handle the specified error response.
1391
- * @param error The error response.
1392
- */
1393
- handleError(error) {
1394
- if (error.error instanceof ErrorEvent) {
1395
- // A client-side or network error occurred. Handle it accordingly.
1396
- console.error('A client-side or network error occurred: ', error.error.message);
1397
- }
1398
- else {
1399
- // The backend returned an unsuccessful response code.
1400
- // The response body may contain clues as to what went wrong,
1401
- console.error(`Backend returned code ${error.status}, ` + `body was: ${error.error}`);
1402
- if (typeof error === 'object') {
1403
- console.log(JSON.stringify(error));
1404
- }
1405
- }
1406
- // return an observable with a user-facing error message
1407
- return throwError('Something bad happened; please try again later.');
1408
- }
1409
- }
1410
- ErrorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorService_Factory() { return new ErrorService(); }, token: ErrorService, providedIn: "root" });
1411
- ErrorService.decorators = [
1412
- { type: Injectable, args: [{
1413
- providedIn: 'root',
1414
- },] }
1415
- ];
1088
+ SortPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SortPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1089
+ SortPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SortPipe, name: "sort" });
1090
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SortPipe, decorators: [{
1091
+ type: Pipe,
1092
+ args: [{
1093
+ name: 'sort',
1094
+ }]
1095
+ }] });
1416
1096
 
1417
1097
  // npm i gravatar --save
1418
1098
  // npm i @types/gravatar --save
@@ -1425,19 +1105,21 @@ class GravatarService {
1425
1105
  */
1426
1106
  buildGravatarUrl(email, size = 80) {
1427
1107
  if (!email) {
1428
- return null;
1108
+ return '';
1429
1109
  }
1430
1110
  return gravatar.url(email, { s: size.toString() });
1431
1111
  // const hash = this._hash.getMd5(email.trim().toLowerCase());
1432
1112
  // return this.buildGravatarUrlFromHash(hash, size);
1433
1113
  }
1434
1114
  }
1435
- GravatarService.ɵprov = i0.ɵɵdefineInjectable({ factory: function GravatarService_Factory() { return new GravatarService(); }, token: GravatarService, providedIn: "root" });
1436
- GravatarService.decorators = [
1437
- { type: Injectable, args: [{
1438
- providedIn: 'root'
1439
- },] }
1440
- ];
1115
+ GravatarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: GravatarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1116
+ GravatarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: GravatarService, providedIn: 'root' });
1117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: GravatarService, decorators: [{
1118
+ type: Injectable,
1119
+ args: [{
1120
+ providedIn: 'root'
1121
+ }]
1122
+ }] });
1441
1123
 
1442
1124
  /**
1443
1125
  * Library route service.
@@ -1496,13 +1178,13 @@ class LibraryRouteService {
1496
1178
  if (i > -1) {
1497
1179
  return {
1498
1180
  frTypeId: roleId.substring(0, i),
1499
- frRoleId: roleId.substring(i + 1)
1181
+ frRoleId: roleId.substring(i + 1),
1500
1182
  };
1501
1183
  }
1502
1184
  else {
1503
1185
  return {
1504
1186
  frTypeId: roleId,
1505
- frRoleId: null
1187
+ frRoleId: undefined,
1506
1188
  };
1507
1189
  }
1508
1190
  }
@@ -1513,22 +1195,23 @@ class LibraryRouteService {
1513
1195
  * @param partDefs The parts definitions.
1514
1196
  * @param typeId The type ID.
1515
1197
  * @param roleId The role ID or null.
1516
- * @returns Part definition or null if not found.
1198
+ * @returns Part definition or undefined if not found.
1517
1199
  */
1518
1200
  findPartDefinition(partDefs, typeId, roleId = null) {
1519
1201
  if (!partDefs) {
1520
- return null;
1202
+ return undefined;
1521
1203
  }
1522
1204
  // if role ID is specified, find both type and role
1523
1205
  if (roleId) {
1524
1206
  const reqRoleId = this.stripFragmentRoleId(roleId);
1525
- return partDefs.find(d => {
1207
+ return partDefs.find((d) => {
1526
1208
  return (d.typeId === typeId &&
1209
+ d.roleId &&
1527
1210
  this.stripFragmentRoleId(d.roleId) === reqRoleId);
1528
1211
  });
1529
1212
  }
1530
1213
  // else just find type ID
1531
- return partDefs.find(d => {
1214
+ return partDefs.find((d) => {
1532
1215
  return d.typeId === typeId;
1533
1216
  });
1534
1217
  }
@@ -1539,12 +1222,12 @@ class LibraryRouteService {
1539
1222
  * @param typeId The part's type ID.
1540
1223
  * @param roleId The part's role ID.
1541
1224
  */
1542
- getEditorKeyFromPartType(typeId, roleId = null) {
1225
+ getEditorKeyFromPartType(typeId, roleId) {
1543
1226
  // find the part type ID
1544
1227
  const partGroupKey = this._partEditorKeys[typeId];
1545
1228
  if (!partGroupKey) {
1546
1229
  return {
1547
- partKey: 'default'
1230
+ partKey: 'default',
1548
1231
  };
1549
1232
  }
1550
1233
  // additionally find the role ID if specified
@@ -1552,11 +1235,11 @@ class LibraryRouteService {
1552
1235
  const reqRoleId = this.stripFragmentRoleId(roleId);
1553
1236
  return {
1554
1237
  partKey: partGroupKey.part,
1555
- frKey: partGroupKey.fragments[reqRoleId]
1238
+ frKey: partGroupKey.fragments[reqRoleId],
1556
1239
  };
1557
1240
  }
1558
1241
  return {
1559
- partKey: partGroupKey.part
1242
+ partKey: partGroupKey.part,
1560
1243
  };
1561
1244
  }
1562
1245
  /**
@@ -1570,13 +1253,13 @@ class LibraryRouteService {
1570
1253
  if (i > -1) {
1571
1254
  return {
1572
1255
  partKey: key.substr(0, i),
1573
- frKey: key.substr(i + 1)
1256
+ frKey: key.substr(i + 1),
1574
1257
  };
1575
1258
  }
1576
1259
  else {
1577
1260
  return {
1578
1261
  partKey: key,
1579
- frKey: key
1262
+ frKey: key,
1580
1263
  };
1581
1264
  }
1582
1265
  }
@@ -1608,7 +1291,7 @@ class LibraryRouteService {
1608
1291
  route = `/items/${itemId}/${editorKey.partKey}/${typeId}/${partId}`;
1609
1292
  return {
1610
1293
  route: route,
1611
- rid: roleId
1294
+ rid: roleId,
1612
1295
  };
1613
1296
  }
1614
1297
  /**
@@ -1631,116 +1314,23 @@ class LibraryRouteService {
1631
1314
  route = `/items/${itemId}/${editorKey.frKey}/fragment/${partId}/${frTypeId}/${loc}`;
1632
1315
  return {
1633
1316
  route: route,
1634
- rid: frRoleId
1317
+ rid: frRoleId,
1635
1318
  };
1636
1319
  }
1637
1320
  }
1638
- LibraryRouteService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LibraryRouteService_Factory() { return new LibraryRouteService(i0.ɵɵinject("partEditorKeys")); }, token: LibraryRouteService, providedIn: "root" });
1639
- LibraryRouteService.decorators = [
1640
- { type: Injectable, args: [{
1641
- providedIn: 'root'
1642
- },] }
1643
- ];
1644
- LibraryRouteService.ctorParameters = () => [
1645
- { type: undefined, decorators: [{ type: Inject, args: ['partEditorKeys',] }] }
1646
- ];
1647
-
1648
- class LocalStorageService {
1649
- /**
1650
- * Retrieve the object with the specified key from the specified storage.
1651
- * @param key key.
1652
- * @param session true to use session instead of local storage.
1653
- */
1654
- retrieve(key, session = false) {
1655
- const json = session
1656
- ? sessionStorage.getItem(key)
1657
- : localStorage.getItem(key);
1658
- if (!json) {
1659
- return null;
1660
- }
1661
- return JSON.parse(json);
1662
- }
1663
- /**
1664
- * Store the specified object with the specified key in the specified storage.
1665
- * @param key key.
1666
- * @param value object.
1667
- * @param session true to use session instead of local storage.
1668
- */
1669
- store(key, value, session = false) {
1670
- if (session) {
1671
- sessionStorage.setItem(key, JSON.stringify(value));
1672
- }
1673
- else {
1674
- localStorage.setItem(key, JSON.stringify(value));
1675
- }
1676
- }
1677
- /**
1678
- * Remove the object with the specified key from the specified storage.
1679
- * @param key key.
1680
- * @param session true to use session instead of local storage.
1681
- */
1682
- remove(key, session = false) {
1683
- if (session) {
1684
- sessionStorage.removeItem(key);
1685
- }
1686
- else {
1687
- localStorage.removeItem(key);
1688
- }
1689
- }
1690
- /**
1691
- * Get all the stored entities keys starting with the specified prefix.
1692
- * @param prefix key prefix.
1693
- * @param session true to use session instead of local storage.
1694
- */
1695
- getKeys(prefix, session = false) {
1696
- const keys = [];
1697
- if (session) {
1698
- for (let i = 0, len = sessionStorage.length; i < len; i++) {
1699
- const key = sessionStorage.key(i);
1700
- if (key.startsWith(prefix)) {
1701
- keys.push(key);
1702
- }
1703
- }
1704
- }
1705
- else {
1706
- for (let i = 0, len = localStorage.length; i < len; i++) {
1707
- const key = localStorage.key(i);
1708
- if (key.startsWith(prefix)) {
1709
- keys.push(key);
1710
- }
1711
- }
1712
- }
1713
- return keys;
1714
- }
1715
- /**
1716
- * Remove all the entries whose key starts with the specified prefix.
1717
- * @param prefix key prefix.
1718
- */
1719
- clear(prefix, session = false) {
1720
- if (session) {
1721
- for (let i = 0, len = sessionStorage.length; i < len; i++) {
1722
- const key = sessionStorage.key(i);
1723
- if (key.startsWith(prefix)) {
1724
- sessionStorage.removeItem(key);
1725
- }
1726
- }
1727
- }
1728
- else {
1729
- for (let i = 0, len = localStorage.length; i < len; i++) {
1730
- const key = localStorage.key(i);
1731
- if (key.startsWith(prefix)) {
1732
- localStorage.removeItem(key);
1733
- }
1734
- }
1735
- }
1736
- }
1737
- }
1738
- LocalStorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LocalStorageService_Factory() { return new LocalStorageService(); }, token: LocalStorageService, providedIn: "root" });
1739
- LocalStorageService.decorators = [
1740
- { type: Injectable, args: [{
1741
- providedIn: 'root',
1742
- },] }
1743
- ];
1321
+ LibraryRouteService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LibraryRouteService, deps: [{ token: 'partEditorKeys' }], target: i0.ɵɵFactoryTarget.Injectable });
1322
+ LibraryRouteService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LibraryRouteService, providedIn: 'root' });
1323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LibraryRouteService, decorators: [{
1324
+ type: Injectable,
1325
+ args: [{
1326
+ providedIn: 'root',
1327
+ }]
1328
+ }], ctorParameters: function () {
1329
+ return [{ type: undefined, decorators: [{
1330
+ type: Inject,
1331
+ args: ['partEditorKeys']
1332
+ }] }];
1333
+ } });
1744
1334
 
1745
1335
  class TextLayerService {
1746
1336
  constructor() {
@@ -1824,13 +1414,13 @@ class TextLayerService {
1824
1414
  * @param sb The target array.
1825
1415
  */
1826
1416
  renderTokenAtEnd(pt, token, sb) {
1827
- if (pt.at > 0) {
1417
+ if (pt.at) {
1828
1418
  // ...to]
1829
1419
  sb.push(token.substr(pt.at - 1, pt.run));
1830
1420
  sb.push('</span>');
1831
1421
  // ...ken
1832
- if (pt.at - 1 + pt.run < token.length) {
1833
- sb.push(token.substr(pt.at - 1 + pt.run));
1422
+ if (pt.at - 1 + (pt.run || 0) < token.length) {
1423
+ sb.push(token.substr(pt.at - 1 + (pt.run || 0)));
1834
1424
  }
1835
1425
  }
1836
1426
  else {
@@ -1849,7 +1439,7 @@ class TextLayerService {
1849
1439
  */
1850
1440
  renderTokenAtPointStart(loc, token, sb, isSelected) {
1851
1441
  // 1.token's left-part
1852
- if (loc.primary.at > 0) {
1442
+ if (loc.primary.at) {
1853
1443
  // to...
1854
1444
  sb.push(token.substr(0, loc.primary.at - 1));
1855
1445
  }
@@ -1870,14 +1460,14 @@ class TextLayerService {
1870
1460
  */
1871
1461
  renderTokenAtRangeStart(loc, token, sb, isSelected) {
1872
1462
  // 1.token's left-part (=before at)
1873
- if (loc.primary.at > 0) {
1463
+ if (loc.primary.at) {
1874
1464
  // to...
1875
1465
  sb.push(token.substr(0, loc.primary.at - 1));
1876
1466
  }
1877
1467
  // 2.span: [
1878
1468
  this.renderOpeningSpan(loc, 0, sb, isSelected);
1879
1469
  // 3.token's right-part (...ken or ...token)
1880
- if (loc.primary.at > 0) {
1470
+ if (loc.primary.at) {
1881
1471
  // ...ken
1882
1472
  sb.push(token.substr(loc.primary.at - 1));
1883
1473
  }
@@ -1907,14 +1497,14 @@ class TextLayerService {
1907
1497
  * fragment if any. The selected fragment gets decorated with an additional
1908
1498
  * class value.
1909
1499
  */
1910
- render(text, locations, selectedLoc = null) {
1500
+ render(text, locations, selectedLoc) {
1911
1501
  if (!text) {
1912
1502
  return '<div></div>';
1913
1503
  }
1914
1504
  // get lines from text
1915
1505
  const sb = [];
1916
1506
  const lines = this.getLines(text);
1917
- let loc = null;
1507
+ let loc = undefined;
1918
1508
  let tokenSelected = false;
1919
1509
  if (!locations) {
1920
1510
  locations = [];
@@ -1939,7 +1529,7 @@ class TextLayerService {
1939
1529
  if (loc && loc.secondary) {
1940
1530
  if (loc.secondary.y === y + 1 && loc.secondary.x === x + 1) {
1941
1531
  this.renderTokenAtEnd(loc.secondary, token, sb);
1942
- loc = null;
1532
+ loc = undefined;
1943
1533
  }
1944
1534
  else {
1945
1535
  sb.push(token);
@@ -1953,7 +1543,7 @@ class TextLayerService {
1953
1543
  if (loc) {
1954
1544
  tokenSelected = selectedLoc ? loc.overlaps(selectedLoc) : false;
1955
1545
  if (!this.renderTokenAtStart(loc, token, sb, tokenSelected)) {
1956
- loc = null;
1546
+ loc = undefined;
1957
1547
  }
1958
1548
  }
1959
1549
  else {
@@ -1983,7 +1573,7 @@ class TextLayerService {
1983
1573
  * Get the Y bounds from the specified selection.
1984
1574
  * @param range The selection range.
1985
1575
  * @param forNew True if getting bounds for a new fragment.
1986
- * @returns Range, inclusive.
1576
+ * @returns Range, inclusive, or undefined.
1987
1577
  */
1988
1578
  getYBoundsFromRange(range, forNew) {
1989
1579
  let p = null;
@@ -1991,10 +1581,10 @@ class TextLayerService {
1991
1581
  case Node.TEXT_NODE:
1992
1582
  // single-p selection, parent=p
1993
1583
  p = range.commonAncestorContainer.parentElement;
1994
- if (forNew && (p.nodeName !== 'P' || !p.hasAttribute('id'))) {
1584
+ if (forNew && ((p === null || p === void 0 ? void 0 : p.nodeName) !== 'P' || !p.hasAttribute('id'))) {
1995
1585
  return null;
1996
1586
  }
1997
- if (p.nodeName === 'SPAN') {
1587
+ if ((p === null || p === void 0 ? void 0 : p.nodeName) === 'SPAN') {
1998
1588
  p = p.parentElement;
1999
1589
  }
2000
1590
  const y = parseInt(p.getAttribute('id').substr(1), 10);
@@ -2038,6 +1628,7 @@ class TextLayerService {
2038
1628
  end: yMax,
2039
1629
  };
2040
1630
  }
1631
+ return null;
2041
1632
  }
2042
1633
  locatePrevSpace(line, index) {
2043
1634
  while (index > -1 && line.charAt(index) !== ' ') {
@@ -2226,13 +1817,14 @@ class TextLayerService {
2226
1817
  getNodeBaseOffset(node) {
2227
1818
  var _a, _b;
2228
1819
  let offset = 0;
2229
- node = node.previousSibling;
2230
- while (node) {
1820
+ let n = node;
1821
+ n = node.previousSibling;
1822
+ while (n) {
2231
1823
  offset +=
2232
- node.nodeType === Node.ELEMENT_NODE
2233
- ? ((_a = node.innerText) === null || _a === void 0 ? void 0 : _a.length) || 0
2234
- : ((_b = node.textContent) === null || _b === void 0 ? void 0 : _b.length) || 0;
2235
- node = node.previousSibling;
1824
+ n.nodeType === Node.ELEMENT_NODE
1825
+ ? ((_a = n.innerText) === null || _a === void 0 ? void 0 : _a.length) || 0
1826
+ : ((_b = n.textContent) === null || _b === void 0 ? void 0 : _b.length) || 0;
1827
+ n = n.previousSibling;
2236
1828
  }
2237
1829
  return offset;
2238
1830
  }
@@ -2280,7 +1872,7 @@ class TextLayerService {
2280
1872
  // single token: check for at,run
2281
1873
  if (start.at) {
2282
1874
  sb.push(`@${start.at}`);
2283
- if (start.run > 1) {
1875
+ if (start.run && start.run > 1) {
2284
1876
  sb.push(`x${start.run}`);
2285
1877
  }
2286
1878
  }
@@ -2330,11 +1922,12 @@ class TextLayerService {
2330
1922
  return null;
2331
1923
  }
2332
1924
  selHasAnySpan(range) {
1925
+ var _a, _b;
2333
1926
  let inside = false;
2334
1927
  if (
2335
1928
  // the selected text node must not be child of a span
2336
- range.startContainer.parentElement.tagName === 'SPAN' ||
2337
- range.startContainer.parentElement.tagName === 'SPAN' ||
1929
+ ((_a = range.startContainer.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) === 'SPAN' ||
1930
+ ((_b = range.startContainer.parentElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'SPAN' ||
2338
1931
  // the nodes tree from the common ancestor, from the start node
2339
1932
  // up to the end node, must not include any span
2340
1933
  this.findNode(range.commonAncestorContainer, (node) => {
@@ -2366,7 +1959,7 @@ class TextLayerService {
2366
1959
  * @param range The selected range. You can get it from the
2367
1960
  * current selection using getSelectedRange().
2368
1961
  * @param text The full base text.
2369
- * @returns TokenLocation The token location or null.
1962
+ * @returns TokenLocation The token location or undefined.
2370
1963
  */
2371
1964
  getSelectedLocationForNew(range, text) {
2372
1965
  if (!range || this.selHasAnySpan(range)) {
@@ -2412,11 +2005,12 @@ class TextLayerService {
2412
2005
  return sel.getRangeAt(0);
2413
2006
  }
2414
2007
  }
2415
- TextLayerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TextLayerService_Factory() { return new TextLayerService(); }, token: TextLayerService, providedIn: "root" });
2416
- TextLayerService.decorators = [
2417
- { type: Injectable, args: [{ providedIn: 'root' },] }
2418
- ];
2419
- TextLayerService.ctorParameters = () => [];
2008
+ TextLayerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TextLayerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2009
+ TextLayerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TextLayerService, providedIn: 'root' });
2010
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: TextLayerService, decorators: [{
2011
+ type: Injectable,
2012
+ args: [{ providedIn: 'root' }]
2013
+ }], ctorParameters: function () { return []; } });
2420
2014
 
2421
2015
  // https://github.com/angular/angular/blob/3b7d4ebbd6445364889d61b7b1b1c65206534d34/packages/forms/src/validators.ts
2422
2016
  // https://indepth.dev/posts/1319/the-best-way-to-implement-custom-validators
@@ -2456,6 +2050,27 @@ class CadmusValidators {
2456
2050
  : null;
2457
2051
  };
2458
2052
  }
2053
+ /**
2054
+ * Conditionally validate using the specified validator
2055
+ * when predicate is true.
2056
+ * See https://medium.com/ngx/3-ways-to-implement-conditional-validation-of-reactive-forms-c59ed6fc3325.
2057
+ *
2058
+ * @param predicate The predicate function to use when determining
2059
+ * if the validator should be used.
2060
+ * @param validator The conditional validator to use.
2061
+ * @returns Validation results.
2062
+ */
2063
+ static conditionalValidator(predicate, validator) {
2064
+ return (control) => {
2065
+ if (!control.parent) {
2066
+ return null;
2067
+ }
2068
+ if (predicate()) {
2069
+ return validator(control);
2070
+ }
2071
+ return null;
2072
+ };
2073
+ }
2459
2074
  }
2460
2075
 
2461
2076
  class PasswordValidator {
@@ -2465,27 +2080,27 @@ class PasswordValidator {
2465
2080
  }
2466
2081
  if (control.value.length < 8) {
2467
2082
  return {
2468
- passwordTooShort: true
2083
+ passwordTooShort: true,
2469
2084
  };
2470
2085
  }
2471
2086
  if (!/.*[A-Z].*/.test(control.value)) {
2472
2087
  return {
2473
- noUpperInPassword: true
2088
+ noUpperInPassword: true,
2474
2089
  };
2475
2090
  }
2476
2091
  if (!/.*[a-z].*/.test(control.value)) {
2477
2092
  return {
2478
- noLowerInPassword: true
2093
+ noLowerInPassword: true,
2479
2094
  };
2480
2095
  }
2481
2096
  if (!/.*[A-Z].*/.test(control.value)) {
2482
2097
  return {
2483
- noUpperInPassword: true
2098
+ noUpperInPassword: true,
2484
2099
  };
2485
2100
  }
2486
2101
  if (!/.*[-`~!@#$%^&*()_+=\[\]{};:'",.<>/?|\\].*/.test(control.value)) {
2487
2102
  return {
2488
- noSymbolInPassword: true
2103
+ noSymbolInPassword: true,
2489
2104
  };
2490
2105
  }
2491
2106
  return null;
@@ -2494,13 +2109,17 @@ class PasswordValidator {
2494
2109
 
2495
2110
  class CadmusCoreModule {
2496
2111
  }
2497
- CadmusCoreModule.decorators = [
2498
- { type: NgModule, args: [{
2499
- imports: [CommonModule, HttpClientModule],
2500
- declarations: [SortPipe],
2501
- exports: [SortPipe]
2502
- },] }
2503
- ];
2112
+ CadmusCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2113
+ CadmusCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusCoreModule, declarations: [SortPipe], imports: [CommonModule, HttpClientModule, NgToolsModule], exports: [SortPipe] });
2114
+ CadmusCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusCoreModule, imports: [[CommonModule, HttpClientModule, NgToolsModule]] });
2115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusCoreModule, decorators: [{
2116
+ type: NgModule,
2117
+ args: [{
2118
+ imports: [CommonModule, HttpClientModule, NgToolsModule],
2119
+ declarations: [SortPipe],
2120
+ exports: [SortPipe],
2121
+ }]
2122
+ }] });
2504
2123
 
2505
2124
  /*
2506
2125
  * Public API Surface of cadmus-core
@@ -2510,5 +2129,4 @@ CadmusCoreModule.decorators = [
2510
2129
  * Generated bundle index. Do not edit.
2511
2130
  */
2512
2131
 
2513
- export { CadmusCoreModule, CadmusValidators, DATATION_FORMAT_OPTIONS, DataPinValueType, Datation, EnvService, EnvServiceFactory, EnvServiceProvider, ErrorService, GravatarService, HistoricalDate, HistoricalDateType, LibraryRouteService, LocalStorageService, PasswordValidator, PendingChangesGuard, RomanNumber, SortPipe, TextLayerService, TextRange, TokenLocation, TokenPoint, deepCopy };
2514
- //# sourceMappingURL=myrmidon-cadmus-core.js.map
2132
+ export { CadmusCoreModule, CadmusValidators, DATATION_FORMAT_OPTIONS, DataPinValueType, Datation, GravatarService, HistoricalDate, HistoricalDateType, LibraryRouteService, PasswordValidator, PendingChangesGuard, SortPipe, TextLayerService, TextRange, TokenLocation, TokenPoint };