@posiwise/resource-module 0.0.191 → 0.0.193

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 (38) hide show
  1. package/fesm2022/{posiwise-resource-module-base-top-banner.component-XPaC2uLL.mjs → posiwise-resource-module-base-top-banner.component-CD5atqs7.mjs} +7 -7
  2. package/fesm2022/{posiwise-resource-module-base-top-banner.component-XPaC2uLL.mjs.map → posiwise-resource-module-base-top-banner.component-CD5atqs7.mjs.map} +1 -1
  3. package/fesm2022/posiwise-resource-module-posiwise-resource-module-C-e2dNwR.mjs +1888 -0
  4. package/fesm2022/posiwise-resource-module-posiwise-resource-module-C-e2dNwR.mjs.map +1 -0
  5. package/fesm2022/{posiwise-resource-module-resource-blogs.module-CeRB6E1r.mjs → posiwise-resource-module-resource-blogs.module-BBFWP2C7.mjs} +13 -13
  6. package/fesm2022/{posiwise-resource-module-resource-blogs.module-CeRB6E1r.mjs.map → posiwise-resource-module-resource-blogs.module-BBFWP2C7.mjs.map} +1 -1
  7. package/fesm2022/{posiwise-resource-module-resource-case-studies.module-DL3JRVp5.mjs → posiwise-resource-module-resource-case-studies.module-ByTD2_48.mjs} +10 -10
  8. package/fesm2022/{posiwise-resource-module-resource-case-studies.module-DL3JRVp5.mjs.map → posiwise-resource-module-resource-case-studies.module-ByTD2_48.mjs.map} +1 -1
  9. package/fesm2022/posiwise-resource-module-resource-events.module-DDRHt23j.mjs +241 -0
  10. package/fesm2022/posiwise-resource-module-resource-events.module-DDRHt23j.mjs.map +1 -0
  11. package/fesm2022/posiwise-resource-module-resource-hub.module-BfsDOG9Y.mjs +244 -0
  12. package/fesm2022/posiwise-resource-module-resource-hub.module-BfsDOG9Y.mjs.map +1 -0
  13. package/fesm2022/posiwise-resource-module-resource-integrations.module-HnP4CCtr.mjs +295 -0
  14. package/fesm2022/posiwise-resource-module-resource-integrations.module-HnP4CCtr.mjs.map +1 -0
  15. package/fesm2022/posiwise-resource-module-resource-post.module-D1Y2bs-g.mjs +334 -0
  16. package/fesm2022/posiwise-resource-module-resource-post.module-D1Y2bs-g.mjs.map +1 -0
  17. package/fesm2022/{posiwise-resource-module-resource-release-notes.module-fyZp_sFo.mjs → posiwise-resource-module-resource-release-notes.module-DXwH6xe3.mjs} +14 -14
  18. package/fesm2022/{posiwise-resource-module-resource-release-notes.module-fyZp_sFo.mjs.map → posiwise-resource-module-resource-release-notes.module-DXwH6xe3.mjs.map} +1 -1
  19. package/fesm2022/posiwise-resource-module-resource-root.module-CFCC4-Ht.mjs +398 -0
  20. package/fesm2022/posiwise-resource-module-resource-root.module-CFCC4-Ht.mjs.map +1 -0
  21. package/fesm2022/{posiwise-resource-module-resource-videos.module-mBQ3w0lv.mjs → posiwise-resource-module-resource-videos.module-cV-K0XzH.mjs} +13 -13
  22. package/fesm2022/{posiwise-resource-module-resource-videos.module-mBQ3w0lv.mjs.map → posiwise-resource-module-resource-videos.module-cV-K0XzH.mjs.map} +1 -1
  23. package/fesm2022/{posiwise-resource-module-resource-white-papers.module-IGdisYOV.mjs → posiwise-resource-module-resource-white-papers.module-C9piJ56m.mjs} +13 -13
  24. package/fesm2022/{posiwise-resource-module-resource-white-papers.module-IGdisYOV.mjs.map → posiwise-resource-module-resource-white-papers.module-C9piJ56m.mjs.map} +1 -1
  25. package/fesm2022/posiwise-resource-module.mjs +1 -1
  26. package/package.json +3 -3
  27. package/fesm2022/posiwise-resource-module-posiwise-resource-module-C-hPiIlg.mjs +0 -1888
  28. package/fesm2022/posiwise-resource-module-posiwise-resource-module-C-hPiIlg.mjs.map +0 -1
  29. package/fesm2022/posiwise-resource-module-resource-events.module-BBHi-JUF.mjs +0 -241
  30. package/fesm2022/posiwise-resource-module-resource-events.module-BBHi-JUF.mjs.map +0 -1
  31. package/fesm2022/posiwise-resource-module-resource-hub.module-mSjREp_s.mjs +0 -244
  32. package/fesm2022/posiwise-resource-module-resource-hub.module-mSjREp_s.mjs.map +0 -1
  33. package/fesm2022/posiwise-resource-module-resource-integrations.module-BYM4LlIm.mjs +0 -295
  34. package/fesm2022/posiwise-resource-module-resource-integrations.module-BYM4LlIm.mjs.map +0 -1
  35. package/fesm2022/posiwise-resource-module-resource-post.module-BhnGYNxN.mjs +0 -334
  36. package/fesm2022/posiwise-resource-module-resource-post.module-BhnGYNxN.mjs.map +0 -1
  37. package/fesm2022/posiwise-resource-module-resource-root.module-D9-M2alB.mjs +0 -398
  38. package/fesm2022/posiwise-resource-module-resource-root.module-D9-M2alB.mjs.map +0 -1
