@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
  */
@@ -3559,6 +3524,7 @@ class TldTranslateConfigService {
3559
3524
  this._termConfig.collectionNameMaxLength = termConfig?.collectionNameMaxLength ?? 300;
3560
3525
  this._termConfig.refreshTimeoutMs = termConfig?.refreshTimeoutMs ?? 10000;
3561
3526
  this._termConfig.refreshTimeoutMsWhenImporting = termConfig?.refreshTimeoutMsWhenImporting ?? 5000;
3527
+ this._termConfig.engineTermUrl = termConfig?.engineTermUrl;
3562
3528
  this._termConfig.freeTrialUrl = termConfig?.freeTrialUrl ?? "https://tilde.com/products-and-services/machine-translation/pricing/Tilde-MT";
3563
3529
  this._termConfig.learnMoreUrl = termConfig?.learnMoreUrl ?? "https://www.tilde.com/products-and-services/machine-translation/Tilde-MT-features-glossary";
3564
3530
  // seperated because following urls have method names added
@@ -4850,6 +4816,76 @@ var FileConversionTypes;
4850
4816
  FileConversionTypes["IMAGE"] = "IMAGE";
4851
4817
  })(FileConversionTypes || (FileConversionTypes = {}));
4852
4818
 
4819
+ var FileTypeIcons;
4820
+ (function (FileTypeIcons) {
4821
+ FileTypeIcons["WORD"] = "file_type_word";
4822
+ FileTypeIcons["WEB"] = "file_type_web";
4823
+ FileTypeIcons["OTHER"] = "file_type_other";
4824
+ FileTypeIcons["POWERPOINT"] = "file_type_powerpoint";
4825
+ FileTypeIcons["EXCEL"] = "file_type_excel";
4826
+ FileTypeIcons["OFFICE_OTHER"] = "file_type_office_other";
4827
+ FileTypeIcons["PDF"] = "file_type_pdf";
4828
+ FileTypeIcons["SCANNED"] = "file_type_scanned";
4829
+ FileTypeIcons["INTERCHANGE"] = "file_type_interchange";
4830
+ })(FileTypeIcons || (FileTypeIcons = {}));
4831
+
4832
+ var FileCategories;
4833
+ (function (FileCategories) {
4834
+ FileCategories["OFFICE"] = "OFFICE";
4835
+ FileCategories["SCANNED"] = "SCANNED";
4836
+ FileCategories["INTERCHANGE"] = "INTERCHANGE";
4837
+ FileCategories["WEB"] = "WEB";
4838
+ FileCategories["OTHER"] = "OTHER";
4839
+ })(FileCategories || (FileCategories = {}));
4840
+
4841
+ var FileTypes;
4842
+ (function (FileTypes) {
4843
+ FileTypes["WORD"] = "WORD";
4844
+ FileTypes["WEB"] = "WEB";
4845
+ FileTypes["OTHER"] = "OTHER";
4846
+ FileTypes["POWERPOINT"] = "POWERPOINT";
4847
+ FileTypes["EXCEL"] = "EXCEL";
4848
+ FileTypes["OFFICE_OTHER"] = "OFFICE_OTHER";
4849
+ FileTypes["PDF"] = "PDF";
4850
+ FileTypes["SCANNED"] = "SCANNED";
4851
+ FileTypes["INTERCHANGE"] = "INTERCHANGE";
4852
+ })(FileTypes || (FileTypes = {}));
4853
+
4854
+ var FileExtensions;
4855
+ (function (FileExtensions) {
4856
+ FileExtensions["DOC"] = "doc";
4857
+ FileExtensions["DOCX"] = "docx";
4858
+ FileExtensions["XLSX"] = "xlsx";
4859
+ FileExtensions["PPTX"] = "pptx";
4860
+ FileExtensions["ODT"] = "odt";
4861
+ FileExtensions["ODP"] = "odp";
4862
+ FileExtensions["ODS"] = "ods";
4863
+ FileExtensions["TXT"] = "txt";
4864
+ FileExtensions["RTF"] = "rtf";
4865
+ FileExtensions["PAGES"] = "pages";
4866
+ FileExtensions["SXW"] = "sxw";
4867
+ FileExtensions["JPG"] = "jpg";
4868
+ FileExtensions["JPEG"] = "jpeg";
4869
+ FileExtensions["PNG"] = "png";
4870
+ FileExtensions["BMP"] = "bmp";
4871
+ FileExtensions["PDF"] = "pdf";
4872
+ FileExtensions["SDLXLIFF"] = "sdlxliff";
4873
+ FileExtensions["SDLXLF"] = "sdlxlf";
4874
+ FileExtensions["TTX"] = "ttx";
4875
+ FileExtensions["TMX"] = "tmx";
4876
+ FileExtensions["XLF"] = "xlf";
4877
+ FileExtensions["XLIF"] = "xlif";
4878
+ FileExtensions["HTML"] = "html";
4879
+ FileExtensions["HTM"] = "htm";
4880
+ FileExtensions["JSON"] = "json";
4881
+ FileExtensions["XHTML"] = "xhtml";
4882
+ FileExtensions["XHT"] = "xht";
4883
+ FileExtensions["XLIFF"] = "xliff";
4884
+ FileExtensions["TEX"] = "tex";
4885
+ FileExtensions["TTL"] = "ttl";
4886
+ FileExtensions["SRT"] = "srt";
4887
+ })(FileExtensions || (FileExtensions = {}));
4888
+
4853
4889
  class TldTranslateFileService {
4854
4890
  constructor(fileApi, alerts, sanitizer, config, tldSystem) {
4855
4891
  this.fileApi = fileApi;
@@ -5137,8 +5173,11 @@ class TldTranslateFileService {
5137
5173
  translationFile.filePreviewProgress = data.percentDone;
5138
5174
  }
5139
5175
  translatedDocPreview(translationFile) {
5176
+ // show preview for original extension if exists, if not, then preview for docx, if not then try with original filename.
5177
+ const fileName = translationFile.availableExtensions.find(ext => ext.extension === FileExtensions.DOCX)?.fileName
5178
+ ?? translationFile.originalFileName;
5140
5179
  const params = {
5141
- fileName: translationFile.originalFileName,
5180
+ fileName: fileName,
5142
5181
  translationDocId: translationFile.id
5143
5182
  };
5144
5183
  this.fileApi.translatedDocumentPreview(params)
@@ -5610,139 +5649,235 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
5610
5649
  }]
5611
5650
  }] });
5612
5651
 
5613
- /**
5614
- * Enumerator to determine if collection imported from term api or mt
5615
- */
5616
- var ConvertedCollectionType;
5617
- (function (ConvertedCollectionType) {
5618
- ConvertedCollectionType[ConvertedCollectionType["Term"] = 0] = "Term";
5619
- ConvertedCollectionType[ConvertedCollectionType["MT"] = 1] = "MT";
5620
- })(ConvertedCollectionType || (ConvertedCollectionType = {}));
5652
+ var EngineTermCollectionScope;
5653
+ (function (EngineTermCollectionScope) {
5654
+ EngineTermCollectionScope["GLOBAL"] = "Global";
5655
+ EngineTermCollectionScope["GROUP"] = "Group";
5656
+ })(EngineTermCollectionScope || (EngineTermCollectionScope = {}));
5657
+
5658
+ var EngineTermCollectionSource;
5659
+ (function (EngineTermCollectionSource) {
5660
+ EngineTermCollectionSource["TILDE_TERM"] = "TildeTerm";
5661
+ EngineTermCollectionSource["FILE"] = "File";
5662
+ })(EngineTermCollectionSource || (EngineTermCollectionSource = {}));
5663
+
5664
+ var EngineTermCollectionStatus;
5665
+ (function (EngineTermCollectionStatus) {
5666
+ EngineTermCollectionStatus["QUEUING"] = "Queuing";
5667
+ EngineTermCollectionStatus["FETCHING"] = "Fetching";
5668
+ EngineTermCollectionStatus["PREPROCESSING"] = "Preprocessing";
5669
+ EngineTermCollectionStatus["DELETING"] = "Deleting";
5670
+ EngineTermCollectionStatus["READY"] = "Ready";
5671
+ EngineTermCollectionStatus["ERROR"] = "Error";
5672
+ EngineTermCollectionStatus["DELETED"] = "Deleted";
5673
+ })(EngineTermCollectionStatus || (EngineTermCollectionStatus = {}));
5674
+
5675
+ var CombinedCollectionTooltipKey;
5676
+ (function (CombinedCollectionTooltipKey) {
5677
+ CombinedCollectionTooltipKey["NO_ENTRIES"] = "NO_ENTRIES";
5678
+ CombinedCollectionTooltipKey["IMPORTING"] = "IMPORTING";
5679
+ })(CombinedCollectionTooltipKey || (CombinedCollectionTooltipKey = {}));
5621
5680
 
5622
5681
  var MtCollectionStatus;
5623
5682
  (function (MtCollectionStatus) {
5683
+ MtCollectionStatus["QUEUING"] = "Queuing";
5684
+ MtCollectionStatus["FETCHING"] = "Fetching";
5685
+ MtCollectionStatus["PREPROCESSING"] = "Preprocessing";
5686
+ MtCollectionStatus["DELETING"] = "Deleting";
5624
5687
  MtCollectionStatus["READY"] = "Ready";
5688
+ MtCollectionStatus["DELETED"] = "Deleted";
5625
5689
  MtCollectionStatus["PROCESSING"] = "Processing";
5626
5690
  MtCollectionStatus["ERROR"] = "Error";
5691
+ // basic status created in frontend
5692
+ MtCollectionStatus["NOT_IN_USE"] = "NotInUse";
5627
5693
  })(MtCollectionStatus || (MtCollectionStatus = {}));
5628
5694
 
5629
- var ConvertedCollectionTooltipKey;
5630
- (function (ConvertedCollectionTooltipKey) {
5631
- ConvertedCollectionTooltipKey["NO_ENTRIES"] = "NO_ENTRIES";
5632
- ConvertedCollectionTooltipKey["IMPORTING"] = "IMPORTING";
5633
- ConvertedCollectionTooltipKey["SYNCING"] = "SYNCING";
5634
- })(ConvertedCollectionTooltipKey || (ConvertedCollectionTooltipKey = {}));
5635
-
5636
5695
  /**
5637
- * Used to combine term collection interfaces from term api and MT api.
5696
+ * Class that joins collection from term api and its imported collection from MT api.
5638
5697
  */
