UNPKG

323 kBJavaScriptView Raw
1import { CommonModule } from '@angular/common';
2import { Component, Input, NgModule, EventEmitter, Output, Injectable, ChangeDetectionStrategy, Pipe, ChangeDetectorRef, InjectionToken, Inject } from '@angular/core';
3import { MatCardModule, MatButtonModule, MatIconModule, MatMenuModule, MatChipsModule, MatTooltipModule, MatCheckboxModule, MatExpansionModule, MatInputModule, MatOptionModule, MatProgressSpinnerModule, MatSelectModule, MatListModule as MatListModule$1, MatDividerModule } from '@angular/material';
4import { ImageTransformationService, ImageTransformationModule } from '@vendasta/core/image-transformation';
5import { VaIconModule, VaBadgeModule, VaSafeHtmlModule, VaListModule, VaImageGalleryModule, VaBreadcrumbsModule, CheckboxFilterField, FilterSection, Filters, TabbedFilterField, FilterService, UIKitModule } from '@vendasta/uikit';
6import { DisplayPriceService, CoreSharedModule, formatDisplayPrice, formatBillingFrequency, Addon } from '@vendasta/core/shared';
7import { BehaviorSubject, combineLatest, of, ReplaySubject, merge, zip } from 'rxjs';
8import { TranslateService, TranslateModule } from '@ngx-translate/core';
9import { map, switchMap, debounceTime, distinctUntilChanged, startWith, filter, take, skipWhile, shareReplay, tap } from 'rxjs/operators';
10import { Validators, FormControl, FormGroup, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
11import { MatListModule } from '@angular/material/list';
12import { VaFormsModule } from '@vendasta/forms';
13import { BillingModel, buildBilledProductFromProductPricingAndAddon, BillingService, BillingModule } from '@vendasta/core/billing';
14import { FieldType, Field, CustomField, AddonKey, CommonField } from '@vendasta/sales-orders';
15import uuid from 'uuid/v4';
16import { MatProgressSpinnerModule as MatProgressSpinnerModule$1 } from '@angular/material/progress-spinner';
17import { isNullOrUndefined } from 'util';
18import { Categories, Pricing as Pricing$1, Currency } from '@vendasta/core/marketplace-packages';
19import { trigger, state, style, transition, animate } from '@angular/animations';
20
21/**
22 * @fileoverview added by tsickle
23 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
24 */
25/*tslint:disable*/
26class En {
27}
28En.en = {
29 "FRONTEND.STORE": {
30 "TOTAL": "Total",
31 "CONTACT_SALES": "Contact Sales",
32 "FREE": "Free",
33 "STARTING_AT": "Starting at",
34 "ENABLED_UPPER": "ENABLED",
35 "ENABLE_UPPER": "ENABLE",
36 "MIN_TO_MAX": "{{minRange}} to {{maxRange}}",
37 "PRODUCT_PRICING_WITH_FREQUENCY": "{{pricingTier}} accounts {{frequency}}",
38 "COMMITMENT_WITH_RENEWAL": "*{{initial}} {{frequencyString}} minimum, renews for {{recurring}} {{frequencyString}} periods",
39 "COMMITMENT": "${{initial}} ${{frequencyString}} commitment",
40 "PRICING_FREQUENCIES": {
41 "MONTH": "month",
42 "YEAR": "year"
43 },
44 "REQUIRES_DESCRIPTOR": "(Requires {{requirementName}})",
45 "ADMINISTRATIVE_QUESTIONS": "Administrative Questions",
46 "AUTO_TITLE_TEXT": {
47 "SOME_FIELDS_INVALID": "* Some fields are invalid and/or required but empty",
48 "OPTIONAL_FIELDS_UNANSWERED": "Optional fields unanswered",
49 "COMPLETE": "Complete"
50 },
51 "REQUIRES": "Requires",
52 "ENABLED_WITH_PREREQUISITE": "Enabled with {{prerequisite}}",
53 "PRICE_APPLIES_PER_UNIT": "Price applies per unit within a range",
54 "PRICE_APPLIES_TO_ALL_UNITS": "Price applies to all units once range is met",
55 "PRICING": "Pricing",
56 "FAQS": "FAQs",
57 "GALLERY": "Gallery",
58 "FILES": "Files",
59 "GET_IT_NOW": "Get It Now",
60 "CONTAINS_NUM_ITEMS": "Contains {{itemCount}} items"
61 }
62};
63if (false) {
64 /** @type {?} */
65 En.en;
66}
67
68/**
69 * @fileoverview added by tsickle
70 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
71 */
72class VaPricingComponent {
73 /**
74 * @param {?} translateService
75 * @param {?} displayPriceService
76 */
77 constructor(translateService, displayPriceService) {
78 this.translateService = translateService;
79 this.displayPriceService = displayPriceService;
80 this.pricing = null;
81 this.wrapFrequency = false;
82 this.isAddon = false;
83 this.hasVerifiedContract = false;
84 this.highlightPrice = true;
85 this.loaded = true;
86 this.pricing$$ = new BehaviorSubject(null);
87 this.billedProduct$$ = new BehaviorSubject(null);
88 this.hasVerifiedContract$$ = new BehaviorSubject(false);
89 this.translateService.setTranslation('en', En.en, true);
90 this.isFree$ = combineLatest([this.pricing$, this.billedProduct$, this.hasVerifiedContract$]).pipe(map((/**
91 * @param {?} __0
92 * @return {?}
93 */
94 ([pricing, billedProduct, hasVerifiedContract]) => {
95 /** @type {?} */
96 const isFreeHelper = (/**
97 * @param {?} prices
98 * @return {?}
99 */
100 (prices) => {
101 return prices ? prices.some((/**
102 * @param {?} p
103 * @return {?}
104 */
105 p => p.price === 0 || p.price === undefined)) : false;
106 });
107 if (hasVerifiedContract && billedProduct) {
108 return billedProduct.pricingTiers.length === 1 ? isFreeHelper(billedProduct.pricingTiers) : false;
109 }
110 return !!pricing && isFreeHelper(pricing.prices);
111 })));
112 this.shouldContactSales$ = combineLatest([this.pricing$, this.billedProduct$, this.hasVerifiedContract$]).pipe(map((/**
113 * @param {?} __0
114 * @return {?}
115 */
116 ([pricing, billedProduct, hasVerifiedContract]) => {
117 /** @type {?} */
118 const nestedPricesIsContactSales = (/**
119 * @param {?} prices
120 * @return {?}
121 */
122 (prices) => {
123 return prices && prices.length > 0 ? prices.some((/**
124 * @param {?} p
125 * @return {?}
126 */
127 p => p.price === null || p.price < 0)) : true;
128 });
129 if (hasVerifiedContract && billedProduct) {
130 return nestedPricesIsContactSales(billedProduct.pricingTiers);
131 }
132 if (!pricing) {
133 return true;
134 }
135 return nestedPricesIsContactSales(pricing.prices);
136 })));
137 this.isFlatPrice$ = this.billedProduct$.pipe(map((/**
138 * @param {?} billedProduct
139 * @return {?}
140 */
141 billedProduct => billedProduct.pricingTiers.length === 1)));
142 this.pricingTierData$ = this.billedProduct$.pipe(switchMap((/**
143 * @param {?} billedProduct
144 * @return {?}
145 */
146 billedProduct => {
147 /** @type {?} */
148 const pricingTierObservables = billedProduct.pricingTiers.map((/**
149 * @param {?} pricingTier
150 * @return {?}
151 */
152 pricingTier => {
153 return combineLatest(of(pricingTier.isStartingPrice), this.buildPricingTierString(pricingTier), this.buildPricingTierForProduct(pricingTier, billedProduct.billingFrequency), this.buildPricingTierForAddon(pricingTier), this.buildPriceStringForTier(pricingTier, billedProduct.billingFrequency, pricingTier.isStartingPrice), this.buildPriceStringForTier(pricingTier)).pipe(map((/**
154 * @param {?} __0
155 * @return {?}
156 */
157 ([isStartingPrice, pricingTierString, pricingTierForProduct, pricingTierForAddon, priceStringForTier, priceStringForTierWithoutFreq]) => {
158 return {
159 isStartingPrice: isStartingPrice,
160 pricingTierString: pricingTierString,
161 pricingTierForProduct: pricingTierForProduct,
162 pricingTierForAddon: pricingTierForAddon,
163 priceStringForTier: priceStringForTier,
164 priceStringForTierWithoutFreq: priceStringForTierWithoutFreq
165 };
166 })));
167 }));
168 return combineLatest(...pricingTierObservables);
169 })));
170 this.priceData$ = this.pricing$.pipe(switchMap((/**
171 * @param {?} pricing
172 * @return {?}
173 */
174 pricing => {
175 /** @type {?} */
176 const priceObservables = pricing.prices.map((/**
177 * @param {?} price
178 * @return {?}
179 */
180 price => {
181 return combineLatest(of(price.isStartingPrice), this.buildPriceStringForPricing(price, pricing.currency, true, false), this.buildPriceStringForPricing(price, pricing.currency, false, true), this.buildFrequencyString(price.frequency)).pipe(map((/**
182 * @param {?} __0
183 * @return {?}
184 */
185 ([isStartingPrice, priceStringForPricingWithoutFrequency, priceStringForPricingWithFrequency, frequencyString]) => {
186 return {
187 isStartingPrice: isStartingPrice,
188 priceStringForPricingWithoutFrequency: priceStringForPricingWithoutFrequency,
189 priceStringForPricingWithFrequency: priceStringForPricingWithFrequency,
190 frequencyString: frequencyString
191 };
192 })));
193 }));
194 return combineLatest(...priceObservables);
195 })));
196 this.commitmentMessage$ = this.buildCommitmentMessage();
197 }
198 /**
199 * @return {?}
200 */
201 get pricing$() {
202 return this.pricing$$.asObservable();
203 }
204 /**
205 * @return {?}
206 */
207 get billedProduct$() {
208 return this.billedProduct$$.asObservable();
209 }
210 /**
211 * @return {?}
212 */
213 get hasVerifiedContract$() {
214 return this.hasVerifiedContract$$.asObservable();
215 }
216 /**
217 * @param {?} changes
218 * @return {?}
219 */
220 ngOnChanges(changes) {
221 if (changes.hasOwnProperty('pricing')) {
222 this.pricing$$.next(changes.pricing.currentValue);
223 }
224 if (changes.hasOwnProperty('billedProduct')) {
225 this.billedProduct$$.next(changes.billedProduct.currentValue);
226 }
227 if (changes.hasOwnProperty('hasVerifiedContract')) {
228 this.hasVerifiedContract$$.next(changes.hasVerifiedContract.currentValue);
229 }
230 }
231 /**
232 * @param {?} tier
233 * @return {?}
234 */
235 buildPricingTierString(tier) {
236 /** @type {?} */
237 let max = String(tier.rangeMax);
238 if (tier.rangeMax === -1) {
239 max = '∞';
240 if (tier.rangeMin === 0 || tier.rangeMin === 1) {
241 return of('');
242 }
243 }
244 return this.translateService.stream('FRONTEND.STORE.MIN_TO_MAX', { minRange: String(tier.rangeMin), maxRange: max });
245 }
246 /**
247 * @param {?} tier
248 * @param {?=} frequency
249 * @return {?}
250 */
251 buildPricingTierForProduct(tier, frequency) {
252 return combineLatest(this.buildPricingTierString(tier), this.buildFrequencyString(frequency)).pipe(switchMap((/**
253 * @param {?} __0
254 * @return {?}
255 */
256 ([pricingTier, formattedFrequency]) => {
257 if (pricingTier) {
258 return this.translateService.stream('FRONTEND.STORE.PRODUCT_PRICING_WITH_FREQUENCY', {
259 pricingTier: pricingTier,
260 frequency: formattedFrequency
261 });
262 }
263 return of(formattedFrequency);
264 })));
265 }
266 /**
267 * @param {?} tier
268 * @return {?}
269 */
270 buildPricingTierForAddon(tier) {
271 return this.buildPricingTierString(tier).pipe(map((/**
272 * @param {?} pricingRange
273 * @return {?}
274 */
275 pricingRange => pricingRange ? pricingRange : '')));
276 }
277 /**
278 * @param {?} price
279 * @param {?} currency
280 * @param {?} excludeFrequency
281 * @param {?} canIncludeStartingAtPrefix
282 * @return {?}
283 */
284 buildPriceStringForPricing(price, currency, excludeFrequency, canIncludeStartingAtPrefix) {
285 return this.displayPriceService.formatDisplayPrice(price.price, currency, (/** @type {?} */ ((excludeFrequency ? '' : price.frequency))), true, true, true, price.isStartingPrice && canIncludeStartingAtPrefix);
286 }
287 /**
288 * @param {?} tier
289 * @param {?=} frequency
290 * @param {?=} isStartingPrice
291 * @return {?}
292 */
293 buildPriceStringForTier(tier, frequency, isStartingPrice) {
294 return this.displayPriceService.formatDisplayPrice(tier.price, this.billedProduct.currency, (/** @type {?} */ (frequency)), undefined, undefined, undefined, isStartingPrice);
295 }
296 /**
297 * @param {?=} frequency
298 * @return {?}
299 */
300 buildFrequencyString(frequency) {
301 return this.displayPriceService.formatBillingFrequency(frequency);
302 }
303 /**
304 * @return {?}
305 */
306 buildCommitmentMessage() {
307 return combineLatest([
308 this.translateService.stream('FRONTEND.STORE.PRICING_FREQUENCIES'),
309 this.billedProduct$,
310 this.pricing$,
311 this.isFree$,
312 this.shouldContactSales$
313 ]).pipe(switchMap((/**
314 * @param {?} __0
315 * @return {?}
316 */
317 ([frequencyTranslations, billedProduct, pricing, isFree, shouldContactSales]) => {
318 /** @type {?} */
319 const frequency = billedProduct ? billedProduct.billingFrequency.toString().toLowerCase() :
320 pricing && pricing.prices.length > 0 ? pricing.prices[0].frequency.toLowerCase() : '';
321 /** @type {?} */
322 let frequencyString = '';
323 if (frequency === 'yearly') {
324 frequencyString = frequencyTranslations.YEAR;
325 }
326 else if (frequency === 'monthly') {
327 frequencyString = frequencyTranslations.MONTH;
328 }
329 if (!frequencyString || isFree || shouldContactSales) {
330 return of('');
331 }
332 if (billedProduct && billedProduct.commitment) {
333 /** @type {?} */
334 const initial = billedProduct.commitment.initial;
335 /** @type {?} */
336 const recurring = billedProduct.commitment.recurring;
337 return this.translateService.stream('FRONTEND.STORE.COMMITMENT_WITH_RENEWAL', {
338 initial: initial,
339 frequencyString: frequencyString,
340 recurring: recurring,
341 });
342 }
343 return of('');
344 })));
345 }
346}
347VaPricingComponent.decorators = [
348 { type: Component, args: [{
349 selector: 'va-pricing',
350 template: "<ng-container *ngIf=\"highlightPrice\">\n <highlight-pricing [pricing]=\"pricing\"\n [billedProduct]=\"billedProduct\"\n [highlightPrice]=\"highlightPrice\"\n [isAddon]=\"isAddon\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [wrapFrequency]=\"wrapFrequency\"\n [loaded]=\"loaded\">\n </highlight-pricing>\n</ng-container>\n<ng-container *ngIf=\"!highlightPrice\">\n <table-pricing [pricing]=\"pricing\"\n [highlightPrice]=\"highlightPrice\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\">\n </table-pricing>\n</ng-container>\n",
351 styles: [""]
352 }] }
353];
354/** @nocollapse */
355VaPricingComponent.ctorParameters = () => [
356 { type: TranslateService },
357 { type: DisplayPriceService }
358];
359VaPricingComponent.propDecorators = {
360 pricing: [{ type: Input }],
361 billedProduct: [{ type: Input }],
362 wrapFrequency: [{ type: Input }],
363 isAddon: [{ type: Input }],
364 hasVerifiedContract: [{ type: Input }],
365 highlightPrice: [{ type: Input }],
366 loaded: [{ type: Input }]
367};
368if (false) {
369 /** @type {?} */
370 VaPricingComponent.prototype.pricing;
371 /** @type {?} */
372 VaPricingComponent.prototype.billedProduct;
373 /** @type {?} */
374 VaPricingComponent.prototype.wrapFrequency;
375 /** @type {?} */
376 VaPricingComponent.prototype.isAddon;
377 /** @type {?} */
378 VaPricingComponent.prototype.hasVerifiedContract;
379 /** @type {?} */
380 VaPricingComponent.prototype.highlightPrice;
381 /** @type {?} */
382 VaPricingComponent.prototype.loaded;
383 /** @type {?} */
384 VaPricingComponent.prototype.pricing$$;
385 /** @type {?} */
386 VaPricingComponent.prototype.billedProduct$$;
387 /** @type {?} */
388 VaPricingComponent.prototype.hasVerifiedContract$$;
389 /** @type {?} */
390 VaPricingComponent.prototype.isFree$;
391 /** @type {?} */
392 VaPricingComponent.prototype.shouldContactSales$;
393 /** @type {?} */
394 VaPricingComponent.prototype.isFlatPrice$;
395 /** @type {?} */
396 VaPricingComponent.prototype.pricingTierData$;
397 /** @type {?} */
398 VaPricingComponent.prototype.priceData$;
399 /** @type {?} */
400 VaPricingComponent.prototype.commitmentMessage$;
401 /**
402 * @type {?}
403 * @private
404 */
405 VaPricingComponent.prototype.translateService;
406 /**
407 * @type {?}
408 * @private
409 */
410 VaPricingComponent.prototype.displayPriceService;
411}
412
413/**
414 * @fileoverview added by tsickle
415 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
416 */
417class HighlightPricingComponent extends VaPricingComponent {
418}
419HighlightPricingComponent.decorators = [
420 { type: Component, args: [{
421 selector: 'highlight-pricing',
422 template: "<ng-container *ngIf=\"loaded; else loading\">\n <div class=\"no-price\" *ngIf=\"shouldContactSales$ | async; else dontContactSales\">\n {{ 'FRONTEND.STORE.CONTACT_SALES' | translate }}\n </div>\n <ng-template #dontContactSales>\n <div class=\"no-price\" *ngIf=\"isFree$ | async; else notFree\">\n <b>{{ 'FRONTEND.STORE.FREE' | translate }}</b>\n </div>\n <ng-template #notFree>\n <ng-container *ngIf=\"!isAddon\">\n <ng-container *ngIf=\"hasVerifiedContract && billedProduct; else usePricing\">\n <div *ngFor=\"let tier of pricingTierData$ | async\" class=\"price-box\">\n <span>\n <span *ngIf=\"tier.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">{{ tier.priceStringForTierWithoutFreq }}</b>\n </span>\n <span class=\"tier-billing-freq\" [ngClass]=\"{'va-wrap': wrapFrequency}\">\n {{ tier.pricingTierForProduct }}\n </span>\n </div>\n </ng-container>\n <ng-template #usePricing>\n <ng-container *ngIf=\"pricing?.prices\">\n <div *ngFor=\"let price of priceData$ | async; let i = index\" class=\"price-box\">\n <span>\n <span *ngIf=\"price.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">\n <ng-container *ngIf=\"i == 1\">+</ng-container>\n {{ price.priceStringForPricingWithoutFrequency }}\n </b>\n </span>\n <span *ngIf=\"price.frequencyString\" class=\"billing-freq\" [ngClass]=\"{'va-wrap': wrapFrequency}\">\n {{ price.frequencyString }}\n </span>\n </div>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isAddon\">\n <div *ngIf=\"hasVerifiedContract && billedProduct; else useAddonPricing\">\n <div *ngFor=\"let tier of pricingTierData$ | async\" class=\"price-box\">\n <span class=\"addon-billing-freq\">\n {{ tier.pricingTierForAddon }}\n </span>\n <span>\n <span *ngIf=\"tier.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">\n {{ tier.priceStringForTier }}\n </b>\n </span>\n </div>\n </div>\n <ng-template #useAddonPricing>\n <div class=\"price-box\">\n <span *ngIf=\"pricing?.prices[0].frequency\" class=\"addon-billing-freq\">\n {{ (priceData$ | async)[0]?.frequencyString }}\n </span>\n <span>\n <span *ngIf=\"pricing?.prices[0]?.isStartingPrice\" class=\"starting-at\">\n {{ 'FRONTEND.STORE.STARTING_AT' | translate }}\n </span>\n <b class=\"price-number\">\n {{ (priceData$ | async)[0]?.priceStringForPricingWithoutFrequency }}\n </b>\n </span>\n </div>\n </ng-template>\n </ng-container>\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </ng-template>\n </ng-template>\n</ng-container>\n<ng-template #loading>\n <div class=\"stencil-pricing stencil-shimmer\"></div>\n</ng-template>\n",
423 styles: [":host{color:#9e9e9e}.starting-at{margin-right:5px}.price-box{display:-webkit-box;display:flex;-webkit-box-align:baseline;align-items:baseline;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse}.no-price{text-align:center}b{color:#212121;font-size:20px}@media screen and (max-width:600px){.no-price,.price-box,b{font-size:16px}}.billing-freq{text-transform:capitalize;-webkit-box-flex:1;flex:1}.tier-billing-freq{-webkit-box-flex:1;flex:1}.addon-billing-freq{padding-left:5px}.va-wrap{display:block}.stencil-pricing{height:1em}.commitment{color:#9e9e9e;font-size:12px;font-style:italic}"]
424 }] }
425];
426
427/**
428 * @fileoverview added by tsickle
429 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
430 */
431class TablePricingComponent extends VaPricingComponent {
432}
433TablePricingComponent.decorators = [
434 { type: Component, args: [{
435 selector: 'table-pricing',
436 template: "<ng-container *ngIf=\"loaded; else loading\">\n <div *ngIf=\"hasVerifiedContract && billedProduct; else usePricing\">\n <div class=\"price-container\" *ngIf=\"isFlatPrice$ | async; else notFlatPrice\">\n <div class=\"price\">\n {{ (pricingTierData$ | async)[0]?.priceStringForTier }}\n </div>\n </div>\n <ng-template #notFlatPrice>\n <div class=\"price-container--tiered\" *ngIf=\"!(isFlatPrice$ | async)\">\n <div class=\"pricing-tier\" *ngFor=\"let tier of pricingTierData$ | async\">\n <div class=\"pricing-tier__range\">{{ tier.pricingTierString }}</div>\n <div class=\"pricing-tier__price\">\n {{ tier.priceStringForTier }}\n </div>\n </div>\n </div>\n </ng-template>\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </div>\n <ng-template #usePricing>\n <div class=\"gray-font\">\n <ng-container *ngIf=\"shouldContactSales$ | async; else dontContactSales\">\n {{ 'FRONTEND.STORE.CONTACT_SALES' | translate }}\n </ng-container>\n <ng-template #dontContactSales>\n <ng-container *ngIf=\"isFree$ | async; else notFree\">\n {{ 'FRONTEND.STORE.FREE' | translate }}\n </ng-container>\n <ng-template #notFree>\n {{ (priceData$ | async)[0].priceStringForPricingWithFrequency }}\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </ng-template>\n </ng-template>\n </div>\n </ng-template>\n</ng-container>\n<ng-template #loading>\n <div class=\"stencil-pricing stencil-shimmer\"></div>\n</ng-template>\n",
437 styles: [":host{color:#616161}.price-container--tiered{font-size:12px;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;display:-webkit-box;display:flex;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.price-container--tiered .pricing-tier{border-bottom:1px solid #e0e0e0;padding:5px 0;display:-webkit-box;display:flex}.price-container--tiered .pricing-tier:first-child{padding-top:0}.price-container--tiered .pricing-tier:last-child{padding-bottom:0;border-bottom:none}.price-container--tiered .pricing-tier .pricing-tier__range{padding-right:20px;-webkit-box-flex:1;flex:1}.stencil-pricing{height:1em}.commitment{color:#9e9e9e;font-size:12px;font-style:italic}"]
438 }] }
439];
440
441/**
442 * @fileoverview added by tsickle
443 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
444 */
445class VaPricingModule {
446}
447VaPricingModule.decorators = [
448 { type: NgModule, args: [{
449 imports: [
450 CommonModule,
451 CoreSharedModule,
452 TranslateModule
453 ],
454 declarations: [VaPricingComponent, HighlightPricingComponent, TablePricingComponent],
455 exports: [VaPricingComponent]
456 },] }
457];
458
459/**
460 * @fileoverview added by tsickle
461 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
462 */
463class StoreCardComponent {
464 /**
465 * @param {?} imageTransformationService
466 * @param {?} translateService
467 */
468 constructor(imageTransformationService, translateService) {
469 this.imageTransformationService = imageTransformationService;
470 this.translateService = translateService;
471 this.purchasedClicked = new EventEmitter();
472 this.cardClicked = new EventEmitter();
473 this.descriptionClicked = new EventEmitter();
474 this.bannerClicked = new EventEmitter();
475 this.translateService.setTranslation('en', En.en, true);
476 }
477 /**
478 * @return {?}
479 */
480 getBannerColorForName() {
481 // determine an icon color for a product with no icon by using the product name
482 /** @type {?} */
483 const COLOR_CODES = [
484 '#EF5350', '#42A5F5', '#66BB6A', '#FFA726', '#AB47BC', '#FFCA28', '#EC407A', '#26C6DA',
485 '#FF7B57'
486 ];
487 /** @type {?} */
488 let nameSum = 0;
489 /** @type {?} */
490 const defaultColor = '#808080';
491 if (!this.item.name) {
492 return defaultColor;
493 }
494 for (let i = 0; i < this.item.name.length; i++) {
495 nameSum += this.item.name[i].charCodeAt(0);
496 }
497 /** @type {?} */
498 const index = nameSum % COLOR_CODES.length;
499 return COLOR_CODES[index];
500 }
501 /**
502 * @param {?} imageUrl
503 * @return {?}
504 */
505 getSrcsetHeaderUrls(imageUrl) {
506 return this.imageTransformationService.getSrcSetForImage(imageUrl, [680, 1360, 2720]);
507 }
508}
509StoreCardComponent.decorators = [
510 { type: Component, args: [{
511 selector: 'va-store-card',
512 template: `
513<mat-card class="hover-card" *ngIf="item" (click)="cardClicked.emit(item)">
514<div class="hover-area">
515 <div class="product-banner" (click)="bannerClicked.emit(item)"
516 [style.background-color]="item.headerImageUrl ? '': getBannerColorForName()">
517 <img class="img-container" *ngIf="item.headerImageUrl"
518 [src]="item.headerImageUrl" [srcset]="getSrcsetHeaderUrls(item.headerImageUrl)">
519 </div>
520
521 <div class="description" (click)="descriptionClicked.emit(item)">
522 <mat-card-header>
523 <va-icon mat-card-avatar [diameter]="40" [name]="item.name" [iconUrl]="item.iconUrl"></va-icon>
524 <mat-card-title>{{item.name}}</mat-card-title>
525 <mat-card-subtitle>
526 <ng-container *ngIf="item.pricing; else formatted">
527 <va-pricing [pricing]="item.pricing"
528 [highlightPrice]="false"></va-pricing>
529 </ng-container>
530 <ng-template #formatted>{{item.formattedPrice}}</ng-template>
531 </mat-card-subtitle>
532 </mat-card-header>
533 <mat-card-content> {{ item.tagline }}
534 </mat-card-content>
535 </div>
536
537 <button *ngIf="item.purchased !== undefined"
538 mat-button color="primary" class="enabled-indicator" (click)="purchasedClicked.emit(item)" [disabled]="item.purchased">
539 <i *ngIf="!item.purchased" class="material-icons">add</i>
540 <i *ngIf="item.purchased" class="material-icons" style="color: #39B74A">check</i>
541 <span>{{ (item.purchased ? 'FRONTEND.STORE.ENABLED_UPPER' : 'FRONTEND.STORE.ENABLE_UPPER') | translate }}</span>
542 </button>
543 </div>
544</mat-card>
545 `,
546 styles: [":host{position:relative}::ng-deep .mat-card-header-text{width:100%}mat-card.hover-card{overflow:hidden;padding:0;margin-bottom:0}mat-card.hover-card mat-card-subtitle,mat-card.hover-card mat-card-title{margin:0 80px 0 0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}mat-card.hover-card mat-card-subtitle{font-size:12px;margin-top:4px}.hover-area{position:relative;cursor:pointer}.product-banner{max-height:133px;overflow:hidden;display:-webkit-box;display:flex;width:100%;height:100px;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.product-banner img{max-width:100%}@media screen and (min-width:480px){.hover-area{padding-top:55%}.hover-area:hover .description{top:0}.hover-area:hover .enabled-indicator span{width:70px}.product-banner{max-height:none;position:absolute;height:60%;top:0}}.description{box-sizing:border-box;padding:10px 16px 0;overflow:hidden;background:#fff;color:#212121;-webkit-transition:.3s;transition:.3s}.description:after{content:'';display:block;width:100%;height:40%;position:absolute;bottom:0;left:0;background:-webkit-gradient(linear,left top,left bottom,color-stop(40%,rgba(255,255,255,0)),color-stop(70%,#fff));background:linear-gradient(rgba(255,255,255,0) 40%,#fff 70%)}mat-card-header{box-sizing:border-box;padding-bottom:16px;margin:0;height:40%;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}mat-card-content{min-height:40px;max-height:80px;padding:16px;margin:0 -16px;border-top:1px solid #e0e0e0;font-size:12px}.enabled-indicator{position:absolute;right:8px;bottom:8px}.enabled-indicator span{display:inline-block;width:70px;overflow:hidden;-webkit-transition:.3s;transition:.3s}@media screen and (min-width:480px){.description{position:absolute;top:60%;width:100%;height:100%}.description:after{height:70%}mat-card-content{min-height:0;max-height:none}.enabled-indicator span{width:0}}button[mat-button]{padding:0 8px;min-width:0}mat-card-actions{position:relative;padding:8px!important;margin:0!important;text-align:right;border-top:1px solid #e0e0e0;background-color:#fff;color:#212121}.status{font-size:14px}.img-container{height:100%;width:100%}"]
547 }] }
548];
549/** @nocollapse */
550StoreCardComponent.ctorParameters = () => [
551 { type: ImageTransformationService },
552 { type: TranslateService }
553];
554StoreCardComponent.propDecorators = {
555 item: [{ type: Input }],
556 purchasedClicked: [{ type: Output }],
557 cardClicked: [{ type: Output }],
558 descriptionClicked: [{ type: Output }],
559 bannerClicked: [{ type: Output }]
560};
561if (false) {
562 /** @type {?} */
563 StoreCardComponent.prototype.item;
564 /** @type {?} */
565 StoreCardComponent.prototype.purchasedClicked;
566 /** @type {?} */
567 StoreCardComponent.prototype.cardClicked;
568 /** @type {?} */
569 StoreCardComponent.prototype.descriptionClicked;
570 /** @type {?} */
571 StoreCardComponent.prototype.bannerClicked;
572 /**
573 * @type {?}
574 * @private
575 */
576 StoreCardComponent.prototype.imageTransformationService;
577 /**
578 * @type {?}
579 * @private
580 */
581 StoreCardComponent.prototype.translateService;
582}
583
584/**
585 * @fileoverview added by tsickle
586 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
587 */
588class StoreCardModule {
589}
590StoreCardModule.decorators = [
591 { type: NgModule, args: [{
592 imports: [
593 CommonModule,
594 VaIconModule,
595 MatCardModule,
596 MatButtonModule,
597 MatIconModule,
598 MatMenuModule,
599 ImageTransformationModule,
600 VaPricingModule,
601 TranslateModule
602 ],
603 declarations: [StoreCardComponent],
604 exports: [StoreCardComponent]
605 },] }
606];
607
608/**
609 * @fileoverview added by tsickle
610 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
611 */
612class StoreComponent {
613 constructor() {
614 this.items = [];
615 this.searchable = true;
616 this.itemClicked = new EventEmitter();
617 }
618 /**
619 * @return {?}
620 */
621 get filteredItems() {
622 if (this.filterTerm) {
623 return this.items.filter((/**
624 * @param {?} pkg
625 * @return {?}
626 */
627 pkg => pkg.name.toLowerCase().indexOf(this.filterTerm.toLowerCase()) !== -1));
628 }
629 return this.items;
630 }
631}
632StoreComponent.decorators = [
633 { type: Component, args: [{
634 selector: 'va-store',
635 template: `
636 <div class="toolbar">
637 <div *ngIf="searchable" class="table-controls-row">
638 <va-search-box (update)="filterTerm = $event"></va-search-box>
639 </div>
640 </div>
641 <div class="row row-gutters">
642 <div *ngFor="let item of filteredItems" class="col-flex">
643 <va-store-card [item]="item" (cardClicked)="this.itemClicked.emit(item)"></va-store-card>
644 </div>
645 </div>
646 `,
647 styles: [".flex-row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.toolbar{padding:0;background-color:#fff;color:#616161}.toolbar .disabled{cursor:default}.toolbar .disabled mat-icon{cursor:default;color:#9e9e9e}.toolbar va-search-box{margin-right:10px;width:350px}.toolbar .table-controls-row{padding:0 10px 10px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.toolbar .table-controls-row:first-of-type{padding-top:10px}.top-border{border-top:1px solid #fff}.selected{background-color:#fff}.row{display:-webkit-box;display:flex;flex-wrap:wrap}.row+.row-gutters{margin-top:0}.row-gutters{margin-top:-20px;margin-left:-20px}.row-gutters>.col-flex{padding-top:20px;padding-left:20px}.col-flex{position:relative;max-width:100%;box-sizing:border-box;-webkit-box-flex:0;flex:0 0 auto;width:100%}@media screen and (min-width:480px){.col-flex{width:50%}}@media screen and (min-width:1200px){.col-flex{width:33.333333%}}"]
648 }] }
649];
650StoreComponent.propDecorators = {
651 items: [{ type: Input }],
652 searchable: [{ type: Input }],
653 itemClicked: [{ type: Output }]
654};
655if (false) {
656 /** @type {?} */
657 StoreComponent.prototype.items;
658 /** @type {?} */
659 StoreComponent.prototype.searchable;
660 /** @type {?} */
661 StoreComponent.prototype.itemClicked;
662 /** @type {?} */
663 StoreComponent.prototype.filterTerm;
664}
665
666/**
667 * @fileoverview added by tsickle
668 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
669 */
670class DropDownFormSectionComponent {
671 /**
672 * @param {?} translateService
673 */
674 constructor(translateService) {
675 this.translateService = translateService;
676 this.startOpen = false;
677 this.displayAutoTitle = false;
678 this.titleText = '';
679 this.displayAutoDescription = true;
680 this.descriptionText = '';
681 this.editingHint = '';
682 this.expandable = true;
683 this.autoDescriptionText = '';
684 this.iconName = 'help_outline';
685 this.subscriptions = [];
686 this.uniqueIndex = 1;
687 this.autoTitleText = '';
688 this.translateService.setTranslation('en', En.en, true);
689 }
690 /**
691 * @return {?}
692 */
693 ngOnInit() {
694 /** @type {?} */
695 const allFieldsHidden = this.fields.reduce((/**
696 * @param {?} p
697 * @param {?} c
698 * @param {?} i
699 * @param {?} a
700 * @return {?}
701 */
702 (p, c, i, a) => p && c.hidden), true);
703 if (allFieldsHidden) {
704 this.expandable = false;
705 }
706 while (this.parentForm.controls.hasOwnProperty(this.titleText + this.uniqueIndex)) {
707 this.uniqueIndex += 1;
708 }
709 this.parentForm.addControl(this.titleText + this.uniqueIndex, this.toFormGroup(this.fields));
710 /** @type {?} */
711 const form = (/** @type {?} */ (this.parentForm.controls[this.titleText + this.uniqueIndex]));
712 for (const key in form.controls) {
713 if (form.controls.hasOwnProperty(key)) {
714 if (this.prepopulatedData != null && this.prepopulatedData.hasOwnProperty(key)) {
715 form.controls[key].setValue(this.prepopulatedData[key]);
716 }
717 }
718 }
719 this.subscriptions.push(combineLatest([
720 form.statusChanges,
721 this.translateService.stream('FRONTEND.STORE.AUTO_TITLE_TEXT')
722 ]).subscribe((/**
723 * @param {?} __0
724 * @return {?}
725 */
726 ([change, autoTitleText]) => {
727 /** @type {?} */
728 let missingFields = false;
729 for (const control in form.controls) {
730 if (!form.controls[control].value || (form.controls[control].value.constructor === Array && !form.controls[control].value[0])) {
731 this.iconName = 'help_outline';
732 missingFields = true;
733 if (change === 'INVALID') {
734 this.autoTitleText = autoTitleText.SOME_FIELDS_INVALID;
735 if (form.controls[control].dirty || form.controls[control].touched) {
736 this.iconName = 'warning';
737 break;
738 }
739 }
740 else {
741 this.autoTitleText = autoTitleText.OPTIONAL_FIELDS_UNANSWERED;
742 }
743 }
744 }
745 if (!missingFields) {
746 this.iconName = 'check_circle';
747 this.autoTitleText = autoTitleText.COMPLETE;
748 }
749 })));
750 if (this.displayAutoDescription) {
751 this.subscriptions.push(form.valueChanges.subscribe((/**
752 * @param {?} changes
753 * @return {?}
754 */
755 changes => {
756 /** @type {?} */
757 let description = '';
758 for (const key in changes) {
759 if (changes.hasOwnProperty(key) && changes[key] != null && changes[key].length > 0) {
760 if (changes[key][0].name) {
761 for (const fileKey in changes[key]) {
762 if (changes[key][fileKey] != null) {
763 description += changes[key][fileKey].name;
764 description += ', ';
765 }
766 }
767 }
768 else {
769 description += changes[key];
770 description += ', ';
771 }
772 }
773 }
774 this.autoDescriptionText = description.substring(0, description.length - 2);
775 })));
776 }
777 form.updateValueAndValidity({ onlySelf: false, emitEvent: true });
778 }
779 /**
780 * @param {?} formFields
781 * @return {?}
782 */
783 toFormGroup(formFields) {
784 /** @type {?} */
785 const group = {};
786 formFields.forEach((/**
787 * @param {?} field
788 * @return {?}
789 */
790 field => {
791 /** @type {?} */
792 let validations;
793 if (!field.required || field.hidden) {
794 validations = field.validator;
795 }
796 else if (field.controlType === 'checkbox') {
797 validations = [Validators.requiredTrue, field.validator];
798 }
799 else {
800 validations = [Validators.required, field.validator];
801 }
802 /** @type {?} */
803 const formControl = new FormControl({ value: field.value, disabled: field.disabled }, validations);
804 group[field.id] = formControl;
805 this.subscriptions.push(formControl.valueChanges.subscribe((/**
806 * @param {?} value
807 * @return {?}
808 */
809 value => (field.value = value))));
810 }));
811 return new FormGroup(group);
812 }
813 /**
814 * @return {?}
815 */
816 ngOnDestroy() {
817 this.subscriptions.forEach((/**
818 * @param {?} subscription
819 * @return {?}
820 */
821 subscription => subscription.unsubscribe()));
822 }
823}
824DropDownFormSectionComponent.decorators = [
825 { type: Component, args: [{
826 selector: 'va-dropdown-form-section',
827 template: `
828 <mat-expansion-panel *ngIf="expandable || expandable == undefined" [expanded]="startOpen">
829 <mat-expansion-panel-header [collapsedHeight]="'*'" [expandedHeight]="'*'">
830 <div class="dropdown-form-header">
831 <mat-icon
832 [ngClass]="{invalid: iconName=='warning', valid: iconName=='check_circle', question: iconName=='help_outline'}">
833 {{ iconName }}
834 </mat-icon>
835 <mat-panel-title *ngIf="!displayAutoTitle">
836 {{ titleText }}
837 </mat-panel-title>
838 <mat-panel-title *ngIf="displayAutoTitle"
839 [ngClass]="{valid: iconName=='check_circle', invalid: iconName=='warning'}">
840 <div class="title"> {{ titleText }}</div>
841 <div *ngIf="titleText && autoTitleText"> &nbsp;</div>
842 <div><ng-container><i> {{autoTitleText}} </i></ng-container></div>
843 </mat-panel-title>
844 <mat-panel-description *ngIf="displayAutoDescription" [ngClass]="{invalid: iconName=='warning'}">
845 {{ autoDescriptionText }}
846 </mat-panel-description>
847 <mat-panel-description *ngIf="!displayAutoDescription" [ngClass]="{invalid: iconName=='warning'}">
848 <i> {{descriptionText}} </i>
849 </mat-panel-description>
850 </div>
851 </mat-expansion-panel-header>
852 <div class="expansion-panel-body">
853 <va-field *ngFor="let field of fields" [field]="field"
854 [form]="parentForm.controls[titleText + uniqueIndex]"
855 ></va-field>
856 <p *ngIf="editingHint != ''" class="editing-hint"><i>{{ editingHint }}</i></p>
857 </div>
858 </mat-expansion-panel>
859 `,
860 styles: [":host-context(va-dropdown-form-section){font-size:14px}:host-context(va-dropdown-form-section) .expansion-panel-body{margin-top:-10px;display:block}@media screen and (min-width:600px){:host-context(va-dropdown-form-section) .expansion-panel-body{width:60%}}.mat-expanded,.mat-expansion-panel{-webkit-transition:margin .4s;transition:margin .4s}mat-expansion-panel-header{min-height:48px;padding:12px 24px}.dropdown-form-header{width:90%;display:-webkit-box;display:flex}mat-panel-description{align-self:center;-webkit-box-flex:inherit;flex:inherit;display:initial;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}mat-panel-description.invalid{color:#c62828}mat-icon{margin-right:7px;-ms-grid-row-align:center;align-self:center}mat-icon.valid{color:#4caf50}mat-icon.invalid{color:#c62828}mat-icon.question{color:#9e9e9e}mat-panel-title{align-self:center;-webkit-box-flex:0;flex:none;margin-right:20px;display:-webkit-box;display:flex;max-width:100%}mat-panel-title div{display:-webkit-box;display:flex}mat-panel-title.valid{color:#4caf50}mat-panel-title.invalid{color:#c62828}.editing-hint{color:#9e9e9e}.title{color:#212121}.not-expandable-card{background:#fff;cursor:default;font-size:15px;display:-webkit-box;display:flex;height:48px;-webkit-box-align:center;align-items:center;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.not-expandable-card .not-expandable-icon{margin-left:24px}.not-expandable-card .not-expandable-header{display:-webkit-box;display:flex}.not-expandable-card .not-expandable-description{margin-left:22px}.not-expandable-card .valid{color:#4caf50}"]
861 }] }
862];
863/** @nocollapse */
864DropDownFormSectionComponent.ctorParameters = () => [
865 { type: TranslateService }
866];
867DropDownFormSectionComponent.propDecorators = {
868 prepopulatedData: [{ type: Input }],
869 startOpen: [{ type: Input }],
870 parentForm: [{ type: Input }],
871 displayAutoTitle: [{ type: Input }],
872 titleText: [{ type: Input }],
873 displayAutoDescription: [{ type: Input }],
874 descriptionText: [{ type: Input }],
875 fields: [{ type: Input }],
876 editingHint: [{ type: Input }],
877 expandable: [{ type: Input }]
878};
879if (false) {
880 /** @type {?} */
881 DropDownFormSectionComponent.prototype.prepopulatedData;
882 /** @type {?} */
883 DropDownFormSectionComponent.prototype.startOpen;
884 /** @type {?} */
885 DropDownFormSectionComponent.prototype.parentForm;
886 /** @type {?} */
887 DropDownFormSectionComponent.prototype.displayAutoTitle;
888 /** @type {?} */
889 DropDownFormSectionComponent.prototype.titleText;
890 /** @type {?} */
891 DropDownFormSectionComponent.prototype.displayAutoDescription;
892 /** @type {?} */
893 DropDownFormSectionComponent.prototype.descriptionText;
894 /** @type {?} */
895 DropDownFormSectionComponent.prototype.fields;
896 /** @type {?} */
897 DropDownFormSectionComponent.prototype.editingHint;
898 /** @type {?} */
899 DropDownFormSectionComponent.prototype.expandable;
900 /** @type {?} */
901 DropDownFormSectionComponent.prototype.autoDescriptionText;
902 /** @type {?} */
903 DropDownFormSectionComponent.prototype.iconName;
904 /** @type {?} */
905 DropDownFormSectionComponent.prototype.subscriptions;
906 /** @type {?} */
907 DropDownFormSectionComponent.prototype.uniqueIndex;
908 /** @type {?} */
909 DropDownFormSectionComponent.prototype.autoTitleText;
910 /**
911 * @type {?}
912 * @private
913 */
914 DropDownFormSectionComponent.prototype.translateService;
915}
916
917/**
918 * @fileoverview added by tsickle
919 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
920 */
921class FieldComponent {
922 /**
923 * @return {?}
924 */
925 get isValid() {
926 return this.form.controls[this.field.id].valid || this.form.controls[this.field.id].pristine;
927 }
928 /**
929 * @param {?} field
930 * @return {?}
931 */
932 showCheckboxError(field) {
933 return this.form.controls[field].errors && this.form.controls[field].errors.required && this.form.controls[field].touched;
934 }
935}
936FieldComponent.decorators = [
937 { type: Component, args: [{
938 selector: 'va-field',
939 template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n <div *ngIf=\"!field.hidden\" [ngClass]=\"{'for-office-use-only': field.forOfficeUseOnly}\">\n <span *ngIf=\"field.forOfficeUseOnly\" class=\"office-text\">*For Office Use Only</span>\n\n <ng-container *ngSwitchCase=\"'dropdown'\">\n <ng-container *ngIf=\"!field.allowMultiples\">\n <mat-form-field class=\"form-field-container\">\n <mat-select matInput [formControlName]=\"field.id\" [id]=\"field.id\" [placeholder]=\"field.getLabel()\">\n <mat-option *ngFor=\"let option of field.options\" [value]=\"option.value\">{{ option.label }}</mat-option>\n </mat-select>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n <ng-container *ngIf=\"field.allowMultiples\">\n <va-input-tags class=\"form-field-container\" [id]=\"field.id\" [formControlName]=\"field.id\"\n [placeholder]=\"field.getLabel()\"\n [tooltip]=\"field.description\"\n [required]=\"field.required\"\n [options]=\"field.options\"\n [allowDuplicates]=\"field.allowDuplicates\"\n [maxFields]=\"field.maxChoices\">\n </va-input-tags>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'textbox'\">\n <mat-form-field class=\"form-field-container\">\n <span matPrefix *ngIf=\"field.prefix\"> {{ field.prefix}} &nbsp;</span>\n <input matInput [type]=\"field.textboxType\" [id]=\"field.id\" [formControlName]=\"field.id\" [placeholder]=\"field.getLabel()\" [pattern]=\"field.regexValidator || ''\"\n [readonly]=\"field.displayOnly\" [ngClass]=\"{'display-only': field.displayOnly}\">\n <span matSuffix *ngIf=\"field.suffix\"> &nbsp;{{ field.suffix }} </span>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n <mat-error *ngIf=\"form.controls[field.id].hasError('pattern')\"> {{field.regexErrorMessage}} </mat-error>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"form-field-container checkbox\">\n <mat-checkbox [formControlName]=\"field.id\" [id]=\"field.id\" ngControlDefault></mat-checkbox>\n <div class=\"checkbox-placeholder\"> {{field.label}}</div>\n <mat-error *ngIf=\"showCheckboxError(field.id)\" class=\"checkboxError\"> *Required </mat-error>\n </div>\n <div class=\"checkbox-description\" *ngIf=\"field.description\">{{ field.description }}</div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'textarea'\">\n <mat-form-field class=\"form-field-container\">\n <textarea matInput [formControlName]=\"field.id\" [placeholder]=\"field.getLabel()\" [id]=\"field.id\"></textarea>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <div class=\"form-field-container\">\n <file-group-uploader [uploadUrl]=\"field.uploadUrl\" [label]=\"field.getLabel()\" [description]=\"field.description\" [formGroup]=\"form\" [formControlName]=\"field.id\"\n [numFiles]=\"field.numFiles\" class=\"form-field-container\"></file-group-uploader>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'vbcuser'\">\n <mat-form-field class=\"form-field-container\">\n <mat-select matInput [formControlName]=\"field.id\" [id]=\"field.id\" [placeholder]=\"field.getLabel()\">\n <mat-option *ngFor=\"let option of field.options\" [value]=\"option.value\" [disabled]=\"option.disabled\">{{ option.label }}</mat-option>\n </mat-select>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n </div>\n</ng-container>\n",
940 styles: [".form-field-container{font-size:16px;width:100%;margin:10px 0}.checkbox{display:-webkit-box;display:flex;padding:5px 0;color:rgba(0,0,0,.54);margin-top:24px}.checkbox .checkbox-placeholder{margin-left:10px}.checkbox-description{margin-top:-14px;margin-left:32px;color:rgba(0,0,0,.54);font-size:12px}.for-office-use-only{position:relative}.office-text{font-size:8px;position:absolute;right:5px}.display-only{color:rgba(0,0,0,.38)}.checkboxError{padding-left:16px}"]
941 }] }
942];
943FieldComponent.propDecorators = {
944 field: [{ type: Input }],
945 form: [{ type: Input }]
946};
947if (false) {
948 /** @type {?} */
949 FieldComponent.prototype.field;
950 /** @type {?} */
951 FieldComponent.prototype.form;
952}
953
954/**
955 * @fileoverview added by tsickle
956 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
957 */
958class FieldService {
959 /**
960 * @param {?} field
961 * @return {?}
962 */
963 createFormControl(field) {
964 if (field.required) {
965 return new FormControl(field.value, Validators.required);
966 }
967 else {
968 return new FormControl(field.value);
969 }
970 }
971 /**
972 * @param {?} formFields
973 * @param {?} subscriptions
974 * @return {?}
975 */
976 toFormGroup(formFields, subscriptions) {
977 /** @type {?} */
978 const group = {};
979 formFields.forEach((/**
980 * @param {?} field
981 * @return {?}
982 */
983 field => {
984 /** @type {?} */
985 let formControl;
986 if (field.controlType === 'checkbox') {
987 formControl = new FormControl(field.value);
988 }
989 else {
990 formControl = this.createFormControl(field);
991 }
992 group[field.id] = formControl;
993 if (subscriptions) {
994 subscriptions.push(formControl.valueChanges.subscribe((/**
995 * @param {?} value
996 * @return {?}
997 */
998 value => (field.value = value))));
999 }
1000 }));
1001 return new FormGroup(group);
1002 }
1003}
1004FieldService.decorators = [
1005 { type: Injectable }
1006];
1007
1008/**
1009 * @fileoverview added by tsickle
1010 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1011 */
1012class VaHeaderContainerComponent {
1013 /**
1014 * @param {?} translateService
1015 */
1016 constructor(translateService) {
1017 this.translateService = translateService;
1018 this.loaded = true;
1019 this.showEnableAddon = false;
1020 this.prerequisiteSelected = new EventEmitter();
1021 this.actionSelected = new EventEmitter();
1022 this.primaryPricingActionSelected = new EventEmitter();
1023 this.pricingActionSelected = new EventEmitter();
1024 this.translateService.setTranslation('en', En.en, true);
1025 }
1026 /**
1027 * @return {?}
1028 */
1029 onActionSelected() {
1030 this.actionSelected.emit();
1031 }
1032 /**
1033 * @return {?}
1034 */
1035 onPrerequisiteSelected() {
1036 this.prerequisiteSelected.emit();
1037 }
1038 /**
1039 * @param {?} billedProduct
1040 * @return {?}
1041 */
1042 showPricingModel(billedProduct) {
1043 return billedProduct && [BillingModel.Tiered, BillingModel.Stairstep].includes(billedProduct.billingModel);
1044 }
1045 /**
1046 * @param {?} billingModel
1047 * @return {?}
1048 */
1049 getPricingModelTooltips(billingModel) {
1050 switch (billingModel) {
1051 case BillingModel.Stairstep:
1052 return this.translateService.stream('FRONTEND.STORE.PRICE_APPLIES_PER_UNIT');
1053 case BillingModel.Tiered:
1054 return this.translateService.stream('FRONTEND.STORE.PRICE_APPLIES_TO_ALL_UNITS');
1055 default:
1056 return of('');
1057 }
1058 }
1059}
1060VaHeaderContainerComponent.decorators = [
1061 { type: Component, args: [{
1062 selector: 'va-header-container',
1063 template: "<div class=\"header-container\">\n <div class=\"product-overview\">\n <div class=\"product-id\">\n\n <va-icon [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"120\"></va-icon>\n\n <div class=\"product-id-text\">\n\n <h1 [ngClass]=\"{'stencil-title stencil-shimmer': !title, 'product-title': title}\">\n {{ title }}\n </h1>\n\n <span [ngClass]=\"{'stencil-tagline stencil-shimmer': !title && !tagline, 'tagline': tagline}\">\n {{ tagline }}\n </span>\n\n <div *ngIf=\"prerequisite\" class=\"prerequisite\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }}</span>\n <span>{{ prerequisite }}</span>\n </div>\n\n <mat-chip-list>\n <mat-chip *ngFor=\"let chip of chipLabels\">{{ chip }}</mat-chip>\n </mat-chip-list>\n\n </div>\n </div>\n\n <div class=\"pricing\">\n\n <button *ngIf=\"showAction && !showEnableAddon\" mat-raised-button class=\"app-enable-button\" [disabled]=\"!actionEnabled\" (click)=\"onActionSelected()\">\n {{ actionLabel }}\n </button>\n\n <button *ngIf=\"showEnableAddon && !showAction\" mat-raised-button class=\"app-enable-button\" [disabled]=\"!showEnableAddon\" (click)=\"onActionSelected()\">\n {{ actionLabel }}\n </button>\n\n <div *ngIf=\"prerequisiteLabel && !showEnableAddon\" class=\"addon-enable\" (click)=\"onPrerequisiteSelected()\">\n {{ 'FRONTEND.STORE.ENABLED_WITH_PREREQUISITE' | translate: {prerequisite: prerequisiteLabel } }}\n </div>\n\n <div *ngIf=\"showPricing\" class=\"price-box\">\n <div *ngIf=\"pricing?.prices?.length\" class=\"wholesale-price\">{{ pricingLabel }}\n <div *ngIf=\"showPricingModel(billedProduct) && hasVerifiedContract\"\n class=\"pricing-model\"\n [matTooltip]=\"getPricingModelTooltips(billedProduct.billingModel) | async\">({{ billedProduct.billingModel }})\n </div>\n </div>\n <va-pricing [pricing]=\"pricing\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"></va-pricing>\n </div>\n\n <p *ngIf=\"pricingActionEnabled\" class=\"pricing-action-container\">\n <a (click)=\"primaryPricingActionSelected.emit()\">{{ primaryPricingActionLabel }}</a>\n <a (click)=\"pricingActionSelected.emit()\">{{ pricingActionLabel }}</a>\n </p>\n\n </div>\n\n </div>\n</div>\n",
1064 styles: [":host{font-size:16px}.product-title{font-size:24px}.product-overview{display:-webkit-box;display:flex;flex-wrap:wrap;border-bottom:1px solid #e0e0e0}.product-overview h1{margin:0;font-weight:400;line-height:1.2}.product-overview mat-chip{margin-bottom:3px}.product-id{display:-webkit-box;display:flex;width:100%;padding:24px;-webkit-box-flex:1;flex-grow:1}.product-id va-icon{margin-right:20px}@media screen and (max-width:600px){.product-id va-icon ::ng-deep .va-icon-container{width:40px!important;height:40px!important}.product-id va-icon ::ng-deep .va-icon-container span{line-height:40px!important;font-size:15px!important}}.product-id .product-id-text{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.product-id span{overflow:hidden}.product-id .tagline{color:#616161;margin:.5em 0 1em;font-size:16px}@media screen and (min-width:600px){.product-title{font-size:32px}.product-id .tagline{font-size:20px}.product-id{width:66%;padding-right:20px}}.product-id .prerequisite{margin:.5em 0 1em;font-size:14px}.product-id .requires-text{color:#9e9e9e}.inline-link{display:-webkit-inline-box!important;display:inline-flex!important;color:#1e88e5;cursor:pointer;padding-top:5px}.pricing{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;width:100%;padding:0 24px 24px;color:#616161}@media screen and (min-width:600px){.pricing{width:34%;padding-top:24px;padding-left:20px}}.pricing span{display:block}.pricing span:nth-child(2){margin:.5em 0 1em}.pricing .price{font-size:24px;font-weight:700;line-height:1;color:#4caf50}.pricing .price-box{padding-top:10px}.pricing .pricing-action-container{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;margin:8px 0}.pricing .pricing-action-container mat-icon{vertical-align:middle;margin-right:6px}.pricing .pricing-action-container a{cursor:pointer;margin:5px 0}.pricing .pricing-model{display:inline-block;font-size:.8rem;color:#9e9e9e;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.app-enable-button{height:inherit;color:#fff;background-color:#4caf50;font-size:20px;padding:14px 16px;line-height:1}.addon-enable{height:inherit;background-color:#e0e0e0;font-size:14px;padding:14px 16px;line-height:1;color:#1e88e5;cursor:pointer;text-align:center}.wholesale-price{margin-top:0;padding-bottom:8px;margin-bottom:4px;border-bottom:1px solid #e0e0e0}.stencil-title{height:32px;width:200px;margin-bottom:5px!important}.stencil-tagline{height:32px;width:250px}"]
1065 }] }
1066];
1067/** @nocollapse */
1068VaHeaderContainerComponent.ctorParameters = () => [
1069 { type: TranslateService }
1070];
1071VaHeaderContainerComponent.propDecorators = {
1072 iconUrl: [{ type: Input }],
1073 title: [{ type: Input }],
1074 tagline: [{ type: Input }],
1075 prerequisite: [{ type: Input }],
1076 chipLabels: [{ type: Input }],
1077 pricing: [{ type: Input }],
1078 billedProduct: [{ type: Input }],
1079 loaded: [{ type: Input }],
1080 hasVerifiedContract: [{ type: Input }],
1081 pricingLabel: [{ type: Input }],
1082 primaryPricingActionLabel: [{ type: Input }],
1083 pricingActionLabel: [{ type: Input }],
1084 pricingActionEnabled: [{ type: Input }],
1085 actionEnabled: [{ type: Input }],
1086 actionLabel: [{ type: Input }],
1087 showAction: [{ type: Input }],
1088 showPricing: [{ type: Input }],
1089 showEnableAddon: [{ type: Input }],
1090 prerequisiteLabel: [{ type: Input }],
1091 prerequisiteSelected: [{ type: Output }],
1092 actionSelected: [{ type: Output }],
1093 primaryPricingActionSelected: [{ type: Output }],
1094 pricingActionSelected: [{ type: Output }]
1095};
1096if (false) {
1097 /** @type {?} */
1098 VaHeaderContainerComponent.prototype.iconUrl;
1099 /** @type {?} */
1100 VaHeaderContainerComponent.prototype.title;
1101 /** @type {?} */
1102 VaHeaderContainerComponent.prototype.tagline;
1103 /** @type {?} */
1104 VaHeaderContainerComponent.prototype.prerequisite;
1105 /** @type {?} */
1106 VaHeaderContainerComponent.prototype.chipLabels;
1107 /** @type {?} */
1108 VaHeaderContainerComponent.prototype.pricing;
1109 /** @type {?} */
1110 VaHeaderContainerComponent.prototype.billedProduct;
1111 /** @type {?} */
1112 VaHeaderContainerComponent.prototype.loaded;
1113 /** @type {?} */
1114 VaHeaderContainerComponent.prototype.hasVerifiedContract;
1115 /** @type {?} */
1116 VaHeaderContainerComponent.prototype.pricingLabel;
1117 /** @type {?} */
1118 VaHeaderContainerComponent.prototype.primaryPricingActionLabel;
1119 /** @type {?} */
1120 VaHeaderContainerComponent.prototype.pricingActionLabel;
1121 /** @type {?} */
1122 VaHeaderContainerComponent.prototype.pricingActionEnabled;
1123 /** @type {?} */
1124 VaHeaderContainerComponent.prototype.actionEnabled;
1125 /** @type {?} */
1126 VaHeaderContainerComponent.prototype.actionLabel;
1127 /** @type {?} */
1128 VaHeaderContainerComponent.prototype.showAction;
1129 /** @type {?} */
1130 VaHeaderContainerComponent.prototype.showPricing;
1131 /** @type {?} */
1132 VaHeaderContainerComponent.prototype.showEnableAddon;
1133 /** @type {?} */
1134 VaHeaderContainerComponent.prototype.prerequisiteLabel;
1135 /** @type {?} */
1136 VaHeaderContainerComponent.prototype.prerequisiteSelected;
1137 /** @type {?} */
1138 VaHeaderContainerComponent.prototype.actionSelected;
1139 /** @type {?} */
1140 VaHeaderContainerComponent.prototype.primaryPricingActionSelected;
1141 /** @type {?} */
1142 VaHeaderContainerComponent.prototype.pricingActionSelected;
1143 /**
1144 * @type {?}
1145 * @private
1146 */
1147 VaHeaderContainerComponent.prototype.translateService;
1148}
1149
1150/**
1151 * @fileoverview added by tsickle
1152 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1153 */
1154class VaHeaderContainerModule {
1155}
1156VaHeaderContainerModule.decorators = [
1157 { type: NgModule, args: [{
1158 imports: [
1159 CommonModule,
1160 MatIconModule,
1161 VaPricingModule,
1162 VaIconModule,
1163 MatChipsModule,
1164 MatButtonModule,
1165 MatTooltipModule,
1166 TranslateModule
1167 ],
1168 declarations: [VaHeaderContainerComponent],
1169 exports: [VaHeaderContainerComponent]
1170 },] }
1171];
1172
1173/**
1174 * @fileoverview added by tsickle
1175 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1176 */
1177class OrderFormSectionData {
1178}
1179if (false) {
1180 /** @type {?} */
1181 OrderFormSectionData.prototype.parentForm;
1182 /** @type {?} */
1183 OrderFormSectionData.prototype.titleText;
1184 /** @type {?} */
1185 OrderFormSectionData.prototype.subtitleText;
1186 /** @type {?} */
1187 OrderFormSectionData.prototype.descriptionText;
1188 /** @type {?} */
1189 OrderFormSectionData.prototype.iconUrl;
1190 /** @type {?} */
1191 OrderFormSectionData.prototype.primarySection;
1192 /** @type {?} */
1193 OrderFormSectionData.prototype.subsections;
1194}
1195
1196/**
1197 * @fileoverview added by tsickle
1198 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1199 */
1200class OrderFormSectionComponent {
1201 constructor() { }
1202 /**
1203 * @return {?}
1204 */
1205 ngOnInit() {
1206 // The first section should always be expanded.
1207 /** @type {?} */
1208 const topSection = this.getTopSection();
1209 if (topSection) {
1210 topSection.startOpen = true;
1211 }
1212 }
1213 /**
1214 * @return {?}
1215 */
1216 getTopSection() {
1217 if (!this.data) {
1218 return null;
1219 }
1220 if (this.data.primarySection) {
1221 return this.data.primarySection;
1222 }
1223 if (this.data.subsections && this.data.subsections.length > 0) {
1224 return this.data.subsections[0];
1225 }
1226 return null;
1227 }
1228}
1229OrderFormSectionComponent.decorators = [
1230 { type: Component, args: [{
1231 selector: 'va-order-form-section',
1232 template: "<div>\n <mat-card class=\"va-order-form-section-header mat-card\">\n <div class=\"product-overview\">\n <div class=\"product-id\">\n <va-icon [iconUrl]=\"data.iconUrl\" [name]=\"data.titleText\" [diameter]=\"45\"></va-icon>\n <div class=\"product-id-text\">\n <h1 class=\"product-title\">{{ data.titleText }}</h1>\n <span *ngIf=\"data.subtitleText\" class=\"tagline\">{{ data.subtitleText }}</span>\n </div>\n </div>\n <div class=\"description\" *ngIf=\"data.descriptionText\">\n <span>{{ data.descriptionText }}</span>\n </div>\n </div>\n </mat-card>\n <va-dropdown-form-section class=\"va-primary-form-section\" *ngIf=\"data.primarySection\"\n [titleText]=\"data.primarySection.titleText\"\n [editingHint]=\"data.primarySection.editingHint\"\n [displayAutoDescription]=\"data.primarySection.displayAutoDescription\"\n [descriptionText]=\"data.primarySection.descriptionText\"\n [displayAutoTitle]=\"data.primarySection.displayAutoTitle\"\n [prepopulatedData]=\"data.primarySection.prepopulatedData\"\n [parentForm]=\"data.parentForm\"\n [fields]=\"data.primarySection.fields\"\n [startOpen]=\"data.primarySection.startOpen\"\n [expandable]=\"data.primarySection.expandable\">\n </va-dropdown-form-section>\n <ng-container *ngIf=\"data.subsections?.length > 0\">\n <va-dropdown-form-section class=\"va-secondary-form-section\" *ngFor=\"let addon of data.subsections\"\n [titleText]=\"addon.titleText\"\n [editingHint]=\"addon.editingHint\"\n [displayAutoDescription]=\"addon.displayAutoDescription\"\n [descriptionText]=\"addon.descriptionText\"\n [displayAutoTitle]=\"addon.displayAutoTitle\"\n [prepopulatedData]=\"addon.prepopulatedData\"\n [parentForm]=\"data.parentForm\"\n [fields]=\"addon.fields\"\n [startOpen]=\"addon.startOpen\"\n [expandable]=\"addon.expandable\">\n </va-dropdown-form-section>\n </ng-container>\n <ng-container *ngIf=\"!data.primarySection && !(data.subsections?.length > 0)\">\n <mat-card class=\"not-expandable-card\">\n <ng-content></ng-content>\n </mat-card>\n </ng-container>\n</div>\n",
1233 styles: [":host{font-size:16px}mat-card.va-order-form-section-header{margin-bottom:0;border-bottom-color:#e0e0e0;border-bottom-width:1px;box-shadow:0 0 1px -2px rgba(0,0,0,.2),0 0 2px 0 rgba(0,0,0,.14),0 0 5px 0 rgba(0,0,0,.12)}.product-title{font-size:16px}va-mat-card{margin-bottom:24px}.product-overview{display:-webkit-box;display:flex;flex-wrap:wrap}.product-overview h1{margin:0;font-weight:700}.product-id{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.product-id va-icon{margin-right:20px}@media screen and (max-width:600px){.product-id va-icon ::ng-deep .va-icon-container{width:40px!important;height:40px!important}}.product-id .product-id-text{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.product-id span{display:block;overflow:hidden}.product-id .tagline{color:#616161;margin-top:8px;font-size:16px}@media screen and (min-width:600px){.product-id{width:66%;padding-right:16px}}.description{padding-top:16px;width:100%;color:#616161}"]
1234 }] }
1235];
1236/** @nocollapse */
1237OrderFormSectionComponent.ctorParameters = () => [];
1238OrderFormSectionComponent.propDecorators = {
1239 data: [{ type: Input }]
1240};
1241if (false) {
1242 /** @type {?} */
1243 OrderFormSectionComponent.prototype.data;
1244}
1245
1246/**
1247 * @fileoverview added by tsickle
1248 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1249 */
1250class DropDownFormSectionData {
1251 constructor() {
1252 /* tslint:disable */
1253 this.expandable = true;
1254 /* tslint:enable */
1255 }
1256}
1257if (false) {
1258 /** @type {?} */
1259 DropDownFormSectionData.prototype.prepopulatedData;
1260 /** @type {?} */
1261 DropDownFormSectionData.prototype.startOpen;
1262 /** @type {?} */
1263 DropDownFormSectionData.prototype.parentForm;
1264 /** @type {?} */
1265 DropDownFormSectionData.prototype.displayAutoTitle;
1266 /** @type {?} */
1267 DropDownFormSectionData.prototype.titleText;
1268 /** @type {?} */
1269 DropDownFormSectionData.prototype.displayAutoDescription;
1270 /** @type {?} */
1271 DropDownFormSectionData.prototype.descriptionText;
1272 /** @type {?} */
1273 DropDownFormSectionData.prototype.fields;
1274 /** @type {?} */
1275 DropDownFormSectionData.prototype.editingHint;
1276 /** @type {?} */
1277 DropDownFormSectionData.prototype.expandable;
1278}
1279
1280/**
1281 * @fileoverview added by tsickle
1282 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1283 */
1284/**
1285 * @record
1286 */
1287function OrderLabelsInterface() { }
1288if (false) {
1289 /** @type {?} */
1290 OrderLabelsInterface.prototype.commonForm;
1291}
1292/**
1293 * @record
1294 */
1295function OrderFormInterface() { }
1296if (false) {
1297 /** @type {?} */
1298 OrderFormInterface.prototype.appId;
1299 /** @type {?|undefined} */
1300 OrderFormInterface.prototype.addonId;
1301 /** @type {?|undefined} */
1302 OrderFormInterface.prototype.commonForm;
1303 /** @type {?|undefined} */
1304 OrderFormInterface.prototype.commonFormRequiredFields;
1305 /** @type {?|undefined} */
1306 OrderFormInterface.prototype.customFields;
1307}
1308/**
1309 * @record
1310 */
1311function IncludedCommonFormFieldsInterface() { }
1312if (false) {
1313 /** @type {?|undefined} */
1314 IncludedCommonFormFieldsInterface.prototype.businessName;
1315 /** @type {?|undefined} */
1316 IncludedCommonFormFieldsInterface.prototype.businessAddress;
1317 /** @type {?|undefined} */
1318 IncludedCommonFormFieldsInterface.prototype.businessPhoneNumber;
1319 /** @type {?|undefined} */
1320 IncludedCommonFormFieldsInterface.prototype.businessAccountGroupId;
1321 /** @type {?|undefined} */
1322 IncludedCommonFormFieldsInterface.prototype.businessWebsite;
1323 /** @type {?|undefined} */
1324 IncludedCommonFormFieldsInterface.prototype.salespersonName;
1325 /** @type {?|undefined} */
1326 IncludedCommonFormFieldsInterface.prototype.salespersonPhoneNumber;
1327 /** @type {?|undefined} */
1328 IncludedCommonFormFieldsInterface.prototype.salespersonEmail;
1329 /** @type {?|undefined} */
1330 IncludedCommonFormFieldsInterface.prototype.contactName;
1331 /** @type {?|undefined} */
1332 IncludedCommonFormFieldsInterface.prototype.contactPhoneNumber;
1333 /** @type {?|undefined} */
1334 IncludedCommonFormFieldsInterface.prototype.contactEmail;
1335}
1336/**
1337 * @record
1338 */
1339function CommonFormSectionInterface() { }
1340if (false) {
1341 /** @type {?} */
1342 CommonFormSectionInterface.prototype.fields;
1343 /** @type {?|undefined} */
1344 CommonFormSectionInterface.prototype.sectionName;
1345 /** @type {?|undefined} */
1346 CommonFormSectionInterface.prototype.populatedData;
1347}
1348/**
1349 * @record
1350 */
1351function AddonKeyInterface() { }
1352if (false) {
1353 /** @type {?|undefined} */
1354 AddonKeyInterface.prototype.addonId;
1355 /** @type {?|undefined} */
1356 AddonKeyInterface.prototype.appId;
1357}
1358/**
1359 * @record
1360 */
1361function CommonFormFieldInterface() { }
1362if (false) {
1363 /** @type {?|undefined} */
1364 CommonFormFieldInterface.prototype.productIds;
1365 /** @type {?|undefined} */
1366 CommonFormFieldInterface.prototype.addonKeys;
1367}
1368/**
1369 * @record
1370 */
1371function CommonFieldIdsInterface() { }
1372if (false) {
1373 /** @type {?} */
1374 CommonFieldIdsInterface.prototype.fieldId;
1375 /** @type {?} */
1376 CommonFieldIdsInterface.prototype.required;
1377}
1378/**
1379 * @record
1380 */
1381function CommonFormData() { }
1382if (false) {
1383 /** @type {?|undefined} */
1384 CommonFormData.prototype.contact_email;
1385 /** @type {?|undefined} */
1386 CommonFormData.prototype.contact_name;
1387 /** @type {?|undefined} */
1388 CommonFormData.prototype.contact_phone_number;
1389 /** @type {?|undefined} */
1390 CommonFormData.prototype.business_account_group_id;
1391 /** @type {?|undefined} */
1392 CommonFormData.prototype.business_name;
1393 /** @type {?|undefined} */
1394 CommonFormData.prototype.business_address;
1395 /** @type {?|undefined} */
1396 CommonFormData.prototype.business_phone_number;
1397 /** @type {?|undefined} */
1398 CommonFormData.prototype.business_website;
1399 /** @type {?|undefined} */
1400 CommonFormData.prototype.salesperson_name;
1401 /** @type {?|undefined} */
1402 CommonFormData.prototype.salesperson_email;
1403 /** @type {?|undefined} */
1404 CommonFormData.prototype.salesperson_phone_number;
1405}
1406class ProductOrderFormSectionData extends OrderFormSectionData {
1407}
1408if (false) {
1409 /** @type {?} */
1410 ProductOrderFormSectionData.prototype.productId;
1411 /** @type {?} */
1412 ProductOrderFormSectionData.prototype.subsections;
1413}
1414class AddonDropDownFormSectionData extends DropDownFormSectionData {
1415}
1416if (false) {
1417 /** @type {?} */
1418 AddonDropDownFormSectionData.prototype.productId;
1419 /** @type {?} */
1420 AddonDropDownFormSectionData.prototype.addonId;
1421}
1422/**
1423 * @record
1424 */
1425function ProductInfoInterface() { }
1426if (false) {
1427 /** @type {?} */
1428 ProductInfoInterface.prototype.productId;
1429 /** @type {?|undefined} */
1430 ProductInfoInterface.prototype.name;
1431 /** @type {?|undefined} */
1432 ProductInfoInterface.prototype.tagline;
1433 /** @type {?|undefined} */
1434 ProductInfoInterface.prototype.icon;
1435 /** @type {?|undefined} */
1436 ProductInfoInterface.prototype.addonInfo;
1437}
1438/**
1439 * @record
1440 */
1441function AddonInfoInterface() { }
1442if (false) {
1443 /** @type {?} */
1444 AddonInfoInterface.prototype.addonId;
1445 /** @type {?|undefined} */
1446 AddonInfoInterface.prototype.name;
1447}
1448/**
1449 * @record
1450 */
1451function CustomFieldsAnswers() { }
1452if (false) {
1453 /** @type {?} */
1454 CustomFieldsAnswers.prototype.productID;
1455 /** @type {?|undefined} */
1456 CustomFieldsAnswers.prototype.addonKey;
1457 /** @type {?} */
1458 CustomFieldsAnswers.prototype.customFieldsAnswers;
1459}
1460/**
1461 * @record
1462 */
1463function CustomFieldsAnswer() { }
1464if (false) {
1465 /** @type {?} */
1466 CustomFieldsAnswer.prototype.fieldId;
1467 /** @type {?|undefined} */
1468 CustomFieldsAnswer.prototype.answer;
1469}
1470/**
1471 * @record
1472 */
1473function OrderFormOptionsInterface() { }
1474if (false) {
1475 /** @type {?|undefined} */
1476 OrderFormOptionsInterface.prototype.bypassRequiredQuestions;
1477 /** @type {?|undefined} */
1478 OrderFormOptionsInterface.prototype.readOnly;
1479 /** @type {?|undefined} */
1480 OrderFormOptionsInterface.prototype.showOfficeUseQuestions;
1481}
1482
1483/**
1484 * @fileoverview added by tsickle
1485 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1486 */
1487class OrderFormService {
1488 constructor() {
1489 }
1490 /**
1491 * @private
1492 * @param {?} orderForm
1493 * @return {?}
1494 */
1495 static extractRequiredCommonFieldIds(orderForm) {
1496 if (!orderForm || !orderForm.commonFormRequiredFields) {
1497 return [];
1498 }
1499 return Object.keys(orderForm.commonFormRequiredFields).filter((/**
1500 * @param {?} k
1501 * @return {?}
1502 */
1503 k => orderForm.commonFormRequiredFields[k]));
1504 }
1505 /**
1506 * @private
1507 * @param {?} orderForms
1508 * @return {?}
1509 */
1510 static buildCommonFieldIds(orderForms) {
1511 /** @type {?} */
1512 const commonFieldIdsMap = new Map();
1513 for (const key in OrderFormService.camelToSnakeCaseMap) {
1514 if (key) {
1515 commonFieldIdsMap.set(key, {
1516 fieldId: key,
1517 required: false,
1518 });
1519 }
1520 }
1521 orderForms.map((/**
1522 * @param {?} orderForm
1523 * @return {?}
1524 */
1525 orderForm => {
1526 /** @type {?} */
1527 const requiredCommonFieldIds = this.extractRequiredCommonFieldIds(orderForm);
1528 requiredCommonFieldIds.map((/**
1529 * @param {?} fieldId
1530 * @return {?}
1531 */
1532 fieldId => {
1533 /** @type {?} */
1534 const commonFieldId = commonFieldIdsMap.get(fieldId);
1535 commonFieldId.required = true;
1536 commonFieldIdsMap.set(fieldId, commonFieldId);
1537 }));
1538 }));
1539 return Array.from(commonFieldIdsMap.values());
1540 }
1541 /**
1542 * @private
1543 * @param {?} fieldIds
1544 * @param {?} commonData
1545 * @param {?} labels
1546 * @param {?} options
1547 * @return {?}
1548 */
1549 static fillCommonFormSections(fieldIds, commonData, labels, options) {
1550 /** @type {?} */
1551 const commonFormSections = OrderFormService.buildCommonOrderFormFields(fieldIds, labels, options);
1552 return commonFormSections.map((/**
1553 * @param {?} section
1554 * @return {?}
1555 */
1556 section => (Object.assign({}, section, { populatedData: commonData }))));
1557 }
1558 /**
1559 * @private
1560 * @param {?} fieldIds
1561 * @param {?} labels
1562 * @param {?} options
1563 * @return {?}
1564 */
1565 static buildCommonOrderFormFields(fieldIds, labels, options) {
1566 /** @type {?} */
1567 const businessSection = {
1568 sectionName: labels.commonForm.businessSectionTitle || 'Business',
1569 fields: []
1570 };
1571 /** @type {?} */
1572 const salespersonSection = {
1573 sectionName: labels.commonForm.salespersonSectionTitle || 'Salesperson',
1574 fields: []
1575 };
1576 /** @type {?} */
1577 const contactSection = {
1578 sectionName: labels.commonForm.contactSectionTitle || 'Contact',
1579 fields: []
1580 };
1581 for (const field of fieldIds) {
1582 /** @type {?} */
1583 const fieldLabel = this.getLabelForFieldId(field.fieldId, labels);
1584 /** @type {?} */
1585 const commonFormField = new TextboxField({
1586 id: OrderFormService.camelToSnakeCaseMap[field.fieldId],
1587 label: fieldLabel,
1588 textboxType: 'text'
1589 });
1590 commonFormField.displayOnly = commonFormField.id === 'business_account_group_id';
1591 commonFormField.disabled = options.readOnly;
1592 if (!options.bypassRequiredQuestions) {
1593 commonFormField.required = field.required;
1594 }
1595 if (field.fieldId.startsWith('contact')) {
1596 contactSection.fields.push(commonFormField);
1597 }
1598 if (field.fieldId.startsWith('business')) {
1599 businessSection.fields.push(commonFormField);
1600 }
1601 if (field.fieldId.startsWith('salesperson')) {
1602 if (!options.showOfficeUseQuestions) {
1603 commonFormField.hidden = true;
1604 }
1605 salespersonSection.fields.push(commonFormField);
1606 }
1607 }
1608 return [businessSection, contactSection, salespersonSection].filter((/**
1609 * @param {?} section
1610 * @return {?}
1611 */
1612 section => section.fields ? section.fields.length > 0 : false));
1613 }
1614 /**
1615 * @private
1616 * @param {?} fieldId
1617 * @param {?} labels
1618 * @return {?}
1619 */
1620 static getLabelForFieldId(fieldId, labels) {
1621 return labels.commonForm[fieldId] || '';
1622 }
1623 /**
1624 * @private
1625 * @param {?} parentForm
1626 * @return {?}
1627 */
1628 static buildOrderFormSectionData(parentForm) {
1629 /** @type {?} */
1630 const section = new AddonDropDownFormSectionData();
1631 section.displayAutoTitle = true;
1632 section.descriptionText = '';
1633 section.displayAutoDescription = false;
1634 section.parentForm = parentForm;
1635 return section;
1636 }
1637 /**
1638 * @private
1639 * @param {?} customFields
1640 * @param {?} fileUploadUrl
1641 * @param {?} users
1642 * @param {?} answers
1643 * @param {?} options
1644 * @return {?}
1645 */
1646 static buildCustomOrderFormFields(customFields, fileUploadUrl, users, answers, options) {
1647 /** @type {?} */
1648 const fieldTypeMap = {
1649 text: TextboxField,
1650 textbox: TextboxField,
1651 dropdown: DropdownField,
1652 checkbox: CheckboxField,
1653 file: FileUploadGroupField,
1654 textarea: TextareaField,
1655 vbcuser: VBCUserField
1656 };
1657 return customFields
1658 .filter((/**
1659 * @param {?} field
1660 * @return {?}
1661 */
1662 field => {
1663 return fieldTypeMap[field.type];
1664 }))
1665 .map((/**
1666 * @param {?} field
1667 * @return {?}
1668 */
1669 field => {
1670 /** @type {?} */
1671 const fieldClass = fieldTypeMap[field.type];
1672 /** @type {?} */
1673 const result = ((/**
1674 * @return {?}
1675 */
1676 function () {
1677 switch (fieldClass) {
1678 case VBCUserField:
1679 /** @type {?} */
1680 const fieldConfig = (/** @type {?} */ ({
1681 description: field.description,
1682 id: field.id,
1683 required: field.required,
1684 type: field.type,
1685 label: field.label,
1686 forOfficeUseOnly: field.forOfficeUseOnly,
1687 hidden: field.hidden,
1688 users: users // TODO: Get users in this component
1689 }));
1690 return new VBCUserField(fieldConfig);
1691 case FileUploadGroupField:
1692 /** @type {?} */
1693 const uploadField = (/** @type {?} */ (field));
1694 uploadField.uploadUrl = fileUploadUrl;
1695 return new FileUploadGroupField(uploadField);
1696 default:
1697 return new fieldClass(field);
1698 }
1699 }))();
1700 result.id = OrderFormService.encodeCustomFieldId(field.id);
1701 if (!options.showOfficeUseQuestions) {
1702 result.hidden = result.forOfficeUseOnly ? true : result.hidden;
1703 }
1704 result.required = options.bypassRequiredQuestions ? false : result.required;
1705 result.disabled = options.readOnly ? options.readOnly : result.disabled;
1706 if (answers) {
1707 /** @type {?} */
1708 const ca = answers.find((/**
1709 * @param {?} a
1710 * @return {?}
1711 */
1712 a => a.fieldId === field.id));
1713 if (ca) {
1714 try {
1715 result.value = JSON.parse(ca.answer);
1716 }
1717 catch (error) {
1718 result.value = ca.answer;
1719 }
1720 }
1721 }
1722 return result;
1723 }));
1724 }
1725 // Different products can have order form fields with the same fieldID, which will cause problem.
1726 // Please refer to https://github.com/vendasta/business-center-client/pull/1002
1727 // We will prefix the fieldID with uuid, and take it off before we same the order form into session storage
1728 /**
1729 * @private
1730 * @param {?} fieldId
1731 * @return {?}
1732 */
1733 static encodeCustomFieldId(fieldId) {
1734 /** @type {?} */
1735 const id = uuid();
1736 return `${id}#${fieldId}`;
1737 }
1738 /**
1739 * @private
1740 * @param {?} fieldId
1741 * @return {?}
1742 */
1743 static decodeCustomFieldId(fieldId) {
1744 return fieldId.replace(new RegExp('(.*#)'), '');
1745 }
1746 /**
1747 * @private
1748 * @param {?} fieldType
1749 * @return {?}
1750 */
1751 static mapFieldType(fieldType) {
1752 switch (fieldType) {
1753 case 'textbox':
1754 return FieldType.TEXT;
1755 case 'textarea':
1756 return FieldType.TEXTAREA;
1757 case 'checkbox':
1758 return FieldType.CHECKBOX;
1759 case 'dropdown':
1760 return FieldType.DROPDOWN;
1761 case 'file':
1762 return FieldType.FILE;
1763 case 'vbcuser':
1764 return FieldType.VBCUSER;
1765 default:
1766 return FieldType.NOT_SPECIFIED;
1767 }
1768 }
1769 /**
1770 * @private
1771 * @param {?} fieldBase
1772 * @return {?}
1773 */
1774 static orderFieldToSalesOrderField(fieldBase) {
1775 return new Field({
1776 fieldId: OrderFormService.decodeCustomFieldId(fieldBase.id),
1777 fieldType: OrderFormService.mapFieldType(fieldBase.controlType),
1778 label: fieldBase.label,
1779 description: fieldBase.description || '',
1780 prefix: fieldBase.prefix || '',
1781 suffix: fieldBase.suffix || '',
1782 regexValidator: fieldBase.regexValidator || '',
1783 regexErrorMessage: fieldBase.regexErrorMessage || '',
1784 answer: fieldBase.value ? JSON.stringify(fieldBase.value) : 'null'
1785 });
1786 }
1787 /**
1788 * @private
1789 * @param {?} orderFormData
1790 * @return {?}
1791 */
1792 static productOrderFormToCustomFields(orderFormData) {
1793 /** @type {?} */
1794 const primaryCustomField = new CustomField();
1795 primaryCustomField.productId = orderFormData.productId;
1796 primaryCustomField.fields = orderFormData.primarySection
1797 ? orderFormData.primarySection.fields.map((/**
1798 * @param {?} field
1799 * @return {?}
1800 */
1801 field => this.orderFieldToSalesOrderField(field)))
1802 : [];
1803 /** @type {?} */
1804 const secondaryCustomFields = orderFormData.subsections.map((/**
1805 * @param {?} subsection
1806 * @return {?}
1807 */
1808 subsection => {
1809 /** @type {?} */
1810 const customField = new CustomField();
1811 if (subsection.addonId) {
1812 customField.addonKey = new AddonKey({
1813 appId: subsection.productId,
1814 addonId: subsection.addonId
1815 });
1816 }
1817 else {
1818 customField.productId = orderFormData.productId;
1819 }
1820 customField.fields = subsection.fields.map((/**
1821 * @param {?} field
1822 * @return {?}
1823 */
1824 field => this.orderFieldToSalesOrderField(field)));
1825 return customField;
1826 }));
1827 return [].concat(primaryCustomField, secondaryCustomFields);
1828 }
1829 /**
1830 * @param {?} orderForms
1831 * @param {?} commonData
1832 * @param {?} labels
1833 * @param {?} options
1834 * @return {?}
1835 */
1836 static getCommonFormSections(orderForms, commonData, labels, options) {
1837 /** @type {?} */
1838 const fieldIds = OrderFormService.buildCommonFieldIds(orderForms);
1839 return OrderFormService.fillCommonFormSections(fieldIds, commonData, labels, options);
1840 }
1841 /**
1842 * @param {?} orderForms
1843 * @param {?} products
1844 * @param {?} parentForm
1845 * @param {?} fileUploadUrl
1846 * @param {?} users
1847 * @param {?} answers
1848 * @param {?} options
1849 * @return {?}
1850 */
1851 static getCustomFormSections(orderForms, products, parentForm, fileUploadUrl, users, answers, options) {
1852 /** @type {?} */
1853 const formSections = products.map((/**
1854 * @param {?} product
1855 * @return {?}
1856 */
1857 product => {
1858 /** @type {?} */
1859 const subsections = [];
1860 (product.addonInfo || []).map((/**
1861 * @param {?} addon
1862 * @return {?}
1863 */
1864 addon => {
1865 /** @type {?} */
1866 const addonOrderForms = orderForms.filter((/**
1867 * @param {?} o
1868 * @return {?}
1869 */
1870 o => o.addonId === addon.addonId));
1871 /** @type {?} */
1872 const addonAnswers = (answers || []).filter((/**
1873 * @param {?} a
1874 * @return {?}
1875 */
1876 a => a.addonKey &&
1877 a.addonKey.appId === product.productId && a.addonKey.addonId === addon.addonId && a.productID === product.productId));
1878 addonOrderForms.map((/**
1879 * @param {?} addonOrderForm
1880 * @param {?} index
1881 * @return {?}
1882 */
1883 (addonOrderForm, index) => {
1884 if (addonOrderForm && addonOrderForm.customFields && addonOrderForm.customFields.length > 0) {
1885 /** @type {?} */
1886 const addonSection = OrderFormService.buildOrderFormSectionData(parentForm);
1887 /** @type {?} */
1888 const addonAnswersForThisSpecificFormIndex = (addonAnswers.length > index) ? addonAnswers[index].customFieldsAnswers : [];
1889 /** @type {?} */
1890 const formFields = OrderFormService.buildCustomOrderFormFields(addonOrderForm.customFields, fileUploadUrl, users, addonAnswersForThisSpecificFormIndex, options);
1891 addonSection.expandable = true;
1892 addonSection.titleText = addon.name;
1893 addonSection.fields = formFields;
1894 addonSection.productId = product.productId;
1895 addonSection.addonId = addon.addonId;
1896 subsections.push(addonSection);
1897 }
1898 }));
1899 }));
1900 /** @type {?} */
1901 const foundOrderForms = orderForms.reduce((/**
1902 * @param {?} orderFormsFound
1903 * @param {?} o
1904 * @return {?}
1905 */
1906 (orderFormsFound, o) => {
1907 if (o.appId === product.productId && !o.addonId) {
1908 orderFormsFound.push(o);
1909 }
1910 return orderFormsFound;
1911 }), []);
1912 const [primaryOrder, ...otherOrdersForSameProduct] = foundOrderForms;
1913 /** @type {?} */
1914 const productHasOrderForm = primaryOrder && primaryOrder.customFields && primaryOrder.customFields.length > 0;
1915 if (subsections.length > 0 || productHasOrderForm) {
1916 /** @type {?} */
1917 const sectionData = new ProductOrderFormSectionData();
1918 sectionData.productId = product.productId;
1919 sectionData.parentForm = parentForm;
1920 sectionData.titleText = product.name;
1921 sectionData.subtitleText = product.tagline;
1922 sectionData.descriptionText = ''; // TODO: build the description string to show which common data this form uses
1923 sectionData.iconUrl = product.icon;
1924 if (productHasOrderForm) {
1925 /** @type {?} */
1926 const section = OrderFormService.buildOrderFormSectionData(parentForm);
1927 section.titleText = product.name;
1928 /** @type {?} */
1929 let productAnswers = [];
1930 if (answers) {
1931 productAnswers = answers.filter((/**
1932 * @param {?} a
1933 * @return {?}
1934 */
1935 a => !a.addonKey && a.productID === product.productId));
1936 }
1937 const [firstProductAnswers, ...otherProductAnswers] = productAnswers;
1938 section.fields = OrderFormService.buildCustomOrderFormFields(primaryOrder.customFields, fileUploadUrl, users, firstProductAnswers ? firstProductAnswers.customFieldsAnswers : [], options);
1939 sectionData.primarySection = section;
1940 otherOrdersForSameProduct.forEach((/**
1941 * @param {?} _
1942 * @param {?} index
1943 * @return {?}
1944 */
1945 (_, index) => {
1946 /**
1947 * Clone the same section to avoid child component from modifying all as if these are all the top section.
1948 * All sections need to be re-created or else they will have the same id and send repeated data as well.
1949 * @type {?}
1950 */
1951 const dupeSection = Object.assign({}, section);
1952 /** @type {?} */
1953 const answersForSpecificForm = (otherProductAnswers.length > index) ? otherProductAnswers[index].customFieldsAnswers : [];
1954 dupeSection.fields = OrderFormService.buildCustomOrderFormFields(primaryOrder.customFields, fileUploadUrl, users, answersForSpecificForm, options);
1955 subsections.unshift(dupeSection);
1956 }));
1957 }
1958 sectionData.subsections = subsections;
1959 return sectionData;
1960 }
1961 return null;
1962 })).filter((/**
1963 * @param {?} s
1964 * @return {?}
1965 */
1966 s => !!s));
1967 return formSections;
1968 }
1969 /**
1970 * @param {?} extraFields
1971 * @param {?} parentForm
1972 * @param {?} fileUploadUrl
1973 * @param {?} users
1974 * @param {?} answers
1975 * @param {?} options
1976 * @return {?}
1977 */
1978 static getExtraFieldsSection(extraFields, parentForm, fileUploadUrl, users, answers, options) {
1979 if (!extraFields || extraFields.length < 1) {
1980 return null;
1981 }
1982 /** @type {?} */
1983 const section = OrderFormService.buildOrderFormSectionData(parentForm);
1984 section.fields = OrderFormService.buildCustomOrderFormFields(extraFields, fileUploadUrl, users, answers, options);
1985 return section;
1986 }
1987 /**
1988 * @param {?} customFormSections
1989 * @return {?}
1990 */
1991 static getCustomFieldsData(customFormSections) {
1992 /** @type {?} */
1993 const customFormData = customFormSections.reduce((/**
1994 * @param {?} acc
1995 * @param {?} orderFormData
1996 * @return {?}
1997 */
1998 (acc, orderFormData) => {
1999 acc = acc.concat(OrderFormService.productOrderFormToCustomFields(orderFormData));
2000 return acc;
2001 }), []);
2002 return customFormData;
2003 }
2004 /**
2005 * @param {?} commonFormSections
2006 * @return {?}
2007 */
2008 static getCommonFieldsData(commonFormSections) {
2009 /** @type {?} */
2010 let commonFields = [];
2011 if (commonFormSections) {
2012 commonFields = commonFormSections.reduce((/**
2013 * @param {?} acc
2014 * @param {?} group
2015 * @return {?}
2016 */
2017 (acc, group) => {
2018 /** @type {?} */
2019 const fields = group.fields.map((/**
2020 * @param {?} singleField
2021 * @return {?}
2022 */
2023 singleField => {
2024 /** @type {?} */
2025 const field = OrderFormService.orderFieldToSalesOrderField(singleField);
2026 if (field.fieldId) {
2027 return new CommonField({
2028 field: field,
2029 productIds: singleField.productIds,
2030 addonKeys: singleField.addonKeys
2031 });
2032 }
2033 }));
2034 return acc.concat(fields);
2035 }), []);
2036 }
2037 return commonFields;
2038 }
2039 /**
2040 * @param {?} extraFieldsSection
2041 * @return {?}
2042 */
2043 static getExtraFieldsData(extraFieldsSection) {
2044 /** @type {?} */
2045 let extraFieldsData = [];
2046 if (!!extraFieldsSection) {
2047 extraFieldsData = extraFieldsSection.fields.map((/**
2048 * @param {?} field
2049 * @return {?}
2050 */
2051 field => OrderFormService.orderFieldToSalesOrderField(field)));
2052 }
2053 return extraFieldsData;
2054 }
2055}
2056OrderFormService.camelToSnakeCaseMap = {
2057 'contactName': 'contact_name',
2058 'contactEmail': 'contact_email',
2059 'contactPhoneNumber': 'contact_phone_number',
2060 'businessAccountGroupId': 'business_account_group_id',
2061 'businessName': 'business_name',
2062 'businessAddress': 'business_address',
2063 'businessPhoneNumber': 'business_phone_number',
2064 'businessWebsite': 'business_website',
2065 'salespersonName': 'salesperson_name',
2066 'salespersonEmail': 'salesperson_email',
2067 'salespersonPhoneNumber': 'salesperson_phone_number'
2068};
2069OrderFormService.decorators = [
2070 { type: Injectable }
2071];
2072/** @nocollapse */
2073OrderFormService.ctorParameters = () => [];
2074if (false) {
2075 /** @type {?} */
2076 OrderFormService.camelToSnakeCaseMap;
2077}
2078
2079/**
2080 * @fileoverview added by tsickle
2081 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2082 */
2083class OrderFormComponent {
2084 /**
2085 * @param {?} translateService
2086 */
2087 constructor(translateService) {
2088 this.translateService = translateService;
2089 this.dropdownOpen$$ = new BehaviorSubject(false);
2090 this.dropdownOpen$ = this.dropdownOpen$$.asObservable();
2091 this.translateService.setTranslation('en', En.en, true);
2092 }
2093 /**
2094 * @return {?}
2095 */
2096 ngOnInit() {
2097 /** @type {?} */
2098 const options = new OrderFormOptions(this.orderFormOptions || {});
2099 this.commonFormSections = OrderFormService.getCommonFormSections(this.orderForms, this.commonData, this.labels, options);
2100 this.customFormSections = OrderFormService.getCustomFormSections(this.orderForms, this.productInfo, this.parentForm, this.fileUploadUrl, this.users, this.answers, options);
2101 // TODO: Handle MyCorporation OrderForm (handled in a separate component right now)
2102 this.extraFieldsSection = OrderFormService.getExtraFieldsSection(this.extraFields, this.parentForm, this.fileUploadUrl, this.users, this.extraFieldsAnswers, options);
2103 }
2104 /**
2105 * returns the data from common form fields in a format that is usable by sales orders
2106 * @return {?}
2107 */
2108 getCommonFormData() {
2109 return OrderFormService.getCommonFieldsData(this.commonFormSections);
2110 }
2111 /**
2112 * returns the data from custom forms in a format that is usable by sales orders
2113 * @return {?}
2114 */
2115 getCustomFormData() {
2116 return OrderFormService.getCustomFieldsData(this.customFormSections);
2117 }
2118 /**
2119 * returns the data from extra fields in a format that is usable by sales orders
2120 * @return {?}
2121 */
2122 getExtraFieldsData() {
2123 return OrderFormService.getExtraFieldsData(this.extraFieldsSection);
2124 }
2125 /**
2126 * changes the read only state of the sales order form
2127 * @param {?} readOnly
2128 * @return {?}
2129 */
2130 changeReadOnly(readOnly) {
2131 this.orderFormOptions.readOnly = readOnly;
2132 readOnly ? this.parentForm.disable() : this.parentForm.enable();
2133 }
2134 /**
2135 * @return {?}
2136 */
2137 openDropdown() {
2138 this.dropdownOpen$$.next(true);
2139 }
2140}
2141OrderFormComponent.decorators = [
2142 { type: Component, args: [{
2143 template: "<form [formGroup]=\"parentForm\">\n <!-- Common Fields -->\n <div *ngIf=\"commonFormSections?.length > 0\" class=\"common-form-container\">\n <mat-card class=\"common-form-header\">\n <mat-card-title class=\"common-form-header-title\">{{ labels.commonForm.headerTitle }}</mat-card-title>\n <div class=\"common-form-header-text\">{{ labels.commonForm.headerText }}</div>\n </mat-card>\n <va-dropdown-form-section\n *ngFor=\"let formSection of commonFormSections\"\n [parentForm]=\"parentForm\"\n [prepopulatedData]=\"formSection.populatedData\"\n [fields]=\"formSection.fields\"\n [titleText]=\"formSection.sectionName\"\n [startOpen]=\"dropdownOpen$ | async\"\n editingHint=\"{{ labels.commonForm.editingHint }}\"\n >\n </va-dropdown-form-section>\n <ng-container *ngIf=\"extraFieldsSection\">\n <va-dropdown-form-section\n [parentForm]=\"parentForm\"\n [prepopulatedData]=\"extraFieldsSection.prepopulatedData\"\n [fields]=\"extraFieldsSection.fields\"\n [displayAutoDescription]=false\n [startOpen]=\"true\"\n [titleText]=\"'FRONTEND.STORE.ADMINISTRATIVE_QUESTIONS' | translate\"\n >\n </va-dropdown-form-section>\n </ng-container>\n </div>\n\n <!--Custom Fields-->\n <div *ngIf=\"customFormSections?.length > 0\" class=\"custom-form-container\">\n <va-order-form-section *ngFor=\"let sectionData of customFormSections\" [data]=\"sectionData\"></va-order-form-section>\n </div>\n</form>\n",
2144 providers: [],
2145 selector: 'va-order-form',
2146 styles: [".common-form-container{margin-bottom:16px}mat-card.common-form-header{margin-bottom:0;border-bottom-color:#fafafa;border-bottom-width:1px;box-shadow:0 0 1px -2px rgba(0,0,0,.2),0 0 2px 0 rgba(0,0,0,.14),0 0 5px 0 rgba(0,0,0,.12)}.common-form-header-text{font-size:15px;color:#9e9e9e}.common-form-header-title{margin-bottom:0;padding-bottom:15px}va-order-form-section{display:block;margin-bottom:16px}"]
2147 }] }
2148];
2149/** @nocollapse */
2150OrderFormComponent.ctorParameters = () => [
2151 { type: TranslateService }
2152];
2153OrderFormComponent.propDecorators = {
2154 commonData: [{ type: Input }],
2155 answers: [{ type: Input }],
2156 parentForm: [{ type: Input }],
2157 fileUploadUrl: [{ type: Input }],
2158 orderForms: [{ type: Input }],
2159 productInfo: [{ type: Input }],
2160 labels: [{ type: Input }],
2161 users: [{ type: Input }],
2162 extraFields: [{ type: Input }],
2163 extraFieldsAnswers: [{ type: Input }],
2164 orderFormOptions: [{ type: Input }]
2165};
2166if (false) {
2167 /** @type {?} */
2168 OrderFormComponent.prototype.commonData;
2169 /** @type {?} */
2170 OrderFormComponent.prototype.answers;
2171 /** @type {?} */
2172 OrderFormComponent.prototype.parentForm;
2173 /** @type {?} */
2174 OrderFormComponent.prototype.fileUploadUrl;
2175 /** @type {?} */
2176 OrderFormComponent.prototype.orderForms;
2177 /** @type {?} */
2178 OrderFormComponent.prototype.productInfo;
2179 /** @type {?} */
2180 OrderFormComponent.prototype.labels;
2181 /** @type {?} */
2182 OrderFormComponent.prototype.users;
2183 /** @type {?} */
2184 OrderFormComponent.prototype.extraFields;
2185 /** @type {?} */
2186 OrderFormComponent.prototype.extraFieldsAnswers;
2187 /** @type {?} */
2188 OrderFormComponent.prototype.orderFormOptions;
2189 /** @type {?} */
2190 OrderFormComponent.prototype.commonFormSections;
2191 /** @type {?} */
2192 OrderFormComponent.prototype.customFormSections;
2193 /** @type {?} */
2194 OrderFormComponent.prototype.extraFieldsSection;
2195 /** @type {?} */
2196 OrderFormComponent.prototype.dropdownOpen$$;
2197 /** @type {?} */
2198 OrderFormComponent.prototype.dropdownOpen$;
2199 /**
2200 * @type {?}
2201 * @private
2202 */
2203 OrderFormComponent.prototype.translateService;
2204}
2205class OrderFormOptions {
2206 /**
2207 * @param {?} i
2208 */
2209 constructor(i) {
2210 this.bypassRequiredQuestions = !!i.bypassRequiredQuestions;
2211 this.readOnly = !!i.readOnly;
2212 this.showOfficeUseQuestions = !!i.showOfficeUseQuestions;
2213 }
2214}
2215if (false) {
2216 /** @type {?} */
2217 OrderFormOptions.prototype.bypassRequiredQuestions;
2218 /** @type {?} */
2219 OrderFormOptions.prototype.readOnly;
2220 /** @type {?} */
2221 OrderFormOptions.prototype.showOfficeUseQuestions;
2222}
2223
2224/**
2225 * @fileoverview added by tsickle
2226 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2227 */
2228/** @type {?} */
2229const FILES = 'file';
2230/** @type {?} */
2231const DROP_DOWN = 'dropdown';
2232/** @type {?} */
2233const CHECK_BOX = 'checkbox';
2234/** @type {?} */
2235const TEXT_AREA = 'textarea';
2236/** @type {?} */
2237const TEXT_BOX = 'textbox';
2238/** @type {?} */
2239const BUSINESS_USER = 'vbcuser';
2240/**
2241 * @record
2242 */
2243function FieldBaseOptions() { }
2244if (false) {
2245 /** @type {?} */
2246 FieldBaseOptions.prototype.id;
2247 /** @type {?} */
2248 FieldBaseOptions.prototype.label;
2249 /** @type {?|undefined} */
2250 FieldBaseOptions.prototype.required;
2251 /** @type {?|undefined} */
2252 FieldBaseOptions.prototype.description;
2253 /** @type {?|undefined} */
2254 FieldBaseOptions.prototype.type;
2255 /** @type {?|undefined} */
2256 FieldBaseOptions.prototype.prefix;
2257 /** @type {?|undefined} */
2258 FieldBaseOptions.prototype.suffix;
2259 /** @type {?|undefined} */
2260 FieldBaseOptions.prototype.regexValidator;
2261 /** @type {?|undefined} */
2262 FieldBaseOptions.prototype.regexErrorMessage;
2263 /** @type {?|undefined} */
2264 FieldBaseOptions.prototype.disabled;
2265 /** @type {?|undefined} */
2266 FieldBaseOptions.prototype.forOfficeUseOnly;
2267 /** @type {?|undefined} */
2268 FieldBaseOptions.prototype.hidden;
2269 /** @type {?|undefined} */
2270 FieldBaseOptions.prototype.displayOnly;
2271}
2272/**
2273 * @abstract
2274 * @template T
2275 */
2276class FieldBase {
2277 /**
2278 * @param {?} options
2279 */
2280 constructor(options) {
2281 this.id = options.id;
2282 this.label = options.label;
2283 this.required = !!options.required;
2284 this.description = options.description || null;
2285 options.type = options.type === 'text' ? 'textbox' : options.type;
2286 this.controlType = (/** @type {?} */ (options.type));
2287 this.prefix = options.prefix;
2288 this.suffix = options.suffix;
2289 this.regexValidator = options.regexValidator;
2290 this.regexErrorMessage = options.regexErrorMessage;
2291 this.disabled = options.disabled || false;
2292 this.validator = this.validatorBuilder();
2293 this.forOfficeUseOnly = !!options.forOfficeUseOnly;
2294 this.hidden = options.hidden;
2295 this.displayOnly = options.displayOnly;
2296 }
2297 /**
2298 * @return {?}
2299 */
2300 getLabel() {
2301 /** @type {?} */
2302 let fieldLabel = this.label;
2303 if (this.required) {
2304 fieldLabel += ' *';
2305 }
2306 return fieldLabel;
2307 }
2308 /**
2309 * @protected
2310 * @return {?}
2311 */
2312 validatorBuilder() {
2313 return (/**
2314 * @param {?} control
2315 * @return {?}
2316 */
2317 (control) => {
2318 return null;
2319 });
2320 }
2321}
2322if (false) {
2323 /** @type {?} */
2324 FieldBase.prototype.value;
2325 /** @type {?} */
2326 FieldBase.prototype.id;
2327 /** @type {?} */
2328 FieldBase.prototype.label;
2329 /** @type {?} */
2330 FieldBase.prototype.required;
2331 /** @type {?} */
2332 FieldBase.prototype.order;
2333 /** @type {?} */
2334 FieldBase.prototype.description;
2335 /** @type {?} */
2336 FieldBase.prototype.controlType;
2337 /** @type {?} */
2338 FieldBase.prototype.prefix;
2339 /** @type {?} */
2340 FieldBase.prototype.suffix;
2341 /** @type {?} */
2342 FieldBase.prototype.regexValidator;
2343 /** @type {?} */
2344 FieldBase.prototype.regexErrorMessage;
2345 /** @type {?} */
2346 FieldBase.prototype.disabled;
2347 /** @type {?} */
2348 FieldBase.prototype.validator;
2349 /** @type {?} */
2350 FieldBase.prototype.forOfficeUseOnly;
2351 /** @type {?} */
2352 FieldBase.prototype.hidden;
2353 /** @type {?} */
2354 FieldBase.prototype.displayOnly;
2355}
2356
2357/**
2358 * @fileoverview added by tsickle
2359 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2360 */
2361class FieldBuilderComponent {
2362 constructor() {
2363 this.removeField = new EventEmitter(null);
2364 }
2365 /**
2366 * @param {?} option
2367 * @param {?} required
2368 * @return {?}
2369 */
2370 static createDropDownOption(option, required) {
2371 return new FormGroup({
2372 label: new FormControl(option.label || option.value, required ? [Validators.required] : []),
2373 value: new FormControl(option.value),
2374 useValue: new FormControl(!!option.value)
2375 });
2376 }
2377 /**
2378 * @param {?} options
2379 * @return {?}
2380 */
2381 static createDropDownOptions(options) {
2382 if (options === null || options === undefined) {
2383 options = [];
2384 }
2385 /** @type {?} */
2386 const orderFormFieldsGroupArray = options.map((/**
2387 * @param {?} option
2388 * @return {?}
2389 */
2390 option => FieldBuilderComponent.createDropDownOption(option, false)));
2391 return new FormArray(orderFormFieldsGroupArray);
2392 }
2393 /**
2394 * @param {?} orderFormField
2395 * @return {?}
2396 */
2397 static createOrderFormFieldGroup(orderFormField) {
2398 /** @type {?} */
2399 const orderFormFieldGroup = new FormGroup({
2400 descriptionControl: new FormControl(orderFormField.description, []),
2401 labelControl: new FormControl(orderFormField.label, [Validators.required]),
2402 idControl: new FormControl(orderFormField.id, [Validators.required]),
2403 requiredControl: new FormControl(orderFormField.required || false, []),
2404 uploadUrlControl: new FormControl(orderFormField.uploadUrl, []),
2405 prefixControl: new FormControl(orderFormField.prefix, []),
2406 suffixControl: new FormControl(orderFormField.suffix, []),
2407 regexValidatorControl: new FormControl(orderFormField.regexValidator, regexValidator()),
2408 regexErrorMessageControl: new FormControl(orderFormField.regexErrorMessage, []),
2409 typeControl: new FormControl(getFieldInterface(orderFormField.type), [Validators.required]),
2410 allowMultiples: new FormControl(orderFormField.allowMultiples || false, []),
2411 allowDuplicates: new FormControl(orderFormField.allowDuplicates || false, []),
2412 maxChoices: new FormControl(orderFormField.maxChoices ? orderFormField.maxChoices : 1, [Validators.min(1), numberValidator()]),
2413 forOfficeUseOnly: new FormControl(orderFormField.forOfficeUseOnly || false, [])
2414 });
2415 if (orderFormField.optionsWithLabels) {
2416 /** @type {?} */
2417 const optionsArray = FieldBuilderComponent.createDropDownOptions(orderFormField.optionsWithLabels);
2418 orderFormFieldGroup.addControl('optionsFormArray', optionsArray);
2419 }
2420 else if (orderFormField.options) {
2421 /** @type {?} */
2422 const optionsArray = FieldBuilderComponent.createDropDownOptions(orderFormField.options.map((/**
2423 * @param {?} option
2424 * @return {?}
2425 */
2426 option => ({ label: option }))));
2427 orderFormFieldGroup.addControl('optionsFormArray', optionsArray);
2428 }
2429 else {
2430 orderFormFieldGroup.addControl('optionsFormArray', new FormArray([]));
2431 }
2432 return orderFormFieldGroup;
2433 }
2434 /**
2435 * @return {?}
2436 */
2437 ngOnInit() {
2438 if (!this.supportedFieldTypes || this.supportedFieldTypes.length < 1) {
2439 this.supportedFieldTypes = FORM_FIELDS;
2440 }
2441 this.initForm();
2442 }
2443 /**
2444 * @return {?}
2445 */
2446 initForm() {
2447 // Check to see if form has been initiated
2448 if (!this.orderFormFieldGroup.get('labelControl')) {
2449 this.orderFormFieldGroup =
2450 FieldBuilderComponent.createOrderFormFieldGroup({});
2451 }
2452 }
2453 /**
2454 * @return {?}
2455 */
2456 getOptionsArray() {
2457 return (/** @type {?} */ (this.orderFormFieldGroup.get('optionsFormArray')));
2458 }
2459 /**
2460 * @return {?}
2461 */
2462 getCurrentFieldInterface() {
2463 /** @type {?} */
2464 const formFieldTypeInterface = ((/** @type {?} */ (this.orderFormFieldGroup.get('typeControl').value)));
2465 return formFieldTypeInterface ? formFieldTypeInterface.id : null;
2466 }
2467 /**
2468 * @param {?} index
2469 * @return {?}
2470 */
2471 removeOption(index) {
2472 /** @type {?} */
2473 const formArray = this.getOptionsArray();
2474 formArray.removeAt(index);
2475 }
2476 /**
2477 * @return {?}
2478 */
2479 addOption() {
2480 /** @type {?} */
2481 const fieldArray = this.getOptionsArray();
2482 fieldArray.push(FieldBuilderComponent.createDropDownOption({ label: '' }, true));
2483 }
2484 /**
2485 * @return {?}
2486 */
2487 getFormValues() {
2488 /** @type {?} */
2489 const obj = {};
2490 obj.label = this.orderFormFieldGroup.get('labelControl').value;
2491 obj.id = this.orderFormFieldGroup.get('idControl').value;
2492 /** @type {?} */
2493 const formFieldType = ((/** @type {?} */ (this.orderFormFieldGroup.get('typeControl').value)));
2494 obj.type = formFieldType ? formFieldType.id : null;
2495 // Options will be nested under their own form control in the larger Orderformfield array
2496 /** @type {?} */
2497 const optionsArray = ((/** @type {?} */ (this.orderFormFieldGroup.get('optionsFormArray'))));
2498 if (optionsArray && optionsArray.value) {
2499 obj.options = optionsArray.value.map((/**
2500 * @param {?} option
2501 * @return {?}
2502 */
2503 option => option.value || option.label));
2504 obj.optionsWithLabels = optionsArray.value.map((/**
2505 * @param {?} option
2506 * @return {?}
2507 */
2508 option => ({ label: option.label, value: option.value })));
2509 }
2510 obj.description = this.orderFormFieldGroup.get('descriptionControl').value;
2511 obj.required = this.orderFormFieldGroup.get('requiredControl').value || false;
2512 obj.uploadUrl = this.orderFormFieldGroup.get('uploadUrlControl').value;
2513 obj.prefix = this.orderFormFieldGroup.get('prefixControl').value;
2514 obj.suffix = this.orderFormFieldGroup.get('suffixControl').value;
2515 obj.regexValidator = this.orderFormFieldGroup.get('regexValidatorControl').value;
2516 obj.regexErrorMessage = this.orderFormFieldGroup.get('regexErrorMessageControl').value;
2517 obj.allowMultiples = this.orderFormFieldGroup.get('allowMultiples').value || false;
2518 obj.allowDuplicates = this.orderFormFieldGroup.get('allowDuplicates').value || false;
2519 obj.maxChoices = this.orderFormFieldGroup.get('maxChoices').value || 1;
2520 obj.forOfficeUseOnly = this.orderFormFieldGroup.get('forOfficeUseOnly').value || false;
2521 return obj;
2522 }
2523}
2524FieldBuilderComponent.decorators = [
2525 { type: Component, args: [{
2526 selector: 'va-field-builder',
2527 template: "<div class=\"color-primary grab-mask order-form-field-form-container\" [formGroup]=\"orderFormFieldGroup\">\n <mat-form-field class=\"order-form-mat-form-field\">\n <mat-select matInput formControlName=\"typeControl\" placeholder=\"Type\" required novalidate>\n <mat-option *ngFor=\"let field of supportedFieldTypes\" [value]=\"field\">\n {{ field.name }}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"'typeControl.invalid'\">Form Field type is Required</mat-error>\n </mat-form-field>\n <span class=\"options\">\n <mat-checkbox color=\"primary\" [formControlName]=\"'requiredControl'\"> Required</mat-checkbox>\n <mat-checkbox color=\"primary\" [formControlName]=\"'forOfficeUseOnly'\" class=\"underlined\" matTooltip=\"This question will not be shown to end users\"> For Office Use Only</mat-checkbox>\n </span>\n <!-- Options if drop down type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'dropdown'\">\n <div formArrayName=\"optionsFormArray\" *ngFor=\"let option of getOptionsArray().controls; let i = index;\">\n <div class=\"removable-form-field dropdown-option\">\n <mat-form-field class=\"dropdown-option-label\">\n <input matInput [formControl]=\"option.get('label')\" placeholder=\"Option\">\n </mat-form-field>\n <mat-form-field class=\"dropdown-option-value\" *ngIf=\"option.get('useValue').value\">\n <input matInput [formControl]=\"option.get('value')\" placeholder=\"Value\">\n </mat-form-field>\n <a class=\"dropdown-option-value\" (click)=\"option.get('useValue').setValue(true)\" *ngIf=\"!option.get('useValue').value\">+ Assign Value</a>\n <button mat-icon-button type=\"button\" color=\"primary\" (click)=\"removeOption(i)\">\n <mat-icon aria-label=\"Clear Button\">clear</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"order-form-mat-form-field\">\n <a (click)=\"addOption()\">+ Option</a>\n </div>\n <div class=\"dropdown-config\">\n <mat-checkbox color=\"primary\" [formControlName]=\"'allowMultiples'\"> Allow Multiples</mat-checkbox>\n <ng-container *ngIf=\"orderFormFieldGroup.controls.allowMultiples.value\">\n <mat-checkbox class=\"required-checkbox\" color=\"primary\" [formControlName]=\"'allowDuplicates'\"> Allow Duplicates</mat-checkbox>\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"maxChoices\" placeholder=\"Maximum Number of Choices\" required type=\"number\">\n <mat-hint>Must be greater than 0</mat-hint>\n <mat-error *ngIf=\"'maxChoices.invalid'\">Max Choices must be a number larger than 0</mat-error>\n </mat-form-field>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"labelControl\" placeholder=\"Label\" required novalidate>\n <mat-hint>Keep it short. Recommended: Max 140 characters</mat-hint>\n <mat-error *ngIf=\"'idControl.invalid'\">Label is Required</mat-error>\n </mat-form-field>\n </div>\n <!-- Prefix/suffix if textbox type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'textbox'\">\n <ng-container *ngIf=\"showSuffixes\">\n <mat-form-field>\n <input matInput formControlName=\"prefixControl\" placeholder=\"Prefix\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"suffixControl\" placeholder=\"Suffix\">\n </mat-form-field>\n <div class=\"show-hide-text-button\"><a (click)=\"showSuffixes = !showSuffixes\">Hide Prefix/Suffix</a></div>\n </ng-container>\n <div *ngIf=\"!showSuffixes\" class=\"show-hide-text-button\">\n <a (click)=\"showSuffixes = !showSuffixes\">+ Prefix/Suffix</a>\n <div class=\"hidden-note\">- Values will apply even though currently hidden </div>\n </div>\n </ng-container>\n\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"idControl\" placeholder=\"ID\" required>\n <mat-error *ngIf=\"'idControl.invalid'\">Id is Required</mat-error>\n <mat-hint>ID must be unique</mat-hint>\n </mat-form-field>\n </div>\n\n\n <!-- Upload url if file type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'file'\">\n <mat-form-field>\n <input matInput formControlName=\"uploadUrlControl\" placeholder=\"Upload URL\">\n </mat-form-field>\n </ng-container>\n\n\n <!-- Prefix/suffix if textbox type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'textbox'\">\n\n <!-- RegexValidator/RegexErrorMessage if textbox type is selected -->\n <ng-container *ngIf=\"showValidators\">\n <mat-form-field>\n <input matInput formControlName=\"regexValidatorControl\" placeholder=\"Regex Validator\">\n <mat-error *ngIf=\"'regexValidatorControl.invalid'\"> Must be a valid regular expression </mat-error>\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"regexErrorMessageControl\" placeholder=\"Regex Error Message\">\n <mat-hint> Error displayed to the user when the regular expression is not matched </mat-hint>\n </mat-form-field>\n <div class=\"show-hide-text-button\">\n <a (click)=\"showValidators = !showValidators\">Hide Validation</a>\n </div>\n </ng-container>\n <div *ngIf=\"!showValidators\" class=\"show-hide-text-button\">\n <a (click)=\"showValidators = !showValidators\">+ Validation</a>\n <div class=\"hidden-note\"> - Values will apply even though currently hidden </div>\n </div>\n </ng-container>\n\n <!-- Optional description -->\n <div class=\"removable-form-field\">\n <mat-form-field>\n <input matInput formControlName=\"descriptionControl\" placeholder=\"Hint text\">\n <mat-hint>A short sentence to show below the field if you absolutely need extra instruction</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"delete-field-section\">\n <button mat-icon-button type=\"button\" color=\"primary\" (click)=\"removeField.emit()\">\n Delete field\n <!-- <mat-icon aria-label=\"Clear Button\">clear</mat-icon> -->\n </button>\n </div>\n</div>\n",
2528 changeDetection: ChangeDetectionStrategy.OnPush,
2529 styles: [".show-hide-text-button{margin-bottom:2em;display:-webkit-box;display:flex}.show-hide-text-button .hidden-note{font-size:10px;margin-left:7px;color:#9e9e9e;-ms-grid-row-align:center;align-self:center}.options{padding-left:15px;width:15%;display:inline-block}.dropdown-option,mat-form-field{width:85%}.delete-field-section{text-align:right}.mat-icon-button{width:auto;color:rgba(0,0,0,.54)!important}.mat-icon-button:hover{color:#c62828!important}.dropdown-config{margin-top:17px}.dropdown-config mat-checkbox{margin-right:16px}.dropdown-option{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.dropdown-option-label{-webkit-box-flex:1;flex:1 1 auto;margin-right:16px}.dropdown-option-value{-webkit-box-flex:0;flex:0 1 33%}.underlined{border-bottom:1px dotted}"]
2530 }] }
2531];
2532FieldBuilderComponent.propDecorators = {
2533 orderFormFieldGroup: [{ type: Input }],
2534 supportedFieldTypes: [{ type: Input }],
2535 removeField: [{ type: Output }]
2536};
2537if (false) {
2538 /** @type {?} */
2539 FieldBuilderComponent.prototype.orderFormFieldGroup;
2540 /** @type {?} */
2541 FieldBuilderComponent.prototype.supportedFieldTypes;
2542 /** @type {?} */
2543 FieldBuilderComponent.prototype.removeField;
2544 /** @type {?} */
2545 FieldBuilderComponent.prototype.showValidators;
2546 /** @type {?} */
2547 FieldBuilderComponent.prototype.showSuffixes;
2548}
2549// Validation to ensure supplied regex is valid
2550/**
2551 * @return {?}
2552 */
2553function regexValidator() {
2554 return (/**
2555 * @param {?} control
2556 * @return {?}
2557 */
2558 (control) => {
2559 try {
2560 /** @type {?} */
2561 const _ = new RegExp(control.value || '');
2562 }
2563 catch (e) {
2564 return { 'regex': true };
2565 }
2566 return null;
2567 });
2568}
2569/**
2570 * @return {?}
2571 */
2572function numberValidator() {
2573 return (/**
2574 * @param {?} control
2575 * @return {?}
2576 */
2577 (control) => {
2578 /** @type {?} */
2579 const isNumber = /^\d+$/;
2580 if (isNumber.test(control.value)) {
2581 return null;
2582 }
2583 return { 'number': true };
2584 });
2585}
2586/**
2587 * @record
2588 */
2589function FormFieldInterface() { }
2590if (false) {
2591 /** @type {?} */
2592 FormFieldInterface.prototype.id;
2593 /** @type {?} */
2594 FormFieldInterface.prototype.name;
2595}
2596/** @type {?} */
2597const FORM_FIELDS = [
2598 { id: FILES, name: 'Files' }, { id: DROP_DOWN, name: 'Drop Down' },
2599 { id: CHECK_BOX, name: 'Check Box' }, { id: TEXT_AREA, name: 'Text Area' },
2600 { id: TEXT_BOX, name: 'Text Box' }, { id: BUSINESS_USER, name: 'End User' }
2601];
2602/**
2603 * @param {?} formFieldId
2604 * @return {?}
2605 */
2606function getFieldInterface(formFieldId) {
2607 return getFormFieldInterfaceFromId(((/** @type {?} */ (formFieldId))));
2608}
2609/**
2610 * @param {?} id
2611 * @return {?}
2612 */
2613function getFormFieldInterfaceFromId(id) {
2614 return FORM_FIELDS.find((/**
2615 * @param {?} obj
2616 * @return {?}
2617 */
2618 (obj) => obj.id === id));
2619}
2620
2621/**
2622 * @fileoverview added by tsickle
2623 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2624 */
2625class OrderItemListService {
2626 /**
2627 * @param {?} items
2628 * @return {?}
2629 */
2630 static getPriceSummary(items) {
2631 if (!items) {
2632 return { items: [], includesUndefinedPricing: false };
2633 }
2634 /** @type {?} */
2635 let includesUndefinedPricing = false;
2636 /** @type {?} */
2637 const summaryItems = items.reduce((/**
2638 * @param {?} currentArray
2639 * @param {?} item
2640 * @return {?}
2641 */
2642 (currentArray, item) => {
2643 if (item.pricing.prices.length <= 0) {
2644 includesUndefinedPricing = true;
2645 return currentArray;
2646 }
2647 item.pricing.prices.map((/**
2648 * @param {?} price
2649 * @return {?}
2650 */
2651 price => {
2652 if (!price || price.price < 0) {
2653 includesUndefinedPricing = true;
2654 return;
2655 }
2656 /** @type {?} */
2657 const freq = price.billingFrequency;
2658 /** @type {?} */
2659 const cur = item.pricing.currency;
2660 /** @type {?} */
2661 const existingCurIndex = currentArray.findIndex((/**
2662 * @param {?} summaryItem
2663 * @return {?}
2664 */
2665 summaryItem => summaryItem.currency === cur));
2666 /** @type {?} */
2667 let pricing = {
2668 currency: cur,
2669 prices: []
2670 };
2671 if (existingCurIndex > -1) {
2672 pricing = currentArray[existingCurIndex];
2673 }
2674 /** @type {?} */
2675 const existingFreqIndex = pricing.prices.findIndex((/**
2676 * @param {?} summaryItem
2677 * @return {?}
2678 */
2679 summaryItem => summaryItem.billingFrequency === freq));
2680 /** @type {?} */
2681 const quantifiedPrice = price.price !== null ? price.price * item.quantity : null;
2682 /** @type {?} */
2683 const quantifiedDiscount = (price.discountAmount || 0) * item.quantity;
2684 if (existingFreqIndex > -1) {
2685 pricing.prices[existingFreqIndex] = {
2686 price: pricing.prices[existingFreqIndex].price + quantifiedPrice,
2687 billingFrequency: freq,
2688 discountAmount: pricing.prices[existingFreqIndex].discountAmount + quantifiedDiscount
2689 };
2690 }
2691 else {
2692 pricing.prices.push({
2693 price: quantifiedPrice,
2694 billingFrequency: freq,
2695 discountAmount: quantifiedDiscount
2696 });
2697 }
2698 if (existingCurIndex > -1) {
2699 currentArray[existingCurIndex] = pricing;
2700 }
2701 else {
2702 currentArray.push(pricing);
2703 }
2704 }));
2705 return currentArray;
2706 }), []);
2707 return { items: summaryItems, includesUndefinedPricing: includesUndefinedPricing };
2708 }
2709}
2710
2711/**
2712 * @fileoverview added by tsickle
2713 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2714 */
2715class OrderItemListComponent {
2716 /**
2717 * @param {?} translateService
2718 */
2719 constructor(translateService) {
2720 this.translateService = translateService;
2721 this.includesUndefinedPricing = false;
2722 this.translateService.setTranslation('en', En.en, true);
2723 }
2724 /**
2725 * @param {?} items
2726 * @return {?}
2727 */
2728 set orderItems(items) {
2729 this.items = items || [];
2730 /** @type {?} */
2731 const summary = OrderItemListService.getPriceSummary(items);
2732 this.summaryItems = summary.items;
2733 this.includesUndefinedPricing = summary.includesUndefinedPricing;
2734 }
2735 /**
2736 * @param {?} price
2737 * @return {?}
2738 */
2739 calculateTotalPrice(price) {
2740 if (price.price === null) {
2741 return null;
2742 }
2743 /** @type {?} */
2744 const totalPrice = price.price - price.discountAmount;
2745 if (!this.taxOptions) {
2746 return totalPrice;
2747 }
2748 /** @type {?} */
2749 const taxTotal = this.taxOptions.reduce((/**
2750 * @param {?} all
2751 * @param {?} tax
2752 * @return {?}
2753 */
2754 (all, tax) => all + (tax.percentage * totalPrice)), 0);
2755 return totalPrice + taxTotal;
2756 }
2757 /**
2758 * @param {?} tax
2759 * @return {?}
2760 */
2761 buildTaxLabel(tax) {
2762 /** @type {?} */
2763 const taxPercentage = Number(tax.percentage * 100).toFixed(2);
2764 return `${tax.label} (${taxPercentage}%)`;
2765 }
2766 /**
2767 * @return {?}
2768 */
2769 isFree() {
2770 /** @type {?} */
2771 const summaryTotal = this.summaryItems.reduce((/**
2772 * @param {?} all
2773 * @param {?} item
2774 * @return {?}
2775 */
2776 (all, item) => {
2777 /** @type {?} */
2778 const totalPrices = item.prices.reduce((/**
2779 * @param {?} acc
2780 * @param {?} price
2781 * @return {?}
2782 */
2783 (acc, price) => acc + price.price), 0);
2784 return all + totalPrices;
2785 }), 0);
2786 return summaryTotal === 0;
2787 }
2788}
2789OrderItemListComponent.decorators = [
2790 { type: Component, args: [{
2791 selector: 'va-order-item-list',
2792 template: "<div class=\"va-order-item-list\">\n <mat-list class=\"product-list\" *ngIf=\"items; else loading\">\n <ng-container *ngFor=\"let item of items\">\n <mat-list-item>\n <div class=\"list-item\">\n <div class=\"left-section\">\n <div class=\"icon-and-name\">\n <div class=\"icon-container\">\n <va-icon [diameter]=\"32\" [iconUrl]=\"item.icon\" [name]=\"item.name\"></va-icon>\n </div>\n <div>\n <div>\n {{ item.name }}\n <va-badge color=\"blue-solid\" *ngIf=\"item.editionName\">\n <span> {{ item.editionName }} </span>\n </va-badge>\n <span *ngIf=\"item.quantity > 1\"> ({{ item.quantity }})</span>\n </div>\n </div>\n </div>\n </div>\n <div class=\"right-section\" *ngIf=\"!hidePricing && item.pricing\">\n <ng-container *ngIf=\"item.pricing.prices?.length > 0\">\n <ng-container *ngFor=\"let price of item.pricing.prices\">\n <div matLine>\n <strong *ngIf=\"!price.discountAmount\">{{ price.price | price: item.pricing.currency }}</strong>\n <ng-container *ngIf=\"price.price && price.discountAmount > 0\">\n <span matTooltipPosition=\"left\" class=\"item-price-before-discount\"\n [matTooltip]=\"price.discountAmount | price: item.pricing.currency\">\n {{ price.price | price: item.pricing.currency }}\n </span>\n <strong>{{ price.price - price.discountAmount | price: item.pricing.currency }}</strong>\n </ng-container>\n </div>\n <div matLine class=\"tertiary-font-color\" *ngIf=\"price.price > 0\">\n {{ price.billingFrequency | formatBillingFrequency }}\n </div>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"item.pricing.prices?.length <= 0\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ null | price: 'CAD' }}</strong>\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n </div>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n\n <div *ngIf=\"!hidePricing\">\n <div *ngIf=\"items; else loading\">\n <div class=\"total-header\">\n {{ 'FRONTEND.STORE.TOTAL' | translate }}\n </div>\n <mat-list class=\"summary-list\">\n <ng-container *ngIf=\"includesUndefinedPricing; else totalIsDefined\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ null | price: 'CAD' }}</strong>\n </div>\n </mat-list-item>\n </ng-container>\n\n <ng-template #totalIsDefined>\n <ng-container *ngIf=\"isFree(); else totalNotFree\">\n <div class=\"summary-item-group\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ 0 | price: 'USD' }}</strong>\n </div>\n </mat-list-item>\n </div>\n </ng-container>\n\n <ng-template #totalNotFree>\n <ng-container *ngFor=\"let item of summaryItems\">\n <div class=\"summary-item-group\" *ngFor=\"let price of item.prices\">\n <ng-container *ngIf=\"price.price > 0\">\n <div class=\"tax-calculation\">\n <mat-list-item class=\"summary-list-item tax-item\">\n <div matLine *ngIf=\"taxOptions\">\n <strong>{{ price.price - price.discountAmount | price: item.currency }}</strong>\n </div>\n </mat-list-item>\n <ng-container *ngFor=\"let tax of taxOptions\">\n <mat-list-item class=\"summary-list-item tax-item\">\n <div matLine class=\"tax-label\">\n <span>\n {{ buildTaxLabel(tax) }}\n </span>\n <strong>\n +{{ (price.price - price.discountAmount) * tax.percentage | price: item.currency }}\n </strong>\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n\n <mat-list-item class=\"summary-list-item\" [ngClass]=\"{ 'result-item': (price.price > 0 && taxOptions) }\">\n <div matLine>\n <strong>{{ calculateTotalPrice(price) | price: item.currency }}</strong>\n </div>\n </mat-list-item>\n\n <mat-list-item class=\"summary-list-item\">\n <div matLine class=\"tertiary-font-color\">\n {{ price.billingFrequency | formatBillingFrequency }}\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n </ng-container>\n\n </ng-template>\n </ng-template>\n </mat-list>\n </div>\n </div>\n\n <ng-template #loading>\n <div class=\"stencil-shimmer\"></div>\n </ng-template>\n\n</div>\n",
2793 styles: ["::ng-deep .va-order-item-list .mat-list-item{height:auto!important}::ng-deep .va-order-item-list .mat-list .mat-list-item-content{padding:10px 0!important}::ng-deep .va-order-item-list .mat-list .summary-list-item .mat-list-item-content{padding:0!important}.product-list{padding:0;position:relative}.product-list .list-item{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between;width:100%}.product-list .list-item .left-section .icon-and-name{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.product-list .list-item .left-section .icon-and-name .icon-container{margin-right:16px}.product-list .list-item .right-section{margin-left:1em;text-align:right;align-self:flex-start}.total-header{background-color:#616161;color:#fff;line-height:2;height:2em;font-weight:700;padding-right:14px;text-align:right}.summary-list{padding:8px 0;background-color:#f5f5f5}.summary-list .summary-list-item{padding-right:14px;text-align:right}.summary-list .summary-item-group{padding:10px 0}.summary-list .summary-list-item.tax-item{color:#9e9e9e;font-size:14px}.summary-list .summary-list-item.result-item{text-decoration:overline;padding-top:5px}.summary-list .tax-label{font-size:12px}.tertiary-font-color{color:#212121;font-size:14px!important}.stencil-shimmer{width:100%;min-height:20px;margin-bottom:4px}.item-price-before-discount{font-size:14px;margin-right:8px;color:#9e9e9e;text-decoration:line-through;border-bottom:1px dotted #9e9e9e}"]
2794 }] }
2795];
2796/** @nocollapse */
2797OrderItemListComponent.ctorParameters = () => [
2798 { type: TranslateService }
2799];
2800OrderItemListComponent.propDecorators = {
2801 taxOptions: [{ type: Input }],
2802 hidePricing: [{ type: Input }],
2803 orderItems: [{ type: Input }]
2804};
2805if (false) {
2806 /** @type {?} */
2807 OrderItemListComponent.prototype.items;
2808 /** @type {?} */
2809 OrderItemListComponent.prototype.summaryItems;
2810 /** @type {?} */
2811 OrderItemListComponent.prototype.includesUndefinedPricing;
2812 /** @type {?} */
2813 OrderItemListComponent.prototype.taxOptions;
2814 /** @type {?} */
2815 OrderItemListComponent.prototype.hidePricing;
2816 /**
2817 * @type {?}
2818 * @private
2819 */
2820 OrderItemListComponent.prototype.translateService;
2821}
2822
2823/**
2824 * @fileoverview added by tsickle
2825 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2826 */
2827class PricePipe {
2828 /**
2829 * @param {?} value
2830 * @param {?} currency
2831 * @param {?=} billingFrequency
2832 * @param {?=} isCents
2833 * @param {?=} translateZero
2834 * @param {?=} displaySymbol
2835 * @return {?}
2836 */
2837 transform(value, currency, billingFrequency, isCents = true, translateZero = true, displaySymbol = true) {
2838 return formatDisplayPrice(value, currency, billingFrequency, isCents, translateZero, displaySymbol);
2839 }
2840}
2841PricePipe.decorators = [
2842 { type: Pipe, args: [{ name: 'price' },] }
2843];
2844class FormatBillingFrequencyPipe {
2845 /**
2846 * @param {?} value
2847 * @return {?}
2848 */
2849 transform(value) {
2850 return formatBillingFrequency(value);
2851 }
2852}
2853FormatBillingFrequencyPipe.decorators = [
2854 { type: Pipe, args: [{ name: 'formatBillingFrequency' },] }
2855];
2856
2857/**
2858 * @fileoverview added by tsickle
2859 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2860 */
2861class VaOrderFormModule {
2862}
2863VaOrderFormModule.decorators = [
2864 { type: NgModule, args: [{
2865 imports: [
2866 CommonModule,
2867 FormsModule,
2868 MatButtonModule,
2869 MatCheckboxModule,
2870 MatExpansionModule,
2871 MatIconModule,
2872 MatInputModule,
2873 MatOptionModule,
2874 MatProgressSpinnerModule,
2875 MatSelectModule,
2876 MatCardModule,
2877 MatTooltipModule,
2878 ReactiveFormsModule,
2879 VaFormsModule,
2880 VaHeaderContainerModule,
2881 VaIconModule,
2882 VaFormsModule,
2883 VaBadgeModule,
2884 MatListModule,
2885 TranslateModule,
2886 ],
2887 declarations: [
2888 DropDownFormSectionComponent,
2889 FieldComponent,
2890 OrderFormSectionComponent,
2891 OrderFormComponent,
2892 FieldBuilderComponent,
2893 OrderItemListComponent,
2894 PricePipe,
2895 FormatBillingFrequencyPipe,
2896 ],
2897 exports: [
2898 DropDownFormSectionComponent,
2899 FieldComponent,
2900 OrderFormSectionComponent,
2901 OrderFormComponent,
2902 FieldBuilderComponent,
2903 OrderItemListComponent,
2904 ],
2905 providers: [
2906 FieldService,
2907 OrderFormService,
2908 OrderItemListService,
2909 ]
2910 },] }
2911];
2912
2913/**
2914 * @fileoverview added by tsickle
2915 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2916 */
2917class StoreService {
2918 /**
2919 * @param {?} formGroup
2920 * @return {?}
2921 */
2922 markFormsAsTouched(formGroup) {
2923 for (const key in formGroup.controls) {
2924 if (formGroup.controls[key] instanceof FormGroup) {
2925 this.markFormsAsTouched((/** @type {?} */ (formGroup.controls[key])));
2926 }
2927 else {
2928 ((/** @type {?} */ (formGroup.controls[key]))).markAsTouched();
2929 ((/** @type {?} */ (formGroup.controls[key]))).updateValueAndValidity();
2930 }
2931 }
2932 }
2933}
2934StoreService.decorators = [
2935 { type: Injectable }
2936];
2937
2938/**
2939 * @fileoverview added by tsickle
2940 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2941 */
2942class File {
2943 /**
2944 * @param {?} url
2945 */
2946 constructor(url) {
2947 this.url = url;
2948 this.url = url;
2949 }
2950 /**
2951 * @return {?}
2952 */
2953 get name() {
2954 return this.url ? this.url.substring(this.url.lastIndexOf('/') + 1, this.url.lastIndexOf('.')) : null;
2955 }
2956 /**
2957 * @return {?}
2958 */
2959 get icon() {
2960 /** @type {?} */
2961 const ext = this.url ? this.url.substring(this.url.lastIndexOf('.') + 1) : null;
2962 switch (ext) {
2963 case 'pdf':
2964 return 'icon-pdf';
2965 case 'ppt':
2966 return 'icon-ppt';
2967 default:
2968 return 'icon-docs';
2969 }
2970 }
2971}
2972if (false) {
2973 /** @type {?} */
2974 File.prototype.url;
2975}
2976
2977/**
2978 * @fileoverview added by tsickle
2979 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2980 */
2981/**
2982 * @record
2983 */
2984function Pricing() { }
2985if (false) {
2986 /** @type {?} */
2987 Pricing.prototype.currency;
2988 /** @type {?} */
2989 Pricing.prototype.prices;
2990}
2991/**
2992 * @record
2993 */
2994function Price() { }
2995if (false) {
2996 /** @type {?} */
2997 Price.prototype.price;
2998 /** @type {?} */
2999 Price.prototype.frequency;
3000 /** @type {?|undefined} */
3001 Price.prototype.isStartingPrice;
3002}
3003/** @type {?} */
3004const CONTACT_SALES = -1;
3005
3006/**
3007 * @fileoverview added by tsickle
3008 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3009 */
3010class Sellable {
3011 /**
3012 * @return {?}
3013 */
3014 get isFree() {
3015 return this.pricing && this.pricing.prices ? this.pricing.prices.some((/**
3016 * @param {?} p
3017 * @return {?}
3018 */
3019 p => p.price === 0 || p.price === undefined)) : false;
3020 }
3021 /**
3022 * @return {?}
3023 */
3024 get shouldContactSales() {
3025 return this.pricing && this.pricing.prices ?
3026 this.pricing.prices.some((/**
3027 * @param {?} p
3028 * @return {?}
3029 */
3030 p => p.price === null || p.price === CONTACT_SALES)) ||
3031 this.pricing.prices.length === 0 : true;
3032 }
3033 /**
3034 * @param {?} inputString
3035 * @return {?}
3036 */
3037 static getCapitalizeFirstLetter(inputString) {
3038 return inputString ? inputString.charAt(0).toUpperCase() + inputString.slice(1) : null;
3039 }
3040 /**
3041 * @return {?}
3042 */
3043 get formattedPricingList() {
3044 if (this.pricing && this.pricing.prices && this.pricing.prices.length) {
3045 /** @type {?} */
3046 const hasCurrencyAndIsNotUSD = this.pricing.currency && this.pricing.currency !== 'USD';
3047 /** @type {?} */
3048 const currencyStr = hasCurrencyAndIsNotUSD ? this.pricing.currency : '';
3049 /** @type {?} */
3050 const currencySymbol = Sellable.getCurrencySymbol(this.pricing.currency);
3051 return this.pricing.prices.map((/**
3052 * @param {?} price
3053 * @return {?}
3054 */
3055 price => {
3056 /** @type {?} */
3057 const frequencyStr = price.frequency ? '/ ' + Sellable.getCapitalizeFirstLetter(price.frequency) : '';
3058 /** @type {?} */
3059 const roundedPrice = ((price.price || 0) / 100.0).toFixed(2);
3060 /** @type {?} */
3061 const startingAtPrefix = price.isStartingPrice ? 'Starting at ' : '';
3062 /** @type {?} */
3063 const priceStr = `${startingAtPrefix}${currencySymbol}${roundedPrice} ${currencyStr} ${frequencyStr}`;
3064 return (priceStr.trim().replace(/\s+/g, ' '));
3065 }));
3066 }
3067 else {
3068 return ['Contact Sales'];
3069 }
3070 }
3071 /**
3072 * @return {?}
3073 */
3074 get priceStrings() {
3075 if (this.shouldContactSales) {
3076 return ['Contact Sales'];
3077 }
3078 if (this.isFree) {
3079 return ['Free'];
3080 }
3081 return this.formattedPricingList;
3082 }
3083 /**
3084 * @return {?}
3085 */
3086 get formattedWholesalePrice() {
3087 return this.priceStrings.join(' + ');
3088 }
3089 /**
3090 * @param {?} currency
3091 * @return {?}
3092 */
3093 static getCurrencySymbol(currency) {
3094 /** @type {?} */
3095 let currencySymbol = '$';
3096 switch (currency) {
3097 case 'EUR':
3098 currencySymbol = '\u20AC';
3099 break;
3100 case 'GBP':
3101 currencySymbol = '\u00A3';
3102 break;
3103 case 'CHF':
3104 currencySymbol = 'Fr';
3105 break;
3106 case 'CNY':
3107 currencySymbol = '\u00A5';
3108 break;
3109 case 'JPY':
3110 currencySymbol = '\u00A5';
3111 break;
3112 case 'CZK':
3113 currencySymbol = 'K\u010d';
3114 break;
3115 case 'INR':
3116 currencySymbol = '\u20B9';
3117 break;
3118 case 'KHR':
3119 currencySymbol = '\u17DB';
3120 break;
3121 case 'KRW':
3122 currencySymbol = '\u20A9';
3123 break;
3124 case 'NOK':
3125 currencySymbol = 'kr';
3126 break;
3127 case 'SEK':
3128 currencySymbol = 'kr';
3129 break;
3130 case 'RUB':
3131 currencySymbol = '\u20BD';
3132 break;
3133 case 'TRY':
3134 currencySymbol = '\u20BA';
3135 break;
3136 case 'ZAR':
3137 currencySymbol = 'R';
3138 break;
3139 default:
3140 currencySymbol = '$';
3141 break;
3142 }
3143 return currencySymbol;
3144 }
3145}
3146if (false) {
3147 /** @type {?} */
3148 Sellable.prototype.pricing;
3149}
3150
3151/**
3152 * @fileoverview added by tsickle
3153 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3154 */
3155// @dynamic
3156class CaseTransform {
3157 /**
3158 * @param {?} value
3159 * @return {?}
3160 */
3161 static snakeToCamelCase(value) {
3162 return value ? value.replace(new RegExp(/_/g), ' ').replace(/\b\w/g, (/**
3163 * @param {?} l
3164 * @return {?}
3165 */
3166 l => l.toUpperCase()))
3167 .replace(/\b\w/, (/**
3168 * @param {?} l
3169 * @return {?}
3170 */
3171 l => l.toLowerCase())).replace(/\s/g, '') : value;
3172 }
3173 /**
3174 * @param {?} value
3175 * @return {?}
3176 */
3177 static lowerToTitleCase(value) {
3178 // Code taken from https://github.com/gouch/to-title-case to support the proper spec.
3179 /** @type {?} */
3180 const smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
3181 return value ? value.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, (/**
3182 * @param {?} match
3183 * @param {?} index
3184 * @param {?} title
3185 * @return {?}
3186 */
3187 function (match, index, title) {
3188 if (index > 0 && index + match.length !== title.length &&
3189 match.search(smallWords) > -1 && title.charAt(index - 2) !== ':' &&
3190 (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
3191 title.charAt(index - 1).search(/[^\s-]/) < 0) {
3192 return match.toLowerCase();
3193 }
3194 if (match.substr(1).search(/[A-Z]|\../) > -1) {
3195 return match;
3196 }
3197 return match.charAt(0).toUpperCase() + match.substr(1);
3198 })) : value;
3199 }
3200 ;
3201}
3202
3203/**
3204 * @fileoverview added by tsickle
3205 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3206 */
3207/** @type {?} */
3208const COLOR_CODES = [
3209 '#EF5350', '#42A5F5', '#66BB6A', '#FFA726', '#AB47BC', '#FFCA28', '#EC407A', '#26C6DA',
3210 '#FF7B57'
3211];
3212/** @type {?} */
3213const DEFAULT_COLOR = '#808080';
3214class Product extends Sellable {
3215 /**
3216 * @param {?=} data
3217 */
3218 constructor(data) {
3219 super();
3220 this.addons = [];
3221 data = data || {};
3222 this.pricing = data.pricing;
3223 this.productId = data.productId;
3224 this.editionId = data.editionId;
3225 this.editionName = data.editionName;
3226 this.name = data.name;
3227 this.description = data.description;
3228 this.tagline = data.tagline;
3229 this.iconUrl = data.iconUrl;
3230 this.entryUrl = data.entryUrl;
3231 this.screenshotUrls = data.screenshotUrls;
3232 this.pdfUploadUrls = data.pdfUploadUrls;
3233 this.lmiCategories = data.lmiCategories;
3234 this.keySellingPoints = data.keySellingPoints;
3235 this.faqs = data.faqs;
3236 this.wholesalePrice = data.wholesalePrice;
3237 this.currency = data.currency;
3238 this.billingFrequency = data.billingFrequency;
3239 this.isArchived = data.isArchived;
3240 this.addons = data.addons;
3241 this.restrictions = data.restrictions;
3242 this.billingId = data.billingId;
3243 if (data.hasOwnProperty('pdfUploadUrls')) {
3244 this.files = this.pdfUploadUrls ? this.pdfUploadUrls.map((/**
3245 * @param {?} url
3246 * @return {?}
3247 */
3248 url => new File(url))) : null;
3249 }
3250 }
3251 /**
3252 * @param {?} data
3253 * @return {?}
3254 */
3255 static fromApi(data) {
3256 /** @type {?} */
3257 const newProduct = {};
3258 data = data || {};
3259 for (const key in data) {
3260 if (data.hasOwnProperty(key)) {
3261 /** @type {?} */
3262 const newKey = CaseTransform.snakeToCamelCase(key);
3263 newProduct[newKey] = data[key];
3264 }
3265 }
3266 return new Product(newProduct);
3267 }
3268 /**
3269 * @return {?}
3270 */
3271 get iconStyle() {
3272 return this.iconUrl ? `url("${this.iconUrl}") no-repeat center / 100% 100%` : null;
3273 }
3274 /**
3275 * @return {?}
3276 */
3277 get iconColor() {
3278 // determine an icon color for a product with no icon by using the product name
3279 if (!this.name) {
3280 return DEFAULT_COLOR;
3281 }
3282 /** @type {?} */
3283 let nameSum = 0;
3284 for (let i = 0; i < this.name.length; i++) {
3285 nameSum += this.name[i].charCodeAt(0);
3286 }
3287 /** @type {?} */
3288 const index = nameSum % COLOR_CODES.length;
3289 return COLOR_CODES[index];
3290 }
3291 /**
3292 * @return {?}
3293 */
3294 getLmiCategoryNames() {
3295 /** @type {?} */
3296 const lmiCategories = this.lmiCategories || [];
3297 return lmiCategories.map((/**
3298 * @param {?} lmiCategory
3299 * @return {?}
3300 */
3301 lmiCategory => CaseTransform.lowerToTitleCase(lmiCategory.toLowerCase().replace(/_/g, ' '))));
3302 }
3303}
3304if (false) {
3305 /** @type {?} */
3306 Product.prototype.productId;
3307 /** @type {?} */
3308 Product.prototype.editionId;
3309 /** @type {?} */
3310 Product.prototype.editionName;
3311 /** @type {?} */
3312 Product.prototype.name;
3313 /** @type {?} */
3314 Product.prototype.description;
3315 /** @type {?} */
3316 Product.prototype.tagline;
3317 /** @type {?} */
3318 Product.prototype.iconUrl;
3319 /** @type {?} */
3320 Product.prototype.entryUrl;
3321 /** @type {?} */
3322 Product.prototype.screenshotUrls;
3323 /** @type {?} */
3324 Product.prototype.pdfUploadUrls;
3325 /** @type {?} */
3326 Product.prototype.lmiCategories;
3327 /** @type {?} */
3328 Product.prototype.keySellingPoints;
3329 /** @type {?} */
3330 Product.prototype.faqs;
3331 /** @type {?} */
3332 Product.prototype.wholesalePrice;
3333 /** @type {?} */
3334 Product.prototype.currency;
3335 /** @type {?} */
3336 Product.prototype.billingFrequency;
3337 /** @type {?} */
3338 Product.prototype.billingId;
3339 /** @type {?} */
3340 Product.prototype.isArchived;
3341 /** @type {?} */
3342 Product.prototype.addons;
3343 /** @type {?} */
3344 Product.prototype.files;
3345 /** @type {?} */
3346 Product.prototype.restrictions;
3347}
3348class ProductWithParent extends Product {
3349 /**
3350 * @param {?} data
3351 * @return {?}
3352 */
3353 static fromApi(data) {
3354 /** @type {?} */
3355 const newProduct = {};
3356 data = data || {};
3357 for (const key in data) {
3358 if (data.hasOwnProperty(key)) {
3359 /** @type {?} */
3360 const newKey = CaseTransform.snakeToCamelCase(key);
3361 newProduct[newKey] = data[key];
3362 }
3363 }
3364 return new ProductWithParent(newProduct);
3365 }
3366 /**
3367 * @param {?=} data
3368 */
3369 constructor(data) {
3370 super(data);
3371 this.parentId = data.parentId;
3372 this.parentName = data.parentName;
3373 this.parentIconUrl = data.parentIconUrl;
3374 this.multipleActivations = data.multipleActivations || false;
3375 }
3376}
3377if (false) {
3378 /** @type {?} */
3379 ProductWithParent.prototype.parentId;
3380 /** @type {?} */
3381 ProductWithParent.prototype.parentName;
3382 /** @type {?} */
3383 ProductWithParent.prototype.parentIconUrl;
3384 /** @type {?} */
3385 ProductWithParent.prototype.multipleActivations;
3386}
3387
3388/**
3389 * @fileoverview added by tsickle
3390 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3391 */
3392class AddonDetailsComponent {
3393 constructor() {
3394 this.hasVerifiedContract = false;
3395 this.loaded = true;
3396 this.showPricing = true;
3397 this.showEnableAddon = false;
3398 this.actionEnabled = false;
3399 this.prerequisiteSelected = new EventEmitter();
3400 this.actionSelected = new EventEmitter();
3401 }
3402 /**
3403 * @return {?}
3404 */
3405 onPrerequisiteSelected() {
3406 this.prerequisiteSelected.emit();
3407 }
3408 /**
3409 * @return {?}
3410 */
3411 onActionSelected() {
3412 this.actionSelected.emit();
3413 }
3414 /**
3415 * @param {?} product
3416 * @param {?} addon
3417 * @return {?}
3418 */
3419 getPricing(product, addon) {
3420 return {
3421 currency: product.currency,
3422 prices: [
3423 {
3424 price: addon.price,
3425 frequency: addon.billingFrequency ? addon.billingFrequency : 'Monthly'
3426 }
3427 ]
3428 };
3429 }
3430 /**
3431 * @return {?}
3432 */
3433 get pricingLabel() {
3434 return this.reseller ? 'Wholesale Pricing' : 'Pricing';
3435 }
3436}
3437AddonDetailsComponent.decorators = [
3438 { type: Component, args: [{
3439 selector: 'addon-details',
3440 template: "<div class=\"addon-page\">\n <va-header-container [iconUrl]=\"addon.icon\"\n [title]=\"addon.title\"\n [tagline]=\"addon.tagline\"\n [chipLabels]=\"product.getLmiCategoryNames()\"\n [pricing]=\"getPricing(product, addon)\"\n [pricingLabel]=\"pricingLabel\"\n [prerequisiteLabel]=\"product.name\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"'Enable Add-on'\"\n [showEnableAddon]=\"showEnableAddon\"\n (actionSelected)=\"onActionSelected()\"\n (prerequisiteSelected)=\"onPrerequisiteSelected()\">\n </va-header-container>\n\n <div class=\"addon-details addon-content\">\n <ng-container *ngIf=\"reseller\">\n <div class=\"left-column\">\n <div *ngIf=\"addon.resellerMarketing?.description || addon.resellerMarketing?.keySellingPoints\">\n <va-selling-info [description]=\"addon.resellerMarketing?.description\"\n [keySellingPoints]=\"addon.resellerMarketing?.keySellingPoints\"></va-selling-info>\n </div>\n <section *ngIf=\"addon.resellerMarketing?.faqs?.length > 0 && addon.resellerMarketing?.faqs[0].question\">\n <h2 class=\"va-addon-title\">FAQs</h2>\n <va-faqs [faqs]=\"addon.resellerMarketing?.faqs\"></va-faqs>\n </section>\n </div>\n <div class=\"right-column\">\n <section *ngIf=\"addon.restrictions?.country?.whitelist\">\n <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n </section>\n <section *ngIf=\"addon.screenshots?.length > 0\">\n <h2 class=\"va-addon-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n </section>\n <section *ngIf=\"addon.resellerMarketing?.files?.length > 0\">\n <h2 class=\"va-addon-title\">Files</h2>\n <va-files [files]=\"addon.resellerMarketingFiles\"></va-files>\n </section>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!reseller\">\n <div class=\"left-column\">\n <div *ngIf=\"addon.endUserMarketing?.description || addon.endUserMarketing?.keySellingPoints\">\n <va-selling-info [description]=\"addon.endUserMarketing?.description\"\n [keySellingPoints]=\"addon.endUserMarketing?.keySellingPoints\"></va-selling-info>\n </div>\n <section *ngIf=\"addon.endUserMarketing?.faqs?.length > 0 && addon.endUserMarketing?.faqs[0].question\">\n <h2 class=\"va-addon-title\">FAQs</h2>\n <va-faqs [faqs]=\"addon.endUserMarketing?.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"addon.restrictions?.country?.whitelist?.length > 0\">\n <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n </section>\n <section *ngIf=\"addon.screenshots?.length > 0\">\n <h2 class=\"va-addon-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n </section>\n <section *ngIf=\"addon.endUserMarketing?.files?.length > 0\">\n <h2 class=\"va-addon-title\">Files</h2>\n <va-files [files]=\"addon.endUserMarketingFiles\"></va-files>\n </section>\n </div>\n </ng-container>\n </div>\n\n</div>\n",
3441 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-addon-title{font-size:32px;font-weight:300;margin-top:0;color:#212121}@media screen and (min-width:600px){.va-addon-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.addon-page{position:relative;margin:0 auto 20px;background:#fff;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px;color:#212121}.addon-page .item-amount{color:#999;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.addon-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.addon-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
3442 }] }
3443];
3444AddonDetailsComponent.propDecorators = {
3445 product: [{ type: Input }],
3446 addon: [{ type: Input }],
3447 reseller: [{ type: Input }],
3448 billedProduct: [{ type: Input }],
3449 hasVerifiedContract: [{ type: Input }],
3450 loaded: [{ type: Input }],
3451 showPricing: [{ type: Input }],
3452 showEnableAddon: [{ type: Input }],
3453 actionEnabled: [{ type: Input }],
3454 prerequisiteSelected: [{ type: Output }],
3455 actionSelected: [{ type: Output }]
3456};
3457if (false) {
3458 /** @type {?} */
3459 AddonDetailsComponent.prototype.product;
3460 /** @type {?} */
3461 AddonDetailsComponent.prototype.addon;
3462 /** @type {?} */
3463 AddonDetailsComponent.prototype.reseller;
3464 /** @type {?} */
3465 AddonDetailsComponent.prototype.billedProduct;
3466 /** @type {?} */
3467 AddonDetailsComponent.prototype.hasVerifiedContract;
3468 /** @type {?} */
3469 AddonDetailsComponent.prototype.loaded;
3470 /** @type {?} */
3471 AddonDetailsComponent.prototype.showPricing;
3472 /** @type {?} */
3473 AddonDetailsComponent.prototype.showEnableAddon;
3474 /** @type {?} */
3475 AddonDetailsComponent.prototype.actionEnabled;
3476 /** @type {?} */
3477 AddonDetailsComponent.prototype.prerequisiteSelected;
3478 /** @type {?} */
3479 AddonDetailsComponent.prototype.actionSelected;
3480}
3481
3482/**
3483 * @fileoverview added by tsickle
3484 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3485 */
3486class VaFilesComponent {
3487}
3488VaFilesComponent.decorators = [
3489 { type: Component, args: [{
3490 selector: 'va-files',
3491 template: `
3492 <div class="va-files file-list-container" *ngFor="let file of files">
3493 <mat-icon class="file-icon">insert_drive_file</mat-icon>
3494 <a [href]="file.url" target="_blank">{{ file.name }}</a>
3495 </div>`,
3496 styles: [".va-files{display:-webkit-inline-box;display:inline-flex;margin-bottom:16px}.va-files a{color:#212121;font-size:16px;font-weight:700;-ms-grid-row-align:center;align-self:center;padding-left:8px;text-decoration:none}.va-files .file-icon{vertical-align:middle}.va-files .file-list-container{display:-webkit-box;display:flex}"]
3497 }] }
3498];
3499VaFilesComponent.propDecorators = {
3500 files: [{ type: Input }]
3501};
3502if (false) {
3503 /** @type {?} */
3504 VaFilesComponent.prototype.files;
3505}
3506
3507/**
3508 * @fileoverview added by tsickle
3509 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3510 */
3511class VaFilesModule {
3512}
3513VaFilesModule.decorators = [
3514 { type: NgModule, args: [{
3515 imports: [
3516 CommonModule,
3517 MatIconModule
3518 ],
3519 declarations: [VaFilesComponent],
3520 exports: [VaFilesComponent]
3521 },] }
3522];
3523
3524/**
3525 * @fileoverview added by tsickle
3526 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3527 */
3528class VaFaqsComponent {
3529 constructor() {
3530 this.openFaqs = [];
3531 }
3532 /**
3533 * @param {?} index
3534 * @return {?}
3535 */
3536 toggleFaq(index) {
3537 if (this.openFaqs.indexOf(index) >= 0) {
3538 this.openFaqs.splice(this.openFaqs.indexOf(index), 1); // Remove
3539 }
3540 else {
3541 this.openFaqs.push(index); // Insert
3542 }
3543 }
3544 /**
3545 * @param {?} index
3546 * @return {?}
3547 */
3548 isFaqOpen(index) {
3549 return this.openFaqs.indexOf(index) >= 0;
3550 }
3551 /**
3552 * @param {?} index
3553 * @return {?}
3554 */
3555 faqIcon(index) {
3556 return this.isFaqOpen(index) ? 'keyboard_arrow_up' : 'keyboard_arrow_down';
3557 }
3558}
3559VaFaqsComponent.decorators = [
3560 { type: Component, args: [{
3561 selector: 'va-faqs',
3562 template: `
3563 <div class="va-faq" *ngFor="let faq of faqs; let i = index;">
3564 <div class="question" (click)="toggleFaq(i)">
3565 <span>{{ faq.question }}</span>
3566 <mat-icon>{{ faqIcon(i) }}</mat-icon>
3567 </div>
3568 <span class="answer" [ngClass]="{'show': isFaqOpen(i) }" [innerHtml]="faq.answer | vaSanitize"></span>
3569 </div>`,
3570 styles: [".va-faq{font-size:16px;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:start;justify-content:flex-start;padding:12px 0;border-bottom:1px solid #e0e0e0}.va-faq:first-of-type{border-top:1px solid #e0e0e0}.va-faq .question{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;color:#212121;cursor:pointer}.va-faq .answer{color:#616161;height:0;overflow:hidden}.va-faq .show{padding-top:12px;height:inherit}"]
3571 }] }
3572];
3573VaFaqsComponent.propDecorators = {
3574 faqs: [{ type: Input }]
3575};
3576if (false) {
3577 /** @type {?} */
3578 VaFaqsComponent.prototype.faqs;
3579 /** @type {?} */
3580 VaFaqsComponent.prototype.openFaqs;
3581}
3582
3583/**
3584 * @fileoverview added by tsickle
3585 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3586 */
3587class VaFaqsModule {
3588}
3589VaFaqsModule.decorators = [
3590 { type: NgModule, args: [{
3591 imports: [CommonModule, MatIconModule, VaSafeHtmlModule],
3592 declarations: [VaFaqsComponent],
3593 exports: [VaFaqsComponent]
3594 },] }
3595];
3596
3597/**
3598 * @fileoverview added by tsickle
3599 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3600 */
3601class VaSellingInfoComponent {
3602 /**
3603 * @return {?}
3604 */
3605 get filterDescription() {
3606 /** @type {?} */
3607 const desc = this.description.replace(/max-width:\d*[^\"]/i, 'max-width:100%');
3608 if ((desc.indexOf('"max-width:100%"') === -1) && (desc.indexOf('<iframe ') !== -1)) {
3609 /** @type {?} */
3610 const index = desc.indexOf('<iframe ') + 7;
3611 return desc.substr(0, index) + ' style="max-width:100%"' + desc.substr(index);
3612 }
3613 return String(desc);
3614 }
3615}
3616VaSellingInfoComponent.decorators = [
3617 { type: Component, args: [{
3618 selector: 'va-selling-info',
3619 template: `
3620 <section *ngIf="description" class="resize" [innerHtml]="filterDescription | vaSafeHtml"></section>
3621 <section *ngIf="keySellingPoints && keySellingPoints.length > 0" class="key-selling-points">
3622 <div *ngFor="let ksp of keySellingPoints" class="key-selling-point">
3623 <mat-icon>check_circle</mat-icon>
3624 {{ ksp }}
3625 </div>
3626 </section>
3627 `,
3628 styles: ["section{padding:24px}section ::ng-deep>:first-child{margin-top:0;padding-top:0}#description *{max-width:100%!important}.key-selling-point{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;padding-bottom:24px;font-size:16px}@media screen and (max-width:600px){.resize{font-size:16px}.key-selling-point{-webkit-box-align:start;align-items:flex-start}}.key-selling-point:last-of-type{padding-bottom:0}.key-selling-point mat-icon{color:#4caf50;font-size:32px;width:32px;height:32px;margin-right:20px}"]
3629 }] }
3630];
3631VaSellingInfoComponent.propDecorators = {
3632 description: [{ type: Input }],
3633 keySellingPoints: [{ type: Input }]
3634};
3635if (false) {
3636 /** @type {?} */
3637 VaSellingInfoComponent.prototype.description;
3638 /** @type {?} */
3639 VaSellingInfoComponent.prototype.keySellingPoints;
3640}
3641
3642/**
3643 * @fileoverview added by tsickle
3644 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3645 */
3646class VaSellingInfoModule {
3647}
3648VaSellingInfoModule.decorators = [
3649 { type: NgModule, args: [{
3650 imports: [CommonModule, MatIconModule, VaSafeHtmlModule],
3651 declarations: [VaSellingInfoComponent],
3652 exports: [VaSellingInfoComponent]
3653 },] }
3654];
3655
3656/**
3657 * @fileoverview added by tsickle
3658 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3659 */
3660class SupportedCountriesComponent {
3661}
3662SupportedCountriesComponent.decorators = [
3663 { type: Component, args: [{
3664 selector: 'supported-countries',
3665 template: `
3666 <span class="supported-text"> Supported Countries: </span>
3667 <div class="flags">
3668 <span *ngFor="let countryCode of countryCodes" matTooltip="{{countryCode}}" matTooltipPosition="below"
3669 class="flag-icon flag-icon-{{countryCode.toLowerCase()}}">
3670 </span>
3671 </div>
3672 `,
3673 styles: [".flag-icon{margin-right:10px}.supported-text{margin-right:3px}.flags{display:inline-block}"]
3674 }] }
3675];
3676SupportedCountriesComponent.propDecorators = {
3677 countryCodes: [{ type: Input }]
3678};
3679if (false) {
3680 /** @type {?} */
3681 SupportedCountriesComponent.prototype.countryCodes;
3682}
3683
3684/**
3685 * @fileoverview added by tsickle
3686 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3687 */
3688class RestrictionsModule {
3689}
3690RestrictionsModule.decorators = [
3691 { type: NgModule, args: [{
3692 imports: [CommonModule, MatTooltipModule],
3693 declarations: [SupportedCountriesComponent],
3694 exports: [SupportedCountriesComponent]
3695 },] }
3696];
3697
3698/**
3699 * @fileoverview added by tsickle
3700 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3701 */
3702class AddonModule {
3703}
3704AddonModule.decorators = [
3705 { type: NgModule, args: [{
3706 imports: [
3707 CommonModule,
3708 VaListModule,
3709 VaImageGalleryModule,
3710 VaIconModule,
3711 VaPricingModule,
3712 VaFilesModule,
3713 VaFaqsModule,
3714 VaSellingInfoModule,
3715 VaHeaderContainerModule,
3716 VaSafeHtmlModule,
3717 MatProgressSpinnerModule$1,
3718 VaBreadcrumbsModule,
3719 RestrictionsModule
3720 ],
3721 exports: [AddonDetailsComponent],
3722 declarations: [AddonDetailsComponent],
3723 providers: [],
3724 entryComponents: []
3725 },] }
3726];
3727
3728/**
3729 * @fileoverview added by tsickle
3730 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3731 */
3732class DetailsStencilComponent {
3733}
3734DetailsStencilComponent.decorators = [
3735 { type: Component, args: [{
3736 selector: 'details-stencil',
3737 template: `
3738 <div class="details">
3739
3740 <mat-card class="details-header">
3741 <div class="details-column-0">
3742 <div class="details-column-0-1">
3743 <div class="details-icon stencil-shimmer"></div>
3744 </div>
3745 <div class="details-column-0-2">
3746 <div class="details-title stencil-shimmer"></div>
3747 <div class="details-title stencil-shimmer"></div>
3748 </div>
3749 </div>
3750 <div class="details-column-1">
3751 <div class="details-column-1-0 stencil-shimmer"></div>
3752 <div class="details-column-1-1 stencil-shimmer"></div>
3753 </div>
3754 </mat-card>
3755
3756 <mat-card>
3757 <div class="details-box-large stencil-shimmer"></div>
3758 </mat-card>
3759
3760 <mat-card class="details-body">
3761 <div class="details-body-column-0" >
3762 <div class="details-icon-small stencil-shimmer"></div>
3763 <div class="details-icon-small stencil-shimmer"></div>
3764 <div class="details-icon-small stencil-shimmer"></div>
3765 <div class="details-icon-small stencil-shimmer"></div>
3766 <div class="details-icon-small stencil-shimmer"></div>
3767 <div class="details-icon-small stencil-shimmer"></div>
3768 <div class="details-icon-small stencil-shimmer"></div>
3769 </div>
3770 <div class="details-body-column-1">
3771 <div class="details-line stencil-shimmer"></div>
3772 <div class="details-line stencil-shimmer"></div>
3773 <div class="details-line stencil-shimmer"></div>
3774 <div class="details-line stencil-shimmer"></div>
3775 <div class="details-line stencil-shimmer"></div>
3776 <div class="details-line stencil-shimmer"></div>
3777 <div class="details-line stencil-shimmer"></div>
3778 </div>
3779 <div class="details-body-column-2">
3780 <div class="details-box stencil-shimmer"></div>
3781 <div class="details-box stencil-shimmer"></div>
3782 <div class="details-box stencil-shimmer"></div>
3783 <div class="details-box stencil-shimmer"></div>
3784 <div class="details-box stencil-shimmer"></div>
3785 </div>
3786 </mat-card>
3787
3788 </div>
3789 `,
3790 styles: [".details{position:relative;margin:0 auto 20px;background:#fff;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.details-header{display:-webkit-box;display:flex;height:180px}.details-column-0{display:-webkit-box;display:flex;width:66%}@media screen and (max-width:600px){.details-column-0{width:100%}}.details-column-0-1{display:-webkit-box;display:flex;width:25%;min-width:120px}@media screen and (max-width:600px){.details-column-0-1{width:50%}}.details-icon{height:120px;width:120px;border-radius:50%}.details-title{margin:20px 0 20px 20px;height:32px;width:250px}@media screen and (max-width:600px){.details-title{width:120px}}.details-column-1{width:34%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:1100px){.details-column-1{width:0}}.details-column-1-0{height:32px;margin:10px 0}.details-column-1-1{height:70px}@media screen and (max-width:600px){.details-column-1-0{width:0;margin:0}.details-column-1-1{height:0}}.details-box-large{display:-webkit-box;display:flex;width:650px;height:150px}@media screen and (max-width:1100px){.details-box-large{width:100%}}.details-body{display:-webkit-box;display:flex;height:500px;width:100%}.details-body-column-0{width:10%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:600px){.details-body-column-0{width:0%}}.details-body-column-1{width:56%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:600px){.details-body-column-1{width:100%}}.details-icon-small{margin-bottom:24px;display:-webkit-box;display:flex;height:32px;width:32px;border-radius:50%}.details-line{margin-bottom:24px;height:32px;width:400px}@media screen and (max-width:600px){.details-line{width:100%;margin-right:10px}}.details-body-column-2{width:34%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:1100px){.details-body-column-2{width:0}}.details-box{height:70px;margin-bottom:10px}@media screen and (max-width:600px){.details-box{width:0;margin:0}}"]
3791 }] }
3792];
3793
3794/**
3795 * @fileoverview added by tsickle
3796 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3797 */
3798class CardStencilComponent {
3799}
3800CardStencilComponent.decorators = [
3801 { type: Component, args: [{
3802 selector: 'card-stencil',
3803 template: `
3804 <div class="card-stencil-container">
3805 <mat-card class="card-stencil">
3806 <div class="card-stencil-header stencil-shimmer"></div>
3807 <div class="card-stencil-footer">
3808 <div class="card-stencil-circle stencil-shimmer"></div>
3809 <div>
3810 <div class="card-stencil-line-large stencil-shimmer"></div>
3811 <div class="card-stencil-line-medium stencil-shimmer"></div>
3812 </div>
3813 </div>
3814 </mat-card>
3815 </div>
3816 `,
3817 styles: [".card-stencil-container{position:relative;width:100%;padding-bottom:100%;margin-bottom:-45%}.card-stencil{position:absolute;width:100%;height:55%;padding:0;margin-bottom:0}.card-stencil-header{display:-webkit-box;display:flex;height:60%}.card-stencil-footer{display:-webkit-box;display:flex;height:40%;-webkit-box-align:center;align-items:center}.card-stencil-circle{margin:0 16px;height:60px;width:60px;border-radius:50%}@media screen and (max-width:650px){.card-stencil-circle{width:45px;height:45px}}.card-stencil-line-large{height:20px;width:200px;margin-bottom:10px}@media screen and (max-width:650px){.card-stencil-line-large{width:100px;height:10px}}.card-stencil-line-medium{height:20px;width:160px}@media screen and (max-width:650px){.card-stencil-line-medium{width:80px;height:10px}}"]
3818 }] }
3819];
3820
3821/**
3822 * @fileoverview added by tsickle
3823 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3824 */
3825class CardListStencilComponent {
3826 constructor() {
3827 this.numCards = 3;
3828 this.cards = [];
3829 }
3830 /**
3831 * @return {?}
3832 */
3833 ngOnInit() {
3834 for (let n = 0; n < this.numCards; n++) {
3835 this.cards.push(n);
3836 }
3837 }
3838}
3839CardListStencilComponent.decorators = [
3840 { type: Component, args: [{
3841 selector: 'card-stencil-list',
3842 template: `
3843 <div class="row row-gutters">
3844 <div *ngFor="let _ of cards" class="col-flex">
3845 <card-stencil></card-stencil>
3846 </div>
3847 </div>
3848 `,
3849 styles: [`
3850 .row {
3851 display: flex;
3852 flex-wrap: wrap;
3853 }
3854
3855 .row + .row-gutters {
3856 margin-top: 0;
3857 }
3858
3859 .row-gutters {
3860 margin-top: -20px;
3861 margin-left: -20px;
3862 }
3863
3864 .row-gutters > .col-flex {
3865 padding-top: 20px;
3866 padding-left: 20px;
3867 }
3868
3869 .col-flex {
3870 position: relative;
3871 max-width: 100%;
3872 box-sizing: border-box;
3873 flex: 0 0 auto;
3874 width: 100%;
3875 }
3876
3877 @media screen and (min-width: 480px) {
3878 .col-flex {
3879 width: 50%;
3880 }
3881 }
3882
3883 @media screen and (min-width: 1200px) {
3884
3885 .col-flex {
3886 width: 33.333333%;
3887 }
3888 }
3889
3890 `]
3891 }] }
3892];
3893CardListStencilComponent.propDecorators = {
3894 numCards: [{ type: Input }]
3895};
3896if (false) {
3897 /** @type {?} */
3898 CardListStencilComponent.prototype.numCards;
3899 /** @type {?} */
3900 CardListStencilComponent.prototype.cards;
3901}
3902
3903/**
3904 * @fileoverview added by tsickle
3905 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3906 */
3907class SearchBarStencilComponent {
3908}
3909SearchBarStencilComponent.decorators = [
3910 { type: Component, args: [{
3911 selector: 'search-bar-stencil',
3912 template: `
3913 <div class="search-bar-stencil-container">
3914 <div class="search-bar-stencil-line stencil-shimmer">
3915 <div class="search-bar-stencil-icon"></div>
3916 </div>
3917 </div>
3918 `,
3919 styles: [`
3920 .search-bar-stencil-container {
3921 height: 52px;
3922 display: flex;
3923 align-content: center;
3924 background-color: white;
3925 border-radius: 2px;
3926 }
3927 .search-bar-stencil-line {
3928 height: 30px;
3929 width: 350px;
3930 margin: auto 10px;
3931 display: flex;
3932 justify-content: flex-end;
3933 }
3934 .search-bar-stencil-icon {
3935 background-color: white;
3936 width: 20px;
3937 height: 20px;
3938 margin: auto 5px;
3939 }
3940 `]
3941 }] }
3942];
3943
3944/**
3945 * @fileoverview added by tsickle
3946 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3947 */
3948class ListStencilComponent {
3949 constructor() {
3950 this.showHeader = true;
3951 this.numRows = 3;
3952 this.rowHeight = '51px'; // defaults to height of partner center business tab height (95px for marketplace)
3953 // defaults to height of partner center business tab height (95px for marketplace)
3954 this.sidePadding = '17px'; // defaults to padding on partner center business padding (38px for marketplace)
3955 // defaults to padding on partner center business padding (38px for marketplace)
3956 this.rows = []; // this is to turn the number of rows into an arbitrary list so we can loop through them
3957 }
3958 /**
3959 * @return {?}
3960 */
3961 ngOnInit() {
3962 for (let n = 0; n < this.numRows; n++) {
3963 this.rows.push(n);
3964 }
3965 // if you think this is gross i agree
3966 // if you think this is gross and actually have a solution hit me up otherwise just enjoy the magic.
3967 // determine the height of each row for the table
3968 this.listItemRowStyles = {
3969 'height': `${this.rowHeight}`,
3970 'padding': `0 ${this.sidePadding}`
3971 };
3972 }
3973}
3974ListStencilComponent.decorators = [
3975 { type: Component, args: [{
3976 selector: 'list-stencil',
3977 template: `
3978 <mat-card class="list-container">
3979 <div *ngIf="showHeader" class="list-header stencil-shimmer" style=""></div>
3980 <div *ngFor="let _ of rows">
3981 <div class="list-item-row" [ngStyle]="listItemRowStyles">
3982 <div class="stencil-shimmer" style="margin: 0; padding: 0; width: 100%; height: 80%;"></div>
3983 </div>
3984 </div>
3985 </mat-card>
3986 `,
3987 styles: [`
3988 .list-container { padding: 0; }
3989 .list-header { height: 40px; }
3990 .list-item-row { height: 50px; display: flex; justify-content: space-between; align-items: center; }
3991 `]
3992 }] }
3993];
3994ListStencilComponent.propDecorators = {
3995 showHeader: [{ type: Input }],
3996 numRows: [{ type: Input }],
3997 rowHeight: [{ type: Input }],
3998 sidePadding: [{ type: Input }]
3999};
4000if (false) {
4001 /** @type {?} */
4002 ListStencilComponent.prototype.showHeader;
4003 /** @type {?} */
4004 ListStencilComponent.prototype.numRows;
4005 /** @type {?} */
4006 ListStencilComponent.prototype.rowHeight;
4007 /** @type {?} */
4008 ListStencilComponent.prototype.sidePadding;
4009 /** @type {?} */
4010 ListStencilComponent.prototype.rows;
4011 /** @type {?} */
4012 ListStencilComponent.prototype.listItemRowStyles;
4013}
4014
4015/**
4016 * @fileoverview added by tsickle
4017 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4018 */
4019class StencilsModule {
4020}
4021StencilsModule.decorators = [
4022 { type: NgModule, args: [{
4023 imports: [CommonModule, MatCardModule, MatIconModule, MatInputModule, MatSelectModule, MatExpansionModule, MatCheckboxModule],
4024 declarations: [DetailsStencilComponent, CardStencilComponent, CardListStencilComponent, SearchBarStencilComponent, ListStencilComponent],
4025 exports: [DetailsStencilComponent, CardStencilComponent, CardListStencilComponent, SearchBarStencilComponent, ListStencilComponent]
4026 },] }
4027];
4028
4029/**
4030 * @fileoverview added by tsickle
4031 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4032 */
4033class VaAddonListComponent {
4034 /**
4035 * @param {?} billingService
4036 * @param {?} cdr
4037 */
4038 constructor(billingService, cdr) {
4039 this.billingService = billingService;
4040 this.cdr = cdr;
4041 this.showPricing = true;
4042 this._hasVerifiedContract = null;
4043 this._canAccessContractPricing = null;
4044 this.addonSelected = new EventEmitter();
4045 this.billedProductsMap = new Map();
4046 this.billedProductLoaded = new Map();
4047 this.subscriptions = [];
4048 }
4049 /**
4050 * @param {?} addons
4051 * @return {?}
4052 */
4053 set addons(addons) {
4054 this._addons = addons;
4055 this.populateBilledProduct();
4056 }
4057 /**
4058 * @param {?} value
4059 * @return {?}
4060 */
4061 set hasVerifiedContract(value) {
4062 this._hasVerifiedContract = value;
4063 this.populateBilledProduct();
4064 }
4065 /**
4066 * @param {?} value
4067 * @return {?}
4068 */
4069 set canAccessContractPricing(value) {
4070 this._canAccessContractPricing = value;
4071 this.populateBilledProduct();
4072 }
4073 /**
4074 * @return {?}
4075 */
4076 ngOnInit() {
4077 this.populateBilledProduct();
4078 }
4079 /**
4080 * @return {?}
4081 */
4082 populateBilledProduct() {
4083 if (this.displayContractPricing()) {
4084 /** @type {?} */
4085 const billingIDs = this._addons.map((/**
4086 * @param {?} a
4087 * @return {?}
4088 */
4089 a => {
4090 this.billedProductsMap.set(a.addonId, null);
4091 this.billedProductLoaded.set(a.addonId, false);
4092 return a.billingId;
4093 }));
4094 this.subscriptions.push(this.billingService.getMultiProductPricing(this.partnerID, billingIDs).subscribe((/**
4095 * @param {?} pricing
4096 * @return {?}
4097 */
4098 pricing => {
4099 this._addons.forEach((/**
4100 * @param {?} addon
4101 * @return {?}
4102 */
4103 addon => {
4104 /** @type {?} */
4105 const addonPricing = pricing[addon.billingId];
4106 if (!addonPricing) {
4107 return;
4108 }
4109 /** @type {?} */
4110 const billedProduct = buildBilledProductFromProductPricingAndAddon(addon, addonPricing);
4111 this.billedProductsMap.set(addon.addonId, billedProduct);
4112 this.billedProductLoaded.set(addon.addonId, true);
4113 }));
4114 this.cdr.detectChanges();
4115 })));
4116 }
4117 }
4118 /**
4119 * @param {?} addonId
4120 * @return {?}
4121 */
4122 onClick(addonId) {
4123 this.addonSelected.emit(addonId);
4124 }
4125 /**
4126 * @param {?} object
4127 * @return {?}
4128 */
4129 instanceOfPricing(object) {
4130 if (typeof object === 'number') {
4131 return false;
4132 }
4133 return object.currency !== undefined && object.prices !== undefined;
4134 }
4135 /**
4136 * @param {?} addon
4137 * @return {?}
4138 */
4139 getDisplayPricing(addon) {
4140 /** @type {?} */
4141 const price = addon.price;
4142 if (price && this.instanceOfPricing(price)) {
4143 return price;
4144 }
4145 return {
4146 currency: addon.currency,
4147 prices: [
4148 {
4149 price: addon.price,
4150 frequency: addon.billingFrequency ? addon.billingFrequency : 'Monthly'
4151 }
4152 ]
4153 };
4154 }
4155 /**
4156 * @return {?}
4157 */
4158 noData() {
4159 return isNullOrUndefined(this._hasVerifiedContract) || isNullOrUndefined(this._canAccessContractPricing);
4160 }
4161 /**
4162 * @return {?}
4163 */
4164 displayContractPricing() {
4165 return this._canAccessContractPricing && this._hasVerifiedContract;
4166 }
4167 /**
4168 * @param {?} addon
4169 * @return {?}
4170 */
4171 isBilledProductLoaded(addon) {
4172 if (this.noData()) {
4173 return false;
4174 }
4175 if (this.displayContractPricing()) {
4176 /** @type {?} */
4177 const value = this.billedProductLoaded.get(addon.addonId);
4178 return value ? value : false;
4179 }
4180 return true;
4181 }
4182 /**
4183 * @return {?}
4184 */
4185 ngOnDestroy() {
4186 this.subscriptions.forEach((/**
4187 * @param {?} subscription
4188 * @return {?}
4189 */
4190 subscription => subscription.unsubscribe()));
4191 }
4192}
4193VaAddonListComponent.decorators = [
4194 { type: Component, args: [{
4195 selector: 'va-addon-list',
4196 template: "<mat-list *ngIf=\"_addons\" class=\"addon-list\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let addon of _addons\">\n <mat-list-item (click)=\"onClick(addon.addonId)\">\n <div class=\"addon-icon-title\">\n <img *ngIf=\"addon.icon;else noIcon\" class=\"addon-icon\" [src]=\"addon.icon\" mat-list-avatar/>\n <ng-template #noIcon>\n <mat-icon class=\"addon-default-icon\" mat-list-icon>add_circle</mat-icon>\n </ng-template>\n <div class=\"addon-title-tagline\">\n <p class=\"addon-title\" matLine>{{ addon.title }} </p>\n <p class=\"addon-tagline\" matLine>{{ addon.tagline }}</p>\n </div>\n </div>\n <div *ngIf=\"showPricing\" class=\"price-section\">\n <va-pricing\n [pricing]=\"getDisplayPricing(addon)\"\n [highlightPrice]=\"false\"\n [hasVerifiedContract]=\"_hasVerifiedContract\"\n [billedProduct]=\"billedProductsMap.get(addon.addonId)\"\n [loaded]=\"isBilledProductLoaded(addon)\">\n </va-pricing>\n </div>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n</mat-list>\n",
4197 styles: [":host{display:block}h2+:host{margin:-8px 0}:host ::ng-deep .mat-list-item.mat-2-line{height:auto!important}:host ::ng-deep .mat-list .mat-list-item .mat-list-item-content{padding:8px;-webkit-box-align:start;align-items:flex-start;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (min-width:800px){:host ::ng-deep .mat-list .mat-list-item .mat-list-item-content{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}.addon-list{position:relative}.addon-default-icon{margin:0 5px;color:#4caf50}.addon-icon{width:32px;height:32px}.addon-icon-title{-webkit-box-flex:1;flex-grow:1;display:-webkit-box;display:flex;width:100%}@media screen and (min-width:800px){.addon-icon-title{width:auto}}.addon-title-tagline{padding:0 16px 10px 8px;-webkit-box-flex:1;flex-grow:1}.addon-title-tagline .addon-title{color:#212121;font-size:16px;line-height:1.2;margin:6px 0;white-space:normal}.addon-title-tagline .addon-tagline{color:#616161;font-size:14px;margin:0;white-space:normal}.price-section{min-width:10em;margin-top:6px;flex-shrink:0}mat-list-item:hover{background-color:#fafafa!important;cursor:pointer!important}"]
4198 }] }
4199];
4200/** @nocollapse */
4201VaAddonListComponent.ctorParameters = () => [
4202 { type: BillingService },
4203 { type: ChangeDetectorRef }
4204];
4205VaAddonListComponent.propDecorators = {
4206 addons: [{ type: Input, args: ['addons',] }],
4207 showPricing: [{ type: Input }],
4208 partnerID: [{ type: Input }],
4209 hasVerifiedContract: [{ type: Input, args: ['hasVerifiedContract',] }],
4210 canAccessContractPricing: [{ type: Input, args: ['canAccessContractPricing',] }],
4211 addonSelected: [{ type: Output }]
4212};
4213if (false) {
4214 /** @type {?} */
4215 VaAddonListComponent.prototype._addons;
4216 /** @type {?} */
4217 VaAddonListComponent.prototype.showPricing;
4218 /** @type {?} */
4219 VaAddonListComponent.prototype.partnerID;
4220 /** @type {?} */
4221 VaAddonListComponent.prototype._hasVerifiedContract;
4222 /** @type {?} */
4223 VaAddonListComponent.prototype._canAccessContractPricing;
4224 /** @type {?} */
4225 VaAddonListComponent.prototype.addonSelected;
4226 /** @type {?} */
4227 VaAddonListComponent.prototype.billedProductsMap;
4228 /**
4229 * @type {?}
4230 * @private
4231 */
4232 VaAddonListComponent.prototype.billedProductLoaded;
4233 /**
4234 * @type {?}
4235 * @private
4236 */
4237 VaAddonListComponent.prototype.subscriptions;
4238 /**
4239 * @type {?}
4240 * @private
4241 */
4242 VaAddonListComponent.prototype.billingService;
4243 /**
4244 * @type {?}
4245 * @private
4246 */
4247 VaAddonListComponent.prototype.cdr;
4248}
4249
4250/**
4251 * @fileoverview added by tsickle
4252 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4253 */
4254class VaAddonListModule {
4255}
4256VaAddonListModule.decorators = [
4257 { type: NgModule, args: [{
4258 imports: [
4259 BillingModule,
4260 CommonModule,
4261 MatIconModule,
4262 MatListModule$1,
4263 MatDividerModule,
4264 VaPricingModule
4265 ],
4266 declarations: [VaAddonListComponent],
4267 exports: [VaAddonListComponent]
4268 },] }
4269];
4270
4271/**
4272 * @fileoverview added by tsickle
4273 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4274 */
4275/**
4276 * @record
4277 */
4278function HeimdallServiceTokenInterface() { }
4279if (false) {
4280 /**
4281 * @param {?} category
4282 * @param {?} action
4283 * @param {?} label
4284 * @param {?=} value
4285 * @param {?=} dimensions
4286 * @return {?}
4287 */
4288 HeimdallServiceTokenInterface.prototype.track = function (category, action, label, value, dimensions) { };
4289}
4290/** @type {?} */
4291const HeimdallServiceToken = new InjectionToken('HeimdallService');
4292class HeimdallClient {
4293 /**
4294 * @param {?} userEvents
4295 */
4296 constructor(userEvents) {
4297 this.userEvents = userEvents;
4298 }
4299 /**
4300 * @param {?} category
4301 * @param {?} action
4302 * @param {?} label
4303 * @param {?=} value
4304 * @param {?=} dimensions
4305 * @return {?}
4306 */
4307 track(category, action, label, value, dimensions) {
4308 this.userEvents.track(category, action, label, value, dimensions);
4309 }
4310}
4311HeimdallClient.decorators = [
4312 { type: Injectable }
4313];
4314/** @nocollapse */
4315HeimdallClient.ctorParameters = () => [
4316 { type: undefined, decorators: [{ type: Inject, args: [HeimdallServiceToken,] }] }
4317];
4318if (false) {
4319 /**
4320 * @type {?}
4321 * @private
4322 */
4323 HeimdallClient.prototype.userEvents;
4324}
4325class HeimdallClientModule {
4326}
4327HeimdallClientModule.decorators = [
4328 { type: NgModule, args: [{
4329 providers: [HeimdallClient]
4330 },] }
4331];
4332
4333/**
4334 * @fileoverview added by tsickle
4335 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4336 */
4337/** @type {?} */
4338const STOREFRONT_FILTER_NAME = 'Store Filters';
4339/**
4340 * @record
4341 */
4342function StorefrontCategory() { }
4343if (false) {
4344 /** @type {?} */
4345 StorefrontCategory.prototype.id;
4346 /** @type {?} */
4347 StorefrontCategory.prototype.name;
4348 /** @type {?} */
4349 StorefrontCategory.prototype.packageIds;
4350}
4351class StorefrontComponent {
4352 /**
4353 * @param {?} userEvents
4354 * @param {?} filterService
4355 * @param {?} translateService
4356 */
4357 constructor(userEvents, filterService, translateService) {
4358 this.userEvents = userEvents;
4359 this.filterService = filterService;
4360 this.translateService = translateService;
4361 this.useCustomCase = false;
4362 this.categorySelected = new EventEmitter();
4363 this.packageIdSelected = new EventEmitter();
4364 this.getDataForCategory = new EventEmitter();
4365 this.categories$$ = new BehaviorSubject([]);
4366 this.packagesMap$$ = new BehaviorSubject(new Map());
4367 this.searchTerm$$ = new BehaviorSubject('');
4368 this.selectedCateoryId$$ = new BehaviorSubject('');
4369 this.translateService.setTranslation('en', En.en, true);
4370 }
4371 /**
4372 * @param {?} value
4373 * @return {?}
4374 */
4375 set categories(value) {
4376 this.categories$$.next(value || []);
4377 }
4378 /**
4379 * @param {?} value
4380 * @return {?}
4381 */
4382 set categoryIdToStoreItemListMap(value) {
4383 this.packagesMap$$.next(value || new Map());
4384 }
4385 /**
4386 * @return {?}
4387 */
4388 ngOnInit() {
4389 /** @type {?} */
4390 const lmiCategoryCheckboxList = LMI_CATEGORIES.map((/**
4391 * @param {?} category
4392 * @return {?}
4393 */
4394 (category) => {
4395 return new CheckboxFilterField({
4396 name: category.name,
4397 id: category.categoryId,
4398 value: false,
4399 condition: (/**
4400 * @param {?} item
4401 * @return {?}
4402 */
4403 (item) => {
4404 /** @type {?} */
4405 let lmiCategories = [];
4406 if (item.lmiCategories) {
4407 lmiCategories = item.lmiCategories.map((/**
4408 * @param {?} cat
4409 * @return {?}
4410 */
4411 (cat) => {
4412 return Categories[cat].toLowerCase();
4413 }));
4414 }
4415 return lmiCategories.indexOf(category.categoryId) > -1;
4416 })
4417 });
4418 }));
4419 /** @type {?} */
4420 const lmiCategoryFilterSection = new FilterSection({
4421 title: 'LMI Category',
4422 type: 'or',
4423 fields: lmiCategoryCheckboxList
4424 });
4425 this.lmiCategoryFilter = new Filters(STOREFRONT_FILTER_NAME, [
4426 lmiCategoryFilterSection
4427 ]);
4428 this.filters$ = this.categories$$.pipe(map((/**
4429 * @param {?} categories
4430 * @return {?}
4431 */
4432 categories => {
4433 /** @type {?} */
4434 const tabbedFilterField = new TabbedFilterField({
4435 name: '',
4436 value: null,
4437 id: 'categorytab',
4438 options: categories
4439 });
4440 /** @type {?} */
4441 const filters = new Filters(STOREFRONT_FILTER_NAME, [
4442 new FilterSection({
4443 title: 'Categories',
4444 type: 'or',
4445 fields: [tabbedFilterField]
4446 }),
4447 lmiCategoryFilterSection
4448 ]);
4449 return filters;
4450 })));
4451 this.filterService.setFilters(this.lmiCategoryFilter);
4452 this.searchTermSubscription = this.searchTerm$$.asObservable().pipe(debounceTime(300), distinctUntilChanged()).subscribe((/**
4453 * @param {?} searchTerm
4454 * @return {?}
4455 */
4456 searchTerm => this.userEvents.track('store', 'search-input', '', 1, { 'searchTerm': searchTerm })));
4457 /** @type {?} */
4458 const selectedLMIFilters$ = this.filterService.filters.fieldValuesObservable.pipe(startWith([]), map((/**
4459 * @return {?}
4460 */
4461 () => {
4462 return this.lmiCategoryFilter.fields.filter((/**
4463 * @param {?} item
4464 * @return {?}
4465 */
4466 (item) => item.value));
4467 })));
4468 this.showLMIFilter$ = selectedLMIFilters$.pipe(filter((/**
4469 * @param {?} selectedLMIFilters
4470 * @return {?}
4471 */
4472 selectedLMIFilters => !!selectedLMIFilters)), take(1), map((/**
4473 * @param {?} selectedLMIFilters
4474 * @return {?}
4475 */
4476 selectedLMIFilters => selectedLMIFilters.length > 0)));
4477 this.filteredItems$ = combineLatest(this.packagesMap$$, this.searchTerm$$, this.selectedCateoryId$$, selectedLMIFilters$).pipe(map((/**
4478 * @param {?} __0
4479 * @return {?}
4480 */
4481 ([packages, searchTerm, selectedCategoryId, selectedLMIFilters]) => {
4482 /** @type {?} */
4483 let storeItems = [];
4484 if (packages.size) {
4485 storeItems = (selectedCategoryId ? packages.get(selectedCategoryId) : packages.get(Array.from(packages.keys())[0]));
4486 }
4487 storeItems = storeItems ? this.lmiCategoryFilter.applyFilters(storeItems) : [];
4488 return searchTerm ? storeItems.filter((/**
4489 * @param {?} item
4490 * @return {?}
4491 */
4492 item => item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1)) : storeItems;
4493 })));
4494 }
4495 /**
4496 * @return {?}
4497 */
4498 ngOnDestroy() {
4499 this.searchTermSubscription.unsubscribe();
4500 }
4501 /**
4502 * @param {?} term
4503 * @return {?}
4504 */
4505 onSearchTermChanged(term) {
4506 this.searchTerm$$.next(term);
4507 }
4508 /**
4509 * @param {?} filterField
4510 * @return {?}
4511 */
4512 onFieldValueChanged(filterField) {
4513 if (!(filterField instanceof TabbedFilterField)) {
4514 return;
4515 }
4516 this.selectedCateoryId$$.next(filterField.value.id);
4517 this.categorySelected.emit((/** @type {?} */ (filterField.value)));
4518 /** @type {?} */
4519 const currentStoreItemsForSelectCategory = this.packagesMap$$.getValue().get(filterField.value.id);
4520 if (!(currentStoreItemsForSelectCategory && currentStoreItemsForSelectCategory.length)) {
4521 this.getDataForCategory.emit((/** @type {?} */ (filterField.value)));
4522 }
4523 }
4524 /**
4525 * @param {?} item
4526 * @return {?}
4527 */
4528 storeItemClicked(item) {
4529 this.packageIdSelected.emit(item.id);
4530 }
4531}
4532StorefrontComponent.decorators = [
4533 { type: Component, args: [{
4534 selector: 'va-storefront',
4535 template: "<va-filter-container\n [filters]=\"filters$ | async\"\n (searchTermChanged)=\"onSearchTermChanged($event)\"\n (fieldValueChanged)=\"onFieldValueChanged($event)\"\n [theme]=\"'plain'\"\n [filterIsOpen]=\"showLMIFilter$ | async\"\n [useCustomCase]=\"useCustomCase\"\n >\n <va-store\n [items]=\"filteredItems$ | async\"\n [searchable]=\"false\"\n (itemClicked)=\"storeItemClicked($event)\"\n content>\n </va-store>\n</va-filter-container>\n",
4536 styles: [".public-store-container{padding:20px}va-store{margin-top:20px;display:block}@media only screen and (device-width:375px) and (-webkit-device-pixel-ratio:2){::ng-deep va-filter-tabbed{width:280px}::ng-deep .filter-container .toolbar.toolbar{background:0 0}}@media only screen and (device-width:414px) and (-webkit-device-pixel-ratio:3){::ng-deep va-filter-tabbed{width:280px}::ng-deep .filter-container .toolbar.toolbar{background:0 0}}"]
4537 }] }
4538];
4539/** @nocollapse */
4540StorefrontComponent.ctorParameters = () => [
4541 { type: undefined, decorators: [{ type: Inject, args: [HeimdallServiceToken,] }] },
4542 { type: FilterService },
4543 { type: TranslateService }
4544];
4545StorefrontComponent.propDecorators = {
4546 categories: [{ type: Input }],
4547 categoryIdToStoreItemListMap: [{ type: Input }],
4548 useCustomCase: [{ type: Input }],
4549 categorySelected: [{ type: Output }],
4550 packageIdSelected: [{ type: Output }],
4551 getDataForCategory: [{ type: Output }]
4552};
4553if (false) {
4554 /** @type {?} */
4555 StorefrontComponent.prototype.useCustomCase;
4556 /** @type {?} */
4557 StorefrontComponent.prototype.categorySelected;
4558 /** @type {?} */
4559 StorefrontComponent.prototype.packageIdSelected;
4560 /** @type {?} */
4561 StorefrontComponent.prototype.getDataForCategory;
4562 /**
4563 * @type {?}
4564 * @private
4565 */
4566 StorefrontComponent.prototype.categories$$;
4567 /**
4568 * @type {?}
4569 * @private
4570 */
4571 StorefrontComponent.prototype.packagesMap$$;
4572 /**
4573 * @type {?}
4574 * @private
4575 */
4576 StorefrontComponent.prototype.searchTerm$$;
4577 /**
4578 * @type {?}
4579 * @private
4580 */
4581 StorefrontComponent.prototype.selectedCateoryId$$;
4582 /**
4583 * @type {?}
4584 * @private
4585 */
4586 StorefrontComponent.prototype.lmiCategoryFilter;
4587 /** @type {?} */
4588 StorefrontComponent.prototype.filters$;
4589 /** @type {?} */
4590 StorefrontComponent.prototype.filteredItems$;
4591 /** @type {?} */
4592 StorefrontComponent.prototype.searchTermSubscription;
4593 /** @type {?} */
4594 StorefrontComponent.prototype.showLMIFilter$;
4595 /**
4596 * @type {?}
4597 * @private
4598 */
4599 StorefrontComponent.prototype.userEvents;
4600 /**
4601 * @type {?}
4602 * @private
4603 */
4604 StorefrontComponent.prototype.filterService;
4605 /**
4606 * @type {?}
4607 * @private
4608 */
4609 StorefrontComponent.prototype.translateService;
4610}
4611
4612/**
4613 * @fileoverview added by tsickle
4614 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4615 */
4616class StoreModule {
4617}
4618StoreModule.decorators = [
4619 { type: NgModule, args: [{
4620 imports: [CommonModule, UIKitModule, MatCardModule, MatIconModule, MatInputModule, FormsModule, ReactiveFormsModule,
4621 MatSelectModule, MatExpansionModule, MatCheckboxModule, StoreCardModule, VaOrderFormModule, AddonModule, StencilsModule,
4622 VaPricingModule, VaAddonListModule, HeimdallClientModule],
4623 declarations: [StoreComponent, StorefrontComponent],
4624 providers: [StoreService, FilterService],
4625 exports: [StoreComponent, StoreCardModule, VaOrderFormModule, StencilsModule, StorefrontComponent]
4626 },] }
4627];
4628
4629/**
4630 * @fileoverview added by tsickle
4631 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4632 */
4633/**
4634 * @record
4635 */
4636function LmiCategory() { }
4637if (false) {
4638 /** @type {?} */
4639 LmiCategory.prototype.name;
4640 /** @type {?} */
4641 LmiCategory.prototype.categoryId;
4642}
4643/** @type {?} */
4644const LMI_CATEGORIES = [
4645 { name: 'Listings', categoryId: 'listings' },
4646 { name: 'Social', categoryId: 'social' },
4647 { name: 'Reputation', categoryId: 'reputation' },
4648 { name: 'SEO', categoryId: 'seo' },
4649 { name: 'Website', categoryId: 'website' },
4650 { name: 'Advertising', categoryId: 'advertising' },
4651 { name: 'Content & Experience', categoryId: 'content_and_experience' }
4652];
4653/** @type {?} */
4654const LMI_CATEGORY_MAP = LMI_CATEGORIES.reduce((/**
4655 * @param {?} previous
4656 * @param {?} current
4657 * @return {?}
4658 */
4659(previous, current) => {
4660 previous[current.categoryId] = current;
4661 return previous;
4662}), {});
4663/** @type {?} */
4664const LMI_CATEGORIES_BY_NAME = LMI_CATEGORIES.reduce((/**
4665 * @param {?} previous
4666 * @param {?} current
4667 * @return {?}
4668 */
4669(previous, current) => {
4670 previous[current.name] = current;
4671 return previous;
4672}), {});
4673
4674/**
4675 * @fileoverview added by tsickle
4676 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4677 */
4678class VaSalespersonDetailsComponent {
4679 constructor() {
4680 this.showGetItNow = true;
4681 this.getItNow = new EventEmitter();
4682 }
4683 /**
4684 * @return {?}
4685 */
4686 onGetItNowSelected() {
4687 this.getItNow.emit(this.salesperson);
4688 }
4689 /**
4690 * @return {?}
4691 */
4692 get iconUrl() {
4693 return this.salesperson && this.salesperson.photoUrlSecure ?
4694 this.salesperson.photoUrlSecure :
4695 'https://vbc-frontend.storage-download.googleapis.com/salesperson-details/default_sales_person.jpg';
4696 }
4697 /**
4698 * @return {?}
4699 */
4700 get name() {
4701 return this.salesperson && this.salesperson.formattedName ?
4702 this.salesperson.formattedName : '';
4703 }
4704 /**
4705 * @return {?}
4706 */
4707 get title() {
4708 return this.salesperson && this.salesperson.jobTitle ?
4709 this.salesperson.jobTitle : '';
4710 }
4711 /**
4712 * @return {?}
4713 */
4714 get email() {
4715 return this.salesperson && this.salesperson.email ?
4716 this.salesperson.email : '';
4717 }
4718 /**
4719 * @return {?}
4720 */
4721 get cityAndState() {
4722 return this.salesperson && this.salesperson.city && this.salesperson.state ?
4723 this.salesperson.city + ', ' + this.salesperson.state : '';
4724 }
4725}
4726VaSalespersonDetailsComponent.decorators = [
4727 { type: Component, args: [{
4728 selector: 'va-salesperson-details',
4729 template: "<div class=\"container\">\n <div class=\"salesperson-contact-info\">\n\n <div class=\"salesperson-image\" *ngIf=\"salesperson\">\n <va-icon [iconUrl]=\"iconUrl\" [diameter]=\"60\"></va-icon>\n </div>\n\n <div>\n <div class=\"salesperson-name\">{{ name }}</div>\n <div>{{ title }}</div>\n <div>{{ cityAndState }}</div>\n <div><a href=\"mailto:{{ email }}\">{{ email }}</a></div>\n </div>\n\n <div *ngIf=\"!salesperson\" class=\"generic-contact\">\n Contact {{ brandName ? \"your \" + brandName : \"a\" }} representative today!\n </div>\n\n <div class=\"pricing\">\n <va-pricing [pricing]=\"packagePricing\" wrapFrequency=\"true\"></va-pricing>\n <div class=\"cta get-it-now-bottom-button\">\n <button mat-button *ngIf=\"salesperson && showGetItNow\" (click)=\"onGetItNowSelected()\" class=\"now-button\">\n Get it Now\n </button>\n </div>\n </div>\n </div>\n</div>\n",
4730 styles: ["a{color:#1e88e5;text-decoration:none}.container{width:100%;margin:0 auto;background-color:#fff;box-shadow:1px 1px 1px 0 rgba(0,0,0,.2)}.salesperson-image{margin-right:20px}.salesperson-contact-info{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;padding:24px;font-size:14px;color:#9e9e9e}@media screen and (max-width:600px){.salesperson-contact-info{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;display:inline-block}}.salesperson-name{font-size:20px;font-weight:700;color:#212121}.generic-contact{margin-left:20px}.pricing{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-flex:1;flex-grow:1;-webkit-box-pack:end;justify-content:flex-end}.pricing ::ng-deep .price-box{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.pricing ::ng-deep .price-number{margin-right:4px}@media screen and (min-width:600px){.pricing{padding-left:16px}}.pricing va-pricing{margin-right:20px}.now-button{font-size:14px;color:#fff;background-color:#4caf50}"]
4731 }] }
4732];
4733VaSalespersonDetailsComponent.propDecorators = {
4734 salesperson: [{ type: Input }],
4735 packagePricing: [{ type: Input }],
4736 brandName: [{ type: Input }],
4737 showGetItNow: [{ type: Input }],
4738 getItNow: [{ type: Output }]
4739};
4740if (false) {
4741 /** @type {?} */
4742 VaSalespersonDetailsComponent.prototype.salesperson;
4743 /** @type {?} */
4744 VaSalespersonDetailsComponent.prototype.packagePricing;
4745 /** @type {?} */
4746 VaSalespersonDetailsComponent.prototype.brandName;
4747 /** @type {?} */
4748 VaSalespersonDetailsComponent.prototype.showGetItNow;
4749 /** @type {?} */
4750 VaSalespersonDetailsComponent.prototype.getItNow;
4751}
4752
4753/**
4754 * @fileoverview added by tsickle
4755 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4756 */
4757class VaSalespersonDetailsModule {
4758}
4759VaSalespersonDetailsModule.decorators = [
4760 { type: NgModule, args: [{
4761 imports: [
4762 CommonModule,
4763 MatButtonModule,
4764 MatIconModule,
4765 VaIconModule,
4766 VaPricingModule,
4767 ],
4768 declarations: [
4769 VaSalespersonDetailsComponent
4770 ],
4771 exports: [
4772 VaSalespersonDetailsComponent
4773 ],
4774 entryComponents: [
4775 VaSalespersonDetailsComponent
4776 ]
4777 },] }
4778];
4779
4780/**
4781 * @fileoverview added by tsickle
4782 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4783 */
4784class Package extends Sellable {
4785 // the order the product / addons in the package
4786 /**
4787 * @param {?} data
4788 * @return {?}
4789 */
4790 static fromApi(data) {
4791 /** @type {?} */
4792 const newPackage = new Package();
4793 if (!data.pricing && data.selling_price) {
4794 data.pricing = {
4795 currency: data.currency,
4796 prices: [{
4797 price: data.selling_price * 100,
4798 frequency: data.billingFrequency,
4799 isStartingPrice: false,
4800 }]
4801 };
4802 }
4803 Object.assign(newPackage, data);
4804 if (!newPackage.name) {
4805 newPackage.name = 'Untitled';
4806 }
4807 if (data.created) {
4808 newPackage.createdDate = new Date(data.created);
4809 }
4810 if (data.updated) {
4811 newPackage.updatedDate = new Date(data.updated);
4812 }
4813 return newPackage;
4814 }
4815 /**
4816 * @return {?}
4817 */
4818 get isPackageFree() {
4819 return this.isFree;
4820 }
4821}
4822if (false) {
4823 /** @type {?} */
4824 Package.prototype.solution_id;
4825 /** @type {?} */
4826 Package.prototype.partner_id;
4827 /** @type {?} */
4828 Package.prototype.market_id;
4829 /** @type {?} */
4830 Package.prototype.name;
4831 /** @type {?} */
4832 Package.prototype.icon;
4833 /** @type {?} */
4834 Package.prototype.status;
4835 /** @type {?} */
4836 Package.prototype.tagline;
4837 /** @type {?} */
4838 Package.prototype.header_image_url;
4839 /** @type {?} */
4840 Package.prototype.content;
4841 /** @type {?} */
4842 Package.prototype.products;
4843 /** @type {?} */
4844 Package.prototype.addon_keys;
4845 /** @type {?} */
4846 Package.prototype.hide_product_icons_and_names;
4847 /** @type {?} */
4848 Package.prototype.hide_product_details;
4849 /** @type {?} */
4850 Package.prototype.createdDate;
4851 /** @type {?} */
4852 Package.prototype.updatedDate;
4853 /** @type {?} */
4854 Package.prototype.productOrder;
4855}
4856
4857/**
4858 * @fileoverview added by tsickle
4859 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4860 */
4861/**
4862 * @param {?} combined
4863 * @param {?} order
4864 * @return {?}
4865 */
4866function orderProductsAndAddons(combined, order) {
4867 if (!order || order.length === 0) {
4868 return combined || [];
4869 }
4870 if (!combined || combined.length === 0) {
4871 return [];
4872 }
4873 /** @type {?} */
4874 const itemMap = (combined || []).reduce((/**
4875 * @param {?} m
4876 * @param {?} curr
4877 * @return {?}
4878 */
4879 (m, curr) => {
4880 m.set(getUniqueProductAddonId(curr), curr);
4881 return m;
4882 }), new Map());
4883 /** @type {?} */
4884 const combinedIdList = combined.map(getUniqueProductAddonId);
4885 /** @type {?} */
4886 const finalOrderedIds = combineProductOrderWithContainedProducts(order, combinedIdList);
4887 /** @type {?} */
4888 const orderedList = (/** @type {?} */ (finalOrderedIds.reduce((/**
4889 * @param {?} items
4890 * @param {?} id
4891 * @return {?}
4892 */
4893 (items, id) => {
4894 items.push(itemMap.get(id));
4895 return items;
4896 }), [])));
4897 return orderedList.filter(filterUniqueAndDefined);
4898}
4899/**
4900 * @param {?} elem
4901 * @param {?} pos
4902 * @param {?} arr
4903 * @return {?}
4904 */
4905function filterUniqueAndDefined(elem, pos, arr) {
4906 return elem && arr.indexOf(elem) === pos;
4907}
4908/**
4909 * @param {?} productOrder
4910 * @param {?} itemIds
4911 * @return {?}
4912 */
4913function combineProductOrderWithContainedProducts(productOrder, itemIds) {
4914 if (itemIds == null || itemIds.length === 0) {
4915 return [];
4916 }
4917 if (!productOrder || productOrder.length === 0) {
4918 return itemIds.filter(filterUniqueAndDefined);
4919 }
4920 return productOrder
4921 .filter((/**
4922 * @param {?} elem
4923 * @return {?}
4924 */
4925 elem => itemIds.indexOf(elem) >= 0))
4926 .concat(itemIds)
4927 .filter(filterUniqueAndDefined);
4928}
4929/**
4930 * @param {?} thing
4931 * @return {?}
4932 */
4933function getUniqueProductAddonId(thing) {
4934 return thing['addonId'] || thing['productId'];
4935}
4936
4937/**
4938 * @fileoverview added by tsickle
4939 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4940 */
4941class VaPackageDetailsComponent {
4942 constructor() {
4943 this.showActionButton = true;
4944 this.showPricing = true;
4945 this.actionLabel = 'Get It Now';
4946 this.getItNow = new EventEmitter();
4947 this.standAloneProducts$$ = new BehaviorSubject([]);
4948 this.products$ = new BehaviorSubject([]);
4949 this.addons$ = new BehaviorSubject([]);
4950 this.pkg$ = new ReplaySubject(1);
4951 this.itemSelectedEvent$ = new ReplaySubject(1);
4952 this.combinedItemsList$ = combineLatest(this.products$, this.addons$, (/**
4953 * @param {?} products
4954 * @param {?} addons
4955 * @return {?}
4956 */
4957 (products, addons) => {
4958 return (/** @type {?} */ ([].concat(products || []).concat(addons || [])));
4959 }));
4960 this.orderedItemsList$ = combineLatest(this.combinedItemsList$, this.pkg$, (/**
4961 * @param {?} combined
4962 * @param {?} pkg
4963 * @return {?}
4964 */
4965 (combined, pkg) => {
4966 return orderProductsAndAddons(combined, pkg ? pkg.productOrder || [] : []);
4967 }));
4968 /** @type {?} */
4969 const nonEmptyCombinedItemsList = this.combinedItemsList$.pipe(skipWhile((/**
4970 * @param {?} items
4971 * @return {?}
4972 */
4973 items => !items || items.length === 0)), shareReplay(1));
4974 // Need to map to an index because that's how product selection works.
4975 /** @type {?} */
4976 const initialSelectedItem$ = nonEmptyCombinedItemsList.pipe(map((/**
4977 * @param {?} _
4978 * @return {?}
4979 */
4980 (_) => 0)), take(1));
4981 /** @type {?} */
4982 const mergedSelection = merge(initialSelectedItem$, this.itemSelectedEvent$);
4983 this.selectedItem$ = combineLatest(mergedSelection, this.orderedItemsList$).pipe(map((/**
4984 * @param {?} __0
4985 * @return {?}
4986 */
4987 ([index, items]) => {
4988 return items[index];
4989 })));
4990 this.lmiCategories$ = this.products$.pipe(skipWhile((/**
4991 * @param {?} products
4992 * @return {?}
4993 */
4994 products => !products || products.length === 0)), map((/**
4995 * @param {?} products
4996 * @return {?}
4997 */
4998 products => {
4999 return VaPackageDetailsComponent.getLmiCategories(products);
5000 })));
5001 this.productNameForSingleAddon$ = nonEmptyCombinedItemsList.pipe(map((/**
5002 * @param {?} items
5003 * @return {?}
5004 */
5005 items => {
5006 return VaPackageDetailsComponent.getProductNameForSingleAddon(items);
5007 })));
5008 this.displayTagName$ = combineLatest(this.pkg$, this.combinedItemsList$).pipe(map((/**
5009 * @param {?} __0
5010 * @return {?}
5011 */
5012 ([pkg, items]) => {
5013 return VaPackageDetailsComponent.getDisplayTagline(pkg, items);
5014 })));
5015 }
5016 /**
5017 * @param {?} standAloneProducts
5018 * @return {?}
5019 */
5020 set standAloneProducts(standAloneProducts) {
5021 this.standAloneProducts$$.next(standAloneProducts);
5022 }
5023 /**
5024 * @param {?} products
5025 * @return {?}
5026 */
5027 set products(products) {
5028 this.products$.next(products);
5029 }
5030 /**
5031 * @param {?} addons
5032 * @return {?}
5033 */
5034 set addons(addons) {
5035 this.addons$.next(addons);
5036 }
5037 /**
5038 * @param {?} pkg
5039 * @return {?}
5040 */
5041 set pkg(pkg) {
5042 this.pkg$.next(pkg);
5043 }
5044 /**
5045 * @param {?} products
5046 * @return {?}
5047 */
5048 static getLmiCategories(products) {
5049 /** @type {?} */
5050 let lmiCategories = [];
5051 if (products) {
5052 products.forEach((/**
5053 * @param {?} product
5054 * @return {?}
5055 */
5056 product => {
5057 lmiCategories = lmiCategories.concat(product.getLmiCategoryNames());
5058 }));
5059 }
5060 return new Set(lmiCategories);
5061 }
5062 /**
5063 * @param {?} pkg
5064 * @param {?} items
5065 * @return {?}
5066 */
5067 static getDisplayTagline(pkg, items) {
5068 if (pkg && pkg.tagline) {
5069 return pkg.tagline;
5070 }
5071 else if (items && items.length === 1) {
5072 // Single product / addon package.
5073 return items[0].tagline || '';
5074 }
5075 return '';
5076 }
5077 /**
5078 * @param {?} items
5079 * @return {?}
5080 */
5081 static getProductNameForSingleAddon(items) {
5082 if (items && items.length === 1 && items[0] instanceof Addon) {
5083 /** @type {?} */
5084 const addon = (/** @type {?} */ (items[0]));
5085 return addon.productName;
5086 }
5087 }
5088 /**
5089 * @param {?} i
5090 * @return {?}
5091 */
5092 selectItem(i) {
5093 this.itemSelectedEvent$.next(i);
5094 }
5095 /**
5096 * @return {?}
5097 */
5098 emitGetItNow() {
5099 this.getItNow.emit();
5100 }
5101}
5102VaPackageDetailsComponent.decorators = [
5103 { type: Component, args: [{
5104 selector: 'va-package-details',
5105 template: "<div *ngIf=\"pkg$ | async as pkg\" class=\"page\">\n <va-header-container [iconUrl]=\"pkg.icon\"\n [title]=\"pkg.name\"\n [tagline]=\"displayTagName$ | async\"\n [prerequisite]=\"productNameForSingleAddon$ | async\"\n [chipLabels]=\"lmiCategories$ | async\"\n [pricing]=\"pkg.pricing\"\n [pricingLabel]=\"'Pricing'\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"actionLabel\"\n [actionEnabled]=true\n (actionSelected)=\"emitGetItNow()\"\n ></va-header-container>\n <ng-container *ngIf=\"pkg?.content\">\n <va-selling-info [description]=\"pkg.content\"></va-selling-info>\n </ng-container>\n\n <va-products-nav [items]=\"orderedItemsList$ | async\"\n [hideItemsNav]=\"pkg?.hide_product_icons_and_names\"\n (itemSelected)=\"selectItem($event)\"></va-products-nav>\n\n <ng-container *ngIf=\"selectedItem$ | async as selectedItem\">\n <div *ngIf=\"!pkg?.hide_product_details\" class=\"package-content\">\n <div class=\"left-column\">\n <section\n *ngIf=\"(selectedItem.endUserMarketing?.description || selectedItem.endUserMarketing?.keySellingPoints) ||\n (selectedItem.description || selectedItem.keySellingPoints)\">\n <va-selling-info [description]=\"selectedItem.endUserMarketing?.description || selectedItem.description\"\n [keySellingPoints]=\"selectedItem.endUserMarketing?.keySellingPoints || selectedItem.keySellingPoints\"></va-selling-info>\n </section>\n\n <section *ngIf=\"(selectedItem.endUserMarketing?.faqs?.length > 0\n && selectedItem.endUserMarketing?.faqs[0].question) || selectedItem.faqs?.length > 0\">\n <h2 class=\"va-component-title\">FAQs</h2>\n <va-faqs [faqs]=\"selectedItem.endUserMarketing?.faqs || selectedItem.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"selectedItem.screenshotUrls?.length > 0 || selectedItem.screenshots?.length > 0\">\n <h2 class=\"va-component-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"selectedItem.screenshotUrls || selectedItem.screenshots\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"selectedItem.endUserMarketing?.files?.length > 0 || selectedItem.files?.length > 0\">\n <h2 class=\"va-component-title\">Files</h2>\n <va-files [files]=\"selectedItem.endUserMarketingFiles || selectedItem.files\"></va-files>\n </section>\n </div>\n </div>\n </ng-container>\n</div>\n",
5106 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.package-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.package-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
5107 }] }
5108];
5109/** @nocollapse */
5110VaPackageDetailsComponent.ctorParameters = () => [];
5111VaPackageDetailsComponent.propDecorators = {
5112 showActionButton: [{ type: Input }],
5113 showPricing: [{ type: Input }],
5114 actionLabel: [{ type: Input }],
5115 getItNow: [{ type: Output }],
5116 standAloneProducts: [{ type: Input }],
5117 products: [{ type: Input }],
5118 addons: [{ type: Input }],
5119 pkg: [{ type: Input }]
5120};
5121if (false) {
5122 /** @type {?} */
5123 VaPackageDetailsComponent.prototype.showActionButton;
5124 /** @type {?} */
5125 VaPackageDetailsComponent.prototype.showPricing;
5126 /** @type {?} */
5127 VaPackageDetailsComponent.prototype.actionLabel;
5128 /** @type {?} */
5129 VaPackageDetailsComponent.prototype.getItNow;
5130 /** @type {?} */
5131 VaPackageDetailsComponent.prototype.standAloneProducts$$;
5132 /** @type {?} */
5133 VaPackageDetailsComponent.prototype.products$;
5134 /** @type {?} */
5135 VaPackageDetailsComponent.prototype.addons$;
5136 /** @type {?} */
5137 VaPackageDetailsComponent.prototype.pkg$;
5138 /** @type {?} */
5139 VaPackageDetailsComponent.prototype.itemSelectedEvent$;
5140 /** @type {?} */
5141 VaPackageDetailsComponent.prototype.selectedItem$;
5142 /** @type {?} */
5143 VaPackageDetailsComponent.prototype.combinedItemsList$;
5144 /** @type {?} */
5145 VaPackageDetailsComponent.prototype.orderedItemsList$;
5146 /** @type {?} */
5147 VaPackageDetailsComponent.prototype.lmiCategories$;
5148 /** @type {?} */
5149 VaPackageDetailsComponent.prototype.productNameForSingleAddon$;
5150 /** @type {?} */
5151 VaPackageDetailsComponent.prototype.displayTagName$;
5152}
5153
5154/**
5155 * @fileoverview added by tsickle
5156 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5157 */
5158class VaProductsNavComponent {
5159 /**
5160 * @param {?} translateService
5161 */
5162 constructor(translateService) {
5163 this.translateService = translateService;
5164 this.itemSelected = new EventEmitter();
5165 this.selectedIndex = 0;
5166 this.pageMarker = 0;
5167 this.translateService.setTranslation('en', En.en, true);
5168 }
5169 /**
5170 * @param {?} index
5171 * @return {?}
5172 */
5173 onItemSelected(index) {
5174 this.selectedIndex = index;
5175 this.itemSelected.emit(index);
5176 }
5177 /**
5178 * @param {?} slides
5179 * @return {?}
5180 */
5181 moveSlides(slides) {
5182 /** @type {?} */
5183 const sliderWidth = Math.round(slides.offsetWidth / slides.children[0].clientWidth);
5184 /** @type {?} */
5185 const numSlides = Math.ceil(slides.children.length / sliderWidth);
5186 if (numSlides === 0) {
5187 return;
5188 }
5189 /** @type {?} */
5190 const pageWidth = slides.offsetWidth;
5191 /** @type {?} */
5192 let move = 0;
5193 if (this.pageMarker === -1) {
5194 this.pageMarker = numSlides - 1; // go to end
5195 move = pageWidth * this.pageMarker;
5196 slides.style.left = `-${move}px`;
5197 }
5198 else if (this.pageMarker >= numSlides) {
5199 slides.style.left = '0px';
5200 this.pageMarker = 0; // reset
5201 }
5202 else {
5203 move = pageWidth * this.pageMarker;
5204 slides.style.left = `-${move}px`;
5205 }
5206 }
5207 /**
5208 * @param {?} slides
5209 * @return {?}
5210 */
5211 pageNext(slides) {
5212 this.pageMarker++;
5213 this.moveSlides(slides);
5214 }
5215 /**
5216 * @param {?} slides
5217 * @return {?}
5218 */
5219 pagePrev(slides) {
5220 this.pageMarker--;
5221 this.moveSlides(slides);
5222 }
5223}
5224VaProductsNavComponent.decorators = [
5225 { type: Component, args: [{
5226 selector: 'va-products-nav',
5227 template: "<p *ngIf=\"items?.length > 1\" class=\"item-amount\">{{ 'FRONTEND.STORE.CONTAINS_NUM_ITEMS' | translate: {itemCount: items.length} }}</p>\n<div class=\"wrapper\">\n <nav *ngIf=\"items && !hideItemsNav\" (swipeleft)=\"pageNext(slides)\" (swiperight)=\"pagePrev(slides)\">\n <div [ngClass]=\"{'hide-arrows': items && items.length < 5}\">\n <span class=\"prev\" (click)=\"pagePrev(slides)\"><mat-icon>keyboard_arrow_left</mat-icon></span>\n <span class=\"next\" (click)=\"pageNext(slides)\"><mat-icon>keyboard_arrow_right</mat-icon></span>\n </div>\n <ul class=\"slides\" #slides>\n <li *ngFor=\"let item of items; index as i;\" (click)=\"onItemSelected(i)\">\n <a [ngClass]=\"{'active': i === selectedIndex}\">\n <span class=\"icon-area\">\n <va-icon [iconUrl]=\"item.icon || item.iconUrl\" [name]=\"item.name || item.title\" [diameter]=\"80\"></va-icon>\n <va-icon *ngIf=\"item.addonId\" class=\"addon-indicator\" [iconUrl]=\"item.productIcon\" [name]=\"item.productName\" [diameter]=\"24\"></va-icon>\n </span>\n <p>{{ item.name || item.title }}</p>\n <div *ngIf=\"item.addonId\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }}</span>\n <span>{{item.productName}}</span>\n </div>\n </a>\n </li>\n </ul>\n </nav>\n</div>\n",
5228 styles: ["nav{position:relative;width:350px;margin:0 auto;background:#fff;border:1px solid #e0e0e0;border-width:1px 0;overflow:hidden}nav ul{display:-webkit-box;display:flex;flex-wrap:nowrap;list-style:none;margin:0 50px;padding:0;position:relative;left:0;-webkit-transition:left .3s;transition:left .3s;word-break:break-word}nav li{min-width:100%;-webkit-box-flex:1;flex:1 0 25%;text-align:center;font-size:14px}nav li:first-child a{border-right:1px solid #e0e0e0}nav a{position:relative;display:block;height:100%;padding:20px;text-decoration:none;color:#212121;-webkit-transition:background .3s;transition:background .3s;-webkit-box-align:center;align-items:center;border-right:1px solid #e0e0e0;cursor:pointer}nav a:hover{background-color:rgba(255,255,255,.6)}nav a.active{background-color:#fff}nav a.active:after{content:'';display:block;position:absolute;bottom:-1px;left:0;width:100%;height:1px;background-color:#fff}nav p{margin-bottom:0}nav .icon img{width:80px;min-width:80px;height:80px}nav .next,nav .prev{position:absolute;height:100%;width:50px;top:0;background:rgba(33,33,33,.1);cursor:pointer;text-align:center;opacity:1;-webkit-transition:opacity .3s;transition:opacity .3s;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;z-index:1}nav .next:not(.disabled):hover,nav .prev:not(.disabled):hover{background:rgba(33,33,33,.3)}nav .prev{left:0}nav .next{right:0}nav .disabled{cursor:default;opacity:0}@media screen and (min-width:600px){nav{width:auto;overflow:initial}nav li{min-width:0;width:25%;-webkit-box-flex:0;flex-grow:0}nav .hide-arrows{display:none}nav .hide-arrows+.slides{margin:0}}va-icon{display:inline-block}.item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}.wrapper{overflow:hidden}.requires-text{color:#9e9e9e}.icon-area{position:relative;display:inline-block}.addon-indicator{position:absolute;border:2px solid #fff;border-radius:50%;bottom:-2px;right:-2px}"]
5229 }] }
5230];
5231/** @nocollapse */
5232VaProductsNavComponent.ctorParameters = () => [
5233 { type: TranslateService }
5234];
5235VaProductsNavComponent.propDecorators = {
5236 items: [{ type: Input }],
5237 hideItemsNav: [{ type: Input }],
5238 itemSelected: [{ type: Output }]
5239};
5240if (false) {
5241 /** @type {?} */
5242 VaProductsNavComponent.prototype.items;
5243 /** @type {?} */
5244 VaProductsNavComponent.prototype.hideItemsNav;
5245 /** @type {?} */
5246 VaProductsNavComponent.prototype.itemSelected;
5247 /** @type {?} */
5248 VaProductsNavComponent.prototype.selectedIndex;
5249 /** @type {?} */
5250 VaProductsNavComponent.prototype.pageMarker;
5251 /**
5252 * @type {?}
5253 * @private
5254 */
5255 VaProductsNavComponent.prototype.translateService;
5256}
5257
5258/**
5259 * @fileoverview added by tsickle
5260 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5261 */
5262class ProductsNavV2Component {
5263 /**
5264 * @param {?} translateService
5265 */
5266 constructor(translateService) {
5267 this.translateService = translateService;
5268 this.itemSelected = new EventEmitter();
5269 this.selected_id = '';
5270 this.pageMarker = 0;
5271 this.translateService.setTranslation('en', En.en, true);
5272 }
5273 /**
5274 * @param {?} id
5275 * @return {?}
5276 */
5277 onItemSelected(id) {
5278 this.selected_id = id;
5279 this.itemSelected.emit(id);
5280 }
5281 /**
5282 * @param {?} slides
5283 * @return {?}
5284 */
5285 moveSlides(slides) {
5286 /** @type {?} */
5287 const sliderWidth = Math.round(slides.offsetWidth / slides.children[0].clientWidth);
5288 /** @type {?} */
5289 const numSlides = Math.ceil(slides.children.length / sliderWidth);
5290 if (numSlides === 0) {
5291 return;
5292 }
5293 /** @type {?} */
5294 const pageWidth = slides.offsetWidth;
5295 /** @type {?} */
5296 let move = 0;
5297 if (this.pageMarker === -1) {
5298 this.pageMarker = numSlides - 1; // go to end
5299 move = pageWidth * this.pageMarker;
5300 slides.style.left = `-${move}px`;
5301 }
5302 else if (this.pageMarker >= numSlides) {
5303 slides.style.left = '0px';
5304 this.pageMarker = 0; // reset
5305 }
5306 else {
5307 move = pageWidth * this.pageMarker;
5308 slides.style.left = `-${move}px`;
5309 }
5310 }
5311 /**
5312 * @param {?} slides
5313 * @return {?}
5314 */
5315 pageNext(slides) {
5316 this.pageMarker++;
5317 this.moveSlides(slides);
5318 }
5319 /**
5320 * @param {?} slides
5321 * @return {?}
5322 */
5323 pagePrev(slides) {
5324 this.pageMarker--;
5325 this.moveSlides(slides);
5326 }
5327}
5328ProductsNavV2Component.decorators = [
5329 { type: Component, args: [{
5330 selector: 'va-products-nav-v2',
5331 template: "<p *ngIf=\"items?.length > 1\" class=\"item-amount\">{{ 'FRONTEND.STORE.CONTAINS_NUM_ITEMS' | translate: {itemCount: items.length} }}</p>\n<div class=\"wrapper\">\n <nav *ngIf=\"items && !hideItemsNav\" (swipeleft)=\"pageNext(slides)\" (swiperight)=\"pagePrev(slides)\">\n <div [ngClass]=\"{'hide-arrows': items && items.length < 5}\">\n <span class=\"prev\" (click)=\"pagePrev(slides)\"><mat-icon>keyboard_arrow_left</mat-icon></span>\n <span class=\"next\" (click)=\"pageNext(slides)\"><mat-icon>keyboard_arrow_right</mat-icon></span>\n </div>\n <ul class=\"slides\" #slides>\n <li *ngFor=\"let lineItem of items;\" (click)=\"onItemSelected(lineItem?.item?.id)\">\n <a [ngClass]=\"{'active': lineItem?.item?.id === selected_id}\">\n <span class=\"icon-area\">\n <va-icon [iconUrl]=\"lineItem?.item?.icon\" [name]=\"lineItem?.item?.name\" [diameter]=\"80\"></va-icon>\n <va-icon *ngIf=\"lineItem?.parent?.id\" class=\"addon-indicator\" [iconUrl]=\"lineItem?.parent?.icon\" [name]=\"lineItem?.parent?.name\"\n [diameter]=\"24\"></va-icon>\n </span>\n <div class=\"name-container\">\n <div>{{ lineItem?.item?.name }}</div>\n <div *ngIf=\"lineItem?.item?.editionName\" class=\"edition-name\">{{ lineItem.item.editionName }}</div>\n </div>\n <div *ngIf=\"lineItem?.parent?.id\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }} </span>\n <span>{{lineItem?.parent.name}}</span>\n </div>\n </a>\n </li>\n </ul>\n </nav>\n</div>\n",
5332 styles: [".name-container{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.name-container va-badge{margin-top:12px;margin-left:6px}nav{position:relative;width:350px;margin:0 auto;background:#fff;border:1px solid #e0e0e0;border-width:1px 0;overflow:hidden}nav ul{display:-webkit-box;display:flex;flex-wrap:nowrap;list-style:none;margin:0 50px;padding:0;position:relative;left:0;-webkit-transition:left .3s;transition:left .3s;word-break:break-word}nav li{min-width:100%;-webkit-box-flex:1;flex:1 0 25%;text-align:center;font-size:14px}nav li:first-child a{border-right:1px solid #e0e0e0}nav a{position:relative;display:block;height:100%;padding:20px;text-decoration:none;color:#212121;-webkit-transition:background .3s;transition:background .3s;-webkit-box-align:center;align-items:center;border-right:1px solid #e0e0e0;cursor:pointer}nav a:hover{background-color:rgba(255,255,255,.6)}nav a.active{background-color:#fff}nav a.active:after{content:'';display:block;position:absolute;bottom:-1px;left:0;width:100%;height:1px;background-color:#fff}nav p{margin-bottom:0}nav .icon img{width:80px;min-width:80px;height:80px}nav .next,nav .prev{position:absolute;height:100%;width:50px;top:0;background:rgba(33,33,33,.1);cursor:pointer;text-align:center;opacity:1;-webkit-transition:opacity .3s;transition:opacity .3s;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;z-index:1}nav .next:not(.disabled):hover,nav .prev:not(.disabled):hover{background:rgba(33,33,33,.3)}nav .prev{left:0}nav .next{right:0}nav .disabled{cursor:default;opacity:0}@media screen and (min-width:600px){nav{width:auto;overflow:initial}nav li{min-width:0;width:25%;-webkit-box-flex:0;flex-grow:0}nav .hide-arrows{display:none}nav .hide-arrows+.slides{margin:0}}va-icon{display:inline-block}.item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}.wrapper{overflow:hidden}.requires-text{color:#9e9e9e}.icon-area{position:relative;display:inline-block}.addon-indicator{position:absolute;border:2px solid #fff;border-radius:50%;bottom:-2px;right:-2px}.edition-name{color:#9e9e9e;font-style:italic;text-align:center;width:100%;font-size:16px;margin-bottom:4px}"]
5333 }] }
5334];
5335/** @nocollapse */
5336ProductsNavV2Component.ctorParameters = () => [
5337 { type: TranslateService }
5338];
5339ProductsNavV2Component.propDecorators = {
5340 items: [{ type: Input }],
5341 hideItemsNav: [{ type: Input }],
5342 itemSelected: [{ type: Output }]
5343};
5344if (false) {
5345 /** @type {?} */
5346 ProductsNavV2Component.prototype.items;
5347 /** @type {?} */
5348 ProductsNavV2Component.prototype.hideItemsNav;
5349 /** @type {?} */
5350 ProductsNavV2Component.prototype.itemSelected;
5351 /** @type {?} */
5352 ProductsNavV2Component.prototype.selected_id;
5353 /** @type {?} */
5354 ProductsNavV2Component.prototype.pageMarker;
5355 /**
5356 * @type {?}
5357 * @private
5358 */
5359 ProductsNavV2Component.prototype.translateService;
5360}
5361
5362/**
5363 * @fileoverview added by tsickle
5364 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5365 */
5366class VaProductsNavModule {
5367}
5368VaProductsNavModule.decorators = [
5369 { type: NgModule, args: [{
5370 imports: [
5371 CommonModule,
5372 MatIconModule,
5373 VaIconModule,
5374 VaBadgeModule,
5375 TranslateModule
5376 ],
5377 declarations: [VaProductsNavComponent, ProductsNavV2Component],
5378 exports: [VaProductsNavComponent, ProductsNavV2Component]
5379 },] }
5380];
5381
5382/**
5383 * @fileoverview added by tsickle
5384 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5385 */
5386class VaPackageDetailsModule {
5387}
5388VaPackageDetailsModule.decorators = [
5389 { type: NgModule, args: [{
5390 imports: [
5391 VaImageGalleryModule, CommonModule, MatIconModule, VaSafeHtmlModule, VaIconModule,
5392 VaPricingModule, MatButtonModule, VaFilesModule, VaFaqsModule, VaSellingInfoModule,
5393 VaHeaderContainerModule, VaAddonListModule, VaProductsNavModule
5394 ],
5395 declarations: [VaPackageDetailsComponent],
5396 exports: [VaPackageDetailsComponent],
5397 entryComponents: [VaPackageDetailsComponent]
5398 },] }
5399];
5400
5401/**
5402 * @fileoverview added by tsickle
5403 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5404 */
5405class PackageDetails {
5406 /**
5407 * @return {?}
5408 */
5409 get isPackageFree() {
5410 /** @type {?} */
5411 const isFreeHelper = (/**
5412 * @param {?} prices
5413 * @return {?}
5414 */
5415 (prices) => {
5416 return prices ? prices.some((/**
5417 * @param {?} p
5418 * @return {?}
5419 */
5420 p => p.price === 0 || p.price === undefined)) : false;
5421 });
5422 return this.pricing && isFreeHelper(this.pricing.prices);
5423 }
5424}
5425if (false) {
5426 /** @type {?} */
5427 PackageDetails.prototype.solution_id;
5428 /** @type {?} */
5429 PackageDetails.prototype.partner_id;
5430 /** @type {?} */
5431 PackageDetails.prototype.market_id;
5432 /** @type {?} */
5433 PackageDetails.prototype.name;
5434 /** @type {?} */
5435 PackageDetails.prototype.icon;
5436 /** @type {?} */
5437 PackageDetails.prototype.status;
5438 /** @type {?} */
5439 PackageDetails.prototype.tagline;
5440 /** @type {?} */
5441 PackageDetails.prototype.header_image_url;
5442 /** @type {?} */
5443 PackageDetails.prototype.content;
5444 /** @type {?} */
5445 PackageDetails.prototype.hide_product_icons_and_names;
5446 /** @type {?} */
5447 PackageDetails.prototype.hide_product_details;
5448 /** @type {?} */
5449 PackageDetails.prototype.createdDate;
5450 /** @type {?} */
5451 PackageDetails.prototype.updatedDate;
5452 /** @type {?} */
5453 PackageDetails.prototype.pricing;
5454 /** @type {?} */
5455 PackageDetails.prototype.line_items;
5456 /** @type {?} */
5457 PackageDetails.prototype.market_action;
5458}
5459/**
5460 * @param {?} data
5461 * @param {?} products
5462 * @return {?}
5463 */
5464function convertToPackageDetails(data, products) {
5465 if (!data) {
5466 return undefined;
5467 }
5468 /** @type {?} */
5469 const newPackage = new PackageDetails();
5470 if (!data.pricing) {
5471 data.pricing = Pricing$1.fromProto({
5472 currency: undefined,
5473 prices: [{
5474 price: 0,
5475 frequency: undefined,
5476 isStartingPrice: false,
5477 }]
5478 });
5479 }
5480 Object.assign(newPackage, data);
5481 if (!newPackage.name) {
5482 newPackage.name = 'Untitled';
5483 }
5484 if (data.created) {
5485 newPackage.createdDate = new Date(data.created);
5486 }
5487 if (data.updated) {
5488 newPackage.updatedDate = new Date(data.updated);
5489 }
5490 if (data.lineItems) {
5491 newPackage.line_items = convertProtoLineItemsToStoreLineItems(data.lineItems, products);
5492 }
5493 if (typeof data.pricing.currency === 'number') {
5494 newPackage.pricing.currency = Currency[data.pricing.currency];
5495 }
5496 return newPackage;
5497}
5498/**
5499 * @param {?} protoLineItems
5500 * @param {?} products
5501 * @return {?}
5502 */
5503function convertProtoLineItemsToStoreLineItems(protoLineItems, products) {
5504 if (!protoLineItems || !protoLineItems.lineItems || protoLineItems.lineItems.length === 0 || !products || products.length === 0) {
5505 return [];
5506 }
5507 return protoLineItems.lineItems.map((/**
5508 * @param {?} lineItem
5509 * @return {?}
5510 */
5511 lineItem => {
5512 /** @type {?} */
5513 const product = products.find((/**
5514 * @param {?} p
5515 * @return {?}
5516 */
5517 p => p.productId === lineItem.id));
5518 /** @type {?} */
5519 let parent;
5520 if (!!lineItem.parentId) {
5521 parent = products.find((/**
5522 * @param {?} p
5523 * @return {?}
5524 */
5525 p => p.productId === lineItem.parentId));
5526 }
5527 return convertProtoLineItemToStoreLineItem(lineItem, product, parent);
5528 }));
5529}
5530/**
5531 * @param {?} protoLineItem
5532 * @param {?} product
5533 * @param {?=} parentProduct
5534 * @return {?}
5535 */
5536function convertProtoLineItemToStoreLineItem(protoLineItem, product, parentProduct) {
5537 if (!product || !protoLineItem) {
5538 return undefined;
5539 }
5540 /** @type {?} */
5541 let files = [];
5542 if (product.pdfUploadUrls && product.pdfUploadUrls.length > 0) {
5543 files = product.pdfUploadUrls.map((/**
5544 * @param {?} url
5545 * @return {?}
5546 */
5547 url => new File(url)));
5548 }
5549 /** @type {?} */
5550 const lineItem = (/** @type {?} */ ({
5551 item: {
5552 id: protoLineItem.id,
5553 editionId: protoLineItem.editionId,
5554 icon: product.iconUrl,
5555 name: product.name,
5556 editionName: '',
5557 description: product.description,
5558 keySellingPoints: product.keySellingPoints,
5559 faqs: product.faqs,
5560 files: files,
5561 screenshotUrls: product.screenshotUrls,
5562 lmiCategories: [],
5563 },
5564 quantity: protoLineItem.quantity,
5565 parent: {}
5566 }));
5567 if (protoLineItem.parentId && parentProduct) {
5568 lineItem.parent = {
5569 id: protoLineItem.parentId,
5570 editionId: '',
5571 icon: parentProduct.iconUrl,
5572 name: parentProduct.name,
5573 editionName: '',
5574 };
5575 }
5576 return lineItem;
5577}
5578
5579/**
5580 * @fileoverview added by tsickle
5581 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5582 */
5583class VaPackageDetailsV2Component {
5584 /**
5585 * @param {?} translateService
5586 */
5587 constructor(translateService) {
5588 this.translateService = translateService;
5589 this.showActionButton = true;
5590 this.showPricing = true;
5591 this.getItNow = new EventEmitter();
5592 this.pkg$$ = new ReplaySubject(1);
5593 this.itemSelectedEvent$$ = new BehaviorSubject('');
5594 this.translateService.setTranslation('en', En.en, true);
5595 this.orderedLineItems$ = this.pkg$$.pipe(map((/**
5596 * @param {?} pkg
5597 * @return {?}
5598 */
5599 pkg => pkg.line_items)), filter((/**
5600 * @param {?} items
5601 * @return {?}
5602 */
5603 items => !!items || items.length === 0)), shareReplay(1));
5604 this.productNameForSingleAddon$ = this.orderedLineItems$.pipe(map((/**
5605 * @param {?} items
5606 * @return {?}
5607 */
5608 items => this.getParentsNameForItem(items))));
5609 this.selectedItem$ = combineLatest([this.itemSelectedEvent$$, this.orderedLineItems$]).pipe(map((/**
5610 * @param {?} __0
5611 * @return {?}
5612 */
5613 ([id, lineItems]) => lineItems.find((/**
5614 * @param {?} lineItem
5615 * @return {?}
5616 */
5617 lineItem => lineItem.item.id === id)))));
5618 this.lmiCategories$ = this.orderedLineItems$.pipe(map((/**
5619 * @param {?} lis
5620 * @return {?}
5621 */
5622 (lis) => {
5623 /** @type {?} */
5624 const lmiMap = (lis || []).reduce((/**
5625 * @param {?} prev
5626 * @param {?} li
5627 * @return {?}
5628 */
5629 (prev, li) => {
5630 if (li && li.item) {
5631 (li.item.lmiCategories || []).forEach((/**
5632 * @param {?} lmi
5633 * @return {?}
5634 */
5635 lmi => prev.set(lmi, lmi)));
5636 }
5637 return prev;
5638 }), new Map());
5639 /** @type {?} */
5640 const lmiCats = [];
5641 lmiMap.forEach((/**
5642 * @param {?} v
5643 * @param {?} k
5644 * @return {?}
5645 */
5646 (v, k) => {
5647 lmiCats.push(k);
5648 }));
5649 return lmiCats;
5650 })));
5651 // Set the initial selected Item
5652 this.orderedLineItems$.pipe(map((/**
5653 * @param {?} lineItems
5654 * @return {?}
5655 */
5656 lineItems => lineItems[0])), tap((/**
5657 * @param {?} lineItem
5658 * @return {?}
5659 */
5660 lineItem => this.selectItem(lineItem && lineItem.item ? lineItem.item.id : ''))), take(1)).subscribe();
5661 }
5662 /**
5663 * @param {?} pkg
5664 * @return {?}
5665 */
5666 set pkg(pkg) {
5667 this.pkg$$.next(pkg);
5668 }
5669 /**
5670 * @return {?}
5671 */
5672 ngOnInit() {
5673 if (!this.actionLabel) {
5674 this.actionLabel = this.translateService.instant('FRONTEND.STORE.GET_IT_NOW');
5675 }
5676 }
5677 /**
5678 * @param {?} id
5679 * @return {?}
5680 */
5681 selectItem(id) {
5682 this.itemSelectedEvent$$.next(id);
5683 }
5684 /**
5685 * @return {?}
5686 */
5687 emitGetItNow() {
5688 this.getItNow.emit();
5689 }
5690 /**
5691 * @param {?} items
5692 * @return {?}
5693 */
5694 getParentsNameForItem(items) {
5695 if (items && items.length === 1 && items[0]) {
5696 return items[0].parent.name;
5697 }
5698 }
5699}
5700VaPackageDetailsV2Component.decorators = [
5701 { type: Component, args: [{
5702 selector: 'va-package-details-v2',
5703 template: "<div *ngIf=\"pkg$$ | async as pkg\" class=\"page\">\n <va-header-container [iconUrl]=\"pkg.icon\"\n [title]=\"pkg.name\"\n [tagline]=\"pkg.tagline\"\n [prerequisite]=\"productNameForSingleAddon$ | async\"\n [chipLabels]=\"lmiCategories$ | async\"\n [pricing]=\"pkg.pricing\"\n [pricingLabel]=\"'FRONTEND.STORE.PRICING' | translate\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"actionLabel\"\n [actionEnabled]=true\n (actionSelected)=\"emitGetItNow()\"\n ></va-header-container>\n\n <ng-container *ngIf=\"pkg?.content\">\n <va-selling-info [description]=\"pkg.content\"></va-selling-info>\n </ng-container>\n\n <va-products-nav-v2 [items]=\"orderedLineItems$ | async\"\n [hideItemsNav]=\"pkg?.hide_product_icons_and_names\"\n (itemSelected)=\"selectItem($event)\"></va-products-nav-v2>\n\n <ng-container *ngIf=\"selectedItem$ | async as selectedItem\">\n <div *ngIf=\"!pkg?.hide_product_details\" class=\"package-content\">\n <div class=\"left-column\">\n <section *ngIf=\"selectedItem?.item?.description || selectedItem?.item?.keySellingPoints\">\n <va-selling-info [description]=\"selectedItem?.item?.description\"\n [keySellingPoints]=\"selectedItem?.item?.keySellingPoints\"></va-selling-info>\n </section>\n\n <section *ngIf=\"selectedItem?.item?.faqs?.length > 0 && selectedItem?.item?.faqs[0].question\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.FAQS' | translate }}</h2>\n <va-faqs [faqs]=\"selectedItem.item.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"selectedItem?.item?.screenshotUrls?.length > 0\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.GALLERY' | translate }}</h2>\n <va-image-gallery [imageUrls]=\"selectedItem.item.screenshotUrls\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"selectedItem?.item?.files?.length > 0\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.FILES' | translate }}</h2>\n <va-files [files]=\"selectedItem.item.files\"></va-files>\n </section>\n </div>\n </div>\n </ng-container>\n</div>\n",
5704 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.package-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.package-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
5705 }] }
5706];
5707/** @nocollapse */
5708VaPackageDetailsV2Component.ctorParameters = () => [
5709 { type: TranslateService }
5710];
5711VaPackageDetailsV2Component.propDecorators = {
5712 showActionButton: [{ type: Input }],
5713 showPricing: [{ type: Input }],
5714 actionLabel: [{ type: Input }],
5715 pkg: [{ type: Input }],
5716 getItNow: [{ type: Output }]
5717};
5718if (false) {
5719 /** @type {?} */
5720 VaPackageDetailsV2Component.prototype.showActionButton;
5721 /** @type {?} */
5722 VaPackageDetailsV2Component.prototype.showPricing;
5723 /** @type {?} */
5724 VaPackageDetailsV2Component.prototype.actionLabel;
5725 /** @type {?} */
5726 VaPackageDetailsV2Component.prototype.getItNow;
5727 /** @type {?} */
5728 VaPackageDetailsV2Component.prototype.pkg$$;
5729 /** @type {?} */
5730 VaPackageDetailsV2Component.prototype.itemSelectedEvent$$;
5731 /** @type {?} */
5732 VaPackageDetailsV2Component.prototype.selectedItem$;
5733 /** @type {?} */
5734 VaPackageDetailsV2Component.prototype.orderedLineItems$;
5735 /** @type {?} */
5736 VaPackageDetailsV2Component.prototype.productNameForSingleAddon$;
5737 /** @type {?} */
5738 VaPackageDetailsV2Component.prototype.lmiCategories$;
5739 /**
5740 * @type {?}
5741 * @private
5742 */
5743 VaPackageDetailsV2Component.prototype.translateService;
5744}
5745
5746/**
5747 * @fileoverview added by tsickle
5748 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5749 */
5750class VaPackageDetailsV2Module {
5751}
5752VaPackageDetailsV2Module.decorators = [
5753 { type: NgModule, args: [{
5754 imports: [
5755 VaImageGalleryModule,
5756 CommonModule,
5757 MatIconModule,
5758 VaSafeHtmlModule,
5759 VaIconModule,
5760 VaPricingModule,
5761 MatButtonModule,
5762 VaFilesModule,
5763 VaFaqsModule,
5764 VaSellingInfoModule,
5765 VaHeaderContainerModule,
5766 VaAddonListModule,
5767 VaProductsNavModule,
5768 TranslateModule
5769 ],
5770 declarations: [VaPackageDetailsV2Component],
5771 exports: [VaPackageDetailsV2Component],
5772 entryComponents: [VaPackageDetailsV2Component]
5773 },] }
5774];
5775
5776/**
5777 * @fileoverview added by tsickle
5778 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5779 */
5780/**
5781 * @record
5782 */
5783function SalesPackage() { }
5784if (false) {
5785 /** @type {?} */
5786 SalesPackage.prototype.formattedPrices;
5787 /** @type {?} */
5788 SalesPackage.prototype.packageId;
5789 /** @type {?} */
5790 SalesPackage.prototype.name;
5791 /** @type {?} */
5792 SalesPackage.prototype.icon;
5793 /** @type {?} */
5794 SalesPackage.prototype.productIds;
5795 /** @type {?} */
5796 SalesPackage.prototype.products;
5797 /** @type {?} */
5798 SalesPackage.prototype.addonsWithNoParent;
5799 /** @type {?} */
5800 SalesPackage.prototype.totalAddons;
5801 /** @type {?|undefined} */
5802 SalesPackage.prototype.activationStatus;
5803}
5804/**
5805 * @record
5806 */
5807function SalesProduct() { }
5808if (false) {
5809 /** @type {?} */
5810 SalesProduct.prototype.formattedPrices;
5811 /** @type {?} */
5812 SalesProduct.prototype.productId;
5813 /** @type {?} */
5814 SalesProduct.prototype.name;
5815 /** @type {?} */
5816 SalesProduct.prototype.icon;
5817 /** @type {?} */
5818 SalesProduct.prototype.tagline;
5819 /** @type {?|undefined} */
5820 SalesProduct.prototype.activationStatus;
5821 /** @type {?|undefined} */
5822 SalesProduct.prototype.editionId;
5823 /** @type {?|undefined} */
5824 SalesProduct.prototype.editionName;
5825 /** @type {?} */
5826 SalesProduct.prototype.addons;
5827 /** @type {?|undefined} */
5828 SalesProduct.prototype.parentInfo;
5829}
5830/**
5831 * @record
5832 */
5833function ProductParentInfo() { }
5834if (false) {
5835 /** @type {?} */
5836 ProductParentInfo.prototype.parentId;
5837 /** @type {?} */
5838 ProductParentInfo.prototype.parentName;
5839 /** @type {?} */
5840 ProductParentInfo.prototype.parentIconUrl;
5841 /** @type {?} */
5842 ProductParentInfo.prototype.multipleActivations;
5843}
5844/**
5845 * @record
5846 */
5847function SalesAddon() { }
5848if (false) {
5849 /** @type {?} */
5850 SalesAddon.prototype.parentId;
5851 /** @type {?} */
5852 SalesAddon.prototype.addonId;
5853 /** @type {?} */
5854 SalesAddon.prototype.name;
5855 /** @type {?} */
5856 SalesAddon.prototype.icon;
5857 /** @type {?} */
5858 SalesAddon.prototype.tagline;
5859 /** @type {?} */
5860 SalesAddon.prototype.parentName;
5861 /** @type {?} */
5862 SalesAddon.prototype.parentIcon;
5863 /** @type {?} */
5864 SalesAddon.prototype.multipleActivations;
5865 /** @type {?|undefined} */
5866 SalesAddon.prototype.activationStatus;
5867}
5868/**
5869 * @record
5870 */
5871function PackageItemActivationStatus() { }
5872if (false) {
5873 /** @type {?} */
5874 PackageItemActivationStatus.prototype.packageItemId;
5875 /** @type {?} */
5876 PackageItemActivationStatus.prototype.status;
5877}
5878/** @enum {number} */
5879const ActivationStatus = {
5880 SUCCESS: 0,
5881 WARNING: 1,
5882 ERROR: 2,
5883};
5884ActivationStatus[ActivationStatus.SUCCESS] = 'SUCCESS';
5885ActivationStatus[ActivationStatus.WARNING] = 'WARNING';
5886ActivationStatus[ActivationStatus.ERROR] = 'ERROR';
5887/**
5888 * @record
5889 */
5890function StatusNotificationItem() { }
5891if (false) {
5892 /** @type {?} */
5893 StatusNotificationItem.prototype.icon;
5894 /** @type {?} */
5895 StatusNotificationItem.prototype.text;
5896 /** @type {?} */
5897 StatusNotificationItem.prototype.status;
5898}
5899/**
5900 * @param {?} packages
5901 * @param {?} products
5902 * @param {?} addons
5903 * @return {?}
5904 */
5905function buildSalesPackages(packages, products, addons) {
5906 if (!packages || packages.length < 1) {
5907 return [];
5908 }
5909 return packages.map((/**
5910 * @param {?} pkg
5911 * @return {?}
5912 */
5913 pkg => buildSalesPackageFromPackage(pkg, products, addons)));
5914}
5915/**
5916 * @param {?} pkg
5917 * @param {?} products
5918 * @param {?} addons
5919 * @return {?}
5920 */
5921function buildSalesPackageFromPackage(pkg, products, addons) {
5922 if (!pkg) {
5923 return null;
5924 }
5925 /** @type {?} */
5926 const salesProducts = buildSalesProducts(pkg, products, addons);
5927 // Addons can be in a package even if the parent product is not, this will create salesAddons with no parent
5928 /** @type {?} */
5929 const addonsWithNoParent = buildSalesAddonsWithNoParent(pkg, products, addons);
5930 return createSalesPackage(pkg, salesProducts, addonsWithNoParent);
5931}
5932/**
5933 * @param {?} pkg
5934 * @param {?} products
5935 * @param {?} addons
5936 * @return {?}
5937 */
5938function buildSalesProducts(pkg, products, addons) {
5939 if (!(products && products.length && pkg.products && pkg.products.length)) {
5940 return [];
5941 }
5942 /** @type {?} */
5943 const productMap = new Map();
5944 products.forEach((/**
5945 * @param {?} product
5946 * @return {?}
5947 */
5948 product => productMap.set(product.productId, product)));
5949 return pkg.products
5950 .map((/**
5951 * @param {?} productId
5952 * @return {?}
5953 */
5954 productId => {
5955 /** @type {?} */
5956 const productMatch = productMap.get(productId);
5957 /** @type {?} */
5958 const addonsInPackage = coerceAddonsForAddonKeys(addons, pkg.addon_keys);
5959 return productMatch ? buildSalesProductFromProduct(productMatch, addonsInPackage) : null;
5960 }))
5961 .filter((/**
5962 * @param {?} productItem
5963 * @return {?}
5964 */
5965 productItem => productItem));
5966}
5967/**
5968 * @param {?} addons
5969 * @param {?} addonKeys
5970 * @return {?}
5971 */
5972function coerceAddonsForAddonKeys(addons, addonKeys) {
5973 if (!addons || addons.length === 0 || !addonKeys || addonKeys.length === 0) {
5974 return [];
5975 }
5976 return addons.reduce((/**
5977 * @param {?} addonsArray
5978 * @param {?} addon
5979 * @return {?}
5980 */
5981 (addonsArray, addon) => {
5982 /** @type {?} */
5983 const key = addonKeys.find((/**
5984 * @param {?} k
5985 * @return {?}
5986 */
5987 k => k.addonId === addon.addonId));
5988 if (key) {
5989 /** @type {?} */
5990 const quantity = key.quantity || 1;
5991 for (let i = 0; i < quantity; i++) {
5992 addonsArray.push(addon);
5993 }
5994 }
5995 return addonsArray;
5996 }), []);
5997}
5998/**
5999 * @param {?} pkg
6000 * @param {?} products
6001 * @param {?} addons
6002 * @return {?}
6003 */
6004function buildSalesAddonsWithNoParent(pkg, products, addons) {
6005 if (!addons || addons.length < 1 || !pkg.addon_keys) {
6006 return [];
6007 }
6008 /** @type {?} */
6009 const productMap = new Map();
6010 products.forEach((/**
6011 * @param {?} product
6012 * @return {?}
6013 */
6014 product => productMap.set(product.productId, product)));
6015 /** @type {?} */
6016 const addonsMap = new Map();
6017 addons.forEach((/**
6018 * @param {?} addon
6019 * @return {?}
6020 */
6021 addon => addonsMap.set(addon.addonId, addon)));
6022 /** @type {?} */
6023 const addonsWithNoParent = pkg.addon_keys.reduce((/**
6024 * @param {?} addonArray
6025 * @param {?} addonKey
6026 * @return {?}
6027 */
6028 (addonArray, addonKey) => {
6029 if (pkg.products && pkg.products.some((/**
6030 * @param {?} productId
6031 * @return {?}
6032 */
6033 productId => productId === addonKey.appId))) {
6034 return addonArray || [];
6035 }
6036 /** @type {?} */
6037 const parentProduct = productMap.get(addonKey.appId);
6038 /** @type {?} */
6039 const parentName = parentProduct ? parentProduct.name : null;
6040 /** @type {?} */
6041 const parentIcon = parentProduct ? parentProduct.iconUrl : null;
6042 /** @type {?} */
6043 const quantity = addonKey.quantity || 1;
6044 /** @type {?} */
6045 const addon = addonsMap.get(addonKey.addonId);
6046 for (let i = 0; i < quantity; i++) {
6047 addonArray.push(createSalesAddon(addon, parentName, parentIcon));
6048 }
6049 return addonArray;
6050 }), []);
6051 return addonsWithNoParent;
6052}
6053/**
6054 * @param {?} product
6055 * @param {?} addons
6056 * @return {?}
6057 */
6058function buildSalesProductFromProduct(product, addons) {
6059 if (!product) {
6060 return null;
6061 }
6062 if (!addons || addons.length < 1) {
6063 return createSalesProduct(product, null);
6064 }
6065 /** @type {?} */
6066 const productAddons = addons.filter((/**
6067 * @param {?} addon
6068 * @return {?}
6069 */
6070 addon => addon.appId === product.productId));
6071 /** @type {?} */
6072 const salesAddons = createSalesAddons(productAddons);
6073 return createSalesProduct(product, salesAddons);
6074}
6075/**
6076 * @param {?} pkg
6077 * @param {?} salesProducts
6078 * @param {?} addonsWithNoParent
6079 * @return {?}
6080 */
6081function createSalesPackage(pkg, salesProducts, addonsWithNoParent) {
6082 /** @type {?} */
6083 let totalAddons = 0;
6084 for (const key of pkg.addon_keys || []) {
6085 totalAddons += key.quantity || 1;
6086 }
6087 return {
6088 formattedPrices: pkg.priceStrings.join(', '),
6089 packageId: pkg.solution_id,
6090 name: pkg.name,
6091 icon: pkg.icon,
6092 productIds: pkg.products,
6093 products: salesProducts || [],
6094 addonsWithNoParent: addonsWithNoParent || [],
6095 totalAddons: totalAddons
6096 };
6097}
6098/**
6099 * @param {?} product
6100 * @param {?} salesAddons
6101 * @return {?}
6102 */
6103function createSalesProduct(product, salesAddons) {
6104 /** @type {?} */
6105 let parentInfo;
6106 if (product instanceof ProductWithParent) {
6107 parentInfo = {
6108 parentId: product.parentId,
6109 parentName: product.parentName,
6110 parentIconUrl: product.parentIconUrl,
6111 multipleActivations: product.multipleActivations || false,
6112 };
6113 }
6114 return {
6115 formattedPrices: product.priceStrings.join(', '),
6116 productId: product.productId,
6117 name: product.name,
6118 tagline: product.tagline || '',
6119 icon: product.iconUrl,
6120 addons: salesAddons || [],
6121 editionId: product.editionId,
6122 editionName: product.editionName,
6123 parentInfo: parentInfo,
6124 };
6125}
6126/**
6127 * @param {?} addons
6128 * @return {?}
6129 */
6130function createSalesAddons(addons) {
6131 return addons.map((/**
6132 * @param {?} addon
6133 * @return {?}
6134 */
6135 addon => createSalesAddon(addon)));
6136}
6137/**
6138 * @param {?} addon
6139 * @param {?=} parentName
6140 * @param {?=} parentIcon
6141 * @return {?}
6142 */
6143function createSalesAddon(addon, parentName, parentIcon) {
6144 return {
6145 parentId: addon.appId,
6146 addonId: addon.addonId,
6147 name: addon.title,
6148 tagline: addon.tagline || '',
6149 icon: addon.icon || '',
6150 multipleActivations: addon.multipleActivations,
6151 parentIcon: parentIcon || '',
6152 parentName: parentName || ''
6153 };
6154}
6155/**
6156 * @param {?} pkg
6157 * @param {?} products
6158 * @param {?} addons
6159 * @param {?} activationStatus
6160 * @return {?}
6161 */
6162function createSalesPackageWithStatus(pkg, products, addons, activationStatus) {
6163 return {
6164 formattedPrices: pkg.formattedPrices,
6165 packageId: pkg.packageId,
6166 name: pkg.name,
6167 icon: pkg.icon,
6168 productIds: pkg.productIds,
6169 products: products || [],
6170 addonsWithNoParent: addons || [],
6171 activationStatus: activationStatus || null,
6172 totalAddons: pkg.totalAddons
6173 };
6174}
6175/**
6176 * @param {?} product
6177 * @param {?} addons
6178 * @param {?} activationStatus
6179 * @return {?}
6180 */
6181function createSalesProductWithStatus(product, addons, activationStatus) {
6182 return {
6183 formattedPrices: product.formattedPrices,
6184 productId: product.productId,
6185 name: product.name,
6186 editionId: product.editionId,
6187 editionName: product.editionName,
6188 tagline: product.tagline,
6189 icon: product.icon,
6190 addons: addons || [],
6191 activationStatus: activationStatus || null,
6192 parentInfo: product.parentInfo || null,
6193 };
6194}
6195/**
6196 * @param {?} addon
6197 * @param {?} activationStatus
6198 * @return {?}
6199 */
6200function createSalesAddonWithStatus(addon, activationStatus) {
6201 return {
6202 parentId: addon.parentId,
6203 addonId: addon.addonId,
6204 name: addon.name,
6205 tagline: addon.tagline,
6206 icon: addon.icon,
6207 parentIcon: addon.parentIcon,
6208 parentName: addon.parentName,
6209 multipleActivations: addon.multipleActivations,
6210 activationStatus: activationStatus || null
6211 };
6212}
6213/**
6214 * @param {?} salesPackages
6215 * @param {?} statuses
6216 * @return {?}
6217 */
6218function addStatusesToSalesPackages(salesPackages, statuses) {
6219 if (!statuses || statuses.length === 0) {
6220 return salesPackages;
6221 }
6222 return salesPackages.map((/**
6223 * @param {?} salesPackage
6224 * @return {?}
6225 */
6226 salesPackage => {
6227 /** @type {?} */
6228 const newProducts = salesPackage.products.map((/**
6229 * @param {?} product
6230 * @return {?}
6231 */
6232 product => addStatusesToSalesProduct(product, statuses)));
6233 /** @type {?} */
6234 const newAddonsWithNoParent = salesPackage.addonsWithNoParent.map((/**
6235 * @param {?} addon
6236 * @return {?}
6237 */
6238 addon => {
6239 /** @type {?} */
6240 const status = findStatus(statuses, addon.addonId);
6241 return addStatusesToSalesAddon(addon, status);
6242 }));
6243 /** @type {?} */
6244 const productStatuses = newProducts
6245 .map((/**
6246 * @param {?} product
6247 * @return {?}
6248 */
6249 product => product.activationStatus.status));
6250 /** @type {?} */
6251 const addonStatuses = newProducts
6252 .map((/**
6253 * @param {?} product
6254 * @return {?}
6255 */
6256 product => product.addons ? product.addons.map((/**
6257 * @param {?} addon
6258 * @return {?}
6259 */
6260 addon => addon.activationStatus.status)) : []))
6261 .reduce((/**
6262 * @param {?} statusList
6263 * @param {?} reducedList
6264 * @return {?}
6265 */
6266 (statusList, reducedList) => reducedList.concat(statusList)), []);
6267 /** @type {?} */
6268 const addonsWithNoParentStatuses = newAddonsWithNoParent
6269 .map((/**
6270 * @param {?} addon
6271 * @return {?}
6272 */
6273 addon => addon.activationStatus ? addon.activationStatus.status : null));
6274 /** @type {?} */
6275 const allStatuses = [...productStatuses, ...addonStatuses, ...addonsWithNoParentStatuses];
6276 /** @type {?} */
6277 const packageStatus = convertNumberToActivationStatus(Math.max(...allStatuses));
6278 /** @type {?} */
6279 const statusNotification = createStatusNotificationItemForPackage(packageStatus);
6280 return createSalesPackageWithStatus(salesPackage, newProducts, newAddonsWithNoParent, statusNotification);
6281 }));
6282}
6283/**
6284 * @param {?} product
6285 * @param {?} statuses
6286 * @return {?}
6287 */
6288function addStatusesToSalesProduct(product, statuses) {
6289 if (!statuses || statuses.length === 0) {
6290 return product;
6291 }
6292 /** @type {?} */
6293 const productStatus = findStatus(statuses, product.productId);
6294 /** @type {?} */
6295 const statusNotification = createStatusNotificationItemForPackageItem(productStatus);
6296 if (!product.addons) {
6297 return createSalesProductWithStatus(product, null, statusNotification);
6298 }
6299 /** @type {?} */
6300 const newSalesAddons = product.addons.map((/**
6301 * @param {?} addon
6302 * @return {?}
6303 */
6304 addon => {
6305 /** @type {?} */
6306 const addonStatus = findStatus(statuses, addon.addonId);
6307 return addStatusesToSalesAddon(addon, addonStatus);
6308 }));
6309 return createSalesProductWithStatus(product, newSalesAddons, statusNotification);
6310}
6311/**
6312 * @param {?} addon
6313 * @param {?} status
6314 * @return {?}
6315 */
6316function addStatusesToSalesAddon(addon, status) {
6317 /** @type {?} */
6318 const addonStatusNotification = createStatusNotificationItemForPackageItem(status);
6319 return createSalesAddonWithStatus(addon, addonStatusNotification);
6320}
6321/**
6322 * @param {?} statuses
6323 * @param {?} id
6324 * @return {?}
6325 */
6326function findStatus(statuses, id) {
6327 if (!statuses || statuses.length <= 0) {
6328 return null;
6329 }
6330 /** @type {?} */
6331 const statusIndex = statuses.findIndex((/**
6332 * @param {?} s
6333 * @return {?}
6334 */
6335 s => {
6336 return s.packageItemId === id;
6337 }));
6338 if (statusIndex < 0) {
6339 return null;
6340 }
6341 /** @type {?} */
6342 const status = statuses[statusIndex].status;
6343 statuses.splice(statusIndex, 1);
6344 return status;
6345}
6346/**
6347 * @param {?} status
6348 * @return {?}
6349 */
6350function createStatusNotificationItemForPackageItem(status) {
6351 switch (status) {
6352 case ActivationStatus.SUCCESS:
6353 return { icon: 'check_circle', status: status, text: 'Activated' };
6354 case ActivationStatus.WARNING:
6355 return { icon: 'warning', status: status, text: 'Already Activated' };
6356 default:
6357 return { icon: 'error', status: status, text: 'Activation Errors' };
6358 }
6359}
6360/**
6361 * @param {?} status
6362 * @return {?}
6363 */
6364function createStatusNotificationItemForPackage(status) {
6365 switch (status) {
6366 case ActivationStatus.SUCCESS:
6367 return { icon: 'check_circle', status: status, text: 'Activated' };
6368 case ActivationStatus.WARNING:
6369 return { icon: 'warning', status: status, text: 'Activation Warnings' };
6370 default:
6371 return { icon: 'error', status: status, text: 'Activation Errors Occured' };
6372 }
6373}
6374/**
6375 * @param {?} number
6376 * @return {?}
6377 */
6378function convertNumberToActivationStatus(number) {
6379 switch (number) {
6380 case 0:
6381 return ActivationStatus.SUCCESS;
6382 case 1:
6383 return ActivationStatus.WARNING;
6384 default:
6385 return ActivationStatus.ERROR;
6386 }
6387}
6388
6389/**
6390 * @fileoverview added by tsickle
6391 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6392 */
6393/** @enum {string} */
6394const ListIndent = {
6395 INDENT_ZERO: 'indent-zero',
6396 INDENT_ONE: 'indent-one',
6397 INDENT_TWO: 'indent-two',
6398};
6399class VaPackageDropdownItemComponent {
6400 constructor() {
6401 this.enableDropdown = false;
6402 this.indent = ListIndent.INDENT_ZERO;
6403 this.itemToggled = new EventEmitter();
6404 }
6405 /**
6406 * @return {?}
6407 */
6408 ngOnInit() {
6409 }
6410 /**
6411 * @return {?}
6412 */
6413 toggleItem() {
6414 this.itemToggled.emit(null);
6415 }
6416 /**
6417 * @param {?} status
6418 * @return {?}
6419 */
6420 isActivatedStatus(status) {
6421 return status === ActivationStatus.SUCCESS;
6422 }
6423 /**
6424 * @param {?} status
6425 * @return {?}
6426 */
6427 isWarningStatus(status) {
6428 return status === ActivationStatus.WARNING;
6429 }
6430 /**
6431 * @param {?} status
6432 * @return {?}
6433 */
6434 isErrorStatus(status) {
6435 return status === ActivationStatus.ERROR;
6436 }
6437}
6438VaPackageDropdownItemComponent.decorators = [
6439 { type: Component, args: [{
6440 selector: 'va-package-dropdown-item',
6441 template: "<mat-list-item [ngClass]=\"indent\" class=\"va-dropdown-list-item\">\n <va-icon *ngIf=\"!secondaryIconUrl && !secondaryIconName; else dualIcon\" mat-list-avatar [name]=\"title\" [iconUrl]=\"iconUrl\" [diameter]=\"40\"></va-icon>\n <h3 mat-line class=\"va-dropdown-list-item__title\">{{ title }}\n <va-badge *ngIf=\"titleBadge\" small color=\"blue-solid\" class=\"va-dropdown-list-item__title-badge\">{{ titleBadge }}</va-badge>\n <span *ngIf=\"titleDescriptor\" class=\"va-dropdown-list-item__title-descriptor\">{{ titleDescriptor }}</span>\n </h3>\n <p class=\"package-dropdown-font\" mat-line>{{subtitle}}</p>\n\n <span *ngIf=\"!statusItem\" class=\"va-dropdown-list-item__layout\">\n <p class=\"va-dropdown-list-item__layout va-dropdown-list-item__notice\">{{ description }}</p>\n <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n </span>\n\n <span *ngIf=\"statusItem\" class=\"va-dropdown-list-item__layout va-dropdown-list-item__status\">\n <div [ngClass]=\"{\n 'activated': isActivatedStatus(statusItem.status),\n 'warning': isWarningStatus(statusItem.status),\n 'error': isErrorStatus(statusItem.status)}\">\n <mat-icon>{{statusItem.icon}}</mat-icon>\n </div>\n <p class=\"va-dropdown-list-item__notice\"\n [ngClass]=\"{\n 'activated': isActivatedStatus(statusItem.status),\n 'warning': isWarningStatus(statusItem.status),\n 'error': isErrorStatus(statusItem.status)}\">\n {{ statusItem.text }}\n </p>\n <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n </span>\n</mat-list-item>\n\n\n<ng-template #dropdownButton>\n <button *ngIf=\"enableDropdown\" mat-icon-button type=\"button\" (click)=\"toggleItem()\">\n <mat-icon mat-list-icon\n class=\"dropdown-icon\"\n [ngClass]=\"{'dropdown-icon-rotate-up': !toggleValue, 'dropdown-icon-rotate-down': toggleValue}\">\n keyboard_arrow_down\n </mat-icon>\n </button>\n</ng-template>\n\n<ng-template #dualIcon>\n <div class=\"dual-icon\">\n <va-icon mat-list-avatar [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"40\"></va-icon>\n <va-icon mat-list-avatar class=\"secondary-icon\" [iconUrl]=\"secondaryIconUrl\" [diameter]=\"20\" [name]=\"secondaryIconName\"></va-icon>\n </div>\n</ng-template>\n",
6442 styles: [".va-dropdown-list-item{border-bottom:1px solid rgba(0,0,0,.12)}mat-list-item .va-dropdown-list-item__title{font-weight:700}.va-dropdown-list-item__title-badge{padding-bottom:4px}.indent-one{padding-left:30px}.va-dropdown-list-item__title-descriptor{font-size:11px;font-weight:700;font-style:italic}.indent-two{padding-left:30px}.indent-two .mat-list-avatar{margin-left:40px}.dual-icon{position:relative;display:inline-block;-webkit-box-ordinal-group:0;order:-1;margin-right:16px}.dual-icon .secondary-icon{position:absolute;border-radius:50%;bottom:-24px;right:-24px}.va-dropdown-list-item__layout{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.va-dropdown-list-item__layout .va-dropdown-list-item__notice{width:-webkit-max-content;width:-moz-max-content;width:max-content;font-style:italic}@media screen and (max-width:500px){.va-dropdown-list-item__layout p{display:none}}.va-dropdown-list-item__layout mat-icon{padding:0}.va-dropdown-list-item__layout button{padding:0;min-width:0}.va-dropdown-list-item__layout button .dropdown-icon{color:rgba(0,0,0,.54)}.va-dropdown-list-item__layout button .dropdown-icon-rotate-down{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:.4s;transition:.4s;pointer-events:none}.va-dropdown-list-item__layout button .dropdown-icon-rotate-up{-webkit-transform:rotate(0);transform:rotate(0);-webkit-transition:.4s;transition:.4s;pointer-events:none}.va-dropdown-list-item__status{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.va-dropdown-list-item__status p{padding-left:6px;font-size:14px;white-space:nowrap}.va-dropdown-list-item__status .activated{color:#4caf50}.va-dropdown-list-item__status .warning{color:#ffa000}.va-dropdown-list-item__status .error{color:#c62828}", ".package-dropdown-font,.product-dropdown-font{color:rgba(0,0,0,.54);font-size:14px;font-weight:400}.package-list-container{border-top:1px solid rgba(0,0,0,.12);padding:0}.package-list-container mat-list{padding:0}.package-dropdown-stencil-display{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.package-dropdown-stencil-display va-icon{margin-right:20px}.package-dropdown-stencil-display .stencil-text{width:inherit;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.package-dropdown-stencil-display .stencil-text .stencil-title{height:32px;width:40%;margin-bottom:5px!important;margin-top:0!important}.package-dropdown-stencil-display .stencil-text .stencil-tagline{height:32px;width:inherit}.product-or-addon-list{background-color:rgba(0,0,0,.04);overflow:hidden}"]
6443 }] }
6444];
6445VaPackageDropdownItemComponent.propDecorators = {
6446 title: [{ type: Input }],
6447 titleBadge: [{ type: Input }],
6448 titleDescriptor: [{ type: Input }],
6449 iconUrl: [{ type: Input }],
6450 secondaryIconUrl: [{ type: Input }],
6451 secondaryIconName: [{ type: Input }],
6452 subtitle: [{ type: Input }],
6453 statusItem: [{ type: Input }],
6454 enableDropdown: [{ type: Input }],
6455 indent: [{ type: Input }],
6456 toggleValue: [{ type: Input }],
6457 description: [{ type: Input }],
6458 itemToggled: [{ type: Output }]
6459};
6460if (false) {
6461 /** @type {?} */
6462 VaPackageDropdownItemComponent.prototype.title;
6463 /** @type {?} */
6464 VaPackageDropdownItemComponent.prototype.titleBadge;
6465 /** @type {?} */
6466 VaPackageDropdownItemComponent.prototype.titleDescriptor;
6467 /** @type {?} */
6468 VaPackageDropdownItemComponent.prototype.iconUrl;
6469 /** @type {?} */
6470 VaPackageDropdownItemComponent.prototype.secondaryIconUrl;
6471 /** @type {?} */
6472 VaPackageDropdownItemComponent.prototype.secondaryIconName;
6473 /** @type {?} */
6474 VaPackageDropdownItemComponent.prototype.subtitle;
6475 /** @type {?} */
6476 VaPackageDropdownItemComponent.prototype.statusItem;
6477 /** @type {?} */
6478 VaPackageDropdownItemComponent.prototype.enableDropdown;
6479 /** @type {?} */
6480 VaPackageDropdownItemComponent.prototype.indent;
6481 /** @type {?} */
6482 VaPackageDropdownItemComponent.prototype.toggleValue;
6483 /** @type {?} */
6484 VaPackageDropdownItemComponent.prototype.description;
6485 /** @type {?} */
6486 VaPackageDropdownItemComponent.prototype.itemToggled;
6487}
6488
6489/**
6490 * @fileoverview added by tsickle
6491 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6492 */
6493/**
6494 * @record
6495 */
6496function OrderLengthsForToggling() { }
6497if (false) {
6498 /** @type {?} */
6499 OrderLengthsForToggling.prototype.packages;
6500 /** @type {?} */
6501 OrderLengthsForToggling.prototype.products;
6502}
6503class VaPackageDropdownComponent {
6504 /**
6505 * @param {?} translateService
6506 */
6507 constructor(translateService) {
6508 this.translateService = translateService;
6509 // controls whether only one dropdown can be expanded at a time
6510 this.singularDropdown = false;
6511 // hides pricing
6512 this.hidePricing = false;
6513 this.packageProductIndent = ListIndent.INDENT_ONE;
6514 this.packageAddonWithoutProductIndent = ListIndent.INDENT_ONE;
6515 this.packageAddonWithProductIndent = ListIndent.INDENT_TWO;
6516 this.productAddonIndent = ListIndent.INDENT_ONE;
6517 this.packages$$ = new ReplaySubject(1);
6518 this.products$$ = new ReplaySubject(1);
6519 this.standAloneProducts$$ = new ReplaySubject(1);
6520 this.statuses$$ = new BehaviorSubject([]);
6521 this.addons$$ = new ReplaySubject(1);
6522 this.orderItemLengths$$ = new BehaviorSubject((/** @type {?} */ ({
6523 packages: 0,
6524 products: 0
6525 })));
6526 this.packageToggles = [];
6527 this.productToggles = [];
6528 this.translateService.setTranslation('en', En.en, true);
6529 }
6530 // packages in dropdown
6531 /**
6532 * @param {?} packages
6533 * @return {?}
6534 */
6535 set packages(packages) {
6536 this.packages$$.next(packages);
6537 }
6538 // products within given packages
6539 /**
6540 * @param {?} products
6541 * @return {?}
6542 */
6543 set products(products) {
6544 this.products$$.next(products);
6545 }
6546 // products not associated with a package
6547 /**
6548 * @param {?} standAloneProducts
6549 * @return {?}
6550 */
6551 set standAloneProducts(standAloneProducts) {
6552 this.standAloneProducts$$.next(standAloneProducts);
6553 }
6554 // statuses for all products and addons
6555 /**
6556 * @param {?} statuses
6557 * @return {?}
6558 */
6559 set statuses(statuses) {
6560 this.statuses$$.next(statuses);
6561 }
6562 // addons within given packages
6563 /**
6564 * @param {?} addons
6565 * @return {?}
6566 */
6567 set addons(addons) {
6568 this.addons$$.next(addons);
6569 }
6570 /**
6571 * @return {?}
6572 */
6573 ngOnInit() {
6574 /** @type {?} */
6575 const packages$ = this.packages$$.pipe(filter((/**
6576 * @param {?} packages
6577 * @return {?}
6578 */
6579 packages => packages !== null)));
6580 /** @type {?} */
6581 const products$ = this.products$$.pipe(filter((/**
6582 * @param {?} products
6583 * @return {?}
6584 */
6585 products => products !== null)));
6586 /** @type {?} */
6587 const addons$ = this.addons$$.pipe(filter((/**
6588 * @param {?} addons
6589 * @return {?}
6590 */
6591 addons => addons !== null)));
6592 /** @type {?} */
6593 const salesPackage$ = zip(packages$, products$, addons$).pipe(tap((/**
6594 * @param {?} __0
6595 * @return {?}
6596 */
6597 ([packages, products, _]) => {
6598 this.orderItemLengths$$.next((/** @type {?} */ ({
6599 packages: packages.length,
6600 products: products.length
6601 })));
6602 })), map((/**
6603 * @param {?} __0
6604 * @return {?}
6605 */
6606 ([packages, products, addons]) => buildSalesPackages(packages, products, addons))));
6607 this.salesPackages$ = combineLatest(salesPackage$, this.statuses$$).pipe(map((/**
6608 * @param {?} __0
6609 * @return {?}
6610 */
6611 ([salesPackages, statuses]) => addStatusesToSalesPackages(salesPackages, statuses))), startWith([]));
6612 this.salesProducts$ = combineLatest(this.standAloneProducts$$, this.statuses$$).pipe(filter((/**
6613 * @param {?} __0
6614 * @return {?}
6615 */
6616 ([products, _]) => products !== null)), map((/**
6617 * @param {?} __0
6618 * @return {?}
6619 */
6620 ([products, statuses]) => {
6621 return products.map((/**
6622 * @param {?} p
6623 * @return {?}
6624 */
6625 p => {
6626 /** @type {?} */
6627 const addons = p.addons || null;
6628 /** @type {?} */
6629 const salesProducts = buildSalesProductFromProduct(p, addons);
6630 return addStatusesToSalesProduct(salesProducts, statuses);
6631 }));
6632 })), startWith([]));
6633 this.templateData$ = combineLatest(this.salesPackages$, this.salesProducts$).pipe(map((/**
6634 * @param {?} __0
6635 * @return {?}
6636 */
6637 ([packages, products]) => ({ packages: packages, products: products }))));
6638 }
6639 /**
6640 * @return {?}
6641 */
6642 openAllDropdowns() {
6643 for (let x = 0; x < this.orderItemLengths$$.getValue().packages; x++) {
6644 this.packageToggles[x] = true;
6645 }
6646 for (let x = 0; x < this.orderItemLengths$$.getValue().products; x++) {
6647 this.productToggles[x] = true;
6648 }
6649 }
6650 /**
6651 * @param {?} indexToToggle
6652 * @return {?}
6653 */
6654 togglePackage(indexToToggle) {
6655 if (this.singularDropdown) {
6656 /** @type {?} */
6657 const openedIndex = this.packageToggles.findIndex((/**
6658 * @param {?} value
6659 * @return {?}
6660 */
6661 value => value === true));
6662 if (openedIndex !== indexToToggle) {
6663 this.packageToggles[openedIndex] = false;
6664 }
6665 /** @type {?} */
6666 const productOpenedIndex = this.productToggles.findIndex((/**
6667 * @param {?} value
6668 * @return {?}
6669 */
6670 value => value === true));
6671 if (productOpenedIndex > -1) {
6672 this.productToggles[productOpenedIndex] = false;
6673 }
6674 }
6675 this.packageToggles[indexToToggle] = !this.packageToggles[indexToToggle];
6676 }
6677 /**
6678 * @param {?} indexToToggle
6679 * @return {?}
6680 */
6681 toggleProduct(indexToToggle) {
6682 if (this.singularDropdown) {
6683 /** @type {?} */
6684 const openedIndex = this.productToggles.findIndex((/**
6685 * @param {?} value
6686 * @return {?}
6687 */
6688 value => value === true));
6689 if (openedIndex !== indexToToggle) {
6690 this.productToggles[openedIndex] = false;
6691 }
6692 /** @type {?} */
6693 const packageOpenedIndex = this.packageToggles.findIndex((/**
6694 * @param {?} value
6695 * @return {?}
6696 */
6697 value => value === true));
6698 if (packageOpenedIndex > -1) {
6699 this.packageToggles[packageOpenedIndex] = false;
6700 }
6701 }
6702 this.productToggles[indexToToggle] = !this.productToggles[indexToToggle];
6703 }
6704 /**
6705 * @param {?} product
6706 * @return {?}
6707 */
6708 standAloneProductDescription(product) {
6709 if (product.addons && product.addons.length > 0) {
6710 /** @type {?} */
6711 let description = `Contains ${product.addons.length}`;
6712 description = product.addons.length === 1 ? `${description} Addon` : `${description} Addons`;
6713 return description;
6714 }
6715 return '';
6716 }
6717 /**
6718 * @param {?} product
6719 * @return {?}
6720 */
6721 standAloneProductWithParentDescription(product) {
6722 if (!product.parentInfo) {
6723 return '';
6724 }
6725 return `(Requires ${product.parentInfo.parentName})`;
6726 }
6727 /**
6728 * @param {?} pkg
6729 * @return {?}
6730 */
6731 packageDescription(pkg) {
6732 /** @type {?} */
6733 const hasProducts = pkg.products && pkg.products.length > 0;
6734 if (!hasProducts && pkg.totalAddons === 0) {
6735 return 'No Items in Package';
6736 }
6737 /** @type {?} */
6738 let description = '';
6739 /** @type {?} */
6740 const hasOneProduct = pkg.products && pkg.products.length === 1;
6741 if (hasProducts || pkg.totalAddons > 0) {
6742 description = 'Contains ';
6743 }
6744 if (hasProducts) {
6745 description = `${description} ${pkg.products.length}`;
6746 description = hasOneProduct ? `${description} Product` : `${description} Products`;
6747 }
6748 if (hasProducts && pkg.totalAddons > 0) {
6749 description = `${description} & ${pkg.totalAddons}`;
6750 description = pkg.totalAddons === 1 ? `${description} Addon` : `${description} Addons`;
6751 }
6752 return description;
6753 }
6754}
6755VaPackageDropdownComponent.decorators = [
6756 { type: Component, args: [{
6757 selector: 'va-package-dropdown',
6758 animations: [
6759 trigger('listAnimationStart', [
6760 state('void', style({ height: '0px' })),
6761 state('*', style({ height: '*' })),
6762 transition('void => *', [animate('0.25s ease')]),
6763 transition('* => void', [animate('0.25s ease')])
6764 ])
6765 ],
6766 template: "<ng-container *ngIf=\"templateData$ | async as data\">\n <mat-card class=\"package-list-container\" *ngIf=\"data.products?.length > 0 || data.packages?.length > 0 else loading\">\n <mat-list>\n <div class=\"package-list\" *ngFor=\"let package of data.packages; let packageIndex = index\">\n\n <va-package-dropdown-item\n [title]=\"package.name\"\n [iconUrl]=\"package.icon\"\n [subtitle]=\"hidePricing ? '' : package.formattedPrices\"\n [statusItem]=\"package.activationStatus\"\n [description]=\"packageDescription(package)\"\n [enableDropdown]=\"package.products?.length > 0 || package.addonsWithNoParent?.length > 0\"\n [toggleValue]=\"packageToggles[packageIndex]\"\n (itemToggled)=\"togglePackage(packageIndex)\"\n ></va-package-dropdown-item>\n\n <mat-list class=\"product-or-addon-list package-dropdown-font\" *ngIf=\"packageToggles[packageIndex]\"\n [@listAnimationStart]>\n <div *ngFor=\"let product of package.products\">\n <va-package-dropdown-item\n [title]=\"product.name\"\n [subtitle]=\"product.tagline\"\n [titleBadge]=\"product.editionName\"\n [iconUrl]=\"product.icon\"\n [statusItem]=\"product.activationStatus\"\n [indent]=\"packageProductIndent\"\n ></va-package-dropdown-item>\n\n <va-package-dropdown-item\n *ngFor=\"let addon of product.addons\"\n [title]=\"addon.name\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"packageAddonWithProductIndent\"\n ></va-package-dropdown-item>\n </div>\n\n <va-package-dropdown-item\n *ngFor=\"let addon of package.addonsWithNoParent\"\n [title]=\"addon.name\"\n [titleDescriptor]=\"'FRONTEND.STORE.REQUIRES_DESCRIPTOR' | translate: {requirementName: addon.parentName}\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [secondaryIconUrl]=\"addon.parentIcon\"\n [secondaryIconName]=\"addon.parentName\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"packageAddonWithoutProductIndent\"\n ></va-package-dropdown-item>\n </mat-list>\n </div>\n\n <div class=\"product-list\" *ngFor=\"let product of data.products; let productIndex = index\">\n <va-package-dropdown-item\n [title]=\"product.name\"\n [titleBadge]=\"product.editionName\"\n [titleDescriptor]=\"standAloneProductWithParentDescription(product)\"\n [iconUrl]=\"product.icon\"\n [subtitle]=\"hidePricing ? '' : product.formattedPrices\"\n [secondaryIconUrl]=\"product.parentInfo?.parentIconUrl\"\n [secondaryIconName]=\"product.parentInfo?.parentName\"\n [statusItem]=\"product.activationStatus\"\n [description]=\"standAloneProductDescription(product)\"\n [enableDropdown]=\"product.addons?.length > 0\"\n [toggleValue]=\"productToggles[productIndex]\"\n (itemToggled)=\"toggleProduct(productIndex)\"\n ></va-package-dropdown-item>\n\n <mat-list class=\"product-or-addon-list product-dropdown-font\" *ngIf=\"productToggles[productIndex]\"\n [@listAnimationStart]>\n <va-package-dropdown-item\n *ngFor=\"let addon of product.addons\"\n [title]=\"addon.name\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"productAddonIndent\"\n ></va-package-dropdown-item>\n </mat-list>\n </div>\n\n </mat-list>\n </mat-card>\n</ng-container>\n\n<ng-template #loading>\n <mat-card>\n <div class=\"package-dropdown-stencil-display\">\n <va-icon [iconUrl]=\"\"></va-icon>\n <div class=\"stencil-text\">\n <h1 class=\"stencil-title stencil-shimmer\"></h1>\n <span class=\"stencil-tagline stencil-shimmer\"></span>\n </div>\n </div>\n </mat-card>\n</ng-template>\n",
6767 styles: [".package-dropdown-font,.product-dropdown-font{color:rgba(0,0,0,.54);font-size:14px;font-weight:400}.package-list-container{border-top:1px solid rgba(0,0,0,.12);padding:0}.package-list-container mat-list{padding:0}.package-dropdown-stencil-display{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.package-dropdown-stencil-display va-icon{margin-right:20px}.package-dropdown-stencil-display .stencil-text{width:inherit;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.package-dropdown-stencil-display .stencil-text .stencil-title{height:32px;width:40%;margin-bottom:5px!important;margin-top:0!important}.package-dropdown-stencil-display .stencil-text .stencil-tagline{height:32px;width:inherit}.product-or-addon-list{background-color:rgba(0,0,0,.04);overflow:hidden}"]
6768 }] }
6769];
6770/** @nocollapse */
6771VaPackageDropdownComponent.ctorParameters = () => [
6772 { type: TranslateService }
6773];
6774VaPackageDropdownComponent.propDecorators = {
6775 packages: [{ type: Input }],
6776 products: [{ type: Input }],
6777 standAloneProducts: [{ type: Input }],
6778 statuses: [{ type: Input }],
6779 addons: [{ type: Input }],
6780 singularDropdown: [{ type: Input }],
6781 hidePricing: [{ type: Input }]
6782};
6783if (false) {
6784 /** @type {?} */
6785 VaPackageDropdownComponent.prototype.singularDropdown;
6786 /** @type {?} */
6787 VaPackageDropdownComponent.prototype.hidePricing;
6788 /** @type {?} */
6789 VaPackageDropdownComponent.prototype.packageProductIndent;
6790 /** @type {?} */
6791 VaPackageDropdownComponent.prototype.packageAddonWithoutProductIndent;
6792 /** @type {?} */
6793 VaPackageDropdownComponent.prototype.packageAddonWithProductIndent;
6794 /** @type {?} */
6795 VaPackageDropdownComponent.prototype.productAddonIndent;
6796 /** @type {?} */
6797 VaPackageDropdownComponent.prototype.packages$$;
6798 /** @type {?} */
6799 VaPackageDropdownComponent.prototype.products$$;
6800 /** @type {?} */
6801 VaPackageDropdownComponent.prototype.standAloneProducts$$;
6802 /** @type {?} */
6803 VaPackageDropdownComponent.prototype.statuses$$;
6804 /** @type {?} */
6805 VaPackageDropdownComponent.prototype.addons$$;
6806 /** @type {?} */
6807 VaPackageDropdownComponent.prototype.orderItemLengths$$;
6808 /** @type {?} */
6809 VaPackageDropdownComponent.prototype.templateData$;
6810 /** @type {?} */
6811 VaPackageDropdownComponent.prototype.salesPackages$;
6812 /** @type {?} */
6813 VaPackageDropdownComponent.prototype.salesProducts$;
6814 /** @type {?} */
6815 VaPackageDropdownComponent.prototype.packageToggles;
6816 /** @type {?} */
6817 VaPackageDropdownComponent.prototype.productToggles;
6818 /**
6819 * @type {?}
6820 * @private
6821 */
6822 VaPackageDropdownComponent.prototype.translateService;
6823}
6824
6825/**
6826 * @fileoverview added by tsickle
6827 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6828 */
6829class VaPackageDropdownModule {
6830}
6831VaPackageDropdownModule.decorators = [
6832 { type: NgModule, args: [{
6833 imports: [
6834 CommonModule,
6835 MatButtonModule,
6836 MatCardModule,
6837 MatListModule$1,
6838 MatIconModule,
6839 VaIconModule,
6840 VaBadgeModule,
6841 TranslateModule
6842 ],
6843 declarations: [VaPackageDropdownComponent, VaPackageDropdownItemComponent],
6844 exports: [VaPackageDropdownComponent],
6845 entryComponents: [VaPackageDropdownComponent]
6846 },] }
6847];
6848
6849/**
6850 * @fileoverview added by tsickle
6851 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6852 */
6853class VaProductDetailsComponent {
6854 constructor() {
6855 this.hasVerifiedContract = false;
6856 this.canAccessContractPricing = false;
6857 this.showActionButton = false;
6858 this.showPricing = false;
6859 this.showPricingAction = false;
6860 this.loaded = true;
6861 this.enableClicked = new EventEmitter();
6862 this.addonSelected = new EventEmitter();
6863 this.primaryPricingActionSelected = new EventEmitter();
6864 this.pricingActionSelected = new EventEmitter();
6865 }
6866 /**
6867 * @return {?}
6868 */
6869 getAddons() {
6870 if (!this._addons) {
6871 this._addons = this.product.addons.map((/**
6872 * @param {?} addon
6873 * @return {?}
6874 */
6875 (addon) => Addon.fromApi(addon)));
6876 }
6877 return this._addons;
6878 }
6879 /**
6880 * @return {?}
6881 */
6882 getActionLabel() {
6883 if (this.product.isArchived) {
6884 return 'Enable';
6885 }
6886 return 'Enabled';
6887 }
6888 /**
6889 * @return {?}
6890 */
6891 get price() {
6892 // NOTE: wholesalePrice = 0 means free, wholesalePrice = null || -1 means "contact sales"
6893 /** @type {?} */
6894 let prices = [];
6895 if (this.product.wholesalePrice !== CONTACT_SALES && this.product.wholesalePrice != null) {
6896 prices = [{
6897 price: this.product.wholesalePrice,
6898 frequency: this.product.billingFrequency
6899 }];
6900 }
6901 return {
6902 currency: this.product.currency,
6903 prices: prices
6904 };
6905 }
6906 /**
6907 * @param {?} addonId
6908 * @return {?}
6909 */
6910 onAddonSelected(addonId) {
6911 this.addonSelected.emit(addonId);
6912 }
6913}
6914VaProductDetailsComponent.decorators = [
6915 { type: Component, args: [{
6916 selector: 'va-product-details',
6917 template: "<div class=\"page\">\n <va-header-container [iconUrl]=\"product.iconUrl\"\n [title]=\"product.name\"\n [tagline]=\"product.tagline\"\n [chipLabels]=\"product.getLmiCategoryNames()\"\n [pricing]=\"price\"\n [pricingLabel]=\"'Wholesale Price'\"\n [primaryPricingActionLabel]=\"primaryPricingActionLabel\"\n [pricingActionLabel]=\"pricingActionLabel\"\n [pricingActionEnabled]=\"showPricingAction\"\n [actionLabel]=\"getActionLabel()\"\n [actionEnabled]=\"product.isArchived\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"\n (primaryPricingActionSelected)=\"primaryPricingActionSelected.emit()\"\n (pricingActionSelected)=\"pricingActionSelected.emit()\"\n (actionSelected)=\"enableClicked.emit()\">\n </va-header-container>\n <div class=\"product-details product-content\">\n <div class=\"left-column\">\n <ng-container *ngIf=\"product.description || product.keySellingPoints\">\n <va-selling-info [description]=\"product.description\"\n [keySellingPoints]=\"product.keySellingPoints\"></va-selling-info>\n </ng-container>\n <section *ngIf=\"product.addons?.length > 0\">\n <h2 class=\"va-component-title\">Add-Ons</h2>\n <va-addon-list (addonSelected)=\"onAddonSelected($event)\"\n [addons]=\"getAddons()\"\n [showPricing]=\"showPricing\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [canAccessContractPricing]=\"canAccessContractPricing\"\n [partnerID]=\"partnerID\">\n </va-addon-list>\n </section>\n\n <section *ngIf=\"product.faqs?.length > 0\">\n <h2 class=\"va-component-title\">FAQs</h2>\n <va-faqs [faqs]=\"product.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"product.restrictions?.country?.whitelist?.length > 0\">\n <supported-countries [countryCodes]=\"product.restrictions.country.whitelist\"></supported-countries>\n </section>\n\n <section *ngIf=\"product.screenshotUrls?.length > 0\">\n <h2 class=\"va-component-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"product.screenshotUrls\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"product.files?.length > 0\">\n <h2 class=\"va-component-title\">Files</h2>\n <va-files [files]=\"product.files\"></va-files>\n </section>\n </div>\n </div>\n</div>\n",
6918 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.sales-person-details{max-height:430px;overflow:hidden}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.product-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.product-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
6919 }] }
6920];
6921VaProductDetailsComponent.propDecorators = {
6922 product: [{ type: Input }],
6923 billedProduct: [{ type: Input }],
6924 hasVerifiedContract: [{ type: Input }],
6925 canAccessContractPricing: [{ type: Input }],
6926 showActionButton: [{ type: Input }],
6927 showPricing: [{ type: Input }],
6928 primaryPricingActionLabel: [{ type: Input }],
6929 pricingActionLabel: [{ type: Input }],
6930 showPricingAction: [{ type: Input }],
6931 loaded: [{ type: Input }],
6932 partnerID: [{ type: Input }],
6933 enableClicked: [{ type: Output }],
6934 addonSelected: [{ type: Output }],
6935 primaryPricingActionSelected: [{ type: Output }],
6936 pricingActionSelected: [{ type: Output }]
6937};
6938if (false) {
6939 /** @type {?} */
6940 VaProductDetailsComponent.prototype.product;
6941 /** @type {?} */
6942 VaProductDetailsComponent.prototype.billedProduct;
6943 /** @type {?} */
6944 VaProductDetailsComponent.prototype.hasVerifiedContract;
6945 /** @type {?} */
6946 VaProductDetailsComponent.prototype.canAccessContractPricing;
6947 /** @type {?} */
6948 VaProductDetailsComponent.prototype.showActionButton;
6949 /** @type {?} */
6950 VaProductDetailsComponent.prototype.showPricing;
6951 /** @type {?} */
6952 VaProductDetailsComponent.prototype.primaryPricingActionLabel;
6953 /** @type {?} */
6954 VaProductDetailsComponent.prototype.pricingActionLabel;
6955 /** @type {?} */
6956 VaProductDetailsComponent.prototype.showPricingAction;
6957 /** @type {?} */
6958 VaProductDetailsComponent.prototype.loaded;
6959 /** @type {?} */
6960 VaProductDetailsComponent.prototype.partnerID;
6961 /** @type {?} */
6962 VaProductDetailsComponent.prototype.enableClicked;
6963 /** @type {?} */
6964 VaProductDetailsComponent.prototype.addonSelected;
6965 /** @type {?} */
6966 VaProductDetailsComponent.prototype.primaryPricingActionSelected;
6967 /** @type {?} */
6968 VaProductDetailsComponent.prototype.pricingActionSelected;
6969 /**
6970 * @type {?}
6971 * @private
6972 */
6973 VaProductDetailsComponent.prototype._addons;
6974}
6975
6976/**
6977 * @fileoverview added by tsickle
6978 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6979 */
6980class VaProductDetailsModule {
6981}
6982VaProductDetailsModule.decorators = [
6983 { type: NgModule, args: [{
6984 imports: [
6985 VaImageGalleryModule, CommonModule, VaIconModule,
6986 VaPricingModule, VaFilesModule, VaFaqsModule, VaSellingInfoModule,
6987 VaHeaderContainerModule, VaSafeHtmlModule, VaAddonListModule, RestrictionsModule
6988 ],
6989 declarations: [VaProductDetailsComponent],
6990 exports: [VaProductDetailsComponent],
6991 entryComponents: [VaProductDetailsComponent]
6992 },] }
6993];
6994
6995/**
6996 * @fileoverview added by tsickle
6997 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6998 */
6999class ResellerItem {
7000 /**
7001 * @param {?=} data
7002 */
7003 constructor(data) {
7004 this.quantity = 1;
7005 data = data || {};
7006 Object.assign(this, data);
7007 }
7008}
7009if (false) {
7010 /** @type {?} */
7011 ResellerItem.prototype.appId;
7012 /** @type {?} */
7013 ResellerItem.prototype.addonId;
7014 /** @type {?} */
7015 ResellerItem.prototype.name;
7016 /** @type {?} */
7017 ResellerItem.prototype.icon;
7018 /** @type {?} */
7019 ResellerItem.prototype.tagline;
7020 /** @type {?} */
7021 ResellerItem.prototype.headerImage;
7022 /** @type {?} */
7023 ResellerItem.prototype.currency;
7024 /** @type {?} */
7025 ResellerItem.prototype.price;
7026 /** @type {?} */
7027 ResellerItem.prototype.billingFrequency;
7028 /** @type {?} */
7029 ResellerItem.prototype.lmiCategories;
7030 /** @type {?} */
7031 ResellerItem.prototype.enabled;
7032 /** @type {?} */
7033 ResellerItem.prototype.isCustom;
7034 /** @type {?} */
7035 ResellerItem.prototype.orderForm;
7036 /** @type {?} */
7037 ResellerItem.prototype.quantity;
7038 /** @type {?} */
7039 ResellerItem.prototype.allowMultipleActivations;
7040 /** @type {?} */
7041 ResellerItem.prototype.usesCustomizationForm;
7042 /** @type {?} */
7043 ResellerItem.prototype.usesActivationSpecificEntryUrl;
7044 /** @type {?} */
7045 ResellerItem.prototype.entryUrl;
7046 /** @type {?} */
7047 ResellerItem.prototype.restrictions;
7048 /** @type {?} */
7049 ResellerItem.prototype.activationRequiresApproval;
7050 /** @type {?} */
7051 ResellerItem.prototype.billingId;
7052 /** @type {?} */
7053 ResellerItem.prototype.usesEditions;
7054 /** @type {?} */
7055 ResellerItem.prototype.editionIds;
7056 /** @type {?} */
7057 ResellerItem.prototype.suggestedRetailPrice;
7058 /** @type {?} */
7059 ResellerItem.prototype.editionId;
7060 /** @type {?} */
7061 ResellerItem.prototype.trialConfiguration;
7062}
7063
7064/**
7065 * @fileoverview added by tsickle
7066 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7067 */
7068class CheckboxField extends FieldBase {
7069 constructor() {
7070 super(...arguments);
7071 this.controlType = 'checkbox';
7072 }
7073}
7074if (false) {
7075 /** @type {?} */
7076 CheckboxField.prototype.controlType;
7077}
7078
7079/**
7080 * @fileoverview added by tsickle
7081 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7082 */
7083/**
7084 * @record
7085 */
7086function Option() { }
7087if (false) {
7088 /** @type {?} */
7089 Option.prototype.value;
7090 /** @type {?} */
7091 Option.prototype.label;
7092 /** @type {?|undefined} */
7093 Option.prototype.disabled;
7094}
7095/**
7096 * @record
7097 */
7098function DropDownFieldOptions() { }
7099if (false) {
7100 /** @type {?} */
7101 DropDownFieldOptions.prototype.options;
7102 /** @type {?|undefined} */
7103 DropDownFieldOptions.prototype.allowMultiples;
7104 /** @type {?|undefined} */
7105 DropDownFieldOptions.prototype.allowDuplicates;
7106 /** @type {?|undefined} */
7107 DropDownFieldOptions.prototype.maxChoices;
7108}
7109class DropdownField extends FieldBase {
7110 /**
7111 * @param {?} options
7112 */
7113 constructor(options) {
7114 super(options);
7115 this.controlType = 'dropdown';
7116 this.options = [];
7117 if (!!options.options && options.options.length > 0) {
7118 // Because this typeof guard is on the element and not the array as a whole typescript doesn't recognize it as a valid type assertion
7119 // The ts-ignore's are required because of this
7120 if (typeof options.options[0] === 'string') {
7121 if (options.allowMultiples) {
7122 // @ts-ignore
7123 this.options = options.options.map((/**
7124 * @param {?} o
7125 * @return {?}
7126 */
7127 (o) => ({ value: o, name: o })));
7128 }
7129 else {
7130 // @ts-ignore
7131 this.options = options.options.map((/**
7132 * @param {?} o
7133 * @return {?}
7134 */
7135 (o) => ({ value: o, label: o })));
7136 }
7137 }
7138 else {
7139 if (options.allowMultiples) {
7140 // @ts-ignore
7141 this.options = options.options.map((/**
7142 * @param {?} o
7143 * @return {?}
7144 */
7145 (o) => ({ value: o.value, name: o.label })));
7146 }
7147 else {
7148 // @ts-ignore
7149 this.options = options.options;
7150 }
7151 }
7152 }
7153 this.allowMultiples = !!options.allowMultiples;
7154 this.allowDuplicates = !!options.allowDuplicates;
7155 this.maxChoices = options.maxChoices ? options.maxChoices : 1;
7156 this.validator = this.validatorBuilder();
7157 }
7158 /**
7159 * @protected
7160 * @return {?}
7161 */
7162 validatorBuilder() {
7163 /** @type {?} */
7164 const maxChoices = this.maxChoices;
7165 return (/**
7166 * @param {?} control
7167 * @return {?}
7168 */
7169 (control) => {
7170 if (Array.isArray(control.value) && maxChoices && control.value.length > maxChoices) {
7171 return { overMaxChoices: true };
7172 }
7173 });
7174 }
7175}
7176if (false) {
7177 /** @type {?} */
7178 DropdownField.prototype.controlType;
7179 /** @type {?} */
7180 DropdownField.prototype.options;
7181 /** @type {?} */
7182 DropdownField.prototype.allowMultiples;
7183 /** @type {?} */
7184 DropdownField.prototype.allowDuplicates;
7185 /** @type {?} */
7186 DropdownField.prototype.maxChoices;
7187}
7188
7189/**
7190 * @fileoverview added by tsickle
7191 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7192 */
7193/** @type {?} */
7194const DEFAULT_NUM_FILES = 5;
7195/**
7196 * @record
7197 */
7198function FileUploadGroupFieldOptions() { }
7199if (false) {
7200 /** @type {?} */
7201 FileUploadGroupFieldOptions.prototype.fileType;
7202 /** @type {?} */
7203 FileUploadGroupFieldOptions.prototype.uploadUrl;
7204 /** @type {?} */
7205 FileUploadGroupFieldOptions.prototype.numFiles;
7206}
7207class FileUploadGroupField extends FieldBase {
7208 /**
7209 * @param {?} options
7210 */
7211 constructor(options) {
7212 super(options);
7213 this.controlType = 'file';
7214 if (!options.uploadUrl) {
7215 throw new Error('uploadUrl is required.');
7216 }
7217 this.fileType = options.fileType || 'image';
7218 this.numFiles = options.numFiles || DEFAULT_NUM_FILES;
7219 this.uploadUrl = options.uploadUrl;
7220 this.value = [];
7221 }
7222}
7223if (false) {
7224 /** @type {?} */
7225 FileUploadGroupField.prototype.controlType;
7226 /** @type {?} */
7227 FileUploadGroupField.prototype.fileType;
7228 /** @type {?} */
7229 FileUploadGroupField.prototype.uploadUrl;
7230 /** @type {?} */
7231 FileUploadGroupField.prototype.numFiles;
7232}
7233
7234/**
7235 * @fileoverview added by tsickle
7236 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7237 */
7238class TextareaField extends FieldBase {
7239 constructor() {
7240 super(...arguments);
7241 this.controlType = 'textarea';
7242 }
7243}
7244if (false) {
7245 /** @type {?} */
7246 TextareaField.prototype.controlType;
7247}
7248
7249/**
7250 * @fileoverview added by tsickle
7251 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7252 */
7253/**
7254 * @record
7255 */
7256function TextBoxFieldOptions() { }
7257if (false) {
7258 /** @type {?} */
7259 TextBoxFieldOptions.prototype.textboxType;
7260 /** @type {?|undefined} */
7261 TextBoxFieldOptions.prototype.prefix;
7262 /** @type {?|undefined} */
7263 TextBoxFieldOptions.prototype.suffix;
7264 /** @type {?|undefined} */
7265 TextBoxFieldOptions.prototype.displayOnly;
7266}
7267class TextboxField extends FieldBase {
7268 /**
7269 * @param {?} options
7270 */
7271 constructor(options) {
7272 super(options);
7273 this.controlType = 'textbox';
7274 this.textboxType = options.textboxType || 'text';
7275 this.prefix = options.prefix || '';
7276 this.suffix = options.suffix || '';
7277 this.regexValidator = options.regexValidator || '';
7278 this.regexErrorMessage = options.regexErrorMessage || '';
7279 this.displayOnly = options.displayOnly || false;
7280 }
7281}
7282if (false) {
7283 /** @type {?} */
7284 TextboxField.prototype.controlType;
7285 /** @type {?} */
7286 TextboxField.prototype.textboxType;
7287 /** @type {?} */
7288 TextboxField.prototype.prefix;
7289 /** @type {?} */
7290 TextboxField.prototype.suffix;
7291 /** @type {?} */
7292 TextboxField.prototype.regexValidator;
7293 /** @type {?} */
7294 TextboxField.prototype.regexErrorMessage;
7295 /** @type {?} */
7296 TextboxField.prototype.displayOnly;
7297}
7298
7299/**
7300 * @fileoverview added by tsickle
7301 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7302 */
7303/**
7304 * @record
7305 */
7306function User() { }
7307if (false) {
7308 /** @type {?} */
7309 User.prototype.userId;
7310 /** @type {?} */
7311 User.prototype.email;
7312 /** @type {?|undefined} */
7313 User.prototype.firstName;
7314 /** @type {?|undefined} */
7315 User.prototype.lastName;
7316}
7317/**
7318 * @record
7319 */
7320function VBCUserFieldOptions() { }
7321if (false) {
7322 /** @type {?} */
7323 VBCUserFieldOptions.prototype.users;
7324}
7325class VBCUserField extends DropdownField {
7326 /**
7327 * @param {?} options
7328 */
7329 constructor(options) {
7330 super({
7331 id: options.id,
7332 label: options.label,
7333 required: options.required,
7334 description: options.description,
7335 options: getOptions(options.users),
7336 disabled: options.disabled,
7337 forOfficeUseOnly: options.forOfficeUseOnly
7338 });
7339 this.controlType = 'vbcuser';
7340 }
7341}
7342if (false) {
7343 /** @type {?} */
7344 VBCUserField.prototype.controlType;
7345}
7346/**
7347 * @param {?} vbcUsers
7348 * @return {?}
7349 */
7350function getOptions(vbcUsers) {
7351 if (vbcUsers && vbcUsers.length > 0) {
7352 vbcUsers.sort(compareUsersByEmail);
7353 return vbcUsers.map((/**
7354 * @param {?} user
7355 * @return {?}
7356 */
7357 user => {
7358 /** @type {?} */
7359 const labelString = createLabelString(user.firstName, user.lastName, user.email);
7360 if (user.userId && user.email && user.firstName && user.lastName) {
7361 return {
7362 label: labelString,
7363 value: JSON.stringify({ firstName: user.firstName, lastName: user.lastName, email: user.email, id: user.userId })
7364 };
7365 }
7366 return { label: labelString, value: '', disabled: true };
7367 }));
7368 }
7369 return [{ label: 'No Users — Please add one to this account', value: '', disabled: true }];
7370}
7371/**
7372 * @param {?} a
7373 * @param {?} b
7374 * @return {?}
7375 */
7376function compareUsersByEmail(a, b) {
7377 if (a == null) {
7378 return -1;
7379 }
7380 if (b == null) {
7381 return 1;
7382 }
7383 return a.email.localeCompare(b.email);
7384}
7385/**
7386 * @param {?} firstName
7387 * @param {?} lastName
7388 * @param {?} email
7389 * @return {?}
7390 */
7391function createLabelString(firstName, lastName, email) {
7392 /** @type {?} */
7393 let returnString = '';
7394 returnString += firstName ? firstName + ' ' : '';
7395 returnString += lastName ? lastName + ' ' : '';
7396 returnString += email ? `(${email})` : '';
7397 return returnString;
7398}
7399
7400/**
7401 * @fileoverview added by tsickle
7402 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7403 */
7404
7405/**
7406 * @fileoverview added by tsickle
7407 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7408 */
7409
7410/**
7411 * @fileoverview added by tsickle
7412 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7413 */
7414
7415/**
7416 * @fileoverview added by tsickle
7417 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7418 */
7419
7420export { ActivationStatus, AddonDetailsComponent, AddonDropDownFormSectionData, AddonModule, BUSINESS_USER, CHECK_BOX, CONTACT_SALES, CardListStencilComponent, CardStencilComponent, CaseTransform, CheckboxField, DROP_DOWN, DetailsStencilComponent, DropDownFormSectionComponent, DropDownFormSectionData, DropdownField, FILES, FORM_FIELDS, FieldBase, FieldBuilderComponent, FieldComponent, FieldService, File, FileUploadGroupField, HeimdallServiceToken, LMI_CATEGORIES, LMI_CATEGORIES_BY_NAME, LMI_CATEGORY_MAP, ListStencilComponent, OrderFormComponent, OrderFormSectionComponent, OrderFormSectionData, Package, PackageDetails, Product, ProductOrderFormSectionData, ProductWithParent, ProductsNavV2Component, ResellerItem, RestrictionsModule, STOREFRONT_FILTER_NAME, SearchBarStencilComponent, StencilsModule, StoreCardComponent, StoreCardModule, StoreComponent, StoreModule, StoreService, StorefrontComponent, TEXT_AREA, TEXT_BOX, TextareaField, TextboxField, VBCUserField, VaAddonListComponent, VaAddonListModule, VaFaqsComponent, VaFaqsModule, VaFilesComponent, VaFilesModule, VaHeaderContainerComponent, VaHeaderContainerModule, VaOrderFormModule, VaPackageDetailsComponent, VaPackageDetailsModule, VaPackageDetailsV2Component, VaPackageDetailsV2Module, VaPackageDropdownComponent, VaPackageDropdownModule, VaPricingComponent, VaPricingModule, VaProductDetailsComponent, VaProductDetailsModule, VaProductsNavComponent, VaProductsNavModule, VaSalespersonDetailsComponent, VaSalespersonDetailsModule, VaSellingInfoComponent, VaSellingInfoModule, combineProductOrderWithContainedProducts, convertToPackageDetails, getUniqueProductAddonId, orderProductsAndAddons, HeimdallClient as ɵb, HeimdallClientModule as ɵc, HighlightPricingComponent as ɵd, TablePricingComponent as ɵe, OrderItemListComponent as ɵf, PricePipe as ɵg, FormatBillingFrequencyPipe as ɵh, OrderFormService as ɵi, OrderItemListService as ɵj, SupportedCountriesComponent as ɵk, VaPackageDetailsV2Component as ɵl, Sellable as ɵm, VaPackageDropdownItemComponent as ɵn };
7421//# sourceMappingURL=vendasta-store.js.map