@tilde-nlp/ngx-translate 2.0.2 → 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 (131) 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-document/services/tld-translate-file.service.mjs +6 -2
  18. package/esm2020/lib/modules/tld-term/create-collection/create-collection.component.mjs +51 -0
  19. package/esm2020/lib/modules/tld-term/index.mjs +2 -1
  20. package/esm2020/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1-status.enum.mjs +7 -0
  21. package/esm2020/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1.model.mjs +2 -0
  22. package/esm2020/lib/modules/tld-term/services/api-v1/mt-term-v1.service.mjs +53 -0
  23. package/esm2020/lib/modules/tld-term/services/api-v2/mt-term-v2.service.mjs +67 -0
  24. package/esm2020/lib/modules/tld-term/services/engine-term/eninge-term-api.service.mjs +32 -0
  25. package/esm2020/lib/modules/tld-term/services/engine-term/models/add-engine-terms-request-params.model.mjs +2 -0
  26. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-list.model.mjs +2 -0
  27. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-scope.enum.mjs +6 -0
  28. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-source.enum.mjs +6 -0
  29. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection-status.enum.mjs +11 -0
  30. package/esm2020/lib/modules/tld-term/services/engine-term/models/engine-term-collection.model.mjs +2 -0
  31. package/esm2020/lib/modules/tld-term/services/engine-term/models/index.mjs +8 -0
  32. package/esm2020/lib/modules/tld-term/services/engine-term/models/update-engine-terms-request-params.model.mjs +2 -0
  33. package/esm2020/lib/modules/tld-term/services/index.mjs +4 -4
  34. package/esm2020/lib/modules/tld-term/services/models/combined-collection-tooltip-key.enum.mjs +6 -0
  35. package/esm2020/lib/modules/tld-term/services/models/combined-collection.model.mjs +190 -0
  36. package/esm2020/lib/modules/tld-term/services/models/index.mjs +6 -0
  37. package/esm2020/lib/modules/tld-term/services/models/mt-collection-status.enum.mjs +14 -0
  38. package/esm2020/lib/modules/tld-term/services/models/mt-collection.model.mjs +2 -0
  39. package/esm2020/lib/modules/tld-term/services/models/mt-term-service.model.mjs +2 -0
  40. package/esm2020/lib/modules/tld-term/services/term-api/index.mjs +3 -0
  41. package/esm2020/lib/modules/tld-term/services/term-api/models/index.mjs +3 -0
  42. package/esm2020/lib/modules/tld-term/services/term-api/models/tld-term-collection-languages.model.mjs +2 -0
  43. package/esm2020/lib/modules/tld-term/services/term-api/models/tld-term-collection.model.mjs +2 -0
  44. package/esm2020/lib/modules/tld-term/services/term-api/term-api.service.mjs +58 -0
  45. package/esm2020/lib/modules/tld-term/services/terminology.service.mjs +292 -0
  46. package/esm2020/lib/modules/tld-term/tld-term-collection/tld-term-collection.component.mjs +27 -12
  47. package/esm2020/lib/modules/tld-term/tld-term-collection-list/tld-term-collection-list.component.mjs +24 -51
  48. package/esm2020/lib/modules/tld-term/tld-term-menu/tld-term-menu.component.mjs +19 -12
  49. package/esm2020/lib/modules/tld-term/tld-term.module.mjs +6 -5
  50. package/esm2020/lib/modules/tld-text/services/api/tld-translate-text-api.service.mjs +7 -7
  51. package/esm2020/lib/modules/tld-tooltip/services/api-v2/tld-system-api-v2.service.mjs +4 -2
  52. package/esm2020/lib/modules/tld-web/tld-translate-web/tld-translate-web.component.mjs +8 -8
  53. package/esm2020/lib/tld-translate.module.mjs +17 -4
  54. package/esm2020/public-api.mjs +4 -2
  55. package/fesm2015/tilde-nlp-ngx-translate.mjs +834 -517
  56. package/fesm2015/tilde-nlp-ngx-translate.mjs.map +1 -1
  57. package/fesm2020/tilde-nlp-ngx-translate.mjs +797 -501
  58. package/fesm2020/tilde-nlp-ngx-translate.mjs.map +1 -1
  59. package/lib/factories/file-api-service.factory.d.ts +2 -2
  60. package/lib/factories/mt-term-term-api.factory.d.ts +7 -0
  61. package/lib/factories/text-api-service.factory.d.ts +3 -3
  62. package/lib/i18n/de.d.ts +0 -5
  63. package/lib/i18n/en.d.ts +1 -5
  64. package/lib/i18n/et.d.ts +0 -5
  65. package/lib/i18n/fi.d.ts +0 -5
  66. package/lib/i18n/lt.d.ts +0 -5
  67. package/lib/i18n/lv.d.ts +0 -5
  68. package/lib/i18n/pl.d.ts +0 -5
  69. package/lib/i18n/sv.d.ts +0 -3
  70. package/lib/injection-tokens/index.d.ts +1 -0
  71. package/lib/injection-tokens/mt-term-api.token.d.ts +1 -0
  72. package/lib/modules/tld-common/models/configs/tld-term-config.model.d.ts +1 -0
  73. package/lib/modules/tld-document/services/api/file-api.service.d.ts +3 -3
  74. package/lib/modules/tld-term/create-collection/create-collection.component.d.ts +17 -0
  75. package/lib/modules/tld-term/index.d.ts +1 -0
  76. 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
  77. package/lib/modules/tld-term/services/api-v1/models/mt-term-collection-v1.model.d.ts +12 -0
  78. package/lib/modules/tld-term/services/api-v1/mt-term-v1.service.d.ts +17 -0
  79. package/lib/modules/tld-term/services/api-v2/mt-term-v2.service.d.ts +18 -0
  80. package/lib/modules/tld-term/services/engine-term/eninge-term-api.service.d.ts +17 -0
  81. package/lib/modules/tld-term/services/engine-term/models/add-engine-terms-request-params.model.d.ts +8 -0
  82. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-list.model.d.ts +4 -0
  83. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-scope.enum.d.ts +4 -0
  84. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-source.enum.d.ts +4 -0
  85. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection-status.enum.d.ts +9 -0
  86. package/lib/modules/tld-term/services/engine-term/models/engine-term-collection.model.d.ts +14 -0
  87. package/lib/modules/tld-term/services/engine-term/models/index.d.ts +7 -0
  88. package/lib/modules/tld-term/services/engine-term/models/update-engine-terms-request-params.model.d.ts +5 -0
  89. package/lib/modules/tld-term/services/index.d.ts +3 -3
  90. package/lib/modules/tld-term/services/models/combined-collection-tooltip-key.enum.d.ts +4 -0
  91. package/lib/modules/tld-term/services/models/combined-collection.model.d.ts +87 -0
  92. package/lib/modules/tld-term/services/models/index.d.ts +5 -0
  93. package/lib/modules/tld-term/services/models/mt-collection-status.enum.d.ts +11 -0
  94. package/lib/modules/tld-term/services/models/mt-collection.model.d.ts +14 -0
  95. package/lib/modules/tld-term/services/models/mt-term-service.model.d.ts +7 -0
  96. package/lib/modules/tld-term/services/term-api/index.d.ts +2 -0
  97. package/lib/modules/tld-term/services/term-api/models/index.d.ts +2 -0
  98. package/lib/modules/tld-term/{models/term-api → services/term-api/models}/tld-term-collection.model.d.ts +2 -2
  99. package/lib/modules/tld-term/services/term-api/term-api.service.d.ts +17 -0
  100. package/lib/modules/tld-term/services/terminology.service.d.ts +63 -0
  101. package/lib/modules/tld-term/tld-term-collection/tld-term-collection.component.d.ts +13 -4
  102. package/lib/modules/tld-term/tld-term-collection-list/tld-term-collection-list.component.d.ts +13 -17
  103. package/lib/modules/tld-term/tld-term-menu/tld-term-menu.component.d.ts +11 -7
  104. package/lib/modules/tld-term/tld-term.module.d.ts +13 -12
  105. package/lib/modules/tld-text/services/api/tld-translate-text-api.service.d.ts +3 -3
  106. package/lib/modules/tld-web/tld-translate-web/tld-translate-web.component.d.ts +3 -3
  107. package/package.json +1 -1
  108. package/public-api.d.ts +3 -1
  109. package/src/assets/webcomponent/tld-translate.js +1 -1
  110. package/tilde-nlp-ngx-translate-2.1.0.tgz +0 -0
  111. package/esm2020/lib/modules/tld-term/models/converted-collection-tooltip-key.model.mjs +0 -7
  112. package/esm2020/lib/modules/tld-term/models/converted-collection-type.model.mjs +0 -9
  113. package/esm2020/lib/modules/tld-term/models/index.mjs +0 -7
  114. package/esm2020/lib/modules/tld-term/models/mt-api/tld-mt-term-collection.model.mjs +0 -2
  115. package/esm2020/lib/modules/tld-term/models/mt-collection-status.model.mjs +0 -7
  116. package/esm2020/lib/modules/tld-term/models/term-api/tld-term-collection-languages.model.mjs +0 -2
  117. package/esm2020/lib/modules/tld-term/models/term-api/tld-term-collection.model.mjs +0 -2
  118. package/esm2020/lib/modules/tld-term/models/tld-converted-collection.model.mjs +0 -114
  119. package/esm2020/lib/modules/tld-term/services/mt-collections-api.service.mjs +0 -33
  120. package/esm2020/lib/modules/tld-term/services/term-api.service.mjs +0 -34
  121. package/esm2020/lib/modules/tld-term/services/tld-term-collections.service.mjs +0 -253
  122. package/lib/modules/tld-term/models/converted-collection-tooltip-key.model.d.ts +0 -5
  123. package/lib/modules/tld-term/models/converted-collection-type.model.d.ts +0 -7
  124. package/lib/modules/tld-term/models/index.d.ts +0 -6
  125. package/lib/modules/tld-term/models/mt-api/tld-mt-term-collection.model.d.ts +0 -15
  126. package/lib/modules/tld-term/models/tld-converted-collection.model.d.ts +0 -43
  127. package/lib/modules/tld-term/services/mt-collections-api.service.d.ts +0 -13
  128. package/lib/modules/tld-term/services/term-api.service.d.ts +0 -15
  129. package/lib/modules/tld-term/services/tld-term-collections.service.d.ts +0 -57
  130. package/tilde-nlp-ngx-translate-2.0.2.tgz +0 -0
  131. /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
