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OH,GAAUpJ,KAAKE,KAC9B,MAAO,CAACkJ,EAAOC,GAAaG,SAASD,GAAQA,EAAOH,CACxD,CAEA,WAAIK,GACA,MAAO,WACH,MAAMA,QAAgBzJ,KAAKE,KAAKuJ,QAEhC,OAAOA,QAAAA,EAAW,EACrB,EAJM,EAKX,CAKA,WAAIC,GACA,OAAO1J,KAAKuJ,OAASH,CACzB,CAKA,iBAAIO,GACA,OAAO3J,KAAKuJ,OAASF,CACzB,GACH,EA/BAT,EAAAA,EAAAA,GAAS,CAAEC,OAAQ,qBAAsBC,KAAM,kBACTjK,EAAAA,EAAAA,sBAAAR,EAAlBiL,E","sources":["src/components/page-view/details.hbs","src/components/page-view/details.ts","src/components/simple-binary/async-toggle.hbs","src/components/simple-binary/async-toggle.ts","src/components/ticked-slider.hbs","src/components/ticked-slider.js","src/helpers/handle-number-change.ts","src/components/action-sheets/address-verification.hbs","src/components/action-sheets/address-verification.ts","src/components/adc-banner.hbs","src/components/adc-banner.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n <:default as |PageViewContainer api|>\\n \\n <:loading as |PageViewLoading|>\\n \\n \\n\\n <:default as |data|>\\n {{yield data api}}\\n\\n {{#if @deleteModel}}\\n \\n {{/if}}\\n \\n\\n <:error as |PageViewError|>\\n \\n \\n \\n \\n\")","import Component from '@glimmer/component';\n\nimport type { PageViewSignature } from '../page-view';\nimport type { PageViewContainerSignature } from '../page-view/container';\nimport type { PageViewDeleteSignature } from './delete';\n\ninterface PageViewDetailsSignature {\n Element: PageViewSignature['Element'];\n Args: Pick['Args'], 'model' | 'dataLoaded'> & {\n /** Information about the delete operation. */\n deleteModel?: PageViewDeleteSignature['Args']['model'];\n /** Optional CSS class applied to the `` component. */\n cssContainer?: string;\n };\n Blocks: {\n default: [PageViewContainerSignature['Blocks']['default'][0], PageViewSignature['Blocks']['default'][1]];\n };\n}\n\n// eslint-disable-next-line ember/no-empty-glimmer-component-classes\nexport default class PageViewDetails extends Component> {}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n \\n\\n \\n\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { A } from '@ember/array';\nimport { equal } from '@ember/object/computed';\nimport { timeout, task } from 'ember-concurrency';\n\nimport type { Task } from 'ember-concurrency';\nimport type { SimpleBinarySignature } from '../simple-binary';\n\ntype AsyncState = 'idle' | 'pending' | 'success' | 'failure';\n\nexport interface AsyncToggleSignature {\n Element: SimpleBinarySignature['Element'];\n Args: Pick<\n SimpleBinarySignature['Args'],\n 'checked' | 'errorMessage' | 'errorDuration' | 'errorTooltipPlace' | 'icon' | 'label' | 'css'\n > & {\n /** Triggered when the async state is \"pending\". */\n onChange: (state: boolean) => Promise;\n };\n}\n\nexport default class AsyncToggle extends Component {\n @tracked state: AsyncState = 'idle';\n\n get css(): string {\n const { state } = this;\n\n return A(['async-toggle', `async-${state}`, state === 'failure' ? 'has-error' : undefined, this.args.css])\n .compact()\n .join(' ');\n }\n\n @equal('state', 'pending')\n declare isPending: boolean;\n\n animateState: Task = task(\n { drop: true },\n async (evt: MouseEvent & { target: HTMLInputElement }) => {\n evt.preventDefault();\n\n this.state = 'idle';\n\n try {\n this.state = 'pending';\n await this.args.onChange(!!evt.target.checked);\n this.state = 'success';\n } catch {\n this.state = 'failure';\n } finally {\n await timeout(this.state === 'success' ? 700 : 3000);\n\n this.state = 'idle';\n }\n }\n );\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n \\n
\\n {{#each this.ticks as |tick|}}\\n
\\n {{#if tick.text}}\\n \\n {{/if}}\\n
\\n {{/each}}\\n
\\n\\n
\\n {{#each this.ticks as |tick|}}\\n
\\n {{/each}}\\n
\\n \\n\")","import { action, get, set } from '@ember/object';\nimport { once } from '@ember/runloop';\nimport { VALUE_CHANGE_ACTION } from './common/base-input.js';\nimport { default as BaseSlider } from './slider/base-slider.js';\n\n/**\n * Stores array of tick objects.\n *\n * @param {number} currentValue Current value of slider. By default this will be the currently set value property. This may also be the current non-set value during sliding the slider.\n */\nfunction updateTicks(currentValue = this.value) {\n // Create an array of size max value minus min value (with null at each index).\n const ticks = Array.apply(null, Array(this.maxValue - this.minValue + 1))\n // For each array item, create a tick using the index.\n .map((_, n) => getTick.call(this, n + this.minValue, currentValue));\n\n set(this, 'ticks', ticks);\n}\n\n/**\n * Get Tick based on given tick index.\n *\n * @param {number} index Index inclusively between min and max values.\n * @param {number} currentValue Current value of slider. This could be the set one by default or the current one during sliding the slider.\n *\n * @return {Tick}\n */\nfunction getTick(index, currentValue) {\n const tickTexts = {\n [this.minValue]: this.minTickText,\n [this.maxValue]: this.maxTickText,\n [this.suggestedTick]: this.suggestedTickText\n };\n\n return {\n // We need the index so that handlebar doesn't take any shortcuts rendering.\n // Without this, the ticks will be selected out of order during value changes.\n index,\n // Selected tick is to the left of slider marker.\n cssClass: index <= currentValue ? 'selected' : '',\n // Get text (if any) that goes above the tick.\n text: tickTexts[index]\n };\n}\n\n/**\n * @classdesc A slider control that has tick markers for each slider option.\n */\nexport default class TickedSlider extends BaseSlider {\n /**\n * Text that will appear on left most tick.\n *\n * @type {String}\n */\n minTickText;\n\n /**\n * Text that will appear on right most tick.\n *\n * @type {String}\n */\n maxTickText;\n\n /**\n * Suggested tick index.\n *\n * @type {number}\n */\n suggestedTick;\n\n /**\n * Suggested tick's text.\n *\n * @type {String}\n */\n suggestedTickText;\n\n /**\n * Update ticks every time any of the tick-related values change.\n */\n @action valueChangeObserver() {\n // Do not copy this deprecated usage. If you see this, please fix it\n // eslint-disable-next-line ember/no-runloop\n once(this, updateTicks);\n }\n\n /**\n * Updates slider and reverts value if request fails.\n *\n * @param {number} newTickValue - The new value of the slider.\n * @param {boolean} [isFromSlider=true] - Was the change made by the slider?\n * @param {boolean} [isMouseUp=true] - Is the mouse currently in the release position?\n */\n @action sliderChanged(newTickValue, isFromSlider = true, isMouseUp = true) {\n // Was a new tick value given?\n if (newTickValue !== undefined) {\n const numberOfTicks = this.ticks?.length - 1;\n\n // If the mouse event is done and it's from the slider.\n if (isMouseUp && isFromSlider) {\n // Round to the nearest tick's percentage.\n set(this, 'sliderPercentage', (newTickValue / numberOfTicks) * 100);\n }\n\n // Only update the ticks if this is from the slider.\n if (isFromSlider) {\n updateTicks.call(this, (this.sliderPercentage * numberOfTicks) / 100);\n }\n }\n\n // Was the value-change action defined in the handlebars?\n if (get(this, VALUE_CHANGE_ACTION)) {\n // Send back the new value, along with a boolean indicating if the value was changed using the slider element.\n get(this, VALUE_CHANGE_ACTION)(newTickValue, isFromSlider, isMouseUp);\n }\n }\n}\n\n/**\n * The definition of a Tick.\n *\n * @typedef {{\n * index: number,\n * cssClass: string,\n * text: String,\n * textStyle: string\n * }} Tick\n *\n * @property {number} index Index of tick that is between min and max values.\n * @property {String} cssStyle CSS class name for tick.\n * @property {String} text Text that will be displayed above the tick.\n * @property {String} textStyle In-line styling for text positioning.\n *\n * @components.TickedSlider\n * @private\n */\n","import { set } from '@ember/object';\n\ntype EventToHandle = Event & { target: HTMLInputElement };\n\nexport default function handleNumberChange(context: T, name: keyof T): (evt: EventToHandle) => void {\n return (evt: EventToHandle): void => {\n set(context, name, Number(evt.target.value) as any);\n };\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n \\n <:default>\\n

{{tc this \\\"instructions\\\"}}

\\n \\n <:label as |item|>\\n {{item.label}}\\n \\n <:content as |item|>\\n
\\n {{item.props.street1}}
\\n {{#if item.props.street2}}\\n {{item.props.street2}}
\\n {{/if}}\\n {{item.props.city}},\\n {{item.props.state}}\\n {{item.props.zip}}\\n {{item.props.country}}\\n
\\n \\n \\n \\n \\n\")","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { POST } from '@adc/ajax/services/adc-ajax';\nimport { intlPath } from '@adc/i18n/path';\nimport { BinaryListItem } from '../simple-binary/list.ts';\n\nimport type AdcAjaxService from '@adc/ajax/services/adc-ajax';\nimport type ADCIntlService from '@adc/i18n/services/adc-intl';\n\n// #region Types\n\nclass BaseAddress {\n street1: string;\n street2: string;\n subCity: string;\n city: string;\n state: string;\n subState: string;\n zip: string;\n\n protected constructor(props: Partial) {\n this.city = props.city ?? '';\n this.state = props.state ?? '';\n this.street1 = props.street1 ?? '';\n this.street2 = props.street2 ?? '';\n this.subCity = props.subCity ?? '';\n this.subState = props.subState ?? '';\n this.zip = props.zip ?? '';\n }\n}\n\n// This matches the Address class within ABO and is what the API expects.\nexport class Address extends BaseAddress {\n countryId: number;\n\n constructor(props: Partial
) {\n super(props);\n this.countryId = props.countryId ?? 1;\n }\n\n /**\n * Are all the required fields filled out for the address to be considered complete?\n */\n isComplete(): boolean {\n return !!(this.street1 && this.city && this.state && this.zip);\n }\n}\n\nexport type ValidatedAddress = BaseAddress & {\n countryCode: string;\n // We consider an address to be valid if the result code contains either AV24 or AV25.\n addressIsValid: boolean;\n // Whether the API call was processed successfully.\n checkedSuccessfully: boolean;\n};\n\nexport type ValidatedAddressApiResponse = {\n validatedAddress: ValidatedAddress;\n isValidatedAddressDifferent: boolean;\n countryDisplay: string;\n};\n\n/**\n * The props that are passed to the BinaryListItem component.\n */\ntype AddressVerificationItemProps = Pick & {\n country: string;\n};\n\n/**\n * The selected address in the action sheet.\n */\nenum SelectedAddress {\n None = -1,\n Original,\n Validated\n}\n\nexport type AddressVerificationSignature = {\n Args: {\n /** The response from the API that contains the validated address. */\n validatedAddressResponse?: ValidatedAddressApiResponse;\n /** The address that was entered by the user. */\n address?: Address;\n /** Function that is called once an address is chosen from the Action Sheet and the submit button is pressed. */\n onSubmit: (validatedAddress?: ValidatedAddress) => Promise;\n /** Function that is called when the action sheet is closed without the confirm button being pressed. */\n onClose?: VoidFunction;\n };\n Element: HTMLDivElement;\n};\n\n// #endregion\n\n// #region Exported Functions\n\n/**\n * Fetches the validated address from the API using the provided address.\n */\nexport async function fetchValidatedAddress(\n address: Address,\n ajax: AdcAjaxService\n): Promise {\n const response = await ajax.apiRequest<{ value: ValidatedAddressApiResponse }>(\n 'accountManagement/validateAddress',\n undefined,\n { ...address },\n POST\n );\n return response.value;\n}\n\n// #endregion\n\n@intlPath({ module: '@adc/ui-components', path: 'address-verification' })\nexport default class AddressVerification extends Component {\n @service declare ajax: AdcAjaxService;\n @service declare intl: ADCIntlService;\n\n // #region Properties\n\n @tracked isAddressSuggestionActionSheetOpen = false;\n @tracked selectedRadioItem: SelectedAddress = SelectedAddress.None;\n\n get addressSuggestionList(): BinaryListItem[] {\n const { address, validatedAddressResponse } = this.args;\n if (!validatedAddressResponse || !address) {\n return [];\n }\n\n return [address, validatedAddressResponse.validatedAddress].map(\n (data, idx) =>\n new BinaryListItem({\n label: this.intl.tc(this, idx === SelectedAddress.Original ? 'original' : 'recommended'),\n state: idx === this.selectedRadioItem,\n props: {\n street1: data.street1,\n street2: data.street2,\n city: data.city,\n state: data.state,\n zip: data.zip,\n country: validatedAddressResponse.countryDisplay\n }\n })\n );\n }\n\n // #endregion\n\n // #region Actions\n\n @action async onValidatedAddressResponseChange(): Promise {\n const { validatedAddressResponse } = this.args;\n if (!validatedAddressResponse) {\n this.isAddressSuggestionActionSheetOpen = false;\n return;\n }\n\n if (!this.args.address?.isComplete()) {\n this.handleActionSheetSubmit(true);\n return;\n }\n\n if (\n validatedAddressResponse?.isValidatedAddressDifferent &&\n validatedAddressResponse?.validatedAddress.checkedSuccessfully\n ) {\n this.selectedRadioItem = SelectedAddress.Validated;\n this.isAddressSuggestionActionSheetOpen = true;\n } else {\n this.handleActionSheetSubmit(true);\n }\n }\n\n /**\n * Is called when the address selected in the action sheet changes.\n */\n @action selectedAddressChange(items: BinaryListItem[]): void {\n items.find((item, idx) => {\n if (item.state) {\n this.selectedRadioItem = idx;\n return true;\n }\n return false;\n });\n }\n\n /**\n * Is called when the user selects the suggested address from the action sheet\n * to save.\n */\n @action async handleActionSheetSubmit(forceQuit = false): Promise {\n try {\n await this.args.onSubmit(\n !forceQuit && this.selectedRadioItem === SelectedAddress.Validated\n ? this.args.validatedAddressResponse?.validatedAddress\n : undefined\n );\n } finally {\n this.isAddressSuggestionActionSheetOpen = false;\n }\n }\n\n @action close(): void {\n this.isAddressSuggestionActionSheetOpen = false;\n this.args?.onClose?.();\n }\n\n // #endregion\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{#if this.isInformative}}\\n {{#if @icon}}\\n \\n {{/if}}\\n {{/if}}\\n\\n \\n \\n {{message}}\\n \\n \\n\\n {{#if (and this.isIssue @optionText @on-option-click)}}\\n \\n \\n \\n {{/if}}\\n
\")","import Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { intlPath } from '@adc/i18n/path';\n\nimport type { SvgSymbolSignature } from '@adc/svg-system/components/svg-symbol';\n\nexport const ISSUE = 'issue';\nexport const INFORMATIVE = 'informative';\n\nexport interface AdcBannerSignature {\n Element: HTMLDivElement;\n Args: {\n /** The text to appear within the banner. */\n message: string | Promise;\n /** The banner type (defaults to `issue`) */\n type?: typeof ISSUE | typeof INFORMATIVE;\n /** Optional icon to appear in banner. */\n icon?: string;\n /** Optional title for icon. */\n iconTitle?: string;\n /** Optional fill color for icon. */\n iconColor?: SvgSymbolSignature['Args']['fillColor'];\n /** Text to be rendered inside the banner option button. */\n optionText?: string;\n /** Triggered when the user interacts with the banner option button. */\n 'on-option-click'?: VoidFunction;\n };\n}\n\n/**\n * @classdesc\n * Component designed to show status related information with an optional action button.\n */\n@intlPath({ module: '@adc/ui-components', path: 'adc-banner' })\nexport default class AdcBannerComponent extends Component {\n /**\n * The type of the banner. Affects the styling and the composition of the component.\n */\n get type(): string {\n const { type = ISSUE } = this.args;\n return [ISSUE, INFORMATIVE].includes(type) ? type : ISSUE;\n }\n\n get message(): Promise {\n return (async () => {\n const message = await this.args.message;\n assert('[@adc/ui-components] A message needs to be provided for the to make sense.', message);\n return message ?? '';\n })();\n }\n\n /**\n * Is this an Issue banner?\n */\n get isIssue(): boolean {\n return this.type === ISSUE;\n }\n\n /**\n * Is this an Informative banner?\n */\n get isInformative(): boolean {\n return this.type === INFORMATIVE;\n }\n}\n"],"names":["TEMPLATE","createTemplateFactory","scope","pageView_","coalesce_","routeViewContentDeleteModel_","PageViewDetails","Component","setComponentTemplate","simpleBinary_","on","simpleBinaryLabel_","spinnerSvg_","_state","WeakMap","_isPending","AsyncToggle","constructor","arguments","_classPrivateFieldInitSpec","i","_defineProperty","buildTask","context","generator","evt","preventDefault","this","state","args","onChange","target","checked","_unused","timeout","drop","css","A","concat","undefined","compact","join","_AsyncToggle","g","prototype","tracked","equal","didInsert_","didUpdate_","sliderAdc_","updateTicks","currentValue","length","value","ticks","Array","apply","maxValue","minValue","map","_","n","getTick","call","set","index","cssClass","text","minTickText","maxTickText","suggestedTick","suggestedTickText","TickedSlider","BaseSlider","valueChangeObserver","once","sliderChanged","newTickValue","isFromSlider","isMouseUp","_this$ticks","numberOfTicks","sliderPercentage","get","VALUE_CHANGE_ACTION","_TickedSlider","action","handleNumberChange","name","Number","actionSheet_","tc_","array","hash","t_","fn","tc_0","simpleBinaryList_","BaseAddress","props","_props$city","_props$state","_props$street","_props$street2","_props$subCity","_props$subState","_props$zip","city","street1","street2","subCity","subState","zip","Address","_props$countryId","super","countryId","isComplete","SelectedAddress","async","fetchValidatedAddress","address","ajax","response","apiRequest","_objectSpread","POST","AddressVerification","c","_ajax","_intl","_isAddressSuggestionActionSheetOpen","_selectedRadioItem","_AddressVerification","addressSuggestionList","validatedAddressResponse","validatedAddress","data","idx","BinaryListItem","label","intl","tc","Original","selectedRadioItem","country","countryDisplay","onValidatedAddressResponseChange","_this$args$address","isValidatedAddressDifferent","checkedSuccessfully","Validated","isAddressSuggestionActionSheetOpen","handleActionSheetSubmit","selectedAddressChange","items","find","item","forceQuit","_this$args$validatedA","onSubmit","close","_this$args","_this$args$onClose","onClose","inject","None","intlPath","module","path","svgSymbol_","asyncLoader_","and_","buttonAsync_","noop_","ISSUE","INFORMATIVE","AdcBannerComponent","type","includes","message","isIssue","isInformative"],"sourceRoot":""}