5639
- class TldConvertedCollection {
5640
- constructor(obj, sourceLanguageCode, targetLanguageCode) {
5641
- this.sourceLanguageCode = sourceLanguageCode;
5642
- this.targetLanguageCode = targetLanguageCode;
5643
- this.isSynchronized = true;
5644
- if (this.isTldCorpus(obj)) {
5645
- this.fromTldMTCollection(obj);
5698
+ class CombinedCollection {
5699
+ //#endregion
5700
+ constructor(termApiCollection, mtCollection) {
5701
+ //#endregion
5702
+ //#region Editable MT (api v2) fields
5703
+ this.editables = {};
5704
+ //#endregion
5705
+ //#region Getters for common fields
5706
+ // 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.
5707
+ // Otherwise it might be easy to miss some property updating and get wrong data in future.
5708
+ this._isSynchronized = true;
5709
+ this.mtCollection = mtCollection;
5710
+ this.termCollection = termApiCollection;
5711
+ this.update(null);
5712
+ }
5713
+ static findExistingCollectionFromList(collections, collection) {
5714
+ for (const col of collections) {
5715
+ if ((col.termId && col.termId == collection.termId) ||
5716
+ (col.mtCollection?.id && col.mtCollection.id == collection.mtCollection?.id)) {
5717
+ return col;
5718
+ }
5646
5719
  }
5647
- else {
5648
- this.fromTermApi(obj);
5720
+ return null;
5721
+ }
5722
+ static findExistingIndexFromList(collections, collection) {
5723
+ let i = 0;
5724
+ for (const col of collections) {
5725
+ if ((col.termId && col.termId == collection.termId) ||
5726
+ (col.mtCollection?.id && col.mtCollection.id == collection.mtCollection?.id)) {
5727
+ return i;
5728
+ }
5729
+ i += 1;
5649
5730
  }
5731
+ return null;
5650
5732
  }
5733
+ /**
5734
+ * Weather collection is synchronized with term portal collection. If no term collection, value is set to true.
5735
+ */
5736
+ get isSynchronized() {
5737
+ return this._isSynchronized;
5738
+ }
5739
+ /**
5740
+ * Determines if collections is 'syncable'. Returns true if it is not synced or if synchronization has failed and status is error.
5741
+ */
5651
5742
  get syncButtonVissible() {
5652
- return !this.isSynchronized || (this.termModifiedDate && this.mtStatus === MtCollectionStatus.ERROR);
5743
+ return !this.isSynchronized || (this.termCollection?.modifyDate && this.mtStatus === MtCollectionStatus.ERROR);
5653
5744
  }
5745
+ /**
5746
+ * If not ready or error, then collection is importing.
5747
+ */
5654
5748
  get isImporting() {
5655
- return this.mtStatus === MtCollectionStatus.PROCESSING;
5749
+ return this.mtCollection && CombinedCollection.importingStatuses.includes(this.mtCollection?.status);
5656
5750
  }
5657
5751
  ;
5658
- static findExistingCollectionFromList(termCollections, collection) {
5659
- for (const col of termCollections) {
5660
- if ((col.id && col.id === collection.id)
5661
- || (collection.termId && col.termId === collection.termId)) {
5662
- return col;
5663
- }
5664
- }
5665
- return null;
5752
+ /**
5753
+ * Term collection id. Returns value from term collection or from mt, if term collection not existing.
5754
+ */
5755
+ get termId() {
5756
+ return this.termCollection?.id ?? this.mtCollection?.termId;
5666
5757
  }
5667
- update(obj) {
5668
- if (obj.importedFrom === ConvertedCollectionType.MT) {
5669
- if (obj.mtStatus !== MtCollectionStatus.ERROR) {
5670
- this.errorKey = null;
5671
- }
5672
- this.id = obj.id;
5673
- this.mtStatus = obj.mtStatus;
5674
- this.mtAttachmentDateTime = obj.mtAttachmentDateTime;
5675
- this.mtEntryCount = obj.mtEntryCount;
5676
- }
5677
- else if (obj.importedFrom === ConvertedCollectionType.Term) {
5678
- this.termId = obj.termId;
5679
- this.languagesString = obj.languagesString;
5680
- this.termModifiedDate = obj.termModifiedDate;
5681
- this.entryCount = obj.entryCount;
5682
- this.title = obj.title;
5758
+ get mtStatus() {
5759
+ return this.mtCollection?.status;
5760
+ }
5761
+ /**
5762
+ * Last updated date from mt api.
5763
+ */
5764
+ get lastUpdated() {
5765
+ return this.mtCollection?.lastUpdated;
5766
+ }
5767
+ /**
5768
+ * Collection name. If has term collection, takes from there. If not, then returns mt collection name.
5769
+ */
5770
+ get name() {
5771
+ return this.termCollection?.name ?? this.mtCollection?.name;
5772
+ }
5773
+ /**
5774
+ * Entry count from term api.
5775
+ */
5776
+ get termEntries() {
5777
+ return this.termCollection?.entryCount;
5778
+ }
5779
+ get default() {
5780
+ return this.mtCollection?.default;
5781
+ }
5782
+ /**
5783
+ * Status from mt api or custom "NOT_IN_USE" status if not imported in mt.s
5784
+ */
5785
+ get status() {
5786
+ return this.mtStatus ?? MtCollectionStatus.NOT_IN_USE;
5787
+ }
5788
+ /**
5789
+ * Scope can be edited only if has mt collcetion or term collection is being prepared for import.
5790
+ */
5791
+ get canEditScope() {
5792
+ return this.mtCollection || this.editables.default;
5793
+ }
5794
+ /**
5795
+ * Updates collection with values from new collection.
5796
+ * @param collection collection from which should be updated.
5797
+ * @param initialRefresh if set to true, editable fields will also be updated.
5798
+ */
5799
+ update(collection, initialRefresh = true) {
5800
+ if (collection?.termCollection) {
5801
+ this.termCollection = collection.termCollection;
5683
5802
  }
5684
- this.isSynchronized = this.isTermSynchronizedWithMT();
5685
- if (this.entryCount === 0 && this.termId !== null) {
5686
- this.tooltipKey = ConvertedCollectionTooltipKey.NO_ENTRIES;
5803
+ if (collection?.mtCollection) {
5804
+ this.mtCollection = collection.mtCollection;
5687
5805
  }
5688
- else if (this.isImporting && this.mtEntryCount === 0) {
5689
- this.tooltipKey = ConvertedCollectionTooltipKey.IMPORTING;
5806
+ if (initialRefresh) {
5807
+ this.updateEditables();
5690
5808
  }
5691
- else if (this.isImporting) {
5692
- this.tooltipKey = ConvertedCollectionTooltipKey.SYNCING;
5809
+ this.updateIsSynchronized();
5810
+ this.updateTooltipKey();
5811
+ this.updateSource();
5812
+ }
5813
+ /**
5814
+ * If some of editables are edited.
5815
+ *
5816
+ * 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.
5817
+ *
5818
+ * @returns true if collection is edited, false if not.
5819
+ */
5820
+ isEdited() {
5821
+ // if collection not imported and enabled not set, should not update collection.
5822
+ if (!this.mtCollection && !this.editables.default) {
5823
+ return false;
5693
5824
  }
5694
- else {
5695
- this.tooltipKey = null;
5825
+ else if ((this.mtCollection?.default !== this.editables.default)
5826
+ || (this.mtCollection && this.editables.scope !== this.mtCollection.scope)) {
5827
+ return true;
5696
5828
  }
5829
+ return false;
5697
5830
  }
5698
- deletedFromTermApi() {
5699
- this.termId = null;
5700
- this.languagesString = null;
5701
- this.termModifiedDate = null;
5702
- this.entryCount = null;
5703
- }
5704
- static convertCollections(collections, sourceLanguage, targetLanguage) {
5705
- const converted = [];
5706
- collections.forEach((collection) => {
5707
- converted.push(new TldConvertedCollection(collection, sourceLanguage, targetLanguage));
5708
- });
5709
- return converted;
5710
- }
5711
- fromTermApi(obj) {
5712
- this.termId = obj.id.toString();
5713
- this.title = obj.name;
5714
- this.importedFrom = ConvertedCollectionType.Term;
5715
- this.termModifiedDate = new Date(obj.modifyDate);
5716
- const language = obj.languages?.find(lang => lang.id.toLowerCase() === this.sourceLanguageCode.toLowerCase());
5717
- this.entryCount = language?.count ?? 0;
5718
- this.languagesString = obj.languages.filter(lang => lang.id !== this.sourceLanguageCode && lang.count > 0)
5719
- .map(lang => lang.id.toUpperCase()).join(", ");
5720
- }
5721
- fromTldMTCollection(obj) {
5722
- this.id = obj.CorpusId;
5723
- this.title = obj.Title;
5724
- this.importedFrom = ConvertedCollectionType.MT;
5725
- this.mtAttachmentDateTime = new Date(obj.AttachmentDateTime);
5726
- this.termId = obj.TildeTermId;
5727
- this.mtStatus = obj.Status;
5728
- this.mtPreparedDateTime = obj.PreparedDateTime;
5729
- this.mtEntryCount = obj.Count;
5730
- }
5731
- isTldCorpus(obj) {
5732
- return obj.TildeTermId !== undefined;
5831
+ /**
5832
+ * Deletes term collection and its properties.
5833
+ */
5834
+ deleteTerms() {
5835
+ this.termCollection = null;
5836
+ this.update(null);
5733
5837
  }
5734
5838
  /**
5735
- * Check if the newest version of the term collection is synchronized from Term portal.
5736
- * Note. Term collections that are not linked from Term portal are considered as synchronized.
5737
- */
5738
- isTermSynchronizedWithMT() {
5839
+ * Deletes mt collection and its properties.
5840
+ */
5841
+ deleteMT() {
5842
+ this.mtCollection = null;
5843
+ this.update(null);
5844
+ }
5845
+ //#region Private methods
5846
+ updateIsSynchronized() {
5739
5847
  let isSynchronized = true;
5740
- if (this.termModifiedDate && this.mtAttachmentDateTime) {
5741
- isSynchronized = this.termModifiedDate < this.mtAttachmentDateTime;
5848
+ const termModified = this.termCollection?.modifyDate;
5849
+ const lastMtUpdated = this.mtCollection?.lastUpdated;
5850
+ if (termModified && lastMtUpdated) {
5851
+ isSynchronized = termModified < lastMtUpdated;
5742
5852
  }
5743
- return isSynchronized;
5853
+ this._isSynchronized = isSynchronized;
5744
5854
  }
5745
- }
5855
+ updateSource() {
5856
+ if (this.termCollection) {
5857
+ this.source = EngineTermCollectionSource.TILDE_TERM;
5858
+ }
5859
+ else if (this.mtCollection) {
5860
+ this.source = EngineTermCollectionSource.FILE;
5861
+ }
5862
+ }
5863
+ updateTooltipKey() {
5864
+ if (this.termCollection?.entryCount === 0) {
5865
+ this.termTooltipKey = CombinedCollectionTooltipKey.NO_ENTRIES;
5866
+ }
5867
+ else if (this.isImporting) {
5868
+ this.termTooltipKey = CombinedCollectionTooltipKey.IMPORTING;
5869
+ }
5870
+ else {
5871
+ this.termTooltipKey = null;
5872
+ }
5873
+ }
5874
+ updateEditables() {
5875
+ this.editables.default = this.mtCollection?.default;
5876
+ this.editables.scope = this.mtCollection?.scope ?? EngineTermCollectionScope.GLOBAL;
5877
+ }
5878
+ }
5879
+ //#region Static properties
5880
+ CombinedCollection.importingStatuses = [MtCollectionStatus.FETCHING, MtCollectionStatus.PREPROCESSING, MtCollectionStatus.PROCESSING, MtCollectionStatus.QUEUING];
5746
5881
 
5747
5882
  class TermApiService {
5748
5883
  constructor(config, http) {
@@ -5757,10 +5892,34 @@ class TermApiService {
5757
5892
  name: collectionName,
5758
5893
  defaultLanguages
5759
5894
  };
5760
- return this.http.post(this.url, params);
5895
+ return this.http.post(this.url, params)
5896
+ .pipe(map((collection) => {
5897
+ return this.convertToCombinedCollection(collection);
5898
+ }));
5761
5899
  }
5762
- getCollectionList(sourceLanguageCode, targetLanguageCode) {
5763
- return this.http.get(this.url).pipe(map((collections) => { return TldConvertedCollection.convertCollections(collections, sourceLanguageCode, targetLanguageCode); }));
5900
+ getCollectionList(languages) {
5901
+ return this.http.get(this.url)
5902
+ .pipe(map((collections) => {
5903
+ const converted = [];
5904
+ collections.forEach((collection) => {
5905
+ converted.push(this.convertToCombinedCollection(collection));
5906
+ });
5907
+ return converted;
5908
+ }));
5909
+ }
5910
+ getEditLink(termId, sourceLanguage, targetLanguage) {
5911
+ let link = `${this.config.termConfig.apiUrl}/collections/${termId}/mt`;
5912
+ if (sourceLanguage) {
5913
+ link = `${link}/${sourceLanguage}`;
5914
+ }
5915
+ if (targetLanguage) {
5916
+ link = `${link}/${targetLanguage}`;
5917
+ }
5918
+ return link;
5919
+ }
5920
+ convertToCombinedCollection(collection) {
5921
+ collection.modifyDate = new Date(collection.modifyDate);
5922
+ return new CombinedCollection(collection, null);
5764
5923
  }
5765
5924
  }
5766
5925
  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 });
@@ -5772,52 +5931,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
5772
5931
  }]
5773
5932
  }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: i1$3.HttpClient }]; } });
5774
5933
 
5775
- class MtCollectionsApiService {
5776
- constructor(http, config) {
5777
- this.http = http;
5934
+ class TerminologyService {
5935
+ constructor(config, termApi, mtApi) {
5778
5936
  this.config = config;
5779
- }
5780
- attachTermsFromTildeTerm(systemId, tildeTermCollectionId) {
5781
- const params = { systemID: systemId, tildeTermColectionID: tildeTermCollectionId };
5782
- const url = `${this.config.coreConfig.translationServiceUrl}AttachTermsFromTildeTerm`;
5783
- return this.http.get(url, { params });
5784
- }
5785
- loadMTCollections(systemId, sourceLanguage, targetLanguage) {
5786
- const headers = Common.getAuthHeaders(this.config);
5787
- const url = `${this.config.coreConfig.translationServiceUrl}GetDetailedSystemTermCorpora`;
5788
- const params = { systemID: systemId };
5789
- return this.http.get(url, { headers, params }).pipe(map((collections) => { return TldConvertedCollection.convertCollections(collections, sourceLanguage, targetLanguage); }));
5790
- }
5791
- }
5792
- 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 });
5793
- MtCollectionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, providedIn: 'root' });
5794
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtCollectionsApiService, decorators: [{
5795
- type: Injectable,
5796
- args: [{
5797
- providedIn: 'root'
5798
- }]
5799
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
5800
-
5801
- class TldTermCollectionsService {
5802
- constructor(config, tldSystem, termApi, mtApi) {
5803
- this.config = config;
5804
- this.tldSystem = tldSystem;
5805
5937
  this.termApi = termApi;
5806
5938
  this.mtApi = mtApi;
5807
5939
  this._selected = null;
5940
+ this.onDataUpdate = new Subject();
5808
5941
  this.LOCAL_STORAGE_KEY = "systemLastCollections";
5809
- this.tldSystem.getActiveData()
5810
- .subscribe((active) => {
5811
- this.sourceLanguageCode = active?.sourceLang.lang;
5812
- this.targetLanguageCode = active?.targetLang.lang;
5813
- this.activeSystemId = active?.systemId || null;
5814
- this._collections = new Set();
5815
- // avoiding setter, so the null value is not storeed in location since it is not by user action
5816
- this._selected = null;
5817
- if (active && this.tldSystem.isTerminologySupported(active?.system)) {
5818
- this.refreshCollections(true);
5819
- }
5820
- });
5821
5942
  }
5822
5943
  get selected() { return this._selected; }
5823
5944
  set selected(val) {
@@ -5826,15 +5947,15 @@ class TldTermCollectionsService {
5826
5947
  if (!this._selected) {
5827
5948
  return;
5828
5949
  }
5829
- if (!this._selected.id) {
5830
- this.addCollectionToSystem(this._selected);
5950
+ if (!this._selected.mtCollection) {
5951
+ this.addToEngine(this._selected);
5831
5952
  }
5832
5953
  }
5833
- get collections() {
5834
- return this._collections;
5954
+ get hasAnyCollections() {
5955
+ return this._hasAnyCollections;
5835
5956
  }
5836
- get isRefreshingCollections() {
5837
- return this._isRefreshingCollections;
5957
+ get shouldShowPromotion() {
5958
+ return !this.hasAnyCollections && !this.hasEditPermissions;
5838
5959
  }
5839
5960
  get canCreateCollections() {
5840
5961
  return this.config.termConfig.canCreateCollection;
@@ -5842,99 +5963,127 @@ class TldTermCollectionsService {
5842
5963
  get hasEditPermissions() {
5843
5964
  return this.config?.coreConfig.isAuth && this.canCreateCollections && this.config.termConfig.isTermPortalSupported;
5844
5965
  }
5845
- get hasAnyCollections() {
5846
- return this._hasAnyCollections;
5966
+ get isRefreshingCollections() {
5967
+ return this._isRefreshingCollections;
5847
5968
  }
5848
- get shouldShowPromotion() {
5849
- return !this.hasAnyCollections && !this.hasEditPermissions;
5969
+ get collections() {
5970
+ return this._collections;
5850
5971
  }
5851
- onMenuOpen() {
5852
- this.menuOpened = true;
5853
- if (!this.shouldShowPromotion) {
5854
- this.startAutoRefresh();
5972
+ setEngine(engineId, languages = null, setSelectedFromLocalStorage = false) {
5973
+ // engine is already set with that ID and no need to refresh it.
5974
+ if (engineId !== this.engineId || JSON.stringify(languages) !== JSON.stringify(this.engineLanguages)) {
5975
+ this.engineLanguages = languages;
5976
+ this.engineId = engineId;
5977
+ this._collections = new Set();
5978
+ this.emitDataUpdateEvent();
5979
+ // avoiding setter, so the null value is not storeed in location since it is not by user action
5980
+ this._selected = null;
5855
5981
  }
5982
+ if (this.engineId) {
5983
+ this.refreshCollections(setSelectedFromLocalStorage, true);
5984
+ }
5985
+ return this.onDataUpdate.asObservable();
5856
5986
  }
5857
- onMenuClose() {
5858
- this.menuOpened = false;
5859
- // if menu is closed, but selected collection still syncing, auto refresh should be kept opened.
5860
- if (this.selected?.mtStatus !== MtCollectionStatus.PROCESSING) {
5861
- this.stopAutoRefresh();
5987
+ refreshCollections(setSelectedFromLocalStorage = false, initialRefresh = false) {
5988
+ if (!this.engineId || !this.config.termConfig.isCollectionsActivated || this.isRefreshingCollections) {
5989
+ return;
5862
5990
  }
5991
+ // clear timeout since this refresh replaces scheduled
5992
+ this.clearTimeout();
5993
+ this._isRefreshingCollections = true;
5994
+ let termResponse;
5995
+ let mtApiResponse;
5996
+ const observables = [
5997
+ this.termApi.getCollectionList(this.engineLanguages)
5998
+ .pipe(tap((response) => termResponse = response)),
5999
+ this.mtApi.getList(this.engineId)
6000
+ .pipe(tap((response) => mtApiResponse = response)),
6001
+ ];
6002
+ forkJoin(observables).subscribe({
6003
+ // do not need response becaue responses are saved in pipe methods
6004
+ next: () => {
6005
+ this.isAnyImporting = false;
6006
+ // note that termResponse and mtapiresponse gets changed during remove method
6007
+ this.removeDeleted(termResponse, mtApiResponse, initialRefresh);
6008
+ this.addCollections([...mtApiResponse, ...termResponse], initialRefresh);
6009
+ if (setSelectedFromLocalStorage) {
6010
+ this.setSelectedFromLocalStorage();
6011
+ }
6012
+ this._isRefreshingCollections = false;
6013
+ this.scheduleRefresh();
6014
+ },
6015
+ error: (error) => {
6016
+ this._isRefreshingCollections = false;
6017
+ // it is enough to show error only in console. No special thing is necessary.
6018
+ console.error(error);
6019
+ },
6020
+ });
5863
6021
  }
5864
- addCollectionToSystem(collection) {
5865
- if (!collection || !collection.termId) {
6022
+ addToEngine(collection) {
6023
+ if (!collection || !collection.termCollection) {
5866
6024
  console.error("Trying to attach collection that has no tilde term id.");
5867
6025
  return;
5868
6026
  }
5869
- collection.mtStatus = MtCollectionStatus.PROCESSING;
5870
- collection.isSynchronized = true;
5871
- this.mtApi.attachTermsFromTildeTerm(this.activeSystemId, collection.termId)
5872
- .subscribe(() => { }, () => {
5873
- collection.mtStatus = MtCollectionStatus.ERROR;
5874
- collection.errorKey = ErrorCode.COLLECTION_IMPORT;
6027
+ // collection.mtStatus = MtCollectionStatus.PROCESSING;
6028
+ // collection.isSynchronized = true;
6029
+ this.mtApi.add(this.engineId, collection)
6030
+ .subscribe({
6031
+ error: () => {
6032
+ // collection.mtStatus = MtCollectionStatus.ERROR;
6033
+ // collection.errorKey = ErrorCode.COLLECTION_IMPORT;
6034
+ }
5875
6035
  });
5876
6036
  }
5877
- create(defaultLanguages, collectionName) {
5878
- return this.termApi.createCollection(defaultLanguages, collectionName).pipe(map(collection => new TldConvertedCollection(collection, this.sourceLanguageCode, this.targetLanguageCode)), tap((collection) => {
6037
+ create(sourceLanguage, targetLanguage, collectionName, redirectToEdit = true) {
6038
+ return this.termApi.createCollection([sourceLanguage, targetLanguage], collectionName).pipe(tap((collection) => {
6039
+ if (redirectToEdit) {
6040
+ window.open(this.termApi.getEditLink(collection.termCollection.id, sourceLanguage, targetLanguage), "_blank");
6041
+ }
5879
6042
  this._collections.add(collection);
6043
+ this.emitDataUpdateEvent();
5880
6044
  this._hasAnyCollections = true;
5881
6045
  }));
5882
6046
  }
5883
- refreshCollections(setSelectedFromLocalStorage = false) {
5884
- if (!this.activeSystemId
5885
- || !this.config.termConfig.isCollectionsActivated) {
5886
- return;
6047
+ updateIfNecessary(collection) {
6048
+ // collection is not imported and should be attached to engine
6049
+ if (collection.isEdited()) {
6050
+ this.mtApi.add(this.engineId, collection).subscribe((updatedCollection) => {
6051
+ collection.update(updatedCollection);
6052
+ });
5887
6053
  }
5888
- this._isRefreshingCollections = true;
5889
- const observables = [
5890
- this.termApi.getCollectionList(this.sourceLanguageCode, this.targetLanguageCode),
5891
- this.mtApi.loadMTCollections(this.activeSystemId, this.sourceLanguageCode, this.targetLanguageCode)
5892
- ];
5893
- forkJoin(observables).subscribe((response) => {
5894
- this.isAnyImporting = false;
5895
- // TO DO. Doesn't seem to be clean approach with syncing collections. Maybe some cleaner solution possible?
5896
- this.removeDeletedFromTerms(response[0]);
5897
- this.updateCollections([...response[0], ...response[1]]);
5898
- if (setSelectedFromLocalStorage) {
5899
- this.setSelectedFromLocalStorage();
5900
- }
5901
- this._isRefreshingCollections = false;
5902
- this.scheduleRefresh();
5903
- }, (error) => {
5904
- this._isRefreshingCollections = false;
5905
- // it is enough to show error only in console. No special thing is necessary.
5906
- console.error(error);
5907
- });
5908
6054
  }
5909
6055
  /**
5910
- *
5911
- * @returns selected collection id if it is allowed to use collection for translations
5912
- */
6056
+ *
6057
+ * @returns selected collection id if it is allowed to use collection for translations
6058
+ */
5913
6059
  selectedIdForTranslation() {
5914
- if (this.selected && (this.selected.mtPreparedDateTime || this.selected.mtStatus === MtCollectionStatus.READY)) {
5915
- return this.selected.id;
6060
+ if (this.selected?.mtCollection && (this.selected.mtCollection.lastUpdated || this.selected.mtCollection?.status === MtCollectionStatus.READY)) {
6061
+ return this.selected.mtCollection?.id;
5916
6062
  }
5917
6063
  return null;
5918
6064
  }
5919
- startAutoRefresh() {
5920
- this.isAutoRefreshingOn = true;
5921
- this.scheduleRefresh(0);
6065
+ startAutoRefresh(engineId, languages = null, setSelectedFromLocalStorage = false) {
6066
+ this.hardAutoRefresh = true;
6067
+ return this.setEngine(engineId ?? this.engineId, languages ?? this.engineLanguages, setSelectedFromLocalStorage);
5922
6068
  }
5923
6069
  stopAutoRefresh() {
5924
- if (this.refreshTimeout) {
5925
- clearTimeout(this.refreshTimeout);
5926
- this.refreshTimeout = null;
5927
- }
5928
- this.isAutoRefreshingOn = false;
6070
+ this.clearTimeout();
6071
+ this.isSoftAutoRefreshOn = false;
6072
+ this.hardAutoRefresh = false;
6073
+ }
6074
+ removeMtCollection(collection, engineId = this.engineId) {
6075
+ return this.mtApi.remove(engineId, collection).pipe(tap((response) => {
6076
+ collection.update(response);
6077
+ }));
5929
6078
  }
5930
6079
  scheduleRefresh(timeout) {
5931
6080
  // if menu is closed and selected collection is not importing anymore - auto refreshing should be cancelled.
5932
- if (!this.menuOpened && !this.selected?.isImporting && this.isAutoRefreshingOn) {
6081
+ if (!this.hardAutoRefresh && !this.selected?.isImporting && this.isSoftAutoRefreshOn) {
5933
6082
  this.stopAutoRefresh();
5934
6083
  return;
5935
6084
  }
5936
- // if menu is opened, auto refresh should be on. If menu is closed, refresh needs to be done only if selected is importing.
5937
- if (!this.refreshTimeout && (this.isAutoRefreshingOn || this.selected?.isImporting)) {
6085
+ // 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.
6086
+ if (this.hardAutoRefresh || (!this.refreshTimeout && (this.isSoftAutoRefreshOn || this.selected?.isImporting))) {
5938
6087
  const timeoutMs = timeout ?? (this.isAnyImporting ? this.config.termConfig.refreshTimeoutMsWhenImporting : this.config.termConfig.refreshTimeoutMs);
5939
6088
  this.refreshTimeout = setTimeout(() => {
5940
6089
  this.refreshTimeout = null;
@@ -5943,72 +6092,92 @@ class TldTermCollectionsService {
5943
6092
  }
5944
6093
  }
5945
6094
  /**
5946
- * Should be called after refresh to check if there is any collections from term api that are deleted.
6095
+ *
6096
+ * @param newCollections
6097
+ * @param initialRefresh Whether also editable collection fields should be updated. If not initial refresh, editable fields will not be updated.
5947
6098
  */
5948
- removeDeletedFromTerms(refreshedList) {
5949
- for (const collection of this.collections) {
5950
- if (!collection.termId) {
5951
- continue;
5952
- }
5953
- const exists = refreshedList.find(refreshedCollection => refreshedCollection.importedFrom === ConvertedCollectionType.Term && refreshedCollection.termId === collection.termId);
5954
- if (!exists) {
5955
- // Removes collection if it hasn't been imported.
5956
- if (!collection.id) {
5957
- this.collections.delete(collection);
5958
- }
5959
- else {
5960
- collection.deletedFromTermApi();
5961
- }
5962
- }
5963
- }
5964
- }
5965
- updateCollections(refreshedCollections) {
6099
+ addCollections(newCollections, initialRefresh) {
5966
6100
  // sets collection list to this value at the end, so deleted collections are not in the list.
5967
- const updatedCollections = new Set();
5968
- for (let collection of refreshedCollections) {
6101
+ for (let collection of newCollections) {
5969
6102
  // User shouldn't see failed collections if he can't retry to import them.
5970
6103
  if (!this.hasEditPermissions
5971
- && collection.importedFrom === ConvertedCollectionType.MT
5972
6104
  && collection.mtStatus === MtCollectionStatus.ERROR) {
5973
6105
  continue;
5974
6106
  }
5975
6107
  if (collection.isImporting) {
5976
6108
  this.isAnyImporting = true;
5977
6109
  }
5978
- let existing = TldConvertedCollection.findExistingCollectionFromList(this.collections, collection);
5979
- // 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.
5980
- // But term id is necessary to do the previous check to sync collections - it can be set to null only after update.
5981
- if (collection.importedFrom === ConvertedCollectionType.MT) {
5982
- // 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.
5983
- if (!(collection.mtStatus === MtCollectionStatus.READY
5984
- || (collection.mtStatus === MtCollectionStatus.PROCESSING && collection.mtPreparedDateTime)
5985
- || existing)) {
6110
+ let existing = CombinedCollection.findExistingCollectionFromList(this.collections, collection);
6111
+ // If term api doesn't have engine languages, collection should not be shown (if it is not already imported somehow);
6112
+ if (!existing && collection.source === EngineTermCollectionSource.TILDE_TERM) {
6113
+ let hasLanguages = true;
6114
+ for (let i = 0; i < this.engineLanguages?.length; i++) {
6115
+ if (!collection.termCollection.languages?.find(lang => lang.id === this.engineLanguages[i])) {
6116
+ hasLanguages = false;
6117
+ break;
6118
+ }
6119
+ }
6120
+ if (!hasLanguages) {
5986
6121
  continue;
5987
6122
  }
5988
- collection.termId = null;
5989
6123
  }
5990
- if (existing) {
5991
- existing.update(collection);
6124
+ if (!existing) {
6125
+ this._collections.add(collection);
6126
+ }
6127
+ else {
6128
+ existing.update(collection, initialRefresh);
6129
+ }
6130
+ }
6131
+ // this._collections = updatedCollections;
6132
+ this.emitDataUpdateEvent();
6133
+ this._hasAnyCollections = this._collections.size > 0;
6134
+ }
6135
+ /**
6136
+ * Should be called after refresh to check if there is any collections from api that are deleted.
6137
+ */
6138
+ removeDeleted(termResponse, mtResponse, initialRefresh) {
6139
+ for (const collection of this.collections) {
6140
+ const termExistingIx = CombinedCollection.findExistingIndexFromList(termResponse, collection);
6141
+ const mtExistingIx = CombinedCollection.findExistingIndexFromList(mtResponse, collection);
6142
+ if (termExistingIx === null && mtExistingIx === null) {
6143
+ this.collections.delete(collection);
5992
6144
  }
5993
6145
  else {
5994
- this.collections.add(collection);
6146
+ if (termExistingIx !== null) {
6147
+ const existing = termResponse[termExistingIx];
6148
+ collection.update(existing, initialRefresh);
6149
+ termResponse.splice(termExistingIx, 1);
6150
+ }
6151
+ else {
6152
+ collection.deleteTerms();
6153
+ }
6154
+ if (mtExistingIx !== null) {
6155
+ const existing = mtResponse[mtExistingIx];
6156
+ collection.update(existing, initialRefresh);
6157
+ mtResponse.splice(mtExistingIx, 1);
6158
+ }
6159
+ else {
6160
+ collection.deleteMT();
6161
+ }
5995
6162
  }
5996
- const editedCollection = existing ?? collection;
5997
- updatedCollections.add(editedCollection);
5998
6163
  }
5999
- this._collections = updatedCollections;
6000
- this._hasAnyCollections = updatedCollections.size > 0;
6164
+ }
6165
+ clearTimeout() {
6166
+ if (this.refreshTimeout) {
6167
+ clearTimeout(this.refreshTimeout);
6168
+ this.refreshTimeout = null;
6169
+ }
6001
6170
  }
6002
6171
  setSelectedFromLocalStorage() {
6003
6172
  // If no collections or selected is already set, it should not be changed from localstorage value. (Usually, localstorage should have the same value).
6004
6173
  if (this.collections?.size === 0 || this.selected) {
6005
6174
  return;
6006
6175
  }
6007
- const storedId = this.readLocalStorage()?.[this.activeSystemId];
6176
+ const storedId = this.readLocalStorage()?.[this.engineId];
6008
6177
  if (!storedId) {
6009
6178
  return;
6010
6179
  }
6011
- const existing = Array.from(this.collections).find(item => item.id === storedId || item.termId === storedId);
6180
+ const existing = Array.from(this.collections).find(item => item.termCollection?.id === storedId || item.mtCollection?.id === storedId);
6012
6181
  this.selected = existing;
6013
6182
  }
6014
6183
  storeSelectedInLocalStorage() {
@@ -6016,7 +6185,7 @@ class TldTermCollectionsService {
6016
6185
  if (!localStorageObject) {
6017
6186
  localStorageObject = {};
6018
6187
  }
6019
- localStorageObject[this.activeSystemId] = this.selected ? (this.selected.termId ?? this.selected.id) : null;
6188
+ localStorageObject[this.engineId] = this.selected ? (this.selected.termCollection?.id ?? this.selected.mtCollection?.id) : null;
6020
6189
  // store term id if it exists
6021
6190
  localStorage.setItem(this.LOCAL_STORAGE_KEY, JSON.stringify(localStorageObject));
6022
6191
  }
@@ -6029,21 +6198,27 @@ class TldTermCollectionsService {
6029
6198
  return null;
6030
6199
  }
6031
6200
  }
6201
+ emitDataUpdateEvent() {
6202
+ this.onDataUpdate.next(this.collections);
6203
+ }
6032
6204
  }
6033
- 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 });
6034
- TldTermCollectionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionsService, providedIn: 'root' });
6035
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionsService, decorators: [{
6205
+ 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 });
6206
+ TerminologyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, providedIn: 'root' });
6207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TerminologyService, decorators: [{
6036
6208
  type: Injectable,
6037
6209
  args: [{
6038
6210
  providedIn: 'root'
6039
6211
  }]
6040
- }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: TldSystemService }, { type: TermApiService }, { type: MtCollectionsApiService }]; } });
6212
+ }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: TermApiService }, { type: undefined, decorators: [{
6213
+ type: Inject,
6214
+ args: [MT_TERM_API_TOKEN]
6215
+ }] }]; } });
6041
6216
 
6042
6217
  class TldTranslateFileApiService {
6043
- constructor(http, config, collectionService, alerts) {
6218
+ constructor(http, config, terminologyService, alerts) {
6044
6219
  this.http = http;
6045
6220
  this.config = config;
6046
- this.collectionService = collectionService;
6221
+ this.terminologyService = terminologyService;
6047
6222
  this.alerts = alerts;
6048
6223
  this._segmentLimit = -1;
6049
6224
  this._sourceDownloadStatusses = [TranslationStatuss.WAITING, TranslationStatuss.SAVING, TranslationStatuss.COMPLETED, TranslationStatuss.TRANSLATING];
@@ -6077,11 +6252,11 @@ class TldTranslateFileApiService {
6077
6252
  segmentLimit: this._segmentLimit,
6078
6253
  ocrPageLimit: this.config.fileConfig.ocrPageLimit
6079
6254
  };
6080
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
6255
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
6081
6256
  if (selectedCollectionId) {
6082
6257
  params.termCorpusId = selectedCollectionId;
6083
6258
  }
6084
- return this.http.post(url, params, { headers }).pipe(map((response) => {
6259
+ return this.http.post(url, params, { headers }).pipe(map$1((response) => {
6085
6260
  if (response.success) {
6086
6261
  const error = { ErrorCode: ErrorCode.CANT_START_FILE_TRANSLATION };
6087
6262
  this.alerts.unhandeledError(error);
@@ -6108,7 +6283,7 @@ class TldTranslateFileApiService {
6108
6283
  const formData = new FormData();
6109
6284
  formData.append("file", file.file);
6110
6285
  return this.http.post(url, formData, { headers: new HttpHeaders(headers), reportProgress: true, observe: "events" })
6111
- .pipe(map((response) => {
6286
+ .pipe(map$1((response) => {
6112
6287
  const returnvalue = {};
6113
6288
  if (response.type === HttpEventType.Response) {
6114
6289
  const body = response.body;
@@ -6131,7 +6306,7 @@ class TldTranslateFileApiService {
6131
6306
  getStatus(properties) {
6132
6307
  const methodName = "GetStatus";
6133
6308
  const url = this.config.fileConfig.fileApiUrl + methodName;
6134
- return this.http.post(url, { docId: properties.file.id }, { headers: this.getAuthHeaders() }).pipe(map((response) => {
6309
+ return this.http.post(url, { docId: properties.file.id }, { headers: this.getAuthHeaders() }).pipe(map$1((response) => {
6135
6310
  if (typeof (response) == 'string') {
6136
6311
  const error = { ErrorCode: response };
6137
6312
  this.alerts.unhandeledError(error);
@@ -6186,78 +6361,43 @@ class TldTranslateFileApiService {
6186
6361
  return Common.getAuthHeaders(this.config);
6187
6362
  }
6188
6363
  }
6189
- 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 });
6364
+ 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 });
6190
6365
  TldTranslateFileApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, providedIn: 'root' });
6191
6366
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateFileApiService, decorators: [{
6192
6367
  type: Injectable,
6193
6368
  args: [{
6194
6369
  providedIn: 'root'
6195
6370
  }]
6196
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TldTermCollectionsService }, { type: TldAlertService }]; } });
6197
-
6198
- class TldTermCreateCollectionDialogComponent {
6199
- constructor(dialogRef, data, config) {
6200
- this.dialogRef = dialogRef;
6201
- this.data = data;
6202
- this.config = config;
6203
- }
6204
- ngOnInit() {
6205
- this.minLength = this.config.termConfig.collectionNameMinLength;
6206
- this.maxLength = this.config.termConfig.collectionNameMaxLength;
6207
- this.collectionName = new UntypedFormControl(this.data.collectionName, [
6208
- Validators.minLength(this.minLength),
6209
- Validators.maxLength(this.maxLength),
6210
- Validators.required
6211
- ]);
6212
- this.collectionName.markAsTouched();
6213
- this.formGroup = new UntypedFormGroup({ collectionName: this.collectionName });
6214
- }
6215
- submit() {
6216
- if (this.formGroup.valid) {
6217
- this.dialogRef.close(this.collectionName.value);
6218
- }
6219
- }
6220
- }
6221
- 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 });
6222
- 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" }] });
6223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, decorators: [{
6224
- type: Component,
6225
- 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"] }]
6226
- }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
6227
- type: Inject,
6228
- args: [MAT_DIALOG_DATA]
6229
- }] }, { type: TldTranslateConfigService }]; } });
6371
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TerminologyService }, { type: TldAlertService }]; } });
6230
6372
 
6231
6373
  class TldTermCollectionListComponent {
6232
- constructor(collectionService, config, tldSystem, dialog, translate, alerts) {
6233
- this.collectionService = collectionService;
6374
+ constructor(terminologyService, config, tldSystem, termApiService) {
6375
+ this.terminologyService = terminologyService;
6234
6376
  this.config = config;
6235
6377
  this.tldSystem = tldSystem;
6236
- this.dialog = dialog;
6237
- this.translate = translate;
6238
- this.alerts = alerts;
6378
+ this.termApiService = termApiService;
6239
6379
  this.localizationKey = "TERM_COLLECTIONS.";
6240
6380
  this.tooltipLocalizationKey = "TERM_COLLECTIONS.TOOLTIPS.";
6241
6381
  this.readyStatus = "Ready";
6242
6382
  this.collectionErrorStatus = MtCollectionStatus.ERROR;
6243
6383
  }
6244
6384
  get selected() {
6245
- return this.collectionService.selected;
6385
+ return this.terminologyService.selected;
6246
6386
  }
6247
6387
  set selected(val) {
6248
- this.collectionService.selected = val;
6388
+ this.terminologyService.selected = val;
6249
6389
  }
6250
6390
  get collections() {
6251
- return this.collectionService?.collections;
6391
+ return this.terminologyService?.collections;
6252
6392
  }
6253
6393
  get hasAnyCollections() {
6254
- return this.collectionService.hasAnyCollections;
6394
+ return this.terminologyService.hasAnyCollections;
6255
6395
  }
6256
6396
  get isRefreshingCollections() {
6257
- return this.collectionService?.isRefreshingCollections;
6397
+ return this.terminologyService?.isRefreshingCollections;
6258
6398
  }
6259
6399
  get hasEditPermissions() {
6260
- return this.collectionService.hasEditPermissions;
6400
+ return this.terminologyService.hasEditPermissions;
6261
6401
  }
6262
6402
  get appName() {
6263
6403
  return this.config.coreConfig.appName;
@@ -6272,42 +6412,18 @@ class TldTermCollectionListComponent {
6272
6412
  this.subscription.unsubscribe();
6273
6413
  }
6274
6414
  getEditLink(collection) {
6275
- return `${this.config.termConfig.apiUrl}/collections/${collection.termId}/mt/${this.sourceLanguageCode}/${this.targetLanguageCode}`;
6276
- }
6277
- createNew() {
6278
- const localizationKey = "TERM_COLLECTIONS.DEFAULT_COLLECTION_NAME";
6279
- this.translate.get(localizationKey).subscribe((collectionName) => {
6280
- const dialogRef = this.dialog.open(TldTermCreateCollectionDialogComponent, {
6281
- minWidth: '300px',
6282
- maxWidth: '700px',
6283
- data: { collectionName: collectionName }
6284
- });
6285
- dialogRef.afterClosed().subscribe(collectionName => {
6286
- if (!collectionName) {
6287
- return;
6288
- }
6289
- const languages = [this.sourceLanguageCode, this.targetLanguageCode];
6290
- this.collectionService.create(languages, collectionName).subscribe((collection) => {
6291
- window.open(this.getEditLink(collection), "_blank");
6292
- }, (err) => {
6293
- console.error(err);
6294
- const error = { ErrorCode: ErrorCode.COLLECTION_CREATE };
6295
- this.alerts.unhandeledError(error);
6296
- throw error;
6297
- });
6298
- });
6299
- });
6415
+ return this.termApiService.getEditLink(collection.termCollection?.id, this.sourceLanguageCode, this.targetLanguageCode);
6300
6416
  }
6301
6417
  attach(collection) {
6302
- this.collectionService.addCollectionToSystem(collection);
6418
+ this.terminologyService.addToEngine(collection);
6303
6419
  }
6304
6420
  }
6305
- 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 });
6306
- 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" }] });
6421
+ 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 });
6422
+ 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" }] });
6307
6423
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionListComponent, decorators: [{
6308
6424
  type: Component,
6309
- 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"] }]
6310
- }], ctorParameters: function () { return [{ type: TldTermCollectionsService }, { type: TldTranslateConfigService }, { type: TldSystemService }, { type: i1$2.MatDialog }, { type: i1$1.TranslateService }, { type: TldAlertService }]; } });
6425
+ 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"] }]
6426
+ }], ctorParameters: function () { return [{ type: TerminologyService }, { type: TldTranslateConfigService }, { type: TldSystemService }, { type: TermApiService }]; } });
6311
6427
 
6312
6428
  class WtwLinkParamsService {
6313
6429
  constructor(translate) {
@@ -6364,44 +6480,138 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
6364
6480
  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"] }]
6365
6481
  }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: WtwLinkParamsService }]; } });
6366
6482
 
6483
+ class TldTermCreateCollectionDialogComponent {
6484
+ constructor(dialogRef, data, config) {
6485
+ this.dialogRef = dialogRef;
6486
+ this.data = data;
6487
+ this.config = config;
6488
+ }
6489
+ ngOnInit() {
6490
+ this.minLength = this.config.termConfig.collectionNameMinLength;
6491
+ this.maxLength = this.config.termConfig.collectionNameMaxLength;
6492
+ this.collectionName = new UntypedFormControl(this.data.collectionName, [
6493
+ Validators.minLength(this.minLength),
6494
+ Validators.maxLength(this.maxLength),
6495
+ Validators.required
6496
+ ]);
6497
+ this.collectionName.markAsTouched();
6498
+ this.formGroup = new UntypedFormGroup({ collectionName: this.collectionName });
6499
+ }
6500
+ submit() {
6501
+ if (this.formGroup.valid) {
6502
+ this.dialogRef.close(this.collectionName.value);
6503
+ }
6504
+ }
6505
+ }
6506
+ 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 });
6507
+ 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" }] });
6508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCreateCollectionDialogComponent, decorators: [{
6509
+ type: Component,
6510
+ 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"] }]
6511
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
6512
+ type: Inject,
6513
+ args: [MAT_DIALOG_DATA]
6514
+ }] }, { type: TldTranslateConfigService }]; } });
6515
+
6516
+ class CreateCollectionComponent {
6517
+ constructor(translate, dialog, terminologyService) {
6518
+ this.translate = translate;
6519
+ this.dialog = dialog;
6520
+ this.terminologyService = terminologyService;
6521
+ }
6522
+ ngOnInit() {
6523
+ }
6524
+ create() {
6525
+ const localizationKey = "TERM_COLLECTIONS.DEFAULT_COLLECTION_NAME";
6526
+ this.translate.get(localizationKey).subscribe((collectionName) => {
6527
+ const dialogRef = this.dialog.open(TldTermCreateCollectionDialogComponent, {
6528
+ minWidth: '300px',
6529
+ maxWidth: '700px',
6530
+ data: { collectionName: collectionName }
6531
+ });
6532
+ dialogRef.afterClosed().subscribe(collectionName => {
6533
+ if (!collectionName) {
6534
+ return;
6535
+ }
6536
+ this.terminologyService.create(this.sourceLanguageCode, this.targetLanguageCode, collectionName).subscribe({
6537
+ error: (err) => {
6538
+ console.error(err);
6539
+ const error = { ErrorCode: ErrorCode.COLLECTION_CREATE };
6540
+ throw error;
6541
+ }
6542
+ });
6543
+ });
6544
+ });
6545
+ }
6546
+ }
6547
+ 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 });
6548
+ 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" }] });
6549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateCollectionComponent, decorators: [{
6550
+ type: Component,
6551
+ 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" }]
6552
+ }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: i1$2.MatDialog }, { type: TerminologyService }]; }, propDecorators: { sourceLanguageCode: [{
6553
+ type: Input
6554
+ }], targetLanguageCode: [{
6555
+ type: Input
6556
+ }] } });
6557
+
6367
6558
  class TldTermCollectionComponent {
6368
- constructor(terms) {
6369
- this.terms = terms;
6559
+ constructor(terminologyService, systemService) {
6560
+ this.terminologyService = terminologyService;
6561
+ this.systemService = systemService;
6562
+ }
6563
+ get promotion() { return this.terminologyService.shouldShowPromotion; }
6564
+ get hasEditPermissions() { return this.terminologyService.hasEditPermissions; }
6565
+ ngOnInit() {
6566
+ this.subscription = this.systemService.getActiveData().subscribe((data) => {
6567
+ this.sourceLanguageCode = data.sourceLang.lang;
6568
+ this.targetLanguageCode = data.targetLang.lang;
6569
+ this.terminologyService.setEngine(data.systemId, [this.sourceLanguageCode, this.targetLanguageCode]);
6570
+ });
6571
+ }
6572
+ ngOnDestroy() {
6573
+ this.subscription.unsubscribe();
6370
6574
  }
6371
- get promotion() { return this.terms.shouldShowPromotion; }
6372
6575
  }
6373
- TldTermCollectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, deps: [{ token: TldTermCollectionsService }], target: i0.ɵɵFactoryTarget.Component });
6374
- 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" }] });
6576
+ 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 });
6577
+ 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"] }] });
6375
6578
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermCollectionComponent, decorators: [{
6376
6579
  type: Component,
6377
- 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>" }]
6378
- }], ctorParameters: function () { return [{ type: TldTermCollectionsService }]; } });
6580
+ 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"] }]
6581
+ }], ctorParameters: function () { return [{ type: TerminologyService }, { type: TldSystemService }]; } });
6379
6582
 