@@ -4874,6 +4840,76 @@ var FileConversionTypes;
4874
4840
  FileConversionTypes["IMAGE"] = "IMAGE";
4875
4841
  })(FileConversionTypes || (FileConversionTypes = {}));
4876
4842
 
4843
+ var FileTypeIcons;
4844
+ (function (FileTypeIcons) {
4845
+ FileTypeIcons["WORD"] = "file_type_word";
4846
+ FileTypeIcons["WEB"] = "file_type_web";
4847
+ FileTypeIcons["OTHER"] = "file_type_other";
4848
+ FileTypeIcons["POWERPOINT"] = "file_type_powerpoint";
4849
+ FileTypeIcons["EXCEL"] = "file_type_excel";
4850
+ FileTypeIcons["OFFICE_OTHER"] = "file_type_office_other";
4851
+ FileTypeIcons["PDF"] = "file_type_pdf";
4852
+ FileTypeIcons["SCANNED"] = "file_type_scanned";
4853
+ FileTypeIcons["INTERCHANGE"] = "file_type_interchange";
4854
+ })(FileTypeIcons || (FileTypeIcons = {}));
4855
+
4856
+ var FileCategories;
4857
+ (function (FileCategories) {
4858
+ FileCategories["OFFICE"] = "OFFICE";
4859
+ FileCategories["SCANNED"] = "SCANNED";
4860
+ FileCategories["INTERCHANGE"] = "INTERCHANGE";
4861
+ FileCategories["WEB"] = "WEB";
4862
+ FileCategories["OTHER"] = "OTHER";
4863
+ })(FileCategories || (FileCategories = {}));
4864
+
4865
+ var FileTypes;
4866
+ (function (FileTypes) {
4867
+ FileTypes["WORD"] = "WORD";
4868
+ FileTypes["WEB"] = "WEB";
4869
+ FileTypes["OTHER"] = "OTHER";
4870
+ FileTypes["POWERPOINT"] = "POWERPOINT";
4871
+ FileTypes["EXCEL"] = "EXCEL";
4872
+ FileTypes["OFFICE_OTHER"] = "OFFICE_OTHER";
4873
+ FileTypes["PDF"] = "PDF";
4874
+ FileTypes["SCANNED"] = "SCANNED";
4875
+ FileTypes["INTERCHANGE"] = "INTERCHANGE";
4876
+ })(FileTypes || (FileTypes = {}));
4877
+
4878
+ var FileExtensions;
4879
+ (function (FileExtensions) {
4880
+ FileExtensions["DOC"] = "doc";
4881
+ FileExtensions["DOCX"] = "docx";
4882
+ FileExtensions["XLSX"] = "xlsx";
4883
+ FileExtensions["PPTX"] = "pptx";
4884
+ FileExtensions["ODT"] = "odt";
4885
+ FileExtensions["ODP"] = "odp";
4886
+ FileExtensions["ODS"] = "ods";
4887
+ FileExtensions["TXT"] = "txt";
4888
+ FileExtensions["RTF"] = "rtf";
4889
+ FileExtensions["PAGES"] = "pages";
4890
+ FileExtensions["SXW"] = "sxw";
4891
+ FileExtensions["JPG"] = "jpg";
4892
+ FileExtensions["JPEG"] = "jpeg";
4893
+ FileExtensions["PNG"] = "png";
4894
+ FileExtensions["BMP"] = "bmp";
4895
+ FileExtensions["PDF"] = "pdf";
4896
+ FileExtensions["SDLXLIFF"] = "sdlxliff";
4897
+ FileExtensions["SDLXLF"] = "sdlxlf";
4898
+ FileExtensions["TTX"] = "ttx";
4899
+ FileExtensions["TMX"] = "tmx";
4900
+ FileExtensions["XLF"] = "xlf";
4901
+ FileExtensions["XLIF"] = "xlif";
4902
+ FileExtensions["HTML"] = "html";
4903
+ FileExtensions["HTM"] = "htm";
4904
+ FileExtensions["JSON"] = "json";
4905
+ FileExtensions["XHTML"] = "xhtml";
4906
+ FileExtensions["XHT"] = "xht";
4907
+ FileExtensions["XLIFF"] = "xliff";
4908
+ FileExtensions["TEX"] = "tex";
4909
+ FileExtensions["TTL"] = "ttl";
4910
+ FileExtensions["SRT"] = "srt";
4911
+ })(FileExtensions || (FileExtensions = {}));
4912
+
4877
4913
  class TldTranslateFileService {
4878
4914
  constructor(fileApi, alerts, sanitizer, config, tldSystem) {
4879
4915
  this.fileApi = fileApi;
@@ -5162,8 +5198,11 @@ class TldTranslateFileService {
5162
5198
  translationFile.filePreviewProgress = data.percentDone;
5163
5199
  }
5164
5200
  translatedDocPreview(translationFile) {
5201
+ var _a, _b;
5202
+ // show preview for original extension if exists, if not, then preview for docx, if not then try with original filename.
5203
+ const fileName = (_b = (_a = translationFile.availableExtensions.find(ext => ext.extension === FileExtensions.DOCX)) === null || _a === void 0 ? void 0 : _a.fileName) !== null && _b !== void 0 ? _b : translationFile.originalFileName;
5165
5204
  const params = {
5166
- fileName: translationFile.originalFileName,
5205
+ fileName: fileName,
5167
5206
  translationDocId: translationFile.id
5168
5207
  };
5169
5208
  this.fileApi.translatedDocumentPreview(params)
@@ -5646,140 +5685,250 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
5646
5685
  }]
5647
5686
  }] });
5648
5687
 
