@tilde-nlp/ngx-translate 2.0.3 → 2.1.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 (130) hide show
  1. package/esm2020/lib/factories/file-api-service.factory.mjs +1 -1
  2. package/esm2020/lib/factories/mt-term-term-api.factory.mjs +12 -0
  3. package/esm2020/lib/factories/text-api-service.factory.mjs +3 -3
  4. package/esm2020/lib/i18n/de.mjs +2 -7
  5. package/esm2020/lib/i18n/en.mjs +2 -6
  6. package/esm2020/lib/i18n/et.mjs +1 -6
  7. package/esm2020/lib/i18n/fi.mjs +1 -6
  8. package/esm2020/lib/i18n/lt.mjs +1 -6
  9. package/esm2020/lib/i18n/lv.mjs +2 -7
  10. package/esm2020/lib/i18n/pl.mjs +1 -6
  11. package/esm2020/lib/i18n/sv.mjs +1 -4
  12. package/esm2020/lib/injection-tokens/index.mjs +2 -1
  13. package/esm2020/lib/injection-tokens/mt-term-api.token.mjs +2 -0
  14. package/esm2020/lib/modules/tld-common/models/configs/tld-term-config.model.mjs +1 -1
  15. package/esm2020/lib/modules/tld-common/services/tld-translate-config.service.mjs +2 -1
  16. package/esm2020/lib/modules/tld-document/services/api/file-api.service.mjs +7 -7
  17. package/esm2020/lib/modules/tld-term/create-collection/create-collection.component.mjs +51 -0
  18. package/esm2020/lib/modules/tld-term/index.mjs +2 -1
  19. package/esm2020/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1-status.enum.mjs +7 -0
  20. package/esm2020/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1.model.mjs +2 -0
  21. package/esm2020/lib/modules/tld-term/services/api-v1/mt-term-v1.service.mjs +53 -0
  22. package/esm2020/lib/modules/tld-term/services/api-v2/mt-term-v2.service.mjs +67 -0
  23. package/esm2020/lib/modules/tld-term/services/engine-term/eninge-term-api.service.mjs +32 -0
  24. package/esm2020/lib/modules/tld-term/services/engine-term/models/add-engine-terms-request-params.model.mjs +2 -0
  25. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-list.model.mjs +2 -0
  26. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-scope.enum.mjs +6 -0
  27. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-source.enum.mjs +6 -0
  28. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-status.enum.mjs +11 -0
  29. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection.model.mjs +2 -0
  30. package/esm2020/lib/modules/tld-term/services/engine-term/models/index.mjs +8 -0
  31. package/esm2020/lib/modules/tld-term/services/engine-term/models/update-engine-terms-request-params.model.mjs +2 -0
  32. package/esm2020/lib/modules/tld-term/services/index.mjs +4 -4
  33. package/esm2020/lib/modules/tld-term/services/models/combined-collection-tooltip-key.enum.mjs +6 -0
  34. package/esm2020/lib/modules/tld-term/services/models/combined-collection.model.mjs +190 -0
  35. package/esm2020/lib/modules/tld-term/services/models/index.mjs +6 -0
  36. package/esm2020/lib/modules/tld-term/services/models/mt-collection-status.enum.mjs +14 -0
  37. package/esm2020/lib/modules/tld-term/services/models/mt-collection.model.mjs +2 -0
  38. package/esm2020/lib/modules/tld-term/services/models/mt-term-service.model.mjs +2 -0
  39. package/esm2020/lib/modules/tld-term/services/term-api/index.mjs +3 -0
  40. package/esm2020/lib/modules/tld-term/services/term-api/models/index.mjs +3 -0
  41. package/esm2020/lib/modules/tld-term/services/term-api/models/tld-term-collection-languages.model.mjs +2 -0
  42. package/esm2020/lib/modules/tld-term/services/term-api/models/tld-term-collection.model.mjs +2 -0
  43. package/esm2020/lib/modules/tld-term/services/term-api/term-api.service.mjs +58 -0
  44. package/esm2020/lib/modules/tld-term/services/terminology.service.mjs +292 -0
  45. package/esm2020/lib/modules/tld-term/tld-term-collection/tld-term-collection.component.mjs +27 -12
  46. package/esm2020/lib/modules/tld-term/tld-term-collection-list/tld-term-collection-list.component.mjs +24 -51
  47. package/esm2020/lib/modules/tld-term/tld-term-menu/tld-term-menu.component.mjs +19 -12
  48. package/esm2020/lib/modules/tld-term/tld-term.module.mjs +6 -5
  49. package/esm2020/lib/modules/tld-text/services/api/tld-translate-text-api.service.mjs +7 -7
  50. package/esm2020/lib/modules/tld-tooltip/services/api-v2/tld-system-api-v2.service.mjs +4 -2
  51. package/esm2020/lib/modules/tld-web/tld-translate-web/tld-translate-web.component.mjs +8 -8
  52. package/esm2020/lib/tld-translate.module.mjs +17 -4
  53. package/esm2020/public-api.mjs +4 -2
  54. package/fesm2015/tilde-nlp-ngx-translate.mjs +749 -435
  55. package/fesm2015/tilde-nlp-ngx-translate.mjs.map +1 -1
  56. package/fesm2020/tilde-nlp-ngx-translate.mjs +724 -431
  57. package/fesm2020/tilde-nlp-ngx-translate.mjs.map +1 -1
  58. package/lib/factories/file-api-service.factory.d.ts +2 -2
  59. package/lib/factories/mt-term-term-api.factory.d.ts +7 -0
  60. package/lib/factories/text-api-service.factory.d.ts +3 -3
  61. package/lib/i18n/de.d.ts +0 -5
  62. package/lib/i18n/en.d.ts +1 -5
  63. package/lib/i18n/et.d.ts +0 -5
  64. package/lib/i18n/fi.d.ts +0 -5
  65. package/lib/i18n/lt.d.ts +0 -5
  66. package/lib/i18n/lv.d.ts +0 -5
  67. package/lib/i18n/pl.d.ts +0 -5
  68. package/lib/i18n/sv.d.ts +0 -3
  69. package/lib/injection-tokens/index.d.ts +1 -0
  70. package/lib/injection-tokens/mt-term-api.token.d.ts +1 -0
  71. package/lib/modules/tld-common/models/configs/tld-term-config.model.d.ts +1 -0
  72. package/lib/modules/tld-document/services/api/file-api.service.d.ts +3 -3
  73. package/lib/modules/tld-term/create-collection/create-collection.component.d.ts +17 -0
  74. package/lib/modules/tld-term/index.d.ts +1 -0
  75. package/lib/modules/tld-term/{models/mt-collection-status.model.d.ts → services/api-v1/models/mt-term-collection-v1-status.enum.d.ts} +1 -1
  76. package/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1.model.d.ts +12 -0
  77. package/lib/modules/tld-term/services/api-v1/mt-term-v1.service.d.ts +17 -0
  78. package/lib/modules/tld-term/services/api-v2/mt-term-v2.service.d.ts +18 -0
  79. package/lib/modules/tld-term/services/engine-term/eninge-term-api.service.d.ts +17 -0
  80. package/lib/modules/tld-term/services/engine-term/models/add-engine-terms-request-params.model.d.ts +8 -0
  81. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-list.model.d.ts +4 -0
  82. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-scope.enum.d.ts +4 -0
  83. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-source.enum.d.ts +4 -0
  84. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-status.enum.d.ts +9 -0
  85. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection.model.d.ts +14 -0
  86. package/lib/modules/tld-term/services/engine-term/models/index.d.ts +7 -0
  87. package/lib/modules/tld-term/services/engine-term/models/update-engine-terms-request-params.model.d.ts +5 -0
  88. package/lib/modules/tld-term/services/index.d.ts +3 -3
  89. package/lib/modules/tld-term/services/models/combined-collection-tooltip-key.enum.d.ts +4 -0
  90. package/lib/modules/tld-term/services/models/combined-collection.model.d.ts +87 -0
  91. package/lib/modules/tld-term/services/models/index.d.ts +5 -0
  92. package/lib/modules/tld-term/services/models/mt-collection-status.enum.d.ts +11 -0
  93. package/lib/modules/tld-term/services/models/mt-collection.model.d.ts +14 -0
  94. package/lib/modules/tld-term/services/models/mt-term-service.model.d.ts +7 -0
  95. package/lib/modules/tld-term/services/term-api/index.d.ts +2 -0
  96. package/lib/modules/tld-term/services/term-api/models/index.d.ts +2 -0
  97. package/lib/modules/tld-term/{models/term-api → services/term-api/models}/tld-term-collection.model.d.ts +2 -2
  98. package/lib/modules/tld-term/services/term-api/term-api.service.d.ts +17 -0
  99. package/lib/modules/tld-term/services/terminology.service.d.ts +63 -0
  100. package/lib/modules/tld-term/tld-term-collection/tld-term-collection.component.d.ts +13 -4
  101. package/lib/modules/tld-term/tld-term-collection-list/tld-term-collection-list.component.d.ts +13 -17
  102. package/lib/modules/tld-term/tld-term-menu/tld-term-menu.component.d.ts +11 -7
  103. package/lib/modules/tld-term/tld-term.module.d.ts +13 -12
  104. package/lib/modules/tld-text/services/api/tld-translate-text-api.service.d.ts +3 -3
  105. package/lib/modules/tld-web/tld-translate-web/tld-translate-web.component.d.ts +3 -3
  106. package/package.json +1 -1
  107. package/public-api.d.ts +3 -1
  108. package/src/assets/webcomponent/tld-translate.js +1 -1
  109. package/tilde-nlp-ngx-translate-2.1.0.tgz +0 -0
  110. package/esm2020/lib/modules/tld-term/models/converted-collection-tooltip-key.model.mjs +0 -7
  111. package/esm2020/lib/modules/tld-term/models/converted-collection-type.model.mjs +0 -9
  112. package/esm2020/lib/modules/tld-term/models/index.mjs +0 -7
  113. package/esm2020/lib/modules/tld-term/models/mt-api/tld-mt-term-collection.model.mjs +0 -2
  114. package/esm2020/lib/modules/tld-term/models/mt-collection-status.model.mjs +0 -7
  115. package/esm2020/lib/modules/tld-term/models/term-api/tld-term-collection-languages.model.mjs +0 -2
  116. package/esm2020/lib/modules/tld-term/models/term-api/tld-term-collection.model.mjs +0 -2
  117. package/esm2020/lib/modules/tld-term/models/tld-converted-collection.model.mjs +0 -114
  118. package/esm2020/lib/modules/tld-term/services/mt-collections-api.service.mjs +0 -33
  119. package/esm2020/lib/modules/tld-term/services/term-api.service.mjs +0 -34
  120. package/esm2020/lib/modules/tld-term/services/tld-term-collections.service.mjs +0 -253
  121. package/lib/modules/tld-term/models/converted-collection-tooltip-key.model.d.ts +0 -5
  122. package/lib/modules/tld-term/models/converted-collection-type.model.d.ts +0 -7
  123. package/lib/modules/tld-term/models/index.d.ts +0 -6
  124. package/lib/modules/tld-term/models/mt-api/tld-mt-term-collection.model.d.ts +0 -15
  125. package/lib/modules/tld-term/models/tld-converted-collection.model.d.ts +0 -43
  126. package/lib/modules/tld-term/services/mt-collections-api.service.d.ts +0 -13
  127. package/lib/modules/tld-term/services/term-api.service.d.ts +0 -15
  128. package/lib/modules/tld-term/services/tld-term-collections.service.d.ts +0 -57
  129. package/tilde-nlp-ngx-translate-2.0.3.tgz +0 -0
  130. /package/lib/modules/tld-term/{models/term-api → services/term-api/models}/tld-term-collection-languages.model.d.ts +0 -0
@@ -8,13 +8,13 @@ import * as i1$3 from '@angular/common/http';
8
8
  import { HttpErrorResponse, HttpHeaders, HttpEventType, HttpClient, HttpClientModule } from '@angular/common/http';
9
9
  import * as i12 from '@tilde-nlp/ngx-common';
10
10
  import { NotificationMessageType, CloseButtonModule, SortTranslationsModule, InlineMessageType, InlineMessageIconPosition, InlineMessageModule, FileUploadModule, FilterWithHighlightPipe, FilterWithHighlightModule, ClickOutsideModule, NotificationMessageModule, CompanyProductModule } from '@tilde-nlp/ngx-common';
11
- import { Subject, ReplaySubject, BehaviorSubject, of, timer, throwError, forkJoin } from 'rxjs';
11
+ import { Subject, ReplaySubject, BehaviorSubject, of, timer, throwError, map, tap, forkJoin } from 'rxjs';
12
12
  import * as i1$1 from '@ngx-translate/core';
13
13
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
14
14
  import * as i4 from '@angular/flex-layout/flex';
15
15
  import * as i3$1 from '@angular/material/menu';
16
16
  import { MatMenu, MatMenuModule } from '@angular/material/menu';
17
- import { takeUntil, catchError, retryWhen, mergeMap, take, map, tap, distinctUntilChanged, debounce } from 'rxjs/operators';
17
+ import { takeUntil, catchError, retryWhen, mergeMap, take, map as map$1, distinctUntilChanged, debounce, tap as tap$1 } from 'rxjs/operators';
18
18
  import * as i5 from '@angular/material/button';
19
19
  import { MatButton, MatButtonModule } from '@angular/material/button';
20
20
  import * as i3 from '@angular/common';