6380
6583
  class TldTermMenuComponent {
6381
- constructor(collectionService) {
6382
- this.collectionService = collectionService;
6584
+ constructor(terminologyService) {
6585
+ this.terminologyService = terminologyService;
6383
6586
  }
6384
- get selected() { return this.collectionService.selected; }
6587
+ get selected() { return this.terminologyService.selected; }
6385
6588
  ;
6386
- set selected(val) { this.collectionService.selected = val; }
6589
+ set selected(val) { this.terminologyService.selected = val; }
6590
+ get title() {
6591
+ return this.selected?.termCollection?.name ?? this.selected.mtCollection?.name;
6592
+ }
6593
+ ngOnDestroy() {
6594
+ this.menuClosed();
6595
+ }
6387
6596
  menuOpened() {
6388
- this.collectionService.onMenuOpen();
6597
+ this.subscription = this.terminologyService.startAutoRefresh().subscribe();
6389
6598
  }
6390
6599
  menuClosed() {
6391
- this.collectionService.onMenuClose();
6600
+ this.terminologyService.stopAutoRefresh();
6601
+ this.subscription?.unsubscribe();
6392
6602
  }
6393
6603
  }
6394
- TldTermMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, deps: [{ token: TldTermCollectionsService }], target: i0.ɵɵFactoryTarget.Component });
6395
- 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" }] });
6604
+ TldTermMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, deps: [{ token: TerminologyService }], target: i0.ɵɵFactoryTarget.Component });
6605
+ 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" }] });
6396
6606
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermMenuComponent, decorators: [{
6397
6607
  type: Component,
6398
- 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"] }]
6399
- }], ctorParameters: function () { return [{ type: TldTermCollectionsService }]; } });
6608
+ 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"] }]
6609
+ }], ctorParameters: function () { return [{ type: TerminologyService }]; } });
6400
6610
 