5649
- /**
5650
- * Enumerator to determine if collection imported from term api or mt
5651
- */
5652
- var ConvertedCollectionType;
5653
- (function (ConvertedCollectionType) {
5654
- ConvertedCollectionType[ConvertedCollectionType["Term"] = 0] = "Term";
5655
- ConvertedCollectionType[ConvertedCollectionType["MT"] = 1] = "MT";
5656
- })(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 = {}));
5657
5716
 
5658
5717
  var MtCollectionStatus;
5659
5718
  (function (MtCollectionStatus) {
5719
+ MtCollectionStatus["QUEUING"] = "Queuing";
5720
+ MtCollectionStatus["FETCHING"] = "Fetching";
5721
+ MtCollectionStatus["PREPROCESSING"] = "Preprocessing";
5722
+ MtCollectionStatus["DELETING"] = "Deleting";
5660
5723
  MtCollectionStatus["READY"] = "Ready";
5724
+ MtCollectionStatus["DELETED"] = "Deleted";
5661
5725
  MtCollectionStatus["PROCESSING"] = "Processing";
5662
5726
  MtCollectionStatus["ERROR"] = "Error";
5727
+ // basic status created in frontend
5728
+ MtCollectionStatus["NOT_IN_USE"] = "NotInUse";
5663
5729
  })(MtCollectionStatus || (MtCollectionStatus = {}));
5664
5730
 
5665
- var ConvertedCollectionTooltipKey;
5666
- (function (ConvertedCollectionTooltipKey) {
5667
- ConvertedCollectionTooltipKey["NO_ENTRIES"] = "NO_ENTRIES";
5668
- ConvertedCollectionTooltipKey["IMPORTING"] = "IMPORTING";
5669
- ConvertedCollectionTooltipKey["SYNCING"] = "SYNCING";
5670
- })(ConvertedCollectionTooltipKey || (ConvertedCollectionTooltipKey = {}));
5671
-
5672
5731
  /**
5673
- * 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.
5674
5733
  */
5675
- class TldConvertedCollection {
5676
- constructor(obj, sourceLanguageCode, targetLanguageCode) {
5677
- this.sourceLanguageCode = sourceLanguageCode;
5678
- this.targetLanguageCode = targetLanguageCode;
5679
- this.isSynchronized = true;
5680
- if (this.isTldCorpus(obj)) {
5681
- 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
+ }
5682
5756
  }
5683
- else {
5684
- 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;
5685
5768
  }
5769
+ return null;
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;
5686
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
+ */
5687
5780
  get syncButtonVissible() {
5688
- 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);
5689
5783
  }
5784
+ /**
5785
+ * If not ready or error, then collection is importing.
5786
+ */
5690
5787
  get isImporting() {
5691
- 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);
5692
5790
  }
5693
5791
  ;
5694
- static findExistingCollectionFromList(termCollections, collection) {
5695
- for (const col of termCollections) {
5696
- if ((col.id && col.id === collection.id)
5697
- || (collection.termId && col.termId === collection.termId)) {
5698
- return col;
5699
- }
5700
- }
5701
- 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;
5702
5798
  }
5703
- update(obj) {
5704
- if (obj.importedFrom === ConvertedCollectionType.MT) {
5705
- if (obj.mtStatus !== MtCollectionStatus.ERROR) {
5706
- this.errorKey = null;
5707
- }
5708
- this.id = obj.id;
5709
- this.mtStatus = obj.mtStatus;
5710
- this.mtAttachmentDateTime = obj.mtAttachmentDateTime;
5711
- this.mtEntryCount = obj.mtEntryCount;
5712
- }
5713
- else if (obj.importedFrom === ConvertedCollectionType.Term) {
5714
- this.termId = obj.termId;
5715
- this.languagesString = obj.languagesString;
5716
- this.termModifiedDate = obj.termModifiedDate;
5717
- this.entryCount = obj.entryCount;
5718
- 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;
5719
5849
  }
5720
- this.isSynchronized = this.isTermSynchronizedWithMT();
5721
- if (this.entryCount === 0 && this.termId !== null) {
5722
- this.tooltipKey = ConvertedCollectionTooltipKey.NO_ENTRIES;
5850
+ if (collection === null || collection === void 0 ? void 0 : collection.mtCollection) {
5851
+ this.mtCollection = collection.mtCollection;
5723
5852
  }
5724
- else if (this.isImporting && this.mtEntryCount === 0) {
5725
- this.tooltipKey = ConvertedCollectionTooltipKey.IMPORTING;
5853
+ if (initialRefresh) {
5854
+ this.updateEditables();
5726
5855
  }
5727
- else if (this.isImporting) {
5728
- 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;
5729
5872
  }
5730
- else {
5731
- 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;
5732
5876
  }
5877
+ return false;
5733
5878
  }
5734
- deletedFromTermApi() {
5735
- this.termId = null;
5736
- this.languagesString = null;
5737
- this.termModifiedDate = null;
5738
- this.entryCount = null;
5879
+ /**
5880
+ * Deletes term collection and its properties.
5881
+ */
5882
+ deleteTerms() {
5883
+ this.termCollection = null;
5884
+ this.update(null);
5739
5885
  }
5740
- static convertCollections(collections, sourceLanguage, targetLanguage) {
5741
- const converted = [];
5742
- collections.forEach((collection) => {
5743
- converted.push(new TldConvertedCollection(collection, sourceLanguage, targetLanguage));
5744
- });
5745
- return converted;
5886
+ /**
5887
+ * Deletes mt collection and its properties.
5888
+ */
5889
+ deleteMT() {
5890
+ this.mtCollection = null;
5891
+ this.update(null);
5746
5892
  }
5747
- fromTermApi(obj) {
5893
+ //#region Private methods
5894
+ updateIsSynchronized() {
5748
5895
  var _a, _b;
5749
- this.termId = obj.id.toString();
5750
- this.title = obj.name;
5751
- this.importedFrom = ConvertedCollectionType.Term;
5752
- this.termModifiedDate = new Date(obj.modifyDate);
5753
- const language = (_a = obj.languages) === null || _a === void 0 ? void 0 : _a.find(lang => lang.id.toLowerCase() === this.sourceLanguageCode.toLowerCase());
5754
- this.entryCount = (_b = language === null || language === void 0 ? void 0 : language.count) !== null && _b !== void 0 ? _b : 0;
5755
- this.languagesString = obj.languages.filter(lang => lang.id !== this.sourceLanguageCode && lang.count > 0)
5756
- .map(lang => lang.id.toUpperCase()).join(", ");
5757
- }
5758
- fromTldMTCollection(obj) {
5759
- this.id = obj.CorpusId;
5760
- this.title = obj.Title;
5761
- this.importedFrom = ConvertedCollectionType.MT;
5762
- this.mtAttachmentDateTime = new Date(obj.AttachmentDateTime);
5763
- this.termId = obj.TildeTermId;
5764
- this.mtStatus = obj.Status;
5765
- this.mtPreparedDateTime = obj.PreparedDateTime;
5766
- this.mtEntryCount = obj.Count;
5767
- }
5768
- isTldCorpus(obj) {
5769
- return obj.TildeTermId !== undefined;
5770
- }
5771
- /**
5772
- * Check if the newest version of the term collection is synchronized from Term portal.
5773
- * Note. Term collections that are not linked from Term portal are considered as synchronized.
5774
- */
5775
- isTermSynchronizedWithMT() {
5776
5896
  let isSynchronized = true;
5777
- if (this.termModifiedDate && this.mtAttachmentDateTime) {
5778
- 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;
5779
5901
  }
5780
- return isSynchronized;
5902
+ this._isSynchronized = isSynchronized;
5781
5903
  }
5782
- }
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];
5783
5932
 
5784
5933
  class TermApiService {
5785
5934
  constructor(config, http) {
@@ -5794,10 +5943,34 @@ class TermApiService {
5794
5943
  name: collectionName,
5795
5944
  defaultLanguages
5796
5945
  };
5797
- 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
+ }));
5950
+ }
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;
5798
5970
  }
