@aiconomy/aico-components 0.0.95 → 0.0.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +671 -32
- package/dist/aico-components/aico-components.esm.js +1 -1
- package/dist/aico-components/aico-components.esm.js.map +1 -1
- package/dist/aico-components/p-34bd96ca.js +2 -0
- package/dist/aico-components/p-34bd96ca.js.map +1 -0
- package/dist/aico-components/p-7f6fcb2e.entry.js +2 -0
- package/dist/aico-components/p-7f6fcb2e.entry.js.map +1 -0
- package/dist/aico-components/p-a4f7ae53.entry.js +2 -0
- package/dist/aico-components/p-a4f7ae53.entry.js.map +1 -0
- package/dist/aico-components/p-b61bc8e9.entry.js +2 -0
- package/dist/aico-components/p-b61bc8e9.entry.js.map +1 -0
- package/dist/aico-components/{p-7ea04e72.entry.js → p-b9bc0400.entry.js} +3 -3
- package/dist/aico-components/p-b9bc0400.entry.js.map +1 -0
- package/dist/aico-components/p-bf3db54a.entry.js +2 -0
- package/dist/aico-components/p-bf3db54a.entry.js.map +1 -0
- package/dist/aico-components/p-e187bbea.js +2 -0
- package/dist/aico-components/p-e187bbea.js.map +1 -0
- package/dist/cjs/ConditionalRender-52579540.js +9 -0
- package/dist/cjs/ConditionalRender-52579540.js.map +1 -0
- package/dist/cjs/aico-album-content_19.cjs.entry.js +22 -25
- package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-article-detail.cjs.entry.js +11 -1
- package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-components.cjs.js +1 -1
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +4 -2
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-news-list.cjs.entry.js +7 -4
- package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js +6 -3
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-9ae3486f.js → utils-3d8a97f6.js} +16 -9
- package/dist/cjs/utils-3d8a97f6.js.map +1 -0
- package/dist/collection/components/aico-article-detail/aico-article-detail.js +48 -2
- package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +42 -4
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
- package/dist/collection/components/aico-news-list/aico-news-list.js +78 -9
- package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +58 -7
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
- package/dist/collection/model/Article.js.map +1 -1
- package/dist/collection/model/NewsTag.js +2 -0
- package/dist/collection/model/NewsTag.js.map +1 -0
- package/dist/collection/utils/utils.js +15 -8
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/aico-article-detail2.js +14 -2
- package/dist/components/aico-article-detail2.js.map +1 -1
- package/dist/components/aico-fetch-article-detail.js +5 -1
- package/dist/components/aico-fetch-article-detail.js.map +1 -1
- package/dist/components/aico-news-list.js +10 -3
- package/dist/components/aico-news-list.js.map +1 -1
- package/dist/components/aico-special-news-carousel.js +8 -2
- package/dist/components/aico-special-news-carousel.js.map +1 -1
- package/dist/components/utils.js +15 -8
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/ConditionalRender-7460c386.js +7 -0
- package/dist/esm/ConditionalRender-7460c386.js.map +1 -0
- package/dist/esm/aico-album-content_19.entry.js +2 -5
- package/dist/esm/aico-album-content_19.entry.js.map +1 -1
- package/dist/esm/aico-article-detail.entry.js +11 -1
- package/dist/esm/aico-article-detail.entry.js.map +1 -1
- package/dist/esm/aico-components.js +1 -1
- package/dist/esm/aico-fetch-article-detail.entry.js +4 -2
- package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
- package/dist/esm/aico-news-list.entry.js +7 -4
- package/dist/esm/aico-news-list.entry.js.map +1 -1
- package/dist/esm/aico-special-news-carousel.entry.js +6 -3
- package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-25eef7c7.js → utils-f81eb958.js} +16 -9
- package/dist/esm/utils-f81eb958.js.map +1 -0
- package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +13 -0
- package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +19 -0
- package/dist/types/components/aico-news-list/aico-news-list.d.ts +36 -1
- package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +29 -0
- package/dist/types/components.d.ts +172 -0
- package/dist/types/model/Article.d.ts +2 -1
- package/dist/types/model/NewsTag.d.ts +8 -0
- package/dist/types/utils/utils.d.ts +2 -2
- package/package.json +2 -3
- package/dist/aico-components/p-19752961.entry.js +0 -2
- package/dist/aico-components/p-19752961.entry.js.map +0 -1
- package/dist/aico-components/p-59bfd021.js +0 -2
- package/dist/aico-components/p-59bfd021.js.map +0 -1
- package/dist/aico-components/p-7ea04e72.entry.js.map +0 -1
- package/dist/aico-components/p-80cb133a.entry.js +0 -2
- package/dist/aico-components/p-80cb133a.entry.js.map +0 -1
- package/dist/aico-components/p-918b9928.entry.js +0 -2
- package/dist/aico-components/p-918b9928.entry.js.map +0 -1
- package/dist/aico-components/p-c900f292.entry.js +0 -2
- package/dist/aico-components/p-c900f292.entry.js.map +0 -1
- package/dist/cjs/utils-9ae3486f.js.map +0 -1
- package/dist/esm/utils-25eef7c7.js.map +0 -1
- package/docs/components/aico-article-detail/readme.md +0 -83
- package/docs/components/aico-fetch-article-detail/readme.md +0 -63
- package/docs/components/aico-news-list/readme.md +0 -41
- package/docs/components/aico-news-list-item/readme.md +0 -37
- package/docs/components/aico-special-news-carousel/readme.md +0 -27
- package/docs/components/content/aico-album-content/readme.md +0 -30
- package/docs/components/content/aico-asking-content/readme.md +0 -31
- package/docs/components/content/aico-asking-list-content/readme.md +0 -10
- package/docs/components/content/aico-block-quote-content/readme.md +0 -31
- package/docs/components/content/aico-bullet-content/readme.md +0 -37
- package/docs/components/content/aico-carousel-content/readme.md +0 -38
- package/docs/components/content/aico-collection-content/readme.md +0 -10
- package/docs/components/content/aico-content-card-content/readme.md +0 -37
- package/docs/components/content/aico-divider-content/readme.md +0 -31
- package/docs/components/content/aico-document-content/readme.md +0 -31
- package/docs/components/content/aico-faq-content/readme.md +0 -31
- package/docs/components/content/aico-heading-content/readme.md +0 -37
- package/docs/components/content/aico-html-content/readme.md +0 -31
- package/docs/components/content/aico-link-content/readme.md +0 -31
- package/docs/components/content/aico-news-content/readme.md +0 -37
- package/docs/components/content/aico-no-content/readme.md +0 -23
- package/docs/components/content/aico-page-content/readme.md +0 -38
- package/docs/components/content/aico-table-content/readme.md +0 -37
- package/docs/components/content/aico-testimonial-content/readme.md +0 -30
- package/docs/components/content/aico-text-content/readme.md +0 -37
- package/docs/components/content/aico-title-content/readme.md +0 -52
- package/docs/components/content/aico-upload-content/readme.md +0 -37
- package/docs/components/content/aico-video-content/readme.md +0 -37
|
@@ -55,6 +55,17 @@ export namespace Components {
|
|
|
55
55
|
}
|
|
56
56
|
interface AicoArticleDetail {
|
|
57
57
|
"article": Article;
|
|
58
|
+
/**
|
|
59
|
+
* Determines if the article category and tags are shown or not.
|
|
60
|
+
*/
|
|
61
|
+
"hideCategoryAndTags": boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Determines if the article date and author are shown or not.
|
|
64
|
+
*/
|
|
65
|
+
"hideDateAndAuthor": boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
|
|
68
|
+
*/
|
|
58
69
|
"locale": string;
|
|
59
70
|
}
|
|
60
71
|
interface AicoAskingContent {
|
|
@@ -95,7 +106,13 @@ export namespace Components {
|
|
|
95
106
|
"locale": string;
|
|
96
107
|
}
|
|
97
108
|
interface AicoFetchArticleDetail {
|
|
109
|
+
/**
|
|
110
|
+
* The token used to authenticate against he Aico Api.
|
|
111
|
+
*/
|
|
98
112
|
"aicoBearerToken": string;
|
|
113
|
+
/**
|
|
114
|
+
* The url of the Aico Api that will be used to retrieve the article.
|
|
115
|
+
*/
|
|
99
116
|
"aicoUrl": string;
|
|
100
117
|
/**
|
|
101
118
|
* The id will be used to fetch the article. If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.
|
|
@@ -105,6 +122,17 @@ export namespace Components {
|
|
|
105
122
|
* The url handle will be used to fetch the article. If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.
|
|
106
123
|
*/
|
|
107
124
|
"articleUrlHandle"?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Determines if the article category and tags are shown or not.
|
|
127
|
+
*/
|
|
128
|
+
"hideCategoryAndTags": boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Determines if the article date and author are shown or not.
|
|
131
|
+
*/
|
|
132
|
+
"hideDateAndAuthor": boolean;
|
|
133
|
+
/**
|
|
134
|
+
* The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
|
|
135
|
+
*/
|
|
108
136
|
"locale": string;
|
|
109
137
|
}
|
|
110
138
|
interface AicoHeadingContent {
|
|
@@ -123,10 +151,41 @@ export namespace Components {
|
|
|
123
151
|
"content": NewsContent;
|
|
124
152
|
}
|
|
125
153
|
interface AicoNewsList {
|
|
154
|
+
/**
|
|
155
|
+
* The token used to authenticate against he Aico Api.
|
|
156
|
+
*/
|
|
126
157
|
"aicoBearerToken": string;
|
|
158
|
+
/**
|
|
159
|
+
* The url of the Aico Api that will be used to retrieve the article.
|
|
160
|
+
*/
|
|
127
161
|
"aicoUrl": string;
|
|
162
|
+
/**
|
|
163
|
+
* Brands used to filter the results.
|
|
164
|
+
*/
|
|
165
|
+
"newsBrandIds": string[];
|
|
166
|
+
/**
|
|
167
|
+
* Channel names used to filter the results.
|
|
168
|
+
*/
|
|
128
169
|
"newsChannels": string[];
|
|
170
|
+
/**
|
|
171
|
+
* Language locales used to filter the results.
|
|
172
|
+
*/
|
|
173
|
+
"newsLanguageLocales": string[];
|
|
174
|
+
/**
|
|
175
|
+
* Sellers used to filter the results.
|
|
176
|
+
*/
|
|
177
|
+
"newsSellerIds": string[];
|
|
178
|
+
/**
|
|
179
|
+
* The text used by the next button in the pagination component.
|
|
180
|
+
*/
|
|
129
181
|
"nextButtonText": string;
|
|
182
|
+
/**
|
|
183
|
+
* The page size. Prefer this number to be even.
|
|
184
|
+
*/
|
|
185
|
+
"pageSize": number;
|
|
186
|
+
/**
|
|
187
|
+
* The text used by the previous button in the pagination component.
|
|
188
|
+
*/
|
|
130
189
|
"previousButtonText": string;
|
|
131
190
|
}
|
|
132
191
|
interface AicoNewsListItem {
|
|
@@ -139,9 +198,33 @@ export namespace Components {
|
|
|
139
198
|
"locale": string;
|
|
140
199
|
}
|
|
141
200
|
interface AicoSpecialNewsCarousel {
|
|
201
|
+
/**
|
|
202
|
+
* The token used to authenticate against he Aico Api.
|
|
203
|
+
*/
|
|
142
204
|
"aicoBearerToken": string;
|
|
205
|
+
/**
|
|
206
|
+
* The url of the Aico Api that will be used to retrieve the article.
|
|
207
|
+
*/
|
|
143
208
|
"aicoUrl": string;
|
|
209
|
+
/**
|
|
210
|
+
* Brands used to filter the results.
|
|
211
|
+
*/
|
|
212
|
+
"newsBrandIds": string[];
|
|
213
|
+
/**
|
|
214
|
+
* Channel names used to filter the results.
|
|
215
|
+
*/
|
|
144
216
|
"newsChannels": string[];
|
|
217
|
+
/**
|
|
218
|
+
* Language locales used to filter the results.
|
|
219
|
+
*/
|
|
220
|
+
"newsLanguageLocales": string[];
|
|
221
|
+
/**
|
|
222
|
+
* Sellers used to filter the results.
|
|
223
|
+
*/
|
|
224
|
+
"newsSellerIds": string[];
|
|
225
|
+
/**
|
|
226
|
+
* The number of articles shown in the carousel. Prefer this number to be small.
|
|
227
|
+
*/
|
|
145
228
|
"numberOfArticles": number;
|
|
146
229
|
}
|
|
147
230
|
interface AicoTableContent {
|
|
@@ -449,6 +532,17 @@ declare namespace LocalJSX {
|
|
|
449
532
|
}
|
|
450
533
|
interface AicoArticleDetail {
|
|
451
534
|
"article": Article;
|
|
535
|
+
/**
|
|
536
|
+
* Determines if the article category and tags are shown or not.
|
|
537
|
+
*/
|
|
538
|
+
"hideCategoryAndTags"?: boolean;
|
|
539
|
+
/**
|
|
540
|
+
* Determines if the article date and author are shown or not.
|
|
541
|
+
*/
|
|
542
|
+
"hideDateAndAuthor"?: boolean;
|
|
543
|
+
/**
|
|
544
|
+
* The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
|
|
545
|
+
*/
|
|
452
546
|
"locale"?: string;
|
|
453
547
|
}
|
|
454
548
|
interface AicoAskingContent {
|
|
@@ -489,7 +583,13 @@ declare namespace LocalJSX {
|
|
|
489
583
|
"locale"?: string;
|
|
490
584
|
}
|
|
491
585
|
interface AicoFetchArticleDetail {
|
|
586
|
+
/**
|
|
587
|
+
* The token used to authenticate against he Aico Api.
|
|
588
|
+
*/
|
|
492
589
|
"aicoBearerToken": string;
|
|
590
|
+
/**
|
|
591
|
+
* The url of the Aico Api that will be used to retrieve the article.
|
|
592
|
+
*/
|
|
493
593
|
"aicoUrl": string;
|
|
494
594
|
/**
|
|
495
595
|
* The id will be used to fetch the article. If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.
|
|
@@ -499,6 +599,17 @@ declare namespace LocalJSX {
|
|
|
499
599
|
* The url handle will be used to fetch the article. If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.
|
|
500
600
|
*/
|
|
501
601
|
"articleUrlHandle"?: string;
|
|
602
|
+
/**
|
|
603
|
+
* Determines if the article category and tags are shown or not.
|
|
604
|
+
*/
|
|
605
|
+
"hideCategoryAndTags"?: boolean;
|
|
606
|
+
/**
|
|
607
|
+
* Determines if the article date and author are shown or not.
|
|
608
|
+
*/
|
|
609
|
+
"hideDateAndAuthor"?: boolean;
|
|
610
|
+
/**
|
|
611
|
+
* The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
|
|
612
|
+
*/
|
|
502
613
|
"locale"?: string;
|
|
503
614
|
}
|
|
504
615
|
interface AicoHeadingContent {
|
|
@@ -518,11 +629,45 @@ declare namespace LocalJSX {
|
|
|
518
629
|
"onNewsArticleClicked"?: (event: AicoNewsContentCustomEvent<NewsArticle>) => void;
|
|
519
630
|
}
|
|
520
631
|
interface AicoNewsList {
|
|
632
|
+
/**
|
|
633
|
+
* The token used to authenticate against he Aico Api.
|
|
634
|
+
*/
|
|
521
635
|
"aicoBearerToken": string;
|
|
636
|
+
/**
|
|
637
|
+
* The url of the Aico Api that will be used to retrieve the article.
|
|
638
|
+
*/
|
|
522
639
|
"aicoUrl": string;
|
|
640
|
+
/**
|
|
641
|
+
* Brands used to filter the results.
|
|
642
|
+
*/
|
|
643
|
+
"newsBrandIds"?: string[];
|
|
644
|
+
/**
|
|
645
|
+
* Channel names used to filter the results.
|
|
646
|
+
*/
|
|
523
647
|
"newsChannels"?: string[];
|
|
648
|
+
/**
|
|
649
|
+
* Language locales used to filter the results.
|
|
650
|
+
*/
|
|
651
|
+
"newsLanguageLocales"?: string[];
|
|
652
|
+
/**
|
|
653
|
+
* Sellers used to filter the results.
|
|
654
|
+
*/
|
|
655
|
+
"newsSellerIds"?: string[];
|
|
656
|
+
/**
|
|
657
|
+
* The text used by the next button in the pagination component.
|
|
658
|
+
*/
|
|
524
659
|
"nextButtonText"?: string;
|
|
660
|
+
/**
|
|
661
|
+
* Event emitted when a user clicks an article. The handler receives the entire Article entity.
|
|
662
|
+
*/
|
|
525
663
|
"onArticleClick"?: (event: AicoNewsListCustomEvent<Article>) => void;
|
|
664
|
+
/**
|
|
665
|
+
* The page size. Prefer this number to be even.
|
|
666
|
+
*/
|
|
667
|
+
"pageSize"?: number;
|
|
668
|
+
/**
|
|
669
|
+
* The text used by the previous button in the pagination component.
|
|
670
|
+
*/
|
|
526
671
|
"previousButtonText"?: string;
|
|
527
672
|
}
|
|
528
673
|
interface AicoNewsListItem {
|
|
@@ -537,10 +682,37 @@ declare namespace LocalJSX {
|
|
|
537
682
|
"onPageClicked"?: (event: AicoPageContentCustomEvent<PageContent>) => void;
|
|
538
683
|
}
|
|
539
684
|
interface AicoSpecialNewsCarousel {
|
|
685
|
+
/**
|
|
686
|
+
* The token used to authenticate against he Aico Api.
|
|
687
|
+
*/
|
|
540
688
|
"aicoBearerToken": string;
|
|
689
|
+
/**
|
|
690
|
+
* The url of the Aico Api that will be used to retrieve the article.
|
|
691
|
+
*/
|
|
541
692
|
"aicoUrl": string;
|
|
693
|
+
/**
|
|
694
|
+
* Brands used to filter the results.
|
|
695
|
+
*/
|
|
696
|
+
"newsBrandIds"?: string[];
|
|
697
|
+
/**
|
|
698
|
+
* Channel names used to filter the results.
|
|
699
|
+
*/
|
|
542
700
|
"newsChannels"?: string[];
|
|
701
|
+
/**
|
|
702
|
+
* Language locales used to filter the results.
|
|
703
|
+
*/
|
|
704
|
+
"newsLanguageLocales"?: string[];
|
|
705
|
+
/**
|
|
706
|
+
* Sellers used to filter the results.
|
|
707
|
+
*/
|
|
708
|
+
"newsSellerIds"?: string[];
|
|
709
|
+
/**
|
|
710
|
+
* The number of articles shown in the carousel. Prefer this number to be small.
|
|
711
|
+
*/
|
|
543
712
|
"numberOfArticles"?: number;
|
|
713
|
+
/**
|
|
714
|
+
* Event emitted when a user clicks an article title. The handler receives the entire Article entity.
|
|
715
|
+
*/
|
|
544
716
|
"onArticleClicked"?: (event: AicoSpecialNewsCarouselCustomEvent<Article>) => void;
|
|
545
717
|
}
|
|
546
718
|
interface AicoTableContent {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Entity } from './Entity';
|
|
2
2
|
import { NewsCategory } from './NewsCategory';
|
|
3
|
+
import { NewsTag } from './NewsTag';
|
|
3
4
|
import { ContentType } from './article/ContentType';
|
|
4
5
|
export type ArticleTranslation = Entity & {
|
|
5
6
|
locale: string;
|
|
@@ -54,7 +55,7 @@ export type ArticleAttributes = {
|
|
|
54
55
|
publishDate: Date;
|
|
55
56
|
endDatePermanentNews?: Date;
|
|
56
57
|
newsCategory: NewsCategory;
|
|
57
|
-
newsTags:
|
|
58
|
+
newsTags: NewsTag[];
|
|
58
59
|
soccerTeams: object[];
|
|
59
60
|
brands: object[];
|
|
60
61
|
album?: object;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Article } from '../components';
|
|
2
2
|
import { AicoApiRequestInfo } from '../model/AicoApiRequestInfo';
|
|
3
3
|
import { NewsResponse } from '../model/NewsResponse';
|
|
4
|
-
export declare function fetchNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels?: string[]): Promise<NewsResponse>;
|
|
5
|
-
export declare function fetchSpecialNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels?: string[]): Promise<NewsResponse>;
|
|
4
|
+
export declare function fetchNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels?: string[], newsSellerIds?: string[], newsBrandIds?: string[], newsLanguageLocales?: string[]): Promise<NewsResponse>;
|
|
5
|
+
export declare function fetchSpecialNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels?: string[], newsSellerIds?: string[], newsBrandIds?: string[], newsLanguageLocales?: string[]): Promise<NewsResponse>;
|
|
6
6
|
export declare function fetchNewsArticle(api: AicoApiRequestInfo, articleId: string, signal: AbortSignal): Promise<Article>;
|
|
7
7
|
export declare function fetchNewsArticleByHandle(api: AicoApiRequestInfo, urlHandle: string, signal: AbortSignal): Promise<Article>;
|
|
8
8
|
export declare function fetchArticle(url: string, bearerToken: string, signal: AbortSignal): Promise<Article>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiconomy/aico-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.114",
|
|
4
4
|
"description": "Aiconomy components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"unpkg": "dist/aico-components/aico-components.esm.js",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist/",
|
|
15
|
-
"loader/"
|
|
16
|
-
"docs/"
|
|
15
|
+
"loader/"
|
|
17
16
|
],
|
|
18
17
|
"scripts": {
|
|
19
18
|
"dev": "npm run stencil & npm run storybook",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as n}from"./p-ae20e789.js";var c;(function(t){t["BULLET"]="BULLET";t["TEXT"]="TEXT";t["VIDEO"]="VIDEO";t["TABLE"]="TABLE";t["HEADING"]="HEADING";t["TITLE"]="TITLE";t["CONTENT_CARD"]="CONTENT_CARD";t["TESTIMONIAL"]="TESTIMONIAL";t["PRODUCT"]="PRODUCT";t["NEWS"]="NEWS";t["ASKING"]="ASKING";t["AGENDA"]="AGENDA";t["LIST_ASKING"]="LIST_ASKING";t["LIST_AGENDA"]="LIST_AGENDA";t["CRM"]="CRM";t["B2B"]="B2B";t["FORM_BUILDER"]="FORM_BUILDER";t["BLOCK_QUOTE"]="BLOCK_QUOTE";t["FAQ"]="FAQ";t["COURSE"]="COURSE";t["DOCUMENT"]="DOCUMENT";t["LINK"]="LINK";t["HTML"]="HTML";t["DIVIDER"]="DIVIDER";t["COLLECTION"]="COLLECTION";t["CAROUSEL"]="CAROUSEL";t["PAGE"]="PAGE";t["ALBUM"]="ALBUM";t["UPLOAD"]="UPLOAD"})(c||(c={}));const o="";const a=class{constructor(e){t(this,e);this.dateOptions={day:"numeric",month:"long",year:"numeric"};this.article=undefined;this.locale="de"}render(){const t=new Date(this.article.attributes.publishDate);const c=this.article.attributes.contentBuilder.rows.sort(((t,e)=>t.order-e.order)).map(((t,e)=>this.mapRowContent(t,e)));return e(n,null,e("figure",null,e("blockquote",{class:"blockquote"},e("h2",{class:"text-uppercase"},this.article.attributes.name)),e("figcaption",{class:"blockquote-footer"},t.toLocaleDateString("en-US",this.dateOptions)," by ",e("cite",{title:"Author"},this.article.attributes.author))),e("div",{class:"content-wrapper"},c))}mapRowContent(t,n){const c=t.columns.map(((t,e)=>this.mapColumnContent(t,e)));return e("div",{class:`content-row content-row-index-${n}`},c)}mapColumnContent(t,n){const c=t.contentContainer.contents.sort(((t,e)=>{var n,c;return((n=t.sort)!==null&&n!==void 0?n:0)-((c=e.sort)!==null&&c!==void 0?c:0)})).map(((t,e)=>this.mapContent(t,e)));return e("div",{class:`content-column content-column-index-${n}`},c)}mapContent(t,n){return e("div",{class:`content-data-wrapper content-data-wrapper-index-${n}`},this.mapContentData(t.type,t.contentData))}mapContentData(t,n){switch(t){case c.ALBUM:return e("aico-album-content",{content:n});case c.ASKING:return e("aico-asking-content",{content:n,locale:this.locale});case c.BLOCK_QUOTE:return e("aico-block-quote-content",{content:n,locale:this.locale});case c.BULLET:return e("aico-bullet-content",{content:n,locale:this.locale});case c.CAROUSEL:return e("aico-carousel-content",{content:n,locale:this.locale});case c.CONTENT_CARD:return e("aico-content-card-content",{content:n,locale:this.locale});case c.DIVIDER:return e("aico-divider-content",{content:n,locale:this.locale});case c.DOCUMENT:return e("aico-document-content",{content:n,locale:this.locale});case c.FAQ:return e("aico-faq-content",{content:n,locale:this.locale});case c.HEADING:return e("aico-heading-content",{content:n,locale:this.locale});case c.HTML:return e("aico-html-content",{content:n,locale:this.locale});case c.LINK:return e("aico-link-content",{content:n,locale:this.locale});case c.NEWS:return e("aico-news-content",{content:n});case c.PAGE:return e("aico-page-content",{content:n,locale:this.locale});case c.TABLE:return e("aico-table-content",{content:n,locale:this.locale});case c.TESTIMONIAL:return e("aico-testimonial-content",{content:n});case c.TEXT:return e("aico-text-content",{content:n,locale:this.locale});case c.TITLE:return e("aico-title-content",{content:n,locale:this.locale});case c.UPLOAD:return e("aico-upload-content",{content:n,locale:this.locale});case c.VIDEO:return e("aico-video-content",{content:n,locale:this.locale});case c.PRODUCT:case c.AGENDA:case c.LIST_ASKING:case c.LIST_AGENDA:case c.CRM:case c.B2B:case c.FORM_BUILDER:case c.COURSE:case c.COLLECTION:default:return e("div",{class:"content-data content-data-not-handled"},"Content type not handled.")}}};a.style=o;export{a as aico_article_detail};
|
|
2
|
-
//# sourceMappingURL=p-19752961.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ContentType","aicoArticleDetailCss","AicoArticleDetail","this","dateOptions","day","month","year","render","articleDate","Date","article","attributes","publishDate","content","contentBuilder","rows","sort","a","b","order","map","row","index","mapRowContent","h","Host","class","name","toLocaleDateString","title","author","rowContent","columns","column","columnIndex","mapColumnContent","columnContent","contentContainer","contents","_a","_b","contentIndex","mapContent","mapContentData","type","contentData","contentType","ALBUM","ASKING","locale","BLOCK_QUOTE","BULLET","CAROUSEL","CONTENT_CARD","DIVIDER","DOCUMENT","FAQ","HEADING","HTML","LINK","NEWS","PAGE","TABLE","TESTIMONIAL","TEXT","TITLE","UPLOAD","VIDEO","PRODUCT","AGENDA","LIST_ASKING","LIST_AGENDA","CRM","B2B","FORM_BUILDER","COURSE","COLLECTION"],"sources":["src/model/article/ContentType.ts","src/components/aico-article-detail/aico-article-detail.css?tag=aico-article-detail&encapsulation=scoped","src/components/aico-article-detail/aico-article-detail.tsx"],"sourcesContent":["export enum ContentType {\n BULLET = 'BULLET',\n TEXT = 'TEXT',\n VIDEO = 'VIDEO',\n TABLE = 'TABLE',\n HEADING = 'HEADING',\n TITLE = 'TITLE',\n CONTENT_CARD = 'CONTENT_CARD',\n TESTIMONIAL = 'TESTIMONIAL',\n PRODUCT = 'PRODUCT',\n NEWS = 'NEWS',\n ASKING = 'ASKING',\n AGENDA = 'AGENDA',\n LIST_ASKING = 'LIST_ASKING',\n LIST_AGENDA = 'LIST_AGENDA',\n CRM = 'CRM',\n B2B = 'B2B',\n FORM_BUILDER = 'FORM_BUILDER',\n BLOCK_QUOTE = 'BLOCK_QUOTE',\n FAQ = 'FAQ',\n COURSE = 'COURSE',\n DOCUMENT = 'DOCUMENT',\n LINK = 'LINK',\n HTML = 'HTML',\n DIVIDER = 'DIVIDER',\n COLLECTION = 'COLLECTION',\n CAROUSEL = 'CAROUSEL',\n PAGE = 'PAGE',\n ALBUM = 'ALBUM',\n UPLOAD = 'UPLOAD',\n}\n",null,"import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n @Prop() locale: string = 'de';\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <figcaption class=\"blockquote-footer\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n </Host>\n );\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} locale={this.locale} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} locale={this.locale} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} locale={this.locale} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} locale={this.locale} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} locale={this.locale} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} locale={this.locale} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} locale={this.locale} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} locale={this.locale} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} locale={this.locale} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} locale={this.locale} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} locale={this.locale} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} locale={this.locale} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} locale={this.locale} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} locale={this.locale} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} locale={this.locale} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} locale={this.locale} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} locale={this.locale} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"],"mappings":"kDAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,mBACAA,EAAA,eACAA,EAAA,iBACAA,EAAA,iBACAA,EAAA,qBACAA,EAAA,iBACAA,EAAA,+BACAA,EAAA,6BACAA,EAAA,qBACAA,EAAA,eACAA,EAAA,mBACAA,EAAA,mBACAA,EAAA,6BACAA,EAAA,6BACAA,EAAA,aACAA,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Q/C,KAAK+C,SAE1E,KAAKlD,EAAY4D,KACf,OAAOnC,EAAA,qBAAmBX,QAASA,EAAwBoC,OAAQ/C,KAAK+C,SAE1E,KAAKlD,EAAY6D,KACf,OAAOpC,EAAA,qBAAmBX,QAASA,IAErC,KAAKd,EAAY8D,KACf,OAAOrC,EAAA,qBAAmBX,QAASA,EAAwBoC,OAAQ/C,KAAK+C,SAE1E,KAAKlD,EAAY+D,MACf,OAAOtC,EAAA,sBAAoBX,QAASA,EAAyBoC,OAAQ/C,KAAK+C,SAE5E,KAAKlD,EAAYgE,YACf,OAAOvC,EAAA,4BAA0BX,QAASA,IAE5C,KAAKd,EAAYiE,KACf,OAAOxC,EAAA,qBAAmBX,QAASA,EAAwBoC,OAAQ/C,KAAK+C,SAE1E,KAAKlD,EAAYkE,MACf,OAAOzC,EAAA,sBAAoBX,QAASA,EAAyBoC,OAAQ/C,KAAK+C,SAE5E,KAAKlD,EAAYmE,OACf,OAAO1C,EAAA,uBAAqBX,QAASA,EAA0BoC,OAAQ/C,KAAK+C,SAE9E,KAAKlD,EAAYoE,MACf,OAAO3C,EAAA,sBAAoBX,QAASA,EAAyBoC,OAAQ/C,KAAK+C,SAE5E,KAAKlD,EAAYqE,QACjB,KAAKrE,EAAYsE,OACjB,KAAKtE,EAAYuE,YACjB,KAAKvE,EAAYwE,YACjB,KAAKxE,EAAYyE,IACjB,KAAKzE,EAAY0E,IACjB,KAAK1E,EAAY2E,aACjB,KAAK3E,EAAY4E,OACjB,KAAK5E,EAAY6E,WACjB,QACE,OAAOpD,EAAA,OAAKE,MAAM,yCAAuC,6B"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const t=t=>{const e=new Headers;e.append("Accept","application/vnd.api+json");e.append("Authorization",`Bearer ${t}`);return e};const e=(e,n,a,r)=>new Request(new URL(`${n}?${a.toString()}`,e.baseApi),{headers:t(e.bearerToken),signal:r});async function n(t,n,a,r,s=[]){const c=new URLSearchParams;c.set("page[number]",String(n));c.set("page[size]",String(a));c.set("sort","-publishDate");c.set("filter[isActive]","1");c.set("filter[excludeTag][]","Eisnull");for(const t of s){c.append("filter[channel][]",t)}const i=e(t,"news",c,r);const o=await fetch(i);return await o.json()}async function a(t,n,a,r,s=[]){const c=new URLSearchParams;c.set("page[number]",String(n));c.set("page[size]",String(a));c.set("sort","-publishDate");c.set("filter[isActive]","1");c.set("filter[isSpecialArticle]","1");c.set("filter[isLightVersion]","true");c.set("filter[excludeTag][]","Eisnull");for(const t of s){c.append("filter[channel][]",t)}const i=e(t,"news",c,r);const o=await fetch(i);return await o.json()}async function r(t,n,a){const r=e(t,`news/${n}`,new URLSearchParams,a);const s=await fetch(r);const c=await s.json();return c.data}async function s(t,n,a){const r=new URLSearchParams;r.set("filter[urlHandle]",n);const s=e(t,"news",r,a);const c=await fetch(s);const i=await c.json();return i.data[0]}function c(t){switch(t){case"extra-small":return"28%";case"small":return"40%";case"large":return"80%";case"extra large":return"100%";default:return"60%"}}function i(t){const e=/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#&?]*).*/;const n=t.match(e);if(n&&n[1].length==11){return`https://www.youtube.com/embed/${n[1]}`}return null}function o(t){if(!t||t===" "){return true}return false}function u(t){const e=[];for(const n of Object.entries(t)){if(n[1]){e.push(n[0])}}return e.join(" ")}export{r as a,n as b,a as c,u as d,i as e,s as f,c as g,o as s};
|
|
2
|
-
//# sourceMappingURL=p-59bfd021.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getAuthenticatedHeaders","bearerToken","headers","Headers","append","getAuthenticatedRequest","api","route","query","signal","Request","URL","toString","baseApi","async","fetchNewsArticles","page","size","newsChannels","queryParams","URLSearchParams","set","String","newsChannel","request","response","fetch","json","fetchSpecialNewsArticles","fetchNewsArticle","articleId","article","data","fetchNewsArticleByHandle","urlHandle","articles","getImageWidthPrc","pictureSize","getYoutubeURL","url","regExp","match","length","strIsNullOrEmptyOrWhitespace","str","getClass","conditions","classes","kvp","Object","entries","push","join"],"sources":["src/model/AicoApiRequestInfo.ts","src/utils/utils.ts"],"sourcesContent":["export type AicoApiRequestInfo = {\n baseApi: string;\n bearerToken: string;\n};\n\nexport const getAuthenticatedHeaders = (bearerToken: string): Headers => {\n const headers = new Headers();\n headers.append('Accept', 'application/vnd.api+json');\n headers.append('Authorization', `Bearer ${bearerToken}`);\n return headers;\n};\n\nexport const getAuthenticatedRequest = (api: AicoApiRequestInfo, route: string, query: URLSearchParams, signal?: AbortSignal): Request => {\n return new Request(new URL(`${route}?${query.toString()}`, api.baseApi), {\n headers: getAuthenticatedHeaders(api.bearerToken),\n signal,\n });\n};\n","import { Article } from '../components';\nimport { AicoApiRequestInfo, getAuthenticatedHeaders, getAuthenticatedRequest } from '../model/AicoApiRequestInfo';\nimport { NewsResponse } from '../model/NewsResponse';\n\nexport async function fetchNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels: string[] = []): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('sort', '-publishDate');\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n for (const newsChannel of newsChannels) {\n queryParams.append('filter[channel][]', newsChannel);\n }\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchSpecialNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels: string[] = []): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('sort', '-publishDate');\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[isSpecialArticle]', '1');\n queryParams.set('filter[isLightVersion]', 'true');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n for (const newsChannel of newsChannels) {\n queryParams.append('filter[channel][]', newsChannel);\n }\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchNewsArticle(api: AicoApiRequestInfo, articleId: string, signal: AbortSignal): Promise<Article> {\n const request = getAuthenticatedRequest(api, `news/${articleId}`, new URLSearchParams(), signal);\n const response = await fetch(request);\n const article = await response.json();\n return article.data;\n}\n\nexport async function fetchNewsArticleByHandle(api: AicoApiRequestInfo, urlHandle: string, signal: AbortSignal): Promise<Article> {\n const queryParams = new URLSearchParams();\n queryParams.set('filter[urlHandle]', urlHandle);\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n const articles = await response.json();\n return articles.data[0];\n}\n\nexport async function fetchArticle(url: string, bearerToken: string, signal: AbortSignal): Promise<Article> {\n const request = new Request(new URL(url), {\n headers: getAuthenticatedHeaders(bearerToken),\n signal,\n });\n const response = await fetch(request);\n return await response.json();\n}\n\nexport function getImageWidthPrc(pictureSize?: string): string {\n switch (pictureSize) {\n case 'extra-small':\n return '28%';\n case 'small':\n return '40%';\n case 'large':\n return '80%';\n case 'extra large': // TODO: has - or not?\n return '100%';\n default:\n return '60%';\n }\n}\n\nexport function getYoutubeURL(url: string): string | null {\n const regExp = /.*(?:youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=)([^#&?]*).*/;\n const match = url.match(regExp);\n if (match && match[1].length == 11) {\n return `https://www.youtube.com/embed/${match[1]}`;\n }\n\n return null;\n}\n\nexport function strIsNullOrEmptyOrWhitespace(str?: string | null): boolean {\n if (!str || str === ' ') {\n return true;\n }\n\n return false;\n}\n\nexport function getClass(conditions: { [key: string]: boolean }): string {\n const classes: string[] = [];\n for (const kvp of Object.entries(conditions)) {\n if (kvp[1]) {\n classes.push(kvp[0]);\n }\n }\n\n return classes.join(' ');\n}\n"],"mappings":"AAKO,MAAMA,EAA2BC,IACtC,MAAMC,EAAU,IAAIC,QACpBD,EAAQE,OAAO,SAAU,4BACzBF,EAAQE,OAAO,gBAAiB,UA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