6401
6611
  class TldTermModule {
6402
6612
  }
6403
6613
  TldTermModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6404
- TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent], imports: [FormsModule,
6614
+ 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,
6405
6615
  CommonModule,
6406
6616
  MaterialModule,
6407
6617
  TranslateModule,
@@ -6412,7 +6622,7 @@ TldTermModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
6412
6622
  MatTooltipModule,
6413
6623
  TldCommonModule,
6414
6624
  ReactiveFormsModule,
6415
- CloseButtonModule], exports: [TldTermMenuComponent] });
6625
+ CloseButtonModule], exports: [TldTermMenuComponent, CreateCollectionComponent] });
6416
6626
  TldTermModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, imports: [FormsModule,
6417
6627
  CommonModule,
6418
6628
  MaterialModule,
@@ -6428,7 +6638,7 @@ TldTermModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
6428
6638
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTermModule, decorators: [{
6429
6639
  type: NgModule,
6430
6640
  args: [{
6431
- declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent],
6641
+ declarations: [TldTermCollectionComponent, TldTermCollectionListComponent, TldTermCreateCollectionDialogComponent, TldTermMenuComponent, TldTermPromotionComponent, CreateCollectionComponent],
6432
6642
  imports: [
6433
6643
  FormsModule,
6434
6644
  CommonModule,
@@ -6443,79 +6653,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
6443
6653
  ReactiveFormsModule,
6444
6654
  CloseButtonModule
6445
6655
  ],
6446
- exports: [TldTermMenuComponent]
6656
+ exports: [TldTermMenuComponent, CreateCollectionComponent]
6447
6657
  }]
6448
6658
  }] });