@@ -352,12 +352,9 @@ const i18n_de = {
352
352
  "SELECTED_NONE": "Keines",
353
353
  "EDIT": "Bearbeiten",
354
354
  "CREATE": "Neues Glossar",
355
- "ENTRY_COUNT": "Einträge: {{count}}",
356
- "ENTRY_COUNT_WITH_LANGUGAES": "Einträge: {{count}} [{{languages}}]",
357
355
  "DEFAULT_COLLECTION_NAME": "Meine Begriffssammlung",
358
356
  "SYNC": "Synchronisieren",
359
357
  "SYNC_ERROR": "Erneut versuchen",
360
- "MT_ENTRY_COUNT": "Importiert: {{count}}",
361
358
  "TITLE": "Glossare auswählen, bearbeiten und verwalten",
362
359
  "TITLE_EMPTY": "Ein erstes Glossar erstellen",
363
360
  "TITLE_MOBILE": "Glossare auswählen",
@@ -374,8 +371,7 @@ const i18n_de = {
374
371
  },
375
372
  "ARIA_LABELS": {
376
373
  "RADIO_GROUP": "Begriffssammlung auswählen",
377
- "OTHER_COLLECTIONS": "Sammlungsmenü öffnen",
378
- "MT_ENTRY_COUNT": "Anzahl der für die maschinelle Übersetzung verwendeten Einträge"
374
+ "OTHER_COLLECTIONS": "Sammlungsmenü öffnen"
379
375
  },
380
376
  "CREATE_DIALOG": {
381
377
  "CANCEL": "Abbrechen",
@@ -388,7 +384,6 @@ const i18n_de = {
388
384
  },
389
385
  "TOOLTIPS": {
390
386
  "EDIT": "Sie werden zum Terminologieportal weitergeleitet, das in einem neuen Tab geöffnet wird",
391
- "ENTRY_COUNT": "Anzahl der hinzugefügten Einträge in der Begriffssammlung",
392
387
  "IMPORTING": "Die Begriffssammlung wird gerade importiert und kann nicht verwendet werden, solange der Import nicht abgeschlossen ist.",
393
388
  "NO_ENTRIES": "Begriffssammlung kann nicht verwendet werden, da es keine Begriffe für die Ausgangssprache gibt.",
394
389
  "SYNC": "Begriffssammlung aktualisieren",
@@ -747,9 +742,7 @@ const i18n_en = {
747
742
  "CREATE": "New glossary",
748
743
  "DESCRIPTION_EMPTY": "You can set up exactly how you want {{appName}} to translate words and phrases specific to your company or industry by adding them to your unique term collections.",
749
744
  "DESCRIPTION_EMPTY_MOBILE": "Use the desktop version to set up exactly how you want Tilde MT to translate words and phrases specific to your company or industry by adding them to your unique term collections.",
750
- "ENTRY_COUNT": "Entries: {{count}}",
751
- "ENTRY_COUNT_WITH_LANGUGAES": "Entries: {{count}} [{{languages}}]",
752
- "MT_ENTRY_COUNT": "Imported: {{count}}",
745
+ "LAST_UPDATED": "Last updated: {{date}}",
753
746
  "DEFAULT_COLLECTION_NAME": "My term collection",
754
747
  "SYNC": "Sync",
755
748
  "SYNC_ERROR": "Retry",
@@ -768,8 +761,6 @@ const i18n_en = {
768
761
  },
769
762
  "TOOLTIPS": {
770
763
  "EDIT": "You will be redirected to terminology portal that will be opened in a new tab",
771
- "ENTRY_COUNT": "Number of entries added to the term collection",
772
- "MT_ENTRY_COUNT": "Number of entries used for machine translation",
773
764
  "IMPORTING": "Import of the term collection in progress, the collection will not be available until it is completed.",
774
765
  "NO_ENTRIES": "Term collection cannot be used: no terms in source language",
775
766
  "SYNC": "Update the term collection",
@@ -1124,7 +1115,6 @@ const i18n_et = {
1124
1115
  "CANCEL": "Loobu"
1125
1116
  },
1126
1117
  "TERM_COLLECTIONS": {
1127
- "MT_ENTRY_COUNT": "Imporditud: {{count}}",
1128
1118
  "TITLE": "Sõnastike valimine, redigeerimine ja haldamine",
1129
1119
  "TITLE_EMPTY": "Looge oma esimene sõnastik",
1130
1120
  "TITLE_MOBILE": "Valige sõnastikud",
@@ -1137,8 +1127,6 @@ const i18n_et = {
1137
1127
  "SELECTED_NONE": "Puudub",
1138
1128
  "EDIT": "Redigeeri",
1139
1129
  "CREATE": "Uus sõnastik",
1140
- "ENTRY_COUNT": "Kirjeid: {{count}}",
1141
- "ENTRY_COUNT_WITH_LANGUGAES": "Kirjeid: {{count}} [{{languages}}]",
1142
1130
  "DEFAULT_COLLECTION_NAME": "Minu terminikogu",
1143
1131
  "SYNC": "Sünkrooni",
1144
1132
  "SYNC_ERROR": "Proovi uuesti",
@@ -1162,9 +1150,7 @@ const i18n_et = {
1162
1150
  "COLLECTION_NAME_ERROR": "Pealkiri peaks olema vähemalt {{minLength}} sümbolit pikk ja mitte pikem kui {{maxLength}} sümbolit"
1163
1151
  },
1164
1152
  "TOOLTIPS": {
1165
- "MT_ENTRY_COUNT": "Masintõlkes kasutatavate kirjete arv",
1166
1153
  "EDIT": "Teid suunatakse ümber terminoloogiaportaali, mis avatakse uuel vahekaardil",
1167
- "ENTRY_COUNT": "Terminikogusse lisatud kirjete arv",
1168
1154
  "IMPORTING": "Terminikogu imporditakse ja seda ei kasutata, kui importimine veel kestab.",
1169
1155
  "NO_ENTRIES": "Terminikogu ei saa kasutada. Lähtekeeles pole termineid.",
1170
1156
  "SYNC": "Värskenda terminikogu",
@@ -1507,7 +1493,6 @@ const i18n_fi = {
1507
1493
  "CLOSE": "Sulje"
1508
1494
  },
1509
1495
  "TERM_COLLECTIONS": {
1510
- "MT_ENTRY_COUNT": "Tuotu: {{count}}",
1511
1496
  "TITLE": "Valitse, muokkaa ja hallinnoi sanastoja",
1512
1497
  "TITLE_EMPTY": "Luo ensimmäinen sanasto",
1513
1498
  "TITLE_MOBILE": "Valitse sanastot",
@@ -1526,8 +1511,6 @@ const i18n_fi = {
1526
1511
  "SELECTED_NONE": "Ei mitään",
1527
1512
  "EDIT": "Muokkaa",
1528
1513
  "CREATE": "Uusi sanasto",
1529
- "ENTRY_COUNT": "Merkinnät: {{count}}",
1530
- "ENTRY_COUNT_WITH_LANGUGAES": "Merkinnät: {{count}} [{{languages}}]",
1531
1514
  "DEFAULT_COLLECTION_NAME": "Termikokoelmani",
1532
1515
  "SYNC": "Synkronoi",
1533
1516
  "SYNC_ERROR": "Yritä uudelleen",
@@ -1545,9 +1528,7 @@ const i18n_fi = {
1545
1528
  "COLLECTION_NAME_ERROR": "Otsikon tulee olla vähintään {{minLength}} ja enintään {{maxLength}} merkkiä pitkä"
1546
1529
  },
1547
1530
  "TOOLTIPS": {
1548
- "MT_ENTRY_COUNT": "Konekäännökseen käytettyjen merkintöjen määrä",
1549
1531
  "EDIT": "Sinut ohjataan uudelleen termiportaaliin, joka avautuu uudessa välilehdessä",
1550
- "ENTRY_COUNT": "Termikokoelmaan lisättyjen merkintöjen määrä",
1551
1532
  "IMPORTING": "Termikokoelmaa tuodaan. Sitä ei voida käyttää, ennen kuin tuonti on valmis.",
1552
1533
  "NO_ENTRIES": "Termikokoelmaa ei voida käyttää, koska lähdekielellä ei ole termejä",
1553
1534
  "SYNC": "Päivitä termikokoelma",
@@ -1913,7 +1894,6 @@ const i18n_lt = {
1913
1894
  "CANCEL": "Atšaukti"
1914
1895
  },
1915
1896
  "TERM_COLLECTIONS": {
1916
- "MT_ENTRY_COUNT": "Importuota: {{count}}",
1917
1897
  "TITLE": "Pasirinkite, redaguokite ir tvarkykite žodynus",
1918
1898
  "TITLE_EMPTY": "Sukurkite pirmąjį savo žodyną",
1919
1899
  "TITLE_MOBILE": "Pasirinkite žodynus",
@@ -1932,8 +1912,6 @@ const i18n_lt = {
1932
1912
  "SELECTED_NONE": "Nėra",
1933
1913
  "EDIT": "Redaguoti",
1934
1914
  "CREATE": "Naujas žodynas",
1935
- "ENTRY_COUNT": "Įrašų: {{count}}",
1936
- "ENTRY_COUNT_WITH_LANGUGAES": "Įrašų: {{count}} [{{languages}}]",
1937
1915
  "DEFAULT_COLLECTION_NAME": "Mano terminų rinkinys",
1938
1916
  "SYNC": "Sinchronizuoti",
1939
1917
  "SYNC_ERROR": "Kartoti",
@@ -1951,9 +1929,7 @@ const i18n_lt = {
1951
1929
  "COLLECTION_NAME_ERROR": "Pavadinimas turėtų būti bent tiek simbolių ilgio: {{minLength}} ir ne ilgesnis nei tiek simbolių: {{maxLength}}"
1952
1930
  },
1953
1931
  "TOOLTIPS": {
1954
- "MT_ENTRY_COUNT": "Mašininio vertimo įrašų skaičius",
1955
1932
  "EDIT": "Būsite nukreipti į terminologijos portalą, kuris bus atidarytas naujame skirtuke",
1956
- "ENTRY_COUNT": "Į terminų rinkinį įtrauktų įrašų skaičius",
1957
1933
  "IMPORTING": "Terminų rinkinys importuojamas ir nebus naudojamas, kol nebaigta importuoti.",
1958
1934
  "NO_ENTRIES": "Terminų rinkinio naudoti negalima, nes nėra šaltinio kalbos terminų",
1959
1935
  "SYNC": "Atnaujinti terminų rinkinį",
@@ -2304,7 +2280,6 @@ const i18n_lv = {
2304
2280
  "CANCEL": "Atcelt"
2305
2281
  },
2306
2282
  "TERM_COLLECTIONS": {
2307
- "MT_ENTRY_COUNT": "Importēts: {{count}}",
2308
2283
  "TITLE": "Glosāriju atlase, rediģēšana un pārvaldība",
2309
2284
  "TITLE_EMPTY": "Sava pirmā glosārija izveide",
2310
2285
  "TITLE_MOBILE": "Glosāriju atlase",
@@ -2323,8 +2298,6 @@ const i18n_lv = {
2323
2298
  "SELECTED_NONE": "Neviens",
2324
2299
  "EDIT": "Rediģēt",
2325
2300
  "CREATE": "Jauns glosārijs",
2326
- "ENTRY_COUNT": "Ieraksti: {{count}}",
2327
- "ENTRY_COUNT_WITH_LANGUGAES": "Ieraksti: {{count}} [{{languages}}]",
2328
2301
  "DEFAULT_COLLECTION_NAME": "Mana terminu kolekcija",
2329
2302
  "SYNC": "Sinhronizēt",
2330
2303
  "SYNC_ERROR": "Mēģināt vēlreiz",
@@ -2342,9 +2315,7 @@ const i18n_lv = {
2342
2315
  "COLLECTION_NAME_ERROR": "Rakstzīmju skaits virsrakstā nedrīkst būt mazāks par {{minLength}} vai lielāks par {{maxLength}}"
2343
2316
  },
2344
2317
  "TOOLTIPS": {
2345
- "MT_ENTRY_COUNT": "Mašīntulkošanai izmantoto ierakstu skaits",
2346
- "EDIT": "Jūs tiksit novirzīts uz terminoloģijas portālu, kas tiks atvērts jaunā cilnē",
2347
- "ENTRY_COUNT": "Terminu kolekcijā pievienoto ierakstu skaits",
2318
+ "EDIT": "Jūs tiksiet novirzīts uz terminoloģijas portālu, kas tiks atvērts jaunā cilnē",
2348
2319
  "IMPORTING": "Terminu kolekcija tiek importēta un netiks izmantota līdz importēšanas beigām.",
2349
2320
  "NO_ENTRIES": "Terminu kolekciju nevar izmantot, jo avotvalodā nav terminu",
2350
2321
  "SYNC": "Atjaunināt terminu kolekciju",
@@ -2682,7 +2653,6 @@ const i18n_pl = {
2682
2653
  "CANCEL": "Anuluj"
2683
2654
  },
2684
2655
  "TERM_COLLECTIONS": {
2685
- "MT_ENTRY_COUNT": "Zaimportowano: {{count}}",
2686
2656
  "TITLE": "Wybieranie, edytowanie i zarządzanie słownikami",
2687
2657
  "TITLE_EMPTY": "Utwórz swój pierwszy słownik",
2688
2658
  "TITLE_MOBILE": "Wybierz słowniki",
@@ -2701,8 +2671,6 @@ const i18n_pl = {
2701
2671
  "SELECTED_NONE": "Brak",
2702
2672
  "EDIT": "Edytuj",
2703
2673
  "CREATE": "Nowy glosariusz",
2704
- "ENTRY_COUNT": "Wpisy: {{count}}",
2705
- "ENTRY_COUNT_WITH_LANGUGAES": "Wpisy: {{count}} [{{languages}}]",
2706
2674
  "DEFAULT_COLLECTION_NAME": "Mój zbiór terminów",
2707
2675
  "SYNC": "Synchronizuj",
2708
2676
  "SYNC_ERROR": "Spróbuj ponownie",
@@ -2720,9 +2688,7 @@ const i18n_pl = {
2720
2688
  "COLLECTION_NAME_ERROR": "Tytuł powinien mieć minimalną liczbę symboli wynoszącą {{minLength}} oraz nie większą niż {{maxLength}}"
2721
2689
  },
2722
2690
  "TOOLTIPS": {
2723
- "MT_ENTRY_COUNT": "Liczba wpisów używanych do tłumaczenia maszynowego",
2724
2691
  "EDIT": "Nastąpi przekierowanie do portalu z terminologią, który otworzy się w nowej zakładce",
2725
- "ENTRY_COUNT": "Liczba wpisów dodana w zbiorze terminów",
2726
2692
  "IMPORTING": "Zbiór terminów jest importowany i do momentu zakończenia importu nie można z niego korzystać.",
2727
2693
  "NO_ENTRIES": "Nie można korzystać ze zbioru terminów, ponieważ dla języka źródłowego nie ma terminów",
2728
2694
  "SYNC": "Zaktualizuj zbiór terminów",
@@ -2980,8 +2946,6 @@ const i18n_sv = {
2980
2946
  "CREATE": "Ny ordlista",
2981
2947
  "DESCRIPTION_EMPTY": "Du kan skapa unika termbanker för varje domän och projekt för att definiera hur specifika ord och fraser översätts.",
2982
2948
  "DESCRIPTION_EMPTY_MOBILE": "Använd skrivbordsversionen för att skapa unika termbanker för varje domän och projekt för att definiera hur specifika ord och fraser översätts. När du är klar kommer du att kunna använda dem i dina översättningsprojekt.",
2983
- "ENTRY_COUNT": "Poster: {{count}}",
2984
- "ENTRY_COUNT_WITH_LANGUGAES": "Poster: {{count}} [{{languages}}]",
2985
2949
  "DEFAULT_COLLECTION_NAME": "Min termbank",
2986
2950
  "SYNC": "Synkronisera",
2987
2951
  "SYNC_ERROR": "Försök igen",
@@ -3000,7 +2964,6 @@ const i18n_sv = {
3000
2964
  },
3001
2965
  "TOOLTIPS": {
3002
2966
  "EDIT": "Du kommer att omdirigeras till terminologiportalen som kommer att öppnas i en ny flik",
3003
- "ENTRY_COUNT": "Antal poster som lagts till i termbanken",
3004
2967
  "IMPORTING": "Termbanken importeras och kommer inte att användas förrän importen är klar.",
3005
2968
  "NO_ENTRIES": "Termbanken kan inte användas eftersom det inte finns några termer för källspråket",
3006
2969
  "SYNC": "Uppdatera termbank",
@@ -3215,6 +3178,8 @@ const TLD_TRANSLATE_CONFIG_TOKEN = "TldTranslateConfig";
3215
3178
 
3216
3179
  const OPEN_CLOSE_BTN_ICONS_TOKEN = 'OPEN_CLOSE_BTN_ICONS_TOKEN';
3217
3180
 
3181
+ const MT_TERM_API_TOKEN = "MtTermApiToken";
3182
+
3218
3183
  /**
3219
3184
  * Class for storing some common methods or global app constants.
3220
3185
  */
@@ -3563,6 +3528,7 @@ class TldTranslateConfigService {
3563
3528
  this._termConfig.collectionNameMaxLength = (_21 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.collectionNameMaxLength) !== null && _21 !== void 0 ? _21 : 300;
3564
3529
  this._termConfig.refreshTimeoutMs = (_22 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.refreshTimeoutMs) !== null && _22 !== void 0 ? _22 : 10000;
3565
3530
  this._termConfig.refreshTimeoutMsWhenImporting = (_23 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.refreshTimeoutMsWhenImporting) !== null && _23 !== void 0 ? _23 : 5000;
3531
+ this._termConfig.engineTermUrl = termConfig === null || termConfig === void 0 ? void 0 : termConfig.engineTermUrl;
3566
3532
  this._termConfig.freeTrialUrl = (_24 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.freeTrialUrl) !== null && _24 !== void 0 ? _24 : "https://tilde.com/products-and-services/machine-translation/pricing/Tilde-MT";
3567
3533
  this._termConfig.learnMoreUrl = (_25 = termConfig === null || termConfig === void 0 ? void 0 : termConfig.learnMoreUrl) !== null && _25 !== void 0 ? _25 : "https://www.tilde.com/products-and-services/machine-translation/Tilde-MT-features-glossary";
3568
3534
  // seperated because following urls have method names added
@@ -5719,140 +5685,250 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
5719
5685
  }]
5720
5686
  }] });
5721
5687
 
5722
- /**
5723
- * Enumerator to determine if collection imported from term api or mt
5724
- */
5725
- var ConvertedCollectionType;
5726
- (function (ConvertedCollectionType) {
5727
- ConvertedCollectionType[ConvertedCollectionType["Term"] = 0] = "Term";
5728
- ConvertedCollectionType[ConvertedCollectionType["MT"] = 1] = "MT";
5729
- })(ConvertedCollectionType || (ConvertedCollectionType = {}));
5688
+ var EngineTermCollectionScope;
5689
+ (function (EngineTermCollectionScope) {
5690
+ EngineTermCollectionScope["GLOBAL"] = "Global";
5691
+ EngineTermCollectionScope["GROUP"] = "Group";
5692
+ })(EngineTermCollectionScope || (EngineTermCollectionScope = {}));
5693
+
5694
+ var EngineTermCollectionSource;
5695
+ (function (EngineTermCollectionSource) {
5696
+ EngineTermCollectionSource["TILDE_TERM"] = "TildeTerm";
5697
+ EngineTermCollectionSource["FILE"] = "File";
5698
+ })(EngineTermCollectionSource || (EngineTermCollectionSource = {}));
5699
+
5700
+ var EngineTermCollectionStatus;
5701
+ (function (EngineTermCollectionStatus) {
5702
+ EngineTermCollectionStatus["QUEUING"] = "Queuing";
5703
+ EngineTermCollectionStatus["FETCHING"] = "Fetching";
5704
+ EngineTermCollectionStatus["PREPROCESSING"] = "Preprocessing";
5705
+ EngineTermCollectionStatus["DELETING"] = "Deleting";
5706
+ EngineTermCollectionStatus["READY"] = "Ready";
5707
+ EngineTermCollectionStatus["ERROR"] = "Error";
5708
+ EngineTermCollectionStatus["DELETED"] = "Deleted";
5709
+ })(EngineTermCollectionStatus || (EngineTermCollectionStatus = {}));
5710
+
5711
+ var CombinedCollectionTooltipKey;
5712
+ (function (CombinedCollectionTooltipKey) {
5713
+ CombinedCollectionTooltipKey["NO_ENTRIES"] = "NO_ENTRIES";
5714
+ CombinedCollectionTooltipKey["IMPORTING"] = "IMPORTING";
5715
+ })(CombinedCollectionTooltipKey || (CombinedCollectionTooltipKey = {}));
5730
5716
 
5731
5717
  var MtCollectionStatus;
5732
5718
  (function (MtCollectionStatus) {
5719
+ MtCollectionStatus["QUEUING"] = "Queuing";
5720
+ MtCollectionStatus["FETCHING"] = "Fetching";
5721
+ MtCollectionStatus["PREPROCESSING"] = "Preprocessing";
5722
+ MtCollectionStatus["DELETING"] = "Deleting";
5733
5723
  MtCollectionStatus["READY"] = "Ready";
5724
+ MtCollectionStatus["DELETED"] = "Deleted";
5734
5725
  MtCollectionStatus["PROCESSING"] = "Processing";
5735
5726
  MtCollectionStatus["ERROR"] = "Error";
5727
+ // basic status created in frontend
5728
+ MtCollectionStatus["NOT_IN_USE"] = "NotInUse";
5736
5729
  })(MtCollectionStatus || (MtCollectionStatus = {}));
5737
5730
 
5738
- var ConvertedCollectionTooltipKey;
5739
- (function (ConvertedCollectionTooltipKey) {
5740
- ConvertedCollectionTooltipKey["NO_ENTRIES"] = "NO_ENTRIES";
5741
- ConvertedCollectionTooltipKey["IMPORTING"] = "IMPORTING";
5742
- ConvertedCollectionTooltipKey["SYNCING"] = "SYNCING";
5743
- })(ConvertedCollectionTooltipKey || (ConvertedCollectionTooltipKey = {}));
5744
-
5745
5731
  /**
5746
- * Used to combine term collection interfaces from term api and MT api.
5732
+ * Class that joins collection from term api and its imported collection from MT api.
5747
5733
  */
5748
- class TldConvertedCollection {
5749
- constructor(obj, sourceLanguageCode, targetLanguageCode) {
5750
- this.sourceLanguageCode = sourceLanguageCode;
5751
- this.targetLanguageCode = targetLanguageCode;
5752
- this.isSynchronized = true;
5753
- if (this.isTldCorpus(obj)) {
5754
- this.fromTldMTCollection(obj);
5734
+ class CombinedCollection {
5735
+ //#endregion
5736
+ constructor(termApiCollection, mtCollection) {
5737
+ //#endregion
5738
+ //#region Editable MT (api v2) fields
5739
+ this.editables = {};
5740
+ //#endregion
5741
+ //#region Getters for common fields
5742
+ // It is possible to optimize getters, by setting some of the values in update method, but it is left this way, so that data is more consistent.
5743
+ // Otherwise it might be easy to miss some property updating and get wrong data in future.
5744
+ this._isSynchronized = true;
5745
+ this.mtCollection = mtCollection;
5746
+ this.termCollection = termApiCollection;
5747
+ this.update(null);
5748
+ }
5749
+ static findExistingCollectionFromList(collections, collection) {
5750
+ var _a, _b;
5751
+ for (const col of collections) {
5752
+ if ((col.termId && col.termId == collection.termId) ||
5753
+ (((_a = col.mtCollection) === null || _a === void 0 ? void 0 : _a.id) && col.mtCollection.id == ((_b = collection.mtCollection) === null || _b === void 0 ? void 0 : _b.id))) {
5754
+ return col;
5755
+ }
5755
5756
  }
5756
- else {
5757
- this.fromTermApi(obj);
5757
+ return null;
5758
+ }
5759
+ static findExistingIndexFromList(collections, collection) {
5760
+ var _a, _b;
5761
+ let i = 0;
5762
+ for (const col of collections) {
5763
+ if ((col.termId && col.termId == collection.termId) ||
5764
+ (((_a = col.mtCollection) === null || _a === void 0 ? void 0 : _a.id) && col.mtCollection.id == ((_b = collection.mtCollection) === null || _b === void 0 ? void 0 : _b.id))) {
5765
+ return i;
5766
+ }
5767
+ i += 1;
5758
5768
  }
5769
+ return null;
5759
5770
  }
5771
+ /**
5772
+ * Weather collection is synchronized with term portal collection. If no term collection, value is set to true.
5773
+ */
5774
+ get isSynchronized() {
5775
+ return this._isSynchronized;
5776
+ }
5777
+ /**
5778
+ * Determines if collections is 'syncable'. Returns true if it is not synced or if synchronization has failed and status is error.
5779
+ */
5760
5780
  get syncButtonVissible() {
5761
- return !this.isSynchronized || (this.termModifiedDate && this.mtStatus === MtCollectionStatus.ERROR);
5781
+ var _a;
5782
+ return !this.isSynchronized || (((_a = this.termCollection) === null || _a === void 0 ? void 0 : _a.modifyDate) && this.mtStatus === MtCollectionStatus.ERROR);
5762
5783
  }
5784
+ /**
5785
+ * If not ready or error, then collection is importing.
5786
+ */
5763
5787
  get isImporting() {
5764
- return this.mtStatus === MtCollectionStatus.PROCESSING;
5788
+ var _a;
5789
+ return this.mtCollection && CombinedCollection.importingStatuses.includes((_a = this.mtCollection) === null || _a === void 0 ? void 0 : _a.status);
5765
5790
  }
5766
5791
  ;
5767
- static findExistingCollectionFromList(termCollections, collection) {
5768
- for (const col of termCollections) {
5769
- if ((col.id && col.id === collection.id)
5770
- || (collection.termId && col.termId === collection.termId)) {
5771
- return col;
5772
- }
5773
- }
5774
- return null;
5792
+ /**
5793
+ * Term collection id. Returns value from term collection or from mt, if term collection not existing.
5794
+ */
5795
+ get termId() {
5796
+ var _a, _b, _c;
5797
+ return (_b = (_a = this.termCollection) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : (_c = this.mtCollection) === null || _c === void 0 ? void 0 : _c.termId;
5775
5798
  }
5776
- update(obj) {
5777
- if (obj.importedFrom === ConvertedCollectionType.MT) {
5778
- if (obj.mtStatus !== MtCollectionStatus.ERROR) {
5779
- this.errorKey = null;
5780
- }
5781
- this.id = obj.id;
5782
- this.mtStatus = obj.mtStatus;
5783
- this.mtAttachmentDateTime = obj.mtAttachmentDateTime;
5784
- this.mtEntryCount = obj.mtEntryCount;
5785
- }
5786
- else if (obj.importedFrom === ConvertedCollectionType.Term) {
5787
- this.termId = obj.termId;
5788
- this.languagesString = obj.languagesString;
5789
- this.termModifiedDate = obj.termModifiedDate;
5790
- this.entryCount = obj.entryCount;
5791
- this.title = obj.title;
5799
+ get mtStatus() {
5800
+ var _a;
5801
+ return (_a = this.mtCollection) === null || _a === void 0 ? void 0 : _a.status;
5802
+ }
5803
+ /**
5804
+ * Last updated date from mt api.
5805
+ */
5806
+ get lastUpdated() {
5807
+ var _a;
5808
+ return (_a = this.mtCollection) === null || _a === void 0 ? void 0 : _a.lastUpdated;
5809
+ }
5810
+ /**
5811
+ * Collection name. If has term collection, takes from there. If not, then returns mt collection name.
5812
+ */
5813
+ get name() {
5814
+ var _a, _b, _c;
5815
+ return (_b = (_a = this.termCollection) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : (_c = this.mtCollection) === null || _c === void 0 ? void 0 : _c.name;
5816
+ }
5817
+ /**
5818
+ * Entry count from term api.
5819
+ */
5820
+ get termEntries() {
5821
+ var _a;
5822
+ return (_a = this.termCollection) === null || _a === void 0 ? void 0 : _a.entryCount;
5823
+ }
5824
+ get default() {
5825
+ var _a;
5826
+ return (_a = this.mtCollection) === null || _a === void 0 ? void 0 : _a.default;
5827
+ }
5828
+ /**
5829
+ * Status from mt api or custom "NOT_IN_USE" status if not imported in mt.s
5830
+ */
5831
+ get status() {
5832
+ var _a;
5833
+ return (_a = this.mtStatus) !== null && _a !== void 0 ? _a : MtCollectionStatus.NOT_IN_USE;
5834
+ }
5835
+ /**
5836
+ * Scope can be edited only if has mt collcetion or term collection is being prepared for import.
5837
+ */
5838
+ get canEditScope() {
5839
+ return this.mtCollection || this.editables.default;
5840
+ }
5841
+ /**
5842
+ * Updates collection with values from new collection.
5843
+ * @param collection collection from which should be updated.
5844
+ * @param initialRefresh if set to true, editable fields will also be updated.
5845
+ */
5846
+ update(collection, initialRefresh = true) {
5847
+ if (collection === null || collection === void 0 ? void 0 : collection.termCollection) {
5848
+ this.termCollection = collection.termCollection;
5792
5849
  }
5793
- this.isSynchronized = this.isTermSynchronizedWithMT();
5794
- if (this.entryCount === 0 && this.termId !== null) {
5795
- this.tooltipKey = ConvertedCollectionTooltipKey.NO_ENTRIES;
5850
+ if (collection === null || collection === void 0 ? void 0 : collection.mtCollection) {
5851
+ this.mtCollection = collection.mtCollection;
5796
5852
  }
5797
- else if (this.isImporting && this.mtEntryCount === 0) {
5798
- this.tooltipKey = ConvertedCollectionTooltipKey.IMPORTING;
5853
+ if (initialRefresh) {
5854
+ this.updateEditables();
5799
5855
  }
5800
- else if (this.isImporting) {
5801
- this.tooltipKey = ConvertedCollectionTooltipKey.SYNCING;
5856
+ this.updateIsSynchronized();
5857
+ this.updateTooltipKey();
5858
+ this.updateSource();
5859
+ }
5860
+ /**
5861
+ * If some of editables are edited.
5862
+ *
5863
+ * if collection not imported and enabled not set, method will return true, because you cannot update collection if it is not imported or is not meant to be imported.
5864
+ *
5865
+ * @returns true if collection is edited, false if not.
5866
+ */
5867
+ isEdited() {
5868
+ var _a;
5869
+ // if collection not imported and enabled not set, should not update collection.
5870
+ if (!this.mtCollection && !this.editables.default) {
5871
+ return false;
5802
5872
  }
5803
- else {
5804
- this.tooltipKey = null;
5873
+ else if ((((_a = this.mtCollection) === null || _a === void 0 ? void 0 : _a.default) !== this.editables.default)
5874
+ || (this.mtCollection && this.editables.scope !== this.mtCollection.scope)) {
5875
+ return true;
5805
5876
  }
5877
+ return false;
5806
5878
  }
5807
- deletedFromTermApi() {
5808
- this.termId = null;
5809
- this.languagesString = null;
5810
- this.termModifiedDate = null;
5811
- this.entryCount = null;
5879
+ /**
5880
+ * Deletes term collection and its properties.
5881
+ */
5882
+ deleteTerms() {
5883
+ this.termCollection = null;
5884
+ this.update(null);
5812
5885
  }
5813
- static convertCollections(collections, sourceLanguage, targetLanguage) {
5814
- const converted = [];
5815
- collections.forEach((collection) => {
5816
- converted.push(new TldConvertedCollection(collection, sourceLanguage, targetLanguage));
5817
- });
5818
- return converted;
5886
+ /**
5887
+ * Deletes mt collection and its properties.
5888
+ */
5889
+ deleteMT() {
5890
+ this.mtCollection = null;
5891
+ this.update(null);
5819
5892
  }
5820
- fromTermApi(obj) {
5893
+ //#region Private methods
5894
+ updateIsSynchronized() {
5821
5895
  var _a, _b;
5822
- this.termId = obj.id.toString();
5823
- this.title = obj.name;
5824
- this.importedFrom = ConvertedCollectionType.Term;
5825
- this.termModifiedDate = new Date(obj.modifyDate);
5826
- const language = (_a = obj.languages) === null || _a === void 0 ? void 0 : _a.find(lang => lang.id.toLowerCase() === this.sourceLanguageCode.toLowerCase());
5827
- this.entryCount = (_b = language === null || language === void 0 ? void 0 : language.count) !== null && _b !== void 0 ? _b : 0;
5828
- this.languagesString = obj.languages.filter(lang => lang.id !== this.sourceLanguageCode && lang.count > 0)
5829
- .map(lang => lang.id.toUpperCase()).join(", ");
5830
- }
5831
- fromTldMTCollection(obj) {
5832
- this.id = obj.CorpusId;
5833
- this.title = obj.Title;
5834
- this.importedFrom = ConvertedCollectionType.MT;
5835
- this.mtAttachmentDateTime = new Date(obj.AttachmentDateTime);
5836
- this.termId = obj.TildeTermId;
5837
- this.mtStatus = obj.Status;
5838
- this.mtPreparedDateTime = obj.PreparedDateTime;
5839
- this.mtEntryCount = obj.Count;
5840
- }
5841
- isTldCorpus(obj) {
5842
- return obj.TildeTermId !== undefined;
5843
- }
5844
- /**
5845
- * Check if the newest version of the term collection is synchronized from Term portal.
5846
- * Note. Term collections that are not linked from Term portal are considered as synchronized.
5847
- */
5848
- isTermSynchronizedWithMT() {
5849
5896
  let isSynchronized = true;
5850
- if (this.termModifiedDate && this.mtAttachmentDateTime) {
5851
- isSynchronized = this.termModifiedDate < this.mtAttachmentDateTime;
5897
+ const termModified = (_a = this.termCollection) === null || _a === void 0 ? void 0 : _a.modifyDate;
5898
+ const lastMtUpdated = (_b = this.mtCollection) === null || _b === void 0 ? void 0 : _b.lastUpdated;
5899
+ if (termModified && lastMtUpdated) {
5900
+ isSynchronized = termModified < lastMtUpdated;
5852
5901
  }
5853
- return isSynchronized;
5902
+ this._isSynchronized = isSynchronized;
5854
5903
  }
5855
- }
5904
+ updateSource() {
5905
+ if (this.termCollection) {
5906
+ this.source = EngineTermCollectionSource.TILDE_TERM;
5907
+ }
5908
+ else if (this.mtCollection) {
5909
+ this.source = EngineTermCollectionSource.FILE;
5910
+ }
5911
+ }
5912
+ updateTooltipKey() {
5913
+ var _a;
5914
+ if (((_a = this.termCollection) === null || _a === void 0 ? void 0 : _a.entryCount) === 0) {
5915
+ this.termTooltipKey = CombinedCollectionTooltipKey.NO_ENTRIES;
5916
+ }
5917
+ else if (this.isImporting) {
5918
+ this.termTooltipKey = CombinedCollectionTooltipKey.IMPORTING;
5919
+ }
5920
+ else {
5921
+ this.termTooltipKey = null;
5922
+ }
5923
+ }
5924
+ updateEditables() {
5925
+ var _a, _b, _c;
5926
+ this.editables.default = (_a = this.mtCollection) === null || _a === void 0 ? void 0 : _a.default;
5927
+ this.editables.scope = (_c = (_b = this.mtCollection) === null || _b === void 0 ? void 0 : _b.scope) !== null && _c !== void 0 ? _c : EngineTermCollectionScope.GLOBAL;
5928
+ }
5929
+ }
5930
+ //#region Static properties
5931
+ CombinedCollection.importingStatuses = [MtCollectionStatus.FETCHING, MtCollectionStatus.PREPROCESSING, MtCollectionStatus.PROCESSING, MtCollectionStatus.QUEUING];
5856
5932
 
5857
5933
  class TermApiService {
5858
5934
  constructor(config, http) {
@@ -5867,10 +5943,34 @@ class TermApiService {
5867
5943
  name: collectionName,
5868
5944
  defaultLanguages
5869
5945
  };
5870
- return this.http.post(this.url, params);
5946
+ return this.http.post(this.url, params)
5947
+ .pipe(map((collection) => {
5948
+ return this.convertToCombinedCollection(collection);
5949
+ }));
5871
5950
  }
5872
- getCollectionList(sourceLanguageCode, targetLanguageCode) {
5873
- return this.http.get(this.url).pipe(map((collections) => { return TldConvertedCollection.convertCollections(collections, sourceLanguageCode, targetLanguageCode); }));
5951
+ getCollectionList(languages) {
5952
+ return this.http.get(this.url)
5953
+ .pipe(map((collections) => {
5954
+ const converted = [];
5955
+ collections.forEach((collection) => {
5956
+ converted.push(this.convertToCombinedCollection(collection));
5957
+ });
5958
+ return converted;
5959
+ }));
5960
+ }
5961
+ getEditLink(termId, sourceLanguage, targetLanguage) {
5962
+ let link = `${this.config.termConfig.apiUrl}/collections/${termId}/mt`;
5963
+ if (sourceLanguage) {
5964
+ link = `${link}/${sourceLanguage}`;
5965
+ }
5966
+ if (targetLanguage) {
5967
+ link = `${link}/${targetLanguage}`;
5968
+ }
5969
+ return link;
5970
+ }
5971
+ convertToCombinedCollection(collection) {
5972
+ collection.modifyDate = new Date(collection.modifyDate);
5973
+ return new CombinedCollection(collection, null);
5874
5974
  }
5875
5975
  }
5876
5976
  TermApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TermApiService, deps: [{ token: TldTranslateConfigService }, { token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -5882,52 +5982,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
5882
5982
  }]
5883
5983
  }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: i1$3.HttpClient }]; } });
5884
5984
 
5885
- class MtCollectionsApiService {
5886
- constructor(http, config) {
5887
- this.http = http;
5985
+ class TerminologyService {
5986
+ constructor(config, termApi, mtApi) {
5888
5987
  this.config = config;
5889
- }
5890
- attachTermsFromTildeTerm(systemId, tildeTermCollectionId) {
5891
- const params = { systemID: systemId, tildeTermColectionID: tildeTermCollectionId };
5892
- const url = `${this.config.coreConfig.translationServiceUrl}AttachTermsFromTildeTerm`;
5893
- return this.http.get(url, { params });
5894
- }
5895
- loadMTCollections(systemId, sourceLanguage, targetLanguage) {
5896
- const headers = Common.getAuthHeaders(this.config);
5897
- const url = `${this.config.coreConfig.translationServiceUrl}GetDetailedSystemTermCorpora`;
5898
- const params = { systemID: systemId };
5899
- return this.http.get(url, { headers, params }).pipe(map((collections) => { return TldConvertedCollection.convertCollections(collections, sourceLanguage, targetLanguage); }));
5900
- }
5901
- }
5902
- MtCollectionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
5903
- MtCollectionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, providedIn: 'root' });
5904
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, decorators: [{
5905
- type: Injectable,
5906
- args: [{
5907
- providedIn: 'root'
5908
- }]
5909
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
5910
-
5911
- class TldTermCollectionsService {
5912
- constructor(config, tldSystem, termApi, mtApi) {
5913
- this.config = config;
5914
- this.tldSystem = tldSystem;
5915
5988
  this.termApi = termApi;
5916
5989
  this.mtApi = mtApi;
5917
5990
  this._selected = null;
5991
+ this.onDataUpdate = new Subject();
5918
5992
  this.LOCAL_STORAGE_KEY = "systemLastCollections";
5919
- this.tldSystem.getActiveData()
5920
- .subscribe((active) => {
5921
- this.sourceLanguageCode = active === null || active === void 0 ? void 0 : active.sourceLang.lang;
5922
- this.targetLanguageCode = active === null || active === void 0 ? void 0 : active.targetLang.lang;
5923
- this.activeSystemId = (active === null || active === void 0 ? void 0 : active.systemId) || null;
5924
- this._collections = new Set();
5925
- // avoiding setter, so the null value is not storeed in location since it is not by user action
5926
- this._selected = null;
5927
- if (active && this.tldSystem.isTerminologySupported(active === null || active === void 0 ? void 0 : active.system)) {
5928
- this.refreshCollections(true);
5929
- }
5930
- });
5931
5993
  }
5932
5994
  get selected() { return this._selected; }
5933
5995
  set selected(val) {
@@ -5936,15 +5998,15 @@ class TldTermCollectionsService {
5936
5998
  if (!this._selected) {
5937
5999
  return;
5938
6000
  }
5939
- if (!this._selected.id) {
5940
- this.addCollectionToSystem(this._selected);
6001
+ if (!this._selected.mtCollection) {
6002
+ this.addToEngine(this._selected);
5941
6003
  }
5942
6004
  }
5943
- get collections() {
5944
- return this._collections;
6005
+ get hasAnyCollections() {
6006
+ return this._hasAnyCollections;
5945
6007
  }
5946
- get isRefreshingCollections() {
5947
- return this._isRefreshingCollections;
6008
+ get shouldShowPromotion() {
6009
+ return !this.hasAnyCollections && !this.hasEditPermissions;
5948
6010
  }
5949
6011
  get canCreateCollections() {
5950
6012
  return this.config.termConfig.canCreateCollection;
@@ -5953,101 +6015,129 @@ class TldTermCollectionsService {
5953
6015
  var _a;
5954
6016
  return ((_a = this.config) === null || _a === void 0 ? void 0 : _a.coreConfig.isAuth) && this.canCreateCollections && this.config.termConfig.isTermPortalSupported;
5955
6017
  }
5956
- get hasAnyCollections() {
5957
- return this._hasAnyCollections;
6018
+ get isRefreshingCollections() {
6019
+ return this._isRefreshingCollections;
5958
6020
  }
5959
- get shouldShowPromotion() {
5960
- return !this.hasAnyCollections && !this.hasEditPermissions;
6021
+ get collections() {
6022
+ return this._collections;
5961
6023
  }
5962
- onMenuOpen() {
5963
- this.menuOpened = true;
5964
- if (!this.shouldShowPromotion) {
5965
- this.startAutoRefresh();
6024
+ setEngine(engineId, languages = null, setSelectedFromLocalStorage = false) {
6025
+ // engine is already set with that ID and no need to refresh it.
6026
+ if (engineId !== this.engineId || JSON.stringify(languages) !== JSON.stringify(this.engineLanguages)) {
6027
+ this.engineLanguages = languages;
6028
+ this.engineId = engineId;
6029
+ this._collections = new Set();
6030
+ this.emitDataUpdateEvent();
6031
+ // avoiding setter, so the null value is not storeed in location since it is not by user action
6032
+ this._selected = null;
6033
+ }
6034
+ if (this.engineId) {
6035
+ this.refreshCollections(setSelectedFromLocalStorage, true);
5966
6036
  }
6037
+ return this.onDataUpdate.asObservable();
5967
6038
  }
5968
- onMenuClose() {
5969
- var _a;
5970
- this.menuOpened = false;
5971
- // if menu is closed, but selected collection still syncing, auto refresh should be kept opened.
5972
- if (((_a = this.selected) === null || _a === void 0 ? void 0 : _a.mtStatus) !== MtCollectionStatus.PROCESSING) {
5973
- this.stopAutoRefresh();
6039
+ refreshCollections(setSelectedFromLocalStorage = false, initialRefresh = false) {
6040
+ if (!this.engineId || !this.config.termConfig.isCollectionsActivated || this.isRefreshingCollections) {
6041
+ return;
5974
6042
  }
6043
+ // clear timeout since this refresh replaces scheduled
6044
+ this.clearTimeout();
6045
+ this._isRefreshingCollections = true;
6046
+ let termResponse;
6047
+ let mtApiResponse;
6048
+ const observables = [
6049
+ this.termApi.getCollectionList(this.engineLanguages)
6050
+ .pipe(tap((response) => termResponse = response)),
6051
+ this.mtApi.getList(this.engineId)
6052
+ .pipe(tap((response) => mtApiResponse = response)),
6053
+ ];
6054
+ forkJoin(observables).subscribe({
6055
+ // do not need response becaue responses are saved in pipe methods
6056
+ next: () => {
6057
+ this.isAnyImporting = false;
6058
+ // note that termResponse and mtapiresponse gets changed during remove method
6059
+ this.removeDeleted(termResponse, mtApiResponse, initialRefresh);
6060
+ this.addCollections([...mtApiResponse, ...termResponse], initialRefresh);
6061
+ if (setSelectedFromLocalStorage) {
6062
+ this.setSelectedFromLocalStorage();
6063
+ }
6064
+ this._isRefreshingCollections = false;
6065
+ this.scheduleRefresh();
6066
+ },
6067
+ error: (error) => {
6068
+ this._isRefreshingCollections = false;
6069
+ // it is enough to show error only in console. No special thing is necessary.
6070
+ console.error(error);
6071
+ },
6072
+ });
5975
6073
  }
5976
- addCollectionToSystem(collection) {
5977
- if (!collection || !collection.termId) {
6074
+ addToEngine(collection) {
6075
+ if (!collection || !collection.termCollection) {
5978
6076
  console.error("Trying to attach collection that has no tilde term id.");
5979
6077
  return;
5980
6078
  }
5981
- collection.mtStatus = MtCollectionStatus.PROCESSING;
5982
- collection.isSynchronized = true;
5983
- this.mtApi.attachTermsFromTildeTerm(this.activeSystemId, collection.termId)
5984
- .subscribe(() => { }, () => {
5985
- collection.mtStatus = MtCollectionStatus.ERROR;
5986
- collection.errorKey = ErrorCode.COLLECTION_IMPORT;
6079
+ // collection.mtStatus = MtCollectionStatus.PROCESSING;
6080
+ // collection.isSynchronized = true;
6081
+ this.mtApi.add(this.engineId, collection)
6082
+ .subscribe({
6083
+ error: () => {
6084
+ // collection.mtStatus = MtCollectionStatus.ERROR;
6085
+ // collection.errorKey = ErrorCode.COLLECTION_IMPORT;
6086
+ }
5987
6087
  });
5988
6088
  }
5989
- create(defaultLanguages, collectionName) {
5990
- return this.termApi.createCollection(defaultLanguages, collectionName).pipe(map(collection => new TldConvertedCollection(collection, this.sourceLanguageCode, this.targetLanguageCode)), tap((collection) => {
6089
+ create(sourceLanguage, targetLanguage, collectionName, redirectToEdit = true) {
6090
+ return this.termApi.createCollection([sourceLanguage, targetLanguage], collectionName).pipe(tap((collection) => {
6091
+ if (redirectToEdit) {
6092
+ window.open(this.termApi.getEditLink(collection.termCollection.id, sourceLanguage, targetLanguage), "_blank");
6093
+ }
5991
6094
  this._collections.add(collection);
6095
+ this.emitDataUpdateEvent();
5992
6096
  this._hasAnyCollections = true;
5993
6097
  }));
5994
6098
  }
5995
- refreshCollections(setSelectedFromLocalStorage = false) {
5996
- if (!this.activeSystemId
5997
- || !this.config.termConfig.isCollectionsActivated) {
5998
- return;
6099
+ updateIfNecessary(collection) {
6100
+ // collection is not imported and should be attached to engine
6101
+ if (collection.isEdited()) {
6102
+ this.mtApi.add(this.engineId, collection).subscribe((updatedCollection) => {
6103
+ collection.update(updatedCollection);
6104
+ });
5999
6105
  }
6000
- this._isRefreshingCollections = true;
6001
- const observables = [
6002
- this.termApi.getCollectionList(this.sourceLanguageCode, this.targetLanguageCode),
6003
- this.mtApi.loadMTCollections(this.activeSystemId, this.sourceLanguageCode, this.targetLanguageCode)
6004
- ];
6005
- forkJoin(observables).subscribe((response) => {
6006
- this.isAnyImporting = false;
6007
- // TO DO. Doesn't seem to be clean approach with syncing collections. Maybe some cleaner solution possible?
6008
- this.removeDeletedFromTerms(response[0]);
6009
- this.updateCollections([...response[0], ...response[1]]);
6010
- if (setSelectedFromLocalStorage) {
6011
- this.setSelectedFromLocalStorage();
6012
- }
6013
- this._isRefreshingCollections = false;
6014
- this.scheduleRefresh();
6015
- }, (error) => {
6016
- this._isRefreshingCollections = false;
6017
- // it is enough to show error only in console. No special thing is necessary.
6018
- console.error(error);
6019
- });
6020
6106
  }
6021
6107
  /**
6022
- *
6023
- * @returns selected collection id if it is allowed to use collection for translations
6024
- */
6108
+ *
6109
+ * @returns selected collection id if it is allowed to use collection for translations
6110
+ */
6025
6111
  selectedIdForTranslation() {
6026
- if (this.selected && (this.selected.mtPreparedDateTime || this.selected.mtStatus === MtCollectionStatus.READY)) {
6027
- return this.selected.id;
6112
+ var _a, _b, _c;
6113
+ if (((_a = this.selected) === null || _a === void 0 ? void 0 : _a.mtCollection) && (this.selected.mtCollection.lastUpdated || ((_b = this.selected.mtCollection) === null || _b === void 0 ? void 0 : _b.status) === MtCollectionStatus.READY)) {
6114
+ return (_c = this.selected.mtCollection) === null || _c === void 0 ? void 0 : _c.id;
6028
6115
  }
6029
6116
  return null;
6030
6117
  }
6031
- startAutoRefresh() {
6032
- this.isAutoRefreshingOn = true;
6033
- this.scheduleRefresh(0);
6118
+ startAutoRefresh(engineId, languages = null, setSelectedFromLocalStorage = false) {
6119
+ this.hardAutoRefresh = true;
6120
+ return this.setEngine(engineId !== null && engineId !== void 0 ? engineId : this.engineId, languages !== null && languages !== void 0 ? languages : this.engineLanguages, setSelectedFromLocalStorage);
6034
6121
  }
6035
6122
  stopAutoRefresh() {
6036
- if (this.refreshTimeout) {
6037
- clearTimeout(this.refreshTimeout);
6038
- this.refreshTimeout = null;
6039
- }
6040
- this.isAutoRefreshingOn = false;
6123
+ this.clearTimeout();
6124
+ this.isSoftAutoRefreshOn = false;
6125
+ this.hardAutoRefresh = false;
6126
+ }
6127
+ removeMtCollection(collection, engineId = this.engineId) {
6128
+ return this.mtApi.remove(engineId, collection).pipe(tap((response) => {
6129
+ collection.update(response);
6130
+ }));
6041
6131
  }
6042
6132
  scheduleRefresh(timeout) {
6043
6133
  var _a, _b;
6044
6134
  // if menu is closed and selected collection is not importing anymore - auto refreshing should be cancelled.
6045
- if (!this.menuOpened && !((_a = this.selected) === null || _a === void 0 ? void 0 : _a.isImporting) && this.isAutoRefreshingOn) {
6135
+ if (!this.hardAutoRefresh && !((_a = this.selected) === null || _a === void 0 ? void 0 : _a.isImporting) && this.isSoftAutoRefreshOn) {
6046
6136
  this.stopAutoRefresh();
6047
6137
  return;
6048
6138
  }
6049
- // if menu is opened, auto refresh should be on. If menu is closed, refresh needs to be done only if selected is importing.
6050
- if (!this.refreshTimeout && (this.isAutoRefreshingOn || ((_b = this.selected) === null || _b === void 0 ? void 0 : _b.isImporting))) {
6139
+ // if hard auto refresho on, auto refresh should be on. If hard autoreferesh is off , refresh needs to be done only if selected is importing.
6140
+ if (this.hardAutoRefresh || (!this.refreshTimeout && (this.isSoftAutoRefreshOn || ((_b = this.selected) === null || _b === void 0 ? void 0 : _b.isImporting)))) {
6051
6141
  const timeoutMs = timeout !== null && timeout !== void 0 ? timeout : (this.isAnyImporting ? this.config.termConfig.refreshTimeoutMsWhenImporting : this.config.termConfig.refreshTimeoutMs);
6052
6142
  this.refreshTimeout = setTimeout(() => {
6053
6143
  this.refreshTimeout = null;
@@ -6056,61 +6146,82 @@ class TldTermCollectionsService {
6056
6146
  }
6057
6147
  }
6058
6148
  /**
6059
- * Should be called after refresh to check if there is any collections from term api that are deleted.
6149
+ *
6150
+ * @param newCollections
6151
+ * @param initialRefresh Whether also editable collection fields should be updated. If not initial refresh, editable fields will not be updated.
6060
6152
  */
6061
- removeDeletedFromTerms(refreshedList) {
6062
- for (const collection of this.collections) {
6063
- if (!collection.termId) {
6064
- continue;
6065
- }
6066
- const exists = refreshedList.find(refreshedCollection => refreshedCollection.importedFrom === ConvertedCollectionType.Term && refreshedCollection.termId === collection.termId);
6067
- if (!exists) {
6068
- // Removes collection if it hasn't been imported.
6069
- if (!collection.id) {
6070
- this.collections.delete(collection);
6071
- }
6072
- else {
6073
- collection.deletedFromTermApi();
6074
- }
6075
- }
6076
- }
6077
- }
6078
- updateCollections(refreshedCollections) {
6153
+ addCollections(newCollections, initialRefresh) {
6154
+ var _a, _b;
6079
6155
  // sets collection list to this value at the end, so deleted collections are not in the list.
6080
- const updatedCollections = new Set();
6081
- for (let collection of refreshedCollections) {
6156
+ for (let collection of newCollections) {
6082
6157
  // User shouldn't see failed collections if he can't retry to import them.
6083
6158
  if (!this.hasEditPermissions
6084
- && collection.importedFrom === ConvertedCollectionType.MT
6085
6159
  && collection.mtStatus === MtCollectionStatus.ERROR) {
6086
6160
  continue;
6087
6161
  }
6088
6162
  if (collection.isImporting) {
6089
6163
  this.isAnyImporting = true;
6090
6164
  }
6091
- let existing = TldConvertedCollection.findExistingCollectionFromList(this.collections, collection);
6092
- // Term Id should be set only for entities coming from term API, because collection can be deleted, but key would still be in MT api.
6093
- // But term id is necessary to do the previous check to sync collections - it can be set to null only after update.
6094
- if (collection.importedFrom === ConvertedCollectionType.MT) {
6095
- // Collections from MT should be only visible when Ready or collection is being processed, but it has already been created before and it can be used.
6096
- if (!(collection.mtStatus === MtCollectionStatus.READY
6097
- || (collection.mtStatus === MtCollectionStatus.PROCESSING && collection.mtPreparedDateTime)
6098
- || existing)) {
6165
+ let existing = CombinedCollection.findExistingCollectionFromList(this.collections, collection);
6166
+ // If term api doesn't have engine languages, collection should not be shown (if it is not already imported somehow);
6167
+ if (!existing && collection.source === EngineTermCollectionSource.TILDE_TERM) {
6168
+ let hasLanguages = true;
6169
+ for (let i = 0; i < ((_a = this.engineLanguages) === null || _a === void 0 ? void 0 : _a.length); i++) {
6170
+ if (!((_b = collection.termCollection.languages) === null || _b === void 0 ? void 0 : _b.find(lang => lang.id === this.engineLanguages[i]))) {
6171
+ hasLanguages = false;
6172
+ break;
6173
+ }
6174
+ }
6175
+ if (!hasLanguages) {
6099
6176
  continue;
6100
6177
  }
6101
- collection.termId = null;
6102
6178
  }
6103
- if (existing) {
6104
- existing.update(collection);
6179
+ if (!existing) {
6180
+ this._collections.add(collection);
6105
6181
  }
6106
6182
  else {
6107
- this.collections.add(collection);
6183
+ existing.update(collection, initialRefresh);
6108
6184
  }
6109
- const editedCollection = existing !== null && existing !== void 0 ? existing : collection;
6110
- updatedCollections.add(editedCollection);
6111
6185
  }
6112
- this._collections = updatedCollections;
6113
- this._hasAnyCollections = updatedCollections.size > 0;
6186
+ // this._collections = updatedCollections;
6187
+ this.emitDataUpdateEvent();
6188
+ this._hasAnyCollections = this._collections.size > 0;
6189
+ }
6190
+ /**
6191
+ * Should be called after refresh to check if there is any collections from api that are deleted.
6192
+ */
6193
+ removeDeleted(termResponse, mtResponse, initialRefresh) {
6194
+ for (const collection of this.collections) {
6195
+ const termExistingIx = CombinedCollection.findExistingIndexFromList(termResponse, collection);
6196
+ const mtExistingIx = CombinedCollection.findExistingIndexFromList(mtResponse, collection);
6197
+ if (termExistingIx === null && mtExistingIx === null) {
6198
+ this.collections.delete(collection);
6199
+ }
6200
+ else {
6201
+ if (termExistingIx !== null) {
6202
+ const existing = termResponse[termExistingIx];
6203
+ collection.update(existing, initialRefresh);
6204
+ termResponse.splice(termExistingIx, 1);
6205
+ }
6206
+ else {
6207
+ collection.deleteTerms();
6208
+ }
6209
+ if (mtExistingIx !== null) {
6210
+ const existing = mtResponse[mtExistingIx];
6211
+ collection.update(existing, initialRefresh);
6212
+ mtResponse.splice(mtExistingIx, 1);
6213
+ }
6214
+ else {
6215
+ collection.deleteMT();
6216
+ }
6217
+ }
6218
+ }
6219
+ }
6220
+ clearTimeout() {
6221
+ if (this.refreshTimeout) {
6222
+ clearTimeout(this.refreshTimeout);
6223
+ this.refreshTimeout = null;
6224
+ }
6114
6225
  }
6115
6226
  setSelectedFromLocalStorage() {
6116
6227
  var _a, _b;
@@ -6118,20 +6229,20 @@ class TldTermCollectionsService {
6118
6229
  if (((_a = this.collections) === null || _a === void 0 ? void 0 : _a.size) === 0 || this.selected) {
6119
6230
  return;
6120
6231
  }
6121
- const storedId = (_b = this.readLocalStorage()) === null || _b === void 0 ? void 0 : _b[this.activeSystemId];
6232
+ const storedId = (_b = this.readLocalStorage()) === null || _b === void 0 ? void 0 : _b[this.engineId];
6122
6233
  if (!storedId) {
6123
6234
  return;
6124
6235
  }
6125
- const existing = Array.from(this.collections).find(item => item.id === storedId || item.termId === storedId);
6236
+ const existing = Array.from(this.collections).find(item => { var _a, _b; return ((_a = item.termCollection) === null || _a === void 0 ? void 0 : _a.id) === storedId || ((_b = item.mtCollection) === null || _b === void 0 ? void 0 : _b.id) === storedId; });
6126
6237
  this.selected = existing;
6127
6238
  }
6128
6239
  storeSelectedInLocalStorage() {
6129
- var _a;
6240
+ var _a, _b, _c;
6130
6241
  let localStorageObject = this.readLocalStorage();
6131
6242
  if (!localStorageObject) {
6132
6243
  localStorageObject = {};
6133
6244
  }
6134
- localStorageObject[this.activeSystemId] = this.selected ? ((_a = this.selected.termId) !== null && _a !== void 0 ? _a : this.selected.id) : null;
6245
+ localStorageObject[this.engineId] = this.selected ? ((_b = (_a = this.selected.termCollection) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : (_c = this.selected.mtCollection) === null || _c === void 0 ? void 0 : _c.id) : null;
6135
6246
  // store term id if it exists
6136
6247
  localStorage.setItem(this.LOCAL_STORAGE_KEY, JSON.stringify(localStorageObject));
6137
6248
  }
@@ -6144,21 +6255,29 @@ class TldTermCollectionsService {
6144
6255
  return null;
6145
6256
  }
6146
6257
  }
6258
+ emitDataUpdateEvent() {
6259
+ this.onDataUpdate.next(this.collections);
6260
+ }
6147
6261
  }
6148
- TldTermCollectionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionsService, deps: [{ token: TldTranslateConfigService }, { token: TldSystemService }, { token: TermApiService }, { token: MtCollectionsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
6149
- TldTermCollectionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionsService, providedIn: 'root' });
6150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionsService, decorators: [{
6262
+ TerminologyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, deps: [{ token: TldTranslateConfigService }, { token: TermApiService }, { token: MT_TERM_API_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
6263
+ TerminologyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, providedIn: 'root' });
6264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, decorators: [{
6151
6265
  type: Injectable,
6152
6266
  args: [{
6153
6267
  providedIn: 'root'
6154
6268
  }]
6155
- }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: TldSystemService }, { type: TermApiService }, { type: MtCollectionsApiService }]; } });
6269
+ }], ctorParameters: function () {
6270
+ return [{ type: TldTranslateConfigService }, { type: TermApiService }, { type: undefined, decorators: [{
6271
+ type: Inject,
6272
+ args: [MT_TERM_API_TOKEN]
6273
+ }] }];
6274
+ } });
6156
6275
 
6157
6276
  class TldTranslateFileApiService {
6158
- constructor(http, config, collectionService, alerts) {
6277
+ constructor(http, config, terminologyService, alerts) {
6159
6278
  this.http = http;
6160
6279
  this.config = config;
6161
- this.collectionService = collectionService;
6280
+ this.terminologyService = terminologyService;
6162
6281
  this.alerts = alerts;
6163
6282
  this._segmentLimit = -1;
6164
6283
  this._sourceDownloadStatusses = [TranslationStatuss.WAITING, TranslationStatuss.SAVING, TranslationStatuss.COMPLETED, TranslationStatuss.TRANSLATING];
@@ -6192,11 +6311,11 @@ class TldTranslateFileApiService {
6192
6311
  segmentLimit: this._segmentLimit,
6193
6312
  ocrPageLimit: this.config.fileConfig.ocrPageLimit
6194
6313
  };
6195
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
6314
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
6196
6315
  if (selectedCollectionId) {
6197
6316
  params.termCorpusId = selectedCollectionId;
6198
6317
  }
6199
- return this.http.post(url, params, { headers }).pipe(map((response) => {
6318
+ return this.http.post(url, params, { headers }).pipe(map$1((response) => {
6200
6319
  if (response.success) {
6201
6320
  const error = { ErrorCode: ErrorCode.CANT_START_FILE_TRANSLATION };
6202
6321
  this.alerts.unhandeledError(error);
@@ -6223,7 +6342,7 @@ class TldTranslateFileApiService {
6223
6342
  const formData = new FormData();
6224
6343
  formData.append("file", file.file);
6225
6344
  return this.http.post(url, formData, { headers: new HttpHeaders(headers), reportProgress: true, observe: "events" })
6226
- .pipe(map((response) => {
6345
+ .pipe(map$1((response) => {
6227
6346
  const returnvalue = {};
6228
6347
  if (response.type === HttpEventType.Response) {
6229
6348
  const body = response.body;
@@ -6246,7 +6365,7 @@ class TldTranslateFileApiService {
6246
6365
  getStatus(properties) {
6247
6366
  const methodName = "GetStatus";
6248
6367
  const url = this.config.fileConfig.fileApiUrl + methodName;
6249
- return this.http.post(url, { docId: properties.file.id }, { headers: this.getAuthHeaders() }).pipe(map((response) => {
6368
+ return this.http.post(url, { docId: properties.file.id }, { headers: this.getAuthHeaders() }).pipe(map$1((response) => {
6250
6369
  var _a;
6251
6370
  if (typeof (response) == 'string') {
6252
6371
  const error = { ErrorCode: response };
@@ -6302,82 +6421,45 @@ class TldTranslateFileApiService {
6302
6421
  return Common.getAuthHeaders(this.config);
6303
6422
  }
6304
6423
  }
6305
- TldTranslateFileApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }, { token: TldTermCollectionsService }, { token: TldAlertService }], target: i0.ɵɵFactoryTarget.Injectable });
6424
+ TldTranslateFileApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }, { token: TerminologyService }, { token: TldAlertService }], target: i0.ɵɵFactoryTarget.Injectable });
6306
6425
  TldTranslateFileApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, providedIn: 'root' });
6307
6426
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, decorators: [{
6308
6427
  type: Injectable,
6309
6428
  args: [{
6310
6429
  providedIn: 'root'
6311
6430
  }]
6312
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TldTermCollectionsService }, { type: TldAlertService }]; } });
6313
-
6314
- class TldTermCreateCollectionDialogComponent {
6315
- constructor(dialogRef, data, config) {
6316
- this.dialogRef = dialogRef;
6317
- this.data = data;
6318
- this.config = config;
6319
- }
6320
- ngOnInit() {
6321
- this.minLength = this.config.termConfig.collectionNameMinLength;
6322
- this.maxLength = this.config.termConfig.collectionNameMaxLength;
6323
- this.collectionName = new UntypedFormControl(this.data.collectionName, [
6324
- Validators.minLength(this.minLength),
6325
- Validators.maxLength(this.maxLength),
6326
- Validators.required
6327
- ]);
6328
- this.collectionName.markAsTouched();
6329
- this.formGroup = new UntypedFormGroup({ collectionName: this.collectionName });
6330
- }
6331
- submit() {
6332
- if (this.formGroup.valid) {
6333
- this.dialogRef.close(this.collectionName.value);
6334
- }
6335
- }
6336
- }
6337
- TldTermCreateCollectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Component });
6338
- TldTermCreateCollectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCreateCollectionDialogComponent, selector: "tld-term-create-collection-dialog", ngImport: i0, template: "<tld-close-button class=\"close-button\" mat-dialog-close>\r\n</tld-close-button>\r\n<h1 mat-dialog-title>{{'TERM_COLLECTIONS.CREATE_DIALOG.TITLE' | translate}}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_1' | translate\"></p>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_2' | translate\"></p>\r\n <div [formGroup]=\"formGroup\">\r\n <mat-form-field appearance=\"outline\" class=\"collection-name-form-field\">\r\n <mat-label>{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_LABEL' | translate}}</mat-label>\r\n <input matInput formControlName=\"collectionName\" (keyup.enter)=\"submit()\">\r\n <mat-error *ngIf=\"collectionName.errors\">{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_ERROR' |\r\n translate: {minLength: minLength, maxLength: maxLength} }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"center center\">\r\n <button mat-flat-button (click)=\"submit()\" cdkFocusInitial color=\"accent\"\r\n [disabled]=\"formGroup.invalid\">{{'TERM_COLLECTIONS.CREATE_DIALOG.CREATE' | translate}}</button>\r\n <button mat-button mat-dialog-close color=\"accent\">{{\"TERM_COLLECTIONS.CREATE_DIALOG.CANCEL\" | translate}}</button>\r\n</div>\r\n", styles: ["input{outline:none!important}:host ::ng-deep .mat-form-field-appearance-outline:hover .mat-form-field-outline,:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,:host ::ng-deep .mat-form-field.mat-focused .mat-form-field-label{color:#ad234a}.create-dialog-wrapper{position:relative}.close-button{position:absolute;right:1em;top:1em}\n"], dependencies: [{ kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i12.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
6339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, decorators: [{
6340
- type: Component,
6341
- args: [{ selector: 'tld-term-create-collection-dialog', template: "<tld-close-button class=\"close-button\" mat-dialog-close>\r\n</tld-close-button>\r\n<h1 mat-dialog-title>{{'TERM_COLLECTIONS.CREATE_DIALOG.TITLE' | translate}}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_1' | translate\"></p>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_2' | translate\"></p>\r\n <div [formGroup]=\"formGroup\">\r\n <mat-form-field appearance=\"outline\" class=\"collection-name-form-field\">\r\n <mat-label>{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_LABEL' | translate}}</mat-label>\r\n <input matInput formControlName=\"collectionName\" (keyup.enter)=\"submit()\">\r\n <mat-error *ngIf=\"collectionName.errors\">{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_ERROR' |\r\n translate: {minLength: minLength, maxLength: maxLength} }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"center center\">\r\n <button mat-flat-button (click)=\"submit()\" cdkFocusInitial color=\"accent\"\r\n [disabled]=\"formGroup.invalid\">{{'TERM_COLLECTIONS.CREATE_DIALOG.CREATE' | translate}}</button>\r\n <button mat-button mat-dialog-close color=\"accent\">{{\"TERM_COLLECTIONS.CREATE_DIALOG.CANCEL\" | translate}}</button>\r\n</div>\r\n", styles: ["input{outline:none!important}:host ::ng-deep .mat-form-field-appearance-outline:hover .mat-form-field-outline,:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,:host ::ng-deep .mat-form-field.mat-focused .mat-form-field-label{color:#ad234a}.create-dialog-wrapper{position:relative}.close-button{position:absolute;right:1em;top:1em}\n"] }]
6342
- }], ctorParameters: function () {
6343
- return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
6344
- type: Inject,
6345
- args: [MAT_DIALOG_DATA]
6346
- }] }, { type: TldTranslateConfigService }];
6347
- } });
6431
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TerminologyService }, { type: TldAlertService }]; } });
6348
6432
 
6349
6433
  class TldTermCollectionListComponent {
6350
- constructor(collectionService, config, tldSystem, dialog, translate, alerts) {
6351
- this.collectionService = collectionService;
6434
+ constructor(terminologyService, config, tldSystem, termApiService) {
6435
+ this.terminologyService = terminologyService;
6352
6436
  this.config = config;
6353
6437
  this.tldSystem = tldSystem;
6354
- this.dialog = dialog;
6355
- this.translate = translate;
6356
- this.alerts = alerts;
6438
+ this.termApiService = termApiService;
6357
6439
  this.localizationKey = "TERM_COLLECTIONS.";
6358
6440
  this.tooltipLocalizationKey = "TERM_COLLECTIONS.TOOLTIPS.";
6359
6441
  this.readyStatus = "Ready";
6360
6442
  this.collectionErrorStatus = MtCollectionStatus.ERROR;
6361
6443
  }
6362
6444
  get selected() {
6363
- return this.collectionService.selected;
6445
+ return this.terminologyService.selected;
6364
6446
  }
6365
6447
  set selected(val) {
6366
- this.collectionService.selected = val;
6448
+ this.terminologyService.selected = val;
6367
6449
  }
6368
6450
  get collections() {
6369
6451
  var _a;
6370
- return (_a = this.collectionService) === null || _a === void 0 ? void 0 : _a.collections;
6452
+ return (_a = this.terminologyService) === null || _a === void 0 ? void 0 : _a.collections;
6371
6453
  }
6372
6454
  get hasAnyCollections() {
6373
- return this.collectionService.hasAnyCollections;
6455
+ return this.terminologyService.hasAnyCollections;
6374
6456
  }
6375
6457
  get isRefreshingCollections() {
6376
6458
  var _a;
6377
- return (_a = this.collectionService) === null || _a === void 0 ? void 0 : _a.isRefreshingCollections;
6459
+ return (_a = this.terminologyService) === null || _a === void 0 ? void 0 : _a.isRefreshingCollections;
6378
6460
  }
6379
6461
  get hasEditPermissions() {
6380
- return this.collectionService.hasEditPermissions;
6462
+ return this.terminologyService.hasEditPermissions;
6381
6463
  }
6382
6464
  get appName() {
6383
6465
  return this.config.coreConfig.appName;
@@ -6392,42 +6474,19 @@ class TldTermCollectionListComponent {
6392
6474
  this.subscription.unsubscribe();
6393
6475
  }
6394
6476
  getEditLink(collection) {
6395
- return `${this.config.termConfig.apiUrl}/collections/${collection.termId}/mt/${this.sourceLanguageCode}/${this.targetLanguageCode}`;
6396
- }
6397
- createNew() {
6398
- const localizationKey = "TERM_COLLECTIONS.DEFAULT_COLLECTION_NAME";
6399
- this.translate.get(localizationKey).subscribe((collectionName) => {
6400
- const dialogRef = this.dialog.open(TldTermCreateCollectionDialogComponent, {
6401
- minWidth: '300px',
6402
- maxWidth: '700px',
6403
- data: { collectionName: collectionName }
6404
- });
6405
- dialogRef.afterClosed().subscribe(collectionName => {
6406
- if (!collectionName) {
6407
- return;
6408
- }
6409
- const languages = [this.sourceLanguageCode, this.targetLanguageCode];
6410
- this.collectionService.create(languages, collectionName).subscribe((collection) => {
6411
- window.open(this.getEditLink(collection), "_blank");
6412
- }, (err) => {
6413
- console.error(err);
6414
- const error = { ErrorCode: ErrorCode.COLLECTION_CREATE };
6415
- this.alerts.unhandeledError(error);
6416
- throw error;
6417
- });
6418
- });
6419
- });
6477
+ var _a;
6478
+ return this.termApiService.getEditLink((_a = collection.termCollection) === null || _a === void 0 ? void 0 : _a.id, this.sourceLanguageCode, this.targetLanguageCode);
6420
6479
  }
6421
6480
  attach(collection) {
6422
- this.collectionService.addCollectionToSystem(collection);
6481
+ this.terminologyService.addToEngine(collection);
6423
6482
  }
6424
6483
  }
6425
- TldTermCollectionListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionListComponent, deps: [{ token: TldTermCollectionsService }, { token: TldTranslateConfigService }, { token: TldSystemService }, { token: i1$2.MatDialog }, { token: i1$1.TranslateService }, { token: TldAlertService }], target: i0.ɵɵFactoryTarget.Component });
6426
- TldTermCollectionListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCollectionListComponent, selector: "tld-term-collection-list", ngImport: i0, template: "<header class=\"tld-collection-list-header\">\r\n <ng-container *ngIf=\"hasAnyCollections\">\r\n <h1 class=\"term-window-title\">\r\n <span fxHide.lt-sm>{{localizationKey + 'TITLE' | translate}}</span>\r\n <span fxHide.gt-xs>{{localizationKey + 'TITLE_MOBILE' | translate}}</span>\r\n </h1>\r\n <p class=\"term-window-description\">\r\n <span>{{localizationKey + 'DESCRIPTION_1' | translate}}</span>\r\n <span fxHide.lt-sm *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2' | translate}}</span>\r\n <span fxHide.gt-xs *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2_MOBILE' | translate}}</span>\r\n </p>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasAnyCollections\">\r\n <h1 class=\"term-window-title\">{{localizationKey + 'TITLE_EMPTY' | translate}}</h1>\r\n <p class=\"term-window-description\" fxHide.lt-sm>{{localizationKey + 'DESCRIPTION_EMPTY' | translate: {appName: appName} }}</p>\r\n <p class=\"term-window-description\" fxHide.gt-xs>{{localizationKey + 'DESCRIPTION_EMPTY_MOBILE' | translate: {appName: appName} }}</p>\r\n </ng-container>\r\n</header>\r\n<div *ngIf=\"hasAnyCollections\" class=\"tld-collection-list-body\">\r\n <mat-radio-group [attr.aria-label]=\"localizationKey + 'ARIA_LABELS.RADIO_GROUP' | translate\"\r\n [(ngModel)]=\"selected\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\r\n <mat-radio-button [value]=\"null\">\r\n {{localizationKey + 'SELECTED_NONE' | translate}}\r\n </mat-radio-button>\r\n </div>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" *ngFor=\"let collection of collections\"\r\n [matTooltip]=\"collection.tooltipKey? (tooltipLocalizationKey + collection.tooltipKey | translate) : ''\">\r\n <mat-radio-button [value]=\"collection\" fxFlex\r\n [disabled]=\"collection.termId !== null && collection.entryCount<=0\" fxLayoutAlign=\"center center\">\r\n <span class=\"collection-label\" [matTooltip]=\"collection.tooltipKey? '' : collection.title\">\r\n {{collection.title}}</span>\r\n <span class=\"collection-label entries-count-label\"\r\n *ngIf=\"collection.entryCount!==undefined && !collection.mtAttachmentDateTime\"\r\n [matTooltip]=\"collection.tooltipKey? '' : (tooltipLocalizationKey+'ENTRY_COUNT' | translate)\">\r\n {{localizationKey + (collection.languagesString?'ENTRY_COUNT_WITH_LANGUGAES':'ENTRY_COUNT') |\r\n translate: {count: collection.entryCount, languages: collection.languagesString} }}\r\n </span>\r\n\r\n <span class=\"collection-label entries-count-label\"\r\n *ngIf=\"collection.mtEntryCount!==undefined && collection.mtAttachmentDateTime\"\r\n [matTooltip]=\"collection.tooltipKey? '' : (tooltipLocalizationKey+'MT_ENTRY_COUNT' | translate)\">\r\n {{localizationKey + ('MT_ENTRY_COUNT') |\r\n translate: {count: collection.mtEntryCount} }}\r\n </span>\r\n </mat-radio-button>\r\n\r\n <span *ngIf=\" collection.mtStatus === collectionErrorStatus\" color=\"accent\" class=\"material-icons\"\r\n [matTooltip]=\"(collection.errorKey? 'ERRORS.'+collection.errorKey : tooltipLocalizationKey + 'ATTACH_TO_SYSTEM_ERROR') | translate: { termId: collection.termId} \">\r\n error\r\n </span>\r\n\r\n <mat-spinner color=\"accent\" diameter=\"20\" *ngIf=\"collection.isImporting\"></mat-spinner>\r\n <ng-container *ngIf=\"hasEditPermissions\">\r\n <button mat-button *ngIf=\"collection.syncButtonVissible\" (click)=\"attach(collection)\" color=\"primary\"\r\n [matTooltip]=\"tooltipLocalizationKey + 'SYNC' | translate\" [disabled]=\"collection.isImporting\">\r\n {{localizationKey + (collectionErrorStatus === collection.mtStatus? 'SYNC_ERROR': 'SYNC') | translate}}\r\n </button>\r\n <a mat-button color=\"accent\" target=\"_blank\"\r\n [matTooltip]=\"collection.tooltipKey? '' : (tooltipLocalizationKey + 'EDIT' | translate)\"\r\n [attr.href]=\"getEditLink(collection)\" *ngIf=\"collection.termId\" fxHide.lt-sm>\r\n <span>\r\n {{localizationKey + 'EDIT' | translate}}\r\n </span>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </mat-radio-group>\r\n</div>\r\n<footer class=\"tld-collection-list-footer\" fxLayout=\"row\" *ngIf=\"hasEditPermissions\">\r\n <button mat-flat-button color=\"primary\" (click)=\"createNew()\" fxHide.lt-sm>\r\n {{localizationKey + 'CREATE' | translate}}\r\n </button>\r\n</footer>\r\n", styles: [".tld-collection-list-body,.tld-collection-list-header,.tld-collection-list-footer{padding:1em .75em}.collection-label{display:block;max-width:215px;overflow:hidden;text-overflow:ellipsis}.collection-label.entries-count-label{font-size:small;color:#9aa5b1}:host ::ng-deep .mat-radio-button{overflow:hidden;padding:5px 0}:host ::ng-deep .mat-radio-button .mat-radio-ripple{display:none}:host ::ng-deep .mat-radio-button .mat-radio-label-content{overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "component", type: i13.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
6484
+ TldTermCollectionListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionListComponent, deps: [{ token: TerminologyService }, { token: TldTranslateConfigService }, { token: TldSystemService }, { token: TermApiService }], target: i0.ɵɵFactoryTarget.Component });
6485
+ TldTermCollectionListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCollectionListComponent, selector: "tld-term-collection-list", ngImport: i0, template: "<header class=\"tld-collection-list-header\">\r\n <ng-container *ngIf=\"hasAnyCollections\">\r\n <h1 class=\"term-window-title\">\r\n <span fxHide.lt-sm>{{localizationKey + 'TITLE' | translate}}</span>\r\n <span fxHide.gt-xs>{{localizationKey + 'TITLE_MOBILE' | translate}}</span>\r\n </h1>\r\n <p class=\"term-window-description\">\r\n <span>{{localizationKey + 'DESCRIPTION_1' | translate}}</span>\r\n <span fxHide.lt-sm *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2' | translate}}</span>\r\n <span fxHide.gt-xs *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2_MOBILE' | translate}}</span>\r\n </p>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasAnyCollections\">\r\n <h1 class=\"term-window-title\">{{localizationKey + 'TITLE_EMPTY' | translate}}</h1>\r\n <p class=\"term-window-description\" fxHide.lt-sm>{{localizationKey + 'DESCRIPTION_EMPTY' | translate: {appName:\r\n appName} }}</p>\r\n <p class=\"term-window-description\" fxHide.gt-xs>{{localizationKey + 'DESCRIPTION_EMPTY_MOBILE' | translate:\r\n {appName: appName} }}</p>\r\n </ng-container>\r\n</header>\r\n<div *ngIf=\"hasAnyCollections\" class=\"tld-collection-list-body\">\r\n <mat-radio-group [attr.aria-label]=\"localizationKey + 'ARIA_LABELS.RADIO_GROUP' | translate\" [(ngModel)]=\"selected\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\r\n <mat-radio-button [value]=\"null\">\r\n <span class=\"text-m-semi-bold\">\r\n {{localizationKey + 'SELECTED_NONE' | translate}}\r\n </span>\r\n </mat-radio-button>\r\n </div>\r\n <div class=\"collection\" fxLayout=\"row\" fxLayoutAlign=\"start center\" *ngFor=\"let collection of collections\"\r\n [matTooltip]=\"collection.termTooltipKey? (tooltipLocalizationKey + collection.termTooltipKey | translate) : ''\">\r\n <mat-radio-button [value]=\"collection\" fxFlex [disabled]=\"collection.termId !== null && collection.termEntries<=0\"\r\n fxLayoutAlign=\"center center\">\r\n <span class=\"collection-label text-m-semi-bold\" [matTooltip]=\"collection.termTooltipKey? '' : collection.name\">\r\n {{collection.name}}\r\n </span>\r\n\r\n <span *ngIf=\"collection.lastUpdated\" class=\"collection-label last-updated-label\">\r\n {{ localizationKey + ('LAST_UPDATED') | translate: { date: collection.lastUpdated | date: 'dd.MM.yy\r\n HH:mm' } }}\r\n </span>\r\n </mat-radio-button>\r\n\r\n <span *ngIf=\" collection.mtStatus === collectionErrorStatus\" color=\"accent\" class=\"material-icons\">\r\n error\r\n </span>\r\n\r\n <mat-spinner color=\"accent\" diameter=\"20\" *ngIf=\"collection.isImporting\"></mat-spinner>\r\n <ng-container *ngIf=\"hasEditPermissions\">\r\n <button mat-button *ngIf=\"collection.syncButtonVissible\" (click)=\"attach(collection)\" color=\"primary\"\r\n [matTooltip]=\"tooltipLocalizationKey + 'SYNC' | translate\" [disabled]=\"collection.isImporting\">\r\n {{localizationKey + (collectionErrorStatus === collection.mtStatus? 'SYNC_ERROR': 'SYNC') | translate}}\r\n </button>\r\n <a mat-icon-button target=\"_blank\"\r\n [matTooltip]=\"collection.termTooltipKey? '' : (tooltipLocalizationKey + 'EDIT' | translate)\"\r\n [attr.href]=\"getEditLink(collection)\" *ngIf=\"collection.termCollection\" fxHide.lt-sm>\r\n <mat-icon class=\"material-icons\">edit</mat-icon>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </mat-radio-group>\r\n</div>\r\n", styles: [".tld-collection-list-body,.tld-collection-list-header{padding:1em .75em}.collection-label{display:block;max-width:215px;overflow:hidden;text-overflow:ellipsis}.collection-label.last-updated-label{font-size:small;color:#5a6672}:host ::ng-deep .mat-radio-button{overflow:hidden;padding:5px 0}:host ::ng-deep .mat-radio-button .mat-radio-ripple{display:none}:host ::ng-deep .mat-radio-button .mat-radio-label-content{overflow:hidden}.collection{min-height:70px;border-top:1px solid #cbd2d9}\n"], dependencies: [{ kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "component", type: i13.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i3.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
6427
6486
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionListComponent, decorators: [{
6428
6487
  type: Component,
6429
- args: [{ selector: 'tld-term-collection-list', template: "<header class=\"tld-collection-list-header\">\r\n <ng-container *ngIf=\"hasAnyCollections\">\r\n <h1 class=\"term-window-title\">\r\n <span fxHide.lt-sm>{{localizationKey + 'TITLE' | translate}}</span>\r\n <span fxHide.gt-xs>{{localizationKey + 'TITLE_MOBILE' | translate}}</span>\r\n </h1>\r\n <p class=\"term-window-description\">\r\n <span>{{localizationKey + 'DESCRIPTION_1' | translate}}</span>\r\n <span fxHide.lt-sm *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2' | translate}}</span>\r\n <span fxHide.gt-xs *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2_MOBILE' | translate}}</span>\r\n </p>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasAnyCollections\">\r\n <h1 class=\"term-window-title\">{{localizationKey + 'TITLE_EMPTY' | translate}}</h1>\r\n <p class=\"term-window-description\" fxHide.lt-sm>{{localizationKey + 'DESCRIPTION_EMPTY' | translate: {appName: appName} }}</p>\r\n <p class=\"term-window-description\" fxHide.gt-xs>{{localizationKey + 'DESCRIPTION_EMPTY_MOBILE' | translate: {appName: appName} }}</p>\r\n </ng-container>\r\n</header>\r\n<div *ngIf=\"hasAnyCollections\" class=\"tld-collection-list-body\">\r\n <mat-radio-group [attr.aria-label]=\"localizationKey + 'ARIA_LABELS.RADIO_GROUP' | translate\"\r\n [(ngModel)]=\"selected\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\r\n <mat-radio-button [value]=\"null\">\r\n {{localizationKey + 'SELECTED_NONE' | translate}}\r\n </mat-radio-button>\r\n </div>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" *ngFor=\"let collection of collections\"\r\n [matTooltip]=\"collection.tooltipKey? (tooltipLocalizationKey + collection.tooltipKey | translate) : ''\">\r\n <mat-radio-button [value]=\"collection\" fxFlex\r\n [disabled]=\"collection.termId !== null && collection.entryCount<=0\" fxLayoutAlign=\"center center\">\r\n <span class=\"collection-label\" [matTooltip]=\"collection.tooltipKey? '' : collection.title\">\r\n {{collection.title}}</span>\r\n <span class=\"collection-label entries-count-label\"\r\n *ngIf=\"collection.entryCount!==undefined && !collection.mtAttachmentDateTime\"\r\n [matTooltip]=\"collection.tooltipKey? '' : (tooltipLocalizationKey+'ENTRY_COUNT' | translate)\">\r\n {{localizationKey + (collection.languagesString?'ENTRY_COUNT_WITH_LANGUGAES':'ENTRY_COUNT') |\r\n translate: {count: collection.entryCount, languages: collection.languagesString} }}\r\n </span>\r\n\r\n <span class=\"collection-label entries-count-label\"\r\n *ngIf=\"collection.mtEntryCount!==undefined && collection.mtAttachmentDateTime\"\r\n [matTooltip]=\"collection.tooltipKey? '' : (tooltipLocalizationKey+'MT_ENTRY_COUNT' | translate)\">\r\n {{localizationKey + ('MT_ENTRY_COUNT') |\r\n translate: {count: collection.mtEntryCount} }}\r\n </span>\r\n </mat-radio-button>\r\n\r\n <span *ngIf=\" collection.mtStatus === collectionErrorStatus\" color=\"accent\" class=\"material-icons\"\r\n [matTooltip]=\"(collection.errorKey? 'ERRORS.'+collection.errorKey : tooltipLocalizationKey + 'ATTACH_TO_SYSTEM_ERROR') | translate: { termId: collection.termId} \">\r\n error\r\n </span>\r\n\r\n <mat-spinner color=\"accent\" diameter=\"20\" *ngIf=\"collection.isImporting\"></mat-spinner>\r\n <ng-container *ngIf=\"hasEditPermissions\">\r\n <button mat-button *ngIf=\"collection.syncButtonVissible\" (click)=\"attach(collection)\" color=\"primary\"\r\n [matTooltip]=\"tooltipLocalizationKey + 'SYNC' | translate\" [disabled]=\"collection.isImporting\">\r\n {{localizationKey + (collectionErrorStatus === collection.mtStatus? 'SYNC_ERROR': 'SYNC') | translate}}\r\n </button>\r\n <a mat-button color=\"accent\" target=\"_blank\"\r\n [matTooltip]=\"collection.tooltipKey? '' : (tooltipLocalizationKey + 'EDIT' | translate)\"\r\n [attr.href]=\"getEditLink(collection)\" *ngIf=\"collection.termId\" fxHide.lt-sm>\r\n <span>\r\n {{localizationKey + 'EDIT' | translate}}\r\n </span>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </mat-radio-group>\r\n</div>\r\n<footer class=\"tld-collection-list-footer\" fxLayout=\"row\" *ngIf=\"hasEditPermissions\">\r\n <button mat-flat-button color=\"primary\" (click)=\"createNew()\" fxHide.lt-sm>\r\n {{localizationKey + 'CREATE' | translate}}\r\n </button>\r\n</footer>\r\n", styles: [".tld-collection-list-body,.tld-collection-list-header,.tld-collection-list-footer{padding:1em .75em}.collection-label{display:block;max-width:215px;overflow:hidden;text-overflow:ellipsis}.collection-label.entries-count-label{font-size:small;color:#9aa5b1}:host ::ng-deep .mat-radio-button{overflow:hidden;padding:5px 0}:host ::ng-deep .mat-radio-button .mat-radio-ripple{display:none}:host ::ng-deep .mat-radio-button .mat-radio-label-content{overflow:hidden}\n"] }]
6430
- }], ctorParameters: function () { return [{ type: TldTermCollectionsService }, { type: TldTranslateConfigService }, { type: TldSystemService }, { type: i1$2.MatDialog }, { type: i1$1.TranslateService }, { type: TldAlertService }]; } });
6488
+ args: [{ selector: 'tld-term-collection-list', template: "<header class=\"tld-collection-list-header\">\r\n <ng-container *ngIf=\"hasAnyCollections\">\r\n <h1 class=\"term-window-title\">\r\n <span fxHide.lt-sm>{{localizationKey + 'TITLE' | translate}}</span>\r\n <span fxHide.gt-xs>{{localizationKey + 'TITLE_MOBILE' | translate}}</span>\r\n </h1>\r\n <p class=\"term-window-description\">\r\n <span>{{localizationKey + 'DESCRIPTION_1' | translate}}</span>\r\n <span fxHide.lt-sm *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2' | translate}}</span>\r\n <span fxHide.gt-xs *ngIf=\"hasEditPermissions\">{{localizationKey + 'DESCRIPTION_2_MOBILE' | translate}}</span>\r\n </p>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasAnyCollections\">\r\n <h1 class=\"term-window-title\">{{localizationKey + 'TITLE_EMPTY' | translate}}</h1>\r\n <p class=\"term-window-description\" fxHide.lt-sm>{{localizationKey + 'DESCRIPTION_EMPTY' | translate: {appName:\r\n appName} }}</p>\r\n <p class=\"term-window-description\" fxHide.gt-xs>{{localizationKey + 'DESCRIPTION_EMPTY_MOBILE' | translate:\r\n {appName: appName} }}</p>\r\n </ng-container>\r\n</header>\r\n<div *ngIf=\"hasAnyCollections\" class=\"tld-collection-list-body\">\r\n <mat-radio-group [attr.aria-label]=\"localizationKey + 'ARIA_LABELS.RADIO_GROUP' | translate\" [(ngModel)]=\"selected\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\r\n <mat-radio-button [value]=\"null\">\r\n <span class=\"text-m-semi-bold\">\r\n {{localizationKey + 'SELECTED_NONE' | translate}}\r\n </span>\r\n </mat-radio-button>\r\n </div>\r\n <div class=\"collection\" fxLayout=\"row\" fxLayoutAlign=\"start center\" *ngFor=\"let collection of collections\"\r\n [matTooltip]=\"collection.termTooltipKey? (tooltipLocalizationKey + collection.termTooltipKey | translate) : ''\">\r\n <mat-radio-button [value]=\"collection\" fxFlex [disabled]=\"collection.termId !== null && collection.termEntries<=0\"\r\n fxLayoutAlign=\"center center\">\r\n <span class=\"collection-label text-m-semi-bold\" [matTooltip]=\"collection.termTooltipKey? '' : collection.name\">\r\n {{collection.name}}\r\n </span>\r\n\r\n <span *ngIf=\"collection.lastUpdated\" class=\"collection-label last-updated-label\">\r\n {{ localizationKey + ('LAST_UPDATED') | translate: { date: collection.lastUpdated | date: 'dd.MM.yy\r\n HH:mm' } }}\r\n </span>\r\n </mat-radio-button>\r\n\r\n <span *ngIf=\" collection.mtStatus === collectionErrorStatus\" color=\"accent\" class=\"material-icons\">\r\n error\r\n </span>\r\n\r\n <mat-spinner color=\"accent\" diameter=\"20\" *ngIf=\"collection.isImporting\"></mat-spinner>\r\n <ng-container *ngIf=\"hasEditPermissions\">\r\n <button mat-button *ngIf=\"collection.syncButtonVissible\" (click)=\"attach(collection)\" color=\"primary\"\r\n [matTooltip]=\"tooltipLocalizationKey + 'SYNC' | translate\" [disabled]=\"collection.isImporting\">\r\n {{localizationKey + (collectionErrorStatus === collection.mtStatus? 'SYNC_ERROR': 'SYNC') | translate}}\r\n </button>\r\n <a mat-icon-button target=\"_blank\"\r\n [matTooltip]=\"collection.termTooltipKey? '' : (tooltipLocalizationKey + 'EDIT' | translate)\"\r\n [attr.href]=\"getEditLink(collection)\" *ngIf=\"collection.termCollection\" fxHide.lt-sm>\r\n <mat-icon class=\"material-icons\">edit</mat-icon>\r\n </a>\r\n </ng-container>\r\n </div>\r\n </mat-radio-group>\r\n</div>\r\n", styles: [".tld-collection-list-body,.tld-collection-list-header{padding:1em .75em}.collection-label{display:block;max-width:215px;overflow:hidden;text-overflow:ellipsis}.collection-label.last-updated-label{font-size:small;color:#5a6672}:host ::ng-deep .mat-radio-button{overflow:hidden;padding:5px 0}:host ::ng-deep .mat-radio-button .mat-radio-ripple{display:none}:host ::ng-deep .mat-radio-button .mat-radio-label-content{overflow:hidden}.collection{min-height:70px;border-top:1px solid #cbd2d9}\n"] }]
6489
+ }], ctorParameters: function () { return [{ type: TerminologyService }, { type: TldTranslateConfigService }, { type: TldSystemService }, { type: TermApiService }]; } });
6431
6490
 
6432
6491
  class WtwLinkParamsService {
6433
6492
  constructor(translate) {
@@ -6484,44 +6543,142 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
6484
6543
  args: [{ selector: 'tld-term-promotion', template: "<section class=\"term-promotion-wrapper\" fxLayout=\"column\" fxLayoutGap=\"16px\">\r\n <div>\r\n <h1 class=\"term-window-title\">{{ localizationKey + \"TITLE\" | translate}}</h1>\r\n <p>{{ localizationKey + \"DESCRIPTION\" | translate}}</p>\r\n </div>\r\n <div fxLayoutGap=\"0.75em\" fxLayout.lt-sm=\"column\">\r\n <a [attr.href]=\"trialUrl\" target=\"_blank\" mat-flat-button color=\"primary\">\r\n {{ localizationKey + \"START_TRIAL\" | translate}}\r\n </a>\r\n <a [attr.href]=\"learnMoreUrl\" target=\"_blank\">{{ localizationKey + \"LEARN_MORE\" | translate}}</a>\r\n </div>\r\n</section>", styles: [".term-promotion-wrapper{margin:1em}.term-promotion-wrapper button{width:100%}.term-promotion-wrapper p{margin:0}.term-promotion-wrapper a.mat-flat-button:hover{color:#fff!important}\n"] }]
6485
6544
  }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: WtwLinkParamsService }]; } });
6486
6545
 
6546
+ class TldTermCreateCollectionDialogComponent {
6547
+ constructor(dialogRef, data, config) {
6548
+ this.dialogRef = dialogRef;
6549
+ this.data = data;
6550
+ this.config = config;
6551
+ }
6552
+ ngOnInit() {
6553
+ this.minLength = this.config.termConfig.collectionNameMinLength;
6554
+ this.maxLength = this.config.termConfig.collectionNameMaxLength;
6555
+ this.collectionName = new UntypedFormControl(this.data.collectionName, [
6556
+ Validators.minLength(this.minLength),
6557
+ Validators.maxLength(this.maxLength),
6558
+ Validators.required
6559
+ ]);
6560
+ this.collectionName.markAsTouched();
6561
+ this.formGroup = new UntypedFormGroup({ collectionName: this.collectionName });
6562
+ }
6563
+ submit() {
6564
+ if (this.formGroup.valid) {
6565
+ this.dialogRef.close(this.collectionName.value);
6566
+ }
6567
+ }
6568
+ }
6569
+ TldTermCreateCollectionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Component });
6570
+ TldTermCreateCollectionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCreateCollectionDialogComponent, selector: "tld-term-create-collection-dialog", ngImport: i0, template: "<tld-close-button class=\"close-button\" mat-dialog-close>\r\n</tld-close-button>\r\n<h1 mat-dialog-title>{{'TERM_COLLECTIONS.CREATE_DIALOG.TITLE' | translate}}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_1' | translate\"></p>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_2' | translate\"></p>\r\n <div [formGroup]=\"formGroup\">\r\n <mat-form-field appearance=\"outline\" class=\"collection-name-form-field\">\r\n <mat-label>{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_LABEL' | translate}}</mat-label>\r\n <input matInput formControlName=\"collectionName\" (keyup.enter)=\"submit()\">\r\n <mat-error *ngIf=\"collectionName.errors\">{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_ERROR' |\r\n translate: {minLength: minLength, maxLength: maxLength} }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"center center\">\r\n <button mat-flat-button (click)=\"submit()\" cdkFocusInitial color=\"accent\"\r\n [disabled]=\"formGroup.invalid\">{{'TERM_COLLECTIONS.CREATE_DIALOG.CREATE' | translate}}</button>\r\n <button mat-button mat-dialog-close color=\"accent\">{{\"TERM_COLLECTIONS.CREATE_DIALOG.CANCEL\" | translate}}</button>\r\n</div>\r\n", styles: ["input{outline:none!important}:host ::ng-deep .mat-form-field-appearance-outline:hover .mat-form-field-outline,:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,:host ::ng-deep .mat-form-field.mat-focused .mat-form-field-label{color:#ad234a}.create-dialog-wrapper{position:relative}.close-button{position:absolute;right:1em;top:1em}\n"], dependencies: [{ kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i12.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
6571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, decorators: [{
6572
+ type: Component,
6573
+ args: [{ selector: 'tld-term-create-collection-dialog', template: "<tld-close-button class=\"close-button\" mat-dialog-close>\r\n</tld-close-button>\r\n<h1 mat-dialog-title>{{'TERM_COLLECTIONS.CREATE_DIALOG.TITLE' | translate}}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_1' | translate\"></p>\r\n <p [innerHtml]=\"'TERM_COLLECTIONS.CREATE_DIALOG.DESCRIPTION_2' | translate\"></p>\r\n <div [formGroup]=\"formGroup\">\r\n <mat-form-field appearance=\"outline\" class=\"collection-name-form-field\">\r\n <mat-label>{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_LABEL' | translate}}</mat-label>\r\n <input matInput formControlName=\"collectionName\" (keyup.enter)=\"submit()\">\r\n <mat-error *ngIf=\"collectionName.errors\">{{'TERM_COLLECTIONS.CREATE_DIALOG.COLLECTION_NAME_ERROR' |\r\n translate: {minLength: minLength, maxLength: maxLength} }}</mat-error>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"center center\">\r\n <button mat-flat-button (click)=\"submit()\" cdkFocusInitial color=\"accent\"\r\n [disabled]=\"formGroup.invalid\">{{'TERM_COLLECTIONS.CREATE_DIALOG.CREATE' | translate}}</button>\r\n <button mat-button mat-dialog-close color=\"accent\">{{\"TERM_COLLECTIONS.CREATE_DIALOG.CANCEL\" | translate}}</button>\r\n</div>\r\n", styles: ["input{outline:none!important}:host ::ng-deep .mat-form-field-appearance-outline:hover .mat-form-field-outline,:host ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,:host ::ng-deep .mat-form-field.mat-focused .mat-form-field-label{color:#ad234a}.create-dialog-wrapper{position:relative}.close-button{position:absolute;right:1em;top:1em}\n"] }]
6574
+ }], ctorParameters: function () {
6575
+ return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
6576
+ type: Inject,
6577
+ args: [MAT_DIALOG_DATA]
6578
+ }] }, { type: TldTranslateConfigService }];
6579
+ } });
6580
+
6581
+ class CreateCollectionComponent {
6582
+ constructor(translate, dialog, terminologyService) {
6583
+ this.translate = translate;
6584
+ this.dialog = dialog;
6585
+ this.terminologyService = terminologyService;
6586
+ }
6587
+ ngOnInit() {
6588
+ }
6589
+ create() {
6590
+ const localizationKey = "TERM_COLLECTIONS.DEFAULT_COLLECTION_NAME";
6591
+ this.translate.get(localizationKey).subscribe((collectionName) => {
6592
+ const dialogRef = this.dialog.open(TldTermCreateCollectionDialogComponent, {
6593
+ minWidth: '300px',
6594
+ maxWidth: '700px',
6595
+ data: { collectionName: collectionName }
6596
+ });
6597
+ dialogRef.afterClosed().subscribe(collectionName => {
6598
+ if (!collectionName) {
6599
+ return;
6600
+ }
6601
+ this.terminologyService.create(this.sourceLanguageCode, this.targetLanguageCode, collectionName).subscribe({
6602
+ error: (err) => {
6603
+ console.error(err);
6604
+ const error = { ErrorCode: ErrorCode.COLLECTION_CREATE };
6605
+ throw error;
6606
+ }
6607
+ });
6608
+ });
6609
+ });
6610
+ }
6611
+ }
6612
+ CreateCollectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateCollectionComponent, deps: [{ token: i1$1.TranslateService }, { token: i1$2.MatDialog }, { token: TerminologyService }], target: i0.ɵɵFactoryTarget.Component });
6613
+ CreateCollectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CreateCollectionComponent, selector: "tld-create-collection", inputs: { sourceLanguageCode: "sourceLanguageCode", targetLanguageCode: "targetLanguageCode" }, ngImport: i0, template: "<button mat-flat-button color=\"accent\" (click)=\"create()\" fxHide.lt-sm>\r\n {{'TERM_COLLECTIONS.CREATE' | translate}}\r\n</button>\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i5$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
6614
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateCollectionComponent, decorators: [{
6615
+ type: Component,
6616
+ args: [{ selector: 'tld-create-collection', template: "<button mat-flat-button color=\"accent\" (click)=\"create()\" fxHide.lt-sm>\r\n {{'TERM_COLLECTIONS.CREATE' | translate}}\r\n</button>\r\n" }]
6617
+ }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: i1$2.MatDialog }, { type: TerminologyService }]; }, propDecorators: { sourceLanguageCode: [{
6618
+ type: Input
6619
+ }], targetLanguageCode: [{
6620
+ type: Input
6621
+ }] } });
6622
+
6487
6623
  class TldTermCollectionComponent {
6488
- constructor(terms) {
6489
- this.terms = terms;
6624
+ constructor(terminologyService, systemService) {
6625
+ this.terminologyService = terminologyService;
6626
+ this.systemService = systemService;
6627
+ }
6628
+ get promotion() { return this.terminologyService.shouldShowPromotion; }
6629
+ get hasEditPermissions() { return this.terminologyService.hasEditPermissions; }
6630
+ ngOnInit() {
6631
+ this.subscription = this.systemService.getActiveData().subscribe((data) => {
6632
+ this.sourceLanguageCode = data.sourceLang.lang;
6633
+ this.targetLanguageCode = data.targetLang.lang;
6634
+ this.terminologyService.setEngine(data.systemId, [this.sourceLanguageCode, this.targetLanguageCode]);
6635
+ });
6636
+ }
6637
+ ngOnDestroy() {
6638
+ this.subscription.unsubscribe();
6490
6639
  }
6491
- get promotion() { return this.terms.shouldShowPromotion; }
6492
6640
  }
6493
- TldTermCollectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, deps: [{ token: TldTermCollectionsService }], target: i0.ɵɵFactoryTarget.Component });
6494
- TldTermCollectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCollectionComponent, selector: "tld-term-collection", ngImport: i0, template: "<section class=\"tld-collection-list-wrapper\">\r\n <ng-container *ngIf=\"!promotion\">\r\n <tld-term-collection-list></tld-term-collection-list>\r\n </ng-container>\r\n <ng-container *ngIf=\"promotion\">\r\n <tld-term-promotion></tld-term-promotion>\r\n </ng-container>\r\n</section>", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TldTermCollectionListComponent, selector: "tld-term-collection-list" }, { kind: "component", type: TldTermPromotionComponent, selector: "tld-term-promotion" }] });
6641
+ TldTermCollectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, deps: [{ token: TerminologyService }, { token: TldSystemService }], target: i0.ɵɵFactoryTarget.Component });
6642
+ TldTermCollectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermCollectionComponent, selector: "tld-term-collection", ngImport: i0, template: "<section class=\"tld-collection-list-wrapper\">\r\n <ng-container *ngIf=\"!promotion\">\r\n <tld-term-collection-list></tld-term-collection-list>\r\n <footer class=\"tld-collection-list-footer\" fxLayout=\"row\" *ngIf=\"hasEditPermissions\">\r\n <tld-create-collection [sourceLanguageCode]=\"sourceLanguageCode\" [targetLanguageCode]=\"targetLanguageCode\">\r\n </tld-create-collection>\r\n </footer>\r\n </ng-container>\r\n <ng-container *ngIf=\"promotion\">\r\n <tld-term-promotion></tld-term-promotion>\r\n </ng-container>\r\n</section>\r\n", styles: [".tld-collection-list-footer{padding:1em .75em}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "component", type: TldTermCollectionListComponent, selector: "tld-term-collection-list" }, { kind: "component", type: TldTermPromotionComponent, selector: "tld-term-promotion" }, { kind: "component", type: CreateCollectionComponent, selector: "tld-create-collection", inputs: ["sourceLanguageCode", "targetLanguageCode"] }] });
6495
6643
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, decorators: [{
6496
6644
  type: Component,
6497
- args: [{ selector: 'tld-term-collection', template: "<section class=\"tld-collection-list-wrapper\">\r\n <ng-container *ngIf=\"!promotion\">\r\n <tld-term-collection-list></tld-term-collection-list>\r\n </ng-container>\r\n <ng-container *ngIf=\"promotion\">\r\n <tld-term-promotion></tld-term-promotion>\r\n </ng-container>\r\n</section>" }]
6498
- }], ctorParameters: function () { return [{ type: TldTermCollectionsService }]; } });
6645
+ args: [{ selector: 'tld-term-collection', template: "<section class=\"tld-collection-list-wrapper\">\r\n <ng-container *ngIf=\"!promotion\">\r\n <tld-term-collection-list></tld-term-collection-list>\r\n <footer class=\"tld-collection-list-footer\" fxLayout=\"row\" *ngIf=\"hasEditPermissions\">\r\n <tld-create-collection [sourceLanguageCode]=\"sourceLanguageCode\" [targetLanguageCode]=\"targetLanguageCode\">\r\n </tld-create-collection>\r\n </footer>\r\n </ng-container>\r\n <ng-container *ngIf=\"promotion\">\r\n <tld-term-promotion></tld-term-promotion>\r\n </ng-container>\r\n</section>\r\n", styles: [".tld-collection-list-footer{padding:1em .75em}\n"] }]
6646
+ }], ctorParameters: function () { return [{ type: TerminologyService }, { type: TldSystemService }]; } });
6499
6647
 
6500
6648
  class TldTermMenuComponent {
6501
- constructor(collectionService) {
6502
- this.collectionService = collectionService;
6649
+ constructor(terminologyService) {
6650
+ this.terminologyService = terminologyService;
6503
6651
  }
6504
- get selected() { return this.collectionService.selected; }
6652
+ get selected() { return this.terminologyService.selected; }
6505
6653
  ;
6506
- set selected(val) { this.collectionService.selected = val; }
6654
+ set selected(val) { this.terminologyService.selected = val; }
6655
+ get title() {
6656
+ var _a, _b, _c, _d;
6657
+ return (_c = (_b = (_a = this.selected) === null || _a === void 0 ? void 0 : _a.termCollection) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : (_d = this.selected.mtCollection) === null || _d === void 0 ? void 0 : _d.name;
6658
+ }
6659
+ ngOnDestroy() {
6660
+ this.menuClosed();
6661
+ }
6507
6662
  menuOpened() {
6508
- this.collectionService.onMenuOpen();
6663
+ this.subscription = this.terminologyService.startAutoRefresh().subscribe();
6509
6664
  }
6510
6665
  menuClosed() {
6511
- this.collectionService.onMenuClose();
6666
+ var _a;
6667
+ this.terminologyService.stopAutoRefresh();
6668
+ (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
6512
6669
  }
6513
6670
  }
6514
- TldTermMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, deps: [{ token: TldTermCollectionsService }], target: i0.ɵɵFactoryTarget.Component });
6515
- TldTermMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermMenuComponent, selector: "tld-term-menu", ngImport: i0, template: "<div fxLayoutAlign=\"center center\" [ngClass.lt-sm]=\"'tld-term-collection-wrapper-mobile'\" fxLayoutGap=\"8px\">\r\n <span fxHide.lt-md>\r\n {{'TERM_COLLECTIONS.GLOSSARY' | translate}}\r\n </span>\r\n <tld-open-close-button fxHide.lt-sm #state=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu\"\r\n (menuOpened)=\"menuOpened()\" (menuClosed)=\"menuClosed()\"\r\n [matTooltip]=\"selected? selected.title:''\" [isOpened]=\"state.menuOpen\" class=\"tld-collection-menu-button\"\r\n [attr.aria-label]=\"'TERM_COLLECTIONS.ARIA_LABELS.OTHER_COLLECTIONS' | translate\">\r\n <span class=\"selected-collection\">\r\n {{selected? selected.title : ('TERM_COLLECTIONS.SELECTED_NONE' | translate)}}\r\n </span>\r\n <mat-spinner class=\"selected-col-spinner\" color=\"accent\" diameter=\"16\" *ngIf=\"selected?.isImporting\"></mat-spinner>\r\n </tld-open-close-button>\r\n <button mat-icon-button fxHide.gt-xs [matMenuTriggerFor]=\"menu\">\r\n <mat-icon svgIcon=\"collections_menu\" [attr.color]=\"selected?'accent':''\"></mat-icon>\r\n </button>\r\n\r\n</div>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"tld-collection-menu\">\r\n <tld-close-button fxHide.gt-xs></tld-close-button>\r\n <div class=\"tld-term-collection\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <tld-term-collection></tld-term-collection>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tld-collection-menu-button .selected-collection{overflow:hidden;text-overflow:ellipsis;max-width:140px;display:inline-block}.selected-col-spinner{margin-left:5px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i4.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i5$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i13.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: TldOpenCloseButtonComponent, selector: "tld-open-close-button", inputs: ["disableFocusOnAction", "isOpened", "disabled", "isIcon", "ariaLabelCode"] }, { kind: "component", type: i12.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "component", type: TldTermCollectionComponent, selector: "tld-term-collection" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
6671
+ TldTermMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, deps: [{ token: TerminologyService }], target: i0.ɵɵFactoryTarget.Component });
6672
+ TldTermMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTermMenuComponent, selector: "tld-term-menu", ngImport: i0, template: "<div fxLayoutAlign=\"center center\" [ngClass.lt-sm]=\"'tld-term-collection-wrapper-mobile'\" fxLayoutGap=\"8px\">\r\n <span fxHide.lt-md>\r\n {{'TERM_COLLECTIONS.GLOSSARY' | translate}}\r\n </span>\r\n <tld-open-close-button fxHide.lt-sm #state=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu\" (menuOpened)=\"menuOpened()\"\r\n (menuClosed)=\"menuClosed()\" [matTooltip]=\"selected? title:''\" [isOpened]=\"state.menuOpen\"\r\n class=\"tld-collection-menu-button\" [attr.aria-label]=\"'TERM_COLLECTIONS.ARIA_LABELS.OTHER_COLLECTIONS' | translate\">\r\n <span class=\"selected-collection\">\r\n {{selected? title : ('TERM_COLLECTIONS.SELECTED_NONE' | translate)}}\r\n </span>\r\n <mat-spinner class=\"selected-col-spinner\" color=\"accent\" diameter=\"16\" *ngIf=\"selected?.isImporting\"></mat-spinner>\r\n </tld-open-close-button>\r\n <button mat-icon-button fxHide.gt-xs [matMenuTriggerFor]=\"menu\">\r\n <mat-icon svgIcon=\"collections_menu\" [attr.color]=\"selected?'accent':''\"></mat-icon>\r\n </button>\r\n\r\n</div>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"tld-collection-menu\">\r\n <tld-close-button fxHide.gt-xs></tld-close-button>\r\n <div class=\"tld-term-collection\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <tld-term-collection></tld-term-collection>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tld-collection-menu-button .selected-collection{overflow:hidden;text-overflow:ellipsis;max-width:140px;display:inline-block}.selected-col-spinner{margin-left:5px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i4.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i5$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i13.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: TldOpenCloseButtonComponent, selector: "tld-open-close-button", inputs: ["disableFocusOnAction", "isOpened", "disabled", "isIcon", "ariaLabelCode"] }, { kind: "component", type: i12.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "component", type: TldTermCollectionComponent, selector: "tld-term-collection" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
6516
6673
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, decorators: [{
6517
6674
  type: Component,
6518
- args: [{ selector: 'tld-term-menu', template: "<div fxLayoutAlign=\"center center\" [ngClass.lt-sm]=\"'tld-term-collection-wrapper-mobile'\" fxLayoutGap=\"8px\">\r\n <span fxHide.lt-md>\r\n {{'TERM_COLLECTIONS.GLOSSARY' | translate}}\r\n </span>\r\n <tld-open-close-button fxHide.lt-sm #state=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu\"\r\n (menuOpened)=\"menuOpened()\" (menuClosed)=\"menuClosed()\"\r\n [matTooltip]=\"selected? selected.title:''\" [isOpened]=\"state.menuOpen\" class=\"tld-collection-menu-button\"\r\n [attr.aria-label]=\"'TERM_COLLECTIONS.ARIA_LABELS.OTHER_COLLECTIONS' | translate\">\r\n <span class=\"selected-collection\">\r\n {{selected? selected.title : ('TERM_COLLECTIONS.SELECTED_NONE' | translate)}}\r\n </span>\r\n <mat-spinner class=\"selected-col-spinner\" color=\"accent\" diameter=\"16\" *ngIf=\"selected?.isImporting\"></mat-spinner>\r\n </tld-open-close-button>\r\n <button mat-icon-button fxHide.gt-xs [matMenuTriggerFor]=\"menu\">\r\n <mat-icon svgIcon=\"collections_menu\" [attr.color]=\"selected?'accent':''\"></mat-icon>\r\n </button>\r\n\r\n</div>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"tld-collection-menu\">\r\n <tld-close-button fxHide.gt-xs></tld-close-button>\r\n <div class=\"tld-term-collection\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <tld-term-collection></tld-term-collection>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tld-collection-menu-button .selected-collection{overflow:hidden;text-overflow:ellipsis;max-width:140px;display:inline-block}.selected-col-spinner{margin-left:5px}\n"] }]
6519
- }], ctorParameters: function () { return [{ type: TldTermCollectionsService }]; } });
6675
+ args: [{ selector: 'tld-term-menu', template: "<div fxLayoutAlign=\"center center\" [ngClass.lt-sm]=\"'tld-term-collection-wrapper-mobile'\" fxLayoutGap=\"8px\">\r\n <span fxHide.lt-md>\r\n {{'TERM_COLLECTIONS.GLOSSARY' | translate}}\r\n </span>\r\n <tld-open-close-button fxHide.lt-sm #state=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu\" (menuOpened)=\"menuOpened()\"\r\n (menuClosed)=\"menuClosed()\" [matTooltip]=\"selected? title:''\" [isOpened]=\"state.menuOpen\"\r\n class=\"tld-collection-menu-button\" [attr.aria-label]=\"'TERM_COLLECTIONS.ARIA_LABELS.OTHER_COLLECTIONS' | translate\">\r\n <span class=\"selected-collection\">\r\n {{selected? title : ('TERM_COLLECTIONS.SELECTED_NONE' | translate)}}\r\n </span>\r\n <mat-spinner class=\"selected-col-spinner\" color=\"accent\" diameter=\"16\" *ngIf=\"selected?.isImporting\"></mat-spinner>\r\n </tld-open-close-button>\r\n <button mat-icon-button fxHide.gt-xs [matMenuTriggerFor]=\"menu\">\r\n <mat-icon svgIcon=\"collections_menu\" [attr.color]=\"selected?'accent':''\"></mat-icon>\r\n </button>\r\n\r\n</div>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"tld-collection-menu\">\r\n <tld-close-button fxHide.gt-xs></tld-close-button>\r\n <div class=\"tld-term-collection\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <tld-term-collection></tld-term-collection>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tld-collection-menu-button .selected-collection{overflow:hidden;text-overflow:ellipsis;max-width:140px;display:inline-block}.selected-col-spinner{margin-left:5px}\n"] }]
6676
+ }], ctorParameters: function () { return [{ type: TerminologyService }]; } });
6520
6677
 
6521
6678
  class TldTermModule {
6522
6679
  }
6523
6680
  TldTermModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6524
- TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent], imports: [FormsModule,
6681
+ TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent, CreateCollectionComponent], imports: [FormsModule,
6525
6682
  CommonModule,
6526
6683
  MaterialModule,
6527
6684
  TranslateModule,
@@ -6532,7 +6689,7 @@ TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
6532
6689
  MatTooltipModule,
6533
6690
  TldCommonModule,
6534
6691
  ReactiveFormsModule,
6535
- CloseButtonModule], exports: [TldTermMenuComponent] });
6692
+ CloseButtonModule], exports: [TldTermMenuComponent, CreateCollectionComponent] });
6536
6693
  TldTermModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, imports: [FormsModule,
6537
6694
  CommonModule,
6538
6695
  MaterialModule,
@@ -6548,7 +6705,7 @@ TldTermModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
6548
6705
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, decorators: [{
6549
6706
  type: NgModule,
6550
6707
  args: [{
6551
- declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent],
6708
+ declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent, CreateCollectionComponent],
6552
6709
  imports: [
6553
6710
  FormsModule,
6554
6711
  CommonModule,
@@ -6563,10 +6720,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
6563
6720
  ReactiveFormsModule,
6564
6721
  CloseButtonModule
6565
6722
  ],
6566
- exports: [TldTermMenuComponent]
6723
+ exports: [TldTermMenuComponent, CreateCollectionComponent]
6567
6724
  }]
6568
6725
  }] });
6569
6726
 
6727
+ class EningeTermApiService {
6728
+ constructor(http, config) {
6729
+ this.http = http;
6730
+ this.config = config;
6731
+ this.baseUrl = this.config.termConfig.engineTermUrl;
6732
+ }
6733
+ add(engineId, params) {
6734
+ return this.http.post(`${this.baseUrl}/${engineId}/terms`, params);
6735
+ }
6736
+ update(engineId, collectionId, params) {
6737
+ return this.http.put(`${this.baseUrl}/${engineId}/terms/${collectionId}`, params);
6738
+ }
6739
+ getList(engineId) {
6740
+ return this.http.get(`${this.baseUrl}/${engineId}/terms`, { params: { engineId } });
6741
+ }
6742
+ remove(engineId, collectionId) {
6743
+ return this.http.delete(`${this.baseUrl}/${engineId}/terms/${collectionId}`);
6744
+ }
6745
+ }
6746
+ EningeTermApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EningeTermApiService, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
6747
+ EningeTermApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EningeTermApiService, providedIn: 'root' });
6748
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EningeTermApiService, decorators: [{
6749
+ type: Injectable,
6750
+ args: [{
6751
+ providedIn: 'root'
6752
+ }]
6753
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
6754
+
6570
6755
  class ExtensionDialogComponent {
6571
6756
  constructor(data) {
6572
6757
  this.data = data;
@@ -7056,10 +7241,10 @@ class TldVoiceInputApiService {
7056
7241
  const formData = new FormData();
7057
7242
  formData.append("file", params.file);
7058
7243
  formData.append("langauge", params.language);
7059
- return this.http.post(this.audioConfig.audioApiUrl, formData).pipe(map(response => this.mapJob(response)));
7244
+ return this.http.post(this.audioConfig.audioApiUrl, formData).pipe(map$1(response => this.mapJob(response)));
7060
7245
  }
7061
7246
  getJobInfo(jobId) {
7062
- return this.http.get(`${this.audioConfig.audioApiUrl}/${jobId}`).pipe(map(response => this.mapJob(response)));
7247
+ return this.http.get(`${this.audioConfig.audioApiUrl}/${jobId}`).pipe(map$1(response => this.mapJob(response)));
7063
7248
  }
7064
7249
  mapJob(response) {
7065
7250
  // converts to VoiceToTextState, so it suits enum conventions.
@@ -7679,7 +7864,7 @@ class TldTranslateTextService {
7679
7864
  this.untranslatedParagraphCount = 0;
7680
7865
  this.paragraphTranslationSubscription = this.paragraphTranslationsSubject.asObservable().pipe(mergeMap((untranslatedParagraph) => {
7681
7866
  this.untranslatedParagraphCount += 1;
7682
- return this.translateParagraph(untranslatedParagraph).pipe(tap((response) => {
7867
+ return this.translateParagraph(untranslatedParagraph).pipe(tap$1((response) => {
7683
7868
  // No need to handle response if source text has changed.
7684
7869
  if (source != this.sourceText) {
7685
7870
  return;
@@ -9497,7 +9682,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
9497
9682
 
9498
9683
  window.$ = window.jQuery = $;
9499
9684
  class TldTranslateWebsiteComponent {
9500
- constructor(translate, configService, translateButtonService, alerts, router, activatedRoute, tldSystem, collectionService, tldTranslateWebService, iconService, apiVersion) {
9685
+ constructor(translate, configService, translateButtonService, alerts, router, activatedRoute, tldSystem, terminologyService, tldTranslateWebService, iconService, apiVersion) {
9501
9686
  this.translate = translate;
9502
9687
  this.configService = configService;
9503
9688
  this.translateButtonService = translateButtonService;
@@ -9505,7 +9690,7 @@ class TldTranslateWebsiteComponent {
9505
9690
  this.router = router;
9506
9691
  this.activatedRoute = activatedRoute;
9507
9692
  this.tldSystem = tldSystem;
9508
- this.collectionService = collectionService;
9693
+ this.terminologyService = terminologyService;
9509
9694
  this.tldTranslateWebService = tldTranslateWebService;
9510
9695
  this.apiVersion = apiVersion;
9511
9696
  this.product = '';
@@ -9776,7 +9961,7 @@ class TldTranslateWebsiteComponent {
9776
9961
  this.sendMessage({ message: 'changeSystem', systemId: sys.id });
9777
9962
  }
9778
9963
  translateButtonClick() {
9779
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
9964
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
9780
9965
  if (this.urlToTranslate != '') {
9781
9966
  this.sendMessage({
9782
9967
  message: 'loadUrl',
@@ -9935,7 +10120,7 @@ class TldTranslateWebsiteComponent {
9935
10120
  body.appendChild(script);
9936
10121
  }
9937
10122
  }
9938
- TldTranslateWebsiteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateWebsiteComponent, deps: [{ token: i1$1.TranslateService }, { token: TldTranslateConfigService }, { token: TldTranslateButtonService }, { token: TldAlertService }, { token: i4$1.Router }, { token: i4$1.ActivatedRoute }, { token: TldSystemService }, { token: TldTermCollectionsService }, { token: TldTranslateWebService }, { token: IconService }, { token: TRANSLATION_API_VERSION_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
10123
+ TldTranslateWebsiteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateWebsiteComponent, deps: [{ token: i1$1.TranslateService }, { token: TldTranslateConfigService }, { token: TldTranslateButtonService }, { token: TldAlertService }, { token: i4$1.Router }, { token: i4$1.ActivatedRoute }, { token: TldSystemService }, { token: TerminologyService }, { token: TldTranslateWebService }, { token: IconService }, { token: TRANSLATION_API_VERSION_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
9939
10124
  TldTranslateWebsiteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TldTranslateWebsiteComponent, selector: "tld-translate-website", inputs: { product: "product", company: "company" }, outputs: { onError: "onError" }, viewQueries: [{ propertyName: "urlInputField", first: true, predicate: ["url"], descendants: true }], ngImport: i0, template: "<div id=\"widget\" class=\"tld-translate-web\">\r\n <div class=\"translate-container-header\">\r\n <a href=\"/\" id=\"home-link\" [attr.title]=\"'WEBTRANSLATE.BACK' | translate\">\r\n <img [src]=\"logoLocation\" alt=\"logo\">\r\n <lib-company-product *ngIf=\"company && product\" [company]=\"company\" [product]=\"product\"></lib-company-product>\r\n </a>\r\n <div [ngClass.lt-sm]=\"'tld-translate-mobile'\">\r\n\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" class=\"address-wrapper\">\r\n <div fxFlex class=\"back-btn\">\r\n\r\n <button (click)=\"goToHome()\" color=\"accent\" mat-flat-button [attr.title]=\"'WEBTRANSLATE.BACK' | translate\">\r\n <mat-icon inline=true>chevron_left</mat-icon>\r\n </button>\r\n\r\n </div>\r\n <div fxFlex class=\"\">\r\n <div data-text=\"address\" class=\"\">{{'WEBTRANSLATE.ADDRESS' | translate}}</div>\r\n </div>\r\n <div fxFlex=\"100%\" class=\"address-input\">\r\n <input type=\"url\" #url class=\"url w-100\" autofocus=\"autofocus\" [(ngModel)]=\"urlToTranslate\"\r\n (keyup.enter)=\"loadButtonClicked()\" />\r\n </div>\r\n <div fxFlex class=\"load-btn\">\r\n <button (click)=\"loadButtonClicked()\" color=\"accent\" mat-flat-button\r\n [attr.title]=\"'WEBTRANSLATE.LOAD_PAGE' | translate\" [disabled]=\"!urlToTranslate\">\r\n <mat-icon inline=true>search</mat-icon>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center\" class=\"tld-translate-switcher-wrapper\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\r\n <tld-translate-switcher\r\n *ngIf=\"switcherOptions\"\r\n [isCollectionsActivated]=\"isCollectionsActivated\"\r\n [useParentWidth]=\"useParentWidth\"\r\n [disabled]=\"actionButtonDisabled\"\r\n [settings]=\"switcherOptions\"\r\n [showTranslateButton]=\"false\"\r\n [hideOnSmallScreens]=\"false\"\r\n [hideLangMenuLabels]=\"hideLangMenuLabels\"\r\n [maxDisplayedLanguages]=\"maxDisplayedLanguages\"\r\n [showDomainsWithLanguageName]=\"showDomainsWithLanguageName\"\r\n (onDomainChange)=\"systemChange($event)\"\r\n (onActionClick)=\"translateButtonClick()\"\r\n (onLanguageSwap)=\"swapLanguages()\"\r\n (onSourceLanguageChange)=\"sourceLanguageChange($event)\"\r\n (onTargetLanguageChange)=\"targetLanguageChange($event)\">\r\n </tld-translate-switcher>\r\n <div fxFlexAlign=\"center\" class=\"action-btn-wrapper\">\r\n <tld-translate-button\r\n *ngIf=\"showTranslateBtn\"\r\n class=\"switcher-translate-button\"\r\n [disabled]=\"actionButtonDisabled || !urlToTranslate\">\r\n </tld-translate-button>\r\n <button *ngIf=\"showCancel\" mat-flat-button color=\"accent\" (click)=\"cancel()\"\r\n class=\"cancel-button\">{{'WEBTRANSLATE.CANCEL' | translate}}</button>\r\n <button *ngIf=\"showRestore\" mat-flat-button color=\"accent\" (click)=\"restore()\"\r\n class=\"restore-button\">{{'WEBTRANSLATE.RESTORE' | translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n <div id=\"website-frame-container\">\r\n <mat-progress-bar *ngIf=\"showProgress\" color=\"accent\" [mode]=\"mode\" [value]=\"progressValue\">\r\n </mat-progress-bar>\r\n <lib-tld-notification-message [@openCloseAnimation] *ngFor=\"let message of messages; let ix = index\" [message]=\"message\"\r\n (closeClicked)=\"removeMessage(ix)\"></lib-tld-notification-message>\r\n <iframe id=\"letsmt-translate-page-iframe\" name=\"letsmtTranslatePageIframe\" src=\"about:blank\"\r\n [attr.sandbox]=\"sandbox\"></iframe>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".tld-translate-switcher-wrapper{padding:0 .5em;margin-left:auto;margin-right:auto}.translate-container-header{padding:.6em 1em 0;box-sizing:border-box}#widget .translate-container-header{width:100%;height:100%;margin-left:auto;margin-right:auto}#letsmt-translate-page-iframe{width:100%;height:100%;border:0}#website-frame-container{inset:5.92em 0 0;border-top:solid 1px #d4d4d4;position:fixed}#home-link{position:absolute;left:.75em;top:.2em;display:flex;flex-direction:row;text-decoration:none}#home-link img{margin-right:.75em;max-height:5.5em}@media screen and (max-width: 73em){#home-link{display:none}}.back-btn .mat-flat-button,.load-btn .mat-flat-button{width:27px;height:27px;line-height:27px;min-width:27px;padding:0}.back-btn .mat-flat-button .mat-icon,.load-btn .mat-flat-button .mat-icon{vertical-align:top;font-size:1.25em}.address-wrapper{max-width:60em;margin-bottom:.38em;margin-left:auto;margin-right:auto}.load-btn{padding-left:.8em}.back-btn{padding-right:.8em}.cancel-button,.restore-button{min-width:100px;height:36px;align-self:center}.w-100{width:100%}.address-input{padding-left:.9em;padding-right:.65em}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TldTranslateSwitcherComponent, selector: "tld-translate-switcher", inputs: ["buttonDisabled", "showTranslateButton", "hideOnSmallScreens", "disabled", "hideLangMenuLabels", "maxDisplayedLanguages", "collections", "showDomainsWithLanguageName", "isCollectionsActivated", "useParentWidth", "loader", "settings"], outputs: ["onDomainChange", "onActionClick", "onSourceLanguageChange", "onTargetLanguageChange", "onLanguageSwap", "onVendorChange"] }, { kind: "component", type: TldTranslateButtonComponent, selector: "tld-translate-button", inputs: ["disabled", "enablePulseAnimation"], outputs: ["clicked"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i11.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexAlignDirective, selector: " [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md], [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md], [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm], [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]", inputs: ["fxFlexAlign", "fxFlexAlign.xs", "fxFlexAlign.sm", "fxFlexAlign.md", "fxFlexAlign.lg", "fxFlexAlign.xl", "fxFlexAlign.lt-sm", "fxFlexAlign.lt-md", "fxFlexAlign.lt-lg", "fxFlexAlign.lt-xl", "fxFlexAlign.gt-xs", "fxFlexAlign.gt-sm", "fxFlexAlign.gt-md", "fxFlexAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i12.NotificationMessageComponent, selector: "lib-tld-notification-message", inputs: ["message", "inline"], outputs: ["buttonClicked", "closeClicked", "linkClicked"] }, { kind: "component", type: i12.CompanyProductComponent, selector: "lib-company-product", inputs: ["company", "product"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], animations: [
9940
10125
  trigger('openCloseAnimation', [
9941
10126
  transition(':enter', [
@@ -9957,7 +10142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
9957
10142
  ])
9958
10143
  ], template: "<div id=\"widget\" class=\"tld-translate-web\">\r\n <div class=\"translate-container-header\">\r\n <a href=\"/\" id=\"home-link\" [attr.title]=\"'WEBTRANSLATE.BACK' | translate\">\r\n <img [src]=\"logoLocation\" alt=\"logo\">\r\n <lib-company-product *ngIf=\"company && product\" [company]=\"company\" [product]=\"product\"></lib-company-product>\r\n </a>\r\n <div [ngClass.lt-sm]=\"'tld-translate-mobile'\">\r\n\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" class=\"address-wrapper\">\r\n <div fxFlex class=\"back-btn\">\r\n\r\n <button (click)=\"goToHome()\" color=\"accent\" mat-flat-button [attr.title]=\"'WEBTRANSLATE.BACK' | translate\">\r\n <mat-icon inline=true>chevron_left</mat-icon>\r\n </button>\r\n\r\n </div>\r\n <div fxFlex class=\"\">\r\n <div data-text=\"address\" class=\"\">{{'WEBTRANSLATE.ADDRESS' | translate}}</div>\r\n </div>\r\n <div fxFlex=\"100%\" class=\"address-input\">\r\n <input type=\"url\" #url class=\"url w-100\" autofocus=\"autofocus\" [(ngModel)]=\"urlToTranslate\"\r\n (keyup.enter)=\"loadButtonClicked()\" />\r\n </div>\r\n <div fxFlex class=\"load-btn\">\r\n <button (click)=\"loadButtonClicked()\" color=\"accent\" mat-flat-button\r\n [attr.title]=\"'WEBTRANSLATE.LOAD_PAGE' | translate\" [disabled]=\"!urlToTranslate\">\r\n <mat-icon inline=true>search</mat-icon>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center\" class=\"tld-translate-switcher-wrapper\">\r\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxFlex>\r\n <tld-translate-switcher\r\n *ngIf=\"switcherOptions\"\r\n [isCollectionsActivated]=\"isCollectionsActivated\"\r\n [useParentWidth]=\"useParentWidth\"\r\n [disabled]=\"actionButtonDisabled\"\r\n [settings]=\"switcherOptions\"\r\n [showTranslateButton]=\"false\"\r\n [hideOnSmallScreens]=\"false\"\r\n [hideLangMenuLabels]=\"hideLangMenuLabels\"\r\n [maxDisplayedLanguages]=\"maxDisplayedLanguages\"\r\n [showDomainsWithLanguageName]=\"showDomainsWithLanguageName\"\r\n (onDomainChange)=\"systemChange($event)\"\r\n (onActionClick)=\"translateButtonClick()\"\r\n (onLanguageSwap)=\"swapLanguages()\"\r\n (onSourceLanguageChange)=\"sourceLanguageChange($event)\"\r\n (onTargetLanguageChange)=\"targetLanguageChange($event)\">\r\n </tld-translate-switcher>\r\n <div fxFlexAlign=\"center\" class=\"action-btn-wrapper\">\r\n <tld-translate-button\r\n *ngIf=\"showTranslateBtn\"\r\n class=\"switcher-translate-button\"\r\n [disabled]=\"actionButtonDisabled || !urlToTranslate\">\r\n </tld-translate-button>\r\n <button *ngIf=\"showCancel\" mat-flat-button color=\"accent\" (click)=\"cancel()\"\r\n class=\"cancel-button\">{{'WEBTRANSLATE.CANCEL' | translate}}</button>\r\n <button *ngIf=\"showRestore\" mat-flat-button color=\"accent\" (click)=\"restore()\"\r\n class=\"restore-button\">{{'WEBTRANSLATE.RESTORE' | translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n <div id=\"website-frame-container\">\r\n <mat-progress-bar *ngIf=\"showProgress\" color=\"accent\" [mode]=\"mode\" [value]=\"progressValue\">\r\n </mat-progress-bar>\r\n <lib-tld-notification-message [@openCloseAnimation] *ngFor=\"let message of messages; let ix = index\" [message]=\"message\"\r\n (closeClicked)=\"removeMessage(ix)\"></lib-tld-notification-message>\r\n <iframe id=\"letsmt-translate-page-iframe\" name=\"letsmtTranslatePageIframe\" src=\"about:blank\"\r\n [attr.sandbox]=\"sandbox\"></iframe>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".tld-translate-switcher-wrapper{padding:0 .5em;margin-left:auto;margin-right:auto}.translate-container-header{padding:.6em 1em 0;box-sizing:border-box}#widget .translate-container-header{width:100%;height:100%;margin-left:auto;margin-right:auto}#letsmt-translate-page-iframe{width:100%;height:100%;border:0}#website-frame-container{inset:5.92em 0 0;border-top:solid 1px #d4d4d4;position:fixed}#home-link{position:absolute;left:.75em;top:.2em;display:flex;flex-direction:row;text-decoration:none}#home-link img{margin-right:.75em;max-height:5.5em}@media screen and (max-width: 73em){#home-link{display:none}}.back-btn .mat-flat-button,.load-btn .mat-flat-button{width:27px;height:27px;line-height:27px;min-width:27px;padding:0}.back-btn .mat-flat-button .mat-icon,.load-btn .mat-flat-button .mat-icon{vertical-align:top;font-size:1.25em}.address-wrapper{max-width:60em;margin-bottom:.38em;margin-left:auto;margin-right:auto}.load-btn{padding-left:.8em}.back-btn{padding-right:.8em}.cancel-button,.restore-button{min-width:100px;height:36px;align-self:center}.w-100{width:100%}.address-input{padding-left:.9em;padding-right:.65em}\n"] }]
9959
10144
  }], ctorParameters: function () {
9960
- return [{ type: i1$1.TranslateService }, { type: TldTranslateConfigService }, { type: TldTranslateButtonService }, { type: TldAlertService }, { type: i4$1.Router }, { type: i4$1.ActivatedRoute }, { type: TldSystemService }, { type: TldTermCollectionsService }, { type: TldTranslateWebService }, { type: IconService }, { type: TranslationApiVersion, decorators: [{
10145
+ return [{ type: i1$1.TranslateService }, { type: TldTranslateConfigService }, { type: TldTranslateButtonService }, { type: TldAlertService }, { type: i4$1.Router }, { type: i4$1.ActivatedRoute }, { type: TldSystemService }, { type: TerminologyService }, { type: TldTranslateWebService }, { type: IconService }, { type: TranslationApiVersion, decorators: [{
9961
10146
  type: Inject,
9962
10147
  args: [TRANSLATION_API_VERSION_TOKEN]
9963
10148
  }] }];
@@ -10278,6 +10463,123 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10278
10463
  args: [TldTranslateBodyComponent]
10279
10464
  }] } });
10280
10465
 
10466
+ class MtTermV1Service {
10467
+ constructor(http, config) {
10468
+ this.http = http;
10469
+ this.config = config;
10470
+ }
10471
+ add(engineId, collection) {
10472
+ const url = `${this.config.coreConfig.translationServiceUrl}AttachTermsFromTildeTerm`;
10473
+ return this.http.get(url, { params: { systemID: engineId, tildeTermColectionID: collection.termId } })
10474
+ .pipe(map(data => this.convertToCombinedCollection(data)));
10475
+ }
10476
+ getList(engineId) {
10477
+ const headers = Common.getAuthHeaders(this.config);
10478
+ const url = `${this.config.coreConfig.translationServiceUrl}GetDetailedSystemTermCorpora`;
10479
+ const params = { systemID: engineId };
10480
+ return this.http.get(url, { headers, params }).pipe(map((data) => {
10481
+ const mtCollections = [];
10482
+ data.forEach((collection) => {
10483
+ mtCollections.push(this.convertToCombinedCollection(collection));
10484
+ });
10485
+ return mtCollections;
10486
+ }));
10487
+ }
10488
+ remove(engineId, collection) {
10489
+ throw new Error("not Implemented");
10490
+ }
10491
+ convertToCombinedCollection(collection) {
10492
+ const convertedMtCollection = {
10493
+ id: collection.CorpusId,
10494
+ termId: collection.TildeTermId,
10495
+ lastUpdated: new Date(collection.AttachmentDateTime),
10496
+ name: collection.Title,
10497
+ // any because enums should overlap
10498
+ status: collection.Status
10499
+ };
10500
+ return new CombinedCollection(null, convertedMtCollection);
10501
+ }
10502
+ }
10503
+ MtTermV1Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV1Service, deps: [{ token: i1$3.HttpClient }, { token: TldTranslateConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
10504
+ MtTermV1Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV1Service, providedIn: 'root' });
10505
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV1Service, decorators: [{
10506
+ type: Injectable,
10507
+ args: [{
10508
+ providedIn: 'root'
10509
+ }]
10510
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
10511
+
10512
+ class MtTermV2Service {
10513
+ constructor(config, engineTermApi) {
10514
+ this.config = config;
10515
+ this.engineTermApi = engineTermApi;
10516
+ this.baseUrl = this.config.termConfig.engineTermUrl;
10517
+ }
10518
+ add(engineId, collection) {
10519
+ if (!collection.mtCollection) {
10520
+ const params = {
10521
+ collectionId: collection.termId,
10522
+ default: collection.editables.default,
10523
+ collectionSource: collection.source,
10524
+ scope: collection.editables.scope
10525
+ };
10526
+ return this.engineTermApi.add(engineId, params)
10527
+ .pipe(map(collection => this.convertToCombinedCollection(collection)));
10528
+ }
10529
+ else {
10530
+ const params = {
10531
+ default: collection.editables.default,
10532
+ scope: collection.editables.scope
10533
+ };
10534
+ return this.engineTermApi.update(engineId, collection.termId, params)
10535
+ .pipe(map(collection => this.convertToCombinedCollection(collection)));
10536
+ }
10537
+ }
10538
+ getList(engineId) {
10539
+ return this.engineTermApi.getList(engineId)
10540
+ .pipe(map((collections) => {
10541
+ var _a;
10542
+ const converted = [];
10543
+ (_a = collections === null || collections === void 0 ? void 0 : collections.termCollections) === null || _a === void 0 ? void 0 : _a.forEach((collection) => {
10544
+ converted.push(this.convertToCombinedCollection(collection));
10545
+ });
10546
+ return converted;
10547
+ }));
10548
+ }
10549
+ remove(engineId, collection) {
10550
+ return this.engineTermApi.remove(engineId, collection.mtCollection.id).pipe(map(collection => this.convertToCombinedCollection(collection)));
10551
+ }
10552
+ convertToCombinedCollection(collection) {
10553
+ const convertedMtCollection = {
10554
+ id: collection.id,
10555
+ lastUpdated: new Date(collection.collectionUpdatedAt),
10556
+ name: collection.name,
10557
+ status: collection.status,
10558
+ termId: collection.collectionId,
10559
+ default: collection.default,
10560
+ scope: collection.scope
10561
+ };
10562
+ return new CombinedCollection(null, convertedMtCollection);
10563
+ }
10564
+ }
10565
+ MtTermV2Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV2Service, deps: [{ token: TldTranslateConfigService }, { token: EningeTermApiService }], target: i0.ɵɵFactoryTarget.Injectable });
10566
+ MtTermV2Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV2Service, providedIn: 'root' });
10567
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV2Service, decorators: [{
10568
+ type: Injectable,
10569
+ args: [{
10570
+ providedIn: 'root'
10571
+ }]
10572
+ }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: EningeTermApiService }]; } });
10573
+
10574
+ function mtTermApiFactory(version, config, http, engineTermService) {
10575
+ if (version === TranslationApiVersion.V1) {
10576
+ return new MtTermV1Service(http, config);
10577
+ }
10578
+ else {
10579
+ return new MtTermV2Service(config, engineTermService);
10580
+ }
10581
+ }
10582
+
10281
10583
  var FileV2Category;
10282
10584
  (function (FileV2Category) {
10283
10585
  FileV2Category["SOURCE"] = "SOURCE";
@@ -10310,7 +10612,7 @@ class FileApiV2Service {
10310
10612
  formData.append("domain", properties.system.domain);
10311
10613
  }
10312
10614
  const headers = Common.GetApiV2AuthHeaders(this.config);
10313
- return this.http.post(this.url, formData, { headers }).pipe(map(response => response.id));
10615
+ return this.http.post(this.url, formData, { headers }).pipe(map$1(response => response.id));
10314
10616
  }
10315
10617
  remove(properties) {
10316
10618
  if (properties.file.translationStartedOnServer) {
@@ -10332,7 +10634,7 @@ class FileApiV2Service {
10332
10634
  }
10333
10635
  getStatus(properties) {
10334
10636
  const headers = Common.GetApiV2AuthHeaders(this.config);
10335
- return this.http.get(`${this.url}/${properties.file.id}`, { headers }).pipe(map((response) => {
10637
+ return this.http.get(`${this.url}/${properties.file.id}`, { headers }).pipe(map$1((response) => {
10336
10638
  const extensions = [];
10337
10639
  response.files.forEach((file) => {
10338
10640
  if (file.category.toUpperCase() === FileV2Category.TRANSLATED) {
@@ -10380,7 +10682,7 @@ class TldSystemApiV2Service {
10380
10682
  getSystemList() {
10381
10683
  var _a, _b;
10382
10684
  const headers = Common.GetApiV2AuthHeaders(this.config);
10383
- return this.http.get((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.apiV2Config) === null || _b === void 0 ? void 0 : _b.systemListUrl, { headers }).pipe(map((response) => {
10685
+ return this.http.get((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.apiV2Config) === null || _b === void 0 ? void 0 : _b.systemListUrl, { headers }).pipe(map$1((response) => {
10384
10686
  const systems = [];
10385
10687
  const uniqueDirections = [];
10386
10688
  const autoDomainSystems = [];
@@ -10393,7 +10695,9 @@ class TldSystemApiV2Service {
10393
10695
  sourceLanguage: system.srcLang,
10394
10696
  targetLanguage: system.trgLang,
10395
10697
  translationApiVersion: TranslationApiVersion.V2,
10396
- vendor: system.vendor
10698
+ vendor: system.vendor,
10699
+ // hardcoded since there is no param yet for determinig which systems support terms.
10700
+ includesTerminology: true
10397
10701
  };
10398
10702
  systems.push(newSystem);
10399
10703
  if (((_a = this.config.apiV2Config) === null || _a === void 0 ? void 0 : _a.autoDomainDetection) && !uniqueDirections.includes(languageDirections)) {
@@ -10446,7 +10750,7 @@ class TldSystemApiService {
10446
10750
  const params = {
10447
10751
  appID: this.config.coreConfig.appId,
10448
10752
  };
10449
- return this.http.get((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.coreConfig) === null || _b === void 0 ? void 0 : _b.systemListUrl, { headers, params }).pipe(map((response) => {
10753
+ return this.http.get((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.coreConfig) === null || _b === void 0 ? void 0 : _b.systemListUrl, { headers, params }).pipe(map$1((response) => {
10450
10754
  const systems = [];
10451
10755
  response.System.forEach(element => {
10452
10756
  var _a;
@@ -10519,7 +10823,7 @@ class TldTranslateTextApiV2Service {
10519
10823
  if (this.config.textConfig.checkSourceGrammar && this.config.textConfig.grammarCheckLanguages.includes(params.system.sourceLanguage)) {
10520
10824
  this.checkAndAttachGrammarToTree(params.text, params.system.sourceLanguage, sourceTree);
10521
10825
  }
10522
- return this.http.post(this.config.apiV2Config.translationUrl, requestParams, { headers }).pipe(map((translationResponse) => {
10826
+ return this.http.post(this.config.apiV2Config.translationUrl, requestParams, { headers }).pipe(map$1((translationResponse) => {
10523
10827
  const systemId = `${requestParams.srcLang}-${requestParams.trgLang}-${translationResponse.domain}`;
10524
10828
  const originalTranslation = translationResponse.translations[0].translation;
10525
10829
  const targetTree = {
@@ -10598,8 +10902,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10598
10902
  }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
10599
10903
 
10600
10904
  class TldTranslateTextApiService {
10601
- constructor(collectionService, http, config, alerts) {
10602
- this.collectionService = collectionService;
10905
+ constructor(terminologyService, http, config, alerts) {
10906
+ this.terminologyService = terminologyService;
10603
10907
  this.http = http;
10604
10908
  this.config = config;
10605
10909
  this.alerts = alerts;
@@ -10636,11 +10940,11 @@ class TldTranslateTextApiService {
10636
10940
  systemID: requestParams.system.id,
10637
10941
  text: requestParams.text,
10638
10942
  };
10639
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
10943
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
10640
10944
  if (selectedCollectionId) {
10641
10945
  params.options += `,termCorpusId=${selectedCollectionId}`;
10642
10946
  }
10643
- return this.http.get((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.textConfig) === null || _b === void 0 ? void 0 : _b.translationUrl, { headers: headers, params: params }).pipe(map((response) => {
10947
+ return this.http.get((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.textConfig) === null || _b === void 0 ? void 0 : _b.translationUrl, { headers: headers, params: params }).pipe(map$1((response) => {
10644
10948
  if (response.ErrorMessage) {
10645
10949
  this.alerts.unhandeledError(response.ErrorMessage);
10646
10950
  throw response.ErrorMessage;
@@ -10768,21 +11072,21 @@ class TldTranslateTextApiService {
10768
11072
  });
10769
11073
  }
10770
11074
  }
10771
- TldTranslateTextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, deps: [{ token: TldTermCollectionsService }, { token: i1$3.HttpClient }, { token: TldTranslateConfigService }, { token: TldAlertService }], target: i0.ɵɵFactoryTarget.Injectable });
11075
+ TldTranslateTextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, deps: [{ token: TerminologyService }, { token: i1$3.HttpClient }, { token: TldTranslateConfigService }, { token: TldAlertService }], target: i0.ɵɵFactoryTarget.Injectable });
10772
11076
  TldTranslateTextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, providedIn: 'root' });
10773
11077
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, decorators: [{
10774
11078
  type: Injectable,
10775
11079
  args: [{
10776
11080
  providedIn: 'root'
10777
11081
  }]
10778
- }], ctorParameters: function () { return [{ type: TldTermCollectionsService }, { type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TldAlertService }]; } });
11082
+ }], ctorParameters: function () { return [{ type: TerminologyService }, { type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TldAlertService }]; } });
10779
11083
 
10780
- function textApiServiceFactory(version, config, http, collectionsService, alerts) {
11084
+ function textApiServiceFactory(version, config, http, terminologyService, alerts) {
10781
11085
  if (version === TranslationApiVersion.V2) {
10782
11086
  return new TldTranslateTextApiV2Service(http, config);
10783
11087
  }
10784
11088
  else {
10785
- return new TldTranslateTextApiService(collectionsService, http, config, alerts);
11089
+ return new TldTranslateTextApiService(terminologyService, http, config, alerts);
10786
11090
  }
10787
11091
  }
10788
11092
 
@@ -10797,7 +11101,7 @@ class TldTranslateModule {
10797
11101
  TRANSLATION_API_VERSION_TOKEN,
10798
11102
  TldTranslateConfigService,
10799
11103
  HttpClient,
10800
- TldTermCollectionsService,
11104
+ TerminologyService,
10801
11105
  TldAlertService
10802
11106
  ]
10803
11107
  },
@@ -10808,10 +11112,20 @@ class TldTranslateModule {
10808
11112
  TRANSLATION_API_VERSION_TOKEN,
10809
11113
  TldTranslateConfigService,
10810
11114
  HttpClient,
10811
- TldTermCollectionsService,
11115
+ TerminologyService,
10812
11116
  TldAlertService
10813
11117
  ]
10814
11118
  },
11119
+ {
11120
+ provide: MT_TERM_API_TOKEN,
11121
+ useFactory: mtTermApiFactory,
11122
+ deps: [
11123
+ TRANSLATION_API_VERSION_TOKEN,
11124
+ TldTranslateConfigService,
11125
+ HttpClient,
11126
+ EningeTermApiService
11127
+ ]
11128
+ },
10815
11129
  ];
10816
11130
  if (translationApiVersion !== null) {
10817
11131
  providers.push({
@@ -10890,5 +11204,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10890
11204
  * Generated bundle index. Do not edit.
10891
11205
  */
10892
11206
 
10893
- export { AudioRecordService, Common, ConvertedCollectionTooltipKey, ConvertedCollectionType, ErrorCode, ExtensionDialogComponent, ExtensionDialogModule, ExtensionDialogService, FILE_API_SERVICE_TOKEN, FileCategories, FileExtensions, FileTranslationSubstatus, FileTypeIcons, FileTypes, HighlightParams, HighlightTreeComponent, IconService, MtCollectionsApiService, OPEN_CLOSE_BTN_ICONS_TOKEN, OpenExtensionDialogComponent, OpenedMenu, SYSTEM_SERVICE_TOKEN, SourceAndTargetWrapperComponent, TEXT_API_SERVICE_TOKEN, TLD_TRANSLATE_CONFIG_TOKEN, TRANSLATION_API_VERSION_TOKEN, TermApiService, TextToSpeechComponent, TextToSpeechModule, TextareaWithBackgroundComponent, TldAlertService, TldAudioModule, TldCommonModule, TldConvertedCollection, TldDictateComponent, TldDictionaryComponent, TldDocumentModule, TldDomainListComponent, TldFileTranslateBaseComponent, TldHighlightService, TldLangListComponent, TldListMenuComponent, TldLoaderComponent, TldMessageComponent, TldMessageType, TldOpenCloseButtonComponent, TldRecordComponent, TldSystemService, TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCollectionsService, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermModule, TldTermPromotionComponent, TldTextModule, TldTooltipModule, TldTranslateAchievementComponent, TldTranslateButtonComponent, TldTranslateComponent, TldTranslateConfigService, TldTranslateFileApiService, TldTranslateFileComponent, TldTranslateFileDownloadButtonComponent, TldTranslateFileMultipleComponent, TldTranslateFileService, TldTranslateImageConversionHelpComponent, TldTranslateModule, TldTranslatePdfConversionHelpComponent, TldTranslateSourceComponent, TldTranslateSuggestComponent, TldTranslateSuggestDialogComponent, TldTranslateSwitcherComponent, TldTranslateTextComponent, TldTranslateTextService, TldTranslateWebsiteComponent, TldVoiceInputApiService, TldVoiceInputService, TldWebModule, TranslateDomainPipe, TranslationApiVersion, TranslationStatuss, TranslationSystemPickerButtonComponent, TranslationSystemPickerComponent, TranslationSystemPickerDropdownComponent, TranslationSystemPickerFilterComponent, TranslationSystemPickerLanguageListComponent, TranslationSystemPickerService, VoiceToTextState, availableLanguages, languageMenuVersion };
11207
+ export { AudioRecordService, CombinedCollection, CombinedCollectionTooltipKey, Common, CreateCollectionComponent, EngineTermCollectionScope, EngineTermCollectionSource, EngineTermCollectionStatus, EningeTermApiService, ErrorCode, ExtensionDialogComponent, ExtensionDialogModule, ExtensionDialogService, FILE_API_SERVICE_TOKEN, FileCategories, FileExtensions, FileTranslationSubstatus, FileTypeIcons, FileTypes, HighlightParams, HighlightTreeComponent, IconService, MT_TERM_API_TOKEN, MtCollectionStatus, OPEN_CLOSE_BTN_ICONS_TOKEN, OpenExtensionDialogComponent, OpenedMenu, SYSTEM_SERVICE_TOKEN, SourceAndTargetWrapperComponent, TEXT_API_SERVICE_TOKEN, TLD_TRANSLATE_CONFIG_TOKEN, TRANSLATION_API_VERSION_TOKEN, TermApiService, TerminologyService, TextToSpeechComponent, TextToSpeechModule, TextareaWithBackgroundComponent, TldAlertService, TldAudioModule, TldCommonModule, TldDictateComponent, TldDictionaryComponent, TldDocumentModule, TldDomainListComponent, TldFileTranslateBaseComponent, TldHighlightService, TldLangListComponent, TldListMenuComponent, TldLoaderComponent, TldMessageComponent, TldMessageType, TldOpenCloseButtonComponent, TldRecordComponent, TldSystemService, TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermModule, TldTermPromotionComponent, TldTextModule, TldTooltipModule, TldTranslateAchievementComponent, TldTranslateButtonComponent, TldTranslateComponent, TldTranslateConfigService, TldTranslateFileApiService, TldTranslateFileComponent, TldTranslateFileDownloadButtonComponent, TldTranslateFileMultipleComponent, TldTranslateFileService, TldTranslateImageConversionHelpComponent, TldTranslateModule, TldTranslatePdfConversionHelpComponent, TldTranslateSourceComponent, TldTranslateSuggestComponent, TldTranslateSuggestDialogComponent, TldTranslateSwitcherComponent, TldTranslateTextComponent, TldTranslateTextService, TldTranslateWebsiteComponent, TldVoiceInputApiService, TldVoiceInputService, TldWebModule, TranslateDomainPipe, TranslationApiVersion, TranslationStatuss, TranslationSystemPickerButtonComponent, TranslationSystemPickerComponent, TranslationSystemPickerDropdownComponent, TranslationSystemPickerFilterComponent, TranslationSystemPickerLanguageListComponent, TranslationSystemPickerService, VoiceToTextState, availableLanguages, languageMenuVersion };
10894
11208
  //# sourceMappingURL=tilde-nlp-ngx-translate.mjs.map