5799
- getCollectionList(sourceLanguageCode, targetLanguageCode) {
5800
- return this.http.get(this.url).pipe(map((collections) => { return TldConvertedCollection.convertCollections(collections, sourceLanguageCode, targetLanguageCode); }));
5971
+ convertToCombinedCollection(collection) {
5972
+ collection.modifyDate = new Date(collection.modifyDate);
5973
+ return new CombinedCollection(collection, null);
5801
5974
  }
5802
5975
  }
5803
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 });
@@ -5809,52 +5982,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
5809
5982
  }]
5810
5983
  }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: i1$3.HttpClient }]; } });
5811
5984
 
5812
- class MtCollectionsApiService {
5813
- constructor(http, config) {
5814
- this.http = http;
5815
- this.config = config;
5816
- }
5817
- attachTermsFromTildeTerm(systemId, tildeTermCollectionId) {
5818
- const params = { systemID: systemId, tildeTermColectionID: tildeTermCollectionId };
5819
- const url = `${this.config.coreConfig.translationServiceUrl}AttachTermsFromTildeTerm`;
5820
- return this.http.get(url, { params });
5821
- }
5822
- loadMTCollections(systemId, sourceLanguage, targetLanguage) {
5823
- const headers = Common.getAuthHeaders(this.config);
5824
- const url = `${this.config.coreConfig.translationServiceUrl}GetDetailedSystemTermCorpora`;
5825
- const params = { systemID: systemId };
5826
- return this.http.get(url, { headers, params }).pipe(map((collections) => { return TldConvertedCollection.convertCollections(collections, sourceLanguage, targetLanguage); }));
5827
- }
5828
- }
5829
- 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 });
5830
- MtCollectionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, providedIn: 'root' });
5831
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, decorators: [{
5832
- type: Injectable,
5833
- args: [{
5834
- providedIn: 'root'
5835
- }]
5836
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
5837
-
5838
- class TldTermCollectionsService {
5839
- constructor(config, tldSystem, termApi, mtApi) {
5985
+ class TerminologyService {
5986
+ constructor(config, termApi, mtApi) {
5840
5987
  this.config = config;
5841
- this.tldSystem = tldSystem;
5842
5988
  this.termApi = termApi;
5843
5989
  this.mtApi = mtApi;
5844
5990
  this._selected = null;
5991
+ this.onDataUpdate = new Subject();
5845
5992
  this.LOCAL_STORAGE_KEY = "systemLastCollections";
5846
- this.tldSystem.getActiveData()
5847
- .subscribe((active) => {
5848
- this.sourceLanguageCode = active === null || active === void 0 ? void 0 : active.sourceLang.lang;
5849
- this.targetLanguageCode = active === null || active === void 0 ? void 0 : active.targetLang.lang;
5850
- this.activeSystemId = (active === null || active === void 0 ? void 0 : active.systemId) || null;
5851
- this._collections = new Set();
5852
- // avoiding setter, so the null value is not storeed in location since it is not by user action
5853
- this._selected = null;
5854
- if (active && this.tldSystem.isTerminologySupported(active === null || active === void 0 ? void 0 : active.system)) {
5855
- this.refreshCollections(true);
5856
- }
5857
- });
5858
5993
  }
5859
5994
  get selected() { return this._selected; }
5860
5995
  set selected(val) {
@@ -5863,15 +5998,15 @@ class TldTermCollectionsService {
5863
5998
  if (!this._selected) {
5864
5999
  return;
5865
6000
  }
5866
- if (!this._selected.id) {
5867
- this.addCollectionToSystem(this._selected);
6001
+ if (!this._selected.mtCollection) {
6002
+ this.addToEngine(this._selected);
5868
6003
  }
5869
6004
  }
5870
- get collections() {
5871
- return this._collections;
6005
+ get hasAnyCollections() {
6006
+ return this._hasAnyCollections;
5872
6007
  }
5873
- get isRefreshingCollections() {
5874
- return this._isRefreshingCollections;
6008
+ get shouldShowPromotion() {
6009
+ return !this.hasAnyCollections && !this.hasEditPermissions;
5875
6010
  }
5876
6011
  get canCreateCollections() {
5877
6012
  return this.config.termConfig.canCreateCollection;
@@ -5880,101 +6015,129 @@ class TldTermCollectionsService {
5880
6015
  var _a;
5881
6016
  return ((_a = this.config) === null || _a === void 0 ? void 0 : _a.coreConfig.isAuth) && this.canCreateCollections && this.config.termConfig.isTermPortalSupported;
5882
6017
  }
5883
- get hasAnyCollections() {
5884
- return this._hasAnyCollections;
6018
+ get isRefreshingCollections() {
6019
+ return this._isRefreshingCollections;
5885
6020
  }
5886
- get shouldShowPromotion() {
5887
- return !this.hasAnyCollections && !this.hasEditPermissions;
6021
+ get collections() {
6022
+ return this._collections;
5888
6023
  }
5889
- onMenuOpen() {
5890
- this.menuOpened = true;
5891
- if (!this.shouldShowPromotion) {
5892
- 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);
5893
6036
  }
6037
+ return this.onDataUpdate.asObservable();
5894
6038
  }
5895
- onMenuClose() {
5896
- var _a;
5897
- this.menuOpened = false;
5898
- // if menu is closed, but selected collection still syncing, auto refresh should be kept opened.
5899
- if (((_a = this.selected) === null || _a === void 0 ? void 0 : _a.mtStatus) !== MtCollectionStatus.PROCESSING) {
5900
- this.stopAutoRefresh();
6039
+ refreshCollections(setSelectedFromLocalStorage = false, initialRefresh = false) {
6040
+ if (!this.engineId || !this.config.termConfig.isCollectionsActivated || this.isRefreshingCollections) {
6041
+ return;
5901
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
+ });
5902
6073
  }
5903
- addCollectionToSystem(collection) {
5904
- if (!collection || !collection.termId) {
6074
+ addToEngine(collection) {
6075
+ if (!collection || !collection.termCollection) {
5905
6076
  console.error("Trying to attach collection that has no tilde term id.");
5906
6077
  return;
5907
6078
  }
5908
- collection.mtStatus = MtCollectionStatus.PROCESSING;
5909
- collection.isSynchronized = true;
5910
- this.mtApi.attachTermsFromTildeTerm(this.activeSystemId, collection.termId)
5911
- .subscribe(() => { }, () => {
5912
- collection.mtStatus = MtCollectionStatus.ERROR;
5913
- 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
+ }
5914
6087
  });
5915
6088
  }
5916
- create(defaultLanguages, collectionName) {
5917
- 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
+ }
5918
6094
  this._collections.add(collection);
6095
+ this.emitDataUpdateEvent();
5919
6096
  this._hasAnyCollections = true;
5920
6097
  }));
5921
6098
  }
5922
- refreshCollections(setSelectedFromLocalStorage = false) {
5923
- if (!this.activeSystemId
5924
- || !this.config.termConfig.isCollectionsActivated) {
5925
- 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
+ });
5926
6105
  }
5927
- this._isRefreshingCollections = true;
5928
- const observables = [
5929
- this.termApi.getCollectionList(this.sourceLanguageCode, this.targetLanguageCode),
5930
- this.mtApi.loadMTCollections(this.activeSystemId, this.sourceLanguageCode, this.targetLanguageCode)
5931
- ];
5932
- forkJoin(observables).subscribe((response) => {
5933
- this.isAnyImporting = false;
5934
- // TO DO. Doesn't seem to be clean approach with syncing collections. Maybe some cleaner solution possible?
5935
- this.removeDeletedFromTerms(response[0]);
5936
- this.updateCollections([...response[0], ...response[1]]);
5937
- if (setSelectedFromLocalStorage) {
5938
- this.setSelectedFromLocalStorage();
5939
- }
5940
- this._isRefreshingCollections = false;
5941
- this.scheduleRefresh();
5942
- }, (error) => {
5943
- this._isRefreshingCollections = false;
5944
- // it is enough to show error only in console. No special thing is necessary.
5945
- console.error(error);
5946
- });
5947
6106
  }
5948
6107
  /**
5949
- *
5950
- * @returns selected collection id if it is allowed to use collection for translations
5951
- */
6108
+ *
6109
+ * @returns selected collection id if it is allowed to use collection for translations
6110
+ */
5952
6111
  selectedIdForTranslation() {
5953
- if (this.selected && (this.selected.mtPreparedDateTime || this.selected.mtStatus === MtCollectionStatus.READY)) {
5954
- 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;
5955
6115
  }
5956
6116
  return null;
5957
6117
  }
5958
- startAutoRefresh() {
5959
- this.isAutoRefreshingOn = true;
5960
- 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);
5961
6121
  }
5962
6122
  stopAutoRefresh() {
5963
- if (this.refreshTimeout) {
5964
- clearTimeout(this.refreshTimeout);
5965
- this.refreshTimeout = null;
5966
- }
5967
- 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
+ }));
5968
6131
  }
5969
6132
  scheduleRefresh(timeout) {
5970
6133
  var _a, _b;
5971
6134
  // if menu is closed and selected collection is not importing anymore - auto refreshing should be cancelled.
5972
- 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) {
5973
6136
  this.stopAutoRefresh();
5974
6137
  return;
5975
6138
  }
5976
- // if menu is opened, auto refresh should be on. If menu is closed, refresh needs to be done only if selected is importing.
5977
- 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)))) {
5978
6141
  const timeoutMs = timeout !== null && timeout !== void 0 ? timeout : (this.isAnyImporting ? this.config.termConfig.refreshTimeoutMsWhenImporting : this.config.termConfig.refreshTimeoutMs);
5979
6142
  this.refreshTimeout = setTimeout(() => {
5980
6143
  this.refreshTimeout = null;
@@ -5983,61 +6146,82 @@ class TldTermCollectionsService {
5983
6146
  }
5984
6147
  }
5985
6148
  /**
5986
- * 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.
5987
6152
  */
5988
- removeDeletedFromTerms(refreshedList) {
5989
- for (const collection of this.collections) {
5990
- if (!collection.termId) {
5991
- continue;
5992
- }
5993
- const exists = refreshedList.find(refreshedCollection => refreshedCollection.importedFrom === ConvertedCollectionType.Term && refreshedCollection.termId === collection.termId);
5994
- if (!exists) {
5995
- // Removes collection if it hasn't been imported.
5996
- if (!collection.id) {
5997
- this.collections.delete(collection);
5998
- }
5999
- else {
6000
- collection.deletedFromTermApi();
6001
- }
6002
- }
6003
- }
6004
- }
6005
- updateCollections(refreshedCollections) {
6153
+ addCollections(newCollections, initialRefresh) {
6154
+ var _a, _b;
6006
6155
  // sets collection list to this value at the end, so deleted collections are not in the list.
6007
- const updatedCollections = new Set();
6008
- for (let collection of refreshedCollections) {
6156
+ for (let collection of newCollections) {
6009
6157
  // User shouldn't see failed collections if he can't retry to import them.
6010
6158
  if (!this.hasEditPermissions
6011
- && collection.importedFrom === ConvertedCollectionType.MT
6012
6159
  && collection.mtStatus === MtCollectionStatus.ERROR) {
6013
6160
  continue;
6014
6161
  }
6015
6162
  if (collection.isImporting) {
6016
6163
  this.isAnyImporting = true;
6017
6164
  }
6018
- let existing = TldConvertedCollection.findExistingCollectionFromList(this.collections, collection);
6019
- // 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.
6020
- // But term id is necessary to do the previous check to sync collections - it can be set to null only after update.
6021
- if (collection.importedFrom === ConvertedCollectionType.MT) {
6022
- // 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.
6023
- if (!(collection.mtStatus === MtCollectionStatus.READY
6024
- || (collection.mtStatus === MtCollectionStatus.PROCESSING && collection.mtPreparedDateTime)
6025
- || 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) {
6026
6176
  continue;
6027
6177
  }
6028
- collection.termId = null;
6029
6178
  }
6030
- if (existing) {
6031
- existing.update(collection);
6179
+ if (!existing) {
6180
+ this._collections.add(collection);
6181
+ }
6182
+ else {
6183
+ existing.update(collection, initialRefresh);
6184
+ }
6185
+ }
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);
6032
6199
  }
6033
6200
  else {
6034
- this.collections.add(collection);
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
+ }
6035
6217
  }
6036
- const editedCollection = existing !== null && existing !== void 0 ? existing : collection;
6037
- updatedCollections.add(editedCollection);
6038
6218
  }
6039
- this._collections = updatedCollections;
6040
- this._hasAnyCollections = updatedCollections.size > 0;
6219
+ }
6220
+ clearTimeout() {
6221
+ if (this.refreshTimeout) {
6222
+ clearTimeout(this.refreshTimeout);
6223
+ this.refreshTimeout = null;
6224
+ }
6041
6225
  }
6042
6226
  setSelectedFromLocalStorage() {
6043
6227
  var _a, _b;
@@ -6045,20 +6229,20 @@ class TldTermCollectionsService {
6045
6229
  if (((_a = this.collections) === null || _a === void 0 ? void 0 : _a.size) === 0 || this.selected) {
6046
6230
  return;
6047
6231
  }
6048
- 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];
6049
6233
  if (!storedId) {
6050
6234
  return;
6051
6235
  }
6052
- 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; });
6053
6237
  this.selected = existing;
6054
6238
  }