6449
6659
 
6450
- var FileTypeIcons;
6451
- (function (FileTypeIcons) {
6452
- FileTypeIcons["WORD"] = "file_type_word";
6453
- FileTypeIcons["WEB"] = "file_type_web";
6454
- FileTypeIcons["OTHER"] = "file_type_other";
6455
- FileTypeIcons["POWERPOINT"] = "file_type_powerpoint";
6456
- FileTypeIcons["EXCEL"] = "file_type_excel";
6457
- FileTypeIcons["OFFICE_OTHER"] = "file_type_office_other";
6458
- FileTypeIcons["PDF"] = "file_type_pdf";
6459
- FileTypeIcons["SCANNED"] = "file_type_scanned";
6460
- FileTypeIcons["INTERCHANGE"] = "file_type_interchange";
6461
- })(FileTypeIcons || (FileTypeIcons = {}));
6462
-
6463
- var FileCategories;
6464
- (function (FileCategories) {
6465
- FileCategories["OFFICE"] = "OFFICE";
6466
- FileCategories["SCANNED"] = "SCANNED";
6467
- FileCategories["INTERCHANGE"] = "INTERCHANGE";
6468
- FileCategories["WEB"] = "WEB";
6469
- FileCategories["OTHER"] = "OTHER";
6470
- })(FileCategories || (FileCategories = {}));
6471
-
6472
- var FileTypes;
6473
- (function (FileTypes) {
6474
- FileTypes["WORD"] = "WORD";
6475
- FileTypes["WEB"] = "WEB";
6476
- FileTypes["OTHER"] = "OTHER";
6477
- FileTypes["POWERPOINT"] = "POWERPOINT";
6478
- FileTypes["EXCEL"] = "EXCEL";
6479
- FileTypes["OFFICE_OTHER"] = "OFFICE_OTHER";
6480
- FileTypes["PDF"] = "PDF";
6481
- FileTypes["SCANNED"] = "SCANNED";
6482
- FileTypes["INTERCHANGE"] = "INTERCHANGE";
6483
- })(FileTypes || (FileTypes = {}));
6484
-
6485
- var FileExtensions;
6486
- (function (FileExtensions) {
6487
- FileExtensions["DOC"] = "doc";
6488
- FileExtensions["DOCX"] = "docx";
6489
- FileExtensions["XLSX"] = "xlsx";
6490
- FileExtensions["PPTX"] = "pptx";
6491
- FileExtensions["ODT"] = "odt";
6492
- FileExtensions["ODP"] = "odp";
6493
- FileExtensions["ODS"] = "ods";
6494
- FileExtensions["TXT"] = "txt";
6495
- FileExtensions["RTF"] = "rtf";
6496
- FileExtensions["PAGES"] = "pages";
6497
- FileExtensions["SXW"] = "sxw";
6498
- FileExtensions["JPG"] = "jpg";
6499
- FileExtensions["JPEG"] = "jpeg";
6500
- FileExtensions["PNG"] = "png";
6501
- FileExtensions["BMP"] = "bmp";
6502
- FileExtensions["PDF"] = "pdf";
6503
- FileExtensions["SDLXLIFF"] = "sdlxliff";
6504
- FileExtensions["SDLXLF"] = "sdlxlf";
6505
- FileExtensions["TTX"] = "ttx";
6506
- FileExtensions["TMX"] = "tmx";
6507
- FileExtensions["XLF"] = "xlf";
6508
- FileExtensions["XLIF"] = "xlif";
6509
- FileExtensions["HTML"] = "html";
6510
- FileExtensions["HTM"] = "htm";
6511
- FileExtensions["JSON"] = "json";
6512
- FileExtensions["XHTML"] = "xhtml";
6513
- FileExtensions["XHT"] = "xht";
6514
- FileExtensions["XLIFF"] = "xliff";
6515
- FileExtensions["TEX"] = "tex";
6516
- FileExtensions["TTL"] = "ttl";
6517
- FileExtensions["SRT"] = "srt";
6518
- })(FileExtensions || (FileExtensions = {}));
6660
+ class EningeTermApiService {
6661
+ constructor(http, config) {
6662
+ this.http = http;
6663
+ this.config = config;
6664
+ this.baseUrl = this.config.termConfig.engineTermUrl;
6665
+ }
6666
+ add(engineId, params) {
6667
+ return this.http.post(`${this.baseUrl}/${engineId}/terms`, params);
6668
+ }
6669
+ update(engineId, collectionId, params) {
6670
+ return this.http.put(`${this.baseUrl}/${engineId}/terms/${collectionId}`, params);
6671
+ }
6672
+ getList(engineId) {
6673
+ return this.http.get(`${this.baseUrl}/${engineId}/terms`, { params: { engineId } });
6674
+ }
6675
+ remove(engineId, collectionId) {
6676
+ return this.http.delete(`${this.baseUrl}/${engineId}/terms/${collectionId}`);
6677
+ }
6678
+ }
6679
+ 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 });
6680
+ EningeTermApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EningeTermApiService, providedIn: 'root' });
6681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EningeTermApiService, decorators: [{
6682
+ type: Injectable,
6683
+ args: [{
6684
+ providedIn: 'root'
6685
+ }]
6686
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
6519
6687
 
6520
6688
  class ExtensionDialogComponent {
6521
6689
  constructor(data) {
@@ -6998,10 +7166,10 @@ class TldVoiceInputApiService {
6998
7166
  const formData = new FormData();
6999
7167
  formData.append("file", params.file);
7000
7168
  formData.append("langauge", params.language);
7001
- return this.http.post(this.audioConfig.audioApiUrl, formData).pipe(map(response => this.mapJob(response)));
7169
+ return this.http.post(this.audioConfig.audioApiUrl, formData).pipe(map$1(response => this.mapJob(response)));
7002
7170
  }
7003
7171
  getJobInfo(jobId) {
7004
- return this.http.get(`${this.audioConfig.audioApiUrl}/${jobId}`).pipe(map(response => this.mapJob(response)));
7172
+ return this.http.get(`${this.audioConfig.audioApiUrl}/${jobId}`).pipe(map$1(response => this.mapJob(response)));
7005
7173
  }
7006
7174
  mapJob(response) {
7007
7175
  // converts to VoiceToTextState, so it suits enum conventions.
@@ -7616,7 +7784,7 @@ class TldTranslateTextService {
7616
7784
  this.untranslatedParagraphCount = 0;
7617
7785
  this.paragraphTranslationSubscription = this.paragraphTranslationsSubject.asObservable().pipe(mergeMap((untranslatedParagraph) => {
7618
7786
  this.untranslatedParagraphCount += 1;
7619
- return this.translateParagraph(untranslatedParagraph).pipe(tap((response) => {
7787
+ return this.translateParagraph(untranslatedParagraph).pipe(tap$1((response) => {
7620
7788
  // No need to handle response if source text has changed.
7621
7789
  if (source != this.sourceText) {
7622
7790
  return;
@@ -9409,7 +9577,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
9409
9577
 
9410
9578
  window.$ = window.jQuery = $;
9411
9579
  class TldTranslateWebsiteComponent {
9412
- constructor(translate, configService, translateButtonService, alerts, router, activatedRoute, tldSystem, collectionService, tldTranslateWebService, iconService, apiVersion) {
9580
+ constructor(translate, configService, translateButtonService, alerts, router, activatedRoute, tldSystem, terminologyService, tldTranslateWebService, iconService, apiVersion) {
9413
9581
  this.translate = translate;
9414
9582
  this.configService = configService;
9415
9583
  this.translateButtonService = translateButtonService;
@@ -9417,7 +9585,7 @@ class TldTranslateWebsiteComponent {
9417
9585
  this.router = router;
9418
9586
  this.activatedRoute = activatedRoute;
9419
9587
  this.tldSystem = tldSystem;
9420
- this.collectionService = collectionService;
9588
+ this.terminologyService = terminologyService;
9421
9589
  this.tldTranslateWebService = tldTranslateWebService;
9422
9590
  this.apiVersion = apiVersion;
9423
9591
  this.product = '';
@@ -9684,7 +9852,7 @@ class TldTranslateWebsiteComponent {
9684
9852
  this.sendMessage({ message: 'changeSystem', systemId: sys.id });
9685
9853
  }
9686
9854
  translateButtonClick() {
9687
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
9855
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
9688
9856
  if (this.urlToTranslate != '') {
9689
9857
  this.sendMessage({
9690
9858
  message: 'loadUrl',
@@ -9843,7 +10011,7 @@ class TldTranslateWebsiteComponent {
9843
10011
  body.appendChild(script);
9844
10012
  }
9845
10013
  }
9846
- 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 });
10014
+ 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 });
9847
10015
  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: [
9848
10016
  trigger('openCloseAnimation', [
9849
10017
  transition(':enter', [
@@ -9864,7 +10032,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
9864
10032
  transition(':leave', animate(500, style({ height: 0 })))
9865
10033
  ])
9866
10034
  ], 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"] }]
9867
- }], ctorParameters: function () { 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: [{
10035
+ }], ctorParameters: function () { 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: [{
9868
10036
  type: Inject,
9869
10037
  args: [TRANSLATION_API_VERSION_TOKEN]
9870
10038
  }] }]; }, propDecorators: { product: [{
@@ -10172,6 +10340,122 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10172
10340
  args: [TldTranslateBodyComponent]
10173
10341
  }] } });
10174
10342
 
10343
+ class MtTermV1Service {
10344
+ constructor(http, config) {
10345
+ this.http = http;
10346
+ this.config = config;
10347
+ }
10348
+ add(engineId, collection) {
10349
+ const url = `${this.config.coreConfig.translationServiceUrl}AttachTermsFromTildeTerm`;
10350
+ return this.http.get(url, { params: { systemID: engineId, tildeTermColectionID: collection.termId } })
10351
+ .pipe(map(data => this.convertToCombinedCollection(data)));
10352
+ }
10353
+ getList(engineId) {
10354
+ const headers = Common.getAuthHeaders(this.config);
10355
+ const url = `${this.config.coreConfig.translationServiceUrl}GetDetailedSystemTermCorpora`;
10356
+ const params = { systemID: engineId };
10357
+ return this.http.get(url, { headers, params }).pipe(map((data) => {
10358
+ const mtCollections = [];
10359
+ data.forEach((collection) => {
10360
+ mtCollections.push(this.convertToCombinedCollection(collection));
10361
+ });
10362
+ return mtCollections;
10363
+ }));
10364
+ }
10365
+ remove(engineId, collection) {
10366
+ throw new Error("not Implemented");
10367
+ }
10368
+ convertToCombinedCollection(collection) {
10369
+ const convertedMtCollection = {
10370
+ id: collection.CorpusId,
10371
+ termId: collection.TildeTermId,
10372
+ lastUpdated: new Date(collection.AttachmentDateTime),
10373
+ name: collection.Title,
10374
+ // any because enums should overlap
10375
+ status: collection.Status
10376
+ };
10377
+ return new CombinedCollection(null, convertedMtCollection);
10378
+ }
10379
+ }
10380
+ 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 });
10381
+ MtTermV1Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV1Service, providedIn: 'root' });
10382
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV1Service, decorators: [{
10383
+ type: Injectable,
10384
+ args: [{
10385
+ providedIn: 'root'
10386
+ }]
10387
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
10388
+
10389
+ class MtTermV2Service {
10390
+ constructor(config, engineTermApi) {
10391
+ this.config = config;
10392
+ this.engineTermApi = engineTermApi;
10393
+ this.baseUrl = this.config.termConfig.engineTermUrl;
10394
+ }
10395
+ add(engineId, collection) {
10396
+ if (!collection.mtCollection) {
10397
+ const params = {
10398
+ collectionId: collection.termId,
10399
+ default: collection.editables.default,
10400
+ collectionSource: collection.source,
10401
+ scope: collection.editables.scope
10402
+ };
10403
+ return this.engineTermApi.add(engineId, params)
10404
+ .pipe(map(collection => this.convertToCombinedCollection(collection)));
10405
+ }
10406
+ else {
10407
+ const params = {
10408
+ default: collection.editables.default,
10409
+ scope: collection.editables.scope
10410
+ };
10411
+ return this.engineTermApi.update(engineId, collection.termId, params)
10412
+ .pipe(map(collection => this.convertToCombinedCollection(collection)));
10413
+ }
10414
+ }
10415
+ getList(engineId) {
10416
+ return this.engineTermApi.getList(engineId)
10417
+ .pipe(map((collections) => {
10418
+ const converted = [];
10419
+ collections?.termCollections?.forEach((collection) => {
10420
+ converted.push(this.convertToCombinedCollection(collection));
10421
+ });
10422
+ return converted;
10423
+ }));
10424
+ }
10425
+ remove(engineId, collection) {
10426
+ return this.engineTermApi.remove(engineId, collection.mtCollection.id).pipe(map(collection => this.convertToCombinedCollection(collection)));
10427
+ }
10428
+ convertToCombinedCollection(collection) {
10429
+ const convertedMtCollection = {
10430
+ id: collection.id,
10431
+ lastUpdated: new Date(collection.collectionUpdatedAt),
10432
+ name: collection.name,
10433
+ status: collection.status,
10434
+ termId: collection.collectionId,
10435
+ default: collection.default,
10436
+ scope: collection.scope
10437
+ };
10438
+ return new CombinedCollection(null, convertedMtCollection);
10439
+ }
10440
+ }
10441
+ 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 });
10442
+ MtTermV2Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV2Service, providedIn: 'root' });
10443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MtTermV2Service, decorators: [{
10444
+ type: Injectable,
10445
+ args: [{
10446
+ providedIn: 'root'
10447
+ }]
10448
+ }], ctorParameters: function () { return [{ type: TldTranslateConfigService }, { type: EningeTermApiService }]; } });
10449
+
10450
+ function mtTermApiFactory(version, config, http, engineTermService) {
10451
+ if (version === TranslationApiVersion.V1) {
10452
+ return new MtTermV1Service(http, config);
10453
+ }
10454
+ else {
10455
+ return new MtTermV2Service(config, engineTermService);
10456
+ }
10457
+ }
10458
+
10175
10459
  var FileV2Category;
10176
10460
  (function (FileV2Category) {
10177
10461
  FileV2Category["SOURCE"] = "SOURCE";
@@ -10204,7 +10488,7 @@ class FileApiV2Service {
10204
10488
  formData.append("domain", properties.system.domain);
10205
10489
  }
10206
10490
  const headers = Common.GetApiV2AuthHeaders(this.config);
10207
- return this.http.post(this.url, formData, { headers }).pipe(map(response => response.id));
10491
+ return this.http.post(this.url, formData, { headers }).pipe(map$1(response => response.id));
10208
10492
  }
10209
10493
  remove(properties) {
10210
10494
  if (properties.file.translationStartedOnServer) {
@@ -10226,7 +10510,7 @@ class FileApiV2Service {
10226
10510
  }
10227
10511
  getStatus(properties) {
10228
10512
  const headers = Common.GetApiV2AuthHeaders(this.config);
10229
- return this.http.get(`${this.url}/${properties.file.id}`, { headers }).pipe(map((response) => {
10513
+ return this.http.get(`${this.url}/${properties.file.id}`, { headers }).pipe(map$1((response) => {
10230
10514
  const extensions = [];
10231
10515
  response.files.forEach((file) => {
10232
10516
  if (file.category.toUpperCase() === FileV2Category.TRANSLATED) {
@@ -10273,7 +10557,7 @@ class TldSystemApiV2Service {
10273
10557
  }
10274
10558
  getSystemList() {
10275
10559
  const headers = Common.GetApiV2AuthHeaders(this.config);
10276
- return this.http.get(this.config?.apiV2Config?.systemListUrl, { headers }).pipe(map((response) => {
10560
+ return this.http.get(this.config?.apiV2Config?.systemListUrl, { headers }).pipe(map$1((response) => {
10277
10561
  const systems = [];
10278
10562
  const uniqueDirections = [];
10279
10563
  const autoDomainSystems = [];
@@ -10285,7 +10569,9 @@ class TldSystemApiV2Service {
10285
10569
  sourceLanguage: system.srcLang,
10286
10570
  targetLanguage: system.trgLang,
10287
10571
  translationApiVersion: TranslationApiVersion.V2,
10288
- vendor: system.vendor
10572
+ vendor: system.vendor,
10573
+ // hardcoded since there is no param yet for determinig which systems support terms.
10574
+ includesTerminology: true
10289
10575
  };
10290
10576
  systems.push(newSystem);
10291
10577
  if (this.config.apiV2Config?.autoDomainDetection && !uniqueDirections.includes(languageDirections)) {
@@ -10337,7 +10623,7 @@ class TldSystemApiService {
10337
10623
  const params = {
10338
10624
  appID: this.config.coreConfig.appId,
10339
10625
  };
10340
- return this.http.get(this.config?.coreConfig?.systemListUrl, { headers, params }).pipe(map((response) => {
10626
+ return this.http.get(this.config?.coreConfig?.systemListUrl, { headers, params }).pipe(map$1((response) => {
10341
10627
  const systems = [];
10342
10628
  response.System.forEach(element => {
10343
10629
  const system = {
@@ -10409,7 +10695,7 @@ class TldTranslateTextApiV2Service {
10409
10695
  if (this.config.textConfig.checkSourceGrammar && this.config.textConfig.grammarCheckLanguages.includes(params.system.sourceLanguage)) {
10410
10696
  this.checkAndAttachGrammarToTree(params.text, params.system.sourceLanguage, sourceTree);
10411
10697
  }
10412
- return this.http.post(this.config.apiV2Config.translationUrl, requestParams, { headers }).pipe(map((translationResponse) => {
10698
+ return this.http.post(this.config.apiV2Config.translationUrl, requestParams, { headers }).pipe(map$1((translationResponse) => {
10413
10699
  const systemId = `${requestParams.srcLang}-${requestParams.trgLang}-${translationResponse.domain}`;
10414
10700
  const originalTranslation = translationResponse.translations[0].translation;
10415
10701
  const targetTree = {
@@ -10487,8 +10773,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10487
10773
  }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: TldTranslateConfigService }]; } });
10488
10774
 
10489
10775
  class TldTranslateTextApiService {
10490
- constructor(collectionService, http, config, alerts) {
10491
- this.collectionService = collectionService;
10776
+ constructor(terminologyService, http, config, alerts) {
10777
+ this.terminologyService = terminologyService;
10492
10778
  this.http = http;
10493
10779
  this.config = config;
10494
10780
  this.alerts = alerts;
@@ -10524,11 +10810,11 @@ class TldTranslateTextApiService {
10524
10810
  systemID: requestParams.system.id,
10525
10811
  text: requestParams.text,
10526
10812
  };
10527
- const selectedCollectionId = this.collectionService.selectedIdForTranslation();
10813
+ const selectedCollectionId = this.terminologyService.selectedIdForTranslation();
10528
10814
  if (selectedCollectionId) {
10529
10815
  params.options += `,termCorpusId=${selectedCollectionId}`;
10530
10816
  }
10531
- return this.http.get(this.config?.textConfig?.translationUrl, { headers: headers, params: params }).pipe(map((response) => {
10817
+ return this.http.get(this.config?.textConfig?.translationUrl, { headers: headers, params: params }).pipe(map$1((response) => {
10532
10818
  if (response.ErrorMessage) {
10533
10819
  this.alerts.unhandeledError(response.ErrorMessage);
10534
10820
  throw response.ErrorMessage;
@@ -10655,21 +10941,21 @@ class TldTranslateTextApiService {
10655
10941
  });
10656
10942
  }
10657
10943
  }
10658
- 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 });
10944
+ 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 });
10659
10945
  TldTranslateTextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, providedIn: 'root' });
10660
10946
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TldTranslateTextApiService, decorators: [{
10661
10947
  type: Injectable,
10662
10948
  args: [{
10663
10949
  providedIn: 'root'
10664
10950
  }]
10665
- }], ctorParameters: function () { return [{ type: TldTermCollectionsService }, { type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TldAlertService }]; } });
10951
+ }], ctorParameters: function () { return [{ type: TerminologyService }, { type: i1$3.HttpClient }, { type: TldTranslateConfigService }, { type: TldAlertService }]; } });
10666
10952
 
10667
- function textApiServiceFactory(version, config, http, collectionsService, alerts) {
10953
+ function textApiServiceFactory(version, config, http, terminologyService, alerts) {
10668
10954
  if (version === TranslationApiVersion.V2) {
10669
10955
  return new TldTranslateTextApiV2Service(http, config);
10670
10956
  }
10671
10957
  else {
10672
- return new TldTranslateTextApiService(collectionsService, http, config, alerts);
10958
+ return new TldTranslateTextApiService(terminologyService, http, config, alerts);
10673
10959
  }
10674
10960
  }
10675
10961
 
@@ -10684,7 +10970,7 @@ class TldTranslateModule {
10684
10970
  TRANSLATION_API_VERSION_TOKEN,
10685
10971
  TldTranslateConfigService,
10686
10972
  HttpClient,
10687
- TldTermCollectionsService,
10973
+ TerminologyService,
10688
10974
  TldAlertService
10689
10975
  ]
10690
10976
  },
@@ -10695,10 +10981,20 @@ class TldTranslateModule {
10695
10981
  TRANSLATION_API_VERSION_TOKEN,
10696
10982
  TldTranslateConfigService,
10697
10983
  HttpClient,
10698
- TldTermCollectionsService,
10984
+ TerminologyService,
10699
10985
  TldAlertService
10700
10986
  ]
10701
10987
  },
10988
+ {
10989
+ provide: MT_TERM_API_TOKEN,
10990
+ useFactory: mtTermApiFactory,
10991
+ deps: [
10992
+ TRANSLATION_API_VERSION_TOKEN,
10993
+ TldTranslateConfigService,
10994
+ HttpClient,
10995
+ EningeTermApiService
10996
+ ]
10997
+ },
10702
10998
  ];
10703
10999
  if (translationApiVersion !== null) {
10704
11000
  providers.push({
@@ -10777,5 +11073,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
10777
11073
  * Generated bundle index. Do not edit.
10778
11074
  */
10779
11075
 
10780
- 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 };
11076
+ 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 };
10781
11077
  //# sourceMappingURL=tilde-nlp-ngx-translate.mjs.map