@@ -1,1888 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, NgModule, CUSTOM_ELEMENTS_SCHEMA, EventEmitter, ViewContainerRef, Output, Input, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import * as i2 from '@posiwise/common-services';
4
- import { HelperService } from '@posiwise/helper-service';
5
- import * as i1 from '@angular/router';
6
- import { RouterModule } from '@angular/router';
7
- import { Trial4SharedContactUsModule } from '@posiwise/resource-contact-us';
8
- import * as i3 from '@angular/common';
9
- import { CommonModule } from '@angular/common';
10
- import * as i5$2 from '@angular/forms';
11
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
12
- import { HubSpotMeetingsSharedModule } from '@posiwise/alpha-module';
13
- import { CoreTranslocoModule } from '@posiwise/core-transloco';
14
- import * as i5 from '@posiwise/directives';
15
- import { DirectivesModule } from '@posiwise/directives';
16
- import { PipesModule } from '@posiwise/pipes';
17
- import * as i6 from '@posiwise/shared-components';
18
- import { ResourceSharedComponentsModule } from '@posiwise/shared-components';
19
- import { IconFieldModule } from 'primeng/iconfield';
20
- import { InputIconModule } from 'primeng/inputicon';
21
- import { InputTextModule } from 'primeng/inputtext';
22
- import { TextareaModule } from 'primeng/textarea';
23
- import * as i10 from '@jsverse/transloco';
24
- import { TranslocoModule } from '@jsverse/transloco';
25
- import { AppBaseComponent } from '@posiwise/app-base-component';
26
- import { Subject, forkJoin } from 'rxjs';
27
- import * as i5$1 from 'primeng/paginator';
28
- import { PaginatorModule } from 'primeng/paginator';
29
- import * as i2$1 from '@ng-bootstrap/ng-bootstrap';
30
- import * as i8 from '@posiwise/utils';
31
- import { DragDropModule } from '@angular/cdk/drag-drop';
32
- import { NgxCaptchaModule } from 'ngx-captcha';
33
- import { SelectModule } from 'primeng/select';
34
- import * as i7 from 'primeng/progressspinner';
35
- import * as i3$1 from '@angular/platform-browser';
36
- import * as i11 from 'ngx-quill';
37
- import { QuillModule } from 'ngx-quill';
38
- import * as i12 from 'ngx-ui-switch';
39
- import { UiSwitchModule } from 'ngx-ui-switch';
40
- import * as i7$1 from 'primeng/autocomplete';
41
- import { AutoCompleteModule } from 'primeng/autocomplete';
42
- import * as i6$1 from 'primeng/datepicker';
43
- import { DatePickerModule } from 'primeng/datepicker';
44
- import moment from 'moment';
45
-
46
- class ResourceService {
47
- constructor(api) {
48
- this.api = api;
49
- this.resource = '/posts';
50
- this.comments = '/comments';
51
- }
52
- getPublicPosts(master_subscription_id, page, pageSize, search, tagCategoryIds, tagIds) {
53
- const params = {
54
- page,
55
- page_size: pageSize,
56
- search: search,
57
- master_subscription_id
58
- };
59
- if (tagCategoryIds) {
60
- params['tag_category_ids'] = tagCategoryIds;
61
- }
62
- if (tagIds) {
63
- params['tag_ids'] = tagIds;
64
- }
65
- return this.api.getWithParams(`${this.resource}/get_all`, {
66
- ...params
67
- });
68
- }
69
- getAdminPosts(subscriptionId, paging) {
70
- return this.api.getWithParams(`${this.resource}/admin_get_all`, {
71
- ...HelperService.getPagingParams(paging),
72
- subscription_id: subscriptionId
73
- });
74
- }
75
- addPost(post) {
76
- const formData = new FormData();
77
- // eslint-disable-next-line no-restricted-syntax
78
- for (const key in post) {
79
- if (key in post) {
80
- formData.append(key, post[key]);
81
- }
82
- }
83
- return this.api.post(this.resource, formData);
84
- }
85
- getPostBySlug(slug) {
86
- return this.api.get(`${this.resource}/${slug}`);
87
- }
88
- deletePost(id) {
89
- return this.api.delete(`${this.resource}/${id}`);
90
- }
91
- updatePost(post, id) {
92
- const formData = new FormData();
93
- // eslint-disable-next-line no-restricted-syntax
94
- for (const key in post) {
95
- if (key in post) {
96
- formData.append(key, post[key]);
97
- }
98
- }
99
- return this.api.put(`${this.resource}/${id}`, formData);
100
- }
101
- getComments() {
102
- return this.api.get(`${this.comments}/get_all`);
103
- }
104
- postComments(post) {
105
- return this.api.post(this.comments, post);
106
- }
107
- getResourceInsight(subscription_id, starting_at, ending_at) {
108
- return this.api.getWithParams(`/admin/posts_analytics?type=views&subscription_id=${subscription_id}`, { starting_at, ending_at });
109
- }
110
- getResourcePostsInsight(id) {
111
- return this.api.get(`${this.resource}/${id}/insights`);
112
- }
113
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceService, deps: [{ token: i2.MainApiHttpService }], target: i0.ɵɵFactoryTarget.Injectable }); }
114
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceService }); }
115
- }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceService, decorators: [{
117
- type: Injectable
118
- }], ctorParameters: () => [{ type: i2.MainApiHttpService }] });
119
-
120
- // Lazy loaded routes - each route now loads its own module with only the components it needs
121
- const routes = [
122
- {
123
- path: '',
124
- pathMatch: 'full',
125
- loadChildren: () => import('./posiwise-resource-module-resource-root.module-D9-M2alB.mjs').then(m => m.ResourceRootModule)
126
- },
127
- {
128
- path: 'hub',
129
- loadChildren: () => import('./posiwise-resource-module-resource-hub.module-mSjREp_s.mjs').then(m => m.ResourceHubModule)
130
- },
131
- {
132
- path: 'blogs',
133
- loadChildren: () => import('./posiwise-resource-module-resource-blogs.module-CeRB6E1r.mjs').then(m => m.ResourceBlogsModule)
134
- },
135
- {
136
- path: 'videos',
137
- loadChildren: () => import('./posiwise-resource-module-resource-videos.module-mBQ3w0lv.mjs').then(m => m.ResourceVideosModule)
138
- },
139
- {
140
- path: 'integrations',
141
- loadChildren: () => import('./posiwise-resource-module-resource-integrations.module-BYM4LlIm.mjs').then(m => m.ResourceIntegrationsModule)
142
- },
143
- {
144
- path: 'release-notes',
145
- loadChildren: () => import('./posiwise-resource-module-resource-release-notes.module-fyZp_sFo.mjs').then(m => m.ResourceReleaseNotesModule)
146
- },
147
- {
148
- path: 'events',
149
- loadChildren: () => import('./posiwise-resource-module-resource-events.module-BBHi-JUF.mjs').then(m => m.ResourceEventsModule)
150
- },
151
- {
152
- path: 'white-papers',
153
- loadChildren: () => import('./posiwise-resource-module-resource-white-papers.module-IGdisYOV.mjs').then(m => m.ResourceWhitePapersModule)
154
- },
155
- {
156
- path: 'case-studies',
157
- loadChildren: () => import('./posiwise-resource-module-resource-case-studies.module-DL3JRVp5.mjs').then(m => m.ResourceCaseStudiesModule)
158
- },
159
- {
160
- path: 'view/:slug',
161
- loadChildren: () => import('./posiwise-resource-module-resource-post.module-BhnGYNxN.mjs').then(m => m.ResourcePostModule)
162
- }
163
- ];
164
- class BlogPublicRoutingModule {
165
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: BlogPublicRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
166
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: BlogPublicRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] }); }
167
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: BlogPublicRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
168
- }
169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: BlogPublicRoutingModule, decorators: [{
170
- type: NgModule,
171
- args: [{
172
- imports: [RouterModule.forChild(routes)],
173
- exports: [RouterModule]
174
- }]
175
- }] });
176
-
177
- class ResourcePublicModule {
178
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourcePublicModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
179
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: ResourcePublicModule, imports: [BlogPublicRoutingModule] }); }
180
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourcePublicModule, providers: [ResourceService], imports: [BlogPublicRoutingModule] }); }
181
- }
182
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourcePublicModule, decorators: [{
183
- type: NgModule,
184
- args: [{
185
- imports: [BlogPublicRoutingModule],
186
- providers: [ResourceService],
187
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
188
- }]
189
- }] });
190
-
191
- class ResourceModule {
192
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
193
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: ResourceModule, imports: [ResourcePublicModule] }); }
194
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceModule, imports: [ResourcePublicModule] }); }
195
- }
196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceModule, decorators: [{
197
- type: NgModule,
198
- args: [{
199
- imports: [ResourcePublicModule]
200
- }]
201
- }] });
202
-
203
- class Trial4ContactUsModule {
204
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: Trial4ContactUsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
205
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: Trial4ContactUsModule, imports: [Trial4SharedContactUsModule], exports: [Trial4SharedContactUsModule] }); }
206
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: Trial4ContactUsModule, imports: [Trial4SharedContactUsModule, Trial4SharedContactUsModule] }); }
207
- }
208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: Trial4ContactUsModule, decorators: [{
209
- type: NgModule,
210
- args: [{
211
- imports: [Trial4SharedContactUsModule],
212
- exports: [Trial4SharedContactUsModule]
213
- }]
214
- }] });
215
-
216
- /**
217
- * Lazy-loading wrapper for ResourceEditCard
218
- */
219
- class ResourceEditCardLazyComponent {
220
- constructor(cdr) {
221
- this.cdr = cdr;
222
- this.canEdit = false;
223
- this.updated = new EventEmitter();
224
- this.componentRef = null;
225
- this.loading = false;
226
- }
227
- async ngOnChanges(changes) {
228
- if (this.canEdit && !this.componentRef && !this.loading) {
229
- await this.loadEditCard();
230
- }
231
- else if (!this.canEdit && this.componentRef) {
232
- this.container.clear();
233
- this.componentRef = null;
234
- }
235
- else if (this.componentRef && (changes['id'] || changes['resourceData'])) {
236
- // Update existing component inputs
237
- this.componentRef.instance.id = this.id;
238
- this.componentRef.instance.resourceData = this.resourceData;
239
- }
240
- }
241
- async loadEditCard() {
242
- if (this.componentRef || this.loading)
243
- return; // Prevent double loading
244
- this.loading = true; // Set BEFORE async operation
245
- try {
246
- // Dynamically import ResourceEditCard component (145 KB)
247
- const module = await Promise.resolve().then(function () { return resourceEditCard_component; });
248
- const ResourceEditCardComponent = module.ResourceEditCardComponent;
249
- // Ensure container exists and is clear
250
- if (!this.container)
251
- return;
252
- this.container.clear();
253
- // Create component dynamically (only once)
254
- this.componentRef = this.container.createComponent(ResourceEditCardComponent);
255
- this.componentRef.instance.id = this.id;
256
- this.componentRef.instance.resourceData = this.resourceData;
257
- this.componentRef.instance.updated.subscribe(() => {
258
- this.updated.emit();
259
- this.cdr.markForCheck();
260
- });
261
- this.loading = false;
262
- }
263
- catch (error) {
264
- console.error('Failed to load ResourceEditCard:', error);
265
- this.loading = false;
266
- }
267
- }
268
- ngOnDestroy() {
269
- this.componentRef?.destroy();
270
- }
271
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceEditCardLazyComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
272
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: ResourceEditCardLazyComponent, isStandalone: false, selector: "pw-resource-edit-card-lazy", inputs: { id: "id", resourceData: "resourceData", canEdit: "canEdit" }, outputs: { updated: "updated" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["editCardContainer"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `<ng-container #editCardContainer></ng-container>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
273
- }
274
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceEditCardLazyComponent, decorators: [{
275
- type: Component,
276
- args: [{
277
- selector: 'pw-resource-edit-card-lazy',
278
- template: `<ng-container #editCardContainer></ng-container>`,
279
- changeDetection: ChangeDetectionStrategy.OnPush,
280
- standalone: false
281
- }]
282
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { container: [{
283
- type: ViewChild,
284
- args: ['editCardContainer', { read: ViewContainerRef, static: true }]
285
- }], id: [{
286
- type: Input
287
- }], resourceData: [{
288
- type: Input
289
- }], canEdit: [{
290
- type: Input
291
- }], updated: [{
292
- type: Output
293
- }] } });
294
-
295
- class ResourceCompanyCardComponent extends AppBaseComponent {
296
- constructor(injector, cdr) {
297
- super(injector);
298
- this.cdr = cdr;
299
- this.getPosts = new EventEmitter();
300
- this.destroy$ = new Subject();
301
- this.canEditResourcesValue = false;
302
- this.header = '';
303
- this.data = [];
304
- this.vendor = false;
305
- this.postData = false;
306
- this.filteredData = [];
307
- this.first = 0;
308
- this.rows = 12;
309
- }
310
- ngOnChanges() {
311
- this.search();
312
- }
313
- ngOnInit() {
314
- if (this.userLoggedIn) {
315
- this.updateCanEditResourcesValue();
316
- this.localStorage.getItem$('product').subscribe(res => {
317
- const data = res ? JSON.parse(res) : null;
318
- this.subscriptionId = data?.subscriptionId;
319
- this.cdr.markForCheck();
320
- });
321
- }
322
- }
323
- search(keywords) {
324
- if (keywords) {
325
- this.filteredData = this.data.filter(x => x.title.toLowerCase().includes(keywords.toLowerCase()));
326
- if (this.filteredData.length === 0) {
327
- this.postData = true;
328
- }
329
- else {
330
- this.postData = false;
331
- }
332
- }
333
- else {
334
- this.filteredData = [...this.data];
335
- this.postData = false;
336
- }
337
- }
338
- onPageChange(event) {
339
- this.first = event.first;
340
- this.rows = event.rows;
341
- }
342
- ngOnDestroy() {
343
- this.destroy$.next();
344
- this.destroy$.complete();
345
- }
346
- updateCanEditResourcesValue() {
347
- this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
348
- }
349
- canEditResources() {
350
- return this.canEditResourcesValue;
351
- }
352
- /** Show no-data when there is integration count but no posts (postData is false, filteredData empty). */
353
- get showNoPostsMessage() {
354
- return (this.integrationCountDisplay > 0 &&
355
- !this.postData &&
356
- (!this.filteredData || this.filteredData.length === 0));
357
- }
358
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceCompanyCardComponent, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
359
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ResourceCompanyCardComponent, isStandalone: false, selector: "pw-resource-company-card", inputs: { header: "header", data: "data", integrationCountDisplay: "integrationCountDisplay", vendor: "vendor", user: "user", userLoggedIn: "userLoggedIn" }, outputs: { getPosts: "getPosts" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div [ngClass]=\"{ 'vendors-distributor-wrapper': !vendor }\">\n <div class=\"d-flex justify-content-between align-items-center mb-3 search-container\">\n <div>\n <span class=\"int-span\">{{header}}</span>\n </div>\n @if (integrationCountDisplay > 0) {\n <div class=\"search-wrapper position-relative\">\n <i class=\"fa fa-search search-icon\"></i>\n <input type=\"text\"\n (keyup)=\"search($event.target.value)\"\n placeholder=\"Search eg security\"\n class=\"search-input top-search-input\" id=\"input_search_eg_security_9712\" name=\"input_search_eg_security_9712\" />\n </div>\n }\n\n </div>\n\n @if (postData) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\"> </pw-no-data>\n </div>\n }\n\n @if (showNoPostsMessage) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"></pw-no-data>\n </div>\n }\n\n @if (!postData && integrationCountDisplay > 0 && filteredData.length > 0) {\n <div class=\"row\">\n @for (img of filteredData | slice:first:(first + rows); track img) {\n <div class=\"col-md-3 mt-4\"\n >\n <div class=\"boxes d-flex align-items-center justify-content-center\">\n @if (img?.companyImg) {\n <img [src]=\"img.companyImg\" alt=\"Vendor Company Icon\" class=\"vendor-icon\" />\n } @else {\n @if (img?.rectangular_picture?.url) {\n @if (!img.rectangular_picture.url.includes('default-photo')) {\n @if (img?.showcase) {\n <a class=\"vendor-link\" [href]=\"img.external_url || ('/resources/view/' + img.slug)\">\n <img [src]=\"img.rectangular_picture.url\" alt=\"Vendor Rectangular Company Icon\" class=\"vendor-icon\" />\n </a>\n } @else {\n <img [src]=\"img.rectangular_picture.url\" alt=\"Vendor Rectangular Company Icon\" class=\"vendor-icon\" />\n }\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"img?.id\"\n [resourceData]=\"img\"\n (updated)=\"getPosts.emit()\">\n </pw-resource-edit-card-lazy>\n } @else {\n @if (img?.showcase) {\n <a class=\"vendor-link\" [href]=\"img.external_url || ('/resources/view/' + img.slug)\">\n <span class=\"vendor-name text-center mt-2\">{{ img?.title }}</span>\n </a>\n } @else {\n <span class=\"vendor-name text-center\">{{ img?.title }}</span>\n }\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"img?.id\"\n [resourceData]=\"img\"\n (updated)=\"getPosts.emit()\">\n </pw-resource-edit-card-lazy>\n }\n } @else {\n <ng-template [ngTemplateOutlet]=\"noImage\"></ng-template>\n }\n }\n </div>\n </div>\n }\n @if (filteredData.length > 0) {\n <div class=\"customPaginator d-flex align-items-center mt-5 justify-content-center\"\n >\n <p-paginator\n [first]=\"first\"\n [rows]=\"rows\"\n [totalRecords]=\"filteredData.length\"\n (onPageChange)=\"onPageChange($event)\"></p-paginator>\n </div>\n }\n </div>\n }\n</div>\n", styles: [".top-search-input{color:#000!important;border:3px solid #d4d4d4!important;padding:5px 30px!important;border-radius:29px!important}::placeholder{color:#d4d4d4}.vendors-distributor-wrapper{margin-top:5rem!important}.vendor-icon{max-width:180px;max-height:100%;width:100%!important}.vendor-name{font-size:3rem;line-height:3rem;color:var(--text-color, black)}::ng-deep .customPaginator .p-paginator{border:none!important}::ng-deep .customPaginator .p-paginator button{border:none!important}.int-span{text-transform:uppercase;font-size:2.5rem;color:var(--first)}.boxes{width:100%;min-height:150px;display:flex;align-items:center;justify-content:center;text-align:center;padding:15px;border:1px dashed #ccc;border-radius:8px;word-break:break-word;white-space:normal;height:100%}a.vendor-link{display:inline-block;transition:transform .2s ease}a.vendor-link:hover{transform:scale(1.05);cursor:pointer}.search-wrapper{position:relative;width:300px}.search-input{width:100%;padding:10px 20px 10px 40px;border:2px solid #d4d4d4;border-radius:30px;font-size:1rem;color:#000;background-color:#fff}.search-input::placeholder{color:silver}.search-input:focus{outline:none;border-color:var(--first)}.search-icon{position:absolute;top:50%;left:14px;transform:translateY(-50%);color:#d4d4d4;font-size:1.1rem}@media(width<=768px){.vendor-icon{width:50!important}.search-container{flex-wrap:wrap!important;gap:2rem}.int-span{font-size:1.75rem}}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: ResourceEditCardLazyComponent, selector: "pw-resource-edit-card-lazy", inputs: ["id", "resourceData", "canEdit"], outputs: ["updated"] }, { kind: "component", type: i5$1.Paginator, selector: "p-paginator", inputs: ["pageLinkSize", "styleClass", "alwaysShow", "dropdownAppendTo", "templateLeft", "templateRight", "dropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showFirstLastIcon", "totalRecords", "rows", "rowsPerPageOptions", "showJumpToPageDropdown", "showJumpToPageInput", "jumpToPageItemTemplate", "showPageLinks", "locale", "dropdownItemTemplate", "first", "appendTo"], outputs: ["onPageChange"] }, { kind: "pipe", type: i3.SlicePipe, name: "slice" }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
360
- }
361
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceCompanyCardComponent, decorators: [{
362
- type: Component,
363
- args: [{ selector: 'pw-resource-company-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div [ngClass]=\"{ 'vendors-distributor-wrapper': !vendor }\">\n <div class=\"d-flex justify-content-between align-items-center mb-3 search-container\">\n <div>\n <span class=\"int-span\">{{header}}</span>\n </div>\n @if (integrationCountDisplay > 0) {\n <div class=\"search-wrapper position-relative\">\n <i class=\"fa fa-search search-icon\"></i>\n <input type=\"text\"\n (keyup)=\"search($event.target.value)\"\n placeholder=\"Search eg security\"\n class=\"search-input top-search-input\" id=\"input_search_eg_security_9712\" name=\"input_search_eg_security_9712\" />\n </div>\n }\n\n </div>\n\n @if (postData) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\"> </pw-no-data>\n </div>\n }\n\n @if (showNoPostsMessage) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"></pw-no-data>\n </div>\n }\n\n @if (!postData && integrationCountDisplay > 0 && filteredData.length > 0) {\n <div class=\"row\">\n @for (img of filteredData | slice:first:(first + rows); track img) {\n <div class=\"col-md-3 mt-4\"\n >\n <div class=\"boxes d-flex align-items-center justify-content-center\">\n @if (img?.companyImg) {\n <img [src]=\"img.companyImg\" alt=\"Vendor Company Icon\" class=\"vendor-icon\" />\n } @else {\n @if (img?.rectangular_picture?.url) {\n @if (!img.rectangular_picture.url.includes('default-photo')) {\n @if (img?.showcase) {\n <a class=\"vendor-link\" [href]=\"img.external_url || ('/resources/view/' + img.slug)\">\n <img [src]=\"img.rectangular_picture.url\" alt=\"Vendor Rectangular Company Icon\" class=\"vendor-icon\" />\n </a>\n } @else {\n <img [src]=\"img.rectangular_picture.url\" alt=\"Vendor Rectangular Company Icon\" class=\"vendor-icon\" />\n }\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"img?.id\"\n [resourceData]=\"img\"\n (updated)=\"getPosts.emit()\">\n </pw-resource-edit-card-lazy>\n } @else {\n @if (img?.showcase) {\n <a class=\"vendor-link\" [href]=\"img.external_url || ('/resources/view/' + img.slug)\">\n <span class=\"vendor-name text-center mt-2\">{{ img?.title }}</span>\n </a>\n } @else {\n <span class=\"vendor-name text-center\">{{ img?.title }}</span>\n }\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"img?.id\"\n [resourceData]=\"img\"\n (updated)=\"getPosts.emit()\">\n </pw-resource-edit-card-lazy>\n }\n } @else {\n <ng-template [ngTemplateOutlet]=\"noImage\"></ng-template>\n }\n }\n </div>\n </div>\n }\n @if (filteredData.length > 0) {\n <div class=\"customPaginator d-flex align-items-center mt-5 justify-content-center\"\n >\n <p-paginator\n [first]=\"first\"\n [rows]=\"rows\"\n [totalRecords]=\"filteredData.length\"\n (onPageChange)=\"onPageChange($event)\"></p-paginator>\n </div>\n }\n </div>\n }\n</div>\n", styles: [".top-search-input{color:#000!important;border:3px solid #d4d4d4!important;padding:5px 30px!important;border-radius:29px!important}::placeholder{color:#d4d4d4}.vendors-distributor-wrapper{margin-top:5rem!important}.vendor-icon{max-width:180px;max-height:100%;width:100%!important}.vendor-name{font-size:3rem;line-height:3rem;color:var(--text-color, black)}::ng-deep .customPaginator .p-paginator{border:none!important}::ng-deep .customPaginator .p-paginator button{border:none!important}.int-span{text-transform:uppercase;font-size:2.5rem;color:var(--first)}.boxes{width:100%;min-height:150px;display:flex;align-items:center;justify-content:center;text-align:center;padding:15px;border:1px dashed #ccc;border-radius:8px;word-break:break-word;white-space:normal;height:100%}a.vendor-link{display:inline-block;transition:transform .2s ease}a.vendor-link:hover{transform:scale(1.05);cursor:pointer}.search-wrapper{position:relative;width:300px}.search-input{width:100%;padding:10px 20px 10px 40px;border:2px solid #d4d4d4;border-radius:30px;font-size:1rem;color:#000;background-color:#fff}.search-input::placeholder{color:silver}.search-input:focus{outline:none;border-color:var(--first)}.search-icon{position:absolute;top:50%;left:14px;transform:translateY(-50%);color:#d4d4d4;font-size:1.1rem}@media(width<=768px){.vendor-icon{width:50!important}.search-container{flex-wrap:wrap!important;gap:2rem}.int-span{font-size:1.75rem}}\n"] }]
364
- }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }], propDecorators: { getPosts: [{
365
- type: Output
366
- }], header: [{
367
- type: Input
368
- }], data: [{
369
- type: Input
370
- }], integrationCountDisplay: [{
371
- type: Input
372
- }], vendor: [{
373
- type: Input
374
- }], user: [{
375
- type: Input
376
- }], userLoggedIn: [{
377
- type: Input
378
- }] } });
379
-
380
- class ResourceTopBannerEditComponent extends AppBaseComponent {
381
- constructor(fb, modalService, tagService, cdr, injector) {
382
- super(injector);
383
- this.fb = fb;
384
- this.modalService = modalService;
385
- this.tagService = tagService;
386
- this.cdr = cdr;
387
- this.getUpdatedTag = new EventEmitter();
388
- this.image = null;
389
- this.defaultImage = 'assets/img/resource/blog.png';
390
- }
391
- ngOnInit() {
392
- if (this.userLoggedIn) {
393
- this.localStorage.getItem$('product').subscribe(res => {
394
- const data = res ? JSON.parse(res) : null;
395
- this.subscriptionId = data?.subscriptionId;
396
- this.cdr.markForCheck();
397
- });
398
- }
399
- this.form = this.fb.group({
400
- title: [this.blogPostTag?.title ?? ''],
401
- description: [this.blogPostTag?.description ?? ''],
402
- meta_title: [this.blogPostTag?.meta_title ?? ''],
403
- meta_description: [this.blogPostTag?.meta_description ?? '']
404
- });
405
- this.image = this.blogPostTag?.image?.url ?? null;
406
- }
407
- openEditModal() {
408
- this.modalService.open(this.editModal, { centered: true, size: 'lg' });
409
- }
410
- openImageModal(modalRef) {
411
- this.imageModalRef = this.modalService.open(modalRef, { centered: true });
412
- }
413
- onImageSelected(base64) {
414
- this.image = base64;
415
- this.file = HelperService.convertBase64ToFile(base64);
416
- this.imageModalRef?.close();
417
- }
418
- onClose() {
419
- this.imageModalRef?.close();
420
- }
421
- removeImage() {
422
- this.image = null;
423
- }
424
- handleImageError(event) {
425
- event.target.src = this.defaultImage;
426
- }
427
- save() {
428
- this.buttonBusy = true;
429
- const payload = {
430
- title: this.form.value.title ?? this.blogPostTag?.title,
431
- description: this.form.value.description ?? this.blogPostTag?.description,
432
- meta_title: this.form.value.meta_title ?? this.blogPostTag?.meta_title,
433
- meta_description: this.form.value.meta_description ?? this.blogPostTag?.meta_description,
434
- tag_category_id: this.blogPostTag?.tag_category_id,
435
- tag_type: this.blogPostTag?.tag_type,
436
- subscription_id: this.subscriptionId,
437
- name: this.blogPostTag?.name
438
- };
439
- if (this.file) {
440
- payload['image'] = this.file;
441
- }
442
- else if (!this.image) {
443
- payload['remove_image'] = true;
444
- }
445
- this.tagService.updateTagById(this.blogPostTag?.id, payload).subscribe(() => {
446
- this.buttonBusy = false;
447
- this.toast.success('Tag Updated');
448
- this.getUpdatedTag.emit();
449
- this.modalService.dismissAll();
450
- this.cdr.markForCheck();
451
- });
452
- }
453
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceTopBannerEditComponent, deps: [{ token: i5$2.FormBuilder }, { token: i2$1.NgbModal }, { token: i2.TagService }, { token: i0.ChangeDetectorRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
454
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ResourceTopBannerEditComponent, isStandalone: false, selector: "pw-resource-top-banner-edit", inputs: { blogPostTag: "blogPostTag", user: "user", userLoggedIn: "userLoggedIn" }, outputs: { getUpdatedTag: "getUpdatedTag" }, viewQueries: [{ propertyName: "editModal", first: true, predicate: ["editModal"], descendants: true }, { propertyName: "imageCropContent", first: true, predicate: ["imageCropContent"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"edit-card\">\n <i class=\"fa fa-edit cursor-pointer text-black in-page-edit-icon mb-1 ms-3\"\n (click)=\"openEditModal()\"\n (keydown.enter)=\"openEditModal()\"\n (keydown.space)=\"openEditModal()\"\n title=\"Edit Blog Tag\"></i>\n</div>\n\n<ng-template #editModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Blog Post Tag</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <form [formGroup]=\"form\">\n <div class=\"row\">\n\n <div class=\"col-12\">\n <pw-input-container label=\"Title\" name=\"title\">\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" id=\"input_title_1\" name=\"input_title_1\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container label=\"Description\" name=\"description\" controlId=\"resource-top-banner-description\">\n <textarea id=\"resource-top-banner-description\" name=\"description\" class=\"form-control\" rows=\"4\" formControlName=\"description\"></textarea>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container label=\"Meta Title\" name=\"meta_title\">\n <input type=\"text\" class=\"form-control\" formControlName=\"meta_title\" placeholder=\"Meta Title for SEO\" id=\"input_meta_title_2\" name=\"input_meta_title_2\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container label=\"Meta Description\" name=\"meta_description\" controlId=\"resource-top-banner-meta_description\">\n <textarea id=\"resource-top-banner-meta_description\" name=\"meta_description\" class=\"form-control\" rows=\"3\" formControlName=\"meta_description\" placeholder=\"Meta Description for SEO\"></textarea>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 my-4\">\n <span id=\"resource-top-banner-tag-image-label\" class=\"pw-label-style\">Blog Tag Image</span>\n <div class=\"text-center d-flex flex-column align-items-center col-6\">\n <img [src]=\"image || defaultImage\"\n (click)=\"openImageModal(imageCropContent)\"\n (keydown.enter)=\"openImageModal(imageCropContent)\"\n (keydown.space)=\"openImageModal(imageCropContent)\"\n class=\"image w-100\"\n alt=\"Blog\"\n (error)=\"handleImageError($event)\"\n />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <a class=\"d-inline-block mt-2\"\n (click)=\"openImageModal(imageCropContent)\">\n {{ image ? 'Update' : 'Add' }} Image\n </a>\n @if (image) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (keydown.enter)=\"removeImage()\"\n (keydown.space)=\"removeImage()\"\n (click)=\"removeImage()\"></i>\n }\n </div>\n </div>\n </div>\n\n </div>\n </form>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"modal.dismiss()\">Cancel</button>\n <button class=\"btn btn-primary\" [buttonBusy]=\"buttonBusy\" (click)=\"save()\">Save</button>\n </div>\n</ng-template>\n\n<ng-template #imageCropContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Image</h5>\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. Avoid artwork, celebrities, or copyrighted images.</small>\n <pw-image-cropper\n #cropper\n aspectRatio=\"dynamic\"\n (imageSelectionEvent)=\"onImageSelected($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i5$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$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: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8.ProfileImageCropperComponent, selector: "pw-image-cropper", inputs: ["aspectRatio", "dynamicData"], outputs: ["imageSelectionEvent", "closeEvent", "fileChangeEvent"] }, { kind: "component", type: i6.InputContainerComponent, selector: "pw-input-container", inputs: ["name", "controlId", "useAriaLabelledbyOnly", "label", "labelClass", "tooltipPosition", "required", "errorMsg", "isReadOnly", "showTooltip", "tooltipText", "showTriangle", "afterLabel", "showAfterLabel", "showTriangleText", "isLeftTooltip"] }, { kind: "directive", type: i5.ButtonBusyDirective, selector: "[buttonBusy]", inputs: ["buttonBusy", "busyText"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
455
- }
456
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceTopBannerEditComponent, decorators: [{
457
- type: Component,
458
- args: [{ selector: 'pw-resource-top-banner-edit', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"edit-card\">\n <i class=\"fa fa-edit cursor-pointer text-black in-page-edit-icon mb-1 ms-3\"\n (click)=\"openEditModal()\"\n (keydown.enter)=\"openEditModal()\"\n (keydown.space)=\"openEditModal()\"\n title=\"Edit Blog Tag\"></i>\n</div>\n\n<ng-template #editModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Blog Post Tag</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <form [formGroup]=\"form\">\n <div class=\"row\">\n\n <div class=\"col-12\">\n <pw-input-container label=\"Title\" name=\"title\">\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" id=\"input_title_1\" name=\"input_title_1\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container label=\"Description\" name=\"description\" controlId=\"resource-top-banner-description\">\n <textarea id=\"resource-top-banner-description\" name=\"description\" class=\"form-control\" rows=\"4\" formControlName=\"description\"></textarea>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container label=\"Meta Title\" name=\"meta_title\">\n <input type=\"text\" class=\"form-control\" formControlName=\"meta_title\" placeholder=\"Meta Title for SEO\" id=\"input_meta_title_2\" name=\"input_meta_title_2\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container label=\"Meta Description\" name=\"meta_description\" controlId=\"resource-top-banner-meta_description\">\n <textarea id=\"resource-top-banner-meta_description\" name=\"meta_description\" class=\"form-control\" rows=\"3\" formControlName=\"meta_description\" placeholder=\"Meta Description for SEO\"></textarea>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 my-4\">\n <span id=\"resource-top-banner-tag-image-label\" class=\"pw-label-style\">Blog Tag Image</span>\n <div class=\"text-center d-flex flex-column align-items-center col-6\">\n <img [src]=\"image || defaultImage\"\n (click)=\"openImageModal(imageCropContent)\"\n (keydown.enter)=\"openImageModal(imageCropContent)\"\n (keydown.space)=\"openImageModal(imageCropContent)\"\n class=\"image w-100\"\n alt=\"Blog\"\n (error)=\"handleImageError($event)\"\n />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <a class=\"d-inline-block mt-2\"\n (click)=\"openImageModal(imageCropContent)\">\n {{ image ? 'Update' : 'Add' }} Image\n </a>\n @if (image) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (keydown.enter)=\"removeImage()\"\n (keydown.space)=\"removeImage()\"\n (click)=\"removeImage()\"></i>\n }\n </div>\n </div>\n </div>\n\n </div>\n </form>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"modal.dismiss()\">Cancel</button>\n <button class=\"btn btn-primary\" [buttonBusy]=\"buttonBusy\" (click)=\"save()\">Save</button>\n </div>\n</ng-template>\n\n<ng-template #imageCropContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Image</h5>\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. Avoid artwork, celebrities, or copyrighted images.</small>\n <pw-image-cropper\n #cropper\n aspectRatio=\"dynamic\"\n (imageSelectionEvent)=\"onImageSelected($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n" }]
459
- }], ctorParameters: () => [{ type: i5$2.FormBuilder }, { type: i2$1.NgbModal }, { type: i2.TagService }, { type: i0.ChangeDetectorRef }, { type: i0.Injector }], propDecorators: { blogPostTag: [{
460
- type: Input
461
- }], user: [{
462
- type: Input
463
- }], userLoggedIn: [{
464
- type: Input
465
- }], getUpdatedTag: [{
466
- type: Output
467
- }], editModal: [{
468
- type: ViewChild,
469
- args: ['editModal']
470
- }], imageCropContent: [{
471
- type: ViewChild,
472
- args: ['imageCropContent']
473
- }] } });
474
-
475
- class ResourceNoteCardComponent extends AppBaseComponent {
476
- constructor(injector, resourceService, tagService, cdr) {
477
- super(injector);
478
- this.resourceService = resourceService;
479
- this.tagService = tagService;
480
- this.cdr = cdr;
481
- this.releaseHeader = false;
482
- this.isReleasePress = false;
483
- this.isResource = false;
484
- this.postSlice = false;
485
- this.canEditResourcesValue = false;
486
- this.isLoaded = false;
487
- this.masterSubscriptionId = this.appConfig.master_subscription.subscription_id;
488
- this.postTags = {};
489
- this.releasePosts = {};
490
- }
491
- ngOnInit() {
492
- if (this.userLoggedIn) {
493
- this.localStorage.getItem$('product').subscribe(res => {
494
- const data = res ? JSON.parse(res) : null;
495
- this.subscriptionId = data?.subscriptionId;
496
- this.cdr.markForCheck();
497
- });
498
- }
499
- this.getTags();
500
- }
501
- ngOnChanges(changes) {
502
- if (changes['user'] || changes['userLoggedIn']) {
503
- if (this.userLoggedIn && this.user) {
504
- this.updateCanEditResourcesValue();
505
- }
506
- }
507
- }
508
- getTags() {
509
- this.isLoaded = false;
510
- this.tagService
511
- .getAllTagCategories({ search: 'Release Notes' }, this.getEffectiveSubscriptionId())
512
- .subscribe(response => {
513
- this.tagCategory = response?.tag_categories?.[0];
514
- this.getPostTags();
515
- this.cdr.markForCheck();
516
- });
517
- }
518
- getPostTags() {
519
- this.tagService
520
- .getTagsByType('post_categories', {}, this.getEffectiveSubscriptionId())
521
- .subscribe(response => {
522
- this.postTags['product'] = this.findTag(response.tags, 'Product Release Notes', this.tagCategory?.id);
523
- this.postTags['press'] = this.findTag(response.tags, 'Press Release Notes', this.tagCategory?.id);
524
- if (this.postTags['product']?.id) {
525
- this.getProductReleasePosts(1, 100);
526
- }
527
- else {
528
- this.isLoaded = true;
529
- this.releasePosts['product'] = [];
530
- }
531
- if (this.postTags['press']?.id) {
532
- this.getPressReleasePosts(1, 100);
533
- }
534
- else {
535
- this.isLoaded = true;
536
- this.releasePosts['press'] = [];
537
- }
538
- this.cdr.markForCheck();
539
- });
540
- }
541
- findTag(tags, name, categoryId) {
542
- return tags.find(tag => tag.name === name && tag.tag_category_id === categoryId);
543
- }
544
- hasPressReleases() {
545
- return this.releasePosts['press']?.length !== 0 && this.isLoaded;
546
- }
547
- hasProductReleases() {
548
- return this.releasePosts['product']?.length !== 0 && this.isLoaded;
549
- }
550
- getProductReleasePosts(page, pageSize) {
551
- this.isLoaded = false;
552
- this.resourceService
553
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', '', this.postTags['product']?.id)
554
- .subscribe(response => {
555
- const sortedPosts = response.posts
556
- .filter(post => post.showcase === true)
557
- .sort((a, b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime());
558
- this.releasePosts['product'] = this.getProcessedPosts(sortedPosts);
559
- this.cdr.markForCheck();
560
- })
561
- .add(() => {
562
- this.isLoaded = true;
563
- this.cdr.markForCheck();
564
- });
565
- }
566
- getPressReleasePosts(page, pageSize) {
567
- this.isLoaded = false;
568
- this.resourceService
569
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', '', this.postTags['press']?.id)
570
- .subscribe(response => {
571
- const sortedPosts = response?.posts
572
- .filter(post => post.showcase === true)
573
- .sort((a, b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime());
574
- this.releasePosts['press'] = this.getProcessedPosts(sortedPosts);
575
- this.cdr.markForCheck();
576
- })
577
- .add(() => {
578
- this.isLoaded = true;
579
- this.cdr.markForCheck();
580
- });
581
- }
582
- getProcessedPosts(posts, sliceCount = 3) {
583
- const cloned = [...posts];
584
- return this.postSlice ? cloned.reverse() : cloned.slice(0, sliceCount).reverse();
585
- }
586
- toggleEditTitle() {
587
- this.isEditingTitle = true;
588
- this.editedTitle = this.postTags['product'].title;
589
- }
590
- toggleEditPressTitle() {
591
- this.isPressEditingTitle = true;
592
- this.editedTitle = this.postTags['press'].title;
593
- }
594
- saveEditedTitle(type) {
595
- HelperService.updateTagTitle(this.postTags[type], this.editedTitle, this.tagService, this.getEffectiveSubscriptionId(), this.toast).subscribe(() => {
596
- this.postTags[type].title = this.editedTitle;
597
- if (type === 'product') {
598
- this.isEditingTitle = false;
599
- }
600
- else {
601
- this.isPressEditingTitle = false;
602
- }
603
- this.cdr.markForCheck();
604
- });
605
- }
606
- /** Helper method to get effective subscription ID */
607
- getEffectiveSubscriptionId() {
608
- return HelperService.getEffectiveSubscriptionId(this.user, this.subscriptionId, this.masterSubscriptionId);
609
- }
610
- updateCanEditResourcesValue() {
611
- this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
612
- }
613
- canEditResources() {
614
- return this.canEditResourcesValue;
615
- }
616
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceNoteCardComponent, deps: [{ token: i0.Injector }, { token: ResourceService }, { token: i2.TagService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
617
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ResourceNoteCardComponent, isStandalone: false, selector: "pw-resource-note-card", inputs: { releaseHeader: "releaseHeader", categoryId: "categoryId", isReleasePress: "isReleasePress", isResource: "isResource", postSlice: "postSlice", resourceTitle: "resourceTitle", tag: "tag", user: "user", userLoggedIn: "userLoggedIn" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@if (hasProductReleases()) {\n<section class=\"resource-vault-section bg-white\">\n <div class=\"container\">\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (postTags['product']?.title) {\n <span [innerHTML]=\"postTags['product']?.title\"></span>\n } @else {\n Product Release Notes\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditTitle()\" (keydown.enter)=\"toggleEditTitle()\" (keydown.space)=\"toggleEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9216\" name=\"input_editedTitle_9216\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle('product')\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n @if (!postSlice) {\n <a class=\"view-all\" routerLink=\"/resources/release-notes\">VIEW ALL ></a>\n }\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (releasePosts['product']?.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n @if (hasProductReleases()) {\n <div class=\"row mt-5 d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of releasePosts['product']; track post.id; let i = $index) {\n <div class=\"resource-blog-card p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getProductReleasePosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <p class=\"resource-title\" [innerHTML]=\"post.title\"></p>\n @if (!post.picture?.url?.includes('default-photo.jpg')) {\n <img\n src=\"{{ post.picture.url }}\"\n class=\"resource-image mt-auto\"\n alt=\"Product Resource Icon\"\n width=\"240\"\n height=\"240\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n } @else {\n <img\n src=\"assets/img/resource/rocket-box.png\"\n class=\"press-release-icon mt-auto\"\n alt=\"Product Resource Default Icon\"\n width=\"240\"\n height=\"240\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n }\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [routerLink]=\"['/resources/view', post?.slug]\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>\n}\n@if (isReleasePress && hasPressReleases()) {\n<section class=\"resource-vault-section bg-white\">\n <div class=\"container\">\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isPressEditingTitle }\">\n @if (!isPressEditingTitle) {\n @if (postTags['press']?.title) {\n <span [innerHTML]=\"postTags['press']?.title\"></span>\n } @else {\n Press Release Notes\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditPressTitle()\" (keydown.enter)=\"toggleEditPressTitle()\" (keydown.space)=\"toggleEditPressTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isPressEditingTitle }\" id=\"input_editedTitle_1600\" name=\"input_editedTitle_1600\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle('press')\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isPressEditingTitle = false\">Cancel</button>\n }\n </h2>\n @if (!postSlice) {\n <a class=\"view-all\" routerLink=\"/resources/release-notes\">VIEW ALL ></a>\n }\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (releasePosts['press']?.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n @if (hasPressReleases()) {\n <div class=\"row mt-5 d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of releasePosts['press']; track post.id; let i = $index) {\n <div class=\"resource-blog-card p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPressReleasePosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <p class=\"resource-title\" [innerHTML]=\"post.title\"></p>\n @if (!post.picture?.url.includes('default-photo.jpg')) {\n <img\n src=\"{{ post.picture.url }}\"\n class=\"resource-image mt-auto\"\n alt=\"Press Resource Icon\"\n width=\"240\"\n height=\"240\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n } @else {\n <img\n src=\"assets/img/resource/rocket-box.png\"\n class=\"press-release-icon mt-auto\"\n alt=\"Press Resource Default Icon\"\n width=\"240\"\n height=\"240\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n }\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [routerLink]=\"['/resources/view', post?.slug]\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>\n}\n", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5$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: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i7.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: ResourceEditCardLazyComponent, selector: "pw-resource-edit-card-lazy", inputs: ["id", "resourceData", "canEdit"], outputs: ["updated"] }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
618
- }
619
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceNoteCardComponent, decorators: [{
620
- type: Component,
621
- args: [{ selector: 'pw-resource-note-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if (hasProductReleases()) {\n<section class=\"resource-vault-section bg-white\">\n <div class=\"container\">\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (postTags['product']?.title) {\n <span [innerHTML]=\"postTags['product']?.title\"></span>\n } @else {\n Product Release Notes\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditTitle()\" (keydown.enter)=\"toggleEditTitle()\" (keydown.space)=\"toggleEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9216\" name=\"input_editedTitle_9216\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle('product')\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n @if (!postSlice) {\n <a class=\"view-all\" routerLink=\"/resources/release-notes\">VIEW ALL ></a>\n }\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (releasePosts['product']?.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n @if (hasProductReleases()) {\n <div class=\"row mt-5 d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of releasePosts['product']; track post.id; let i = $index) {\n <div class=\"resource-blog-card p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getProductReleasePosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <p class=\"resource-title\" [innerHTML]=\"post.title\"></p>\n @if (!post.picture?.url?.includes('default-photo.jpg')) {\n <img\n src=\"{{ post.picture.url }}\"\n class=\"resource-image mt-auto\"\n alt=\"Product Resource Icon\"\n width=\"240\"\n height=\"240\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n } @else {\n <img\n src=\"assets/img/resource/rocket-box.png\"\n class=\"press-release-icon mt-auto\"\n alt=\"Product Resource Default Icon\"\n width=\"240\"\n height=\"240\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n }\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [routerLink]=\"['/resources/view', post?.slug]\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>\n}\n@if (isReleasePress && hasPressReleases()) {\n<section class=\"resource-vault-section bg-white\">\n <div class=\"container\">\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isPressEditingTitle }\">\n @if (!isPressEditingTitle) {\n @if (postTags['press']?.title) {\n <span [innerHTML]=\"postTags['press']?.title\"></span>\n } @else {\n Press Release Notes\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditPressTitle()\" (keydown.enter)=\"toggleEditPressTitle()\" (keydown.space)=\"toggleEditPressTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isPressEditingTitle }\" id=\"input_editedTitle_1600\" name=\"input_editedTitle_1600\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle('press')\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isPressEditingTitle = false\">Cancel</button>\n }\n </h2>\n @if (!postSlice) {\n <a class=\"view-all\" routerLink=\"/resources/release-notes\">VIEW ALL ></a>\n }\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (releasePosts['press']?.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n @if (hasPressReleases()) {\n <div class=\"row mt-5 d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of releasePosts['press']; track post.id; let i = $index) {\n <div class=\"resource-blog-card p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPressReleasePosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <p class=\"resource-title\" [innerHTML]=\"post.title\"></p>\n @if (!post.picture?.url.includes('default-photo.jpg')) {\n <img\n src=\"{{ post.picture.url }}\"\n class=\"resource-image mt-auto\"\n alt=\"Press Resource Icon\"\n width=\"240\"\n height=\"240\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n } @else {\n <img\n src=\"assets/img/resource/rocket-box.png\"\n class=\"press-release-icon mt-auto\"\n alt=\"Press Resource Default Icon\"\n width=\"240\"\n height=\"240\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n }\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [routerLink]=\"['/resources/view', post?.slug]\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>\n}\n", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"] }]
622
- }], ctorParameters: () => [{ type: i0.Injector }, { type: ResourceService }, { type: i2.TagService }, { type: i0.ChangeDetectorRef }], propDecorators: { releaseHeader: [{
623
- type: Input
624
- }], categoryId: [{
625
- type: Input
626
- }], isReleasePress: [{
627
- type: Input
628
- }], isResource: [{
629
- type: Input
630
- }], postSlice: [{
631
- type: Input
632
- }], resourceTitle: [{
633
- type: Input
634
- }], tag: [{
635
- type: Input
636
- }], user: [{
637
- type: Input
638
- }], userLoggedIn: [{
639
- type: Input
640
- }] } });
641
-
642
- class CaseStudyCardComponent extends AppBaseComponent {
643
- constructor(injector, resourceService, tagService, cdr) {
644
- super(injector);
645
- this.resourceService = resourceService;
646
- this.tagService = tagService;
647
- this.cdr = cdr;
648
- this.showCaseStudyHeader = false;
649
- this.postSlice = false;
650
- this.canEditResourcesValue = false;
651
- this.isLoaded = false;
652
- this.masterSubscriptionId = this.appConfig.master_subscription.subscription_id;
653
- this.companyName = this.appConfig.company.name;
654
- this.posts = [];
655
- this.isEditingTitle = false;
656
- }
657
- ngOnInit() {
658
- if (this.userLoggedIn) {
659
- this.localStorage.getItem$('product').subscribe(res => {
660
- const data = res ? JSON.parse(res) : null;
661
- this.subscriptionId = data?.subscriptionId;
662
- this.cdr.markForCheck();
663
- });
664
- }
665
- this.getPosts(1, 10);
666
- }
667
- ngOnChanges(changes) {
668
- if (changes['user'] || changes['userLoggedIn']) {
669
- if (this.userLoggedIn && this.user) {
670
- this.updateCanEditResourcesValue();
671
- }
672
- }
673
- }
674
- getPosts(page, pageSize) {
675
- this.isLoaded = false;
676
- this.resourceService
677
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', this.categoryId)
678
- .subscribe(response => {
679
- const sortedPosts = (response.posts ?? [])
680
- .filter(post => post.showcase === true)
681
- .sort((a, b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime());
682
- this.posts = this.postSlice ? sortedPosts : [...sortedPosts].slice(0, 3);
683
- this.cdr.markForCheck();
684
- })
685
- .add(() => {
686
- this.isLoaded = true;
687
- this.cdr.markForCheck();
688
- });
689
- }
690
- toggleEditTitle() {
691
- this.isEditingTitle = true;
692
- this.editedTitle = this.resourceTitle;
693
- }
694
- saveEditedTitle() {
695
- HelperService.updateTagTitle(this.tag, this.editedTitle, this.tagService, this.getEffectiveSubscriptionId(), this.toast).subscribe(() => {
696
- this.resourceTitle = this.editedTitle;
697
- this.isEditingTitle = false;
698
- this.cdr.markForCheck();
699
- });
700
- }
701
- /** Helper method to get effective subscription ID */
702
- getEffectiveSubscriptionId() {
703
- return HelperService.getEffectiveSubscriptionId(this.user, this.subscriptionId, this.masterSubscriptionId);
704
- }
705
- updateCanEditResourcesValue() {
706
- this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
707
- }
708
- canEditResources() {
709
- return this.canEditResourcesValue;
710
- }
711
- trackByPostId(index, post) {
712
- return post.id;
713
- }
714
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: CaseStudyCardComponent, deps: [{ token: i0.Injector }, { token: ResourceService }, { token: i2.TagService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
715
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: CaseStudyCardComponent, isStandalone: false, selector: "pw-case-studies-card", inputs: { showCaseStudyHeader: "showCaseStudyHeader", categoryId: "categoryId", postSlice: "postSlice", tag: "tag", resourceTitle: "resourceTitle", user: "user", userLoggedIn: "userLoggedIn" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<section class=\"resource-vault-section bg-white text-center py-5 extra-top-padding section-outer\" id=\"case-studies\">\n <div class=\"container\">\n @if (showCaseStudyHeader) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <ng-container *ngTemplateOutlet=\"caseStudyHeaderTemplate\"></ng-container>\n <a class=\"view-all\" routerLink=\"/resources/case-studies\">VIEW ALL ></a>\n </div>\n } @else {\n <div class=\"d-md-flex justify-content-between align-items-start\">\n <ng-container *ngTemplateOutlet=\"caseStudyHeaderTemplate\"></ng-container>\n </div>\n }\n\n\n <ng-template #caseStudyHeaderTemplate>\n <h2 class=\"section-heading d-flex align-items-center\" id=\"case-studies\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span>\n <span [innerHTML]=\"resourceTitle\"></span>\n </span>\n } @else {\n Case Studies\n }\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\"\n (click)=\"toggleEditTitle()\"\n (keydown.enter)=\"toggleEditTitle()\"\n (keydown.space)=\"toggleEditTitle()\"\n title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9216\" name=\"input_editedTitle_9216\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n\n </h2>\n </ng-template>\n\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n\n\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"row d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of posts; track trackByPostId($index, post); let i = $index) {\n <div class=\"testimonial-box\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <div>\n @if (!post.rectangular_picture.url.includes('default-photo.jpg') ) {\n <img [src]=\"post.rectangular_picture.url\"\n alt=\"IT Partners Logo\"\n class=\"company-logo mb-3\"\n width=\"320\"\n height=\"180\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n }\n <p class=\"mb-4 mt-3 testimonial-section\">\n <span [innerHTML]=\"post.title\"></span>\n </p>\n </div>\n <!-- BOTTOM AVATAR -->\n <div class=\"avatar-container mt-5\">\n @if (post.picture.url && !post.picture.url.includes('default-photo.jpg')) {\n <img [src]=\"post.picture.url\"\n alt=\"User Avatar\"\n class=\"testimonial-avatar\"\n width=\"96\"\n height=\"96\"\n loading=\"lazy\"\n decoding=\"async\" />\n }\n @if (post?.external_url) {\n <a\n class=\"read-more-btn-overlay\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"read-more-btn-overlay\" aria-label=\"Navigate to resource view\" [routerLink]=\"['/resources/view', post?.slug]\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n </div>\n }\n </div>\n }\n </div>\n</section>\n", styles: [".resource-vault-section{background:#fff;text-align:center;padding:3rem 0}.section-outer,.container{padding:0 15px}.d-md-flex{display:flex}.justify-content-between{justify-content:space-between}.align-items-start{align-items:flex-start}.vault-heading{font-size:2rem;font-weight:700}.video-row{margin-top:3rem;gap:5.5rem!important}.row{display:flex;flex-wrap:wrap}.col-md-6,.col-lg-4{flex:0 0 auto;width:100%}@media(width>=768px){.col-md-6,.col-lg-4{width:50%}}@media(width>=992px){.col-md-6,.col-lg-4{width:33.3333%}}.mb-4{margin-bottom:1.5rem}.testimonial-box{display:flex;flex-direction:column;justify-content:space-between;background:#fff;color:#000;border-radius:20px;box-shadow:0 0 20px #0000001a;text-align:center;width:338px;height:auto;padding:2.5rem 1.5rem;font-size:1.1rem;min-height:421.4px!important}.testimonial-box .testimonial-section{font-size:1.5rem;line-height:2rem;font-weight:400;color:var(--text-color, black)}.testimonial-box .testimonial-section strong{display:block}.testimonial-box .company-logo{width:100%!important;height:auto!important;max-width:150px!important;object-fit:contain;align-self:center}.testimonial-box .avatar-container{margin-top:auto;position:relative;display:inline-block}.testimonial-box .avatar-container .testimonial-avatar{width:60%;aspect-ratio:1/1;height:auto;border-radius:50%;object-fit:fill}.testimonial-box .avatar-container .read-more-btn-overlay{position:absolute;text-decoration:none!important;bottom:0;left:50%;transform:translate(-50%);background-color:var(--text-color, black);color:#fff;width:240px;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-items:center;text-align:left;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.testimonial-box .avatar-container .read-more-btn-overlay:hover{background:#fff;color:var(--text-color, black)!important}.testimonial-box .avatar-container .read-more-btn-overlay .arrow{margin-bottom:.3rem}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5$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: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i7.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: ResourceEditCardLazyComponent, selector: "pw-resource-edit-card-lazy", inputs: ["id", "resourceData", "canEdit"], outputs: ["updated"] }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
716
- }
717
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: CaseStudyCardComponent, decorators: [{
718
- type: Component,
719
- args: [{ selector: 'pw-case-studies-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<section class=\"resource-vault-section bg-white text-center py-5 extra-top-padding section-outer\" id=\"case-studies\">\n <div class=\"container\">\n @if (showCaseStudyHeader) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <ng-container *ngTemplateOutlet=\"caseStudyHeaderTemplate\"></ng-container>\n <a class=\"view-all\" routerLink=\"/resources/case-studies\">VIEW ALL ></a>\n </div>\n } @else {\n <div class=\"d-md-flex justify-content-between align-items-start\">\n <ng-container *ngTemplateOutlet=\"caseStudyHeaderTemplate\"></ng-container>\n </div>\n }\n\n\n <ng-template #caseStudyHeaderTemplate>\n <h2 class=\"section-heading d-flex align-items-center\" id=\"case-studies\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span>\n <span [innerHTML]=\"resourceTitle\"></span>\n </span>\n } @else {\n Case Studies\n }\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\"\n (click)=\"toggleEditTitle()\"\n (keydown.enter)=\"toggleEditTitle()\"\n (keydown.space)=\"toggleEditTitle()\"\n title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9216\" name=\"input_editedTitle_9216\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n\n </h2>\n </ng-template>\n\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n\n\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"row d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of posts; track trackByPostId($index, post); let i = $index) {\n <div class=\"testimonial-box\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <div>\n @if (!post.rectangular_picture.url.includes('default-photo.jpg') ) {\n <img [src]=\"post.rectangular_picture.url\"\n alt=\"IT Partners Logo\"\n class=\"company-logo mb-3\"\n width=\"320\"\n height=\"180\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n }\n <p class=\"mb-4 mt-3 testimonial-section\">\n <span [innerHTML]=\"post.title\"></span>\n </p>\n </div>\n <!-- BOTTOM AVATAR -->\n <div class=\"avatar-container mt-5\">\n @if (post.picture.url && !post.picture.url.includes('default-photo.jpg')) {\n <img [src]=\"post.picture.url\"\n alt=\"User Avatar\"\n class=\"testimonial-avatar\"\n width=\"96\"\n height=\"96\"\n loading=\"lazy\"\n decoding=\"async\" />\n }\n @if (post?.external_url) {\n <a\n class=\"read-more-btn-overlay\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"read-more-btn-overlay\" aria-label=\"Navigate to resource view\" [routerLink]=\"['/resources/view', post?.slug]\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n </div>\n }\n </div>\n }\n </div>\n</section>\n", styles: [".resource-vault-section{background:#fff;text-align:center;padding:3rem 0}.section-outer,.container{padding:0 15px}.d-md-flex{display:flex}.justify-content-between{justify-content:space-between}.align-items-start{align-items:flex-start}.vault-heading{font-size:2rem;font-weight:700}.video-row{margin-top:3rem;gap:5.5rem!important}.row{display:flex;flex-wrap:wrap}.col-md-6,.col-lg-4{flex:0 0 auto;width:100%}@media(width>=768px){.col-md-6,.col-lg-4{width:50%}}@media(width>=992px){.col-md-6,.col-lg-4{width:33.3333%}}.mb-4{margin-bottom:1.5rem}.testimonial-box{display:flex;flex-direction:column;justify-content:space-between;background:#fff;color:#000;border-radius:20px;box-shadow:0 0 20px #0000001a;text-align:center;width:338px;height:auto;padding:2.5rem 1.5rem;font-size:1.1rem;min-height:421.4px!important}.testimonial-box .testimonial-section{font-size:1.5rem;line-height:2rem;font-weight:400;color:var(--text-color, black)}.testimonial-box .testimonial-section strong{display:block}.testimonial-box .company-logo{width:100%!important;height:auto!important;max-width:150px!important;object-fit:contain;align-self:center}.testimonial-box .avatar-container{margin-top:auto;position:relative;display:inline-block}.testimonial-box .avatar-container .testimonial-avatar{width:60%;aspect-ratio:1/1;height:auto;border-radius:50%;object-fit:fill}.testimonial-box .avatar-container .read-more-btn-overlay{position:absolute;text-decoration:none!important;bottom:0;left:50%;transform:translate(-50%);background-color:var(--text-color, black);color:#fff;width:240px;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-items:center;text-align:left;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.testimonial-box .avatar-container .read-more-btn-overlay:hover{background:#fff;color:var(--text-color, black)!important}.testimonial-box .avatar-container .read-more-btn-overlay .arrow{margin-bottom:.3rem}\n"] }]
720
- }], ctorParameters: () => [{ type: i0.Injector }, { type: ResourceService }, { type: i2.TagService }, { type: i0.ChangeDetectorRef }], propDecorators: { showCaseStudyHeader: [{
721
- type: Input
722
- }], categoryId: [{
723
- type: Input
724
- }], postSlice: [{
725
- type: Input
726
- }], tag: [{
727
- type: Input
728
- }], resourceTitle: [{
729
- type: Input
730
- }], user: [{
731
- type: Input
732
- }], userLoggedIn: [{
733
- type: Input
734
- }] } });
735
-
736
- class ResourceCardComponent extends AppBaseComponent {
737
- constructor(injector, resourceService, tagService, cdr) {
738
- super(injector);
739
- this.resourceService = resourceService;
740
- this.tagService = tagService;
741
- this.cdr = cdr;
742
- this.isHeaderVisible = true;
743
- this.isRelated = false;
744
- this.postSlice = false;
745
- this.isLoaded = false;
746
- this.masterSubscriptionId = this.appConfig.master_subscription.subscription_id;
747
- this.posts = [];
748
- this.canEditResourcesValue = false;
749
- }
750
- ngOnInit() {
751
- if (this.userLoggedIn) {
752
- this.localStorage.getItem$('product').subscribe(res => {
753
- const data = res ? JSON.parse(res) : null;
754
- this.subscriptionId = data?.subscriptionId;
755
- this.cdr.markForCheck();
756
- });
757
- }
758
- this.getPosts(1, 10);
759
- }
760
- ngOnChanges(changes) {
761
- if (changes['user'] || changes['userLoggedIn']) {
762
- if (this.userLoggedIn && this.user) {
763
- this.updateCanEditResourcesValue();
764
- }
765
- }
766
- }
767
- getPosts(page, pageSize) {
768
- this.isLoaded = false;
769
- this.resourceService
770
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', this.categoryId)
771
- .subscribe(response => {
772
- const sortedPosts = (response.posts ?? [])
773
- .filter(post => post.showcase === true)
774
- .sort((a, b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime());
775
- this.posts = this.postSlice ? sortedPosts : [...sortedPosts].slice(0, 3);
776
- this.cdr.markForCheck();
777
- })
778
- .add(() => {
779
- this.isLoaded = true;
780
- this.cdr.markForCheck();
781
- });
782
- }
783
- toggleTagEditTitle() {
784
- this.isEditingTitle = true;
785
- this.editedTitle = this.resourceTitle;
786
- }
787
- saveEditedTitle() {
788
- HelperService.updateTagTitle(this.tag, this.editedTitle, this.tagService, this.getEffectiveSubscriptionId(), this.toast).subscribe(() => {
789
- this.resourceTitle = this.editedTitle;
790
- this.isEditingTitle = false;
791
- this.cdr.markForCheck();
792
- });
793
- }
794
- /** Helper method to get effective subscription ID */
795
- getEffectiveSubscriptionId() {
796
- return HelperService.getEffectiveSubscriptionId(this.user, this.subscriptionId, this.masterSubscriptionId);
797
- }
798
- updateCanEditResourcesValue() {
799
- this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
800
- }
801
- canEditResources() {
802
- return this.canEditResourcesValue;
803
- }
804
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceCardComponent, deps: [{ token: i0.Injector }, { token: ResourceService }, { token: i2.TagService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
805
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ResourceCardComponent, isStandalone: false, selector: "pw-resource-cards", inputs: { categoryId: "categoryId", isHeaderVisible: "isHeaderVisible", isRelated: "isRelated", resourceTitle: "resourceTitle", postSlice: "postSlice", header: "header", tag: "tag", resourceLink: "resourceLink", user: "user", userLoggedIn: "userLoggedIn" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<section class=\"resource-vault-section bg-white\">\n <div class=\"container\">\n @if (isHeaderVisible) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n Our team's articles\n }\n @if (!isRelated && canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleTagEditTitle()\" (keydown.enter)=\"toggleTagEditTitle()\" (keydown.space)=\"toggleTagEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9056\" name=\"input_editedTitle_9056\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n <a class=\"view-all\" [routerLink]=\"resourceLink\">VIEW ALL ></a>\n </div>\n }\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"row d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of posts; track post; let i = $index) {\n <div class=\"resource-blog-card p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <p class=\"resource-title\" [innerHTML]=\"post.title \"></p>\n <a\n [href]=\"post.external_url || ('/resources/view/' + post?.slug)\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Navigate to resource\"\n >\n <img\n [src]=\"post.picture.url\"\n class=\"img-fluid my-3 mt-auto\"\n alt=\"Webinar\"\n width=\"640\"\n height=\"360\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\"\n /></a>\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n [href]=\"post.external_url\"\n aria-label=\"Navigate to external url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [href]=\"'/resources/view/' + post?.slug\" target=\"_blank\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5$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: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i7.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: ResourceEditCardLazyComponent, selector: "pw-resource-edit-card-lazy", inputs: ["id", "resourceData", "canEdit"], outputs: ["updated"] }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
806
- }
807
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceCardComponent, decorators: [{
808
- type: Component,
809
- args: [{ selector: 'pw-resource-cards', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<section class=\"resource-vault-section bg-white\">\n <div class=\"container\">\n @if (isHeaderVisible) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n Our team's articles\n }\n @if (!isRelated && canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleTagEditTitle()\" (keydown.enter)=\"toggleTagEditTitle()\" (keydown.space)=\"toggleTagEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9056\" name=\"input_editedTitle_9056\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n <a class=\"view-all\" [routerLink]=\"resourceLink\">VIEW ALL ></a>\n </div>\n }\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"row d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of posts; track post; let i = $index) {\n <div class=\"resource-blog-card p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <p class=\"resource-title\" [innerHTML]=\"post.title \"></p>\n <a\n [href]=\"post.external_url || ('/resources/view/' + post?.slug)\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Navigate to resource\"\n >\n <img\n [src]=\"post.picture.url\"\n class=\"img-fluid my-3 mt-auto\"\n alt=\"Webinar\"\n width=\"640\"\n height=\"360\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\"\n /></a>\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n [href]=\"post.external_url\"\n aria-label=\"Navigate to external url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [href]=\"'/resources/view/' + post?.slug\" target=\"_blank\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"] }]
810
- }], ctorParameters: () => [{ type: i0.Injector }, { type: ResourceService }, { type: i2.TagService }, { type: i0.ChangeDetectorRef }], propDecorators: { categoryId: [{
811
- type: Input
812
- }], isHeaderVisible: [{
813
- type: Input
814
- }], isRelated: [{
815
- type: Input
816
- }], resourceTitle: [{
817
- type: Input
818
- }], postSlice: [{
819
- type: Input
820
- }], header: [{
821
- type: Input
822
- }], tag: [{
823
- type: Input
824
- }], resourceLink: [{
825
- type: Input
826
- }], user: [{
827
- type: Input
828
- }], userLoggedIn: [{
829
- type: Input
830
- }] } });
831
-
832
- class BaseResourceComponent extends AppBaseComponent {
833
- constructor(resourceService, tagService, authService, cdr, injector) {
834
- super(injector);
835
- this.resourceService = resourceService;
836
- this.tagService = tagService;
837
- this.authService = authService;
838
- this.cdr = cdr;
839
- this.masterSubscriptionId = this.appConfig.master_subscription.subscription_id;
840
- this.posts = [];
841
- this.testimonialsPosts = [];
842
- this.isLoaded = false;
843
- this.canEditResourcesValue = false;
844
- }
845
- ngOnInit() {
846
- this.getUserSubscriptionId().subscribe(response => {
847
- this.subscriptionId = response;
848
- this.cdr.markForCheck();
849
- });
850
- this.authService.getToken$().subscribe(res => {
851
- this.userLoggedIn = !!res;
852
- if (this.userLoggedIn) {
853
- this.localStorage.getItem$('product').subscribe(res => {
854
- const data = res ? JSON.parse(res) : null;
855
- this.subscriptionId = data?.subscriptionId;
856
- this.cdr.markForCheck();
857
- });
858
- this.userService.getUserInfo().subscribe(data => {
859
- this.user = data;
860
- this.updateCanEditResourcesValue();
861
- this.initializeComponent();
862
- this.cdr.markForCheck();
863
- });
864
- }
865
- else {
866
- this.initializeComponent();
867
- }
868
- this.cdr.markForCheck();
869
- });
870
- }
871
- initializeComponent() {
872
- if (this.shouldUseTagCategories()) {
873
- this.getTags();
874
- }
875
- else {
876
- this.getPostTags();
877
- }
878
- if (this.shouldLoadTestimonials()) {
879
- this.getTestimonialTags();
880
- }
881
- }
882
- getTags() {
883
- this.isLoaded = false;
884
- forkJoin({
885
- categories: this.tagService.getAllTagCategories({ search: this.getSearchTerm() }, this.getEffectiveSubscriptionId()),
886
- tags: this.tagService.getTagsByType('post_categories', {}, this.getEffectiveSubscriptionId())
887
- })
888
- .subscribe(({ categories, tags }) => {
889
- this.tagCategory = categories?.tag_categories?.[0];
890
- this.blogPostTag = tags.tags.find(tag => tag.tag_category_id === this.tagCategory?.id);
891
- this.getPosts(1, 100);
892
- this.cdr.markForCheck();
893
- })
894
- .add(() => {
895
- this.isLoaded = true;
896
- this.cdr.markForCheck();
897
- });
898
- }
899
- getPostTags() {
900
- this.tagService
901
- .getTagsByType('post_categories', {}, this.getEffectiveSubscriptionId())
902
- .subscribe(response => {
903
- this.blogPostTag = response.tags.find(tag => tag.name === this.getResourceType());
904
- this.getPosts(1, 100);
905
- this.cdr.markForCheck();
906
- })
907
- .add(() => {
908
- this.isLoaded = true;
909
- this.cdr.markForCheck();
910
- });
911
- }
912
- getTestimonialTags() {
913
- this.tagService
914
- .getTagsByType('post_categories', {}, this.getEffectiveSubscriptionId())
915
- .subscribe(response => {
916
- this.blogTestimonialsPostTag = response.tags.find(tag => tag.name === 'Testimonials');
917
- this.getTestimonialsPosts(1, 100);
918
- this.cdr.markForCheck();
919
- });
920
- }
921
- getPosts(page, pageSize) {
922
- this.fetchPosts(page, pageSize, this.blogPostTag?.tag_category_id, 'posts');
923
- }
924
- getTestimonialsPosts(page, pageSize) {
925
- this.fetchPosts(page, pageSize, this.blogTestimonialsPostTag?.tag_category_id, 'testimonialsPosts');
926
- }
927
- /** Shared method to fetch posts with common filtering, sorting, and slicing logic */
928
- fetchPosts(page, pageSize, tagCategoryId, targetProperty) {
929
- this.resourceService
930
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', tagCategoryId)
931
- .subscribe(response => {
932
- const filteredPosts = response.posts
933
- .filter(post => post.tags?.some(tag => tag.tag_category_id === tagCategoryId))
934
- .sort((a, b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime())
935
- .slice(0, 12);
936
- if (targetProperty === 'posts') {
937
- this.posts = filteredPosts;
938
- }
939
- else {
940
- this.testimonialsPosts = filteredPosts;
941
- }
942
- this.cdr.markForCheck();
943
- });
944
- }
945
- /** Helper method to get effective subscription ID */
946
- getEffectiveSubscriptionId() {
947
- return HelperService.getEffectiveSubscriptionId(this.user, this.subscriptionId, this.masterSubscriptionId);
948
- }
949
- // Optional methods that can be overridden
950
- getSearchTerm() {
951
- return this.getResourceType();
952
- }
953
- shouldUseTagCategories() {
954
- return false;
955
- }
956
- shouldLoadTestimonials() {
957
- return false;
958
- }
959
- updateCanEditResourcesValue() {
960
- if (this.userLoggedIn && this.user) {
961
- this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
962
- }
963
- else {
964
- this.canEditResourcesValue = false;
965
- }
966
- }
967
- canEditResources() {
968
- return this.canEditResourcesValue;
969
- }
970
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: BaseResourceComponent, deps: [{ token: ResourceService }, { token: i2.TagService }, { token: i2.AuthService }, { token: i0.ChangeDetectorRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
971
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: BaseResourceComponent, isStandalone: false, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
972
- }
973
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: BaseResourceComponent, decorators: [{
974
- type: Component,
975
- args: [{
976
- template: '',
977
- changeDetection: ChangeDetectionStrategy.OnPush,
978
- standalone: false
979
- }]
980
- }], ctorParameters: () => [{ type: ResourceService }, { type: i2.TagService }, { type: i2.AuthService }, { type: i0.ChangeDetectorRef }, { type: i0.Injector }] });
981
-
982
- class ResourceVaultComponent extends BaseResourceComponent {
983
- constructor(resourceService, tagService, authService, cdr, injector) {
984
- super(resourceService, tagService, authService, cdr, injector);
985
- this.showVaultSection = false;
986
- this.postSlice = false;
987
- this.isLoadedChange = new EventEmitter();
988
- this.isEditingTitle = false;
989
- }
990
- ngOnInit() {
991
- super.ngOnInit();
992
- this.getPosts(1, 10);
993
- }
994
- getResourceType() {
995
- return 'Vault';
996
- }
997
- getPosts(page, pageSize) {
998
- this.isLoaded = false;
999
- this.resourceService
1000
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', this.categoryId)
1001
- .subscribe(response => {
1002
- const sortedPosts = (response.posts ?? [])
1003
- .filter(post => post.showcase === true)
1004
- .sort((a, b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime());
1005
- this.posts = this.postSlice ? sortedPosts : [...sortedPosts].slice(0, 3);
1006
- this.cdr.markForCheck();
1007
- })
1008
- .add(() => {
1009
- this.isLoaded = true;
1010
- this.isLoadedChange.emit(this.isLoaded);
1011
- this.cdr.markForCheck();
1012
- });
1013
- }
1014
- toggleEditTitle() {
1015
- this.isEditingTitle = true;
1016
- this.editedTitle = this.resourceTitle;
1017
- }
1018
- saveEditedTitle() {
1019
- HelperService.updateTagTitle(this.tag, this.editedTitle, this.tagService, this.getEffectiveSubscriptionId(), this.toast).subscribe(() => {
1020
- this.resourceTitle = this.editedTitle;
1021
- this.isEditingTitle = false;
1022
- this.cdr.markForCheck();
1023
- });
1024
- }
1025
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceVaultComponent, deps: [{ token: ResourceService }, { token: i2.TagService }, { token: i2.AuthService }, { token: i0.ChangeDetectorRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
1026
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ResourceVaultComponent, isStandalone: false, selector: "pw-resource--vault", inputs: { showVaultSection: "showVaultSection", postSlice: "postSlice", categoryId: "categoryId", resourceTitle: "resourceTitle", tag: "tag" }, outputs: { isLoadedChange: "isLoadedChange" }, usesInheritance: true, ngImport: i0, template: "<section class=\"resource-vault-section bg-white text-center py-5 extra-top-padding section-outer\">\n <div class=\"container\">\n @if (showVaultSection) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap mb-5\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n Whitepapers &amp; Tools\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditTitle()\" (keydown.enter)=\"toggleEditTitle()\" (keydown.space)=\"toggleEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9216\" name=\"input_editedTitle_9216\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n <a class=\"view-all\" routerLink=\"/resources/white-papers\">VIEW ALL ></a>\n </div>\n }\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"d-flex mt-2 flex-wrap justify-content-center gap-4 video-row\">\n @for (post of posts; track post) {\n <div class=\"resource-blog-card text-center p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <p class=\"mb-4\" [innerHTML]=\"post.title\"></p>\n <a\n [href]=\"post.external_url || ('/resources/view/' + post?.slug)\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Navigate to resource\"\n >\n <img\n [src]=\"post.picture.url\"\n class=\"img-fluid my-3 mt-auto\"\n alt=\"Webinar\"\n loading=\"lazy\"\n />\n </a>\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [href]=\"'/resources/view/' + post?.slug\" target=\"_blank\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>\n", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5$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: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i7.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: ResourceEditCardLazyComponent, selector: "pw-resource-edit-card-lazy", inputs: ["id", "resourceData", "canEdit"], outputs: ["updated"] }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1027
- }
1028
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceVaultComponent, decorators: [{
1029
- type: Component,
1030
- args: [{ selector: 'pw-resource--vault', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<section class=\"resource-vault-section bg-white text-center py-5 extra-top-padding section-outer\">\n <div class=\"container\">\n @if (showVaultSection) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap mb-5\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n Whitepapers &amp; Tools\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditTitle()\" (keydown.enter)=\"toggleEditTitle()\" (keydown.space)=\"toggleEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9216\" name=\"input_editedTitle_9216\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n <a class=\"view-all\" routerLink=\"/resources/white-papers\">VIEW ALL ></a>\n </div>\n }\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"d-flex mt-2 flex-wrap justify-content-center gap-4 video-row\">\n @for (post of posts; track post) {\n <div class=\"resource-blog-card text-center p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n <p class=\"mb-4\" [innerHTML]=\"post.title\"></p>\n <a\n [href]=\"post.external_url || ('/resources/view/' + post?.slug)\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Navigate to resource\"\n >\n <img\n [src]=\"post.picture.url\"\n class=\"img-fluid my-3 mt-auto\"\n alt=\"Webinar\"\n loading=\"lazy\"\n />\n </a>\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [href]=\"'/resources/view/' + post?.slug\" target=\"_blank\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>\n", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"] }]
1031
- }], ctorParameters: () => [{ type: ResourceService }, { type: i2.TagService }, { type: i2.AuthService }, { type: i0.ChangeDetectorRef }, { type: i0.Injector }], propDecorators: { showVaultSection: [{
1032
- type: Input
1033
- }], postSlice: [{
1034
- type: Input
1035
- }], categoryId: [{
1036
- type: Input
1037
- }], resourceTitle: [{
1038
- type: Input
1039
- }], tag: [{
1040
- type: Input
1041
- }], isLoadedChange: [{
1042
- type: Output
1043
- }] } });
1044
-
1045
- class ResourceVideoCardComponent extends AppBaseComponent {
1046
- constructor(sanitizer, resourceService, tagService, cdr, injector) {
1047
- super(injector);
1048
- this.sanitizer = sanitizer;
1049
- this.resourceService = resourceService;
1050
- this.tagService = tagService;
1051
- this.cdr = cdr;
1052
- this.showVideoSection = false;
1053
- this.postSlice = false;
1054
- this.canEditResourcesValue = false;
1055
- this.masterSubscriptionId = this.appConfig.master_subscription.subscription_id;
1056
- this.posts = [];
1057
- this.isLoaded = false;
1058
- this.videoStates = {};
1059
- this.isEditingTitle = false;
1060
- }
1061
- ngOnInit() {
1062
- if (this.userLoggedIn) {
1063
- this.localStorage.getItem$('product').subscribe(res => {
1064
- const data = res ? JSON.parse(res) : null;
1065
- this.subscriptionId = data?.subscriptionId;
1066
- this.cdr.markForCheck();
1067
- });
1068
- }
1069
- this.getPosts(1, 10);
1070
- }
1071
- ngOnChanges(changes) {
1072
- if (changes['user'] || changes['userLoggedIn']) {
1073
- if (this.userLoggedIn && this.user) {
1074
- this.updateCanEditResourcesValue();
1075
- }
1076
- }
1077
- }
1078
- loadVideo(post) {
1079
- if (!post.external_url)
1080
- return;
1081
- const slug = post.slug;
1082
- let externalUrl = post.external_url;
1083
- // Append autoplay only when clicked
1084
- externalUrl += externalUrl.includes('?') ? '&autoplay=1' : '?autoplay=1';
1085
- // baseUrl is a trusted internal source (e.g. YouTube embed URL)
1086
- this.videoStates[slug].url = this.sanitizer.bypassSecurityTrustResourceUrl(externalUrl); //NOSONAR
1087
- }
1088
- getPosts(page, pageSize) {
1089
- this.isLoaded = false;
1090
- this.resourceService
1091
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', this.categoryId)
1092
- .subscribe(response => {
1093
- const sortedPosts = (response.posts ?? [])
1094
- .filter(post => post.showcase === true)
1095
- .sort((a, b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime());
1096
- this.posts = this.postSlice ? sortedPosts : [...sortedPosts].slice(0, 3);
1097
- this.posts.forEach(post => {
1098
- if (post.external_url) {
1099
- this.videoStates[post.slug] = {
1100
- loaded: true,
1101
- // baseUrl is a trusted internal source (e.g. YouTube embed URL)
1102
- url: this.sanitizer.bypassSecurityTrustResourceUrl(post.external_url) //NOSONAR
1103
- };
1104
- }
1105
- });
1106
- this.cdr.markForCheck();
1107
- })
1108
- .add(() => {
1109
- this.isLoaded = true;
1110
- this.cdr.markForCheck();
1111
- });
1112
- }
1113
- toggleTagEditTitle() {
1114
- this.isEditingTitle = true;
1115
- this.editedTitle = this.resourceTitle;
1116
- }
1117
- saveEditedTitle() {
1118
- HelperService.updateTagTitle(this.tag, this.editedTitle, this.tagService, this.getEffectiveSubscriptionId(), this.toast).subscribe(() => {
1119
- this.resourceTitle = this.editedTitle;
1120
- this.isEditingTitle = false;
1121
- this.cdr.markForCheck();
1122
- });
1123
- }
1124
- /** Helper method to get effective subscription ID */
1125
- getEffectiveSubscriptionId() {
1126
- return HelperService.getEffectiveSubscriptionId(this.user, this.subscriptionId, this.masterSubscriptionId);
1127
- }
1128
- updateCanEditResourcesValue() {
1129
- this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
1130
- }
1131
- canEditResources() {
1132
- return this.canEditResourcesValue;
1133
- }
1134
- trackByPostId(index, post) {
1135
- return post.id;
1136
- }
1137
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceVideoCardComponent, deps: [{ token: i3$1.DomSanitizer }, { token: ResourceService }, { token: i2.TagService }, { token: i0.ChangeDetectorRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
1138
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ResourceVideoCardComponent, isStandalone: false, selector: "pw-resource-video-card", inputs: { showVideoSection: "showVideoSection", categoryId: "categoryId", tag: "tag", postSlice: "postSlice", resourceTitle: "resourceTitle", user: "user", userLoggedIn: "userLoggedIn" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<section class=\"resource-vault-section bg-white text-center py-5 extra-top-padding section-outer\">\n <div class=\"container\">\n @if (showVideoSection) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n On-Demand Videos\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleTagEditTitle()\" (keydown.enter)=\"toggleTagEditTitle()\" (keydown.space)=\"toggleTagEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9216\" name=\"input_editedTitle_9216\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n <a class=\"view-all\" routerLink=\"/resources/videos\">VIEW ALL ></a>\n </div>\n }\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"row mt-5 d-flex flex-wrap justify-content-center video-row\">\n @for (post of posts; track trackByPostId($index, post); let i = $index) {\n <div class=\"resource-blog-card\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPosts(1, 10)\">\n </pw-resource-edit-card-lazy>\n <p [innerHTML]=\"post.title\" class=\"mb-5\"></p>\n <a [href]=\" post.external_url\" target=\"_blank\">\n <img\n [src]=\"post.picture?.url\"\n class=\"img-fluid mb-3\"\n [alt]=\"post.title\"\n width=\"640\"\n height=\"360\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n </a>\n <a class=\"resource-btn mt-3\" [href]=\" post.external_url\" target=\"_blank\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Watch now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n </div>\n }\n </div>\n }\n </div>\n\n</section>\n", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5$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: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i7.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: ResourceEditCardLazyComponent, selector: "pw-resource-edit-card-lazy", inputs: ["id", "resourceData", "canEdit"], outputs: ["updated"] }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1139
- }
1140
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceVideoCardComponent, decorators: [{
1141
- type: Component,
1142
- args: [{ selector: 'pw-resource-video-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<section class=\"resource-vault-section bg-white text-center py-5 extra-top-padding section-outer\">\n <div class=\"container\">\n @if (showVideoSection) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n On-Demand Videos\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleTagEditTitle()\" (keydown.enter)=\"toggleTagEditTitle()\" (keydown.space)=\"toggleTagEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_9216\" name=\"input_editedTitle_9216\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n <a class=\"view-all\" routerLink=\"/resources/videos\">VIEW ALL ></a>\n </div>\n }\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"row mt-5 d-flex flex-wrap justify-content-center video-row\">\n @for (post of posts; track trackByPostId($index, post); let i = $index) {\n <div class=\"resource-blog-card\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getPosts(1, 10)\">\n </pw-resource-edit-card-lazy>\n <p [innerHTML]=\"post.title\" class=\"mb-5\"></p>\n <a [href]=\" post.external_url\" target=\"_blank\">\n <img\n [src]=\"post.picture?.url\"\n class=\"img-fluid mb-3\"\n [alt]=\"post.title\"\n width=\"640\"\n height=\"360\"\n [attr.loading]=\"i === 0 ? 'eager' : 'lazy'\"\n [attr.fetchpriority]=\"i === 0 ? 'high' : null\"\n decoding=\"async\" />\n </a>\n <a class=\"resource-btn mt-3\" [href]=\" post.external_url\" target=\"_blank\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Watch now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n </div>\n }\n </div>\n }\n </div>\n\n</section>\n", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"] }]
1143
- }], ctorParameters: () => [{ type: i3$1.DomSanitizer }, { type: ResourceService }, { type: i2.TagService }, { type: i0.ChangeDetectorRef }, { type: i0.Injector }], propDecorators: { showVideoSection: [{
1144
- type: Input
1145
- }], categoryId: [{
1146
- type: Input
1147
- }], tag: [{
1148
- type: Input
1149
- }], postSlice: [{
1150
- type: Input
1151
- }], resourceTitle: [{
1152
- type: Input
1153
- }], user: [{
1154
- type: Input
1155
- }], userLoggedIn: [{
1156
- type: Input
1157
- }] } });
1158
-
1159
- class UpcomingEventCardComponent extends AppBaseComponent {
1160
- constructor(resourceService, tagService, cdr, injector) {
1161
- super(injector);
1162
- this.resourceService = resourceService;
1163
- this.tagService = tagService;
1164
- this.cdr = cdr;
1165
- this.showEventContent = false;
1166
- this.postSlice = false;
1167
- this.canEditResourcesValue = false;
1168
- this.now = new Date().getTime();
1169
- this.isEditingTitle = false;
1170
- this.masterSubscriptionId = this.appConfig.master_subscription.subscription_id;
1171
- this.posts = [];
1172
- this.isLoaded = false;
1173
- }
1174
- ngOnInit() {
1175
- if (this.userLoggedIn) {
1176
- this.localStorage.getItem$('product').subscribe(res => {
1177
- const data = res ? JSON.parse(res) : null;
1178
- this.subscriptionId = data?.subscriptionId;
1179
- this.cdr.markForCheck();
1180
- });
1181
- this.getPostTags();
1182
- }
1183
- else {
1184
- this.getPostTags();
1185
- }
1186
- }
1187
- ngOnChanges(changes) {
1188
- if (changes['user'] || changes['userLoggedIn']) {
1189
- if (this.userLoggedIn && this.user) {
1190
- this.updateCanEditResourcesValue();
1191
- }
1192
- }
1193
- }
1194
- getPostTags() {
1195
- this.tagService
1196
- .getTagsByType('post_categories', {}, this.getEffectiveSubscriptionId())
1197
- .subscribe(response => {
1198
- this.blogPostTag = response.tags.find(tag => tag.name === 'Events');
1199
- if (this.blogPostTag?.tag_category_id) {
1200
- if (this.postSlice) {
1201
- this.getPosts(1, 100);
1202
- }
1203
- else {
1204
- this.getAllPosts(1, 100);
1205
- }
1206
- }
1207
- else {
1208
- this.isLoaded = true;
1209
- this.cdr.markForCheck();
1210
- }
1211
- this.cdr.markForCheck();
1212
- });
1213
- }
1214
- getPosts(page, pageSize) {
1215
- this.isLoaded = false;
1216
- this.resourceService
1217
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', this.categoryId ?? this.blogPostTag?.tag_category_id)
1218
- .subscribe(response => {
1219
- const sortedPosts = (response.posts ?? [])
1220
- .filter(post => post.showcase === true && new Date(post?.when).getTime() > this.now)
1221
- .sort((a, b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime());
1222
- this.posts = sortedPosts;
1223
- this.cdr.markForCheck();
1224
- })
1225
- .add(() => {
1226
- this.isLoaded = true;
1227
- this.cdr.markForCheck();
1228
- });
1229
- }
1230
- isUpcoming(post) {
1231
- return new Date(post?.when).getTime() > this.now;
1232
- }
1233
- getAllPosts(page, pageSize) {
1234
- this.isLoaded = false;
1235
- this.resourceService
1236
- .getPublicPosts(this.getEffectiveSubscriptionId(), page, pageSize, '', this.categoryId ?? this.blogPostTag?.tag_category_id)
1237
- .subscribe(response => {
1238
- const sortedPosts = (response.posts ?? [])
1239
- .filter(post => post.showcase === true)
1240
- .sort((a, b) => new Date(b.when).getTime() - new Date(a.when).getTime());
1241
- this.posts = [...sortedPosts].slice(0, 3).reverse();
1242
- this.cdr.markForCheck();
1243
- })
1244
- .add(() => {
1245
- this.isLoaded = true;
1246
- this.cdr.markForCheck();
1247
- });
1248
- }
1249
- toggleEditTitle() {
1250
- this.isEditingTitle = true;
1251
- this.editedTitle = this.resourceTitle;
1252
- }
1253
- saveEditedTitle() {
1254
- HelperService.updateTagTitle(this.tag, this.editedTitle, this.tagService, this.getEffectiveSubscriptionId(), this.toast).subscribe(() => {
1255
- this.resourceTitle = this.editedTitle;
1256
- this.isEditingTitle = false;
1257
- this.cdr.markForCheck();
1258
- });
1259
- }
1260
- /** Helper method to get effective subscription ID */
1261
- getEffectiveSubscriptionId() {
1262
- return HelperService.getEffectiveSubscriptionId(this.user, this.subscriptionId, this.masterSubscriptionId);
1263
- }
1264
- updateCanEditResourcesValue() {
1265
- this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
1266
- }
1267
- canEditResources() {
1268
- return this.canEditResourcesValue;
1269
- }
1270
- trackByPostId(index, post) {
1271
- return post.id;
1272
- }
1273
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: UpcomingEventCardComponent, deps: [{ token: ResourceService }, { token: i2.TagService }, { token: i0.ChangeDetectorRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
1274
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: UpcomingEventCardComponent, isStandalone: false, selector: "pw-upcoming-event-card", inputs: { showEventContent: "showEventContent", categoryId: "categoryId", tag: "tag", postSlice: "postSlice", resourceTitle: "resourceTitle", user: "user", userLoggedIn: "userLoggedIn" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<section class=\"resource-vault-section bg-white text-center py-5 extra-top-padding section-outer\">\n <div class=\"container\">\n @if (showEventContent) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n Events &amp; Webinars\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditTitle()\" (keydown.enter)=\"toggleEditTitle()\" (keydown.space)=\"toggleEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_7936\" name=\"input_editedTitle_7936\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n <a class=\"view-all\" routerLink=\"/resources/events\">VIEW ALL ></a>\n </div>\n }\n @if (!showEventContent) {\n <div class=\"d-md-flex justify-content-between align-items-start\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n Upcoming Events\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditTitle()\" (keydown.enter)=\"toggleEditTitle()\" (keydown.space)=\"toggleEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_7936\" name=\"input_editedTitle_7936\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n </div>\n }\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"row mt-5 d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of posts; track trackByPostId($index, post)) {\n <div class=\"resource-blog-card d text-center p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getAllPosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n @if (postSlice) {\n <h5 class=\"badge-title fw-bold\">UPCOMING:</h5>\n } @else {\n <h5 class=\"badge-title fw-bold\">\n {{ isUpcoming(post) ? 'UPCOMING:' : 'REPLAY:' }}\n </h5>\n }\n\n <p class=\"event-title mb-4\" [innerHtml]=\"post?.title\"></p>\n <a\n [href]=\"post.external_url || ('/resources/view/' + post?.slug)\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Navigate to resource\"\n >\n <img\n [src]=\"post.picture?.url\"\n class=\"img-fluid my-3 mt-auto\"\n alt=\"Webinar\"\n loading=\"lazy\"\n />\n </a>\n\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [href]=\"'/resources/view/' + post?.slug\" target=\"_blank\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>\n\n\n@if (!showEventContent) {\n<section class=\"bg-white\">\n <pw-replay-event-card [resourceTitle]=\"resourceTitle\" [user]=\"user\" [userLoggedIn]=\"userLoggedIn\"></pw-replay-event-card>\n</section>\n}\n", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5$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: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i7.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: ResourceEditCardLazyComponent, selector: "pw-resource-edit-card-lazy", inputs: ["id", "resourceData", "canEdit"], outputs: ["updated"] }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1275
- }
1276
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: UpcomingEventCardComponent, decorators: [{
1277
- type: Component,
1278
- args: [{ selector: 'pw-upcoming-event-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<section class=\"resource-vault-section bg-white text-center py-5 extra-top-padding section-outer\">\n <div class=\"container\">\n @if (showEventContent) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n Events &amp; Webinars\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditTitle()\" (keydown.enter)=\"toggleEditTitle()\" (keydown.space)=\"toggleEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_7936\" name=\"input_editedTitle_7936\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n <a class=\"view-all\" routerLink=\"/resources/events\">VIEW ALL ></a>\n </div>\n }\n @if (!showEventContent) {\n <div class=\"d-md-flex justify-content-between align-items-start\">\n <h2 class=\"section-heading d-flex align-items-center\" [ngClass]=\"{ 'w-50': isEditingTitle }\">\n @if (!isEditingTitle) {\n @if (resourceTitle) {\n <span [innerHTML]=\"resourceTitle\"></span>\n } @else {\n Upcoming Events\n }\n @if (canEditResourcesValue) {\n <i class=\"fa fa-edit in-page-edit-icon ms-3 cursor-pointer\" (click)=\"toggleEditTitle()\" (keydown.enter)=\"toggleEditTitle()\" (keydown.space)=\"toggleEditTitle()\" title=\"Edit Title\"></i>\n }\n } @else {\n <input [(ngModel)]=\"editedTitle\" class=\"form-control d-inline w-auto me-2\" [ngClass]=\"{ 'w-100': isEditingTitle }\" id=\"input_editedTitle_7936\" name=\"input_editedTitle_7936\" />\n <button class=\"btn btn-sm btn-primary me-1\" (click)=\"saveEditedTitle()\">Save</button>\n <button class=\"btn btn-sm btn-secondary\" (click)=\"isEditingTitle = false\">Cancel</button>\n }\n </h2>\n </div>\n }\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (posts.length === 0 && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n\n @if (posts.length !== 0 && isLoaded) {\n <div class=\"row mt-5 d-flex flex-wrap justify-content-center gap-4 video-row\">\n @for (post of posts; track trackByPostId($index, post)) {\n <div class=\"resource-blog-card d text-center p-4\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEditResourcesValue\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"getAllPosts(1, 100)\">\n </pw-resource-edit-card-lazy>\n @if (postSlice) {\n <h5 class=\"badge-title fw-bold\">UPCOMING:</h5>\n } @else {\n <h5 class=\"badge-title fw-bold\">\n {{ isUpcoming(post) ? 'UPCOMING:' : 'REPLAY:' }}\n </h5>\n }\n\n <p class=\"event-title mb-4\" [innerHtml]=\"post?.title\"></p>\n <a\n [href]=\"post.external_url || ('/resources/view/' + post?.slug)\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Navigate to resource\"\n >\n <img\n [src]=\"post.picture?.url\"\n class=\"img-fluid my-3 mt-auto\"\n alt=\"Webinar\"\n loading=\"lazy\"\n />\n </a>\n\n @if (post?.external_url) {\n <a\n class=\"resource-btn mt-3\"\n aria-label=\"Navigate to external url\"\n [href]=\"post.external_url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n } @else {\n <a class=\"resource-btn mt-3\" aria-label=\"Navigate to resource view\" [href]=\"'/resources/view/' + post?.slug\" target=\"_blank\">\n <span>{{ post?.cta_text && post.cta_text !== 'null' ? post.cta_text : 'Read Now' }}</span>\n <span class=\"arrow\">\u2192</span>\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n</section>\n\n\n@if (!showEventContent) {\n<section class=\"bg-white\">\n <pw-replay-event-card [resourceTitle]=\"resourceTitle\" [user]=\"user\" [userLoggedIn]=\"userLoggedIn\"></pw-replay-event-card>\n</section>\n}\n", styles: [".bold{font-weight:700}.resource-heading{margin-bottom:2rem}.resource-note{margin-top:1rem;font-size:.85rem;color:#555}.resource-divider{border:0;height:40px;width:100%;background:linear-gradient(to bottom,#0000,#00000026);margin:0}.press-release-icon{height:auto!important;margin:0 11px 1.9rem;display:block;align-self:center;width:auto!important;aspect-ratio:0!important;object-fit:cover;margin-top:auto;margin-right:0!important}.resource-vault-section{padding:60px 0;background:#fff;padding-bottom:9rem!important;padding-top:7rem!important;box-shadow:0 4px 32px -14px #40576d4d!important}.resource-vault-section .vault-heading{font-size:3rem;font-weight:300}.resource-vault-section .explore-link{color:#000;font-weight:400;text-decoration:none;font-size:1.5rem}.resource-vault-section .resource-blog-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:30px;box-shadow:0 20px 40px #00000014;padding:25px;text-align:center;width:338px;height:auto!important}.resource-vault-section .resource-blog-card h5{font-size:1.5rem;font-weight:400;margin-bottom:.5rem;color:var(--text-color, black)}.resource-vault-section .resource-blog-card p{font-size:1.5rem;color:var(--text-color, black);line-height:2rem}.resource-vault-section .resource-blog-card img{width:100%;border-radius:10px;aspect-ratio:1/1;object-fit:cover;margin-top:auto;margin-right:0!important;max-width:250px!important;align-self:center!important}.resource-vault-section .resource-blog-card iframe{height:210px;border-radius:10px;object-fit:cover;margin-right:0!important;max-width:280px!important}.resource-vault-section .resource-blog-card .resource-btn{background-color:var(--text-color, black);color:#fff;margin-top:auto;padding:10px 24px;border-radius:24px;font-size:1.5rem;font-weight:500;width:100%;max-width:240px;cursor:pointer;transition:background .3s ease;display:flex;justify-content:space-between;align-self:center;align-items:center;text-align:left;text-decoration:none;border:1px solid;box-shadow:none!important;border-color:var(--text-color, black)}.resource-vault-section .resource-blog-card .resource-btn:hover{background:#fff;color:var(--text-color, black)!important}.resource-vault-section .vault-description{text-align:left;max-width:657px;color:#182527;line-height:2.3rem!important;font-size:1.65rem}@media(width<=1200px){.resource-vault-section .vault-heading{font-size:3.5rem}.resource-vault-section .vault-description{margin-top:1.35rem}.resource-vault-section .resource-btn{margin-left:0!important}}.video-row{gap:5.5rem!important;margin-top:3rem!important}@media(width>=991px){section.bg-white.text-center.extra-top-padding{position:relative;overflow:hidden}section.bg-white.text-center.extra-top-padding .banner-header{margin-bottom:4rem!important}}.vault-header{text-align:left}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=768px){.video-row{gap:3rem!important}}@media(max-width:768px){.resource-vault-section{padding-bottom:6rem!important}.resource-vault-section .container{padding-top:0rem!important;padding-bottom:0rem!important}.vault-header{text-align:center!important}.vault-heading{font-size:3rem!important}}@media(width<=1200px){.container{padding:7rem 3rem 1rem!important}}\n"] }]
1279
- }], ctorParameters: () => [{ type: ResourceService }, { type: i2.TagService }, { type: i0.ChangeDetectorRef }, { type: i0.Injector }], propDecorators: { showEventContent: [{
1280
- type: Input
1281
- }], categoryId: [{
1282
- type: Input
1283
- }], tag: [{
1284
- type: Input
1285
- }], postSlice: [{
1286
- type: Input
1287
- }], resourceTitle: [{
1288
- type: Input
1289
- }], user: [{
1290
- type: Input
1291
- }], userLoggedIn: [{
1292
- type: Input
1293
- }] } });
1294
-
1295
- /**
1296
- * Module containing resource card components (lightweight version)
1297
- * ResourceEditCard is lazy-loaded on demand to save 145 KB
1298
- * Trial4ContactUs moved to separate module for better tree-shaking
1299
- * Used by both ResourceRootModule and ResourceSharedModule
1300
- */
1301
- class ResourceCardsModule {
1302
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceCardsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1303
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: ResourceCardsModule, declarations: [ResourceVideoCardComponent,
1304
- UpcomingEventCardComponent,
1305
- ResourceCardComponent,
1306
- CaseStudyCardComponent,
1307
- ResourceNoteCardComponent,
1308
- ResourceVaultComponent,
1309
- ResourceEditCardLazyComponent], imports: [CommonModule,
1310
- RouterModule,
1311
- FormsModule,
1312
- ReactiveFormsModule,
1313
- PipesModule,
1314
- PaginatorModule,
1315
- SelectModule,
1316
- ResourceSharedComponentsModule,
1317
- CoreTranslocoModule,
1318
- TranslocoModule,
1319
- DirectivesModule,
1320
- DragDropModule,
1321
- NgxCaptchaModule,
1322
- Trial4ContactUsModule // ✅ Import standalone module
1323
- ], exports: [ResourceVideoCardComponent,
1324
- UpcomingEventCardComponent,
1325
- ResourceCardComponent,
1326
- CaseStudyCardComponent,
1327
- ResourceNoteCardComponent,
1328
- ResourceVaultComponent,
1329
- Trial4ContactUsModule, // ✅ Re-export for backward compatibility
1330
- ResourceEditCardLazyComponent,
1331
- PaginatorModule // Export PaginatorModule so ResourceCompanyCardComponent can use p-paginator
1332
- ] }); }
1333
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceCardsModule, imports: [CommonModule,
1334
- RouterModule,
1335
- FormsModule,
1336
- ReactiveFormsModule,
1337
- PipesModule,
1338
- PaginatorModule,
1339
- SelectModule,
1340
- ResourceSharedComponentsModule,
1341
- CoreTranslocoModule,
1342
- TranslocoModule,
1343
- DirectivesModule,
1344
- DragDropModule,
1345
- NgxCaptchaModule,
1346
- Trial4ContactUsModule // ✅ Import standalone module
1347
- , Trial4ContactUsModule,
1348
- PaginatorModule // Export PaginatorModule so ResourceCompanyCardComponent can use p-paginator
1349
- ] }); }
1350
- }
1351
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceCardsModule, decorators: [{
1352
- type: NgModule,
1353
- args: [{
1354
- declarations: [
1355
- ResourceVideoCardComponent,
1356
- UpcomingEventCardComponent,
1357
- ResourceCardComponent,
1358
- CaseStudyCardComponent,
1359
- ResourceNoteCardComponent,
1360
- ResourceVaultComponent,
1361
- ResourceEditCardLazyComponent
1362
- ],
1363
- imports: [
1364
- CommonModule,
1365
- RouterModule,
1366
- FormsModule,
1367
- ReactiveFormsModule,
1368
- PipesModule,
1369
- PaginatorModule,
1370
- SelectModule,
1371
- ResourceSharedComponentsModule,
1372
- CoreTranslocoModule,
1373
- TranslocoModule,
1374
- DirectivesModule,
1375
- DragDropModule,
1376
- NgxCaptchaModule,
1377
- Trial4ContactUsModule // ✅ Import standalone module
1378
- ],
1379
- exports: [
1380
- ResourceVideoCardComponent,
1381
- UpcomingEventCardComponent,
1382
- ResourceCardComponent,
1383
- CaseStudyCardComponent,
1384
- ResourceNoteCardComponent,
1385
- ResourceVaultComponent,
1386
- Trial4ContactUsModule, // ✅ Re-export for backward compatibility
1387
- ResourceEditCardLazyComponent,
1388
- PaginatorModule // Export PaginatorModule so ResourceCompanyCardComponent can use p-paginator
1389
- ],
1390
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
1391
- }]
1392
- }] });
1393
-
1394
- // Shared components used across multiple resource routes
1395
- // Note: Most heavy modules (Quill, Calendar, UiSwitch, etc.) are now in ResourceCardsModule
1396
- class ResourceSharedModule {
1397
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1398
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: ResourceSharedModule, declarations: [ResourceCompanyCardComponent, ResourceTopBannerEditComponent], imports: [CommonModule,
1399
- RouterModule,
1400
- FormsModule,
1401
- ReactiveFormsModule,
1402
- PipesModule,
1403
- ResourceSharedComponentsModule,
1404
- CoreTranslocoModule,
1405
- TranslocoModule,
1406
- DirectivesModule,
1407
- InputTextModule,
1408
- IconFieldModule,
1409
- InputIconModule,
1410
- TextareaModule,
1411
- ResourceCardsModule,
1412
- HubSpotMeetingsSharedModule // For pw-book-a-demo component (HubSpotMeetingsComponent)
1413
- ], exports: [
1414
- // Export the 2 components specific to this module
1415
- ResourceCompanyCardComponent,
1416
- ResourceTopBannerEditComponent,
1417
- // Export card components module (includes all heavy modules + card components)
1418
- ResourceCardsModule,
1419
- // Export HubSpotMeetingsSharedModule to make pw-book-a-demo component available
1420
- HubSpotMeetingsSharedModule,
1421
- // Export common lightweight modules
1422
- CommonModule,
1423
- RouterModule,
1424
- FormsModule,
1425
- ReactiveFormsModule,
1426
- PipesModule,
1427
- ResourceSharedComponentsModule,
1428
- CoreTranslocoModule,
1429
- TranslocoModule,
1430
- DirectivesModule,
1431
- InputTextModule,
1432
- IconFieldModule,
1433
- InputIconModule,
1434
- TextareaModule] }); }
1435
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceSharedModule, imports: [CommonModule,
1436
- RouterModule,
1437
- FormsModule,
1438
- ReactiveFormsModule,
1439
- PipesModule,
1440
- ResourceSharedComponentsModule,
1441
- CoreTranslocoModule,
1442
- TranslocoModule,
1443
- DirectivesModule,
1444
- InputTextModule,
1445
- IconFieldModule,
1446
- InputIconModule,
1447
- TextareaModule,
1448
- ResourceCardsModule,
1449
- HubSpotMeetingsSharedModule // For pw-book-a-demo component (HubSpotMeetingsComponent)
1450
- ,
1451
- // Export card components module (includes all heavy modules + card components)
1452
- ResourceCardsModule,
1453
- // Export HubSpotMeetingsSharedModule to make pw-book-a-demo component available
1454
- HubSpotMeetingsSharedModule,
1455
- // Export common lightweight modules
1456
- CommonModule,
1457
- RouterModule,
1458
- FormsModule,
1459
- ReactiveFormsModule,
1460
- PipesModule,
1461
- ResourceSharedComponentsModule,
1462
- CoreTranslocoModule,
1463
- TranslocoModule,
1464
- DirectivesModule,
1465
- InputTextModule,
1466
- IconFieldModule,
1467
- InputIconModule,
1468
- TextareaModule] }); }
1469
- }
1470
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceSharedModule, decorators: [{
1471
- type: NgModule,
1472
- args: [{
1473
- declarations: [ResourceCompanyCardComponent, ResourceTopBannerEditComponent],
1474
- imports: [
1475
- CommonModule,
1476
- RouterModule,
1477
- FormsModule,
1478
- ReactiveFormsModule,
1479
- PipesModule,
1480
- ResourceSharedComponentsModule,
1481
- CoreTranslocoModule,
1482
- TranslocoModule,
1483
- DirectivesModule,
1484
- InputTextModule,
1485
- IconFieldModule,
1486
- InputIconModule,
1487
- TextareaModule,
1488
- ResourceCardsModule,
1489
- HubSpotMeetingsSharedModule // For pw-book-a-demo component (HubSpotMeetingsComponent)
1490
- ],
1491
- exports: [
1492
- // Export the 2 components specific to this module
1493
- ResourceCompanyCardComponent,
1494
- ResourceTopBannerEditComponent,
1495
- // Export card components module (includes all heavy modules + card components)
1496
- ResourceCardsModule,
1497
- // Export HubSpotMeetingsSharedModule to make pw-book-a-demo component available
1498
- HubSpotMeetingsSharedModule,
1499
- // Export common lightweight modules
1500
- CommonModule,
1501
- RouterModule,
1502
- FormsModule,
1503
- ReactiveFormsModule,
1504
- PipesModule,
1505
- ResourceSharedComponentsModule,
1506
- CoreTranslocoModule,
1507
- TranslocoModule,
1508
- DirectivesModule,
1509
- InputTextModule,
1510
- IconFieldModule,
1511
- InputIconModule,
1512
- TextareaModule
1513
- ],
1514
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
1515
- }]
1516
- }] });
1517
-
1518
- class ResourceEditCardComponent extends AppBaseComponent {
1519
- constructor(fb, modalService, resourceService, authService, tagService, cdr, injector) {
1520
- super(injector);
1521
- this.fb = fb;
1522
- this.modalService = modalService;
1523
- this.resourceService = resourceService;
1524
- this.authService = authService;
1525
- this.tagService = tagService;
1526
- this.cdr = cdr;
1527
- this.updated = new EventEmitter();
1528
- this.image = '';
1529
- this.rectangularImage = '';
1530
- this.file = null;
1531
- this.rectangularFile = null;
1532
- this.selectedTags = [];
1533
- this.allTags = [];
1534
- this.tagsSuggestion = [];
1535
- this.buttonBusy = false;
1536
- this.editForm = this.fb.group({
1537
- title: [''],
1538
- external_url: [''],
1539
- cta_text: [''],
1540
- when: [''],
1541
- showcase: [false],
1542
- published_at: [false],
1543
- accepted_at: [false],
1544
- body: ['']
1545
- });
1546
- }
1547
- ngOnInit() {
1548
- this.authService.getToken$().subscribe(res => {
1549
- this.userLoggedIn = !!res;
1550
- if (this.userLoggedIn) {
1551
- this.localStorage.getItem$('product').subscribe(res => {
1552
- const data = res ? JSON.parse(res) : null;
1553
- this.subscriptionId = data?.subscriptionId;
1554
- this.cdr.markForCheck();
1555
- });
1556
- }
1557
- this.cdr.markForCheck();
1558
- });
1559
- }
1560
- navigateToResourceEdit() {
1561
- const basePath = `/admin/resources/${this.resourceData?.slug}`;
1562
- const fullUrl = `${location.origin}${basePath}`;
1563
- window.open(fullUrl, '_blank');
1564
- }
1565
- openModal(modalTemplate) {
1566
- if (this.resourceData) {
1567
- const when = this.resourceData.when ? new Date(this.resourceData.when) : null;
1568
- this.editForm.setValue({
1569
- title: this.resourceData.title ?? '',
1570
- external_url: this.resourceData.external_url ?? '',
1571
- cta_text: this.resourceData.cta_text ?? '',
1572
- when: when ?? '',
1573
- showcase: !!this.resourceData.showcase,
1574
- published_at: !!this.resourceData.published_at,
1575
- accepted_at: !!this.resourceData.accepted_at,
1576
- body: this.resourceData.body
1577
- });
1578
- this.image = this.resourceData.picture?.url ?? '';
1579
- this.selectedTags = this.resourceData?.tags?.length ? [...this.resourceData.tags] : [];
1580
- this.rectangularImage = this.resourceData.rectangular_picture?.url ?? '';
1581
- }
1582
- this.modalService.open(modalTemplate, { centered: true, size: 'lg' });
1583
- this.getPostTags();
1584
- }
1585
- search(event) {
1586
- let values = [];
1587
- if (event.query) {
1588
- values = this.allTags.filter(x => x.name.toLowerCase().includes(event.query.toLowerCase()));
1589
- }
1590
- else {
1591
- this.allTags.forEach(element => {
1592
- values.push(element);
1593
- });
1594
- }
1595
- this.tagsSuggestion = values;
1596
- }
1597
- getPostTags() {
1598
- this.tagService
1599
- .getTagsByType('post_categories', {}, this.subscriptionId)
1600
- .subscribe(response => {
1601
- this.allTags = response.tags;
1602
- this.cdr.markForCheck();
1603
- });
1604
- }
1605
- deleteRectangularImage() {
1606
- this.rectangularImage = null;
1607
- this.rectangularFile = null;
1608
- }
1609
- openImageModal(modalTemplate) {
1610
- this.imageModalRef = this.modalService.open(modalTemplate, { centered: true, size: 'md' });
1611
- }
1612
- onImageSelected(base64) {
1613
- this.image = base64;
1614
- this.file = HelperService.convertBase64ToFile(base64);
1615
- this.imageModalRef?.close();
1616
- }
1617
- onRectangularImageSelection(base64) {
1618
- this.rectangularImage = base64;
1619
- this.rectangularFile = HelperService.convertBase64ToFile(base64);
1620
- this.imageModalRef?.close();
1621
- }
1622
- removeImage() {
1623
- this.image = null;
1624
- this.file = null;
1625
- }
1626
- saveResource() {
1627
- this.buttonBusy = true;
1628
- this.saveTags(this.id);
1629
- const payload = {
1630
- ...this.editForm.value,
1631
- subscription_id: this.subscriptionId
1632
- };
1633
- this.handlePicture(payload);
1634
- this.handlePublishedAt(payload);
1635
- this.handleAcceptedAt(payload);
1636
- this.handleAcceptedAt(payload);
1637
- this.handleOptionalFields(payload);
1638
- this.handleRectangularPicture(payload);
1639
- this.handleRemovals(payload);
1640
- this.resourceService.updatePost(payload, this.id).subscribe({
1641
- next: () => {
1642
- // NG0100: Toastr + dismissAll can run CD in the same macrotask as clearing [buttonBusy].
1643
- // Clear busy in one task; toast/emit/modal in the next so dev-mode "verify" sees a stable binding.
1644
- setTimeout(() => {
1645
- this.buttonBusy = false;
1646
- this.cdr.markForCheck();
1647
- setTimeout(() => {
1648
- this.toast.success('Blog Post Updated');
1649
- this.updated.emit();
1650
- this.modalService.dismissAll();
1651
- this.cdr.markForCheck();
1652
- }, 0);
1653
- }, 0);
1654
- },
1655
- error: () => {
1656
- setTimeout(() => {
1657
- this.buttonBusy = false;
1658
- this.cdr.markForCheck();
1659
- }, 0);
1660
- }
1661
- });
1662
- }
1663
- saveTags(id) {
1664
- if (this.selectedTags.length) {
1665
- const data = {
1666
- entity_tags: this.selectedTags.map(tag => ({ tag_id: tag.id })),
1667
- slug: id,
1668
- tag_entity: 'Post' // or use TAG_ENTITY.POST if you imported it
1669
- };
1670
- this.tagService.addTags(data, this.subscriptionId).subscribe(() => {
1671
- this.cdr.markForCheck();
1672
- });
1673
- }
1674
- }
1675
- handlePicture(data) {
1676
- if (this.file) {
1677
- data.picture = this.file;
1678
- }
1679
- else {
1680
- delete data.picture;
1681
- }
1682
- }
1683
- handlePublishedAt(data) {
1684
- const control = this.editForm.get('published_at');
1685
- if (control?.dirty) {
1686
- data.published_at = control.value ? moment().format('DD-MMM-YYYY') : '';
1687
- }
1688
- else {
1689
- delete data.published_at;
1690
- }
1691
- }
1692
- handleAcceptedAt(data) {
1693
- const control = this.editForm.get('accepted_at');
1694
- if (control?.dirty) {
1695
- data.accepted_at = control.value ? moment().format('DD-MMM-YYYY') : '';
1696
- }
1697
- else {
1698
- delete data.accepted_at;
1699
- }
1700
- }
1701
- handleOptionalFields(data) {
1702
- if (!this.editForm.get('when')?.value) {
1703
- data.when = '';
1704
- }
1705
- if (!this.editForm.get('showcase')?.value) {
1706
- data.showcase = '';
1707
- }
1708
- }
1709
- handleRectangularPicture(data) {
1710
- if (this.rectangularFile) {
1711
- data.rectangular_picture = this.rectangularFile;
1712
- }
1713
- else {
1714
- delete data.rectangular_picture;
1715
- }
1716
- }
1717
- handleRemovals(data) {
1718
- if (!this.file && !this.image) {
1719
- data.remove_picture = true;
1720
- }
1721
- if (!this.rectangularFile && !this.rectangularImage) {
1722
- data.remove_rectangular_picture = true;
1723
- }
1724
- }
1725
- openRectModal(content) {
1726
- this.imageModalRef = this.modalService.open(content, {
1727
- centered: true,
1728
- windowClass: 'modal-holder'
1729
- });
1730
- }
1731
- handleImageError(event, fallbackPath) {
1732
- HelperService.handleImageFallbackPath(event, fallbackPath);
1733
- }
1734
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceEditCardComponent, deps: [{ token: i5$2.FormBuilder }, { token: i2$1.NgbModal }, { token: ResourceService }, { token: i2.AuthService }, { token: i2.TagService }, { token: i0.ChangeDetectorRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
1735
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ResourceEditCardComponent, isStandalone: false, selector: "pw-resource-edit-card", inputs: { id: "id", resourceData: "resourceData" }, outputs: { updated: "updated" }, usesInheritance: true, ngImport: i0, template: "<div class=\"edit-card\">\n <i class=\"fa fa-edit cursor-pointer text-dark in-page-edit-icon d-flex justify-content-center mb-2\"\n (click)=\"openModal(editResourceModal)\"\n (keydown.enter)=\"openModal(editResourceModal)\"\n (keydown.space)=\"openModal(editResourceModal)\"\n title=\"Edit Resource\"></i>\n</div>\n\n<ng-template #editResourceModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Resource</h5>\n <i class=\"fa fa-edit cursor-pointer text-dark in-page-edit-icon d-flex justify-content-center ms-3\"\n (click)=\"navigateToResourceEdit()\"\n (keydown.enter)=\"navigateToResourceEdit()\"\n (keydown.space)=\"navigateToResourceEdit()\"\n title=\"Go to the main edit page\"></i>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <form [formGroup]=\"editForm\">\n <div class=\"row\">\n\n\n <div class=\"col-12\">\n <pw-input-container label=\"Title\" name=\"title\">\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" id=\"input_title_1\" name=\"input_title_1\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 row\">\n <pw-input-container label=\"CTA Text\" name=\"cta_text\" class=\"col-md-6\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.CtaText' | transloco\">\n <input type=\"text\" class=\"form-control\" formControlName=\"cta_text\" id=\"input_cta_text_2\" name=\"input_cta_text_2\"/>\n </pw-input-container>\n\n <pw-input-container label=\"External URL\" name=\"external_url\" class=\"col-md-6\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.ExternalUrl' | transloco\">\n <input type=\"text\" class=\"form-control\" formControlName=\"external_url\" id=\"input_external_url_3\" name=\"input_external_url_3\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container\n [label]=\"'Resource.Posts.Body' | transloco\"\n name=\"body\"\n [errorMsg]=\"'Resource.Posts.Validation.Body' | transloco\">\n <quill-editor\n [styles]=\"{ height: '300px' }\"\n class=\"quillEditor\"\n [modules]=\"editorConfig\"\n formControlName=\"body\"\n [ngClass]=\"{\n 'w-100': true,\n 'quill-container': true,\n 'is-invalid': submitted && f['body'].errors\n }\">\n </quill-editor>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 col-md-3 col-sm-6\">\n <pw-input-container\n [label]=\"'Resource.Posts.When' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.When' | transloco\"\n name=\"when\">\n <p-datepicker inputId=\"resource-edit-card-when\" formControlName=\"when\"\n [showIcon]=\"true\"\n dateFormat=\"dd-M-yy\"\n [placeholder]=\"'Select Date'\"\n [ngClass]=\"{ 'is-invalid': submitted && f['when'].errors }\">\n </p-datepicker>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 col-md-8\">\n <pw-input-container\n [label]=\"'Resource.Posts.Tags' | transloco\"\n class=\"ui-fluid skills-modal tags\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.CtaText' | transloco\"\n name=\"cta_text\">\n <p-autoComplete appendTo=\"body\" [(ngModel)]=\"selectedTags\"\n class=\"body-bg\"\n [suggestions]=\"tagsSuggestion\"\n dataKey=\"id\"\n optionLabel=\"name\"\n (completeMethod)=\"search($event)\"\n styleClass=\"w-100\"\n [minLength]=\"1\"\n [maxlength]=\"10\"\n [dropdown]=\"true\"\n [ngModelOptions]=\"{ standalone: true }\"\n placeholder=\"Tags\"\n [multiple]=\"true\">\n </p-autoComplete>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 row\">\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'SHOWCASE'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Mark as showcase post'\"\n name=\"showcase\">\n <ui-switch formControlName=\"showcase\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'PUBLISHED'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Set to publish the post'\"\n name=\"published_at\">\n <ui-switch formControlName=\"published_at\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'ACCEPTED BY ADMIN'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Indicates approval by admin'\"\n name=\"accepted_at\">\n <ui-switch formControlName=\"accepted_at\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4 col-sm-4 my-4 ms-3\">\n <div class=\"text-center mb-4\">\n <span id=\"resource-edit-cover-picture-label\" class=\"pw-label-style\">{{ 'Resource.Posts.CoverPicture' | transloco }}</span>\n <div class=\"text-center d-flex flex-column align-items-center\">\n <img [src]=\"(image && !image.includes('default-photo.jpg')) ? image : 'assets/img/resource/blog.png'\"\n (click)=\"openImageModal(imageCropContent)\"\n (keydown.enter)=\"openImageModal(imageCropContent)\"\n class=\"image w-100\"\n alt=\"Modal\"\n (error)=\"handleImageError($event, 'assets/img/resource/blog.png')\" />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <a class=\"d-inline-block\" (click)=\"openImageModal(imageCropContent)\">\n {{ slug !== 'create' ? 'Edit' : 'Add' }} Picture\n </a>\n @if (image && !image.includes('default-photo.jpg')) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (click)=\"removeImage()\"\n (keydown.enter)=\"removeImage()\"></i>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4 col-sm-4 my-4 ms-3\">\n <div class=\"text-center mb-4\">\n <span id=\"resource-edit-rectangular-picture-label\" class=\"pw-label-style\">Rectangular Picture</span>\n <div class=\"text-center d-flex flex-column align-items-center\">\n <img [src]=\"(rectangularImage && !rectangularImage.includes('default-photo.jpg')) ? rectangularImage : 'assets/img/resource/blog.png'\"\n (click)=\"openRectModal(rectContent)\"\n (keydown.enter)=\"openRectModal(rectContent)\"\n class=\"image w-100\"\n alt=\"Uploaded rectangular media preview\"\n (error)=\"handleImageError($event, 'assets/img/resource/blog.png')\" />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <a class=\"d-inline-block\" (click)=\"openRectModal(rectContent)\">\n {{ slug !== 'create' ? 'Edit' : 'Add' }} Picture\n </a>\n @if (rectangularImage && !rectangularImage.includes('default-photo.jpg')) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (click)=\"deleteRectangularImage()\"\n (keydown.enter)=\"deleteRectangularImage()\"></i>\n }\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </form>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"modal.dismiss()\">Cancel</button>\n <button class=\"btn btn-primary\" [buttonBusy]=\"buttonBusy\" (click)=\"saveResource()\">Save</button>\n </div>\n</ng-template>\n\n<ng-template #imageCropContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Picture</h5>\n <button type=\"button\" class=\"btn-close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. (Do not upload pictures containing celebrities,\n nudity, artwork or copyrighted images.)</small>\n <pw-image-cropper\n [aspectRatio]=\"'dynamic'\"\n (imageSelectionEvent)=\"onImageSelected($event)\"\n (closeEvent)=\"modal.close()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n\n<ng-template #rectContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Picture</h5>\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. (Do not upload pictures containing celebrities,\n nudity, artwork or copyrighted images.)</small>\n <pw-image-cropper\n #profile\n [aspectRatio]=\"'dynamic'\"\n (imageSelectionEvent)=\"onRectangularImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n", styles: ["::ng-deep .modal-content{margin-top:5rem!important}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$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: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i6$1.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i7$1.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "addOnTab", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "addOnBlur", "separator", "appendTo", "motionOptions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onAdd", "onFocus", "onBlur", "onDropdownClick", "onClear", "onInputKeydown", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "component", type: i8.ProfileImageCropperComponent, selector: "pw-image-cropper", inputs: ["aspectRatio", "dynamicData"], outputs: ["imageSelectionEvent", "closeEvent", "fileChangeEvent"] }, { kind: "component", type: i6.InputContainerComponent, selector: "pw-input-container", inputs: ["name", "controlId", "useAriaLabelledbyOnly", "label", "labelClass", "tooltipPosition", "required", "errorMsg", "isReadOnly", "showTooltip", "tooltipText", "showTriangle", "afterLabel", "showAfterLabel", "showTriangleText", "isLeftTooltip"] }, { kind: "directive", type: i5.ButtonBusyDirective, selector: "[buttonBusy]", inputs: ["buttonBusy", "busyText"] }, { kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: i11.QuillEditorComponent, selector: "quill-editor" }, { kind: "component", type: i12.UiSwitchComponent, selector: "ui-switch", inputs: ["size", "color", "switchOffColor", "switchColor", "defaultBgColor", "defaultBoColor", "checkedLabel", "uncheckedLabel", "checkedTextColor", "uncheckedTextColor", "beforeChange", "ariaLabel", "checked", "disabled", "reverse", "loading"], outputs: ["change", "changeEvent", "valueChange"] }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1736
- }
1737
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceEditCardComponent, decorators: [{
1738
- type: Component,
1739
- args: [{ selector: 'pw-resource-edit-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"edit-card\">\n <i class=\"fa fa-edit cursor-pointer text-dark in-page-edit-icon d-flex justify-content-center mb-2\"\n (click)=\"openModal(editResourceModal)\"\n (keydown.enter)=\"openModal(editResourceModal)\"\n (keydown.space)=\"openModal(editResourceModal)\"\n title=\"Edit Resource\"></i>\n</div>\n\n<ng-template #editResourceModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Resource</h5>\n <i class=\"fa fa-edit cursor-pointer text-dark in-page-edit-icon d-flex justify-content-center ms-3\"\n (click)=\"navigateToResourceEdit()\"\n (keydown.enter)=\"navigateToResourceEdit()\"\n (keydown.space)=\"navigateToResourceEdit()\"\n title=\"Go to the main edit page\"></i>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <form [formGroup]=\"editForm\">\n <div class=\"row\">\n\n\n <div class=\"col-12\">\n <pw-input-container label=\"Title\" name=\"title\">\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" id=\"input_title_1\" name=\"input_title_1\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 row\">\n <pw-input-container label=\"CTA Text\" name=\"cta_text\" class=\"col-md-6\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.CtaText' | transloco\">\n <input type=\"text\" class=\"form-control\" formControlName=\"cta_text\" id=\"input_cta_text_2\" name=\"input_cta_text_2\"/>\n </pw-input-container>\n\n <pw-input-container label=\"External URL\" name=\"external_url\" class=\"col-md-6\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.ExternalUrl' | transloco\">\n <input type=\"text\" class=\"form-control\" formControlName=\"external_url\" id=\"input_external_url_3\" name=\"input_external_url_3\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container\n [label]=\"'Resource.Posts.Body' | transloco\"\n name=\"body\"\n [errorMsg]=\"'Resource.Posts.Validation.Body' | transloco\">\n <quill-editor\n [styles]=\"{ height: '300px' }\"\n class=\"quillEditor\"\n [modules]=\"editorConfig\"\n formControlName=\"body\"\n [ngClass]=\"{\n 'w-100': true,\n 'quill-container': true,\n 'is-invalid': submitted && f['body'].errors\n }\">\n </quill-editor>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 col-md-3 col-sm-6\">\n <pw-input-container\n [label]=\"'Resource.Posts.When' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.When' | transloco\"\n name=\"when\">\n <p-datepicker inputId=\"resource-edit-card-when\" formControlName=\"when\"\n [showIcon]=\"true\"\n dateFormat=\"dd-M-yy\"\n [placeholder]=\"'Select Date'\"\n [ngClass]=\"{ 'is-invalid': submitted && f['when'].errors }\">\n </p-datepicker>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 col-md-8\">\n <pw-input-container\n [label]=\"'Resource.Posts.Tags' | transloco\"\n class=\"ui-fluid skills-modal tags\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.CtaText' | transloco\"\n name=\"cta_text\">\n <p-autoComplete appendTo=\"body\" [(ngModel)]=\"selectedTags\"\n class=\"body-bg\"\n [suggestions]=\"tagsSuggestion\"\n dataKey=\"id\"\n optionLabel=\"name\"\n (completeMethod)=\"search($event)\"\n styleClass=\"w-100\"\n [minLength]=\"1\"\n [maxlength]=\"10\"\n [dropdown]=\"true\"\n [ngModelOptions]=\"{ standalone: true }\"\n placeholder=\"Tags\"\n [multiple]=\"true\">\n </p-autoComplete>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 row\">\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'SHOWCASE'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Mark as showcase post'\"\n name=\"showcase\">\n <ui-switch formControlName=\"showcase\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'PUBLISHED'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Set to publish the post'\"\n name=\"published_at\">\n <ui-switch formControlName=\"published_at\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'ACCEPTED BY ADMIN'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Indicates approval by admin'\"\n name=\"accepted_at\">\n <ui-switch formControlName=\"accepted_at\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4 col-sm-4 my-4 ms-3\">\n <div class=\"text-center mb-4\">\n <span id=\"resource-edit-cover-picture-label\" class=\"pw-label-style\">{{ 'Resource.Posts.CoverPicture' | transloco }}</span>\n <div class=\"text-center d-flex flex-column align-items-center\">\n <img [src]=\"(image && !image.includes('default-photo.jpg')) ? image : 'assets/img/resource/blog.png'\"\n (click)=\"openImageModal(imageCropContent)\"\n (keydown.enter)=\"openImageModal(imageCropContent)\"\n class=\"image w-100\"\n alt=\"Modal\"\n (error)=\"handleImageError($event, 'assets/img/resource/blog.png')\" />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <a class=\"d-inline-block\" (click)=\"openImageModal(imageCropContent)\">\n {{ slug !== 'create' ? 'Edit' : 'Add' }} Picture\n </a>\n @if (image && !image.includes('default-photo.jpg')) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (click)=\"removeImage()\"\n (keydown.enter)=\"removeImage()\"></i>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4 col-sm-4 my-4 ms-3\">\n <div class=\"text-center mb-4\">\n <span id=\"resource-edit-rectangular-picture-label\" class=\"pw-label-style\">Rectangular Picture</span>\n <div class=\"text-center d-flex flex-column align-items-center\">\n <img [src]=\"(rectangularImage && !rectangularImage.includes('default-photo.jpg')) ? rectangularImage : 'assets/img/resource/blog.png'\"\n (click)=\"openRectModal(rectContent)\"\n (keydown.enter)=\"openRectModal(rectContent)\"\n class=\"image w-100\"\n alt=\"Uploaded rectangular media preview\"\n (error)=\"handleImageError($event, 'assets/img/resource/blog.png')\" />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <a class=\"d-inline-block\" (click)=\"openRectModal(rectContent)\">\n {{ slug !== 'create' ? 'Edit' : 'Add' }} Picture\n </a>\n @if (rectangularImage && !rectangularImage.includes('default-photo.jpg')) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (click)=\"deleteRectangularImage()\"\n (keydown.enter)=\"deleteRectangularImage()\"></i>\n }\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </form>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"modal.dismiss()\">Cancel</button>\n <button class=\"btn btn-primary\" [buttonBusy]=\"buttonBusy\" (click)=\"saveResource()\">Save</button>\n </div>\n</ng-template>\n\n<ng-template #imageCropContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Picture</h5>\n <button type=\"button\" class=\"btn-close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. (Do not upload pictures containing celebrities,\n nudity, artwork or copyrighted images.)</small>\n <pw-image-cropper\n [aspectRatio]=\"'dynamic'\"\n (imageSelectionEvent)=\"onImageSelected($event)\"\n (closeEvent)=\"modal.close()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n\n<ng-template #rectContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Picture</h5>\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. (Do not upload pictures containing celebrities,\n nudity, artwork or copyrighted images.)</small>\n <pw-image-cropper\n #profile\n [aspectRatio]=\"'dynamic'\"\n (imageSelectionEvent)=\"onRectangularImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n", styles: ["::ng-deep .modal-content{margin-top:5rem!important}\n"] }]
1740
- }], ctorParameters: () => [{ type: i5$2.FormBuilder }, { type: i2$1.NgbModal }, { type: ResourceService }, { type: i2.AuthService }, { type: i2.TagService }, { type: i0.ChangeDetectorRef }, { type: i0.Injector }], propDecorators: { id: [{
1741
- type: Input
1742
- }], resourceData: [{
1743
- type: Input
1744
- }], updated: [{
1745
- type: Output
1746
- }] } });
1747
-
1748
- var resourceEditCard_component = /*#__PURE__*/Object.freeze({
1749
- __proto__: null,
1750
- ResourceEditCardComponent: ResourceEditCardComponent
1751
- });
1752
-
1753
- /**
1754
- * Lazy-loadable module for ResourceEditCard
1755
- * Contains heavy dependencies (Quill, Calendar, etc.) that are only needed for admins
1756
- * This module is dynamically imported when edit button is clicked
1757
- */
1758
- class ResourceEditModule {
1759
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceEditModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1760
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: ResourceEditModule, declarations: [ResourceEditCardComponent], imports: [CommonModule,
1761
- FormsModule,
1762
- ReactiveFormsModule,
1763
- DatePickerModule,
1764
- AutoCompleteModule,
1765
- ResourceSharedComponentsModule,
1766
- CoreTranslocoModule,
1767
- TranslocoModule,
1768
- DirectivesModule, i11.QuillModule, UiSwitchModule], exports: [ResourceEditCardComponent] }); }
1769
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceEditModule, imports: [CommonModule,
1770
- FormsModule,
1771
- ReactiveFormsModule,
1772
- DatePickerModule,
1773
- AutoCompleteModule,
1774
- ResourceSharedComponentsModule,
1775
- CoreTranslocoModule,
1776
- TranslocoModule,
1777
- DirectivesModule,
1778
- QuillModule.forRoot(),
1779
- UiSwitchModule] }); }
1780
- }
1781
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ResourceEditModule, decorators: [{
1782
- type: NgModule,
1783
- args: [{
1784
- declarations: [ResourceEditCardComponent],
1785
- imports: [
1786
- CommonModule,
1787
- FormsModule,
1788
- ReactiveFormsModule,
1789
- DatePickerModule,
1790
- AutoCompleteModule,
1791
- ResourceSharedComponentsModule,
1792
- CoreTranslocoModule,
1793
- TranslocoModule,
1794
- DirectivesModule,
1795
- QuillModule.forRoot(),
1796
- UiSwitchModule
1797
- ],
1798
- exports: [ResourceEditCardComponent],
1799
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
1800
- }]
1801
- }] });
1802
-
1803
- class TestimonialCardListComponent {
1804
- constructor() {
1805
- this.editPost = new EventEmitter();
1806
- this.posts = [];
1807
- this.postHeader = '';
1808
- this.canEdit = false;
1809
- }
1810
- ngOnChanges(changes) {
1811
- if (changes.posts && this.posts?.length) {
1812
- setTimeout(() => this.initSwiper(), 0); // Wait for DOM to render
1813
- }
1814
- }
1815
- async initSwiper() {
1816
- // Dynamically import Swiper only when needed (lazy-load ~150KB library)
1817
- const { default: Swiper } = await import('swiper');
1818
- const { Navigation, Pagination } = await import('swiper/modules');
1819
- this.swiper = new Swiper('.swiper-container', {
1820
- modules: [Navigation, Pagination],
1821
- slidesPerView: 1,
1822
- spaceBetween: 24,
1823
- centeredSlides: true,
1824
- touchRatio: 1,
1825
- touchAngle: 45,
1826
- grabCursor: true,
1827
- navigation: {
1828
- nextEl: '.swiper-button-next',
1829
- prevEl: '.swiper-button-prev'
1830
- },
1831
- pagination: {
1832
- el: '.swiper-pagination',
1833
- clickable: true
1834
- },
1835
- breakpoints: {
1836
- 425: {
1837
- slidesPerView: 1.05,
1838
- centeredSlides: true
1839
- },
1840
- 470: {
1841
- slidesPerView: 1.25,
1842
- centeredSlides: true
1843
- },
1844
- 564: {
1845
- slidesPerView: 1.5,
1846
- centeredSlides: true
1847
- },
1848
- 640: {
1849
- slidesPerView: 1.5,
1850
- centeredSlides: true
1851
- },
1852
- 768: {
1853
- slidesPerView: 1.5,
1854
- centeredSlides: true
1855
- },
1856
- 1024: {
1857
- slidesPerView: 2, // Allow room between cards
1858
- centeredSlides: false
1859
- },
1860
- 1200: {
1861
- slidesPerView: 3,
1862
- centeredSlides: false
1863
- }
1864
- }
1865
- });
1866
- }
1867
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: TestimonialCardListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1868
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: TestimonialCardListComponent, isStandalone: false, selector: "pw-testimonial-card", inputs: { posts: "posts", postHeader: "postHeader", canEdit: "canEdit" }, outputs: { editPost: "editPost" }, usesOnChanges: true, ngImport: i0, template: "<section class=\"resource-section section-outer bg-white\">\n <div class=\"container\">\n @if (postHeader) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap mb-3\">\n <h2 class=\"section-heading\">{{postHeader}}</h2>\n </div>\n }\n @if (posts.length === 0) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n <div [hidden]=\"posts.length === 0\">\n <div class=\"swiper-container\">\n <div class=\"swiper-wrapper\">\n @for (post of posts; track post) {\n <div class=\"swiper-slide\">\n <div class=\"testimonial-box\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEdit\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"editPost.emit(1, 100)\">\n </pw-resource-edit-card-lazy>\n <div class=\"stars mb-5\">\u2605\u2605\u2605\u2605\u2605</div>\n <div class=\"testimonial-content\">\n <div class=\"ql-container ql-snow ql-res\">\n <div class=\"ql-editor\"\n [innerHTML]=\"post?.body\">\n </div>\n </div>\n </div>\n <!-- THIS STAYS AT BOTTOM -->\n <div class=\"avatar-container\">\n @if (!post.rectangular_picture.url.includes('default-photo.jpg') ) {\n <img\n [src]=\"post.rectangular_picture.url\"\n alt=\"Logo\"\n class=\"testimonial-logo mt-4\"\n />\n }\n </div>\n </div>\n </div>\n }\n </div>\n <div class=\"swiper-pagination\"></div>\n <div class=\"swiper-button-prev\"></div>\n <div class=\"swiper-button-next\"></div>\n </div>\n </div>\n </div>\n</section>", styles: [".resource-section{box-shadow:0 4px 32px -14px #40576d4d!important;position:relative}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=767px){.container{padding:0 1rem!important}}.ql-res{resize:none!important;border-width:0}.swiper-container{padding:20px;position:relative;overflow:hidden}@media(width>=768px){.swiper-container{padding:20px 40px}}.resource-card{background:#fff;border-radius:8px;box-shadow:0 0 20px #0000001a;padding:1.5rem;height:100%;display:flex;flex-direction:column;margin:0 auto;width:100%;max-width:350px}.resource-title{font-size:1.25rem;font-weight:600;margin-bottom:1rem}.resource-image{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:4px}.read-now-btn{margin-top:auto;display:inline-flex;align-items:center;gap:.5rem;color:#000;text-decoration:none;font-weight:500}.read-now-btn .arrow{transition:transform .2s ease}.read-now-btn:hover .arrow{transform:translate(5px)}.swiper-button-prev,.swiper-button-next{color:#000}.swiper-button-prev:after,.swiper-button-next:after{font-size:24px}@media(width<=767px){.swiper-button-prev,.swiper-button-next{display:none}}.swiper-pagination{position:relative;margin-top:20px}.swiper-pagination-bullet{background:#000;opacity:.5}.swiper-pagination-bullet-active{opacity:1}.swiper-wrapper{display:flex;align-items:stretch}.swiper-slide{display:flex;align-items:stretch;height:auto}.testimonial-box{display:flex;flex-direction:column;justify-content:space-between;background:#fff;border-radius:20px;padding:2.5rem 1.5rem;box-shadow:0 0 20px #0000001a;text-align:center;width:338px;font-size:1.1rem;height:100%;min-height:100%}.testimonial-box span{margin:0;font-size:22px}.testimonial-box .avatar-container{margin-top:auto}.testimonial-box .testimonial-logo{width:100%!important;height:auto!important;max-width:150px!important;object-fit:contain;align-self:center}.testimonial-box .stars{font-size:2.2rem;color:#f6b300;margin-bottom:2.5rem}.centaris-text{margin-bottom:3rem!important}@media(width<=768px){::ng-deep .swiper-wrapper{gap:1rem!important}.testimonial-box{width:300px!important}}\n", "textarea{font-size:1rem!important}.resource-body-section{background-color:#fff}.resource-body-section .container{padding:3rem 1.5rem 4rem!important;max-width:850px!important;margin:0 auto;text-align:left}.user-not-logged-in{background:#fafbfc;border:1px solid #e2e5ea;border-radius:8px;font-size:14px;font-weight:400;color:#5a6473;padding:1rem 1.5rem;box-shadow:none!important;margin-bottom:2rem!important}.user-not-logged-in a{color:#1a1d21!important;text-decoration:none;font-weight:600;transition:color .15s ease-out}.user-not-logged-in a:hover,.user-not-logged-in a:focus-visible{color:var(--first)!important}.user-not-logged-in a:focus-visible{outline:2px solid var(--first);outline-offset:2px;border-radius:2px}.resource-book-section{background:#fff;padding-top:4rem;padding-bottom:0}.resource-book-section .container{max-width:850px;margin:0 auto;padding:0 1.5rem!important;text-align:left}.resource-book-section .resource-contact{line-height:1.6;font-size:1rem;color:#3d4654}.resource-book-section .resource-contact a{text-decoration:underline;color:#1a1d21;margin:0 .2rem;transition:color .15s ease-out}.resource-book-section .resource-contact a:hover{color:var(--first)!important}.resource-offer-section{background:#fff;padding-top:1rem}.resource-offer-section .container{max-width:850px;margin:0 auto;padding:0 1.5rem;text-align:left}.resource-divider{border:0;border-top:1px solid #e2e5ea;margin:2rem auto;max-width:850px;height:0;background:none}::ng-deep .body-quill{border-width:0!important;max-width:850px;display:block;margin-left:auto;margin-right:auto}::ng-deep .p-textarea{border-radius:8px;border:1px solid #e2e5ea;font-size:1rem!important}.card{background-color:#fff;border-radius:12px}.comment-row{gap:1.5rem;padding-bottom:3rem;max-width:850px;display:block;margin-left:auto;margin-right:auto}.comment-label{font-size:14px!important;font-weight:600!important;letter-spacing:.04em;text-transform:uppercase;color:#5a6473}.response-row{max-width:850px;display:block;margin-left:auto;margin-right:auto;margin-top:2rem!important}@media(width<=768px){.resource-body-section .container{padding:2rem 1rem 3rem}.resource-book-section{padding-top:2rem!important}.resource-book-section .resource-contact{font-size:.9375rem!important}}\n"], dependencies: [{ kind: "directive", type: i5.LazyImgDirective, selector: "img" }, { kind: "component", type: ResourceEditCardLazyComponent, selector: "pw-resource-edit-card-lazy", inputs: ["id", "resourceData", "canEdit"], outputs: ["updated"] }, { kind: "component", type: i6.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "pipe", type: i10.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1869
- }
1870
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: TestimonialCardListComponent, decorators: [{
1871
- type: Component,
1872
- args: [{ selector: 'pw-testimonial-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<section class=\"resource-section section-outer bg-white\">\n <div class=\"container\">\n @if (postHeader) {\n <div class=\"d-flex justify-content-between align-items-center flex-wrap mb-3\">\n <h2 class=\"section-heading\">{{postHeader}}</h2>\n </div>\n }\n @if (posts.length === 0) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Resource.NoDataMessage' | transloco\"/>\n </div>\n }\n <div [hidden]=\"posts.length === 0\">\n <div class=\"swiper-container\">\n <div class=\"swiper-wrapper\">\n @for (post of posts; track post) {\n <div class=\"swiper-slide\">\n <div class=\"testimonial-box\">\n <pw-resource-edit-card-lazy\n [canEdit]=\"canEdit\"\n [id]=\"post.id\"\n [resourceData]=\"post\"\n (updated)=\"editPost.emit(1, 100)\">\n </pw-resource-edit-card-lazy>\n <div class=\"stars mb-5\">\u2605\u2605\u2605\u2605\u2605</div>\n <div class=\"testimonial-content\">\n <div class=\"ql-container ql-snow ql-res\">\n <div class=\"ql-editor\"\n [innerHTML]=\"post?.body\">\n </div>\n </div>\n </div>\n <!-- THIS STAYS AT BOTTOM -->\n <div class=\"avatar-container\">\n @if (!post.rectangular_picture.url.includes('default-photo.jpg') ) {\n <img\n [src]=\"post.rectangular_picture.url\"\n alt=\"Logo\"\n class=\"testimonial-logo mt-4\"\n />\n }\n </div>\n </div>\n </div>\n }\n </div>\n <div class=\"swiper-pagination\"></div>\n <div class=\"swiper-button-prev\"></div>\n <div class=\"swiper-button-next\"></div>\n </div>\n </div>\n </div>\n</section>", styles: [".resource-section{box-shadow:0 4px 32px -14px #40576d4d!important;position:relative}@media(width>=768px)and (width<=1200px){.container{padding:0 6rem!important}}@media(width<=767px){.container{padding:0 1rem!important}}.ql-res{resize:none!important;border-width:0}.swiper-container{padding:20px;position:relative;overflow:hidden}@media(width>=768px){.swiper-container{padding:20px 40px}}.resource-card{background:#fff;border-radius:8px;box-shadow:0 0 20px #0000001a;padding:1.5rem;height:100%;display:flex;flex-direction:column;margin:0 auto;width:100%;max-width:350px}.resource-title{font-size:1.25rem;font-weight:600;margin-bottom:1rem}.resource-image{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:4px}.read-now-btn{margin-top:auto;display:inline-flex;align-items:center;gap:.5rem;color:#000;text-decoration:none;font-weight:500}.read-now-btn .arrow{transition:transform .2s ease}.read-now-btn:hover .arrow{transform:translate(5px)}.swiper-button-prev,.swiper-button-next{color:#000}.swiper-button-prev:after,.swiper-button-next:after{font-size:24px}@media(width<=767px){.swiper-button-prev,.swiper-button-next{display:none}}.swiper-pagination{position:relative;margin-top:20px}.swiper-pagination-bullet{background:#000;opacity:.5}.swiper-pagination-bullet-active{opacity:1}.swiper-wrapper{display:flex;align-items:stretch}.swiper-slide{display:flex;align-items:stretch;height:auto}.testimonial-box{display:flex;flex-direction:column;justify-content:space-between;background:#fff;border-radius:20px;padding:2.5rem 1.5rem;box-shadow:0 0 20px #0000001a;text-align:center;width:338px;font-size:1.1rem;height:100%;min-height:100%}.testimonial-box span{margin:0;font-size:22px}.testimonial-box .avatar-container{margin-top:auto}.testimonial-box .testimonial-logo{width:100%!important;height:auto!important;max-width:150px!important;object-fit:contain;align-self:center}.testimonial-box .stars{font-size:2.2rem;color:#f6b300;margin-bottom:2.5rem}.centaris-text{margin-bottom:3rem!important}@media(width<=768px){::ng-deep .swiper-wrapper{gap:1rem!important}.testimonial-box{width:300px!important}}\n", "textarea{font-size:1rem!important}.resource-body-section{background-color:#fff}.resource-body-section .container{padding:3rem 1.5rem 4rem!important;max-width:850px!important;margin:0 auto;text-align:left}.user-not-logged-in{background:#fafbfc;border:1px solid #e2e5ea;border-radius:8px;font-size:14px;font-weight:400;color:#5a6473;padding:1rem 1.5rem;box-shadow:none!important;margin-bottom:2rem!important}.user-not-logged-in a{color:#1a1d21!important;text-decoration:none;font-weight:600;transition:color .15s ease-out}.user-not-logged-in a:hover,.user-not-logged-in a:focus-visible{color:var(--first)!important}.user-not-logged-in a:focus-visible{outline:2px solid var(--first);outline-offset:2px;border-radius:2px}.resource-book-section{background:#fff;padding-top:4rem;padding-bottom:0}.resource-book-section .container{max-width:850px;margin:0 auto;padding:0 1.5rem!important;text-align:left}.resource-book-section .resource-contact{line-height:1.6;font-size:1rem;color:#3d4654}.resource-book-section .resource-contact a{text-decoration:underline;color:#1a1d21;margin:0 .2rem;transition:color .15s ease-out}.resource-book-section .resource-contact a:hover{color:var(--first)!important}.resource-offer-section{background:#fff;padding-top:1rem}.resource-offer-section .container{max-width:850px;margin:0 auto;padding:0 1.5rem;text-align:left}.resource-divider{border:0;border-top:1px solid #e2e5ea;margin:2rem auto;max-width:850px;height:0;background:none}::ng-deep .body-quill{border-width:0!important;max-width:850px;display:block;margin-left:auto;margin-right:auto}::ng-deep .p-textarea{border-radius:8px;border:1px solid #e2e5ea;font-size:1rem!important}.card{background-color:#fff;border-radius:12px}.comment-row{gap:1.5rem;padding-bottom:3rem;max-width:850px;display:block;margin-left:auto;margin-right:auto}.comment-label{font-size:14px!important;font-weight:600!important;letter-spacing:.04em;text-transform:uppercase;color:#5a6473}.response-row{max-width:850px;display:block;margin-left:auto;margin-right:auto;margin-top:2rem!important}@media(width<=768px){.resource-body-section .container{padding:2rem 1rem 3rem}.resource-book-section{padding-top:2rem!important}.resource-book-section .resource-contact{font-size:.9375rem!important}}\n"] }]
1873
- }], propDecorators: { editPost: [{
1874
- type: Output
1875
- }], posts: [{
1876
- type: Input
1877
- }], postHeader: [{
1878
- type: Input
1879
- }], canEdit: [{
1880
- type: Input
1881
- }] } });
1882
-
1883
- /**
1884
- * Generated bundle index. Do not edit.
1885
- */
1886
-
1887
- export { BaseResourceComponent as B, CaseStudyCardComponent as C, ResourceVideoCardComponent as R, TestimonialCardListComponent as T, UpcomingEventCardComponent as U, ResourceCardComponent as a, ResourceNoteCardComponent as b, ResourceVaultComponent as c, ResourceCardsModule as d, ResourceService as e, ResourceEditCardLazyComponent as f, ResourceSharedModule as g, ResourceTopBannerEditComponent as h, ResourceCompanyCardComponent as i, ResourceEditCardComponent as j, ResourceEditModule as k, ResourceModule as l, ResourcePublicModule as m, Trial4ContactUsModule as n };
1888
- //# sourceMappingURL=posiwise-resource-module-posiwise-resource-module-C-hPiIlg.mjs.map