6055
6239
  storeSelectedInLocalStorage() {
6056
- var _a;
6240
+ var _a, _b, _c;
6057
6241
  let localStorageObject = this.readLocalStorage();
6058
6242
  if (!localStorageObject) {
6059
6243
  localStorageObject = {};
6060
6244
  }
6061
- 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;
6062
6246
  // store term id if it exists
6063
6247
  localStorage.setItem(this.LOCAL_STORAGE_KEY, JSON.stringify(localStorageObject));
6064
6248
  }
@@ -6071,21 +6255,29 @@ class TldTermCollectionsService {
6071
6255
  return null;
6072
6256
  }
6073
6257
  }
6258
+ emitDataUpdateEvent() {
6259
+ this.onDataUpdate.next(this.collections);
6260
+ }
6074
6261
  }
6075
- 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 });
6076
- TldTermCollectionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionsService, providedIn: 'root' });
6077
- 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: [{
6078
6265
  type: Injectable,
6079
6266
  args: [{
6080
6267
  providedIn: 'root'
6081
6268
  }]
6082
- }], 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
+ } });
6083
6275
 
6084
6276
  class TldTranslateFileApiService {
6085
- constructor(http, config, collectionService, alerts) {
6277
+ constructor(http, config, terminologyService, alerts) {
6086
6278
  this.http = http;
6087
6279
  this.config = config;
6088
- this.collectionService = collectionService;
6280
+ this.terminologyService = terminologyService;
6089
6281
  this.alerts = alerts;
6090
6282
  this._segmentLimit = -1;
6091
6283
  this._sourceDownloadStatusses = [TranslationStatuss.WAITING, TranslationStatuss.SAVING, TranslationStatuss.COMPLETED, TranslationStatuss.TRANSLATING];
@@ -6119,11 +6311,11 @@ class TldTranslateFileApiService {
6119
6311
  segmentLimit: this._segmentLimit,
6120
6312
  ocrPageLimit: this.config.fileConfig.ocrPageLimit
6121
6313
  };
6122
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
6314
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
6123
6315
  if (selectedCollectionId) {
6124
6316
  params.termCorpusId = selectedCollectionId;
6125
6317
  }
6126
- return this.http.post(url, params, { headers }).pipe(map((response) => {
6318
+ return this.http.post(url, params, { headers }).pipe(map$1((response) => {
6127
6319
  if (response.success) {
6128
6320
  const error = { ErrorCode: ErrorCode.CANT_START_FILE_TRANSLATION };
6129
6321
  this.alerts.unhandeledError(error);
@@ -6150,7 +6342,7 @@ class TldTranslateFileApiService {
6150
6342
  const formData = new FormData();
6151
6343
  formData.append("file", file.file);
6152
6344
  return this.http.post(url, formData, { headers: new HttpHeaders(headers), reportProgress: true, observe: "events" })
6153
- .pipe(map((response) => {
6345
+ .pipe(map$1((response) => {
6154
6346
  const returnvalue = {};
6155
6347
  if (response.type === HttpEventType.Response) {
6156
6348
  const body = response.body;
@@ -6173,7 +6365,7 @@ class TldTranslateFileApiService {
6173
6365
  getStatus(properties) {
6174
6366
  const methodName = "GetStatus";
6175
6367
  const url = this.config.fileConfig.fileApiUrl + methodName;
6176
- 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) => {
6177
6369
  var _a;
6178
6370
  if (typeof (response) == 'string') {
6179
6371
  const error = { ErrorCode: response };
@@ -6220,91 +6412,54 @@ class TldTranslateFileApiService {
6220
6412
  }
6221
6413
  if (bIx < 0) {
6222
6414
  bIx = 100;
6223
- }
6224
- return aIx - bIx;
6225
- });
6226
- return array;
6227
- }
6228
- getAuthHeaders() {
6229
- return Common.getAuthHeaders(this.config);
6230
- }
6231
- }
6232
- 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 });
6233
- TldTranslateFileApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, providedIn: 'root' });
6234
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, decorators: [{
6235
- type: Injectable,
6236
- args: [{
6237
- providedIn: 'root'
6238
- }]
6239
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TldTermCollectionsService }, { type: TldAlertService }]; } });
6240
-
6241
- class TldTermCreateCollectionDialogComponent {
6242
- constructor(dialogRef, data, config) {
6243
- this.dialogRef = dialogRef;
6244
- this.data = data;
6245
- this.config = config;
6246
- }
6247
- ngOnInit() {
6248
- this.minLength = this.config.termConfig.collectionNameMinLength;
6249
- this.maxLength = this.config.termConfig.collectionNameMaxLength;
6250
- this.collectionName = new UntypedFormControl(this.data.collectionName, [
6251
- Validators.minLength(this.minLength),
6252
- Validators.maxLength(this.maxLength),
6253
- Validators.required
6254
- ]);
6255
- this.collectionName.markAsTouched();
6256
- this.formGroup = new UntypedFormGroup({ collectionName: this.collectionName });
6415
+ }
6416
+ return aIx - bIx;
6417
+ });
6418
+ return array;
6257
6419
  }
6258
- submit() {
6259
- if (this.formGroup.valid) {
6260
- this.dialogRef.close(this.collectionName.value);
6261
- }
6420
+ getAuthHeaders() {
6421
+ return Common.getAuthHeaders(this.config);
6262
6422
  }
6263
6423
  }
6264
- 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 });
6265
- TldTermCreateCollectionDialogComponentcmp = 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" }] });
6266
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, decorators: [{
6267
- type: Component,
6268
- 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"] }]
6269
- }], ctorParameters: function () {
6270
- return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
6271
- type: Inject,
6272
- args: [MAT_DIALOG_DATA]
6273
- }] }, { type: TldTranslateConfigService }];
6274
- } });
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 });
6425
+ TldTranslateFileApiServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, providedIn: 'root' });
6426
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, decorators: [{
6427
+ type: Injectable,
6428
+ args: [{
6429
+ providedIn: 'root'
6430
+ }]
6431
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TerminologyService }, { type: TldAlertService }]; } });
6275
6432
 
6276
6433
  class TldTermCollectionListComponent {
6277
- constructor(collectionService, config, tldSystem, dialog, translate, alerts) {
6278
- this.collectionService = collectionService;
6434
+ constructor(terminologyService, config, tldSystem, termApiService) {
6435
+ this.terminologyService = terminologyService;
6279
6436
  this.config = config;
6280
6437
  this.tldSystem = tldSystem;
6281
- this.dialog = dialog;
6282
- this.translate = translate;
6283
- this.alerts = alerts;
6438
+ this.termApiService = termApiService;
6284
6439
  this.localizationKey = "TERM_COLLECTIONS.";
6285
6440
  this.tooltipLocalizationKey = "TERM_COLLECTIONS.TOOLTIPS.";
6286
6441
  this.readyStatus = "Ready";
6287
6442
  this.collectionErrorStatus = MtCollectionStatus.ERROR;
6288
6443
  }
6289
6444
  get selected() {
6290
- return this.collectionService.selected;
6445
+ return this.terminologyService.selected;
6291
6446
  }
6292
6447
  set selected(val) {
6293
- this.collectionService.selected = val;
6448
+ this.terminologyService.selected = val;
6294
6449
  }
6295
6450
  get collections() {
6296
6451
  var _a;
6297
- 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;
6298
6453
  }
6299
6454
  get hasAnyCollections() {
6300
- return this.collectionService.hasAnyCollections;
6455
+ return this.terminologyService.hasAnyCollections;
6301
6456
  }
6302
6457
  get isRefreshingCollections() {
6303
6458
  var _a;
6304
- 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;
6305
6460
  }
6306
6461
  get hasEditPermissions() {
6307
- return this.collectionService.hasEditPermissions;
6462
+ return this.terminologyService.hasEditPermissions;
6308
6463
  }
6309
6464
  get appName() {
6310
6465
  return this.config.coreConfig.appName;
@@ -6319,42 +6474,19 @@ class TldTermCollectionListComponent {
6319
6474
  this.subscription.unsubscribe();
6320
6475
  }
6321
6476
  getEditLink(collection) {
6322
- return `${this.config.termConfig.apiUrl}/collections/${collection.termId}/mt/${this.sourceLanguageCode}/${this.targetLanguageCode}`;
6323
- }
6324
- createNew() {
6325
- const localizationKey = "TERM_COLLECTIONS.DEFAULT_COLLECTION_NAME";
6326
- this.translate.get(localizationKey).subscribe((collectionName) => {
6327
- const dialogRef = this.dialog.open(TldTermCreateCollectionDialogComponent, {
6328
- minWidth: '300px',
6329
- maxWidth: '700px',
6330
- data: { collectionName: collectionName }
6331
- });
6332
- dialogRef.afterClosed().subscribe(collectionName => {
6333
- if (!collectionName) {
6334
- return;
6335
- }
6336
- const languages = [this.sourceLanguageCode, this.targetLanguageCode];
6337
- this.collectionService.create(languages, collectionName).subscribe((collection) => {
6338
- window.open(this.getEditLink(collection), "_blank");
6339
- }, (err) => {
6340
- console.error(err);
6341
- const error = { ErrorCode: ErrorCode.COLLECTION_CREATE };
6342
- this.alerts.unhandeledError(error);
6343
- throw error;
6344
- });
6345
- });
6346
- });
6477
+ var _a;
6478
+ return this.termApiService.getEditLink((_a = collection.termCollection) === null || _a === void 0 ? void 0 : _a.id, this.sourceLanguageCode, this.targetLanguageCode);
6347
6479
  }
6348
6480
  attach(collection) {
6349
- this.collectionService.addCollectionToSystem(collection);
6481
+ this.terminologyService.addToEngine(collection);
6350
6482
  }
6351
6483
  }
6352
- 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 });
6353
- 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" }] });
6354
6486
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionListComponent, decorators: [{
6355
6487
  type: Component,
6356
- 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"] }]
6357
- }], 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 }]; } });
6358
6490
 
6359
6491
  class WtwLinkParamsService {
6360
6492
  constructor(translate) {
@@ -6411,44 +6543,142 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
6411
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"] }]
6412
6544
  }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: WtwLinkParamsService }]; } });
6413
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
+
6414
6623
  class TldTermCollectionComponent {
6415
- constructor(terms) {
6416
- 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();
6417
6639
  }
6418
- get promotion() { return this.terms.shouldShowPromotion; }
6419
6640
  }
6420
- TldTermCollectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, deps: [{ token: TldTermCollectionsService }], target: i0.ɵɵFactoryTarget.Component });
6421
- 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"] }] });
6422
6643
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, decorators: [{
6423
6644
  type: Component,
6424
- 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>" }]
6425
- }], 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 }]; } });
6426
6647
 
6427
6648
  class TldTermMenuComponent {
6428
- constructor(collectionService) {
6429
- this.collectionService = collectionService;
6649
+ constructor(terminologyService) {
6650
+ this.terminologyService = terminologyService;
6430
6651
  }
6431
- get selected() { return this.collectionService.selected; }
6652
+ get selected() { return this.terminologyService.selected; }
6432
6653
  ;
6433
- 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
+ }
6434
6662
  menuOpened() {
6435
- this.collectionService.onMenuOpen();
6663
+ this.subscription = this.terminologyService.startAutoRefresh().subscribe();
6436
6664
  }
6437
6665
  menuClosed() {
6438
- this.collectionService.onMenuClose();
6666
+ var _a;
6667
+ this.terminologyService.stopAutoRefresh();
6668
+ (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
6439
6669
  }
6440
6670
  }
6441
- TldTermMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, deps: [{ token: TldTermCollectionsService }], target: i0.ɵɵFactoryTarget.Component });
6442
- 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" }] });
6443
6673
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, decorators: [{
6444
6674
  type: Component,
6445
- 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"] }]
6446
- }], 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 }]; } });
6447
6677
 
6448
6678
  class TldTermModule {
6449
6679
  }
6450
6680
  TldTermModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6451
- 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,
6452
6682
  CommonModule,
6453
6683
  MaterialModule,
6454
6684
  TranslateModule,
@@ -6459,7 +6689,7 @@ TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
6459
6689
  MatTooltipModule,
6460
6690
  TldCommonModule,
6461
6691
  ReactiveFormsModule,
6462
- CloseButtonModule], exports: [TldTermMenuComponent] });
6692
+ CloseButtonModule], exports: [TldTermMenuComponent, CreateCollectionComponent] });
6463
6693
  TldTermModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, imports: [FormsModule,
6464
6694
  CommonModule,
6465
6695
  MaterialModule,
@@ -6475,7 +6705,7 @@ TldTermModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
6475
6705
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, decorators: [{
6476
6706
  type: NgModule,
6477
6707
  args: [{
6478
- declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent],
6708
+ declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent, CreateCollectionComponent],
6479
6709
  imports: [
6480
6710
  FormsModule,
6481
6711
  CommonModule,
@@ -6490,79 +6720,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
6490
6720
  ReactiveFormsModule,
6491
6721
  CloseButtonModule
6492
6722
  ],
6493
- exports: [TldTermMenuComponent]
6723
+ exports: [TldTermMenuComponent, CreateCollectionComponent]
6494
6724
  }]
6495
6725
  }] });
6496
6726
 
6497
- var FileTypeIcons;
6498
- (function (FileTypeIcons) {
6499
- FileTypeIcons["WORD"] = "file_type_word";
6500
- FileTypeIcons["WEB"] = "file_type_web";
6501
- FileTypeIcons["OTHER"] = "file_type_other";
6502
- FileTypeIcons["POWERPOINT"] = "file_type_powerpoint";
6503
- FileTypeIcons["EXCEL"] = "file_type_excel";
6504
- FileTypeIcons["OFFICE_OTHER"] = "file_type_office_other";
6505
- FileTypeIcons["PDF"] = "file_type_pdf";
6506
- FileTypeIcons["SCANNED"] = "file_type_scanned";
6507
- FileTypeIcons["INTERCHANGE"] = "file_type_interchange";
6508
- })(FileTypeIcons || (FileTypeIcons = {}));
6509
-
6510
- var FileCategories;
6511
- (function (FileCategories) {
6512
- FileCategories["OFFICE"] = "OFFICE";
6513
- FileCategories["SCANNED"] = "SCANNED";
6514
- FileCategories["INTERCHANGE"] = "INTERCHANGE";
6515
- FileCategories["WEB"] = "WEB";
6516
- FileCategories["OTHER"] = "OTHER";
6517
- })(FileCategories || (FileCategories = {}));
6518
-
6519
- var FileTypes;
6520
- (function (FileTypes) {
6521
- FileTypes["WORD"] = "WORD";
6522
- FileTypes["WEB"] = "WEB";
6523
- FileTypes["OTHER"] = "OTHER";
6524
- FileTypes["POWERPOINT"] = "POWERPOINT";
6525
- FileTypes["EXCEL"] = "EXCEL";
6526
- FileTypes["OFFICE_OTHER"] = "OFFICE_OTHER";
6527
- FileTypes["PDF"] = "PDF";
6528
- FileTypes["SCANNED"] = "SCANNED";
6529
- FileTypes["INTERCHANGE"] = "INTERCHANGE";
6530
- })(FileTypes || (FileTypes = {}));
6531
-
6532
- var FileExtensions;
6533
- (function (FileExtensions) {
6534
- FileExtensions["DOC"] = "doc";
6535
- FileExtensions["DOCX"] = "docx";
6536
- FileExtensions["XLSX"] = "xlsx";
6537
- FileExtensions["PPTX"] = "pptx";
6538
- FileExtensions["ODT"] = "odt";
6539
- FileExtensions["ODP"] = "odp";
6540
- FileExtensions["ODS"] = "ods";
6541
- FileExtensions["TXT"] = "txt";
6542
- FileExtensions["RTF"] = "rtf";
6543
- FileExtensions["PAGES"] = "pages";
6544
- FileExtensions["SXW"] = "sxw";
6545
- FileExtensions["JPG"] = "jpg";
6546
- FileExtensions["JPEG"] = "jpeg";
6547
- FileExtensions["PNG"] = "png";
6548
- FileExtensions["BMP"] = "bmp";
6549
- FileExtensions["PDF"] = "pdf";
6550
- FileExtensions["SDLXLIFF"] = "sdlxliff";
6551
- FileExtensions["SDLXLF"] = "sdlxlf";
6552
- FileExtensions["TTX"] = "ttx";
6553
- FileExtensions["TMX"] = "tmx";
6554
- FileExtensions["XLF"] = "xlf";
6555
- FileExtensions["XLIF"] = "xlif";
6556
- FileExtensions["HTML"] = "html";
6557
- FileExtensions["HTM"] = "htm";
6558
- FileExtensions["JSON"] = "json";
6559
- FileExtensions["XHTML"] = "xhtml";
6560
- FileExtensions["XHT"] = "xht";
6561
- FileExtensions["XLIFF"] = "xliff";
6562
- FileExtensions["TEX"] = "tex";
6563
- FileExtensions["TTL"] = "ttl";
6564
- FileExtensions["SRT"] = "srt";
6565
- })(FileExtensions || (FileExtensions = {}));
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 }]; } });
6566
6754
 
6567
6755
  class ExtensionDialogComponent {
6568
6756
  constructor(data) {
@@ -7053,10 +7241,10 @@ class TldVoiceInputApiService {
7053
7241
  const formData = new FormData();
7054
7242
  formData.append("file", params.file);
7055
7243
  formData.append("langauge", params.language);
7056
- 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)));
7057
7245
  }
7058
7246
  getJobInfo(jobId) {
7059
- 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)));
7060
7248
  }
7061
7249
  mapJob(response) {
7062
7250
  // converts to VoiceToTextState, so it suits enum conventions.
@@ -7676,7 +7864,7 @@ class TldTranslateTextService {
7676
7864
  this.untranslatedParagraphCount = 0;
7677
7865
  this.paragraphTranslationSubscription = this.paragraphTranslationsSubject.asObservable().pipe(mergeMap((untranslatedParagraph) => {
7678
7866
  this.untranslatedParagraphCount += 1;
7679
- return this.translateParagraph(untranslatedParagraph).pipe(tap((response) => {
7867
+ return this.translateParagraph(untranslatedParagraph).pipe(tap$1((response) => {
7680
7868
  // No need to handle response if source text has changed.
7681
7869
  if (source != this.sourceText) {
7682
7870
  return;
@@ -9494,7 +9682,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
9494
9682
 
9495
9683
  window.$ = window.jQuery = $;
9496
9684
  class TldTranslateWebsiteComponent {
9497
- 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) {
9498
9686
  this.translate = translate;
9499
9687
  this.configService = configService;
9500
9688
  this.translateButtonService = translateButtonService;
@@ -9502,7 +9690,7 @@ class TldTranslateWebsiteComponent {
9502
9690
  this.router = router;
9503
9691
  this.activatedRoute = activatedRoute;
9504
9692
  this.tldSystem = tldSystem;
9505
- this.collectionService = collectionService;
9693
+ this.terminologyService = terminologyService;
9506
9694
  this.tldTranslateWebService = tldTranslateWebService;
9507
9695
  this.apiVersion = apiVersion;
9508
9696
  this.product = '';
@@ -9773,7 +9961,7 @@ class TldTranslateWebsiteComponent {
9773
9961
  this.sendMessage({ message: 'changeSystem', systemId: sys.id });
9774
9962
  }
9775
9963
  translateButtonClick() {
9776
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
9964
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
9777
9965
  if (this.urlToTranslate != '') {
9778
9966
  this.sendMessage({
9779
9967
  message: 'loadUrl',
@@ -9932,7 +10120,7 @@ class TldTranslateWebsiteComponent {
9932
10120
  body.appendChild(script);
9933
10121
  }
9934
10122
  }
9935
- 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 });
9936
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: [
9937
10125
  trigger('openCloseAnimation', [
9938
10126
  transition(':enter', [
@@ -9954,7 +10142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
9954
10142
  ])
9955
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"] }]
9956
10144
  }], ctorParameters: function () {
9957
- 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: [{
9958
10146
  type: Inject,
9959
10147
  args: [TRANSLATION_API_VERSION_TOKEN]
9960
10148
  }] }];
@@ -10275,6 +10463,123 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10275
10463
  args: [TldTranslateBodyComponent]
10276
10464
  }] } });
10277
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
+
10278
10583
  var FileV2Category;
10279
10584
  (function (FileV2Category) {
10280
10585
  FileV2Category["SOURCE"] = "SOURCE";
@@ -10307,7 +10612,7 @@ class FileApiV2Service {
10307
10612
  formData.append("domain", properties.system.domain);
10308
10613
  }
10309
10614
  const headers = Common.GetApiV2AuthHeaders(this.config);
10310
- 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));
10311
10616
  }
10312
10617
  remove(properties) {
10313
10618
  if (properties.file.translationStartedOnServer) {
@@ -10329,7 +10634,7 @@ class FileApiV2Service {
10329
10634
  }
10330
10635
  getStatus(properties) {
10331
10636
  const headers = Common.GetApiV2AuthHeaders(this.config);
10332
- 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) => {
10333
10638
  const extensions = [];
10334
10639
  response.files.forEach((file) => {
10335
10640
  if (file.category.toUpperCase() === FileV2Category.TRANSLATED) {
@@ -10377,7 +10682,7 @@ class TldSystemApiV2Service {
10377
10682
  getSystemList() {
10378
10683
  var _a, _b;
10379
10684
  const headers = Common.GetApiV2AuthHeaders(this.config);
10380
- 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) => {
10381
10686
  const systems = [];
10382
10687
  const uniqueDirections = [];
10383
10688
  const autoDomainSystems = [];
@@ -10390,7 +10695,9 @@ class TldSystemApiV2Service {
10390
10695
  sourceLanguage: system.srcLang,
10391
10696
  targetLanguage: system.trgLang,
10392
10697
  translationApiVersion: TranslationApiVersion.V2,
10393
- vendor: system.vendor
10698
+ vendor: system.vendor,
10699
+ // hardcoded since there is no param yet for determinig which systems support terms.
10700
+ includesTerminology: true
10394
10701
  };
10395
10702
  systems.push(newSystem);
10396
10703
  if (((_a = this.config.apiV2Config) === null || _a === void 0 ? void 0 : _a.autoDomainDetection) && !uniqueDirections.includes(languageDirections)) {
@@ -10443,7 +10750,7 @@ class TldSystemApiService {
10443
10750
  const params = {
10444
10751
  appID: this.config.coreConfig.appId,
10445
10752
  };
10446
- 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) => {
10447
10754
  const systems = [];
10448
10755
  response.System.forEach(element => {
10449
10756
  var _a;
@@ -10516,7 +10823,7 @@ class TldTranslateTextApiV2Service {
10516
10823
  if (this.config.textConfig.checkSourceGrammar && this.config.textConfig.grammarCheckLanguages.includes(params.system.sourceLanguage)) {
10517
10824
  this.checkAndAttachGrammarToTree(params.text, params.system.sourceLanguage, sourceTree);
10518
10825
  }
10519
- 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) => {
10520
10827
  const systemId = `${requestParams.srcLang}-${requestParams.trgLang}-${translationResponse.domain}`;
10521
10828
  const originalTranslation = translationResponse.translations[0].translation;
10522
10829
  const targetTree = {
@@ -10595,8 +10902,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10595
10902
  }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
10596
10903
 
10597
10904
  class TldTranslateTextApiService {
10598
- constructor(collectionService, http, config, alerts) {
10599
- this.collectionService = collectionService;
10905
+ constructor(terminologyService, http, config, alerts) {
10906
+ this.terminologyService = terminologyService;
10600
10907
  this.http = http;
10601
10908
  this.config = config;
10602
10909
  this.alerts = alerts;
@@ -10633,11 +10940,11 @@ class TldTranslateTextApiService {
10633
10940
  systemID: requestParams.system.id,
10634
10941
  text: requestParams.text,
10635
10942
  };
10636
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
10943
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
10637
10944
  if (selectedCollectionId) {
10638
10945
  params.options += `,termCorpusId=${selectedCollectionId}`;
10639
10946
  }
10640
- 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) => {
10641
10948
  if (response.ErrorMessage) {
10642
10949
  this.alerts.unhandeledError(response.ErrorMessage);
10643
10950
  throw response.ErrorMessage;
@@ -10765,21 +11072,21 @@ class TldTranslateTextApiService {
10765
11072
  });
10766
11073
  }
10767
11074
  }
10768
- 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 });
10769
11076
  TldTranslateTextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, providedIn: 'root' });
10770
11077
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, decorators: [{
10771
11078
  type: Injectable,
10772
11079
  args: [{
10773
11080
  providedIn: 'root'
10774
11081
  }]
10775
- }], 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 }]; } });
10776
11083
 
10777
- function textApiServiceFactory(version, config, http, collectionsService, alerts) {
11084
+ function textApiServiceFactory(version, config, http, terminologyService, alerts) {
10778
11085
  if (version === TranslationApiVersion.V2) {
10779
11086
  return new TldTranslateTextApiV2Service(http, config);
10780
11087
  }
10781
11088
  else {
10782
- return new TldTranslateTextApiService(collectionsService, http, config, alerts);
11089
+ return new TldTranslateTextApiService(terminologyService, http, config, alerts);
10783
11090
  }
10784
11091
  }
10785
11092
 
@@ -10794,7 +11101,7 @@ class TldTranslateModule {
10794
11101
  TRANSLATION_API_VERSION_TOKEN,
10795
11102
  TldTranslateConfigService,
10796
11103
  HttpClient,
10797
- TldTermCollectionsService,
11104
+ TerminologyService,
10798
11105
  TldAlertService
10799
11106
  ]
10800
11107
  },
@@ -10805,10 +11112,20 @@ class TldTranslateModule {
10805
11112
  TRANSLATION_API_VERSION_TOKEN,
10806
11113
  TldTranslateConfigService,
10807
11114
  HttpClient,
10808
- TldTermCollectionsService,
11115
+ TerminologyService,
10809
11116
  TldAlertService
10810
11117
  ]
10811
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
+ },
10812
11129
  ];
10813
11130
  if (translationApiVersion !== null) {
10814
11131
  providers.push({
@@ -10887,5 +11204,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10887
11204
  * Generated bundle index. Do not edit.
10888
11205
  */
10889
11206
 
10890
- 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 };
10891
11208
  //# sourceMappingURL=tilde-nlp-ngx-translate.mjs.map