\n ) {}\n\n public get trip_name(): FormControl {\n return this.tripForm.controls.trip_name\n }\n\n public updateOrder(): void {\n this.startOrder.close({ trip_name: this.trip_name.value })\n }\n}\n","\n
\n
\n \n Get Started. \n Give this trip a friendly name.\n \n \n \n
\n","\n\t\n\t\n\t\t
\n\t\t\t{{ order.source.label }}\n\t\t
\n\t\t
\n\t\t\t
{{ order.label }} \n\t\t\n\t\t
\n\t\t\t
\n\t\t\t\tPlaced on: {{ order.created_at | date: 'MMMM d, y' }}\n\t\t\t
\n\t\t\t
\n\t\t\t\tOrder Number: {{ order.order_number }}\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\tStart Order\n\t\t \n\t\t
\n\t\t\t\n\t\t\t\tContinue Order \n\t\t\t\tCanceled \n\t\t\t \n\t\t \n\t
\n \n","import { Component, OnInit } from '@angular/core'\nimport { MatDialog } from '@angular/material/dialog'\nimport { Router } from '@angular/router'\nimport { StartOrderComponent } from 'src/app/dialogs/start.order/start.order.component'\nimport { OrderService } from 'src/app/services/order.service'\nimport { Order } from 'src/types/order'\n\n@Component({\n selector: 'gwc-orders',\n templateUrl: './orders.component.html',\n styleUrls: ['./orders.component.scss']\n})\n\nexport class OrdersComponent implements OnInit {\n public orders: Order[] = []\n\n constructor(\n private router: Router,\n private orderService: OrderService,\n private matDialog: MatDialog\n ) { }\n\n ngOnInit(): void {\n this.getOrders()\n }\n\n private getOrders(): void {\n this.orderService.getOrders()\n .subscribe((response: Order[]) => {\n this.orders = response\n })\n }\n\n public startOrder(uuid: string): void {\n const dialog = this.matDialog.open(StartOrderComponent, {\n data: { trip_name: '' },\n ariaLabel: 'Start Order Dialog'\n })\n \n dialog.afterClosed().subscribe(result => {\n if (result) {\n let data: any = {}\n\n if (result.trip_name) {\n data.label = result.trip_name\n }\n \n this.orderService.updateOrder(uuid, data)\n .subscribe(response => {\n this.router.navigate(['/order', uuid])\n })\n }\n })\n }\n}\n","import { DatePipe } from '@angular/common'\nimport { Component, Input } from '@angular/core'\nimport { MatButtonModule } from '@angular/material/button'\nimport { Profile } from 'src/types/user'\n\n@Component({\n selector: 'gwc-profile-card',\n standalone: true,\n imports: [\n MatButtonModule,\n DatePipe\n ],\n templateUrl: './card-profile.component.html',\n styleUrl: './card-profile.component.scss'\n})\n\nexport class CardProfileComponent {\n @Input({ required: true }) profile!: Profile\n}","\n
\n
\n {{ profile.first_name}} {{ profile.last_name }}\n \n
Birthday: {{ profile.date_of_birth | date }}
\n \n \n
\n View Details\n \n
","\n\t\n \n @for (profile of profiles; track profile) {\n \n }\n
\n ","import { NgModule } from '@angular/core'\nimport { RouterModule, Routes } from '@angular/router'\nimport { HomeComponent } from './home.component'\nimport { InboxComponent } from './inbox/inbox.component'\nimport { MessageComponent } from './message/message.component'\nimport { OrdersComponent } from './orders/orders.component'\nimport { ProfilesComponent } from './profiles/profiles.component'\n\nconst homeRoutes: Routes = [\n {\n path: '',\n component: HomeComponent,\n children: [\n {\n path: 'orders',\n component: OrdersComponent\n },\n {\n path: 'profiles',\n component: ProfilesComponent\n },\n {\n path: 'inbox',\n component: InboxComponent\n },\n {\n path: 'inbox/:message_uuid',\n component: MessageComponent\n },\n {\n path: '',\n redirectTo: '/orders',\n pathMatch: 'full'\n }\n ]\n }\n]\n\n@NgModule({\n imports: [RouterModule.forChild(homeRoutes)],\n exports: [RouterModule]\n})\n\nexport class HomeRoutingModule { }\n","import { Component, OnInit } from '@angular/core'\nimport { ProfileService } from 'src/app/services/profile.service'\nimport { CardProfileComponent } from './card/card-profile.component'\nimport { Profile } from 'src/types/user'\n\n@Component({\n selector: 'gwc-profiles',\n standalone: true,\n imports: [\n CardProfileComponent\n ],\n templateUrl: './profiles.component.html',\n styleUrl: './profiles.component.scss'\n})\n\nexport class ProfilesComponent implements OnInit {\n public profiles!: Profile[]\n\n constructor(\n private profileService: ProfileService\n ) {}\n\n ngOnInit(): void {\n this.getProfiles()\n }\n\n private getProfiles(): void {\n this.profileService.getProfiles().subscribe({\n next: (response: Profile[]) => {\n this.profiles = response\n },\n error: () => {\n this.profiles = []\n }\n })\n }\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { LayoutComponent } from './layout.component'\nimport { RouterModule } from '@angular/router'\nimport { MatIconModule } from '@angular/material/icon'\nimport { MatSidenavModule } from '@angular/material/sidenav'\nimport { MatToolbarModule } from '@angular/material/toolbar'\nimport { MatListModule } from '@angular/material/list'\nimport { MatMenuModule } from '@angular/material/menu'\n\n@NgModule({\n declarations: [\n LayoutComponent\n ],\n imports: [\n CommonModule,\n RouterModule,\n MatIconModule,\n MatListModule,\n MatMenuModule,\n MatSidenavModule,\n MatToolbarModule\n ],\n exports: [\n LayoutComponent\n ]\n})\n\nexport class LayoutModule { }\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { HomeRoutingModule } from './home-routing.module'\nimport { HomeComponent } from './home.component'\nimport { LayoutModule } from 'src/app/components/layout/layout.module'\nimport { OrdersComponent } from './orders/orders.component'\nimport { InboxComponent } from './inbox/inbox.component'\nimport { MessageComponent } from './message/message.component'\nimport { MatButtonModule } from '@angular/material/button'\nimport { StartOrderComponent } from 'src/app/dialogs/start.order/start.order.component'\n\n@NgModule({\n declarations: [\n HomeComponent,\n OrdersComponent,\n InboxComponent,\n MessageComponent\n ],\n imports: [\n CommonModule,\n HomeRoutingModule,\n LayoutModule,\n MatButtonModule,\n StartOrderComponent\n ]\n})\n\nexport class HomeModule { }\n","\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t{{ invoice.created_at | date:'MM/dd/yyyy' }} Invoice\n\t\t\t \n\t\t\t
\n\t\t\t\t{{ invoice.status }}\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t{{ item.details.friendly_name ? item.details.friendly_name : item.details.option ? item.details.option.label : item.details.label }}\n\t\t\t
\n\t\t\t
\n\t\t\t\t{{ item.amount/100 | currency }}\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t{{ discount.description }}\n\t\t\t
\n\t\t\t
\n\t\t\t\t{{ discount.amount/100 | currency }}\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\tAmount Paid \n\t\t\t
\n\t\t\t
\n\t\t\t\t{{ invoice.amount/100 | currency }}\n\t\t\t
\n\t\t
\n\t
\n \n","import { Component, OnInit } from '@angular/core'\nimport { ActivatedRoute } from '@angular/router'\nimport { OrderService } from 'src/app/services/order.service'\nimport { Invoice } from 'src/types/order'\n\n@Component({\n selector: 'gwc-invoices',\n templateUrl: './invoices.component.html',\n styleUrls: ['./invoices.component.scss']\n})\n\nexport class InvoicesComponent implements OnInit {\n public invoices!: Invoice[]\n public order_uuid!: string\n\n constructor(\n private activatedRoute: ActivatedRoute,\n private orderService: OrderService\n ) {\n if (this.activatedRoute.parent) {\n this.order_uuid = this.activatedRoute.parent.snapshot.paramMap.get('order_uuid') || ''\n }\n }\n\n ngOnInit(): void {\n this.orderService.getOrderDetails(this.order_uuid, 'invoices')\n .subscribe(response => {\n this.invoices = response\n })\n }\n\n}\n","import { Component, OnInit } from '@angular/core'\nimport { ActivatedRoute } from '@angular/router'\nimport { OrderService } from 'src/app/services/order.service'\nimport { OrderSummary, Itinerary } from 'src/types/order'\n\n@Component({\n selector: 'gwc-order',\n templateUrl: './order.component.html',\n styleUrls: ['./order.component.scss']\n})\n\nexport class OrderComponent implements OnInit {\n public uuid!: string\n public order!: OrderSummary\n public itinerary!: Itinerary\n public phone: string | undefined\n\n constructor(\n private activatedRoute: ActivatedRoute,\n private orderService: OrderService\n ) {\n this.uuid = this.activatedRoute.snapshot.params['order_uuid']\n }\n\n ngOnInit(): void {\n this.getSummary()\n }\n\n private getSummary(): void {\n this.orderService.getOrderDetails(this.uuid, 'summary')\n .subscribe(response => {\n this.order = response\n this.phone = this.order && this.order.source !== 'idp' ? this.order.phone_number : undefined\n })\n }\n}\n","\n\t\n\t\t \n\t
\n \n","import { FieldTypeConfig, FormlyFieldConfig } from \"@ngx-formly/core\"\n\nexport const profile = [ \n\t{\n\t\t\"props\": {\n\t\t\t\"uuid\": \"jfbnlfkjdb\"\n\t\t},\n\t\t\"type\": \"stepper\",\n\t\t\"fieldGroup\": [\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-personal\", \n\t\t\t\t\t\"id\": \"personal_information\", \n\t\t\t\t\t\"label\": \"What is your full name?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [ \n\t\t\t\t\t{ \n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"first_name\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"First Name\",\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\"maxLength\": 35\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"middle_name\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": false, \n\t\t\t\t\t\t\t\t\t\"label\": \"Middle Name\",\n\t\t\t\t\t\t\t\t\t\"maxLength\": 35,\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"last_name\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\"maxLength\": 35,\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-place-of-birth\",\n\t\t\t\t\t\"id\": \"place_of_birth\",\n\t\t\t\t\t\"label\": \"Where were you born?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"select\",\n\t\t\t\t\t\t\t\t\"key\": \"birth_country\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Country\",\n\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AF\",\"label\":\"Afghanistan\"},{\"value\":\"AL\",\"label\":\"Albania\"},{\"value\":\"DZ\",\"label\":\"Algeria\"},{\"value\":\"AD\",\"label\":\"Andorra\"},{\"value\":\"AO\",\"label\":\"Angola\"},{\"value\":\"AI\",\"label\":\"Anguilla\"},{\"value\":\"AG\",\"label\":\"Antigua and Barbuda\"},{\"value\":\"AR\",\"label\":\"Argentina\"},{\"value\":\"AM\",\"label\":\"Armenia\"},{\"value\":\"AW\",\"label\":\"Aruba\"},{\"value\":\"AU\",\"label\":\"Australia\"},{\"value\":\"AT\",\"label\":\"Austria\"},{\"value\":\"AZ\",\"label\":\"Azerbaijan\"},{\"value\":\"BS\",\"label\":\"Bahamas\"},{\"value\":\"BH\",\"label\":\"Bahrain\"},{\"value\":\"BD\",\"label\":\"Bangladesh\"},{\"value\":\"BB\",\"label\":\"Barbados\"},{\"value\":\"BY\",\"label\":\"Belarus\"},{\"value\":\"BE\",\"label\":\"Belgium\"},{\"value\":\"BZ\",\"label\":\"Belize\"},{\"value\":\"BJ\",\"label\":\"Benin\"},{\"value\":\"BM\",\"label\":\"Bermuda\"},{\"value\":\"BT\",\"label\":\"Bhutan\"},{\"value\":\"BO\",\"label\":\"Bolivia\"},{\"value\":\"BA\",\"label\":\"Bosnia Herzegovina\"},{\"value\":\"BW\",\"label\":\"Botswana\"},{\"value\":\"BR\",\"label\":\"Brazil\"},{\"value\":\"BN\",\"label\":\"Brunei\"},{\"value\":\"BG\",\"label\":\"Bulgaria\"},{\"value\":\"BF\",\"label\":\"Burkina Faso\"},{\"value\":\"BI\",\"label\":\"Burundi\"},{\"value\":\"KH\",\"label\":\"Cambodia\"},{\"value\":\"CM\",\"label\":\"Cameroon\"},{\"value\":\"CA\",\"label\":\"Canada\"},{\"value\":\"CV\",\"label\":\"Cape Verde\"},{\"value\":\"KY\",\"label\":\"Cayman Islands\"},{\"value\":\"CF\",\"label\":\"Central African Republic\"},{\"value\":\"TD\",\"label\":\"Chad\"},{\"value\":\"CL\",\"label\":\"Chile\"},{\"value\":\"CN\",\"label\":\"China\"},{\"value\":\"CO\",\"label\":\"Colombia\"},{\"value\":\"KM\",\"label\":\"Comores Islands\"},{\"value\":\"CG\",\"label\":\"Congo[Brazzaville]\"},{\"value\":\"CD\",\"label\":\"Congo[Kinshasa]\"},{\"value\":\"CK\",\"label\":\"Cook Islands\"},{\"value\":\"CR\",\"label\":\"Costa Rica\"},{\"value\":\"CI\",\"label\":\"Cote dIvoire\"},{\"value\":\"HR\",\"label\":\"Croatia\"},{\"value\":\"CU\",\"label\":\"Cuba\"},{\"value\":\"CY\",\"label\":\"Cyprus\"},{\"value\":\"CZ\",\"label\":\"Czech Republic\"},{\"value\":\"DK\",\"label\":\"Denmark\"},{\"value\":\"DJ\",\"label\":\"Djibouti\"},{\"value\":\"DM\",\"label\":\"Dominica\"},{\"value\":\"DO\",\"label\":\"Dominican Republic\"},{\"value\":\"SZ\",\"label\":\"Eswatini [Swaziland]\"},{\"value\":\"EC\",\"label\":\"Ecuador\"},{\"value\":\"EG\",\"label\":\"Egypt\"},{\"value\":\"SV\",\"label\":\"El Salvador\"},{\"value\":\"GQ\",\"label\":\"Equatorial Guinea\"},{\"value\":\"ER\",\"label\":\"Eritrea\"},{\"value\":\"EE\",\"label\":\"Estonia\"},{\"value\":\"ET\",\"label\":\"Ethiopia\"},{\"value\":\"FO\",\"label\":\"Faroe Islands\"},{\"value\":\"FJ\",\"label\":\"Fiji\"},{\"value\":\"FI\",\"label\":\"Finland\"},{\"value\":\"FR\",\"label\":\"France\"},{\"value\":\"GF\",\"label\":\"French Guiana\"},{\"value\":\"PF\",\"label\":\"French Polynesia\"},{\"value\":\"GP\",\"label\":\"French West Indies\"},{\"value\":\"MK\",\"label\":\"North Macedonia\"},{\"value\":\"GA\",\"label\":\"Gabon\"},{\"value\":\"GM\",\"label\":\"Gambia\"},{\"value\":\"GE\",\"label\":\"Georgia\"},{\"value\":\"DE\",\"label\":\"Germany\"},{\"value\":\"GH\",\"label\":\"Ghana\"},{\"value\":\"GI\",\"label\":\"Gibraltar\"},{\"value\":\"GR\",\"label\":\"Greece\"},{\"value\":\"GL\",\"label\":\"Greenland\"},{\"value\":\"GD\",\"label\":\"Grenada\"},{\"value\":\"GU\",\"label\":\"Guam\"},{\"value\":\"GT\",\"label\":\"Guatemala\"},{\"value\":\"GN\",\"label\":\"Guinea\"},{\"value\":\"GW\",\"label\":\"Guinea-Bissau\"},{\"value\":\"GY\",\"label\":\"Guyana\"},{\"value\":\"HT\",\"label\":\"Haiti\"},{\"value\":\"HN\",\"label\":\"Honduras\"},{\"value\":\"HK\",\"label\":\"Hong Kong [SAR China]\"},{\"value\":\"HU\",\"label\":\"Hungary\"},{\"value\":\"IS\",\"label\":\"Iceland\"},{\"value\":\"IN\",\"label\":\"India\"},{\"value\":\"ID\",\"label\":\"Indonesia\"},{\"value\":\"IR\",\"label\":\"Iran\"},{\"value\":\"IQ\",\"label\":\"Iraq\"},{\"value\":\"IE\",\"label\":\"Ireland\"},{\"value\":\"IL\",\"label\":\"Israel\"},{\"value\":\"IT\",\"label\":\"Italy\"},{\"value\":\"JM\",\"label\":\"Jamaica\"},{\"value\":\"JP\",\"label\":\"Japan\"},{\"value\":\"JO\",\"label\":\"Jordan\"},{\"value\":\"KZ\",\"label\":\"Kazakhstan\"},{\"value\":\"KE\",\"label\":\"Kenya\"},{\"value\":\"KI\",\"label\":\"Kiribati\"},{\"value\":\"KP\",\"label\":\"North Korea[Peoples Rep.]\"},{\"value\":\"KR\",\"label\":\"South Korea[Rep.]\"},{\"value\":\"KW\",\"label\":\"Kuwait\"},{\"value\":\"KG\",\"label\":\"Kyrgyzstan\"},{\"value\":\"LA\",\"label\":\"Laos\"},{\"value\":\"LV\",\"label\":\"Latvia\"},{\"value\":\"LB\",\"label\":\"Lebanon\"},{\"value\":\"LS\",\"label\":\"Lesotho\"},{\"value\":\"LR\",\"label\":\"Liberia\"},{\"value\":\"LY\",\"label\":\"Libya\"},{\"value\":\"LI\",\"label\":\"Liechtenstein\"},{\"value\":\"LT\",\"label\":\"Lithuania\"},{\"value\":\"LU\",\"label\":\"Luxembourg\"},{\"value\":\"MO\",\"label\":\"Macao [SAR China]\"},{\"value\":\"MG\",\"label\":\"Madagascar\"},{\"value\":\"MW\",\"label\":\"Malawi\"},{\"value\":\"MY\",\"label\":\"Malaysia\"},{\"value\":\"MV\",\"label\":\"Maldives\"},{\"value\":\"ML\",\"label\":\"Mali\"},{\"value\":\"MT\",\"label\":\"Malta\"},{\"value\":\"MH\",\"label\":\"Marshall Islands\"},{\"value\":\"MR\",\"label\":\"Mauritania\"},{\"value\":\"MU\",\"label\":\"Mauritius\"},{\"value\":\"YT\",\"label\":\"Mayotte\"},{\"value\":\"MX\",\"label\":\"Mexico\"},{\"value\":\"FM\",\"label\":\"Micronesia \"},{\"value\":\"MD\",\"label\":\"Moldova\"},{\"value\":\"MC\",\"label\":\"Monaco\"},{\"value\":\"MN\",\"label\":\"Mongolia\"},{\"value\":\"MS\",\"label\":\"Montserrat\"},{\"value\":\"MA\",\"label\":\"Morocco\"},{\"value\":\"MZ\",\"label\":\"Mozambique\"},{\"value\":\"MM\",\"label\":\"Myanmar\"},{\"value\":\"NA\",\"label\":\"Namibia\"},{\"value\":\"NR\",\"label\":\"Nauru\"},{\"value\":\"NP\",\"label\":\"Nepal\"},{\"value\":\"AN\",\"label\":\"Netherlands Antilles\"},{\"value\":\"NL\",\"label\":\"Netherlands\"},{\"value\":\"NC\",\"label\":\"New Caledonia\"},{\"value\":\"NZ\",\"label\":\"New Zealand\"},{\"value\":\"NI\",\"label\":\"Nicaragua\"},{\"value\":\"NE\",\"label\":\"Niger\"},{\"value\":\"NG\",\"label\":\"Nigeria\"},{\"value\":\"NU\",\"label\":\"Niue\"},{\"value\":\"NF\",\"label\":\"Norfolk Island\"},{\"value\":\"MP\",\"label\":\"Northern Mariana Isl.\"},{\"value\":\"NO\",\"label\":\"Norway\"},{\"value\":\"OM\",\"label\":\"Oman\"},{\"value\":\"PK\",\"label\":\"Pakistan\"},{\"value\":\"PW\",\"label\":\"Palau Islands\"},{\"value\":\"PA\",\"label\":\"Panama\"},{\"value\":\"PG\",\"label\":\"Papua New Guinea\"},{\"value\":\"PY\",\"label\":\"Paraguay\"},{\"value\":\"PE\",\"label\":\"Peru\"},{\"value\":\"PH\",\"label\":\"Philippines\"},{\"value\":\"PL\",\"label\":\"Poland\"},{\"value\":\"PT\",\"label\":\"Portugal\"},{\"value\":\"PR\",\"label\":\"Puerto Rico\"},{\"value\":\"QA\",\"label\":\"Qatar\"},{\"value\":\"RE\",\"label\":\"Reunion\"},{\"value\":\"RO\",\"label\":\"Romania\"},{\"value\":\"RU\",\"label\":\"Russia\"},{\"value\":\"RW\",\"label\":\"Rwanda\"},{\"value\":\"AS\",\"label\":\"Samoa[American]\"},{\"value\":\"WS\",\"label\":\"Samoa\"},{\"value\":\"SM\",\"label\":\"San Marino\"},{\"value\":\"ST\",\"label\":\"Sao Tome & Principe\"},{\"value\":\"SA\",\"label\":\"Saudi Arabia\"},{\"value\":\"SN\",\"label\":\"Senegal\"},{\"value\":\"RS\",\"label\":\"Serbia\"},{\"value\":\"SC\",\"label\":\"Seychelles\"},{\"value\":\"SL\",\"label\":\"Sierra Leone\"},{\"value\":\"SG\",\"label\":\"Singapore\"},{\"value\":\"SK\",\"label\":\"Slovak Republic\"},{\"value\":\"SI\",\"label\":\"Slovenia\"},{\"value\":\"SB\",\"label\":\"Solomon Islands\"},{\"value\":\"SO\",\"label\":\"Somalia\"},{\"value\":\"ZA\",\"label\":\"South Africa\"},{\"value\":\"ES\",\"label\":\"Spain\"},{\"value\":\"LK\",\"label\":\"Sri Lanka\"},{\"value\":\"KN\",\"label\":\"St.Kitts-Nevis\"},{\"value\":\"LC\",\"label\":\"St.Lucia\"},{\"value\":\"VC\",\"label\":\"St.Vincent & Grenadines\"},{\"value\":\"SD\",\"label\":\"Sudan\"},{\"value\":\"ME\",\"label\":\"Montenegro\"},{\"value\":\"SR\",\"label\":\"Suriname\"},{\"value\":\"SS\",\"label\":\"South Sudan\"},{\"value\":\"SE\",\"label\":\"Sweden\"},{\"value\":\"CH\",\"label\":\"Switzerland\"},{\"value\":\"SY\",\"label\":\"Syria\"},{\"value\":\"TW\",\"label\":\"Taiwan[Rep. of China]\"},{\"value\":\"TJ\",\"label\":\"Tajikistan\"},{\"value\":\"TZ\",\"label\":\"Tanzania\"},{\"value\":\"TH\",\"label\":\"Thailand\"},{\"value\":\"TL\",\"label\":\"Timor Leste\"},{\"value\":\"TG\",\"label\":\"Togo\"},{\"value\":\"TO\",\"label\":\"Tonga\"},{\"value\":\"TT\",\"label\":\"Trinidad & Tobago\"},{\"value\":\"TN\",\"label\":\"Tunisia\"},{\"value\":\"TR\",\"label\":\"Turkey\"},{\"value\":\"TM\",\"label\":\"Turkmenistan\"},{\"value\":\"TC\",\"label\":\"Turks & Caicos Isl.\"},{\"value\":\"TV\",\"label\":\"Tuvalu\"},{\"value\":\"UG\",\"label\":\"Uganda\"},{\"value\":\"UA\",\"label\":\"Ukraine\"},{\"value\":\"AE\",\"label\":\"United Arab Emirates\"},{\"value\":\"GB\",\"label\":\"United Kingdom\"},{\"value\":\"US\",\"label\":\"United States\"},{\"value\":\"UY\",\"label\":\"Uruguay\"},{\"value\":\"UZ\",\"label\":\"Uzbekistan\"},{\"value\":\"VU\",\"label\":\"Vanuatu\"},{\"value\":\"VA\",\"label\":\"Vatican\"},{\"value\":\"VE\",\"label\":\"Venezuela\"},{\"value\":\"VN\",\"label\":\"Vietnam\"},{\"value\":\"VI\",\"label\":\"Virgin Islands [U.S.A.]\"},{\"value\":\"VG\",\"label\":\"Virgin Islands [British]\"},{\"value\":\"YE\",\"label\":\"Yemen\"},{\"value\":\"ZM\",\"label\":\"Zambia\"},{\"value\":\"ZW\",\"label\":\"Zimbabwe\"},{\"value\":\"CW\",\"label\":\"Curacao\"},{\"value\":\"SX\",\"label\":\"Sint Maarten\"},{\"value\":\"MF\",\"label\":\"Saint Maarten\"}]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"birth_city\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"City\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\"key\": \"birth_state\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.birth_country === 'US')\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"State\",\n\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AK\",\"label\":\"Alaska\"},{\"value\":\"AL\",\"label\":\"Alabama\"},{\"value\":\"AR\",\"label\":\"Arkansas\"},{\"value\":\"ASM\",\"label\":\"American Samoa\"},{\"value\":\"AZ\",\"label\":\"Arizona\"},{\"value\":\"CA-N\",\"label\":\"California North\"},{\"value\":\"CA-S\",\"label\":\"California South\"},{\"value\":\"CO\",\"label\":\"Colorado\"},{\"value\":\"CT\",\"label\":\"Connecticut\"},{\"value\":\"DC\",\"label\":\"District of Columbia\"},{\"value\":\"DE\",\"label\":\"Delaware\"},{\"value\":\"FL\",\"label\":\"Florida\"},{\"value\":\"GA\",\"label\":\"Georgia\"},{\"value\":\"GUM\",\"label\":\"Guam\"},{\"value\":\"HI\",\"label\":\"Hawaii\"},{\"value\":\"IA\",\"label\":\"Iowa\"},{\"value\":\"ID\",\"label\":\"Idaho\"},{\"value\":\"IL\",\"label\":\"Illinois\"},{\"value\":\"IN\",\"label\":\"Indiana\"},{\"value\":\"KS\",\"label\":\"Kansas\"},{\"value\":\"KY\",\"label\":\"Kentucky\"},{\"value\":\"LA\",\"label\":\"Louisiana\"},{\"value\":\"MA\",\"label\":\"Massachusetts\"},{\"value\":\"MD\",\"label\":\"Maryland\"},{\"value\":\"ME\",\"label\":\"Maine\"},{\"value\":\"MI\",\"label\":\"Michigan\"},{\"value\":\"MN\",\"label\":\"Minnesota\"},{\"value\":\"MNP\",\"label\":\"North Mariana Islands\"},{\"value\":\"MO\",\"label\":\"Missouri\"},{\"value\":\"MS\",\"label\":\"Mississippi\"},{\"value\":\"MT\",\"label\":\"Montana\"},{\"value\":\"NC\",\"label\":\"North Carolina\"},{\"value\":\"ND\",\"label\":\"North Dakota\"},{\"value\":\"NE\",\"label\":\"Nebraska\"},{\"value\":\"NH\",\"label\":\"New Hampshire\"},{\"value\":\"NJ\",\"label\":\"New Jersey\"},{\"value\":\"NM\",\"label\":\"New Mexico\"},{\"value\":\"NV\",\"label\":\"Nevada\"},{\"value\":\"NY\",\"label\":\"New York\"},{\"value\":\"OH\",\"label\":\"Ohio\"},{\"value\":\"OK\",\"label\":\"Oklahoma\"},{\"value\":\"OR\",\"label\":\"Oregon\"},{\"value\":\"PA\",\"label\":\"Pennsylvania\"},{\"value\":\"PRI\",\"label\":\"Puerto Rico\"},{\"value\":\"RI\",\"label\":\"Rhode Island\"},{\"value\":\"SC\",\"label\":\"South Carolina\"},{\"value\":\"SD\",\"label\":\"South Dakota\"},{\"value\":\"TN\",\"label\":\"Tennessee\"},{\"value\":\"TX\",\"label\":\"Texas\"},{\"value\":\"UT\",\"label\":\"Utah\"},{\"value\":\"VA\",\"label\":\"Virginia\"},{\"value\":\"VIR\",\"label\":\"U.S. Virgin Islands\"},{\"value\":\"VT\",\"label\":\"Vermont\"},{\"value\":\"WA\",\"label\":\"Washington\"},{\"value\":\"WI\",\"label\":\"Wisconsin\"},{\"value\":\"WV\",\"label\":\"West Virginia\"},{\"value\":\"WY\",\"label\":\"Wyoming\"},{\"value\":\"XMI\",\"label\":\"Midway Islands\"}]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\"key\": \"birth_state\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.birth_country === 'CA')\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Province\",\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"label\": \"Florida\", \"value\": \"FL\"},\n\t\t\t\t\t\t\t\t\t\t{\"label\": \"Georgia\", \"value\": \"GA\"}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-physical-profile\",\n\t\t\t\t\t\"id\": \"physical_profile\",\n\t\t\t\t\t\"label\": \"Please provide some descriptive information below.\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"key\": \"date_of_birth\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Date of Birth\",\n\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\"view\": \"year\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Gender
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"gender\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"label\": \"Gender\",\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Male\",\n\t\t\t\t\t\t\t\t\t\t\t\"icon\": \"icon-male\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"male\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Female\",\n\t\t\t\t\t\t\t\t\t\t\t\"icon\": \"icon-female\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"female\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Height
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"height.feet\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Feet\",\n\t\t\t\t\t\t\t\t\t\t\t\"type\": \"number\",\n\t\t\t\t\t\t\t\t\t\t\t\"min\": 0,\n\t\t\t\t\t\t\t\t\t\t\t\"max\": 10,\n\t\t\t\t\t\t\t\t\t\t\t\"step\": 1\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"height.inches\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Inches\",\n\t\t\t\t\t\t\t\t\t\t\t\"type\": \"number\",\n\t\t\t\t\t\t\t\t\t\t\t\"step\": 1,\n\t\t\t\t\t\t\t\t\t\t\t\"min\": 0,\n\t\t\t\t\t\t\t\t\t\t\t\"max\": 11\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"select\",\n\t\t\t\t\t\t\t\t\"key\": \"hair_color\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Natural Hair Color\",\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"black\", \"label\": \"Black\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"blonde\", \"label\": \"Blonde\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"brown\", \"label\": \"Brown\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"red\", \"label\": \"Red\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"gray\", \"label\": \"Gray\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"bald\", \"label\": \"Bald\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"other\", \"label\": \"Other\"}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"select\",\n\t\t\t\t\t\t\t\t\"key\": \"eye_color\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Natural Eye Color\",\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"amber\", \"label\": \"Amber\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"black\", \"label\": \"Black\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"blue\", \"label\": \"Blue\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"brown\", \"label\": \"Brown\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"gray\", \"label\": \"Gray\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"green\", \"label\": \"Green\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"hazel\", \"label\": \"Hazel\"}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-contact-information\",\n\t\t\t\t\t\"id\": \"contact_information\",\n\t\t\t\t\t\"label\": \"Please enter your contact information.\",\n\t\t\t\t\t\"hint\": \"The address used on this form must be your permament domicile address. P.O. Box addresses cannot be used on this form.\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"address.address_1\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Street Address 1\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"address.address_2\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\"label\": \"Street Address 2\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"address.city\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"City\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"address.state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"State\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AK\",\"label\":\"Alaska\"},{\"value\":\"AL\",\"label\":\"Alabama\"},{\"value\":\"AR\",\"label\":\"Arkansas\"},{\"value\":\"ASM\",\"label\":\"American Samoa\"},{\"value\":\"AZ\",\"label\":\"Arizona\"},{\"value\":\"CA-N\",\"label\":\"California North\"},{\"value\":\"CA-S\",\"label\":\"California South\"},{\"value\":\"CO\",\"label\":\"Colorado\"},{\"value\":\"CT\",\"label\":\"Connecticut\"},{\"value\":\"DC\",\"label\":\"District of Columbia\"},{\"value\":\"DE\",\"label\":\"Delaware\"},{\"value\":\"FL\",\"label\":\"Florida\"},{\"value\":\"GA\",\"label\":\"Georgia\"},{\"value\":\"GUM\",\"label\":\"Guam\"},{\"value\":\"HI\",\"label\":\"Hawaii\"},{\"value\":\"IA\",\"label\":\"Iowa\"},{\"value\":\"ID\",\"label\":\"Idaho\"},{\"value\":\"IL\",\"label\":\"Illinois\"},{\"value\":\"IN\",\"label\":\"Indiana\"},{\"value\":\"KS\",\"label\":\"Kansas\"},{\"value\":\"KY\",\"label\":\"Kentucky\"},{\"value\":\"LA\",\"label\":\"Louisiana\"},{\"value\":\"MA\",\"label\":\"Massachusetts\"},{\"value\":\"MD\",\"label\":\"Maryland\"},{\"value\":\"ME\",\"label\":\"Maine\"},{\"value\":\"MI\",\"label\":\"Michigan\"},{\"value\":\"MN\",\"label\":\"Minnesota\"},{\"value\":\"MNP\",\"label\":\"North Mariana Islands\"},{\"value\":\"MO\",\"label\":\"Missouri\"},{\"value\":\"MS\",\"label\":\"Mississippi\"},{\"value\":\"MT\",\"label\":\"Montana\"},{\"value\":\"NC\",\"label\":\"North Carolina\"},{\"value\":\"ND\",\"label\":\"North Dakota\"},{\"value\":\"NE\",\"label\":\"Nebraska\"},{\"value\":\"NH\",\"label\":\"New Hampshire\"},{\"value\":\"NJ\",\"label\":\"New Jersey\"},{\"value\":\"NM\",\"label\":\"New Mexico\"},{\"value\":\"NV\",\"label\":\"Nevada\"},{\"value\":\"NY\",\"label\":\"New York\"},{\"value\":\"OH\",\"label\":\"Ohio\"},{\"value\":\"OK\",\"label\":\"Oklahoma\"},{\"value\":\"OR\",\"label\":\"Oregon\"},{\"value\":\"PA\",\"label\":\"Pennsylvania\"},{\"value\":\"PRI\",\"label\":\"Puerto Rico\"},{\"value\":\"RI\",\"label\":\"Rhode Island\"},{\"value\":\"SC\",\"label\":\"South Carolina\"},{\"value\":\"SD\",\"label\":\"South Dakota\"},{\"value\":\"TN\",\"label\":\"Tennessee\"},{\"value\":\"TX\",\"label\":\"Texas\"},{\"value\":\"UT\",\"label\":\"Utah\"},{\"value\":\"VA\",\"label\":\"Virginia\"},{\"value\":\"VIR\",\"label\":\"U.S. Virgin Islands\"},{\"value\":\"VT\",\"label\":\"Vermont\"},{\"value\":\"WA\",\"label\":\"Washington\"},{\"value\":\"WI\",\"label\":\"Wisconsin\"},{\"value\":\"WV\",\"label\":\"West Virginia\"},{\"value\":\"WY\",\"label\":\"Wyoming\"},{\"value\":\"XMI\",\"label\":\"Midway Islands\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"address.zip\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Zip\",\n\t\t\t\t\t\t\t\t\t\"maxLength\": 5,\n\t\t\t\t\t\t\t\t\t\"pattern\": \"[0-9]{5}\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"masked-input\",\n\t\t\t\t\t\t\t\t\"key\": \"contact_phone_home\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Phone Number\",\n\t\t\t\t\t\t\t\t\t\"mask\": \"(000) 000-0000\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"contact_email\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Email\",\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^\\\\w+([-+._']\\\\w+)*@\\\\w+([-._]\\\\w+)*\\\\.\\\\w+([-.]\\\\w+)*$\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-name-change\",\n\t\t\t\t\t\"id\": \"name_change\",\n\t\t\t\t\t\"label\":\"Have you changed your legal name in the past?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"change_name.answer\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Yes\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"No\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"no\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"key\": \"change_name.list\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"multiple\",\n\t\t\t\t\t\t\t\t\t\t\"defaultValue\": [null],\n\t\t\t\t\t\t\t\t\t\t\"fieldArray\": {\n\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"first_name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--tight\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"last_name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--tight\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.change_name && model.change_name.answer === 'yes')\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-personal\",\n\t\t\t\t\t\"icon_size\": \"large\",\n\t\t\t\t\t\"id\": \"parents_information\",\n\t\t\t\t\t\"label\": \"Are both parents available to visit the acceptance agent?\",\n\t\t\t\t\t\"hide\": \"!(model.date_of_birth && dt.now().minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"child_passport.parents\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Both\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"both\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"one\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"One\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Is the unavailable parent able to sign a statement of consent form?
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"key\": \"child_passport.sign_form\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\t\t\"templateOptions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Yes\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": \"no\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"No\"\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Do you have a sole legal custody?
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"child_passport.sole_custody\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"templateOptions\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Yes\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"No\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": \"no\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"model.child_passport?.sign_form !== 'no'\",\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"model.child_passport?.parents !== 'one'\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-personal\",\n\t\t\t\t\t\"id\": \"applying_parent\",\n\t\t\t\t\t\"hide\": \"model.child_passport?.sign_form !== 'yes'\",\n\t\t\t\t\t\"label\": \"Please provide the full name of the applying parent\\/guardian.\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"ds_3053.applying.first_middle_name\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"ds_3053.applying.last_name\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-personal\",\n\t\t\t\t\t\"id\": \"non_applying_parent\",\n\t\t\t\t\t\"hide\": \"model.child_passport?.sign_form !== 'yes'\",\n\t\t\t\t\t\"label\": \"Please provide information about the non-applying parent\\/guardian.\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.first_middle_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.last_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.address\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Street Address\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.apartment\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Apartment\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.city\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"City\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.state\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"State\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AK\",\"label\":\"Alaska\"},{\"value\":\"AL\",\"label\":\"Alabama\"},{\"value\":\"AR\",\"label\":\"Arkansas\"},{\"value\":\"ASM\",\"label\":\"American Samoa\"},{\"value\":\"AZ\",\"label\":\"Arizona\"},{\"value\":\"CA-N\",\"label\":\"California North\"},{\"value\":\"CA-S\",\"label\":\"California South\"},{\"value\":\"CO\",\"label\":\"Colorado\"},{\"value\":\"CT\",\"label\":\"Connecticut\"},{\"value\":\"DC\",\"label\":\"District of Columbia\"},{\"value\":\"DE\",\"label\":\"Delaware\"},{\"value\":\"FL\",\"label\":\"Florida\"},{\"value\":\"GA\",\"label\":\"Georgia\"},{\"value\":\"GUM\",\"label\":\"Guam\"},{\"value\":\"HI\",\"label\":\"Hawaii\"},{\"value\":\"IA\",\"label\":\"Iowa\"},{\"value\":\"ID\",\"label\":\"Idaho\"},{\"value\":\"IL\",\"label\":\"Illinois\"},{\"value\":\"IN\",\"label\":\"Indiana\"},{\"value\":\"KS\",\"label\":\"Kansas\"},{\"value\":\"KY\",\"label\":\"Kentucky\"},{\"value\":\"LA\",\"label\":\"Louisiana\"},{\"value\":\"MA\",\"label\":\"Massachusetts\"},{\"value\":\"MD\",\"label\":\"Maryland\"},{\"value\":\"ME\",\"label\":\"Maine\"},{\"value\":\"MI\",\"label\":\"Michigan\"},{\"value\":\"MN\",\"label\":\"Minnesota\"},{\"value\":\"MNP\",\"label\":\"North Mariana Islands\"},{\"value\":\"MO\",\"label\":\"Missouri\"},{\"value\":\"MS\",\"label\":\"Mississippi\"},{\"value\":\"MT\",\"label\":\"Montana\"},{\"value\":\"NC\",\"label\":\"North Carolina\"},{\"value\":\"ND\",\"label\":\"North Dakota\"},{\"value\":\"NE\",\"label\":\"Nebraska\"},{\"value\":\"NH\",\"label\":\"New Hampshire\"},{\"value\":\"NJ\",\"label\":\"New Jersey\"},{\"value\":\"NM\",\"label\":\"New Mexico\"},{\"value\":\"NV\",\"label\":\"Nevada\"},{\"value\":\"NY\",\"label\":\"New York\"},{\"value\":\"OH\",\"label\":\"Ohio\"},{\"value\":\"OK\",\"label\":\"Oklahoma\"},{\"value\":\"OR\",\"label\":\"Oregon\"},{\"value\":\"PA\",\"label\":\"Pennsylvania\"},{\"value\":\"PRI\",\"label\":\"Puerto Rico\"},{\"value\":\"RI\",\"label\":\"Rhode Island\"},{\"value\":\"SC\",\"label\":\"South Carolina\"},{\"value\":\"SD\",\"label\":\"South Dakota\"},{\"value\":\"TN\",\"label\":\"Tennessee\"},{\"value\":\"TX\",\"label\":\"Texas\"},{\"value\":\"UT\",\"label\":\"Utah\"},{\"value\":\"VA\",\"label\":\"Virginia\"},{\"value\":\"VIR\",\"label\":\"U.S. Virgin Islands\"},{\"value\":\"VT\",\"label\":\"Vermont\"},{\"value\":\"WA\",\"label\":\"Washington\"},{\"value\":\"WI\",\"label\":\"Wisconsin\"},{\"value\":\"WV\",\"label\":\"West Virginia\"},{\"value\":\"WY\",\"label\":\"Wyoming\"},{\"value\":\"XMI\",\"label\":\"Midway Islands\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.zip\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"[0-9]{5}\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxlength\": 5,\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Zip Code\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.phone\",\n\t\t\t\t\t\t\t\t\"type\": \"masked-input\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"mask\": \"(999) 999-9999\",\n\t\t\t\t\t\t\t\t\t\"label\": \"Phone Number\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"ds_3053.non_applying.email\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Email Address\",\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^\\\\w+([-+._']\\\\w+)*@\\\\w+([-._]\\\\w+)*\\\\.\\\\w+([-.]\\\\w+)*$\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-trips\",\n\t\t\t\t\t\"id\": \"frequent_traveler\",\n\t\t\t\t\t\"label\": \"How often do you travel internationally?\"\t\t\t\t\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"frequent_traveler\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"1-10 times a year\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"no\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"10+ times a year\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-passports\",\n\t\t\t\t\t\"id\": \"large_book\",\n\t\t\t\t\t\"hide\": \"!(model.frequent_traveler === 'yes')\",\n\t\t\t\t\t\"label\": \"Since you travel frequently, you might qualify for a 52-page book at no additional cost. Would you like to apply?\",\n\t\t\t\t\t\"hint\": \"The decision is made by the U.S. Passport Agency depending on several factors and we have no control over the outcome.\",\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"large_book\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"label\": \"Yes\",\n\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"label\": \"No\",\n\t\t\t\t\t\t\t\t\t\"value\": \"no\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-employment-status\",\n\t\t\t\t\t\"id\": \"employment\",\n\t\t\t\t\t\"label\": \"Are you currently employed?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"employment_status.answer\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"label\": \"Yes\",\n\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"label\": \"No\",\n\t\t\t\t\t\t\t\t\t\"value\": \"no\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t}, \n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Please provide additional information
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"employment_status.employer\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Employer\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 30\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"employment_status.position\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Position\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 30\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"!(model.employment_status && model.employment_status.answer === 'yes')\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-emergency-contact\",\n\t\t\t\t\t\"id\": \"emergency_contact\",\n\t\t\t\t\t\"label\": \"Would you like to provide an emergency contact?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"emergency_contact.answer\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"label\": \"Yes\",\n\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"label\": \"No\",\n\t\t\t\t\t\t\t\t\t\"value\": \"no\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.relationship\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"maxLength\": 70,\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Relationship\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.first_name\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.last_name\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.address.address_1\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Street Address 1\",\n\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.address.address_2\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\"label\": \"Street Address 2\",\n\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.address.city\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"City\",\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^[a-zA-Z\\\\s\\\\-']*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.address.state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"State\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AK\",\"label\":\"Alaska\"},{\"value\":\"AL\",\"label\":\"Alabama\"},{\"value\":\"AR\",\"label\":\"Arkansas\"},{\"value\":\"ASM\",\"label\":\"American Samoa\"},{\"value\":\"AZ\",\"label\":\"Arizona\"},{\"value\":\"CA-N\",\"label\":\"California North\"},{\"value\":\"CA-S\",\"label\":\"California South\"},{\"value\":\"CO\",\"label\":\"Colorado\"},{\"value\":\"CT\",\"label\":\"Connecticut\"},{\"value\":\"DC\",\"label\":\"District of Columbia\"},{\"value\":\"DE\",\"label\":\"Delaware\"},{\"value\":\"FL\",\"label\":\"Florida\"},{\"value\":\"GA\",\"label\":\"Georgia\"},{\"value\":\"GUM\",\"label\":\"Guam\"},{\"value\":\"HI\",\"label\":\"Hawaii\"},{\"value\":\"IA\",\"label\":\"Iowa\"},{\"value\":\"ID\",\"label\":\"Idaho\"},{\"value\":\"IL\",\"label\":\"Illinois\"},{\"value\":\"IN\",\"label\":\"Indiana\"},{\"value\":\"KS\",\"label\":\"Kansas\"},{\"value\":\"KY\",\"label\":\"Kentucky\"},{\"value\":\"LA\",\"label\":\"Louisiana\"},{\"value\":\"MA\",\"label\":\"Massachusetts\"},{\"value\":\"MD\",\"label\":\"Maryland\"},{\"value\":\"ME\",\"label\":\"Maine\"},{\"value\":\"MI\",\"label\":\"Michigan\"},{\"value\":\"MN\",\"label\":\"Minnesota\"},{\"value\":\"MNP\",\"label\":\"North Mariana Islands\"},{\"value\":\"MO\",\"label\":\"Missouri\"},{\"value\":\"MS\",\"label\":\"Mississippi\"},{\"value\":\"MT\",\"label\":\"Montana\"},{\"value\":\"NC\",\"label\":\"North Carolina\"},{\"value\":\"ND\",\"label\":\"North Dakota\"},{\"value\":\"NE\",\"label\":\"Nebraska\"},{\"value\":\"NH\",\"label\":\"New Hampshire\"},{\"value\":\"NJ\",\"label\":\"New Jersey\"},{\"value\":\"NM\",\"label\":\"New Mexico\"},{\"value\":\"NV\",\"label\":\"Nevada\"},{\"value\":\"NY\",\"label\":\"New York\"},{\"value\":\"OH\",\"label\":\"Ohio\"},{\"value\":\"OK\",\"label\":\"Oklahoma\"},{\"value\":\"OR\",\"label\":\"Oregon\"},{\"value\":\"PA\",\"label\":\"Pennsylvania\"},{\"value\":\"PRI\",\"label\":\"Puerto Rico\"},{\"value\":\"RI\",\"label\":\"Rhode Island\"},{\"value\":\"SC\",\"label\":\"South Carolina\"},{\"value\":\"SD\",\"label\":\"South Dakota\"},{\"value\":\"TN\",\"label\":\"Tennessee\"},{\"value\":\"TX\",\"label\":\"Texas\"},{\"value\":\"UT\",\"label\":\"Utah\"},{\"value\":\"VA\",\"label\":\"Virginia\"},{\"value\":\"VIR\",\"label\":\"U.S. Virgin Islands\"},{\"value\":\"VT\",\"label\":\"Vermont\"},{\"value\":\"WA\",\"label\":\"Washington\"},{\"value\":\"WI\",\"label\":\"Wisconsin\"},{\"value\":\"WV\",\"label\":\"West Virginia\"},{\"value\":\"WY\",\"label\":\"Wyoming\"},{\"value\":\"XMI\",\"label\":\"Midway Islands\"}]\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.address.zip\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Zip\",\n\t\t\t\t\t\t\t\t\t\"maxLength\": 5,\n\t\t\t\t\t\t\t\t\t\"pattern\": \"[0-9]{5}\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"masked-input\",\n\t\t\t\t\t\t\t\t\"key\": \"emergency_contact.phone_number\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Phone Number\",\n\t\t\t\t\t\t\t\t\t\"mask\": \"(000) 000-0000\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"!(model.emergency_contact && model.emergency_contact.answer === 'yes')\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-passports\",\n\t\t\t\t\t\"id\": \"issued_passports\",\n\t\t\t\t\t\"label\": \"Have you been issued any of the following?\"\n\t\t\t\t}, \n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"issued_passports\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Book\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"book\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Card\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"card\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Both\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"both\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"None\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"none\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-passports\",\n\t\t\t\t\t\"hide\": \"!['book', 'both'].includes(model.issued_passports)\",\n\t\t\t\t\t\"label\": \"Do you have your most recent passport book in your possession?\",\n\t\t\t\t\t\"id\": \"passport_book\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"key\": \"passport.in_possession\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"lost\", \"label\": \"No, it was lost\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"stolen\", \"label\": \"No, it was stolen\"}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Is it Damaged or Mutilated?
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.is_damaged\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"No\"}\n\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your most recent passport book.
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.last\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]{9}$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Issue Date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validators\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"after_dob\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"today\": \"Date can\\u2019t be in the future\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport.is_damaged === 'no')\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your most recent passport book.
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.last\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]{9}$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Issue Date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validators\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"after_dob\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"date_of_birth\": \"Date can\\u2019t be before applicant\\u2019s date of birth\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"today\": \"Date can\\u2019t be in the future\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport.is_damaged === 'yes')\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport && model.passport.in_possession === 'yes')\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Are you able to provide the issue date of your lost passport book?
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.not_in_possession.issue_date_available\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"No\"}\n\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your lost passport book.
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.last\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]{9}$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Issue Date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validators\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"after_dob\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"date_of_birth\": \"Date can\\u2019t be before applicant\\u2019s date of birth\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"today\": \"Date can\\u2019t be in the future\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport.not_in_possession && model.passport.not_in_possession.issue_date_available === 'yes')\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Was your lost passport book issued more than 15 years ago?
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.not_in_possession.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"lost\", \"label\": \"No\"},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"unknown\", \"label\": \"Unknown\"}\n\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your lost passport book.
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.last\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]{9}$\"\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport.not_in_possession && model.passport.not_in_possession.issue_date_available === 'no')\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport && model.passport.in_possession === 'lost')\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Are you able to provide the issue date of your stolen passport book?
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.not_in_possession.issue_date_available\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"No\"}\n\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your stolen passport book.
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.last\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]{9}$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Issue Date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validators\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"after_dob\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"date_of_birth\": \"Date can\\u2019t be before applicant\\u2019s date of birth\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"today\": \"Date can\\u2019t be in the future\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport.not_in_possession && model.passport.not_in_possession.issue_date_available === 'yes')\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Was your stolen passport book issued more than 15 years ago?
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.not_in_possession.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"lost\", \"label\": \"No\"},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\"value\": \"unknown\", \"label\": \"Unknown\"}\n\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your stolen passport book.
\"\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.last\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport.number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^[0-9]{9}$\"\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport.not_in_possession && model.passport.not_in_possession.issue_date_available === 'no')\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport && model.passport.in_possession === 'stolen')\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-passports\",\n\t\t\t\t\t\"hide\": \"!['card', 'both'].includes(model.issued_passports)\",\n\t\t\t\t\t\"label\": \"Do you have your most recent passport card in your possession?\",\n\t\t\t\t\t\"id\": \"passport_card\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"key\": \"passport_card.in_possession\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t{\"value\": \"lost\", \"label\": \"No, it was lost\"},\n\t\t\t\t\t\t\t\t{\"value\": \"stolen\", \"label\": \"No, it was stolen\"}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Is it Damaged or Mutilated?
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"key\": \"passport_card.is_damaged\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"No\"}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your most recent passport card.
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.last\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Card Number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"[a-zA-Z]{1}[0-9]{8}\"\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Issue Date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\"validators\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"after_dob\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"date_of_birth\": \"Date can\\u2019t be before applicant\\u2019s date of birth\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"today\": \"Date can\\u2019t be in the future\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport_card.is_damaged === 'no')\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your most recent passport card.
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.last\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Card Number\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"[a-zA-Z]{1}[0-9]{8}\"\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Issue Date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\"validators\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"after_dob\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"date_of_birth\": \"Date can\\u2019t be before applicant\\u2019s date of birth\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"today\": \"Date can\\u2019t be in the future\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.passport_card.is_damaged === 'yes')\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"!(model.passport_card && model.passport_card.in_possession === 'yes')\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your lost passport card.
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.last\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.number\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Card Number\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"[a-zA-Z]{1}[0-9]{8}\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Issue Date\",\n\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\", \n\t\t\t\t\t\t\t\t\t\t\t\"validators\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\"after_dob\"\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"date_of_birth\": \"Date can\\u2019t be before applicant\\u2019s date of birth\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"today\": \"Date can\\u2019t be in the future\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"!(model.passport_card && model.passport_card.in_possession === 'lost')\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small gwc-form__field-group--column\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Enter your name as printed on your stolen passport card.
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.first_middle\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First and Middle Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 80,\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.last\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40,\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.number\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Passport Card Number\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"[a-zA-Z]{1}[0-9]{8}\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"passport_card.issue_date\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": false,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Issue Date\",\n\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\", \n\t\t\t\t\t\t\t\t\t\t\t\"validators\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\"after_dob\"\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"date_of_birth\": \"Date can\\u2019t be before applicant\\u2019s date of birth\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"today\": \"Date can\\u2019t be in the future\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"!(model.passport_card && model.passport_card.in_possession === 'stolen')\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-name-change\",\n\t\t\t\t\t\"icon_size\": \"small\",\n\t\t\t\t\t\"id\": \"name_change_passport_book\",\n\t\t\t\t\t\"label\": \"Has your name changed since your passport book was issued?\",\n\t\t\t\t\t\"hide\": \"!(['book', 'both'].includes(model.issued_passports) && model.passport && model.passport.in_possession === 'yes' && model.passport.is_damaged === 'no' && dt.now().minus({years: 15}) < dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy'))\"\t\t\t\t\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"name_change_passport.book\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"No\"}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-name-change\",\n\t\t\t\t\t\"icon_size\": \"small\",\n\t\t\t\t\t\"id\": \"name_change_passport_card\",\n\t\t\t\t\t\"label\": \"Has your name changed since your passport card was issued?\",\n\t\t\t\t\t\"hide\": \"!(['card', 'both'].includes(model.issued_passports) && model.passport_card && model.passport_card.in_possession === 'yes' && model.passport_card.is_damaged === 'no' && dt.now().minus({years: 15}) < dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy'))\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"name_change_passport.card\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"No\"}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-name-change\",\n\t\t\t\t\t\"icon_size\": \"small\",\n\t\t\t\t\t\"id\": \"name_change_passport\",\n\t\t\t\t\t\"hide\": \"!(model.name_change_passport && (model.name_change_passport.card == 'yes' || model.name_change_passport.book == 'yes'))\",\n\t\t\t\t\t\"label\": \"What was the reason for name change?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"name_change_passport.reason\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\"value\": \"marriage\", \"label\": \"Marriage\"},\n\t\t\t\t\t\t\t\t{\"value\": \"court_order\", \"label\": \"Court Order\"}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"template\": \"Please provide the place and date of the name change.
\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"name_change_passport.place\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"pattern\": \"^[a-zA-Z\\\\s\\\\-']*$\",\n\t\t\t\t\t\t\t\t\t\"maxlength\": 80,\n\t\t\t\t\t\t\t\t\t\"label\": \"Place of Name Change (City/State)\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Only letters, spaces, dashes, and apostrophes allowed\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"key\": \"name_change_passport.date\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"view\": \"year\",\n\t\t\t\t\t\t\t\t\t\"label\": \"Date of Name Change\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t// \"validation\": {\n\t\t\t\t\t\t\t\t// \t\"messages\": {\n\t\t\t\t\t\t\t\t// \t\t\"min\": \"Date can\\u2019t be before applicant\\u2019s passport issue date.\",\n\t\t\t\t\t\t\t\t// \t\t\"max\": \"Date can\\u2019t be in the future.\"\n\t\t\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-mother-information\",\n\t\t\t\t\t\"id\": \"mother_information\",\n\t\t\t\t\t\"hide\": \"!(model.issued_passports === 'none' || (model.issued_passports === 'book' && (model.passport && model.passport.in_possession !== 'yes' || (model.passport.in_possession === 'yes' && model.passport.is_damaged === 'yes') || dt.now().minus({years: 15}) > dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy') || dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))) || (model.issued_passports === 'card' && (model.passport_card && model.passport_card.in_possession !== 'yes' || (model.passport_card.in_possession === 'yes' && model.passport_card.is_damaged === 'yes') || dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))) || (model.issued_passports === 'both' && model.passport && model.passport_card && ( model.passport.in_possession !== 'yes' || model.passport_card.in_possession !== 'yes' || (model.passport.in_possession === 'yes' && model.passport_card.in_possession === 'yes' && (dt.now().minus({years: 15}) > dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy') || dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy') || model.passport.is_damaged === 'yes') && (dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy') || model.passport_card.is_damaged === 'yes')))))\",\n\t\t\t\t\t\"label\": \"Are you able to provide information about your Mother\\/Parent?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"mother.unknown\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"No\"}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"mother.first_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"mother.last_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"key\": \"mother.date_of_birth\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Date of Birth\",\n\t\t\t\t\t\t\t\t\t\"maxDateKey\": \"date_of_birth\",\n\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\"view\": \"year\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\"min\": \"Date can\\u2019t be after applicant\\u2019s date of birth\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Birthplace
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"mother.birth_country\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Country\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AF\",\"label\":\"Afghanistan\"},{\"value\":\"AL\",\"label\":\"Albania\"},{\"value\":\"DZ\",\"label\":\"Algeria\"},{\"value\":\"AD\",\"label\":\"Andorra\"},{\"value\":\"AO\",\"label\":\"Angola\"},{\"value\":\"AI\",\"label\":\"Anguilla\"},{\"value\":\"AG\",\"label\":\"Antigua and Barbuda\"},{\"value\":\"AR\",\"label\":\"Argentina\"},{\"value\":\"AM\",\"label\":\"Armenia\"},{\"value\":\"AW\",\"label\":\"Aruba\"},{\"value\":\"AU\",\"label\":\"Australia\"},{\"value\":\"AT\",\"label\":\"Austria\"},{\"value\":\"AZ\",\"label\":\"Azerbaijan\"},{\"value\":\"BS\",\"label\":\"Bahamas\"},{\"value\":\"BH\",\"label\":\"Bahrain\"},{\"value\":\"BD\",\"label\":\"Bangladesh\"},{\"value\":\"BB\",\"label\":\"Barbados\"},{\"value\":\"BY\",\"label\":\"Belarus\"},{\"value\":\"BE\",\"label\":\"Belgium\"},{\"value\":\"BZ\",\"label\":\"Belize\"},{\"value\":\"BJ\",\"label\":\"Benin\"},{\"value\":\"BM\",\"label\":\"Bermuda\"},{\"value\":\"BT\",\"label\":\"Bhutan\"},{\"value\":\"BO\",\"label\":\"Bolivia\"},{\"value\":\"BA\",\"label\":\"Bosnia Herzegovina\"},{\"value\":\"BW\",\"label\":\"Botswana\"},{\"value\":\"BR\",\"label\":\"Brazil\"},{\"value\":\"BN\",\"label\":\"Brunei\"},{\"value\":\"BG\",\"label\":\"Bulgaria\"},{\"value\":\"BF\",\"label\":\"Burkina Faso\"},{\"value\":\"BI\",\"label\":\"Burundi\"},{\"value\":\"KH\",\"label\":\"Cambodia\"},{\"value\":\"CM\",\"label\":\"Cameroon\"},{\"value\":\"CA\",\"label\":\"Canada\"},{\"value\":\"CV\",\"label\":\"Cape Verde\"},{\"value\":\"KY\",\"label\":\"Cayman Islands\"},{\"value\":\"CF\",\"label\":\"Central African Republic\"},{\"value\":\"TD\",\"label\":\"Chad\"},{\"value\":\"CL\",\"label\":\"Chile\"},{\"value\":\"CN\",\"label\":\"China\"},{\"value\":\"CO\",\"label\":\"Colombia\"},{\"value\":\"KM\",\"label\":\"Comores Islands\"},{\"value\":\"CG\",\"label\":\"Congo[Brazzaville]\"},{\"value\":\"CD\",\"label\":\"Congo[Kinshasa]\"},{\"value\":\"CK\",\"label\":\"Cook Islands\"},{\"value\":\"CR\",\"label\":\"Costa Rica\"},{\"value\":\"CI\",\"label\":\"Cote dIvoire\"},{\"value\":\"HR\",\"label\":\"Croatia\"},{\"value\":\"CU\",\"label\":\"Cuba\"},{\"value\":\"CY\",\"label\":\"Cyprus\"},{\"value\":\"CZ\",\"label\":\"Czech Republic\"},{\"value\":\"DK\",\"label\":\"Denmark\"},{\"value\":\"DJ\",\"label\":\"Djibouti\"},{\"value\":\"DM\",\"label\":\"Dominica\"},{\"value\":\"DO\",\"label\":\"Dominican Republic\"},{\"value\":\"SZ\",\"label\":\"Eswatini [Swaziland]\"},{\"value\":\"EC\",\"label\":\"Ecuador\"},{\"value\":\"EG\",\"label\":\"Egypt\"},{\"value\":\"SV\",\"label\":\"El Salvador\"},{\"value\":\"GQ\",\"label\":\"Equatorial Guinea\"},{\"value\":\"ER\",\"label\":\"Eritrea\"},{\"value\":\"EE\",\"label\":\"Estonia\"},{\"value\":\"ET\",\"label\":\"Ethiopia\"},{\"value\":\"FO\",\"label\":\"Faroe Islands\"},{\"value\":\"FJ\",\"label\":\"Fiji\"},{\"value\":\"FI\",\"label\":\"Finland\"},{\"value\":\"FR\",\"label\":\"France\"},{\"value\":\"GF\",\"label\":\"French Guiana\"},{\"value\":\"PF\",\"label\":\"French Polynesia\"},{\"value\":\"GP\",\"label\":\"French West Indies\"},{\"value\":\"MK\",\"label\":\"North Macedonia\"},{\"value\":\"GA\",\"label\":\"Gabon\"},{\"value\":\"GM\",\"label\":\"Gambia\"},{\"value\":\"GE\",\"label\":\"Georgia\"},{\"value\":\"DE\",\"label\":\"Germany\"},{\"value\":\"GH\",\"label\":\"Ghana\"},{\"value\":\"GI\",\"label\":\"Gibraltar\"},{\"value\":\"GR\",\"label\":\"Greece\"},{\"value\":\"GL\",\"label\":\"Greenland\"},{\"value\":\"GD\",\"label\":\"Grenada\"},{\"value\":\"GU\",\"label\":\"Guam\"},{\"value\":\"GT\",\"label\":\"Guatemala\"},{\"value\":\"GN\",\"label\":\"Guinea\"},{\"value\":\"GW\",\"label\":\"Guinea-Bissau\"},{\"value\":\"GY\",\"label\":\"Guyana\"},{\"value\":\"HT\",\"label\":\"Haiti\"},{\"value\":\"HN\",\"label\":\"Honduras\"},{\"value\":\"HK\",\"label\":\"Hong Kong [SAR China]\"},{\"value\":\"HU\",\"label\":\"Hungary\"},{\"value\":\"IS\",\"label\":\"Iceland\"},{\"value\":\"IN\",\"label\":\"India\"},{\"value\":\"ID\",\"label\":\"Indonesia\"},{\"value\":\"IR\",\"label\":\"Iran\"},{\"value\":\"IQ\",\"label\":\"Iraq\"},{\"value\":\"IE\",\"label\":\"Ireland\"},{\"value\":\"IL\",\"label\":\"Israel\"},{\"value\":\"IT\",\"label\":\"Italy\"},{\"value\":\"JM\",\"label\":\"Jamaica\"},{\"value\":\"JP\",\"label\":\"Japan\"},{\"value\":\"JO\",\"label\":\"Jordan\"},{\"value\":\"KZ\",\"label\":\"Kazakhstan\"},{\"value\":\"KE\",\"label\":\"Kenya\"},{\"value\":\"KI\",\"label\":\"Kiribati\"},{\"value\":\"KP\",\"label\":\"North Korea[Peoples Rep.]\"},{\"value\":\"KR\",\"label\":\"South Korea[Rep.]\"},{\"value\":\"KW\",\"label\":\"Kuwait\"},{\"value\":\"KG\",\"label\":\"Kyrgyzstan\"},{\"value\":\"LA\",\"label\":\"Laos\"},{\"value\":\"LV\",\"label\":\"Latvia\"},{\"value\":\"LB\",\"label\":\"Lebanon\"},{\"value\":\"LS\",\"label\":\"Lesotho\"},{\"value\":\"LR\",\"label\":\"Liberia\"},{\"value\":\"LY\",\"label\":\"Libya\"},{\"value\":\"LI\",\"label\":\"Liechtenstein\"},{\"value\":\"LT\",\"label\":\"Lithuania\"},{\"value\":\"LU\",\"label\":\"Luxembourg\"},{\"value\":\"MO\",\"label\":\"Macao [SAR China]\"},{\"value\":\"MG\",\"label\":\"Madagascar\"},{\"value\":\"MW\",\"label\":\"Malawi\"},{\"value\":\"MY\",\"label\":\"Malaysia\"},{\"value\":\"MV\",\"label\":\"Maldives\"},{\"value\":\"ML\",\"label\":\"Mali\"},{\"value\":\"MT\",\"label\":\"Malta\"},{\"value\":\"MH\",\"label\":\"Marshall Islands\"},{\"value\":\"MR\",\"label\":\"Mauritania\"},{\"value\":\"MU\",\"label\":\"Mauritius\"},{\"value\":\"YT\",\"label\":\"Mayotte\"},{\"value\":\"MX\",\"label\":\"Mexico\"},{\"value\":\"FM\",\"label\":\"Micronesia \"},{\"value\":\"MD\",\"label\":\"Moldova\"},{\"value\":\"MC\",\"label\":\"Monaco\"},{\"value\":\"MN\",\"label\":\"Mongolia\"},{\"value\":\"MS\",\"label\":\"Montserrat\"},{\"value\":\"MA\",\"label\":\"Morocco\"},{\"value\":\"MZ\",\"label\":\"Mozambique\"},{\"value\":\"MM\",\"label\":\"Myanmar\"},{\"value\":\"NA\",\"label\":\"Namibia\"},{\"value\":\"NR\",\"label\":\"Nauru\"},{\"value\":\"NP\",\"label\":\"Nepal\"},{\"value\":\"AN\",\"label\":\"Netherlands Antilles\"},{\"value\":\"NL\",\"label\":\"Netherlands\"},{\"value\":\"NC\",\"label\":\"New Caledonia\"},{\"value\":\"NZ\",\"label\":\"New Zealand\"},{\"value\":\"NI\",\"label\":\"Nicaragua\"},{\"value\":\"NE\",\"label\":\"Niger\"},{\"value\":\"NG\",\"label\":\"Nigeria\"},{\"value\":\"NU\",\"label\":\"Niue\"},{\"value\":\"NF\",\"label\":\"Norfolk Island\"},{\"value\":\"MP\",\"label\":\"Northern Mariana Isl.\"},{\"value\":\"NO\",\"label\":\"Norway\"},{\"value\":\"OM\",\"label\":\"Oman\"},{\"value\":\"PK\",\"label\":\"Pakistan\"},{\"value\":\"PW\",\"label\":\"Palau Islands\"},{\"value\":\"PA\",\"label\":\"Panama\"},{\"value\":\"PG\",\"label\":\"Papua New Guinea\"},{\"value\":\"PY\",\"label\":\"Paraguay\"},{\"value\":\"PE\",\"label\":\"Peru\"},{\"value\":\"PH\",\"label\":\"Philippines\"},{\"value\":\"PL\",\"label\":\"Poland\"},{\"value\":\"PT\",\"label\":\"Portugal\"},{\"value\":\"PR\",\"label\":\"Puerto Rico\"},{\"value\":\"QA\",\"label\":\"Qatar\"},{\"value\":\"RE\",\"label\":\"Reunion\"},{\"value\":\"RO\",\"label\":\"Romania\"},{\"value\":\"RU\",\"label\":\"Russia\"},{\"value\":\"RW\",\"label\":\"Rwanda\"},{\"value\":\"AS\",\"label\":\"Samoa[American]\"},{\"value\":\"WS\",\"label\":\"Samoa\"},{\"value\":\"SM\",\"label\":\"San Marino\"},{\"value\":\"ST\",\"label\":\"Sao Tome & Principe\"},{\"value\":\"SA\",\"label\":\"Saudi Arabia\"},{\"value\":\"SN\",\"label\":\"Senegal\"},{\"value\":\"RS\",\"label\":\"Serbia\"},{\"value\":\"SC\",\"label\":\"Seychelles\"},{\"value\":\"SL\",\"label\":\"Sierra Leone\"},{\"value\":\"SG\",\"label\":\"Singapore\"},{\"value\":\"SK\",\"label\":\"Slovak Republic\"},{\"value\":\"SI\",\"label\":\"Slovenia\"},{\"value\":\"SB\",\"label\":\"Solomon Islands\"},{\"value\":\"SO\",\"label\":\"Somalia\"},{\"value\":\"ZA\",\"label\":\"South Africa\"},{\"value\":\"ES\",\"label\":\"Spain\"},{\"value\":\"LK\",\"label\":\"Sri Lanka\"},{\"value\":\"KN\",\"label\":\"St.Kitts-Nevis\"},{\"value\":\"LC\",\"label\":\"St.Lucia\"},{\"value\":\"VC\",\"label\":\"St.Vincent & Grenadines\"},{\"value\":\"SD\",\"label\":\"Sudan\"},{\"value\":\"ME\",\"label\":\"Montenegro\"},{\"value\":\"SR\",\"label\":\"Suriname\"},{\"value\":\"SS\",\"label\":\"South Sudan\"},{\"value\":\"SE\",\"label\":\"Sweden\"},{\"value\":\"CH\",\"label\":\"Switzerland\"},{\"value\":\"SY\",\"label\":\"Syria\"},{\"value\":\"TW\",\"label\":\"Taiwan[Rep. of China]\"},{\"value\":\"TJ\",\"label\":\"Tajikistan\"},{\"value\":\"TZ\",\"label\":\"Tanzania\"},{\"value\":\"TH\",\"label\":\"Thailand\"},{\"value\":\"TL\",\"label\":\"Timor Leste\"},{\"value\":\"TG\",\"label\":\"Togo\"},{\"value\":\"TO\",\"label\":\"Tonga\"},{\"value\":\"TT\",\"label\":\"Trinidad & Tobago\"},{\"value\":\"TN\",\"label\":\"Tunisia\"},{\"value\":\"TR\",\"label\":\"Turkey\"},{\"value\":\"TM\",\"label\":\"Turkmenistan\"},{\"value\":\"TC\",\"label\":\"Turks & Caicos Isl.\"},{\"value\":\"TV\",\"label\":\"Tuvalu\"},{\"value\":\"UG\",\"label\":\"Uganda\"},{\"value\":\"UA\",\"label\":\"Ukraine\"},{\"value\":\"AE\",\"label\":\"United Arab Emirates\"},{\"value\":\"GB\",\"label\":\"United Kingdom\"},{\"value\":\"US\",\"label\":\"United States\"},{\"value\":\"UY\",\"label\":\"Uruguay\"},{\"value\":\"UZ\",\"label\":\"Uzbekistan\"},{\"value\":\"VU\",\"label\":\"Vanuatu\"},{\"value\":\"VA\",\"label\":\"Vatican\"},{\"value\":\"VE\",\"label\":\"Venezuela\"},{\"value\":\"VN\",\"label\":\"Vietnam\"},{\"value\":\"VI\",\"label\":\"Virgin Islands [U.S.A.]\"},{\"value\":\"VG\",\"label\":\"Virgin Islands [British]\"},{\"value\":\"YE\",\"label\":\"Yemen\"},{\"value\":\"ZM\",\"label\":\"Zambia\"},{\"value\":\"ZW\",\"label\":\"Zimbabwe\"},{\"value\":\"CW\",\"label\":\"Curacao\"},{\"value\":\"SX\",\"label\":\"Sint Maarten\"},{\"value\":\"MF\",\"label\":\"Saint Maarten\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"mother.birth_state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.mother.birth_country === 'US')\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"State\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AK\",\"label\":\"Alaska\"},{\"value\":\"AL\",\"label\":\"Alabama\"},{\"value\":\"AR\",\"label\":\"Arkansas\"},{\"value\":\"ASM\",\"label\":\"American Samoa\"},{\"value\":\"AZ\",\"label\":\"Arizona\"},{\"value\":\"CA-N\",\"label\":\"California North\"},{\"value\":\"CA-S\",\"label\":\"California South\"},{\"value\":\"CO\",\"label\":\"Colorado\"},{\"value\":\"CT\",\"label\":\"Connecticut\"},{\"value\":\"DC\",\"label\":\"District of Columbia\"},{\"value\":\"DE\",\"label\":\"Delaware\"},{\"value\":\"FL\",\"label\":\"Florida\"},{\"value\":\"GA\",\"label\":\"Georgia\"},{\"value\":\"GUM\",\"label\":\"Guam\"},{\"value\":\"HI\",\"label\":\"Hawaii\"},{\"value\":\"IA\",\"label\":\"Iowa\"},{\"value\":\"ID\",\"label\":\"Idaho\"},{\"value\":\"IL\",\"label\":\"Illinois\"},{\"value\":\"IN\",\"label\":\"Indiana\"},{\"value\":\"KS\",\"label\":\"Kansas\"},{\"value\":\"KY\",\"label\":\"Kentucky\"},{\"value\":\"LA\",\"label\":\"Louisiana\"},{\"value\":\"MA\",\"label\":\"Massachusetts\"},{\"value\":\"MD\",\"label\":\"Maryland\"},{\"value\":\"ME\",\"label\":\"Maine\"},{\"value\":\"MI\",\"label\":\"Michigan\"},{\"value\":\"MN\",\"label\":\"Minnesota\"},{\"value\":\"MNP\",\"label\":\"North Mariana Islands\"},{\"value\":\"MO\",\"label\":\"Missouri\"},{\"value\":\"MS\",\"label\":\"Mississippi\"},{\"value\":\"MT\",\"label\":\"Montana\"},{\"value\":\"NC\",\"label\":\"North Carolina\"},{\"value\":\"ND\",\"label\":\"North Dakota\"},{\"value\":\"NE\",\"label\":\"Nebraska\"},{\"value\":\"NH\",\"label\":\"New Hampshire\"},{\"value\":\"NJ\",\"label\":\"New Jersey\"},{\"value\":\"NM\",\"label\":\"New Mexico\"},{\"value\":\"NV\",\"label\":\"Nevada\"},{\"value\":\"NY\",\"label\":\"New York\"},{\"value\":\"OH\",\"label\":\"Ohio\"},{\"value\":\"OK\",\"label\":\"Oklahoma\"},{\"value\":\"OR\",\"label\":\"Oregon\"},{\"value\":\"PA\",\"label\":\"Pennsylvania\"},{\"value\":\"PRI\",\"label\":\"Puerto Rico\"},{\"value\":\"RI\",\"label\":\"Rhode Island\"},{\"value\":\"SC\",\"label\":\"South Carolina\"},{\"value\":\"SD\",\"label\":\"South Dakota\"},{\"value\":\"TN\",\"label\":\"Tennessee\"},{\"value\":\"TX\",\"label\":\"Texas\"},{\"value\":\"UT\",\"label\":\"Utah\"},{\"value\":\"VA\",\"label\":\"Virginia\"},{\"value\":\"VIR\",\"label\":\"U.S. Virgin Islands\"},{\"value\":\"VT\",\"label\":\"Vermont\"},{\"value\":\"WA\",\"label\":\"Washington\"},{\"value\":\"WI\",\"label\":\"Wisconsin\"},{\"value\":\"WV\",\"label\":\"West Virginia\"},{\"value\":\"WY\",\"label\":\"Wyoming\"},{\"value\":\"XMI\",\"label\":\"Midway Islands\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"mother.birth_state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.mother.birth_country === 'CA')\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Province\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\"label\": \"Florida\", \"value\": \"FL\"},\n\t\t\t\t\t\t\t\t\t\t\t\t{\"label\": \"Georgia\", \"value\": \"GA\"}\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"mother.birth_city\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"City\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Are they a U.S. Citizen?
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"mother.us_citizen\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"No\"}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"!(model.mother && model.mother.unknown === 'no')\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-father-information\",\n\t\t\t\t\t\"id\": \"father_information\",\n\t\t\t\t\t\"hide\": \"!(model.issued_passports === 'none' || (model.issued_passports === 'book' && (model.passport && model.passport.in_possession !== 'yes' || (model.passport.in_possession === 'yes' && model.passport.is_damaged === 'yes') || dt.now().minus({years: 15}) > dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy') || dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))) || (model.issued_passports === 'card' && (model.passport_card && model.passport_card.in_possession !== 'yes' || (model.passport_card.in_possession === 'yes' && model.passport_card.is_damaged === 'yes') || dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))) || (model.issued_passports === 'both' && model.passport && model.passport_card && ( model.passport.in_possession !== 'yes' || model.passport_card.in_possession !== 'yes' || (model.passport.in_possession === 'yes' && model.passport_card.in_possession === 'yes' && (dt.now().minus({years: 15}) > dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy') || dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy') || model.passport.is_damaged === 'yes') && (dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy') || model.passport_card.is_damaged === 'yes')))))\",\n\t\t\t\t\t\"label\": \"Are you able to provide information about your Father\\/Parent?\",\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"father.unknown\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"No\"}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"father.first_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"father.last_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"key\": \"father.date_of_birth\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Date of Birth\",\n\t\t\t\t\t\t\t\t\t\"maxDateKey\": \"date_of_birth\",\n\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\"view\": \"year\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\"min\": \"Date can\\u2019t be after applicant\\u2019s date of birth\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Birthplace
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"father.birth_country\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Country\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AF\",\"label\":\"Afghanistan\"},{\"value\":\"AL\",\"label\":\"Albania\"},{\"value\":\"DZ\",\"label\":\"Algeria\"},{\"value\":\"AD\",\"label\":\"Andorra\"},{\"value\":\"AO\",\"label\":\"Angola\"},{\"value\":\"AI\",\"label\":\"Anguilla\"},{\"value\":\"AG\",\"label\":\"Antigua and Barbuda\"},{\"value\":\"AR\",\"label\":\"Argentina\"},{\"value\":\"AM\",\"label\":\"Armenia\"},{\"value\":\"AW\",\"label\":\"Aruba\"},{\"value\":\"AU\",\"label\":\"Australia\"},{\"value\":\"AT\",\"label\":\"Austria\"},{\"value\":\"AZ\",\"label\":\"Azerbaijan\"},{\"value\":\"BS\",\"label\":\"Bahamas\"},{\"value\":\"BH\",\"label\":\"Bahrain\"},{\"value\":\"BD\",\"label\":\"Bangladesh\"},{\"value\":\"BB\",\"label\":\"Barbados\"},{\"value\":\"BY\",\"label\":\"Belarus\"},{\"value\":\"BE\",\"label\":\"Belgium\"},{\"value\":\"BZ\",\"label\":\"Belize\"},{\"value\":\"BJ\",\"label\":\"Benin\"},{\"value\":\"BM\",\"label\":\"Bermuda\"},{\"value\":\"BT\",\"label\":\"Bhutan\"},{\"value\":\"BO\",\"label\":\"Bolivia\"},{\"value\":\"BA\",\"label\":\"Bosnia Herzegovina\"},{\"value\":\"BW\",\"label\":\"Botswana\"},{\"value\":\"BR\",\"label\":\"Brazil\"},{\"value\":\"BN\",\"label\":\"Brunei\"},{\"value\":\"BG\",\"label\":\"Bulgaria\"},{\"value\":\"BF\",\"label\":\"Burkina Faso\"},{\"value\":\"BI\",\"label\":\"Burundi\"},{\"value\":\"KH\",\"label\":\"Cambodia\"},{\"value\":\"CM\",\"label\":\"Cameroon\"},{\"value\":\"CA\",\"label\":\"Canada\"},{\"value\":\"CV\",\"label\":\"Cape Verde\"},{\"value\":\"KY\",\"label\":\"Cayman Islands\"},{\"value\":\"CF\",\"label\":\"Central African Republic\"},{\"value\":\"TD\",\"label\":\"Chad\"},{\"value\":\"CL\",\"label\":\"Chile\"},{\"value\":\"CN\",\"label\":\"China\"},{\"value\":\"CO\",\"label\":\"Colombia\"},{\"value\":\"KM\",\"label\":\"Comores Islands\"},{\"value\":\"CG\",\"label\":\"Congo[Brazzaville]\"},{\"value\":\"CD\",\"label\":\"Congo[Kinshasa]\"},{\"value\":\"CK\",\"label\":\"Cook Islands\"},{\"value\":\"CR\",\"label\":\"Costa Rica\"},{\"value\":\"CI\",\"label\":\"Cote dIvoire\"},{\"value\":\"HR\",\"label\":\"Croatia\"},{\"value\":\"CU\",\"label\":\"Cuba\"},{\"value\":\"CY\",\"label\":\"Cyprus\"},{\"value\":\"CZ\",\"label\":\"Czech Republic\"},{\"value\":\"DK\",\"label\":\"Denmark\"},{\"value\":\"DJ\",\"label\":\"Djibouti\"},{\"value\":\"DM\",\"label\":\"Dominica\"},{\"value\":\"DO\",\"label\":\"Dominican Republic\"},{\"value\":\"SZ\",\"label\":\"Eswatini [Swaziland]\"},{\"value\":\"EC\",\"label\":\"Ecuador\"},{\"value\":\"EG\",\"label\":\"Egypt\"},{\"value\":\"SV\",\"label\":\"El Salvador\"},{\"value\":\"GQ\",\"label\":\"Equatorial Guinea\"},{\"value\":\"ER\",\"label\":\"Eritrea\"},{\"value\":\"EE\",\"label\":\"Estonia\"},{\"value\":\"ET\",\"label\":\"Ethiopia\"},{\"value\":\"FO\",\"label\":\"Faroe Islands\"},{\"value\":\"FJ\",\"label\":\"Fiji\"},{\"value\":\"FI\",\"label\":\"Finland\"},{\"value\":\"FR\",\"label\":\"France\"},{\"value\":\"GF\",\"label\":\"French Guiana\"},{\"value\":\"PF\",\"label\":\"French Polynesia\"},{\"value\":\"GP\",\"label\":\"French West Indies\"},{\"value\":\"MK\",\"label\":\"North Macedonia\"},{\"value\":\"GA\",\"label\":\"Gabon\"},{\"value\":\"GM\",\"label\":\"Gambia\"},{\"value\":\"GE\",\"label\":\"Georgia\"},{\"value\":\"DE\",\"label\":\"Germany\"},{\"value\":\"GH\",\"label\":\"Ghana\"},{\"value\":\"GI\",\"label\":\"Gibraltar\"},{\"value\":\"GR\",\"label\":\"Greece\"},{\"value\":\"GL\",\"label\":\"Greenland\"},{\"value\":\"GD\",\"label\":\"Grenada\"},{\"value\":\"GU\",\"label\":\"Guam\"},{\"value\":\"GT\",\"label\":\"Guatemala\"},{\"value\":\"GN\",\"label\":\"Guinea\"},{\"value\":\"GW\",\"label\":\"Guinea-Bissau\"},{\"value\":\"GY\",\"label\":\"Guyana\"},{\"value\":\"HT\",\"label\":\"Haiti\"},{\"value\":\"HN\",\"label\":\"Honduras\"},{\"value\":\"HK\",\"label\":\"Hong Kong [SAR China]\"},{\"value\":\"HU\",\"label\":\"Hungary\"},{\"value\":\"IS\",\"label\":\"Iceland\"},{\"value\":\"IN\",\"label\":\"India\"},{\"value\":\"ID\",\"label\":\"Indonesia\"},{\"value\":\"IR\",\"label\":\"Iran\"},{\"value\":\"IQ\",\"label\":\"Iraq\"},{\"value\":\"IE\",\"label\":\"Ireland\"},{\"value\":\"IL\",\"label\":\"Israel\"},{\"value\":\"IT\",\"label\":\"Italy\"},{\"value\":\"JM\",\"label\":\"Jamaica\"},{\"value\":\"JP\",\"label\":\"Japan\"},{\"value\":\"JO\",\"label\":\"Jordan\"},{\"value\":\"KZ\",\"label\":\"Kazakhstan\"},{\"value\":\"KE\",\"label\":\"Kenya\"},{\"value\":\"KI\",\"label\":\"Kiribati\"},{\"value\":\"KP\",\"label\":\"North Korea[Peoples Rep.]\"},{\"value\":\"KR\",\"label\":\"South Korea[Rep.]\"},{\"value\":\"KW\",\"label\":\"Kuwait\"},{\"value\":\"KG\",\"label\":\"Kyrgyzstan\"},{\"value\":\"LA\",\"label\":\"Laos\"},{\"value\":\"LV\",\"label\":\"Latvia\"},{\"value\":\"LB\",\"label\":\"Lebanon\"},{\"value\":\"LS\",\"label\":\"Lesotho\"},{\"value\":\"LR\",\"label\":\"Liberia\"},{\"value\":\"LY\",\"label\":\"Libya\"},{\"value\":\"LI\",\"label\":\"Liechtenstein\"},{\"value\":\"LT\",\"label\":\"Lithuania\"},{\"value\":\"LU\",\"label\":\"Luxembourg\"},{\"value\":\"MO\",\"label\":\"Macao [SAR China]\"},{\"value\":\"MG\",\"label\":\"Madagascar\"},{\"value\":\"MW\",\"label\":\"Malawi\"},{\"value\":\"MY\",\"label\":\"Malaysia\"},{\"value\":\"MV\",\"label\":\"Maldives\"},{\"value\":\"ML\",\"label\":\"Mali\"},{\"value\":\"MT\",\"label\":\"Malta\"},{\"value\":\"MH\",\"label\":\"Marshall Islands\"},{\"value\":\"MR\",\"label\":\"Mauritania\"},{\"value\":\"MU\",\"label\":\"Mauritius\"},{\"value\":\"YT\",\"label\":\"Mayotte\"},{\"value\":\"MX\",\"label\":\"Mexico\"},{\"value\":\"FM\",\"label\":\"Micronesia \"},{\"value\":\"MD\",\"label\":\"Moldova\"},{\"value\":\"MC\",\"label\":\"Monaco\"},{\"value\":\"MN\",\"label\":\"Mongolia\"},{\"value\":\"MS\",\"label\":\"Montserrat\"},{\"value\":\"MA\",\"label\":\"Morocco\"},{\"value\":\"MZ\",\"label\":\"Mozambique\"},{\"value\":\"MM\",\"label\":\"Myanmar\"},{\"value\":\"NA\",\"label\":\"Namibia\"},{\"value\":\"NR\",\"label\":\"Nauru\"},{\"value\":\"NP\",\"label\":\"Nepal\"},{\"value\":\"AN\",\"label\":\"Netherlands Antilles\"},{\"value\":\"NL\",\"label\":\"Netherlands\"},{\"value\":\"NC\",\"label\":\"New Caledonia\"},{\"value\":\"NZ\",\"label\":\"New Zealand\"},{\"value\":\"NI\",\"label\":\"Nicaragua\"},{\"value\":\"NE\",\"label\":\"Niger\"},{\"value\":\"NG\",\"label\":\"Nigeria\"},{\"value\":\"NU\",\"label\":\"Niue\"},{\"value\":\"NF\",\"label\":\"Norfolk Island\"},{\"value\":\"MP\",\"label\":\"Northern Mariana Isl.\"},{\"value\":\"NO\",\"label\":\"Norway\"},{\"value\":\"OM\",\"label\":\"Oman\"},{\"value\":\"PK\",\"label\":\"Pakistan\"},{\"value\":\"PW\",\"label\":\"Palau Islands\"},{\"value\":\"PA\",\"label\":\"Panama\"},{\"value\":\"PG\",\"label\":\"Papua New Guinea\"},{\"value\":\"PY\",\"label\":\"Paraguay\"},{\"value\":\"PE\",\"label\":\"Peru\"},{\"value\":\"PH\",\"label\":\"Philippines\"},{\"value\":\"PL\",\"label\":\"Poland\"},{\"value\":\"PT\",\"label\":\"Portugal\"},{\"value\":\"PR\",\"label\":\"Puerto Rico\"},{\"value\":\"QA\",\"label\":\"Qatar\"},{\"value\":\"RE\",\"label\":\"Reunion\"},{\"value\":\"RO\",\"label\":\"Romania\"},{\"value\":\"RU\",\"label\":\"Russia\"},{\"value\":\"RW\",\"label\":\"Rwanda\"},{\"value\":\"AS\",\"label\":\"Samoa[American]\"},{\"value\":\"WS\",\"label\":\"Samoa\"},{\"value\":\"SM\",\"label\":\"San Marino\"},{\"value\":\"ST\",\"label\":\"Sao Tome & Principe\"},{\"value\":\"SA\",\"label\":\"Saudi Arabia\"},{\"value\":\"SN\",\"label\":\"Senegal\"},{\"value\":\"RS\",\"label\":\"Serbia\"},{\"value\":\"SC\",\"label\":\"Seychelles\"},{\"value\":\"SL\",\"label\":\"Sierra Leone\"},{\"value\":\"SG\",\"label\":\"Singapore\"},{\"value\":\"SK\",\"label\":\"Slovak Republic\"},{\"value\":\"SI\",\"label\":\"Slovenia\"},{\"value\":\"SB\",\"label\":\"Solomon Islands\"},{\"value\":\"SO\",\"label\":\"Somalia\"},{\"value\":\"ZA\",\"label\":\"South Africa\"},{\"value\":\"ES\",\"label\":\"Spain\"},{\"value\":\"LK\",\"label\":\"Sri Lanka\"},{\"value\":\"KN\",\"label\":\"St.Kitts-Nevis\"},{\"value\":\"LC\",\"label\":\"St.Lucia\"},{\"value\":\"VC\",\"label\":\"St.Vincent & Grenadines\"},{\"value\":\"SD\",\"label\":\"Sudan\"},{\"value\":\"ME\",\"label\":\"Montenegro\"},{\"value\":\"SR\",\"label\":\"Suriname\"},{\"value\":\"SS\",\"label\":\"South Sudan\"},{\"value\":\"SE\",\"label\":\"Sweden\"},{\"value\":\"CH\",\"label\":\"Switzerland\"},{\"value\":\"SY\",\"label\":\"Syria\"},{\"value\":\"TW\",\"label\":\"Taiwan[Rep. of China]\"},{\"value\":\"TJ\",\"label\":\"Tajikistan\"},{\"value\":\"TZ\",\"label\":\"Tanzania\"},{\"value\":\"TH\",\"label\":\"Thailand\"},{\"value\":\"TL\",\"label\":\"Timor Leste\"},{\"value\":\"TG\",\"label\":\"Togo\"},{\"value\":\"TO\",\"label\":\"Tonga\"},{\"value\":\"TT\",\"label\":\"Trinidad & Tobago\"},{\"value\":\"TN\",\"label\":\"Tunisia\"},{\"value\":\"TR\",\"label\":\"Turkey\"},{\"value\":\"TM\",\"label\":\"Turkmenistan\"},{\"value\":\"TC\",\"label\":\"Turks & Caicos Isl.\"},{\"value\":\"TV\",\"label\":\"Tuvalu\"},{\"value\":\"UG\",\"label\":\"Uganda\"},{\"value\":\"UA\",\"label\":\"Ukraine\"},{\"value\":\"AE\",\"label\":\"United Arab Emirates\"},{\"value\":\"GB\",\"label\":\"United Kingdom\"},{\"value\":\"US\",\"label\":\"United States\"},{\"value\":\"UY\",\"label\":\"Uruguay\"},{\"value\":\"UZ\",\"label\":\"Uzbekistan\"},{\"value\":\"VU\",\"label\":\"Vanuatu\"},{\"value\":\"VA\",\"label\":\"Vatican\"},{\"value\":\"VE\",\"label\":\"Venezuela\"},{\"value\":\"VN\",\"label\":\"Vietnam\"},{\"value\":\"VI\",\"label\":\"Virgin Islands [U.S.A.]\"},{\"value\":\"VG\",\"label\":\"Virgin Islands [British]\"},{\"value\":\"YE\",\"label\":\"Yemen\"},{\"value\":\"ZM\",\"label\":\"Zambia\"},{\"value\":\"ZW\",\"label\":\"Zimbabwe\"},{\"value\":\"CW\",\"label\":\"Curacao\"},{\"value\":\"SX\",\"label\":\"Sint Maarten\"},{\"value\":\"MF\",\"label\":\"Saint Maarten\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"father.birth_state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.father.birth_country === 'US')\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"State\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AK\",\"label\":\"Alaska\"},{\"value\":\"AL\",\"label\":\"Alabama\"},{\"value\":\"AR\",\"label\":\"Arkansas\"},{\"value\":\"ASM\",\"label\":\"American Samoa\"},{\"value\":\"AZ\",\"label\":\"Arizona\"},{\"value\":\"CA-N\",\"label\":\"California North\"},{\"value\":\"CA-S\",\"label\":\"California South\"},{\"value\":\"CO\",\"label\":\"Colorado\"},{\"value\":\"CT\",\"label\":\"Connecticut\"},{\"value\":\"DC\",\"label\":\"District of Columbia\"},{\"value\":\"DE\",\"label\":\"Delaware\"},{\"value\":\"FL\",\"label\":\"Florida\"},{\"value\":\"GA\",\"label\":\"Georgia\"},{\"value\":\"GUM\",\"label\":\"Guam\"},{\"value\":\"HI\",\"label\":\"Hawaii\"},{\"value\":\"IA\",\"label\":\"Iowa\"},{\"value\":\"ID\",\"label\":\"Idaho\"},{\"value\":\"IL\",\"label\":\"Illinois\"},{\"value\":\"IN\",\"label\":\"Indiana\"},{\"value\":\"KS\",\"label\":\"Kansas\"},{\"value\":\"KY\",\"label\":\"Kentucky\"},{\"value\":\"LA\",\"label\":\"Louisiana\"},{\"value\":\"MA\",\"label\":\"Massachusetts\"},{\"value\":\"MD\",\"label\":\"Maryland\"},{\"value\":\"ME\",\"label\":\"Maine\"},{\"value\":\"MI\",\"label\":\"Michigan\"},{\"value\":\"MN\",\"label\":\"Minnesota\"},{\"value\":\"MNP\",\"label\":\"North Mariana Islands\"},{\"value\":\"MO\",\"label\":\"Missouri\"},{\"value\":\"MS\",\"label\":\"Mississippi\"},{\"value\":\"MT\",\"label\":\"Montana\"},{\"value\":\"NC\",\"label\":\"North Carolina\"},{\"value\":\"ND\",\"label\":\"North Dakota\"},{\"value\":\"NE\",\"label\":\"Nebraska\"},{\"value\":\"NH\",\"label\":\"New Hampshire\"},{\"value\":\"NJ\",\"label\":\"New Jersey\"},{\"value\":\"NM\",\"label\":\"New Mexico\"},{\"value\":\"NV\",\"label\":\"Nevada\"},{\"value\":\"NY\",\"label\":\"New York\"},{\"value\":\"OH\",\"label\":\"Ohio\"},{\"value\":\"OK\",\"label\":\"Oklahoma\"},{\"value\":\"OR\",\"label\":\"Oregon\"},{\"value\":\"PA\",\"label\":\"Pennsylvania\"},{\"value\":\"PRI\",\"label\":\"Puerto Rico\"},{\"value\":\"RI\",\"label\":\"Rhode Island\"},{\"value\":\"SC\",\"label\":\"South Carolina\"},{\"value\":\"SD\",\"label\":\"South Dakota\"},{\"value\":\"TN\",\"label\":\"Tennessee\"},{\"value\":\"TX\",\"label\":\"Texas\"},{\"value\":\"UT\",\"label\":\"Utah\"},{\"value\":\"VA\",\"label\":\"Virginia\"},{\"value\":\"VIR\",\"label\":\"U.S. Virgin Islands\"},{\"value\":\"VT\",\"label\":\"Vermont\"},{\"value\":\"WA\",\"label\":\"Washington\"},{\"value\":\"WI\",\"label\":\"Wisconsin\"},{\"value\":\"WV\",\"label\":\"West Virginia\"},{\"value\":\"WY\",\"label\":\"Wyoming\"},{\"value\":\"XMI\",\"label\":\"Midway Islands\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"father.birth_state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.father.birth_country === 'CA')\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Province\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\"label\": \"Florida\", \"value\": \"FL\"},\n\t\t\t\t\t\t\t\t\t\t\t\t{\"label\": \"Georgia\", \"value\": \"GA\"}\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"father.birth_city\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"City\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Are they a U.S. Citizen?
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"father.us_citizen\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"No\"}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"!(model.father && model.father.unknown === 'no')\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-marital-status\",\n\t\t\t\t\t\"id\": \"marital_status\",\n\t\t\t\t\t\"hide\": \"!(model.issued_passports === 'none' || (model.issued_passports === 'book' && (model.passport && model.passport.in_possession !== 'yes' || (model.passport.in_possession === 'yes' && model.passport.is_damaged === 'yes') || dt.now().minus({years: 15}) > dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy') || dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))) || (model.issued_passports === 'card' && (model.passport_card && model.passport_card.in_possession !== 'yes' || (model.passport_card.in_possession === 'yes' && model.passport_card.is_damaged === 'yes') || dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))) || (model.issued_passports === 'both' && model.passport && model.passport_card && ( model.passport.in_possession !== 'yes' || model.passport_card.in_possession !== 'yes' || (model.passport.in_possession === 'yes' && model.passport_card.in_possession === 'yes' && (dt.now().minus({years: 15}) > dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy') || dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy') || model.passport.is_damaged === 'yes') && (dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy') || model.passport_card.is_damaged === 'yes')))))\",\n\t\t\t\t\t\"label\": \"Are you currently married?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"married.answer\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"No\"}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"key\": \"married.date\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Date of Marriage\",\n\t\t\t\t\t\t\t\t\t\"view\": \"year\",\n\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t// \"validators\": {\n\t\t\t\t\t\t\t\t// \t\"before_applicant_dob\": {\n\t\t\t\t\t\t\t\t// \t\t\"message\": \"'Date can\\u2019t be before applicant\\u2019s date of birth'\",\n\t\t\t\t\t\t\t\t// \t\t\"expression\": \"model.date_of_birth.value && moment($modelValue, ['MM\\/DD\\/YYYY', moment.ISO_8601]).isSameOrAfter(moment(model.date_of_birth.value, ['MM\\/DD\\/YYYY', moment.ISO_8601]))\"\n\t\t\t\t\t\t\t\t// \t},\n\t\t\t\t\t\t\t\t// \t\"before_spouse_dob\": {\n\t\t\t\t\t\t\t\t// \t\t\"message\": \"'Date can\\u2019t be before spouse\\u2019s date of birth'\",\n\t\t\t\t\t\t\t\t// \t\t\"expression\": \"model.married.spouse.date_of_birth.value && moment($modelValue, ['MM\\/DD\\/YYYY', moment.ISO_8601]).isAfter(moment(model.married.spouse.date_of_birth.value, ['MM\\/DD\\/YYYY', moment.ISO_8601]))\"\n\t\t\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t\t\t// },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Please provide information about your spouse.
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"married.spouse.first_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"married.spouse.last_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"key\": \"married.spouse.date_of_birth\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Date of Birth\",\n\t\t\t\t\t\t\t\t\t\"maxDateKey\": \"date_of_birth\",\n\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\"view\": \"year\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\"min\": \"Date can\\u2019t be after applicant\\u2019s date of birth\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Birthplace
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--small\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"married.spouse.birth_country\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Country\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AF\",\"label\":\"Afghanistan\"},{\"value\":\"AL\",\"label\":\"Albania\"},{\"value\":\"DZ\",\"label\":\"Algeria\"},{\"value\":\"AD\",\"label\":\"Andorra\"},{\"value\":\"AO\",\"label\":\"Angola\"},{\"value\":\"AI\",\"label\":\"Anguilla\"},{\"value\":\"AG\",\"label\":\"Antigua and Barbuda\"},{\"value\":\"AR\",\"label\":\"Argentina\"},{\"value\":\"AM\",\"label\":\"Armenia\"},{\"value\":\"AW\",\"label\":\"Aruba\"},{\"value\":\"AU\",\"label\":\"Australia\"},{\"value\":\"AT\",\"label\":\"Austria\"},{\"value\":\"AZ\",\"label\":\"Azerbaijan\"},{\"value\":\"BS\",\"label\":\"Bahamas\"},{\"value\":\"BH\",\"label\":\"Bahrain\"},{\"value\":\"BD\",\"label\":\"Bangladesh\"},{\"value\":\"BB\",\"label\":\"Barbados\"},{\"value\":\"BY\",\"label\":\"Belarus\"},{\"value\":\"BE\",\"label\":\"Belgium\"},{\"value\":\"BZ\",\"label\":\"Belize\"},{\"value\":\"BJ\",\"label\":\"Benin\"},{\"value\":\"BM\",\"label\":\"Bermuda\"},{\"value\":\"BT\",\"label\":\"Bhutan\"},{\"value\":\"BO\",\"label\":\"Bolivia\"},{\"value\":\"BA\",\"label\":\"Bosnia Herzegovina\"},{\"value\":\"BW\",\"label\":\"Botswana\"},{\"value\":\"BR\",\"label\":\"Brazil\"},{\"value\":\"BN\",\"label\":\"Brunei\"},{\"value\":\"BG\",\"label\":\"Bulgaria\"},{\"value\":\"BF\",\"label\":\"Burkina Faso\"},{\"value\":\"BI\",\"label\":\"Burundi\"},{\"value\":\"KH\",\"label\":\"Cambodia\"},{\"value\":\"CM\",\"label\":\"Cameroon\"},{\"value\":\"CA\",\"label\":\"Canada\"},{\"value\":\"CV\",\"label\":\"Cape Verde\"},{\"value\":\"KY\",\"label\":\"Cayman Islands\"},{\"value\":\"CF\",\"label\":\"Central African Republic\"},{\"value\":\"TD\",\"label\":\"Chad\"},{\"value\":\"CL\",\"label\":\"Chile\"},{\"value\":\"CN\",\"label\":\"China\"},{\"value\":\"CO\",\"label\":\"Colombia\"},{\"value\":\"KM\",\"label\":\"Comores Islands\"},{\"value\":\"CG\",\"label\":\"Congo[Brazzaville]\"},{\"value\":\"CD\",\"label\":\"Congo[Kinshasa]\"},{\"value\":\"CK\",\"label\":\"Cook Islands\"},{\"value\":\"CR\",\"label\":\"Costa Rica\"},{\"value\":\"CI\",\"label\":\"Cote dIvoire\"},{\"value\":\"HR\",\"label\":\"Croatia\"},{\"value\":\"CU\",\"label\":\"Cuba\"},{\"value\":\"CY\",\"label\":\"Cyprus\"},{\"value\":\"CZ\",\"label\":\"Czech Republic\"},{\"value\":\"DK\",\"label\":\"Denmark\"},{\"value\":\"DJ\",\"label\":\"Djibouti\"},{\"value\":\"DM\",\"label\":\"Dominica\"},{\"value\":\"DO\",\"label\":\"Dominican Republic\"},{\"value\":\"SZ\",\"label\":\"Eswatini [Swaziland]\"},{\"value\":\"EC\",\"label\":\"Ecuador\"},{\"value\":\"EG\",\"label\":\"Egypt\"},{\"value\":\"SV\",\"label\":\"El Salvador\"},{\"value\":\"GQ\",\"label\":\"Equatorial Guinea\"},{\"value\":\"ER\",\"label\":\"Eritrea\"},{\"value\":\"EE\",\"label\":\"Estonia\"},{\"value\":\"ET\",\"label\":\"Ethiopia\"},{\"value\":\"FO\",\"label\":\"Faroe Islands\"},{\"value\":\"FJ\",\"label\":\"Fiji\"},{\"value\":\"FI\",\"label\":\"Finland\"},{\"value\":\"FR\",\"label\":\"France\"},{\"value\":\"GF\",\"label\":\"French Guiana\"},{\"value\":\"PF\",\"label\":\"French Polynesia\"},{\"value\":\"GP\",\"label\":\"French West Indies\"},{\"value\":\"MK\",\"label\":\"North Macedonia\"},{\"value\":\"GA\",\"label\":\"Gabon\"},{\"value\":\"GM\",\"label\":\"Gambia\"},{\"value\":\"GE\",\"label\":\"Georgia\"},{\"value\":\"DE\",\"label\":\"Germany\"},{\"value\":\"GH\",\"label\":\"Ghana\"},{\"value\":\"GI\",\"label\":\"Gibraltar\"},{\"value\":\"GR\",\"label\":\"Greece\"},{\"value\":\"GL\",\"label\":\"Greenland\"},{\"value\":\"GD\",\"label\":\"Grenada\"},{\"value\":\"GU\",\"label\":\"Guam\"},{\"value\":\"GT\",\"label\":\"Guatemala\"},{\"value\":\"GN\",\"label\":\"Guinea\"},{\"value\":\"GW\",\"label\":\"Guinea-Bissau\"},{\"value\":\"GY\",\"label\":\"Guyana\"},{\"value\":\"HT\",\"label\":\"Haiti\"},{\"value\":\"HN\",\"label\":\"Honduras\"},{\"value\":\"HK\",\"label\":\"Hong Kong [SAR China]\"},{\"value\":\"HU\",\"label\":\"Hungary\"},{\"value\":\"IS\",\"label\":\"Iceland\"},{\"value\":\"IN\",\"label\":\"India\"},{\"value\":\"ID\",\"label\":\"Indonesia\"},{\"value\":\"IR\",\"label\":\"Iran\"},{\"value\":\"IQ\",\"label\":\"Iraq\"},{\"value\":\"IE\",\"label\":\"Ireland\"},{\"value\":\"IL\",\"label\":\"Israel\"},{\"value\":\"IT\",\"label\":\"Italy\"},{\"value\":\"JM\",\"label\":\"Jamaica\"},{\"value\":\"JP\",\"label\":\"Japan\"},{\"value\":\"JO\",\"label\":\"Jordan\"},{\"value\":\"KZ\",\"label\":\"Kazakhstan\"},{\"value\":\"KE\",\"label\":\"Kenya\"},{\"value\":\"KI\",\"label\":\"Kiribati\"},{\"value\":\"KP\",\"label\":\"North Korea[Peoples Rep.]\"},{\"value\":\"KR\",\"label\":\"South Korea[Rep.]\"},{\"value\":\"KW\",\"label\":\"Kuwait\"},{\"value\":\"KG\",\"label\":\"Kyrgyzstan\"},{\"value\":\"LA\",\"label\":\"Laos\"},{\"value\":\"LV\",\"label\":\"Latvia\"},{\"value\":\"LB\",\"label\":\"Lebanon\"},{\"value\":\"LS\",\"label\":\"Lesotho\"},{\"value\":\"LR\",\"label\":\"Liberia\"},{\"value\":\"LY\",\"label\":\"Libya\"},{\"value\":\"LI\",\"label\":\"Liechtenstein\"},{\"value\":\"LT\",\"label\":\"Lithuania\"},{\"value\":\"LU\",\"label\":\"Luxembourg\"},{\"value\":\"MO\",\"label\":\"Macao [SAR China]\"},{\"value\":\"MG\",\"label\":\"Madagascar\"},{\"value\":\"MW\",\"label\":\"Malawi\"},{\"value\":\"MY\",\"label\":\"Malaysia\"},{\"value\":\"MV\",\"label\":\"Maldives\"},{\"value\":\"ML\",\"label\":\"Mali\"},{\"value\":\"MT\",\"label\":\"Malta\"},{\"value\":\"MH\",\"label\":\"Marshall Islands\"},{\"value\":\"MR\",\"label\":\"Mauritania\"},{\"value\":\"MU\",\"label\":\"Mauritius\"},{\"value\":\"YT\",\"label\":\"Mayotte\"},{\"value\":\"MX\",\"label\":\"Mexico\"},{\"value\":\"FM\",\"label\":\"Micronesia \"},{\"value\":\"MD\",\"label\":\"Moldova\"},{\"value\":\"MC\",\"label\":\"Monaco\"},{\"value\":\"MN\",\"label\":\"Mongolia\"},{\"value\":\"MS\",\"label\":\"Montserrat\"},{\"value\":\"MA\",\"label\":\"Morocco\"},{\"value\":\"MZ\",\"label\":\"Mozambique\"},{\"value\":\"MM\",\"label\":\"Myanmar\"},{\"value\":\"NA\",\"label\":\"Namibia\"},{\"value\":\"NR\",\"label\":\"Nauru\"},{\"value\":\"NP\",\"label\":\"Nepal\"},{\"value\":\"AN\",\"label\":\"Netherlands Antilles\"},{\"value\":\"NL\",\"label\":\"Netherlands\"},{\"value\":\"NC\",\"label\":\"New Caledonia\"},{\"value\":\"NZ\",\"label\":\"New Zealand\"},{\"value\":\"NI\",\"label\":\"Nicaragua\"},{\"value\":\"NE\",\"label\":\"Niger\"},{\"value\":\"NG\",\"label\":\"Nigeria\"},{\"value\":\"NU\",\"label\":\"Niue\"},{\"value\":\"NF\",\"label\":\"Norfolk Island\"},{\"value\":\"MP\",\"label\":\"Northern Mariana Isl.\"},{\"value\":\"NO\",\"label\":\"Norway\"},{\"value\":\"OM\",\"label\":\"Oman\"},{\"value\":\"PK\",\"label\":\"Pakistan\"},{\"value\":\"PW\",\"label\":\"Palau Islands\"},{\"value\":\"PA\",\"label\":\"Panama\"},{\"value\":\"PG\",\"label\":\"Papua New Guinea\"},{\"value\":\"PY\",\"label\":\"Paraguay\"},{\"value\":\"PE\",\"label\":\"Peru\"},{\"value\":\"PH\",\"label\":\"Philippines\"},{\"value\":\"PL\",\"label\":\"Poland\"},{\"value\":\"PT\",\"label\":\"Portugal\"},{\"value\":\"PR\",\"label\":\"Puerto Rico\"},{\"value\":\"QA\",\"label\":\"Qatar\"},{\"value\":\"RE\",\"label\":\"Reunion\"},{\"value\":\"RO\",\"label\":\"Romania\"},{\"value\":\"RU\",\"label\":\"Russia\"},{\"value\":\"RW\",\"label\":\"Rwanda\"},{\"value\":\"AS\",\"label\":\"Samoa[American]\"},{\"value\":\"WS\",\"label\":\"Samoa\"},{\"value\":\"SM\",\"label\":\"San Marino\"},{\"value\":\"ST\",\"label\":\"Sao Tome & Principe\"},{\"value\":\"SA\",\"label\":\"Saudi Arabia\"},{\"value\":\"SN\",\"label\":\"Senegal\"},{\"value\":\"RS\",\"label\":\"Serbia\"},{\"value\":\"SC\",\"label\":\"Seychelles\"},{\"value\":\"SL\",\"label\":\"Sierra Leone\"},{\"value\":\"SG\",\"label\":\"Singapore\"},{\"value\":\"SK\",\"label\":\"Slovak Republic\"},{\"value\":\"SI\",\"label\":\"Slovenia\"},{\"value\":\"SB\",\"label\":\"Solomon Islands\"},{\"value\":\"SO\",\"label\":\"Somalia\"},{\"value\":\"ZA\",\"label\":\"South Africa\"},{\"value\":\"ES\",\"label\":\"Spain\"},{\"value\":\"LK\",\"label\":\"Sri Lanka\"},{\"value\":\"KN\",\"label\":\"St.Kitts-Nevis\"},{\"value\":\"LC\",\"label\":\"St.Lucia\"},{\"value\":\"VC\",\"label\":\"St.Vincent & Grenadines\"},{\"value\":\"SD\",\"label\":\"Sudan\"},{\"value\":\"ME\",\"label\":\"Montenegro\"},{\"value\":\"SR\",\"label\":\"Suriname\"},{\"value\":\"SS\",\"label\":\"South Sudan\"},{\"value\":\"SE\",\"label\":\"Sweden\"},{\"value\":\"CH\",\"label\":\"Switzerland\"},{\"value\":\"SY\",\"label\":\"Syria\"},{\"value\":\"TW\",\"label\":\"Taiwan[Rep. of China]\"},{\"value\":\"TJ\",\"label\":\"Tajikistan\"},{\"value\":\"TZ\",\"label\":\"Tanzania\"},{\"value\":\"TH\",\"label\":\"Thailand\"},{\"value\":\"TL\",\"label\":\"Timor Leste\"},{\"value\":\"TG\",\"label\":\"Togo\"},{\"value\":\"TO\",\"label\":\"Tonga\"},{\"value\":\"TT\",\"label\":\"Trinidad & Tobago\"},{\"value\":\"TN\",\"label\":\"Tunisia\"},{\"value\":\"TR\",\"label\":\"Turkey\"},{\"value\":\"TM\",\"label\":\"Turkmenistan\"},{\"value\":\"TC\",\"label\":\"Turks & Caicos Isl.\"},{\"value\":\"TV\",\"label\":\"Tuvalu\"},{\"value\":\"UG\",\"label\":\"Uganda\"},{\"value\":\"UA\",\"label\":\"Ukraine\"},{\"value\":\"AE\",\"label\":\"United Arab Emirates\"},{\"value\":\"GB\",\"label\":\"United Kingdom\"},{\"value\":\"US\",\"label\":\"United States\"},{\"value\":\"UY\",\"label\":\"Uruguay\"},{\"value\":\"UZ\",\"label\":\"Uzbekistan\"},{\"value\":\"VU\",\"label\":\"Vanuatu\"},{\"value\":\"VA\",\"label\":\"Vatican\"},{\"value\":\"VE\",\"label\":\"Venezuela\"},{\"value\":\"VN\",\"label\":\"Vietnam\"},{\"value\":\"VI\",\"label\":\"Virgin Islands [U.S.A.]\"},{\"value\":\"VG\",\"label\":\"Virgin Islands [British]\"},{\"value\":\"YE\",\"label\":\"Yemen\"},{\"value\":\"ZM\",\"label\":\"Zambia\"},{\"value\":\"ZW\",\"label\":\"Zimbabwe\"},{\"value\":\"CW\",\"label\":\"Curacao\"},{\"value\":\"SX\",\"label\":\"Sint Maarten\"},{\"value\":\"MF\",\"label\":\"Saint Maarten\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"married.spouse.birth_state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.married?.spouse?.birth_country === 'US')\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"State\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AK\",\"label\":\"Alaska\"},{\"value\":\"AL\",\"label\":\"Alabama\"},{\"value\":\"AR\",\"label\":\"Arkansas\"},{\"value\":\"ASM\",\"label\":\"American Samoa\"},{\"value\":\"AZ\",\"label\":\"Arizona\"},{\"value\":\"CA-N\",\"label\":\"California North\"},{\"value\":\"CA-S\",\"label\":\"California South\"},{\"value\":\"CO\",\"label\":\"Colorado\"},{\"value\":\"CT\",\"label\":\"Connecticut\"},{\"value\":\"DC\",\"label\":\"District of Columbia\"},{\"value\":\"DE\",\"label\":\"Delaware\"},{\"value\":\"FL\",\"label\":\"Florida\"},{\"value\":\"GA\",\"label\":\"Georgia\"},{\"value\":\"GUM\",\"label\":\"Guam\"},{\"value\":\"HI\",\"label\":\"Hawaii\"},{\"value\":\"IA\",\"label\":\"Iowa\"},{\"value\":\"ID\",\"label\":\"Idaho\"},{\"value\":\"IL\",\"label\":\"Illinois\"},{\"value\":\"IN\",\"label\":\"Indiana\"},{\"value\":\"KS\",\"label\":\"Kansas\"},{\"value\":\"KY\",\"label\":\"Kentucky\"},{\"value\":\"LA\",\"label\":\"Louisiana\"},{\"value\":\"MA\",\"label\":\"Massachusetts\"},{\"value\":\"MD\",\"label\":\"Maryland\"},{\"value\":\"ME\",\"label\":\"Maine\"},{\"value\":\"MI\",\"label\":\"Michigan\"},{\"value\":\"MN\",\"label\":\"Minnesota\"},{\"value\":\"MNP\",\"label\":\"North Mariana Islands\"},{\"value\":\"MO\",\"label\":\"Missouri\"},{\"value\":\"MS\",\"label\":\"Mississippi\"},{\"value\":\"MT\",\"label\":\"Montana\"},{\"value\":\"NC\",\"label\":\"North Carolina\"},{\"value\":\"ND\",\"label\":\"North Dakota\"},{\"value\":\"NE\",\"label\":\"Nebraska\"},{\"value\":\"NH\",\"label\":\"New Hampshire\"},{\"value\":\"NJ\",\"label\":\"New Jersey\"},{\"value\":\"NM\",\"label\":\"New Mexico\"},{\"value\":\"NV\",\"label\":\"Nevada\"},{\"value\":\"NY\",\"label\":\"New York\"},{\"value\":\"OH\",\"label\":\"Ohio\"},{\"value\":\"OK\",\"label\":\"Oklahoma\"},{\"value\":\"OR\",\"label\":\"Oregon\"},{\"value\":\"PA\",\"label\":\"Pennsylvania\"},{\"value\":\"PRI\",\"label\":\"Puerto Rico\"},{\"value\":\"RI\",\"label\":\"Rhode Island\"},{\"value\":\"SC\",\"label\":\"South Carolina\"},{\"value\":\"SD\",\"label\":\"South Dakota\"},{\"value\":\"TN\",\"label\":\"Tennessee\"},{\"value\":\"TX\",\"label\":\"Texas\"},{\"value\":\"UT\",\"label\":\"Utah\"},{\"value\":\"VA\",\"label\":\"Virginia\"},{\"value\":\"VIR\",\"label\":\"U.S. Virgin Islands\"},{\"value\":\"VT\",\"label\":\"Vermont\"},{\"value\":\"WA\",\"label\":\"Washington\"},{\"value\":\"WI\",\"label\":\"Wisconsin\"},{\"value\":\"WV\",\"label\":\"West Virginia\"},{\"value\":\"WY\",\"label\":\"Wyoming\"},{\"value\":\"XMI\",\"label\":\"Midway Islands\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"married.spouse.birth_state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"!(model.married?.spouse?.birth_country === 'CA')\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Province\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\"label\": \"Florida\", \"value\": \"FL\"},\n\t\t\t\t\t\t\t\t\t\t\t\t{\"label\": \"Georgia\", \"value\": \"GA\"}\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"married.spouse.birth_city\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"City\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Gender
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"married.spouse.gender\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\t\t\"label\": \"Gender\",\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Male\",\n\t\t\t\t\t\t\t\t\t\t\t\"icon\": \"icon-male\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"male\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Female\",\n\t\t\t\t\t\t\t\t\t\t\t\"icon\": \"icon-female\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"female\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Is your spouse a U.S. Citizen?
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"married.spouse.us_citizen\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"No\"}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"!(model.married?.answer === 'yes')\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-marital-status\",\n\t\t\t\t\t\"id\": \"widowed_divorced\",\n\t\t\t\t\t\"hide\": \"!(model.issued_passports === 'none' || (model.issued_passports === 'book' && (model.passport && model.passport.in_possession !== 'yes' || (model.passport.in_possession === 'yes' && model.passport.is_damaged === 'yes') || dt.now().minus({years: 15}) > dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy') || dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))) || (model.issued_passports === 'card' && (model.passport_card && model.passport_card.in_possession !== 'yes' || (model.passport_card.in_possession === 'yes' && model.passport_card.is_damaged === 'yes') || dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy'))) || (model.issued_passports === 'both' && model.passport && model.passport_card && ( model.passport.in_possession !== 'yes' || model.passport_card.in_possession !== 'yes' || (model.passport.in_possession === 'yes' && model.passport_card.in_possession === 'yes' && (dt.now().minus({years: 15}) > dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy') || dt.fromFormat(model.passport.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy') || model.passport.is_damaged === 'yes') && (dt.fromFormat(model.passport_card.issue_date, 'MM/dd/yyyy').minus({years: 16}) < dt.fromFormat(model.date_of_birth, 'MM/dd/yyyy') || model.passport_card.is_damaged === 'yes')))))\",\n\t\t\t\t\t\"label\": \"Have you been divorced or widowed in the past?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"divorced_widowed.answer\",\n\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"No\"}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.date\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Date of Marriage\",\n\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01\\/01\\/1800\",\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t// \"validators\": {\n\t\t\t\t\t\t\t\t\t\t// \t\"before_applicant_dob\": {\n\t\t\t\t\t\t\t\t\t\t// \t\t\"message\": \"'Date can\\u2019t be before applicant\\u2019s date of birth'\",\n\t\t\t\t\t\t\t\t\t\t// \t\t\"expression\": \"model.date_of_birth.value && moment($modelValue, ['MM\\/DD\\/YYYY', moment.ISO_8601]).isSameOrAfter(moment(model.date_of_birth.value, ['MM\\/DD\\/YYYY', moment.ISO_8601]))\"\n\t\t\t\t\t\t\t\t\t\t// \t},\n\t\t\t\t\t\t\t\t\t\t// \t\"before_spouse_dob\": {\n\t\t\t\t\t\t\t\t\t\t// \t\t\"message\": \"'Date can\\u2019t be before spouse\\u2019s date of birth'\",\n\t\t\t\t\t\t\t\t\t\t// \t\t\"expression\": \"model.divorced_widowed.spouse.date_of_birth.value && moment($modelValue, ['MM\\/DD\\/YYYY', moment.ISO_8601]).isAfter(moment(model.divorced_widowed.spouse.date_of_birth.value, ['MM\\/DD\\/YYYY', moment.ISO_8601]))\"\n\t\t\t\t\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t\t\t\t\t// },\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.date_of_divorce\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Date of Divorce or Death\",\n\t\t\t\t\t\t\t\t\t\t\t\"view\": \"year\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxDate\": \"now\",\n\t\t\t\t\t\t\t\t\t\t\t\"minDate\": \"01\\/01\\/1800\",\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t// \"validators\": {\n\t\t\t\t\t\t\t\t\t\t// \t\"before_applicant_dob\": {\n\t\t\t\t\t\t\t\t\t\t// \t\t\"message\": \"'Date can\\u2019t be before applicant\\u2019s date of birth'\",\n\t\t\t\t\t\t\t\t\t\t// \t\t\"expression\": \"model.date_of_birth.value && moment($modelValue, ['MM\\/DD\\/YYYY', moment.ISO_8601]).isSameOrAfter(model.date_of_birth.value, ['MM\\/DD\\/YYYY', moment.ISO_8601])\"\n\t\t\t\t\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t\t\t\t\t// },\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Please provide information about your former spouse.
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.first_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"First Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.last_name\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"^(?!['|-]+[A-Za-z])(?!.*[ ]{2,})(?!.*'')(?!.* ')(?!.*' )(?!.*'-)(?!.*-')(?!.*- )(?!.* -)(?!.*--)([A-Za-z ]+[-' ]+[A-Za-z ]|[A-Za-z]*)*$\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Last Name\",\n\t\t\t\t\t\t\t\t\t\t\t\"maxLength\": 40\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\t\t\"messages\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\"pattern\": \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes\\/apostrophes.\"\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.date_of_birth\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Date of Birth\",\n\t\t\t\t\t\t\t\t\t\"maxDateKey\": \"date_of_birth\",\n\t\t\t\t\t\t\t\t\t\"minDate\": \"01/01/1800\",\n\t\t\t\t\t\t\t\t\t\"view\": \"year\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"validation\": {\n\t\t\t\t\t\t\t\t\t\"min\": \"Date can\\u2019t be after applicant\\u2019s date of birth\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Birthplace
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.birth_country\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Country\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AF\",\"label\":\"Afghanistan\"},{\"value\":\"AL\",\"label\":\"Albania\"},{\"value\":\"DZ\",\"label\":\"Algeria\"},{\"value\":\"AD\",\"label\":\"Andorra\"},{\"value\":\"AO\",\"label\":\"Angola\"},{\"value\":\"AI\",\"label\":\"Anguilla\"},{\"value\":\"AG\",\"label\":\"Antigua and Barbuda\"},{\"value\":\"AR\",\"label\":\"Argentina\"},{\"value\":\"AM\",\"label\":\"Armenia\"},{\"value\":\"AW\",\"label\":\"Aruba\"},{\"value\":\"AU\",\"label\":\"Australia\"},{\"value\":\"AT\",\"label\":\"Austria\"},{\"value\":\"AZ\",\"label\":\"Azerbaijan\"},{\"value\":\"BS\",\"label\":\"Bahamas\"},{\"value\":\"BH\",\"label\":\"Bahrain\"},{\"value\":\"BD\",\"label\":\"Bangladesh\"},{\"value\":\"BB\",\"label\":\"Barbados\"},{\"value\":\"BY\",\"label\":\"Belarus\"},{\"value\":\"BE\",\"label\":\"Belgium\"},{\"value\":\"BZ\",\"label\":\"Belize\"},{\"value\":\"BJ\",\"label\":\"Benin\"},{\"value\":\"BM\",\"label\":\"Bermuda\"},{\"value\":\"BT\",\"label\":\"Bhutan\"},{\"value\":\"BO\",\"label\":\"Bolivia\"},{\"value\":\"BA\",\"label\":\"Bosnia Herzegovina\"},{\"value\":\"BW\",\"label\":\"Botswana\"},{\"value\":\"BR\",\"label\":\"Brazil\"},{\"value\":\"BN\",\"label\":\"Brunei\"},{\"value\":\"BG\",\"label\":\"Bulgaria\"},{\"value\":\"BF\",\"label\":\"Burkina Faso\"},{\"value\":\"BI\",\"label\":\"Burundi\"},{\"value\":\"KH\",\"label\":\"Cambodia\"},{\"value\":\"CM\",\"label\":\"Cameroon\"},{\"value\":\"CA\",\"label\":\"Canada\"},{\"value\":\"CV\",\"label\":\"Cape Verde\"},{\"value\":\"KY\",\"label\":\"Cayman Islands\"},{\"value\":\"CF\",\"label\":\"Central African Republic\"},{\"value\":\"TD\",\"label\":\"Chad\"},{\"value\":\"CL\",\"label\":\"Chile\"},{\"value\":\"CN\",\"label\":\"China\"},{\"value\":\"CO\",\"label\":\"Colombia\"},{\"value\":\"KM\",\"label\":\"Comores Islands\"},{\"value\":\"CG\",\"label\":\"Congo[Brazzaville]\"},{\"value\":\"CD\",\"label\":\"Congo[Kinshasa]\"},{\"value\":\"CK\",\"label\":\"Cook Islands\"},{\"value\":\"CR\",\"label\":\"Costa Rica\"},{\"value\":\"CI\",\"label\":\"Cote dIvoire\"},{\"value\":\"HR\",\"label\":\"Croatia\"},{\"value\":\"CU\",\"label\":\"Cuba\"},{\"value\":\"CY\",\"label\":\"Cyprus\"},{\"value\":\"CZ\",\"label\":\"Czech Republic\"},{\"value\":\"DK\",\"label\":\"Denmark\"},{\"value\":\"DJ\",\"label\":\"Djibouti\"},{\"value\":\"DM\",\"label\":\"Dominica\"},{\"value\":\"DO\",\"label\":\"Dominican Republic\"},{\"value\":\"SZ\",\"label\":\"Eswatini [Swaziland]\"},{\"value\":\"EC\",\"label\":\"Ecuador\"},{\"value\":\"EG\",\"label\":\"Egypt\"},{\"value\":\"SV\",\"label\":\"El Salvador\"},{\"value\":\"GQ\",\"label\":\"Equatorial Guinea\"},{\"value\":\"ER\",\"label\":\"Eritrea\"},{\"value\":\"EE\",\"label\":\"Estonia\"},{\"value\":\"ET\",\"label\":\"Ethiopia\"},{\"value\":\"FO\",\"label\":\"Faroe Islands\"},{\"value\":\"FJ\",\"label\":\"Fiji\"},{\"value\":\"FI\",\"label\":\"Finland\"},{\"value\":\"FR\",\"label\":\"France\"},{\"value\":\"GF\",\"label\":\"French Guiana\"},{\"value\":\"PF\",\"label\":\"French Polynesia\"},{\"value\":\"GP\",\"label\":\"French West Indies\"},{\"value\":\"MK\",\"label\":\"North Macedonia\"},{\"value\":\"GA\",\"label\":\"Gabon\"},{\"value\":\"GM\",\"label\":\"Gambia\"},{\"value\":\"GE\",\"label\":\"Georgia\"},{\"value\":\"DE\",\"label\":\"Germany\"},{\"value\":\"GH\",\"label\":\"Ghana\"},{\"value\":\"GI\",\"label\":\"Gibraltar\"},{\"value\":\"GR\",\"label\":\"Greece\"},{\"value\":\"GL\",\"label\":\"Greenland\"},{\"value\":\"GD\",\"label\":\"Grenada\"},{\"value\":\"GU\",\"label\":\"Guam\"},{\"value\":\"GT\",\"label\":\"Guatemala\"},{\"value\":\"GN\",\"label\":\"Guinea\"},{\"value\":\"GW\",\"label\":\"Guinea-Bissau\"},{\"value\":\"GY\",\"label\":\"Guyana\"},{\"value\":\"HT\",\"label\":\"Haiti\"},{\"value\":\"HN\",\"label\":\"Honduras\"},{\"value\":\"HK\",\"label\":\"Hong Kong [SAR China]\"},{\"value\":\"HU\",\"label\":\"Hungary\"},{\"value\":\"IS\",\"label\":\"Iceland\"},{\"value\":\"IN\",\"label\":\"India\"},{\"value\":\"ID\",\"label\":\"Indonesia\"},{\"value\":\"IR\",\"label\":\"Iran\"},{\"value\":\"IQ\",\"label\":\"Iraq\"},{\"value\":\"IE\",\"label\":\"Ireland\"},{\"value\":\"IL\",\"label\":\"Israel\"},{\"value\":\"IT\",\"label\":\"Italy\"},{\"value\":\"JM\",\"label\":\"Jamaica\"},{\"value\":\"JP\",\"label\":\"Japan\"},{\"value\":\"JO\",\"label\":\"Jordan\"},{\"value\":\"KZ\",\"label\":\"Kazakhstan\"},{\"value\":\"KE\",\"label\":\"Kenya\"},{\"value\":\"KI\",\"label\":\"Kiribati\"},{\"value\":\"KP\",\"label\":\"North Korea[Peoples Rep.]\"},{\"value\":\"KR\",\"label\":\"South Korea[Rep.]\"},{\"value\":\"KW\",\"label\":\"Kuwait\"},{\"value\":\"KG\",\"label\":\"Kyrgyzstan\"},{\"value\":\"LA\",\"label\":\"Laos\"},{\"value\":\"LV\",\"label\":\"Latvia\"},{\"value\":\"LB\",\"label\":\"Lebanon\"},{\"value\":\"LS\",\"label\":\"Lesotho\"},{\"value\":\"LR\",\"label\":\"Liberia\"},{\"value\":\"LY\",\"label\":\"Libya\"},{\"value\":\"LI\",\"label\":\"Liechtenstein\"},{\"value\":\"LT\",\"label\":\"Lithuania\"},{\"value\":\"LU\",\"label\":\"Luxembourg\"},{\"value\":\"MO\",\"label\":\"Macao [SAR China]\"},{\"value\":\"MG\",\"label\":\"Madagascar\"},{\"value\":\"MW\",\"label\":\"Malawi\"},{\"value\":\"MY\",\"label\":\"Malaysia\"},{\"value\":\"MV\",\"label\":\"Maldives\"},{\"value\":\"ML\",\"label\":\"Mali\"},{\"value\":\"MT\",\"label\":\"Malta\"},{\"value\":\"MH\",\"label\":\"Marshall Islands\"},{\"value\":\"MR\",\"label\":\"Mauritania\"},{\"value\":\"MU\",\"label\":\"Mauritius\"},{\"value\":\"YT\",\"label\":\"Mayotte\"},{\"value\":\"MX\",\"label\":\"Mexico\"},{\"value\":\"FM\",\"label\":\"Micronesia \"},{\"value\":\"MD\",\"label\":\"Moldova\"},{\"value\":\"MC\",\"label\":\"Monaco\"},{\"value\":\"MN\",\"label\":\"Mongolia\"},{\"value\":\"MS\",\"label\":\"Montserrat\"},{\"value\":\"MA\",\"label\":\"Morocco\"},{\"value\":\"MZ\",\"label\":\"Mozambique\"},{\"value\":\"MM\",\"label\":\"Myanmar\"},{\"value\":\"NA\",\"label\":\"Namibia\"},{\"value\":\"NR\",\"label\":\"Nauru\"},{\"value\":\"NP\",\"label\":\"Nepal\"},{\"value\":\"AN\",\"label\":\"Netherlands Antilles\"},{\"value\":\"NL\",\"label\":\"Netherlands\"},{\"value\":\"NC\",\"label\":\"New Caledonia\"},{\"value\":\"NZ\",\"label\":\"New Zealand\"},{\"value\":\"NI\",\"label\":\"Nicaragua\"},{\"value\":\"NE\",\"label\":\"Niger\"},{\"value\":\"NG\",\"label\":\"Nigeria\"},{\"value\":\"NU\",\"label\":\"Niue\"},{\"value\":\"NF\",\"label\":\"Norfolk Island\"},{\"value\":\"MP\",\"label\":\"Northern Mariana Isl.\"},{\"value\":\"NO\",\"label\":\"Norway\"},{\"value\":\"OM\",\"label\":\"Oman\"},{\"value\":\"PK\",\"label\":\"Pakistan\"},{\"value\":\"PW\",\"label\":\"Palau Islands\"},{\"value\":\"PA\",\"label\":\"Panama\"},{\"value\":\"PG\",\"label\":\"Papua New Guinea\"},{\"value\":\"PY\",\"label\":\"Paraguay\"},{\"value\":\"PE\",\"label\":\"Peru\"},{\"value\":\"PH\",\"label\":\"Philippines\"},{\"value\":\"PL\",\"label\":\"Poland\"},{\"value\":\"PT\",\"label\":\"Portugal\"},{\"value\":\"PR\",\"label\":\"Puerto Rico\"},{\"value\":\"QA\",\"label\":\"Qatar\"},{\"value\":\"RE\",\"label\":\"Reunion\"},{\"value\":\"RO\",\"label\":\"Romania\"},{\"value\":\"RU\",\"label\":\"Russia\"},{\"value\":\"RW\",\"label\":\"Rwanda\"},{\"value\":\"AS\",\"label\":\"Samoa[American]\"},{\"value\":\"WS\",\"label\":\"Samoa\"},{\"value\":\"SM\",\"label\":\"San Marino\"},{\"value\":\"ST\",\"label\":\"Sao Tome & Principe\"},{\"value\":\"SA\",\"label\":\"Saudi Arabia\"},{\"value\":\"SN\",\"label\":\"Senegal\"},{\"value\":\"RS\",\"label\":\"Serbia\"},{\"value\":\"SC\",\"label\":\"Seychelles\"},{\"value\":\"SL\",\"label\":\"Sierra Leone\"},{\"value\":\"SG\",\"label\":\"Singapore\"},{\"value\":\"SK\",\"label\":\"Slovak Republic\"},{\"value\":\"SI\",\"label\":\"Slovenia\"},{\"value\":\"SB\",\"label\":\"Solomon Islands\"},{\"value\":\"SO\",\"label\":\"Somalia\"},{\"value\":\"ZA\",\"label\":\"South Africa\"},{\"value\":\"ES\",\"label\":\"Spain\"},{\"value\":\"LK\",\"label\":\"Sri Lanka\"},{\"value\":\"KN\",\"label\":\"St.Kitts-Nevis\"},{\"value\":\"LC\",\"label\":\"St.Lucia\"},{\"value\":\"VC\",\"label\":\"St.Vincent & Grenadines\"},{\"value\":\"SD\",\"label\":\"Sudan\"},{\"value\":\"ME\",\"label\":\"Montenegro\"},{\"value\":\"SR\",\"label\":\"Suriname\"},{\"value\":\"SS\",\"label\":\"South Sudan\"},{\"value\":\"SE\",\"label\":\"Sweden\"},{\"value\":\"CH\",\"label\":\"Switzerland\"},{\"value\":\"SY\",\"label\":\"Syria\"},{\"value\":\"TW\",\"label\":\"Taiwan[Rep. of China]\"},{\"value\":\"TJ\",\"label\":\"Tajikistan\"},{\"value\":\"TZ\",\"label\":\"Tanzania\"},{\"value\":\"TH\",\"label\":\"Thailand\"},{\"value\":\"TL\",\"label\":\"Timor Leste\"},{\"value\":\"TG\",\"label\":\"Togo\"},{\"value\":\"TO\",\"label\":\"Tonga\"},{\"value\":\"TT\",\"label\":\"Trinidad & Tobago\"},{\"value\":\"TN\",\"label\":\"Tunisia\"},{\"value\":\"TR\",\"label\":\"Turkey\"},{\"value\":\"TM\",\"label\":\"Turkmenistan\"},{\"value\":\"TC\",\"label\":\"Turks & Caicos Isl.\"},{\"value\":\"TV\",\"label\":\"Tuvalu\"},{\"value\":\"UG\",\"label\":\"Uganda\"},{\"value\":\"UA\",\"label\":\"Ukraine\"},{\"value\":\"AE\",\"label\":\"United Arab Emirates\"},{\"value\":\"GB\",\"label\":\"United Kingdom\"},{\"value\":\"US\",\"label\":\"United States\"},{\"value\":\"UY\",\"label\":\"Uruguay\"},{\"value\":\"UZ\",\"label\":\"Uzbekistan\"},{\"value\":\"VU\",\"label\":\"Vanuatu\"},{\"value\":\"VA\",\"label\":\"Vatican\"},{\"value\":\"VE\",\"label\":\"Venezuela\"},{\"value\":\"VN\",\"label\":\"Vietnam\"},{\"value\":\"VI\",\"label\":\"Virgin Islands [U.S.A.]\"},{\"value\":\"VG\",\"label\":\"Virgin Islands [British]\"},{\"value\":\"YE\",\"label\":\"Yemen\"},{\"value\":\"ZM\",\"label\":\"Zambia\"},{\"value\":\"ZW\",\"label\":\"Zimbabwe\"},{\"value\":\"CW\",\"label\":\"Curacao\"},{\"value\":\"SX\",\"label\":\"Sint Maarten\"},{\"value\":\"MF\",\"label\":\"Saint Maarten\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.birth_state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"model.divorced_widowed?.spouse?.birth_country !== 'US'\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"State\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [{\"value\":\"AK\",\"label\":\"Alaska\"},{\"value\":\"AL\",\"label\":\"Alabama\"},{\"value\":\"AR\",\"label\":\"Arkansas\"},{\"value\":\"ASM\",\"label\":\"American Samoa\"},{\"value\":\"AZ\",\"label\":\"Arizona\"},{\"value\":\"CA-N\",\"label\":\"California North\"},{\"value\":\"CA-S\",\"label\":\"California South\"},{\"value\":\"CO\",\"label\":\"Colorado\"},{\"value\":\"CT\",\"label\":\"Connecticut\"},{\"value\":\"DC\",\"label\":\"District of Columbia\"},{\"value\":\"DE\",\"label\":\"Delaware\"},{\"value\":\"FL\",\"label\":\"Florida\"},{\"value\":\"GA\",\"label\":\"Georgia\"},{\"value\":\"GUM\",\"label\":\"Guam\"},{\"value\":\"HI\",\"label\":\"Hawaii\"},{\"value\":\"IA\",\"label\":\"Iowa\"},{\"value\":\"ID\",\"label\":\"Idaho\"},{\"value\":\"IL\",\"label\":\"Illinois\"},{\"value\":\"IN\",\"label\":\"Indiana\"},{\"value\":\"KS\",\"label\":\"Kansas\"},{\"value\":\"KY\",\"label\":\"Kentucky\"},{\"value\":\"LA\",\"label\":\"Louisiana\"},{\"value\":\"MA\",\"label\":\"Massachusetts\"},{\"value\":\"MD\",\"label\":\"Maryland\"},{\"value\":\"ME\",\"label\":\"Maine\"},{\"value\":\"MI\",\"label\":\"Michigan\"},{\"value\":\"MN\",\"label\":\"Minnesota\"},{\"value\":\"MNP\",\"label\":\"North Mariana Islands\"},{\"value\":\"MO\",\"label\":\"Missouri\"},{\"value\":\"MS\",\"label\":\"Mississippi\"},{\"value\":\"MT\",\"label\":\"Montana\"},{\"value\":\"NC\",\"label\":\"North Carolina\"},{\"value\":\"ND\",\"label\":\"North Dakota\"},{\"value\":\"NE\",\"label\":\"Nebraska\"},{\"value\":\"NH\",\"label\":\"New Hampshire\"},{\"value\":\"NJ\",\"label\":\"New Jersey\"},{\"value\":\"NM\",\"label\":\"New Mexico\"},{\"value\":\"NV\",\"label\":\"Nevada\"},{\"value\":\"NY\",\"label\":\"New York\"},{\"value\":\"OH\",\"label\":\"Ohio\"},{\"value\":\"OK\",\"label\":\"Oklahoma\"},{\"value\":\"OR\",\"label\":\"Oregon\"},{\"value\":\"PA\",\"label\":\"Pennsylvania\"},{\"value\":\"PRI\",\"label\":\"Puerto Rico\"},{\"value\":\"RI\",\"label\":\"Rhode Island\"},{\"value\":\"SC\",\"label\":\"South Carolina\"},{\"value\":\"SD\",\"label\":\"South Dakota\"},{\"value\":\"TN\",\"label\":\"Tennessee\"},{\"value\":\"TX\",\"label\":\"Texas\"},{\"value\":\"UT\",\"label\":\"Utah\"},{\"value\":\"VA\",\"label\":\"Virginia\"},{\"value\":\"VIR\",\"label\":\"U.S. Virgin Islands\"},{\"value\":\"VT\",\"label\":\"Vermont\"},{\"value\":\"WA\",\"label\":\"Washington\"},{\"value\":\"WI\",\"label\":\"Wisconsin\"},{\"value\":\"WV\",\"label\":\"West Virginia\"},{\"value\":\"WY\",\"label\":\"Wyoming\"},{\"value\":\"XMI\",\"label\":\"Midway Islands\"}]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"type\": \"select\", \n\t\t\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.birth_state\",\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"model.divorced_widowed?.spouse?.birth_country !== 'CA'\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Province\",\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\"label\": \"Florida\", \"value\": \"FL\"},\n\t\t\t\t\t\t\t\t\t\t\t\t{\"label\": \"Georgia\", \"value\": \"GA\"}\n\t\t\t\t\t\t\t\t\t\t\t]\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.birth_city\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"City\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Gender
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.gender\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"label\": \"Gender\",\n\t\t\t\t\t\t\t\t\t\"required\": true, \n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Male\",\n\t\t\t\t\t\t\t\t\t\t\t\"icon\": \"icon-male\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"male\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Female\",\n\t\t\t\t\t\t\t\t\t\t\t\"icon\": \"icon-female\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"female\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Were they a U.S. Citizen?
\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"divorced_widowed.spouse.us_citizen\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"no\", \"label\": \"Yes\"},\n\t\t\t\t\t\t\t\t\t\t{\"value\": \"yes\", \"label\": \"No\"}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\"hide\": \"model.divorced_widowed?.answer !== 'yes'\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}, \n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-social-security\",\n\t\t\t\t\t\"note\": \"Your Social Security Number will not be permanently saved. If you are unable to provide a social security please enter zeros.\",\n\t\t\t\t\t\"id\": \"social-security\",\n\t\t\t\t\t\"label\": \"The U.S. Department of State requires you to supply your Social Security Number in order to perform a background check.\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"social_security\",\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"type\": \"social-security-input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"id\": \"passport-photo\",\n\t\t\t\t\t\"type\": \"facility_finder\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"photo_location\",\n\t\t\t\t\t\t\"type\": \"location-finder\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"category\": \"passport-photo\",\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"id\": \"acceptance-agent\",\n\t\t\t\t\t\"type\": \"facility_finder\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"key\": \"aa_location\",\n\t\t\t\t\t\t\"type\": \"location-finder\",\n\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\"category\": \"passport-acceptance\",\n\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-passports\",\n\t\t\t\t\t\"icon_size\": \"medium\",\n\t\t\t\t\t\"id\": \"lost_passport_both\",\n\t\t\t\t\t\"label\": \"Did you lose your passport book and card at the same time and place?\",\n\t\t\t\t\t\"hide\": \"!(model.issued_passports === 'both' && model.passport?.in_possession !== 'yes' && model.passport_card?.in_possession !== 'yes')\",\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"lost_passport.both.together\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Yes\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"No\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"no\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"How were the documents lost?
\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"model.passport?.in_possession !== 'lost'\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"How were the documents stolen?
\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"model.passport?.in_possession !== 'stolen'\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"lost_passport.both.how\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Please provide a brief description\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Where and when did the loss occur?
\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"model.passport?.in_possession !== 'lost'\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Where and when did the theft occur?
\",\n\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\t\t\"hide\": \"model.passport?.in_possession !== 'stolen'\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"lost_passport.both.where\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Please provide address if known\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"lost_passport.both.when\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"max_date\": \"today\",\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"The last time you remember them in your possession\",\n\t\t\t\t\t\t\t\t\t\t\t\"start_view\": \"year\",\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"today\": true,\n\t\t\t\t\t\t\t\t\t\t\t// \"validators\": {\n\t\t\t\t\t\t\t\t\t\t\t// \t\"before_applicant_dob\": {\n\t\t\t\t\t\t\t\t\t\t\t// \t\t\"message\": \"'Date can\\u2019t be before applicant\\u2019s date of birth'\",\n\t\t\t\t\t\t\t\t\t\t\t// \t\t\"expression\": \"model.date_of_birth.value && moment($modelValue, ['MM\\/DD\\/YYYY', moment.ISO_8601]).isSameOrAfter(moment(model.date_of_birth.value, ['MM\\/DD\\/YYYY', moment.ISO_8601]))\"\n\t\t\t\t\t\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t\t\t\t\t\t// },\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"model.lost_passport?.both?.together !== 'yes'\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-passports\",\n\t\t\t\t\t\"icon_size\": \"medium\",\n\t\t\t\t\t\"hide\": \"!((model.issued_passports === 'book' && model.passport?.in_possession !== 'yes') || (model.issued_passports == 'both' && model.passport?.in_possession !== 'yes' && (model.passport_card?.in_possession === 'yes' || model.lost_passport?.both?.together === 'no')))\",\n\t\t\t\t\t\"id\": \"lost_passport_book\",\n\t\t\t\t\t\"label\": \"How was the passport book lost or stolen?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"lost_passport.book.how\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Please provide a brief description\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Where and when did the loss occur?
\",\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"model.passport?.in_possession !== 'lost'\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Where and when did the theft occur?
\",\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"model.passport?.in_possession !== 'stolen'\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"lost_passport.book.where.value\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Please provide address if known\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"lost_passport.book.when.value\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"max_date\": \"today\",\n\t\t\t\t\t\t\t\t\t\"label\": \"The last time you remember it in your possession\",\n\t\t\t\t\t\t\t\t\t\"start_view\": \"year\",\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"today\": true,\n\t\t\t\t\t\t\t\t\t// \"validators\": {\n\t\t\t\t\t\t\t\t\t// \t\"before_applicant_dob\": {\n\t\t\t\t\t\t\t\t\t// \t\t\"message\": \"'Date can\\u2019t be before applicant\\u2019s date of birth'\",\n\t\t\t\t\t\t\t\t\t// \t\t\"expression\": \"model.date_of_birth.value && moment($modelValue, ['MM\\/DD\\/YYYY', moment.ISO_8601]).isSameOrAfter(moment(model.date_of_birth.value, ['MM\\/DD\\/YYYY', moment.ISO_8601]))\"\n\t\t\t\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t\t\t\t// },\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-passports\",\n\t\t\t\t\t\"icon_size\": \"medium\",\n\t\t\t\t\t\"hide\": \"!((model.issued_passports === 'card' && model.passport_card?.in_possession !== 'yes') || (model.issued_passports == 'both' && model.passport_card?.in_possession !== 'yes' && (model.passport?.in_possession === 'yes' || model.lost_passport?.both?.together === 'no')))\",\n\t\t\t\t\t\"id\": \"lost_passport_card\",\n\t\t\t\t\t\"label\": \"How was the passport card lost or stolen?\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"lost_passport.card.how.value\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Please provide a brief description\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Where and when did the loss occur?
\",\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"model.passport_card?.in_possession !== 'lost'\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"template\": \"Where and when did the theft occur?
\",\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"model.passport_card?.in_possession !== 'stolen'\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"lost_passport.card.where.value\",\n\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"label\": \"Please provide address if known\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\"key\": \"lost_passport.card.when.value\",\n\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"max_date\": \"today\",\n\t\t\t\t\t\t\t\t\t\"label\": \"The last time you remember it in your possession\",\n\t\t\t\t\t\t\t\t\t\"start_view\": \"year\",\n\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\"today\": true,\n\t\t\t\t\t\t\t\t\t// \"validators\": {\n\t\t\t\t\t\t\t\t\t// \t\"before_applicant_dob\": {\n\t\t\t\t\t\t\t\t\t// \t\t\"message\": \"'Date can\\u2019t be before applicant\\u2019s date of birth'\",\n\t\t\t\t\t\t\t\t\t// \t\t\"expression\": \"model.date_of_birth.value && moment($modelValue, ['MM\\/DD\\/YYYY', moment.ISO_8601]).isSameOrAfter(moment(model.date_of_birth.value, ['MM\\/DD\\/YYYY', moment.ISO_8601]))\"\n\t\t\t\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t\t\t\t// },\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"props\": {\n\t\t\t\t\t\"icon\": \"icon-step-passports\",\n\t\t\t\t\t\"icon_size\": \"medium\",\n\t\t\t\t\t\"id\": \"lost_passport_history\",\n\t\t\t\t\t\"label\": \"Have you had another U.S. passport book\\/card lost or stolen?\",\n\t\t\t\t\t\"hide\": \"!((['both', 'book'].includes(model.issued_passports) && model.passport?.in_possession !== 'yes') || (['both', 'card'].includes(model.issued_passports) && model.passport_card?.in_possession !== 'yes'))\"\n\t\t\t\t},\n\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"key\": \"lost_passport.other.answer\",\n\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Yes\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"yes\"\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"No\",\n\t\t\t\t\t\t\t\t\t\t\t\"value\": \"no\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"fieldGroupClassName\": \"gwc-form__field-group gwc-form__field-group--column gwc-form__field-group--small\",\n\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"How many times?
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\"key\": \"lost_passport.other.frequency\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"input\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"step\": 1,\n\t\t\t\t\t\t\t\t\t\t\t\"min\": 0,\n\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Number of times\",\n\t\t\t\t\t\t\t\t\t\t\t\"type\": \"number\",\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Did you file a police report?
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"key\": \"lost_passport.other.police_report\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"buttons\",\n\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\"options\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": \"yes\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Yes\"\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": \"no\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"No\"\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\"required\": true\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"template\": \"Please enter the dates?
\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"key\": \"lost_passport.other.dates\",\n\t\t\t\t\t\t\t\t\t\t\"type\": \"multiple\",\n\t\t\t\t\t\t\t\t\t\t\"defaultValue\": [null],\n\t\t\t\t\t\t\t\t\t\t\"fieldArray\": {\n\t\t\t\t\t\t\t\t\t\t\t\"fieldGroup\": [\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"className\": \"gwc-form__field gwc-form__field--grow\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"datepicker\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": \"date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"props\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"max_date\": \"today\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"label\": \"Date\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"start_view\": \"decade\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"today\": true\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\"expressions\": {\n\t\t\t\t\t\t\t\t\t\"hide\": \"model.lost_passport?.other?.answer !== 'yes'\",\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t}\n\t\t]\n\t} \n]\n\n\n\n","\n\t\n\t\n
\n","import { Component, OnInit } from '@angular/core'\nimport { FormGroup } from '@angular/forms'\nimport { ActivatedRoute } from '@angular/router'\nimport { FormlyFieldConfig } from '@ngx-formly/core'\nimport { ApplicationService } from 'src/app/services/application.service'\nimport { OrderService } from 'src/app/services/order.service'\nimport { Application } from 'src/types/traveler'\nimport { profile } from './profile'\nimport * as _ from 'lodash'\n\nexport interface FormStep {\n icon: string\n id: string\n label: string\n hint?: string\n fields: FormlyFieldConfig[]\n}\n\n@Component({\n selector: 'gwc-form',\n templateUrl: './form.component.html',\n styleUrls: ['./form.component.scss']\n})\n\nexport class FormComponent implements OnInit {\n public form = new FormGroup({})\n public model: any = {}\n public application!: Application\n public steps_profile: FormlyFieldConfig[] = profile\n public steps_idp!: FormlyFieldConfig[]\n public app_uuid!: string\n public traveler_uuid!: string\n\n constructor(\n private activatedRoute: ActivatedRoute,\n private orderService: OrderService,\n private applicationService: ApplicationService\n ) {\n this.traveler_uuid = this.activatedRoute.parent?.snapshot.params['traveler_uuid']\n this.app_uuid = this.activatedRoute.snapshot.params['app_uuid']\n }\n\n ngOnInit(): void {\n this.getApplication() \n }\n\n public getApplication(): void {\n this.orderService.getApplication(this.traveler_uuid, this.app_uuid)\n .subscribe({\n next: response => {\n this.model = response.model \n this.application = response.application\n },\n error: error => {\n }\n })\n }\n}\n","\n\t@if (application.product.type === 'idp') {\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t@if (['completed', 'processing', 'ready'].includes(application.status)) {\n\t\t\t\t\n\t\t\t\t\t{{ getButtonLabel() }}\n\t\t\t\t \n\t\t\t}\n\t\t \n\n\t\t@if (application.manifest?.status === 'qa_error') {\n\t\t\t@if (application.manifest?.customer_note) {\n\t\t\t\t
\n\t\t\t\t\tAgent Note: {{application.manifest?.customer_note}}\n\t\t\t\t
\n\t\t\t}\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t@for (error of application.manifest?.errors; track error) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{ error.label }}: {{error.reason}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t \n\t\t}\n\t} @else if (application.product.type === 'visa') {\n\t\t@if (!application.steps) {\n\t\t\t
\n\t\t\t\t@for (requirement of application.requirements; track requirement.label) {\n\t\t\t\t\t\n\t\t\t\t\t\t{{ requirement.label }} \n\t\t\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t \n\t\t} @else {\n\t\t\t@if (application.status === 'ready') {\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\tYour application is ready to be submitted.\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\tSubmit\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t}\n\t} @else {\n\t\t@if (!needsManifest()) {\n\t\t\t@if ((application.status !== 'completed' \n\t\t\t|| (!application.documents.length && application.document) \n\t\t\t|| application.documents.length === 1)) {\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t@if (application.product.type !== 'passport_photo_correction'\n\t\t\t\t\t\t&& !['shipped_out', 'delivered'].includes(application.status) \n\t\t\t\t\t\t&& (application.product.type !== 'idp' || ['completed', 'processing', 'ready'].includes(application.status))) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{ getButtonLabel() }}\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t} @else if (application.documents.length > 0) {\n\t\t\t\t\n\t\t\t\t@if (application.product.type === 'ca_passport') {\n\t\t\t\t\t
\n\t\t\t\t\t\tPlease save the forms on your computer and use Adobe Reader 10 or higher to print them. \n\t\t\t\t\t\tDon’t use your phone or tablet. The forms will not work properly. \n\t\t\t\t\t
\n\t\t\t\t}\n\t\n\t\t\t\t
\n\t\t\t}\n\n\t\t\t@if (application.product.type === 'passport' && application.status === 'processing') {\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t
\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t} @else {\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t
Thanks for your submission. You're Almost Done! \n\t\t\t\t\t
\n\t\t\t\t\t\tPlease call us during business hours to complete your process at {{ orderService.phone }} \n\t\t\t\t\t\t \n\t\t\t\t\t\tThis step requires assistance from our team. We'll conduct a final review of your passport documents and answer any questions you may have before you ship your documents.\n\t\t\t\t\t\t \n\t\t\t\t\t\tBusiness Hours\n\t\t\t\t\t\t \n\t\t\t\t\t\tMon-Fri: 9AM - 6PM (EST)\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t \n\t\t\t \n\t\t}\n\t}\n
\n","import { Component, EventEmitter, Input, OnInit, OnDestroy, Output } from '@angular/core'\nimport { ApplicationService } from 'src/app/services/application.service'\nimport { Application, ApplicationDocument } from 'src/types/traveler'\nimport Pusher, { Channel } from 'pusher-js'\nimport { OrderService } from 'src/app/services/order.service'\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser'\nimport { environment } from 'src/environments/environment'\nimport { ButtonComponent } from 'src/app/components/button/button.component'\nimport { MatButtonModule } from '@angular/material/button'\nimport { Subject, switchMap, takeUntil, timer } from 'rxjs'\n\n@Component({\n\tselector: 'gwc-status-message',\n\ttemplateUrl: './status.message.component.html',\n\tstyleUrls: ['./status.message.component.scss'],\n\tstandalone: true,\n\timports: [\n\t\tButtonComponent,\n\t\tMatButtonModule\n\t]\n})\n\nexport class StatusMessageComponent implements OnInit, OnDestroy {\n\t@Input() application!: Application\n\t@Input() swapping: boolean = false\n\t@Input() submitting: boolean = false\n\t@Output() callback = new EventEmitter()\n\n\tpublic document_dowload!: string\n\tpublic message: string = ''\n\tpublic documents: ApplicationDocument[] = []\n\tprivate production = environment.production\n\tprivate pusher: Pusher = new Pusher( this.production ? 'JlhZN10vn51RtiytMnYqbhV6':'dSJVtNaH_5EXtpBFh5szO1D8', {\n\t\tcluster: '',\n\t\twsHost: this.production ? 'wss.govworks.com' : 'wss.dev.govworks.com',\n\t\twsPort: 443,\n\t\tforceTLS: false,\n\t\tdisableStats: true,\n\t\tenabledTransports: ['ws', 'wss']\n\t})\n\tprivate closeTimer = new Subject()\n\tprivate INTERVAL = 30000\n\n\tconstructor(\n\t\tprivate applicationService: ApplicationService,\n\t\tpublic orderService: OrderService,\n\t\tprivate sanitizer: DomSanitizer\n\t) {}\n\n\tngOnInit(): void {\n\t\tthis.document_dowload = `${environment.API}application/${this.application.uuid}/user/download/document/`\n\n\t\tif (this.application.status === 'processing') {\n\t\t\tthis.subscribeForAppUpdates()\n\t\t}\n\n\t\tthis.checkApplicationNextSteps()\n\t}\n\n\tprivate checkApplicationNextSteps(): void {\n\t\tif (this.needsManifest()) {\n\t\t\tthis.openShippingConfirmation()\n\t\t}\n\t}\n\n\tpublic sanitize(html: string): SafeHtml {\n\t\treturn this.sanitizer.bypassSecurityTrustHtml(html)\n\t}\n\n\tpublic getIDPMessage(): SafeHtml {\n\t\tlet message = ''\n\t\tif (this.application.manifest?.status === 'qa_error') {\n\t\t\tmessage = `ACTION REQUIRED. There is an issue that requires your immediate attention.`\n\t\t\tswitch (this.application.status) {\n\t\t\t\tcase 'ready':\n\t\t\t\t\tmessage += ' Please click \"Submit\" to generate a new form.'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'completed': \n\t\t\t\t\tmessage = 'Please review and sign you application to resume the process. Make sure all of the issues listed below were resolved. '\n\t\t\t\t\tbreak\n\t\t\t\tcase 'processing':\n\t\t\t\t\tmessage = `Your application is being submitted. \n\t\t\t\t\t\t${this.message }`\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tmessage += ` Your application cannot be processed until the following problems are resolved:`\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (this.application.status) {\n\t\t\t\tcase 'ready':\n\t\t\t\t\tmessage = 'Your application is ready to be submitted.'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'completed': \n\t\t\t\t\tmessage = 'Your application is ready to be signed and submitted.'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'processing':\n\t\t\t\t\tmessage = `Your application is being submitted. \n\t\t\t\t\t\t${this.message }`\n\t\t\t\t\tbreak\n\t\t\t\tcase 'shipped_out': \n\t\t\t\t\tmessage = 'Your new documents are on their way.'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'processed': \n\t\t\t\t\tmessage = 'Your application was submitted.'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'dropped_off':\n\t\t\t\tcase 'documents_processing': \n\t\t\t\t\tmessage = 'Congratulations! Your IDP application has been sent to AAA and is currently being processed.'\n\t\t\t\t\tbreak\n\t\t\t\tcase 'reviewed':\n\t\t\t\t\tmessage = 'Congratulations! Your IDP application is preparing to ship.'\n\t\t\t\t\tbreak\n\t\t\t}\n\t\n\t\t\tif (!message && this.application.documents.length > 0) {\n\t\t\t\tmessage = this.application.documents.length === 1 ? 'Your application is ready to be downloaded.' : 'Your forms are ready to be downloaded.'\n\t\t\t}\n\t\t}\n\n\t\treturn this.sanitizer.bypassSecurityTrustHtml(message)\n\t}\n\n\tpublic getMessage(): string {\n\t\tif (this.application.product.desired) {\n\t\t\treturn `Based on your answers on your ${ this.application.product.label } application, we’ve detected that your application requires a ${ this.application.product.desired_label } application instead.`\n\t\t} \n\n\t\tswitch (this.application.status) {\n\t\t\tcase 'ready':\n\t\t\t\treturn 'Your application is ready to be submitted.'\n\t\t\tcase 'completed': \n\t\t\t\tif (!this.application.packet_approved) {\n\t\t\t\t\treturn 'Your application is ready to be reviewed.'\n\t\t\t\t}\n\n\t\t\t\tif (this.application.product.subtype === 'idp') {\n\t\t\t\t\treturn 'Your application is ready to be signed and submitted.'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'processing':\n\t\t\t\treturn `Your application is being submitted. \n\t\t\t\t\t${this.message }`\n\t\t\tcase 'shipped_out': \n\t\t\t\treturn 'Your new documents are on their way.'\n\t\t\tcase 'processed': \n\t\t\tcase 'reviewed':\n\t\t\t\treturn 'Your application was submitted.'\n\t\t\tcase 'dropped_off':\n\t\t\tcase 'documents_processing': \n\t\t\t\tif (this.application.product.type === 'passport') {\n\t\t\t\t\treturn 'Your application is being processed by the government.'\n\t\t\t\t} else if (this.application.product.type === 'idp') {\n\t\t\t\t\treturn 'Congratulations! Your IDP application has been sent to AAA and is currently being processed.'\n\t\t\t\t} else {\n\t\t\t\t\treturn 'Your application is being processed.'\n\t\t\t\t}\n\t\t}\n\n\t\tif (this.application.documents.length === 0) {\n\t\t\treturn ''\n\t\t}\n\n\t\treturn this.application.documents.length === 1 ? 'Your application is ready to be downloaded.' : 'Your forms are ready to be downloaded.'\n\t}\n\n\tpublic getButtonLabel(): string {\n\t\tif (this.application.product.desired) {\n\t\t\treturn 'Continue'\n\t\t} \n\n\t\tif (this.application.status === 'ready') return 'Submit'\n\n\t\tif (this.application.status === 'completed') {\n\t\t\tif (this.application.product.subtype === 'idp') {\n\t\t\t\treturn 'Sign and Submit'\n\t\t\t} else if (this.application.packet_approved ) return 'Download' \n\n\t\t\treturn 'Review'\n\t\t}\n\n\t\treturn 'Download'\n\t}\n\n\tpublic getButtonDisabled(): boolean {\n\t\tif (this.application.product.desired) {\n\t\t\treturn this.swapping\n\t\t}\n\n\t\tif (this.application.status === 'processing') {\n\t\t\treturn this.submitting\n\t\t}\n\n\t\treturn false\n\t}\n\n\tpublic getButtonSpinner(): boolean {\n\t\tif (this.application.product.desired) {\n\t\t\treturn this.swapping\n\t\t}\n\n\t\treturn this.application.status === 'processing'\n\t\tif (this.application.status === 'processing') {\n\t\t\treturn this.submitting\n\t\t}\n\n\t\treturn false\n\t}\n\n\tpublic buttonAction(): void {\n\t\tif (this.application.product.desired) {\n\t\t\tthis.productSwap()\n\t\t} else {\n\t\t\tif (this.application.status === 'ready') {\n\t\t\t\tthis.submitApplication()\n\t\t\t} else if (this.application.packet_approved) {\n\t\t\t\tif (this.application.product.subtype === 'idp') {\n\t\t\t\t\tthis.callback.emit({action: 'esignature', document_uuid: this.application.documents[0].uuid})\n\t\t\t\t} else if (!this.needsManifest()) {\n\t\t\t\t\tthis.callback.emit({action: 'download'})\n\t\t\t\t} else {\n\t\t\t\t\tif (this.application.manifest && this.application.manifest.status !== 'unmanifested') {\n\t\t\t\t\t\tthis.callback.emit({action: 'download'})\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.openShippingConfirmation()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else { \n\t\t\t\tthis.callback.emit({action: 'preview'})\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic submitApplication(): void {\n\t\tthis.application.status = 'processing'\n\n\t\tthis.applicationService.submitApplication(this.application.uuid)\n\t\t\t.subscribe(response => {\n\t\t\t\tthis.subscribeForAppUpdates()\n\t\t\t})\n\n\t\tthis.callback.emit({action: 'submit'})\n\t}\n\n\tprivate subscribeForAppUpdates(): void {\n\t\tthis.submitting = true\n\t\tconst channel: Channel = this.pusher.subscribe(`engine-events-app-${this.application.uuid}`)\n\n\t\tchannel.bind('engine-feedback', (message: any) => {\n\t\t\tthis.message = message.message\n\t\t\tthis.callback.emit({action: 'message', data: message})\n\n\t\t\tif (message.percentage === 1) {\n\t\t\t\tthis.endSubmitAndTimer()\n\n\t\t\t\tif (this.application.product.subtype === 'idp') {\n\t\t\t\t\tthis.callback.emit({action: 'refresh'})\n\t\t\t\t} else {\n\t\t\t\t\tthis.refreshTraveler()\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tthis.getPoll()\n\t}\n\n\tprivate productSwap(): void {\n\t\tif (this.application.product.desired) {\n\t\t\tthis.swapping = true\n\n\t\t\tthis.applicationService.getProduct(this.application)\n\t\t\t\t.subscribe(response => {\n\t\t\t\t\tif (response[0]) {\n\t\t\t\t\t\tthis.applicationService.changeProduct(this.application.uuid, response[0].uuid)\n\t\t\t\t\t\t\t.subscribe(response => {\n\t\t\t\t\t\t\t\tthis.refreshTraveler()\n\t\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\t}\n\n\tprivate getPoll(): void {\n\t\ttimer(0, this.INTERVAL).pipe(\n\t\t\tswitchMap(() => this.applicationService.getStatus(this.application.uuid)),\n\t\t\ttakeUntil(this.closeTimer)\n\t\t).subscribe((response) => {\n\t\t\tif(response.status === 'completed') {\n\t\t\t\tthis.endSubmitAndTimer()\n\t\t\t\tthis.refreshTraveler()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate openShippingConfirmation(): void {\n\t\tthis.callback.emit({action: 'ship'})\n\t}\n\n\tpublic needsManifest(): boolean {\n\t\tif (this.application.product.country_code === 'CA') {\n\t\t\treturn false\n\t\t}\n\n\t\tif (this.application.status === 'completed' && \n\t\t\t\tthis.application.packet_approved && \n\t\t\t\t!this.application.is_mailaway &&\n\t\t\t\t(!this.application.manifest || this.application.manifest.status === 'unmanifested')\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tprivate endSubmitAndTimer(): void {\n\t\t// this.submitting = false\n\t\tthis.closeTimer.next(true)\n\t\tthis.unsubscribePusher()\n\t}\n\n\tprivate refreshTraveler(): void {\n\t\tthis.callback.emit({ action: 'refresh' })\n\t}\n\n\tprivate unsubscribePusher(): void {\n\t\tthis.pusher.unsubscribe(`engine-events-app-${this.application.uuid}`)\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.endSubmitAndTimer()\n\t\tthis.closeTimer.unsubscribe()\n\t}\n\n\tpublic downloadPacket() {\n\t\tconst packet =this.application.documents.filter(document => document.type === 'packet')[0]\n\n\t\tif (packet) {\n\t\t\twindow.open(this.document_dowload + packet.uuid, '_blank')\n\t\t\tconsole.log(this.document_dowload + packet.uuid)\n\t\t}\n\t}\n}\n","import { CdkMonitorFocus, CdkTrapFocus, A11yModule } from '@angular/cdk/a11y';\nimport * as i4 from '@angular/cdk/overlay';\nimport { Overlay, FlexibleConnectedPositionStrategy, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';\nimport { ComponentPortal, CdkPortalOutlet, TemplatePortal, PortalModule } from '@angular/cdk/portal';\nimport { NgClass, DOCUMENT, CommonModule } from '@angular/common';\nimport * as i0 from '@angular/core';\nimport { Injectable, inject, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, Optional, SkipSelf, InjectionToken, Inject, ViewChild, forwardRef, booleanAttribute, Directive, Attribute, ContentChild, Self, TemplateRef, NgModule } from '@angular/core';\nimport { MatButton, MatIconButton, MatButtonModule } from '@angular/material/button';\nimport { CdkScrollableModule } from '@angular/cdk/scrolling';\nimport * as i1 from '@angular/material/core';\nimport { DateAdapter, MAT_DATE_FORMATS, _ErrorStateTracker, MatCommonModule } from '@angular/material/core';\nimport { Subject, Subscription, merge, of } from 'rxjs';\nimport { ESCAPE, hasModifierKey, SPACE, ENTER, PAGE_DOWN, PAGE_UP, END, HOME, DOWN_ARROW, UP_ARROW, RIGHT_ARROW, LEFT_ARROW, BACKSPACE } from '@angular/cdk/keycodes';\nimport * as i2 from '@angular/cdk/bidi';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { normalizePassiveListenerOptions, Platform, _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';\nimport { take, startWith, filter } from 'rxjs/operators';\nimport { coerceStringArray } from '@angular/cdk/coercion';\nimport { trigger, transition, animate, keyframes, style, state } from '@angular/animations';\nimport * as i2$1 from '@angular/forms';\nimport { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators, NgControl } from '@angular/forms';\nimport { MAT_FORM_FIELD, MatFormFieldControl } from '@angular/material/form-field';\nimport { MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';\n\n/** @docs-private */\nfunction createMissingDateImplError(provider) {\n return Error(`MatDatepicker: No provider found for ${provider}. You must add one of the following ` +\n `to your app config: provideNativeDateAdapter, provideDateFnsAdapter, ` +\n `provideLuxonDateAdapter, provideMomentDateAdapter, or provide a custom implementation.`);\n}\n\n/** Datepicker data that requires internationalization. */\nclass MatDatepickerIntl {\n constructor() {\n /**\n * Stream that emits whenever the labels here are changed. Use this to notify\n * components if the labels have changed after initialization.\n */\n this.changes = new Subject();\n /** A label for the calendar popup (used by screen readers). */\n this.calendarLabel = 'Calendar';\n /** A label for the button used to open the calendar popup (used by screen readers). */\n this.openCalendarLabel = 'Open calendar';\n /** Label for the button used to close the calendar popup. */\n this.closeCalendarLabel = 'Close calendar';\n /** A label for the previous month button (used by screen readers). */\n this.prevMonthLabel = 'Previous month';\n /** A label for the next month button (used by screen readers). */\n this.nextMonthLabel = 'Next month';\n /** A label for the previous year button (used by screen readers). */\n this.prevYearLabel = 'Previous year';\n /** A label for the next year button (used by screen readers). */\n this.nextYearLabel = 'Next year';\n /** A label for the previous multi-year button (used by screen readers). */\n this.prevMultiYearLabel = 'Previous 24 years';\n /** A label for the next multi-year button (used by screen readers). */\n this.nextMultiYearLabel = 'Next 24 years';\n /** A label for the 'switch to month view' button (used by screen readers). */\n this.switchToMonthViewLabel = 'Choose date';\n /** A label for the 'switch to year view' button (used by screen readers). */\n this.switchToMultiYearViewLabel = 'Choose month and year';\n /**\n * A label for the first date of a range of dates (used by screen readers).\n * @deprecated Provide your own internationalization string.\n * @breaking-change 17.0.0\n */\n this.startDateLabel = 'Start date';\n /**\n * A label for the last date of a range of dates (used by screen readers).\n * @deprecated Provide your own internationalization string.\n * @breaking-change 17.0.0\n */\n this.endDateLabel = 'End date';\n }\n /** Formats a range of years (used for visuals). */\n formatYearRange(start, end) {\n return `${start} \\u2013 ${end}`;\n }\n /** Formats a label for a range of years (used by screen readers). */\n formatYearRangeLabel(start, end) {\n return `${start} to ${end}`;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerIntl, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerIntl, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }] });\n\n/**\n * An internal class that represents the data corresponding to a single calendar cell.\n * @docs-private\n */\nclass MatCalendarCell {\n constructor(value, displayValue, ariaLabel, enabled, cssClasses = {}, compareValue = value, rawValue) {\n this.value = value;\n this.displayValue = displayValue;\n this.ariaLabel = ariaLabel;\n this.enabled = enabled;\n this.cssClasses = cssClasses;\n this.compareValue = compareValue;\n this.rawValue = rawValue;\n }\n}\nlet calendarBodyId = 1;\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = normalizePassiveListenerOptions({\n passive: false,\n capture: true,\n});\n/** Event options that can be used to bind a passive, capturing event. */\nconst passiveCapturingEventOptions = normalizePassiveListenerOptions({\n passive: true,\n capture: true,\n});\n/** Event options that can be used to bind a passive, non-capturing event. */\nconst passiveEventOptions = normalizePassiveListenerOptions({ passive: true });\n/**\n * An internal component used to display calendar data in a table.\n * @docs-private\n */\nclass MatCalendarBody {\n ngAfterViewChecked() {\n if (this._focusActiveCellAfterViewChecked) {\n this._focusActiveCell();\n this._focusActiveCellAfterViewChecked = false;\n }\n }\n constructor(_elementRef, _ngZone) {\n this._elementRef = _elementRef;\n this._ngZone = _ngZone;\n this._platform = inject(Platform);\n /**\n * Used to focus the active cell after change detection has run.\n */\n this._focusActiveCellAfterViewChecked = false;\n /** The number of columns in the table. */\n this.numCols = 7;\n /** The cell number of the active cell in the table. */\n this.activeCell = 0;\n /** Whether a range is being selected. */\n this.isRange = false;\n /**\n * The aspect ratio (width / height) to use for the cells in the table. This aspect ratio will be\n * maintained even as the table resizes.\n */\n this.cellAspectRatio = 1;\n /** Start of the preview range. */\n this.previewStart = null;\n /** End of the preview range. */\n this.previewEnd = null;\n /** Emits when a new value is selected. */\n this.selectedValueChange = new EventEmitter();\n /** Emits when the preview has changed as a result of a user action. */\n this.previewChange = new EventEmitter();\n this.activeDateChange = new EventEmitter();\n /** Emits the date at the possible start of a drag event. */\n this.dragStarted = new EventEmitter();\n /** Emits the date at the conclusion of a drag, or null if mouse was not released on a date. */\n this.dragEnded = new EventEmitter();\n this._didDragSinceMouseDown = false;\n /**\n * Event handler for when the user enters an element\n * inside the calendar body (e.g. by hovering in or focus).\n */\n this._enterHandler = (event) => {\n if (this._skipNextFocus && event.type === 'focus') {\n this._skipNextFocus = false;\n return;\n }\n // We only need to hit the zone when we're selecting a range.\n if (event.target && this.isRange) {\n const cell = this._getCellFromElement(event.target);\n if (cell) {\n this._ngZone.run(() => this.previewChange.emit({ value: cell.enabled ? cell : null, event }));\n }\n }\n };\n this._touchmoveHandler = (event) => {\n if (!this.isRange)\n return;\n const target = getActualTouchTarget(event);\n const cell = target ? this._getCellFromElement(target) : null;\n if (target !== event.target) {\n this._didDragSinceMouseDown = true;\n }\n // If the initial target of the touch is a date cell, prevent default so\n // that the move is not handled as a scroll.\n if (getCellElement(event.target)) {\n event.preventDefault();\n }\n this._ngZone.run(() => this.previewChange.emit({ value: cell?.enabled ? cell : null, event }));\n };\n /**\n * Event handler for when the user's pointer leaves an element\n * inside the calendar body (e.g. by hovering out or blurring).\n */\n this._leaveHandler = (event) => {\n // We only need to hit the zone when we're selecting a range.\n if (this.previewEnd !== null && this.isRange) {\n if (event.type !== 'blur') {\n this._didDragSinceMouseDown = true;\n }\n // Only reset the preview end value when leaving cells. This looks better, because\n // we have a gap between the cells and the rows and we don't want to remove the\n // range just for it to show up again when the user moves a few pixels to the side.\n if (event.target &&\n this._getCellFromElement(event.target) &&\n !(event.relatedTarget &&\n this._getCellFromElement(event.relatedTarget))) {\n this._ngZone.run(() => this.previewChange.emit({ value: null, event }));\n }\n }\n };\n /**\n * Triggered on mousedown or touchstart on a date cell.\n * Respsonsible for starting a drag sequence.\n */\n this._mousedownHandler = (event) => {\n if (!this.isRange)\n return;\n this._didDragSinceMouseDown = false;\n // Begin a drag if a cell within the current range was targeted.\n const cell = event.target && this._getCellFromElement(event.target);\n if (!cell || !this._isInRange(cell.compareValue)) {\n return;\n }\n this._ngZone.run(() => {\n this.dragStarted.emit({\n value: cell.rawValue,\n event,\n });\n });\n };\n /** Triggered on mouseup anywhere. Respsonsible for ending a drag sequence. */\n this._mouseupHandler = (event) => {\n if (!this.isRange)\n return;\n const cellElement = getCellElement(event.target);\n if (!cellElement) {\n // Mouseup happened outside of datepicker. Cancel drag.\n this._ngZone.run(() => {\n this.dragEnded.emit({ value: null, event });\n });\n return;\n }\n if (cellElement.closest('.mat-calendar-body') !== this._elementRef.nativeElement) {\n // Mouseup happened inside a different month instance.\n // Allow it to handle the event.\n return;\n }\n this._ngZone.run(() => {\n const cell = this._getCellFromElement(cellElement);\n this.dragEnded.emit({ value: cell?.rawValue ?? null, event });\n });\n };\n /** Triggered on touchend anywhere. Respsonsible for ending a drag sequence. */\n this._touchendHandler = (event) => {\n const target = getActualTouchTarget(event);\n if (target) {\n this._mouseupHandler({ target });\n }\n };\n this._id = `mat-calendar-body-${calendarBodyId++}`;\n this._startDateLabelId = `${this._id}-start-date`;\n this._endDateLabelId = `${this._id}-end-date`;\n _ngZone.runOutsideAngular(() => {\n const element = _elementRef.nativeElement;\n // `touchmove` is active since we need to call `preventDefault`.\n element.addEventListener('touchmove', this._touchmoveHandler, activeCapturingEventOptions);\n element.addEventListener('mouseenter', this._enterHandler, passiveCapturingEventOptions);\n element.addEventListener('focus', this._enterHandler, passiveCapturingEventOptions);\n element.addEventListener('mouseleave', this._leaveHandler, passiveCapturingEventOptions);\n element.addEventListener('blur', this._leaveHandler, passiveCapturingEventOptions);\n element.addEventListener('mousedown', this._mousedownHandler, passiveEventOptions);\n element.addEventListener('touchstart', this._mousedownHandler, passiveEventOptions);\n if (this._platform.isBrowser) {\n window.addEventListener('mouseup', this._mouseupHandler);\n window.addEventListener('touchend', this._touchendHandler);\n }\n });\n }\n /** Called when a cell is clicked. */\n _cellClicked(cell, event) {\n // Ignore \"clicks\" that are actually canceled drags (eg the user dragged\n // off and then went back to this cell to undo).\n if (this._didDragSinceMouseDown) {\n return;\n }\n if (cell.enabled) {\n this.selectedValueChange.emit({ value: cell.value, event });\n }\n }\n _emitActiveDateChange(cell, event) {\n if (cell.enabled) {\n this.activeDateChange.emit({ value: cell.value, event });\n }\n }\n /** Returns whether a cell should be marked as selected. */\n _isSelected(value) {\n return this.startValue === value || this.endValue === value;\n }\n ngOnChanges(changes) {\n const columnChanges = changes['numCols'];\n const { rows, numCols } = this;\n if (changes['rows'] || columnChanges) {\n this._firstRowOffset = rows && rows.length && rows[0].length ? numCols - rows[0].length : 0;\n }\n if (changes['cellAspectRatio'] || columnChanges || !this._cellPadding) {\n this._cellPadding = `${(50 * this.cellAspectRatio) / numCols}%`;\n }\n if (columnChanges || !this._cellWidth) {\n this._cellWidth = `${100 / numCols}%`;\n }\n }\n ngOnDestroy() {\n const element = this._elementRef.nativeElement;\n element.removeEventListener('touchmove', this._touchmoveHandler, activeCapturingEventOptions);\n element.removeEventListener('mouseenter', this._enterHandler, passiveCapturingEventOptions);\n element.removeEventListener('focus', this._enterHandler, passiveCapturingEventOptions);\n element.removeEventListener('mouseleave', this._leaveHandler, passiveCapturingEventOptions);\n element.removeEventListener('blur', this._leaveHandler, passiveCapturingEventOptions);\n element.removeEventListener('mousedown', this._mousedownHandler, passiveEventOptions);\n element.removeEventListener('touchstart', this._mousedownHandler, passiveEventOptions);\n if (this._platform.isBrowser) {\n window.removeEventListener('mouseup', this._mouseupHandler);\n window.removeEventListener('touchend', this._touchendHandler);\n }\n }\n /** Returns whether a cell is active. */\n _isActiveCell(rowIndex, colIndex) {\n let cellNumber = rowIndex * this.numCols + colIndex;\n // Account for the fact that the first row may not have as many cells.\n if (rowIndex) {\n cellNumber -= this._firstRowOffset;\n }\n return cellNumber == this.activeCell;\n }\n /**\n * Focuses the active cell after the microtask queue is empty.\n *\n * Adding a 0ms setTimeout seems to fix Voiceover losing focus when pressing PageUp/PageDown\n * (issue #24330).\n *\n * Determined a 0ms by gradually increasing duration from 0 and testing two use cases with screen\n * reader enabled:\n *\n * 1. Pressing PageUp/PageDown repeatedly with pausing between each key press.\n * 2. Pressing and holding the PageDown key with repeated keys enabled.\n *\n * Test 1 worked roughly 95-99% of the time with 0ms and got a little bit better as the duration\n * increased. Test 2 got slightly better until the duration was long enough to interfere with\n * repeated keys. If the repeated key speed was faster than the timeout duration, then pressing\n * and holding pagedown caused the entire page to scroll.\n *\n * Since repeated key speed can verify across machines, determined that any duration could\n * potentially interfere with repeated keys. 0ms would be best because it almost entirely\n * eliminates the focus being lost in Voiceover (#24330) without causing unintended side effects.\n * Adding delay also complicates writing tests.\n */\n _focusActiveCell(movePreview = true) {\n this._ngZone.runOutsideAngular(() => {\n this._ngZone.onStable.pipe(take(1)).subscribe(() => {\n setTimeout(() => {\n const activeCell = this._elementRef.nativeElement.querySelector('.mat-calendar-body-active');\n if (activeCell) {\n if (!movePreview) {\n this._skipNextFocus = true;\n }\n activeCell.focus();\n }\n });\n });\n });\n }\n /** Focuses the active cell after change detection has run and the microtask queue is empty. */\n _scheduleFocusActiveCellAfterViewChecked() {\n this._focusActiveCellAfterViewChecked = true;\n }\n /** Gets whether a value is the start of the main range. */\n _isRangeStart(value) {\n return isStart(value, this.startValue, this.endValue);\n }\n /** Gets whether a value is the end of the main range. */\n _isRangeEnd(value) {\n return isEnd(value, this.startValue, this.endValue);\n }\n /** Gets whether a value is within the currently-selected range. */\n _isInRange(value) {\n return isInRange(value, this.startValue, this.endValue, this.isRange);\n }\n /** Gets whether a value is the start of the comparison range. */\n _isComparisonStart(value) {\n return isStart(value, this.comparisonStart, this.comparisonEnd);\n }\n /** Whether the cell is a start bridge cell between the main and comparison ranges. */\n _isComparisonBridgeStart(value, rowIndex, colIndex) {\n if (!this._isComparisonStart(value) || this._isRangeStart(value) || !this._isInRange(value)) {\n return false;\n }\n let previousCell = this.rows[rowIndex][colIndex - 1];\n if (!previousCell) {\n const previousRow = this.rows[rowIndex - 1];\n previousCell = previousRow && previousRow[previousRow.length - 1];\n }\n return previousCell && !this._isRangeEnd(previousCell.compareValue);\n }\n /** Whether the cell is an end bridge cell between the main and comparison ranges. */\n _isComparisonBridgeEnd(value, rowIndex, colIndex) {\n if (!this._isComparisonEnd(value) || this._isRangeEnd(value) || !this._isInRange(value)) {\n return false;\n }\n let nextCell = this.rows[rowIndex][colIndex + 1];\n if (!nextCell) {\n const nextRow = this.rows[rowIndex + 1];\n nextCell = nextRow && nextRow[0];\n }\n return nextCell && !this._isRangeStart(nextCell.compareValue);\n }\n /** Gets whether a value is the end of the comparison range. */\n _isComparisonEnd(value) {\n return isEnd(value, this.comparisonStart, this.comparisonEnd);\n }\n /** Gets whether a value is within the current comparison range. */\n _isInComparisonRange(value) {\n return isInRange(value, this.comparisonStart, this.comparisonEnd, this.isRange);\n }\n /**\n * Gets whether a value is the same as the start and end of the comparison range.\n * For context, the functions that we use to determine whether something is the start/end of\n * a range don't allow for the start and end to be on the same day, because we'd have to use\n * much more specific CSS selectors to style them correctly in all scenarios. This is fine for\n * the regular range, because when it happens, the selected styles take over and still show where\n * the range would've been, however we don't have these selected styles for a comparison range.\n * This function is used to apply a class that serves the same purpose as the one for selected\n * dates, but it only applies in the context of a comparison range.\n */\n _isComparisonIdentical(value) {\n // Note that we don't need to null check the start/end\n // here, because the `value` will always be defined.\n return this.comparisonStart === this.comparisonEnd && value === this.comparisonStart;\n }\n /** Gets whether a value is the start of the preview range. */\n _isPreviewStart(value) {\n return isStart(value, this.previewStart, this.previewEnd);\n }\n /** Gets whether a value is the end of the preview range. */\n _isPreviewEnd(value) {\n return isEnd(value, this.previewStart, this.previewEnd);\n }\n /** Gets whether a value is inside the preview range. */\n _isInPreview(value) {\n return isInRange(value, this.previewStart, this.previewEnd, this.isRange);\n }\n /** Gets ids of aria descriptions for the start and end of a date range. */\n _getDescribedby(value) {\n if (!this.isRange) {\n return null;\n }\n if (this.startValue === value && this.endValue === value) {\n return `${this._startDateLabelId} ${this._endDateLabelId}`;\n }\n else if (this.startValue === value) {\n return this._startDateLabelId;\n }\n else if (this.endValue === value) {\n return this._endDateLabelId;\n }\n return null;\n }\n /** Finds the MatCalendarCell that corresponds to a DOM node. */\n _getCellFromElement(element) {\n const cell = getCellElement(element);\n if (cell) {\n const row = cell.getAttribute('data-mat-row');\n const col = cell.getAttribute('data-mat-col');\n if (row && col) {\n return this.rows[parseInt(row)][parseInt(col)];\n }\n }\n return null;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatCalendarBody, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"17.0.0\", version: \"17.2.0\", type: MatCalendarBody, isStandalone: true, selector: \"[mat-calendar-body]\", inputs: { label: \"label\", rows: \"rows\", todayValue: \"todayValue\", startValue: \"startValue\", endValue: \"endValue\", labelMinRequiredCells: \"labelMinRequiredCells\", numCols: \"numCols\", activeCell: \"activeCell\", isRange: \"isRange\", cellAspectRatio: \"cellAspectRatio\", comparisonStart: \"comparisonStart\", comparisonEnd: \"comparisonEnd\", previewStart: \"previewStart\", previewEnd: \"previewEnd\", startDateAccessibleName: \"startDateAccessibleName\", endDateAccessibleName: \"endDateAccessibleName\" }, outputs: { selectedValueChange: \"selectedValueChange\", previewChange: \"previewChange\", activeDateChange: \"activeDateChange\", dragStarted: \"dragStarted\", dragEnded: \"dragEnded\" }, host: { classAttribute: \"mat-calendar-body\" }, exportAs: [\"matCalendarBody\"], usesOnChanges: true, ngImport: i0, template: \"\\n@if (_firstRowOffset < labelMinRequiredCells) {\\n \\n \\n {{label}}\\n \\n \\n}\\n\\n\\n@for (row of rows; track row; let rowIndex = $index) {\\n \\n \\n @if (rowIndex === 0 && _firstRowOffset) {\\n \\n {{_firstRowOffset >= labelMinRequiredCells ? label : ''}}\\n \\n }\\n \\n @for (item of row; track item; let colIndex = $index) {\\n \\n \\n \\n {{item.displayValue}}\\n \\n \\n \\n \\n }\\n \\n}\\n\\n\\n {{startDateAccessibleName}}\\n \\n\\n {{endDateAccessibleName}}\\n \\n\", styles: [\".mat-calendar-body{min-width:224px}.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){border-color:var(--mat-datepicker-calendar-date-today-outline-color)}.mat-calendar-body-label{height:0;line-height:0;text-align:start;padding-left:4.7142857143%;padding-right:4.7142857143%;font-size:var(--mat-datepicker-calendar-body-label-text-size);font-weight:var(--mat-datepicker-calendar-body-label-text-weight);color:var(--mat-datepicker-calendar-body-label-text-color)}.mat-calendar-body-hidden-label{display:none}.mat-calendar-body-cell-container{position:relative;height:0;line-height:0}.mat-calendar-body-cell{-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;top:0;left:0;width:100%;height:100%;background:none;text-align:center;outline:none;font-family:inherit;margin:0}.mat-calendar-body-cell::-moz-focus-inner{border:0}.mat-calendar-body-cell::before,.mat-calendar-body-cell::after,.mat-calendar-body-cell-preview{content:\\\"\\\";position:absolute;top:5%;left:0;z-index:0;box-sizing:border-box;display:block;height:90%;width:100%}.mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-start::after,.mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,.mat-calendar-body-comparison-start::after,.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:5%;width:95%;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,[dir=rtl] .mat-calendar-body-comparison-start::after,[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:0;border-radius:0;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,.mat-calendar-body-comparison-end::after,.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}[dir=rtl] .mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,[dir=rtl] .mat-calendar-body-comparison-end::after,[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{left:5%;border-radius:0;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-comparison-bridge-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-bridge-end.mat-calendar-body-range-start::after{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end.mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-end.mat-calendar-body-range-start::after{width:90%}.mat-calendar-body-in-preview{color:var(--mat-datepicker-calendar-date-preview-state-outline-color)}.mat-calendar-body-in-preview .mat-calendar-body-cell-preview{border-top:dashed 1px;border-bottom:dashed 1px}.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:dashed 1px}[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:0;border-right:dashed 1px}.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:dashed 1px}[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:0;border-left:dashed 1px}.mat-calendar-body-disabled{cursor:default}.mat-calendar-body-disabled>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){color:var(--mat-datepicker-calendar-date-disabled-state-text-color)}.mat-calendar-body-disabled>.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){border-color:var(--mat-datepicker-calendar-date-today-disabled-state-outline-color)}.cdk-high-contrast-active .mat-calendar-body-disabled{opacity:.5}.mat-calendar-body-cell-content{top:5%;left:5%;z-index:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px;color:var(--mat-datepicker-calendar-date-text-color);border-color:var(--mat-datepicker-calendar-date-outline-color)}.mat-calendar-body-cell-content.mat-focus-indicator{position:absolute}.cdk-high-contrast-active .mat-calendar-body-cell-content{border:none}.cdk-keyboard-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical),.cdk-program-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background-color:var(--mat-datepicker-calendar-date-focus-state-background-color)}@media(hover: hover){.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background-color:var(--mat-datepicker-calendar-date-hover-state-background-color)}}.mat-calendar-body-selected{background-color:var(--mat-datepicker-calendar-date-selected-state-background-color);color:var(--mat-datepicker-calendar-date-selected-state-text-color)}.mat-calendar-body-disabled>.mat-calendar-body-selected{background-color:var(--mat-datepicker-calendar-date-selected-disabled-state-background-color)}.mat-calendar-body-selected.mat-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mat-datepicker-calendar-date-today-selected-state-outline-color)}.mat-calendar-body-in-range::before{background:var(--mat-datepicker-calendar-date-in-range-state-background-color)}.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range::before{background:var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color)}.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range::before{background:var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color)}.mat-calendar-body-comparison-bridge-start::before,[dir=rtl] .mat-calendar-body-comparison-bridge-end::before{background:linear-gradient(to right, var(--mat-datepicker-calendar-date-in-range-state-background-color) 50%, var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color) 50%)}.mat-calendar-body-comparison-bridge-end::before,[dir=rtl] .mat-calendar-body-comparison-bridge-start::before{background:linear-gradient(to left, var(--mat-datepicker-calendar-date-in-range-state-background-color) 50%, var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color) 50%)}.mat-calendar-body-in-range>.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range.mat-calendar-body-in-range::after{background:var(--mat-datepicker-calendar-date-in-overlap-range-state-background-color)}.mat-calendar-body-comparison-identical.mat-calendar-body-selected,.mat-calendar-body-in-comparison-range>.mat-calendar-body-selected{background:var(--mat-datepicker-calendar-date-in-overlap-range-selected-state-background-color)}.cdk-high-contrast-active .mat-datepicker-popup:not(:empty),.cdk-high-contrast-active .mat-calendar-body-cell:not(.mat-calendar-body-in-range) .mat-calendar-body-selected{outline:solid 1px}.cdk-high-contrast-active .mat-calendar-body-today{outline:dotted 1px}.cdk-high-contrast-active .mat-calendar-body-cell::before,.cdk-high-contrast-active .mat-calendar-body-cell::after,.cdk-high-contrast-active .mat-calendar-body-selected{background:none}.cdk-high-contrast-active .mat-calendar-body-in-range::before,.cdk-high-contrast-active .mat-calendar-body-comparison-bridge-start::before,.cdk-high-contrast-active .mat-calendar-body-comparison-bridge-end::before{border-top:solid 1px;border-bottom:solid 1px}.cdk-high-contrast-active .mat-calendar-body-range-start::before{border-left:solid 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-range-start::before{border-left:0;border-right:solid 1px}.cdk-high-contrast-active .mat-calendar-body-range-end::before{border-right:solid 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-range-end::before{border-right:0;border-left:solid 1px}.cdk-high-contrast-active .mat-calendar-body-in-comparison-range::before{border-top:dashed 1px;border-bottom:dashed 1px}.cdk-high-contrast-active .mat-calendar-body-comparison-start::before{border-left:dashed 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-comparison-start::before{border-left:0;border-right:dashed 1px}.cdk-high-contrast-active .mat-calendar-body-comparison-end::before{border-right:dashed 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-comparison-end::before{border-right:0;border-left:dashed 1px}\"], dependencies: [{ kind: \"directive\", type: NgClass, selector: \"[ngClass]\", inputs: [\"class\", \"ngClass\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatCalendarBody, decorators: [{\n type: Component,\n args: [{ selector: '[mat-calendar-body]', host: {\n 'class': 'mat-calendar-body',\n }, exportAs: 'matCalendarBody', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgClass], template: \"\\n@if (_firstRowOffset < labelMinRequiredCells) {\\n \\n \\n {{label}}\\n \\n \\n}\\n\\n\\n@for (row of rows; track row; let rowIndex = $index) {\\n \\n \\n @if (rowIndex === 0 && _firstRowOffset) {\\n \\n {{_firstRowOffset >= labelMinRequiredCells ? label : ''}}\\n \\n }\\n \\n @for (item of row; track item; let colIndex = $index) {\\n \\n \\n \\n {{item.displayValue}}\\n \\n \\n \\n \\n }\\n \\n}\\n\\n\\n {{startDateAccessibleName}}\\n \\n\\n {{endDateAccessibleName}}\\n \\n\", styles: [\".mat-calendar-body{min-width:224px}.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){border-color:var(--mat-datepicker-calendar-date-today-outline-color)}.mat-calendar-body-label{height:0;line-height:0;text-align:start;padding-left:4.7142857143%;padding-right:4.7142857143%;font-size:var(--mat-datepicker-calendar-body-label-text-size);font-weight:var(--mat-datepicker-calendar-body-label-text-weight);color:var(--mat-datepicker-calendar-body-label-text-color)}.mat-calendar-body-hidden-label{display:none}.mat-calendar-body-cell-container{position:relative;height:0;line-height:0}.mat-calendar-body-cell{-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;top:0;left:0;width:100%;height:100%;background:none;text-align:center;outline:none;font-family:inherit;margin:0}.mat-calendar-body-cell::-moz-focus-inner{border:0}.mat-calendar-body-cell::before,.mat-calendar-body-cell::after,.mat-calendar-body-cell-preview{content:\\\"\\\";position:absolute;top:5%;left:0;z-index:0;box-sizing:border-box;display:block;height:90%;width:100%}.mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-start::after,.mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,.mat-calendar-body-comparison-start::after,.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:5%;width:95%;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,[dir=rtl] .mat-calendar-body-comparison-start::after,[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:0;border-radius:0;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,.mat-calendar-body-comparison-end::after,.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}[dir=rtl] .mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,[dir=rtl] .mat-calendar-body-comparison-end::after,[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{left:5%;border-radius:0;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-comparison-bridge-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-bridge-end.mat-calendar-body-range-start::after{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end.mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-end.mat-calendar-body-range-start::after{width:90%}.mat-calendar-body-in-preview{color:var(--mat-datepicker-calendar-date-preview-state-outline-color)}.mat-calendar-body-in-preview .mat-calendar-body-cell-preview{border-top:dashed 1px;border-bottom:dashed 1px}.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:dashed 1px}[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:0;border-right:dashed 1px}.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:dashed 1px}[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:0;border-left:dashed 1px}.mat-calendar-body-disabled{cursor:default}.mat-calendar-body-disabled>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){color:var(--mat-datepicker-calendar-date-disabled-state-text-color)}.mat-calendar-body-disabled>.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){border-color:var(--mat-datepicker-calendar-date-today-disabled-state-outline-color)}.cdk-high-contrast-active .mat-calendar-body-disabled{opacity:.5}.mat-calendar-body-cell-content{top:5%;left:5%;z-index:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px;color:var(--mat-datepicker-calendar-date-text-color);border-color:var(--mat-datepicker-calendar-date-outline-color)}.mat-calendar-body-cell-content.mat-focus-indicator{position:absolute}.cdk-high-contrast-active .mat-calendar-body-cell-content{border:none}.cdk-keyboard-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical),.cdk-program-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background-color:var(--mat-datepicker-calendar-date-focus-state-background-color)}@media(hover: hover){.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background-color:var(--mat-datepicker-calendar-date-hover-state-background-color)}}.mat-calendar-body-selected{background-color:var(--mat-datepicker-calendar-date-selected-state-background-color);color:var(--mat-datepicker-calendar-date-selected-state-text-color)}.mat-calendar-body-disabled>.mat-calendar-body-selected{background-color:var(--mat-datepicker-calendar-date-selected-disabled-state-background-color)}.mat-calendar-body-selected.mat-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mat-datepicker-calendar-date-today-selected-state-outline-color)}.mat-calendar-body-in-range::before{background:var(--mat-datepicker-calendar-date-in-range-state-background-color)}.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range::before{background:var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color)}.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range::before{background:var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color)}.mat-calendar-body-comparison-bridge-start::before,[dir=rtl] .mat-calendar-body-comparison-bridge-end::before{background:linear-gradient(to right, var(--mat-datepicker-calendar-date-in-range-state-background-color) 50%, var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color) 50%)}.mat-calendar-body-comparison-bridge-end::before,[dir=rtl] .mat-calendar-body-comparison-bridge-start::before{background:linear-gradient(to left, var(--mat-datepicker-calendar-date-in-range-state-background-color) 50%, var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color) 50%)}.mat-calendar-body-in-range>.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range.mat-calendar-body-in-range::after{background:var(--mat-datepicker-calendar-date-in-overlap-range-state-background-color)}.mat-calendar-body-comparison-identical.mat-calendar-body-selected,.mat-calendar-body-in-comparison-range>.mat-calendar-body-selected{background:var(--mat-datepicker-calendar-date-in-overlap-range-selected-state-background-color)}.cdk-high-contrast-active .mat-datepicker-popup:not(:empty),.cdk-high-contrast-active .mat-calendar-body-cell:not(.mat-calendar-body-in-range) .mat-calendar-body-selected{outline:solid 1px}.cdk-high-contrast-active .mat-calendar-body-today{outline:dotted 1px}.cdk-high-contrast-active .mat-calendar-body-cell::before,.cdk-high-contrast-active .mat-calendar-body-cell::after,.cdk-high-contrast-active .mat-calendar-body-selected{background:none}.cdk-high-contrast-active .mat-calendar-body-in-range::before,.cdk-high-contrast-active .mat-calendar-body-comparison-bridge-start::before,.cdk-high-contrast-active .mat-calendar-body-comparison-bridge-end::before{border-top:solid 1px;border-bottom:solid 1px}.cdk-high-contrast-active .mat-calendar-body-range-start::before{border-left:solid 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-range-start::before{border-left:0;border-right:solid 1px}.cdk-high-contrast-active .mat-calendar-body-range-end::before{border-right:solid 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-range-end::before{border-right:0;border-left:solid 1px}.cdk-high-contrast-active .mat-calendar-body-in-comparison-range::before{border-top:dashed 1px;border-bottom:dashed 1px}.cdk-high-contrast-active .mat-calendar-body-comparison-start::before{border-left:dashed 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-comparison-start::before{border-left:0;border-right:dashed 1px}.cdk-high-contrast-active .mat-calendar-body-comparison-end::before{border-right:dashed 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-comparison-end::before{border-right:0;border-left:dashed 1px}\"] }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { label: [{\n type: Input\n }], rows: [{\n type: Input\n }], todayValue: [{\n type: Input\n }], startValue: [{\n type: Input\n }], endValue: [{\n type: Input\n }], labelMinRequiredCells: [{\n type: Input\n }], numCols: [{\n type: Input\n }], activeCell: [{\n type: Input\n }], isRange: [{\n type: Input\n }], cellAspectRatio: [{\n type: Input\n }], comparisonStart: [{\n type: Input\n }], comparisonEnd: [{\n type: Input\n }], previewStart: [{\n type: Input\n }], previewEnd: [{\n type: Input\n }], startDateAccessibleName: [{\n type: Input\n }], endDateAccessibleName: [{\n type: Input\n }], selectedValueChange: [{\n type: Output\n }], previewChange: [{\n type: Output\n }], activeDateChange: [{\n type: Output\n }], dragStarted: [{\n type: Output\n }], dragEnded: [{\n type: Output\n }] } });\n/** Checks whether a node is a table cell element. */\nfunction isTableCell(node) {\n return node?.nodeName === 'TD';\n}\n/**\n * Gets the date table cell element that is or contains the specified element.\n * Or returns null if element is not part of a date cell.\n */\nfunction getCellElement(element) {\n let cell;\n if (isTableCell(element)) {\n cell = element;\n }\n else if (isTableCell(element.parentNode)) {\n cell = element.parentNode;\n }\n else if (isTableCell(element.parentNode?.parentNode)) {\n cell = element.parentNode.parentNode;\n }\n return cell?.getAttribute('data-mat-row') != null ? cell : null;\n}\n/** Checks whether a value is the start of a range. */\nfunction isStart(value, start, end) {\n return end !== null && start !== end && value < end && value === start;\n}\n/** Checks whether a value is the end of a range. */\nfunction isEnd(value, start, end) {\n return start !== null && start !== end && value >= start && value === end;\n}\n/** Checks whether a value is inside of a range. */\nfunction isInRange(value, start, end, rangeEnabled) {\n return (rangeEnabled &&\n start !== null &&\n end !== null &&\n start !== end &&\n value >= start &&\n value <= end);\n}\n/**\n * Extracts the element that actually corresponds to a touch event's location\n * (rather than the element that initiated the sequence of touch events).\n */\nfunction getActualTouchTarget(event) {\n const touchLocation = event.changedTouches[0];\n return document.elementFromPoint(touchLocation.clientX, touchLocation.clientY);\n}\n\n/** A class representing a range of dates. */\nclass DateRange {\n constructor(\n /** The start date of the range. */\n start, \n /** The end date of the range. */\n end) {\n this.start = start;\n this.end = end;\n }\n}\n/**\n * A selection model containing a date selection.\n * @docs-private\n */\nclass MatDateSelectionModel {\n constructor(\n /** The current selection. */\n selection, _adapter) {\n this.selection = selection;\n this._adapter = _adapter;\n this._selectionChanged = new Subject();\n /** Emits when the selection has changed. */\n this.selectionChanged = this._selectionChanged;\n this.selection = selection;\n }\n /**\n * Updates the current selection in the model.\n * @param value New selection that should be assigned.\n * @param source Object that triggered the selection change.\n */\n updateSelection(value, source) {\n const oldValue = this.selection;\n this.selection = value;\n this._selectionChanged.next({ selection: value, source, oldValue });\n }\n ngOnDestroy() {\n this._selectionChanged.complete();\n }\n _isValidDateInstance(date) {\n return this._adapter.isDateInstance(date) && this._adapter.isValid(date);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateSelectionModel, deps: \"invalid\", target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateSelectionModel }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateSelectionModel, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: undefined }, { type: i1.DateAdapter }] });\n/**\n * A selection model that contains a single date.\n * @docs-private\n */\nclass MatSingleDateSelectionModel extends MatDateSelectionModel {\n constructor(adapter) {\n super(null, adapter);\n }\n /**\n * Adds a date to the current selection. In the case of a single date selection, the added date\n * simply overwrites the previous selection\n */\n add(date) {\n super.updateSelection(date, this);\n }\n /** Checks whether the current selection is valid. */\n isValid() {\n return this.selection != null && this._isValidDateInstance(this.selection);\n }\n /**\n * Checks whether the current selection is complete. In the case of a single date selection, this\n * is true if the current selection is not null.\n */\n isComplete() {\n return this.selection != null;\n }\n /** Clones the selection model. */\n clone() {\n const clone = new MatSingleDateSelectionModel(this._adapter);\n clone.updateSelection(this.selection, this);\n return clone;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatSingleDateSelectionModel, deps: [{ token: i1.DateAdapter }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatSingleDateSelectionModel }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatSingleDateSelectionModel, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.DateAdapter }] });\n/**\n * A selection model that contains a date range.\n * @docs-private\n */\nclass MatRangeDateSelectionModel extends MatDateSelectionModel {\n constructor(adapter) {\n super(new DateRange(null, null), adapter);\n }\n /**\n * Adds a date to the current selection. In the case of a date range selection, the added date\n * fills in the next `null` value in the range. If both the start and the end already have a date,\n * the selection is reset so that the given date is the new `start` and the `end` is null.\n */\n add(date) {\n let { start, end } = this.selection;\n if (start == null) {\n start = date;\n }\n else if (end == null) {\n end = date;\n }\n else {\n start = date;\n end = null;\n }\n super.updateSelection(new DateRange(start, end), this);\n }\n /** Checks whether the current selection is valid. */\n isValid() {\n const { start, end } = this.selection;\n // Empty ranges are valid.\n if (start == null && end == null) {\n return true;\n }\n // Complete ranges are only valid if both dates are valid and the start is before the end.\n if (start != null && end != null) {\n return (this._isValidDateInstance(start) &&\n this._isValidDateInstance(end) &&\n this._adapter.compareDate(start, end) <= 0);\n }\n // Partial ranges are valid if the start/end is valid.\n return ((start == null || this._isValidDateInstance(start)) &&\n (end == null || this._isValidDateInstance(end)));\n }\n /**\n * Checks whether the current selection is complete. In the case of a date range selection, this\n * is true if the current selection has a non-null `start` and `end`.\n */\n isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }\n /** Clones the selection model. */\n clone() {\n const clone = new MatRangeDateSelectionModel(this._adapter);\n clone.updateSelection(this.selection, this);\n return clone;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRangeDateSelectionModel, deps: [{ token: i1.DateAdapter }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRangeDateSelectionModel }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRangeDateSelectionModel, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.DateAdapter }] });\n/** @docs-private */\nfunction MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY(parent, adapter) {\n return parent || new MatSingleDateSelectionModel(adapter);\n}\n/**\n * Used to provide a single selection model to a component.\n * @docs-private\n */\nconst MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER = {\n provide: MatDateSelectionModel,\n deps: [[new Optional(), new SkipSelf(), MatDateSelectionModel], DateAdapter],\n useFactory: MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY,\n};\n/** @docs-private */\nfunction MAT_RANGE_DATE_SELECTION_MODEL_FACTORY(parent, adapter) {\n return parent || new MatRangeDateSelectionModel(adapter);\n}\n/**\n * Used to provide a range selection model to a component.\n * @docs-private\n */\nconst MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER = {\n provide: MatDateSelectionModel,\n deps: [[new Optional(), new SkipSelf(), MatDateSelectionModel], DateAdapter],\n useFactory: MAT_RANGE_DATE_SELECTION_MODEL_FACTORY,\n};\n\n/** Injection token used to customize the date range selection behavior. */\nconst MAT_DATE_RANGE_SELECTION_STRATEGY = new InjectionToken('MAT_DATE_RANGE_SELECTION_STRATEGY');\n/** Provides the default date range selection behavior. */\nclass DefaultMatCalendarRangeStrategy {\n constructor(_dateAdapter) {\n this._dateAdapter = _dateAdapter;\n }\n selectionFinished(date, currentRange) {\n let { start, end } = currentRange;\n if (start == null) {\n start = date;\n }\n else if (end == null && date && this._dateAdapter.compareDate(date, start) >= 0) {\n end = date;\n }\n else {\n start = date;\n end = null;\n }\n return new DateRange(start, end);\n }\n createPreview(activeDate, currentRange) {\n let start = null;\n let end = null;\n if (currentRange.start && !currentRange.end && activeDate) {\n start = currentRange.start;\n end = activeDate;\n }\n return new DateRange(start, end);\n }\n createDrag(dragOrigin, originalRange, newDate) {\n let start = originalRange.start;\n let end = originalRange.end;\n if (!start || !end) {\n // Can't drag from an incomplete range.\n return null;\n }\n const adapter = this._dateAdapter;\n const isRange = adapter.compareDate(start, end) !== 0;\n const diffYears = adapter.getYear(newDate) - adapter.getYear(dragOrigin);\n const diffMonths = adapter.getMonth(newDate) - adapter.getMonth(dragOrigin);\n const diffDays = adapter.getDate(newDate) - adapter.getDate(dragOrigin);\n if (isRange && adapter.sameDate(dragOrigin, originalRange.start)) {\n start = newDate;\n if (adapter.compareDate(newDate, end) > 0) {\n end = adapter.addCalendarYears(end, diffYears);\n end = adapter.addCalendarMonths(end, diffMonths);\n end = adapter.addCalendarDays(end, diffDays);\n }\n }\n else if (isRange && adapter.sameDate(dragOrigin, originalRange.end)) {\n end = newDate;\n if (adapter.compareDate(newDate, start) < 0) {\n start = adapter.addCalendarYears(start, diffYears);\n start = adapter.addCalendarMonths(start, diffMonths);\n start = adapter.addCalendarDays(start, diffDays);\n }\n }\n else {\n start = adapter.addCalendarYears(start, diffYears);\n start = adapter.addCalendarMonths(start, diffMonths);\n start = adapter.addCalendarDays(start, diffDays);\n end = adapter.addCalendarYears(end, diffYears);\n end = adapter.addCalendarMonths(end, diffMonths);\n end = adapter.addCalendarDays(end, diffDays);\n }\n return new DateRange(start, end);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: DefaultMatCalendarRangeStrategy, deps: [{ token: i1.DateAdapter }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: DefaultMatCalendarRangeStrategy }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: DefaultMatCalendarRangeStrategy, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.DateAdapter }] });\n/** @docs-private */\nfunction MAT_CALENDAR_RANGE_STRATEGY_PROVIDER_FACTORY(parent, adapter) {\n return parent || new DefaultMatCalendarRangeStrategy(adapter);\n}\n/** @docs-private */\nconst MAT_CALENDAR_RANGE_STRATEGY_PROVIDER = {\n provide: MAT_DATE_RANGE_SELECTION_STRATEGY,\n deps: [[new Optional(), new SkipSelf(), MAT_DATE_RANGE_SELECTION_STRATEGY], DateAdapter],\n useFactory: MAT_CALENDAR_RANGE_STRATEGY_PROVIDER_FACTORY,\n};\n\nconst DAYS_PER_WEEK = 7;\n/**\n * An internal component used to display a single month in the datepicker.\n * @docs-private\n */\nclass MatMonthView {\n /**\n * The date to display in this month view (everything other than the month and year is ignored).\n */\n get activeDate() {\n return this._activeDate;\n }\n set activeDate(value) {\n const oldActiveDate = this._activeDate;\n const validDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value)) ||\n this._dateAdapter.today();\n this._activeDate = this._dateAdapter.clampDate(validDate, this.minDate, this.maxDate);\n if (!this._hasSameMonthAndYear(oldActiveDate, this._activeDate)) {\n this._init();\n }\n }\n /** The currently selected date. */\n get selected() {\n return this._selected;\n }\n set selected(value) {\n if (value instanceof DateRange) {\n this._selected = value;\n }\n else {\n this._selected = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n this._setRanges(this._selected);\n }\n /** The minimum selectable date. */\n get minDate() {\n return this._minDate;\n }\n set minDate(value) {\n this._minDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n /** The maximum selectable date. */\n get maxDate() {\n return this._maxDate;\n }\n set maxDate(value) {\n this._maxDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n constructor(_changeDetectorRef, _dateFormats, _dateAdapter, _dir, _rangeStrategy) {\n this._changeDetectorRef = _changeDetectorRef;\n this._dateFormats = _dateFormats;\n this._dateAdapter = _dateAdapter;\n this._dir = _dir;\n this._rangeStrategy = _rangeStrategy;\n this._rerenderSubscription = Subscription.EMPTY;\n /** Origin of active drag, or null when dragging is not active. */\n this.activeDrag = null;\n /** Emits when a new date is selected. */\n this.selectedChange = new EventEmitter();\n /** Emits when any date is selected. */\n this._userSelection = new EventEmitter();\n /** Emits when the user initiates a date range drag via mouse or touch. */\n this.dragStarted = new EventEmitter();\n /**\n * Emits when the user completes or cancels a date range drag.\n * Emits null when the drag was canceled or the newly selected date range if completed.\n */\n this.dragEnded = new EventEmitter();\n /** Emits when any date is activated. */\n this.activeDateChange = new EventEmitter();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._dateAdapter) {\n throw createMissingDateImplError('DateAdapter');\n }\n if (!this._dateFormats) {\n throw createMissingDateImplError('MAT_DATE_FORMATS');\n }\n }\n this._activeDate = this._dateAdapter.today();\n }\n ngAfterContentInit() {\n this._rerenderSubscription = this._dateAdapter.localeChanges\n .pipe(startWith(null))\n .subscribe(() => this._init());\n }\n ngOnChanges(changes) {\n const comparisonChange = changes['comparisonStart'] || changes['comparisonEnd'];\n if (comparisonChange && !comparisonChange.firstChange) {\n this._setRanges(this.selected);\n }\n if (changes['activeDrag'] && !this.activeDrag) {\n this._clearPreview();\n }\n }\n ngOnDestroy() {\n this._rerenderSubscription.unsubscribe();\n }\n /** Handles when a new date is selected. */\n _dateSelected(event) {\n const date = event.value;\n const selectedDate = this._getDateFromDayOfMonth(date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n this._clearPreview();\n this._changeDetectorRef.markForCheck();\n }\n /**\n * Takes the index of a calendar body cell wrapped in an event as argument. For the date that\n * corresponds to the given cell, set `activeDate` to that date and fire `activeDateChange` with\n * that date.\n *\n * This function is used to match each component's model of the active date with the calendar\n * body cell that was focused. It updates its value of `activeDate` synchronously and updates the\n * parent's value asynchronously via the `activeDateChange` event. The child component receives an\n * updated value asynchronously via the `activeCell` Input.\n */\n _updateActiveDate(event) {\n const month = event.value;\n const oldActiveDate = this._activeDate;\n this.activeDate = this._getDateFromDayOfMonth(month);\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this._activeDate);\n }\n }\n /** Handles keydown events on the calendar body when calendar is in month view. */\n _handleCalendarBodyKeydown(event) {\n // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent\n // disabled ones from being selected. This may not be ideal, we should look into whether\n // navigation should skip over disabled dates, and if so, how to implement that efficiently.\n const oldActiveDate = this._activeDate;\n const isRtl = this._isRtl();\n switch (event.keyCode) {\n case LEFT_ARROW:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? 1 : -1);\n break;\n case RIGHT_ARROW:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, isRtl ? -1 : 1);\n break;\n case UP_ARROW:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, -7);\n break;\n case DOWN_ARROW:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 7);\n break;\n case HOME:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 1 - this._dateAdapter.getDate(this._activeDate));\n break;\n case END:\n this.activeDate = this._dateAdapter.addCalendarDays(this._activeDate, this._dateAdapter.getNumDaysInMonth(this._activeDate) -\n this._dateAdapter.getDate(this._activeDate));\n break;\n case PAGE_UP:\n this.activeDate = event.altKey\n ? this._dateAdapter.addCalendarYears(this._activeDate, -1)\n : this._dateAdapter.addCalendarMonths(this._activeDate, -1);\n break;\n case PAGE_DOWN:\n this.activeDate = event.altKey\n ? this._dateAdapter.addCalendarYears(this._activeDate, 1)\n : this._dateAdapter.addCalendarMonths(this._activeDate, 1);\n break;\n case ENTER:\n case SPACE:\n this._selectionKeyPressed = true;\n if (this._canSelect(this._activeDate)) {\n // Prevent unexpected default actions such as form submission.\n // Note that we only prevent the default action here while the selection happens in\n // `keyup` below. We can't do the selection here, because it can cause the calendar to\n // reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`\n // because it's too late (see #23305).\n event.preventDefault();\n }\n return;\n case ESCAPE:\n // Abort the current range selection if the user presses escape mid-selection.\n if (this._previewEnd != null && !hasModifierKey(event)) {\n this._clearPreview();\n // If a drag is in progress, cancel the drag without changing the\n // current selection.\n if (this.activeDrag) {\n this.dragEnded.emit({ value: null, event });\n }\n else {\n this.selectedChange.emit(null);\n this._userSelection.emit({ value: null, event });\n }\n event.preventDefault();\n event.stopPropagation(); // Prevents the overlay from closing.\n }\n return;\n default:\n // Don't prevent default or focus active cell on keys that we don't explicitly handle.\n return;\n }\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n this._focusActiveCellAfterViewChecked();\n }\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }\n /** Handles keyup events on the calendar body when calendar is in month view. */\n _handleCalendarBodyKeyup(event) {\n if (event.keyCode === SPACE || event.keyCode === ENTER) {\n if (this._selectionKeyPressed && this._canSelect(this._activeDate)) {\n this._dateSelected({ value: this._dateAdapter.getDate(this._activeDate), event });\n }\n this._selectionKeyPressed = false;\n }\n }\n /** Initializes this month view. */\n _init() {\n this._setRanges(this.selected);\n this._todayDate = this._getCellCompareValue(this._dateAdapter.today());\n this._monthLabel = this._dateFormats.display.monthLabel\n ? this._dateAdapter.format(this.activeDate, this._dateFormats.display.monthLabel)\n : this._dateAdapter\n .getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();\n let firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);\n this._firstWeekOffset =\n (DAYS_PER_WEEK +\n this._dateAdapter.getDayOfWeek(firstOfMonth) -\n this._dateAdapter.getFirstDayOfWeek()) %\n DAYS_PER_WEEK;\n this._initWeekdays();\n this._createWeekCells();\n this._changeDetectorRef.markForCheck();\n }\n /** Focuses the active cell after the microtask queue is empty. */\n _focusActiveCell(movePreview) {\n this._matCalendarBody._focusActiveCell(movePreview);\n }\n /** Focuses the active cell after change detection has run and the microtask queue is empty. */\n _focusActiveCellAfterViewChecked() {\n this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked();\n }\n /** Called when the user has activated a new cell and the preview needs to be updated. */\n _previewChanged({ event, value: cell }) {\n if (this._rangeStrategy) {\n // We can assume that this will be a range, because preview\n // events aren't fired for single date selections.\n const value = cell ? cell.rawValue : null;\n const previewRange = this._rangeStrategy.createPreview(value, this.selected, event);\n this._previewStart = this._getCellCompareValue(previewRange.start);\n this._previewEnd = this._getCellCompareValue(previewRange.end);\n if (this.activeDrag && value) {\n const dragRange = this._rangeStrategy.createDrag?.(this.activeDrag.value, this.selected, value, event);\n if (dragRange) {\n this._previewStart = this._getCellCompareValue(dragRange.start);\n this._previewEnd = this._getCellCompareValue(dragRange.end);\n }\n }\n // Note that here we need to use `detectChanges`, rather than `markForCheck`, because\n // the way `_focusActiveCell` is set up at the moment makes it fire at the wrong time\n // when navigating one month back using the keyboard which will cause this handler\n // to throw a \"changed after checked\" error when updating the preview state.\n this._changeDetectorRef.detectChanges();\n }\n }\n /**\n * Called when the user has ended a drag. If the drag/drop was successful,\n * computes and emits the new range selection.\n */\n _dragEnded(event) {\n if (!this.activeDrag)\n return;\n if (event.value) {\n // Propagate drag effect\n const dragDropResult = this._rangeStrategy?.createDrag?.(this.activeDrag.value, this.selected, event.value, event.event);\n this.dragEnded.emit({ value: dragDropResult ?? null, event: event.event });\n }\n else {\n this.dragEnded.emit({ value: null, event: event.event });\n }\n }\n /**\n * Takes a day of the month and returns a new date in the same month and year as the currently\n * active date. The returned date will have the same day of the month as the argument date.\n */\n _getDateFromDayOfMonth(dayOfMonth) {\n return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), dayOfMonth);\n }\n /** Initializes the weekdays. */\n _initWeekdays() {\n const firstDayOfWeek = this._dateAdapter.getFirstDayOfWeek();\n const narrowWeekdays = this._dateAdapter.getDayOfWeekNames('narrow');\n const longWeekdays = this._dateAdapter.getDayOfWeekNames('long');\n // Rotate the labels for days of the week based on the configured first day of the week.\n let weekdays = longWeekdays.map((long, i) => {\n return { long, narrow: narrowWeekdays[i] };\n });\n this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));\n }\n /** Creates MatCalendarCells for the dates in this month. */\n _createWeekCells() {\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(this.activeDate);\n const dateNames = this._dateAdapter.getDateNames();\n this._weeks = [[]];\n for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {\n if (cell == DAYS_PER_WEEK) {\n this._weeks.push([]);\n cell = 0;\n }\n const date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), i + 1);\n const enabled = this._shouldEnableDate(date);\n const ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.dateA11yLabel);\n const cellClasses = this.dateClass ? this.dateClass(date, 'month') : undefined;\n this._weeks[this._weeks.length - 1].push(new MatCalendarCell(i + 1, dateNames[i], ariaLabel, enabled, cellClasses, this._getCellCompareValue(date), date));\n }\n }\n /** Date filter for the month */\n _shouldEnableDate(date) {\n return (!!date &&\n (!this.minDate || this._dateAdapter.compareDate(date, this.minDate) >= 0) &&\n (!this.maxDate || this._dateAdapter.compareDate(date, this.maxDate) <= 0) &&\n (!this.dateFilter || this.dateFilter(date)));\n }\n /**\n * Gets the date in this month that the given Date falls on.\n * Returns null if the given Date is in another month.\n */\n _getDateInCurrentMonth(date) {\n return date && this._hasSameMonthAndYear(date, this.activeDate)\n ? this._dateAdapter.getDate(date)\n : null;\n }\n /** Checks whether the 2 dates are non-null and fall within the same month of the same year. */\n _hasSameMonthAndYear(d1, d2) {\n return !!(d1 &&\n d2 &&\n this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) &&\n this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2));\n }\n /** Gets the value that will be used to one cell to another. */\n _getCellCompareValue(date) {\n if (date) {\n // We use the time since the Unix epoch to compare dates in this view, rather than the\n // cell values, because we need to support ranges that span across multiple months/years.\n const year = this._dateAdapter.getYear(date);\n const month = this._dateAdapter.getMonth(date);\n const day = this._dateAdapter.getDate(date);\n return new Date(year, month, day).getTime();\n }\n return null;\n }\n /** Determines whether the user has the RTL layout direction. */\n _isRtl() {\n return this._dir && this._dir.value === 'rtl';\n }\n /** Sets the current range based on a model value. */\n _setRanges(selectedValue) {\n if (selectedValue instanceof DateRange) {\n this._rangeStart = this._getCellCompareValue(selectedValue.start);\n this._rangeEnd = this._getCellCompareValue(selectedValue.end);\n this._isRange = true;\n }\n else {\n this._rangeStart = this._rangeEnd = this._getCellCompareValue(selectedValue);\n this._isRange = false;\n }\n this._comparisonRangeStart = this._getCellCompareValue(this.comparisonStart);\n this._comparisonRangeEnd = this._getCellCompareValue(this.comparisonEnd);\n }\n /** Gets whether a date can be selected in the month view. */\n _canSelect(date) {\n return !this.dateFilter || this.dateFilter(date);\n }\n /** Clears out preview state. */\n _clearPreview() {\n this._previewStart = this._previewEnd = null;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatMonthView, deps: [{ token: i0.ChangeDetectorRef }, { token: MAT_DATE_FORMATS, optional: true }, { token: i1.DateAdapter, optional: true }, { token: i2.Directionality, optional: true }, { token: MAT_DATE_RANGE_SELECTION_STRATEGY, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"17.0.0\", version: \"17.2.0\", type: MatMonthView, isStandalone: true, selector: \"mat-month-view\", inputs: { activeDate: \"activeDate\", selected: \"selected\", minDate: \"minDate\", maxDate: \"maxDate\", dateFilter: \"dateFilter\", dateClass: \"dateClass\", comparisonStart: \"comparisonStart\", comparisonEnd: \"comparisonEnd\", startDateAccessibleName: \"startDateAccessibleName\", endDateAccessibleName: \"endDateAccessibleName\", activeDrag: \"activeDrag\" }, outputs: { selectedChange: \"selectedChange\", _userSelection: \"_userSelection\", dragStarted: \"dragStarted\", dragEnded: \"dragEnded\", activeDateChange: \"activeDateChange\" }, viewQueries: [{ propertyName: \"_matCalendarBody\", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: [\"matMonthView\"], usesOnChanges: true, ngImport: i0, template: \"\\n\", dependencies: [{ kind: \"component\", type: MatCalendarBody, selector: \"[mat-calendar-body]\", inputs: [\"label\", \"rows\", \"todayValue\", \"startValue\", \"endValue\", \"labelMinRequiredCells\", \"numCols\", \"activeCell\", \"isRange\", \"cellAspectRatio\", \"comparisonStart\", \"comparisonEnd\", \"previewStart\", \"previewEnd\", \"startDateAccessibleName\", \"endDateAccessibleName\"], outputs: [\"selectedValueChange\", \"previewChange\", \"activeDateChange\", \"dragStarted\", \"dragEnded\"], exportAs: [\"matCalendarBody\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatMonthView, decorators: [{\n type: Component,\n args: [{ selector: 'mat-month-view', exportAs: 'matMonthView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatCalendarBody], template: \"\\n\" }]\n }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Inject,\n args: [MAT_DATE_RANGE_SELECTION_STRATEGY]\n }, {\n type: Optional\n }] }], propDecorators: { activeDate: [{\n type: Input\n }], selected: [{\n type: Input\n }], minDate: [{\n type: Input\n }], maxDate: [{\n type: Input\n }], dateFilter: [{\n type: Input\n }], dateClass: [{\n type: Input\n }], comparisonStart: [{\n type: Input\n }], comparisonEnd: [{\n type: Input\n }], startDateAccessibleName: [{\n type: Input\n }], endDateAccessibleName: [{\n type: Input\n }], activeDrag: [{\n type: Input\n }], selectedChange: [{\n type: Output\n }], _userSelection: [{\n type: Output\n }], dragStarted: [{\n type: Output\n }], dragEnded: [{\n type: Output\n }], activeDateChange: [{\n type: Output\n }], _matCalendarBody: [{\n type: ViewChild,\n args: [MatCalendarBody]\n }] } });\n\nconst yearsPerPage = 24;\nconst yearsPerRow = 4;\n/**\n * An internal component used to display a year selector in the datepicker.\n * @docs-private\n */\nclass MatMultiYearView {\n /** The date to display in this multi-year view (everything other than the year is ignored). */\n get activeDate() {\n return this._activeDate;\n }\n set activeDate(value) {\n let oldActiveDate = this._activeDate;\n const validDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value)) ||\n this._dateAdapter.today();\n this._activeDate = this._dateAdapter.clampDate(validDate, this.minDate, this.maxDate);\n if (!isSameMultiYearView(this._dateAdapter, oldActiveDate, this._activeDate, this.minDate, this.maxDate)) {\n this._init();\n }\n }\n /** The currently selected date. */\n get selected() {\n return this._selected;\n }\n set selected(value) {\n if (value instanceof DateRange) {\n this._selected = value;\n }\n else {\n this._selected = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n this._setSelectedYear(value);\n }\n /** The minimum selectable date. */\n get minDate() {\n return this._minDate;\n }\n set minDate(value) {\n this._minDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n /** The maximum selectable date. */\n get maxDate() {\n return this._maxDate;\n }\n set maxDate(value) {\n this._maxDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n constructor(_changeDetectorRef, _dateAdapter, _dir) {\n this._changeDetectorRef = _changeDetectorRef;\n this._dateAdapter = _dateAdapter;\n this._dir = _dir;\n this._rerenderSubscription = Subscription.EMPTY;\n /** Emits when a new year is selected. */\n this.selectedChange = new EventEmitter();\n /** Emits the selected year. This doesn't imply a change on the selected date */\n this.yearSelected = new EventEmitter();\n /** Emits when any date is activated. */\n this.activeDateChange = new EventEmitter();\n if (!this._dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw createMissingDateImplError('DateAdapter');\n }\n this._activeDate = this._dateAdapter.today();\n }\n ngAfterContentInit() {\n this._rerenderSubscription = this._dateAdapter.localeChanges\n .pipe(startWith(null))\n .subscribe(() => this._init());\n }\n ngOnDestroy() {\n this._rerenderSubscription.unsubscribe();\n }\n /** Initializes this multi-year view. */\n _init() {\n this._todayYear = this._dateAdapter.getYear(this._dateAdapter.today());\n // We want a range years such that we maximize the number of\n // enabled dates visible at once. This prevents issues where the minimum year\n // is the last item of a page OR the maximum year is the first item of a page.\n // The offset from the active year to the \"slot\" for the starting year is the\n // *actual* first rendered year in the multi-year view.\n const activeYear = this._dateAdapter.getYear(this._activeDate);\n const minYearOfPage = activeYear - getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);\n this._years = [];\n for (let i = 0, row = []; i < yearsPerPage; i++) {\n row.push(minYearOfPage + i);\n if (row.length == yearsPerRow) {\n this._years.push(row.map(year => this._createCellForYear(year)));\n row = [];\n }\n }\n this._changeDetectorRef.markForCheck();\n }\n /** Handles when a new year is selected. */\n _yearSelected(event) {\n const year = event.value;\n const selectedYear = this._dateAdapter.createDate(year, 0, 1);\n const selectedDate = this._getDateFromYear(year);\n this.yearSelected.emit(selectedYear);\n this.selectedChange.emit(selectedDate);\n }\n /**\n * Takes the index of a calendar body cell wrapped in an event as argument. For the date that\n * corresponds to the given cell, set `activeDate` to that date and fire `activeDateChange` with\n * that date.\n *\n * This function is used to match each component's model of the active date with the calendar\n * body cell that was focused. It updates its value of `activeDate` synchronously and updates the\n * parent's value asynchronously via the `activeDateChange` event. The child component receives an\n * updated value asynchronously via the `activeCell` Input.\n */\n _updateActiveDate(event) {\n const year = event.value;\n const oldActiveDate = this._activeDate;\n this.activeDate = this._getDateFromYear(year);\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n }\n }\n /** Handles keydown events on the calendar body when calendar is in multi-year view. */\n _handleCalendarBodyKeydown(event) {\n const oldActiveDate = this._activeDate;\n const isRtl = this._isRtl();\n switch (event.keyCode) {\n case LEFT_ARROW:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, isRtl ? 1 : -1);\n break;\n case RIGHT_ARROW:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, isRtl ? -1 : 1);\n break;\n case UP_ARROW:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, -yearsPerRow);\n break;\n case DOWN_ARROW:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, yearsPerRow);\n break;\n case HOME:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, -getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate));\n break;\n case END:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, yearsPerPage -\n getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate) -\n 1);\n break;\n case PAGE_UP:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -yearsPerPage * 10 : -yearsPerPage);\n break;\n case PAGE_DOWN:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? yearsPerPage * 10 : yearsPerPage);\n break;\n case ENTER:\n case SPACE:\n // Note that we only prevent the default action here while the selection happens in\n // `keyup` below. We can't do the selection here, because it can cause the calendar to\n // reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`\n // because it's too late (see #23305).\n this._selectionKeyPressed = true;\n break;\n default:\n // Don't prevent default or focus active cell on keys that we don't explicitly handle.\n return;\n }\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n }\n this._focusActiveCellAfterViewChecked();\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }\n /** Handles keyup events on the calendar body when calendar is in multi-year view. */\n _handleCalendarBodyKeyup(event) {\n if (event.keyCode === SPACE || event.keyCode === ENTER) {\n if (this._selectionKeyPressed) {\n this._yearSelected({ value: this._dateAdapter.getYear(this._activeDate), event });\n }\n this._selectionKeyPressed = false;\n }\n }\n _getActiveCell() {\n return getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);\n }\n /** Focuses the active cell after the microtask queue is empty. */\n _focusActiveCell() {\n this._matCalendarBody._focusActiveCell();\n }\n /** Focuses the active cell after change detection has run and the microtask queue is empty. */\n _focusActiveCellAfterViewChecked() {\n this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked();\n }\n /**\n * Takes a year and returns a new date on the same day and month as the currently active date\n * The returned date will have the same year as the argument date.\n */\n _getDateFromYear(year) {\n const activeMonth = this._dateAdapter.getMonth(this.activeDate);\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(year, activeMonth, 1));\n const normalizedDate = this._dateAdapter.createDate(year, activeMonth, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth));\n return normalizedDate;\n }\n /** Creates an MatCalendarCell for the given year. */\n _createCellForYear(year) {\n const date = this._dateAdapter.createDate(year, 0, 1);\n const yearName = this._dateAdapter.getYearName(date);\n const cellClasses = this.dateClass ? this.dateClass(date, 'multi-year') : undefined;\n return new MatCalendarCell(year, yearName, yearName, this._shouldEnableYear(year), cellClasses);\n }\n /** Whether the given year is enabled. */\n _shouldEnableYear(year) {\n // disable if the year is greater than maxDate lower than minDate\n if (year === undefined ||\n year === null ||\n (this.maxDate && year > this._dateAdapter.getYear(this.maxDate)) ||\n (this.minDate && year < this._dateAdapter.getYear(this.minDate))) {\n return false;\n }\n // enable if it reaches here and there's no filter defined\n if (!this.dateFilter) {\n return true;\n }\n const firstOfYear = this._dateAdapter.createDate(year, 0, 1);\n // If any date in the year is enabled count the year as enabled.\n for (let date = firstOfYear; this._dateAdapter.getYear(date) == year; date = this._dateAdapter.addCalendarDays(date, 1)) {\n if (this.dateFilter(date)) {\n return true;\n }\n }\n return false;\n }\n /** Determines whether the user has the RTL layout direction. */\n _isRtl() {\n return this._dir && this._dir.value === 'rtl';\n }\n /** Sets the currently-highlighted year based on a model value. */\n _setSelectedYear(value) {\n this._selectedYear = null;\n if (value instanceof DateRange) {\n const displayValue = value.start || value.end;\n if (displayValue) {\n this._selectedYear = this._dateAdapter.getYear(displayValue);\n }\n }\n else if (value) {\n this._selectedYear = this._dateAdapter.getYear(value);\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatMultiYearView, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.DateAdapter, optional: true }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatMultiYearView, isStandalone: true, selector: \"mat-multi-year-view\", inputs: { activeDate: \"activeDate\", selected: \"selected\", minDate: \"minDate\", maxDate: \"maxDate\", dateFilter: \"dateFilter\", dateClass: \"dateClass\" }, outputs: { selectedChange: \"selectedChange\", yearSelected: \"yearSelected\", activeDateChange: \"activeDateChange\" }, viewQueries: [{ propertyName: \"_matCalendarBody\", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: [\"matMultiYearView\"], ngImport: i0, template: \"\\n\", dependencies: [{ kind: \"component\", type: MatCalendarBody, selector: \"[mat-calendar-body]\", inputs: [\"label\", \"rows\", \"todayValue\", \"startValue\", \"endValue\", \"labelMinRequiredCells\", \"numCols\", \"activeCell\", \"isRange\", \"cellAspectRatio\", \"comparisonStart\", \"comparisonEnd\", \"previewStart\", \"previewEnd\", \"startDateAccessibleName\", \"endDateAccessibleName\"], outputs: [\"selectedValueChange\", \"previewChange\", \"activeDateChange\", \"dragStarted\", \"dragEnded\"], exportAs: [\"matCalendarBody\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatMultiYearView, decorators: [{\n type: Component,\n args: [{ selector: 'mat-multi-year-view', exportAs: 'matMultiYearView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatCalendarBody], template: \"\\n\" }]\n }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }], propDecorators: { activeDate: [{\n type: Input\n }], selected: [{\n type: Input\n }], minDate: [{\n type: Input\n }], maxDate: [{\n type: Input\n }], dateFilter: [{\n type: Input\n }], dateClass: [{\n type: Input\n }], selectedChange: [{\n type: Output\n }], yearSelected: [{\n type: Output\n }], activeDateChange: [{\n type: Output\n }], _matCalendarBody: [{\n type: ViewChild,\n args: [MatCalendarBody]\n }] } });\nfunction isSameMultiYearView(dateAdapter, date1, date2, minDate, maxDate) {\n const year1 = dateAdapter.getYear(date1);\n const year2 = dateAdapter.getYear(date2);\n const startingYear = getStartingYear(dateAdapter, minDate, maxDate);\n return (Math.floor((year1 - startingYear) / yearsPerPage) ===\n Math.floor((year2 - startingYear) / yearsPerPage));\n}\n/**\n * When the multi-year view is first opened, the active year will be in view.\n * So we compute how many years are between the active year and the *slot* where our\n * \"startingYear\" will render when paged into view.\n */\nfunction getActiveOffset(dateAdapter, activeDate, minDate, maxDate) {\n const activeYear = dateAdapter.getYear(activeDate);\n return euclideanModulo(activeYear - getStartingYear(dateAdapter, minDate, maxDate), yearsPerPage);\n}\n/**\n * We pick a \"starting\" year such that either the maximum year would be at the end\n * or the minimum year would be at the beginning of a page.\n */\nfunction getStartingYear(dateAdapter, minDate, maxDate) {\n let startingYear = 0;\n if (maxDate) {\n const maxYear = dateAdapter.getYear(maxDate);\n startingYear = maxYear - yearsPerPage + 1;\n }\n else if (minDate) {\n startingYear = dateAdapter.getYear(minDate);\n }\n return startingYear;\n}\n/** Gets remainder that is non-negative, even if first number is negative */\nfunction euclideanModulo(a, b) {\n return ((a % b) + b) % b;\n}\n\n/**\n * An internal component used to display a single year in the datepicker.\n * @docs-private\n */\nclass MatYearView {\n /** The date to display in this year view (everything other than the year is ignored). */\n get activeDate() {\n return this._activeDate;\n }\n set activeDate(value) {\n let oldActiveDate = this._activeDate;\n const validDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value)) ||\n this._dateAdapter.today();\n this._activeDate = this._dateAdapter.clampDate(validDate, this.minDate, this.maxDate);\n if (this._dateAdapter.getYear(oldActiveDate) !== this._dateAdapter.getYear(this._activeDate)) {\n this._init();\n }\n }\n /** The currently selected date. */\n get selected() {\n return this._selected;\n }\n set selected(value) {\n if (value instanceof DateRange) {\n this._selected = value;\n }\n else {\n this._selected = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n this._setSelectedMonth(value);\n }\n /** The minimum selectable date. */\n get minDate() {\n return this._minDate;\n }\n set minDate(value) {\n this._minDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n /** The maximum selectable date. */\n get maxDate() {\n return this._maxDate;\n }\n set maxDate(value) {\n this._maxDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n constructor(_changeDetectorRef, _dateFormats, _dateAdapter, _dir) {\n this._changeDetectorRef = _changeDetectorRef;\n this._dateFormats = _dateFormats;\n this._dateAdapter = _dateAdapter;\n this._dir = _dir;\n this._rerenderSubscription = Subscription.EMPTY;\n /** Emits when a new month is selected. */\n this.selectedChange = new EventEmitter();\n /** Emits the selected month. This doesn't imply a change on the selected date */\n this.monthSelected = new EventEmitter();\n /** Emits when any date is activated. */\n this.activeDateChange = new EventEmitter();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._dateAdapter) {\n throw createMissingDateImplError('DateAdapter');\n }\n if (!this._dateFormats) {\n throw createMissingDateImplError('MAT_DATE_FORMATS');\n }\n }\n this._activeDate = this._dateAdapter.today();\n }\n ngAfterContentInit() {\n this._rerenderSubscription = this._dateAdapter.localeChanges\n .pipe(startWith(null))\n .subscribe(() => this._init());\n }\n ngOnDestroy() {\n this._rerenderSubscription.unsubscribe();\n }\n /** Handles when a new month is selected. */\n _monthSelected(event) {\n const month = event.value;\n const selectedMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n this.monthSelected.emit(selectedMonth);\n const selectedDate = this._getDateFromMonth(month);\n this.selectedChange.emit(selectedDate);\n }\n /**\n * Takes the index of a calendar body cell wrapped in an event as argument. For the date that\n * corresponds to the given cell, set `activeDate` to that date and fire `activeDateChange` with\n * that date.\n *\n * This function is used to match each component's model of the active date with the calendar\n * body cell that was focused. It updates its value of `activeDate` synchronously and updates the\n * parent's value asynchronously via the `activeDateChange` event. The child component receives an\n * updated value asynchronously via the `activeCell` Input.\n */\n _updateActiveDate(event) {\n const month = event.value;\n const oldActiveDate = this._activeDate;\n this.activeDate = this._getDateFromMonth(month);\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n }\n }\n /** Handles keydown events on the calendar body when calendar is in year view. */\n _handleCalendarBodyKeydown(event) {\n // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent\n // disabled ones from being selected. This may not be ideal, we should look into whether\n // navigation should skip over disabled dates, and if so, how to implement that efficiently.\n const oldActiveDate = this._activeDate;\n const isRtl = this._isRtl();\n switch (event.keyCode) {\n case LEFT_ARROW:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, isRtl ? 1 : -1);\n break;\n case RIGHT_ARROW:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, isRtl ? -1 : 1);\n break;\n case UP_ARROW:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -4);\n break;\n case DOWN_ARROW:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 4);\n break;\n case HOME:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -this._dateAdapter.getMonth(this._activeDate));\n break;\n case END:\n this.activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 11 - this._dateAdapter.getMonth(this._activeDate));\n break;\n case PAGE_UP:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -10 : -1);\n break;\n case PAGE_DOWN:\n this.activeDate = this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? 10 : 1);\n break;\n case ENTER:\n case SPACE:\n // Note that we only prevent the default action here while the selection happens in\n // `keyup` below. We can't do the selection here, because it can cause the calendar to\n // reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`\n // because it's too late (see #23305).\n this._selectionKeyPressed = true;\n break;\n default:\n // Don't prevent default or focus active cell on keys that we don't explicitly handle.\n return;\n }\n if (this._dateAdapter.compareDate(oldActiveDate, this.activeDate)) {\n this.activeDateChange.emit(this.activeDate);\n this._focusActiveCellAfterViewChecked();\n }\n // Prevent unexpected default actions such as form submission.\n event.preventDefault();\n }\n /** Handles keyup events on the calendar body when calendar is in year view. */\n _handleCalendarBodyKeyup(event) {\n if (event.keyCode === SPACE || event.keyCode === ENTER) {\n if (this._selectionKeyPressed) {\n this._monthSelected({ value: this._dateAdapter.getMonth(this._activeDate), event });\n }\n this._selectionKeyPressed = false;\n }\n }\n /** Initializes this year view. */\n _init() {\n this._setSelectedMonth(this.selected);\n this._todayMonth = this._getMonthInCurrentYear(this._dateAdapter.today());\n this._yearLabel = this._dateAdapter.getYearName(this.activeDate);\n let monthNames = this._dateAdapter.getMonthNames('short');\n // First row of months only contains 5 elements so we can fit the year label on the same row.\n this._months = [\n [0, 1, 2, 3],\n [4, 5, 6, 7],\n [8, 9, 10, 11],\n ].map(row => row.map(month => this._createCellForMonth(month, monthNames[month])));\n this._changeDetectorRef.markForCheck();\n }\n /** Focuses the active cell after the microtask queue is empty. */\n _focusActiveCell() {\n this._matCalendarBody._focusActiveCell();\n }\n /** Schedules the matCalendarBody to focus the active cell after change detection has run */\n _focusActiveCellAfterViewChecked() {\n this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked();\n }\n /**\n * Gets the month in this year that the given Date falls on.\n * Returns null if the given Date is in another year.\n */\n _getMonthInCurrentYear(date) {\n return date && this._dateAdapter.getYear(date) == this._dateAdapter.getYear(this.activeDate)\n ? this._dateAdapter.getMonth(date)\n : null;\n }\n /**\n * Takes a month and returns a new date in the same day and year as the currently active date.\n * The returned date will have the same month as the argument date.\n */\n _getDateFromMonth(month) {\n const normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(normalizedDate);\n return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth));\n }\n /** Creates an MatCalendarCell for the given month. */\n _createCellForMonth(month, monthName) {\n const date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n const ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.monthYearA11yLabel);\n const cellClasses = this.dateClass ? this.dateClass(date, 'year') : undefined;\n return new MatCalendarCell(month, monthName.toLocaleUpperCase(), ariaLabel, this._shouldEnableMonth(month), cellClasses);\n }\n /** Whether the given month is enabled. */\n _shouldEnableMonth(month) {\n const activeYear = this._dateAdapter.getYear(this.activeDate);\n if (month === undefined ||\n month === null ||\n this._isYearAndMonthAfterMaxDate(activeYear, month) ||\n this._isYearAndMonthBeforeMinDate(activeYear, month)) {\n return false;\n }\n if (!this.dateFilter) {\n return true;\n }\n const firstOfMonth = this._dateAdapter.createDate(activeYear, month, 1);\n // If any date in the month is enabled count the month as enabled.\n for (let date = firstOfMonth; this._dateAdapter.getMonth(date) == month; date = this._dateAdapter.addCalendarDays(date, 1)) {\n if (this.dateFilter(date)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Tests whether the combination month/year is after this.maxDate, considering\n * just the month and year of this.maxDate\n */\n _isYearAndMonthAfterMaxDate(year, month) {\n if (this.maxDate) {\n const maxYear = this._dateAdapter.getYear(this.maxDate);\n const maxMonth = this._dateAdapter.getMonth(this.maxDate);\n return year > maxYear || (year === maxYear && month > maxMonth);\n }\n return false;\n }\n /**\n * Tests whether the combination month/year is before this.minDate, considering\n * just the month and year of this.minDate\n */\n _isYearAndMonthBeforeMinDate(year, month) {\n if (this.minDate) {\n const minYear = this._dateAdapter.getYear(this.minDate);\n const minMonth = this._dateAdapter.getMonth(this.minDate);\n return year < minYear || (year === minYear && month < minMonth);\n }\n return false;\n }\n /** Determines whether the user has the RTL layout direction. */\n _isRtl() {\n return this._dir && this._dir.value === 'rtl';\n }\n /** Sets the currently-selected month based on a model value. */\n _setSelectedMonth(value) {\n if (value instanceof DateRange) {\n this._selectedMonth =\n this._getMonthInCurrentYear(value.start) || this._getMonthInCurrentYear(value.end);\n }\n else {\n this._selectedMonth = this._getMonthInCurrentYear(value);\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatYearView, deps: [{ token: i0.ChangeDetectorRef }, { token: MAT_DATE_FORMATS, optional: true }, { token: i1.DateAdapter, optional: true }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatYearView, isStandalone: true, selector: \"mat-year-view\", inputs: { activeDate: \"activeDate\", selected: \"selected\", minDate: \"minDate\", maxDate: \"maxDate\", dateFilter: \"dateFilter\", dateClass: \"dateClass\" }, outputs: { selectedChange: \"selectedChange\", monthSelected: \"monthSelected\", activeDateChange: \"activeDateChange\" }, viewQueries: [{ propertyName: \"_matCalendarBody\", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: [\"matYearView\"], ngImport: i0, template: \"\\n\", dependencies: [{ kind: \"component\", type: MatCalendarBody, selector: \"[mat-calendar-body]\", inputs: [\"label\", \"rows\", \"todayValue\", \"startValue\", \"endValue\", \"labelMinRequiredCells\", \"numCols\", \"activeCell\", \"isRange\", \"cellAspectRatio\", \"comparisonStart\", \"comparisonEnd\", \"previewStart\", \"previewEnd\", \"startDateAccessibleName\", \"endDateAccessibleName\"], outputs: [\"selectedValueChange\", \"previewChange\", \"activeDateChange\", \"dragStarted\", \"dragEnded\"], exportAs: [\"matCalendarBody\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatYearView, decorators: [{\n type: Component,\n args: [{ selector: 'mat-year-view', exportAs: 'matYearView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatCalendarBody], template: \"\\n\" }]\n }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }], propDecorators: { activeDate: [{\n type: Input\n }], selected: [{\n type: Input\n }], minDate: [{\n type: Input\n }], maxDate: [{\n type: Input\n }], dateFilter: [{\n type: Input\n }], dateClass: [{\n type: Input\n }], selectedChange: [{\n type: Output\n }], monthSelected: [{\n type: Output\n }], activeDateChange: [{\n type: Output\n }], _matCalendarBody: [{\n type: ViewChild,\n args: [MatCalendarBody]\n }] } });\n\nlet calendarHeaderId = 1;\n/** Default header for MatCalendar */\nclass MatCalendarHeader {\n constructor(_intl, calendar, _dateAdapter, _dateFormats, changeDetectorRef) {\n this._intl = _intl;\n this.calendar = calendar;\n this._dateAdapter = _dateAdapter;\n this._dateFormats = _dateFormats;\n this._id = `mat-calendar-header-${calendarHeaderId++}`;\n this._periodButtonLabelId = `${this._id}-period-label`;\n this.calendar.stateChanges.subscribe(() => changeDetectorRef.markForCheck());\n }\n /** The display text for the current calendar view. */\n get periodButtonText() {\n if (this.calendar.currentView == 'month') {\n return this._dateAdapter\n .format(this.calendar.activeDate, this._dateFormats.display.monthYearLabel)\n .toLocaleUpperCase();\n }\n if (this.calendar.currentView == 'year') {\n return this._dateAdapter.getYearName(this.calendar.activeDate);\n }\n return this._intl.formatYearRange(...this._formatMinAndMaxYearLabels());\n }\n /** The aria description for the current calendar view. */\n get periodButtonDescription() {\n if (this.calendar.currentView == 'month') {\n return this._dateAdapter\n .format(this.calendar.activeDate, this._dateFormats.display.monthYearLabel)\n .toLocaleUpperCase();\n }\n if (this.calendar.currentView == 'year') {\n return this._dateAdapter.getYearName(this.calendar.activeDate);\n }\n // Format a label for the window of years displayed in the multi-year calendar view. Use\n // `formatYearRangeLabel` because it is TTS friendly.\n return this._intl.formatYearRangeLabel(...this._formatMinAndMaxYearLabels());\n }\n /** The `aria-label` for changing the calendar view. */\n get periodButtonLabel() {\n return this.calendar.currentView == 'month'\n ? this._intl.switchToMultiYearViewLabel\n : this._intl.switchToMonthViewLabel;\n }\n /** The label for the previous button. */\n get prevButtonLabel() {\n return {\n 'month': this._intl.prevMonthLabel,\n 'year': this._intl.prevYearLabel,\n 'multi-year': this._intl.prevMultiYearLabel,\n }[this.calendar.currentView];\n }\n /** The label for the next button. */\n get nextButtonLabel() {\n return {\n 'month': this._intl.nextMonthLabel,\n 'year': this._intl.nextYearLabel,\n 'multi-year': this._intl.nextMultiYearLabel,\n }[this.calendar.currentView];\n }\n /** Handles user clicks on the period label. */\n currentPeriodClicked() {\n this.calendar.currentView = this.calendar.currentView == 'month' ? 'multi-year' : 'month';\n }\n /** Handles user clicks on the previous button. */\n previousClicked() {\n this.calendar.activeDate =\n this.calendar.currentView == 'month'\n ? this._dateAdapter.addCalendarMonths(this.calendar.activeDate, -1)\n : this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);\n }\n /** Handles user clicks on the next button. */\n nextClicked() {\n this.calendar.activeDate =\n this.calendar.currentView == 'month'\n ? this._dateAdapter.addCalendarMonths(this.calendar.activeDate, 1)\n : this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);\n }\n /** Whether the previous period button is enabled. */\n previousEnabled() {\n if (!this.calendar.minDate) {\n return true;\n }\n return (!this.calendar.minDate || !this._isSameView(this.calendar.activeDate, this.calendar.minDate));\n }\n /** Whether the next period button is enabled. */\n nextEnabled() {\n return (!this.calendar.maxDate || !this._isSameView(this.calendar.activeDate, this.calendar.maxDate));\n }\n /** Whether the two dates represent the same view in the current view mode (month or year). */\n _isSameView(date1, date2) {\n if (this.calendar.currentView == 'month') {\n return (this._dateAdapter.getYear(date1) == this._dateAdapter.getYear(date2) &&\n this._dateAdapter.getMonth(date1) == this._dateAdapter.getMonth(date2));\n }\n if (this.calendar.currentView == 'year') {\n return this._dateAdapter.getYear(date1) == this._dateAdapter.getYear(date2);\n }\n // Otherwise we are in 'multi-year' view.\n return isSameMultiYearView(this._dateAdapter, date1, date2, this.calendar.minDate, this.calendar.maxDate);\n }\n /**\n * Format two individual labels for the minimum year and maximum year available in the multi-year\n * calendar view. Returns an array of two strings where the first string is the formatted label\n * for the minimum year, and the second string is the formatted label for the maximum year.\n */\n _formatMinAndMaxYearLabels() {\n // The offset from the active year to the \"slot\" for the starting year is the\n // *actual* first rendered year in the multi-year view, and the last year is\n // just yearsPerPage - 1 away.\n const activeYear = this._dateAdapter.getYear(this.calendar.activeDate);\n const minYearOfPage = activeYear -\n getActiveOffset(this._dateAdapter, this.calendar.activeDate, this.calendar.minDate, this.calendar.maxDate);\n const maxYearOfPage = minYearOfPage + yearsPerPage - 1;\n const minYearLabel = this._dateAdapter.getYearName(this._dateAdapter.createDate(minYearOfPage, 0, 1));\n const maxYearLabel = this._dateAdapter.getYearName(this._dateAdapter.createDate(maxYearOfPage, 0, 1));\n return [minYearLabel, maxYearLabel];\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatCalendarHeader, deps: [{ token: MatDatepickerIntl }, { token: forwardRef(() => MatCalendar) }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatCalendarHeader, isStandalone: true, selector: \"mat-calendar-header\", exportAs: [\"matCalendarHeader\"], ngImport: i0, template: \"\\n\", dependencies: [{ kind: \"component\", type: MatButton, selector: \" button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] \", exportAs: [\"matButton\"] }, { kind: \"component\", type: MatIconButton, selector: \"button[mat-icon-button]\", exportAs: [\"matButton\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatCalendarHeader, decorators: [{\n type: Component,\n args: [{ selector: 'mat-calendar-header', exportAs: 'matCalendarHeader', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatButton, MatIconButton], template: \"\\n\" }]\n }], ctorParameters: () => [{ type: MatDatepickerIntl }, { type: MatCalendar, decorators: [{\n type: Inject,\n args: [forwardRef(() => MatCalendar)]\n }] }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }, { type: i0.ChangeDetectorRef }] });\n/** A calendar that is used as part of the datepicker. */\nclass MatCalendar {\n /** A date representing the period (month or year) to start the calendar in. */\n get startAt() {\n return this._startAt;\n }\n set startAt(value) {\n this._startAt = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n /** The currently selected date. */\n get selected() {\n return this._selected;\n }\n set selected(value) {\n if (value instanceof DateRange) {\n this._selected = value;\n }\n else {\n this._selected = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n }\n /** The minimum selectable date. */\n get minDate() {\n return this._minDate;\n }\n set minDate(value) {\n this._minDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n /** The maximum selectable date. */\n get maxDate() {\n return this._maxDate;\n }\n set maxDate(value) {\n this._maxDate = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n /**\n * The current active date. This determines which time period is shown and which date is\n * highlighted when using keyboard navigation.\n */\n get activeDate() {\n return this._clampedActiveDate;\n }\n set activeDate(value) {\n this._clampedActiveDate = this._dateAdapter.clampDate(value, this.minDate, this.maxDate);\n this.stateChanges.next();\n this._changeDetectorRef.markForCheck();\n }\n /** Whether the calendar is in month view. */\n get currentView() {\n return this._currentView;\n }\n set currentView(value) {\n const viewChangedResult = this._currentView !== value ? value : null;\n this._currentView = value;\n this._moveFocusOnNextTick = true;\n this._changeDetectorRef.markForCheck();\n if (viewChangedResult) {\n this.viewChanged.emit(viewChangedResult);\n }\n }\n constructor(_intl, _dateAdapter, _dateFormats, _changeDetectorRef) {\n this._dateAdapter = _dateAdapter;\n this._dateFormats = _dateFormats;\n this._changeDetectorRef = _changeDetectorRef;\n /**\n * Used for scheduling that focus should be moved to the active cell on the next tick.\n * We need to schedule it, rather than do it immediately, because we have to wait\n * for Angular to re-evaluate the view children.\n */\n this._moveFocusOnNextTick = false;\n /** Whether the calendar should be started in month or year view. */\n this.startView = 'month';\n /** Emits when the currently selected date changes. */\n this.selectedChange = new EventEmitter();\n /**\n * Emits the year chosen in multiyear view.\n * This doesn't imply a change on the selected date.\n */\n this.yearSelected = new EventEmitter();\n /**\n * Emits the month chosen in year view.\n * This doesn't imply a change on the selected date.\n */\n this.monthSelected = new EventEmitter();\n /**\n * Emits when the current view changes.\n */\n this.viewChanged = new EventEmitter(true);\n /** Emits when any date is selected. */\n this._userSelection = new EventEmitter();\n /** Emits a new date range value when the user completes a drag drop operation. */\n this._userDragDrop = new EventEmitter();\n /** Origin of active drag, or null when dragging is not active. */\n this._activeDrag = null;\n /**\n * Emits whenever there is a state change that the header may need to respond to.\n */\n this.stateChanges = new Subject();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._dateAdapter) {\n throw createMissingDateImplError('DateAdapter');\n }\n if (!this._dateFormats) {\n throw createMissingDateImplError('MAT_DATE_FORMATS');\n }\n }\n this._intlChanges = _intl.changes.subscribe(() => {\n _changeDetectorRef.markForCheck();\n this.stateChanges.next();\n });\n }\n ngAfterContentInit() {\n this._calendarHeaderPortal = new ComponentPortal(this.headerComponent || MatCalendarHeader);\n this.activeDate = this.startAt || this._dateAdapter.today();\n // Assign to the private property since we don't want to move focus on init.\n this._currentView = this.startView;\n }\n ngAfterViewChecked() {\n if (this._moveFocusOnNextTick) {\n this._moveFocusOnNextTick = false;\n this.focusActiveCell();\n }\n }\n ngOnDestroy() {\n this._intlChanges.unsubscribe();\n this.stateChanges.complete();\n }\n ngOnChanges(changes) {\n // Ignore date changes that are at a different time on the same day. This fixes issues where\n // the calendar re-renders when there is no meaningful change to [minDate] or [maxDate]\n // (#24435).\n const minDateChange = changes['minDate'] &&\n !this._dateAdapter.sameDate(changes['minDate'].previousValue, changes['minDate'].currentValue)\n ? changes['minDate']\n : undefined;\n const maxDateChange = changes['maxDate'] &&\n !this._dateAdapter.sameDate(changes['maxDate'].previousValue, changes['maxDate'].currentValue)\n ? changes['maxDate']\n : undefined;\n const change = minDateChange || maxDateChange || changes['dateFilter'];\n if (change && !change.firstChange) {\n const view = this._getCurrentViewComponent();\n if (view) {\n // We need to `detectChanges` manually here, because the `minDate`, `maxDate` etc. are\n // passed down to the view via data bindings which won't be up-to-date when we call `_init`.\n this._changeDetectorRef.detectChanges();\n view._init();\n }\n }\n this.stateChanges.next();\n }\n /** Focuses the active date. */\n focusActiveCell() {\n this._getCurrentViewComponent()._focusActiveCell(false);\n }\n /** Updates today's date after an update of the active date */\n updateTodaysDate() {\n this._getCurrentViewComponent()._init();\n }\n /** Handles date selection in the month view. */\n _dateSelected(event) {\n const date = event.value;\n if (this.selected instanceof DateRange ||\n (date && !this._dateAdapter.sameDate(date, this.selected))) {\n this.selectedChange.emit(date);\n }\n this._userSelection.emit(event);\n }\n /** Handles year selection in the multiyear view. */\n _yearSelectedInMultiYearView(normalizedYear) {\n this.yearSelected.emit(normalizedYear);\n }\n /** Handles month selection in the year view. */\n _monthSelectedInYearView(normalizedMonth) {\n this.monthSelected.emit(normalizedMonth);\n }\n /** Handles year/month selection in the multi-year/year views. */\n _goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }\n /** Called when the user starts dragging to change a date range. */\n _dragStarted(event) {\n this._activeDrag = event;\n }\n /**\n * Called when a drag completes. It may end in cancelation or in the selection\n * of a new range.\n */\n _dragEnded(event) {\n if (!this._activeDrag)\n return;\n if (event.value) {\n this._userDragDrop.emit(event);\n }\n this._activeDrag = null;\n }\n /** Returns the component instance that corresponds to the current calendar view. */\n _getCurrentViewComponent() {\n // The return type is explicitly written as a union to ensure that the Closure compiler does\n // not optimize calls to _init(). Without the explicit return type, TypeScript narrows it to\n // only the first component type. See https://github.com/angular/components/issues/22996.\n return this.monthView || this.yearView || this.multiYearView;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatCalendar, deps: [{ token: MatDatepickerIntl }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"17.0.0\", version: \"17.2.0\", type: MatCalendar, isStandalone: true, selector: \"mat-calendar\", inputs: { headerComponent: \"headerComponent\", startAt: \"startAt\", startView: \"startView\", selected: \"selected\", minDate: \"minDate\", maxDate: \"maxDate\", dateFilter: \"dateFilter\", dateClass: \"dateClass\", comparisonStart: \"comparisonStart\", comparisonEnd: \"comparisonEnd\", startDateAccessibleName: \"startDateAccessibleName\", endDateAccessibleName: \"endDateAccessibleName\" }, outputs: { selectedChange: \"selectedChange\", yearSelected: \"yearSelected\", monthSelected: \"monthSelected\", viewChanged: \"viewChanged\", _userSelection: \"_userSelection\", _userDragDrop: \"_userDragDrop\" }, host: { classAttribute: \"mat-calendar\" }, providers: [MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER], viewQueries: [{ propertyName: \"monthView\", first: true, predicate: MatMonthView, descendants: true }, { propertyName: \"yearView\", first: true, predicate: MatYearView, descendants: true }, { propertyName: \"multiYearView\", first: true, predicate: MatMultiYearView, descendants: true }], exportAs: [\"matCalendar\"], usesOnChanges: true, ngImport: i0, template: \" \\n\\n\\n @switch (currentView) {\\n @case ('month') {\\n \\n }\\n\\n @case ('year') {\\n \\n }\\n\\n @case ('multi-year') {\\n \\n }\\n }\\n
\\n\", styles: [\".mat-calendar{display:block;font-family:var(--mat-datepicker-calendar-text-font);font-size:var(--mat-datepicker-calendar-text-size)}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:none}.mat-calendar-controls{display:flex;align-items:center;margin:5% calc(4.7142857143% - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0;margin:0 8px;font-size:var(--mat-datepicker-calendar-period-button-text-size);font-weight:var(--mat-datepicker-calendar-period-button-text-weight);--mdc-text-button-label-text-color:var(--mat-datepicker-calendar-period-button-text-color)}.mat-calendar-arrow{display:inline-block;width:10px;height:5px;margin:0 0 0 5px;vertical-align:middle;fill:var(--mat-datepicker-calendar-period-button-icon-color)}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.cdk-high-contrast-active .mat-calendar-arrow{fill:CanvasText}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-datepicker-content .mat-calendar-previous-button:not(.mat-mdc-button-disabled),.mat-datepicker-content .mat-calendar-next-button:not(.mat-mdc-button-disabled){color:var(--mat-datepicker-calendar-navigation-button-icon-color)}.mat-calendar-previous-button::after,.mat-calendar-next-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:\\\"\\\";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0;color:var(--mat-datepicker-calendar-header-text-color);font-size:var(--mat-datepicker-calendar-header-text-size);font-weight:var(--mat-datepicker-calendar-header-text-weight)}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:\\\"\\\";position:absolute;top:0;left:-8px;right:-8px;height:1px;background:var(--mat-datepicker-calendar-header-divider-color)}.mat-calendar-body-cell-content::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}.mat-calendar-body-cell:focus .mat-focus-indicator::before{content:\\\"\\\"}\"], dependencies: [{ kind: \"directive\", type: CdkPortalOutlet, selector: \"[cdkPortalOutlet]\", inputs: [\"cdkPortalOutlet\"], outputs: [\"attached\"], exportAs: [\"cdkPortalOutlet\"] }, { kind: \"directive\", type: CdkMonitorFocus, selector: \"[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]\", outputs: [\"cdkFocusChange\"], exportAs: [\"cdkMonitorFocus\"] }, { kind: \"component\", type: MatMonthView, selector: \"mat-month-view\", inputs: [\"activeDate\", \"selected\", \"minDate\", \"maxDate\", \"dateFilter\", \"dateClass\", \"comparisonStart\", \"comparisonEnd\", \"startDateAccessibleName\", \"endDateAccessibleName\", \"activeDrag\"], outputs: [\"selectedChange\", \"_userSelection\", \"dragStarted\", \"dragEnded\", \"activeDateChange\"], exportAs: [\"matMonthView\"] }, { kind: \"component\", type: MatYearView, selector: \"mat-year-view\", inputs: [\"activeDate\", \"selected\", \"minDate\", \"maxDate\", \"dateFilter\", \"dateClass\"], outputs: [\"selectedChange\", \"monthSelected\", \"activeDateChange\"], exportAs: [\"matYearView\"] }, { kind: \"component\", type: MatMultiYearView, selector: \"mat-multi-year-view\", inputs: [\"activeDate\", \"selected\", \"minDate\", \"maxDate\", \"dateFilter\", \"dateClass\"], outputs: [\"selectedChange\", \"yearSelected\", \"activeDateChange\"], exportAs: [\"matMultiYearView\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatCalendar, decorators: [{\n type: Component,\n args: [{ selector: 'mat-calendar', host: {\n 'class': 'mat-calendar',\n }, exportAs: 'matCalendar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER], standalone: true, imports: [CdkPortalOutlet, CdkMonitorFocus, MatMonthView, MatYearView, MatMultiYearView], template: \" \\n\\n\\n @switch (currentView) {\\n @case ('month') {\\n \\n }\\n\\n @case ('year') {\\n \\n }\\n\\n @case ('multi-year') {\\n \\n }\\n }\\n
\\n\", styles: [\".mat-calendar{display:block;font-family:var(--mat-datepicker-calendar-text-font);font-size:var(--mat-datepicker-calendar-text-size)}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:none}.mat-calendar-controls{display:flex;align-items:center;margin:5% calc(4.7142857143% - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0;margin:0 8px;font-size:var(--mat-datepicker-calendar-period-button-text-size);font-weight:var(--mat-datepicker-calendar-period-button-text-weight);--mdc-text-button-label-text-color:var(--mat-datepicker-calendar-period-button-text-color)}.mat-calendar-arrow{display:inline-block;width:10px;height:5px;margin:0 0 0 5px;vertical-align:middle;fill:var(--mat-datepicker-calendar-period-button-icon-color)}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.cdk-high-contrast-active .mat-calendar-arrow{fill:CanvasText}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-datepicker-content .mat-calendar-previous-button:not(.mat-mdc-button-disabled),.mat-datepicker-content .mat-calendar-next-button:not(.mat-mdc-button-disabled){color:var(--mat-datepicker-calendar-navigation-button-icon-color)}.mat-calendar-previous-button::after,.mat-calendar-next-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:\\\"\\\";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0;color:var(--mat-datepicker-calendar-header-text-color);font-size:var(--mat-datepicker-calendar-header-text-size);font-weight:var(--mat-datepicker-calendar-header-text-weight)}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:\\\"\\\";position:absolute;top:0;left:-8px;right:-8px;height:1px;background:var(--mat-datepicker-calendar-header-divider-color)}.mat-calendar-body-cell-content::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}.mat-calendar-body-cell:focus .mat-focus-indicator::before{content:\\\"\\\"}\"] }]\n }], ctorParameters: () => [{ type: MatDatepickerIntl }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }, { type: i0.ChangeDetectorRef }], propDecorators: { headerComponent: [{\n type: Input\n }], startAt: [{\n type: Input\n }], startView: [{\n type: Input\n }], selected: [{\n type: Input\n }], minDate: [{\n type: Input\n }], maxDate: [{\n type: Input\n }], dateFilter: [{\n type: Input\n }], dateClass: [{\n type: Input\n }], comparisonStart: [{\n type: Input\n }], comparisonEnd: [{\n type: Input\n }], startDateAccessibleName: [{\n type: Input\n }], endDateAccessibleName: [{\n type: Input\n }], selectedChange: [{\n type: Output\n }], yearSelected: [{\n type: Output\n }], monthSelected: [{\n type: Output\n }], viewChanged: [{\n type: Output\n }], _userSelection: [{\n type: Output\n }], _userDragDrop: [{\n type: Output\n }], monthView: [{\n type: ViewChild,\n args: [MatMonthView]\n }], yearView: [{\n type: ViewChild,\n args: [MatYearView]\n }], multiYearView: [{\n type: ViewChild,\n args: [MatMultiYearView]\n }] } });\n\n/**\n * Animations used by the Material datepicker.\n * @docs-private\n */\nconst matDatepickerAnimations = {\n /** Transforms the height of the datepicker's calendar. */\n transformPanel: trigger('transformPanel', [\n transition('void => enter-dropdown', animate('120ms cubic-bezier(0, 0, 0.2, 1)', keyframes([\n style({ opacity: 0, transform: 'scale(1, 0.8)' }),\n style({ opacity: 1, transform: 'scale(1, 1)' }),\n ]))),\n transition('void => enter-dialog', animate('150ms cubic-bezier(0, 0, 0.2, 1)', keyframes([\n style({ opacity: 0, transform: 'scale(0.7)' }),\n style({ transform: 'none', opacity: 1 }),\n ]))),\n transition('* => void', animate('100ms linear', style({ opacity: 0 }))),\n ]),\n /** Fades in the content of the calendar. */\n fadeInCalendar: trigger('fadeInCalendar', [\n state('void', style({ opacity: 0 })),\n state('enter', style({ opacity: 1 })),\n // TODO(crisbeto): this animation should be removed since it isn't quite on spec, but we\n // need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.\n transition('void => *', animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')),\n ]),\n};\n\n/** Used to generate a unique ID for each datepicker instance. */\nlet datepickerUid = 0;\n/** Injection token that determines the scroll handling while the calendar is open. */\nconst MAT_DATEPICKER_SCROLL_STRATEGY = new InjectionToken('mat-datepicker-scroll-strategy', {\n providedIn: 'root',\n factory: () => {\n const overlay = inject(Overlay);\n return () => overlay.scrollStrategies.reposition();\n },\n});\n/** @docs-private */\nfunction MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {\n return () => overlay.scrollStrategies.reposition();\n}\n/** @docs-private */\nconst MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {\n provide: MAT_DATEPICKER_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY,\n};\n/**\n * Component used as the content for the datepicker overlay. We use this instead of using\n * MatCalendar directly as the content so we can control the initial focus. This also gives us a\n * place to put additional features of the overlay that are not part of the calendar itself in the\n * future. (e.g. confirmation buttons).\n * @docs-private\n */\nclass MatDatepickerContent {\n constructor(_elementRef, _changeDetectorRef, _globalModel, _dateAdapter, _rangeSelectionStrategy, intl) {\n this._elementRef = _elementRef;\n this._changeDetectorRef = _changeDetectorRef;\n this._globalModel = _globalModel;\n this._dateAdapter = _dateAdapter;\n this._rangeSelectionStrategy = _rangeSelectionStrategy;\n this._subscriptions = new Subscription();\n /** Emits when an animation has finished. */\n this._animationDone = new Subject();\n /** Whether there is an in-progress animation. */\n this._isAnimating = false;\n /** Portal with projected action buttons. */\n this._actionsPortal = null;\n this._closeButtonText = intl.closeCalendarLabel;\n }\n ngOnInit() {\n this._animationState = this.datepicker.touchUi ? 'enter-dialog' : 'enter-dropdown';\n }\n ngAfterViewInit() {\n this._subscriptions.add(this.datepicker.stateChanges.subscribe(() => {\n this._changeDetectorRef.markForCheck();\n }));\n this._calendar.focusActiveCell();\n }\n ngOnDestroy() {\n this._subscriptions.unsubscribe();\n this._animationDone.complete();\n }\n _handleUserSelection(event) {\n const selection = this._model.selection;\n const value = event.value;\n const isRange = selection instanceof DateRange;\n // If we're selecting a range and we have a selection strategy, always pass the value through\n // there. Otherwise don't assign null values to the model, unless we're selecting a range.\n // A null value when picking a range means that the user cancelled the selection (e.g. by\n // pressing escape), whereas when selecting a single value it means that the value didn't\n // change. This isn't very intuitive, but it's here for backwards-compatibility.\n if (isRange && this._rangeSelectionStrategy) {\n const newSelection = this._rangeSelectionStrategy.selectionFinished(value, selection, event.event);\n this._model.updateSelection(newSelection, this);\n }\n else if (value &&\n (isRange || !this._dateAdapter.sameDate(value, selection))) {\n this._model.add(value);\n }\n // Delegate closing the overlay to the actions.\n if ((!this._model || this._model.isComplete()) && !this._actionsPortal) {\n this.datepicker.close();\n }\n }\n _handleUserDragDrop(event) {\n this._model.updateSelection(event.value, this);\n }\n _startExitAnimation() {\n this._animationState = 'void';\n this._changeDetectorRef.markForCheck();\n }\n _handleAnimationEvent(event) {\n this._isAnimating = event.phaseName === 'start';\n if (!this._isAnimating) {\n this._animationDone.next();\n }\n }\n _getSelected() {\n return this._model.selection;\n }\n /** Applies the current pending selection to the global model. */\n _applyPendingSelection() {\n if (this._model !== this._globalModel) {\n this._globalModel.updateSelection(this._model.selection, this);\n }\n }\n /**\n * Assigns a new portal containing the datepicker actions.\n * @param portal Portal with the actions to be assigned.\n * @param forceRerender Whether a re-render of the portal should be triggered. This isn't\n * necessary if the portal is assigned during initialization, but it may be required if it's\n * added at a later point.\n */\n _assignActions(portal, forceRerender) {\n // If we have actions, clone the model so that we have the ability to cancel the selection,\n // otherwise update the global model directly. Note that we want to assign this as soon as\n // possible, but `_actionsPortal` isn't available in the constructor so we do it in `ngOnInit`.\n this._model = portal ? this._globalModel.clone() : this._globalModel;\n this._actionsPortal = portal;\n if (forceRerender) {\n this._changeDetectorRef.detectChanges();\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerContent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: MatDateSelectionModel }, { token: i1.DateAdapter }, { token: MAT_DATE_RANGE_SELECTION_STRATEGY, optional: true }, { token: MatDatepickerIntl }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDatepickerContent, isStandalone: true, selector: \"mat-datepicker-content\", inputs: { color: \"color\" }, host: { listeners: { \"@transformPanel.start\": \"_handleAnimationEvent($event)\", \"@transformPanel.done\": \"_handleAnimationEvent($event)\" }, properties: { \"class\": \"color ? \\\"mat-\\\" + color : \\\"\\\"\", \"@transformPanel\": \"_animationState\", \"class.mat-datepicker-content-touch\": \"datepicker.touchUi\" }, classAttribute: \"mat-datepicker-content\" }, viewQueries: [{ propertyName: \"_calendar\", first: true, predicate: MatCalendar, descendants: true }], exportAs: [\"matDatepickerContent\"], ngImport: i0, template: \"\\n \\n\\n \\n\\n \\n {{ _closeButtonText }} \\n
\\n\", styles: [\".mat-datepicker-content{display:block;border-radius:4px;background-color:var(--mat-datepicker-calendar-container-background-color);color:var(--mat-datepicker-calendar-container-text-color);box-shadow:var(--mat-datepicker-calendar-container-elevation-shadow);border-radius:var(--mat-datepicker-calendar-container-shape)}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-content-container-with-custom-header .mat-calendar{height:auto}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{display:block;max-height:80vh;box-shadow:var(--mat-datepicker-calendar-container-touch-elevation-shadow);border-radius:var(--mat-datepicker-calendar-container-touch-shape);position:relative;overflow:visible}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\"], dependencies: [{ kind: \"directive\", type: CdkTrapFocus, selector: \"[cdkTrapFocus]\", inputs: [\"cdkTrapFocus\", \"cdkTrapFocusAutoCapture\"], exportAs: [\"cdkTrapFocus\"] }, { kind: \"component\", type: MatCalendar, selector: \"mat-calendar\", inputs: [\"headerComponent\", \"startAt\", \"startView\", \"selected\", \"minDate\", \"maxDate\", \"dateFilter\", \"dateClass\", \"comparisonStart\", \"comparisonEnd\", \"startDateAccessibleName\", \"endDateAccessibleName\"], outputs: [\"selectedChange\", \"yearSelected\", \"monthSelected\", \"viewChanged\", \"_userSelection\", \"_userDragDrop\"], exportAs: [\"matCalendar\"] }, { kind: \"directive\", type: CdkPortalOutlet, selector: \"[cdkPortalOutlet]\", inputs: [\"cdkPortalOutlet\"], outputs: [\"attached\"], exportAs: [\"cdkPortalOutlet\"] }, { kind: \"component\", type: MatButton, selector: \" button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] \", exportAs: [\"matButton\"] }], animations: [matDatepickerAnimations.transformPanel, matDatepickerAnimations.fadeInCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerContent, decorators: [{\n type: Component,\n args: [{ selector: 'mat-datepicker-content', host: {\n 'class': 'mat-datepicker-content',\n '[class]': 'color ? \"mat-\" + color : \"\"',\n '[@transformPanel]': '_animationState',\n '(@transformPanel.start)': '_handleAnimationEvent($event)',\n '(@transformPanel.done)': '_handleAnimationEvent($event)',\n '[class.mat-datepicker-content-touch]': 'datepicker.touchUi',\n }, animations: [matDatepickerAnimations.transformPanel, matDatepickerAnimations.fadeInCalendar], exportAs: 'matDatepickerContent', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CdkTrapFocus, MatCalendar, CdkPortalOutlet, MatButton], template: \"\\n \\n\\n \\n\\n \\n {{ _closeButtonText }} \\n
\\n\", styles: [\".mat-datepicker-content{display:block;border-radius:4px;background-color:var(--mat-datepicker-calendar-container-background-color);color:var(--mat-datepicker-calendar-container-text-color);box-shadow:var(--mat-datepicker-calendar-container-elevation-shadow);border-radius:var(--mat-datepicker-calendar-container-shape)}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-content-container-with-custom-header .mat-calendar{height:auto}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{display:block;max-height:80vh;box-shadow:var(--mat-datepicker-calendar-container-touch-elevation-shadow);border-radius:var(--mat-datepicker-calendar-container-touch-shape);position:relative;overflow:visible}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\"] }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: MatDateSelectionModel }, { type: i1.DateAdapter }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_RANGE_SELECTION_STRATEGY]\n }] }, { type: MatDatepickerIntl }], propDecorators: { _calendar: [{\n type: ViewChild,\n args: [MatCalendar]\n }], color: [{\n type: Input\n }] } });\n/** Base class for a datepicker. */\nclass MatDatepickerBase {\n /** The date to open the calendar to initially. */\n get startAt() {\n // If an explicit startAt is set we start there, otherwise we start at whatever the currently\n // selected value is.\n return this._startAt || (this.datepickerInput ? this.datepickerInput.getStartValue() : null);\n }\n set startAt(value) {\n this._startAt = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n }\n /** Color palette to use on the datepicker's calendar. */\n get color() {\n return (this._color || (this.datepickerInput ? this.datepickerInput.getThemePalette() : undefined));\n }\n set color(value) {\n this._color = value;\n }\n /** Whether the datepicker pop-up should be disabled. */\n get disabled() {\n return this._disabled === undefined && this.datepickerInput\n ? this.datepickerInput.disabled\n : !!this._disabled;\n }\n set disabled(value) {\n if (value !== this._disabled) {\n this._disabled = value;\n this.stateChanges.next(undefined);\n }\n }\n /** Classes to be passed to the date picker panel. */\n get panelClass() {\n return this._panelClass;\n }\n set panelClass(value) {\n this._panelClass = coerceStringArray(value);\n }\n /** Whether the calendar is open. */\n get opened() {\n return this._opened;\n }\n set opened(value) {\n if (value) {\n this.open();\n }\n else {\n this.close();\n }\n }\n /** The minimum selectable date. */\n _getMinDate() {\n return this.datepickerInput && this.datepickerInput.min;\n }\n /** The maximum selectable date. */\n _getMaxDate() {\n return this.datepickerInput && this.datepickerInput.max;\n }\n _getDateFilter() {\n return this.datepickerInput && this.datepickerInput.dateFilter;\n }\n constructor(_overlay, _ngZone, _viewContainerRef, scrollStrategy, _dateAdapter, _dir, _model) {\n this._overlay = _overlay;\n this._ngZone = _ngZone;\n this._viewContainerRef = _viewContainerRef;\n this._dateAdapter = _dateAdapter;\n this._dir = _dir;\n this._model = _model;\n this._inputStateChanges = Subscription.EMPTY;\n this._document = inject(DOCUMENT);\n /** The view that the calendar should start in. */\n this.startView = 'month';\n /**\n * Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather\n * than a dropdown and elements have more padding to allow for bigger touch targets.\n */\n this.touchUi = false;\n /** Preferred position of the datepicker in the X axis. */\n this.xPosition = 'start';\n /** Preferred position of the datepicker in the Y axis. */\n this.yPosition = 'below';\n /**\n * Whether to restore focus to the previously-focused element when the calendar is closed.\n * Note that automatic focus restoration is an accessibility feature and it is recommended that\n * you provide your own equivalent, if you decide to turn it off.\n */\n this.restoreFocus = true;\n /**\n * Emits selected year in multiyear view.\n * This doesn't imply a change on the selected date.\n */\n this.yearSelected = new EventEmitter();\n /**\n * Emits selected month in year view.\n * This doesn't imply a change on the selected date.\n */\n this.monthSelected = new EventEmitter();\n /**\n * Emits when the current view changes.\n */\n this.viewChanged = new EventEmitter(true);\n /** Emits when the datepicker has been opened. */\n this.openedStream = new EventEmitter();\n /** Emits when the datepicker has been closed. */\n this.closedStream = new EventEmitter();\n this._opened = false;\n /** The id for the datepicker calendar. */\n this.id = `mat-datepicker-${datepickerUid++}`;\n /** The element that was focused before the datepicker was opened. */\n this._focusedElementBeforeOpen = null;\n /** Unique class that will be added to the backdrop so that the test harnesses can look it up. */\n this._backdropHarnessClass = `${this.id}-backdrop`;\n /** Emits when the datepicker's state changes. */\n this.stateChanges = new Subject();\n if (!this._dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw createMissingDateImplError('DateAdapter');\n }\n this._scrollStrategy = scrollStrategy;\n }\n ngOnChanges(changes) {\n const positionChange = changes['xPosition'] || changes['yPosition'];\n if (positionChange && !positionChange.firstChange && this._overlayRef) {\n const positionStrategy = this._overlayRef.getConfig().positionStrategy;\n if (positionStrategy instanceof FlexibleConnectedPositionStrategy) {\n this._setConnectedPositions(positionStrategy);\n if (this.opened) {\n this._overlayRef.updatePosition();\n }\n }\n }\n this.stateChanges.next(undefined);\n }\n ngOnDestroy() {\n this._destroyOverlay();\n this.close();\n this._inputStateChanges.unsubscribe();\n this.stateChanges.complete();\n }\n /** Selects the given date */\n select(date) {\n this._model.add(date);\n }\n /** Emits the selected year in multiyear view */\n _selectYear(normalizedYear) {\n this.yearSelected.emit(normalizedYear);\n }\n /** Emits selected month in year view */\n _selectMonth(normalizedMonth) {\n this.monthSelected.emit(normalizedMonth);\n }\n /** Emits changed view */\n _viewChanged(view) {\n this.viewChanged.emit(view);\n }\n /**\n * Register an input with this datepicker.\n * @param input The datepicker input to register with this datepicker.\n * @returns Selection model that the input should hook itself up to.\n */\n registerInput(input) {\n if (this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('A MatDatepicker can only be associated with a single input.');\n }\n this._inputStateChanges.unsubscribe();\n this.datepickerInput = input;\n this._inputStateChanges = input.stateChanges.subscribe(() => this.stateChanges.next(undefined));\n return this._model;\n }\n /**\n * Registers a portal containing action buttons with the datepicker.\n * @param portal Portal to be registered.\n */\n registerActions(portal) {\n if (this._actionsPortal && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('A MatDatepicker can only be associated with a single actions row.');\n }\n this._actionsPortal = portal;\n this._componentRef?.instance._assignActions(portal, true);\n }\n /**\n * Removes a portal containing action buttons from the datepicker.\n * @param portal Portal to be removed.\n */\n removeActions(portal) {\n if (portal === this._actionsPortal) {\n this._actionsPortal = null;\n this._componentRef?.instance._assignActions(null, true);\n }\n }\n /** Open the calendar. */\n open() {\n // Skip reopening if there's an in-progress animation to avoid overlapping\n // sequences which can cause \"changed after checked\" errors. See #25837.\n if (this._opened || this.disabled || this._componentRef?.instance._isAnimating) {\n return;\n }\n if (!this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Attempted to open an MatDatepicker with no associated input.');\n }\n this._focusedElementBeforeOpen = _getFocusedElementPierceShadowDom();\n this._openOverlay();\n this._opened = true;\n this.openedStream.emit();\n }\n /** Close the calendar. */\n close() {\n // Skip reopening if there's an in-progress animation to avoid overlapping\n // sequences which can cause \"changed after checked\" errors. See #25837.\n if (!this._opened || this._componentRef?.instance._isAnimating) {\n return;\n }\n const canRestoreFocus = this.restoreFocus &&\n this._focusedElementBeforeOpen &&\n typeof this._focusedElementBeforeOpen.focus === 'function';\n const completeClose = () => {\n // The `_opened` could've been reset already if\n // we got two events in quick succession.\n if (this._opened) {\n this._opened = false;\n this.closedStream.emit();\n }\n };\n if (this._componentRef) {\n const { instance, location } = this._componentRef;\n instance._startExitAnimation();\n instance._animationDone.pipe(take(1)).subscribe(() => {\n const activeElement = this._document.activeElement;\n // Since we restore focus after the exit animation, we have to check that\n // the user didn't move focus themselves inside the `close` handler.\n if (canRestoreFocus &&\n (!activeElement ||\n activeElement === this._document.activeElement ||\n location.nativeElement.contains(activeElement))) {\n this._focusedElementBeforeOpen.focus();\n }\n this._focusedElementBeforeOpen = null;\n this._destroyOverlay();\n });\n }\n if (canRestoreFocus) {\n // Because IE moves focus asynchronously, we can't count on it being restored before we've\n // marked the datepicker as closed. If the event fires out of sequence and the element that\n // we're refocusing opens the datepicker on focus, the user could be stuck with not being\n // able to close the calendar at all. We work around it by making the logic, that marks\n // the datepicker as closed, async as well.\n setTimeout(completeClose);\n }\n else {\n completeClose();\n }\n }\n /** Applies the current pending selection on the overlay to the model. */\n _applyPendingSelection() {\n this._componentRef?.instance?._applyPendingSelection();\n }\n /** Forwards relevant values from the datepicker to the datepicker content inside the overlay. */\n _forwardContentValues(instance) {\n instance.datepicker = this;\n instance.color = this.color;\n instance._dialogLabelId = this.datepickerInput.getOverlayLabelId();\n instance._assignActions(this._actionsPortal, false);\n }\n /** Opens the overlay with the calendar. */\n _openOverlay() {\n this._destroyOverlay();\n const isDialog = this.touchUi;\n const portal = new ComponentPortal(MatDatepickerContent, this._viewContainerRef);\n const overlayRef = (this._overlayRef = this._overlay.create(new OverlayConfig({\n positionStrategy: isDialog ? this._getDialogStrategy() : this._getDropdownStrategy(),\n hasBackdrop: true,\n backdropClass: [\n isDialog ? 'cdk-overlay-dark-backdrop' : 'mat-overlay-transparent-backdrop',\n this._backdropHarnessClass,\n ],\n direction: this._dir,\n scrollStrategy: isDialog ? this._overlay.scrollStrategies.block() : this._scrollStrategy(),\n panelClass: `mat-datepicker-${isDialog ? 'dialog' : 'popup'}`,\n })));\n this._getCloseStream(overlayRef).subscribe(event => {\n if (event) {\n event.preventDefault();\n }\n this.close();\n });\n // The `preventDefault` call happens inside the calendar as well, however focus moves into\n // it inside a timeout which can give browsers a chance to fire off a keyboard event in-between\n // that can scroll the page (see #24969). Always block default actions of arrow keys for the\n // entire overlay so the page doesn't get scrolled by accident.\n overlayRef.keydownEvents().subscribe(event => {\n const keyCode = event.keyCode;\n if (keyCode === UP_ARROW ||\n keyCode === DOWN_ARROW ||\n keyCode === LEFT_ARROW ||\n keyCode === RIGHT_ARROW ||\n keyCode === PAGE_UP ||\n keyCode === PAGE_DOWN) {\n event.preventDefault();\n }\n });\n this._componentRef = overlayRef.attach(portal);\n this._forwardContentValues(this._componentRef.instance);\n // Update the position once the calendar has rendered. Only relevant in dropdown mode.\n if (!isDialog) {\n this._ngZone.onStable.pipe(take(1)).subscribe(() => overlayRef.updatePosition());\n }\n }\n /** Destroys the current overlay. */\n _destroyOverlay() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef = this._componentRef = null;\n }\n }\n /** Gets a position strategy that will open the calendar as a dropdown. */\n _getDialogStrategy() {\n return this._overlay.position().global().centerHorizontally().centerVertically();\n }\n /** Gets a position strategy that will open the calendar as a dropdown. */\n _getDropdownStrategy() {\n const strategy = this._overlay\n .position()\n .flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin())\n .withTransformOriginOn('.mat-datepicker-content')\n .withFlexibleDimensions(false)\n .withViewportMargin(8)\n .withLockedPosition();\n return this._setConnectedPositions(strategy);\n }\n /** Sets the positions of the datepicker in dropdown mode based on the current configuration. */\n _setConnectedPositions(strategy) {\n const primaryX = this.xPosition === 'end' ? 'end' : 'start';\n const secondaryX = primaryX === 'start' ? 'end' : 'start';\n const primaryY = this.yPosition === 'above' ? 'bottom' : 'top';\n const secondaryY = primaryY === 'top' ? 'bottom' : 'top';\n return strategy.withPositions([\n {\n originX: primaryX,\n originY: secondaryY,\n overlayX: primaryX,\n overlayY: primaryY,\n },\n {\n originX: primaryX,\n originY: primaryY,\n overlayX: primaryX,\n overlayY: secondaryY,\n },\n {\n originX: secondaryX,\n originY: secondaryY,\n overlayX: secondaryX,\n overlayY: primaryY,\n },\n {\n originX: secondaryX,\n originY: primaryY,\n overlayX: secondaryX,\n overlayY: secondaryY,\n },\n ]);\n }\n /** Gets an observable that will emit when the overlay is supposed to be closed. */\n _getCloseStream(overlayRef) {\n const ctrlShiftMetaModifiers = ['ctrlKey', 'shiftKey', 'metaKey'];\n return merge(overlayRef.backdropClick(), overlayRef.detachments(), overlayRef.keydownEvents().pipe(filter(event => {\n // Closing on alt + up is only valid when there's an input associated with the datepicker.\n return ((event.keyCode === ESCAPE && !hasModifierKey(event)) ||\n (this.datepickerInput &&\n hasModifierKey(event, 'altKey') &&\n event.keyCode === UP_ARROW &&\n ctrlShiftMetaModifiers.every((modifier) => !hasModifierKey(event, modifier))));\n })));\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerBase, deps: [{ token: i4.Overlay }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: MAT_DATEPICKER_SCROLL_STRATEGY }, { token: i1.DateAdapter, optional: true }, { token: i2.Directionality, optional: true }, { token: MatDateSelectionModel }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"17.2.0\", type: MatDatepickerBase, inputs: { calendarHeaderComponent: \"calendarHeaderComponent\", startAt: \"startAt\", startView: \"startView\", color: \"color\", touchUi: [\"touchUi\", \"touchUi\", booleanAttribute], disabled: [\"disabled\", \"disabled\", booleanAttribute], xPosition: \"xPosition\", yPosition: \"yPosition\", restoreFocus: [\"restoreFocus\", \"restoreFocus\", booleanAttribute], dateClass: \"dateClass\", panelClass: \"panelClass\", opened: [\"opened\", \"opened\", booleanAttribute] }, outputs: { yearSelected: \"yearSelected\", monthSelected: \"monthSelected\", viewChanged: \"viewChanged\", openedStream: \"opened\", closedStream: \"closed\" }, usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerBase, decorators: [{\n type: Directive\n }], ctorParameters: () => [{ type: i4.Overlay }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{\n type: Inject,\n args: [MAT_DATEPICKER_SCROLL_STRATEGY]\n }] }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }, { type: MatDateSelectionModel }], propDecorators: { calendarHeaderComponent: [{\n type: Input\n }], startAt: [{\n type: Input\n }], startView: [{\n type: Input\n }], color: [{\n type: Input\n }], touchUi: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], disabled: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], xPosition: [{\n type: Input\n }], yPosition: [{\n type: Input\n }], restoreFocus: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], yearSelected: [{\n type: Output\n }], monthSelected: [{\n type: Output\n }], viewChanged: [{\n type: Output\n }], dateClass: [{\n type: Input\n }], openedStream: [{\n type: Output,\n args: ['opened']\n }], closedStream: [{\n type: Output,\n args: ['closed']\n }], panelClass: [{\n type: Input\n }], opened: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }] } });\n\n// TODO(mmalerba): We use a component instead of a directive here so the user can use implicit\n// template reference variables (e.g. #d vs #d=\"matDatepicker\"). We can change this to a directive\n// if angular adds support for `exportAs: '$implicit'` on directives.\n/** Component responsible for managing the datepicker popup/dialog. */\nclass MatDatepicker extends MatDatepickerBase {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepicker, deps: null, target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDatepicker, isStandalone: true, selector: \"mat-datepicker\", providers: [\n MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER,\n { provide: MatDatepickerBase, useExisting: MatDatepicker },\n ], exportAs: [\"matDatepicker\"], usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepicker, decorators: [{\n type: Component,\n args: [{\n selector: 'mat-datepicker',\n template: '',\n exportAs: 'matDatepicker',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER,\n { provide: MatDatepickerBase, useExisting: MatDatepicker },\n ],\n standalone: true,\n }]\n }] });\n\n/**\n * An event used for datepicker input and change events. We don't always have access to a native\n * input or change event because the event may have been triggered by the user clicking on the\n * calendar popup. For consistency, we always use MatDatepickerInputEvent instead.\n */\nclass MatDatepickerInputEvent {\n constructor(\n /** Reference to the datepicker input component that emitted the event. */\n target, \n /** Reference to the native input element associated with the datepicker input. */\n targetElement) {\n this.target = target;\n this.targetElement = targetElement;\n this.value = this.target.value;\n }\n}\n/** Base class for datepicker inputs. */\nclass MatDatepickerInputBase {\n /** The value of the input. */\n get value() {\n return this._model ? this._getValueFromModel(this._model.selection) : this._pendingValue;\n }\n set value(value) {\n this._assignValueProgrammatically(value);\n }\n /** Whether the datepicker-input is disabled. */\n get disabled() {\n return !!this._disabled || this._parentDisabled();\n }\n set disabled(value) {\n const newValue = value;\n const element = this._elementRef.nativeElement;\n if (this._disabled !== newValue) {\n this._disabled = newValue;\n this.stateChanges.next(undefined);\n }\n // We need to null check the `blur` method, because it's undefined during SSR.\n // In Ivy static bindings are invoked earlier, before the element is attached to the DOM.\n // This can cause an error to be thrown in some browsers (IE/Edge) which assert that the\n // element has been inserted.\n if (newValue && this._isInitialized && element.blur) {\n // Normally, native input elements automatically blur if they turn disabled. This behavior\n // is problematic, because it would mean that it triggers another change detection cycle,\n // which then causes a changed after checked error if the input element was focused before.\n element.blur();\n }\n }\n /** Gets the base validator functions. */\n _getValidators() {\n return [this._parseValidator, this._minValidator, this._maxValidator, this._filterValidator];\n }\n /** Registers a date selection model with the input. */\n _registerModel(model) {\n this._model = model;\n this._valueChangesSubscription.unsubscribe();\n if (this._pendingValue) {\n this._assignValue(this._pendingValue);\n }\n this._valueChangesSubscription = this._model.selectionChanged.subscribe(event => {\n if (this._shouldHandleChangeEvent(event)) {\n const value = this._getValueFromModel(event.selection);\n this._lastValueValid = this._isValidValue(value);\n this._cvaOnChange(value);\n this._onTouched();\n this._formatValue(value);\n this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));\n this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));\n }\n });\n }\n constructor(_elementRef, _dateAdapter, _dateFormats) {\n this._elementRef = _elementRef;\n this._dateAdapter = _dateAdapter;\n this._dateFormats = _dateFormats;\n /** Emits when a `change` event is fired on this ` `. */\n this.dateChange = new EventEmitter();\n /** Emits when an `input` event is fired on this ` `. */\n this.dateInput = new EventEmitter();\n /** Emits when the internal state has changed */\n this.stateChanges = new Subject();\n this._onTouched = () => { };\n this._validatorOnChange = () => { };\n this._cvaOnChange = () => { };\n this._valueChangesSubscription = Subscription.EMPTY;\n this._localeSubscription = Subscription.EMPTY;\n /** The form control validator for whether the input parses. */\n this._parseValidator = () => {\n return this._lastValueValid\n ? null\n : { 'matDatepickerParse': { 'text': this._elementRef.nativeElement.value } };\n };\n /** The form control validator for the date filter. */\n this._filterValidator = (control) => {\n const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));\n return !controlValue || this._matchesFilter(controlValue)\n ? null\n : { 'matDatepickerFilter': true };\n };\n /** The form control validator for the min date. */\n this._minValidator = (control) => {\n const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));\n const min = this._getMinDate();\n return !min || !controlValue || this._dateAdapter.compareDate(min, controlValue) <= 0\n ? null\n : { 'matDatepickerMin': { 'min': min, 'actual': controlValue } };\n };\n /** The form control validator for the max date. */\n this._maxValidator = (control) => {\n const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));\n const max = this._getMaxDate();\n return !max || !controlValue || this._dateAdapter.compareDate(max, controlValue) >= 0\n ? null\n : { 'matDatepickerMax': { 'max': max, 'actual': controlValue } };\n };\n /** Whether the last value set on the input was valid. */\n this._lastValueValid = false;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._dateAdapter) {\n throw createMissingDateImplError('DateAdapter');\n }\n if (!this._dateFormats) {\n throw createMissingDateImplError('MAT_DATE_FORMATS');\n }\n }\n // Update the displayed date when the locale changes.\n this._localeSubscription = _dateAdapter.localeChanges.subscribe(() => {\n this._assignValueProgrammatically(this.value);\n });\n }\n ngAfterViewInit() {\n this._isInitialized = true;\n }\n ngOnChanges(changes) {\n if (dateInputsHaveChanged(changes, this._dateAdapter)) {\n this.stateChanges.next(undefined);\n }\n }\n ngOnDestroy() {\n this._valueChangesSubscription.unsubscribe();\n this._localeSubscription.unsubscribe();\n this.stateChanges.complete();\n }\n /** @docs-private */\n registerOnValidatorChange(fn) {\n this._validatorOnChange = fn;\n }\n /** @docs-private */\n validate(c) {\n return this._validator ? this._validator(c) : null;\n }\n // Implemented as part of ControlValueAccessor.\n writeValue(value) {\n this._assignValueProgrammatically(value);\n }\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn) {\n this._cvaOnChange = fn;\n }\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn) {\n this._onTouched = fn;\n }\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }\n _onKeydown(event) {\n const ctrlShiftMetaModifiers = ['ctrlKey', 'shiftKey', 'metaKey'];\n const isAltDownArrow = hasModifierKey(event, 'altKey') &&\n event.keyCode === DOWN_ARROW &&\n ctrlShiftMetaModifiers.every((modifier) => !hasModifierKey(event, modifier));\n if (isAltDownArrow && !this._elementRef.nativeElement.readOnly) {\n this._openPopup();\n event.preventDefault();\n }\n }\n _onInput(value) {\n const lastValueWasValid = this._lastValueValid;\n let date = this._dateAdapter.parse(value, this._dateFormats.parse.dateInput);\n this._lastValueValid = this._isValidValue(date);\n date = this._dateAdapter.getValidDateOrNull(date);\n const hasChanged = !this._dateAdapter.sameDate(date, this.value);\n // We need to fire the CVA change event for all\n // nulls, otherwise the validators won't run.\n if (!date || hasChanged) {\n this._cvaOnChange(date);\n }\n else {\n // Call the CVA change handler for invalid values\n // since this is what marks the control as dirty.\n if (value && !this.value) {\n this._cvaOnChange(date);\n }\n if (lastValueWasValid !== this._lastValueValid) {\n this._validatorOnChange();\n }\n }\n if (hasChanged) {\n this._assignValue(date);\n this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));\n }\n }\n _onChange() {\n this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));\n }\n /** Handles blur events on the input. */\n _onBlur() {\n // Reformat the input only if we have a valid value.\n if (this.value) {\n this._formatValue(this.value);\n }\n this._onTouched();\n }\n /** Formats a value and sets it on the input element. */\n _formatValue(value) {\n this._elementRef.nativeElement.value =\n value != null ? this._dateAdapter.format(value, this._dateFormats.display.dateInput) : '';\n }\n /** Assigns a value to the model. */\n _assignValue(value) {\n // We may get some incoming values before the model was\n // assigned. Save the value so that we can assign it later.\n if (this._model) {\n this._assignValueToModel(value);\n this._pendingValue = null;\n }\n else {\n this._pendingValue = value;\n }\n }\n /** Whether a value is considered valid. */\n _isValidValue(value) {\n return !value || this._dateAdapter.isValid(value);\n }\n /**\n * Checks whether a parent control is disabled. This is in place so that it can be overridden\n * by inputs extending this one which can be placed inside of a group that can be disabled.\n */\n _parentDisabled() {\n return false;\n }\n /** Programmatically assigns a value to the input. */\n _assignValueProgrammatically(value) {\n value = this._dateAdapter.deserialize(value);\n this._lastValueValid = this._isValidValue(value);\n value = this._dateAdapter.getValidDateOrNull(value);\n this._assignValue(value);\n this._formatValue(value);\n }\n /** Gets whether a value matches the current date filter. */\n _matchesFilter(value) {\n const filter = this._getDateFilter();\n return !filter || filter(value);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerInputBase, deps: [{ token: i0.ElementRef }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"17.2.0\", type: MatDatepickerInputBase, isStandalone: true, inputs: { value: \"value\", disabled: [\"disabled\", \"disabled\", booleanAttribute] }, outputs: { dateChange: \"dateChange\", dateInput: \"dateInput\" }, usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerInputBase, decorators: [{\n type: Directive,\n args: [{ standalone: true }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }], propDecorators: { value: [{\n type: Input\n }], disabled: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], dateChange: [{\n type: Output\n }], dateInput: [{\n type: Output\n }] } });\n/**\n * Checks whether the `SimpleChanges` object from an `ngOnChanges`\n * callback has any changes, accounting for date objects.\n */\nfunction dateInputsHaveChanged(changes, adapter) {\n const keys = Object.keys(changes);\n for (let key of keys) {\n const { previousValue, currentValue } = changes[key];\n if (adapter.isDateInstance(previousValue) && adapter.isDateInstance(currentValue)) {\n if (!adapter.sameDate(previousValue, currentValue)) {\n return true;\n }\n }\n else {\n return true;\n }\n }\n return false;\n}\n\n/** @docs-private */\nconst MAT_DATEPICKER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatDatepickerInput),\n multi: true,\n};\n/** @docs-private */\nconst MAT_DATEPICKER_VALIDATORS = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MatDatepickerInput),\n multi: true,\n};\n/** Directive used to connect an input to a MatDatepicker. */\nclass MatDatepickerInput extends MatDatepickerInputBase {\n /** The datepicker that this input is associated with. */\n set matDatepicker(datepicker) {\n if (datepicker) {\n this._datepicker = datepicker;\n this._closedSubscription = datepicker.closedStream.subscribe(() => this._onTouched());\n this._registerModel(datepicker.registerInput(this));\n }\n }\n /** The minimum valid date. */\n get min() {\n return this._min;\n }\n set min(value) {\n const validValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n if (!this._dateAdapter.sameDate(validValue, this._min)) {\n this._min = validValue;\n this._validatorOnChange();\n }\n }\n /** The maximum valid date. */\n get max() {\n return this._max;\n }\n set max(value) {\n const validValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n if (!this._dateAdapter.sameDate(validValue, this._max)) {\n this._max = validValue;\n this._validatorOnChange();\n }\n }\n /** Function that can be used to filter out dates within the datepicker. */\n get dateFilter() {\n return this._dateFilter;\n }\n set dateFilter(value) {\n const wasMatchingValue = this._matchesFilter(this.value);\n this._dateFilter = value;\n if (this._matchesFilter(this.value) !== wasMatchingValue) {\n this._validatorOnChange();\n }\n }\n constructor(elementRef, dateAdapter, dateFormats, _formField) {\n super(elementRef, dateAdapter, dateFormats);\n this._formField = _formField;\n this._closedSubscription = Subscription.EMPTY;\n this._validator = Validators.compose(super._getValidators());\n }\n /**\n * Gets the element that the datepicker popup should be connected to.\n * @return The element to connect the popup to.\n */\n getConnectedOverlayOrigin() {\n return this._formField ? this._formField.getConnectedOverlayOrigin() : this._elementRef;\n }\n /** Gets the ID of an element that should be used a description for the calendar overlay. */\n getOverlayLabelId() {\n if (this._formField) {\n return this._formField.getLabelId();\n }\n return this._elementRef.nativeElement.getAttribute('aria-labelledby');\n }\n /** Returns the palette used by the input's form field, if any. */\n getThemePalette() {\n return this._formField ? this._formField.color : undefined;\n }\n /** Gets the value at which the calendar should start. */\n getStartValue() {\n return this.value;\n }\n ngOnDestroy() {\n super.ngOnDestroy();\n this._closedSubscription.unsubscribe();\n }\n /** Opens the associated datepicker. */\n _openPopup() {\n if (this._datepicker) {\n this._datepicker.open();\n }\n }\n _getValueFromModel(modelValue) {\n return modelValue;\n }\n _assignValueToModel(value) {\n if (this._model) {\n this._model.updateSelection(value, this);\n }\n }\n /** Gets the input's minimum date. */\n _getMinDate() {\n return this._min;\n }\n /** Gets the input's maximum date. */\n _getMaxDate() {\n return this._max;\n }\n /** Gets the input's date filtering function. */\n _getDateFilter() {\n return this._dateFilter;\n }\n _shouldHandleChangeEvent(event) {\n return event.source !== this;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerInput, deps: [{ token: i0.ElementRef }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }, { token: MAT_FORM_FIELD, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDatepickerInput, isStandalone: true, selector: \"input[matDatepicker]\", inputs: { matDatepicker: \"matDatepicker\", min: \"min\", max: \"max\", dateFilter: [\"matDatepickerFilter\", \"dateFilter\"] }, host: { listeners: { \"input\": \"_onInput($event.target.value)\", \"change\": \"_onChange()\", \"blur\": \"_onBlur()\", \"keydown\": \"_onKeydown($event)\" }, properties: { \"attr.aria-haspopup\": \"_datepicker ? \\\"dialog\\\" : null\", \"attr.aria-owns\": \"(_datepicker?.opened && _datepicker.id) || null\", \"attr.min\": \"min ? _dateAdapter.toIso8601(min) : null\", \"attr.max\": \"max ? _dateAdapter.toIso8601(max) : null\", \"attr.data-mat-calendar\": \"_datepicker ? _datepicker.id : null\", \"disabled\": \"disabled\" }, classAttribute: \"mat-datepicker-input\" }, providers: [\n MAT_DATEPICKER_VALUE_ACCESSOR,\n MAT_DATEPICKER_VALIDATORS,\n { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: MatDatepickerInput },\n ], exportAs: [\"matDatepickerInput\"], usesInheritance: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerInput, decorators: [{\n type: Directive,\n args: [{\n selector: 'input[matDatepicker]',\n providers: [\n MAT_DATEPICKER_VALUE_ACCESSOR,\n MAT_DATEPICKER_VALIDATORS,\n { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: MatDatepickerInput },\n ],\n host: {\n 'class': 'mat-datepicker-input',\n '[attr.aria-haspopup]': '_datepicker ? \"dialog\" : null',\n '[attr.aria-owns]': '(_datepicker?.opened && _datepicker.id) || null',\n '[attr.min]': 'min ? _dateAdapter.toIso8601(min) : null',\n '[attr.max]': 'max ? _dateAdapter.toIso8601(max) : null',\n // Used by the test harness to tie this input to its calendar. We can't depend on\n // `aria-owns` for this, because it's only defined while the calendar is open.\n '[attr.data-mat-calendar]': '_datepicker ? _datepicker.id : null',\n '[disabled]': 'disabled',\n '(input)': '_onInput($event.target.value)',\n '(change)': '_onChange()',\n '(blur)': '_onBlur()',\n '(keydown)': '_onKeydown($event)',\n },\n exportAs: 'matDatepickerInput',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_FORM_FIELD]\n }] }], propDecorators: { matDatepicker: [{\n type: Input\n }], min: [{\n type: Input\n }], max: [{\n type: Input\n }], dateFilter: [{\n type: Input,\n args: ['matDatepickerFilter']\n }] } });\n\n/** Can be used to override the icon of a `matDatepickerToggle`. */\nclass MatDatepickerToggleIcon {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerToggleIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDatepickerToggleIcon, isStandalone: true, selector: \"[matDatepickerToggleIcon]\", ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerToggleIcon, decorators: [{\n type: Directive,\n args: [{\n selector: '[matDatepickerToggleIcon]',\n standalone: true,\n }]\n }] });\nclass MatDatepickerToggle {\n /** Whether the toggle button is disabled. */\n get disabled() {\n if (this._disabled === undefined && this.datepicker) {\n return this.datepicker.disabled;\n }\n return !!this._disabled;\n }\n set disabled(value) {\n this._disabled = value;\n }\n constructor(_intl, _changeDetectorRef, defaultTabIndex) {\n this._intl = _intl;\n this._changeDetectorRef = _changeDetectorRef;\n this._stateChanges = Subscription.EMPTY;\n const parsedTabIndex = Number(defaultTabIndex);\n this.tabIndex = parsedTabIndex || parsedTabIndex === 0 ? parsedTabIndex : null;\n }\n ngOnChanges(changes) {\n if (changes['datepicker']) {\n this._watchStateChanges();\n }\n }\n ngOnDestroy() {\n this._stateChanges.unsubscribe();\n }\n ngAfterContentInit() {\n this._watchStateChanges();\n }\n _open(event) {\n if (this.datepicker && !this.disabled) {\n this.datepicker.open();\n event.stopPropagation();\n }\n }\n _watchStateChanges() {\n const datepickerStateChanged = this.datepicker ? this.datepicker.stateChanges : of();\n const inputStateChanged = this.datepicker && this.datepicker.datepickerInput\n ? this.datepicker.datepickerInput.stateChanges\n : of();\n const datepickerToggled = this.datepicker\n ? merge(this.datepicker.openedStream, this.datepicker.closedStream)\n : of();\n this._stateChanges.unsubscribe();\n this._stateChanges = merge(this._intl.changes, datepickerStateChanged, inputStateChanged, datepickerToggled).subscribe(() => this._changeDetectorRef.markForCheck());\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerToggle, deps: [{ token: MatDatepickerIntl }, { token: i0.ChangeDetectorRef }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"17.0.0\", version: \"17.2.0\", type: MatDatepickerToggle, isStandalone: true, selector: \"mat-datepicker-toggle\", inputs: { datepicker: [\"for\", \"datepicker\"], tabIndex: \"tabIndex\", ariaLabel: [\"aria-label\", \"ariaLabel\"], disabled: [\"disabled\", \"disabled\", booleanAttribute], disableRipple: \"disableRipple\" }, host: { listeners: { \"click\": \"_open($event)\" }, properties: { \"attr.tabindex\": \"null\", \"class.mat-datepicker-toggle-active\": \"datepicker && datepicker.opened\", \"class.mat-accent\": \"datepicker && datepicker.color === \\\"accent\\\"\", \"class.mat-warn\": \"datepicker && datepicker.color === \\\"warn\\\"\", \"attr.data-mat-calendar\": \"datepicker ? datepicker.id : null\" }, classAttribute: \"mat-datepicker-toggle\" }, queries: [{ propertyName: \"_customIcon\", first: true, predicate: MatDatepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: \"_button\", first: true, predicate: [\"button\"], descendants: true }], exportAs: [\"matDatepickerToggle\"], usesOnChanges: true, ngImport: i0, template: \"\\n\\n @if (!_customIcon) {\\n \\n \\n \\n }\\n\\n \\n \\n\", styles: [\".mat-datepicker-toggle{pointer-events:auto;color:var(--mat-datepicker-toggle-icon-color)}.mat-datepicker-toggle-active{color:var(--mat-datepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mat-datepicker-toggle-default-icon{color:CanvasText}\"], dependencies: [{ kind: \"component\", type: MatIconButton, selector: \"button[mat-icon-button]\", exportAs: [\"matButton\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerToggle, decorators: [{\n type: Component,\n args: [{ selector: 'mat-datepicker-toggle', host: {\n 'class': 'mat-datepicker-toggle',\n '[attr.tabindex]': 'null',\n '[class.mat-datepicker-toggle-active]': 'datepicker && datepicker.opened',\n '[class.mat-accent]': 'datepicker && datepicker.color === \"accent\"',\n '[class.mat-warn]': 'datepicker && datepicker.color === \"warn\"',\n // Used by the test harness to tie this toggle to its datepicker.\n '[attr.data-mat-calendar]': 'datepicker ? datepicker.id : null',\n // Bind the `click` on the host, rather than the inner `button`, so that we can call\n // `stopPropagation` on it without affecting the user's `click` handlers. We need to stop\n // it so that the input doesn't get focused automatically by the form field (See #21836).\n '(click)': '_open($event)',\n }, exportAs: 'matDatepickerToggle', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatIconButton], template: \"\\n\\n @if (!_customIcon) {\\n \\n \\n \\n }\\n\\n \\n \\n\", styles: [\".mat-datepicker-toggle{pointer-events:auto;color:var(--mat-datepicker-toggle-icon-color)}.mat-datepicker-toggle-active{color:var(--mat-datepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mat-datepicker-toggle-default-icon{color:CanvasText}\"] }]\n }], ctorParameters: () => [{ type: MatDatepickerIntl }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{\n type: Attribute,\n args: ['tabindex']\n }] }], propDecorators: { datepicker: [{\n type: Input,\n args: ['for']\n }], tabIndex: [{\n type: Input\n }], ariaLabel: [{\n type: Input,\n args: ['aria-label']\n }], disabled: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], disableRipple: [{\n type: Input\n }], _customIcon: [{\n type: ContentChild,\n args: [MatDatepickerToggleIcon]\n }], _button: [{\n type: ViewChild,\n args: ['button']\n }] } });\n\n// This file contains the `_computeAriaAccessibleName` function, which computes what the *expected*\n// ARIA accessible name would be for a given element. Implements a subset of ARIA specification\n// [Accessible Name and Description Computation 1.2](https://www.w3.org/TR/accname-1.2/).\n//\n// Specification accname-1.2 can be summarized by returning the result of the first method\n// available.\n//\n// 1. `aria-labelledby` attribute\n// ```\n// \n// Start Date \n// \n// ```\n// 2. `aria-label` attribute (e.g. ` `)\n// 3. Label with `for`/`id`\n// ```\n// \n// Label \n// \n// ```\n// 4. `placeholder` attribute (e.g. ` `)\n// 5. `title` attribute (e.g. ` `)\n// 6. text content\n// ```\n// \n// Departure Date \n// \n// ```\n/**\n * Computes the *expected* ARIA accessible name for argument element based on [accname-1.2\n * specification](https://www.w3.org/TR/accname-1.2/). Implements a subset of accname-1.2,\n * and should only be used for the Datepicker's specific use case.\n *\n * Intended use:\n * This is not a general use implementation. Only implements the parts of accname-1.2 that are\n * required for the Datepicker's specific use case. This function is not intended for any other\n * use.\n *\n * Limitations:\n * - Only covers the needs of `matStartDate` and `matEndDate`. Does not support other use cases.\n * - See NOTES's in implementation for specific details on what parts of the accname-1.2\n * specification are not implemented.\n *\n * @param element {HTMLInputElement} native <input/> element of `matStartDate` or\n * `matEndDate` component. Corresponds to the 'Root Element' from accname-1.2\n *\n * @return expected ARIA accessible name of argument <input/>\n */\nfunction _computeAriaAccessibleName(element) {\n return _computeAriaAccessibleNameInternal(element, true);\n}\n/**\n * Determine if argument node is an Element based on `nodeType` property. This function is safe to\n * use with server-side rendering.\n */\nfunction ssrSafeIsElement(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Determine if argument node is an HTMLInputElement based on `nodeName` property. This funciton is\n * safe to use with server-side rendering.\n */\nfunction ssrSafeIsHTMLInputElement(node) {\n return node.nodeName === 'INPUT';\n}\n/**\n * Determine if argument node is an HTMLTextAreaElement based on `nodeName` property. This\n * funciton is safe to use with server-side rendering.\n */\nfunction ssrSafeIsHTMLTextAreaElement(node) {\n return node.nodeName === 'TEXTAREA';\n}\n/**\n * Calculate the expected ARIA accessible name for given DOM Node. Given DOM Node may be either the\n * \"Root node\" passed to `_computeAriaAccessibleName` or \"Current node\" as result of recursion.\n *\n * @return the accessible name of argument DOM Node\n *\n * @param currentNode node to determine accessible name of\n * @param isDirectlyReferenced true if `currentNode` is the root node to calculate ARIA accessible\n * name of. False if it is a result of recursion.\n */\nfunction _computeAriaAccessibleNameInternal(currentNode, isDirectlyReferenced) {\n // NOTE: this differs from accname-1.2 specification.\n // - Does not implement Step 1. of accname-1.2: '''If `currentNode`'s role prohibits naming,\n // return the empty string (\"\")'''.\n // - Does not implement Step 2.A. of accname-1.2: '''if current node is hidden and not directly\n // referenced by aria-labelledby... return the empty string.'''\n // acc-name-1.2 Step 2.B.: aria-labelledby\n if (ssrSafeIsElement(currentNode) && isDirectlyReferenced) {\n const labelledbyIds = currentNode.getAttribute?.('aria-labelledby')?.split(/\\s+/g) || [];\n const validIdRefs = labelledbyIds.reduce((validIds, id) => {\n const elem = document.getElementById(id);\n if (elem) {\n validIds.push(elem);\n }\n return validIds;\n }, []);\n if (validIdRefs.length) {\n return validIdRefs\n .map(idRef => {\n return _computeAriaAccessibleNameInternal(idRef, false);\n })\n .join(' ');\n }\n }\n // acc-name-1.2 Step 2.C.: aria-label\n if (ssrSafeIsElement(currentNode)) {\n const ariaLabel = currentNode.getAttribute('aria-label')?.trim();\n if (ariaLabel) {\n return ariaLabel;\n }\n }\n // acc-name-1.2 Step 2.D. attribute or element that defines a text alternative\n //\n // NOTE: this differs from accname-1.2 specification.\n // Only implements Step 2.D. for ``,` `, and `` element. Does not\n // implement other elements that have an attribute or element that defines a text alternative.\n if (ssrSafeIsHTMLInputElement(currentNode) || ssrSafeIsHTMLTextAreaElement(currentNode)) {\n // use label with a `for` attribute referencing the current node\n if (currentNode.labels?.length) {\n return Array.from(currentNode.labels)\n .map(x => _computeAriaAccessibleNameInternal(x, false))\n .join(' ');\n }\n // use placeholder if available\n const placeholder = currentNode.getAttribute('placeholder')?.trim();\n if (placeholder) {\n return placeholder;\n }\n // use title if available\n const title = currentNode.getAttribute('title')?.trim();\n if (title) {\n return title;\n }\n }\n // NOTE: this differs from accname-1.2 specification.\n // - does not implement acc-name-1.2 Step 2.E.: '''if the current node is a control embedded\n // within the label... then include the embedded control as part of the text alternative in\n // the following manner...'''. Step 2E applies to embedded controls such as textbox, listbox,\n // range, etc.\n // - does not implement acc-name-1.2 step 2.F.: check that '''role allows name from content''',\n // which applies to `currentNode` and its children.\n // - does not implement acc-name-1.2 Step 2.F.ii.: '''Check for CSS generated textual content'''\n // (e.g. :before and :after).\n // - does not implement acc-name-1.2 Step 2.I.: '''if the current node has a Tooltip attribute,\n // return its value'''\n // Return text content with whitespace collapsed into a single space character. Accomplish\n // acc-name-1.2 steps 2F, 2G, and 2H.\n return (currentNode.textContent || '').replace(/\\s+/g, ' ').trim();\n}\n\n/**\n * Used to provide the date range input wrapper component\n * to the parts without circular dependencies.\n */\nconst MAT_DATE_RANGE_INPUT_PARENT = new InjectionToken('MAT_DATE_RANGE_INPUT_PARENT');\n/**\n * Base class for the individual inputs that can be projected inside a `mat-date-range-input`.\n */\nclass MatDateRangeInputPartBase extends MatDatepickerInputBase {\n /** Object used to control when error messages are shown. */\n get errorStateMatcher() {\n return this._errorStateTracker.matcher;\n }\n set errorStateMatcher(value) {\n this._errorStateTracker.matcher = value;\n }\n /** Whether the input is in an error state. */\n get errorState() {\n return this._errorStateTracker.errorState;\n }\n set errorState(value) {\n this._errorStateTracker.errorState = value;\n }\n constructor(_rangeInput, _elementRef, _defaultErrorStateMatcher, _injector, _parentForm, _parentFormGroup, dateAdapter, dateFormats) {\n super(_elementRef, dateAdapter, dateFormats);\n this._rangeInput = _rangeInput;\n this._elementRef = _elementRef;\n this._defaultErrorStateMatcher = _defaultErrorStateMatcher;\n this._injector = _injector;\n this._parentForm = _parentForm;\n this._parentFormGroup = _parentFormGroup;\n this._dir = inject(Directionality, { optional: true });\n this._errorStateTracker = new _ErrorStateTracker(this._defaultErrorStateMatcher, null, this._parentFormGroup, this._parentForm, this.stateChanges);\n }\n ngOnInit() {\n // We need the date input to provide itself as a `ControlValueAccessor` and a `Validator`, while\n // injecting its `NgControl` so that the error state is handled correctly. This introduces a\n // circular dependency, because both `ControlValueAccessor` and `Validator` depend on the input\n // itself. Usually we can work around it for the CVA, but there's no API to do it for the\n // validator. We work around it here by injecting the `NgControl` in `ngOnInit`, after\n // everything has been resolved.\n const ngControl = this._injector.get(NgControl, null, { optional: true, self: true });\n if (ngControl) {\n this.ngControl = ngControl;\n this._errorStateTracker.ngControl = ngControl;\n }\n }\n ngDoCheck() {\n if (this.ngControl) {\n // We need to re-evaluate this on every change detection cycle, because there are some\n // error triggers that we can't subscribe to (e.g. parent form submissions). This means\n // that whatever logic is in here has to be super lean or we risk destroying the performance.\n this.updateErrorState();\n }\n }\n /** Gets whether the input is empty. */\n isEmpty() {\n return this._elementRef.nativeElement.value.length === 0;\n }\n /** Gets the placeholder of the input. */\n _getPlaceholder() {\n return this._elementRef.nativeElement.placeholder;\n }\n /** Focuses the input. */\n focus() {\n this._elementRef.nativeElement.focus();\n }\n /** Gets the value that should be used when mirroring the input's size. */\n getMirrorValue() {\n const element = this._elementRef.nativeElement;\n const value = element.value;\n return value.length > 0 ? value : element.placeholder;\n }\n /** Refreshes the error state of the input. */\n updateErrorState() {\n this._errorStateTracker.updateErrorState();\n }\n /** Handles `input` events on the input element. */\n _onInput(value) {\n super._onInput(value);\n this._rangeInput._handleChildValueChange();\n }\n /** Opens the datepicker associated with the input. */\n _openPopup() {\n this._rangeInput._openDatepicker();\n }\n /** Gets the minimum date from the range input. */\n _getMinDate() {\n return this._rangeInput.min;\n }\n /** Gets the maximum date from the range input. */\n _getMaxDate() {\n return this._rangeInput.max;\n }\n /** Gets the date filter function from the range input. */\n _getDateFilter() {\n return this._rangeInput.dateFilter;\n }\n _parentDisabled() {\n return this._rangeInput._groupDisabled;\n }\n _shouldHandleChangeEvent({ source }) {\n return source !== this._rangeInput._startInput && source !== this._rangeInput._endInput;\n }\n _assignValueProgrammatically(value) {\n super._assignValueProgrammatically(value);\n const opposite = (this === this._rangeInput._startInput\n ? this._rangeInput._endInput\n : this._rangeInput._startInput);\n opposite?._validatorOnChange();\n }\n /** return the ARIA accessible name of the input element */\n _getAccessibleName() {\n return _computeAriaAccessibleName(this._elementRef.nativeElement);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateRangeInputPartBase, deps: [{ token: MAT_DATE_RANGE_INPUT_PARENT }, { token: i0.ElementRef }, { token: i1.ErrorStateMatcher }, { token: i0.Injector }, { token: i2$1.NgForm, optional: true }, { token: i2$1.FormGroupDirective, optional: true }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDateRangeInputPartBase, isStandalone: true, inputs: { errorStateMatcher: \"errorStateMatcher\" }, usesInheritance: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateRangeInputPartBase, decorators: [{\n type: Directive,\n args: [{ standalone: true }]\n }], ctorParameters: () => [{ type: undefined, decorators: [{\n type: Inject,\n args: [MAT_DATE_RANGE_INPUT_PARENT]\n }] }, { type: i0.ElementRef }, { type: i1.ErrorStateMatcher }, { type: i0.Injector }, { type: i2$1.NgForm, decorators: [{\n type: Optional\n }] }, { type: i2$1.FormGroupDirective, decorators: [{\n type: Optional\n }] }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }], propDecorators: { errorStateMatcher: [{\n type: Input\n }] } });\n/** Input for entering the start date in a `mat-date-range-input`. */\nclass MatStartDate extends MatDateRangeInputPartBase {\n constructor(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats) {\n super(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats);\n /** Validator that checks that the start date isn't after the end date. */\n this._startValidator = (control) => {\n const start = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));\n const end = this._model ? this._model.selection.end : null;\n return !start || !end || this._dateAdapter.compareDate(start, end) <= 0\n ? null\n : { 'matStartDateInvalid': { 'end': end, 'actual': start } };\n };\n this._validator = Validators.compose([...super._getValidators(), this._startValidator]);\n }\n _getValueFromModel(modelValue) {\n return modelValue.start;\n }\n _shouldHandleChangeEvent(change) {\n if (!super._shouldHandleChangeEvent(change)) {\n return false;\n }\n else {\n return !change.oldValue?.start\n ? !!change.selection.start\n : !change.selection.start ||\n !!this._dateAdapter.compareDate(change.oldValue.start, change.selection.start);\n }\n }\n _assignValueToModel(value) {\n if (this._model) {\n const range = new DateRange(value, this._model.selection.end);\n this._model.updateSelection(range, this);\n }\n }\n _formatValue(value) {\n super._formatValue(value);\n // Any time the input value is reformatted we need to tell the parent.\n this._rangeInput._handleChildValueChange();\n }\n _onKeydown(event) {\n const endInput = this._rangeInput._endInput;\n const element = this._elementRef.nativeElement;\n const isLtr = this._dir?.value !== 'rtl';\n // If the user hits RIGHT (LTR) when at the end of the input (and no\n // selection), move the cursor to the start of the end input.\n if (((event.keyCode === RIGHT_ARROW && isLtr) || (event.keyCode === LEFT_ARROW && !isLtr)) &&\n element.selectionStart === element.value.length &&\n element.selectionEnd === element.value.length) {\n event.preventDefault();\n endInput._elementRef.nativeElement.setSelectionRange(0, 0);\n endInput.focus();\n }\n else {\n super._onKeydown(event);\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatStartDate, deps: [{ token: MAT_DATE_RANGE_INPUT_PARENT }, { token: i0.ElementRef }, { token: i1.ErrorStateMatcher }, { token: i0.Injector }, { token: i2$1.NgForm, optional: true }, { token: i2$1.FormGroupDirective, optional: true }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatStartDate, isStandalone: true, selector: \"input[matStartDate]\", outputs: { dateChange: \"dateChange\", dateInput: \"dateInput\" }, host: { attributes: { \"type\": \"text\" }, listeners: { \"input\": \"_onInput($event.target.value)\", \"change\": \"_onChange()\", \"keydown\": \"_onKeydown($event)\", \"blur\": \"_onBlur()\" }, properties: { \"disabled\": \"disabled\", \"attr.aria-haspopup\": \"_rangeInput.rangePicker ? \\\"dialog\\\" : null\", \"attr.aria-owns\": \"(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null\", \"attr.min\": \"_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null\", \"attr.max\": \"_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null\" }, classAttribute: \"mat-start-date mat-date-range-input-inner\" }, providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: MatStartDate, multi: true },\n { provide: NG_VALIDATORS, useExisting: MatStartDate, multi: true },\n ], usesInheritance: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatStartDate, decorators: [{\n type: Directive,\n args: [{\n selector: 'input[matStartDate]',\n host: {\n 'class': 'mat-start-date mat-date-range-input-inner',\n '[disabled]': 'disabled',\n '(input)': '_onInput($event.target.value)',\n '(change)': '_onChange()',\n '(keydown)': '_onKeydown($event)',\n '[attr.aria-haspopup]': '_rangeInput.rangePicker ? \"dialog\" : null',\n '[attr.aria-owns]': '(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null',\n '[attr.min]': '_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null',\n '[attr.max]': '_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null',\n '(blur)': '_onBlur()',\n 'type': 'text',\n },\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: MatStartDate, multi: true },\n { provide: NG_VALIDATORS, useExisting: MatStartDate, multi: true },\n ],\n // These need to be specified explicitly, because some tooling doesn't\n // seem to pick them up from the base class. See #20932.\n outputs: ['dateChange', 'dateInput'],\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: undefined, decorators: [{\n type: Inject,\n args: [MAT_DATE_RANGE_INPUT_PARENT]\n }] }, { type: i0.ElementRef }, { type: i1.ErrorStateMatcher }, { type: i0.Injector }, { type: i2$1.NgForm, decorators: [{\n type: Optional\n }] }, { type: i2$1.FormGroupDirective, decorators: [{\n type: Optional\n }] }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }] });\n/** Input for entering the end date in a `mat-date-range-input`. */\nclass MatEndDate extends MatDateRangeInputPartBase {\n constructor(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats) {\n super(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats);\n /** Validator that checks that the end date isn't before the start date. */\n this._endValidator = (control) => {\n const end = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));\n const start = this._model ? this._model.selection.start : null;\n return !end || !start || this._dateAdapter.compareDate(end, start) >= 0\n ? null\n : { 'matEndDateInvalid': { 'start': start, 'actual': end } };\n };\n this._validator = Validators.compose([...super._getValidators(), this._endValidator]);\n }\n _getValueFromModel(modelValue) {\n return modelValue.end;\n }\n _shouldHandleChangeEvent(change) {\n if (!super._shouldHandleChangeEvent(change)) {\n return false;\n }\n else {\n return !change.oldValue?.end\n ? !!change.selection.end\n : !change.selection.end ||\n !!this._dateAdapter.compareDate(change.oldValue.end, change.selection.end);\n }\n }\n _assignValueToModel(value) {\n if (this._model) {\n const range = new DateRange(this._model.selection.start, value);\n this._model.updateSelection(range, this);\n }\n }\n _moveCaretToEndOfStartInput() {\n const startInput = this._rangeInput._startInput._elementRef.nativeElement;\n const value = startInput.value;\n if (value.length > 0) {\n startInput.setSelectionRange(value.length, value.length);\n }\n startInput.focus();\n }\n _onKeydown(event) {\n const element = this._elementRef.nativeElement;\n const isLtr = this._dir?.value !== 'rtl';\n // If the user is pressing backspace on an empty end input, move focus back to the start.\n if (event.keyCode === BACKSPACE && !element.value) {\n this._moveCaretToEndOfStartInput();\n }\n // If the user hits LEFT (LTR) when at the start of the input (and no\n // selection), move the cursor to the end of the start input.\n else if (((event.keyCode === LEFT_ARROW && isLtr) || (event.keyCode === RIGHT_ARROW && !isLtr)) &&\n element.selectionStart === 0 &&\n element.selectionEnd === 0) {\n event.preventDefault();\n this._moveCaretToEndOfStartInput();\n }\n else {\n super._onKeydown(event);\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatEndDate, deps: [{ token: MAT_DATE_RANGE_INPUT_PARENT }, { token: i0.ElementRef }, { token: i1.ErrorStateMatcher }, { token: i0.Injector }, { token: i2$1.NgForm, optional: true }, { token: i2$1.FormGroupDirective, optional: true }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatEndDate, isStandalone: true, selector: \"input[matEndDate]\", outputs: { dateChange: \"dateChange\", dateInput: \"dateInput\" }, host: { attributes: { \"type\": \"text\" }, listeners: { \"input\": \"_onInput($event.target.value)\", \"change\": \"_onChange()\", \"keydown\": \"_onKeydown($event)\", \"blur\": \"_onBlur()\" }, properties: { \"disabled\": \"disabled\", \"attr.aria-haspopup\": \"_rangeInput.rangePicker ? \\\"dialog\\\" : null\", \"attr.aria-owns\": \"(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null\", \"attr.min\": \"_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null\", \"attr.max\": \"_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null\" }, classAttribute: \"mat-end-date mat-date-range-input-inner\" }, providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: MatEndDate, multi: true },\n { provide: NG_VALIDATORS, useExisting: MatEndDate, multi: true },\n ], usesInheritance: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatEndDate, decorators: [{\n type: Directive,\n args: [{\n selector: 'input[matEndDate]',\n host: {\n 'class': 'mat-end-date mat-date-range-input-inner',\n '[disabled]': 'disabled',\n '(input)': '_onInput($event.target.value)',\n '(change)': '_onChange()',\n '(keydown)': '_onKeydown($event)',\n '[attr.aria-haspopup]': '_rangeInput.rangePicker ? \"dialog\" : null',\n '[attr.aria-owns]': '(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null',\n '[attr.min]': '_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null',\n '[attr.max]': '_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null',\n '(blur)': '_onBlur()',\n 'type': 'text',\n },\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: MatEndDate, multi: true },\n { provide: NG_VALIDATORS, useExisting: MatEndDate, multi: true },\n ],\n // These need to be specified explicitly, because some tooling doesn't\n // seem to pick them up from the base class. See #20932.\n outputs: ['dateChange', 'dateInput'],\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: undefined, decorators: [{\n type: Inject,\n args: [MAT_DATE_RANGE_INPUT_PARENT]\n }] }, { type: i0.ElementRef }, { type: i1.ErrorStateMatcher }, { type: i0.Injector }, { type: i2$1.NgForm, decorators: [{\n type: Optional\n }] }, { type: i2$1.FormGroupDirective, decorators: [{\n type: Optional\n }] }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_FORMATS]\n }] }] });\n\nlet nextUniqueId = 0;\nclass MatDateRangeInput {\n /** Current value of the range input. */\n get value() {\n return this._model ? this._model.selection : null;\n }\n /** Whether the control's label should float. */\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n /**\n * Implemented as a part of `MatFormFieldControl`.\n * Set the placeholder attribute on `matStartDate` and `matEndDate`.\n * @docs-private\n */\n get placeholder() {\n const start = this._startInput?._getPlaceholder() || '';\n const end = this._endInput?._getPlaceholder() || '';\n return start || end ? `${start} ${this.separator} ${end}` : '';\n }\n /** The range picker that this input is associated with. */\n get rangePicker() {\n return this._rangePicker;\n }\n set rangePicker(rangePicker) {\n if (rangePicker) {\n this._model = rangePicker.registerInput(this);\n this._rangePicker = rangePicker;\n this._closedSubscription.unsubscribe();\n this._closedSubscription = rangePicker.closedStream.subscribe(() => {\n this._startInput?._onTouched();\n this._endInput?._onTouched();\n });\n this._registerModel(this._model);\n }\n }\n /** Whether the input is required. */\n get required() {\n return (this._required ??\n (this._isTargetRequired(this) ||\n this._isTargetRequired(this._startInput) ||\n this._isTargetRequired(this._endInput)) ??\n false);\n }\n set required(value) {\n this._required = value;\n }\n /** Function that can be used to filter out dates within the date range picker. */\n get dateFilter() {\n return this._dateFilter;\n }\n set dateFilter(value) {\n const start = this._startInput;\n const end = this._endInput;\n const wasMatchingStart = start && start._matchesFilter(start.value);\n const wasMatchingEnd = end && end._matchesFilter(start.value);\n this._dateFilter = value;\n if (start && start._matchesFilter(start.value) !== wasMatchingStart) {\n start._validatorOnChange();\n }\n if (end && end._matchesFilter(end.value) !== wasMatchingEnd) {\n end._validatorOnChange();\n }\n }\n /** The minimum valid date. */\n get min() {\n return this._min;\n }\n set min(value) {\n const validValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n if (!this._dateAdapter.sameDate(validValue, this._min)) {\n this._min = validValue;\n this._revalidate();\n }\n }\n /** The maximum valid date. */\n get max() {\n return this._max;\n }\n set max(value) {\n const validValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));\n if (!this._dateAdapter.sameDate(validValue, this._max)) {\n this._max = validValue;\n this._revalidate();\n }\n }\n /** Whether the input is disabled. */\n get disabled() {\n return this._startInput && this._endInput\n ? this._startInput.disabled && this._endInput.disabled\n : this._groupDisabled;\n }\n set disabled(value) {\n if (value !== this._groupDisabled) {\n this._groupDisabled = value;\n this.stateChanges.next(undefined);\n }\n }\n /** Whether the input is in an error state. */\n get errorState() {\n if (this._startInput && this._endInput) {\n return this._startInput.errorState || this._endInput.errorState;\n }\n return false;\n }\n /** Whether the datepicker input is empty. */\n get empty() {\n const startEmpty = this._startInput ? this._startInput.isEmpty() : false;\n const endEmpty = this._endInput ? this._endInput.isEmpty() : false;\n return startEmpty && endEmpty;\n }\n constructor(_changeDetectorRef, _elementRef, control, _dateAdapter, _formField) {\n this._changeDetectorRef = _changeDetectorRef;\n this._elementRef = _elementRef;\n this._dateAdapter = _dateAdapter;\n this._formField = _formField;\n this._closedSubscription = Subscription.EMPTY;\n /** Unique ID for the group. */\n this.id = `mat-date-range-input-${nextUniqueId++}`;\n /** Whether the control is focused. */\n this.focused = false;\n /** Name of the form control. */\n this.controlType = 'mat-date-range-input';\n this._groupDisabled = false;\n /** Value for the `aria-describedby` attribute of the inputs. */\n this._ariaDescribedBy = null;\n /** Separator text to be shown between the inputs. */\n this.separator = '–';\n /** Start of the comparison range that should be shown in the calendar. */\n this.comparisonStart = null;\n /** End of the comparison range that should be shown in the calendar. */\n this.comparisonEnd = null;\n /** Emits when the input's state has changed. */\n this.stateChanges = new Subject();\n /**\n * Disable the automatic labeling to avoid issues like #27241.\n * @docs-private\n */\n this.disableAutomaticLabeling = true;\n if (!_dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw createMissingDateImplError('DateAdapter');\n }\n // The datepicker module can be used both with MDC and non-MDC form fields. We have\n // to conditionally add the MDC input class so that the range picker looks correctly.\n if (_formField?._elementRef.nativeElement.classList.contains('mat-mdc-form-field')) {\n _elementRef.nativeElement.classList.add('mat-mdc-input-element', 'mat-mdc-form-field-input-control', 'mdc-text-field__input');\n }\n // TODO(crisbeto): remove `as any` after #18206 lands.\n this.ngControl = control;\n }\n /**\n * Implemented as a part of `MatFormFieldControl`.\n * @docs-private\n */\n setDescribedByIds(ids) {\n this._ariaDescribedBy = ids.length ? ids.join(' ') : null;\n }\n /**\n * Implemented as a part of `MatFormFieldControl`.\n * @docs-private\n */\n onContainerClick() {\n if (!this.focused && !this.disabled) {\n if (!this._model || !this._model.selection.start) {\n this._startInput.focus();\n }\n else {\n this._endInput.focus();\n }\n }\n }\n ngAfterContentInit() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._startInput) {\n throw Error('mat-date-range-input must contain a matStartDate input');\n }\n if (!this._endInput) {\n throw Error('mat-date-range-input must contain a matEndDate input');\n }\n }\n if (this._model) {\n this._registerModel(this._model);\n }\n // We don't need to unsubscribe from this, because we\n // know that the input streams will be completed on destroy.\n merge(this._startInput.stateChanges, this._endInput.stateChanges).subscribe(() => {\n this.stateChanges.next(undefined);\n });\n }\n ngOnChanges(changes) {\n if (dateInputsHaveChanged(changes, this._dateAdapter)) {\n this.stateChanges.next(undefined);\n }\n }\n ngOnDestroy() {\n this._closedSubscription.unsubscribe();\n this.stateChanges.complete();\n }\n /** Gets the date at which the calendar should start. */\n getStartValue() {\n return this.value ? this.value.start : null;\n }\n /** Gets the input's theme palette. */\n getThemePalette() {\n return this._formField ? this._formField.color : undefined;\n }\n /** Gets the element to which the calendar overlay should be attached. */\n getConnectedOverlayOrigin() {\n return this._formField ? this._formField.getConnectedOverlayOrigin() : this._elementRef;\n }\n /** Gets the ID of an element that should be used a description for the calendar overlay. */\n getOverlayLabelId() {\n return this._formField ? this._formField.getLabelId() : null;\n }\n /** Gets the value that is used to mirror the state input. */\n _getInputMirrorValue(part) {\n const input = part === 'start' ? this._startInput : this._endInput;\n return input ? input.getMirrorValue() : '';\n }\n /** Whether the input placeholders should be hidden. */\n _shouldHidePlaceholders() {\n return this._startInput ? !this._startInput.isEmpty() : false;\n }\n /** Handles the value in one of the child inputs changing. */\n _handleChildValueChange() {\n this.stateChanges.next(undefined);\n this._changeDetectorRef.markForCheck();\n }\n /** Opens the date range picker associated with the input. */\n _openDatepicker() {\n if (this._rangePicker) {\n this._rangePicker.open();\n }\n }\n /** Whether the separate text should be hidden. */\n _shouldHideSeparator() {\n return ((!this._formField ||\n (this._formField.getLabelId() && !this._formField._shouldLabelFloat())) &&\n this.empty);\n }\n /** Gets the value for the `aria-labelledby` attribute of the inputs. */\n _getAriaLabelledby() {\n const formField = this._formField;\n return formField && formField._hasFloatingLabel() ? formField._labelId : null;\n }\n _getStartDateAccessibleName() {\n return this._startInput._getAccessibleName();\n }\n _getEndDateAccessibleName() {\n return this._endInput._getAccessibleName();\n }\n /** Updates the focused state of the range input. */\n _updateFocus(origin) {\n this.focused = origin !== null;\n this.stateChanges.next();\n }\n /** Re-runs the validators on the start/end inputs. */\n _revalidate() {\n if (this._startInput) {\n this._startInput._validatorOnChange();\n }\n if (this._endInput) {\n this._endInput._validatorOnChange();\n }\n }\n /** Registers the current date selection model with the start/end inputs. */\n _registerModel(model) {\n if (this._startInput) {\n this._startInput._registerModel(model);\n }\n if (this._endInput) {\n this._endInput._registerModel(model);\n }\n }\n /** Checks whether a specific range input directive is required. */\n _isTargetRequired(target) {\n return target?.ngControl?.control?.hasValidator(Validators.required);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateRangeInput, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i2$1.ControlContainer, optional: true, self: true }, { token: i1.DateAdapter, optional: true }, { token: MAT_FORM_FIELD, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"16.1.0\", version: \"17.2.0\", type: MatDateRangeInput, isStandalone: true, selector: \"mat-date-range-input\", inputs: { rangePicker: \"rangePicker\", required: [\"required\", \"required\", booleanAttribute], dateFilter: \"dateFilter\", min: \"min\", max: \"max\", disabled: [\"disabled\", \"disabled\", booleanAttribute], separator: \"separator\", comparisonStart: \"comparisonStart\", comparisonEnd: \"comparisonEnd\" }, host: { attributes: { \"role\": \"group\" }, properties: { \"class.mat-date-range-input-hide-placeholders\": \"_shouldHidePlaceholders()\", \"class.mat-date-range-input-required\": \"required\", \"attr.id\": \"id\", \"attr.aria-labelledby\": \"_getAriaLabelledby()\", \"attr.aria-describedby\": \"_ariaDescribedBy\", \"attr.data-mat-calendar\": \"rangePicker ? rangePicker.id : null\" }, classAttribute: \"mat-date-range-input\" }, providers: [\n { provide: MatFormFieldControl, useExisting: MatDateRangeInput },\n { provide: MAT_DATE_RANGE_INPUT_PARENT, useExisting: MatDateRangeInput },\n ], queries: [{ propertyName: \"_startInput\", first: true, predicate: MatStartDate, descendants: true }, { propertyName: \"_endInput\", first: true, predicate: MatEndDate, descendants: true }], exportAs: [\"matDateRangeInput\"], usesOnChanges: true, ngImport: i0, template: \"\\n\\n\", styles: [\".mat-date-range-input{display:block;width:100%}.mat-date-range-input-container{display:flex;align-items:center}.mat-date-range-input-separator{transition:opacity 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);margin:0 4px;color:var(--mat-datepicker-range-input-separator-color)}.mat-form-field-disabled .mat-date-range-input-separator{color:var(--mat-datepicker-range-input-disabled-state-separator-color)}._mat-animation-noopable .mat-date-range-input-separator{transition:none}.mat-date-range-input-separator-hidden{-webkit-user-select:none;user-select:none;opacity:0;transition:none}.mat-date-range-input-wrapper{position:relative;overflow:hidden;max-width:calc(50% - 4px)}.mat-date-range-input-end-wrapper{flex-grow:1}.mat-date-range-input-inner{position:absolute;top:0;left:0;font:inherit;background:rgba(0,0,0,0);color:currentColor;border:none;outline:none;padding:0;margin:0;vertical-align:bottom;text-align:inherit;-webkit-appearance:none;width:100%;height:100%}.mat-date-range-input-inner:-moz-ui-invalid{box-shadow:none}.mat-date-range-input-inner::placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner::-moz-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner::-webkit-input-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner:-ms-input-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner[disabled]{color:var(--mat-datepicker-range-input-disabled-state-text-color)}.mat-form-field-hide-placeholder .mat-date-range-input-inner::placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner::-moz-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-moz-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::-moz-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-moz-placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner::-webkit-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-webkit-input-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::-webkit-input-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-webkit-input-placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner:-ms-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner:-ms-input-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner:-ms-input-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner:-ms-input-placeholder{opacity:0}._mat-animation-noopable .mat-date-range-input-inner::placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner::-moz-placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner::-webkit-input-placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner:-ms-input-placeholder{transition:none}.mat-date-range-input-mirror{-webkit-user-select:none;user-select:none;visibility:hidden;white-space:nowrap;display:inline-block;min-width:2px}.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix{width:200px}\"], dependencies: [{ kind: \"directive\", type: CdkMonitorFocus, selector: \"[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]\", outputs: [\"cdkFocusChange\"], exportAs: [\"cdkMonitorFocus\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateRangeInput, decorators: [{\n type: Component,\n args: [{ selector: 'mat-date-range-input', exportAs: 'matDateRangeInput', host: {\n 'class': 'mat-date-range-input',\n '[class.mat-date-range-input-hide-placeholders]': '_shouldHidePlaceholders()',\n '[class.mat-date-range-input-required]': 'required',\n '[attr.id]': 'id',\n 'role': 'group',\n '[attr.aria-labelledby]': '_getAriaLabelledby()',\n '[attr.aria-describedby]': '_ariaDescribedBy',\n // Used by the test harness to tie this input to its calendar. We can't depend on\n // `aria-owns` for this, because it's only defined while the calendar is open.\n '[attr.data-mat-calendar]': 'rangePicker ? rangePicker.id : null',\n }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [\n { provide: MatFormFieldControl, useExisting: MatDateRangeInput },\n { provide: MAT_DATE_RANGE_INPUT_PARENT, useExisting: MatDateRangeInput },\n ], standalone: true, imports: [CdkMonitorFocus], template: \"\\n\\n\", styles: [\".mat-date-range-input{display:block;width:100%}.mat-date-range-input-container{display:flex;align-items:center}.mat-date-range-input-separator{transition:opacity 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);margin:0 4px;color:var(--mat-datepicker-range-input-separator-color)}.mat-form-field-disabled .mat-date-range-input-separator{color:var(--mat-datepicker-range-input-disabled-state-separator-color)}._mat-animation-noopable .mat-date-range-input-separator{transition:none}.mat-date-range-input-separator-hidden{-webkit-user-select:none;user-select:none;opacity:0;transition:none}.mat-date-range-input-wrapper{position:relative;overflow:hidden;max-width:calc(50% - 4px)}.mat-date-range-input-end-wrapper{flex-grow:1}.mat-date-range-input-inner{position:absolute;top:0;left:0;font:inherit;background:rgba(0,0,0,0);color:currentColor;border:none;outline:none;padding:0;margin:0;vertical-align:bottom;text-align:inherit;-webkit-appearance:none;width:100%;height:100%}.mat-date-range-input-inner:-moz-ui-invalid{box-shadow:none}.mat-date-range-input-inner::placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner::-moz-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner::-webkit-input-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner:-ms-input-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner[disabled]{color:var(--mat-datepicker-range-input-disabled-state-text-color)}.mat-form-field-hide-placeholder .mat-date-range-input-inner::placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner::-moz-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-moz-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::-moz-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-moz-placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner::-webkit-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-webkit-input-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::-webkit-input-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-webkit-input-placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner:-ms-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner:-ms-input-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner:-ms-input-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner:-ms-input-placeholder{opacity:0}._mat-animation-noopable .mat-date-range-input-inner::placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner::-moz-placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner::-webkit-input-placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner:-ms-input-placeholder{transition:none}.mat-date-range-input-mirror{-webkit-user-select:none;user-select:none;visibility:hidden;white-space:nowrap;display:inline-block;min-width:2px}.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix{width:200px}\"] }]\n }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i2$1.ControlContainer, decorators: [{\n type: Optional\n }, {\n type: Self\n }] }, { type: i1.DateAdapter, decorators: [{\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_FORM_FIELD]\n }] }], propDecorators: { rangePicker: [{\n type: Input\n }], required: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], dateFilter: [{\n type: Input\n }], min: [{\n type: Input\n }], max: [{\n type: Input\n }], disabled: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], separator: [{\n type: Input\n }], comparisonStart: [{\n type: Input\n }], comparisonEnd: [{\n type: Input\n }], _startInput: [{\n type: ContentChild,\n args: [MatStartDate]\n }], _endInput: [{\n type: ContentChild,\n args: [MatEndDate]\n }] } });\n\n// TODO(mmalerba): We use a component instead of a directive here so the user can use implicit\n// template reference variables (e.g. #d vs #d=\"matDateRangePicker\"). We can change this to a\n// directive if angular adds support for `exportAs: '$implicit'` on directives.\n/** Component responsible for managing the date range picker popup/dialog. */\nclass MatDateRangePicker extends MatDatepickerBase {\n _forwardContentValues(instance) {\n super._forwardContentValues(instance);\n const input = this.datepickerInput;\n if (input) {\n instance.comparisonStart = input.comparisonStart;\n instance.comparisonEnd = input.comparisonEnd;\n instance.startDateAccessibleName = input._getStartDateAccessibleName();\n instance.endDateAccessibleName = input._getEndDateAccessibleName();\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateRangePicker, deps: null, target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDateRangePicker, isStandalone: true, selector: \"mat-date-range-picker\", providers: [\n MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER,\n MAT_CALENDAR_RANGE_STRATEGY_PROVIDER,\n { provide: MatDatepickerBase, useExisting: MatDateRangePicker },\n ], exportAs: [\"matDateRangePicker\"], usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDateRangePicker, decorators: [{\n type: Component,\n args: [{\n selector: 'mat-date-range-picker',\n template: '',\n exportAs: 'matDateRangePicker',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER,\n MAT_CALENDAR_RANGE_STRATEGY_PROVIDER,\n { provide: MatDatepickerBase, useExisting: MatDateRangePicker },\n ],\n standalone: true,\n }]\n }] });\n\n/** Button that will close the datepicker and assign the current selection to the data model. */\nclass MatDatepickerApply {\n constructor(_datepicker) {\n this._datepicker = _datepicker;\n }\n _applySelection() {\n this._datepicker._applyPendingSelection();\n this._datepicker.close();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerApply, deps: [{ token: MatDatepickerBase }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDatepickerApply, isStandalone: true, selector: \"[matDatepickerApply], [matDateRangePickerApply]\", host: { listeners: { \"click\": \"_applySelection()\" } }, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerApply, decorators: [{\n type: Directive,\n args: [{\n selector: '[matDatepickerApply], [matDateRangePickerApply]',\n host: { '(click)': '_applySelection()' },\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: MatDatepickerBase }] });\n/** Button that will close the datepicker and discard the current selection. */\nclass MatDatepickerCancel {\n constructor(_datepicker) {\n this._datepicker = _datepicker;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerCancel, deps: [{ token: MatDatepickerBase }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDatepickerCancel, isStandalone: true, selector: \"[matDatepickerCancel], [matDateRangePickerCancel]\", host: { listeners: { \"click\": \"_datepicker.close()\" } }, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerCancel, decorators: [{\n type: Directive,\n args: [{\n selector: '[matDatepickerCancel], [matDateRangePickerCancel]',\n host: { '(click)': '_datepicker.close()' },\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: MatDatepickerBase }] });\n/**\n * Container that can be used to project a row of action buttons\n * to the bottom of a datepicker or date range picker.\n */\nclass MatDatepickerActions {\n constructor(_datepicker, _viewContainerRef) {\n this._datepicker = _datepicker;\n this._viewContainerRef = _viewContainerRef;\n }\n ngAfterViewInit() {\n this._portal = new TemplatePortal(this._template, this._viewContainerRef);\n this._datepicker.registerActions(this._portal);\n }\n ngOnDestroy() {\n this._datepicker.removeActions(this._portal);\n // Needs to be null checked since we initialize it in `ngAfterViewInit`.\n if (this._portal && this._portal.isAttached) {\n this._portal?.detach();\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerActions, deps: [{ token: MatDatepickerBase }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatDatepickerActions, isStandalone: true, selector: \"mat-datepicker-actions, mat-date-range-picker-actions\", viewQueries: [{ propertyName: \"_template\", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: `\n \n \n \n
\n \n `, isInline: true, styles: [\".mat-datepicker-actions{display:flex;justify-content:flex-end;align-items:center;padding:0 8px 8px 8px}.mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerActions, decorators: [{\n type: Component,\n args: [{ selector: 'mat-datepicker-actions, mat-date-range-picker-actions', template: `\n \n \n \n
\n \n `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, styles: [\".mat-datepicker-actions{display:flex;justify-content:flex-end;align-items:center;padding:0 8px 8px 8px}.mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\"] }]\n }], ctorParameters: () => [{ type: MatDatepickerBase }, { type: i0.ViewContainerRef }], propDecorators: { _template: [{\n type: ViewChild,\n args: [TemplateRef]\n }] } });\n\nclass MatDatepickerModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerModule, imports: [CommonModule,\n MatButtonModule,\n OverlayModule,\n A11yModule,\n PortalModule,\n MatCommonModule,\n MatCalendar,\n MatCalendarBody,\n MatDatepicker,\n MatDatepickerContent,\n MatDatepickerInput,\n MatDatepickerToggle,\n MatDatepickerToggleIcon,\n MatMonthView,\n MatYearView,\n MatMultiYearView,\n MatCalendarHeader,\n MatDateRangeInput,\n MatStartDate,\n MatEndDate,\n MatDateRangePicker,\n MatDatepickerActions,\n MatDatepickerCancel,\n MatDatepickerApply], exports: [CdkScrollableModule,\n MatCalendar,\n MatCalendarBody,\n MatDatepicker,\n MatDatepickerContent,\n MatDatepickerInput,\n MatDatepickerToggle,\n MatDatepickerToggleIcon,\n MatMonthView,\n MatYearView,\n MatMultiYearView,\n MatCalendarHeader,\n MatDateRangeInput,\n MatStartDate,\n MatEndDate,\n MatDateRangePicker,\n MatDatepickerActions,\n MatDatepickerCancel,\n MatDatepickerApply] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerModule, providers: [MatDatepickerIntl, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule,\n MatButtonModule,\n OverlayModule,\n A11yModule,\n PortalModule,\n MatCommonModule,\n MatDatepickerContent,\n MatDatepickerToggle,\n MatCalendarHeader, CdkScrollableModule] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatDatepickerModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [\n CommonModule,\n MatButtonModule,\n OverlayModule,\n A11yModule,\n PortalModule,\n MatCommonModule,\n MatCalendar,\n MatCalendarBody,\n MatDatepicker,\n MatDatepickerContent,\n MatDatepickerInput,\n MatDatepickerToggle,\n MatDatepickerToggleIcon,\n MatMonthView,\n MatYearView,\n MatMultiYearView,\n MatCalendarHeader,\n MatDateRangeInput,\n MatStartDate,\n MatEndDate,\n MatDateRangePicker,\n MatDatepickerActions,\n MatDatepickerCancel,\n MatDatepickerApply,\n ],\n exports: [\n CdkScrollableModule,\n MatCalendar,\n MatCalendarBody,\n MatDatepicker,\n MatDatepickerContent,\n MatDatepickerInput,\n MatDatepickerToggle,\n MatDatepickerToggleIcon,\n MatMonthView,\n MatYearView,\n MatMultiYearView,\n MatCalendarHeader,\n MatDateRangeInput,\n MatStartDate,\n MatEndDate,\n MatDateRangePicker,\n MatDatepickerActions,\n MatDatepickerCancel,\n MatDatepickerApply,\n ],\n providers: [MatDatepickerIntl, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { DateRange, DefaultMatCalendarRangeStrategy, MAT_DATEPICKER_SCROLL_STRATEGY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY, MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_DATEPICKER_VALIDATORS, MAT_DATEPICKER_VALUE_ACCESSOR, MAT_DATE_RANGE_SELECTION_STRATEGY, MAT_RANGE_DATE_SELECTION_MODEL_FACTORY, MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER, MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY, MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER, MatCalendar, MatCalendarBody, MatCalendarCell, MatCalendarHeader, MatDateRangeInput, MatDateRangePicker, MatDateSelectionModel, MatDatepicker, MatDatepickerActions, MatDatepickerApply, MatDatepickerCancel, MatDatepickerContent, MatDatepickerInput, MatDatepickerInputEvent, MatDatepickerIntl, MatDatepickerModule, MatDatepickerToggle, MatDatepickerToggleIcon, MatEndDate, MatMonthView, MatMultiYearView, MatRangeDateSelectionModel, MatSingleDateSelectionModel, MatStartDate, MatYearView, matDatepickerAnimations, yearsPerPage, yearsPerRow };\n","import * as i0 from '@angular/core';\nimport { InjectionToken, EventEmitter, inject, Injectable, ElementRef, Renderer2, makeEnvironmentProviders, Directive, Input, Output, HostListener, Pipe } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';\n\nconst NGX_MASK_CONFIG = new InjectionToken('ngx-mask config');\nconst NEW_CONFIG = new InjectionToken('new ngx-mask config');\nconst INITIAL_CONFIG = new InjectionToken('initial ngx-mask config');\nconst initialConfig = {\n suffix: '',\n prefix: '',\n thousandSeparator: ' ',\n decimalMarker: ['.', ','],\n clearIfNotMatch: false,\n showTemplate: false,\n showMaskTyped: false,\n placeHolderCharacter: '_',\n dropSpecialCharacters: true,\n hiddenInput: undefined,\n shownMaskExpression: '',\n separatorLimit: '',\n allowNegativeNumbers: false,\n validation: true,\n // eslint-disable-next-line @typescript-eslint/quotes\n specialCharacters: ['-', '/', '(', ')', '.', ':', ' ', '+', ',', '@', '[', ']', '\"', \"'\"],\n leadZeroDateTime: false,\n apm: false,\n leadZero: false,\n keepCharacterPositions: false,\n triggerOnMaskChange: false,\n inputTransformFn: (value) => value,\n outputTransformFn: (value) => value,\n maskFilled: new EventEmitter(),\n patterns: {\n '0': {\n pattern: new RegExp('\\\\d'),\n },\n '9': {\n pattern: new RegExp('\\\\d'),\n optional: true,\n },\n X: {\n pattern: new RegExp('\\\\d'),\n symbol: '*',\n },\n A: {\n pattern: new RegExp('[a-zA-Z0-9]'),\n },\n S: {\n pattern: new RegExp('[a-zA-Z]'),\n },\n U: {\n pattern: new RegExp('[A-Z]'),\n },\n L: {\n pattern: new RegExp('[a-z]'),\n },\n d: {\n pattern: new RegExp('\\\\d'),\n },\n m: {\n pattern: new RegExp('\\\\d'),\n },\n M: {\n pattern: new RegExp('\\\\d'),\n },\n H: {\n pattern: new RegExp('\\\\d'),\n },\n h: {\n pattern: new RegExp('\\\\d'),\n },\n s: {\n pattern: new RegExp('\\\\d'),\n },\n },\n};\nconst timeMasks = [\n \"Hh:m0:s0\" /* MaskExpression.HOURS_MINUTES_SECONDS */,\n \"Hh:m0\" /* MaskExpression.HOURS_MINUTES */,\n \"m0:s0\" /* MaskExpression.MINUTES_SECONDS */,\n];\nconst withoutValidation = [\n \"percent\" /* MaskExpression.PERCENT */,\n \"Hh\" /* MaskExpression.HOURS_HOUR */,\n \"s0\" /* MaskExpression.SECONDS */,\n \"m0\" /* MaskExpression.MINUTES */,\n \"separator\" /* MaskExpression.SEPARATOR */,\n \"d0/M0/0000\" /* MaskExpression.DAYS_MONTHS_YEARS */,\n \"d0/M0\" /* MaskExpression.DAYS_MONTHS */,\n \"d0\" /* MaskExpression.DAYS */,\n \"M0\" /* MaskExpression.MONTHS */,\n];\n\nclass NgxMaskApplierService {\n constructor() {\n this._config = inject(NGX_MASK_CONFIG);\n this.dropSpecialCharacters = this._config.dropSpecialCharacters;\n this.hiddenInput = this._config.hiddenInput;\n this.clearIfNotMatch = this._config.clearIfNotMatch;\n this.specialCharacters = this._config.specialCharacters;\n this.patterns = this._config.patterns;\n this.prefix = this._config.prefix;\n this.suffix = this._config.suffix;\n this.thousandSeparator = this._config.thousandSeparator;\n this.decimalMarker = this._config.decimalMarker;\n this.showMaskTyped = this._config.showMaskTyped;\n this.placeHolderCharacter = this._config.placeHolderCharacter;\n this.validation = this._config.validation;\n this.separatorLimit = this._config.separatorLimit;\n this.allowNegativeNumbers = this._config.allowNegativeNumbers;\n this.leadZeroDateTime = this._config.leadZeroDateTime;\n this.leadZero = this._config.leadZero;\n this.apm = this._config.apm;\n this.inputTransformFn = this._config.inputTransformFn;\n this.outputTransformFn = this._config.outputTransformFn;\n this.keepCharacterPositions = this._config.keepCharacterPositions;\n this._shift = new Set();\n this.plusOnePosition = false;\n this.maskExpression = '';\n this.actualValue = '';\n this.showKeepCharacterExp = '';\n this.shownMaskExpression = '';\n this.deletedSpecialCharacter = false;\n this._formatWithSeparators = (str, thousandSeparatorChar, decimalChars, precision) => {\n let x = [];\n let decimalChar = '';\n if (Array.isArray(decimalChars)) {\n const regExp = new RegExp(decimalChars.map((v) => ('[\\\\^$.|?*+()'.indexOf(v) >= 0 ? `\\\\${v}` : v)).join('|'));\n x = str.split(regExp);\n decimalChar = str.match(regExp)?.[0] ?? \"\" /* MaskExpression.EMPTY_STRING */;\n }\n else {\n x = str.split(decimalChars);\n decimalChar = decimalChars;\n }\n const decimals = x.length > 1 ? `${decimalChar}${x[1]}` : \"\" /* MaskExpression.EMPTY_STRING */;\n let res = x[0] ?? \"\" /* MaskExpression.EMPTY_STRING */;\n const separatorLimit = this.separatorLimit.replace(/\\s/g, \"\" /* MaskExpression.EMPTY_STRING */);\n if (separatorLimit && +separatorLimit) {\n if (res[0] === \"-\" /* MaskExpression.MINUS */) {\n res = `-${res.slice(1, res.length).slice(0, separatorLimit.length)}`;\n }\n else {\n res = res.slice(0, separatorLimit.length);\n }\n }\n const rgx = /(\\d+)(\\d{3})/;\n while (thousandSeparatorChar && rgx.test(res)) {\n res = res.replace(rgx, '$1' + thousandSeparatorChar + '$2');\n }\n if (precision === undefined) {\n return res + decimals;\n }\n else if (precision === 0) {\n return res;\n }\n return res + decimals.substring(0, precision + 1);\n };\n this.percentage = (str) => {\n const sanitizedStr = str.replace(',', '.');\n const value = Number(this.allowNegativeNumbers && str.includes(\"-\" /* MaskExpression.MINUS */)\n ? sanitizedStr.slice(1, str.length)\n : sanitizedStr);\n return !isNaN(value) && value >= 0 && value <= 100;\n };\n this.getPrecision = (maskExpression) => {\n const x = maskExpression.split(\".\" /* MaskExpression.DOT */);\n if (x.length > 1) {\n return Number(x[x.length - 1]);\n }\n return Infinity;\n };\n this.checkAndRemoveSuffix = (inputValue) => {\n for (let i = this.suffix?.length - 1; i >= 0; i--) {\n const substr = this.suffix.substring(i, this.suffix?.length);\n if (inputValue.includes(substr) &&\n i !== this.suffix?.length - 1 &&\n (i - 1 < 0 ||\n !inputValue.includes(this.suffix.substring(i - 1, this.suffix?.length)))) {\n return inputValue.replace(substr, \"\" /* MaskExpression.EMPTY_STRING */);\n }\n }\n return inputValue;\n };\n this.checkInputPrecision = (inputValue, precision, decimalMarker) => {\n if (precision < Infinity) {\n // TODO need think about decimalMarker\n if (Array.isArray(decimalMarker)) {\n const marker = decimalMarker.find((dm) => dm !== this.thousandSeparator);\n // eslint-disable-next-line no-param-reassign\n decimalMarker = marker ? marker : decimalMarker[0];\n }\n const precisionRegEx = new RegExp(this._charToRegExpExpression(decimalMarker) + `\\\\d{${precision}}.*$`);\n const precisionMatch = inputValue.match(precisionRegEx);\n const precisionMatchLength = (precisionMatch && precisionMatch[0]?.length) ?? 0;\n if (precisionMatchLength - 1 > precision) {\n const diff = precisionMatchLength - 1 - precision;\n // eslint-disable-next-line no-param-reassign\n inputValue = inputValue.substring(0, inputValue.length - diff);\n }\n if (precision === 0 &&\n this._compareOrIncludes(inputValue[inputValue.length - 1], decimalMarker, this.thousandSeparator)) {\n // eslint-disable-next-line no-param-reassign\n inputValue = inputValue.substring(0, inputValue.length - 1);\n }\n }\n return inputValue;\n };\n }\n applyMaskWithPattern(inputValue, maskAndPattern) {\n const [mask, customPattern] = maskAndPattern;\n this.customPattern = customPattern;\n return this.applyMask(inputValue, mask);\n }\n applyMask(inputValue, maskExpression, position = 0, justPasted = false, backspaced = false, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cb = () => { }) {\n if (!maskExpression || typeof inputValue !== 'string') {\n return \"\" /* MaskExpression.EMPTY_STRING */;\n }\n let cursor = 0;\n let result = '';\n let multi = false;\n let backspaceShift = false;\n let shift = 1;\n let stepBack = false;\n if (inputValue.slice(0, this.prefix.length) === this.prefix) {\n // eslint-disable-next-line no-param-reassign\n inputValue = inputValue.slice(this.prefix.length, inputValue.length);\n }\n if (!!this.suffix && inputValue?.length > 0) {\n // eslint-disable-next-line no-param-reassign\n inputValue = this.checkAndRemoveSuffix(inputValue);\n }\n if (inputValue === '(' && this.prefix) {\n // eslint-disable-next-line no-param-reassign\n inputValue = '';\n }\n const inputArray = inputValue.toString().split(\"\" /* MaskExpression.EMPTY_STRING */);\n if (this.allowNegativeNumbers &&\n inputValue.slice(cursor, cursor + 1) === \"-\" /* MaskExpression.MINUS */) {\n result += inputValue.slice(cursor, cursor + 1);\n }\n if (maskExpression === \"IP\" /* MaskExpression.IP */) {\n const valuesIP = inputValue.split(\".\" /* MaskExpression.DOT */);\n this.ipError = this._validIP(valuesIP);\n // eslint-disable-next-line no-param-reassign\n maskExpression = '099.099.099.099';\n }\n const arr = [];\n for (let i = 0; i < inputValue.length; i++) {\n if (inputValue[i]?.match('\\\\d')) {\n arr.push(inputValue[i] ?? \"\" /* MaskExpression.EMPTY_STRING */);\n }\n }\n if (maskExpression === \"CPF_CNPJ\" /* MaskExpression.CPF_CNPJ */) {\n this.cpfCnpjError = arr.length !== 11 && arr.length !== 14;\n if (arr.length > 11) {\n // eslint-disable-next-line no-param-reassign\n maskExpression = '00.000.000/0000-00';\n }\n else {\n // eslint-disable-next-line no-param-reassign\n maskExpression = '000.000.000-00';\n }\n }\n if (maskExpression.startsWith(\"percent\" /* MaskExpression.PERCENT */)) {\n if (inputValue.match('[a-z]|[A-Z]') ||\n // eslint-disable-next-line no-useless-escape\n (inputValue.match(/[-!$%^&*()_+|~=`{}\\[\\]:\";'<>?,\\/.]/) && !backspaced)) {\n // eslint-disable-next-line no-param-reassign\n inputValue = this._stripToDecimal(inputValue);\n const precision = this.getPrecision(maskExpression);\n // eslint-disable-next-line no-param-reassign\n inputValue = this.checkInputPrecision(inputValue, precision, this.decimalMarker);\n }\n const decimalMarker = typeof this.decimalMarker === 'string' ? this.decimalMarker : \".\" /* MaskExpression.DOT */;\n if (inputValue.indexOf(decimalMarker) > 0 &&\n !this.percentage(inputValue.substring(0, inputValue.indexOf(decimalMarker)))) {\n let base = inputValue.substring(0, inputValue.indexOf(decimalMarker) - 1);\n if (this.allowNegativeNumbers &&\n inputValue.slice(cursor, cursor + 1) === \"-\" /* MaskExpression.MINUS */ &&\n !backspaced) {\n base = inputValue.substring(0, inputValue.indexOf(decimalMarker));\n }\n // eslint-disable-next-line no-param-reassign\n inputValue = `${base}${inputValue.substring(inputValue.indexOf(decimalMarker), inputValue.length)}`;\n }\n let value = '';\n this.allowNegativeNumbers &&\n inputValue.slice(cursor, cursor + 1) === \"-\" /* MaskExpression.MINUS */\n ? (value = `${\"-\" /* MaskExpression.MINUS */}${inputValue.slice(cursor + 1, cursor + inputValue.length)}`)\n : (value = inputValue);\n if (this.percentage(value)) {\n result = this._splitPercentZero(inputValue);\n }\n else {\n result = this._splitPercentZero(inputValue.substring(0, inputValue.length - 1));\n }\n }\n else if (maskExpression.startsWith(\"separator\" /* MaskExpression.SEPARATOR */)) {\n if (inputValue.match('[wа-яА-Я]') ||\n inputValue.match('[ЁёА-я]') ||\n inputValue.match('[a-z]|[A-Z]') ||\n inputValue.match(/[-@#!$%\\\\^&*()_£¬'+|~=`{}\\]:\";<>.?/]/) ||\n inputValue.match('[^A-Za-z0-9,]')) {\n // eslint-disable-next-line no-param-reassign\n inputValue = this._stripToDecimal(inputValue);\n }\n const precision = this.getPrecision(maskExpression);\n const decimalMarker = Array.isArray(this.decimalMarker)\n ? \".\" /* MaskExpression.DOT */\n : this.decimalMarker;\n if (precision === 0) {\n // eslint-disable-next-line no-param-reassign\n inputValue = this.allowNegativeNumbers\n ? inputValue.length > 2 &&\n inputValue[0] === \"-\" /* MaskExpression.MINUS */ &&\n inputValue[1] === \"0\" /* MaskExpression.NUMBER_ZERO */ &&\n inputValue[2] !== this.thousandSeparator &&\n inputValue[2] !== \",\" /* MaskExpression.COMMA */ &&\n inputValue[2] !== \".\" /* MaskExpression.DOT */\n ? '-' + inputValue.slice(2, inputValue.length)\n : inputValue[0] === \"0\" /* MaskExpression.NUMBER_ZERO */ &&\n inputValue.length > 1 &&\n inputValue[1] !== this.thousandSeparator &&\n inputValue[1] !== \",\" /* MaskExpression.COMMA */ &&\n inputValue[1] !== \".\" /* MaskExpression.DOT */\n ? inputValue.slice(1, inputValue.length)\n : inputValue\n : inputValue.length > 1 &&\n inputValue[0] === \"0\" /* MaskExpression.NUMBER_ZERO */ &&\n inputValue[1] !== this.thousandSeparator &&\n inputValue[1] !== \",\" /* MaskExpression.COMMA */ &&\n inputValue[1] !== \".\" /* MaskExpression.DOT */\n ? inputValue.slice(1, inputValue.length)\n : inputValue;\n }\n else {\n if (inputValue[0] === decimalMarker && inputValue.length > 1) {\n // eslint-disable-next-line no-param-reassign\n inputValue =\n \"0\" /* MaskExpression.NUMBER_ZERO */ + inputValue.slice(0, inputValue.length + 1);\n this.plusOnePosition = true;\n }\n if (inputValue[0] === \"0\" /* MaskExpression.NUMBER_ZERO */ &&\n inputValue[1] !== decimalMarker &&\n inputValue[1] !== this.thousandSeparator) {\n // eslint-disable-next-line no-param-reassign\n inputValue =\n inputValue.length > 1\n ? inputValue.slice(0, 1) +\n decimalMarker +\n inputValue.slice(1, inputValue.length + 1)\n : inputValue;\n this.plusOnePosition = true;\n }\n if (this.allowNegativeNumbers &&\n inputValue[0] === \"-\" /* MaskExpression.MINUS */ &&\n (inputValue[1] === decimalMarker ||\n inputValue[1] === \"0\" /* MaskExpression.NUMBER_ZERO */)) {\n // eslint-disable-next-line no-param-reassign\n inputValue =\n inputValue[1] === decimalMarker && inputValue.length > 2\n ? inputValue.slice(0, 1) +\n \"0\" /* MaskExpression.NUMBER_ZERO */ +\n inputValue.slice(1, inputValue.length)\n : inputValue[1] === \"0\" /* MaskExpression.NUMBER_ZERO */ &&\n inputValue.length > 2 &&\n inputValue[2] !== decimalMarker\n ? inputValue.slice(0, 2) +\n decimalMarker +\n inputValue.slice(2, inputValue.length)\n : inputValue;\n this.plusOnePosition = true;\n }\n }\n if (backspaced) {\n const inputValueAfterZero = inputValue.slice(this._findFirstNonZeroDigitIndex(inputValue), inputValue.length);\n const positionOfZeroOrDecimalMarker = inputValue[position] === \"0\" /* MaskExpression.NUMBER_ZERO */ ||\n inputValue[position] === decimalMarker;\n const zeroIndexNumberZero = inputValue[0] === \"0\" /* MaskExpression.NUMBER_ZERO */;\n const zeroIndexMinus = inputValue[0] === \"-\" /* MaskExpression.MINUS */;\n const zeroIndexThousand = inputValue[0] === this.thousandSeparator;\n const firstIndexDecimalMarker = inputValue[1] === decimalMarker;\n const firstIndexNumberZero = inputValue[1] === \"0\" /* MaskExpression.NUMBER_ZERO */;\n const secondIndexDecimalMarker = inputValue[2] === decimalMarker;\n if (zeroIndexNumberZero &&\n firstIndexDecimalMarker &&\n positionOfZeroOrDecimalMarker &&\n position < 2) {\n // eslint-disable-next-line no-param-reassign\n inputValue = inputValueAfterZero;\n }\n if (zeroIndexMinus &&\n firstIndexNumberZero &&\n secondIndexDecimalMarker &&\n positionOfZeroOrDecimalMarker &&\n position < 3) {\n // eslint-disable-next-line no-param-reassign\n inputValue = \"-\" /* MaskExpression.MINUS */ + inputValueAfterZero;\n }\n if (inputValueAfterZero !== \"-\" /* MaskExpression.MINUS */ &&\n ((position === 0 && (zeroIndexNumberZero || zeroIndexThousand)) ||\n (this.allowNegativeNumbers &&\n position === 1 &&\n zeroIndexMinus &&\n !firstIndexNumberZero))) {\n // eslint-disable-next-line no-param-reassign\n inputValue = zeroIndexMinus\n ? \"-\" /* MaskExpression.MINUS */ + inputValueAfterZero\n : inputValueAfterZero;\n }\n }\n // TODO: we had different rexexps here for the different cases... but tests dont seam to bother - check this\n // separator: no COMMA, dot-sep: no SPACE, COMMA OK, comma-sep: no SPACE, COMMA OK\n const thousandSeparatorCharEscaped = this._charToRegExpExpression(this.thousandSeparator);\n let invalidChars = '@#!$%^&*()_+|~=`{}\\\\[\\\\]:\\\\s,\\\\.\";<>?\\\\/'.replace(thousandSeparatorCharEscaped, '');\n //.replace(decimalMarkerEscaped, '');\n if (Array.isArray(this.decimalMarker)) {\n for (const marker of this.decimalMarker) {\n invalidChars = invalidChars.replace(this._charToRegExpExpression(marker), \"\" /* MaskExpression.EMPTY_STRING */);\n }\n }\n else {\n invalidChars = invalidChars.replace(this._charToRegExpExpression(this.decimalMarker), '');\n }\n const invalidCharRegexp = new RegExp('[' + invalidChars + ']');\n if (inputValue.match(invalidCharRegexp)) {\n // eslint-disable-next-line no-param-reassign\n inputValue = inputValue.substring(0, inputValue.length - 1);\n }\n // eslint-disable-next-line no-param-reassign\n inputValue = this.checkInputPrecision(inputValue, precision, this.decimalMarker);\n const strForSep = inputValue.replace(new RegExp(thousandSeparatorCharEscaped, 'g'), '');\n result = this._formatWithSeparators(strForSep, this.thousandSeparator, this.decimalMarker, precision);\n const commaShift = result.indexOf(\",\" /* MaskExpression.COMMA */) - inputValue.indexOf(\",\" /* MaskExpression.COMMA */);\n const shiftStep = result.length - inputValue.length;\n if (result[position - 1] === this.thousandSeparator && this.prefix && backspaced) {\n // eslint-disable-next-line no-param-reassign\n position = position - 1;\n }\n else if (shiftStep > 0 && result[position] !== this.thousandSeparator) {\n backspaceShift = true;\n let _shift = 0;\n do {\n this._shift.add(position + _shift);\n _shift++;\n } while (_shift < shiftStep);\n }\n else if (result[position - 1] === this.decimalMarker ||\n shiftStep === -4 ||\n shiftStep === -3 ||\n result[position] === this.thousandSeparator) {\n this._shift.clear();\n this._shift.add(position - 1);\n }\n else if ((commaShift !== 0 &&\n position > 0 &&\n !(result.indexOf(\",\" /* MaskExpression.COMMA */) >= position && position > 3)) ||\n (!(result.indexOf(\".\" /* MaskExpression.DOT */) >= position && position > 3) &&\n shiftStep <= 0)) {\n this._shift.clear();\n backspaceShift = true;\n shift = shiftStep;\n // eslint-disable-next-line no-param-reassign\n position += shiftStep;\n this._shift.add(position);\n }\n else {\n this._shift.clear();\n }\n }\n else {\n for (let i = 0, inputSymbol = inputArray[0]; i < inputArray.length; i++, inputSymbol = inputArray[i] ?? \"\" /* MaskExpression.EMPTY_STRING */) {\n if (cursor === maskExpression.length) {\n break;\n }\n const symbolStarInPattern = \"*\" /* MaskExpression.SYMBOL_STAR */ in this.patterns;\n if (this._checkSymbolMask(inputSymbol, maskExpression[cursor] ?? \"\" /* MaskExpression.EMPTY_STRING */) &&\n maskExpression[cursor + 1] === \"?\" /* MaskExpression.SYMBOL_QUESTION */) {\n result += inputSymbol;\n cursor += 2;\n }\n else if (maskExpression[cursor + 1] === \"*\" /* MaskExpression.SYMBOL_STAR */ &&\n multi &&\n this._checkSymbolMask(inputSymbol, maskExpression[cursor + 2] ?? \"\" /* MaskExpression.EMPTY_STRING */)) {\n result += inputSymbol;\n cursor += 3;\n multi = false;\n }\n else if (this._checkSymbolMask(inputSymbol, maskExpression[cursor] ?? \"\" /* MaskExpression.EMPTY_STRING */) &&\n maskExpression[cursor + 1] === \"*\" /* MaskExpression.SYMBOL_STAR */ &&\n !symbolStarInPattern) {\n result += inputSymbol;\n multi = true;\n }\n else if (maskExpression[cursor + 1] === \"?\" /* MaskExpression.SYMBOL_QUESTION */ &&\n this._checkSymbolMask(inputSymbol, maskExpression[cursor + 2] ?? \"\" /* MaskExpression.EMPTY_STRING */)) {\n result += inputSymbol;\n cursor += 3;\n }\n else if (this._checkSymbolMask(inputSymbol, maskExpression[cursor] ?? \"\" /* MaskExpression.EMPTY_STRING */)) {\n if (maskExpression[cursor] === \"H\" /* MaskExpression.HOURS */) {\n if (this.apm ? Number(inputSymbol) > 9 : Number(inputSymbol) > 2) {\n // eslint-disable-next-line no-param-reassign\n position = !this.leadZeroDateTime ? position + 1 : position;\n cursor += 1;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n if (this.leadZeroDateTime) {\n result += '0';\n }\n continue;\n }\n }\n if (maskExpression[cursor] === \"h\" /* MaskExpression.HOUR */) {\n if (this.apm\n ? (result.length === 1 && Number(result) > 1) ||\n (result === '1' && Number(inputSymbol) > 2) ||\n (inputValue.slice(cursor - 1, cursor).length === 1 &&\n Number(inputValue.slice(cursor - 1, cursor)) > 2) ||\n (inputValue.slice(cursor - 1, cursor) === '1' &&\n Number(inputSymbol) > 2)\n : (result === '2' && Number(inputSymbol) > 3) ||\n ((result.slice(cursor - 2, cursor) === '2' ||\n result.slice(cursor - 3, cursor) === '2' ||\n result.slice(cursor - 4, cursor) === '2' ||\n result.slice(cursor - 1, cursor) === '2') &&\n Number(inputSymbol) > 3 &&\n cursor > 10)) {\n // eslint-disable-next-line no-param-reassign\n position = position + 1;\n cursor += 1;\n i--;\n continue;\n }\n }\n if (maskExpression[cursor] === \"m\" /* MaskExpression.MINUTE */ ||\n maskExpression[cursor] === \"s\" /* MaskExpression.SECOND */) {\n if (Number(inputSymbol) > 5) {\n // eslint-disable-next-line no-param-reassign\n position = !this.leadZeroDateTime ? position + 1 : position;\n cursor += 1;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n if (this.leadZeroDateTime) {\n result += '0';\n }\n continue;\n }\n }\n const daysCount = 31;\n const inputValueCursor = inputValue[cursor];\n const inputValueCursorPlusOne = inputValue[cursor + 1];\n const inputValueCursorPlusTwo = inputValue[cursor + 2];\n const inputValueCursorMinusOne = inputValue[cursor - 1];\n const inputValueCursorMinusTwo = inputValue[cursor - 2];\n const inputValueSliceMinusThreeMinusOne = inputValue.slice(cursor - 3, cursor - 1);\n const inputValueSliceMinusOnePlusOne = inputValue.slice(cursor - 1, cursor + 1);\n const inputValueSliceCursorPlusTwo = inputValue.slice(cursor, cursor + 2);\n const inputValueSliceMinusTwoCursor = inputValue.slice(cursor - 2, cursor);\n if (maskExpression[cursor] === \"d\" /* MaskExpression.DAY */) {\n const maskStartWithMonth = maskExpression.slice(0, 2) === \"M0\" /* MaskExpression.MONTHS */;\n const startWithMonthInput = maskExpression.slice(0, 2) === \"M0\" /* MaskExpression.MONTHS */ &&\n this.specialCharacters.includes(inputValueCursorMinusTwo);\n if ((Number(inputSymbol) > 3 && this.leadZeroDateTime) ||\n (!maskStartWithMonth &&\n (Number(inputValueSliceCursorPlusTwo) > daysCount ||\n Number(inputValueSliceMinusOnePlusOne) > daysCount ||\n this.specialCharacters.includes(inputValueCursorPlusOne))) ||\n (startWithMonthInput\n ? Number(inputValueSliceMinusOnePlusOne) > daysCount ||\n (!this.specialCharacters.includes(inputValueCursor) &&\n this.specialCharacters.includes(inputValueCursorPlusTwo)) ||\n this.specialCharacters.includes(inputValueCursor)\n : Number(inputValueSliceCursorPlusTwo) > daysCount ||\n this.specialCharacters.includes(inputValueCursorPlusOne))) {\n // eslint-disable-next-line no-param-reassign\n position = !this.leadZeroDateTime ? position + 1 : position;\n cursor += 1;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n if (this.leadZeroDateTime) {\n result += '0';\n }\n continue;\n }\n }\n if (maskExpression[cursor] === \"M\" /* MaskExpression.MONTH */) {\n const monthsCount = 12;\n // mask without day\n const withoutDays = cursor === 0 &&\n (Number(inputSymbol) > 2 ||\n Number(inputValueSliceCursorPlusTwo) > monthsCount ||\n (this.specialCharacters.includes(inputValueCursorPlusOne) &&\n !backspaced));\n // day<10 && month<12 for input\n const specialChart = maskExpression.slice(cursor + 2, cursor + 3);\n const day1monthInput = inputValueSliceMinusThreeMinusOne.includes(specialChart) &&\n maskExpression.includes('d0') &&\n ((this.specialCharacters.includes(inputValueCursorMinusTwo) &&\n Number(inputValueSliceMinusOnePlusOne) > monthsCount &&\n !this.specialCharacters.includes(inputValueCursor)) ||\n this.specialCharacters.includes(inputValueCursor));\n // month<12 && day<10 for input\n const day2monthInput = Number(inputValueSliceMinusThreeMinusOne) <= daysCount &&\n !this.specialCharacters.includes(inputValueSliceMinusThreeMinusOne) &&\n this.specialCharacters.includes(inputValueCursorMinusOne) &&\n (Number(inputValueSliceCursorPlusTwo) > monthsCount ||\n this.specialCharacters.includes(inputValueCursorPlusOne));\n // cursor === 5 && without days\n const day2monthInputDot = (Number(inputValueSliceCursorPlusTwo) > monthsCount && cursor === 5) ||\n (this.specialCharacters.includes(inputValueCursorPlusOne) &&\n cursor === 5);\n // // day<10 && month<12 for paste whole data\n const day1monthPaste = Number(inputValueSliceMinusThreeMinusOne) > daysCount &&\n !this.specialCharacters.includes(inputValueSliceMinusThreeMinusOne) &&\n !this.specialCharacters.includes(inputValueSliceMinusTwoCursor) &&\n Number(inputValueSliceMinusTwoCursor) > monthsCount &&\n maskExpression.includes('d0');\n // 10 monthsCount;\n if ((Number(inputSymbol) > 1 && this.leadZeroDateTime) ||\n withoutDays ||\n day1monthInput ||\n day2monthPaste ||\n day1monthPaste ||\n day2monthInput ||\n (day2monthInputDot && !this.leadZeroDateTime)) {\n // eslint-disable-next-line no-param-reassign\n position = !this.leadZeroDateTime ? position + 1 : position;\n cursor += 1;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n if (this.leadZeroDateTime) {\n result += '0';\n }\n continue;\n }\n }\n result += inputSymbol;\n cursor++;\n }\n else if (this.specialCharacters.includes(inputSymbol) &&\n maskExpression[cursor] === inputSymbol) {\n result += inputSymbol;\n cursor++;\n }\n else if (this.specialCharacters.indexOf(maskExpression[cursor] ?? \"\" /* MaskExpression.EMPTY_STRING */) !== -1) {\n result += maskExpression[cursor];\n cursor++;\n this._shiftStep(maskExpression, cursor, inputArray.length);\n i--;\n }\n else if (maskExpression[cursor] === \"9\" /* MaskExpression.NUMBER_NINE */ &&\n this.showMaskTyped) {\n this._shiftStep(maskExpression, cursor, inputArray.length);\n }\n else if (this.patterns[maskExpression[cursor] ?? \"\" /* MaskExpression.EMPTY_STRING */] &&\n this.patterns[maskExpression[cursor] ?? \"\" /* MaskExpression.EMPTY_STRING */]?.optional) {\n if (!!inputArray[cursor] &&\n maskExpression !== '099.099.099.099' &&\n maskExpression !== '000.000.000-00' &&\n maskExpression !== '00.000.000/0000-00' &&\n !maskExpression.match(/^9+\\.0+$/) &&\n !this.patterns[maskExpression[cursor] ?? \"\" /* MaskExpression.EMPTY_STRING */]\n ?.optional) {\n result += inputArray[cursor];\n }\n if (maskExpression.includes(\"9\" /* MaskExpression.NUMBER_NINE */ + \"*\" /* MaskExpression.SYMBOL_STAR */) &&\n maskExpression.includes(\"0\" /* MaskExpression.NUMBER_ZERO */ + \"*\" /* MaskExpression.SYMBOL_STAR */)) {\n cursor++;\n }\n cursor++;\n i--;\n }\n else if (this.maskExpression[cursor + 1] === \"*\" /* MaskExpression.SYMBOL_STAR */ &&\n this._findSpecialChar(this.maskExpression[cursor + 2] ?? \"\" /* MaskExpression.EMPTY_STRING */) &&\n this._findSpecialChar(inputSymbol) === this.maskExpression[cursor + 2] &&\n multi) {\n cursor += 3;\n result += inputSymbol;\n }\n else if (this.maskExpression[cursor + 1] === \"?\" /* MaskExpression.SYMBOL_QUESTION */ &&\n this._findSpecialChar(this.maskExpression[cursor + 2] ?? \"\" /* MaskExpression.EMPTY_STRING */) &&\n this._findSpecialChar(inputSymbol) === this.maskExpression[cursor + 2] &&\n multi) {\n cursor += 3;\n result += inputSymbol;\n }\n else if (this.showMaskTyped &&\n this.specialCharacters.indexOf(inputSymbol) < 0 &&\n inputSymbol !== this.placeHolderCharacter &&\n this.placeHolderCharacter.length === 1) {\n stepBack = true;\n }\n }\n }\n if (result.length + 1 === maskExpression.length &&\n this.specialCharacters.indexOf(maskExpression[maskExpression.length - 1] ?? \"\" /* MaskExpression.EMPTY_STRING */) !== -1) {\n result += maskExpression[maskExpression.length - 1];\n }\n let newPosition = position + 1;\n while (this._shift.has(newPosition)) {\n shift++;\n newPosition++;\n }\n let actualShift = justPasted && !maskExpression.startsWith(\"separator\" /* MaskExpression.SEPARATOR */)\n ? cursor\n : this._shift.has(position)\n ? shift\n : 0;\n if (stepBack) {\n actualShift--;\n }\n cb(actualShift, backspaceShift);\n if (shift < 0) {\n this._shift.clear();\n }\n let onlySpecial = false;\n if (backspaced) {\n onlySpecial = inputArray.every((char) => this.specialCharacters.includes(char));\n }\n let res = `${this.prefix}${onlySpecial ? \"\" /* MaskExpression.EMPTY_STRING */ : result}${this.showMaskTyped ? '' : this.suffix}`;\n if (result.length === 0) {\n res = !this.dropSpecialCharacters ? `${this.prefix}${result}` : `${result}`;\n }\n const isSpecialCharacterMaskFirstSymbol = inputValue.length === 1 &&\n this.specialCharacters.includes(maskExpression[0]) &&\n inputValue !== maskExpression[0];\n if (!this._checkSymbolMask(inputValue, maskExpression[1]) &&\n isSpecialCharacterMaskFirstSymbol) {\n return '';\n }\n if (result.includes(\"-\" /* MaskExpression.MINUS */) && this.prefix && this.allowNegativeNumbers) {\n if (backspaced && result === \"-\" /* MaskExpression.MINUS */) {\n return '';\n }\n res = `${\"-\" /* MaskExpression.MINUS */}${this.prefix}${result\n .split(\"-\" /* MaskExpression.MINUS */)\n .join(\"\" /* MaskExpression.EMPTY_STRING */)}${this.suffix}`;\n }\n return res;\n }\n _findDropSpecialChar(inputSymbol) {\n if (Array.isArray(this.dropSpecialCharacters)) {\n return this.dropSpecialCharacters.find((val) => val === inputSymbol);\n }\n return this._findSpecialChar(inputSymbol);\n }\n _findSpecialChar(inputSymbol) {\n return this.specialCharacters.find((val) => val === inputSymbol);\n }\n _checkSymbolMask(inputSymbol, maskSymbol) {\n this.patterns = this.customPattern ? this.customPattern : this.patterns;\n return ((this.patterns[maskSymbol]?.pattern &&\n this.patterns[maskSymbol]?.pattern.test(inputSymbol)) ??\n false);\n }\n _stripToDecimal(str) {\n return str\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .filter((i, idx) => {\n const isDecimalMarker = typeof this.decimalMarker === 'string'\n ? i === this.decimalMarker\n : // TODO (inepipenko) use utility type\n this.decimalMarker.includes(i);\n return (i.match('^-?\\\\d') ||\n i === this.thousandSeparator ||\n isDecimalMarker ||\n (i === \"-\" /* MaskExpression.MINUS */ && idx === 0 && this.allowNegativeNumbers));\n })\n .join(\"\" /* MaskExpression.EMPTY_STRING */);\n }\n _charToRegExpExpression(char) {\n // if (Array.isArray(char)) {\n // \treturn char.map((v) => ('[\\\\^$.|?*+()'.indexOf(v) >= 0 ? `\\\\${v}` : v)).join('|');\n // }\n if (char) {\n const charsToEscape = '[\\\\^$.|?*+()';\n return char === ' ' ? '\\\\s' : charsToEscape.indexOf(char) >= 0 ? `\\\\${char}` : char;\n }\n return char;\n }\n _shiftStep(maskExpression, cursor, inputLength) {\n const shiftStep = /[*?]/g.test(maskExpression.slice(0, cursor))\n ? inputLength\n : cursor;\n this._shift.add(shiftStep + this.prefix.length || 0);\n }\n _compareOrIncludes(value, comparedValue, excludedValue) {\n return Array.isArray(comparedValue)\n ? comparedValue.filter((v) => v !== excludedValue).includes(value)\n : value === comparedValue;\n }\n _validIP(valuesIP) {\n return !(valuesIP.length === 4 &&\n !valuesIP.some((value, index) => {\n if (valuesIP.length !== index + 1) {\n return value === \"\" /* MaskExpression.EMPTY_STRING */ || Number(value) > 255;\n }\n return value === \"\" /* MaskExpression.EMPTY_STRING */ || Number(value.substring(0, 3)) > 255;\n }));\n }\n _splitPercentZero(value) {\n if (value === \"-\" /* MaskExpression.MINUS */ && this.allowNegativeNumbers) {\n return value;\n }\n const decimalIndex = typeof this.decimalMarker === 'string'\n ? value.indexOf(this.decimalMarker)\n : value.indexOf(\".\" /* MaskExpression.DOT */);\n const emptyOrMinus = this.allowNegativeNumbers && value.includes(\"-\" /* MaskExpression.MINUS */) ? '-' : '';\n if (decimalIndex === -1) {\n const parsedValue = parseInt(emptyOrMinus ? value.slice(1, value.length) : value, 10);\n return isNaN(parsedValue)\n ? \"\" /* MaskExpression.EMPTY_STRING */\n : `${emptyOrMinus}${parsedValue}`;\n }\n else {\n const integerPart = parseInt(value.replace('-', '').substring(0, decimalIndex), 10);\n const decimalPart = value.substring(decimalIndex + 1);\n const integerString = isNaN(integerPart) ? '' : integerPart.toString();\n const decimal = typeof this.decimalMarker === 'string' ? this.decimalMarker : \".\" /* MaskExpression.DOT */;\n return integerString === \"\" /* MaskExpression.EMPTY_STRING */\n ? \"\" /* MaskExpression.EMPTY_STRING */\n : `${emptyOrMinus}${integerString}${decimal}${decimalPart}`;\n }\n }\n _findFirstNonZeroDigitIndex(inputString) {\n for (let i = 0; i < inputString.length; i++) {\n const char = inputString[i];\n if (char && char >= '1' && char <= '9') {\n return i;\n }\n }\n return -1;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskApplierService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskApplierService }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskApplierService, decorators: [{\n type: Injectable\n }] });\n\nclass NgxMaskService extends NgxMaskApplierService {\n constructor() {\n super(...arguments);\n this.isNumberValue = false;\n this.maskIsShown = '';\n this.selStart = null;\n this.selEnd = null;\n /**\n * Whether we are currently in writeValue function, in this case when applying the mask we don't want to trigger onChange function,\n * since writeValue should be a one way only process of writing the DOM value based on the Angular model value.\n */\n this.writingValue = false;\n this.maskChanged = false;\n this._maskExpressionArray = [];\n this.triggerOnMaskChange = false;\n this._previousValue = '';\n this._currentValue = '';\n this._emitValue = false;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.onChange = (_) => { };\n this._elementRef = inject(ElementRef, { optional: true });\n this.document = inject(DOCUMENT);\n this._config = inject(NGX_MASK_CONFIG);\n this._renderer = inject(Renderer2, { optional: true });\n }\n applyMask(inputValue, maskExpression, position = 0, justPasted = false, backspaced = false, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cb = () => { }) {\n if (!maskExpression) {\n return inputValue !== this.actualValue ? this.actualValue : inputValue;\n }\n this.maskIsShown = this.showMaskTyped\n ? this.showMaskInInput()\n : \"\" /* MaskExpression.EMPTY_STRING */;\n if (this.maskExpression === \"IP\" /* MaskExpression.IP */ && this.showMaskTyped) {\n this.maskIsShown = this.showMaskInInput(inputValue || \"#\" /* MaskExpression.HASH */);\n }\n if (this.maskExpression === \"CPF_CNPJ\" /* MaskExpression.CPF_CNPJ */ && this.showMaskTyped) {\n this.maskIsShown = this.showMaskInInput(inputValue || \"#\" /* MaskExpression.HASH */);\n }\n if (!inputValue && this.showMaskTyped) {\n this.formControlResult(this.prefix);\n return `${this.prefix}${this.maskIsShown}${this.suffix}`;\n }\n const getSymbol = !!inputValue && typeof this.selStart === 'number'\n ? inputValue[this.selStart] ?? \"\" /* MaskExpression.EMPTY_STRING */\n : \"\" /* MaskExpression.EMPTY_STRING */;\n let newInputValue = '';\n if (this.hiddenInput !== undefined && !this.writingValue) {\n let actualResult = inputValue && inputValue.length === 1\n ? inputValue.split(\"\" /* MaskExpression.EMPTY_STRING */)\n : this.actualValue.split(\"\" /* MaskExpression.EMPTY_STRING */);\n // eslint-disable @typescript-eslint/no-unused-expressions\n if (typeof this.selStart === 'object' && typeof this.selEnd === 'object') {\n this.selStart = Number(this.selStart);\n this.selEnd = Number(this.selEnd);\n }\n else {\n inputValue !== \"\" /* MaskExpression.EMPTY_STRING */ && actualResult.length\n ? typeof this.selStart === 'number' && typeof this.selEnd === 'number'\n ? inputValue.length > actualResult.length\n ? actualResult.splice(this.selStart, 0, getSymbol)\n : inputValue.length < actualResult.length\n ? actualResult.length - inputValue.length === 1\n ? backspaced\n ? actualResult.splice(this.selStart - 1, 1)\n : actualResult.splice(inputValue.length - 1, 1)\n : actualResult.splice(this.selStart, this.selEnd - this.selStart)\n : null\n : null\n : (actualResult = []);\n }\n if (this.showMaskTyped) {\n if (!this.hiddenInput) {\n // eslint-disable-next-line no-param-reassign\n inputValue = this.removeMask(inputValue);\n }\n }\n // eslint-enable @typescript-eslint/no-unused-expressions\n newInputValue =\n this.actualValue.length && actualResult.length <= inputValue.length\n ? this.shiftTypedSymbols(actualResult.join(\"\" /* MaskExpression.EMPTY_STRING */))\n : inputValue;\n }\n if (justPasted && (this.hiddenInput || !this.hiddenInput)) {\n newInputValue = inputValue;\n }\n if (backspaced &&\n this.specialCharacters.indexOf(this.maskExpression[position] ?? \"\" /* MaskExpression.EMPTY_STRING */) !== -1 &&\n this.showMaskTyped &&\n !this.prefix) {\n newInputValue = this._currentValue;\n }\n if (this.deletedSpecialCharacter && position) {\n if (this.specialCharacters.includes(this.actualValue.slice(position, position + 1))) {\n // eslint-disable-next-line no-param-reassign\n position = position + 1;\n }\n else if (maskExpression.slice(position - 1, position + 1) !== \"M0\" /* MaskExpression.MONTHS */) {\n // eslint-disable-next-line no-param-reassign\n position = position - 2;\n }\n this.deletedSpecialCharacter = false;\n }\n if (this.showMaskTyped &&\n this.placeHolderCharacter.length === 1 &&\n !this.leadZeroDateTime) {\n // eslint-disable-next-line no-param-reassign\n inputValue = this.removeMask(inputValue);\n }\n if (this.maskChanged) {\n newInputValue = inputValue;\n }\n else {\n newInputValue =\n Boolean(newInputValue) && newInputValue.length ? newInputValue : inputValue;\n }\n if (this.showMaskTyped &&\n this.keepCharacterPositions &&\n this.actualValue &&\n !justPasted &&\n !this.writingValue) {\n const value = this.dropSpecialCharacters\n ? this.removeMask(this.actualValue)\n : this.actualValue;\n this.formControlResult(value);\n return this.actualValue\n ? this.actualValue\n : `${this.prefix}${this.maskIsShown}${this.suffix}`;\n }\n const result = super.applyMask(newInputValue, maskExpression, position, justPasted, backspaced, cb);\n this.actualValue = this.getActualValue(result);\n // handle some separator implications:\n // a.) adjust decimalMarker default (. -> ,) if thousandSeparator is a dot\n if (this.thousandSeparator === \".\" /* MaskExpression.DOT */ &&\n this.decimalMarker === \".\" /* MaskExpression.DOT */) {\n this.decimalMarker = \",\" /* MaskExpression.COMMA */;\n }\n // b) remove decimal marker from list of special characters to mask\n if (this.maskExpression.startsWith(\"separator\" /* MaskExpression.SEPARATOR */) &&\n this.dropSpecialCharacters === true) {\n this.specialCharacters = this.specialCharacters.filter((item) => !this._compareOrIncludes(item, this.decimalMarker, this.thousandSeparator) //item !== this.decimalMarker, // !\n );\n }\n if (result || result === '') {\n this._previousValue = this._currentValue;\n this._currentValue = result;\n this._emitValue =\n this._previousValue !== this._currentValue ||\n this.maskChanged ||\n (this._previousValue === this._currentValue && justPasted);\n }\n this._emitValue\n ? this.writingValue && this.triggerOnMaskChange\n ? requestAnimationFrame(() => this.formControlResult(result))\n : this.formControlResult(result)\n : '';\n if (!this.showMaskTyped || (this.showMaskTyped && this.hiddenInput)) {\n if (this.hiddenInput) {\n if (backspaced) {\n return this.hideInput(result, this.maskExpression);\n }\n return `${this.hideInput(result, this.maskExpression)}${this.maskIsShown.slice(result.length)}`;\n }\n return result;\n }\n const resLen = result.length;\n const prefNmask = `${this.prefix}${this.maskIsShown}${this.suffix}`;\n if (this.maskExpression.includes(\"H\" /* MaskExpression.HOURS */)) {\n const countSkipedSymbol = this._numberSkipedSymbols(result);\n return `${result}${prefNmask.slice(resLen + countSkipedSymbol)}`;\n }\n else if (this.maskExpression === \"IP\" /* MaskExpression.IP */ ||\n this.maskExpression === \"CPF_CNPJ\" /* MaskExpression.CPF_CNPJ */) {\n return `${result}${prefNmask}`;\n }\n return `${result}${prefNmask.slice(resLen)}`;\n }\n // get the number of characters that were shifted\n _numberSkipedSymbols(value) {\n const regex = /(^|\\D)(\\d\\D)/g;\n let match = regex.exec(value);\n let countSkipedSymbol = 0;\n while (match != null) {\n countSkipedSymbol += 1;\n match = regex.exec(value);\n }\n return countSkipedSymbol;\n }\n applyValueChanges(position, justPasted, backspaced, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cb = () => { }) {\n const formElement = this._elementRef?.nativeElement;\n if (!formElement) {\n return;\n }\n formElement.value = this.applyMask(formElement.value, this.maskExpression, position, justPasted, backspaced, cb);\n if (formElement === this._getActiveElement()) {\n return;\n }\n this.clearIfNotMatchFn();\n }\n hideInput(inputValue, maskExpression) {\n return inputValue\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .map((curr, index) => {\n if (this.patterns &&\n this.patterns[maskExpression[index] ?? \"\" /* MaskExpression.EMPTY_STRING */] &&\n this.patterns[maskExpression[index] ?? \"\" /* MaskExpression.EMPTY_STRING */]?.symbol) {\n return this.patterns[maskExpression[index] ?? \"\" /* MaskExpression.EMPTY_STRING */]\n ?.symbol;\n }\n return curr;\n })\n .join(\"\" /* MaskExpression.EMPTY_STRING */);\n }\n // this function is not necessary, it checks result against maskExpression\n getActualValue(res) {\n const compare = res\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .filter((symbol, i) => {\n const maskChar = this.maskExpression[i] ?? \"\" /* MaskExpression.EMPTY_STRING */;\n return (this._checkSymbolMask(symbol, maskChar) ||\n (this.specialCharacters.includes(maskChar) && symbol === maskChar));\n });\n if (compare.join(\"\" /* MaskExpression.EMPTY_STRING */) === res) {\n return compare.join(\"\" /* MaskExpression.EMPTY_STRING */);\n }\n return res;\n }\n shiftTypedSymbols(inputValue) {\n let symbolToReplace = '';\n const newInputValue = (inputValue &&\n inputValue\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .map((currSymbol, index) => {\n if (this.specialCharacters.includes(inputValue[index + 1] ?? \"\" /* MaskExpression.EMPTY_STRING */) &&\n inputValue[index + 1] !== this.maskExpression[index + 1]) {\n symbolToReplace = currSymbol;\n return inputValue[index + 1];\n }\n if (symbolToReplace.length) {\n const replaceSymbol = symbolToReplace;\n symbolToReplace = \"\" /* MaskExpression.EMPTY_STRING */;\n return replaceSymbol;\n }\n return currSymbol;\n })) ||\n [];\n return newInputValue.join(\"\" /* MaskExpression.EMPTY_STRING */);\n }\n /**\n * Convert number value to string\n * 3.1415 -> '3.1415'\n * 1e-7 -> '0.0000001'\n */\n numberToString(value) {\n if ((!value && value !== 0) ||\n (this.maskExpression.startsWith(\"separator\" /* MaskExpression.SEPARATOR */) &&\n (this.leadZero || !this.dropSpecialCharacters)) ||\n (this.maskExpression.startsWith(\"separator\" /* MaskExpression.SEPARATOR */) &&\n this.separatorLimit.length > 14 &&\n String(value).length > 14)) {\n return String(value);\n }\n return Number(value)\n .toLocaleString('fullwide', {\n useGrouping: false,\n maximumFractionDigits: 20,\n })\n .replace(`/${\"-\" /* MaskExpression.MINUS */}/`, \"-\" /* MaskExpression.MINUS */);\n }\n showMaskInInput(inputVal) {\n if (this.showMaskTyped && !!this.shownMaskExpression) {\n if (this.maskExpression.length !== this.shownMaskExpression.length) {\n throw new Error('Mask expression must match mask placeholder length');\n }\n else {\n return this.shownMaskExpression;\n }\n }\n else if (this.showMaskTyped) {\n if (inputVal) {\n if (this.maskExpression === \"IP\" /* MaskExpression.IP */) {\n return this._checkForIp(inputVal);\n }\n if (this.maskExpression === \"CPF_CNPJ\" /* MaskExpression.CPF_CNPJ */) {\n return this._checkForCpfCnpj(inputVal);\n }\n }\n if (this.placeHolderCharacter.length === this.maskExpression.length) {\n return this.placeHolderCharacter;\n }\n return this.maskExpression.replace(/\\w/g, this.placeHolderCharacter);\n }\n return '';\n }\n clearIfNotMatchFn() {\n const formElement = this._elementRef?.nativeElement;\n if (!formElement) {\n return;\n }\n if (this.clearIfNotMatch &&\n this.prefix.length + this.maskExpression.length + this.suffix.length !==\n formElement.value.replace(this.placeHolderCharacter, \"\" /* MaskExpression.EMPTY_STRING */)\n .length) {\n this.formElementProperty = ['value', \"\" /* MaskExpression.EMPTY_STRING */];\n this.applyMask('', this.maskExpression);\n }\n }\n set formElementProperty([name, value]) {\n if (!this._renderer || !this._elementRef) {\n return;\n }\n //[TODO]: andriikamaldinov1 find better solution\n Promise.resolve().then(() => this._renderer?.setProperty(this._elementRef?.nativeElement, name, value));\n }\n checkDropSpecialCharAmount(mask) {\n const chars = mask\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .filter((item) => this._findDropSpecialChar(item));\n return chars.length;\n }\n removeMask(inputValue) {\n return this._removeMask(this._removeSuffix(this._removePrefix(inputValue)), this.specialCharacters.concat('_').concat(this.placeHolderCharacter));\n }\n _checkForIp(inputVal) {\n if (inputVal === \"#\" /* MaskExpression.HASH */) {\n return `${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}`;\n }\n const arr = [];\n for (let i = 0; i < inputVal.length; i++) {\n const value = inputVal[i] ?? \"\" /* MaskExpression.EMPTY_STRING */;\n if (!value) {\n continue;\n }\n if (value.match('\\\\d')) {\n arr.push(value);\n }\n }\n if (arr.length <= 3) {\n return `${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}`;\n }\n if (arr.length > 3 && arr.length <= 6) {\n return `${this.placeHolderCharacter}.${this.placeHolderCharacter}`;\n }\n if (arr.length > 6 && arr.length <= 9) {\n return this.placeHolderCharacter;\n }\n if (arr.length > 9 && arr.length <= 12) {\n return '';\n }\n return '';\n }\n _checkForCpfCnpj(inputVal) {\n const cpf = `${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +\n `.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +\n `.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +\n `-${this.placeHolderCharacter}${this.placeHolderCharacter}`;\n const cnpj = `${this.placeHolderCharacter}${this.placeHolderCharacter}` +\n `.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +\n `.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +\n `/${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +\n `-${this.placeHolderCharacter}${this.placeHolderCharacter}`;\n if (inputVal === \"#\" /* MaskExpression.HASH */) {\n return cpf;\n }\n const arr = [];\n for (let i = 0; i < inputVal.length; i++) {\n const value = inputVal[i] ?? \"\" /* MaskExpression.EMPTY_STRING */;\n if (!value) {\n continue;\n }\n if (value.match('\\\\d')) {\n arr.push(value);\n }\n }\n if (arr.length <= 3) {\n return cpf.slice(arr.length, cpf.length);\n }\n if (arr.length > 3 && arr.length <= 6) {\n return cpf.slice(arr.length + 1, cpf.length);\n }\n if (arr.length > 6 && arr.length <= 9) {\n return cpf.slice(arr.length + 2, cpf.length);\n }\n if (arr.length > 9 && arr.length < 11) {\n return cpf.slice(arr.length + 3, cpf.length);\n }\n if (arr.length === 11) {\n return '';\n }\n if (arr.length === 12) {\n if (inputVal.length === 17) {\n return cnpj.slice(16, cnpj.length);\n }\n return cnpj.slice(15, cnpj.length);\n }\n if (arr.length > 12 && arr.length <= 14) {\n return cnpj.slice(arr.length + 4, cnpj.length);\n }\n return '';\n }\n /**\n * Recursively determine the current active element by navigating the Shadow DOM until the Active Element is found.\n */\n _getActiveElement(document = this.document) {\n const shadowRootEl = document?.activeElement?.shadowRoot;\n if (!shadowRootEl?.activeElement) {\n return document.activeElement;\n }\n else {\n return this._getActiveElement(shadowRootEl);\n }\n }\n /**\n * Propogates the input value back to the Angular model by triggering the onChange function. It won't do this if writingValue\n * is true. If that is true it means we are currently in the writeValue function, which is supposed to only update the actual\n * DOM element based on the Angular model value. It should be a one way process, i.e. writeValue should not be modifying the Angular\n * model value too. Therefore, we don't trigger onChange in this scenario.\n * @param inputValue the current form input value\n */\n formControlResult(inputValue) {\n if (this.writingValue || (!this.triggerOnMaskChange && this.maskChanged)) {\n this.triggerOnMaskChange && this.maskChanged\n ? this.onChange(this.outputTransformFn(this._toNumber(this._checkSymbols(this._removeSuffix(this._removePrefix(inputValue))))))\n : '';\n this.maskChanged = false;\n return;\n }\n if (Array.isArray(this.dropSpecialCharacters)) {\n this.onChange(this.outputTransformFn(this._toNumber(this._checkSymbols(this._removeMask(this._removeSuffix(this._removePrefix(inputValue)), this.dropSpecialCharacters)))));\n }\n else if (this.dropSpecialCharacters ||\n (!this.dropSpecialCharacters && this.prefix === inputValue)) {\n this.onChange(this.outputTransformFn(this._toNumber(this._checkSymbols(this._removeSuffix(this._removePrefix(inputValue))))));\n }\n else {\n this.onChange(this.outputTransformFn(this._toNumber(inputValue)));\n }\n }\n _toNumber(value) {\n if (!this.isNumberValue || value === \"\" /* MaskExpression.EMPTY_STRING */) {\n return value;\n }\n if (this.maskExpression.startsWith(\"separator\" /* MaskExpression.SEPARATOR */) &&\n (this.leadZero || !this.dropSpecialCharacters)) {\n return value;\n }\n if (String(value).length > 16 && this.separatorLimit.length > 14) {\n return String(value);\n }\n const num = Number(value);\n if (this.maskExpression.startsWith(\"separator\" /* MaskExpression.SEPARATOR */) && Number.isNaN(num)) {\n const val = String(value).replace(',', '.');\n return Number(val);\n }\n return Number.isNaN(num) ? value : num;\n }\n _removeMask(value, specialCharactersForRemove) {\n if (this.maskExpression.startsWith(\"percent\" /* MaskExpression.PERCENT */) &&\n value.includes(\".\" /* MaskExpression.DOT */)) {\n return value;\n }\n return value\n ? value.replace(this._regExpForRemove(specialCharactersForRemove), \"\" /* MaskExpression.EMPTY_STRING */)\n : value;\n }\n _removePrefix(value) {\n if (!this.prefix) {\n return value;\n }\n return value ? value.replace(this.prefix, \"\" /* MaskExpression.EMPTY_STRING */) : value;\n }\n _removeSuffix(value) {\n if (!this.suffix) {\n return value;\n }\n return value ? value.replace(this.suffix, \"\" /* MaskExpression.EMPTY_STRING */) : value;\n }\n _retrieveSeparatorValue(result) {\n let specialCharacters = Array.isArray(this.dropSpecialCharacters)\n ? this.specialCharacters.filter((v) => {\n return this.dropSpecialCharacters.includes(v);\n })\n : this.specialCharacters;\n if (!this.deletedSpecialCharacter &&\n this._checkPatternForSpace() &&\n result.includes(\" \" /* MaskExpression.WHITE_SPACE */) &&\n this.maskExpression.includes(\"*\" /* MaskExpression.SYMBOL_STAR */)) {\n specialCharacters = specialCharacters.filter((char) => char !== \" \" /* MaskExpression.WHITE_SPACE */);\n }\n return this._removeMask(result, specialCharacters);\n }\n _regExpForRemove(specialCharactersForRemove) {\n return new RegExp(specialCharactersForRemove.map((item) => `\\\\${item}`).join('|'), 'gi');\n }\n _replaceDecimalMarkerToDot(value) {\n const markers = Array.isArray(this.decimalMarker)\n ? this.decimalMarker\n : [this.decimalMarker];\n return value.replace(this._regExpForRemove(markers), \".\" /* MaskExpression.DOT */);\n }\n _checkSymbols(result) {\n if (result === \"\" /* MaskExpression.EMPTY_STRING */) {\n return result;\n }\n if (this.maskExpression.startsWith(\"percent\" /* MaskExpression.PERCENT */) &&\n this.decimalMarker === \",\" /* MaskExpression.COMMA */) {\n // eslint-disable-next-line no-param-reassign\n result = result.replace(\",\" /* MaskExpression.COMMA */, \".\" /* MaskExpression.DOT */);\n }\n const separatorPrecision = this._retrieveSeparatorPrecision(this.maskExpression);\n const separatorValue = this._replaceDecimalMarkerToDot(this._retrieveSeparatorValue(result));\n if (!this.isNumberValue) {\n return separatorValue;\n }\n if (separatorPrecision) {\n if (result === this.decimalMarker) {\n return null;\n }\n if (this.separatorLimit.length > 14) {\n return String(separatorValue);\n }\n return this._checkPrecision(this.maskExpression, separatorValue);\n }\n else {\n return separatorValue;\n }\n }\n _checkPatternForSpace() {\n for (const key in this.patterns) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.patterns[key] && this.patterns[key]?.hasOwnProperty('pattern')) {\n const patternString = this.patterns[key]?.pattern.toString();\n const pattern = this.patterns[key]?.pattern;\n if (patternString?.includes(\" \" /* MaskExpression.WHITE_SPACE */) &&\n pattern?.test(this.maskExpression)) {\n return true;\n }\n }\n }\n return false;\n }\n // TODO should think about helpers or separting decimal precision to own property\n _retrieveSeparatorPrecision(maskExpretion) {\n const matcher = maskExpretion.match(new RegExp(`^separator\\\\.([^d]*)`));\n return matcher ? Number(matcher[1]) : null;\n }\n _checkPrecision(separatorExpression, separatorValue) {\n const separatorPrecision = separatorExpression.slice(10, 11);\n if (separatorExpression.indexOf('2') > 0 ||\n (this.leadZero && Number(separatorPrecision) > 0)) {\n if (this.decimalMarker === \",\" /* MaskExpression.COMMA */ && this.leadZero) {\n // eslint-disable-next-line no-param-reassign\n separatorValue = separatorValue.replace(',', '.');\n }\n return this.leadZero\n ? Number(separatorValue).toFixed(Number(separatorPrecision))\n : Number(separatorValue).toFixed(2);\n }\n return this.numberToString(separatorValue);\n }\n _repeatPatternSymbols(maskExp) {\n return ((maskExp.match(/{[0-9]+}/) &&\n maskExp\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .reduce((accum, currVal, index) => {\n this._start =\n currVal === \"{\" /* MaskExpression.CURLY_BRACKETS_LEFT */ ? index : this._start;\n if (currVal !== \"}\" /* MaskExpression.CURLY_BRACKETS_RIGHT */) {\n return this._findSpecialChar(currVal) ? accum + currVal : accum;\n }\n this._end = index;\n const repeatNumber = Number(maskExp.slice(this._start + 1, this._end));\n const replaceWith = new Array(repeatNumber + 1).join(maskExp[this._start - 1]);\n if (maskExp.slice(0, this._start).length > 1 &&\n maskExp.includes(\"S\" /* MaskExpression.LETTER_S */)) {\n const symbols = maskExp.slice(0, this._start - 1);\n return symbols.includes(\"{\" /* MaskExpression.CURLY_BRACKETS_LEFT */)\n ? accum + replaceWith\n : symbols + accum + replaceWith;\n }\n else {\n return accum + replaceWith;\n }\n }, '')) ||\n maskExp);\n }\n currentLocaleDecimalMarker() {\n return (1.1).toLocaleString().substring(1, 2);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskService }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskService, decorators: [{\n type: Injectable\n }] });\n\n/**\n * @internal\n */\nfunction _configFactory() {\n const initConfig = inject(INITIAL_CONFIG);\n const configValue = inject(NEW_CONFIG);\n return configValue instanceof Function\n ? { ...initConfig, ...configValue() }\n : { ...initConfig, ...configValue };\n}\nfunction provideNgxMask(configValue) {\n return [\n {\n provide: NEW_CONFIG,\n useValue: configValue,\n },\n {\n provide: INITIAL_CONFIG,\n useValue: initialConfig,\n },\n {\n provide: NGX_MASK_CONFIG,\n useFactory: _configFactory,\n },\n NgxMaskService,\n ];\n}\nfunction provideEnvironmentNgxMask(configValue) {\n return makeEnvironmentProviders(provideNgxMask(configValue));\n}\n\nclass NgxMaskDirective {\n constructor() {\n this.maskExpression = '';\n this.specialCharacters = [];\n this.patterns = {};\n this.prefix = '';\n this.suffix = '';\n this.thousandSeparator = ' ';\n this.decimalMarker = '.';\n this.dropSpecialCharacters = null;\n this.hiddenInput = null;\n this.showMaskTyped = null;\n this.placeHolderCharacter = null;\n this.shownMaskExpression = null;\n this.showTemplate = null;\n this.clearIfNotMatch = null;\n this.validation = null;\n this.separatorLimit = null;\n this.allowNegativeNumbers = null;\n this.leadZeroDateTime = null;\n this.leadZero = null;\n this.triggerOnMaskChange = null;\n this.apm = null;\n this.inputTransformFn = null;\n this.outputTransformFn = null;\n this.keepCharacterPositions = null;\n this.maskFilled = new EventEmitter();\n this._maskValue = '';\n this._position = null;\n this._maskExpressionArray = [];\n this._allowFewMaskChangeMask = false;\n this._justPasted = false;\n this._isFocused = false;\n /**For IME composition event */\n this._isComposing = false;\n this.document = inject(DOCUMENT);\n this._maskService = inject(NgxMaskService, { self: true });\n this._config = inject(NGX_MASK_CONFIG);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.onChange = (_) => { };\n this.onTouch = () => { };\n }\n ngOnChanges(changes) {\n const { maskExpression, specialCharacters, patterns, prefix, suffix, thousandSeparator, decimalMarker, dropSpecialCharacters, hiddenInput, showMaskTyped, placeHolderCharacter, shownMaskExpression, showTemplate, clearIfNotMatch, validation, separatorLimit, allowNegativeNumbers, leadZeroDateTime, leadZero, triggerOnMaskChange, apm, inputTransformFn, outputTransformFn, keepCharacterPositions, } = changes;\n if (maskExpression) {\n if (maskExpression.currentValue !== maskExpression.previousValue &&\n !maskExpression.firstChange) {\n this._maskService.maskChanged = true;\n }\n if (maskExpression.currentValue &&\n maskExpression.currentValue.split(\"||\" /* MaskExpression.OR */).length > 1) {\n this._maskExpressionArray = maskExpression.currentValue\n .split(\"||\" /* MaskExpression.OR */)\n .sort((a, b) => {\n return a.length - b.length;\n });\n this._setMask();\n }\n else {\n this._maskExpressionArray = [];\n this._maskValue = maskExpression.currentValue || \"\" /* MaskExpression.EMPTY_STRING */;\n this._maskService.maskExpression = this._maskValue;\n }\n }\n if (specialCharacters) {\n if (!specialCharacters.currentValue || !Array.isArray(specialCharacters.currentValue)) {\n return;\n }\n else {\n this._maskService.specialCharacters = specialCharacters.currentValue || [];\n }\n }\n if (allowNegativeNumbers) {\n this._maskService.allowNegativeNumbers = allowNegativeNumbers.currentValue;\n if (this._maskService.allowNegativeNumbers) {\n this._maskService.specialCharacters = this._maskService.specialCharacters.filter((c) => c !== \"-\" /* MaskExpression.MINUS */);\n }\n }\n // Only overwrite the mask available patterns if a pattern has actually been passed in\n if (patterns && patterns.currentValue) {\n this._maskService.patterns = patterns.currentValue;\n }\n if (apm && apm.currentValue) {\n this._maskService.apm = apm.currentValue;\n }\n if (prefix) {\n this._maskService.prefix = prefix.currentValue;\n }\n if (suffix) {\n this._maskService.suffix = suffix.currentValue;\n }\n if (thousandSeparator) {\n this._maskService.thousandSeparator = thousandSeparator.currentValue;\n }\n if (decimalMarker) {\n this._maskService.decimalMarker = decimalMarker.currentValue;\n }\n if (dropSpecialCharacters) {\n this._maskService.dropSpecialCharacters = dropSpecialCharacters.currentValue;\n }\n if (hiddenInput) {\n this._maskService.hiddenInput = hiddenInput.currentValue;\n }\n if (showMaskTyped) {\n this._maskService.showMaskTyped = showMaskTyped.currentValue;\n if (showMaskTyped.previousValue === false &&\n showMaskTyped.currentValue === true &&\n this._isFocused) {\n requestAnimationFrame(() => {\n this._maskService._elementRef?.nativeElement.click();\n });\n }\n }\n if (placeHolderCharacter) {\n this._maskService.placeHolderCharacter = placeHolderCharacter.currentValue;\n }\n if (shownMaskExpression) {\n this._maskService.shownMaskExpression = shownMaskExpression.currentValue;\n }\n if (showTemplate) {\n this._maskService.showTemplate = showTemplate.currentValue;\n }\n if (clearIfNotMatch) {\n this._maskService.clearIfNotMatch = clearIfNotMatch.currentValue;\n }\n if (validation) {\n this._maskService.validation = validation.currentValue;\n }\n if (separatorLimit) {\n this._maskService.separatorLimit = separatorLimit.currentValue;\n }\n if (leadZeroDateTime) {\n this._maskService.leadZeroDateTime = leadZeroDateTime.currentValue;\n }\n if (leadZero) {\n this._maskService.leadZero = leadZero.currentValue;\n }\n if (triggerOnMaskChange) {\n this._maskService.triggerOnMaskChange = triggerOnMaskChange.currentValue;\n }\n if (inputTransformFn) {\n this._maskService.inputTransformFn = inputTransformFn.currentValue;\n }\n if (outputTransformFn) {\n this._maskService.outputTransformFn = outputTransformFn.currentValue;\n }\n if (keepCharacterPositions) {\n this._maskService.keepCharacterPositions = keepCharacterPositions.currentValue;\n }\n this._applyMask();\n }\n validate({ value }) {\n if (!this._maskService.validation || !this._maskValue) {\n return null;\n }\n if (this._maskService.ipError) {\n return this._createValidationError(value);\n }\n if (this._maskService.cpfCnpjError) {\n return this._createValidationError(value);\n }\n if (this._maskValue.startsWith(\"separator\" /* MaskExpression.SEPARATOR */)) {\n return null;\n }\n if (withoutValidation.includes(this._maskValue)) {\n return null;\n }\n if (this._maskService.clearIfNotMatch) {\n return null;\n }\n if (timeMasks.includes(this._maskValue)) {\n return this._validateTime(value);\n }\n if (value && value.toString().length >= 1) {\n let counterOfOpt = 0;\n if (this._maskValue.includes(\"{\" /* MaskExpression.CURLY_BRACKETS_LEFT */) &&\n this._maskValue.includes(\"}\" /* MaskExpression.CURLY_BRACKETS_RIGHT */)) {\n const lengthInsideCurlyBrackets = this._maskValue.slice(this._maskValue.indexOf(\"{\" /* MaskExpression.CURLY_BRACKETS_LEFT */) + 1, this._maskValue.indexOf(\"}\" /* MaskExpression.CURLY_BRACKETS_RIGHT */));\n return lengthInsideCurlyBrackets === String(value.length)\n ? null\n : this._createValidationError(value);\n }\n if (this._maskValue.startsWith(\"percent\" /* MaskExpression.PERCENT */)) {\n return null;\n }\n for (const key in this._maskService.patterns) {\n if (this._maskService.patterns[key]?.optional) {\n if (this._maskValue.indexOf(key) !== this._maskValue.lastIndexOf(key)) {\n const opt = this._maskValue\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .filter((i) => i === key)\n .join(\"\" /* MaskExpression.EMPTY_STRING */);\n counterOfOpt += opt.length;\n }\n else if (this._maskValue.indexOf(key) !== -1) {\n counterOfOpt++;\n }\n if (this._maskValue.indexOf(key) !== -1 &&\n value.toString().length >= this._maskValue.indexOf(key)) {\n return null;\n }\n if (counterOfOpt === this._maskValue.length) {\n return null;\n }\n }\n }\n if ((this._maskValue.indexOf(\"*\" /* MaskExpression.SYMBOL_STAR */) > 1 &&\n value.toString().length <\n this._maskValue.indexOf(\"*\" /* MaskExpression.SYMBOL_STAR */)) ||\n (this._maskValue.indexOf(\"?\" /* MaskExpression.SYMBOL_QUESTION */) > 1 &&\n value.toString().length <\n this._maskValue.indexOf(\"?\" /* MaskExpression.SYMBOL_QUESTION */))) {\n return this._createValidationError(value);\n }\n if (this._maskValue.indexOf(\"*\" /* MaskExpression.SYMBOL_STAR */) === -1 ||\n this._maskValue.indexOf(\"?\" /* MaskExpression.SYMBOL_QUESTION */) === -1) {\n // eslint-disable-next-line no-param-reassign\n value = typeof value === 'number' ? String(value) : value;\n const array = this._maskValue.split('*');\n const length = this._maskService.dropSpecialCharacters\n ? this._maskValue.length -\n this._maskService.checkDropSpecialCharAmount(this._maskValue) -\n counterOfOpt\n : this.prefix\n ? this._maskValue.length + this.prefix.length - counterOfOpt\n : this._maskValue.length - counterOfOpt;\n if (array.length === 1) {\n if (value.toString().length < length) {\n return this._createValidationError(value);\n }\n }\n if (array.length > 1) {\n const lastIndexArray = array[array.length - 1];\n if (lastIndexArray &&\n this._maskService.specialCharacters.includes(lastIndexArray[0]) &&\n String(value).includes(lastIndexArray[0] ?? '') &&\n !this.dropSpecialCharacters) {\n const special = value.split(lastIndexArray[0]);\n return special[special.length - 1].length === lastIndexArray.length - 1\n ? null\n : this._createValidationError(value);\n }\n else if (((lastIndexArray &&\n !this._maskService.specialCharacters.includes(lastIndexArray[0])) ||\n !lastIndexArray ||\n this._maskService.dropSpecialCharacters) &&\n value.length >= length - 1) {\n return null;\n }\n else {\n return this._createValidationError(value);\n }\n }\n }\n if (this._maskValue.indexOf(\"*\" /* MaskExpression.SYMBOL_STAR */) === 1 ||\n this._maskValue.indexOf(\"?\" /* MaskExpression.SYMBOL_QUESTION */) === 1) {\n return null;\n }\n }\n if (value) {\n this.maskFilled.emit();\n return null;\n }\n return null;\n }\n onPaste() {\n this._justPasted = true;\n }\n onFocus() {\n this._isFocused = true;\n }\n onModelChange(value) {\n // on form reset we need to update the actualValue\n if ((value === \"\" /* MaskExpression.EMPTY_STRING */ || value === null || value === undefined) &&\n this._maskService.actualValue) {\n this._maskService.actualValue = this._maskService.getActualValue(\"\" /* MaskExpression.EMPTY_STRING */);\n }\n }\n onInput(e) {\n // If IME is composing text, we wait for the composed text.\n if (this._isComposing)\n return;\n const el = e.target;\n const transformedValue = this._maskService.inputTransformFn(el.value);\n if (el.type !== 'number') {\n if (typeof transformedValue === 'string' || typeof transformedValue === 'number') {\n el.value = transformedValue.toString();\n this._inputValue = el.value;\n this._setMask();\n if (!this._maskValue) {\n this.onChange(el.value);\n return;\n }\n let position = el.selectionStart === 1\n ? el.selectionStart + this._maskService.prefix.length\n : el.selectionStart;\n if (this.showMaskTyped &&\n this.keepCharacterPositions &&\n this._maskService.placeHolderCharacter.length === 1) {\n const inputSymbol = el.value.slice(position - 1, position);\n const prefixLength = this.prefix.length;\n const checkSymbols = this._maskService._checkSymbolMask(inputSymbol, this._maskService.maskExpression[position - 1 - prefixLength] ??\n \"\" /* MaskExpression.EMPTY_STRING */);\n const checkSpecialCharacter = this._maskService._checkSymbolMask(inputSymbol, this._maskService.maskExpression[position + 1 - prefixLength] ??\n \"\" /* MaskExpression.EMPTY_STRING */);\n const selectRangeBackspace = this._maskService.selStart === this._maskService.selEnd;\n const selStart = Number(this._maskService.selStart) - prefixLength;\n const selEnd = Number(this._maskService.selEnd) - prefixLength;\n if (this._code === \"Backspace\" /* MaskExpression.BACKSPACE */) {\n if (!selectRangeBackspace) {\n if (this._maskService.selStart === prefixLength) {\n this._maskService.actualValue = `${this.prefix}${this._maskService.maskIsShown.slice(0, selEnd)}${this._inputValue.split(this.prefix).join('')}`;\n }\n else if (this._maskService.selStart ===\n this._maskService.maskIsShown.length + prefixLength) {\n this._maskService.actualValue = `${this._inputValue}${this._maskService.maskIsShown.slice(selStart, selEnd)}`;\n }\n else {\n this._maskService.actualValue = `${this.prefix}${this._inputValue\n .split(this.prefix)\n .join('')\n .slice(0, selStart)}${this._maskService.maskIsShown.slice(selStart, selEnd)}${this._maskService.actualValue.slice(selEnd + prefixLength, this._maskService.maskIsShown.length + prefixLength)}${this.suffix}`;\n }\n }\n else if (!this._maskService.specialCharacters.includes(this._maskService.maskExpression.slice(position - this.prefix.length, position + 1 - this.prefix.length)) &&\n selectRangeBackspace) {\n if (selStart === 1 && this.prefix) {\n this._maskService.actualValue = `${this.prefix}${this._maskService.placeHolderCharacter}${el.value\n .split(this.prefix)\n .join('')\n .split(this.suffix)\n .join('')}${this.suffix}`;\n position = position - 1;\n }\n else {\n const part1 = el.value.substring(0, position);\n const part2 = el.value.substring(position);\n this._maskService.actualValue = `${part1}${this._maskService.placeHolderCharacter}${part2}`;\n }\n }\n }\n if (this._code !== \"Backspace\" /* MaskExpression.BACKSPACE */) {\n if (!checkSymbols && !checkSpecialCharacter && selectRangeBackspace) {\n position = Number(el.selectionStart) - 1;\n }\n else if (this._maskService.specialCharacters.includes(el.value.slice(position, position + 1)) &&\n checkSpecialCharacter &&\n !this._maskService.specialCharacters.includes(el.value.slice(position + 1, position + 2))) {\n this._maskService.actualValue = `${el.value.slice(0, position - 1)}${el.value.slice(position, position + 1)}${inputSymbol}${el.value.slice(position + 2)}`;\n position = position + 1;\n }\n else if (checkSymbols) {\n if (el.value.length === 1 && position === 1) {\n this._maskService.actualValue = `${this.prefix}${inputSymbol}${this._maskService.maskIsShown.slice(1, this._maskService.maskIsShown.length)}${this.suffix}`;\n }\n else {\n this._maskService.actualValue = `${el.value.slice(0, position - 1)}${inputSymbol}${el.value\n .slice(position + 1)\n .split(this.suffix)\n .join('')}${this.suffix}`;\n }\n }\n else if (this.prefix &&\n el.value.length === 1 &&\n position - prefixLength === 1 &&\n this._maskService._checkSymbolMask(el.value, this._maskService.maskExpression[position - 1 - prefixLength] ??\n \"\" /* MaskExpression.EMPTY_STRING */)) {\n this._maskService.actualValue = `${this.prefix}${el.value}${this._maskService.maskIsShown.slice(1, this._maskService.maskIsShown.length)}${this.suffix}`;\n }\n }\n }\n let caretShift = 0;\n let backspaceShift = false;\n if (this._code === \"Delete\" /* MaskExpression.DELETE */ && \"separator\" /* MaskExpression.SEPARATOR */) {\n this._maskService.deletedSpecialCharacter = true;\n }\n if (this._inputValue.length >= this._maskService.maskExpression.length - 1 &&\n this._code !== \"Backspace\" /* MaskExpression.BACKSPACE */ &&\n this._maskService.maskExpression === \"d0/M0/0000\" /* MaskExpression.DAYS_MONTHS_YEARS */ &&\n position < 10) {\n const inputSymbol = this._inputValue.slice(position - 1, position);\n el.value =\n this._inputValue.slice(0, position - 1) +\n inputSymbol +\n this._inputValue.slice(position + 1);\n }\n if (this._maskService.maskExpression === \"d0/M0/0000\" /* MaskExpression.DAYS_MONTHS_YEARS */ &&\n this.leadZeroDateTime) {\n if ((position < 3 && Number(el.value) > 31 && Number(el.value) < 40) ||\n (position === 5 && Number(el.value.slice(3, 5)) > 12)) {\n position = position + 2;\n }\n }\n if (this._maskService.maskExpression === \"Hh:m0:s0\" /* MaskExpression.HOURS_MINUTES_SECONDS */ &&\n this.apm) {\n if (this._justPasted && el.value.slice(0, 2) === \"00\" /* MaskExpression.DOUBLE_ZERO */) {\n el.value = el.value.slice(1, 2) + el.value.slice(2, el.value.length);\n }\n el.value =\n el.value === \"00\" /* MaskExpression.DOUBLE_ZERO */\n ? \"0\" /* MaskExpression.NUMBER_ZERO */\n : el.value;\n }\n this._maskService.applyValueChanges(position, this._justPasted, this._code === \"Backspace\" /* MaskExpression.BACKSPACE */ || this._code === \"Delete\" /* MaskExpression.DELETE */, (shift, _backspaceShift) => {\n this._justPasted = false;\n caretShift = shift;\n backspaceShift = _backspaceShift;\n });\n // only set the selection if the element is active\n if (this._getActiveElement() !== el) {\n return;\n }\n if (this._maskService.plusOnePosition) {\n position = position + 1;\n this._maskService.plusOnePosition = false;\n }\n // update position after applyValueChanges to prevent cursor on wrong position when it has an array of maskExpression\n if (this._maskExpressionArray.length) {\n if (this._code === \"Backspace\" /* MaskExpression.BACKSPACE */) {\n const specialChartMinusOne = this.specialCharacters.includes(this._maskService.actualValue.slice(position - 1, position));\n const specialChartPlusOne = this.specialCharacters.includes(this._maskService.actualValue.slice(position, position + 1));\n if (this._allowFewMaskChangeMask && !specialChartPlusOne) {\n position = el.selectionStart + 1;\n this._allowFewMaskChangeMask = false;\n }\n else {\n position = specialChartMinusOne ? position - 1 : position;\n }\n }\n else {\n position =\n el.selectionStart === 1\n ? el.selectionStart + this._maskService.prefix.length\n : el.selectionStart;\n }\n }\n this._position =\n this._position === 1 && this._inputValue.length === 1 ? null : this._position;\n let positionToApply = this._position\n ? this._inputValue.length + position + caretShift\n : position +\n (this._code === \"Backspace\" /* MaskExpression.BACKSPACE */ && !backspaceShift ? 0 : caretShift);\n if (positionToApply > this._getActualInputLength()) {\n positionToApply =\n el.value === this._maskService.decimalMarker && el.value.length === 1\n ? this._getActualInputLength() + 1\n : this._getActualInputLength();\n }\n if (positionToApply < 0) {\n positionToApply = 0;\n }\n el.setSelectionRange(positionToApply, positionToApply);\n this._position = null;\n }\n else {\n console.warn('Ngx-mask writeValue work with string | number, your current value:', typeof transformedValue);\n }\n }\n else {\n if (!this._maskValue) {\n this.onChange(el.value);\n return;\n }\n this._maskService.applyValueChanges(el.value.length, this._justPasted, this._code === \"Backspace\" /* MaskExpression.BACKSPACE */ || this._code === \"Delete\" /* MaskExpression.DELETE */);\n }\n }\n // IME starts\n onCompositionStart() {\n this._isComposing = true;\n }\n // IME completes\n onCompositionEnd(e) {\n this._isComposing = false;\n this._justPasted = true;\n this.onInput(e);\n }\n onBlur(e) {\n if (this._maskValue) {\n const el = e.target;\n if (this.leadZero && el.value.length > 0 && typeof this.decimalMarker === 'string') {\n const maskExpression = this._maskService.maskExpression;\n const precision = Number(this._maskService.maskExpression.slice(maskExpression.length - 1, maskExpression.length));\n if (precision > 0) {\n el.value = this.suffix ? el.value.split(this.suffix).join('') : el.value;\n const decimalPart = el.value.split(this.decimalMarker)[1];\n el.value = el.value.includes(this.decimalMarker)\n ? el.value +\n \"0\" /* MaskExpression.NUMBER_ZERO */.repeat(precision - decimalPart.length) +\n this.suffix\n : el.value +\n this.decimalMarker +\n \"0\" /* MaskExpression.NUMBER_ZERO */.repeat(precision) +\n this.suffix;\n this._maskService.actualValue = el.value;\n }\n }\n this._maskService.clearIfNotMatchFn();\n }\n this._isFocused = false;\n this.onTouch();\n }\n onClick(e) {\n if (!this._maskValue) {\n return;\n }\n const el = e.target;\n const posStart = 0;\n const posEnd = 0;\n if (el !== null &&\n el.selectionStart !== null &&\n el.selectionStart === el.selectionEnd &&\n el.selectionStart > this._maskService.prefix.length &&\n // eslint-disable-next-line\n e.keyCode !== 38) {\n if (this._maskService.showMaskTyped && !this.keepCharacterPositions) {\n // We are showing the mask in the input\n this._maskService.maskIsShown = this._maskService.showMaskInInput();\n if (el.setSelectionRange &&\n this._maskService.prefix + this._maskService.maskIsShown === el.value) {\n // the input ONLY contains the mask, so position the cursor at the start\n el.focus();\n el.setSelectionRange(posStart, posEnd);\n }\n else {\n // the input contains some characters already\n if (el.selectionStart > this._maskService.actualValue.length) {\n // if the user clicked beyond our value's length, position the cursor at the end of our value\n el.setSelectionRange(this._maskService.actualValue.length, this._maskService.actualValue.length);\n }\n }\n }\n }\n const nextValue = el &&\n (el.value === this._maskService.prefix\n ? this._maskService.prefix + this._maskService.maskIsShown\n : el.value);\n /** Fix of cursor position jumping to end in most browsers no matter where cursor is inserted onFocus */\n if (el && el.value !== nextValue) {\n el.value = nextValue;\n }\n /** fix of cursor position with prefix when mouse click occur */\n if (el &&\n el.type !== 'number' &&\n (el.selectionStart || el.selectionEnd) <=\n this._maskService.prefix.length) {\n el.selectionStart = this._maskService.prefix.length;\n return;\n }\n /** select only inserted text */\n if (el && el.selectionEnd > this._getActualInputLength()) {\n el.selectionEnd = this._getActualInputLength();\n }\n }\n onKeyDown(e) {\n if (!this._maskValue) {\n return;\n }\n if (this._isComposing) {\n // User finalize their choice from IME composition, so trigger onInput() for the composed text.\n if (e.key === 'Enter')\n this.onCompositionEnd(e);\n return;\n }\n this._code = e.code ? e.code : e.key;\n const el = e.target;\n this._inputValue = el.value;\n this._setMask();\n if (el.type !== 'number') {\n if (e.key === \"ArrowUp\" /* MaskExpression.ARROW_UP */) {\n e.preventDefault();\n }\n if (e.key === \"ArrowLeft\" /* MaskExpression.ARROW_LEFT */ ||\n e.key === \"Backspace\" /* MaskExpression.BACKSPACE */ ||\n e.key === \"Delete\" /* MaskExpression.DELETE */) {\n if (e.key === \"Backspace\" /* MaskExpression.BACKSPACE */ && el.value.length === 0) {\n el.selectionStart = el.selectionEnd;\n }\n if (e.key === \"Backspace\" /* MaskExpression.BACKSPACE */ && el.selectionStart !== 0) {\n // If specialChars is false, (shouldn't ever happen) then set to the defaults\n this.specialCharacters = this.specialCharacters?.length\n ? this.specialCharacters\n : this._config.specialCharacters;\n if (this.prefix.length > 1 &&\n el.selectionStart <= this.prefix.length) {\n el.setSelectionRange(this.prefix.length, el.selectionEnd);\n }\n else {\n if (this._inputValue.length !== el.selectionStart &&\n el.selectionStart !== 1) {\n while (this.specialCharacters.includes((this._inputValue[el.selectionStart - 1] ??\n \"\" /* MaskExpression.EMPTY_STRING */).toString()) &&\n ((this.prefix.length >= 1 &&\n el.selectionStart > this.prefix.length) ||\n this.prefix.length === 0)) {\n el.setSelectionRange(el.selectionStart - 1, el.selectionEnd);\n }\n }\n }\n }\n this.checkSelectionOnDeletion(el);\n if (this._maskService.prefix.length &&\n el.selectionStart <= this._maskService.prefix.length &&\n el.selectionEnd <= this._maskService.prefix.length) {\n e.preventDefault();\n }\n const cursorStart = el.selectionStart;\n if (e.key === \"Backspace\" /* MaskExpression.BACKSPACE */ &&\n !el.readOnly &&\n cursorStart === 0 &&\n el.selectionEnd === el.value.length &&\n el.value.length !== 0) {\n this._position = this._maskService.prefix ? this._maskService.prefix.length : 0;\n this._maskService.applyMask(this._maskService.prefix, this._maskService.maskExpression, this._position);\n }\n }\n if (!!this.suffix &&\n this.suffix.length > 1 &&\n this._inputValue.length - this.suffix.length < el.selectionStart) {\n el.setSelectionRange(this._inputValue.length - this.suffix.length, this._inputValue.length);\n }\n else if ((e.code === 'KeyA' && e.ctrlKey) ||\n (e.code === 'KeyA' && e.metaKey) // Cmd + A (Mac)\n ) {\n el.setSelectionRange(0, this._getActualInputLength());\n e.preventDefault();\n }\n this._maskService.selStart = el.selectionStart;\n this._maskService.selEnd = el.selectionEnd;\n }\n }\n /** It writes the value in the input */\n async writeValue(controlValue) {\n if (typeof controlValue === 'object' && controlValue !== null && 'value' in controlValue) {\n if ('disable' in controlValue) {\n this.setDisabledState(Boolean(controlValue.disable));\n }\n // eslint-disable-next-line no-param-reassign\n controlValue = controlValue.value;\n }\n if (controlValue !== null) {\n // eslint-disable-next-line no-param-reassign\n controlValue = this.inputTransformFn\n ? this.inputTransformFn(controlValue)\n : controlValue;\n }\n if (typeof controlValue === 'string' ||\n typeof controlValue === 'number' ||\n controlValue === null ||\n controlValue === undefined) {\n if (controlValue === null || controlValue === undefined || controlValue === '') {\n this._maskService._currentValue = '';\n this._maskService._previousValue = '';\n }\n let inputValue = controlValue;\n if (typeof inputValue === 'number' ||\n this._maskValue.startsWith(\"separator\" /* MaskExpression.SEPARATOR */)) {\n inputValue = String(inputValue);\n const localeDecimalMarker = this._maskService.currentLocaleDecimalMarker();\n if (!Array.isArray(this._maskService.decimalMarker)) {\n inputValue =\n this._maskService.decimalMarker !== localeDecimalMarker\n ? inputValue.replace(localeDecimalMarker, this._maskService.decimalMarker)\n : inputValue;\n }\n if (this._maskService.leadZero &&\n inputValue &&\n this.maskExpression &&\n this.dropSpecialCharacters !== false) {\n inputValue = this._maskService._checkPrecision(this._maskService.maskExpression, inputValue);\n }\n if (this.decimalMarker === \",\" /* MaskExpression.COMMA */ ||\n (Array.isArray(this._maskService.decimalMarker) &&\n this.thousandSeparator === \".\" /* MaskExpression.DOT */)) {\n inputValue = inputValue\n .toString()\n .replace(\".\" /* MaskExpression.DOT */, \",\" /* MaskExpression.COMMA */);\n }\n if (this.maskExpression?.startsWith(\"separator\" /* MaskExpression.SEPARATOR */) && this.leadZero) {\n requestAnimationFrame(() => {\n this._maskService.applyMask(inputValue?.toString() ?? '', this._maskService.maskExpression);\n });\n }\n this._maskService.isNumberValue = true;\n }\n if (typeof inputValue !== 'string') {\n inputValue = '';\n }\n this._inputValue = inputValue;\n this._setMask();\n if ((inputValue && this._maskService.maskExpression) ||\n (this._maskService.maskExpression &&\n (this._maskService.prefix || this._maskService.showMaskTyped))) {\n // Let the service we know we are writing value so that triggering onChange function won't happen during applyMask\n typeof this.inputTransformFn !== 'function'\n ? (this._maskService.writingValue = true)\n : '';\n this._maskService.formElementProperty = [\n 'value',\n this._maskService.applyMask(inputValue, this._maskService.maskExpression),\n ];\n // Let the service know we've finished writing value\n typeof this.inputTransformFn !== 'function'\n ? (this._maskService.writingValue = false)\n : '';\n }\n else {\n this._maskService.formElementProperty = ['value', inputValue];\n }\n this._inputValue = inputValue;\n }\n else {\n console.warn('Ngx-mask writeValue work with string | number, your current value:', typeof controlValue);\n }\n }\n registerOnChange(fn) {\n this._maskService.onChange = this.onChange = fn;\n }\n registerOnTouched(fn) {\n this.onTouch = fn;\n }\n _getActiveElement(document = this.document) {\n const shadowRootEl = document?.activeElement?.shadowRoot;\n if (!shadowRootEl?.activeElement) {\n return document.activeElement;\n }\n else {\n return this._getActiveElement(shadowRootEl);\n }\n }\n checkSelectionOnDeletion(el) {\n el.selectionStart = Math.min(Math.max(this.prefix.length, el.selectionStart), this._inputValue.length - this.suffix.length);\n el.selectionEnd = Math.min(Math.max(this.prefix.length, el.selectionEnd), this._inputValue.length - this.suffix.length);\n }\n /** It disables the input element */\n setDisabledState(isDisabled) {\n this._maskService.formElementProperty = ['disabled', isDisabled];\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _applyMask() {\n this._maskService.maskExpression = this._maskService._repeatPatternSymbols(this._maskValue || '');\n this._maskService.formElementProperty = [\n 'value',\n this._maskService.applyMask(this._inputValue, this._maskService.maskExpression),\n ];\n }\n _validateTime(value) {\n const rowMaskLen = this._maskValue\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .filter((s) => s !== ':').length;\n if (!value) {\n return null; // Don't validate empty values to allow for optional form control\n }\n if ((+(value[value.length - 1] ?? -1) === 0 && value.length < rowMaskLen) ||\n value.length <= rowMaskLen - 2) {\n return this._createValidationError(value);\n }\n return null;\n }\n _getActualInputLength() {\n return (this._maskService.actualValue.length ||\n this._maskService.actualValue.length + this._maskService.prefix.length);\n }\n _createValidationError(actualValue) {\n return {\n mask: {\n requiredMask: this._maskValue,\n actualValue,\n },\n };\n }\n _setMask() {\n this._maskExpressionArray.some((mask) => {\n const specialChart = mask\n .split(\"\" /* MaskExpression.EMPTY_STRING */)\n .some((char) => this._maskService.specialCharacters.includes(char));\n if ((specialChart &&\n this._inputValue &&\n this._areAllCharactersInEachStringSame(this._maskExpressionArray)) ||\n mask.includes(\"{\" /* MaskExpression.CURLY_BRACKETS_LEFT */)) {\n const test = this._maskService.removeMask(this._inputValue)?.length <=\n this._maskService.removeMask(mask)?.length;\n if (test) {\n this._maskValue =\n this.maskExpression =\n this._maskService.maskExpression =\n mask.includes(\"{\" /* MaskExpression.CURLY_BRACKETS_LEFT */)\n ? this._maskService._repeatPatternSymbols(mask)\n : mask;\n return test;\n }\n else {\n if (this._code === \"Backspace\" /* MaskExpression.BACKSPACE */) {\n this._allowFewMaskChangeMask = true;\n }\n const expression = this._maskExpressionArray[this._maskExpressionArray.length - 1] ??\n \"\" /* MaskExpression.EMPTY_STRING */;\n this._maskValue =\n this.maskExpression =\n this._maskService.maskExpression =\n expression.includes(\"{\" /* MaskExpression.CURLY_BRACKETS_LEFT */)\n ? this._maskService._repeatPatternSymbols(expression)\n : expression;\n }\n }\n else {\n const check = this._maskService\n .removeMask(this._inputValue)\n ?.split(\"\" /* MaskExpression.EMPTY_STRING */)\n .every((character, index) => {\n const indexMask = mask.charAt(index);\n return this._maskService._checkSymbolMask(character, indexMask);\n });\n if (check || this._justPasted) {\n this._maskValue = this.maskExpression = this._maskService.maskExpression = mask;\n return check;\n }\n }\n });\n }\n _areAllCharactersInEachStringSame(array) {\n const specialCharacters = this._maskService.specialCharacters;\n function removeSpecialCharacters(str) {\n const regex = new RegExp(`[${specialCharacters.map((ch) => `\\\\${ch}`).join('')}]`, 'g');\n return str.replace(regex, '');\n }\n const processedArr = array.map(removeSpecialCharacters);\n return processedArr.every((str) => {\n const uniqueCharacters = new Set(str);\n return uniqueCharacters.size === 1;\n });\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.3.8\", type: NgxMaskDirective, isStandalone: true, selector: \"input[mask], textarea[mask]\", inputs: { maskExpression: [\"mask\", \"maskExpression\"], specialCharacters: \"specialCharacters\", patterns: \"patterns\", prefix: \"prefix\", suffix: \"suffix\", thousandSeparator: \"thousandSeparator\", decimalMarker: \"decimalMarker\", dropSpecialCharacters: \"dropSpecialCharacters\", hiddenInput: \"hiddenInput\", showMaskTyped: \"showMaskTyped\", placeHolderCharacter: \"placeHolderCharacter\", shownMaskExpression: \"shownMaskExpression\", showTemplate: \"showTemplate\", clearIfNotMatch: \"clearIfNotMatch\", validation: \"validation\", separatorLimit: \"separatorLimit\", allowNegativeNumbers: \"allowNegativeNumbers\", leadZeroDateTime: \"leadZeroDateTime\", leadZero: \"leadZero\", triggerOnMaskChange: \"triggerOnMaskChange\", apm: \"apm\", inputTransformFn: \"inputTransformFn\", outputTransformFn: \"outputTransformFn\", keepCharacterPositions: \"keepCharacterPositions\" }, outputs: { maskFilled: \"maskFilled\" }, host: { listeners: { \"paste\": \"onPaste()\", \"focus\": \"onFocus($event)\", \"ngModelChange\": \"onModelChange($event)\", \"input\": \"onInput($event)\", \"compositionstart\": \"onCompositionStart($event)\", \"compositionend\": \"onCompositionEnd($event)\", \"blur\": \"onBlur($event)\", \"click\": \"onClick($event)\", \"keydown\": \"onKeyDown($event)\" } }, providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: NgxMaskDirective,\n multi: true,\n },\n {\n provide: NG_VALIDATORS,\n useExisting: NgxMaskDirective,\n multi: true,\n },\n NgxMaskService,\n ], exportAs: [\"mask\", \"ngxMask\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskDirective, decorators: [{\n type: Directive,\n args: [{\n selector: 'input[mask], textarea[mask]',\n standalone: true,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: NgxMaskDirective,\n multi: true,\n },\n {\n provide: NG_VALIDATORS,\n useExisting: NgxMaskDirective,\n multi: true,\n },\n NgxMaskService,\n ],\n exportAs: 'mask,ngxMask',\n }]\n }], propDecorators: { maskExpression: [{\n type: Input,\n args: ['mask']\n }], specialCharacters: [{\n type: Input\n }], patterns: [{\n type: Input\n }], prefix: [{\n type: Input\n }], suffix: [{\n type: Input\n }], thousandSeparator: [{\n type: Input\n }], decimalMarker: [{\n type: Input\n }], dropSpecialCharacters: [{\n type: Input\n }], hiddenInput: [{\n type: Input\n }], showMaskTyped: [{\n type: Input\n }], placeHolderCharacter: [{\n type: Input\n }], shownMaskExpression: [{\n type: Input\n }], showTemplate: [{\n type: Input\n }], clearIfNotMatch: [{\n type: Input\n }], validation: [{\n type: Input\n }], separatorLimit: [{\n type: Input\n }], allowNegativeNumbers: [{\n type: Input\n }], leadZeroDateTime: [{\n type: Input\n }], leadZero: [{\n type: Input\n }], triggerOnMaskChange: [{\n type: Input\n }], apm: [{\n type: Input\n }], inputTransformFn: [{\n type: Input\n }], outputTransformFn: [{\n type: Input\n }], keepCharacterPositions: [{\n type: Input\n }], maskFilled: [{\n type: Output\n }], onPaste: [{\n type: HostListener,\n args: ['paste']\n }], onFocus: [{\n type: HostListener,\n args: ['focus', ['$event']]\n }], onModelChange: [{\n type: HostListener,\n args: ['ngModelChange', ['$event']]\n }], onInput: [{\n type: HostListener,\n args: ['input', ['$event']]\n }], onCompositionStart: [{\n type: HostListener,\n args: ['compositionstart', ['$event']]\n }], onCompositionEnd: [{\n type: HostListener,\n args: ['compositionend', ['$event']]\n }], onBlur: [{\n type: HostListener,\n args: ['blur', ['$event']]\n }], onClick: [{\n type: HostListener,\n args: ['click', ['$event']]\n }], onKeyDown: [{\n type: HostListener,\n args: ['keydown', ['$event']]\n }] } });\n\nclass NgxMaskPipe {\n constructor() {\n this.defaultOptions = inject(NGX_MASK_CONFIG);\n this._maskService = inject(NgxMaskService);\n this._maskExpressionArray = [];\n this.mask = '';\n }\n transform(value, mask, { patterns, ...config } = {}) {\n const currentConfig = {\n maskExpression: mask,\n ...this.defaultOptions,\n ...config,\n patterns: {\n ...this._maskService.patterns,\n ...patterns,\n },\n };\n Object.entries(currentConfig).forEach(([key, value]) => {\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._maskService[key] = value;\n });\n if (mask.includes('||')) {\n if (mask.split('||').length > 1) {\n this._maskExpressionArray = mask.split('||').sort((a, b) => {\n return a.length - b.length;\n });\n this._setMask(value);\n return this._maskService.applyMask(`${value}`, this.mask);\n }\n else {\n this._maskExpressionArray = [];\n return this._maskService.applyMask(`${value}`, this.mask);\n }\n }\n if (mask.includes(\"{\" /* MaskExpression.CURLY_BRACKETS_LEFT */)) {\n return this._maskService.applyMask(`${value}`, this._maskService._repeatPatternSymbols(mask));\n }\n if (mask.startsWith(\"separator\" /* MaskExpression.SEPARATOR */)) {\n if (config.decimalMarker) {\n this._maskService.decimalMarker = config.decimalMarker;\n }\n if (config.thousandSeparator) {\n this._maskService.thousandSeparator = config.thousandSeparator;\n }\n if (config.leadZero) {\n // eslint-disable-next-line no-param-reassign\n this._maskService.leadZero = config.leadZero;\n }\n // eslint-disable-next-line no-param-reassign\n value = String(value);\n const localeDecimalMarker = this._maskService.currentLocaleDecimalMarker();\n if (!Array.isArray(this._maskService.decimalMarker)) {\n // eslint-disable-next-line no-param-reassign\n value =\n this._maskService.decimalMarker !== localeDecimalMarker\n ? value.replace(localeDecimalMarker, this._maskService.decimalMarker)\n : value;\n }\n if (this._maskService.leadZero &&\n value &&\n this._maskService.dropSpecialCharacters !== false) {\n // eslint-disable-next-line no-param-reassign\n value = this._maskService._checkPrecision(mask, value);\n }\n if (this._maskService.decimalMarker === \",\" /* MaskExpression.COMMA */) {\n // eslint-disable-next-line no-param-reassign\n value = value.toString().replace(\".\" /* MaskExpression.DOT */, \",\" /* MaskExpression.COMMA */);\n }\n this._maskService.isNumberValue = true;\n }\n if (value === null || value === undefined) {\n return this._maskService.applyMask('', mask);\n }\n return this._maskService.applyMask(`${value}`, mask);\n }\n _setMask(value) {\n if (this._maskExpressionArray.length > 0) {\n this._maskExpressionArray.some((mask) => {\n const test = this._maskService.removeMask(value)?.length <=\n this._maskService.removeMask(mask)?.length;\n if (value && test) {\n this.mask = mask;\n return test;\n }\n else {\n const expression = this._maskExpressionArray[this._maskExpressionArray.length - 1] ??\n \"\" /* MaskExpression.EMPTY_STRING */;\n this.mask = expression;\n }\n });\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }\n static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: \"14.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskPipe, isStandalone: true, name: \"mask\" }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.3.8\", ngImport: i0, type: NgxMaskPipe, decorators: [{\n type: Pipe,\n args: [{\n name: 'mask',\n pure: true,\n standalone: true,\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { INITIAL_CONFIG, NEW_CONFIG, NGX_MASK_CONFIG, NgxMaskDirective, NgxMaskPipe, NgxMaskService, initialConfig, provideEnvironmentNgxMask, provideNgxMask, timeMasks, withoutValidation };\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { MatButtonModule } from '@angular/material/button'\nimport { TravelerDialogComponent } from './traveler.dialog.component'\nimport { HeaderModule } from '../header/header.module'\n\n@NgModule({\n declarations: [\n TravelerDialogComponent\n ],\n imports: [\n CommonModule,\n MatButtonModule,\n HeaderModule\n ],\n exports: [\n TravelerDialogComponent\n ]\n})\n\nexport class TravelerDialogModule { }\n","import { Component, Input, Output, EventEmitter } from '@angular/core'\n\n@Component({\n selector: 'gwc-traveler-dialog',\n templateUrl: './traveler.dialog.component.html',\n styleUrls: ['./traveler.dialog.component.scss']\n})\n\nexport class TravelerDialogComponent {\n @Input() full!: boolean\n @Input() label!: string\n @Input() closeBtn!: boolean\n @Output() close = new EventEmitter()\n\n public closeDialog(): void {\n this.close.emit()\n }\n}\n","\n
\n \n \n \n
\n
\n \n
\n
\n","\n \n \n
\n
\n Select a document shipping date\n \n
\n Very Important. In order to get your passport processed in the time you need it, it's imperative that you send in all of your documents in for processing on the day that you select before 3 PM . \n
\n
\n \n {{ date.toFormat('cccc, MM/dd/yyyy') }}\n \n
\n
\n \n
\n
\n \n
\n
\n {{ data.traveler.first_name }}, looks like you're sending us your documents on:\n
\n
\n {{ promise_date.value | date: 'EEEE, MM/dd/yyyy' }}\n
\n
\n It is important they you realize that we are placing a reservation on your behalf in order to process your passport with the U.S. Government. If you fail to ship your documents on the date you promised, you will be charged the full service fee.\n
\n
\n
\n Please enter your full name \"{{ data.traveler.friendly_name }}\": \n
\n
\n
\n I acknowledge that if I miss my promised shipping date, I will be subject to being charged a full service fee.\n
\n
\n
\n \n
\n
Thanks for your submission. You're Almost Done! \n
\n Please call us during business hours to complete your process at {{ manifest_phone }} \n \n This step requires assistance from our team. We'll conduct a final review of your passport documents and answer any questions you may have before you ship your documents.\n \n Business Hours\n \n Mon-Fri: 9AM - 6PM (EST) \n
\n
\n
\n
\n \n \n \n {{ actionbarTitle }}\n
{{ actionbarMessage }}
\n
\n \n \n {{ actionbarButton }}\n \n \n \n
\n \n \n \n","import { Component, OnInit, Inject } from '@angular/core'\nimport { FormControl, AbstractControl, Validators, ValidatorFn, ValidationErrors, FormBuilder, ReactiveFormsModule } from '@angular/forms'\nimport { DateTime } from 'luxon'\nimport { DateTime as BusinessDateTime } from 'luxon-business-days'\nimport { Application, Traveler } from 'src/types/traveler'\nimport { ApplicationService } from 'src/app/services/application.service'\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'\nimport { OrderService } from 'src/app/services/order.service'\nimport { CommonModule } from '@angular/common'\nimport { MatButtonModule } from '@angular/material/button'\nimport { MatFormFieldModule } from '@angular/material/form-field'\nimport { MatIconModule } from '@angular/material/icon'\nimport { MatInputModule } from '@angular/material/input'\nimport { MatDatepickerModule } from '@angular/material/datepicker'\nimport { MatCheckboxModule } from '@angular/material/checkbox'\nimport { NgxMaskDirective, provideNgxMask } from 'ngx-mask'\nimport { TravelerDialogModule } from '../traveler.dialog/traveler.dialog.module'\nimport { ButtonComponent } from 'src/app/components/button/button.component'\n\n@Component({\n selector: 'gwc-ship-date',\n templateUrl: './ship.date.component.html',\n styleUrls: ['./ship.date.component.scss'],\n standalone: true,\n imports: [\n ButtonComponent,\n CommonModule,\n MatButtonModule,\n MatCheckboxModule,\n MatDatepickerModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n NgxMaskDirective,\n ReactiveFormsModule,\n TravelerDialogModule\n ],\n providers: [\n provideNgxMask()\n ]\n})\n\nexport class ShipDateComponent implements OnInit {\n public actionLabel!: string\n public actionbarTitle!: string\n public actionbarMessage!: string\n public actionbarButton!: string\n public shipStep = 'pick'\n public dateForm = this.formBuilder.group({\n promise_date:['', [this.validDate()]]\n })\n public confirmForm = this.formBuilder.group({\n confirm: ['', [Validators.required, this.signedName()]]\n })\n public dates: DateTime[] = []\n public minDate = DateTime.fromObject(BusinessDateTime.now().toObject()).startOf('day')\n public maxDate = DateTime.fromObject(BusinessDateTime.now().plusBusiness({ days: 15 }).toObject())\n public confirmed = false\n public manifest_phone!: string\n\n constructor(\n private formBuilder: FormBuilder,\n private applicationService: ApplicationService,\n private orderService: OrderService, \n public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public data: {application: Application, traveler: Traveler, step: 'done'|'pick'}\n ) {\n this.manifest_phone = orderService.phone\n this.setActionBar(data.step)\n }\n\n ngOnInit(): void {\n this.getDates()\n }\n\n private getDates(): void {\n for (let i=0; i<4; i++) {\n this.dates.push(BusinessDateTime.now().plusBusiness({days: i}))\n }\n }\n\n private setActionBar(step: string) {\n if (step === 'pick') {\n this.actionLabel = 'Document Shipping Confirmation'\n this.actionbarTitle = 'Document Shipping Confirmation'\n this.actionbarMessage = 'Select a shipping date for your documents'\n this.actionbarButton = 'Continue'\n this.shipStep = 'pick'\n } else if (step === 'done') {\n this.shipStep = 'done'\n this.actionLabel = 'Your application is being reviewed.',\n this.actionbarTitle = `${this.data.traveler.friendly_name}'s Application Progress`,\n this.actionbarMessage = `Please call us during business hours to complete your process at ${this.manifest_phone}`\n this.actionbarButton = 'Download Documents'\n }\n }\n\n public get promise_date(): FormControl {\n return this.dateForm.controls.promise_date\n }\n\n public get confirm(): FormControl {\n return this.confirmForm.controls.confirm\n }\n\n public getDate(control: AbstractControl): DateTime | null {\n if (control && control.value) {\n return DateTime.fromFormat(control.value, 'MM/dd/yyyy')\n }\n\n return null\n }\n\n public dateSelected(value: DateTime): void {\n this.promise_date.patchValue(value?.toFormat('MM/dd/yyyy'))\n }\n\n private validDate(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (control?.value) {\n let date = DateTime.fromFormat(control.value, 'MM/dd/yyyy')\n\n if (!date.isValid) return { 'invalid_date' : true }\n else if (date < this.minDate) return { 'past' : true }\n else if (date > this.maxDate) return { 'future': true }\n }\n\n return {}\n }\n }\n\n public canProceed(): boolean {\n return !(this.shipStep === 'pick' && this.promise_date.valid) && !(this.shipStep === 'confirm' && this.confirmed)\n }\n\n public proceed(): void {\n if (this.shipStep === 'pick') {\n this.shipStep = 'confirm'\n this.actionbarMessage = 'Confirm and acknowledgement'\n } else if (this.shipStep === 'confirm') {\n this.setPromiseDate()\n } else if (this.shipStep === 'done') {\n this.dialogRef.close('download')\n }\n }\n\n private signedName(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const signed = this.data.traveler && control.value !== this.data.traveler.friendly_name\n return signed ? { signed: { value: control.value }} : null\n }\n }\n\n public confirmedSigned(): void {\n this.confirmed = true\n this.confirm.disable()\n }\n\n private setPromiseDate(): void {\n let date = DateTime.fromFormat(this.promise_date.value, 'MM/dd/yyyy').toFormat('yyyy-MM-dd')\n this.applicationService.setPromiseDate(this.data.application.uuid, date, this.promise_date.value)\n .subscribe(response => {\n if (response.status === 500) {\n this.setActionBar('done')\n } else {\n this.dialogRef.close()\n }\n })\n }\n\n public getErrorMessage(): string {\n let errors = this.promise_date.errors\n\n if (errors) {\n if (errors['past']) {\n return `Shipping date can't be in the past.`\n } else if (errors['future']) {\n return `Shipping date can't be later than ${this.maxDate.toFormat('MM/dd/yyyy')}.`\n }\n }\n\n return 'Please enter a valid date(MM/DD/YYYY).'\n }\n}\n","\n
\n
\n \n
\n FINAL REVIEW INSTRUCTIONS\n \n
\n It is now time to conduct a final review of your application. Failure to follow these commonly missed instructions will result in delays in securing your US Passport.\n
\n
\n \n \n
\n","import { Component, Inject } from '@angular/core'\nimport { FormGroup, FormControl, FormBuilder } from '@angular/forms'\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'\nimport { ReviewChecks } from 'src/types/order'\n\n@Component({\n selector: 'gwc-download-packet',\n templateUrl: './download.packet.component.html',\n styleUrls: ['./download.packet.component.scss']\n})\n\nexport class DownloadPacketComponent {\n public reviewForm = this.formBuilder.group({\n ds_application: [false],\n government_fees: [false],\n passport_photo: [false],\n final_check: [false],\n refund_check: [false],\n no_inbound_shipping: [false]\n })\n\n constructor(\n private formBuilder: FormBuilder,\n private downloadPacket: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public data: ReviewChecks\n ) {}\n\n public allChecks(): boolean {\n let formValue = this.reviewForm.getRawValue()\n\n return (\n formValue.ds_application === true &&\n (formValue.government_fees === true || this.data.gov_fee_included == true) &&\n formValue.passport_photo === true &&\n formValue.final_check === true && \n formValue.refund_check === true && \n (!this.data.adjudicated || formValue.no_inbound_shipping === true)\n )\n }\n\n public downloadDocuments(): void {\n this.downloadPacket.close({ accepted: true })\n }\n}\n","import * as i0 from '@angular/core';\nimport { InjectionToken, inject, EventEmitter, ANIMATION_MODULE_TYPE, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, Inject, Input, Output, NgModule } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { MatCommonModule } from '@angular/material/core';\n\n/** Injection token to be used to override the default options for `mat-progress-bar`. */\nconst MAT_PROGRESS_BAR_DEFAULT_OPTIONS = new InjectionToken('MAT_PROGRESS_BAR_DEFAULT_OPTIONS');\n/**\n * Injection token used to provide the current location to `MatProgressBar`.\n * Used to handle server-side rendering and to stub out during unit tests.\n * @docs-private\n */\nconst MAT_PROGRESS_BAR_LOCATION = new InjectionToken('mat-progress-bar-location', { providedIn: 'root', factory: MAT_PROGRESS_BAR_LOCATION_FACTORY });\n/** @docs-private */\nfunction MAT_PROGRESS_BAR_LOCATION_FACTORY() {\n const _document = inject(DOCUMENT);\n const _location = _document ? _document.location : null;\n return {\n // Note that this needs to be a function, rather than a property, because Angular\n // will only resolve it once, but we want the current path on each call.\n getPathname: () => (_location ? _location.pathname + _location.search : ''),\n };\n}\nclass MatProgressBar {\n constructor(_elementRef, _ngZone, _changeDetectorRef, _animationMode, defaults) {\n this._elementRef = _elementRef;\n this._ngZone = _ngZone;\n this._changeDetectorRef = _changeDetectorRef;\n this._animationMode = _animationMode;\n /** Flag that indicates whether NoopAnimations mode is set to true. */\n this._isNoopAnimation = false;\n this._defaultColor = 'primary';\n this._value = 0;\n this._bufferValue = 0;\n /**\n * Event emitted when animation of the primary progress bar completes. This event will not\n * be emitted when animations are disabled, nor will it be emitted for modes with continuous\n * animations (indeterminate and query).\n */\n this.animationEnd = new EventEmitter();\n this._mode = 'determinate';\n /** Event handler for `transitionend` events. */\n this._transitionendHandler = (event) => {\n if (this.animationEnd.observers.length === 0 ||\n !event.target ||\n !event.target.classList.contains('mdc-linear-progress__primary-bar')) {\n return;\n }\n if (this.mode === 'determinate' || this.mode === 'buffer') {\n this._ngZone.run(() => this.animationEnd.next({ value: this.value }));\n }\n };\n this._isNoopAnimation = _animationMode === 'NoopAnimations';\n if (defaults) {\n if (defaults.color) {\n this.color = this._defaultColor = defaults.color;\n }\n this.mode = defaults.mode || this.mode;\n }\n }\n // TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.\n /** Theme palette color of the progress bar. */\n get color() {\n return this._color || this._defaultColor;\n }\n set color(value) {\n this._color = value;\n }\n /** Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow. */\n get value() {\n return this._value;\n }\n set value(v) {\n this._value = clamp(v || 0);\n this._changeDetectorRef.markForCheck();\n }\n /** Buffer value of the progress bar. Defaults to zero. */\n get bufferValue() {\n return this._bufferValue || 0;\n }\n set bufferValue(v) {\n this._bufferValue = clamp(v || 0);\n this._changeDetectorRef.markForCheck();\n }\n /**\n * Mode of the progress bar.\n *\n * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to\n * 'determinate'.\n * Mirrored to mode attribute.\n */\n get mode() {\n return this._mode;\n }\n set mode(value) {\n // Note that we don't technically need a getter and a setter here,\n // but we use it to match the behavior of the existing mat-progress-bar.\n this._mode = value;\n this._changeDetectorRef.markForCheck();\n }\n ngAfterViewInit() {\n // Run outside angular so change detection didn't get triggered on every transition end\n // instead only on the animation that we care about (primary value bar's transitionend)\n this._ngZone.runOutsideAngular(() => {\n this._elementRef.nativeElement.addEventListener('transitionend', this._transitionendHandler);\n });\n }\n ngOnDestroy() {\n this._elementRef.nativeElement.removeEventListener('transitionend', this._transitionendHandler);\n }\n /** Gets the transform style that should be applied to the primary bar. */\n _getPrimaryBarTransform() {\n return `scaleX(${this._isIndeterminate() ? 1 : this.value / 100})`;\n }\n /** Gets the `flex-basis` value that should be applied to the buffer bar. */\n _getBufferBarFlexBasis() {\n return `${this.mode === 'buffer' ? this.bufferValue : 100}%`;\n }\n /** Returns whether the progress bar is indeterminate. */\n _isIndeterminate() {\n return this.mode === 'indeterminate' || this.mode === 'query';\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatProgressBar, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: ANIMATION_MODULE_TYPE, optional: true }, { token: MAT_PROGRESS_BAR_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"17.0.0\", version: \"17.2.0\", type: MatProgressBar, isStandalone: true, selector: \"mat-progress-bar\", inputs: { color: \"color\", value: [\"value\", \"value\", numberAttribute], bufferValue: [\"bufferValue\", \"bufferValue\", numberAttribute], mode: \"mode\" }, outputs: { animationEnd: \"animationEnd\" }, host: { attributes: { \"role\": \"progressbar\", \"aria-valuemin\": \"0\", \"aria-valuemax\": \"100\", \"tabindex\": \"-1\" }, properties: { \"attr.aria-valuenow\": \"_isIndeterminate() ? null : value\", \"attr.mode\": \"mode\", \"class\": \"\\\"mat-\\\" + color\", \"class._mat-animation-noopable\": \"_isNoopAnimation\", \"class.mdc-linear-progress--animation-ready\": \"!_isNoopAnimation\", \"class.mdc-linear-progress--indeterminate\": \"_isIndeterminate()\" }, classAttribute: \"mat-mdc-progress-bar mdc-linear-progress\" }, exportAs: [\"matProgressBar\"], ngImport: i0, template: \"\\n\\n
\\n \\n @if (mode === 'buffer') {\\n
\\n }\\n
\\n\\n \\n
\\n\\n \\n
\\n\", styles: [\"@keyframes mdc-linear-progress-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(var(--mdc-linear-progress-primary-half))}100%{transform:translateX(var(--mdc-linear-progress-primary-full))}}@keyframes mdc-linear-progress-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(var(--mdc-linear-progress-secondary-quarter))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(var(--mdc-linear-progress-secondary-half))}100%{transform:translateX(var(--mdc-linear-progress-secondary-full))}}@keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(var(--mdc-linear-progress-primary-half-neg))}100%{transform:translateX(var(--mdc-linear-progress-primary-full-neg))}}@keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(var(--mdc-linear-progress-secondary-half-neg))}100%{transform:translateX(var(--mdc-linear-progress-secondary-full-neg))}}@keyframes mdc-linear-progress-buffering-reverse{from{transform:translateX(-10px)}}.mdc-linear-progress{position:relative;width:100%;transform:translateZ(0);outline:1px solid rgba(0,0,0,0);overflow-x:hidden;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}@media screen and (forced-colors: active){.mdc-linear-progress{outline-color:CanvasText}}.mdc-linear-progress__bar{position:absolute;top:0;bottom:0;margin:auto 0;width:100%;animation:none;transform-origin:top left;transition:transform 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__bar-inner{display:inline-block;position:absolute;width:100%;animation:none;border-top-style:solid}.mdc-linear-progress__buffer{display:flex;position:absolute;top:0;bottom:0;margin:auto 0;width:100%;overflow:hidden}.mdc-linear-progress__buffer-dots{background-repeat:repeat-x;flex:auto;transform:rotate(180deg);-webkit-mask-image:url(\\\"data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='xMinYMin slice'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E\\\");mask-image:url(\\\"data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='xMinYMin slice'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E\\\");animation:mdc-linear-progress-buffering 250ms infinite linear}.mdc-linear-progress__buffer-bar{flex:0 1 100%;transition:flex-basis 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__primary-bar{transform:scaleX(0)}.mdc-linear-progress__secondary-bar{display:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__bar{transition:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{left:-145.166611%}.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{left:-54.888891%;display:block}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation:mdc-linear-progress-primary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-primary-indeterminate-scale 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation:mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__bar{right:0;-webkit-transform-origin:center right;transform-origin:center right}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__buffer-dots,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__buffer-dots{animation:mdc-linear-progress-buffering-reverse 250ms infinite linear;transform:rotate(0)}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{right:-145.166611%;left:auto}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{right:-54.888891%;left:auto}.mdc-linear-progress--closed{opacity:0}.mdc-linear-progress--closed-animation-off .mdc-linear-progress__buffer-dots{animation:none}.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar,.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar .mdc-linear-progress__bar-inner{animation:none}@keyframes mdc-linear-progress-buffering{from{transform:rotate(180deg) translateX(calc(var(--mdc-linear-progress-track-height) * -2.5))}}.mdc-linear-progress__bar-inner{border-color:var(--mdc-linear-progress-active-indicator-color)}.mdc-linear-progress__buffer-dots{background-color:var(--mdc-linear-progress-track-color)}@media(forced-colors: active){.mdc-linear-progress__buffer-dots{background-color:ButtonBorder}}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.mdc-linear-progress__buffer-dots{background-color:rgba(0,0,0,0);background-image:url(\\\"data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(244, 67, 54, 0.25)'/%3E%3C/svg%3E\\\")}}.mdc-linear-progress__buffer-bar{background-color:var(--mdc-linear-progress-track-color)}.mdc-linear-progress{height:max(var(--mdc-linear-progress-track-height), var(--mdc-linear-progress-active-indicator-height))}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.mdc-linear-progress{height:4px}}.mdc-linear-progress__bar{height:var(--mdc-linear-progress-active-indicator-height)}.mdc-linear-progress__bar-inner{border-top-width:var(--mdc-linear-progress-active-indicator-height)}.mdc-linear-progress__buffer{height:var(--mdc-linear-progress-track-height)}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.mdc-linear-progress__buffer-dots{background-size:10px var(--mdc-linear-progress-track-height)}}.mdc-linear-progress__buffer{border-radius:var(--mdc-linear-progress-track-shape)}.mat-mdc-progress-bar{display:block;text-align:start;--mdc-linear-progress-primary-half: 83.67142%;--mdc-linear-progress-primary-full: 200.611057%;--mdc-linear-progress-secondary-quarter: 37.651913%;--mdc-linear-progress-secondary-half: 84.386165%;--mdc-linear-progress-secondary-full: 160.277782%;--mdc-linear-progress-primary-half-neg: -83.67142%;--mdc-linear-progress-primary-full-neg: -200.611057%;--mdc-linear-progress-secondary-quarter-neg: -37.651913%;--mdc-linear-progress-secondary-half-neg: -84.386165%;--mdc-linear-progress-secondary-full-neg: -160.277782%}.mat-mdc-progress-bar[mode=query]{transform:scaleX(-1)}.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__buffer-dots,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__primary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__secondary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__bar-inner.mdc-linear-progress__bar-inner{animation:none}.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__primary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__buffer-bar{transition:transform 1ms}\"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatProgressBar, decorators: [{\n type: Component,\n args: [{ selector: 'mat-progress-bar', exportAs: 'matProgressBar', host: {\n 'role': 'progressbar',\n 'aria-valuemin': '0',\n 'aria-valuemax': '100',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n 'tabindex': '-1',\n '[attr.aria-valuenow]': '_isIndeterminate() ? null : value',\n '[attr.mode]': 'mode',\n 'class': 'mat-mdc-progress-bar mdc-linear-progress',\n '[class]': '\"mat-\" + color',\n '[class._mat-animation-noopable]': '_isNoopAnimation',\n '[class.mdc-linear-progress--animation-ready]': '!_isNoopAnimation',\n '[class.mdc-linear-progress--indeterminate]': '_isIndeterminate()',\n }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, template: \"\\n\\n
\\n \\n @if (mode === 'buffer') {\\n
\\n }\\n
\\n\\n \\n
\\n\\n \\n
\\n\", styles: [\"@keyframes mdc-linear-progress-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(var(--mdc-linear-progress-primary-half))}100%{transform:translateX(var(--mdc-linear-progress-primary-full))}}@keyframes mdc-linear-progress-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(var(--mdc-linear-progress-secondary-quarter))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(var(--mdc-linear-progress-secondary-half))}100%{transform:translateX(var(--mdc-linear-progress-secondary-full))}}@keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(var(--mdc-linear-progress-primary-half-neg))}100%{transform:translateX(var(--mdc-linear-progress-primary-full-neg))}}@keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(var(--mdc-linear-progress-secondary-half-neg))}100%{transform:translateX(var(--mdc-linear-progress-secondary-full-neg))}}@keyframes mdc-linear-progress-buffering-reverse{from{transform:translateX(-10px)}}.mdc-linear-progress{position:relative;width:100%;transform:translateZ(0);outline:1px solid rgba(0,0,0,0);overflow-x:hidden;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}@media screen and (forced-colors: active){.mdc-linear-progress{outline-color:CanvasText}}.mdc-linear-progress__bar{position:absolute;top:0;bottom:0;margin:auto 0;width:100%;animation:none;transform-origin:top left;transition:transform 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__bar-inner{display:inline-block;position:absolute;width:100%;animation:none;border-top-style:solid}.mdc-linear-progress__buffer{display:flex;position:absolute;top:0;bottom:0;margin:auto 0;width:100%;overflow:hidden}.mdc-linear-progress__buffer-dots{background-repeat:repeat-x;flex:auto;transform:rotate(180deg);-webkit-mask-image:url(\\\"data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='xMinYMin slice'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E\\\");mask-image:url(\\\"data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='xMinYMin slice'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E\\\");animation:mdc-linear-progress-buffering 250ms infinite linear}.mdc-linear-progress__buffer-bar{flex:0 1 100%;transition:flex-basis 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__primary-bar{transform:scaleX(0)}.mdc-linear-progress__secondary-bar{display:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__bar{transition:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{left:-145.166611%}.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{left:-54.888891%;display:block}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation:mdc-linear-progress-primary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-primary-indeterminate-scale 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation:mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__bar{right:0;-webkit-transform-origin:center right;transform-origin:center right}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__buffer-dots,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__buffer-dots{animation:mdc-linear-progress-buffering-reverse 250ms infinite linear;transform:rotate(0)}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{right:-145.166611%;left:auto}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{right:-54.888891%;left:auto}.mdc-linear-progress--closed{opacity:0}.mdc-linear-progress--closed-animation-off .mdc-linear-progress__buffer-dots{animation:none}.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar,.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar .mdc-linear-progress__bar-inner{animation:none}@keyframes mdc-linear-progress-buffering{from{transform:rotate(180deg) translateX(calc(var(--mdc-linear-progress-track-height) * -2.5))}}.mdc-linear-progress__bar-inner{border-color:var(--mdc-linear-progress-active-indicator-color)}.mdc-linear-progress__buffer-dots{background-color:var(--mdc-linear-progress-track-color)}@media(forced-colors: active){.mdc-linear-progress__buffer-dots{background-color:ButtonBorder}}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.mdc-linear-progress__buffer-dots{background-color:rgba(0,0,0,0);background-image:url(\\\"data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(244, 67, 54, 0.25)'/%3E%3C/svg%3E\\\")}}.mdc-linear-progress__buffer-bar{background-color:var(--mdc-linear-progress-track-color)}.mdc-linear-progress{height:max(var(--mdc-linear-progress-track-height), var(--mdc-linear-progress-active-indicator-height))}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.mdc-linear-progress{height:4px}}.mdc-linear-progress__bar{height:var(--mdc-linear-progress-active-indicator-height)}.mdc-linear-progress__bar-inner{border-top-width:var(--mdc-linear-progress-active-indicator-height)}.mdc-linear-progress__buffer{height:var(--mdc-linear-progress-track-height)}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.mdc-linear-progress__buffer-dots{background-size:10px var(--mdc-linear-progress-track-height)}}.mdc-linear-progress__buffer{border-radius:var(--mdc-linear-progress-track-shape)}.mat-mdc-progress-bar{display:block;text-align:start;--mdc-linear-progress-primary-half: 83.67142%;--mdc-linear-progress-primary-full: 200.611057%;--mdc-linear-progress-secondary-quarter: 37.651913%;--mdc-linear-progress-secondary-half: 84.386165%;--mdc-linear-progress-secondary-full: 160.277782%;--mdc-linear-progress-primary-half-neg: -83.67142%;--mdc-linear-progress-primary-full-neg: -200.611057%;--mdc-linear-progress-secondary-quarter-neg: -37.651913%;--mdc-linear-progress-secondary-half-neg: -84.386165%;--mdc-linear-progress-secondary-full-neg: -160.277782%}.mat-mdc-progress-bar[mode=query]{transform:scaleX(-1)}.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__buffer-dots,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__primary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__secondary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__bar-inner.mdc-linear-progress__bar-inner{animation:none}.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__primary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__buffer-bar{transition:transform 1ms}\"] }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [ANIMATION_MODULE_TYPE]\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_PROGRESS_BAR_DEFAULT_OPTIONS]\n }] }], propDecorators: { color: [{\n type: Input\n }], value: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], bufferValue: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], animationEnd: [{\n type: Output\n }], mode: [{\n type: Input\n }] } });\n/** Clamps a value to be between two numbers, by default 0 and 100. */\nfunction clamp(v, min = 0, max = 100) {\n return Math.max(min, Math.min(max, v));\n}\n\nclass MatProgressBarModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"17.2.0\", ngImport: i0, type: MatProgressBarModule, imports: [MatProgressBar], exports: [MatProgressBar, MatCommonModule] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatProgressBarModule, imports: [MatCommonModule] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatProgressBarModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [MatProgressBar],\n exports: [MatProgressBar, MatCommonModule],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { MAT_PROGRESS_BAR_DEFAULT_OPTIONS, MAT_PROGRESS_BAR_LOCATION, MAT_PROGRESS_BAR_LOCATION_FACTORY, MatProgressBar, MatProgressBarModule };\n","import { Injectable } from '@angular/core'\nimport { from, map, Observable } from 'rxjs'\nimport { Location } from 'src/types/location'\nimport { ApiService } from './api.service'\n\n@Injectable({\n providedIn: 'root'\n})\n\nexport class LocationService extends ApiService {\n private countries: Location[]|undefined\n private states: Location[]|undefined\n\n public getCountries(): Observable {\n if (!this.countries) {\n return this.getRequest(`populate/countries`)\n .pipe(\n map((response) => {\n this.countries = response\n\n return response\n })\n )\n }\n\n return from([this.countries])\n }\n\n getStates(): Observable {\n if (!this.states) {\n return this.getRequest(`populate/states`)\n .pipe(\n map((response) => {\n this.states = response\n\n return response\n })\n )\n }\n\n return from([this.states])\n }\n}\n","\n\tTrip Information \n\t@if (itinerary && itinerary.destinations.length > 0 && itinerary.destinations[0].country) {\n\t\t\n\t\t\t@for (destination of itinerary.destinations; track destination) {\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t@if (destination.formatted) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\t{{ destination.formatted ? destination.formatted.label : destination.country }}\n\t\t\t\t\t
\n\t\t\t\t\t
{{ destination.start_date | date: 'MM/dd/yyyy' }}\n\t\t\t\t\t\t@if (destination.end_date) {\n\t\t\t\t\t\t\t- {{ destination.end_date | date: 'MM/dd/yyyy' }}\n\t\t\t\t\t\t}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t}\n\t\t
\n\t} @else {\n\t\t\n\t\t\t
\n\t\t\t
Please provide your destinations, if known. (Optional)
\n\t\t\t
\n\t\t\t\tAdd Destinations\n\t\t\t \n\t\t
\n\t}\n \n","import { Component, Input, OnDestroy, OnInit } from '@angular/core'\nimport { RouterModule } from '@angular/router'\nimport { LocationService } from 'src/app/services/location.service'\nimport { OrderService } from 'src/app/services/order.service'\nimport { Itinerary } from 'src/types/order'\nimport { Location } from 'src/types/location'\nimport { Subscription } from 'rxjs'\nimport { DatePipe } from '@angular/common'\nimport { MatButtonModule } from '@angular/material/button'\n\n@Component({\n selector: 'gwc-itinerary-widget',\n templateUrl: './itinerary.widget.component.html',\n styleUrls: ['./itinerary.widget.component.scss'],\n standalone: true,\n imports: [\n DatePipe,\n MatButtonModule,\n RouterModule\n ]\n})\n\nexport class ItineraryWidgetComponent implements OnInit, OnDestroy {\n @Input() order_uuid!: string\n\n public itinerary!: Itinerary\n public countries!: Location[]\n public itinerarySubscription!: Subscription\n\n constructor(\n private orderService: OrderService,\n private locationService: LocationService\n ) {}\n\n ngOnInit(): void {\n this.getCountries()\n this.itinerarySubscription = this.orderService.itineraryUpdated.subscribe(() => {\n this.getItinerary()\n })\n }\n\n ngOnDestroy(): void {\n this.itinerarySubscription.unsubscribe()\n }\n\n private getCountries(): void {\n this.locationService.getCountries()\n .subscribe(response => {\n this.countries = response\n this.getItinerary()\n })\n }\n\n private getItinerary(): void {\n this.orderService.getOrderDetails(this.order_uuid, 'itinerary')\n .subscribe(response => {\n this.itinerary = response\n\n this.itinerary.destinations.map(item => {\n if (item.country) {\n let country = this.countries.filter(country => country.label === item.country)[0]\n\n if (country) {\n item.formatted = country\n }\n } \n\n return item\n })\n })\n }\n}\n","\n\t@if (traveler) {\n\t\t
\n\t\t\t\n\t\t\t\n\t\t\t@for (application of traveler.applications; track application.uuid) {\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{{ application.product.label }}\n\t\t\t\t\t\t\t\t
\n\t\n\t\t\t\t\t\t\t\t@if (application.progress > 0 && (application.product.subtype !== 'idp' || application.status !== 'completed' || !application.packet_approved)) {\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t{{ application.progress }}% \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t@if (application.steps) {\n\t\t\t\t\t\t\t\t@if (application.status === 'new') {\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\tStart Application\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t} @else if (!['shipped_out', 'delivered', 'documents_processing', 'dropped_off', 'reviewed', 'processed', 'shipped_in'].includes(application.status) || application.manifest?.status === 'qa_error') {\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t@if (application.status === 'canceled') {\n\t\t\t\t\t\t\t\t\t\t\tCancelled\n\t\t\t\t\t\t\t\t\t\t} @else if (application.progress >= 0 && application.progress < 100) {\n\t\t\t\t\t\t\t\t\t\t\tContinue Application\n\t\t\t\t\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t\t\t\t\tEdit Application\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t@if (application.product.type === 'visa') {\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t@if(application.product.type === 'idp') {\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t@if (application.manifest?.status === 'manifested') {\n\t\t\t\t\t\t\t\t\tFor technical assistance please contact
{{ \"idpsupport@govworks.com\" }} .\n\t\t\t\t\t\t\t\t} @else if (application.manifest?.license?.support) {\n\t\t\t\t\t\t\t\t\tIf you have any questions, feel free to contact the AAA office via
{{ application.manifest?.license?.support }} .\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t}\n\t\t\t\t\t
\n\n\t\t\t\t\t@if (!application.steps || !['new', 'pending', 'canceled'].includes(application.status)) {\n\t\t\t\t\t\t
\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t
\n\t\t\t}\n\n\t\t\t\n\n\t\t\t@if (preview) {\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tI Need to Make Corrections\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tEverything Looks Good!\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t}\n\n\t\t \n\t} @else {\n\t\t
\n\t}\n\t
\n
\n","import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'\nimport { ActivatedRoute, Router, RouterModule } from '@angular/router'\nimport { ApplicationService } from 'src/app/services/application.service'\nimport { OrderService } from 'src/app/services/order.service'\nimport { Application, Traveler } from 'src/types/traveler'\nimport { environment } from 'src/environments/environment'\nimport { StatusMessageComponent } from './status.message/status.message.component'\nimport { MatDialog } from '@angular/material/dialog'\nimport { ShipDateComponent } from 'src/app/dialogs/ship.date/ship.date.component'\nimport { ReviewChecks } from 'src/types/order'\nimport { DownloadPacketComponent } from 'src/app/dialogs/download.packet/download.packet.component'\nimport { MatProgressBarModule } from '@angular/material/progress-bar'\nimport { ButtonComponent } from 'src/app/components/button/button.component'\nimport { ItineraryWidgetComponent } from '../itinerary.widget/itinerary.widget.component'\nimport { MatButtonModule } from '@angular/material/button'\n\n@Component({\n selector: 'gwc-traveler',\n templateUrl: './traveler.component.html',\n styleUrls: ['./traveler.component.scss'],\n standalone: true,\n imports: [\n ButtonComponent,\n ItineraryWidgetComponent,\n MatButtonModule,\n MatProgressBarModule,\n RouterModule,\n StatusMessageComponent\n ]\n})\n\nexport class TravelerComponent implements OnInit {\n @ViewChild(StatusMessageComponent) statusMessageComponent!: StatusMessageComponent\n\n public params: {[key: string]: string} = {}\n public traveler!: Traveler\n public model!: any\n public submitting: string[] = []\n public swapping: string = ''\n public message: string = ''\n public api = environment.API\n private passport_products: any = {\n 'child-passport': 'Child Passport',\n 'passport-renewal': 'Passport Renewal',\n 'lost-passport': 'Lost Passport',\n 'stolen-passport': 'Stolen Passport',\n 'new-passport': 'New Passport',\n 'name-change': 'Name Change',\n 'damaged-passport': 'Damaged Passport'\n }\n public video: Application|null = null\n public preview: Application|null = null\n public dialog: string = ''\n \n constructor(\n private activatedRoute: ActivatedRoute,\n private orderService: OrderService,\n private applicationService: ApplicationService,\n private changeDetectorRef: ChangeDetectorRef,\n private matDialog: MatDialog,\n private router: Router\n ) {\n this.activatedRoute.pathFromRoot.forEach((route) => {\n this.params = {...this.params, ...route.snapshot.params}\n })\n }\n\n ngOnInit(): void {\n this.orderService.getOrderDetails(this.params['order_uuid'], 'travelers')\n .subscribe(response => {\n this.getTravelerDetails()\n })\n } \n\n private getTravelerDetails(): void {\n this.orderService.getTravelerDetails(this.params['traveler_uuid'])\n .subscribe((response: Traveler) => {\n response.applications.forEach(application => {\n // this.checkApplicationStatus(application)\n\n if (application.product.type === 'passport') {\n let desired = this.applicationService.passportCheck(response.model, application.addons.includes('passport_card'), application.product.subtype)\n\n if (application.product.subtype !== desired) {\n application.product.desired = desired\n application.product.desired_label = this.passport_products[desired]\n }\n }\n })\n\n this.traveler = response\n })\n }\n\n public openApplicationPreview(application: Application): void {\n this.preview = application\n this.video = null\n }\n\n public closePreview(approved: boolean) {\n if (this.preview !== null) {\n if (approved) {\n this.applicationService.approvePacket(this.preview.uuid)\n .subscribe(response => {\n this.getTravelerDetails()\n if (this.preview) {\n if (this.preview?.manifest) {\n this.downloadApplication(this.preview)\n } else {\n // this.openShipDialog(this.preview)\n }\n }\n \n this.preview = null\n })\n } else {\n let filtered = this.traveler.applications.filter(application => this.preview && application.uuid === this.preview.uuid)[0]\n \n if (filtered) {\n filtered.status = 'ready'\n this.preview = null\n }\n }\n }\n\n }\n\n public messageCallback($event: any, application: Application): void {\n switch($event.action) {\n case 'refresh': \n this.submitting = []\n this.getTravelerDetails()\n break\n case 'preview': \n this.openApplicationPreview(application)\n break\n case 'submit':\n this.submitting.push(application.uuid)\n\n if (application.product.type === 'passport') {\n this.video = application\n }\n break\n case 'message':\n if (this.video && this.video.uuid === application.uuid) {\n this.message = $event.data.message\n }\n break\n case 'ship':\n this.openShipDialog(application)\n break\n case 'download': \n this.downloadApplication(application)\n break\n case 'esignature':\n this.router.navigate(['esignature', this.params['order_uuid'], this.traveler.uuid, application.uuid, $event.document_uuid])\n }\n }\n\n private openShipDialog(application: Application) {\n let automanifest = ['passport-renewal', 'name-change', 'second-passport'].includes(application.product.subtype) && !application.promise_date\n let dialog = this.matDialog.open(ShipDateComponent, {\n enterAnimationDuration: '0ms',\n exitAnimationDuration: '0ms',\n panelClass: 'gwc-traveler-dialog-overlay',\n disableClose: true,\n data: {\n application, \n traveler: this.traveler,\n step: automanifest ? 'pick' : 'done'\n }\n })\n \n dialog.afterClosed()\n .subscribe(response => {\n if (response) {\n this.getTravelerDetails()\n }\n })\n }\n\n public getButtonLabel(application: Application): string {\n if (application.progress >= 0 && application.progress < 100) return 'Continue Application'\n\n if (application.product.subtype === 'idp') {\n if (application.status !== 'completed' || !application.packet_approved) return 'Edit Application'\n else return \"Submitted\"\n }\n\n return 'Edit Application'\n }\n\n public downloadApplication(application: Application) {\n if (application.product.type === 'passport') {\n const reviewChecks: ReviewChecks = {\n product: application.product.subtype,\n gov_fee_included: application.gov_fee_included,\n adjudicated: ['smart_service_adj', 'expedited_service_adj'].includes(application.processing_service.slug)\n }\n \n const dialog = this.matDialog.open(DownloadPacketComponent, {\n ariaLabel: 'Download Packet Dialog',\n data: reviewChecks\n })\n \n dialog.afterClosed().subscribe(result => {\n if (result && result.accepted) {\n this.openDowload(application)\n }\n })\n } else {\n this.openDowload(application)\n }\n }\n\n public openDowload(application: Application) {\n let url = application.documents.length > 0 ? `${environment.API}application/${application.uuid}/user/download/document/${application.documents[0].uuid}` : `${environment.API}application/${application.uuid}/download`\n\n // if (this.orderService.active_domain === 'fedex') {\n // url = `/pdfviewer/web/viewer.html?file=${url}%3Ftoken%3D456c766e-8253-4f59-b925-be7efaecd064`\n // }\n\n window.open(url, '_blank')\n }\n}\n","import { Injectable } from '@angular/core'\nimport { BehaviorSubject, map, Subject } from 'rxjs'\nimport { Application, Traveler } from 'src/types/traveler'\nimport { ApiService } from './api.service'\n\n@Injectable({\n providedIn: 'root'\n})\n\nexport class TravelerService extends ApiService {\n public updateTravelerToPending(traveler_uuid: string) {\n return this.postRequest(`traveler/${traveler_uuid}/manage/profile`, {})\n }\n}\n","\n\t\n\t\t
\n\t\t\t
\n\t\t\t
{{ traveler.friendly_name }} \n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tApplication Progress \n\t\t\t\t\t{{ traveler.progress | number: '1.0-0' }}% \n\t\t\t\t
\n\t\t\t\t \n\t\t\t \n\t\t\t
\n\t\t\t\tGet Started\n\t\t\t \n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tView Applications\n\t\t\t\t \n\t\t\t \n\t\t
\n\t
\n \n","import { Component, Input, OnInit } from '@angular/core'\nimport { ActivatedRoute, Router } from '@angular/router'\nimport { OrderService } from 'src/app/services/order.service'\nimport { TravelerService } from 'src/app/services/traveler.service'\nimport { Itinerary, OrderTraveler } from 'src/types/order'\n\n@Component({\n selector: 'gwc-travelers',\n templateUrl: './travelers.component.html',\n styleUrls: ['./travelers.component.scss']\n})\n\nexport class TravelersComponent implements OnInit {\n public order_uuid!: string\n public travelers: OrderTraveler[] | undefined\n public itinerary!: Itinerary\n public loading: boolean = false\n\n constructor(\n private orderService: OrderService,\n private activatedRoute: ActivatedRoute,\n private router: Router,\n private travelerService: TravelerService\n ) {\n if (this.activatedRoute.parent) {\n this.order_uuid = this.activatedRoute.parent.snapshot.paramMap.get('order_uuid') || ''\n }\n }\n\n ngOnInit(): void {\n this.getTravelers()\n }\n\n private getTravelers(): void {\n this.orderService.getOrderDetails(this.order_uuid, 'travelers')\n .subscribe(response => {\n this.travelers = response\n })\n }\n\n public getStarted(uuid: string) {\n // Change status here\n this.loading = true\n this.travelerService.updateTravelerToPending(uuid)\n .subscribe(response => {\n this.router.navigate(['traveler', uuid], { relativeTo: this.activatedRoute})\n this.loading = false\n })\n }\n}\n","\n\t\n\t\t\n\t\t \n\t
\n\t \n\t@if (cancel_button()) {\n\t\t\n\t\t\t\n\t\t\t\tRequest Refund\n\t\t\t \n\t\t
\n\t}\n \n\n","import { Component, OnInit, WritableSignal, signal } from '@angular/core'\nimport { ActivatedRoute, NavigationEnd, Router, RouterModule, Event as NavigationEvent } from '@angular/router'\nimport { ItineraryWidgetComponent } from '../itinerary.widget/itinerary.widget.component'\nimport { filter } from 'rxjs'\nimport { OrderService } from 'src/app/services/order.service'\nimport { MatButtonModule } from '@angular/material/button'\n\n@Component({\n\tselector: 'gwc-order-layout',\n\ttemplateUrl: './order.layout.component.html',\n\tstyleUrls: ['./order.layout.component.scss'],\n\tstandalone: true,\n\timports: [\n\t\tItineraryWidgetComponent,\n\t\tRouterModule,\n\t\tMatButtonModule\n\t]\n})\n\nexport class OrderLayoutComponent implements OnInit {\n\tpublic readonly params!: {[key: string]: string}\n\tpublic cancel_button: WritableSignal = signal(false)\n\n\tconstructor(\n\t\tprivate router: Router,\n\t\tprivate activatedRoute: ActivatedRoute,\n\t\tprivate orderService: OrderService\n\t) {\n\t\tlet route = this.activatedRoute.snapshot\n\t\tlet new_params = route.params\n\n\t\twhile(route.parent) {\n\t\t\troute = route.parent\n\t\t\tnew_params = {\n\t\t\t\t...new_params,\n\t\t\t\t...route.params\n\t\t\t}\n\t\t}\n\n\t\tthis.params = new_params\n\t}\n\n\tngOnInit(): void {\n\t\tthis.checkCancelButton(this.router.routerState.snapshot.url)\n\n\t\tthis.router.events\n\t\t\t.pipe(filter((event: NavigationEvent ): event is NavigationEnd => event instanceof NavigationEnd))\n\t\t\t.subscribe((event: NavigationEnd) => {\n\t\t\t\tthis.checkCancelButton(event.url)\n\t\t\t})\n\t}\n\n\tprivate checkCancelButton(url: string) {\n\t\tif (url.includes('invoices')) {\n\t\t\tthis.orderService.checkRefundEligibility(this.params['order_uuid'])\n\t\t\t\t.subscribe({\n\t\t\t\t\tnext: (response) => {\n\t\t\t\t\t\tthis.cancel_button.set(response.eligible)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t} else if (this.cancel_button()) {\n\t\t\tthis.cancel_button.set(false)\n\t\t}\n\t}\n\n\tpublic requestRefund() {\n\t\tthis.orderService.requestRefund(this.params['order_uuid'])\n\t\t\t.subscribe({\n\t\t\t\tnext: (response) => {\n\t\t\t\t\twindow.open(response.url, '_blank')\n\t\t\t\t\tthis.cancel_button.set(false)\n\t\t\t\t},\n\t\t\t\terror: (error) => {\n\t\t\t\t\tconsole.log(error)\n\t\t\t\t}\n\t\t\t})\n\t}\n}\n","\n","import { NgModule } from '@angular/core'\nimport { RouterModule, Routes } from '@angular/router'\nimport { InvoicesComponent } from './order.layout/invoices/invoices.component'\nimport { OrderComponent } from './order.component'\nimport { FormComponent } from './traveler/form/form.component'\nimport { TravelerComponent } from './traveler/traveler.component'\nimport { TravelersComponent } from './order.layout/travelers/travelers.component'\nimport { OrderLayoutComponent } from './order.layout/order.layout.component'\nimport { ItineraryComponent } from './order.layout/itinerary/itinerary.component'\n\nconst orderRoutes: Routes = [\n {\n path: 'order/:order_uuid',\n component: OrderComponent,\n data: {\n breadcrumb: 'order_uuid',\n breadcrumbLabel: 'Order'\n },\n children: [\n {\n path: '',\n data: {\n breadcrumb: null,\n breadcrumbLabel: null\n },\n component: OrderLayoutComponent,\n children: [\n {\n path: '',\n data: {\n breadcrumb: null,\n breadcrumbLabel: null\n },\n component: TravelersComponent,\n },\n {\n path: 'invoices',\n data: {\n breadcrumbLabel: 'Invoices'\n },\n component: InvoicesComponent\n },\n {\n path: 'itinerary',\n data: {\n breadcrumbLabel: 'Itinerary'\n },\n component: ItineraryComponent\n },\n ]\n },\n {\n path: 'traveler/:traveler_uuid',\n data: {\n breadcrumb: 'traveler_uuid',\n breadcrumbLabel: 'Traveler'\n },\n children: [\n {\n path: '',\n data: {\n breadcrumb: null,\n breadcrumbLabel: null\n },\n component: TravelerComponent, \n },\n {\n path: 'app/:app_uuid',\n data: {\n breadcrumb: 'app_uuid',\n breadcrumbLabel: 'Application'\n },\n component: FormComponent\n }\n ]\n }\n ]\n }\n]\n\n@NgModule({\n imports: [RouterModule.forChild(orderRoutes)],\n exports: [RouterModule]\n})\n\nexport class OrderRoutingModule { }\n","import { Component, OnInit } from '@angular/core'\nimport { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms'\nimport { MatDatepickerInputEvent } from '@angular/material/datepicker'\nimport { ActivatedRoute } from '@angular/router'\nimport { DateTime } from 'luxon'\nimport { LocationService } from 'src/app/services/location.service'\nimport { Location } from 'src/types/location'\nimport { OrderService } from 'src/app/services/order.service'\nimport { Itinerary } from 'src/types/order'\nimport { from, Observable, toArray } from 'rxjs'\nimport * as _ from 'lodash'\n\n@Component({\n selector: 'gwc-itinerary',\n templateUrl: './itinerary.component.html',\n styleUrls: ['./itinerary.component.scss']\n})\n\nexport class ItineraryComponent implements OnInit {\n private order_uuid!: string\n public submitting: boolean = false\n public countries: Location[] = []\n // public countries: Observable|undefined\n public filteredCountries: Observable|undefined\n public min: DateTime = DateTime.now()\n public itineraryForm: FormGroup = this.formBuilder.group({\n destinations: this.formBuilder.array([])\n })\n public destinationForm = this.formBuilder.group({\n country: [''],\n start_date: [''],\n end_date: ['']\n })\n public itinerary: Itinerary|undefined\n\n constructor(\n private formBuilder: FormBuilder,\n private orderService: OrderService,\n private activatedRoute: ActivatedRoute,\n private locationService: LocationService\n ) {\n this.order_uuid = this.activatedRoute.parent?.snapshot.params['order_uuid']\n }\n\n ngOnInit(): void {\n this.getItinerary()\n this.getCountries()\n }\n\n get destinations() {\n return this.itineraryForm.controls['destinations'] as FormArray\n }\n\n private getCountries() {\n this.locationService.getCountries()\n .subscribe( res => {\n this.countries = res\n // this.countries = from(res)\n\n // this.filteredCountries = this.countries\n // .pipe(\n // toArray()\n // )\n })\n }\n\n private getItinerary(): void {\n this.orderService.getOrderDetails(this.order_uuid, 'itinerary')\n .subscribe((response: Itinerary) => {\n this.itinerary = response\n\n if (response.destinations.length > 0) {\n response.destinations.forEach(destination => {\n let destinationFormCopy = _.cloneDeep(this.destinationForm)\n let destinationValue = {\n country: destination.country,\n start_date: destination.start_date ? DateTime.fromFormat(destination.start_date, 'yyyy-MM-dd').toFormat('MM/dd/yyyy') : null,\n end_date: destination.end_date ? DateTime.fromFormat(destination.end_date, 'yyyy-MM-dd').toFormat('MM/dd/yyyy') : null\n }\n \n destinationFormCopy.patchValue(destinationValue)\n this.destinations.controls.push(destinationFormCopy)\n })\n } else {\n let destinationFormCopy = _.cloneDeep(this.destinationForm)\n this.destinations.controls.push(destinationFormCopy)\n }\n })\n }\n\n public getDate(group: AbstractControl, key: string): DateTime | null {\n let control = (group as FormGroup).controls[key]\n\n if (control && control.value) {\n return DateTime.fromFormat(control.value, 'MM/dd/yyyy')\n }\n\n return null\n }\n\n public dateSelected($event: MatDatepickerInputEvent, group: AbstractControl, key: string): void {\n let control = (group as FormGroup).controls[key]\n\n if (control) {\n control.patchValue($event.value?.toFormat('MM/dd/yyyy'))\n }\n }\n\n public deleteDestination(i: number) {\n this.destinations.removeAt(i)\n }\n\n public addDestination() {\n let destinationFormCopy = _.cloneDeep(this.destinationForm)\n this.destinations.push(destinationFormCopy)\n }\n\n public displayFn(item: Location) {\n return item ? item.label : ''\n }\n\n public getDestination(group: AbstractControl) {\n return (group as FormGroup).controls['country'] as FormControl\n }\n\n public saveItinerary() {\n if (this.destinations.controls.every(item => item.valid) && this.itinerary) {\n let data = {\n itinerary: {\n itinerary_uuid: this.itinerary.uuid,\n ...this.itineraryForm.getRawValue() \n }\n }\n\n this.orderService.updateOrder(this.order_uuid, data)\n .subscribe(response => {\n this.orderService.itineraryUpdated.next()\n })\n }\n }\n\n public checkDate(destination: any, type: string) {\n let control = destination.controls[type] as FormControl\n\n if (control.valid) {\n if (type === 'start_date') {\n let start_date = DateTime.fromFormat(control.value, 'MM/dd/yyyy')\n \n if (start_date < this.min) {\n control.setErrors({min: true})\n } else {\n let end_date_control = destination.controls.end_date as FormControl\n\n if (end_date_control.valid) {\n let end_date = DateTime.fromFormat(end_date_control.value, 'MM/dd/yyyy')\n\n if (start_date > end_date) {\n control.setErrors({end_date: true})\n }\n }\n }\n } else {\n let end_date = DateTime.fromFormat(control.value, 'MM/dd/yyyy')\n let start_date_control = destination.controls.start_date as FormControl\n\n if (start_date_control.valid) {\n let start_date = DateTime.fromFormat(start_date_control.value, 'MM/dd/yyyy')\n\n if (start_date > end_date) {\n control.setErrors({start_date: true})\n }\n }\n }\n }\n }\n\n public getErrorMessage(destination: any, type: string): string {\n let control = destination.controls[type] as FormControl\n\n if (type === 'start_date') {\n if (control.hasError('min')) {\n return 'Travel date cannot be in the past.'\n } else if (control.hasError('end_date')) {\n return 'Start Date cannot be after End Date.'\n }\n } else {\n if (control.hasError('start_date')) {\n return 'End Date cannot be before Start Date.'\n }\n }\n\n return 'Please enter a valid date.'\n }\n}\n","import * as i0 from '@angular/core';\nimport { Component, ViewEncapsulation, ViewChild, NgModule, NO_ERRORS_SCHEMA, Type, Directive, ViewChildren } from '@angular/core';\nimport * as i4 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport * as i3 from '@ngx-formly/core';\nimport { FieldWrapper, ɵdefineHiddenProp, FormlyModule, FieldType as FieldType$1, ɵobserve } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport * as i2 from '@angular/material/form-field';\nimport { MatFormField, MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field';\nimport * as i1 from '@angular/cdk/a11y';\nimport { Subject } from 'rxjs';\n\nclass FormlyWrapperFormField extends FieldWrapper {\n constructor(renderer, elementRef, focusMonitor) {\n super();\n this.renderer = renderer;\n this.elementRef = elementRef;\n this.focusMonitor = focusMonitor;\n }\n ngOnInit() {\n ɵdefineHiddenProp(this.field, '_formField', this.formField);\n this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n });\n }\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.props.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n ngOnDestroy() {\n delete this.field._formField;\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n}\nFormlyWrapperFormField.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyWrapperFormField, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });\nFormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"12.0.0\", version: \"13.3.12\", type: FormlyWrapperFormField, selector: \"formly-wrapper-mat-form-field\", viewQueries: [{ propertyName: \"formField\", first: true, predicate: MatFormField, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `\n \n \n \n \n {{ props.label }}\n * \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n \n\n \n {{ content }} \n \n \n \n \n `, isInline: true, styles: [\"formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\\n\"], components: [{ type: i2.MatFormField, selector: \"mat-form-field\", inputs: [\"color\", \"appearance\", \"hideRequiredMarker\", \"hintLabel\", \"floatLabel\"], exportAs: [\"matFormField\"] }, { type: i3.ɵFormlyValidationMessage, selector: \"formly-validation-message\", inputs: [\"field\"] }], directives: [{ type: i4.NgIf, selector: \"[ngIf]\", inputs: [\"ngIf\", \"ngIfThen\", \"ngIfElse\"] }, { type: i2.MatLabel, selector: \"mat-label\" }, { type: i4.NgTemplateOutlet, selector: \"[ngTemplateOutlet]\", inputs: [\"ngTemplateOutletContext\", \"ngTemplateOutlet\"] }, { type: i2.MatPrefix, selector: \"[matPrefix]\" }, { type: i2.MatSuffix, selector: \"[matSuffix]\" }, { type: i2.MatError, selector: \"mat-error\", inputs: [\"id\"] }, { type: i2.MatHint, selector: \"mat-hint\", inputs: [\"align\", \"id\"] }], encapsulation: i0.ViewEncapsulation.None });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyWrapperFormField, decorators: [{\n type: Component,\n args: [{ selector: 'formly-wrapper-mat-form-field', template: `\n \n \n \n \n {{ props.label }}\n * \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n \n\n \n {{ content }} \n \n \n \n \n `, encapsulation: ViewEncapsulation.None, styles: [\"formly-wrapper-mat-form-field .mat-mdc-form-field,formly-wrapper-mat-form-field .mat-form-field{width:100%}\\n\"] }]\n }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.FocusMonitor }]; }, propDecorators: { formField: [{\n type: ViewChild,\n args: [MatFormField, { static: true }]\n }] } });\n\nclass FormlyMatFormFieldModule {\n}\nFormlyMatFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlyMatFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule, i3.FormlyModule] });\nFormlyMatFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatFormFieldModule, imports: [[\n CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n FormlyModule.forChild({\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n }),\n ]] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatFormFieldModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [FormlyWrapperFormField],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n FormlyModule.forChild({\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n }),\n ],\n schemas: [NO_ERRORS_SCHEMA],\n }]\n }] });\n\nclass FieldType extends FieldType$1 {\n constructor() {\n super(...arguments);\n this.errorStateMatcher = { isErrorState: () => this.field && this.showError };\n this.stateChanges = new Subject();\n this._errorState = false;\n this._focused = false;\n }\n set matPrefix(prefix) {\n if (prefix) {\n this.props.prefix = prefix;\n }\n }\n set matTextPrefix(textPrefix) {\n if (textPrefix) {\n this.props.textPrefix = textPrefix;\n }\n }\n set matSuffix(suffix) {\n if (suffix) {\n this.props.suffix = suffix;\n }\n }\n set matTextSuffix(textSuffix) {\n if (textSuffix) {\n this.props.textSuffix = textSuffix;\n }\n }\n set _controls(controls) {\n this.attachControl(controls.length === 1 ? controls.first : this);\n }\n ngOnDestroy() {\n delete this.formField?._control;\n this.stateChanges.complete();\n }\n setDescribedByIds(_ids) { }\n onContainerClick(_event) {\n this.field.focus = true;\n this.stateChanges.next();\n }\n get errorState() {\n const showError = this.options.showError(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n return showError;\n }\n get controlType() {\n if (this.props.type) {\n return this.props.type;\n }\n const type = this.field.type;\n return type instanceof Type ? type.prototype.constructor.name : type;\n }\n get focused() {\n const focused = !!this.field.focus && !this.disabled;\n if (focused !== this._focused) {\n this._focused = focused;\n this.stateChanges.next();\n }\n return focused;\n }\n get disabled() {\n return !!this.props.disabled;\n }\n get required() {\n return !!this.props.required;\n }\n get placeholder() {\n return this.props.placeholder || '';\n }\n get shouldPlaceholderFloat() {\n return this.shouldLabelFloat;\n }\n get value() {\n return this.formControl?.value;\n }\n set value(value) {\n this.formControl?.patchValue(value);\n }\n get ngControl() {\n return this.formControl;\n }\n get empty() {\n return this.value == null || this.value === '';\n }\n get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n get formField() {\n return this.field?.['_formField'];\n }\n attachControl(control) {\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n // temporary fix for https://github.com/angular/material2/issues/6728\n const ngControl = control?.ngControl;\n if (ngControl?.valueAccessor?.hasOwnProperty('_formField')) {\n ngControl.valueAccessor['_formField'] = this.formField;\n }\n if (ngControl?.valueAccessor?.hasOwnProperty('_parentFormField')) {\n ngControl.valueAccessor['_parentFormField'] = this.formField;\n }\n ['prefix', 'suffix', 'textPrefix', 'textSuffix'].forEach((type) => ɵobserve(this.field, ['props', type], ({ currentValue }) => currentValue &&\n Promise.resolve().then(() => {\n this.options.detectChanges(this.field);\n })));\n // https://github.com/angular/components/issues/16209\n const setDescribedByIds = control.setDescribedByIds.bind(control);\n control.setDescribedByIds = (ids) => {\n setTimeout(() => setDescribedByIds(ids));\n };\n }\n }\n}\nFieldType.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FieldType, deps: null, target: i0.ɵɵFactoryTarget.Directive });\nFieldType.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"12.0.0\", version: \"13.3.12\", type: FieldType, viewQueries: [{ propertyName: \"matPrefix\", first: true, predicate: [\"matPrefix\"], descendants: true }, { propertyName: \"matTextPrefix\", first: true, predicate: [\"matTextPrefix\"], descendants: true }, { propertyName: \"matSuffix\", first: true, predicate: [\"matSuffix\"], descendants: true }, { propertyName: \"matTextSuffix\", first: true, predicate: [\"matTextSuffix\"], descendants: true }, { propertyName: \"_controls\", predicate: MatFormFieldControl, descendants: true }], usesInheritance: true, ngImport: i0 });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FieldType, decorators: [{\n type: Directive\n }], propDecorators: { matPrefix: [{\n type: ViewChild,\n args: ['matPrefix']\n }], matTextPrefix: [{\n type: ViewChild,\n args: ['matTextPrefix']\n }], matSuffix: [{\n type: ViewChild,\n args: ['matSuffix']\n }], matTextSuffix: [{\n type: ViewChild,\n args: ['matTextSuffix']\n }], _controls: [{\n type: ViewChildren,\n args: [MatFormFieldControl]\n }] } });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FieldType, FormlyMatFormFieldModule };\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';\nimport * as i1 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport * as i4 from '@ngx-formly/core';\nimport { FormlyModule } from '@ngx-formly/core';\nimport * as i3 from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport * as i2 from '@angular/material/input';\nimport { MatInputModule } from '@angular/material/input';\n\nclass FormlyFieldInput extends FieldType {\n get type() {\n return this.props.type || 'text';\n }\n}\nFormlyFieldInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldInput, deps: null, target: i0.ɵɵFactoryTarget.Component });\nFormlyFieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"12.0.0\", version: \"13.3.12\", type: FormlyFieldInput, selector: \"formly-field-mat-input\", usesInheritance: true, ngImport: i0, template: `\n \n \n \n \n `, isInline: true, directives: [{ type: i1.NgIf, selector: \"[ngIf]\", inputs: [\"ngIf\", \"ngIfThen\", \"ngIfElse\"] }, { type: i2.MatInput, selector: \"input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]\", inputs: [\"disabled\", \"id\", \"placeholder\", \"name\", \"required\", \"type\", \"errorStateMatcher\", \"aria-describedby\", \"value\", \"readonly\"], exportAs: [\"matInput\"] }, { type: i3.DefaultValueAccessor, selector: \"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]\" }, { type: i3.RequiredValidator, selector: \":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]\", inputs: [\"required\"] }, { type: i3.NgControlStatus, selector: \"[formControlName],[ngModel],[formControl]\" }, { type: i3.FormControlDirective, selector: \"[formControl]\", inputs: [\"formControl\", \"disabled\", \"ngModel\"], outputs: [\"ngModelChange\"], exportAs: [\"ngForm\"] }, { type: i4.ɵFormlyAttributes, selector: \"[formlyAttributes]\", inputs: [\"formlyAttributes\", \"id\"] }, { type: i3.NumberValueAccessor, selector: \"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]\" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldInput, decorators: [{\n type: Component,\n args: [{\n selector: 'formly-field-mat-input',\n template: `\n \n \n \n \n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n }]\n }] });\n\nclass FormlyMatInputModule {\n}\nFormlyMatInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlyMatInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatInputModule, declarations: [FormlyFieldInput], imports: [CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n FormlyMatFormFieldModule, i4.FormlyModule] });\nFormlyMatInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatInputModule, imports: [[\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n ],\n }),\n ]] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatInputModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n ],\n }),\n ],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FormlyFieldInput, FormlyMatInputModule };\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport * as i4 from '@ngx-formly/core';\nimport { FormlyModule } from '@ngx-formly/core';\nimport * as i2 from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport * as i1 from '@angular/material/input';\nimport { MAT_INPUT_VALUE_ACCESSOR, MatInputModule } from '@angular/material/input';\nimport * as i3 from '@angular/cdk/text-field';\n\nclass FormlyFieldTextArea extends FieldType {\n constructor() {\n super(...arguments);\n this.defaultOptions = {\n props: {\n cols: 1,\n rows: 1,\n },\n };\n }\n}\nFormlyFieldTextArea.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldTextArea, deps: null, target: i0.ɵɵFactoryTarget.Component });\nFormlyFieldTextArea.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"12.0.0\", version: \"13.3.12\", type: FormlyFieldTextArea, selector: \"formly-field-mat-textarea\", providers: [\n // fix for https://github.com/ngx-formly/ngx-formly/issues/1688\n // rely on formControl value instead of elementRef which return empty value in Firefox.\n { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: FormlyFieldTextArea },\n ], usesInheritance: true, ngImport: i0, template: `\n \n `, isInline: true, directives: [{ type: i1.MatInput, selector: \"input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]\", inputs: [\"disabled\", \"id\", \"placeholder\", \"name\", \"required\", \"type\", \"errorStateMatcher\", \"aria-describedby\", \"value\", \"readonly\"], exportAs: [\"matInput\"] }, { type: i2.DefaultValueAccessor, selector: \"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]\" }, { type: i3.CdkTextareaAutosize, selector: \"textarea[cdkTextareaAutosize]\", inputs: [\"cdkAutosizeMinRows\", \"cdkAutosizeMaxRows\", \"cdkTextareaAutosize\", \"placeholder\"], exportAs: [\"cdkTextareaAutosize\"] }, { type: i2.RequiredValidator, selector: \":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]\", inputs: [\"required\"] }, { type: i2.NgControlStatus, selector: \"[formControlName],[ngModel],[formControl]\" }, { type: i2.FormControlDirective, selector: \"[formControl]\", inputs: [\"formControl\", \"disabled\", \"ngModel\"], outputs: [\"ngModelChange\"], exportAs: [\"ngForm\"] }, { type: i4.ɵFormlyAttributes, selector: \"[formlyAttributes]\", inputs: [\"formlyAttributes\", \"id\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldTextArea, decorators: [{\n type: Component,\n args: [{\n selector: 'formly-field-mat-textarea',\n template: `\n \n `,\n providers: [\n // fix for https://github.com/ngx-formly/ngx-formly/issues/1688\n // rely on formControl value instead of elementRef which return empty value in Firefox.\n { provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: FormlyFieldTextArea },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n }]\n }] });\n\nclass FormlyMatTextAreaModule {\n}\nFormlyMatTextAreaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatTextAreaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlyMatTextAreaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatTextAreaModule, declarations: [FormlyFieldTextArea], imports: [CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n FormlyMatFormFieldModule, i4.FormlyModule] });\nFormlyMatTextAreaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatTextAreaModule, imports: [[\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'textarea',\n component: FormlyFieldTextArea,\n wrappers: ['form-field'],\n },\n ],\n }),\n ]] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatTextAreaModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [FormlyFieldTextArea],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'textarea',\n component: FormlyFieldTextArea,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FormlyFieldTextArea, FormlyMatTextAreaModule };\n","import * as i0 from '@angular/core';\nimport { Pipe, NgModule } from '@angular/core';\nimport { Observable, BehaviorSubject } from 'rxjs';\nimport { map, filter, tap } from 'rxjs/operators';\n\nclass FormlySelectOptionsPipe {\n transform(options, field) {\n if (!(options instanceof Observable)) {\n options = this.observableOf(options, field);\n }\n else {\n this.dispose();\n }\n return options.pipe(map((value) => this.transformOptions(value, field)));\n }\n ngOnDestroy() {\n this.dispose();\n }\n transformOptions(options, field) {\n const to = this.transformSelectProps(field);\n const opts = [];\n const groups = {};\n options?.forEach((option) => {\n const o = this.transformOption(option, to);\n if (o.group) {\n const id = groups[o.label];\n if (id === undefined) {\n groups[o.label] = opts.push(o) - 1;\n }\n else {\n o.group.forEach((o) => opts[id].group.push(o));\n }\n }\n else {\n opts.push(o);\n }\n });\n return opts;\n }\n transformOption(option, props) {\n const group = props.groupProp(option);\n if (Array.isArray(group)) {\n return {\n label: props.labelProp(option),\n group: group.map((opt) => this.transformOption(opt, props)),\n };\n }\n option = {\n label: props.labelProp(option),\n value: props.valueProp(option),\n disabled: !!props.disabledProp(option),\n };\n if (group) {\n return { label: group, group: [option] };\n }\n return option;\n }\n transformSelectProps(field) {\n const props = field?.props || field?.templateOptions || {};\n const selectPropFn = (prop) => (typeof prop === 'function' ? prop : (o) => o[prop]);\n return {\n groupProp: selectPropFn(props.groupProp || 'group'),\n labelProp: selectPropFn(props.labelProp || 'label'),\n valueProp: selectPropFn(props.valueProp || 'value'),\n disabledProp: selectPropFn(props.disabledProp || 'disabled'),\n };\n }\n dispose() {\n if (this._options) {\n this._options.complete();\n this._options = null;\n }\n if (this._subscription) {\n this._subscription.unsubscribe();\n this._subscription = null;\n }\n }\n observableOf(options, f) {\n this.dispose();\n if (f && f.options && f.options.fieldChanges) {\n this._subscription = f.options.fieldChanges\n .pipe(filter(({ property, type, field }) => {\n return (type === 'expressionChanges' &&\n (property.indexOf('templateOptions.options') === 0 || property.indexOf('props.options') === 0) &&\n field === f &&\n Array.isArray(field.props.options) &&\n !!this._options);\n }), tap(() => this._options.next(f.props.options)))\n .subscribe();\n }\n this._options = new BehaviorSubject(options);\n return this._options.asObservable();\n }\n}\nFormlySelectOptionsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlySelectOptionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });\nFormlySelectOptionsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlySelectOptionsPipe, name: \"formlySelectOptions\" });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlySelectOptionsPipe, decorators: [{\n type: Pipe,\n args: [{ name: 'formlySelectOptions' }]\n }] });\n\nclass FormlySelectModule {\n}\nFormlySelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlySelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlySelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlySelectModule, declarations: [FormlySelectOptionsPipe], exports: [FormlySelectOptionsPipe] });\nFormlySelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlySelectModule });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlySelectModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [FormlySelectOptionsPipe],\n exports: [FormlySelectOptionsPipe],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FormlySelectModule, FormlySelectOptionsPipe };\n","import * as i0 from '@angular/core';\nimport { forwardRef, InjectionToken, EventEmitter, booleanAttribute, Directive, Output, ContentChildren, Input, numberAttribute, ANIMATION_MODULE_TYPE, ElementRef, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Inject, Attribute, ViewChild, NgModule } from '@angular/core';\nimport { MatRipple, _MatInternalFormField, MatCommonModule, MatRippleModule } from '@angular/material/core';\nimport * as i1 from '@angular/cdk/a11y';\nimport * as i2 from '@angular/cdk/collections';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n/** Change event object emitted by radio button and radio group. */\nclass MatRadioChange {\n constructor(\n /** The radio button that emits the change event. */\n source, \n /** The value of the radio button. */\n value) {\n this.source = source;\n this.value = value;\n }\n}\n/**\n * Provider Expression that allows mat-radio-group to register as a ControlValueAccessor. This\n * allows it to support [(ngModel)] and ngControl.\n * @docs-private\n */\nconst MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatRadioGroup),\n multi: true,\n};\n/**\n * Injection token that can be used to inject instances of `MatRadioGroup`. It serves as\n * alternative token to the actual `MatRadioGroup` class which could cause unnecessary\n * retention of the class and its component metadata.\n */\nconst MAT_RADIO_GROUP = new InjectionToken('MatRadioGroup');\nconst MAT_RADIO_DEFAULT_OPTIONS = new InjectionToken('mat-radio-default-options', {\n providedIn: 'root',\n factory: MAT_RADIO_DEFAULT_OPTIONS_FACTORY,\n});\nfunction MAT_RADIO_DEFAULT_OPTIONS_FACTORY() {\n return {\n color: 'accent',\n };\n}\n/**\n * A group of radio buttons. May contain one or more `` elements.\n */\nclass MatRadioGroup {\n /** Name of the radio button group. All radio buttons inside this group will use this name. */\n get name() {\n return this._name;\n }\n set name(value) {\n this._name = value;\n this._updateRadioButtonNames();\n }\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n get labelPosition() {\n return this._labelPosition;\n }\n set labelPosition(v) {\n this._labelPosition = v === 'before' ? 'before' : 'after';\n this._markRadiosForCheck();\n }\n /**\n * Value for the radio-group. Should equal the value of the selected radio button if there is\n * a corresponding radio button with a matching value. If there is not such a corresponding\n * radio button, this value persists to be applied in case a new radio button is added with a\n * matching value.\n */\n get value() {\n return this._value;\n }\n set value(newValue) {\n if (this._value !== newValue) {\n // Set this before proceeding to ensure no circular loop occurs with selection.\n this._value = newValue;\n this._updateSelectedRadioFromValue();\n this._checkSelectedRadioButton();\n }\n }\n _checkSelectedRadioButton() {\n if (this._selected && !this._selected.checked) {\n this._selected.checked = true;\n }\n }\n /**\n * The currently selected radio button. If set to a new radio button, the radio group value\n * will be updated to match the new selected button.\n */\n get selected() {\n return this._selected;\n }\n set selected(selected) {\n this._selected = selected;\n this.value = selected ? selected.value : null;\n this._checkSelectedRadioButton();\n }\n /** Whether the radio group is disabled */\n get disabled() {\n return this._disabled;\n }\n set disabled(value) {\n this._disabled = value;\n this._markRadiosForCheck();\n }\n /** Whether the radio group is required */\n get required() {\n return this._required;\n }\n set required(value) {\n this._required = value;\n this._markRadiosForCheck();\n }\n constructor(_changeDetector) {\n this._changeDetector = _changeDetector;\n /** Selected value for the radio group. */\n this._value = null;\n /** The HTML name attribute applied to radio buttons in this group. */\n this._name = `mat-radio-group-${nextUniqueId++}`;\n /** The currently selected radio button. Should match value. */\n this._selected = null;\n /** Whether the `value` has been set to its initial value. */\n this._isInitialized = false;\n /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */\n this._labelPosition = 'after';\n /** Whether the radio group is disabled. */\n this._disabled = false;\n /** Whether the radio group is required. */\n this._required = false;\n /** The method to be called in order to update ngModel */\n this._controlValueAccessorChangeFn = () => { };\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n * @docs-private\n */\n this.onTouched = () => { };\n /**\n * Event emitted when the group value changes.\n * Change events are only emitted when the value changes due to user interaction with\n * a radio button (the same behavior as ` `).\n */\n this.change = new EventEmitter();\n }\n /**\n * Initialize properties once content children are available.\n * This allows us to propagate relevant attributes to associated buttons.\n */\n ngAfterContentInit() {\n // Mark this component as initialized in AfterContentInit because the initial value can\n // possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the\n // NgModel occurs *after* the OnInit of the MatRadioGroup.\n this._isInitialized = true;\n // Clear the `selected` button when it's destroyed since the tabindex of the rest of the\n // buttons depends on it. Note that we don't clear the `value`, because the radio button\n // may be swapped out with a similar one and there are some internal apps that depend on\n // that behavior.\n this._buttonChanges = this._radios.changes.subscribe(() => {\n if (this.selected && !this._radios.find(radio => radio === this.selected)) {\n this._selected = null;\n }\n });\n }\n ngOnDestroy() {\n this._buttonChanges?.unsubscribe();\n }\n /**\n * Mark this group as being \"touched\" (for ngModel). Meant to be called by the contained\n * radio buttons upon their blur.\n */\n _touch() {\n if (this.onTouched) {\n this.onTouched();\n }\n }\n _updateRadioButtonNames() {\n if (this._radios) {\n this._radios.forEach(radio => {\n radio.name = this.name;\n radio._markForCheck();\n });\n }\n }\n /** Updates the `selected` radio button from the internal _value state. */\n _updateSelectedRadioFromValue() {\n // If the value already matches the selected radio, do nothing.\n const isAlreadySelected = this._selected !== null && this._selected.value === this._value;\n if (this._radios && !isAlreadySelected) {\n this._selected = null;\n this._radios.forEach(radio => {\n radio.checked = this.value === radio.value;\n if (radio.checked) {\n this._selected = radio;\n }\n });\n }\n }\n /** Dispatch change event with current selection and group value. */\n _emitChangeEvent() {\n if (this._isInitialized) {\n this.change.emit(new MatRadioChange(this._selected, this._value));\n }\n }\n _markRadiosForCheck() {\n if (this._radios) {\n this._radios.forEach(radio => radio._markForCheck());\n }\n }\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value\n */\n writeValue(value) {\n this.value = value;\n this._changeDetector.markForCheck();\n }\n /**\n * Registers a callback to be triggered when the model value changes.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnChange(fn) {\n this._controlValueAccessorChangeFn = fn;\n }\n /**\n * Registers a callback to be triggered when the control is touched.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnTouched(fn) {\n this.onTouched = fn;\n }\n /**\n * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.\n * @param isDisabled Whether the control should be disabled.\n */\n setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n this._changeDetector.markForCheck();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRadioGroup, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"17.2.0\", type: MatRadioGroup, isStandalone: true, selector: \"mat-radio-group\", inputs: { color: \"color\", name: \"name\", labelPosition: \"labelPosition\", value: \"value\", selected: \"selected\", disabled: [\"disabled\", \"disabled\", booleanAttribute], required: [\"required\", \"required\", booleanAttribute] }, outputs: { change: \"change\" }, host: { attributes: { \"role\": \"radiogroup\" }, classAttribute: \"mat-mdc-radio-group\" }, providers: [\n MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,\n { provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup },\n ], queries: [{ propertyName: \"_radios\", predicate: i0.forwardRef(() => MatRadioButton), descendants: true }], exportAs: [\"matRadioGroup\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRadioGroup, decorators: [{\n type: Directive,\n args: [{\n selector: 'mat-radio-group',\n exportAs: 'matRadioGroup',\n providers: [\n MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,\n { provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup },\n ],\n host: {\n 'role': 'radiogroup',\n 'class': 'mat-mdc-radio-group',\n },\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { change: [{\n type: Output\n }], _radios: [{\n type: ContentChildren,\n args: [forwardRef(() => MatRadioButton), { descendants: true }]\n }], color: [{\n type: Input\n }], name: [{\n type: Input\n }], labelPosition: [{\n type: Input\n }], value: [{\n type: Input\n }], selected: [{\n type: Input\n }], disabled: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], required: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }] } });\nclass MatRadioButton {\n /** Whether this radio button is checked. */\n get checked() {\n return this._checked;\n }\n set checked(value) {\n if (this._checked !== value) {\n this._checked = value;\n if (value && this.radioGroup && this.radioGroup.value !== this.value) {\n this.radioGroup.selected = this;\n }\n else if (!value && this.radioGroup && this.radioGroup.value === this.value) {\n // When unchecking the selected radio button, update the selected radio\n // property on the group.\n this.radioGroup.selected = null;\n }\n if (value) {\n // Notify all radio buttons with the same name to un-check.\n this._radioDispatcher.notify(this.id, this.name);\n }\n this._changeDetector.markForCheck();\n }\n }\n /** The value of this radio button. */\n get value() {\n return this._value;\n }\n set value(value) {\n if (this._value !== value) {\n this._value = value;\n if (this.radioGroup !== null) {\n if (!this.checked) {\n // Update checked when the value changed to match the radio group's value\n this.checked = this.radioGroup.value === value;\n }\n if (this.checked) {\n this.radioGroup.selected = this;\n }\n }\n }\n }\n /** Whether the label should appear after or before the radio button. Defaults to 'after' */\n get labelPosition() {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }\n set labelPosition(value) {\n this._labelPosition = value;\n }\n /** Whether the radio button is disabled. */\n get disabled() {\n return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);\n }\n set disabled(value) {\n this._setDisabled(value);\n }\n /** Whether the radio button is required. */\n get required() {\n return this._required || (this.radioGroup && this.radioGroup.required);\n }\n set required(value) {\n this._required = value;\n }\n /** Theme color of the radio button. */\n get color() {\n // As per Material design specifications the selection control radio should use the accent color\n // palette by default. https://material.io/guidelines/components/selection-controls.html\n return (this._color ||\n (this.radioGroup && this.radioGroup.color) ||\n (this._providerOverride && this._providerOverride.color) ||\n 'accent');\n }\n set color(newValue) {\n this._color = newValue;\n }\n /** ID of the native input element inside `` */\n get inputId() {\n return `${this.id || this._uniqueId}-input`;\n }\n constructor(radioGroup, _elementRef, _changeDetector, _focusMonitor, _radioDispatcher, animationMode, _providerOverride, tabIndex) {\n this._elementRef = _elementRef;\n this._changeDetector = _changeDetector;\n this._focusMonitor = _focusMonitor;\n this._radioDispatcher = _radioDispatcher;\n this._providerOverride = _providerOverride;\n this._uniqueId = `mat-radio-${++nextUniqueId}`;\n /** The unique ID for the radio button. */\n this.id = this._uniqueId;\n /** Whether ripples are disabled inside the radio button */\n this.disableRipple = false;\n /** Tabindex of the radio button. */\n this.tabIndex = 0;\n /**\n * Event emitted when the checked state of this radio button changes.\n * Change events are only emitted when the value changes due to user interaction with\n * the radio button (the same behavior as ` `).\n */\n this.change = new EventEmitter();\n /** Whether this radio is checked. */\n this._checked = false;\n /** Value assigned to this radio. */\n this._value = null;\n /** Unregister function for _radioDispatcher */\n this._removeUniqueSelectionListener = () => { };\n // Assertions. Ideally these should be stripped out by the compiler.\n // TODO(jelbourn): Assert that there's no name binding AND a parent radio group.\n this.radioGroup = radioGroup;\n this._noopAnimations = animationMode === 'NoopAnimations';\n if (tabIndex) {\n this.tabIndex = numberAttribute(tabIndex, 0);\n }\n }\n /** Focuses the radio button. */\n focus(options, origin) {\n if (origin) {\n this._focusMonitor.focusVia(this._inputElement, origin, options);\n }\n else {\n this._inputElement.nativeElement.focus(options);\n }\n }\n /**\n * Marks the radio button as needing checking for change detection.\n * This method is exposed because the parent radio group will directly\n * update bound properties of the radio button.\n */\n _markForCheck() {\n // When group value changes, the button will not be notified. Use `markForCheck` to explicit\n // update radio button's status\n this._changeDetector.markForCheck();\n }\n ngOnInit() {\n if (this.radioGroup) {\n // If the radio is inside a radio group, determine if it should be checked\n this.checked = this.radioGroup.value === this._value;\n if (this.checked) {\n this.radioGroup.selected = this;\n }\n // Copy name from parent radio group\n this.name = this.radioGroup.name;\n }\n this._removeUniqueSelectionListener = this._radioDispatcher.listen((id, name) => {\n if (id !== this.id && name === this.name) {\n this.checked = false;\n }\n });\n }\n ngDoCheck() {\n this._updateTabIndex();\n }\n ngAfterViewInit() {\n this._updateTabIndex();\n this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {\n if (!focusOrigin && this.radioGroup) {\n this.radioGroup._touch();\n }\n });\n }\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._removeUniqueSelectionListener();\n }\n /** Dispatch change event with current value. */\n _emitChangeEvent() {\n this.change.emit(new MatRadioChange(this, this._value));\n }\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n _onInputClick(event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `radio-button` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n }\n /** Triggered when the radio button receives an interaction from the user. */\n _onInputInteraction(event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation();\n if (!this.checked && !this.disabled) {\n const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;\n this.checked = true;\n this._emitChangeEvent();\n if (this.radioGroup) {\n this.radioGroup._controlValueAccessorChangeFn(this.value);\n if (groupValueChanged) {\n this.radioGroup._emitChangeEvent();\n }\n }\n }\n }\n /** Triggered when the user clicks on the touch target. */\n _onTouchTargetClick(event) {\n this._onInputInteraction(event);\n if (!this.disabled) {\n // Normally the input should be focused already, but if the click\n // comes from the touch target, then we might have to focus it ourselves.\n this._inputElement.nativeElement.focus();\n }\n }\n /** Sets the disabled state and marks for check if a change occurred. */\n _setDisabled(value) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._changeDetector.markForCheck();\n }\n }\n /** Gets the tabindex for the underlying input element. */\n _updateTabIndex() {\n const group = this.radioGroup;\n let value;\n // Implement a roving tabindex if the button is inside a group. For most cases this isn't\n // necessary, because the browser handles the tab order for inputs inside a group automatically,\n // but we need an explicitly higher tabindex for the selected button in order for things like\n // the focus trap to pick it up correctly.\n if (!group || !group.selected || this.disabled) {\n value = this.tabIndex;\n }\n else {\n value = group.selected === this ? this.tabIndex : -1;\n }\n if (value !== this._previousTabIndex) {\n // We have to set the tabindex directly on the DOM node, because it depends on\n // the selected state which is prone to \"changed after checked errors\".\n const input = this._inputElement?.nativeElement;\n if (input) {\n input.setAttribute('tabindex', value + '');\n this._previousTabIndex = value;\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRadioButton, deps: [{ token: MAT_RADIO_GROUP, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.FocusMonitor }, { token: i2.UniqueSelectionDispatcher }, { token: ANIMATION_MODULE_TYPE, optional: true }, { token: MAT_RADIO_DEFAULT_OPTIONS, optional: true }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"16.1.0\", version: \"17.2.0\", type: MatRadioButton, isStandalone: true, selector: \"mat-radio-button\", inputs: { id: \"id\", name: \"name\", ariaLabel: [\"aria-label\", \"ariaLabel\"], ariaLabelledby: [\"aria-labelledby\", \"ariaLabelledby\"], ariaDescribedby: [\"aria-describedby\", \"ariaDescribedby\"], disableRipple: [\"disableRipple\", \"disableRipple\", booleanAttribute], tabIndex: [\"tabIndex\", \"tabIndex\", (value) => (value == null ? 0 : numberAttribute(value))], checked: [\"checked\", \"checked\", booleanAttribute], value: \"value\", labelPosition: \"labelPosition\", disabled: [\"disabled\", \"disabled\", booleanAttribute], required: [\"required\", \"required\", booleanAttribute], color: \"color\" }, outputs: { change: \"change\" }, host: { listeners: { \"focus\": \"_inputElement.nativeElement.focus()\" }, properties: { \"attr.id\": \"id\", \"class.mat-primary\": \"color === \\\"primary\\\"\", \"class.mat-accent\": \"color === \\\"accent\\\"\", \"class.mat-warn\": \"color === \\\"warn\\\"\", \"class.mat-mdc-radio-checked\": \"checked\", \"class._mat-animation-noopable\": \"_noopAnimations\", \"attr.tabindex\": \"null\", \"attr.aria-label\": \"null\", \"attr.aria-labelledby\": \"null\", \"attr.aria-describedby\": \"null\" }, classAttribute: \"mat-mdc-radio-button\" }, viewQueries: [{ propertyName: \"_inputElement\", first: true, predicate: [\"input\"], descendants: true }, { propertyName: \"_rippleTrigger\", first: true, predicate: [\"formField\"], descendants: true, read: ElementRef, static: true }], exportAs: [\"matRadioButton\"], ngImport: i0, template: \"\\n\", styles: [\".mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:\\\"\\\";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:\\\"\\\";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:\\\"\\\"}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-radio-touch-target-display)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}\"], dependencies: [{ kind: \"directive\", type: MatRipple, selector: \"[mat-ripple], [matRipple]\", inputs: [\"matRippleColor\", \"matRippleUnbounded\", \"matRippleCentered\", \"matRippleRadius\", \"matRippleAnimation\", \"matRippleDisabled\", \"matRippleTrigger\"], exportAs: [\"matRipple\"] }, { kind: \"component\", type: _MatInternalFormField, selector: \"div[mat-internal-form-field]\", inputs: [\"labelPosition\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRadioButton, decorators: [{\n type: Component,\n args: [{ selector: 'mat-radio-button', host: {\n 'class': 'mat-mdc-radio-button',\n '[attr.id]': 'id',\n '[class.mat-primary]': 'color === \"primary\"',\n '[class.mat-accent]': 'color === \"accent\"',\n '[class.mat-warn]': 'color === \"warn\"',\n '[class.mat-mdc-radio-checked]': 'checked',\n '[class._mat-animation-noopable]': '_noopAnimations',\n // Needs to be removed since it causes some a11y issues (see #21266).\n '[attr.tabindex]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n // Note: under normal conditions focus shouldn't land on this element, however it may be\n // programmatically set, for example inside of a focus trap, in this case we want to forward\n // the focus to the native element.\n '(focus)': '_inputElement.nativeElement.focus()',\n }, exportAs: 'matRadioButton', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatRipple, _MatInternalFormField], template: \"\\n\", styles: [\".mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:\\\"\\\";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:\\\"\\\";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:\\\"\\\"}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-radio-touch-target-display)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}\"] }]\n }], ctorParameters: () => [{ type: MatRadioGroup, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_RADIO_GROUP]\n }] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.FocusMonitor }, { type: i2.UniqueSelectionDispatcher }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [ANIMATION_MODULE_TYPE]\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_RADIO_DEFAULT_OPTIONS]\n }] }, { type: undefined, decorators: [{\n type: Attribute,\n args: ['tabindex']\n }] }], propDecorators: { id: [{\n type: Input\n }], name: [{\n type: Input\n }], ariaLabel: [{\n type: Input,\n args: ['aria-label']\n }], ariaLabelledby: [{\n type: Input,\n args: ['aria-labelledby']\n }], ariaDescribedby: [{\n type: Input,\n args: ['aria-describedby']\n }], disableRipple: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], tabIndex: [{\n type: Input,\n args: [{\n transform: (value) => (value == null ? 0 : numberAttribute(value)),\n }]\n }], checked: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], value: [{\n type: Input\n }], labelPosition: [{\n type: Input\n }], disabled: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], required: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], color: [{\n type: Input\n }], change: [{\n type: Output\n }], _inputElement: [{\n type: ViewChild,\n args: ['input']\n }], _rippleTrigger: [{\n type: ViewChild,\n args: ['formField', { read: ElementRef, static: true }]\n }] } });\n\nclass MatRadioModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRadioModule, imports: [MatCommonModule, CommonModule, MatRippleModule, MatRadioGroup, MatRadioButton], exports: [MatCommonModule, MatRadioGroup, MatRadioButton] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRadioModule, imports: [MatCommonModule, CommonModule, MatRippleModule, MatRadioButton, MatCommonModule] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatRadioModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [MatCommonModule, CommonModule, MatRippleModule, MatRadioGroup, MatRadioButton],\n exports: [MatCommonModule, MatRadioGroup, MatRadioButton],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { MAT_RADIO_DEFAULT_OPTIONS, MAT_RADIO_DEFAULT_OPTIONS_FACTORY, MAT_RADIO_GROUP, MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, MatRadioButton, MatRadioChange, MatRadioGroup, MatRadioModule };\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';\nimport * as i4 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport * as i3 from '@ngx-formly/core';\nimport { ɵobserve, FormlyModule } from '@ngx-formly/core';\nimport * as i2 from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport * as i5 from '@ngx-formly/core/select';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport * as i1 from '@angular/material/radio';\nimport { MatRadioGroup, MatRadioModule } from '@angular/material/radio';\n\nclass FormlyFieldRadio extends FieldType {\n constructor() {\n super(...arguments);\n this.defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always',\n tabindex: -1,\n },\n };\n }\n ngAfterViewInit() {\n this.focusObserver = ɵobserve(this.field, ['focus'], ({ currentValue }) => {\n if (this.props.tabindex === -1 && currentValue && this.radioGroup._radios.length > 0) {\n // https://github.com/ngx-formly/ngx-formly/issues/2498\n setTimeout(() => {\n const radio = this.radioGroup.selected ? this.radioGroup.selected : this.radioGroup._radios.first;\n radio.focus();\n });\n }\n });\n }\n // TODO: find a solution to prevent scroll on focus\n onContainerClick() { }\n ngOnDestroy() {\n super.ngOnDestroy();\n this.focusObserver && this.focusObserver.unsubscribe();\n }\n}\nFormlyFieldRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component });\nFormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"12.0.0\", version: \"13.3.12\", type: FormlyFieldRadio, selector: \"formly-field-mat-radio\", viewQueries: [{ propertyName: \"radioGroup\", first: true, predicate: MatRadioGroup, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `\n \n \n {{ option.label }}\n \n \n `, isInline: true, components: [{ type: i1.MatRadioButton, selector: \"mat-radio-button\", inputs: [\"disableRipple\", \"tabIndex\"], exportAs: [\"matRadioButton\"] }], directives: [{ type: i1.MatRadioGroup, selector: \"mat-radio-group\", exportAs: [\"matRadioGroup\"] }, { type: i2.NgControlStatus, selector: \"[formControlName],[ngModel],[formControl]\" }, { type: i2.FormControlDirective, selector: \"[formControl]\", inputs: [\"formControl\", \"disabled\", \"ngModel\"], outputs: [\"ngModelChange\"], exportAs: [\"ngForm\"] }, { type: i3.ɵFormlyAttributes, selector: \"[formlyAttributes]\", inputs: [\"formlyAttributes\", \"id\"] }, { type: i2.RequiredValidator, selector: \":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]\", inputs: [\"required\"] }, { type: i4.NgForOf, selector: \"[ngFor][ngForOf]\", inputs: [\"ngForOf\", \"ngForTrackBy\", \"ngForTemplate\"] }], pipes: { \"async\": i4.AsyncPipe, \"formlySelectOptions\": i5.FormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldRadio, decorators: [{\n type: Component,\n args: [{\n selector: 'formly-field-mat-radio',\n template: `\n \n \n {{ option.label }}\n \n \n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n }]\n }], propDecorators: { radioGroup: [{\n type: ViewChild,\n args: [MatRadioGroup, { static: true }]\n }] } });\n\nclass FormlyMatRadioModule {\n}\nFormlyMatRadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlyMatRadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatRadioModule, declarations: [FormlyFieldRadio], imports: [CommonModule,\n ReactiveFormsModule,\n MatRadioModule,\n FormlyMatFormFieldModule,\n FormlySelectModule, i3.FormlyModule] });\nFormlyMatRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatRadioModule, imports: [[\n CommonModule,\n ReactiveFormsModule,\n MatRadioModule,\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\n }),\n ]] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatRadioModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [FormlyFieldRadio],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatRadioModule,\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FormlyFieldRadio, FormlyMatRadioModule };\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';\nimport * as i5 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport * as i4 from '@ngx-formly/core';\nimport { FormlyModule } from '@ngx-formly/core';\nimport * as i3 from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport * as i2 from '@angular/material/checkbox';\nimport { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';\nimport * as i1 from '@angular/cdk/a11y';\n\nclass FormlyFieldCheckbox extends FieldType {\n constructor(renderer, focusMonitor) {\n super();\n this.renderer = renderer;\n this.focusMonitor = focusMonitor;\n this.defaultOptions = {\n props: {\n hideFieldUnderline: true,\n indeterminate: true,\n floatLabel: 'always',\n hideLabel: true,\n color: 'accent', // workaround for https://github.com/angular/components/issues/18465\n },\n };\n }\n onContainerClick(event) {\n this.checkbox.focus();\n super.onContainerClick(event);\n }\n ngAfterViewInit() {\n if (this.checkbox) {\n this.focusMonitor.monitor(this.checkbox._inputElement, true).subscribe((focusOrigin) => {\n this.field.focus = !!focusOrigin;\n this.stateChanges.next();\n if (focusOrigin) {\n this.props.focus && this.props.focus(this.field);\n }\n else {\n this.props.blur && this.props.blur(this.field);\n }\n });\n }\n }\n ngAfterViewChecked() {\n if (this.required !== this._required && this.checkbox && this.checkbox._inputElement) {\n this._required = this.required;\n const inputElement = this.checkbox._inputElement.nativeElement;\n if (this.required) {\n this.renderer.setAttribute(inputElement, 'required', 'required');\n }\n else {\n this.renderer.removeAttribute(inputElement, 'required');\n }\n }\n }\n ngOnDestroy() {\n super.ngOnDestroy();\n if (this.checkbox) {\n this.focusMonitor.stopMonitoring(this.checkbox._inputElement);\n }\n }\n}\nFormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldCheckbox, deps: [{ token: i0.Renderer2 }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });\nFormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"12.0.0\", version: \"13.3.12\", type: FormlyFieldCheckbox, selector: \"formly-field-mat-checkbox\", viewQueries: [{ propertyName: \"checkbox\", first: true, predicate: MatCheckbox, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `\n \n {{ props.label }}\n * \n \n `, isInline: true, components: [{ type: i2.MatCheckbox, selector: \"mat-checkbox\", inputs: [\"disableRipple\", \"color\", \"tabIndex\", \"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"id\", \"required\", \"labelPosition\", \"name\", \"value\", \"checked\", \"disabled\", \"indeterminate\"], outputs: [\"change\", \"indeterminateChange\"], exportAs: [\"matCheckbox\"] }], directives: [{ type: i3.NgControlStatus, selector: \"[formControlName],[ngModel],[formControl]\" }, { type: i3.FormControlDirective, selector: \"[formControl]\", inputs: [\"formControl\", \"disabled\", \"ngModel\"], outputs: [\"ngModelChange\"], exportAs: [\"ngForm\"] }, { type: i4.ɵFormlyAttributes, selector: \"[formlyAttributes]\", inputs: [\"formlyAttributes\", \"id\"] }, { type: i5.NgIf, selector: \"[ngIf]\", inputs: [\"ngIf\", \"ngIfThen\", \"ngIfElse\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{\n type: Component,\n args: [{\n selector: 'formly-field-mat-checkbox',\n template: `\n \n {{ props.label }}\n * \n \n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n }]\n }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i1.FocusMonitor }]; }, propDecorators: { checkbox: [{\n type: ViewChild,\n args: [MatCheckbox, { static: true }]\n }] } });\n\nclass FormlyMatCheckboxModule {\n}\nFormlyMatCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlyMatCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,\n ReactiveFormsModule,\n MatCheckboxModule,\n FormlyMatFormFieldModule, i4.FormlyModule] });\nFormlyMatCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatCheckboxModule, imports: [[\n CommonModule,\n ReactiveFormsModule,\n MatCheckboxModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'checkbox',\n component: FormlyFieldCheckbox,\n wrappers: ['form-field'],\n },\n {\n name: 'boolean',\n extends: 'checkbox',\n },\n ],\n }),\n ]] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatCheckboxModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatCheckboxModule,\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'checkbox',\n component: FormlyFieldCheckbox,\n wrappers: ['form-field'],\n },\n {\n name: 'boolean',\n extends: 'checkbox',\n },\n ],\n }),\n ],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FormlyFieldCheckbox, FormlyMatCheckboxModule };\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, ViewChildren, NgModule } from '@angular/core';\nimport * as i2 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport * as i3 from '@ngx-formly/core';\nimport { FormlyModule } from '@ngx-formly/core';\nimport * as i4 from '@ngx-formly/core/select';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport * as i1 from '@angular/material/checkbox';\nimport { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';\n\nclass FormlyFieldMultiCheckbox extends FieldType {\n constructor() {\n super(...arguments);\n this.defaultOptions = {\n props: {\n hideFieldUnderline: true,\n floatLabel: 'always',\n color: 'accent', // workaround for https://github.com/angular/components/issues/18465\n },\n };\n }\n onChange(value, checked) {\n this.formControl.markAsDirty();\n if (this.props.type === 'array') {\n this.formControl.patchValue(checked\n ? [...(this.formControl.value || []), value]\n : [...(this.formControl.value || [])].filter((o) => o !== value));\n }\n else {\n this.formControl.patchValue({ ...this.formControl.value, [value]: checked });\n }\n this.formControl.markAsTouched();\n }\n // TODO: find a solution to prevent scroll on focus\n onContainerClick() { }\n isChecked(option) {\n const value = this.formControl.value;\n return value && (this.props.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);\n }\n}\nFormlyFieldMultiCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldMultiCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component });\nFormlyFieldMultiCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"12.0.0\", version: \"13.3.12\", type: FormlyFieldMultiCheckbox, selector: \"formly-field-mat-multicheckbox\", host: { properties: { \"id\": \"id\" } }, viewQueries: [{ propertyName: \"checkboxes\", predicate: MatCheckbox, descendants: true }], usesInheritance: true, ngImport: i0, template: `\n \n \n {{ option.label }}\n \n \n `, isInline: true, components: [{ type: i1.MatCheckbox, selector: \"mat-checkbox\", inputs: [\"disableRipple\", \"color\", \"tabIndex\", \"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"id\", \"required\", \"labelPosition\", \"name\", \"value\", \"checked\", \"disabled\", \"indeterminate\"], outputs: [\"change\", \"indeterminateChange\"], exportAs: [\"matCheckbox\"] }], directives: [{ type: i2.NgForOf, selector: \"[ngFor][ngForOf]\", inputs: [\"ngForOf\", \"ngForTrackBy\", \"ngForTemplate\"] }, { type: i3.ɵFormlyAttributes, selector: \"[formlyAttributes]\", inputs: [\"formlyAttributes\", \"id\"] }], pipes: { \"async\": i2.AsyncPipe, \"formlySelectOptions\": i4.FormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldMultiCheckbox, decorators: [{\n type: Component,\n args: [{\n selector: 'formly-field-mat-multicheckbox',\n template: `\n \n \n {{ option.label }}\n \n \n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[id]': 'id',\n },\n }]\n }], propDecorators: { checkboxes: [{\n type: ViewChildren,\n args: [MatCheckbox]\n }] } });\n\nclass FormlyMatMultiCheckboxModule {\n}\nFormlyMatMultiCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatMultiCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlyMatMultiCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatMultiCheckboxModule, declarations: [FormlyFieldMultiCheckbox], imports: [CommonModule,\n ReactiveFormsModule,\n MatCheckboxModule,\n FormlyMatFormFieldModule,\n FormlySelectModule, i3.FormlyModule] });\nFormlyMatMultiCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatMultiCheckboxModule, imports: [[\n CommonModule,\n ReactiveFormsModule,\n MatCheckboxModule,\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n }),\n ]] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatMultiCheckboxModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatCheckboxModule,\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FormlyFieldMultiCheckbox, FormlyMatMultiCheckboxModule };\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';\nimport * as i5 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport * as i3 from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport * as i4 from '@ngx-formly/core';\nimport { ɵobserve, FormlyModule } from '@ngx-formly/core';\nimport * as i6 from '@ngx-formly/core/select';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport * as i2 from '@angular/material/select';\nimport { MatSelect, MatSelectModule } from '@angular/material/select';\nimport * as i1 from '@angular/material/core';\nimport { MatPseudoCheckboxModule } from '@angular/material/core';\n\nclass FormlyFieldSelect extends FieldType {\n constructor() {\n super(...arguments);\n this.defaultOptions = {\n props: {\n compareWith(o1, o2) {\n return o1 === o2;\n },\n },\n };\n }\n set select(select) {\n ɵobserve(select, ['_parentFormField', '_textField'], ({ currentValue }) => {\n if (currentValue) {\n select._preferredOverlayOrigin = select._parentFormField.getConnectedOverlayOrigin();\n }\n });\n }\n getSelectAllState(options) {\n if (this.empty || this.value.length === 0) {\n return null;\n }\n return this.value.length !== this.getSelectAllValue(options).length ? 'indeterminate' : 'checked';\n }\n toggleSelectAll(options) {\n const selectAllValue = this.getSelectAllValue(options);\n this.formControl.markAsDirty();\n this.formControl.setValue(!this.value || this.value.length !== selectAllValue.length ? selectAllValue : []);\n }\n change($event) {\n this.props.change?.(this.field, $event);\n }\n _getAriaLabelledby() {\n if (this.props.attributes?.['aria-labelledby']) {\n return this.props.attributes['aria-labelledby'];\n }\n return this.formField?._labelId;\n }\n _getAriaLabel() {\n return this.props.attributes?.['aria-label'];\n }\n getSelectAllValue(options) {\n if (!this.selectAllValue || options !== this.selectAllValue.options) {\n const flatOptions = [];\n options.forEach((o) => (o.group ? flatOptions.push(...o.group) : flatOptions.push(o)));\n this.selectAllValue = {\n options,\n value: flatOptions.filter((o) => !o.disabled).map((o) => o.value),\n };\n }\n return this.selectAllValue.value;\n }\n}\nFormlyFieldSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });\nFormlyFieldSelect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"12.0.0\", version: \"13.3.12\", type: FormlyFieldSelect, selector: \"formly-field-mat-select\", viewQueries: [{ propertyName: \"select\", first: true, predicate: MatSelect, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `\n \n \n \n \n {{ props.selectAllOption }}\n \n \n\n \n \n \n \n \n \n \n {{ child.label }}\n \n \n {{ item.label }} \n \n \n \n `, isInline: true, components: [{ type: i1.MatOption, selector: \"mat-option\", exportAs: [\"matOption\"] }, { type: i1.MatPseudoCheckbox, selector: \"mat-pseudo-checkbox\", inputs: [\"state\", \"disabled\"] }, { type: i2.MatSelect, selector: \"mat-select\", inputs: [\"disabled\", \"disableRipple\", \"tabIndex\"], exportAs: [\"matSelect\"] }, { type: i1.MatOptgroup, selector: \"mat-optgroup\", inputs: [\"disabled\"], exportAs: [\"matOptgroup\"] }], directives: [{ type: i3.NgControlStatus, selector: \"[formControlName],[ngModel],[formControl]\" }, { type: i3.FormControlDirective, selector: \"[formControl]\", inputs: [\"formControl\", \"disabled\", \"ngModel\"], outputs: [\"ngModelChange\"], exportAs: [\"ngForm\"] }, { type: i4.ɵFormlyAttributes, selector: \"[formlyAttributes]\", inputs: [\"formlyAttributes\", \"id\"] }, { type: i3.RequiredValidator, selector: \":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]\", inputs: [\"required\"] }, { type: i5.NgIf, selector: \"[ngIf]\", inputs: [\"ngIf\", \"ngIfThen\", \"ngIfElse\"] }, { type: i5.NgTemplateOutlet, selector: \"[ngTemplateOutlet]\", inputs: [\"ngTemplateOutletContext\", \"ngTemplateOutlet\"] }, { type: i5.NgForOf, selector: \"[ngFor][ngForOf]\", inputs: [\"ngForOf\", \"ngForTrackBy\", \"ngForTemplate\"] }], pipes: { \"async\": i5.AsyncPipe, \"formlySelectOptions\": i6.FormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyFieldSelect, decorators: [{\n type: Component,\n args: [{\n selector: 'formly-field-mat-select',\n template: `\n \n \n \n \n {{ props.selectAllOption }}\n \n \n\n \n \n \n \n \n \n \n {{ child.label }}\n \n \n {{ item.label }} \n \n \n \n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n }]\n }], propDecorators: { select: [{\n type: ViewChild,\n args: [MatSelect, { static: true }]\n }] } });\n\nclass FormlyMatSelectModule {\n}\nFormlyMatSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlyMatSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatSelectModule, declarations: [FormlyFieldSelect], imports: [CommonModule,\n ReactiveFormsModule,\n MatSelectModule,\n MatPseudoCheckboxModule,\n FormlyMatFormFieldModule,\n FormlySelectModule, i4.FormlyModule] });\nFormlyMatSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatSelectModule, imports: [[\n CommonModule,\n ReactiveFormsModule,\n MatSelectModule,\n MatPseudoCheckboxModule,\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'select',\n component: FormlyFieldSelect,\n wrappers: ['form-field'],\n },\n { name: 'enum', extends: 'select' },\n ],\n }),\n ]] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMatSelectModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [FormlyFieldSelect],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatSelectModule,\n MatPseudoCheckboxModule,\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'select',\n component: FormlyFieldSelect,\n wrappers: ['form-field'],\n },\n { name: 'enum', extends: 'select' },\n ],\n }),\n ],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FormlyFieldSelect, FormlyMatSelectModule };\n","import { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nexport { FieldType } from '@ngx-formly/material/form-field';\nimport * as i0 from '@angular/core';\nimport { NgModule } from '@angular/core';\nimport { FormlyMatInputModule } from '@ngx-formly/material/input';\nimport { FormlyMatTextAreaModule } from '@ngx-formly/material/textarea';\nimport { FormlyMatRadioModule } from '@ngx-formly/material/radio';\nimport { FormlyMatCheckboxModule } from '@ngx-formly/material/checkbox';\nimport { FormlyMatMultiCheckboxModule } from '@ngx-formly/material/multicheckbox';\nimport { FormlyMatSelectModule } from '@ngx-formly/material/select';\n\nclass FormlyMaterialModule {\n}\nFormlyMaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nFormlyMaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMaterialModule, imports: [FormlyMatFormFieldModule,\n FormlyMatInputModule,\n FormlyMatTextAreaModule,\n FormlyMatRadioModule,\n FormlyMatCheckboxModule,\n FormlyMatMultiCheckboxModule,\n FormlyMatSelectModule] });\nFormlyMaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMaterialModule, imports: [[\n FormlyMatFormFieldModule,\n FormlyMatInputModule,\n FormlyMatTextAreaModule,\n FormlyMatRadioModule,\n FormlyMatCheckboxModule,\n FormlyMatMultiCheckboxModule,\n FormlyMatSelectModule,\n ]] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.3.12\", ngImport: i0, type: FormlyMaterialModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [\n FormlyMatFormFieldModule,\n FormlyMatInputModule,\n FormlyMatTextAreaModule,\n FormlyMatRadioModule,\n FormlyMatCheckboxModule,\n FormlyMatMultiCheckboxModule,\n FormlyMatSelectModule,\n ],\n }]\n }] });\n\n/*\n * Public API Surface of material\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { FormlyMaterialModule };\n","\n","import { Component, Input, OnInit } from '@angular/core'\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core'\nimport { selectOption } from 'src/types/wizard'\n\n@Component({\n selector: 'gwc-button-select',\n templateUrl: './button.select.component.html',\n styleUrls: ['./button.select.component.scss']\n})\n\nexport class ButtonSelectComponent extends FieldType {\n public buttons: selectOption[] = []\n\n constructor() {\n super()\n }\n\n ngOnInit(): void {\n this.buttons = this.props.options as Array\n }\n\n public selectOption(option: selectOption): void {\n this.formControl.patchValue(option.value)\n }\n}\n","import { Component, NgZone } from '@angular/core'\nimport { AbstractControl, FormsModule, ReactiveFormsModule, ValidationErrors } from '@angular/forms'\nimport { MatDatepickerInputEvent, MatDatepickerModule } from '@angular/material/datepicker'\nimport { FieldTypeConfig, FormlyConfig } from '@ngx-formly/core'\nimport { FieldType } from '@ngx-formly/material'\nimport { DateTime } from 'luxon'\nimport { DateValidator } from 'src/types/wizard'\nimport { MatFormFieldModule } from '@angular/material/form-field'\nimport { NgxMaskDirective, NgxMaskPipe, provideNgxMask } from 'ngx-mask'\nimport { MatInputModule } from '@angular/material/input'\nimport * as _ from 'lodash'\n\n@Component({\n\tselector: 'gwc-datepicker',\n\ttemplateUrl: './datepicker.component.html',\n\tstyleUrls: ['./datepicker.component.scss'],\n\tstandalone: true, \n\timports: [\n\t\tFormsModule,\n\t\tMatDatepickerModule,\n\t\tMatFormFieldModule,\n\t\tMatInputModule,\n\t\tNgxMaskDirective,\n\t\tNgxMaskPipe, \n\t\tReactiveFormsModule\n\t],\n\tproviders: [\n\t\tprovideNgxMask()\n\t]\n})\n\nexport class DatepickerComponent extends FieldType {\n\tpublic messages: {[key: string]: string} = {}\n\n\tngOnInit() {\n\t\t// Some old models have the value wrapped in a value key\n\t\tif (this.formControl.value?.value) {\n\t\t\tthis.formControl.patchValue(this.formControl.value.value)\n\t\t}\n\t}\n\n\t\n\tpublic dateSelected($event: MatDatepickerInputEvent): void {\n\t\tthis.formControl.patchValue($event.value?.toFormat('MM/dd/yyyy'))\n\t}\n\n\tpublic getDate(): DateTime | null {\n\t\tif (this.formControl.value) {\n\t\t\treturn DateTime.fromFormat(this.formControl.value, 'MM/dd/yyyy')\n\t\t}\n\n\t\treturn null\n\t}\n\n\tpublic getErrorMessage(): string {\n\t\tif (this.formControl.errors) {\n\t\t\tconst messages = this.field.validation?.messages\n\t\t\tconst errors = this.formControl.errors\n\t\t\tconst errors_list = Object.keys(errors)\n\n\t\t\tif (messages?.[errors_list[0]]) {\n\t\t\t\treturn messages?.[errors_list[0]] as string\n\t\t\t} \n\t\t}\n\n\t\treturn 'Please enter a valid date(MM/DD/YYYY).'\n\t}\n}\n","\n\t{{ props.label }} \n\t \n\t \n\t\n\t \n\t\n\t \n\t\n\t\t{{ getErrorMessage() }}\n\t \n \n","\n\n\t\n\t\t+ \n\t\tAdd\n\t
\n \n","import { Component } from '@angular/core'\nimport { FieldArrayType } from '@ngx-formly/core'\n\n@Component({\n selector: 'gwc-multiple',\n templateUrl: './multiple.component.html',\n styleUrls: ['./multiple.component.scss']\n})\n\nexport class MultipleComponent extends FieldArrayType {}\n","import { Component } from '@angular/core'\nimport { FieldTypeConfig } from '@ngx-formly/core'\nimport { FieldType } from '@ngx-formly/material'\n\n@Component({\n selector: 'gwc-masked-input',\n templateUrl: './masked.input.component.html',\n styleUrls: ['./masked.input.component.scss']\n})\n\nexport class MaskedInputComponent extends FieldType {\n ngOnInit() {\n }\n}\n","\n {{ props.label }} \n \n \n","import { Injectable } from '@angular/core'\nimport { from, map, Observable } from 'rxjs'\nimport { Location } from 'src/types/location'\nimport { ApiService } from './api.service'\n\n@Injectable({\n providedIn: 'root'\n})\n\nexport class FacilityService extends ApiService {\n public getFacilities(zip_code: string, category: string, brand?: string|null) {\n let request: {\n radius: number\n limit: number\n string?: string\n category: string\n brand?: string\n } = {\n category,\n limit:50,\n radius:500\n }\n\n if (brand) request.brand = brand\n\n return this.postRequest(`facility/near/${zip_code}`, request)\n }\n}\n","import * as i0 from '@angular/core';\nimport { inject, NgZone, EventEmitter, PLATFORM_ID, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Input, Output, Directive, ContentChildren, NgModule, Injectable } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { BehaviorSubject, Observable, Subject, combineLatest } from 'rxjs';\nimport { switchMap, take, map, takeUntil } from 'rxjs/operators';\n\n/** Manages event on a Google Maps object, ensuring that events are added only when necessary. */\nclass MapEventManager {\n /** Clears all currently-registered event listeners. */\n _clearListeners() {\n for (const listener of this._listeners) {\n listener.remove();\n }\n this._listeners = [];\n }\n constructor(_ngZone) {\n this._ngZone = _ngZone;\n /** Pending listeners that were added before the target was set. */\n this._pending = [];\n this._listeners = [];\n this._targetStream = new BehaviorSubject(undefined);\n }\n /** Gets an observable that adds an event listener to the map when a consumer subscribes to it. */\n getLazyEmitter(name) {\n return this._targetStream.pipe(switchMap(target => {\n const observable = new Observable(observer => {\n // If the target hasn't been initialized yet, cache the observer so it can be added later.\n if (!target) {\n this._pending.push({ observable, observer });\n return undefined;\n }\n const listener = target.addListener(name, (event) => {\n this._ngZone.run(() => observer.next(event));\n });\n // If there's an error when initializing the Maps API (e.g. a wrong API key), it will\n // return a dummy object that returns `undefined` from `addListener` (see #26514).\n if (!listener) {\n observer.complete();\n return undefined;\n }\n this._listeners.push(listener);\n return () => listener.remove();\n });\n return observable;\n }));\n }\n /** Sets the current target that the manager should bind events to. */\n setTarget(target) {\n const currentTarget = this._targetStream.value;\n if (target === currentTarget) {\n return;\n }\n // Clear the listeners from the pre-existing target.\n if (currentTarget) {\n this._clearListeners();\n this._pending = [];\n }\n this._targetStream.next(target);\n // Add the listeners that were bound before the map was initialized.\n this._pending.forEach(subscriber => subscriber.observable.subscribe(subscriber.observer));\n this._pending = [];\n }\n /** Destroys the manager and clears the event listeners. */\n destroy() {\n this._clearListeners();\n this._pending = [];\n this._targetStream.complete();\n }\n}\n\n/// \n/** default options set to the Googleplex */\nconst DEFAULT_OPTIONS = {\n center: { lat: 37.421995, lng: -122.084092 },\n zoom: 17,\n // Note: the type conversion here isn't necessary for our CI, but it resolves a g3 failure.\n mapTypeId: 'roadmap',\n};\n/** Arbitrary default height for the map element */\nconst DEFAULT_HEIGHT = '500px';\n/** Arbitrary default width for the map element */\nconst DEFAULT_WIDTH = '500px';\n/**\n * Angular component that renders a Google Map via the Google Maps JavaScript\n * API.\n * @see https://developers.google.com/maps/documentation/javascript/reference/\n */\nclass GoogleMap {\n set center(center) {\n this._center = center;\n }\n set zoom(zoom) {\n this._zoom = zoom;\n }\n set options(options) {\n this._options = options || DEFAULT_OPTIONS;\n }\n constructor(_elementRef, _ngZone, platformId) {\n this._elementRef = _elementRef;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n /** Height of the map. Set this to `null` if you'd like to control the height through CSS. */\n this.height = DEFAULT_HEIGHT;\n /** Width of the map. Set this to `null` if you'd like to control the width through CSS. */\n this.width = DEFAULT_WIDTH;\n this._options = DEFAULT_OPTIONS;\n /** Event emitted when the map is initialized. */\n this.mapInitialized = new EventEmitter();\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/events#auth-errors\n */\n this.authFailure = new EventEmitter();\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.bounds_changed\n */\n this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.center_changed\n */\n this.centerChanged = this._eventManager.getLazyEmitter('center_changed');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.click\n */\n this.mapClick = this._eventManager.getLazyEmitter('click');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dblclick\n */\n this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.drag\n */\n this.mapDrag = this._eventManager.getLazyEmitter('drag');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dragend\n */\n this.mapDragend = this._eventManager.getLazyEmitter('dragend');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dragstart\n */\n this.mapDragstart = this._eventManager.getLazyEmitter('dragstart');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.heading_changed\n */\n this.headingChanged = this._eventManager.getLazyEmitter('heading_changed');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.idle\n */\n this.idle = this._eventManager.getLazyEmitter('idle');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.maptypeid_changed\n */\n this.maptypeidChanged = this._eventManager.getLazyEmitter('maptypeid_changed');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mousemove\n */\n this.mapMousemove = this._eventManager.getLazyEmitter('mousemove');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mouseout\n */\n this.mapMouseout = this._eventManager.getLazyEmitter('mouseout');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mouseover\n */\n this.mapMouseover = this._eventManager.getLazyEmitter('mouseover');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/map#Map.projection_changed\n */\n this.projectionChanged = this._eventManager.getLazyEmitter('projection_changed');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.rightclick\n */\n this.mapRightclick = this._eventManager.getLazyEmitter('rightclick');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.tilesloaded\n */\n this.tilesloaded = this._eventManager.getLazyEmitter('tilesloaded');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.tilt_changed\n */\n this.tiltChanged = this._eventManager.getLazyEmitter('tilt_changed');\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.zoom_changed\n */\n this.zoomChanged = this._eventManager.getLazyEmitter('zoom_changed');\n this._isBrowser = isPlatformBrowser(platformId);\n if (this._isBrowser) {\n const googleMapsWindow = window;\n if (!googleMapsWindow.google && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Namespace google not found, cannot construct embedded google ' +\n 'map. Please install the Google Maps JavaScript API: ' +\n 'https://developers.google.com/maps/documentation/javascript/' +\n 'tutorial#Loading_the_Maps_API');\n }\n this._existingAuthFailureCallback = googleMapsWindow.gm_authFailure;\n googleMapsWindow.gm_authFailure = () => {\n if (this._existingAuthFailureCallback) {\n this._existingAuthFailureCallback();\n }\n this.authFailure.emit();\n };\n }\n }\n ngOnChanges(changes) {\n if (changes['height'] || changes['width']) {\n this._setSize();\n }\n const googleMap = this.googleMap;\n if (googleMap) {\n if (changes['options']) {\n googleMap.setOptions(this._combineOptions());\n }\n if (changes['center'] && this._center) {\n googleMap.setCenter(this._center);\n }\n // Note that the zoom can be zero.\n if (changes['zoom'] && this._zoom != null) {\n googleMap.setZoom(this._zoom);\n }\n if (changes['mapTypeId'] && this.mapTypeId) {\n googleMap.setMapTypeId(this.mapTypeId);\n }\n }\n }\n ngOnInit() {\n // It should be a noop during server-side rendering.\n if (this._isBrowser) {\n this._mapEl = this._elementRef.nativeElement.querySelector('.map-container');\n this._setSize();\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n if (google.maps.Map) {\n this._initialize(google.maps.Map);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n google.maps\n .importLibrary('maps')\n .then(lib => this._initialize(lib.Map));\n });\n }\n }\n }\n _initialize(mapConstructor) {\n this._ngZone.runOutsideAngular(() => {\n this.googleMap = new mapConstructor(this._mapEl, this._combineOptions());\n this._eventManager.setTarget(this.googleMap);\n this.mapInitialized.emit(this.googleMap);\n });\n }\n ngOnDestroy() {\n this.mapInitialized.complete();\n this._eventManager.destroy();\n if (this._isBrowser) {\n const googleMapsWindow = window;\n googleMapsWindow.gm_authFailure = this._existingAuthFailureCallback;\n }\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.fitBounds\n */\n fitBounds(bounds, padding) {\n this._assertInitialized();\n this.googleMap.fitBounds(bounds, padding);\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panBy\n */\n panBy(x, y) {\n this._assertInitialized();\n this.googleMap.panBy(x, y);\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panTo\n */\n panTo(latLng) {\n this._assertInitialized();\n this.googleMap.panTo(latLng);\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panToBounds\n */\n panToBounds(latLngBounds, padding) {\n this._assertInitialized();\n this.googleMap.panToBounds(latLngBounds, padding);\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getBounds\n */\n getBounds() {\n this._assertInitialized();\n return this.googleMap.getBounds() || null;\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getCenter\n */\n getCenter() {\n this._assertInitialized();\n return this.googleMap.getCenter();\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getClickableIcons\n */\n getClickableIcons() {\n this._assertInitialized();\n return this.googleMap.getClickableIcons();\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getHeading\n */\n getHeading() {\n this._assertInitialized();\n return this.googleMap.getHeading();\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getMapTypeId\n */\n getMapTypeId() {\n this._assertInitialized();\n return this.googleMap.getMapTypeId();\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getProjection\n */\n getProjection() {\n this._assertInitialized();\n return this.googleMap.getProjection() || null;\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getStreetView\n */\n getStreetView() {\n this._assertInitialized();\n return this.googleMap.getStreetView();\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getTilt\n */\n getTilt() {\n this._assertInitialized();\n return this.googleMap.getTilt();\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getZoom\n */\n getZoom() {\n this._assertInitialized();\n return this.googleMap.getZoom();\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.controls\n */\n get controls() {\n this._assertInitialized();\n return this.googleMap.controls;\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.data\n */\n get data() {\n this._assertInitialized();\n return this.googleMap.data;\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mapTypes\n */\n get mapTypes() {\n this._assertInitialized();\n return this.googleMap.mapTypes;\n }\n /**\n * See\n * https://developers.google.com/maps/documentation/javascript/reference/map#Map.overlayMapTypes\n */\n get overlayMapTypes() {\n this._assertInitialized();\n return this.googleMap.overlayMapTypes;\n }\n /** Returns a promise that resolves when the map has been initialized. */\n _resolveMap() {\n return this.googleMap\n ? Promise.resolve(this.googleMap)\n : this.mapInitialized.pipe(take(1)).toPromise();\n }\n _setSize() {\n if (this._mapEl) {\n const styles = this._mapEl.style;\n styles.height =\n this.height === null ? '' : coerceCssPixelValue(this.height) || DEFAULT_HEIGHT;\n styles.width = this.width === null ? '' : coerceCssPixelValue(this.width) || DEFAULT_WIDTH;\n }\n }\n /** Combines the center and zoom and the other map options into a single object */\n _combineOptions() {\n const options = this._options || {};\n return {\n ...options,\n // It's important that we set **some** kind of `center` and `zoom`, otherwise\n // Google Maps will render a blank rectangle which looks broken.\n center: this._center || options.center || DEFAULT_OPTIONS.center,\n zoom: this._zoom ?? options.zoom ?? DEFAULT_OPTIONS.zoom,\n // Passing in an undefined `mapTypeId` seems to break tile loading\n // so make sure that we have some kind of default (see #22082).\n mapTypeId: this.mapTypeId || options.mapTypeId || DEFAULT_OPTIONS.mapTypeId,\n mapId: this.mapId || options.mapId,\n };\n }\n /** Asserts that the map has been initialized. */\n _assertInitialized() {\n if (!this.googleMap && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Cannot access Google Map information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.');\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: GoogleMap, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: GoogleMap, isStandalone: true, selector: \"google-map\", inputs: { height: \"height\", width: \"width\", mapId: \"mapId\", mapTypeId: \"mapTypeId\", center: \"center\", zoom: \"zoom\", options: \"options\" }, outputs: { mapInitialized: \"mapInitialized\", authFailure: \"authFailure\", boundsChanged: \"boundsChanged\", centerChanged: \"centerChanged\", mapClick: \"mapClick\", mapDblclick: \"mapDblclick\", mapDrag: \"mapDrag\", mapDragend: \"mapDragend\", mapDragstart: \"mapDragstart\", headingChanged: \"headingChanged\", idle: \"idle\", maptypeidChanged: \"maptypeidChanged\", mapMousemove: \"mapMousemove\", mapMouseout: \"mapMouseout\", mapMouseover: \"mapMouseover\", projectionChanged: \"projectionChanged\", mapRightclick: \"mapRightclick\", tilesloaded: \"tilesloaded\", tiltChanged: \"tiltChanged\", zoomChanged: \"zoomChanged\" }, exportAs: [\"googleMap\"], usesOnChanges: true, ngImport: i0, template: '
', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: GoogleMap, decorators: [{\n type: Component,\n args: [{\n selector: 'google-map',\n exportAs: 'googleMap',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: '
',\n encapsulation: ViewEncapsulation.None,\n }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: Object, decorators: [{\n type: Inject,\n args: [PLATFORM_ID]\n }] }], propDecorators: { height: [{\n type: Input\n }], width: [{\n type: Input\n }], mapId: [{\n type: Input\n }], mapTypeId: [{\n type: Input\n }], center: [{\n type: Input\n }], zoom: [{\n type: Input\n }], options: [{\n type: Input\n }], mapInitialized: [{\n type: Output\n }], authFailure: [{\n type: Output\n }], boundsChanged: [{\n type: Output\n }], centerChanged: [{\n type: Output\n }], mapClick: [{\n type: Output\n }], mapDblclick: [{\n type: Output\n }], mapDrag: [{\n type: Output\n }], mapDragend: [{\n type: Output\n }], mapDragstart: [{\n type: Output\n }], headingChanged: [{\n type: Output\n }], idle: [{\n type: Output\n }], maptypeidChanged: [{\n type: Output\n }], mapMousemove: [{\n type: Output\n }], mapMouseout: [{\n type: Output\n }], mapMouseover: [{\n type: Output\n }], projectionChanged: [{\n type: Output\n }], mapRightclick: [{\n type: Output\n }], tilesloaded: [{\n type: Output\n }], tiltChanged: [{\n type: Output\n }], zoomChanged: [{\n type: Output\n }] } });\nconst cssUnitsPattern = /([A-Za-z%]+)$/;\n/** Coerces a value to a CSS pixel value. */\nfunction coerceCssPixelValue(value) {\n if (value == null) {\n return '';\n }\n return cssUnitsPattern.test(value) ? value : `${value}px`;\n}\n\n/// \nclass MapBaseLayer {\n constructor(_map, _ngZone) {\n this._map = _map;\n this._ngZone = _ngZone;\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n this._ngZone.runOutsideAngular(() => {\n this._initializeObject();\n });\n this._assertInitialized();\n this._setMap();\n }\n }\n ngOnDestroy() {\n this._unsetMap();\n }\n _assertInitialized() {\n if (!this._map.googleMap) {\n throw Error('Cannot access Google Map information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.');\n }\n }\n _initializeObject() { }\n _setMap() { }\n _unsetMap() { }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapBaseLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapBaseLayer, isStandalone: true, selector: \"map-base-layer\", exportAs: [\"mapBaseLayer\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapBaseLayer, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-base-layer',\n exportAs: 'mapBaseLayer',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }] });\n\n/// \n/**\n * Angular component that renders a Google Maps Bicycling Layer via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/map#BicyclingLayer\n */\nclass MapBicyclingLayer {\n constructor() {\n this._map = inject(GoogleMap);\n this._zone = inject(NgZone);\n /** Event emitted when the bicycling layer is initialized. */\n this.bicyclingLayerInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n if (google.maps.BicyclingLayer && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.BicyclingLayer);\n }\n else {\n this._zone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.BicyclingLayer);\n });\n });\n }\n }\n }\n _initialize(map, layerConstructor) {\n this._zone.runOutsideAngular(() => {\n this.bicyclingLayer = new layerConstructor();\n this.bicyclingLayerInitialized.emit(this.bicyclingLayer);\n this._assertLayerInitialized();\n this.bicyclingLayer.setMap(map);\n });\n }\n ngOnDestroy() {\n this.bicyclingLayer?.setMap(null);\n }\n _assertLayerInitialized() {\n if (!this.bicyclingLayer) {\n throw Error('Cannot interact with a Google Map Bicycling Layer before it has been initialized. ' +\n 'Please wait for the Transit Layer to load before trying to interact with it.');\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapBicyclingLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapBicyclingLayer, isStandalone: true, selector: \"map-bicycling-layer\", outputs: { bicyclingLayerInitialized: \"bicyclingLayerInitialized\" }, exportAs: [\"mapBicyclingLayer\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapBicyclingLayer, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-bicycling-layer',\n exportAs: 'mapBicyclingLayer',\n standalone: true,\n }]\n }], propDecorators: { bicyclingLayerInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps Circle via the Google Maps JavaScript API.\n * @see developers.google.com/maps/documentation/javascript/reference/polygon#Circle\n */\nclass MapCircle {\n set options(options) {\n this._options.next(options || {});\n }\n set center(center) {\n this._center.next(center);\n }\n set radius(radius) {\n this._radius.next(radius);\n }\n constructor(_map, _ngZone) {\n this._map = _map;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n this._options = new BehaviorSubject({});\n this._center = new BehaviorSubject(undefined);\n this._radius = new BehaviorSubject(undefined);\n this._destroyed = new Subject();\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.center_changed\n */\n this.centerChanged = this._eventManager.getLazyEmitter('center_changed');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.click\n */\n this.circleClick = this._eventManager.getLazyEmitter('click');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dblclick\n */\n this.circleDblclick = this._eventManager.getLazyEmitter('dblclick');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.drag\n */\n this.circleDrag = this._eventManager.getLazyEmitter('drag');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dragend\n */\n this.circleDragend = this._eventManager.getLazyEmitter('dragend');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dragstart\n */\n this.circleDragstart = this._eventManager.getLazyEmitter('dragstart');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mousedown\n */\n this.circleMousedown = this._eventManager.getLazyEmitter('mousedown');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mousemove\n */\n this.circleMousemove = this._eventManager.getLazyEmitter('mousemove');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseout\n */\n this.circleMouseout = this._eventManager.getLazyEmitter('mouseout');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseover\n */\n this.circleMouseover = this._eventManager.getLazyEmitter('mouseover');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseup\n */\n this.circleMouseup = this._eventManager.getLazyEmitter('mouseup');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.radius_changed\n */\n this.radiusChanged = this._eventManager.getLazyEmitter('radius_changed');\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.rightclick\n */\n this.circleRightclick = this._eventManager.getLazyEmitter('rightclick');\n /** Event emitted when the circle is initialized. */\n this.circleInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (!this._map._isBrowser) {\n return;\n }\n this._combineOptions()\n .pipe(take(1))\n .subscribe(options => {\n if (google.maps.Circle && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.Circle, options);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.Circle, options);\n });\n });\n }\n });\n }\n _initialize(map, circleConstructor, options) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.circle = new circleConstructor(options);\n this._assertInitialized();\n this.circle.setMap(map);\n this._eventManager.setTarget(this.circle);\n this.circleInitialized.emit(this.circle);\n this._watchForOptionsChanges();\n this._watchForCenterChanges();\n this._watchForRadiusChanges();\n });\n }\n ngOnDestroy() {\n this._eventManager.destroy();\n this._destroyed.next();\n this._destroyed.complete();\n this.circle?.setMap(null);\n }\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getBounds\n */\n getBounds() {\n this._assertInitialized();\n return this.circle.getBounds();\n }\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getCenter\n */\n getCenter() {\n this._assertInitialized();\n return this.circle.getCenter();\n }\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getDraggable\n */\n getDraggable() {\n this._assertInitialized();\n return this.circle.getDraggable();\n }\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getEditable\n */\n getEditable() {\n this._assertInitialized();\n return this.circle.getEditable();\n }\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getRadius\n */\n getRadius() {\n this._assertInitialized();\n return this.circle.getRadius();\n }\n /**\n * @see\n * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getVisible\n */\n getVisible() {\n this._assertInitialized();\n return this.circle.getVisible();\n }\n _combineOptions() {\n return combineLatest([this._options, this._center, this._radius]).pipe(map(([options, center, radius]) => {\n const combinedOptions = {\n ...options,\n center: center || options.center,\n radius: radius !== undefined ? radius : options.radius,\n };\n return combinedOptions;\n }));\n }\n _watchForOptionsChanges() {\n this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {\n this._assertInitialized();\n this.circle.setOptions(options);\n });\n }\n _watchForCenterChanges() {\n this._center.pipe(takeUntil(this._destroyed)).subscribe(center => {\n if (center) {\n this._assertInitialized();\n this.circle.setCenter(center);\n }\n });\n }\n _watchForRadiusChanges() {\n this._radius.pipe(takeUntil(this._destroyed)).subscribe(radius => {\n if (radius !== undefined) {\n this._assertInitialized();\n this.circle.setRadius(radius);\n }\n });\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.circle) {\n throw Error('Cannot interact with a Google Map Circle before it has been ' +\n 'initialized. Please wait for the Circle to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapCircle, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapCircle, isStandalone: true, selector: \"map-circle\", inputs: { options: \"options\", center: \"center\", radius: \"radius\" }, outputs: { centerChanged: \"centerChanged\", circleClick: \"circleClick\", circleDblclick: \"circleDblclick\", circleDrag: \"circleDrag\", circleDragend: \"circleDragend\", circleDragstart: \"circleDragstart\", circleMousedown: \"circleMousedown\", circleMousemove: \"circleMousemove\", circleMouseout: \"circleMouseout\", circleMouseover: \"circleMouseover\", circleMouseup: \"circleMouseup\", radiusChanged: \"radiusChanged\", circleRightclick: \"circleRightclick\", circleInitialized: \"circleInitialized\" }, exportAs: [\"mapCircle\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapCircle, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-circle',\n exportAs: 'mapCircle',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{\n type: Input\n }], center: [{\n type: Input\n }], radius: [{\n type: Input\n }], centerChanged: [{\n type: Output\n }], circleClick: [{\n type: Output\n }], circleDblclick: [{\n type: Output\n }], circleDrag: [{\n type: Output\n }], circleDragend: [{\n type: Output\n }], circleDragstart: [{\n type: Output\n }], circleMousedown: [{\n type: Output\n }], circleMousemove: [{\n type: Output\n }], circleMouseout: [{\n type: Output\n }], circleMouseover: [{\n type: Output\n }], circleMouseup: [{\n type: Output\n }], radiusChanged: [{\n type: Output\n }], circleRightclick: [{\n type: Output\n }], circleInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps Directions Renderer via the Google Maps\n * JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsRenderer\n */\nclass MapDirectionsRenderer {\n /**\n * See developers.google.com/maps/documentation/javascript/reference/directions\n * #DirectionsRendererOptions.directions\n */\n set directions(directions) {\n this._directions = directions;\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/directions\n * #DirectionsRendererOptions\n */\n set options(options) {\n this._options = options;\n }\n constructor(_googleMap, _ngZone) {\n this._googleMap = _googleMap;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n /**\n * See developers.google.com/maps/documentation/javascript/reference/directions\n * #DirectionsRenderer.directions_changed\n */\n this.directionsChanged = this._eventManager.getLazyEmitter('directions_changed');\n /** Event emitted when the directions renderer is initialized. */\n this.directionsRendererInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._googleMap._isBrowser) {\n if (google.maps.DirectionsRenderer && this._googleMap.googleMap) {\n this._initialize(this._googleMap.googleMap, google.maps.DirectionsRenderer);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._googleMap._resolveMap(), google.maps.importLibrary('routes')]).then(([map, lib]) => {\n this._initialize(map, lib.DirectionsRenderer);\n });\n });\n }\n }\n }\n _initialize(map, rendererConstructor) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.directionsRenderer = new rendererConstructor(this._combineOptions());\n this._assertInitialized();\n this.directionsRenderer.setMap(map);\n this._eventManager.setTarget(this.directionsRenderer);\n this.directionsRendererInitialized.emit(this.directionsRenderer);\n });\n }\n ngOnChanges(changes) {\n if (this.directionsRenderer) {\n if (changes['options']) {\n this.directionsRenderer.setOptions(this._combineOptions());\n }\n if (changes['directions'] && this._directions !== undefined) {\n this.directionsRenderer.setDirections(this._directions);\n }\n }\n }\n ngOnDestroy() {\n this._eventManager.destroy();\n this.directionsRenderer?.setMap(null);\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/directions\n * #DirectionsRenderer.getDirections\n */\n getDirections() {\n this._assertInitialized();\n return this.directionsRenderer.getDirections();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/directions\n * #DirectionsRenderer.getPanel\n */\n getPanel() {\n this._assertInitialized();\n return this.directionsRenderer.getPanel();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/directions\n * #DirectionsRenderer.getRouteIndex\n */\n getRouteIndex() {\n this._assertInitialized();\n return this.directionsRenderer.getRouteIndex();\n }\n _combineOptions() {\n const options = this._options || {};\n return {\n ...options,\n directions: this._directions || options.directions,\n map: this._googleMap.googleMap,\n };\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.directionsRenderer) {\n throw Error('Cannot interact with a Google Map Directions Renderer before it has been ' +\n 'initialized. Please wait for the Directions Renderer to load before trying ' +\n 'to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapDirectionsRenderer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapDirectionsRenderer, isStandalone: true, selector: \"map-directions-renderer\", inputs: { directions: \"directions\", options: \"options\" }, outputs: { directionsChanged: \"directionsChanged\", directionsRendererInitialized: \"directionsRendererInitialized\" }, exportAs: [\"mapDirectionsRenderer\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapDirectionsRenderer, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-directions-renderer',\n exportAs: 'mapDirectionsRenderer',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { directions: [{\n type: Input\n }], options: [{\n type: Input\n }], directionsChanged: [{\n type: Output\n }], directionsRendererInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps Ground Overlay via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/image-overlay#GroundOverlay\n */\nclass MapGroundOverlay {\n /** URL of the image that will be shown in the overlay. */\n set url(url) {\n this._url.next(url);\n }\n /** Bounds for the overlay. */\n get bounds() {\n return this._bounds.value;\n }\n set bounds(bounds) {\n this._bounds.next(bounds);\n }\n /** Opacity of the overlay. */\n set opacity(opacity) {\n this._opacity.next(opacity);\n }\n constructor(_map, _ngZone) {\n this._map = _map;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n this._opacity = new BehaviorSubject(1);\n this._url = new BehaviorSubject('');\n this._bounds = new BehaviorSubject(undefined);\n this._destroyed = new Subject();\n /** Whether the overlay is clickable */\n this.clickable = false;\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/image-overlay#GroundOverlay.click\n */\n this.mapClick = this._eventManager.getLazyEmitter('click');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/image-overlay\n * #GroundOverlay.dblclick\n */\n this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');\n /** Event emitted when the ground overlay is initialized. */\n this.groundOverlayInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n // The ground overlay setup is slightly different from the other Google Maps objects in that\n // we have to recreate the `GroundOverlay` object whenever the bounds change, because\n // Google Maps doesn't provide an API to update the bounds of an existing overlay.\n this._bounds.pipe(takeUntil(this._destroyed)).subscribe(bounds => {\n if (this.groundOverlay) {\n this.groundOverlay.setMap(null);\n this.groundOverlay = undefined;\n }\n if (!bounds) {\n return;\n }\n if (google.maps.GroundOverlay && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.GroundOverlay, bounds);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.GroundOverlay, bounds);\n });\n });\n }\n });\n }\n }\n _initialize(map, overlayConstructor, bounds) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.groundOverlay = new overlayConstructor(this._url.getValue(), bounds, {\n clickable: this.clickable,\n opacity: this._opacity.value,\n });\n this._assertInitialized();\n this.groundOverlay.setMap(map);\n this._eventManager.setTarget(this.groundOverlay);\n this.groundOverlayInitialized.emit(this.groundOverlay);\n // We only need to set up the watchers once.\n if (!this._hasWatchers) {\n this._hasWatchers = true;\n this._watchForOpacityChanges();\n this._watchForUrlChanges();\n }\n });\n }\n ngOnDestroy() {\n this._eventManager.destroy();\n this._destroyed.next();\n this._destroyed.complete();\n this.groundOverlay?.setMap(null);\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/image-overlay\n * #GroundOverlay.getBounds\n */\n getBounds() {\n this._assertInitialized();\n return this.groundOverlay.getBounds();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/image-overlay\n * #GroundOverlay.getOpacity\n */\n getOpacity() {\n this._assertInitialized();\n return this.groundOverlay.getOpacity();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/image-overlay\n * #GroundOverlay.getUrl\n */\n getUrl() {\n this._assertInitialized();\n return this.groundOverlay.getUrl();\n }\n _watchForOpacityChanges() {\n this._opacity.pipe(takeUntil(this._destroyed)).subscribe(opacity => {\n if (opacity != null) {\n this.groundOverlay?.setOpacity(opacity);\n }\n });\n }\n _watchForUrlChanges() {\n this._url.pipe(takeUntil(this._destroyed)).subscribe(url => {\n const overlay = this.groundOverlay;\n if (overlay) {\n overlay.set('url', url);\n // Google Maps only redraws the overlay if we re-set the map.\n overlay.setMap(null);\n overlay.setMap(this._map.googleMap);\n }\n });\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.groundOverlay) {\n throw Error('Cannot interact with a Google Map GroundOverlay before it has been initialized. ' +\n 'Please wait for the GroundOverlay to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapGroundOverlay, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapGroundOverlay, isStandalone: true, selector: \"map-ground-overlay\", inputs: { url: \"url\", bounds: \"bounds\", clickable: \"clickable\", opacity: \"opacity\" }, outputs: { mapClick: \"mapClick\", mapDblclick: \"mapDblclick\", groundOverlayInitialized: \"groundOverlayInitialized\" }, exportAs: [\"mapGroundOverlay\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapGroundOverlay, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-ground-overlay',\n exportAs: 'mapGroundOverlay',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { url: [{\n type: Input\n }], bounds: [{\n type: Input\n }], clickable: [{\n type: Input\n }], opacity: [{\n type: Input\n }], mapClick: [{\n type: Output\n }], mapDblclick: [{\n type: Output\n }], groundOverlayInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps info window via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/info-window\n */\nclass MapInfoWindow {\n set options(options) {\n this._options.next(options || {});\n }\n set position(position) {\n this._position.next(position);\n }\n constructor(_googleMap, _elementRef, _ngZone) {\n this._googleMap = _googleMap;\n this._elementRef = _elementRef;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n this._options = new BehaviorSubject({});\n this._position = new BehaviorSubject(undefined);\n this._destroy = new Subject();\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.closeclick\n */\n this.closeclick = this._eventManager.getLazyEmitter('closeclick');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/info-window\n * #InfoWindow.content_changed\n */\n this.contentChanged = this._eventManager.getLazyEmitter('content_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.domready\n */\n this.domready = this._eventManager.getLazyEmitter('domready');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/info-window\n * #InfoWindow.position_changed\n */\n this.positionChanged = this._eventManager.getLazyEmitter('position_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/info-window\n * #InfoWindow.zindex_changed\n */\n this.zindexChanged = this._eventManager.getLazyEmitter('zindex_changed');\n /** Event emitted when the info window is initialized. */\n this.infoWindowInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._googleMap._isBrowser) {\n this._combineOptions()\n .pipe(take(1))\n .subscribe(options => {\n if (google.maps.InfoWindow) {\n this._initialize(google.maps.InfoWindow, options);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n google.maps.importLibrary('maps').then(lib => {\n this._initialize(lib.InfoWindow, options);\n });\n });\n }\n });\n }\n }\n _initialize(infoWindowConstructor, options) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.infoWindow = new infoWindowConstructor(options);\n this._eventManager.setTarget(this.infoWindow);\n this.infoWindowInitialized.emit(this.infoWindow);\n this._watchForOptionsChanges();\n this._watchForPositionChanges();\n });\n }\n ngOnDestroy() {\n this._eventManager.destroy();\n this._destroy.next();\n this._destroy.complete();\n // If no info window has been created on the server, we do not try closing it.\n // On the server, an info window cannot be created and this would cause errors.\n if (this.infoWindow) {\n this.close();\n }\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.close\n */\n close() {\n this._assertInitialized();\n this.infoWindow.close();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.getContent\n */\n getContent() {\n this._assertInitialized();\n return this.infoWindow.getContent() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/info-window\n * #InfoWindow.getPosition\n */\n getPosition() {\n this._assertInitialized();\n return this.infoWindow.getPosition() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.getZIndex\n */\n getZIndex() {\n this._assertInitialized();\n return this.infoWindow.getZIndex();\n }\n /**\n * Opens the MapInfoWindow using the provided AdvancedMarkerElement.\n * @deprecated Use the `open` method instead.\n * @breaking-change 20.0.0\n */\n openAdvancedMarkerElement(advancedMarkerElement, content) {\n this.open({\n getAnchor: () => advancedMarkerElement,\n }, undefined, content);\n }\n /**\n * Opens the MapInfoWindow using the provided anchor. If the anchor is not set,\n * then the position property of the options input is used instead.\n */\n open(anchor, shouldFocus, content) {\n this._assertInitialized();\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && anchor && !anchor.getAnchor) {\n throw new Error('Specified anchor does not implement the `getAnchor` method. ' +\n 'It cannot be used to open an info window.');\n }\n const anchorObject = anchor ? anchor.getAnchor() : undefined;\n // Prevent the info window from initializing when trying to reopen on the same anchor.\n // Note that when the window is opened for the first time, the anchor will always be\n // undefined. If that's the case, we have to allow it to open in order to handle the\n // case where the window doesn't have an anchor, but is placed at a particular position.\n if (this.infoWindow.get('anchor') !== anchorObject || !anchorObject) {\n this._elementRef.nativeElement.style.display = '';\n if (content) {\n this.infoWindow.setContent(content);\n }\n this.infoWindow.open({\n map: this._googleMap.googleMap,\n anchor: anchorObject,\n shouldFocus,\n });\n }\n }\n _combineOptions() {\n return combineLatest([this._options, this._position]).pipe(map(([options, position]) => {\n const combinedOptions = {\n ...options,\n position: position || options.position,\n content: this._elementRef.nativeElement,\n };\n return combinedOptions;\n }));\n }\n _watchForOptionsChanges() {\n this._options.pipe(takeUntil(this._destroy)).subscribe(options => {\n this._assertInitialized();\n this.infoWindow.setOptions(options);\n });\n }\n _watchForPositionChanges() {\n this._position.pipe(takeUntil(this._destroy)).subscribe(position => {\n if (position) {\n this._assertInitialized();\n this.infoWindow.setPosition(position);\n }\n });\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.infoWindow) {\n throw Error('Cannot interact with a Google Map Info Window before it has been ' +\n 'initialized. Please wait for the Info Window to load before trying to interact with ' +\n 'it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapInfoWindow, deps: [{ token: GoogleMap }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapInfoWindow, isStandalone: true, selector: \"map-info-window\", inputs: { options: \"options\", position: \"position\" }, outputs: { closeclick: \"closeclick\", contentChanged: \"contentChanged\", domready: \"domready\", positionChanged: \"positionChanged\", zindexChanged: \"zindexChanged\", infoWindowInitialized: \"infoWindowInitialized\" }, host: { styleAttribute: \"display: none\" }, exportAs: [\"mapInfoWindow\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapInfoWindow, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-info-window',\n exportAs: 'mapInfoWindow',\n standalone: true,\n host: { 'style': 'display: none' },\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { options: [{\n type: Input\n }], position: [{\n type: Input\n }], closeclick: [{\n type: Output\n }], contentChanged: [{\n type: Output\n }], domready: [{\n type: Output\n }], positionChanged: [{\n type: Output\n }], zindexChanged: [{\n type: Output\n }], infoWindowInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps KML Layer via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer\n */\nclass MapKmlLayer {\n set options(options) {\n this._options.next(options || {});\n }\n set url(url) {\n this._url.next(url);\n }\n constructor(_map, _ngZone) {\n this._map = _map;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n this._options = new BehaviorSubject({});\n this._url = new BehaviorSubject('');\n this._destroyed = new Subject();\n /**\n * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.click\n */\n this.kmlClick = this._eventManager.getLazyEmitter('click');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/kml\n * #KmlLayer.defaultviewport_changed\n */\n this.defaultviewportChanged = this._eventManager.getLazyEmitter('defaultviewport_changed');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.status_changed\n */\n this.statusChanged = this._eventManager.getLazyEmitter('status_changed');\n /** Event emitted when the KML layer is initialized. */\n this.kmlLayerInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n this._combineOptions()\n .pipe(take(1))\n .subscribe(options => {\n if (google.maps.KmlLayer && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.KmlLayer, options);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.KmlLayer, options);\n });\n });\n }\n });\n }\n }\n _initialize(map, layerConstructor, options) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.kmlLayer = new layerConstructor(options);\n this._assertInitialized();\n this.kmlLayer.setMap(map);\n this._eventManager.setTarget(this.kmlLayer);\n this.kmlLayerInitialized.emit(this.kmlLayer);\n this._watchForOptionsChanges();\n this._watchForUrlChanges();\n });\n }\n ngOnDestroy() {\n this._eventManager.destroy();\n this._destroyed.next();\n this._destroyed.complete();\n this.kmlLayer?.setMap(null);\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getDefaultViewport\n */\n getDefaultViewport() {\n this._assertInitialized();\n return this.kmlLayer.getDefaultViewport();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getMetadata\n */\n getMetadata() {\n this._assertInitialized();\n return this.kmlLayer.getMetadata();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getStatus\n */\n getStatus() {\n this._assertInitialized();\n return this.kmlLayer.getStatus();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getUrl\n */\n getUrl() {\n this._assertInitialized();\n return this.kmlLayer.getUrl();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getZIndex\n */\n getZIndex() {\n this._assertInitialized();\n return this.kmlLayer.getZIndex();\n }\n _combineOptions() {\n return combineLatest([this._options, this._url]).pipe(map(([options, url]) => {\n const combinedOptions = {\n ...options,\n url: url || options.url,\n };\n return combinedOptions;\n }));\n }\n _watchForOptionsChanges() {\n this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {\n if (this.kmlLayer) {\n this._assertInitialized();\n this.kmlLayer.setOptions(options);\n }\n });\n }\n _watchForUrlChanges() {\n this._url.pipe(takeUntil(this._destroyed)).subscribe(url => {\n if (url && this.kmlLayer) {\n this._assertInitialized();\n this.kmlLayer.setUrl(url);\n }\n });\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.kmlLayer) {\n throw Error('Cannot interact with a Google Map KmlLayer before it has been ' +\n 'initialized. Please wait for the KmlLayer to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapKmlLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapKmlLayer, isStandalone: true, selector: \"map-kml-layer\", inputs: { options: \"options\", url: \"url\" }, outputs: { kmlClick: \"kmlClick\", defaultviewportChanged: \"defaultviewportChanged\", statusChanged: \"statusChanged\", kmlLayerInitialized: \"kmlLayerInitialized\" }, exportAs: [\"mapKmlLayer\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapKmlLayer, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-kml-layer',\n exportAs: 'mapKmlLayer',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{\n type: Input\n }], url: [{\n type: Input\n }], kmlClick: [{\n type: Output\n }], defaultviewportChanged: [{\n type: Output\n }], statusChanged: [{\n type: Output\n }], kmlLayerInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Default options for the Google Maps marker component. Displays a marker\n * at the Googleplex.\n */\nconst DEFAULT_MARKER_OPTIONS$1 = {\n position: { lat: 37.421995, lng: -122.084092 },\n};\n/**\n * Angular component that renders a Google Maps marker via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/marker\n */\nclass MapMarker {\n /**\n * Title of the marker.\n * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.title\n */\n set title(title) {\n this._title = title;\n }\n /**\n * Position of the marker. See:\n * developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.position\n */\n set position(position) {\n this._position = position;\n }\n /**\n * Label for the marker.\n * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.label\n */\n set label(label) {\n this._label = label;\n }\n /**\n * Whether the marker is clickable. See:\n * developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.clickable\n */\n set clickable(clickable) {\n this._clickable = clickable;\n }\n /**\n * Options used to configure the marker.\n * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions\n */\n set options(options) {\n this._options = options;\n }\n /**\n * Icon to be used for the marker.\n * See: https://developers.google.com/maps/documentation/javascript/reference/marker#Icon\n */\n set icon(icon) {\n this._icon = icon;\n }\n /**\n * Whether the marker is visible.\n * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.visible\n */\n set visible(value) {\n this._visible = value;\n }\n constructor(_googleMap, _ngZone) {\n this._googleMap = _googleMap;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.animation_changed\n */\n this.animationChanged = this._eventManager.getLazyEmitter('animation_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.click\n */\n this.mapClick = this._eventManager.getLazyEmitter('click');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.clickable_changed\n */\n this.clickableChanged = this._eventManager.getLazyEmitter('clickable_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.cursor_changed\n */\n this.cursorChanged = this._eventManager.getLazyEmitter('cursor_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dblclick\n */\n this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.drag\n */\n this.mapDrag = this._eventManager.getLazyEmitter('drag');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dragend\n */\n this.mapDragend = this._eventManager.getLazyEmitter('dragend');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.draggable_changed\n */\n this.draggableChanged = this._eventManager.getLazyEmitter('draggable_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dragstart\n */\n this.mapDragstart = this._eventManager.getLazyEmitter('dragstart');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.flat_changed\n */\n this.flatChanged = this._eventManager.getLazyEmitter('flat_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.icon_changed\n */\n this.iconChanged = this._eventManager.getLazyEmitter('icon_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mousedown\n */\n this.mapMousedown = this._eventManager.getLazyEmitter('mousedown');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseout\n */\n this.mapMouseout = this._eventManager.getLazyEmitter('mouseout');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseover\n */\n this.mapMouseover = this._eventManager.getLazyEmitter('mouseover');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseup\n */\n this.mapMouseup = this._eventManager.getLazyEmitter('mouseup');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.position_changed\n */\n this.positionChanged = this._eventManager.getLazyEmitter('position_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.rightclick\n */\n this.mapRightclick = this._eventManager.getLazyEmitter('rightclick');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.shape_changed\n */\n this.shapeChanged = this._eventManager.getLazyEmitter('shape_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.title_changed\n */\n this.titleChanged = this._eventManager.getLazyEmitter('title_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.visible_changed\n */\n this.visibleChanged = this._eventManager.getLazyEmitter('visible_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.zindex_changed\n */\n this.zindexChanged = this._eventManager.getLazyEmitter('zindex_changed');\n /** Event emitted when the marker is initialized. */\n this.markerInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (!this._googleMap._isBrowser) {\n return;\n }\n if (google.maps.Marker && this._googleMap.googleMap) {\n this._initialize(this._googleMap.googleMap, google.maps.Marker);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._googleMap._resolveMap(), google.maps.importLibrary('marker')]).then(([map, lib]) => {\n this._initialize(map, lib.Marker);\n });\n });\n }\n }\n _initialize(map, markerConstructor) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.marker = new markerConstructor(this._combineOptions());\n this._assertInitialized();\n this.marker.setMap(map);\n this._eventManager.setTarget(this.marker);\n this.markerInitialized.next(this.marker);\n });\n }\n ngOnChanges(changes) {\n const { marker, _title, _position, _label, _clickable, _icon, _visible } = this;\n if (marker) {\n if (changes['options']) {\n marker.setOptions(this._combineOptions());\n }\n if (changes['title'] && _title !== undefined) {\n marker.setTitle(_title);\n }\n if (changes['position'] && _position) {\n marker.setPosition(_position);\n }\n if (changes['label'] && _label !== undefined) {\n marker.setLabel(_label);\n }\n if (changes['clickable'] && _clickable !== undefined) {\n marker.setClickable(_clickable);\n }\n if (changes['icon'] && _icon) {\n marker.setIcon(_icon);\n }\n if (changes['visible'] && _visible !== undefined) {\n marker.setVisible(_visible);\n }\n }\n }\n ngOnDestroy() {\n this.markerInitialized.complete();\n this._eventManager.destroy();\n this.marker?.setMap(null);\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getAnimation\n */\n getAnimation() {\n this._assertInitialized();\n return this.marker.getAnimation() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getClickable\n */\n getClickable() {\n this._assertInitialized();\n return this.marker.getClickable();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getCursor\n */\n getCursor() {\n this._assertInitialized();\n return this.marker.getCursor() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getDraggable\n */\n getDraggable() {\n this._assertInitialized();\n return !!this.marker.getDraggable();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getIcon\n */\n getIcon() {\n this._assertInitialized();\n return this.marker.getIcon() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getLabel\n */\n getLabel() {\n this._assertInitialized();\n return this.marker.getLabel() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getOpacity\n */\n getOpacity() {\n this._assertInitialized();\n return this.marker.getOpacity() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getPosition\n */\n getPosition() {\n this._assertInitialized();\n return this.marker.getPosition() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getShape\n */\n getShape() {\n this._assertInitialized();\n return this.marker.getShape() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getTitle\n */\n getTitle() {\n this._assertInitialized();\n return this.marker.getTitle() || null;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getVisible\n */\n getVisible() {\n this._assertInitialized();\n return this.marker.getVisible();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getZIndex\n */\n getZIndex() {\n this._assertInitialized();\n return this.marker.getZIndex() || null;\n }\n /** Gets the anchor point that can be used to attach other Google Maps objects. */\n getAnchor() {\n this._assertInitialized();\n return this.marker;\n }\n /** Returns a promise that resolves when the marker has been initialized. */\n _resolveMarker() {\n return this.marker\n ? Promise.resolve(this.marker)\n : this.markerInitialized.pipe(take(1)).toPromise();\n }\n /** Creates a combined options object using the passed-in options and the individual inputs. */\n _combineOptions() {\n const options = this._options || DEFAULT_MARKER_OPTIONS$1;\n return {\n ...options,\n title: this._title || options.title,\n position: this._position || options.position,\n label: this._label || options.label,\n clickable: this._clickable ?? options.clickable,\n map: this._googleMap.googleMap,\n icon: this._icon || options.icon,\n visible: this._visible ?? options.visible,\n };\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.marker) {\n throw Error('Cannot interact with a Google Map Marker before it has been ' +\n 'initialized. Please wait for the Marker to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapMarker, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapMarker, isStandalone: true, selector: \"map-marker\", inputs: { title: \"title\", position: \"position\", label: \"label\", clickable: \"clickable\", options: \"options\", icon: \"icon\", visible: \"visible\" }, outputs: { animationChanged: \"animationChanged\", mapClick: \"mapClick\", clickableChanged: \"clickableChanged\", cursorChanged: \"cursorChanged\", mapDblclick: \"mapDblclick\", mapDrag: \"mapDrag\", mapDragend: \"mapDragend\", draggableChanged: \"draggableChanged\", mapDragstart: \"mapDragstart\", flatChanged: \"flatChanged\", iconChanged: \"iconChanged\", mapMousedown: \"mapMousedown\", mapMouseout: \"mapMouseout\", mapMouseover: \"mapMouseover\", mapMouseup: \"mapMouseup\", positionChanged: \"positionChanged\", mapRightclick: \"mapRightclick\", shapeChanged: \"shapeChanged\", titleChanged: \"titleChanged\", visibleChanged: \"visibleChanged\", zindexChanged: \"zindexChanged\", markerInitialized: \"markerInitialized\" }, exportAs: [\"mapMarker\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapMarker, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-marker',\n exportAs: 'mapMarker',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { title: [{\n type: Input\n }], position: [{\n type: Input\n }], label: [{\n type: Input\n }], clickable: [{\n type: Input\n }], options: [{\n type: Input\n }], icon: [{\n type: Input\n }], visible: [{\n type: Input\n }], animationChanged: [{\n type: Output\n }], mapClick: [{\n type: Output\n }], clickableChanged: [{\n type: Output\n }], cursorChanged: [{\n type: Output\n }], mapDblclick: [{\n type: Output\n }], mapDrag: [{\n type: Output\n }], mapDragend: [{\n type: Output\n }], draggableChanged: [{\n type: Output\n }], mapDragstart: [{\n type: Output\n }], flatChanged: [{\n type: Output\n }], iconChanged: [{\n type: Output\n }], mapMousedown: [{\n type: Output\n }], mapMouseout: [{\n type: Output\n }], mapMouseover: [{\n type: Output\n }], mapMouseup: [{\n type: Output\n }], positionChanged: [{\n type: Output\n }], mapRightclick: [{\n type: Output\n }], shapeChanged: [{\n type: Output\n }], titleChanged: [{\n type: Output\n }], visibleChanged: [{\n type: Output\n }], zindexChanged: [{\n type: Output\n }], markerInitialized: [{\n type: Output\n }] } });\n\n/// \n/** Default options for a clusterer. */\nconst DEFAULT_CLUSTERER_OPTIONS = {};\n/**\n * Angular component for implementing a Google Maps Marker Clusterer.\n *\n * See https://developers.google.com/maps/documentation/javascript/marker-clustering\n */\nclass MapMarkerClusterer {\n set averageCenter(averageCenter) {\n this._averageCenter = averageCenter;\n }\n set batchSizeIE(batchSizeIE) {\n this._batchSizeIE = batchSizeIE;\n }\n set calculator(calculator) {\n this._calculator = calculator;\n }\n set clusterClass(clusterClass) {\n this._clusterClass = clusterClass;\n }\n set enableRetinaIcons(enableRetinaIcons) {\n this._enableRetinaIcons = enableRetinaIcons;\n }\n set gridSize(gridSize) {\n this._gridSize = gridSize;\n }\n set ignoreHidden(ignoreHidden) {\n this._ignoreHidden = ignoreHidden;\n }\n set imageExtension(imageExtension) {\n this._imageExtension = imageExtension;\n }\n set imagePath(imagePath) {\n this._imagePath = imagePath;\n }\n set imageSizes(imageSizes) {\n this._imageSizes = imageSizes;\n }\n set maxZoom(maxZoom) {\n this._maxZoom = maxZoom;\n }\n set minimumClusterSize(minimumClusterSize) {\n this._minimumClusterSize = minimumClusterSize;\n }\n set styles(styles) {\n this._styles = styles;\n }\n set title(title) {\n this._title = title;\n }\n set zIndex(zIndex) {\n this._zIndex = zIndex;\n }\n set zoomOnClick(zoomOnClick) {\n this._zoomOnClick = zoomOnClick;\n }\n set options(options) {\n this._options = options;\n }\n constructor(_googleMap, _ngZone) {\n this._googleMap = _googleMap;\n this._ngZone = _ngZone;\n this._currentMarkers = new Set();\n this._eventManager = new MapEventManager(inject(NgZone));\n this._destroy = new Subject();\n this.ariaLabelFn = () => '';\n /**\n * See\n * googlemaps.github.io/v3-utility-library/modules/\n * _google_markerclustererplus.html#clusteringbegin\n */\n this.clusteringbegin = this._eventManager.getLazyEmitter('clusteringbegin');\n /**\n * See\n * googlemaps.github.io/v3-utility-library/modules/_google_markerclustererplus.html#clusteringend\n */\n this.clusteringend = this._eventManager.getLazyEmitter('clusteringend');\n /** Emits when a cluster has been clicked. */\n this.clusterClick = this._eventManager.getLazyEmitter('click');\n /** Event emitted when the clusterer is initialized. */\n this.markerClustererInitialized = new EventEmitter();\n this._canInitialize = _googleMap._isBrowser;\n }\n ngOnInit() {\n if (this._canInitialize) {\n this._ngZone.runOutsideAngular(() => {\n this._googleMap._resolveMap().then(map => {\n if (typeof MarkerClusterer !== 'function' &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('MarkerClusterer class not found, cannot construct a marker cluster. ' +\n 'Please install the MarkerClustererPlus library: ' +\n 'https://github.com/googlemaps/js-markerclustererplus');\n }\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this.markerClusterer = this._ngZone.runOutsideAngular(() => {\n return new MarkerClusterer(map, [], this._combineOptions());\n });\n this._assertInitialized();\n this._eventManager.setTarget(this.markerClusterer);\n this.markerClustererInitialized.emit(this.markerClusterer);\n });\n });\n }\n }\n ngAfterContentInit() {\n if (this._canInitialize) {\n if (this.markerClusterer) {\n this._watchForMarkerChanges();\n }\n else {\n this.markerClustererInitialized\n .pipe(take(1), takeUntil(this._destroy))\n .subscribe(() => this._watchForMarkerChanges());\n }\n }\n }\n ngOnChanges(changes) {\n const { markerClusterer: clusterer, ariaLabelFn, _averageCenter, _batchSizeIE, _calculator, _styles, _clusterClass, _enableRetinaIcons, _gridSize, _ignoreHidden, _imageExtension, _imagePath, _imageSizes, _maxZoom, _minimumClusterSize, _title, _zIndex, _zoomOnClick, } = this;\n if (clusterer) {\n if (changes['options']) {\n clusterer.setOptions(this._combineOptions());\n }\n if (changes['ariaLabelFn']) {\n clusterer.ariaLabelFn = ariaLabelFn;\n }\n if (changes['averageCenter'] && _averageCenter !== undefined) {\n clusterer.setAverageCenter(_averageCenter);\n }\n if (changes['batchSizeIE'] && _batchSizeIE !== undefined) {\n clusterer.setBatchSizeIE(_batchSizeIE);\n }\n if (changes['calculator'] && !!_calculator) {\n clusterer.setCalculator(_calculator);\n }\n if (changes['clusterClass'] && _clusterClass !== undefined) {\n clusterer.setClusterClass(_clusterClass);\n }\n if (changes['enableRetinaIcons'] && _enableRetinaIcons !== undefined) {\n clusterer.setEnableRetinaIcons(_enableRetinaIcons);\n }\n if (changes['gridSize'] && _gridSize !== undefined) {\n clusterer.setGridSize(_gridSize);\n }\n if (changes['ignoreHidden'] && _ignoreHidden !== undefined) {\n clusterer.setIgnoreHidden(_ignoreHidden);\n }\n if (changes['imageExtension'] && _imageExtension !== undefined) {\n clusterer.setImageExtension(_imageExtension);\n }\n if (changes['imagePath'] && _imagePath !== undefined) {\n clusterer.setImagePath(_imagePath);\n }\n if (changes['imageSizes'] && _imageSizes) {\n clusterer.setImageSizes(_imageSizes);\n }\n if (changes['maxZoom'] && _maxZoom !== undefined) {\n clusterer.setMaxZoom(_maxZoom);\n }\n if (changes['minimumClusterSize'] && _minimumClusterSize !== undefined) {\n clusterer.setMinimumClusterSize(_minimumClusterSize);\n }\n if (changes['styles'] && _styles) {\n clusterer.setStyles(_styles);\n }\n if (changes['title'] && _title !== undefined) {\n clusterer.setTitle(_title);\n }\n if (changes['zIndex'] && _zIndex !== undefined) {\n clusterer.setZIndex(_zIndex);\n }\n if (changes['zoomOnClick'] && _zoomOnClick !== undefined) {\n clusterer.setZoomOnClick(_zoomOnClick);\n }\n }\n }\n ngOnDestroy() {\n this._destroy.next();\n this._destroy.complete();\n this._eventManager.destroy();\n this.markerClusterer?.setMap(null);\n }\n fitMapToMarkers(padding) {\n this._assertInitialized();\n this.markerClusterer.fitMapToMarkers(padding);\n }\n getAverageCenter() {\n this._assertInitialized();\n return this.markerClusterer.getAverageCenter();\n }\n getBatchSizeIE() {\n this._assertInitialized();\n return this.markerClusterer.getBatchSizeIE();\n }\n getCalculator() {\n this._assertInitialized();\n return this.markerClusterer.getCalculator();\n }\n getClusterClass() {\n this._assertInitialized();\n return this.markerClusterer.getClusterClass();\n }\n getClusters() {\n this._assertInitialized();\n return this.markerClusterer.getClusters();\n }\n getEnableRetinaIcons() {\n this._assertInitialized();\n return this.markerClusterer.getEnableRetinaIcons();\n }\n getGridSize() {\n this._assertInitialized();\n return this.markerClusterer.getGridSize();\n }\n getIgnoreHidden() {\n this._assertInitialized();\n return this.markerClusterer.getIgnoreHidden();\n }\n getImageExtension() {\n this._assertInitialized();\n return this.markerClusterer.getImageExtension();\n }\n getImagePath() {\n this._assertInitialized();\n return this.markerClusterer.getImagePath();\n }\n getImageSizes() {\n this._assertInitialized();\n return this.markerClusterer.getImageSizes();\n }\n getMaxZoom() {\n this._assertInitialized();\n return this.markerClusterer.getMaxZoom();\n }\n getMinimumClusterSize() {\n this._assertInitialized();\n return this.markerClusterer.getMinimumClusterSize();\n }\n getStyles() {\n this._assertInitialized();\n return this.markerClusterer.getStyles();\n }\n getTitle() {\n this._assertInitialized();\n return this.markerClusterer.getTitle();\n }\n getTotalClusters() {\n this._assertInitialized();\n return this.markerClusterer.getTotalClusters();\n }\n getTotalMarkers() {\n this._assertInitialized();\n return this.markerClusterer.getTotalMarkers();\n }\n getZIndex() {\n this._assertInitialized();\n return this.markerClusterer.getZIndex();\n }\n getZoomOnClick() {\n this._assertInitialized();\n return this.markerClusterer.getZoomOnClick();\n }\n _combineOptions() {\n const options = this._options || DEFAULT_CLUSTERER_OPTIONS;\n return {\n ...options,\n ariaLabelFn: this.ariaLabelFn ?? options.ariaLabelFn,\n averageCenter: this._averageCenter ?? options.averageCenter,\n batchSize: this.batchSize ?? options.batchSize,\n batchSizeIE: this._batchSizeIE ?? options.batchSizeIE,\n calculator: this._calculator ?? options.calculator,\n clusterClass: this._clusterClass ?? options.clusterClass,\n enableRetinaIcons: this._enableRetinaIcons ?? options.enableRetinaIcons,\n gridSize: this._gridSize ?? options.gridSize,\n ignoreHidden: this._ignoreHidden ?? options.ignoreHidden,\n imageExtension: this._imageExtension ?? options.imageExtension,\n imagePath: this._imagePath ?? options.imagePath,\n imageSizes: this._imageSizes ?? options.imageSizes,\n maxZoom: this._maxZoom ?? options.maxZoom,\n minimumClusterSize: this._minimumClusterSize ?? options.minimumClusterSize,\n styles: this._styles ?? options.styles,\n title: this._title ?? options.title,\n zIndex: this._zIndex ?? options.zIndex,\n zoomOnClick: this._zoomOnClick ?? options.zoomOnClick,\n };\n }\n _watchForMarkerChanges() {\n this._assertInitialized();\n this._ngZone.runOutsideAngular(() => {\n this._getInternalMarkers(this._markers).then(markers => {\n const initialMarkers = [];\n for (const marker of markers) {\n this._currentMarkers.add(marker);\n initialMarkers.push(marker);\n }\n this.markerClusterer.addMarkers(initialMarkers);\n });\n });\n this._markers.changes\n .pipe(takeUntil(this._destroy))\n .subscribe((markerComponents) => {\n this._assertInitialized();\n this._ngZone.runOutsideAngular(() => {\n this._getInternalMarkers(markerComponents).then(markers => {\n const newMarkers = new Set(markers);\n const markersToAdd = [];\n const markersToRemove = [];\n for (const marker of Array.from(newMarkers)) {\n if (!this._currentMarkers.has(marker)) {\n this._currentMarkers.add(marker);\n markersToAdd.push(marker);\n }\n }\n for (const marker of Array.from(this._currentMarkers)) {\n if (!newMarkers.has(marker)) {\n markersToRemove.push(marker);\n }\n }\n this.markerClusterer.addMarkers(markersToAdd, true);\n this.markerClusterer.removeMarkers(markersToRemove, true);\n this.markerClusterer.repaint();\n for (const marker of markersToRemove) {\n this._currentMarkers.delete(marker);\n }\n });\n });\n });\n }\n _getInternalMarkers(markers) {\n return Promise.all(markers.map(markerComponent => markerComponent._resolveMarker()));\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.markerClusterer) {\n throw Error('Cannot interact with a MarkerClusterer before it has been initialized. ' +\n 'Please wait for the MarkerClusterer to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapMarkerClusterer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapMarkerClusterer, isStandalone: true, selector: \"map-marker-clusterer\", inputs: { ariaLabelFn: \"ariaLabelFn\", averageCenter: \"averageCenter\", batchSize: \"batchSize\", batchSizeIE: \"batchSizeIE\", calculator: \"calculator\", clusterClass: \"clusterClass\", enableRetinaIcons: \"enableRetinaIcons\", gridSize: \"gridSize\", ignoreHidden: \"ignoreHidden\", imageExtension: \"imageExtension\", imagePath: \"imagePath\", imageSizes: \"imageSizes\", maxZoom: \"maxZoom\", minimumClusterSize: \"minimumClusterSize\", styles: \"styles\", title: \"title\", zIndex: \"zIndex\", zoomOnClick: \"zoomOnClick\", options: \"options\" }, outputs: { clusteringbegin: \"clusteringbegin\", clusteringend: \"clusteringend\", clusterClick: \"clusterClick\", markerClustererInitialized: \"markerClustererInitialized\" }, queries: [{ propertyName: \"_markers\", predicate: MapMarker, descendants: true }], exportAs: [\"mapMarkerClusterer\"], usesOnChanges: true, ngImport: i0, template: ' ', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapMarkerClusterer, decorators: [{\n type: Component,\n args: [{\n selector: 'map-marker-clusterer',\n exportAs: 'mapMarkerClusterer',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n template: ' ',\n encapsulation: ViewEncapsulation.None,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { ariaLabelFn: [{\n type: Input\n }], averageCenter: [{\n type: Input\n }], batchSize: [{\n type: Input\n }], batchSizeIE: [{\n type: Input\n }], calculator: [{\n type: Input\n }], clusterClass: [{\n type: Input\n }], enableRetinaIcons: [{\n type: Input\n }], gridSize: [{\n type: Input\n }], ignoreHidden: [{\n type: Input\n }], imageExtension: [{\n type: Input\n }], imagePath: [{\n type: Input\n }], imageSizes: [{\n type: Input\n }], maxZoom: [{\n type: Input\n }], minimumClusterSize: [{\n type: Input\n }], styles: [{\n type: Input\n }], title: [{\n type: Input\n }], zIndex: [{\n type: Input\n }], zoomOnClick: [{\n type: Input\n }], options: [{\n type: Input\n }], clusteringbegin: [{\n type: Output\n }], clusteringend: [{\n type: Output\n }], clusterClick: [{\n type: Output\n }], _markers: [{\n type: ContentChildren,\n args: [MapMarker, { descendants: true }]\n }], markerClustererInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps Polygon via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon\n */\nclass MapPolygon {\n set options(options) {\n this._options.next(options || {});\n }\n set paths(paths) {\n this._paths.next(paths);\n }\n constructor(_map, _ngZone) {\n this._map = _map;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n this._options = new BehaviorSubject({});\n this._paths = new BehaviorSubject(undefined);\n this._destroyed = new Subject();\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.click\n */\n this.polygonClick = this._eventManager.getLazyEmitter('click');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dblclick\n */\n this.polygonDblclick = this._eventManager.getLazyEmitter('dblclick');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.drag\n */\n this.polygonDrag = this._eventManager.getLazyEmitter('drag');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dragend\n */\n this.polygonDragend = this._eventManager.getLazyEmitter('dragend');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dragstart\n */\n this.polygonDragstart = this._eventManager.getLazyEmitter('dragstart');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mousedown\n */\n this.polygonMousedown = this._eventManager.getLazyEmitter('mousedown');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mousemove\n */\n this.polygonMousemove = this._eventManager.getLazyEmitter('mousemove');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseout\n */\n this.polygonMouseout = this._eventManager.getLazyEmitter('mouseout');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseover\n */\n this.polygonMouseover = this._eventManager.getLazyEmitter('mouseover');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseup\n */\n this.polygonMouseup = this._eventManager.getLazyEmitter('mouseup');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.rightclick\n */\n this.polygonRightclick = this._eventManager.getLazyEmitter('rightclick');\n /** Event emitted when the polygon is initialized. */\n this.polygonInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n this._combineOptions()\n .pipe(take(1))\n .subscribe(options => {\n if (google.maps.Polygon && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.Polygon, options);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.Polygon, options);\n });\n });\n }\n });\n }\n }\n _initialize(map, polygonConstructor, options) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.polygon = new polygonConstructor(options);\n this._assertInitialized();\n this.polygon.setMap(map);\n this._eventManager.setTarget(this.polygon);\n this.polygonInitialized.emit(this.polygon);\n this._watchForOptionsChanges();\n this._watchForPathChanges();\n });\n }\n ngOnDestroy() {\n this._eventManager.destroy();\n this._destroyed.next();\n this._destroyed.complete();\n this.polygon?.setMap(null);\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getDraggable\n */\n getDraggable() {\n this._assertInitialized();\n return this.polygon.getDraggable();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getEditable\n */\n getEditable() {\n this._assertInitialized();\n return this.polygon.getEditable();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getPath\n */\n getPath() {\n this._assertInitialized();\n return this.polygon.getPath();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getPaths\n */\n getPaths() {\n this._assertInitialized();\n return this.polygon.getPaths();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getVisible\n */\n getVisible() {\n this._assertInitialized();\n return this.polygon.getVisible();\n }\n _combineOptions() {\n return combineLatest([this._options, this._paths]).pipe(map(([options, paths]) => {\n const combinedOptions = {\n ...options,\n paths: paths || options.paths,\n };\n return combinedOptions;\n }));\n }\n _watchForOptionsChanges() {\n this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {\n this._assertInitialized();\n this.polygon.setOptions(options);\n });\n }\n _watchForPathChanges() {\n this._paths.pipe(takeUntil(this._destroyed)).subscribe(paths => {\n if (paths) {\n this._assertInitialized();\n this.polygon.setPaths(paths);\n }\n });\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.polygon) {\n throw Error('Cannot interact with a Google Map Polygon before it has been ' +\n 'initialized. Please wait for the Polygon to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapPolygon, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapPolygon, isStandalone: true, selector: \"map-polygon\", inputs: { options: \"options\", paths: \"paths\" }, outputs: { polygonClick: \"polygonClick\", polygonDblclick: \"polygonDblclick\", polygonDrag: \"polygonDrag\", polygonDragend: \"polygonDragend\", polygonDragstart: \"polygonDragstart\", polygonMousedown: \"polygonMousedown\", polygonMousemove: \"polygonMousemove\", polygonMouseout: \"polygonMouseout\", polygonMouseover: \"polygonMouseover\", polygonMouseup: \"polygonMouseup\", polygonRightclick: \"polygonRightclick\", polygonInitialized: \"polygonInitialized\" }, exportAs: [\"mapPolygon\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapPolygon, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-polygon',\n exportAs: 'mapPolygon',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{\n type: Input\n }], paths: [{\n type: Input\n }], polygonClick: [{\n type: Output\n }], polygonDblclick: [{\n type: Output\n }], polygonDrag: [{\n type: Output\n }], polygonDragend: [{\n type: Output\n }], polygonDragstart: [{\n type: Output\n }], polygonMousedown: [{\n type: Output\n }], polygonMousemove: [{\n type: Output\n }], polygonMouseout: [{\n type: Output\n }], polygonMouseover: [{\n type: Output\n }], polygonMouseup: [{\n type: Output\n }], polygonRightclick: [{\n type: Output\n }], polygonInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps Polyline via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline\n */\nclass MapPolyline {\n set options(options) {\n this._options.next(options || {});\n }\n set path(path) {\n this._path.next(path);\n }\n constructor(_map, _ngZone) {\n this._map = _map;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n this._options = new BehaviorSubject({});\n this._path = new BehaviorSubject(undefined);\n this._destroyed = new Subject();\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.click\n */\n this.polylineClick = this._eventManager.getLazyEmitter('click');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dblclick\n */\n this.polylineDblclick = this._eventManager.getLazyEmitter('dblclick');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.drag\n */\n this.polylineDrag = this._eventManager.getLazyEmitter('drag');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dragend\n */\n this.polylineDragend = this._eventManager.getLazyEmitter('dragend');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dragstart\n */\n this.polylineDragstart = this._eventManager.getLazyEmitter('dragstart');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mousedown\n */\n this.polylineMousedown = this._eventManager.getLazyEmitter('mousedown');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mousemove\n */\n this.polylineMousemove = this._eventManager.getLazyEmitter('mousemove');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseout\n */\n this.polylineMouseout = this._eventManager.getLazyEmitter('mouseout');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseover\n */\n this.polylineMouseover = this._eventManager.getLazyEmitter('mouseover');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseup\n */\n this.polylineMouseup = this._eventManager.getLazyEmitter('mouseup');\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.rightclick\n */\n this.polylineRightclick = this._eventManager.getLazyEmitter('rightclick');\n /** Event emitted when the polyline is initialized. */\n this.polylineInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n this._combineOptions()\n .pipe(take(1))\n .subscribe(options => {\n if (google.maps.Polyline && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.Polyline, options);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.Polyline, options);\n });\n });\n }\n });\n }\n }\n _initialize(map, polylineConstructor, options) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.polyline = new polylineConstructor(options);\n this._assertInitialized();\n this.polyline.setMap(map);\n this._eventManager.setTarget(this.polyline);\n this.polylineInitialized.emit(this.polyline);\n this._watchForOptionsChanges();\n this._watchForPathChanges();\n });\n }\n ngOnDestroy() {\n this._eventManager.destroy();\n this._destroyed.next();\n this._destroyed.complete();\n this.polyline?.setMap(null);\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getDraggable\n */\n getDraggable() {\n this._assertInitialized();\n return this.polyline.getDraggable();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getEditable\n */\n getEditable() {\n this._assertInitialized();\n return this.polyline.getEditable();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getPath\n */\n getPath() {\n this._assertInitialized();\n return this.polyline.getPath();\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getVisible\n */\n getVisible() {\n this._assertInitialized();\n return this.polyline.getVisible();\n }\n _combineOptions() {\n return combineLatest([this._options, this._path]).pipe(map(([options, path]) => {\n const combinedOptions = {\n ...options,\n path: path || options.path,\n };\n return combinedOptions;\n }));\n }\n _watchForOptionsChanges() {\n this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {\n this._assertInitialized();\n this.polyline.setOptions(options);\n });\n }\n _watchForPathChanges() {\n this._path.pipe(takeUntil(this._destroyed)).subscribe(path => {\n if (path) {\n this._assertInitialized();\n this.polyline.setPath(path);\n }\n });\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.polyline) {\n throw Error('Cannot interact with a Google Map Polyline before it has been ' +\n 'initialized. Please wait for the Polyline to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapPolyline, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapPolyline, isStandalone: true, selector: \"map-polyline\", inputs: { options: \"options\", path: \"path\" }, outputs: { polylineClick: \"polylineClick\", polylineDblclick: \"polylineDblclick\", polylineDrag: \"polylineDrag\", polylineDragend: \"polylineDragend\", polylineDragstart: \"polylineDragstart\", polylineMousedown: \"polylineMousedown\", polylineMousemove: \"polylineMousemove\", polylineMouseout: \"polylineMouseout\", polylineMouseover: \"polylineMouseover\", polylineMouseup: \"polylineMouseup\", polylineRightclick: \"polylineRightclick\", polylineInitialized: \"polylineInitialized\" }, exportAs: [\"mapPolyline\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapPolyline, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-polyline',\n exportAs: 'mapPolyline',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{\n type: Input\n }], path: [{\n type: Input\n }], polylineClick: [{\n type: Output\n }], polylineDblclick: [{\n type: Output\n }], polylineDrag: [{\n type: Output\n }], polylineDragend: [{\n type: Output\n }], polylineDragstart: [{\n type: Output\n }], polylineMousedown: [{\n type: Output\n }], polylineMousemove: [{\n type: Output\n }], polylineMouseout: [{\n type: Output\n }], polylineMouseover: [{\n type: Output\n }], polylineMouseup: [{\n type: Output\n }], polylineRightclick: [{\n type: Output\n }], polylineInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps Rectangle via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle\n */\nclass MapRectangle {\n set options(options) {\n this._options.next(options || {});\n }\n set bounds(bounds) {\n this._bounds.next(bounds);\n }\n constructor(_map, _ngZone) {\n this._map = _map;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n this._options = new BehaviorSubject({});\n this._bounds = new BehaviorSubject(undefined);\n this._destroyed = new Subject();\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.boundsChanged\n */ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.click\n */\n this.rectangleClick = this._eventManager.getLazyEmitter('click');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dblclick\n */\n this.rectangleDblclick = this._eventManager.getLazyEmitter('dblclick');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.drag\n */\n this.rectangleDrag = this._eventManager.getLazyEmitter('drag');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dragend\n */\n this.rectangleDragend = this._eventManager.getLazyEmitter('dragend');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dragstart\n */\n this.rectangleDragstart = this._eventManager.getLazyEmitter('dragstart');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mousedown\n */\n this.rectangleMousedown = this._eventManager.getLazyEmitter('mousedown');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mousemove\n */\n this.rectangleMousemove = this._eventManager.getLazyEmitter('mousemove');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseout\n */\n this.rectangleMouseout = this._eventManager.getLazyEmitter('mouseout');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseover\n */\n this.rectangleMouseover = this._eventManager.getLazyEmitter('mouseover');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseup\n */\n this.rectangleMouseup = this._eventManager.getLazyEmitter('mouseup');\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.rightclick\n */\n this.rectangleRightclick = this._eventManager.getLazyEmitter('rightclick');\n /** Event emitted when the rectangle is initialized. */\n this.rectangleInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n this._combineOptions()\n .pipe(take(1))\n .subscribe(options => {\n if (google.maps.Rectangle && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.Rectangle, options);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.Rectangle, options);\n });\n });\n }\n });\n }\n }\n _initialize(map, rectangleConstructor, options) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.rectangle = new rectangleConstructor(options);\n this._assertInitialized();\n this.rectangle.setMap(map);\n this._eventManager.setTarget(this.rectangle);\n this.rectangleInitialized.emit(this.rectangle);\n this._watchForOptionsChanges();\n this._watchForBoundsChanges();\n });\n }\n ngOnDestroy() {\n this._eventManager.destroy();\n this._destroyed.next();\n this._destroyed.complete();\n this.rectangle?.setMap(null);\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getBounds\n */\n getBounds() {\n this._assertInitialized();\n return this.rectangle.getBounds();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getDraggable\n */\n getDraggable() {\n this._assertInitialized();\n return this.rectangle.getDraggable();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getEditable\n */\n getEditable() {\n this._assertInitialized();\n return this.rectangle.getEditable();\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getVisible\n */\n getVisible() {\n this._assertInitialized();\n return this.rectangle.getVisible();\n }\n _combineOptions() {\n return combineLatest([this._options, this._bounds]).pipe(map(([options, bounds]) => {\n const combinedOptions = {\n ...options,\n bounds: bounds || options.bounds,\n };\n return combinedOptions;\n }));\n }\n _watchForOptionsChanges() {\n this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {\n this._assertInitialized();\n this.rectangle.setOptions(options);\n });\n }\n _watchForBoundsChanges() {\n this._bounds.pipe(takeUntil(this._destroyed)).subscribe(bounds => {\n if (bounds) {\n this._assertInitialized();\n this.rectangle.setBounds(bounds);\n }\n });\n }\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.rectangle) {\n throw Error('Cannot interact with a Google Map Rectangle before it has been initialized. ' +\n 'Please wait for the Rectangle to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapRectangle, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapRectangle, isStandalone: true, selector: \"map-rectangle\", inputs: { options: \"options\", bounds: \"bounds\" }, outputs: { boundsChanged: \"boundsChanged\", rectangleClick: \"rectangleClick\", rectangleDblclick: \"rectangleDblclick\", rectangleDrag: \"rectangleDrag\", rectangleDragend: \"rectangleDragend\", rectangleDragstart: \"rectangleDragstart\", rectangleMousedown: \"rectangleMousedown\", rectangleMousemove: \"rectangleMousemove\", rectangleMouseout: \"rectangleMouseout\", rectangleMouseover: \"rectangleMouseover\", rectangleMouseup: \"rectangleMouseup\", rectangleRightclick: \"rectangleRightclick\", rectangleInitialized: \"rectangleInitialized\" }, exportAs: [\"mapRectangle\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapRectangle, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-rectangle',\n exportAs: 'mapRectangle',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{\n type: Input\n }], bounds: [{\n type: Input\n }], boundsChanged: [{\n type: Output\n }], rectangleClick: [{\n type: Output\n }], rectangleDblclick: [{\n type: Output\n }], rectangleDrag: [{\n type: Output\n }], rectangleDragend: [{\n type: Output\n }], rectangleDragstart: [{\n type: Output\n }], rectangleMousedown: [{\n type: Output\n }], rectangleMousemove: [{\n type: Output\n }], rectangleMouseout: [{\n type: Output\n }], rectangleMouseover: [{\n type: Output\n }], rectangleMouseup: [{\n type: Output\n }], rectangleRightclick: [{\n type: Output\n }], rectangleInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps Traffic Layer via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/map#TrafficLayer\n */\nclass MapTrafficLayer {\n /**\n * Whether the traffic layer refreshes with updated information automatically.\n */\n set autoRefresh(autoRefresh) {\n this._autoRefresh.next(autoRefresh);\n }\n constructor(_map, _ngZone) {\n this._map = _map;\n this._ngZone = _ngZone;\n this._autoRefresh = new BehaviorSubject(true);\n this._destroyed = new Subject();\n /** Event emitted when the traffic layer is initialized. */\n this.trafficLayerInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n this._combineOptions()\n .pipe(take(1))\n .subscribe(options => {\n if (google.maps.TrafficLayer && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.TrafficLayer, options);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.TrafficLayer, options);\n });\n });\n }\n });\n }\n }\n _initialize(map, layerConstructor, options) {\n this._ngZone.runOutsideAngular(() => {\n this.trafficLayer = new layerConstructor(options);\n this._assertInitialized();\n this.trafficLayer.setMap(map);\n this.trafficLayerInitialized.emit(this.trafficLayer);\n this._watchForAutoRefreshChanges();\n });\n }\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n this.trafficLayer?.setMap(null);\n }\n _combineOptions() {\n return this._autoRefresh.pipe(map(autoRefresh => {\n const combinedOptions = { autoRefresh };\n return combinedOptions;\n }));\n }\n _watchForAutoRefreshChanges() {\n this._combineOptions()\n .pipe(takeUntil(this._destroyed))\n .subscribe(options => {\n this._assertInitialized();\n this.trafficLayer.setOptions(options);\n });\n }\n _assertInitialized() {\n if (!this.trafficLayer) {\n throw Error('Cannot interact with a Google Map Traffic Layer before it has been initialized. ' +\n 'Please wait for the Traffic Layer to load before trying to interact with it.');\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapTrafficLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapTrafficLayer, isStandalone: true, selector: \"map-traffic-layer\", inputs: { autoRefresh: \"autoRefresh\" }, outputs: { trafficLayerInitialized: \"trafficLayerInitialized\" }, exportAs: [\"mapTrafficLayer\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapTrafficLayer, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-traffic-layer',\n exportAs: 'mapTrafficLayer',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { autoRefresh: [{\n type: Input\n }], trafficLayerInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular component that renders a Google Maps Transit Layer via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/map#TransitLayer\n */\nclass MapTransitLayer {\n constructor() {\n this._map = inject(GoogleMap);\n this._zone = inject(NgZone);\n /** Event emitted when the transit layer is initialized. */\n this.transitLayerInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._map._isBrowser) {\n if (google.maps.TransitLayer && this._map.googleMap) {\n this._initialize(this._map.googleMap, google.maps.TransitLayer);\n }\n else {\n this._zone.runOutsideAngular(() => {\n Promise.all([this._map._resolveMap(), google.maps.importLibrary('maps')]).then(([map, lib]) => {\n this._initialize(map, lib.TransitLayer);\n });\n });\n }\n }\n }\n _initialize(map, layerConstructor) {\n this._zone.runOutsideAngular(() => {\n this.transitLayer = new layerConstructor();\n this.transitLayerInitialized.emit(this.transitLayer);\n this._assertLayerInitialized();\n this.transitLayer.setMap(map);\n });\n }\n ngOnDestroy() {\n this.transitLayer?.setMap(null);\n }\n _assertLayerInitialized() {\n if (!this.transitLayer) {\n throw Error('Cannot interact with a Google Map Transit Layer before it has been initialized. ' +\n 'Please wait for the Transit Layer to load before trying to interact with it.');\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapTransitLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapTransitLayer, isStandalone: true, selector: \"map-transit-layer\", outputs: { transitLayerInitialized: \"transitLayerInitialized\" }, exportAs: [\"mapTransitLayer\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapTransitLayer, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-transit-layer',\n exportAs: 'mapTransitLayer',\n standalone: true,\n }]\n }], propDecorators: { transitLayerInitialized: [{\n type: Output\n }] } });\n\n/// \n/**\n * Angular directive that renders a Google Maps heatmap via the Google Maps JavaScript API.\n *\n * See: https://developers.google.com/maps/documentation/javascript/reference/visualization\n */\nclass MapHeatmapLayer {\n /**\n * Data shown on the heatmap.\n * See: https://developers.google.com/maps/documentation/javascript/reference/visualization\n */\n set data(data) {\n this._data = data;\n }\n /**\n * Options used to configure the heatmap. See:\n * developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayerOptions\n */\n set options(options) {\n this._options = options;\n }\n constructor(_googleMap, _ngZone) {\n this._googleMap = _googleMap;\n this._ngZone = _ngZone;\n /** Event emitted when the heatmap is initialized. */\n this.heatmapInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (this._googleMap._isBrowser) {\n if (!window.google?.maps?.visualization &&\n !window.google?.maps.importLibrary &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Namespace `google.maps.visualization` not found, cannot construct heatmap. ' +\n 'Please install the Google Maps JavaScript API with the \"visualization\" library: ' +\n 'https://developers.google.com/maps/documentation/javascript/visualization');\n }\n if (google.maps.visualization?.HeatmapLayer && this._googleMap.googleMap) {\n this._initialize(this._googleMap.googleMap, google.maps.visualization.HeatmapLayer);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([\n this._googleMap._resolveMap(),\n google.maps.importLibrary('visualization'),\n ]).then(([map, lib]) => {\n this._initialize(map, lib.HeatmapLayer);\n });\n });\n }\n }\n }\n _initialize(map, heatmapConstructor) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.heatmap = new heatmapConstructor(this._combineOptions());\n this._assertInitialized();\n this.heatmap.setMap(map);\n this.heatmapInitialized.emit(this.heatmap);\n });\n }\n ngOnChanges(changes) {\n const { _data, heatmap } = this;\n if (heatmap) {\n if (changes['options']) {\n heatmap.setOptions(this._combineOptions());\n }\n if (changes['data'] && _data !== undefined) {\n heatmap.setData(this._normalizeData(_data));\n }\n }\n }\n ngOnDestroy() {\n this.heatmap?.setMap(null);\n }\n /**\n * Gets the data that is currently shown on the heatmap.\n * See: developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayer\n */\n getData() {\n this._assertInitialized();\n return this.heatmap.getData();\n }\n /** Creates a combined options object using the passed-in options and the individual inputs. */\n _combineOptions() {\n const options = this._options || {};\n return {\n ...options,\n data: this._normalizeData(this._data || options.data || []),\n map: this._googleMap.googleMap,\n };\n }\n /**\n * Most Google Maps APIs support both `LatLng` objects and `LatLngLiteral`. The latter is more\n * convenient to write out, because the Google Maps API doesn't have to have been loaded in order\n * to construct them. The `HeatmapLayer` appears to be an exception that only allows a `LatLng`\n * object, or it throws a runtime error. Since it's more convenient and we expect that Angular\n * users will load the API asynchronously, we allow them to pass in a `LatLngLiteral` and we\n * convert it to a `LatLng` object before passing it off to Google Maps.\n */\n _normalizeData(data) {\n const result = [];\n data.forEach(item => {\n result.push(isLatLngLiteral(item) ? new google.maps.LatLng(item.lat, item.lng) : item);\n });\n return result;\n }\n /** Asserts that the heatmap object has been initialized. */\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.heatmap) {\n throw Error('Cannot interact with a Google Map HeatmapLayer before it has been ' +\n 'initialized. Please wait for the heatmap to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapHeatmapLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapHeatmapLayer, isStandalone: true, selector: \"map-heatmap-layer\", inputs: { data: \"data\", options: \"options\" }, outputs: { heatmapInitialized: \"heatmapInitialized\" }, exportAs: [\"mapHeatmapLayer\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapHeatmapLayer, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-heatmap-layer',\n exportAs: 'mapHeatmapLayer',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { data: [{\n type: Input\n }], options: [{\n type: Input\n }], heatmapInitialized: [{\n type: Output\n }] } });\n/** Asserts that an object is a `LatLngLiteral`. */\nfunction isLatLngLiteral(value) {\n return value && typeof value.lat === 'number' && typeof value.lng === 'number';\n}\n\n/// \n/**\n * Default options for the Google Maps marker component. Displays a marker\n * at the Googleplex.\n */\nconst DEFAULT_MARKER_OPTIONS = {\n position: { lat: 37.221995, lng: -122.184092 },\n};\n/**\n * Angular component that renders a Google Maps marker via the Google Maps JavaScript API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/marker\n */\nclass MapAdvancedMarker {\n /**\n * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the AdvancedMarkerElement with the provided value.\n * See: https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.title\n */\n set title(title) {\n this._title = title;\n }\n /**\n * Sets the AdvancedMarkerElement's position. An AdvancedMarkerElement may be constructed without a position, but will not be displayed until its position is provided - for example, by a user's actions or choices. An AdvancedMarkerElement's position can be provided by setting AdvancedMarkerElement.position if not provided at the construction.\n * Note: AdvancedMarkerElement with altitude is only supported on vector maps.\n * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.position\n */\n set position(position) {\n this._position = position;\n }\n /**\n * The DOM Element backing the visual of an AdvancedMarkerElement.\n * Note: AdvancedMarkerElement does not clone the passed-in DOM element. Once the DOM element is passed to an AdvancedMarkerElement, passing the same DOM element to another AdvancedMarkerElement will move the DOM element and cause the previous AdvancedMarkerElement to look empty.\n * See: https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.content\n */\n set content(content) {\n this._content = content;\n }\n /**\n * If true, the AdvancedMarkerElement can be dragged.\n * Note: AdvancedMarkerElement with altitude is not draggable.\n * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.gmpDraggable\n */\n set gmpDraggable(draggable) {\n this._draggable = draggable;\n }\n /**\n * Options for constructing an AdvancedMarkerElement.\n * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions\n */\n set options(options) {\n this._options = options;\n }\n /**\n * AdvancedMarkerElements on the map are prioritized by zIndex, with higher values indicating higher display.\n * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.zIndex\n */\n set zIndex(zIndex) {\n this._zIndex = zIndex;\n }\n constructor(_googleMap, _ngZone) {\n this._googleMap = _googleMap;\n this._ngZone = _ngZone;\n this._eventManager = new MapEventManager(inject(NgZone));\n /**\n * This event is fired when the AdvancedMarkerElement element is clicked.\n * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.click\n */\n this.mapClick = this._eventManager.getLazyEmitter('click');\n /**\n * This event is repeatedly fired while the user drags the AdvancedMarkerElement.\n * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.drag\n */\n this.mapDrag = this._eventManager.getLazyEmitter('drag');\n /**\n * This event is fired when the user stops dragging the AdvancedMarkerElement.\n * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.dragend\n */\n this.mapDragend = this._eventManager.getLazyEmitter('dragend');\n /**\n * This event is fired when the user starts dragging the AdvancedMarkerElement.\n * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.dragstart\n */\n this.mapDragstart = this._eventManager.getLazyEmitter('dragstart');\n /** Event emitted when the marker is initialized. */\n this.markerInitialized = new EventEmitter();\n }\n ngOnInit() {\n if (!this._googleMap._isBrowser) {\n return;\n }\n if (google.maps.marker?.AdvancedMarkerElement && this._googleMap.googleMap) {\n this._initialize(this._googleMap.googleMap, google.maps.marker.AdvancedMarkerElement);\n }\n else {\n this._ngZone.runOutsideAngular(() => {\n Promise.all([this._googleMap._resolveMap(), google.maps.importLibrary('marker')]).then(([map, lib]) => {\n this._initialize(map, lib.AdvancedMarkerElement);\n });\n });\n }\n }\n _initialize(map, advancedMarkerConstructor) {\n // Create the object outside the zone so its events don't trigger change detection.\n // We'll bring it back in inside the `MapEventManager` only for the events that the\n // user has subscribed to.\n this._ngZone.runOutsideAngular(() => {\n this.advancedMarker = new advancedMarkerConstructor(this._combineOptions());\n this._assertInitialized();\n this.advancedMarker.map = map;\n this._eventManager.setTarget(this.advancedMarker);\n this.markerInitialized.next(this.advancedMarker);\n });\n }\n ngOnChanges(changes) {\n const { advancedMarker, _content, _position, _title, _draggable, _zIndex } = this;\n if (advancedMarker) {\n if (changes['title']) {\n advancedMarker.title = _title;\n }\n if (changes['content']) {\n advancedMarker.content = _content;\n }\n if (changes['gmpDraggable']) {\n advancedMarker.gmpDraggable = _draggable;\n }\n if (changes['content']) {\n advancedMarker.content = _content;\n }\n if (changes['position']) {\n advancedMarker.position = _position;\n }\n if (changes['zIndex']) {\n advancedMarker.zIndex = _zIndex;\n }\n }\n }\n ngOnDestroy() {\n this.markerInitialized.complete();\n this._eventManager.destroy();\n if (this.advancedMarker) {\n this.advancedMarker.map = null;\n }\n }\n getAnchor() {\n this._assertInitialized();\n return this.advancedMarker;\n }\n /** Creates a combined options object using the passed-in options and the individual inputs. */\n _combineOptions() {\n const options = this._options || DEFAULT_MARKER_OPTIONS;\n return {\n ...options,\n title: this._title || options.title,\n position: this._position || options.position,\n content: this._content || options.content,\n zIndex: this._zIndex ?? options.zIndex,\n gmpDraggable: this._draggable ?? options.gmpDraggable,\n map: this._googleMap.googleMap,\n };\n }\n /** Asserts that the map has been initialized. */\n _assertInitialized() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.advancedMarker) {\n throw Error('Cannot interact with a Google Map Marker before it has been ' +\n 'initialized. Please wait for the Marker to load before trying to interact with it.');\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapAdvancedMarker, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MapAdvancedMarker, isStandalone: true, selector: \"map-advanced-marker\", inputs: { title: \"title\", position: \"position\", content: \"content\", gmpDraggable: \"gmpDraggable\", options: \"options\", zIndex: \"zIndex\" }, outputs: { mapClick: \"mapClick\", mapDrag: \"mapDrag\", mapDragend: \"mapDragend\", mapDragstart: \"mapDragstart\", markerInitialized: \"markerInitialized\" }, exportAs: [\"mapAdvancedMarker\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapAdvancedMarker, decorators: [{\n type: Directive,\n args: [{\n selector: 'map-advanced-marker',\n exportAs: 'mapAdvancedMarker',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { title: [{\n type: Input\n }], position: [{\n type: Input\n }], content: [{\n type: Input\n }], gmpDraggable: [{\n type: Input\n }], options: [{\n type: Input\n }], zIndex: [{\n type: Input\n }], mapClick: [{\n type: Output\n }], mapDrag: [{\n type: Output\n }], mapDragend: [{\n type: Output\n }], mapDragstart: [{\n type: Output\n }], markerInitialized: [{\n type: Output\n }] } });\n\nconst COMPONENTS = [\n GoogleMap,\n MapBaseLayer,\n MapBicyclingLayer,\n MapCircle,\n MapDirectionsRenderer,\n MapGroundOverlay,\n MapHeatmapLayer,\n MapInfoWindow,\n MapKmlLayer,\n MapMarker,\n MapAdvancedMarker,\n MapMarkerClusterer,\n MapPolygon,\n MapPolyline,\n MapRectangle,\n MapTrafficLayer,\n MapTransitLayer,\n];\nclass GoogleMapsModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: GoogleMapsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"17.2.0\", ngImport: i0, type: GoogleMapsModule, imports: [GoogleMap,\n MapBaseLayer,\n MapBicyclingLayer,\n MapCircle,\n MapDirectionsRenderer,\n MapGroundOverlay,\n MapHeatmapLayer,\n MapInfoWindow,\n MapKmlLayer,\n MapMarker,\n MapAdvancedMarker,\n MapMarkerClusterer,\n MapPolygon,\n MapPolyline,\n MapRectangle,\n MapTrafficLayer,\n MapTransitLayer], exports: [GoogleMap,\n MapBaseLayer,\n MapBicyclingLayer,\n MapCircle,\n MapDirectionsRenderer,\n MapGroundOverlay,\n MapHeatmapLayer,\n MapInfoWindow,\n MapKmlLayer,\n MapMarker,\n MapAdvancedMarker,\n MapMarkerClusterer,\n MapPolygon,\n MapPolyline,\n MapRectangle,\n MapTrafficLayer,\n MapTransitLayer] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: GoogleMapsModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: GoogleMapsModule, decorators: [{\n type: NgModule,\n args: [{\n imports: COMPONENTS,\n exports: COMPONENTS,\n }]\n }] });\n\n/// \n/**\n * Angular service that wraps the Google Maps DirectionsService from the Google Maps JavaScript\n * API.\n *\n * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsService\n */\nclass MapDirectionsService {\n constructor(_ngZone) {\n this._ngZone = _ngZone;\n }\n /**\n * See\n * developers.google.com/maps/documentation/javascript/reference/directions\n * #DirectionsService.route\n */\n route(request) {\n return new Observable(observer => {\n this._getService().then(service => {\n service.route(request, (result, status) => {\n this._ngZone.run(() => {\n observer.next({ result: result || undefined, status });\n observer.complete();\n });\n });\n });\n });\n }\n _getService() {\n if (!this._directionsService) {\n if (google.maps.DirectionsService) {\n this._directionsService = new google.maps.DirectionsService();\n }\n else {\n return google.maps.importLibrary('routes').then(lib => {\n this._directionsService = new lib.DirectionsService();\n return this._directionsService;\n });\n }\n }\n return Promise.resolve(this._directionsService);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapDirectionsService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapDirectionsService, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapDirectionsService, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: () => [{ type: i0.NgZone }] });\n\n/// \n/**\n * Angular service that wraps the Google Maps Geocoder from the Google Maps JavaScript API.\n * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder\n */\nclass MapGeocoder {\n constructor(_ngZone) {\n this._ngZone = _ngZone;\n }\n /**\n * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder.geocode\n */\n geocode(request) {\n return new Observable(observer => {\n this._getGeocoder().then(geocoder => {\n geocoder.geocode(request, (results, status) => {\n this._ngZone.run(() => {\n observer.next({ results: results || [], status });\n observer.complete();\n });\n });\n });\n });\n }\n _getGeocoder() {\n if (!this._geocoder) {\n if (google.maps.Geocoder) {\n this._geocoder = new google.maps.Geocoder();\n }\n else {\n return google.maps.importLibrary('geocoding').then(lib => {\n this._geocoder = new lib.Geocoder();\n return this._geocoder;\n });\n }\n }\n return Promise.resolve(this._geocoder);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapGeocoder, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapGeocoder, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MapGeocoder, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: () => [{ type: i0.NgZone }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { GoogleMap, GoogleMapsModule, MapAdvancedMarker, MapBaseLayer, MapBicyclingLayer, MapCircle, MapDirectionsRenderer, MapDirectionsService, MapEventManager, MapGeocoder, MapGroundOverlay, MapHeatmapLayer, MapInfoWindow, MapKmlLayer, MapMarker, MapMarkerClusterer, MapPolygon, MapPolyline, MapRectangle, MapTrafficLayer, MapTransitLayer };\n","// This file is a workaround for a bug in web browsers' \"native\"\n// ES6 importing system which is uncapable of importing \"*.json\" files.\n// https://github.com/catamphetamine/libphonenumber-js/issues/239\nexport default {\"version\":4,\"country_calling_codes\":{\"1\":[\"US\",\"AG\",\"AI\",\"AS\",\"BB\",\"BM\",\"BS\",\"CA\",\"DM\",\"DO\",\"GD\",\"GU\",\"JM\",\"KN\",\"KY\",\"LC\",\"MP\",\"MS\",\"PR\",\"SX\",\"TC\",\"TT\",\"VC\",\"VG\",\"VI\"],\"7\":[\"RU\",\"KZ\"],\"20\":[\"EG\"],\"27\":[\"ZA\"],\"30\":[\"GR\"],\"31\":[\"NL\"],\"32\":[\"BE\"],\"33\":[\"FR\"],\"34\":[\"ES\"],\"36\":[\"HU\"],\"39\":[\"IT\",\"VA\"],\"40\":[\"RO\"],\"41\":[\"CH\"],\"43\":[\"AT\"],\"44\":[\"GB\",\"GG\",\"IM\",\"JE\"],\"45\":[\"DK\"],\"46\":[\"SE\"],\"47\":[\"NO\",\"SJ\"],\"48\":[\"PL\"],\"49\":[\"DE\"],\"51\":[\"PE\"],\"52\":[\"MX\"],\"53\":[\"CU\"],\"54\":[\"AR\"],\"55\":[\"BR\"],\"56\":[\"CL\"],\"57\":[\"CO\"],\"58\":[\"VE\"],\"60\":[\"MY\"],\"61\":[\"AU\",\"CC\",\"CX\"],\"62\":[\"ID\"],\"63\":[\"PH\"],\"64\":[\"NZ\"],\"65\":[\"SG\"],\"66\":[\"TH\"],\"81\":[\"JP\"],\"82\":[\"KR\"],\"84\":[\"VN\"],\"86\":[\"CN\"],\"90\":[\"TR\"],\"91\":[\"IN\"],\"92\":[\"PK\"],\"93\":[\"AF\"],\"94\":[\"LK\"],\"95\":[\"MM\"],\"98\":[\"IR\"],\"211\":[\"SS\"],\"212\":[\"MA\",\"EH\"],\"213\":[\"DZ\"],\"216\":[\"TN\"],\"218\":[\"LY\"],\"220\":[\"GM\"],\"221\":[\"SN\"],\"222\":[\"MR\"],\"223\":[\"ML\"],\"224\":[\"GN\"],\"225\":[\"CI\"],\"226\":[\"BF\"],\"227\":[\"NE\"],\"228\":[\"TG\"],\"229\":[\"BJ\"],\"230\":[\"MU\"],\"231\":[\"LR\"],\"232\":[\"SL\"],\"233\":[\"GH\"],\"234\":[\"NG\"],\"235\":[\"TD\"],\"236\":[\"CF\"],\"237\":[\"CM\"],\"238\":[\"CV\"],\"239\":[\"ST\"],\"240\":[\"GQ\"],\"241\":[\"GA\"],\"242\":[\"CG\"],\"243\":[\"CD\"],\"244\":[\"AO\"],\"245\":[\"GW\"],\"246\":[\"IO\"],\"247\":[\"AC\"],\"248\":[\"SC\"],\"249\":[\"SD\"],\"250\":[\"RW\"],\"251\":[\"ET\"],\"252\":[\"SO\"],\"253\":[\"DJ\"],\"254\":[\"KE\"],\"255\":[\"TZ\"],\"256\":[\"UG\"],\"257\":[\"BI\"],\"258\":[\"MZ\"],\"260\":[\"ZM\"],\"261\":[\"MG\"],\"262\":[\"RE\",\"YT\"],\"263\":[\"ZW\"],\"264\":[\"NA\"],\"265\":[\"MW\"],\"266\":[\"LS\"],\"267\":[\"BW\"],\"268\":[\"SZ\"],\"269\":[\"KM\"],\"290\":[\"SH\",\"TA\"],\"291\":[\"ER\"],\"297\":[\"AW\"],\"298\":[\"FO\"],\"299\":[\"GL\"],\"350\":[\"GI\"],\"351\":[\"PT\"],\"352\":[\"LU\"],\"353\":[\"IE\"],\"354\":[\"IS\"],\"355\":[\"AL\"],\"356\":[\"MT\"],\"357\":[\"CY\"],\"358\":[\"FI\",\"AX\"],\"359\":[\"BG\"],\"370\":[\"LT\"],\"371\":[\"LV\"],\"372\":[\"EE\"],\"373\":[\"MD\"],\"374\":[\"AM\"],\"375\":[\"BY\"],\"376\":[\"AD\"],\"377\":[\"MC\"],\"378\":[\"SM\"],\"380\":[\"UA\"],\"381\":[\"RS\"],\"382\":[\"ME\"],\"383\":[\"XK\"],\"385\":[\"HR\"],\"386\":[\"SI\"],\"387\":[\"BA\"],\"389\":[\"MK\"],\"420\":[\"CZ\"],\"421\":[\"SK\"],\"423\":[\"LI\"],\"500\":[\"FK\"],\"501\":[\"BZ\"],\"502\":[\"GT\"],\"503\":[\"SV\"],\"504\":[\"HN\"],\"505\":[\"NI\"],\"506\":[\"CR\"],\"507\":[\"PA\"],\"508\":[\"PM\"],\"509\":[\"HT\"],\"590\":[\"GP\",\"BL\",\"MF\"],\"591\":[\"BO\"],\"592\":[\"GY\"],\"593\":[\"EC\"],\"594\":[\"GF\"],\"595\":[\"PY\"],\"596\":[\"MQ\"],\"597\":[\"SR\"],\"598\":[\"UY\"],\"599\":[\"CW\",\"BQ\"],\"670\":[\"TL\"],\"672\":[\"NF\"],\"673\":[\"BN\"],\"674\":[\"NR\"],\"675\":[\"PG\"],\"676\":[\"TO\"],\"677\":[\"SB\"],\"678\":[\"VU\"],\"679\":[\"FJ\"],\"680\":[\"PW\"],\"681\":[\"WF\"],\"682\":[\"CK\"],\"683\":[\"NU\"],\"685\":[\"WS\"],\"686\":[\"KI\"],\"687\":[\"NC\"],\"688\":[\"TV\"],\"689\":[\"PF\"],\"690\":[\"TK\"],\"691\":[\"FM\"],\"692\":[\"MH\"],\"850\":[\"KP\"],\"852\":[\"HK\"],\"853\":[\"MO\"],\"855\":[\"KH\"],\"856\":[\"LA\"],\"880\":[\"BD\"],\"886\":[\"TW\"],\"960\":[\"MV\"],\"961\":[\"LB\"],\"962\":[\"JO\"],\"963\":[\"SY\"],\"964\":[\"IQ\"],\"965\":[\"KW\"],\"966\":[\"SA\"],\"967\":[\"YE\"],\"968\":[\"OM\"],\"970\":[\"PS\"],\"971\":[\"AE\"],\"972\":[\"IL\"],\"973\":[\"BH\"],\"974\":[\"QA\"],\"975\":[\"BT\"],\"976\":[\"MN\"],\"977\":[\"NP\"],\"992\":[\"TJ\"],\"993\":[\"TM\"],\"994\":[\"AZ\"],\"995\":[\"GE\"],\"996\":[\"KG\"],\"998\":[\"UZ\"]},\"countries\":{\"AC\":[\"247\",\"00\",\"(?:[01589]\\\\d|[46])\\\\d{4}\",[5,6]],\"AD\":[\"376\",\"00\",\"(?:1|6\\\\d)\\\\d{7}|[135-9]\\\\d{5}\",[6,8,9],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"[135-9]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"1\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]]]],\"AE\":[\"971\",\"00\",\"(?:[4-7]\\\\d|9[0-689])\\\\d{7}|800\\\\d{2,9}|[2-4679]\\\\d{7}\",[5,6,7,8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{2,9})\",\"$1 $2\",[\"60|8\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[236]|[479][2-8]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{5})\",\"$1 $2 $3\",[\"[479]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"]],\"0\"],\"AF\":[\"93\",\"00\",\"[2-7]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-7]\"],\"0$1\"]],\"0\"],\"AG\":[\"1\",\"011\",\"(?:268|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([457]\\\\d{6})$|1\",\"268$1\",0,\"268\"],\"AI\":[\"1\",\"011\",\"(?:264|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([2457]\\\\d{6})$|1\",\"264$1\",0,\"264\"],\"AL\":[\"355\",\"00\",\"(?:700\\\\d\\\\d|900)\\\\d{3}|8\\\\d{5,7}|(?:[2-5]|6\\\\d)\\\\d{7}\",[6,7,8,9],[[\"(\\\\d{3})(\\\\d{3,4})\",\"$1 $2\",[\"80|9\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"4[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2358][2-5]|4\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[23578]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"6\"],\"0$1\"]],\"0\"],\"AM\":[\"374\",\"00\",\"(?:[1-489]\\\\d|55|60|77)\\\\d{6}\",[8],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]0\"],\"0 $1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"2|3[12]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"1|47\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[3-9]\"],\"0$1\"]],\"0\"],\"AO\":[\"244\",\"00\",\"[29]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[29]\"]]]],\"AR\":[\"54\",\"00\",\"(?:11|[89]\\\\d\\\\d)\\\\d{8}|[2368]\\\\d{9}\",[10,11],[[\"(\\\\d{4})(\\\\d{2})(\\\\d{4})\",\"$1 $2-$3\",[\"2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])\",\"2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)\",\"2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]\",\"2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]\"],\"0$1\",1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2-$3\",[\"1\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[68]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2-$3\",[\"[23]\"],\"0$1\",1],[\"(\\\\d)(\\\\d{4})(\\\\d{2})(\\\\d{4})\",\"$2 15-$3-$4\",[\"9(?:2[2-469]|3[3-578])\",\"9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))\",\"9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)\",\"9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]\",\"9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]\"],\"0$1\",0,\"$1 $2 $3-$4\"],[\"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$2 15-$3-$4\",[\"91\"],\"0$1\",0,\"$1 $2 $3-$4\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1-$2-$3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$2 15-$3-$4\",[\"9\"],\"0$1\",0,\"$1 $2 $3-$4\"]],\"0\",0,\"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?\",\"9$1\"],\"AS\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|684|900)\\\\d{7}\",[10],0,\"1\",0,\"([267]\\\\d{6})$|1\",\"684$1\",0,\"684\"],\"AT\":[\"43\",\"00\",\"1\\\\d{3,12}|2\\\\d{6,12}|43(?:(?:0\\\\d|5[02-9])\\\\d{3,9}|2\\\\d{4,5}|[3467]\\\\d{4}|8\\\\d{4,6}|9\\\\d{4,7})|5\\\\d{4,12}|8\\\\d{7,12}|9\\\\d{8,12}|(?:[367]\\\\d|4[0-24-9])\\\\d{4,11}\",[4,5,6,7,8,9,10,11,12,13],[[\"(\\\\d)(\\\\d{3,12})\",\"$1 $2\",[\"1(?:11|[2-9])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})\",\"$1 $2\",[\"517\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,5})\",\"$1 $2\",[\"5[079]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,10})\",\"$1 $2\",[\"(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,9})\",\"$1 $2\",[\"[2-467]|5[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4,7})\",\"$1 $2 $3\",[\"5\"],\"0$1\"]],\"0\"],\"AU\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d{7}(?:\\\\d(?:\\\\d{2})?)?|8[0-24-9]\\\\d{7})|[2-478]\\\\d{8}|1\\\\d{4,7}\",[5,6,7,8,9,10,12],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1 $2\",[\"16\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,4})\",\"$1 $2 $3\",[\"16\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"14|4\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[2378]\"],\"(0$1)\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1(?:30|[89])\"]]],\"0\",0,\"(183[12])|0\",0,0,0,[[\"(?:(?:(?:2(?:[0-26-9]\\\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\\\d|2[0-8]))\\\\d|3(?:(?:[0-3589]\\\\d|6[1-9]|7[0-35-9])\\\\d|4(?:[0-578]\\\\d|90)))\\\\d\\\\d|8(?:51(?:0(?:0[03-9]|[12479]\\\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\\\d|7[89]|9[0-4])|3\\\\d\\\\d)|(?:6[0-8]|[78]\\\\d)\\\\d{3}|9(?:[02-9]\\\\d{3}|1(?:(?:[0-58]\\\\d|6[0135-9])\\\\d|7(?:0[0-24-9]|[1-9]\\\\d)|9(?:[0-46-9]\\\\d|5[0-79])))))\\\\d{3}\",[9]],[\"4(?:79[01]|83[0-389]|94[0-4])\\\\d{5}|4(?:[0-36]\\\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,[\"163\\\\d{2,6}\",[5,6,7,8,9]],[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{6}(?:\\\\d{2})?|45[0-4]\\\\d{3})|13\\\\d{4}\",[6,8,10,12]]],\"0011\"],\"AW\":[\"297\",\"00\",\"(?:[25-79]\\\\d\\\\d|800)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[25-9]\"]]]],\"AX\":[\"358\",\"00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))\",\"2\\\\d{4,9}|35\\\\d{4,5}|(?:60\\\\d\\\\d|800)\\\\d{4,6}|7\\\\d{5,11}|(?:[14]\\\\d|3[0-46-9]|50)\\\\d{4,8}\",[5,6,7,8,9,10,11,12],0,\"0\",0,0,0,0,\"18\",0,\"00\"],\"AZ\":[\"994\",\"00\",\"365\\\\d{6}|(?:[124579]\\\\d|60|88)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"90\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[28]|2|365|46\",\"1[28]|2|365[45]|46\",\"1[28]|2|365(?:4|5[02])|46\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[13-9]\"],\"0$1\"]],\"0\"],\"BA\":[\"387\",\"00\",\"6\\\\d{8}|(?:[35689]\\\\d|49|70)\\\\d{6}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6[1-3]|[7-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2-$3\",[\"[3-5]|6[56]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"6\"],\"0$1\"]],\"0\"],\"BB\":[\"1\",\"011\",\"(?:246|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-9]\\\\d{6})$|1\",\"246$1\",0,\"246\"],\"BD\":[\"880\",\"00\",\"[1-469]\\\\d{9}|8[0-79]\\\\d{7,8}|[2-79]\\\\d{8}|[2-9]\\\\d{7}|[3-9]\\\\d{6}|[57-9]\\\\d{5}\",[6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1-$2\",[\"31[5-8]|[459]1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1-$2\",[\"3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,6})\",\"$1-$2\",[\"[13-9]|2[23]\"],\"0$1\"],[\"(\\\\d)(\\\\d{7,8})\",\"$1-$2\",[\"2\"],\"0$1\"]],\"0\"],\"BE\":[\"32\",\"00\",\"4\\\\d{8}|[1-9]\\\\d{7}\",[8,9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:80|9)0\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[239]|4[23]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[15-8]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"4\"],\"0$1\"]],\"0\"],\"BF\":[\"226\",\"00\",\"[025-7]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[025-7]\"]]]],\"BG\":[\"359\",\"00\",\"00800\\\\d{7}|[2-7]\\\\d{6,7}|[89]\\\\d{6,8}|2\\\\d{5}\",[6,7,8,9,12],[[\"(\\\\d)(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"43[1-6]|70[1-9]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:70|8)0\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1 $2 $3\",[\"43[1-7]|7\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[48]|9[08]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"],\"0$1\"]],\"0\"],\"BH\":[\"973\",\"00\",\"[136-9]\\\\d{7}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[13679]|8[02-4679]\"]]]],\"BI\":[\"257\",\"00\",\"(?:[267]\\\\d|31)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2367]\"]]]],\"BJ\":[\"229\",\"00\",\"(?:01\\\\d|[24-689])\\\\d{7}\",[8,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[24-689]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"0\"]]]],\"BL\":[\"590\",\"00\",\"(?:590\\\\d|7090)\\\\d{5}|(?:69|80|9\\\\d)\\\\d{7}\",[9],0,\"0\",0,0,0,0,0,[[\"590(?:2[7-9]|3[3-7]|5[12]|87)\\\\d{4}\"],[\"(?:69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\\\d)|6(?:1[016-9]|5[0-4]|[67]\\\\d))|7090[0-4])\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"9(?:(?:39[5-7]|76[018])\\\\d|475[0-5])\\\\d{4}\"]]],\"BM\":[\"1\",\"011\",\"(?:441|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-9]\\\\d{6})$|1\",\"441$1\",0,\"441\"],\"BN\":[\"673\",\"00\",\"[2-578]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-578]\"]]]],\"BO\":[\"591\",\"00(?:1\\\\d)?\",\"8001\\\\d{5}|(?:[2-467]\\\\d|50)\\\\d{6}\",[8,9],[[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"[235]|4[46]\"]],[\"(\\\\d{8})\",\"$1\",[\"[67]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]],\"0\",0,\"0(1\\\\d)?\"],\"BQ\":[\"599\",\"00\",\"(?:[34]1|7\\\\d)\\\\d{5}\",[7],0,0,0,0,0,0,\"[347]\"],\"BR\":[\"55\",\"00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)\",\"(?:[1-46-9]\\\\d\\\\d|5(?:[0-46-9]\\\\d|5[0-46-9]))\\\\d{8}|[1-9]\\\\d{9}|[3589]\\\\d{8}|[34]\\\\d{7}\",[8,9,10,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"300|4(?:0[02]|37)\",\"4(?:02|37)0|[34]00\"]],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{4})\",\"$1 $2 $3\",[\"(?:[358]|90)0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2-$3\",[\"(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]\"],\"($1)\"],[\"(\\\\d{2})(\\\\d{5})(\\\\d{4})\",\"$1 $2-$3\",[\"[16][1-9]|[2-57-9]\"],\"($1)\"]],\"0\",0,\"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\\\d{10,11}))?\",\"$2\"],\"BS\":[\"1\",\"011\",\"(?:242|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([3-8]\\\\d{6})$|1\",\"242$1\",0,\"242\"],\"BT\":[\"975\",\"00\",\"[17]\\\\d{7}|[2-8]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-68]|7[246]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[67]|7\"]]]],\"BW\":[\"267\",\"00\",\"(?:0800|(?:[37]|800)\\\\d)\\\\d{6}|(?:[2-6]\\\\d|90)\\\\d{5}\",[7,8,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"90\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[24-6]|3[15-9]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[37]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"BY\":[\"375\",\"810\",\"(?:[12]\\\\d|33|44|902)\\\\d{7}|8(?:0[0-79]\\\\d{5,7}|[1-7]\\\\d{9})|8(?:1[0-489]|[5-79]\\\\d)\\\\d{7}|8[1-79]\\\\d{6,7}|8[0-79]\\\\d{5}|8\\\\d{5}\",[6,7,8,9,10,11],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"800\"],\"8 $1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,4})\",\"$1 $2 $3\",[\"800\"],\"8 $1\"],[\"(\\\\d{4})(\\\\d{2})(\\\\d{3})\",\"$1 $2-$3\",[\"1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])\",\"1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])\"],\"8 0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"1(?:[56]|7[467])|2[1-3]\"],\"8 0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[1-4]\"],\"8 0$1\"],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"8 $1\"]],\"8\",0,\"0|80?\",0,0,0,0,\"8~10\"],\"BZ\":[\"501\",\"00\",\"(?:0800\\\\d|[2-8])\\\\d{6}\",[7,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[2-8]\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1-$2-$3-$4\",[\"0\"]]]],\"CA\":[\"1\",\"011\",\"[2-9]\\\\d{9}|3\\\\d{6}\",[7,10],0,\"1\",0,0,0,0,0,[[\"(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\\\d{6}\",[10]],[\"\",[10]],[\"8(?:00|33|44|55|66|77|88)[2-9]\\\\d{6}\",[10]],[\"900[2-9]\\\\d{6}\",[10]],[\"52(?:3(?:[2-46-9][02-9]\\\\d|5(?:[02-46-9]\\\\d|5[0-46-9]))|4(?:[2-478][02-9]\\\\d|5(?:[034]\\\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\\\d)|9(?:[05-9]\\\\d|2[0-5]|49)))\\\\d{4}|52[34][2-9]1[02-9]\\\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\\\d{6}\",[10]],0,[\"310\\\\d{4}\",[7]],0,[\"600[2-9]\\\\d{6}\",[10]]]],\"CC\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d{8}(?:\\\\d{2})?|8[0-24-9]\\\\d{7})|[148]\\\\d{8}|1\\\\d{5,7}\",[6,7,8,9,10,12],0,\"0\",0,\"([59]\\\\d{7})$|0\",\"8$1\",0,0,[[\"8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\\\d|70[23]|959))\\\\d{3}\",[9]],[\"4(?:79[01]|83[0-389]|94[0-4])\\\\d{5}|4(?:[0-36]\\\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,0,[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{6}(?:\\\\d{2})?|45[0-4]\\\\d{3})|13\\\\d{4}\",[6,8,10,12]]],\"0011\"],\"CD\":[\"243\",\"00\",\"(?:(?:[189]|5\\\\d)\\\\d|2)\\\\d{7}|[1-68]\\\\d{6}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"88\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"[1-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"5\"],\"0$1\"]],\"0\"],\"CF\":[\"236\",\"00\",\"(?:[27]\\\\d{3}|8776)\\\\d{4}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[278]\"]]]],\"CG\":[\"242\",\"00\",\"222\\\\d{6}|(?:0\\\\d|80)\\\\d{7}\",[9],[[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[02]\"]]]],\"CH\":[\"41\",\"00\",\"8\\\\d{11}|[2-9]\\\\d{8}\",[9,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8[047]|90\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-79]|81\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"8\"],\"0$1\"]],\"0\"],\"CI\":[\"225\",\"00\",\"[02]\\\\d{9}\",[10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d)(\\\\d{5})\",\"$1 $2 $3 $4\",[\"2\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"0\"]]]],\"CK\":[\"682\",\"00\",\"[2-578]\\\\d{4}\",[5],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"[2-578]\"]]]],\"CL\":[\"56\",\"(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0\",\"12300\\\\d{6}|6\\\\d{9,10}|[2-9]\\\\d{8}\",[9,10,11],[[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"219\",\"2196\"],\"($1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"44\"]],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2[1-36]\"],\"($1)\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"9[2-9]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])\"],\"($1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"60|8\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"60\"]]]],\"CM\":[\"237\",\"00\",\"[26]\\\\d{8}|88\\\\d{6,7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"88\"]],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"[26]|88\"]]]],\"CN\":[\"86\",\"00|1(?:[12]\\\\d|79)\\\\d\\\\d00\",\"(?:(?:1[03-689]|2\\\\d)\\\\d\\\\d|6)\\\\d{8}|1\\\\d{10}|[126]\\\\d{6}(?:\\\\d(?:\\\\d{2})?)?|86\\\\d{5,6}|(?:[3-579]\\\\d|8[0-57-9])\\\\d{5,9}\",[7,8,9,10,11,12],[[\"(\\\\d{2})(\\\\d{5,6})\",\"$1 $2\",[\"(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]\",\"(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\\\d|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1\",\"10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\\\d|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12\",\"10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\\\d|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123\",\"10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\\\d|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]\",\"(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))[19]\",\"85[23](?:10|95)|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))(?:10|9[56])\",\"85[23](?:100|95)|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))(?:100|9[56])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"(?:4|80)0\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"10|2(?:[02-57-9]|1[1-9])\",\"10|2(?:[02-57-9]|1[1-9])\",\"10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{7,8})\",\"$1 $2\",[\"9\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"80\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[3-578]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"1[3-9]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"[12]\"],\"0$1\",1]],\"0\",0,\"(1(?:[12]\\\\d|79)\\\\d\\\\d)|0\",0,0,0,0,\"00\"],\"CO\":[\"57\",\"00(?:4(?:[14]4|56)|[579])\",\"(?:46|60\\\\d\\\\d)\\\\d{6}|(?:1\\\\d|[39])\\\\d{9}\",[8,10,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"46\"]],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"6|90\"],\"($1)\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"3[0-357]|91\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{7})\",\"$1-$2-$3\",[\"1\"],\"0$1\",0,\"$1 $2 $3\"]],\"0\",0,\"0([3579]|4(?:[14]4|56))?\"],\"CR\":[\"506\",\"00\",\"(?:8\\\\d|90)\\\\d{8}|(?:[24-8]\\\\d{3}|3005)\\\\d{4}\",[8,10],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]|8[3-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[89]\"]]],0,0,\"(19(?:0[0-2468]|1[09]|20|66|77|99))\"],\"CU\":[\"53\",\"119\",\"(?:[2-7]|8\\\\d\\\\d)\\\\d{7}|[2-47]\\\\d{6}|[34]\\\\d{5}\",[6,7,8,10],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1 $2\",[\"2[1-4]|[34]\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{6,7})\",\"$1 $2\",[\"7\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"[56]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"8\"],\"0$1\"]],\"0\"],\"CV\":[\"238\",\"0\",\"(?:[2-59]\\\\d\\\\d|800)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[2-589]\"]]]],\"CW\":[\"599\",\"00\",\"(?:[34]1|60|(?:7|9\\\\d)\\\\d)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[3467]\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9[4-8]\"]]],0,0,0,0,0,\"[69]\"],\"CX\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d{8}(?:\\\\d{2})?|8[0-24-9]\\\\d{7})|[148]\\\\d{8}|1\\\\d{5,7}\",[6,7,8,9,10,12],0,\"0\",0,\"([59]\\\\d{7})$|0\",\"8$1\",0,0,[[\"8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\\\d|7(?:0[01]|1[0-2])|958))\\\\d{3}\",[9]],[\"4(?:79[01]|83[0-389]|94[0-4])\\\\d{5}|4(?:[0-36]\\\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,0,[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{6}(?:\\\\d{2})?|45[0-4]\\\\d{3})|13\\\\d{4}\",[6,8,10,12]]],\"0011\"],\"CY\":[\"357\",\"00\",\"(?:[279]\\\\d|[58]0)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[257-9]\"]]]],\"CZ\":[\"420\",\"00\",\"(?:[2-578]\\\\d|60)\\\\d{7}|9\\\\d{8,11}\",[9,10,11,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-8]|9[015-7]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"96\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]]]],\"DE\":[\"49\",\"00\",\"[2579]\\\\d{5,14}|49(?:[34]0|69|8\\\\d)\\\\d\\\\d?|49(?:37|49|60|7[089]|9\\\\d)\\\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\\\d{1,8}|(?:1|[368]\\\\d|4[0-8])\\\\d{3,13}|49(?:[015]\\\\d|2[13]|31|[46][1-8])\\\\d{1,9}\",[4,5,6,7,8,9,10,11,12,13,14,15],[[\"(\\\\d{2})(\\\\d{3,13})\",\"$1 $2\",[\"3[02]|40|[68]9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,12})\",\"$1 $2\",[\"2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1\",\"2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{2,11})\",\"$1 $2\",[\"[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]\",\"[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"138\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{2,10})\",\"$1 $2\",[\"3\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,11})\",\"$1 $2\",[\"181\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{4,10})\",\"$1 $2 $3\",[\"1(?:3|80)|9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7,8})\",\"$1 $2\",[\"1[67]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7,12})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{6})\",\"$1 $2\",[\"185\",\"1850\",\"18500\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{7})\",\"$1 $2\",[\"18[68]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{7})\",\"$1 $2\",[\"15[1279]\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{6})\",\"$1 $2\",[\"15[03568]\",\"15(?:[0568]|31)\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{8})\",\"$1 $2\",[\"18\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{7,8})\",\"$1 $2 $3\",[\"1(?:6[023]|7)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{2})(\\\\d{7})\",\"$1 $2 $3\",[\"15[279]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{8})\",\"$1 $2 $3\",[\"15\"],\"0$1\"]],\"0\"],\"DJ\":[\"253\",\"00\",\"(?:2\\\\d|77)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[27]\"]]]],\"DK\":[\"45\",\"00\",\"[2-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-9]\"]]]],\"DM\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|767|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-7]\\\\d{6})$|1\",\"767$1\",0,\"767\"],\"DO\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"8001|8[024]9\"],\"DZ\":[\"213\",\"00\",\"(?:[1-4]|[5-79]\\\\d|80)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[1-4]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-8]\"],\"0$1\"]],\"0\"],\"EC\":[\"593\",\"00\",\"1\\\\d{9,10}|(?:[2-7]|9\\\\d)\\\\d{7}\",[8,9,10,11],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2-$3\",[\"[2-7]\"],\"(0$1)\",0,\"$1-$2-$3\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"EE\":[\"372\",\"00\",\"8\\\\d{9}|[4578]\\\\d{7}|(?:[3-8]\\\\d|90)\\\\d{5}\",[7,8,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88\",\"[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88\"]],[\"(\\\\d{4})(\\\\d{3,4})\",\"$1 $2\",[\"[45]|8(?:00|[1-49])\",\"[45]|8(?:00[1-9]|[1-49])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"EG\":[\"20\",\"00\",\"[189]\\\\d{8,9}|[24-6]\\\\d{8}|[135]\\\\d{7}\",[8,9,10],[[\"(\\\\d)(\\\\d{7,8})\",\"$1 $2\",[\"[23]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6,7})\",\"$1 $2\",[\"1[35]|[4-6]|8[2468]|9[235-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{8})\",\"$1 $2\",[\"1\"],\"0$1\"]],\"0\"],\"EH\":[\"212\",\"00\",\"[5-8]\\\\d{8}\",[9],0,\"0\",0,0,0,0,\"528[89]\"],\"ER\":[\"291\",\"00\",\"[178]\\\\d{6}\",[7],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[178]\"],\"0$1\"]],\"0\"],\"ES\":[\"34\",\"00\",\"[5-9]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]00\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-9]\"]]]],\"ET\":[\"251\",\"00\",\"(?:11|[2-579]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-579]\"],\"0$1\"]],\"0\"],\"FI\":[\"358\",\"00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))\",\"[1-35689]\\\\d{4}|7\\\\d{10,11}|(?:[124-7]\\\\d|3[0-46-9])\\\\d{8}|[1-9]\\\\d{5,8}\",[5,6,7,8,9,10,11,12],[[\"(\\\\d{5})\",\"$1\",[\"20[2-59]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1 $2\",[\"(?:[1-3]0|[68])0|70[07-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4,8})\",\"$1 $2\",[\"[14]|2[09]|50|7[135]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6,10})\",\"$1 $2\",[\"7\"],\"0$1\"],[\"(\\\\d)(\\\\d{4,9})\",\"$1 $2\",[\"(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9\"],\"0$1\"]],\"0\",0,0,0,0,\"1[03-79]|[2-9]\",0,\"00\"],\"FJ\":[\"679\",\"0(?:0|52)\",\"45\\\\d{5}|(?:0800\\\\d|[235-9])\\\\d{6}\",[7,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[235-9]|45\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"0\"]]],0,0,0,0,0,0,0,\"00\"],\"FK\":[\"500\",\"00\",\"[2-7]\\\\d{4}\",[5]],\"FM\":[\"691\",\"00\",\"(?:[39]\\\\d\\\\d|820)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[389]\"]]]],\"FO\":[\"298\",\"00\",\"[2-9]\\\\d{5}\",[6],[[\"(\\\\d{6})\",\"$1\",[\"[2-9]\"]]],0,0,\"(10(?:01|[12]0|88))\"],\"FR\":[\"33\",\"00\",\"[1-9]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0 $1\"],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"[1-79]\"],\"0$1\"]],\"0\"],\"GA\":[\"241\",\"00\",\"(?:[067]\\\\d|11)\\\\d{6}|[2-7]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-7]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"0\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"11|[67]\"],\"0$1\"]],0,0,\"0(11\\\\d{6}|60\\\\d{6}|61\\\\d{6}|6[256]\\\\d{6}|7[467]\\\\d{6})\",\"$1\"],\"GB\":[\"44\",\"00\",\"[1-357-9]\\\\d{9}|[18]\\\\d{8}|8\\\\d{6}\",[7,9,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"800\",\"8001\",\"80011\",\"800111\",\"8001111\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"845\",\"8454\",\"84546\",\"845464\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"800\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{4,5})\",\"$1 $2\",[\"1(?:38|5[23]|69|76|94)\",\"1(?:(?:38|69)7|5(?:24|39)|768|946)\",\"1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5,6})\",\"$1 $2\",[\"1(?:[2-69][02-9]|[78])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[25]|7(?:0|6[02-9])\",\"[25]|7(?:0|6(?:[03-9]|2[356]))\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1389]\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"(?:1(?:1(?:3(?:[0-58]\\\\d\\\\d|73[0-35])|4(?:(?:[0-5]\\\\d|70)\\\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\\\d|6(?:[0-4]\\\\d|50))\\\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\\\d)\\\\d|1(?:[0-7]\\\\d|8[0-3]))|(?:3(?:0\\\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\\\d)\\\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\\\d{3})\\\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\\\d)|76\\\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\\\d|7[4-79])|295[5-7]|35[34]\\\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\\\d{3}\",[9,10]],[\"7(?:457[0-57-9]|700[01]|911[028])\\\\d{5}|7(?:[1-3]\\\\d\\\\d|4(?:[0-46-9]\\\\d|5[0-689])|5(?:0[0-8]|[13-9]\\\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\\\d|8[02-9]|9[0-689])|8(?:[014-9]\\\\d|[23][0-8])|9(?:[024-9]\\\\d|1[02-9]|3[0-689]))\\\\d{6}\",[10]],[\"80[08]\\\\d{7}|800\\\\d{6}|8001111\"],[\"(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\\\d|8[2-49]))\\\\d{7}|845464\\\\d\",[7,10]],[\"70\\\\d{8}\",[10]],0,[\"(?:3[0347]|55)\\\\d{8}\",[10]],[\"76(?:464|652)\\\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\\\d{6}\",[10]],[\"56\\\\d{8}\",[10]]],0,\" x\"],\"GD\":[\"1\",\"011\",\"(?:473|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-9]\\\\d{6})$|1\",\"473$1\",0,\"473\"],\"GE\":[\"995\",\"00\",\"(?:[3-57]\\\\d\\\\d|800)\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"70\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"32\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[57]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[348]\"],\"0$1\"]],\"0\"],\"GF\":[\"594\",\"00\",\"(?:[56]94\\\\d|7093)\\\\d{5}|(?:80|9\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-7]|9[47]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[89]\"],\"0$1\"]],\"0\"],\"GG\":[\"44\",\"00\",\"(?:1481|[357-9]\\\\d{3})\\\\d{6}|8\\\\d{6}(?:\\\\d{2})?\",[7,9,10],0,\"0\",0,\"([25-9]\\\\d{5})$|0\",\"1481$1\",0,0,[[\"1481[25-9]\\\\d{5}\",[10]],[\"7(?:(?:781|839)\\\\d|911[17])\\\\d{5}\",[10]],[\"80[08]\\\\d{7}|800\\\\d{6}|8001111\"],[\"(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\\\d|8[0-3]))\\\\d{7}|845464\\\\d\",[7,10]],[\"70\\\\d{8}\",[10]],0,[\"(?:3[0347]|55)\\\\d{8}\",[10]],[\"76(?:464|652)\\\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\\\d{6}\",[10]],[\"56\\\\d{8}\",[10]]]],\"GH\":[\"233\",\"00\",\"(?:[235]\\\\d{3}|800)\\\\d{5}\",[8,9],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[235]\"],\"0$1\"]],\"0\"],\"GI\":[\"350\",\"00\",\"(?:[25]\\\\d|60)\\\\d{6}\",[8],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"2\"]]]],\"GL\":[\"299\",\"00\",\"(?:19|[2-689]\\\\d|70)\\\\d{4}\",[6],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"19|[2-9]\"]]]],\"GM\":[\"220\",\"00\",\"[2-9]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-9]\"]]]],\"GN\":[\"224\",\"00\",\"722\\\\d{6}|(?:3|6\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"3\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[67]\"]]]],\"GP\":[\"590\",\"00\",\"(?:590\\\\d|7090)\\\\d{5}|(?:69|80|9\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-79]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\\\d)\\\\d{4}\"],[\"(?:69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\\\d)|6(?:1[016-9]|5[0-4]|[67]\\\\d))|7090[0-4])\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"9(?:(?:39[5-7]|76[018])\\\\d|475[0-5])\\\\d{4}\"]]],\"GQ\":[\"240\",\"00\",\"222\\\\d{6}|(?:3\\\\d|55|[89]0)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[235]\"]],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[89]\"]]]],\"GR\":[\"30\",\"00\",\"5005000\\\\d{3}|8\\\\d{9,11}|(?:[269]\\\\d|70)\\\\d{8}\",[10,11,12],[[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"21|7\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2689]\"]],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{5})\",\"$1 $2 $3\",[\"8\"]]]],\"GT\":[\"502\",\"00\",\"80\\\\d{6}|(?:1\\\\d{3}|[2-7])\\\\d{7}\",[8,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-8]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]]]],\"GU\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|671|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-9]\\\\d{6})$|1\",\"671$1\",0,\"671\"],\"GW\":[\"245\",\"00\",\"[49]\\\\d{8}|4\\\\d{6}\",[7,9],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"40\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[49]\"]]]],\"GY\":[\"592\",\"001\",\"(?:[2-8]\\\\d{3}|9008)\\\\d{3}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-9]\"]]]],\"HK\":[\"852\",\"00(?:30|5[09]|[126-9]?)\",\"8[0-46-9]\\\\d{6,7}|9\\\\d{4,7}|(?:[2-7]|9\\\\d{3})\\\\d{7}\",[5,6,7,8,9,11],[[\"(\\\\d{3})(\\\\d{2,5})\",\"$1 $2\",[\"900\",\"9003\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]|8[1-4]|9(?:0[1-9]|[1-8])\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]]],0,0,0,0,0,0,0,\"00\"],\"HN\":[\"504\",\"00\",\"8\\\\d{10}|[237-9]\\\\d{7}\",[8,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"[237-9]\"]]]],\"HR\":[\"385\",\"00\",\"(?:[24-69]\\\\d|3[0-79])\\\\d{7}|80\\\\d{5,7}|[1-79]\\\\d{7}|6\\\\d{5,6}\",[6,7,8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"6[01]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"6|7[245]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-57]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"HT\":[\"509\",\"00\",\"(?:[2-489]\\\\d|55)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-589]\"]]]],\"HU\":[\"36\",\"00\",\"[235-7]\\\\d{8}|[1-9]\\\\d{7}\",[8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"(06 $1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]\"],\"(06 $1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-9]\"],\"06 $1\"]],\"06\"],\"ID\":[\"62\",\"00[89]\",\"00[1-9]\\\\d{9,14}|(?:[1-36]|8\\\\d{5})\\\\d{6}|00\\\\d{9}|[1-9]\\\\d{8,10}|[2-9]\\\\d{7}\",[7,8,9,10,11,12,13,14,15,16,17],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"15\"]],[\"(\\\\d{2})(\\\\d{5,9})\",\"$1 $2\",[\"2[124]|[36]1\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5,7})\",\"$1 $2\",[\"800\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,8})\",\"$1 $2\",[\"[2-79]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{3})\",\"$1-$2-$3\",[\"8[1-35-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6,8})\",\"$1 $2\",[\"1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"804\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"80\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1-$2-$3\",[\"8\"],\"0$1\"]],\"0\"],\"IE\":[\"353\",\"00\",\"(?:1\\\\d|[2569])\\\\d{6,8}|4\\\\d{6,9}|7\\\\d{8}|8\\\\d{8,9}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"2[24-9]|47|58|6[237-9]|9[35-9]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[45]0\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2569]|4[1-69]|7[14]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"70\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"81\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"4\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"IL\":[\"972\",\"0(?:0|1[2-9])\",\"1\\\\d{6}(?:\\\\d{3,5})?|[57]\\\\d{8}|[1-489]\\\\d{7}\",[7,8,9,10,11,12],[[\"(\\\\d{4})(\\\\d{3})\",\"$1-$2\",[\"125\"]],[\"(\\\\d{4})(\\\\d{2})(\\\\d{2})\",\"$1-$2-$3\",[\"121\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[2-489]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[57]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3\",[\"12\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1-$2\",[\"159\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3-$4\",[\"1[7-9]\"]],[\"(\\\\d{3})(\\\\d{1,2})(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3-$4\",[\"15\"]]],\"0\"],\"IM\":[\"44\",\"00\",\"1624\\\\d{6}|(?:[3578]\\\\d|90)\\\\d{8}\",[10],0,\"0\",0,\"([25-8]\\\\d{5})$|0\",\"1624$1\",0,\"74576|(?:16|7[56])24\"],\"IN\":[\"91\",\"00\",\"(?:000800|[2-9]\\\\d\\\\d)\\\\d{7}|1\\\\d{7,12}\",[8,9,10,11,12,13],[[\"(\\\\d{8})\",\"$1\",[\"5(?:0|2[23]|3[03]|[67]1|88)\",\"5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)\",\"5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)\"],0,1],[\"(\\\\d{4})(\\\\d{4,5})\",\"$1 $2\",[\"180\",\"1800\"],0,1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"140\"],0,1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"11|2[02]|33|4[04]|79[1-7]|80[2-46]\",\"11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])\",\"11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]\",\"1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]\",\"1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807\",\"1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]\",\"1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\\\d|7(?:1(?:[013-8]\\\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\\\d|5[0-367])|70[13-7]))[2-7]\"],\"0$1\",1],[\"(\\\\d{5})(\\\\d{5})\",\"$1 $2\",[\"[6-9]\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{2,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1(?:6|8[06])\",\"1(?:6|8[06]0)\"],0,1],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"18\"],0,1]],\"0\"],\"IO\":[\"246\",\"00\",\"3\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"3\"]]]],\"IQ\":[\"964\",\"00\",\"(?:1|7\\\\d\\\\d)\\\\d{7}|[2-6]\\\\d{7,8}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-6]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"IR\":[\"98\",\"00\",\"[1-9]\\\\d{9}|(?:[1-8]\\\\d\\\\d|9)\\\\d{3,4}\",[4,5,6,7,10],[[\"(\\\\d{4,5})\",\"$1\",[\"96\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4,5})\",\"$1 $2\",[\"(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-8]\"],\"0$1\"]],\"0\"],\"IS\":[\"354\",\"00|1(?:0(?:01|[12]0)|100)\",\"(?:38\\\\d|[4-9])\\\\d{6}\",[7,9],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[4-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"3\"]]],0,0,0,0,0,0,0,\"00\"],\"IT\":[\"39\",\"00\",\"0\\\\d{5,10}|1\\\\d{8,10}|3(?:[0-8]\\\\d{7,10}|9\\\\d{7,8})|(?:43|55|70)\\\\d{8}|8\\\\d{5}(?:\\\\d{2,4})?\",[6,7,8,9,10,11,12],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1 $2\",[\"0[26]\"]],[\"(\\\\d{3})(\\\\d{3,6})\",\"$1 $2\",[\"0[13-57-9][0159]|8(?:03|4[17]|9[2-5])\",\"0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))\"]],[\"(\\\\d{4})(\\\\d{2,6})\",\"$1 $2\",[\"0(?:[13-579][2-46-8]|8[236-8])\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"894\"]],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"0[26]|5\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"1(?:44|[679])|[378]|43\"]],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"0[13-57-9][0159]|14\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{5})\",\"$1 $2 $3\",[\"0[26]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"3\"]]],0,0,0,0,0,0,[[\"0669[0-79]\\\\d{1,6}|0(?:1(?:[0159]\\\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\\\d\\\\d|3(?:[0159]\\\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\\\d|6[0-8])|7(?:[0159]\\\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\\\d{2,7}\",[6,7,8,9,10,11]],[\"3[2-9]\\\\d{7,8}|(?:31|43)\\\\d{8}\",[9,10]],[\"80(?:0\\\\d{3}|3)\\\\d{3}\",[6,9]],[\"(?:0878\\\\d{3}|89(?:2\\\\d|3[04]|4(?:[0-4]|[5-9]\\\\d\\\\d)|5[0-4]))\\\\d\\\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\\\d{6}\",[6,8,9,10]],[\"1(?:78\\\\d|99)\\\\d{6}\",[9,10]],[\"3[2-8]\\\\d{9,10}\",[11,12]],0,0,[\"55\\\\d{8}\",[10]],[\"84(?:[08]\\\\d{3}|[17])\\\\d{3}\",[6,9]]]],\"JE\":[\"44\",\"00\",\"1534\\\\d{6}|(?:[3578]\\\\d|90)\\\\d{8}\",[10],0,\"0\",0,\"([0-24-8]\\\\d{5})$|0\",\"1534$1\",0,0,[[\"1534[0-24-8]\\\\d{5}\"],[\"7(?:(?:(?:50|82)9|937)\\\\d|7(?:00[378]|97\\\\d))\\\\d{5}\"],[\"80(?:07(?:35|81)|8901)\\\\d{4}\"],[\"(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\\\d{4}\"],[\"701511\\\\d{4}\"],0,[\"(?:3(?:0(?:07(?:35|81)|8901)|3\\\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\\\d{4})\\\\d{4}\"],[\"76(?:464|652)\\\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\\\d{6}\"],[\"56\\\\d{8}\"]]],\"JM\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|658|900)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"658|876\"],\"JO\":[\"962\",\"00\",\"(?:(?:[2689]|7\\\\d)\\\\d|32|53)\\\\d{6}\",[8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2356]|87\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"70\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"JP\":[\"81\",\"010\",\"00[1-9]\\\\d{6,14}|[257-9]\\\\d{9}|(?:00|[1-9]\\\\d\\\\d)\\\\d{6}\",[8,9,10,11,12,13,14,15,16,17],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3\",[\"(?:12|57|99)0\"],\"0$1\"],[\"(\\\\d{4})(\\\\d)(\\\\d{4})\",\"$1-$2-$3\",[\"1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])\",\"1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]\",\"1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"60\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[36]|4(?:2[09]|7[01])\",\"[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])\",\"1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]\",\"1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1-$2-$3\",[\"[14]|[289][2-9]|5[3-9]|7[2-4679]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"800\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[257-9]\"],\"0$1\"]],\"0\",0,\"(000[259]\\\\d{6})$|(?:(?:003768)0?)|0\",\"$1\"],\"KE\":[\"254\",\"000\",\"(?:[17]\\\\d\\\\d|900)\\\\d{6}|(?:2|80)0\\\\d{6,7}|[4-6]\\\\d{6,8}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5,7})\",\"$1 $2\",[\"[24-6]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[17]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"]],\"0\"],\"KG\":[\"996\",\"00\",\"8\\\\d{9}|[235-9]\\\\d{8}\",[9,10],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"3(?:1[346]|[24-79])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[235-79]|88\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d)(\\\\d{2,3})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"KH\":[\"855\",\"00[14-9]\",\"1\\\\d{9}|[1-9]\\\\d{7,8}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"KI\":[\"686\",\"00\",\"(?:[37]\\\\d|6[0-79])\\\\d{6}|(?:[2-48]\\\\d|50)\\\\d{3}\",[5,8],0,\"0\"],\"KM\":[\"269\",\"00\",\"[3478]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[3478]\"]]]],\"KN\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-7]\\\\d{6})$|1\",\"869$1\",0,\"869\"],\"KP\":[\"850\",\"00|99\",\"85\\\\d{6}|(?:19\\\\d|[2-7])\\\\d{7}\",[8,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"]],\"0\"],\"KR\":[\"82\",\"00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))\",\"00[1-9]\\\\d{8,11}|(?:[12]|5\\\\d{3})\\\\d{7}|[13-6]\\\\d{9}|(?:[1-6]\\\\d|80)\\\\d{7}|[3-6]\\\\d{4,5}|(?:00|7)0\\\\d{8}\",[5,6,8,9,10,11,12,13,14],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1-$2\",[\"(?:3[1-3]|[46][1-4]|5[1-5])1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"1\"]],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1-$2-$3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[36]0|8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1-$2-$3\",[\"[1346]|5[1-5]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[57]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})(\\\\d{4})\",\"$1-$2-$3\",[\"5\"],\"0$1\"]],\"0\",0,\"0(8(?:[1-46-8]|5\\\\d\\\\d))?\"],\"KW\":[\"965\",\"00\",\"18\\\\d{5}|(?:[2569]\\\\d|41)\\\\d{6}\",[7,8],[[\"(\\\\d{4})(\\\\d{3,4})\",\"$1 $2\",[\"[169]|2(?:[235]|4[1-35-9])|52\"]],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[245]\"]]]],\"KY\":[\"1\",\"011\",\"(?:345|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-9]\\\\d{6})$|1\",\"345$1\",0,\"345\"],\"KZ\":[\"7\",\"810\",\"(?:33622|8\\\\d{8})\\\\d{5}|[78]\\\\d{9}\",[10,14],0,\"8\",0,0,0,0,\"33|7\",0,\"8~10\"],\"LA\":[\"856\",\"00\",\"[23]\\\\d{9}|3\\\\d{8}|(?:[235-8]\\\\d|41)\\\\d{6}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2[13]|3[14]|[4-8]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"30[0135-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"[23]\"],\"0$1\"]],\"0\"],\"LB\":[\"961\",\"00\",\"[27-9]\\\\d{7}|[13-9]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[27-9]\"]]],\"0\"],\"LC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|758|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-8]\\\\d{6})$|1\",\"758$1\",0,\"758\"],\"LI\":[\"423\",\"00\",\"[68]\\\\d{8}|(?:[2378]\\\\d|90)\\\\d{5}\",[7,9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[2379]|8(?:0[09]|7)\",\"[2379]|8(?:0(?:02|9)|7)\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"69\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]]],\"0\",0,\"(1001)|0\"],\"LK\":[\"94\",\"00\",\"[1-9]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[1-689]\"],\"0$1\"]],\"0\"],\"LR\":[\"231\",\"00\",\"(?:[245]\\\\d|33|77|88)\\\\d{7}|(?:2\\\\d|[4-6])\\\\d{6}\",[7,8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"4[67]|[56]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-578]\"],\"0$1\"]],\"0\"],\"LS\":[\"266\",\"00\",\"(?:[256]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2568]\"]]]],\"LT\":[\"370\",\"00\",\"(?:[3469]\\\\d|52|[78]0)\\\\d{6}\",[8],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"52[0-7]\"],\"(0-$1)\",1],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[7-9]\"],\"0 $1\",1],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"37|4(?:[15]|6[1-8])\"],\"(0-$1)\",1],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[3-6]\"],\"(0-$1)\",1]],\"0\",0,\"[08]\"],\"LU\":[\"352\",\"00\",\"35[013-9]\\\\d{4,8}|6\\\\d{8}|35\\\\d{2,4}|(?:[2457-9]\\\\d|3[0-46-9])\\\\d{2,9}\",[4,5,6,7,8,9,10,11],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"20[2-689]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,2})\",\"$1 $2 $3 $4\",[\"2(?:[0367]|4[3-8])\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"80[01]|90[015]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"20\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,2})\",\"$1 $2 $3 $4 $5\",[\"2(?:[0367]|4[3-8])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,5})\",\"$1 $2 $3 $4\",[\"[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]\"]]],0,0,\"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\\\d)\"],\"LV\":[\"371\",\"00\",\"(?:[268]\\\\d|90)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[269]|8[01]\"]]]],\"LY\":[\"218\",\"00\",\"[2-9]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{7})\",\"$1-$2\",[\"[2-9]\"],\"0$1\"]],\"0\"],\"MA\":[\"212\",\"00\",\"[5-8]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"5[45]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1-$2\",[\"5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1-$2\",[\"8\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1-$2\",[\"[5-7]\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"5(?:2(?:[0-25-79]\\\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\\\d)\\\\d{5}\"],[\"(?:6(?:[0-79]\\\\d|8[0-247-9])|7(?:[0167]\\\\d|2[0-4]|5[01]|8[0-3]))\\\\d{6}\"],[\"80[0-7]\\\\d{6}\"],[\"89\\\\d{7}\"],0,0,0,0,[\"(?:592(?:4[0-2]|93)|80[89]\\\\d\\\\d)\\\\d{4}\"]]],\"MC\":[\"377\",\"00\",\"(?:[3489]|6\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"4\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[389]\"]],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"6\"],\"0$1\"]],\"0\"],\"MD\":[\"373\",\"00\",\"(?:[235-7]\\\\d|[89]0)\\\\d{6}\",[8],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"22|3\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[25-7]\"],\"0$1\"]],\"0\"],\"ME\":[\"382\",\"00\",\"(?:20|[3-79]\\\\d)\\\\d{6}|80\\\\d{6,7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-9]\"],\"0$1\"]],\"0\"],\"MF\":[\"590\",\"00\",\"(?:590\\\\d|7090)\\\\d{5}|(?:69|80|9\\\\d)\\\\d{7}\",[9],0,\"0\",0,0,0,0,0,[[\"590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\\\d{4}\"],[\"(?:69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\\\d)|6(?:1[016-9]|5[0-4]|[67]\\\\d))|7090[0-4])\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"9(?:(?:39[5-7]|76[018])\\\\d|475[0-5])\\\\d{4}\"]]],\"MG\":[\"261\",\"00\",\"[23]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[23]\"],\"0$1\"]],\"0\",0,\"([24-9]\\\\d{6})$|0\",\"20$1\"],\"MH\":[\"692\",\"011\",\"329\\\\d{4}|(?:[256]\\\\d|45)\\\\d{5}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[2-6]\"]]],\"1\"],\"MK\":[\"389\",\"00\",\"[2-578]\\\\d{7}\",[8],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2|34[47]|4(?:[37]7|5[47]|64)\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[347]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[58]\"],\"0$1\"]],\"0\"],\"ML\":[\"223\",\"00\",\"[24-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[24-9]\"]]]],\"MM\":[\"95\",\"00\",\"1\\\\d{5,7}|95\\\\d{6}|(?:[4-7]|9[0-46-9])\\\\d{6,8}|(?:2|8\\\\d)\\\\d{5,8}\",[6,7,8,9,10],[[\"(\\\\d)(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"16|2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[12]|452|678|86\",\"[12]|452|6788|86\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[4-7]|8[1-35]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4,6})\",\"$1 $2 $3\",[\"9(?:2[0-4]|[35-9]|4[137-9])\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"92\"],\"0$1\"],[\"(\\\\d)(\\\\d{5})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"]],\"0\"],\"MN\":[\"976\",\"001\",\"[12]\\\\d{7,9}|[5-9]\\\\d{7}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[12]1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[5-9]\"]],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"[12]2[1-3]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5,6})\",\"$1 $2\",[\"[12](?:27|3[2-8]|4[2-68]|5[1-4689])\",\"[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{4,5})\",\"$1 $2\",[\"[12]\"],\"0$1\"]],\"0\"],\"MO\":[\"853\",\"00\",\"0800\\\\d{3}|(?:28|[68]\\\\d)\\\\d{6}\",[7,8],[[\"(\\\\d{4})(\\\\d{3})\",\"$1 $2\",[\"0\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[268]\"]]]],\"MP\":[\"1\",\"011\",\"[58]\\\\d{9}|(?:67|90)0\\\\d{7}\",[10],0,\"1\",0,\"([2-9]\\\\d{6})$|1\",\"670$1\",0,\"670\"],\"MQ\":[\"596\",\"00\",\"(?:596\\\\d|7091)\\\\d{5}|(?:69|[89]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-79]|8(?:0[6-9]|[36])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"MR\":[\"222\",\"00\",\"(?:[2-4]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-48]\"]]]],\"MS\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|664|900)\\\\d{7}\",[10],0,\"1\",0,\"([34]\\\\d{6})$|1\",\"664$1\",0,\"664\"],\"MT\":[\"356\",\"00\",\"3550\\\\d{4}|(?:[2579]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2357-9]\"]]]],\"MU\":[\"230\",\"0(?:0|[24-7]0|3[03])\",\"(?:[57]|8\\\\d\\\\d)\\\\d{7}|[2-468]\\\\d{6}\",[7,8,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-46]|8[013]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[57]\"]],[\"(\\\\d{5})(\\\\d{5})\",\"$1 $2\",[\"8\"]]],0,0,0,0,0,0,0,\"020\"],\"MV\":[\"960\",\"0(?:0|19)\",\"(?:800|9[0-57-9]\\\\d)\\\\d{7}|[34679]\\\\d{6}\",[7,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[34679]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"]]],0,0,0,0,0,0,0,\"00\"],\"MW\":[\"265\",\"00\",\"(?:[1289]\\\\d|31|77)\\\\d{7}|1\\\\d{6}\",[7,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1[2-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[137-9]\"],\"0$1\"]],\"0\"],\"MX\":[\"52\",\"0[09]\",\"[2-9]\\\\d{9}\",[10],[[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"33|5[56]|81\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-9]\"]]],0,0,0,0,0,0,0,\"00\"],\"MY\":[\"60\",\"00\",\"1\\\\d{8,9}|(?:3\\\\d|[4-9])\\\\d{7}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3\",[\"[4-79]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1-$2 $3\",[\"1(?:[02469]|[378][1-9]|53)|8\",\"1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1-$2 $3\",[\"3\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1-$2-$3-$4\",[\"1(?:[367]|80)\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3\",[\"15\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2 $3\",[\"1\"],\"0$1\"]],\"0\"],\"MZ\":[\"258\",\"00\",\"(?:2|8\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2|8[2-79]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"NA\":[\"264\",\"00\",\"[68]\\\\d{7,8}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"88\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"6\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"87\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"NC\":[\"687\",\"00\",\"(?:050|[2-57-9]\\\\d\\\\d)\\\\d{3}\",[6],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1.$2.$3\",[\"[02-57-9]\"]]]],\"NE\":[\"227\",\"00\",\"[027-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"08\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[089]|2[013]|7[0467]\"]]]],\"NF\":[\"672\",\"00\",\"[13]\\\\d{5}\",[6],[[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"1[0-3]\"]],[\"(\\\\d)(\\\\d{5})\",\"$1 $2\",[\"[13]\"]]],0,0,\"([0-258]\\\\d{4})$\",\"3$1\"],\"NG\":[\"234\",\"009\",\"38\\\\d{6}|[78]\\\\d{9,13}|(?:20|9\\\\d)\\\\d{8}\",[8,10,11,12,13,14],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"3\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[7-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"20[129]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})(\\\\d{5,6})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"]],\"0\"],\"NI\":[\"505\",\"00\",\"(?:1800|[25-8]\\\\d{3})\\\\d{4}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[125-8]\"]]]],\"NL\":[\"31\",\"00\",\"(?:[124-7]\\\\d\\\\d|3(?:[02-9]\\\\d|1[0-8]))\\\\d{6}|8\\\\d{6,9}|9\\\\d{6,10}|1\\\\d{4,5}\",[5,6,7,8,9,10,11],[[\"(\\\\d{3})(\\\\d{4,7})\",\"$1 $2\",[\"[89]0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"66\"],\"0$1\"],[\"(\\\\d)(\\\\d{8})\",\"$1 $2\",[\"6\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1[16-8]|2[259]|3[124]|4[17-9]|5[124679]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-578]|91\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\",[\"9\"],\"0$1\"]],\"0\"],\"NO\":[\"47\",\"00\",\"(?:0|[2-9]\\\\d{3})\\\\d{4}\",[5,8],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-79]\"]]],0,0,0,0,0,\"[02-689]|7[0-8]\"],\"NP\":[\"977\",\"00\",\"(?:1\\\\d|9)\\\\d{9}|[1-9]\\\\d{7}\",[8,10,11],[[\"(\\\\d)(\\\\d{7})\",\"$1-$2\",[\"1[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1-$2\",[\"1[01]|[2-8]|9(?:[1-59]|[67][2-6])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1-$2\",[\"9\"]]],\"0\"],\"NR\":[\"674\",\"00\",\"(?:444|(?:55|8\\\\d)\\\\d|666)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[4-68]\"]]]],\"NU\":[\"683\",\"00\",\"(?:[4-7]|888\\\\d)\\\\d{3}\",[4,7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"8\"]]]],\"NZ\":[\"64\",\"0(?:0|161)\",\"[1289]\\\\d{9}|50\\\\d{5}(?:\\\\d{2,3})?|[27-9]\\\\d{7,8}|(?:[34]\\\\d|6[0-35-9])\\\\d{6}|8\\\\d{4,6}\",[5,6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{3,8})\",\"$1 $2\",[\"8[1-79]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"50[036-8]|8|90\",\"50(?:[0367]|88)|8|90\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"24|[346]|7[2-57-9]|9[2-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2(?:10|74)|[589]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1|2[028]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,5})\",\"$1 $2 $3\",[\"2(?:[169]|7[0-35-9])|7\"],\"0$1\"]],\"0\",0,0,0,0,0,0,\"00\"],\"OM\":[\"968\",\"00\",\"(?:1505|[279]\\\\d{3}|500)\\\\d{4}|800\\\\d{5,6}\",[7,8,9],[[\"(\\\\d{3})(\\\\d{4,6})\",\"$1 $2\",[\"[58]\"]],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"2\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[179]\"]]]],\"PA\":[\"507\",\"00\",\"(?:00800|8\\\\d{3})\\\\d{6}|[68]\\\\d{7}|[1-57-9]\\\\d{6}\",[7,8,10,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[1-57-9]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"[68]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]]],\"PE\":[\"51\",\"00|19(?:1[124]|77|90)00\",\"(?:[14-8]|9\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"80\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"1\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[4-8]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"]]],\"0\",0,0,0,0,0,0,\"00\",\" Anexo \"],\"PF\":[\"689\",\"00\",\"4\\\\d{5}(?:\\\\d{2})?|8\\\\d{7,8}\",[6,8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"44\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"4|8[7-9]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]]]],\"PG\":[\"675\",\"00|140[1-3]\",\"(?:180|[78]\\\\d{3})\\\\d{4}|(?:[2-589]\\\\d|64)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"18|[2-69]|85\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[78]\"]]],0,0,0,0,0,0,0,\"00\"],\"PH\":[\"63\",\"00\",\"(?:[2-7]|9\\\\d)\\\\d{8}|2\\\\d{5}|(?:1800|8)\\\\d{7,9}\",[6,8,9,10,11,12,13],[[\"(\\\\d)(\\\\d{5})\",\"$1 $2\",[\"2\"],\"(0$1)\"],[\"(\\\\d{4})(\\\\d{4,6})\",\"$1 $2\",[\"3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2\",\"3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))\"],\"(0$1)\"],[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"346|4(?:27|9[35])|883\",\"3469|4(?:279|9(?:30|56))|8834\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[3-7]|8[2-8]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{4})(\\\\d{1,2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"1\"]]],\"0\"],\"PK\":[\"92\",\"00\",\"122\\\\d{6}|[24-8]\\\\d{10,11}|9(?:[013-9]\\\\d{8,10}|2(?:[01]\\\\d\\\\d|2(?:[06-8]\\\\d|1[01]))\\\\d{7})|(?:[2-8]\\\\d{3}|92(?:[0-7]\\\\d|8[1-9]))\\\\d{6}|[24-9]\\\\d{8}|[89]\\\\d{7}\",[8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{2,7})\",\"$1 $2 $3\",[\"[89]0\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"1\"]],[\"(\\\\d{3})(\\\\d{6,7})\",\"$1 $2\",[\"2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])\",\"9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{7,8})\",\"$1 $2\",[\"(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\"],\"(0$1)\"],[\"(\\\\d{5})(\\\\d{5})\",\"$1 $2\",[\"58\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"3\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"[24-9]\"],\"(0$1)\"]],\"0\"],\"PL\":[\"48\",\"00\",\"(?:6|8\\\\d\\\\d)\\\\d{7}|[1-9]\\\\d{6}(?:\\\\d{2})?|[26]\\\\d{5}\",[6,7,8,9,10],[[\"(\\\\d{5})\",\"$1\",[\"19\"]],[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"11|20|64\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1\",\"(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"64\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[2-8]|[2-7]|8[1-79]|9[145]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"8\"]]]],\"PM\":[\"508\",\"00\",\"[45]\\\\d{5}|(?:708|8\\\\d\\\\d)\\\\d{6}\",[6,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[45]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"7\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"PR\":[\"1\",\"011\",\"(?:[589]\\\\d\\\\d|787)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"787|939\"],\"PS\":[\"970\",\"00\",\"[2489]2\\\\d{6}|(?:1\\\\d|5)\\\\d{8}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2489]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"PT\":[\"351\",\"00\",\"1693\\\\d{5}|(?:[26-9]\\\\d|30)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2[12]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"16|[236-9]\"]]]],\"PW\":[\"680\",\"01[12]\",\"(?:[24-8]\\\\d\\\\d|345|900)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-9]\"]]]],\"PY\":[\"595\",\"00\",\"59\\\\d{4,6}|9\\\\d{5,10}|(?:[2-46-8]\\\\d|5[0-8])\\\\d{4,7}\",[6,7,8,9,10,11],[[\"(\\\\d{3})(\\\\d{3,6})\",\"$1 $2\",[\"[2-9]0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{4,5})\",\"$1 $2\",[\"2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"87\"]],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"9(?:[5-79]|8[1-7])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-8]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"]]],\"0\"],\"QA\":[\"974\",\"00\",\"800\\\\d{4}|(?:2|800)\\\\d{6}|(?:0080|[3-7])\\\\d{7}\",[7,8,9,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"2[16]|8\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[3-7]\"]]]],\"RE\":[\"262\",\"00\",\"709\\\\d{6}|(?:26|[689]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[26-9]\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"26(?:2\\\\d\\\\d|3(?:0\\\\d|1[0-6]))\\\\d{4}\"],[\"(?:69(?:2\\\\d\\\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\\\d{4}\"],[\"80\\\\d{7}\"],[\"89[1-37-9]\\\\d{6}\"],0,0,0,0,[\"9(?:399[0-3]|479[0-5]|76(?:2[278]|3[0-37]))\\\\d{4}\"],[\"8(?:1[019]|2[0156]|84|90)\\\\d{6}\"]]],\"RO\":[\"40\",\"00\",\"(?:[236-8]\\\\d|90)\\\\d{7}|[23]\\\\d{5}\",[6,9],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"2[3-6]\",\"2[3-6]\\\\d9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"219|31\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[23]1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[236-9]\"],\"0$1\"]],\"0\",0,0,0,0,0,0,0,\" int \"],\"RS\":[\"381\",\"00\",\"38[02-9]\\\\d{6,9}|6\\\\d{7,9}|90\\\\d{4,8}|38\\\\d{5,6}|(?:7\\\\d\\\\d|800)\\\\d{3,9}|(?:[12]\\\\d|3[0-79])\\\\d{5,10}\",[6,7,8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{3,9})\",\"$1 $2\",[\"(?:2[389]|39)0|[7-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5,10})\",\"$1 $2\",[\"[1-36]\"],\"0$1\"]],\"0\"],\"RU\":[\"7\",\"810\",\"8\\\\d{13}|[347-9]\\\\d{9}\",[10,14],[[\"(\\\\d{4})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"7(?:1[0-8]|2[1-9])\",\"7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))\",\"7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2\"],\"8 ($1)\",1],[\"(\\\\d{5})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"7(?:1[0-68]|2[1-9])\",\"7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))\",\"7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]\"],\"8 ($1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"8 ($1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[349]|8(?:[02-7]|1[1-8])\"],\"8 ($1)\",1],[\"(\\\\d{4})(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"8\"],\"8 ($1)\"]],\"8\",0,0,0,0,\"3[04-689]|[489]\",0,\"8~10\"],\"RW\":[\"250\",\"00\",\"(?:06|[27]\\\\d\\\\d|[89]00)\\\\d{6}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"0\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[7-9]\"],\"0$1\"]],\"0\"],\"SA\":[\"966\",\"00\",\"92\\\\d{7}|(?:[15]|8\\\\d)\\\\d{8}\",[9,10],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"9\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"81\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]],\"0\"],\"SB\":[\"677\",\"0[01]\",\"[6-9]\\\\d{6}|[1-6]\\\\d{4}\",[5,7],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])\"]]]],\"SC\":[\"248\",\"010|0[0-2]\",\"(?:[2489]\\\\d|64)\\\\d{5}\",[7],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[246]|9[57]\"]]],0,0,0,0,0,0,0,\"00\"],\"SD\":[\"249\",\"00\",\"[19]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[19]\"],\"0$1\"]],\"0\"],\"SE\":[\"46\",\"00\",\"(?:[26]\\\\d\\\\d|9)\\\\d{9}|[1-9]\\\\d{8}|[1-689]\\\\d{7}|[1-4689]\\\\d{6}|2\\\\d{5}\",[6,7,8,9,10,12],[[\"(\\\\d{2})(\\\\d{2,3})(\\\\d{2})\",\"$1-$2 $3\",[\"20\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"9(?:00|39|44|9)\"],\"0$1\",0,\"$1 $2\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})\",\"$1-$2 $3\",[\"[12][136]|3[356]|4[0246]|6[03]|90[1-9]\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d)(\\\\d{2,3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"8\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{2})\",\"$1-$2 $3\",[\"1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{3})\",\"$1-$2 $3\",[\"9(?:00|39|44)\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{2})(\\\\d{2,3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"10|7\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"8\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1-$2 $3 $4\",[\"9\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4 $5\",[\"[26]\"],\"0$1\",0,\"$1 $2 $3 $4 $5\"]],\"0\"],\"SG\":[\"65\",\"0[0-3]\\\\d\",\"(?:(?:1\\\\d|8)\\\\d\\\\d|7000)\\\\d{7}|[3689]\\\\d{7}\",[8,10,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[369]|8(?:0[1-9]|[1-9])\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{4})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"7\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]]]],\"SH\":[\"290\",\"00\",\"(?:[256]\\\\d|8)\\\\d{3}\",[4,5],0,0,0,0,0,0,\"[256]\"],\"SI\":[\"386\",\"00|10(?:22|66|88|99)\",\"[1-7]\\\\d{7}|8\\\\d{4,7}|90\\\\d{4,6}\",[5,6,7,8],[[\"(\\\\d{2})(\\\\d{3,6})\",\"$1 $2\",[\"8[09]|9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"59|8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[37][01]|4[0139]|51|6\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[1-57]\"],\"(0$1)\"]],\"0\",0,0,0,0,0,0,\"00\"],\"SJ\":[\"47\",\"00\",\"0\\\\d{4}|(?:[489]\\\\d|79)\\\\d{6}\",[5,8],0,0,0,0,0,0,\"79\"],\"SK\":[\"421\",\"00\",\"[2-689]\\\\d{8}|[2-59]\\\\d{6}|[2-5]\\\\d{5}\",[6,7,9],[[\"(\\\\d)(\\\\d{2})(\\\\d{3,4})\",\"$1 $2 $3\",[\"21\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"[3-5][1-8]1\",\"[3-5][1-8]1[67]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1/$2 $3 $4\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[689]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1/$2 $3 $4\",[\"[3-5]\"],\"0$1\"]],\"0\"],\"SL\":[\"232\",\"00\",\"(?:[237-9]\\\\d|66)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[236-9]\"],\"(0$1)\"]],\"0\"],\"SM\":[\"378\",\"00\",\"(?:0549|[5-7]\\\\d)\\\\d{6}\",[8,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-7]\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"0\"]]],0,0,\"([89]\\\\d{5})$\",\"0549$1\"],\"SN\":[\"221\",\"00\",\"(?:[378]\\\\d|93)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[379]\"]]]],\"SO\":[\"252\",\"00\",\"[346-9]\\\\d{8}|[12679]\\\\d{7}|[1-5]\\\\d{6}|[1348]\\\\d{5}\",[6,7,8,9],[[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"8[125]\"]],[\"(\\\\d{6})\",\"$1\",[\"[134]\"]],[\"(\\\\d)(\\\\d{6})\",\"$1 $2\",[\"[15]|2[0-79]|3[0-46-8]|4[0-7]\"]],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"(?:2|90)4|[67]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[348]|64|79|90\"]],[\"(\\\\d{2})(\\\\d{5,7})\",\"$1 $2\",[\"1|28|6[0-35-9]|77|9[2-9]\"]]],\"0\"],\"SR\":[\"597\",\"00\",\"(?:[2-5]|68|[78]\\\\d)\\\\d{5}\",[6,7],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1-$2-$3\",[\"56\"]],[\"(\\\\d{3})(\\\\d{3})\",\"$1-$2\",[\"[2-5]\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[6-8]\"]]]],\"SS\":[\"211\",\"00\",\"[19]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[19]\"],\"0$1\"]],\"0\"],\"ST\":[\"239\",\"00\",\"(?:22|9\\\\d)\\\\d{5}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[29]\"]]]],\"SV\":[\"503\",\"00\",\"[267]\\\\d{7}|(?:80\\\\d|900)\\\\d{4}(?:\\\\d{4})?\",[7,8,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[89]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[267]\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"]]]],\"SX\":[\"1\",\"011\",\"7215\\\\d{6}|(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"(5\\\\d{6})$|1\",\"721$1\",0,\"721\"],\"SY\":[\"963\",\"00\",\"[1-359]\\\\d{8}|[1-5]\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-4]|5[1-3]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[59]\"],\"0$1\",1]],\"0\"],\"SZ\":[\"268\",\"00\",\"0800\\\\d{4}|(?:[237]\\\\d|900)\\\\d{6}\",[8,9],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[0237]\"]],[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"9\"]]]],\"TA\":[\"290\",\"00\",\"8\\\\d{3}\",[4],0,0,0,0,0,0,\"8\"],\"TC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|649|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-479]\\\\d{6})$|1\",\"649$1\",0,\"649\"],\"TD\":[\"235\",\"00|16\",\"(?:22|[689]\\\\d|77)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[26-9]\"]]],0,0,0,0,0,0,0,\"00\"],\"TG\":[\"228\",\"00\",\"[279]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[279]\"]]]],\"TH\":[\"66\",\"00[1-9]\",\"(?:001800|[2-57]|[689]\\\\d)\\\\d{7}|1\\\\d{7,9}\",[8,9,10,13],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[13-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"TJ\":[\"992\",\"810\",\"[0-57-9]\\\\d{8}\",[9],[[\"(\\\\d{6})(\\\\d)(\\\\d{2})\",\"$1 $2 $3\",[\"331\",\"3317\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"44[02-479]|[34]7\"]],[\"(\\\\d{4})(\\\\d)(\\\\d{4})\",\"$1 $2 $3\",[\"3(?:[1245]|3[12])\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[0-57-9]\"]]],0,0,0,0,0,0,0,\"8~10\"],\"TK\":[\"690\",\"00\",\"[2-47]\\\\d{3,6}\",[4,5,6,7]],\"TL\":[\"670\",\"00\",\"7\\\\d{7}|(?:[2-47]\\\\d|[89]0)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-489]|70\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"7\"]]]],\"TM\":[\"993\",\"810\",\"(?:[1-6]\\\\d|71)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"12\"],\"(8 $1)\"],[\"(\\\\d{3})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[1-5]\"],\"(8 $1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[67]\"],\"8 $1\"]],\"8\",0,0,0,0,0,0,\"8~10\"],\"TN\":[\"216\",\"00\",\"[2-57-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-57-9]\"]]]],\"TO\":[\"676\",\"00\",\"(?:0800|(?:[5-8]\\\\d\\\\d|999)\\\\d)\\\\d{3}|[2-8]\\\\d{4}\",[5,7],[[\"(\\\\d{2})(\\\\d{3})\",\"$1-$2\",[\"[2-4]|50|6[09]|7[0-24-69]|8[05]\"]],[\"(\\\\d{4})(\\\\d{3})\",\"$1 $2\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[5-9]\"]]]],\"TR\":[\"90\",\"00\",\"4\\\\d{6}|8\\\\d{11,12}|(?:[2-58]\\\\d\\\\d|900)\\\\d{7}\",[7,10,12,13],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"512|8[01589]|90\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"5(?:[0-59]|61)\",\"5(?:[0-59]|61[06])\",\"5(?:[0-59]|61[06]1)\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[24][1-8]|3[1-9]\"],\"(0$1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{6,7})\",\"$1 $2 $3\",[\"80\"],\"0$1\",1]],\"0\"],\"TT\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-46-8]\\\\d{6})$|1\",\"868$1\",0,\"868\"],\"TV\":[\"688\",\"00\",\"(?:2|7\\\\d\\\\d|90)\\\\d{4}\",[5,6,7],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"2\"]],[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"90\"]],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"7\"]]]],\"TW\":[\"886\",\"0(?:0[25-79]|19)\",\"[2-689]\\\\d{8}|7\\\\d{9,10}|[2-8]\\\\d{7}|2\\\\d{6}\",[7,8,9,10,11],[[\"(\\\\d{2})(\\\\d)(\\\\d{4})\",\"$1 $2 $3\",[\"202\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[258]0\"],\"0$1\"],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]\",\"[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[49]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\",0,0,0,0,0,0,0,\"#\"],\"TZ\":[\"255\",\"00[056]\",\"(?:[25-8]\\\\d|41|90)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[24]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"5\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[67]\"],\"0$1\"]],\"0\"],\"UA\":[\"380\",\"00\",\"[89]\\\\d{9}|[3-9]\\\\d{8}\",[9,10],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]\",\"6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])\",\"3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[3-7]|89|9[1-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"]],\"0\",0,0,0,0,0,0,\"0~0\"],\"UG\":[\"256\",\"00[057]\",\"800\\\\d{6}|(?:[29]0|[347]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"202\",\"2024\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[27-9]|4(?:6[45]|[7-9])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"[34]\"],\"0$1\"]],\"0\"],\"US\":[\"1\",\"011\",\"[2-9]\\\\d{9}|3\\\\d{6}\",[10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"310\"],0,1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"($1) $2-$3\",[\"[2-9]\"],0,1,\"$1-$2-$3\"]],\"1\",0,0,0,0,0,[[\"(?:3052(?:0[0-8]|[1-9]\\\\d)|5056(?:[0-35-9]\\\\d|4[468])|7302[0-4]\\\\d)\\\\d{4}|(?:305[3-9]|472[24]|505[2-57-9]|7306|983[2-47-9])\\\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\\\d{6}\"],[\"\"],[\"8(?:00|33|44|55|66|77|88)[2-9]\\\\d{6}\"],[\"900[2-9]\\\\d{6}\"],[\"52(?:3(?:[2-46-9][02-9]\\\\d|5(?:[02-46-9]\\\\d|5[0-46-9]))|4(?:[2-478][02-9]\\\\d|5(?:[034]\\\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\\\d)|9(?:[05-9]\\\\d|2[0-5]|49)))\\\\d{4}|52[34][2-9]1[02-9]\\\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\\\d{6}\"],0,0,0,[\"305209\\\\d{4}\"]]],\"UY\":[\"598\",\"0(?:0|1[3-9]\\\\d)\",\"0004\\\\d{2,9}|[1249]\\\\d{7}|(?:[49]\\\\d|80)\\\\d{5}\",[6,7,8,9,10,11,12,13],[[\"(\\\\d{3})(\\\\d{3,4})\",\"$1 $2\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[49]0|8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[124]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2,4})\",\"$1 $2 $3\",[\"0\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{2,4})\",\"$1 $2 $3 $4\",[\"0\"]]],\"0\",0,0,0,0,0,0,\"00\",\" int. \"],\"UZ\":[\"998\",\"00\",\"(?:20|33|[5-79]\\\\d|88)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[235-9]\"]]]],\"VA\":[\"39\",\"00\",\"0\\\\d{5,10}|3[0-8]\\\\d{7,10}|55\\\\d{8}|8\\\\d{5}(?:\\\\d{2,4})?|(?:1\\\\d|39)\\\\d{7,8}\",[6,7,8,9,10,11,12],0,0,0,0,0,0,\"06698\"],\"VC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|784|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-7]\\\\d{6})$|1\",\"784$1\",0,\"784\"],\"VE\":[\"58\",\"00\",\"[68]00\\\\d{7}|(?:[24]\\\\d|[59]0)\\\\d{8}\",[10],[[\"(\\\\d{3})(\\\\d{7})\",\"$1-$2\",[\"[24-689]\"],\"0$1\"]],\"0\"],\"VG\":[\"1\",\"011\",\"(?:284|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"([2-578]\\\\d{6})$|1\",\"284$1\",0,\"284\"],\"VI\":[\"1\",\"011\",\"[58]\\\\d{9}|(?:34|90)0\\\\d{7}\",[10],0,\"1\",0,\"([2-9]\\\\d{6})$|1\",\"340$1\",0,\"340\"],\"VN\":[\"84\",\"00\",\"[12]\\\\d{9}|[135-9]\\\\d{8}|[16]\\\\d{7}|[16-8]\\\\d{6}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"80\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{4,6})\",\"$1 $2\",[\"1\"],0,1],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"6\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[357-9]\"],\"0$1\",1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2[48]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\",1]],\"0\"],\"VU\":[\"678\",\"00\",\"[57-9]\\\\d{6}|(?:[238]\\\\d|48)\\\\d{3}\",[5,7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[57-9]\"]]]],\"WF\":[\"681\",\"00\",\"(?:40|72|8\\\\d{4})\\\\d{4}|[89]\\\\d{5}\",[6,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[47-9]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]]]],\"WS\":[\"685\",\"0\",\"(?:[2-6]|8\\\\d{5})\\\\d{4}|[78]\\\\d{6}|[68]\\\\d{5}\",[5,6,7,10],[[\"(\\\\d{5})\",\"$1\",[\"[2-5]|6[1-9]\"]],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1 $2\",[\"[68]\"]],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"7\"]]]],\"XK\":[\"383\",\"00\",\"2\\\\d{7,8}|3\\\\d{7,11}|(?:4\\\\d\\\\d|[89]00)\\\\d{5}\",[8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-4]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2|39\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7,10})\",\"$1 $2\",[\"3\"],\"0$1\"]],\"0\"],\"YE\":[\"967\",\"00\",\"(?:1|7\\\\d)\\\\d{7}|[1-7]\\\\d{6}\",[7,8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-6]|7(?:[24-6]|8[0-7])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"YT\":[\"262\",\"00\",\"7093\\\\d{5}|(?:80|9\\\\d)\\\\d{7}|(?:26|63)9\\\\d{6}\",[9],0,\"0\",0,0,0,0,0,[[\"269(?:0[0-467]|15|5[0-4]|6\\\\d|[78]0)\\\\d{4}\"],[\"(?:639(?:0[0-79]|1[019]|[267]\\\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\\\d{4}\"],[\"80\\\\d{7}\"],0,0,0,0,0,[\"9(?:(?:39|47)8[01]|769\\\\d)\\\\d{4}\"]]],\"ZA\":[\"27\",\"00\",\"[1-79]\\\\d{8}|8\\\\d{4,9}\",[5,6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1 $2\",[\"8[1-4]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"8[1-4]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"860\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"ZM\":[\"260\",\"00\",\"800\\\\d{6}|(?:21|63|[79]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[28]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"[79]\"],\"0$1\"]],\"0\"],\"ZW\":[\"263\",\"00\",\"2(?:[0-57-9]\\\\d{6,8}|6[0-24-9]\\\\d{6,7})|[38]\\\\d{9}|[35-8]\\\\d{8}|[3-6]\\\\d{7}|[1-689]\\\\d{6}|[1-3569]\\\\d{5}|[1356]\\\\d{4}\",[5,6,7,8,9,10],[[\"(\\\\d{3})(\\\\d{3,5})\",\"$1 $2\",[\"2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2,4})\",\"$1 $2 $3\",[\"[49]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"80\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2\",\"2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)\",\"2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,5})\",\"$1 $2\",[\"1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"29[013-9]|39|54\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,5})\",\"$1 $2\",[\"(?:25|54)8\",\"258|5483\"],\"0$1\"]],\"0\"]},\"nonGeographic\":{\"800\":[\"800\",0,\"(?:00|[1-9]\\\\d)\\\\d{6}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"\\\\d\"]]],0,0,0,0,0,0,[0,0,[\"(?:00|[1-9]\\\\d)\\\\d{6}\"]]],\"808\":[\"808\",0,\"[1-9]\\\\d{7}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[1-9]\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,[\"[1-9]\\\\d{7}\"]]],\"870\":[\"870\",0,\"7\\\\d{11}|[235-7]\\\\d{8}\",[9,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[235-7]\"]]],0,0,0,0,0,0,[0,[\"(?:[356]|774[45])\\\\d{8}|7[6-8]\\\\d{7}\"],0,0,0,0,0,0,[\"2\\\\d{8}\",[9]]]],\"878\":[\"878\",0,\"10\\\\d{10}\",[12],[[\"(\\\\d{2})(\\\\d{5})(\\\\d{5})\",\"$1 $2 $3\",[\"1\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,[\"10\\\\d{10}\"]]],\"881\":[\"881\",0,\"6\\\\d{9}|[0-36-9]\\\\d{8}\",[9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\",[\"[0-37-9]\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{5,6})\",\"$1 $2 $3\",[\"6\"]]],0,0,0,0,0,0,[0,[\"6\\\\d{9}|[0-36-9]\\\\d{8}\"]]],\"882\":[\"882\",0,\"[13]\\\\d{6}(?:\\\\d{2,5})?|[19]\\\\d{7}|(?:[25]\\\\d\\\\d|4)\\\\d{7}(?:\\\\d{2})?\",[7,8,9,10,11,12],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"16|342\"]],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"49\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"1[36]|9\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"3[23]\"]],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"16\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"10|23|3(?:[15]|4[57])|4|51\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"34\"]],[\"(\\\\d{2})(\\\\d{4,5})(\\\\d{5})\",\"$1 $2 $3\",[\"[1-35]\"]]],0,0,0,0,0,0,[0,[\"342\\\\d{4}|(?:337|49)\\\\d{6}|(?:3(?:2|47|7\\\\d{3})|50\\\\d{3})\\\\d{7}\",[7,8,9,10,12]],0,0,0,[\"348[57]\\\\d{7}\",[11]],0,0,[\"1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\\\d{4}|6\\\\d{5,10})|(?:345\\\\d|9[89])\\\\d{6}|(?:10|2(?:3|85\\\\d)|3(?:[15]|[69]\\\\d\\\\d)|4[15-8]|51)\\\\d{8}\"]]],\"883\":[\"883\",0,\"(?:[1-4]\\\\d|51)\\\\d{6,10}\",[8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{2,8})\",\"$1 $2 $3\",[\"[14]|2[24-689]|3[02-689]|51[24-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"510\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"21\"]],[\"(\\\\d{4})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"51[13]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"[235]\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,[\"(?:2(?:00\\\\d\\\\d|10)|(?:370[1-9]|51\\\\d0)\\\\d)\\\\d{7}|51(?:00\\\\d{5}|[24-9]0\\\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\\\d{5,9}\"]]],\"888\":[\"888\",0,\"\\\\d{11}\",[11],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\"]],0,0,0,0,0,0,[0,0,0,0,0,0,[\"\\\\d{11}\"]]],\"979\":[\"979\",0,\"[1359]\\\\d{8}\",[9],[[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[1359]\"]]],0,0,0,0,0,0,[0,0,0,[\"[1359]\\\\d{8}\"]]]}}","// The minimum length of the national significant number.\nexport var MIN_LENGTH_FOR_NSN = 2; // The ITU says the maximum length should be 15,\n// but one can find longer numbers in Germany.\n\nexport var MAX_LENGTH_FOR_NSN = 17; // The maximum length of the country calling code.\n\nexport var MAX_LENGTH_COUNTRY_CODE = 3; // Digits accepted in phone numbers\n// (ascii, fullwidth, arabic-indic, and eastern arabic digits).\n\nexport var VALID_DIGITS = \"0-9\\uFF10-\\uFF19\\u0660-\\u0669\\u06F0-\\u06F9\"; // `DASHES` will be right after the opening square bracket of the \"character class\"\n\nvar DASHES = \"-\\u2010-\\u2015\\u2212\\u30FC\\uFF0D\";\nvar SLASHES = \"\\uFF0F/\";\nvar DOTS = \"\\uFF0E.\";\nexport var WHITESPACE = \" \\xA0\\xAD\\u200B\\u2060\\u3000\";\nvar BRACKETS = \"()\\uFF08\\uFF09\\uFF3B\\uFF3D\\\\[\\\\]\"; // export const OPENING_BRACKETS = '(\\uFF08\\uFF3B\\\\\\['\n\nvar TILDES = \"~\\u2053\\u223C\\uFF5E\"; // Regular expression of acceptable punctuation found in phone numbers. This\n// excludes punctuation found as a leading character only. This consists of dash\n// characters, white space characters, full stops, slashes, square brackets,\n// parentheses and tildes. Full-width variants are also present.\n\nexport var VALID_PUNCTUATION = \"\".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);\nexport var PLUS_CHARS = \"+\\uFF0B\"; // const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+')\n","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// https://stackoverflow.com/a/46971044/970769\n// \"Breaking changes in Typescript 2.1\"\n// \"Extending built-ins like Error, Array, and Map may no longer work.\"\n// \"As a recommendation, you can manually adjust the prototype immediately after any super(...) calls.\"\n// https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\nvar ParseError = /*#__PURE__*/function (_Error) {\n _inherits(ParseError, _Error);\n\n var _super = _createSuper(ParseError);\n\n function ParseError(code) {\n var _this;\n\n _classCallCheck(this, ParseError);\n\n _this = _super.call(this, code); // Set the prototype explicitly.\n // Any subclass of FooError will have to manually set the prototype as well.\n\n Object.setPrototypeOf(_assertThisInitialized(_this), ParseError.prototype);\n _this.name = _this.constructor.name;\n return _this;\n }\n\n return _createClass(ParseError);\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nexport { ParseError as default };\n","// Copy-pasted from:\n// https://github.com/substack/semver-compare/blob/master/index.js\n//\n// Inlining this function because some users reported issues with\n// importing from `semver-compare` in a browser with ES6 \"native\" modules.\n//\n// Fixes `semver-compare` not being able to compare versions with alpha/beta/etc \"tags\".\n// https://github.com/catamphetamine/libphonenumber-js/issues/381\nexport default function (a, b) {\n a = a.split('-');\n b = b.split('-');\n var pa = a[0].split('.');\n var pb = b[0].split('.');\n\n for (var i = 0; i < 3; i++) {\n var na = Number(pa[i]);\n var nb = Number(pb[i]);\n if (na > nb) return 1;\n if (nb > na) return -1;\n if (!isNaN(na) && isNaN(nb)) return 1;\n if (isNaN(na) && !isNaN(nb)) return -1;\n }\n\n if (a[1] && b[1]) {\n return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0;\n }\n\n return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;\n}\n","var objectConstructor = {}.constructor;\nexport default function isObject(object) {\n return object !== undefined && object !== null && object.constructor === objectConstructor;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport compare from './tools/semver-compare.js';\nimport isObject from './helpers/isObject.js'; // Added \"possibleLengths\" and renamed\n// \"country_phone_code_to_countries\" to \"country_calling_codes\".\n\nvar V2 = '1.0.18'; // Added \"idd_prefix\" and \"default_idd_prefix\".\n\nvar V3 = '1.2.0'; // Moved `001` country code to \"nonGeographic\" section of metadata.\n\nvar V4 = '1.7.35';\nvar DEFAULT_EXT_PREFIX = ' ext. ';\nvar CALLING_CODE_REG_EXP = /^\\d+$/;\n/**\r\n * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md\r\n */\n\nvar Metadata = /*#__PURE__*/function () {\n function Metadata(metadata) {\n _classCallCheck(this, Metadata);\n\n validateMetadata(metadata);\n this.metadata = metadata;\n setVersion.call(this, metadata);\n }\n\n _createClass(Metadata, [{\n key: \"getCountries\",\n value: function getCountries() {\n return Object.keys(this.metadata.countries).filter(function (_) {\n return _ !== '001';\n });\n }\n }, {\n key: \"getCountryMetadata\",\n value: function getCountryMetadata(countryCode) {\n return this.metadata.countries[countryCode];\n }\n }, {\n key: \"nonGeographic\",\n value: function nonGeographic() {\n if (this.v1 || this.v2 || this.v3) return; // `nonGeographical` was a typo.\n // It's present in metadata generated from `1.7.35` to `1.7.37`.\n // The test case could be found by searching for \"nonGeographical\".\n\n return this.metadata.nonGeographic || this.metadata.nonGeographical;\n }\n }, {\n key: \"hasCountry\",\n value: function hasCountry(country) {\n return this.getCountryMetadata(country) !== undefined;\n }\n }, {\n key: \"hasCallingCode\",\n value: function hasCallingCode(callingCode) {\n if (this.getCountryCodesForCallingCode(callingCode)) {\n return true;\n }\n\n if (this.nonGeographic()) {\n if (this.nonGeographic()[callingCode]) {\n return true;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return true;\n }\n }\n }\n }, {\n key: \"isNonGeographicCallingCode\",\n value: function isNonGeographicCallingCode(callingCode) {\n if (this.nonGeographic()) {\n return this.nonGeographic()[callingCode] ? true : false;\n } else {\n return this.getCountryCodesForCallingCode(callingCode) ? false : true;\n }\n } // Deprecated.\n\n }, {\n key: \"country\",\n value: function country(countryCode) {\n return this.selectNumberingPlan(countryCode);\n }\n }, {\n key: \"selectNumberingPlan\",\n value: function selectNumberingPlan(countryCode, callingCode) {\n // Supports just passing `callingCode` as the first argument.\n if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {\n callingCode = countryCode;\n countryCode = null;\n }\n\n if (countryCode && countryCode !== '001') {\n if (!this.hasCountry(countryCode)) {\n throw new Error(\"Unknown country: \".concat(countryCode));\n }\n\n this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);\n } else if (callingCode) {\n if (!this.hasCallingCode(callingCode)) {\n throw new Error(\"Unknown calling code: \".concat(callingCode));\n }\n\n this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);\n } else {\n this.numberingPlan = undefined;\n }\n\n return this;\n }\n }, {\n key: \"getCountryCodesForCallingCode\",\n value: function getCountryCodesForCallingCode(callingCode) {\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes) {\n // Metadata before V4 included \"non-geographic entity\" calling codes\n // inside `country_calling_codes` (for example, `\"881\":[\"001\"]`).\n // Now the semantics of `country_calling_codes` has changed:\n // it's specifically for \"countries\" now.\n // Older versions of custom metadata will simply skip parsing\n // \"non-geographic entity\" phone numbers with new versions\n // of this library: it's not considered a bug,\n // because such numbers are extremely rare,\n // and developers extremely rarely use custom metadata.\n if (countryCodes.length === 1 && countryCodes[0].length === 3) {\n return;\n }\n\n return countryCodes;\n }\n }\n }, {\n key: \"getCountryCodeForCallingCode\",\n value: function getCountryCodeForCallingCode(callingCode) {\n var countryCodes = this.getCountryCodesForCallingCode(callingCode);\n\n if (countryCodes) {\n return countryCodes[0];\n }\n }\n }, {\n key: \"getNumberingPlanMetadata\",\n value: function getNumberingPlanMetadata(callingCode) {\n var countryCode = this.getCountryCodeForCallingCode(callingCode);\n\n if (countryCode) {\n return this.getCountryMetadata(countryCode);\n }\n\n if (this.nonGeographic()) {\n var metadata = this.nonGeographic()[callingCode];\n\n if (metadata) {\n return metadata;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n // In that metadata, there was no concept of \"non-geographic\" metadata\n // so metadata for `001` country code was stored along with other countries.\n // The test case can be found by searching for:\n // \"should work around `nonGeographic` metadata not existing\".\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return this.metadata.countries['001'];\n }\n }\n } // Deprecated.\n\n }, {\n key: \"countryCallingCode\",\n value: function countryCallingCode() {\n return this.numberingPlan.callingCode();\n } // Deprecated.\n\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n return this.numberingPlan.IDDPrefix();\n } // Deprecated.\n\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n return this.numberingPlan.defaultIDDPrefix();\n } // Deprecated.\n\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n return this.numberingPlan.nationalNumberPattern();\n } // Deprecated.\n\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n return this.numberingPlan.possibleLengths();\n } // Deprecated.\n\n }, {\n key: \"formats\",\n value: function formats() {\n return this.numberingPlan.formats();\n } // Deprecated.\n\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n return this.numberingPlan.nationalPrefixForParsing();\n } // Deprecated.\n\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.numberingPlan.nationalPrefixTransformRule();\n } // Deprecated.\n\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.numberingPlan.leadingDigits();\n } // Deprecated.\n\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n return this.numberingPlan.hasTypes();\n } // Deprecated.\n\n }, {\n key: \"type\",\n value: function type(_type) {\n return this.numberingPlan.type(_type);\n } // Deprecated.\n\n }, {\n key: \"ext\",\n value: function ext() {\n return this.numberingPlan.ext();\n }\n }, {\n key: \"countryCallingCodes\",\n value: function countryCallingCodes() {\n if (this.v1) return this.metadata.country_phone_code_to_countries;\n return this.metadata.country_calling_codes;\n } // Deprecated.\n\n }, {\n key: \"chooseCountryByCountryCallingCode\",\n value: function chooseCountryByCountryCallingCode(callingCode) {\n return this.selectNumberingPlan(callingCode);\n }\n }, {\n key: \"hasSelectedNumberingPlan\",\n value: function hasSelectedNumberingPlan() {\n return this.numberingPlan !== undefined;\n }\n }]);\n\n return Metadata;\n}();\n\nexport { Metadata as default };\n\nvar NumberingPlan = /*#__PURE__*/function () {\n function NumberingPlan(metadata, globalMetadataObject) {\n _classCallCheck(this, NumberingPlan);\n\n this.globalMetadataObject = globalMetadataObject;\n this.metadata = metadata;\n setVersion.call(this, globalMetadataObject.metadata);\n }\n\n _createClass(NumberingPlan, [{\n key: \"callingCode\",\n value: function callingCode() {\n return this.metadata[0];\n } // Formatting information for regions which share\n // a country calling code is contained by only one region\n // for performance reasons. For example, for NANPA region\n // (\"North American Numbering Plan Administration\",\n // which includes USA, Canada, Cayman Islands, Bahamas, etc)\n // it will be contained in the metadata for `US`.\n\n }, {\n key: \"getDefaultCountryMetadataForRegion\",\n value: function getDefaultCountryMetadataForRegion() {\n return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());\n } // Is always present.\n\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[1];\n } // Is only present when a country supports multiple IDD prefixes.\n\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[12];\n }\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n if (this.v1 || this.v2) return this.metadata[1];\n return this.metadata[2];\n } // \"possible length\" data is always present in Google's metadata.\n\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.v1) return;\n return this.metadata[this.v2 ? 2 : 3];\n }\n }, {\n key: \"_getFormats\",\n value: function _getFormats(metadata) {\n return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];\n } // For countries of the same region (e.g. NANPA)\n // formats are all stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"formats\",\n value: function formats() {\n var _this = this;\n\n var formats = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];\n return formats.map(function (_) {\n return new Format(_, _this);\n });\n }\n }, {\n key: \"nationalPrefix\",\n value: function nationalPrefix() {\n return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];\n }\n }, {\n key: \"_getNationalPrefixFormattingRule\",\n value: function _getNationalPrefixFormattingRule(metadata) {\n return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];\n } // For countries of the same region (e.g. NANPA)\n // national prefix formatting rule is stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"_nationalPrefixForParsing\",\n value: function _nationalPrefixForParsing() {\n return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];\n }\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n // If `national_prefix_for_parsing` is not set explicitly,\n // then infer it from `national_prefix` (if any)\n return this._nationalPrefixForParsing() || this.nationalPrefix();\n }\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];\n }\n }, {\n key: \"_getNationalPrefixIsOptionalWhenFormatting\",\n value: function _getNationalPrefixIsOptionalWhenFormatting() {\n return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];\n } // For countries of the same region (e.g. NANPA)\n // \"national prefix is optional when formatting\" flag is\n // stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];\n }\n }, {\n key: \"types\",\n value: function types() {\n return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];\n }\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n // Versions 1.2.0 - 1.2.4: can be `[]`.\n\n /* istanbul ignore next */\n if (this.types() && this.types().length === 0) {\n return false;\n } // Versions <= 1.2.4: can be `undefined`.\n // Version >= 1.2.5: can be `0`.\n\n\n return !!this.types();\n }\n }, {\n key: \"type\",\n value: function type(_type2) {\n if (this.hasTypes() && getType(this.types(), _type2)) {\n return new Type(getType(this.types(), _type2), this);\n }\n }\n }, {\n key: \"ext\",\n value: function ext() {\n if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;\n return this.metadata[13] || DEFAULT_EXT_PREFIX;\n }\n }]);\n\n return NumberingPlan;\n}();\n\nvar Format = /*#__PURE__*/function () {\n function Format(format, metadata) {\n _classCallCheck(this, Format);\n\n this._format = format;\n this.metadata = metadata;\n }\n\n _createClass(Format, [{\n key: \"pattern\",\n value: function pattern() {\n return this._format[0];\n }\n }, {\n key: \"format\",\n value: function format() {\n return this._format[1];\n }\n }, {\n key: \"leadingDigitsPatterns\",\n value: function leadingDigitsPatterns() {\n return this._format[2] || [];\n }\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._format[3] || this.metadata.nationalPrefixFormattingRule();\n }\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n }\n }, {\n key: \"nationalPrefixIsMandatoryWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {\n // National prefix is omitted if there's no national prefix formatting rule\n // set for this country, or when the national prefix formatting rule\n // contains no national prefix itself, or when this rule is set but\n // national prefix is optional for this phone number format\n // (and it is not enforced explicitly)\n return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n } // Checks whether national prefix formatting rule contains national prefix.\n\n }, {\n key: \"usesNationalPrefix\",\n value: function usesNationalPrefix() {\n return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a \"dummy\" one.\n !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0`\n // when `national_prefix_formatting_rule` is not present.\n // So, `true` or `false` are returned explicitly here, so that\n // `0` number isn't returned.\n ? true : false;\n }\n }, {\n key: \"internationalFormat\",\n value: function internationalFormat() {\n return this._format[5] || this.format();\n }\n }]);\n\n return Format;\n}();\n/**\r\n * A pattern that is used to determine if the national prefix formatting rule\r\n * has the first group only, i.e., does not start with the national prefix.\r\n * Note that the pattern explicitly allows for unbalanced parentheses.\r\n */\n\n\nvar FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\\(?\\$1\\)?$/;\n\nvar Type = /*#__PURE__*/function () {\n function Type(type, metadata) {\n _classCallCheck(this, Type);\n\n this.type = type;\n this.metadata = metadata;\n }\n\n _createClass(Type, [{\n key: \"pattern\",\n value: function pattern() {\n if (this.metadata.v1) return this.type;\n return this.type[0];\n }\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.metadata.v1) return;\n return this.type[1] || this.metadata.possibleLengths();\n }\n }]);\n\n return Type;\n}();\n\nfunction getType(types, type) {\n switch (type) {\n case 'FIXED_LINE':\n return types[0];\n\n case 'MOBILE':\n return types[1];\n\n case 'TOLL_FREE':\n return types[2];\n\n case 'PREMIUM_RATE':\n return types[3];\n\n case 'PERSONAL_NUMBER':\n return types[4];\n\n case 'VOICEMAIL':\n return types[5];\n\n case 'UAN':\n return types[6];\n\n case 'PAGER':\n return types[7];\n\n case 'VOIP':\n return types[8];\n\n case 'SHARED_COST':\n return types[9];\n }\n}\n\nexport function validateMetadata(metadata) {\n if (!metadata) {\n throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');\n } // `country_phone_code_to_countries` was renamed to\n // `country_calling_codes` in `1.0.18`.\n\n\n if (!isObject(metadata) || !isObject(metadata.countries)) {\n throw new Error(\"[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got \".concat(isObject(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + typeOf(metadata) + ': ' + metadata, \".\"));\n }\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\nvar typeOf = function typeOf(_) {\n return _typeof(_);\n};\n/**\r\n * Returns extension prefix for a country.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string?}\r\n * @example\r\n * // Returns \" ext. \"\r\n * getExtPrefix(\"US\")\r\n */\n\n\nexport function getExtPrefix(country, metadata) {\n metadata = new Metadata(metadata);\n\n if (metadata.hasCountry(country)) {\n return metadata.country(country).ext();\n }\n\n return DEFAULT_EXT_PREFIX;\n}\n/**\r\n * Returns \"country calling code\" for a country.\r\n * Throws an error if the country doesn't exist or isn't supported by this library.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string}\r\n * @example\r\n * // Returns \"44\"\r\n * getCountryCallingCode(\"GB\")\r\n */\n\nexport function getCountryCallingCode(country, metadata) {\n metadata = new Metadata(metadata);\n\n if (metadata.hasCountry(country)) {\n return metadata.country(country).countryCallingCode();\n }\n\n throw new Error(\"Unknown country: \".concat(country));\n}\nexport function isSupportedCountry(country, metadata) {\n // metadata = new Metadata(metadata)\n // return metadata.hasCountry(country)\n return metadata.countries.hasOwnProperty(country);\n}\n\nfunction setVersion(metadata) {\n var version = metadata.version;\n\n if (typeof version === 'number') {\n this.v1 = version === 1;\n this.v2 = version === 2;\n this.v3 = version === 3;\n this.v4 = version === 4;\n } else {\n if (!version) {\n this.v1 = true;\n } else if (compare(version, V3) === -1) {\n this.v2 = true;\n } else if (compare(version, V4) === -1) {\n this.v3 = true;\n } else {\n this.v4 = true;\n }\n }\n} // const ISO_COUNTRY_CODE = /^[A-Z]{2}$/\n// function isCountryCode(countryCode) {\n// \treturn ISO_COUNTRY_CODE.test(countryCodeOrCountryCallingCode)\n// }\n","import { VALID_DIGITS } from '../../constants.js'; // The RFC 3966 format for extensions.\n\nvar RFC3966_EXTN_PREFIX = ';ext=';\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\n\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\n\n\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n\n var extLimitWhenNotSure = '6';\n /** @type {string} */\n\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\"; // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n\n /** @type {string} */\n\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n\n var optionalExtnSuffix = \"#?\"; // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n\n /** @type {string} */\n\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\"; // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n\n /** @type {string} */\n\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\"; // When extension is not separated clearly.\n\n /** @type {string} */\n\n var ambiguousSeparator = \"[- ]+\"; // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n\n /** @type {string} */\n\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\"; // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n\n /** @type {string} */\n\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n /** @type {string} */\n\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n /** @type {string} */\n\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix; // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n","import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants.js';\nimport createExtensionPattern from './extension/createExtensionPattern.js'; // Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\n\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}'; //\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\n\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*'; // This regular expression isn't present in Google's `libphonenumber`\n// and is only used to determine whether the phone number being input\n// is too short for it to even consider it a \"valid\" number.\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\n\nvar VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions\n'(?:' + createExtensionPattern() + ')?'; // The combined regular expression for valid phone numbers:\n//\n\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp( // Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' + // Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i'); // Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\n\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n} // This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\n\nexport function isViablePhoneNumberStart(number) {\n return VALID_PHONE_NUMBER_START_REG_EXP.test(number);\n}\n","import createExtensionPattern from './createExtensionPattern.js'; // Regexp of all known extension prefixes used by different regions followed by\n// 1 or more valid digits, for use when parsing.\n\nvar EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i'); // Strips any extension (as in, the part of the number dialled after the call is\n// connected, usually indicated with extn, ext, x or similar) from the end of\n// the number, and returns it.\n\nexport default function extractExtension(number) {\n var start = number.search(EXTN_PATTERN);\n\n if (start < 0) {\n return {};\n } // If we find a potential extension, and the number preceding this is a viable\n // number, we assume it is an extension.\n\n\n var numberWithoutExtension = number.slice(0, start);\n var matches = number.match(EXTN_PATTERN);\n var i = 1;\n\n while (i < matches.length) {\n if (matches[i]) {\n return {\n number: numberWithoutExtension,\n ext: matches[i]\n };\n }\n\n i++;\n }\n}\n","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n// These mappings map a character (key) to a specific digit that should\n// replace it for normalization purposes. Non-European digits that\n// may be used in phone numbers are mapped to a European equivalent.\n//\n// E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\n//\nexport var DIGITS = {\n '0': '0',\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n \"\\uFF10\": '0',\n // Fullwidth digit 0\n \"\\uFF11\": '1',\n // Fullwidth digit 1\n \"\\uFF12\": '2',\n // Fullwidth digit 2\n \"\\uFF13\": '3',\n // Fullwidth digit 3\n \"\\uFF14\": '4',\n // Fullwidth digit 4\n \"\\uFF15\": '5',\n // Fullwidth digit 5\n \"\\uFF16\": '6',\n // Fullwidth digit 6\n \"\\uFF17\": '7',\n // Fullwidth digit 7\n \"\\uFF18\": '8',\n // Fullwidth digit 8\n \"\\uFF19\": '9',\n // Fullwidth digit 9\n \"\\u0660\": '0',\n // Arabic-indic digit 0\n \"\\u0661\": '1',\n // Arabic-indic digit 1\n \"\\u0662\": '2',\n // Arabic-indic digit 2\n \"\\u0663\": '3',\n // Arabic-indic digit 3\n \"\\u0664\": '4',\n // Arabic-indic digit 4\n \"\\u0665\": '5',\n // Arabic-indic digit 5\n \"\\u0666\": '6',\n // Arabic-indic digit 6\n \"\\u0667\": '7',\n // Arabic-indic digit 7\n \"\\u0668\": '8',\n // Arabic-indic digit 8\n \"\\u0669\": '9',\n // Arabic-indic digit 9\n \"\\u06F0\": '0',\n // Eastern-Arabic digit 0\n \"\\u06F1\": '1',\n // Eastern-Arabic digit 1\n \"\\u06F2\": '2',\n // Eastern-Arabic digit 2\n \"\\u06F3\": '3',\n // Eastern-Arabic digit 3\n \"\\u06F4\": '4',\n // Eastern-Arabic digit 4\n \"\\u06F5\": '5',\n // Eastern-Arabic digit 5\n \"\\u06F6\": '6',\n // Eastern-Arabic digit 6\n \"\\u06F7\": '7',\n // Eastern-Arabic digit 7\n \"\\u06F8\": '8',\n // Eastern-Arabic digit 8\n \"\\u06F9\": '9' // Eastern-Arabic digit 9\n\n};\nexport function parseDigit(character) {\n return DIGITS[character];\n}\n/**\r\n * Parses phone number digits from a string.\r\n * Drops all punctuation leaving only digits.\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * parseDigits('8 (800) 555')\r\n * // Outputs '8800555'.\r\n * ```\r\n */\n\nexport default function parseDigits(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n var digit = parseDigit(character);\n\n if (digit) {\n result += digit;\n }\n }\n\n return result;\n}\n","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { parseDigit } from './helpers/parseDigits.js';\n/**\r\n * Parses phone number characters from a string.\r\n * Drops all punctuation leaving only digits and the leading `+` sign (if any).\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * // Outputs '8800555'.\r\n * parseIncompletePhoneNumber('8 (800) 555')\r\n * // Outputs '+7800555'.\r\n * parseIncompletePhoneNumber('+7 800 555')\r\n * ```\r\n */\n\nexport default function parseIncompletePhoneNumber(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n result += parsePhoneNumberCharacter(character, result) || '';\n }\n\n return result;\n}\n/**\r\n * Parses next character while parsing phone number digits (including a `+`)\r\n * from text: discards everything except `+` and digits, and `+` is only allowed\r\n * at the start of a phone number.\r\n * For example, is used in `react-phone-number-input` where it uses\r\n * [`input-format`](https://gitlab.com/catamphetamine/input-format).\r\n * @param {string} character - Yet another character from raw input string.\r\n * @param {string?} prevParsedCharacters - Previous parsed characters.\r\n * @param {function?} emitEvent - An optional \"emit event\" function.\r\n * @return {string?} The parsed character.\r\n */\n\nexport function parsePhoneNumberCharacter(character, prevParsedCharacters, emitEvent) {\n // Only allow a leading `+`.\n if (character === '+') {\n // If this `+` is not the first parsed character\n // then discard it.\n if (prevParsedCharacters) {\n // `emitEvent` argument was added to this `export`ed function on Dec 26th, 2023.\n // Any 3rd-party code that used to `import` and call this function before that\n // won't be passing any `emitEvent` argument.\n //\n // The addition of the `emitEvent` argument was to fix the slightly-weird behavior\n // of parsing an input string when the user inputs something like `\"2+7\"\n // https://github.com/catamphetamine/react-phone-number-input/issues/437\n //\n // If the parser encounters an unexpected `+` in a string being parsed\n // then it simply discards that out-of-place `+` and any following characters.\n //\n if (typeof emitEvent === 'function') {\n emitEvent('end');\n }\n\n return;\n }\n\n return '+';\n } // Allow digits.\n\n\n return parseDigit(character);\n}\n","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n/**\r\n * Merges two arrays.\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {*}\r\n */\nexport default function mergeArrays(a, b) {\n var merged = a.slice();\n\n for (var _iterator = _createForOfIteratorHelperLoose(b), _step; !(_step = _iterator()).done;) {\n var element = _step.value;\n\n if (a.indexOf(element) < 0) {\n merged.push(element);\n }\n }\n\n return merged.sort(function (a, b) {\n return a - b;\n }); // ES6 version, requires Set polyfill.\n // let merged = new Set(a)\n // for (const element of b) {\n // \tmerged.add(i)\n // }\n // return Array.from(merged).sort((a, b) => a - b)\n}\n","import mergeArrays from './mergeArrays.js';\nexport default function checkNumberLength(nationalNumber, metadata) {\n return checkNumberLengthForType(nationalNumber, undefined, metadata);\n} // Checks whether a number is possible for the country based on its length.\n// Should only be called for the \"new\" metadata which has \"possible lengths\".\n\nexport function checkNumberLengthForType(nationalNumber, type, metadata) {\n var type_info = metadata.type(type); // There should always be \" \" set for every type element.\n // This is declared in the XML schema.\n // For size efficiency, where a sub-description (e.g. fixed-line)\n // has the same \" \" as the \"general description\", this is missing,\n // so we fall back to the \"general description\". Where no numbers of the type\n // exist at all, there is one possible length (-1) which is guaranteed\n // not to match the length of any real phone number.\n\n var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths(); // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n // Metadata before version `1.0.18` didn't contain `possible_lengths`.\n\n if (!possible_lengths) {\n return 'IS_POSSIBLE';\n }\n\n if (type === 'FIXED_LINE_OR_MOBILE') {\n // No such country in metadata.\n\n /* istanbul ignore next */\n if (!metadata.type('FIXED_LINE')) {\n // The rare case has been encountered where no fixedLine data is available\n // (true for some non-geographic entities), so we just check mobile.\n return checkNumberLengthForType(nationalNumber, 'MOBILE', metadata);\n }\n\n var mobile_type = metadata.type('MOBILE');\n\n if (mobile_type) {\n // Merge the mobile data in if there was any. \"Concat\" creates a new\n // array, it doesn't edit possible_lengths in place, so we don't need a copy.\n // Note that when adding the possible lengths from mobile, we have\n // to again check they aren't empty since if they are this indicates\n // they are the same as the general desc and should be obtained from there.\n possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths()); // The current list is sorted; we need to merge in the new list and\n // re-sort (duplicates are okay). Sorting isn't so expensive because\n // the lists are very small.\n // if (local_lengths) {\n // \tlocal_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())\n // } else {\n // \tlocal_lengths = mobile_type.possibleLengthsLocal()\n // }\n }\n } // If the type doesn't exist then return 'INVALID_LENGTH'.\n else if (type && !type_info) {\n return 'INVALID_LENGTH';\n }\n\n var actual_length = nationalNumber.length; // In `libphonenumber-js` all \"local-only\" formats are dropped for simplicity.\n // // This is safe because there is never an overlap beween the possible lengths\n // // and the local-only lengths; this is checked at build time.\n // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)\n // {\n // \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n // }\n\n var minimum_length = possible_lengths[0];\n\n if (minimum_length === actual_length) {\n return 'IS_POSSIBLE';\n }\n\n if (minimum_length > actual_length) {\n return 'TOO_SHORT';\n }\n\n if (possible_lengths[possible_lengths.length - 1] < actual_length) {\n return 'TOO_LONG';\n } // We skip the first element since we've already checked it.\n\n\n return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n","import Metadata from './metadata.js';\nimport checkNumberLength from './helpers/checkNumberLength.js';\n/**\r\n * Checks if a phone number is \"possible\" (basically just checks its length).\r\n *\r\n * isPossible(phoneNumberInstance, { ..., v2: true }, metadata)\r\n *\r\n * isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)\r\n * isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)\r\n *\r\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\r\n * @param {object} [options]\r\n * @param {object} metadata\r\n * @return {string}\r\n */\n\nexport default function isPossiblePhoneNumber(input, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n\n metadata = new Metadata(metadata);\n\n if (options.v2) {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else {\n if (!input.phone) {\n return false;\n }\n\n if (input.country) {\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n\n metadata.country(input.country);\n } else {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n\n metadata.selectNumberingPlan(input.countryCallingCode);\n }\n } // Old metadata (< 1.0.18) had no \"possible length\" data.\n\n\n if (metadata.possibleLengths()) {\n return isPossibleNumber(input.phone || input.nationalNumber, metadata);\n } else {\n // There was a bug between `1.7.35` and `1.7.37` where \"possible_lengths\"\n // were missing for \"non-geographical\" numbering plans.\n // Just assume the number is possible in such cases:\n // it's unlikely that anyone generated their custom metadata\n // in that short period of time (one day).\n // This code can be removed in some future major version update.\n if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {\n // \"Non-geographic entities\" did't have `possibleLengths`\n // due to a bug in metadata generation process.\n return true;\n } else {\n throw new Error('Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.');\n }\n }\n}\nexport function isPossibleNumber(nationalNumber, metadata) {\n //, isInternational) {\n switch (checkNumberLength(nationalNumber, metadata)) {\n case 'IS_POSSIBLE':\n return true;\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // \treturn !isInternational\n\n default:\n return false;\n }\n}\n","/**\r\n * Checks whether the entire input sequence can be matched\r\n * against the regular expression.\r\n * @return {boolean}\r\n */\nexport default function matchesEntirely(text, regular_expression) {\n // If assigning the `''` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n text = text || '';\n return new RegExp('^(?:' + regular_expression + ')$').test(text);\n}\n","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nvar NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc)\n\nexport default function getNumberType(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {}; // When `parse()` returns an empty object — `{}` —\n // that means that the phone number is malformed,\n // so it can't possibly be valid.\n\n if (!input.country && !input.countryCallingCode) {\n return;\n }\n\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(input.country, input.countryCallingCode);\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function:\n // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835\n // Is this national number even valid for this country\n\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {\n return;\n } // Is it fixed line number\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {\n // Because duplicate regular expressions are removed\n // to reduce metadata size, if \"mobile\" pattern is \"\"\n // then it means it was removed due to being a duplicate of the fixed-line pattern.\n //\n if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {\n return 'FIXED_LINE_OR_MOBILE';\n } // `MOBILE` type pattern isn't included if it matched `FIXED_LINE` one.\n // For example, for \"US\" country.\n // Old metadata (< `1.0.18`) had a specific \"types\" data structure\n // that happened to be `undefined` for `MOBILE` in that case.\n // Newer metadata (>= `1.0.18`) has another data structure that is\n // not `undefined` for `MOBILE` in that case (it's just an empty array).\n // So this `if` is just for backwards compatibility with old metadata.\n\n\n if (!metadata.type('MOBILE')) {\n return 'FIXED_LINE_OR_MOBILE';\n } // Check if the number happens to qualify as both fixed line and mobile.\n // (no such country in the minimal metadata set)\n\n /* istanbul ignore if */\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {\n return 'FIXED_LINE_OR_MOBILE';\n }\n\n return 'FIXED_LINE';\n }\n\n for (var _iterator = _createForOfIteratorHelperLoose(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done;) {\n var type = _step.value;\n\n if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {\n return type;\n }\n }\n}\nexport function isNumberTypeEqualTo(nationalNumber, type, metadata) {\n type = metadata.type(type);\n\n if (!type || !type.pattern()) {\n return false;\n } // Check if any possible number lengths are present;\n // if so, we use them to avoid checking\n // the validation pattern if they don't match.\n // If they are absent, this means they match\n // the general description, which we have\n // already checked before a specific number type.\n\n\n if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {\n return false;\n }\n\n return matchesEntirely(nationalNumber, type.pattern());\n}\n","import applyInternationalSeparatorStyle from './applyInternationalSeparatorStyle.js'; // This was originally set to $1 but there are some countries for which the\n// first group is not used in the national pattern (e.g. Argentina) so the $1\n// group does not match correctly. Therefore, we use `\\d`, so that the first\n// group actually used in the pattern will be matched.\n\nexport var FIRST_GROUP_PATTERN = /(\\$\\d)/;\nexport default function formatNationalNumberUsingFormat(number, format, _ref) {\n var useInternationalFormat = _ref.useInternationalFormat,\n withNationalPrefix = _ref.withNationalPrefix,\n carrierCode = _ref.carrierCode,\n metadata = _ref.metadata;\n var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : // This library doesn't use `domestic_carrier_code_formatting_rule`,\n // because that one is only used when formatting phone numbers\n // for dialing from a mobile phone, and this is not a dialing library.\n // carrierCode && format.domesticCarrierCodeFormattingRule()\n // \t// First, replace the $CC in the formatting rule with the desired carrier code.\n // \t// Then, replace the $FG in the formatting rule with the first group\n // \t// and the carrier code combined in the appropriate way.\n // \t? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))\n // \t: (\n // \t\twithNationalPrefix && format.nationalPrefixFormattingRule()\n // \t\t\t? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())\n // \t\t\t: format.format()\n // \t)\n withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());\n\n if (useInternationalFormat) {\n return applyInternationalSeparatorStyle(formattedNumber);\n }\n\n return formattedNumber;\n}\n","import Metadata from '../metadata.js';\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\n\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/; // For regions that have multiple IDD prefixes\n// a preferred IDD prefix is returned.\n\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nimport Metadata, { getCountryCallingCode } from './metadata.js';\nimport getIddPrefix from './helpers/getIddPrefix.js';\nimport { formatRFC3966 } from './helpers/RFC3966.js';\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n }\n};\n/**\r\n * Formats a phone number.\r\n *\r\n * format(phoneNumberInstance, 'INTERNATIONAL', { ..., v2: true }, metadata)\r\n * format(phoneNumberInstance, 'NATIONAL', { ..., v2: true }, metadata)\r\n *\r\n * format({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', { ... }, metadata)\r\n * format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', undefined, metadata)\r\n *\r\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\r\n * @param {string} format\r\n * @param {object} [options]\r\n * @param {object} metadata\r\n * @return {string}\r\n */\n\nexport default function formatNumber(input, format, options, metadata) {\n // Apply default options.\n if (options) {\n options = _objectSpread(_objectSpread({}, DEFAULT_OPTIONS), options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n\n metadata = new Metadata(metadata);\n\n if (input.country && input.country !== '001') {\n // Validate `input.country`.\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n\n metadata.country(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n\n var number;\n\n switch (format) {\n case 'NATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return '';\n }\n\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\n\n number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);\n number = \"+\".concat(countryCallingCode, \" \").concat(number);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n\n case 'RFC3966':\n return formatRFC3966({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\n });\n // For reference, here's Google's IDD formatter:\n // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546\n // Not saying that this IDD formatter replicates it 1:1, but it seems to work.\n // Who would even need to format phone numbers in IDD format anyway?\n\n case 'IDD':\n if (!options.fromCountry) {\n return; // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\n\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n\n if (!format) {\n return number;\n }\n\n return formatNationalNumberUsingFormat(number, format, {\n useInternationalFormat: formatAs === 'INTERNATIONAL',\n withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,\n carrierCode: carrierCode,\n metadata: metadata\n });\n}\n\nexport function chooseFormatForNumber(availableFormats, nationalNnumber) {\n for (var _iterator = _createForOfIteratorHelperLoose(availableFormats), _step; !(_step = _iterator()).done;) {\n var format = _step.value;\n\n // Validate leading digits.\n // The test case for \"else path\" could be found by searching for\n // \"format.leadingDigitsPatterns().length === 0\".\n if (format.leadingDigitsPatterns().length > 0) {\n // The last leading_digits_pattern is used here, as it is the most detailed\n var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1]; // If leading digits don't match then move on to the next phone number format\n\n if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {\n continue;\n }\n } // Check that the national number matches the phone number format regular expression\n\n\n if (matchesEntirely(nationalNnumber, format.pattern())) {\n return format;\n }\n }\n}\n\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\n\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata); // When calling within the same country calling code.\n\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata); // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\n } // If regions share a country calling code, the country calling code need\n // not be dialled. This also applies when dialling within a region, so this\n // if clause covers both these cases. Technically this is the case for\n // dialling from La Reunion to other overseas departments of France (French\n // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n // this edge case for now and for those cases return the version including\n // country calling code. Details here:\n // http://www.petitfute.com/voyage/225-info-pratiques-reunion\n //\n\n\n return formattedNumber;\n }\n\n var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);\n\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\n","import { VALID_PUNCTUATION } from '../constants.js'; // Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\n// For some reason Google's metadata contains ` `s with brackets and dashes.\n// Meanwhile, there's no single opinion about using punctuation in international phone numbers.\n//\n// For example, Google's ` ` for USA is `+1 213-373-4253`.\n// And here's a quote from WikiPedia's \"North American Numbering Plan\" page:\n// https://en.wikipedia.org/wiki/North_American_Numbering_Plan\n//\n// \"The country calling code for all countries participating in the NANP is 1.\n// In international format, an NANP number should be listed as +1 301 555 01 00,\n// where 301 is an area code (Maryland).\"\n//\n// I personally prefer the international format without any punctuation.\n// For example, brackets are remnants of the old age, meaning that the\n// phone number part in brackets (so called \"area code\") can be omitted\n// if dialing within the same \"area\".\n// And hyphens were clearly introduced for splitting local numbers into memorizable groups.\n// For example, remembering \"5553535\" is difficult but \"555-35-35\" is much simpler.\n// Imagine a man taking a bus from home to work and seeing an ad with a phone number.\n// He has a couple of seconds to memorize that number until it passes by.\n// If it were spaces instead of hyphens the man wouldn't necessarily get it,\n// but with hyphens instead of spaces the grouping is more explicit.\n// I personally think that hyphens introduce visual clutter,\n// so I prefer replacing them with spaces in international numbers.\n// In the modern age all output is done on displays where spaces are clearly distinguishable\n// so hyphens can be safely replaced with spaces without losing any legibility.\n//\n\nexport default function applyInternationalSeparatorStyle(formattedNumber) {\n return formattedNumber.replace(new RegExp(\"[\".concat(VALID_PUNCTUATION, \"]+\"), 'g'), ' ').trim();\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport Metadata from './metadata.js';\nimport isPossibleNumber from './isPossible.js';\nimport isValidNumber from './isValid.js'; // import checkNumberLength from './helpers/checkNumberLength.js'\n\nimport getNumberType from './helpers/getNumberType.js';\nimport getPossibleCountriesForNumber from './helpers/getPossibleCountriesForNumber.js';\nimport formatNumber from './format.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nvar PhoneNumber = /*#__PURE__*/function () {\n /**\r\n * @param {string} countryOrCountryCallingCode\r\n * @param {string} nationalNumber\r\n * @param {object} metadata — Metadata JSON\r\n * @return {PhoneNumber}\r\n */\n function PhoneNumber(countryOrCountryCallingCode, nationalNumber, metadata) {\n _classCallCheck(this, PhoneNumber);\n\n if (!countryOrCountryCallingCode) {\n throw new TypeError('`country` or `countryCallingCode` not passed');\n }\n\n if (!nationalNumber) {\n throw new TypeError('`nationalNumber` not passed');\n }\n\n if (!metadata) {\n throw new TypeError('`metadata` not passed');\n }\n\n var _getCountryAndCountry = getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadata),\n country = _getCountryAndCountry.country,\n countryCallingCode = _getCountryAndCountry.countryCallingCode;\n\n this.country = country;\n this.countryCallingCode = countryCallingCode;\n this.nationalNumber = nationalNumber;\n this.number = '+' + this.countryCallingCode + this.nationalNumber; // Exclude `metadata` property output from `PhoneNumber.toString()`\n // so that it doesn't clutter the console output of Node.js.\n // Previously, when Node.js did `console.log(new PhoneNumber(...))`,\n // it would output the whole internal structure of the `metadata` object.\n\n this.getMetadata = function () {\n return metadata;\n };\n }\n\n _createClass(PhoneNumber, [{\n key: \"setExt\",\n value: function setExt(ext) {\n this.ext = ext;\n }\n }, {\n key: \"getPossibleCountries\",\n value: function getPossibleCountries() {\n if (this.country) {\n return [this.country];\n }\n\n return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());\n }\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n return isPossibleNumber(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"isValid\",\n value: function isValid() {\n return isValidNumber(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"isNonGeographic\",\n value: function isNonGeographic() {\n var metadata = new Metadata(this.getMetadata());\n return metadata.isNonGeographicCallingCode(this.countryCallingCode);\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(phoneNumber) {\n return this.number === phoneNumber.number && this.ext === phoneNumber.ext;\n } // This function was originally meant to be an equivalent for `validatePhoneNumberLength()`,\n // but later it was found out that it doesn't include the possible `TOO_SHORT` result\n // returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`,\n // so eventually I simply commented out this method from the `PhoneNumber` class\n // and just left the `validatePhoneNumberLength()` function, even though that one would require\n // and additional step to also validate the actual country / calling code of the phone number.\n // validateLength() {\n // \tconst metadata = new Metadata(this.getMetadata())\n // \tmetadata.selectNumberingPlan(this.countryCallingCode)\n // \tconst result = checkNumberLength(this.nationalNumber, metadata)\n // \tif (result !== 'IS_POSSIBLE') {\n // \t\treturn result\n // \t}\n // }\n\n }, {\n key: \"getType\",\n value: function getType() {\n return getNumberType(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"format\",\n value: function format(_format, options) {\n return formatNumber(this, _format, options ? _objectSpread(_objectSpread({}, options), {}, {\n v2: true\n }) : {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"formatNational\",\n value: function formatNational(options) {\n return this.format('NATIONAL', options);\n }\n }, {\n key: \"formatInternational\",\n value: function formatInternational(options) {\n return this.format('INTERNATIONAL', options);\n }\n }, {\n key: \"getURI\",\n value: function getURI(options) {\n return this.format('RFC3966', options);\n }\n }]);\n\n return PhoneNumber;\n}();\n\nexport { PhoneNumber as default };\n\nvar isCountryCode = function isCountryCode(value) {\n return /^[A-Z]{2}$/.test(value);\n};\n\nfunction getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJson) {\n var country;\n var countryCallingCode;\n var metadata = new Metadata(metadataJson); // If country code is passed then derive `countryCallingCode` from it.\n // Also store the country code as `.country`.\n\n if (isCountryCode(countryOrCountryCallingCode)) {\n country = countryOrCountryCallingCode;\n metadata.selectNumberingPlan(country);\n countryCallingCode = metadata.countryCallingCode();\n } else {\n countryCallingCode = countryOrCountryCallingCode;\n /* istanbul ignore if */\n\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(countryCallingCode)) {\n country = '001';\n }\n }\n }\n\n return {\n country: country,\n countryCallingCode: countryCallingCode\n };\n}\n","import Metadata from '../metadata.js';\n/**\r\n * Returns a list of countries that the phone number could potentially belong to.\r\n * @param {string} callingCode — Calling code.\r\n * @param {string} nationalNumber — National (significant) number.\r\n * @param {object} metadata — Metadata.\r\n * @return {string[]} A list of possible countries.\r\n */\n\nexport default function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata) {\n var _metadata = new Metadata(metadata);\n\n var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);\n\n if (!possibleCountries) {\n return [];\n }\n\n return possibleCountries.filter(function (country) {\n return couldNationalNumberBelongToCountry(nationalNumber, country, metadata);\n });\n}\n\nfunction couldNationalNumberBelongToCountry(nationalNumber, country, metadata) {\n var _metadata = new Metadata(metadata);\n\n _metadata.selectNumberingPlan(country);\n\n if (_metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0) {\n return true;\n }\n\n return false;\n}\n","import Metadata from './metadata.js';\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport getNumberType from './helpers/getNumberType.js';\n/**\r\n * Checks if a given phone number is valid.\r\n *\r\n * isValid(phoneNumberInstance, { ..., v2: true }, metadata)\r\n *\r\n * isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)\r\n * isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)\r\n *\r\n * If the `number` is a string, it will be parsed to an object,\r\n * but only if it contains only valid phone number characters (including punctuation).\r\n * If the `number` is an object, it is used as is.\r\n *\r\n * The optional `defaultCountry` argument is the default country.\r\n * I.e. it does not restrict to just that country,\r\n * e.g. in those cases where several countries share\r\n * the same phone numbering rules (NANPA, Britain, etc).\r\n * For example, even though the number `07624 369230`\r\n * belongs to the Isle of Man (\"IM\" country code)\r\n * calling `isValidNumber('07624369230', 'GB', metadata)`\r\n * still returns `true` because the country is not restricted to `GB`,\r\n * it's just that `GB` is the default one for the phone numbering rules.\r\n * For restricting the country see `isValidNumberForRegion()`\r\n * though restricting a country might not be a good idea.\r\n * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\r\n *\r\n * Examples:\r\n *\r\n * ```js\r\n * isValidNumber('+78005553535', metadata)\r\n * isValidNumber('8005553535', 'RU', metadata)\r\n * isValidNumber('88005553535', 'RU', metadata)\r\n * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)\r\n * ```\r\n */\n\nexport default function isValidNumber(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(input.country, input.countryCallingCode); // By default, countries only have type regexps when it's required for\n // distinguishing different countries having the same `countryCallingCode`.\n\n if (metadata.hasTypes()) {\n return getNumberType(input, options, metadata.metadata) !== undefined;\n } // If there are no type regexps for this country in metadata then use\n // `nationalNumberPattern` as a \"better than nothing\" replacement.\n\n\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n return matchesEntirely(nationalNumber, metadata.nationalNumberPattern());\n}\n","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport isViablePhoneNumber from './isViablePhoneNumber.js'; // https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\n\nexport function parseRFC3966(text) {\n var number;\n var ext; // Replace \"tel:\" with \"tel=\" for parsing convenience.\n\n text = text.replace(/^tel:/, 'tel=');\n\n for (var _iterator = _createForOfIteratorHelperLoose(text.split(';')), _step; !(_step = _iterator()).done;) {\n var part = _step.value;\n\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n\n switch (name) {\n case 'tel':\n number = value;\n break;\n\n case 'ext':\n ext = value;\n break;\n\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n\n break;\n }\n } // If the phone number is not viable, then abort.\n\n\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n\n var result = {\n number: number\n };\n\n if (ext) {\n result.ext = ext;\n }\n\n return result;\n}\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\n\nexport function formatRFC3966(_ref) {\n var number = _ref.number,\n ext = _ref.ext;\n\n if (!number) {\n return '';\n }\n\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n","import Metadata from '../metadata.js';\nimport { VALID_DIGITS } from '../constants.js';\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\nexport default function stripIddPrefix(number, country, callingCode, metadata) {\n if (!country) {\n return;\n } // Check if the number is IDD-prefixed.\n\n\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());\n\n if (number.search(IDDPrefixPattern) !== 0) {\n return;\n } // Strip IDD prefix.\n\n\n number = number.slice(number.match(IDDPrefixPattern)[0].length); // If there're any digits after an IDD prefix,\n // then those digits are a country calling code.\n // Since no country code starts with a `0`,\n // the code below validates that the next digit (if present) is not `0`.\n\n var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n\n if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n if (matchedGroups[1] === '0') {\n return;\n }\n }\n\n return number;\n}\n","import extractNationalNumberFromPossiblyIncompleteNumber from './extractNationalNumberFromPossiblyIncompleteNumber.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport checkNumberLength from './checkNumberLength.js';\n/**\r\n * Strips national prefix and carrier code from a complete phone number.\r\n * The difference from the non-\"FromCompleteNumber\" function is that\r\n * it won't extract national prefix if the resultant number is too short\r\n * to be a complete number for the selected phone numbering plan.\r\n * @param {string} number — Complete phone number digits.\r\n * @param {Metadata} metadata — Metadata with a phone numbering plan selected.\r\n * @return {object} `{ nationalNumber: string, carrierCode: string? }`.\r\n */\n\nexport default function extractNationalNumber(number, metadata) {\n // Parsing national prefixes and carrier codes\n // is only required for local phone numbers\n // but some people don't understand that\n // and sometimes write international phone numbers\n // with national prefixes (or maybe even carrier codes).\n // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n // Google's original library forgives such mistakes\n // and so does this library, because it has been requested:\n // https://github.com/catamphetamine/libphonenumber-js/issues/127\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),\n carrierCode = _extractNationalNumbe.carrierCode,\n nationalNumber = _extractNationalNumbe.nationalNumber;\n\n if (nationalNumber !== number) {\n if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n } // Check the national (significant) number length after extracting national prefix and carrier code.\n // Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature.\n\n\n if (metadata.possibleLengths()) {\n // The number remaining after stripping the national prefix and carrier code\n // should be long enough to have a possible length for the country.\n // Otherwise, don't strip the national prefix and carrier code,\n // since the original number could be a valid number.\n // This check has been copy-pasted \"as is\" from Google's original library:\n // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250\n // It doesn't check for the \"possibility\" of the original `number`.\n // I guess it's fine not checking that one. It works as is anyway.\n if (!isPossibleIncompleteNationalNumber(nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n }\n }\n\n return {\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n} // In some countries, the same digit could be a national prefix\n// or a leading digit of a valid phone number.\n// For example, in Russia, national prefix is `8`,\n// and also `800 555 35 35` is a valid number\n// in which `8` is not a national prefix, but the first digit\n// of a national (significant) number.\n// Same's with Belarus:\n// `82004910060` is a valid national (significant) number,\n// but `2004910060` is not.\n// To support such cases (to prevent the code from always stripping\n// national prefix), a condition is imposed: a national prefix\n// is not extracted when the original number is \"viable\" and the\n// resultant number is not, a \"viable\" national number being the one\n// that matches `national_number_pattern`.\n\nfunction shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {\n // The equivalent in Google's code is:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004\n if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {\n return false;\n } // This \"is possible\" national number (length) check has been commented out\n // because it's superceded by the (effectively) same check done in the\n // `extractNationalNumber()` function after it calls `shouldHaveExtractedNationalPrefix()`.\n // In other words, why run the same check twice if it could only be run once.\n // // Check the national (significant) number length after extracting national prefix and carrier code.\n // // Fixes a minor \"weird behavior\" bug: https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/57\n // // (Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature).\n // if (metadata.possibleLengths()) {\n // \tif (isPossibleIncompleteNationalNumber(nationalNumberBefore, metadata) &&\n // \t\t!isPossibleIncompleteNationalNumber(nationalNumberAfter, metadata)) {\n // \t\treturn false\n // \t}\n // }\n\n\n return true;\n}\n\nfunction isPossibleIncompleteNationalNumber(nationalNumber, metadata) {\n switch (checkNumberLength(nationalNumber, metadata)) {\n case 'TOO_SHORT':\n case 'INVALID_LENGTH':\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n return false;\n\n default:\n return true;\n }\n}\n","/**\r\n * Strips any national prefix (such as 0, 1) present in a\r\n * (possibly incomplete) number provided.\r\n * \"Carrier codes\" are only used in Colombia and Brazil,\r\n * and only when dialing within those countries from a mobile phone to a fixed line number.\r\n * Sometimes it won't actually strip national prefix\r\n * and will instead prepend some digits to the `number`:\r\n * for example, when number `2345678` is passed with `VI` country selected,\r\n * it will return `{ number: \"3402345678\" }`, because `340` area code is prepended.\r\n * @param {string} number — National number digits.\r\n * @param {object} metadata — Metadata with country selected.\r\n * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`. Even if a national prefix was extracted, it's not necessarily present in the returned object, so don't rely on its presence in the returned object in order to find out whether a national prefix has been extracted or not.\r\n */\nexport default function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {\n if (number && metadata.numberingPlan.nationalPrefixForParsing()) {\n // See METADATA.md for the description of\n // `national_prefix_for_parsing` and `national_prefix_transform_rule`.\n // Attempt to parse the first digits as a national prefix.\n var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');\n var prefixMatch = prefixPattern.exec(number);\n\n if (prefixMatch) {\n var nationalNumber;\n var carrierCode; // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n // If a `national_prefix_for_parsing` has any \"capturing groups\"\n // then it means that the national (significant) number is equal to\n // those \"capturing groups\" transformed via `national_prefix_transform_rule`,\n // and nothing could be said about the actual national prefix:\n // what is it and was it even there.\n // If a `national_prefix_for_parsing` doesn't have any \"capturing groups\",\n // then everything it matches is a national prefix.\n // To determine whether `national_prefix_for_parsing` matched any\n // \"capturing groups\", the value of the result of calling `.exec()`\n // is looked at, and if it has non-undefined values where there're\n // \"capturing groups\" in the regular expression, then it means\n // that \"capturing groups\" have been matched.\n // It's not possible to tell whether there'll be any \"capturing gropus\"\n // before the matching process, because a `national_prefix_for_parsing`\n // could exhibit both behaviors.\n\n var capturedGroupsCount = prefixMatch.length - 1;\n var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];\n\n if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {\n nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule()); // If there's more than one captured group,\n // then carrier code is the second one.\n\n if (capturedGroupsCount > 1) {\n carrierCode = prefixMatch[1];\n }\n } // If there're no \"capturing groups\",\n // or if there're \"capturing groups\" but no\n // `national_prefix_transform_rule`,\n // then just strip the national prefix from the number,\n // and possibly a carrier code.\n // Seems like there could be more.\n else {\n // `prefixBeforeNationalNumber` is the whole substring matched by\n // the `national_prefix_for_parsing` regular expression.\n // There seem to be no guarantees that it's just a national prefix.\n // For example, if there's a carrier code, it's gonna be a\n // part of `prefixBeforeNationalNumber` too.\n var prefixBeforeNationalNumber = prefixMatch[0];\n nationalNumber = number.slice(prefixBeforeNationalNumber.length); // If there's at least one captured group,\n // then carrier code is the first one.\n\n if (hasCapturedGroups) {\n carrierCode = prefixMatch[1];\n }\n } // Tries to guess whether a national prefix was present in the input.\n // This is not something copy-pasted from Google's library:\n // they don't seem to have an equivalent for that.\n // So this isn't an \"officially approved\" way of doing something like that.\n // But since there seems no other existing method, this library uses it.\n\n\n var nationalPrefix;\n\n if (hasCapturedGroups) {\n var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);\n var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup); // Example: an Argentinian (AR) phone number `0111523456789`.\n // `prefixMatch[0]` is `01115`, and `$1` is `11`,\n // and the rest of the phone number is `23456789`.\n // The national number is transformed via `9$1` to `91123456789`.\n // National prefix `0` is detected being present at the start.\n // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {\n\n if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {\n nationalPrefix = metadata.numberingPlan.nationalPrefix();\n }\n } else {\n nationalPrefix = prefixMatch[0];\n }\n\n return {\n nationalNumber: nationalNumber,\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode\n };\n }\n }\n\n return {\n nationalNumber: number\n };\n}\n","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport Metadata from '../metadata.js';\nimport getNumberType from './getNumberType.js';\nexport default function getCountryByNationalNumber(nationalPhoneNumber, _ref) {\n var countries = _ref.countries,\n defaultCountry = _ref.defaultCountry,\n metadata = _ref.metadata;\n // Re-create `metadata` because it will be selecting a `country`.\n metadata = new Metadata(metadata); // const matchingCountries = []\n\n for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done;) {\n var country = _step.value;\n metadata.country(country); // \"Leading digits\" patterns are only defined for about 20% of all countries.\n // By definition, matching \"leading digits\" is a sufficient but not a necessary\n // condition for a phone number to belong to a country.\n // The point of \"leading digits\" check is that it's the fastest one to get a match.\n // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\n // I'd suppose that \"leading digits\" patterns are mutually exclusive for different countries\n // because of the intended use of that feature.\n\n if (metadata.leadingDigits()) {\n if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n } // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if (getNumberType({\n phone: nationalPhoneNumber,\n country: country\n }, undefined, metadata.metadata)) {\n // If both the `defaultCountry` and the \"main\" one match the phone number,\n // don't prefer the `defaultCountry` over the \"main\" one.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154\n return country; // // If the `defaultCountry` is among the `matchingCountries` then return it.\n // if (defaultCountry) {\n // \tif (country === defaultCountry) {\n // \t\treturn country\n // \t}\n // \tmatchingCountries.push(country)\n // } else {\n // \treturn country\n // }\n }\n } // // Return the first (\"main\") one of the `matchingCountries`.\n // if (matchingCountries.length > 0) {\n // \treturn matchingCountries[0]\n // }\n\n}\n","import getCountryByNationalNumber from './getCountryByNationalNumber.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\nexport default function getCountryByCallingCode(callingCode, _ref) {\n var nationalPhoneNumber = _ref.nationalNumber,\n defaultCountry = _ref.defaultCountry,\n metadata = _ref.metadata;\n\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n return '001';\n }\n }\n\n var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);\n\n if (!possibleCountries) {\n return;\n } // If there's just one country corresponding to the country code,\n // then just return it, without further phone number digits validation.\n\n\n if (possibleCountries.length === 1) {\n return possibleCountries[0];\n }\n\n return getCountryByNationalNumber(nationalPhoneNumber, {\n countries: possibleCountries,\n defaultCountry: defaultCountry,\n metadata: metadata.metadata\n });\n}\n","// When phone numbers are written in `RFC3966` format — `\"tel:+12133734253\"` —\n// they can have their \"calling code\" part written separately in a `phone-context` parameter.\n// Example: `\"tel:12133734253;phone-context=+1\"`.\n// This function parses the full phone number from the local number and the `phone-context`\n// when the `phone-context` contains a `+` sign.\nimport { VALID_DIGITS // PLUS_CHARS\n} from '../constants.js';\nexport var PLUS_SIGN = '+';\nvar RFC3966_VISUAL_SEPARATOR_ = '[\\\\-\\\\.\\\\(\\\\)]?';\nvar RFC3966_PHONE_DIGIT_ = '(' + '[' + VALID_DIGITS + ']' + '|' + RFC3966_VISUAL_SEPARATOR_ + ')';\nvar RFC3966_GLOBAL_NUMBER_DIGITS_ = '^' + '\\\\' + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + '*' + '[' + VALID_DIGITS + ']' + RFC3966_PHONE_DIGIT_ + '*' + '$';\n/**\r\n * Regular expression of valid global-number-digits for the phone-context\r\n * parameter, following the syntax defined in RFC3966.\r\n */\n\nvar RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, 'g'); // In this port of Google's library, we don't accept alpha characters in phone numbers.\n// const ALPHANUM_ = VALID_ALPHA_ + VALID_DIGITS\n\nvar ALPHANUM_ = VALID_DIGITS;\nvar RFC3966_DOMAINLABEL_ = '[' + ALPHANUM_ + ']+((\\\\-)*[' + ALPHANUM_ + '])*';\nvar VALID_ALPHA_ = 'a-zA-Z';\nvar RFC3966_TOPLABEL_ = '[' + VALID_ALPHA_ + ']+((\\\\-)*[' + ALPHANUM_ + '])*';\nvar RFC3966_DOMAINNAME_ = '^(' + RFC3966_DOMAINLABEL_ + '\\\\.)*' + RFC3966_TOPLABEL_ + '\\\\.?$';\n/**\r\n * Regular expression of valid domainname for the phone-context parameter,\r\n * following the syntax defined in RFC3966.\r\n */\n\nvar RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, 'g');\nexport var RFC3966_PREFIX_ = 'tel:';\nexport var RFC3966_PHONE_CONTEXT_ = ';phone-context=';\nexport var RFC3966_ISDN_SUBADDRESS_ = ';isub=';\n/**\r\n * Extracts the value of the phone-context parameter of `numberToExtractFrom`,\r\n * following the syntax defined in RFC3966.\r\n *\r\n * @param {string} numberToExtractFrom\r\n * @return {string|null} the extracted string (possibly empty), or `null` if no phone-context parameter is found.\r\n */\n\nexport default function extractPhoneContext(numberToExtractFrom) {\n var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_); // If no phone-context parameter is present\n\n if (indexOfPhoneContext < 0) {\n return null;\n }\n\n var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length; // If phone-context parameter is empty\n\n if (phoneContextStart >= numberToExtractFrom.length) {\n return '';\n }\n\n var phoneContextEnd = numberToExtractFrom.indexOf(';', phoneContextStart); // If phone-context is not the last parameter\n\n if (phoneContextEnd >= 0) {\n return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);\n } else {\n return numberToExtractFrom.substring(phoneContextStart);\n }\n}\n/**\r\n * Returns whether the value of phoneContext follows the syntax defined in RFC3966.\r\n *\r\n * @param {string|null} phoneContext\r\n * @return {boolean}\r\n */\n\nexport function isPhoneContextValid(phoneContext) {\n if (phoneContext === null) {\n return true;\n }\n\n if (phoneContext.length === 0) {\n return false;\n } // Does phone-context value match pattern of global-number-digits or domainname.\n\n\n return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);\n}\n","// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\nimport { VALID_DIGITS, PLUS_CHARS, MIN_LENGTH_FOR_NSN, MAX_LENGTH_FOR_NSN } from './constants.js';\nimport ParseError from './ParseError.js';\nimport Metadata from './metadata.js';\nimport isViablePhoneNumber, { isViablePhoneNumberStart } from './helpers/isViablePhoneNumber.js';\nimport extractExtension from './helpers/extension/extractExtension.js';\nimport parseIncompletePhoneNumber from './parseIncompletePhoneNumber.js';\nimport getCountryCallingCode from './getCountryCallingCode.js';\nimport { isPossibleNumber } from './isPossible.js'; // import { parseRFC3966 } from './helpers/RFC3966.js'\n\nimport PhoneNumber from './PhoneNumber.js';\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport extractCountryCallingCode from './helpers/extractCountryCallingCode.js';\nimport extractNationalNumber from './helpers/extractNationalNumber.js';\nimport stripIddPrefix from './helpers/stripIddPrefix.js';\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode.js';\nimport extractFormattedPhoneNumberFromPossibleRfc3966NumberUri from './helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js'; // We don't allow input strings for parsing to be longer than 250 chars.\n// This prevents malicious input from consuming CPU.\n\nvar MAX_INPUT_STRING_LENGTH = 250; // This consists of the plus symbol, digits, and arabic-indic digits.\n\nvar PHONE_NUMBER_START_PATTERN = new RegExp('[' + PLUS_CHARS + VALID_DIGITS + ']'); // Regular expression of trailing characters that we want to remove.\n// A trailing `#` is sometimes used when writing phone numbers with extensions in US.\n// Example: \"+1 (645) 123 1234-910#\" number has extension \"910\".\n\nvar AFTER_PHONE_NUMBER_END_PATTERN = new RegExp('[^' + VALID_DIGITS + '#' + ']+$');\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false; // Examples:\n//\n// ```js\n// parse('8 (800) 555-35-35', 'RU')\n// parse('8 (800) 555-35-35', 'RU', metadata)\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } })\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)\n// parse('+7 800 555 35 35')\n// parse('+7 800 555 35 35', metadata)\n// ```\n//\n\n/**\r\n * Parses a phone number.\r\n *\r\n * parse('123456789', { defaultCountry: 'RU', v2: true }, metadata)\r\n * parse('123456789', { defaultCountry: 'RU' }, metadata)\r\n * parse('123456789', undefined, metadata)\r\n *\r\n * @param {string} input\r\n * @param {object} [options]\r\n * @param {object} metadata\r\n * @return {object|PhoneNumber?} If `options.v2: true` flag is passed, it returns a `PhoneNumber?` instance. Otherwise, returns an object of shape `{ phone: '...', country: '...' }` (or just `{}` if no phone number was parsed).\r\n */\n\nexport default function parse(text, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n metadata = new Metadata(metadata); // Validate `defaultCountry`.\n\n if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {\n if (options.v2) {\n throw new ParseError('INVALID_COUNTRY');\n }\n\n throw new Error(\"Unknown country: \".concat(options.defaultCountry));\n } // Parse the phone number.\n\n\n var _parseInput = parseInput(text, options.v2, options.extract),\n formattedPhoneNumber = _parseInput.number,\n ext = _parseInput.ext,\n error = _parseInput.error; // If the phone number is not viable then return nothing.\n\n\n if (!formattedPhoneNumber) {\n if (options.v2) {\n if (error === 'TOO_SHORT') {\n throw new ParseError('TOO_SHORT');\n }\n\n throw new ParseError('NOT_A_NUMBER');\n }\n\n return {};\n }\n\n var _parsePhoneNumber = parsePhoneNumber(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata),\n country = _parsePhoneNumber.country,\n nationalNumber = _parsePhoneNumber.nationalNumber,\n countryCallingCode = _parsePhoneNumber.countryCallingCode,\n countryCallingCodeSource = _parsePhoneNumber.countryCallingCodeSource,\n carrierCode = _parsePhoneNumber.carrierCode;\n\n if (!metadata.hasSelectedNumberingPlan()) {\n if (options.v2) {\n throw new ParseError('INVALID_COUNTRY');\n }\n\n return {};\n } // Validate national (significant) number length.\n\n\n if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {\n // Won't throw here because the regexp already demands length > 1.\n\n /* istanbul ignore if */\n if (options.v2) {\n throw new ParseError('TOO_SHORT');\n } // Google's demo just throws an error in this case.\n\n\n return {};\n } // Validate national (significant) number length.\n //\n // A sidenote:\n //\n // They say that sometimes national (significant) numbers\n // can be longer than `MAX_LENGTH_FOR_NSN` (e.g. in Germany).\n // https://github.com/googlei18n/libphonenumber/blob/7e1748645552da39c4e1ba731e47969d97bdb539/resources/phonenumber.proto#L36\n // Such numbers will just be discarded.\n //\n\n\n if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {\n if (options.v2) {\n throw new ParseError('TOO_LONG');\n } // Google's demo just throws an error in this case.\n\n\n return {};\n }\n\n if (options.v2) {\n var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata.metadata);\n\n if (country) {\n phoneNumber.country = country;\n }\n\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n }\n\n if (ext) {\n phoneNumber.ext = ext;\n }\n\n phoneNumber.__countryCallingCodeSource = countryCallingCodeSource;\n return phoneNumber;\n } // Check if national phone number pattern matches the number.\n // National number pattern is different for each country,\n // even for those ones which are part of the \"NANPA\" group.\n\n\n var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country) ? matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) : false;\n\n if (!options.extended) {\n return valid ? result(country, nationalNumber, ext) : {};\n } // isInternational: countryCallingCode !== undefined\n\n\n return {\n country: country,\n countryCallingCode: countryCallingCode,\n carrierCode: carrierCode,\n valid: valid,\n possible: valid ? true : options.extended === true && metadata.possibleLengths() && isPossibleNumber(nationalNumber, metadata) ? true : false,\n phone: nationalNumber,\n ext: ext\n };\n}\n/**\r\n * Extracts a formatted phone number from text.\r\n * Doesn't guarantee that the extracted phone number\r\n * is a valid phone number (for example, doesn't validate its length).\r\n * @param {string} text\r\n * @param {boolean} [extract] — If `false`, then will parse the entire `text` as a phone number.\r\n * @param {boolean} [throwOnError] — By default, it won't throw if the text is too long.\r\n * @return {string}\r\n * @example\r\n * // Returns \"(213) 373-4253\".\r\n * extractFormattedPhoneNumber(\"Call (213) 373-4253 for assistance.\")\r\n */\n\nfunction _extractFormattedPhoneNumber(text, extract, throwOnError) {\n if (!text) {\n return;\n }\n\n if (text.length > MAX_INPUT_STRING_LENGTH) {\n if (throwOnError) {\n throw new ParseError('TOO_LONG');\n }\n\n return;\n }\n\n if (extract === false) {\n return text;\n } // Attempt to extract a possible number from the string passed in\n\n\n var startsAt = text.search(PHONE_NUMBER_START_PATTERN);\n\n if (startsAt < 0) {\n return;\n }\n\n return text // Trim everything to the left of the phone number\n .slice(startsAt) // Remove trailing non-numerical characters\n .replace(AFTER_PHONE_NUMBER_END_PATTERN, '');\n}\n/**\r\n * @param {string} text - Input.\r\n * @param {boolean} v2 - Legacy API functions don't pass `v2: true` flag.\r\n * @param {boolean} [extract] - Whether to extract a phone number from `text`, or attempt to parse the entire text as a phone number.\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\n\n\nfunction parseInput(text, v2, extract) {\n // // Parse RFC 3966 phone number URI.\n // if (text && text.indexOf('tel:') === 0) {\n // \treturn parseRFC3966(text)\n // }\n // let number = extractFormattedPhoneNumber(text, extract, v2)\n var number = extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(text, {\n extractFormattedPhoneNumber: function extractFormattedPhoneNumber(text) {\n return _extractFormattedPhoneNumber(text, extract, v2);\n }\n }); // If the phone number is not viable, then abort.\n\n if (!number) {\n return {};\n }\n\n if (!isViablePhoneNumber(number)) {\n if (isViablePhoneNumberStart(number)) {\n return {\n error: 'TOO_SHORT'\n };\n }\n\n return {};\n } // Attempt to parse extension first, since it doesn't require region-specific\n // data and we want to have the non-normalised number here.\n\n\n var withExtensionStripped = extractExtension(number);\n\n if (withExtensionStripped.ext) {\n return withExtensionStripped;\n }\n\n return {\n number: number\n };\n}\n/**\r\n * Creates `parse()` result object.\r\n */\n\n\nfunction result(country, nationalNumber, ext) {\n var result = {\n country: country,\n phone: nationalNumber\n };\n\n if (ext) {\n result.ext = ext;\n }\n\n return result;\n}\n/**\r\n * Parses a viable phone number.\r\n * @param {string} formattedPhoneNumber — Example: \"(213) 373-4253\".\r\n * @param {string} [defaultCountry]\r\n * @param {string} [defaultCallingCode]\r\n * @param {Metadata} metadata\r\n * @return {object} Returns `{ country: string?, countryCallingCode: string?, nationalNumber: string? }`.\r\n */\n\n\nfunction parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) {\n // Extract calling code from phone number.\n var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata.metadata),\n countryCallingCodeSource = _extractCountryCallin.countryCallingCodeSource,\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number; // Choose a country by `countryCallingCode`.\n\n\n var country;\n\n if (countryCallingCode) {\n metadata.selectNumberingPlan(countryCallingCode);\n } // If `formattedPhoneNumber` is passed in \"national\" format\n // then `number` is defined and `countryCallingCode` is `undefined`.\n else if (number && (defaultCountry || defaultCallingCode)) {\n metadata.selectNumberingPlan(defaultCountry, defaultCallingCode);\n\n if (defaultCountry) {\n country = defaultCountry;\n } else {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n country = '001';\n }\n }\n }\n\n countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata.metadata);\n } else return {};\n\n if (!number) {\n return {\n countryCallingCodeSource: countryCallingCodeSource,\n countryCallingCode: countryCallingCode\n };\n }\n\n var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), metadata),\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode; // Sometimes there are several countries\n // corresponding to the same country phone code\n // (e.g. NANPA countries all having `1` country phone code).\n // Therefore, to reliably determine the exact country,\n // national (significant) number should have been parsed first.\n //\n // When `metadata.json` is generated, all \"ambiguous\" country phone codes\n // get their countries populated with the full set of\n // \"phone number type\" regular expressions.\n //\n\n\n var exactCountry = getCountryByCallingCode(countryCallingCode, {\n nationalNumber: nationalNumber,\n defaultCountry: defaultCountry,\n metadata: metadata\n });\n\n if (exactCountry) {\n country = exactCountry;\n /* istanbul ignore if */\n\n if (exactCountry === '001') {// Can't happen with `USE_NON_GEOGRAPHIC_COUNTRY_CODE` being `false`.\n // If `USE_NON_GEOGRAPHIC_COUNTRY_CODE` is set to `true` for some reason,\n // then remove the \"istanbul ignore if\".\n } else {\n metadata.country(country);\n }\n }\n\n return {\n country: country,\n countryCallingCode: countryCallingCode,\n countryCallingCodeSource: countryCallingCodeSource,\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n}\n","import extractPhoneContext, { isPhoneContextValid, PLUS_SIGN, RFC3966_PREFIX_, RFC3966_PHONE_CONTEXT_, RFC3966_ISDN_SUBADDRESS_ } from './extractPhoneContext.js';\nimport ParseError from '../ParseError.js';\n/**\r\n * @param {string} numberToParse\r\n * @param {string} nationalNumber\r\n * @return {}\r\n */\n\nexport default function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {\n var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;\n var phoneContext = extractPhoneContext(numberToParse);\n\n if (!isPhoneContextValid(phoneContext)) {\n throw new ParseError('NOT_A_NUMBER');\n }\n\n var phoneNumberString;\n\n if (phoneContext === null) {\n // Extract a possible number from the string passed in.\n // (this strips leading characters that could not be the start of a phone number)\n phoneNumberString = extractFormattedPhoneNumber(numberToParse) || '';\n } else {\n phoneNumberString = ''; // If the phone context contains a phone number prefix, we need to capture\n // it, whereas domains will be ignored.\n\n if (phoneContext.charAt(0) === PLUS_SIGN) {\n phoneNumberString += phoneContext;\n } // Now append everything between the \"tel:\" prefix and the phone-context.\n // This should include the national number, an optional extension or\n // isdn-subaddress component. Note we also handle the case when \"tel:\" is\n // missing, as we have seen in some of the phone number inputs.\n // In that case, we append everything from the beginning.\n\n\n var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);\n var indexOfNationalNumber; // RFC 3966 \"tel:\" prefix is preset at this stage because\n // `isPhoneContextValid()` requires it to be present.\n\n /* istanbul ignore else */\n\n if (indexOfRfc3966Prefix >= 0) {\n indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;\n } else {\n indexOfNationalNumber = 0;\n }\n\n var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);\n phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);\n } // Delete the isdn-subaddress and everything after it if it is present.\n // Note extension won't appear at the same time with isdn-subaddress\n // according to paragraph 5.3 of the RFC3966 spec.\n\n\n var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);\n\n if (indexOfIsdn > 0) {\n phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);\n } // If both phone context and isdn-subaddress are absent but other\n // parameters are present, the parameters are left in nationalNumber.\n // This is because we are concerned about deleting content from a potential\n // number string when there is no strong evidence that the number is\n // actually written in RFC3966.\n\n\n if (phoneNumberString !== '') {\n return phoneNumberString;\n }\n}\n","import stripIddPrefix from './stripIddPrefix.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport Metadata from '../metadata.js';\nimport { MAX_LENGTH_COUNTRY_CODE } from '../constants.js';\n/**\r\n * Converts a phone number digits (possibly with a `+`)\r\n * into a calling code and the rest phone number digits.\r\n * The \"rest phone number digits\" could include\r\n * a national prefix, carrier code, and national\r\n * (significant) number.\r\n * @param {string} number — Phone number digits (possibly with a `+`).\r\n * @param {string} [country] — Default country.\r\n * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic).\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCodeSource: string?, countryCallingCode: string?, number: string }`\r\n * @example\r\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\r\n * extractCountryCallingCode('2133734253', 'US', null, metadata)\r\n * extractCountryCallingCode('2133734253', null, '1', metadata)\r\n * extractCountryCallingCode('+12133734253', null, null, metadata)\r\n * extractCountryCallingCode('+12133734253', 'RU', null, metadata)\r\n */\n\nexport default function extractCountryCallingCode(number, country, callingCode, metadata) {\n if (!number) {\n return {};\n }\n\n var isNumberWithIddPrefix; // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata); // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n isNumberWithIddPrefix = true;\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || callingCode) {\n var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n\n if (countryCallingCode) {\n return {\n countryCallingCodeSource: 'FROM_NUMBER_WITHOUT_PLUS_SIGN',\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n\n return {\n // No need to set it to `UNSPECIFIED`. It can be just `undefined`.\n // countryCallingCodeSource: 'UNSPECIFIED',\n number: number\n };\n }\n } // Fast abortion: country codes do not begin with a '0'\n\n\n if (number[1] === '0') {\n return {};\n }\n\n metadata = new Metadata(metadata); // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n\n var i = 2;\n\n while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCodeSource: isNumberWithIddPrefix ? 'FROM_NUMBER_WITH_IDD' : 'FROM_NUMBER_WITH_PLUS_SIGN',\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n\n i++;\n }\n\n return {};\n} // The possible values for the returned `countryCallingCodeSource` are:\n//\n// Copy-pasted from:\n// https://github.com/google/libphonenumber/blob/master/resources/phonenumber.proto\n//\n// // The source from which the country_code is derived. This is not set in the\n// // general parsing method, but in the method that parses and keeps raw_input.\n// // New fields could be added upon request.\n// enum CountryCodeSource {\n// // Default value returned if this is not set, because the phone number was\n// // created using parse, not parseAndKeepRawInput. hasCountryCodeSource will\n// // return false if this is the case.\n// UNSPECIFIED = 0;\n//\n// // The country_code is derived based on a phone number with a leading \"+\",\n// // e.g. the French number \"+33 1 42 68 53 00\".\n// FROM_NUMBER_WITH_PLUS_SIGN = 1;\n//\n// // The country_code is derived based on a phone number with a leading IDD,\n// // e.g. the French number \"011 33 1 42 68 53 00\", as it is dialled from US.\n// FROM_NUMBER_WITH_IDD = 5;\n//\n// // The country_code is derived based on a phone number without a leading\n// // \"+\", e.g. the French number \"33 1 42 68 53 00\" when defaultCountry is\n// // supplied as France.\n// FROM_NUMBER_WITHOUT_PLUS_SIGN = 10;\n//\n// // The country_code is derived NOT based on the phone number itself, but\n// // from the defaultCountry parameter provided in the parsing function by the\n// // clients. This happens mostly for numbers written in the national format\n// // (without country code). For example, this would be set when parsing the\n// // French number \"01 42 68 53 00\", when defaultCountry is supplied as\n// // France.\n// FROM_DEFAULT_COUNTRY = 20;\n// }\n","import Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport extractNationalNumber from './extractNationalNumber.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryCallingCode from '../getCountryCallingCode.js';\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits.\r\n * @param {string?} country\r\n * @param {string?} callingCode\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`.\r\n */\n\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) {\n var countryCallingCode = country ? getCountryCallingCode(country, metadata) : callingCode;\n\n if (number.indexOf(countryCallingCode) === 0) {\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(country, callingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n\n var _extractNationalNumbe2 = extractNationalNumber(number, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n\n\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n\n return {\n number: number\n };\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport parse from './parse.js';\nexport default function parsePhoneNumberWithError(text, options, metadata) {\n return parse(text, _objectSpread(_objectSpread({}, options), {}, {\n v2: true\n }), metadata);\n}\n","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport isObject from './helpers/isObject.js'; // Extracts the following properties from function arguments:\n// * input `text`\n// * `options` object\n// * `metadata` JSON\n\nexport default function normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3];\n\n var text;\n var options;\n var metadata; // If the phone number is passed as a string.\n // `parsePhoneNumber('88005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n text = arg_1;\n } else throw new TypeError('A text for parsing must be a string.'); // If \"default country\" argument is being passed then move it to `options`.\n // `parsePhoneNumber('88005553535', 'RU', [options], metadata)`.\n\n\n if (!arg_2 || typeof arg_2 === 'string') {\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n options = undefined;\n metadata = arg_3;\n }\n\n if (arg_2) {\n options = _objectSpread({\n defaultCountry: arg_2\n }, options);\n }\n } // `defaultCountry` is not passed.\n // Example: `parsePhoneNumber('+78005553535', [options], metadata)`.\n else if (isObject(arg_2)) {\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n } else throw new Error(\"Invalid second argument: \".concat(arg_2));\n\n return {\n text: text,\n options: options,\n metadata: metadata\n };\n}\n","import parsePhoneNumberWithError_ from './parsePhoneNumberWithError_.js';\nimport normalizeArguments from './normalizeArguments.js';\nexport default function parsePhoneNumberWithError() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumberWithError_(text, options, metadata);\n}\n","import { Pipe, PipeTransform } from '@angular/core'\nimport { parsePhoneNumber, CountryCode } from 'libphonenumber-js/min'\n\n@Pipe({\n name: 'phone'\n})\n\nexport class PhonePipe implements PipeTransform {\n\n transform(phoneValue: number | string, country: string): any {\n try {\n const phoneNumber = parsePhoneNumber(phoneValue + '', country as CountryCode)\n return phoneNumber.formatNational()\n } catch (error) {\n return phoneValue;\n }\n }\n}\n","import withMetadataArgument from './withMetadataArgument.js'\r\nimport { parsePhoneNumberWithError as _parsePhoneNumberWithError } from '../../core/index.js'\r\n\r\nexport function parsePhoneNumberWithError() {\r\n\treturn withMetadataArgument(_parsePhoneNumberWithError, arguments)\r\n}\r\n","// Importing from a \".js\" file is a workaround for Node.js \"ES Modules\"\r\n// importing system which is even uncapable of importing \"*.json\" files.\r\nimport metadata from '../../metadata.min.json.js'\r\n\r\nexport default function withMetadataArgument(func, _arguments) {\r\n\tvar args = Array.prototype.slice.call(_arguments)\r\n\targs.push(metadata)\r\n\treturn func.apply(this, args)\r\n}","import { Pipe, PipeTransform } from '@angular/core'\n\n@Pipe({\n name: 'filter',\n pure: false\n})\n\nexport class FilterPipe implements PipeTransform {\n transform(items: any, callback: (item: any) => boolean): any {\n if (!items || !callback) {\n return items\n }\n\n return items.filter((item: any) => callback(item))\n }\n}\n","\n\t
\n\t
\n\t\tSelect a location:\n\t \n\t
\n\t\t\n\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{{ formControl.value.address.address_1 }} {{ formControl.value.address.address_2 ? ', ' + formControl.value.address.address_2 : '' }} \n\t\t\t\t\t{{ formControl.value.address.city }}, {{ formControl.value.address.state }} {{ formControl.value.address.zip }}\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{{ formControl.value.phone | phone: 'US' }}\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{{ day.value }} {{ formControl.value.hours[$any(day.key)].open }} - {{ formControl.value.hours[$any(day.key)].close }}\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t{{ formControl.value.comments }}\n\t\t\t\t
\n\t\t\t \n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t
\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\tNo locations found within 500 miles from the specified zipcode. Please try a different zip code.\n\t\t\t
\n\t\t \n\t \n
\n","import { KeyValue } from '@angular/common'\nimport { HttpClient } from '@angular/common/http'\nimport { AfterViewInit, ChangeDetectorRef, Component, NgIterable, OnInit } from '@angular/core'\nimport { FormControl, Validators } from '@angular/forms'\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core'\nimport { Observable, of, Subscription } from 'rxjs'\nimport { catchError, map } from 'rxjs/operators'\nimport { FacilityService } from 'src/app/services/facility.service'\nimport { OrderService } from 'src/app/services/order.service'\nimport { Facility } from 'src/types/wizard'\n\n@Component({\n selector: 'gwc-location-finder',\n templateUrl: './facility.finder.component.html',\n styleUrls: ['./facility.finder.component.scss']\n})\n\nexport class FacilityFinderComponent extends FieldType implements OnInit {\n public facilities: Facility[] = []\n public companies: {[key: string]: string} = {\n fedex: 'FedEx Office',\n cvs: 'CVS Pharmacy',\n walgreens: 'Walgreens',\n aaa: 'AAA'\n }\n public weekdays: {[key: string]: string} = {\n m: 'Mon',\n\t\tt: 'Tue',\n\t\tw: 'Wed',\n\t\tr: 'Thu',\n f: 'Fri',\n\t\ts: 'Sat',\n\t\tsu: 'Sun',\n }\n public zipCodeControl = new FormControl('', Validators.required)\n public selected: Facility|undefined\n public originalOrder = (a: KeyValue, b: KeyValue): number => {\n return 0\n }\n public apiLoaded: Observable = of(false)\n public mapOptions: google.maps.MapOptions = {\n mapTypeControl: false,\n streetViewControl: false,\n styles: [\n {\n stylers: [\n { saturation: -100 },\n { gamma: 1 }\n ]\n },\n {\n elementType: 'labels.text.stroke',\n stylers: [\n { visibility: 'off' }\n ]\n },\n {\n featureType: 'poi.business',\n elementType: 'labels.text',\n stylers: [\n { visibility: 'off' }\n ]\n },\n {\n featureType: 'poi.business',\n elementType: 'labels.icon',\n stylers: [\n { visibility: 'off' }\n ]\n },\n {\n featureType: 'poi.place_of_worship',\n elementType: 'labels.text',\n stylers: [\n { visibility: 'off' }\n ]\n },\n {\n featureType: 'poi.place_of_worship',\n elementType: 'labels.icon',\n stylers: [\n { visibility: 'off' }\n ]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [\n { visibility: 'simplified' }\n ]\n },\n {\n featureType: 'water',\n stylers: [\n { visibility: 'on' },\n { saturation: 50 },\n { gamma: 0 },\n { hue: '#50a5d1' }\n ]\n },\n {\n featureType: 'administrative.neighborhood',\n elementType: 'labels.text.fill',\n stylers: [\n { color: '#333333' }\n ]\n },\n {\n featureType: 'road.local',\n elementType: 'labels.text',\n stylers: [\n { weight: 0.5 },\n { color: '#333333' }\n ]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.icon',\n stylers: [\n { gamma: 1 },\n { saturation: 50 }\n ]\n }\n ]\n }\n public mapCenter!: google.maps.LatLngLiteral \n private domain!: string\n private nextPageSubscription!: Subscription\n\n constructor(\n private facilityService: FacilityService,\n private ref: ChangeDetectorRef,\n private orderService: OrderService,\n httpClient: HttpClient,\n ){\n super()\n this.apiLoaded = httpClient.jsonp('https://maps.googleapis.com/maps/api/js?key=AIzaSyDrBuO_eyjOF8o1vZ2bdbOsc3xW6_ALheo', 'callback')\n .pipe(\n map(() => true),\n catchError(() => of(false)),\n )\n this.domain = orderService.active_domain\n }\n\n ngOnInit(): void {\n // this.prefillZipCode()\n\n if (this.formControl.value && (this.formControl.value.facility || this.formControl.value.facility === null)) {\n this.formControl.patchValue(this.formControl.value.facility)\n }\n\n this.nextPageSubscription = this.orderService.nextPage.subscribe(response => {\n this.prefillZipCode()\n })\n }\n\n ngOnDestroy(): void {\n if (this.nextPageSubscription) {\n this.nextPageSubscription.unsubscribe()\n }\n }\n\n private prefillZipCode() {\n if (this.formControl.value) {\n this.zipCodeControl.patchValue(this.formControl.value.zip)\n } else {\n if (this.model.address?.zip) {\n this.zipCodeControl.patchValue(this.model.address.zip)\n }\n }\n\n this.getFacilities()\n }\n\n public getFacilities(): any {\n // this.formControl.reset()\n let zip_code = this.zipCodeControl.getRawValue()\n\n if (zip_code) {\n let brand = ['fedex', 'aaa'].includes(this.domain) && this.props['category'] === 'passport-photo' ? this.domain : null\n\n if (this.domain === 'idp') {\n brand = 'aaa'\n }\n\n return this.facilityService.getFacilities(zip_code, this.props['category'], brand)\n .subscribe(response => {\n this.facilities = response\n\n if (this.facilities[0] && (!this.formControl.value || !this.formControl.value.address)) {\n this.formControl.patchValue(this.facilities[0])\n this.mapCenter = {\n lat: this.facilities[0].latitude,\n lng: this.facilities[0].longitude\n }\n }\n\n this.ref.detectChanges()\n this.nextPageSubscription.unsubscribe()\n })\n }\n }\n\n public selectFacility(facility: Facility): void {\n this.formControl.patchValue(facility)\n this.mapCenter = {\n lat: facility.latitude,\n lng: facility.longitude\n }\n }\n\n public hoursAvailable = (day: any): boolean => {\n return this.formControl.value.hours[day.key]\n }\n}\n","import { Component, OnInit } from '@angular/core'\nimport { FieldTypeConfig } from '@ngx-formly/core'\nimport { FieldType } from '@ngx-formly/material'\n\n@Component({\n selector: 'gwc-social-security',\n templateUrl: './social.security.component.html',\n styleUrls: ['./social.security.component.scss']\n})\n\nexport class SocialSecurityComponent extends FieldType implements OnInit {\n public show: boolean = false\n\n ngOnInit(): void {\n }\n\n public toggleShow(): void {\n this.show = !this.show\n }\n}\n"," \n\t\n\t\t \n\t\t\n\t\t\tPlease enter a valid social security number.\n\t\t \n\t \n\t\n\t\t\n\t\t\t \n\t\t \n\t \n
\n","import { NgModule } from '@angular/core'\nimport { PhonePipe } from './phone.pipe'\n\n@NgModule({\n declarations: [\n PhonePipe\n ],\n exports: [\n PhonePipe\n ]\n})\n\nexport class PhonePipeModule {}\n","import { NgModule } from '@angular/core'\nimport { FilterPipe } from './filter.pipe'\n\n@NgModule({\n declarations: [\n FilterPipe\n ],\n exports: [\n FilterPipe\n ]\n})\n\nexport class FilterPipeModule {}\n","\n\t@for (option of checkboxes; track option) {\n\t\t
\n\t\t\t{{ option.label }}\n\t\t \n\t}\n\t@if (formControl.touched && formControl.invalid) {\n\t\t
\n\t\t\tPlease select at least one option.\n\t\t
\n\t}\n
\n","import { Component } from '@angular/core'\nimport { FieldTypeConfig } from '@ngx-formly/core'\nimport { FieldType } from '@ngx-formly/material'\nimport { selectOption } from 'src/types/wizard'\n\n@Component({\n selector: 'gwc-multi-select',\n templateUrl: './multi-select.component.html',\n styleUrls: ['./multi-select.component.scss']\n})\n\nexport class MultiSelectComponent extends FieldType {\n public checkboxes!: selectOption[]\n\n ngOnInit(): void {\n this.checkboxes = this.props.options as Array\n }\n\n public toggleOption(option: selectOption): void {\n let list = this.formControl.getRawValue() as string[] || []\n let value = option.value\n let index = list.indexOf(value)\n\n if (index >= 0) {\n list.splice(index, 1)\n } else {\n list.push(value)\n }\n\n this.formControl.patchValue(list)\n }\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms'\nimport { MatIconModule } from '@angular/material/icon'\nimport { DownloadPacketComponent } from 'src/app/dialogs/download.packet/download.packet.component'\nimport { HeaderModule } from '../header/header.module'\nimport { MatButtonModule } from '@angular/material/button'\nimport { MatDialogModule } from '@angular/material/dialog'\nimport { MatCheckboxModule } from '@angular/material/checkbox'\nimport { ButtonComponent } from 'src/app/components/button/button.component'\n\n@NgModule({\n declarations: [\n DownloadPacketComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n HeaderModule,\n ReactiveFormsModule,\n MatButtonModule,\n MatIconModule,\n MatDialogModule,\n MatCheckboxModule,\n ButtonComponent\n ]\n})\n\nexport class DownloadPacketModule { }\n","import * as i0 from '@angular/core';\nimport { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';\nimport { toDataURL, toCanvas, toString } from 'qrcode';\nimport * as i1 from '@angular/platform-browser';\n\nclass QRCodeComponent {\n constructor(renderer, sanitizer) {\n this.renderer = renderer;\n this.sanitizer = sanitizer;\n this.allowEmptyString = false;\n this.colorDark = \"#000000ff\";\n this.colorLight = \"#ffffffff\";\n this.cssClass = \"qrcode\";\n this.elementType = \"canvas\";\n this.errorCorrectionLevel = \"M\";\n this.margin = 4;\n this.qrdata = \"\";\n this.scale = 4;\n this.width = 10;\n this.qrCodeURL = new EventEmitter();\n this.context = null;\n }\n async ngOnChanges() {\n await this.createQRCode();\n }\n isValidQrCodeText(data) {\n if (this.allowEmptyString === false) {\n return !(typeof data === \"undefined\" ||\n data === \"\" ||\n data === \"null\" ||\n data === null);\n }\n return !(typeof data === \"undefined\");\n }\n toDataURL(qrCodeConfig) {\n return new Promise((resolve, reject) => {\n toDataURL(this.qrdata, qrCodeConfig, (err, url) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(url);\n }\n });\n });\n }\n toCanvas(canvas, qrCodeConfig) {\n return new Promise((resolve, reject) => {\n toCanvas(canvas, this.qrdata, qrCodeConfig, (error) => {\n if (error) {\n reject(error);\n }\n else {\n resolve(\"success\");\n }\n });\n });\n }\n toSVG(qrCodeConfig) {\n return new Promise((resolve, reject) => {\n toString(this.qrdata, qrCodeConfig, (err, url) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(url);\n }\n });\n });\n }\n renderElement(element) {\n for (const node of this.qrcElement.nativeElement.childNodes) {\n this.renderer.removeChild(this.qrcElement.nativeElement, node);\n }\n this.renderer.appendChild(this.qrcElement.nativeElement, element);\n }\n async createQRCode() {\n if (this.version && this.version > 40) {\n console.warn(\"[angularx-qrcode] max value for `version` is 40\");\n this.version = 40;\n }\n else if (this.version && this.version < 1) {\n console.warn(\"[angularx-qrcode]`min value for `version` is 1\");\n this.version = 1;\n }\n else if (this.version !== undefined && isNaN(this.version)) {\n console.warn(\"[angularx-qrcode] version should be a number, defaulting to auto.\");\n this.version = undefined;\n }\n try {\n if (!this.isValidQrCodeText(this.qrdata)) {\n throw new Error(\"[angularx-qrcode] Field `qrdata` is empty, set 'allowEmptyString=\\\"true\\\"' to overwrite this behaviour.\");\n }\n if (this.isValidQrCodeText(this.qrdata) && this.qrdata === \"\") {\n this.qrdata = \" \";\n }\n const config = {\n color: {\n dark: this.colorDark,\n light: this.colorLight,\n },\n errorCorrectionLevel: this.errorCorrectionLevel,\n margin: this.margin,\n scale: this.scale,\n version: this.version,\n width: this.width,\n };\n const centerImageSrc = this.imageSrc;\n const centerImageHeight = this.imageHeight || 40;\n const centerImageWidth = this.imageWidth || 40;\n switch (this.elementType) {\n case \"canvas\": {\n const canvasElement = this.renderer.createElement(\"canvas\");\n this.context = canvasElement.getContext(\"2d\");\n this.toCanvas(canvasElement, config)\n .then(() => {\n if (this.ariaLabel) {\n this.renderer.setAttribute(canvasElement, \"aria-label\", `${this.ariaLabel}`);\n }\n if (this.title) {\n this.renderer.setAttribute(canvasElement, \"title\", `${this.title}`);\n }\n if (centerImageSrc && this.context) {\n this.centerImage = new Image(centerImageWidth, centerImageHeight);\n if (centerImageSrc !== this.centerImage.src) {\n this.centerImage.src = centerImageSrc;\n }\n if (centerImageHeight !== this.centerImage.height) {\n this.centerImage.height = centerImageHeight;\n }\n if (centerImageWidth !== this.centerImage.width) {\n this.centerImage.width = centerImageWidth;\n }\n const centerImage = this.centerImage;\n if (centerImage) {\n centerImage.onload = () => {\n this.context?.drawImage(centerImage, canvasElement.width / 2 - centerImageWidth / 2, canvasElement.height / 2 - centerImageHeight / 2, centerImageWidth, centerImageHeight);\n };\n }\n }\n this.renderElement(canvasElement);\n this.emitQRCodeURL(canvasElement);\n })\n .catch((e) => {\n console.error(\"[angularx-qrcode] canvas error:\", e);\n });\n break;\n }\n case \"svg\": {\n const svgParentElement = this.renderer.createElement(\"div\");\n this.toSVG(config)\n .then((svgString) => {\n this.renderer.setProperty(svgParentElement, \"innerHTML\", svgString);\n const svgElement = svgParentElement.firstChild;\n this.renderer.setAttribute(svgElement, \"height\", `${this.width}`);\n this.renderer.setAttribute(svgElement, \"width\", `${this.width}`);\n this.renderElement(svgElement);\n this.emitQRCodeURL(svgElement);\n })\n .catch((e) => {\n console.error(\"[angularx-qrcode] svg error:\", e);\n });\n break;\n }\n case \"url\":\n case \"img\":\n default: {\n const imgElement = this.renderer.createElement(\"img\");\n this.toDataURL(config)\n .then((dataUrl) => {\n if (this.alt) {\n imgElement.setAttribute(\"alt\", this.alt);\n }\n if (this.ariaLabel) {\n imgElement.setAttribute(\"aria-label\", this.ariaLabel);\n }\n imgElement.setAttribute(\"src\", dataUrl);\n if (this.title) {\n imgElement.setAttribute(\"title\", this.title);\n }\n this.renderElement(imgElement);\n this.emitQRCodeURL(imgElement);\n })\n .catch((e) => {\n console.error(\"[angularx-qrcode] img/url error:\", e);\n });\n }\n }\n }\n catch (e) {\n console.error(\"[angularx-qrcode] Error generating QR Code:\", e.message);\n }\n }\n emitQRCodeURL(element) {\n const className = element.constructor.name;\n if (className === SVGSVGElement.name) {\n const svgHTML = element.outerHTML;\n const blob = new Blob([svgHTML], { type: \"image/svg+xml\" });\n const urlSvg = URL.createObjectURL(blob);\n const urlSanitized = this.sanitizer.bypassSecurityTrustUrl(urlSvg);\n this.qrCodeURL.emit(urlSanitized);\n return;\n }\n let urlImage = \"\";\n if (className === HTMLCanvasElement.name) {\n urlImage = element.toDataURL(\"image/png\");\n }\n if (className === HTMLImageElement.name) {\n urlImage = element.src;\n }\n fetch(urlImage)\n .then((urlResponse) => urlResponse.blob())\n .then((blob) => URL.createObjectURL(blob))\n .then((url) => this.sanitizer.bypassSecurityTrustUrl(url))\n .then((urlSanitized) => {\n this.qrCodeURL.emit(urlSanitized);\n })\n .catch((error) => {\n console.error(\"[angularx-qrcode] Error when fetching image/png URL: \" + error);\n });\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.0.6\", ngImport: i0, type: QRCodeComponent, deps: [{ token: i0.Renderer2 }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"17.0.6\", type: QRCodeComponent, selector: \"qrcode\", inputs: { allowEmptyString: \"allowEmptyString\", colorDark: \"colorDark\", colorLight: \"colorLight\", cssClass: \"cssClass\", elementType: \"elementType\", errorCorrectionLevel: \"errorCorrectionLevel\", imageSrc: \"imageSrc\", imageHeight: \"imageHeight\", imageWidth: \"imageWidth\", margin: \"margin\", qrdata: \"qrdata\", scale: \"scale\", version: \"version\", width: \"width\", alt: \"alt\", ariaLabel: \"ariaLabel\", title: \"title\" }, outputs: { qrCodeURL: \"qrCodeURL\" }, viewQueries: [{ propertyName: \"qrcElement\", first: true, predicate: [\"qrcElement\"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.0.6\", ngImport: i0, type: QRCodeComponent, decorators: [{\n type: Component,\n args: [{\n selector: \"qrcode\",\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `
`,\n }]\n }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i1.DomSanitizer }], propDecorators: { allowEmptyString: [{\n type: Input\n }], colorDark: [{\n type: Input\n }], colorLight: [{\n type: Input\n }], cssClass: [{\n type: Input\n }], elementType: [{\n type: Input\n }], errorCorrectionLevel: [{\n type: Input\n }], imageSrc: [{\n type: Input\n }], imageHeight: [{\n type: Input\n }], imageWidth: [{\n type: Input\n }], margin: [{\n type: Input\n }], qrdata: [{\n type: Input\n }], scale: [{\n type: Input\n }], version: [{\n type: Input\n }], width: [{\n type: Input\n }], alt: [{\n type: Input\n }], ariaLabel: [{\n type: Input\n }], title: [{\n type: Input\n }], qrCodeURL: [{\n type: Output\n }], qrcElement: [{\n type: ViewChild,\n args: [\"qrcElement\", { static: true }]\n }] } });\n\nclass QRCodeModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.0.6\", ngImport: i0, type: QRCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"17.0.6\", ngImport: i0, type: QRCodeModule, declarations: [QRCodeComponent], exports: [QRCodeComponent] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"17.0.6\", ngImport: i0, type: QRCodeModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.0.6\", ngImport: i0, type: QRCodeModule, decorators: [{\n type: NgModule,\n args: [{\n providers: [],\n declarations: [QRCodeComponent],\n exports: [QRCodeComponent],\n }]\n }] });\n\nexport { QRCodeComponent, QRCodeModule };\n","@switch (step()) {\n\t@case ('upload') {\n\t\t\n\t\t@if (props['allow_upload']) {\n\t\t\t\n\t\t}\n\t}\n\t@case ('phone') {\n\t\t\n\t\t\t@if (is_photo()) {\n\t\t\t\t{{ is_text() ? 'Please use the link in the text message to take your photo' : 'Please use your phone to take your photo' }}\n\t\t\t} @else {\n\t\t\t\t{{ is_text() ? 'Please use the link in the text message to scan your documents' : 'Please use your phone to scan your document' }}\n\t\t\t}\n\t\t \n\t\t\n\t\t\t@for (document of documents(); track document.document_uuid) {\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t@if (listening() === document.document_uuid || !isCompleted(document.document_uuid)()) {\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t} @else if (isCompleted(document.document_uuid)()) {\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{{ document.friendly_name }}\n\t\t\t\t\t
\n\t\t\t\t \n\t\t\t}\n\t\t \n\t}\n\t@case ('crop') {\n\t\t\n\t\t\t@if (!imageChangedEvent()) {\n\t\t\t\t@switch(uploadingDocument().type) {\n\t\t\t\t\t@case ('drivers_license_front') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tUpload a picture of the front of your Driver's License \n\t\t\t\t\t\t\tPlease ensure the entire front of the driver's license, including the edges of the card, is visible and free from any glare that could obscure the text.\n\t\t\t\t\t\t
\n\t\t\t\t\t} \n\t\t\t\t\t@case ('drivers_license_back') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tUpload a picture of the back of your Driver's License \n\t\t\t\t\t\t\tPlease ensure the entire back of the driver's license, including the edges of the card, is visible and free from any glare that could obscure the text.\n\t\t\t\t\t\t
\n\t\t\t\t\t} \n\t\t\t\t\t@case ('online_passport_photo') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPlease make sure the photo meets the following requirements: \n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPhoto is taking using a white background. \n\t\t\t\t\t\t\tThe applicant has a neutral facial expression or a natural smile. \n\t\t\t\t\t\t\tThe applicant doesn't wear glasses, hat, or anything that covers your head (except for religious purposes). \n\t\t\t\t\t\t\tThe applicant doesn't wear any uniform. \n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t{{ is_photo() ? 'Upload Passport Type Photo' : 'Upload Document Scan' }}\n\t\t\t\t \n\t\t\t} @else {\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t{{ is_photo() ? 'Confirm Passport Type Photo' : 'Confirm Document Scan' }}\n\t\t\t\t \n\t\t\t}\n\t\t \n\t}\n\t@case ('completed') {\n\t\t@if (!is_photo) {\n\t\t\t\n\t\t\t\tAll documents have been scanned.\n\t\t\t \n\t\t}\n\t\t@for (document of documents(); track document.document_uuid; let i = $index) {\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{{ document.friendly_name }}\n\t\t\t\t\t
\n\t\t\t\t\t\tRetake\n\t\t\t\t\t \t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t}\n\t}\n}","import { ChangeDetectorRef, Component, ElementRef, OnInit, signal, ViewChild, WritableSignal, Signal, computed } from '@angular/core'\nimport { FormControl, Validators } from '@angular/forms'\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core'\nimport { ImageCroppedEvent, LoadedImage } from 'ngx-image-cropper'\nimport { generateToken } from 'src/app/services/helper.service'\nimport { OrderService } from 'src/app/services/order.service'\nimport { ProfileService } from 'src/app/services/profile.service'\nimport { ScannerService } from 'src/app/services/scanner.service'\nimport { UserService } from 'src/app/services/user.service'\nimport { environment } from 'src/environments/environment'\nimport { QRData } from 'src/types/scanner'\nimport { User } from 'src/types/user'\nimport { Scan } from 'src/types/wizard'\n\n@Component({\n\tselector: 'gwc-secure-scan',\n\ttemplateUrl: './secure.scan.component.html',\n\tstyleUrls: ['./secure.scan.component.scss']\n})\n\nexport class SecureScanComponent extends FieldType implements OnInit {\n\t@ViewChild('input') file_input!: ElementRef\n\n\tpublic sendingText: WritableSignal = signal(false)\n\tpublic uploadingImage: WritableSignal = signal(false)\n\tpublic step: WritableSignal = signal('')\n\tpublic is_photo: WritableSignal = signal(false)\n\tpublic is_text: WritableSignal = signal(false)\n\tpublic phone = new FormControl('', Validators.required)\n\tpublic documents: WritableSignal = signal([])\n\tpublic scans: WritableSignal = signal([])\n\tpublic listening: WritableSignal = signal('')\n\tpublic completed: WritableSignal = signal([])\n\tpublic uploading_file_index: WritableSignal = signal(0)\n\tpublic croppedImage: Blob|null = null\n\n\tpublic uploadingDocument = computed(() => this.scans()[this.uploading_file_index()])\n\n\tpublic isCompleted = (document_uuid: string): Signal => {\n\t\treturn computed(() => this.completed().includes(document_uuid))\n\t}\n\tpublic qrLink: WritableSignal = signal('')\n\tpublic firstScanIndex: number = 0\n\tprivate documentsSubscription!: NodeJS.Timeout\n\tpublic imageChangedEvent: WritableSignal = signal(null)\n\n\tconstructor(\n\t\tprivate scannerService: ScannerService,\n\t\tprivate userService: UserService,\n\t\tprivate orderService: OrderService,\n\t\tprivate ref: ChangeDetectorRef,\n\t\tprivate profileService: ProfileService\n\t) {\n\t\tsuper()\n\t}\n\n\tngOnInit(): void {\n\t\t// let group: any = this.formControl\n\n\t\t// group.controls[\"drivers_license_front\"].patchValue()\n\t\t// group.controls[\"drivers_license_back\"].patchValue('')\n\t\t// delete this.model[\"drivers_license_front\"] \n\t\t// delete this.model[\"drivers_license_back\"] \n\n\n\t\tthis.prefillPhone()\n\t\tthis.getScans()\n\t}\n\n\tprivate prefillPhone(): void {\n\t\tthis.userService.getUser()\n\t\t\t.subscribe((response: User) => {\n\t\t\t\tlet phone = response.phones.filter(phone => phone.type === 'mobile')[0]\n\n\t\t\t\tif (phone && phone.value) {\n\t\t\t\t\tthis.phone.patchValue(phone.value)\n\t\t\t\t\tthis.phone.markAsTouched()\n\t\t\t\t\tthis.phone.markAsDirty()\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\tprivate getScans() {\n\t\tconst docs = this.field.fieldGroup\n\t\tconst value: any = this.formControl.value\n\t\tlet index = 0\n\t\tlet document_list: Scan[] = []\n\t\tlet request_list: Scan[] = []\n\t\tlet completed_list: string[] = []\n\t\tif (docs) {\n\t\t\tdocs?.forEach(doc => {\n\t\t\t\tif (doc.key) {\n\t\t\t\t\tlet key = doc.key.toString()\n\n\t\t\t\t\tif (key === 'online_passport_photo') {\n\t\t\t\t\t\tthis.is_photo.set(true)\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!value[key]) {\n\t\t\t\t\t\trequest_list.push({\n\t\t\t\t\t\t\tdocument_uuid: '',\n\t\t\t\t\t\t\tfriendly_name: doc.props?.['friendly_name'],\n\t\t\t\t\t\t\ttype: key,\n\t\t\t\t\t\t\tmessage: doc.props?.['message']\n\t\t\t\t\t\t})\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdocument_list.push({\n\t\t\t\t\t\t\ttype: key,\n\t\t\t\t\t\t\tdocument_uuid: value[key],\n\t\t\t\t\t\t\tfriendly_name: doc.props?.['friendly_name'],\n\t\t\t\t\t\t\tmessage: doc.props?.['message']\n\t\t\t\t\t\t})\n\t\t\t\t\t\tcompleted_list.push(value[key])\n\t\t\t\t\t\tindex += 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\n\t\t\tif (request_list.length > 0) {\n\t\t\t\tthis.generateQRLink(request_list)\n\t\t\t}\n\n\t\t\tthis.documents.set(document_list)\n\t\t\tthis.scans.set(request_list)\n\t\t\tthis.completed.set(completed_list)\n\t\t\tthis.firstScanIndex = index\n\t\t\tthis.step.set(request_list.length === 0 ? 'completed' : 'upload')\n\t\t}\n\t}\n\n\tprivate generateQRLink(documents: Scan[]) {\n\t\tconst token: string = generateToken()\n\t\tconst request_object: QRData = {\n\t\t\ttoken,\n\t\t\tdomain: 'govworks',\n\t\t\tapplication_uuid: this.orderService.active_app,\n\t\t\tdocuments\n\t\t}\n\n\t\tthis.scannerService.saveQRData(request_object)\n\t\t\t.subscribe({\n\t\t\t\tnext: response => {\n\t\t\t\t\tthis.documentsSubscription = setInterval(() => {\n\t\t\t\t\t\tthis.scannerService.pollDemoDocuments(token)\n\t\t\t\t\t\t\t.subscribe({\n\t\t\t\t\t\t\t\tnext: response => {\n\t\t\t\t\t\t\t\t\tif (response) {\n\t\t\t\t\t\t\t\t\t\tif (this.documentsSubscription) {\n\t\t\t\t\t\t\t\t\t\t\tclearInterval(this.documentsSubscription)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (response.documents) {\n\t\t\t\t\t\t\t\t\t\t\tthis.documents.set([...this.documents(), ...response.documents])\n\t\t\t\t\t\t\t\t\t\t\tthis.step.set('phone')\n\t\t\t\t\t\t\t\t\t\t\tthis.subscribeForDocumentUpdates(this.firstScanIndex)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\terror: error => {\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t}, 3000)\n\t\t\t\n\t\t\t\t\tthis.qrLink.set(`${environment.API}scanner/client/start/qr?token=${token}`)\n\t\t\t\t}\n\t\t\t})\n\n\t}\n\n\tpublic sendText() {\n\t\tif (this.scans().length > 0) {\n\t\t\tthis.sendingText.set(true)\n\t\t\tthis.scannerService.sendText(\n\t\t\t\tthis.phone.value as string,\n\t\t\t\tthis.scans(),\n\t\t\t\tthis.model.profile_uuid,\n\t\t\t\tthis.orderService.active_traveler,\n\t\t\t\tthis.orderService.active_app)\n\t\t\t\t.subscribe({\n\t\t\t\t\tnext: response => {\n\t\t\t\t\t\tthis.is_text.set(true)\n\t\t\t\t\t\tthis.documents.set([...this.documents(), ...response.documents])\n\t\t\t\t\t\tthis.step.set('phone')\n\t\t\t\t\t\tthis.subscribeForDocumentUpdates(this.firstScanIndex)\n\t\t\t\t\t\tthis.sendingText.set(false)\n\t\t\t\t\t\tthis.ref.detectChanges()\n\t\t\t\t\t},\n\t\t\t\t\terror: error => {\n\t\t\t\t\t\tthis.sendingText.set(false)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\t}\n\n\tprivate subscribeForDocumentUpdates(index: number) {\n\t\tthis.listening.set(this.documents()[index].document_uuid)\n\n\t\tlet subscription = setInterval(() => {\n\t\t\tthis.scannerService.getDocumentStatus(this.listening())\n\t\t\t\t.subscribe(response => {\n\t\t\t\t\tif (response.status === 'confirmed') {\n\t\t\t\t\t\tlet group: any = this.formControl\n\n\t\t\t\t\t\tgroup.controls[response.type].patchValue(response.uuid)\n\t\t\t\t\t\tthis.model[response.type] = response.uuid\n\t\t\t\t\t\tif (subscription) {\n\t\t\t\t\t\t\tclearInterval(subscription)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.completed.set([...this.completed(), response.uuid])\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Save the model when a photo is confirmed. If there are multiple photos, the model is saved after each photo is individually confirmed\n\t\t\t\t\t\tthis.saveModel()\n\t\t\t\t\t\tif ((index + 1) < this.documents().length) {\n\t\t\t\t\t\t\tthis.subscribeForDocumentUpdates(index + 1)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.listening.set('')\n\t\t\t\t\t\t\tthis.step.set('completed')\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.ref.detectChanges()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}, 3000)\n\t}\n\n\tprivate saveModel(): void {\n\t\tthis.profileService.saveProfileWithApplication(this.props['uuid'], this.model)\n\t\t\t.subscribe()\n\t}\n\n\tpublic uploadFile(index: number): void {\n\t\tif (this.documentsSubscription) {\n\t\t\tclearInterval(this.documentsSubscription)\n\t\t}\n\t\tthis.step.set('crop')\n\t\tthis.uploading_file_index.set(index)\n\t}\n\n\tpublic fileUploaded($event: any) {\n\t\tlet file_list = this.file_input.nativeElement.files as FileList\n\n\t\tif (file_list.length > 0) {\n\t\t\tthis.imageChangedEvent.set($event)\n\t\t}\n\t}\n\n\tpublic retakePhoto(document: Scan, index: number) {\n\t\tconst request_list = [{ ...document, document_uuid: '' }]\n\t\tlet new_documents: Scan[] = this.documents()\n\t\tnew_documents.splice(index, 1)\n\t\tthis.formControl.get(document.type)?.reset()\n\t\tthis.documents.set(new_documents)\n\t\tthis.scans.set(request_list)\n\t\tthis.generateQRLink(request_list)\n\t\tthis.step.set('upload')\n\t\tthis.firstScanIndex = 0\n\t}\n\n\tpublic getDocumentImg(document_uuid: string): string {\n\t\treturn `${environment.API}scanner/document/${document_uuid}/data`\n\t}\n\n\tpublic fileChangeEvent(event: any): void {\n\t\tthis.imageChangedEvent = event;\n\t}\n\n\tpublic imageCropped(event: ImageCroppedEvent) {\n\t\tif(event.blob) {\n\t\t\tthis.croppedImage = event.blob\n\t\t}\n\t}\n\n\tpublic uploadCroppedImage() {\n\t\tconst index = this.uploading_file_index()\n\t\tconst scans = this.scans()\n\t\tif (this.croppedImage && index !== null) {\n\t\t\tthis.uploadingImage.set(true)\n\t\t\tthis.scannerService.uploadFile('direct', this.croppedImage, undefined, scans[index], this.orderService.active_app)\n \t.subscribe({\n\t\t\t\t\tnext: response => {\n\t\t\t\t\t\tthis.uploadingImage.set(false)\n\n\t\t\t\t\t\tif (response?.document_uuid) {\n\t\t\t\t\t\t\tconst new_document: Scan = {\n\t\t\t\t\t\t\t\t...scans[index],\n\t\t\t\t\t\t\t\tdocument_uuid: response.document_uuid\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst group: any = this.formControl\n\n\t\t\t\t\t\t\tgroup.controls[new_document.type].patchValue(response.document_uuid)\n\t\t\t\t\t\t\tthis.model[new_document.type] = response.document_uuid\n\t\t\t\t\t\t\tthis.completed.set([...this.completed(), response.document_uuid])\n\t\t\t\t\t\t\tthis.documents.set([...this.documents(), new_document])\n\t\n\t\t\t\t\t\t\tif (this.scans()[index + 1]) {\n\t\t\t\t\t\t\t\tthis.uploading_file_index.set(index + 1)\n\t\t\t\t\t\t\t\tthis.imageChangedEvent.set(null)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.imageChangedEvent.set(null)\n\t\t\t\t\t\t\t\tthis.step.set('completed')\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\t\n\t\t}\n\t}\n\n\timageLoaded(image: LoadedImage) {\n\t\t// show cropper\n\t}\n\n\tcropperReady() {\n\t\t// cropper ready\n\t}\n\t\n\tloadImageFailed() {\n\t\t// show message\n\t}\n\n\t// private dataURLtoFile(dataurl: string, filename: string): File {\n\t// let arr = dataurl.split(',')\n\t// let mime = arr[0].match(/:(.*?);/)?.[1]\n\t// let bstr = Buffer.from(arr[1]).toString()\n\t// let n = bstr.length\n\t// let u8arr = new Uint8Array(n)\n\n\t// while(n--){\n\t// u8arr[n] = bstr.charCodeAt(n)\n\t// }\n\n\t// return new File([u8arr], filename, {type:mime})\n\t// }\n}\n","export const generateToken = (t=21) => {\n\treturn crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?'-':'_'),'')\n}\n","import * as i0 from '@angular/core';\nimport { InjectionToken, EventEmitter, booleanAttribute, TemplateRef, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, ViewChild, ContentChildren, Input, Output, Directive, forwardRef, inject, Optional, Host, NgModule } from '@angular/core';\nimport { MAT_OPTION_PARENT_COMPONENT, MatOption, MAT_OPTGROUP, MatOptionSelectionChange, _countGroupLabelsBeforeOption, _getOptionScrollPosition, MatOptionModule, MatCommonModule } from '@angular/material/core';\nexport { MatOptgroup, MatOption } from '@angular/material/core';\nimport { DOCUMENT, CommonModule } from '@angular/common';\nimport * as i3 from '@angular/cdk/scrolling';\nimport { CdkScrollableModule } from '@angular/cdk/scrolling';\nimport * as i1$1 from '@angular/cdk/overlay';\nimport { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';\nimport { ActiveDescendantKeyManager, removeAriaReferencedId, addAriaReferencedId } from '@angular/cdk/a11y';\nimport * as i1 from '@angular/cdk/platform';\nimport { _getEventTarget } from '@angular/cdk/platform';\nimport { trigger, state, style, transition, group, animate } from '@angular/animations';\nimport { Subscription, Subject, defer, merge, of, fromEvent } from 'rxjs';\nimport { ESCAPE, hasModifierKey, UP_ARROW, ENTER, DOWN_ARROW, TAB } from '@angular/cdk/keycodes';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport * as i4 from '@angular/material/form-field';\nimport { MAT_FORM_FIELD } from '@angular/material/form-field';\nimport { startWith, switchMap, take, filter, map, tap, delay } from 'rxjs/operators';\nimport * as i2 from '@angular/cdk/bidi';\n\n// Animation values come from\n// https://github.com/material-components/material-components-web/blob/master/packages/mdc-menu-surface/_mixins.scss\n// TODO(mmalerba): Ideally find a way to import the values from MDC's code.\nconst panelAnimation = trigger('panelAnimation', [\n state('void, hidden', style({\n opacity: 0,\n transform: 'scaleY(0.8)',\n })),\n transition(':enter, hidden => visible', [\n group([\n animate('0.03s linear', style({ opacity: 1 })),\n animate('0.12s cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'scaleY(1)' })),\n ]),\n ]),\n transition(':leave, visible => hidden', [animate('0.075s linear', style({ opacity: 0 }))]),\n]);\n\n/**\n * Autocomplete IDs need to be unique across components, so this counter exists outside of\n * the component definition.\n */\nlet _uniqueAutocompleteIdCounter = 0;\n/** Event object that is emitted when an autocomplete option is selected. */\nclass MatAutocompleteSelectedEvent {\n constructor(\n /** Reference to the autocomplete panel that emitted the event. */\n source, \n /** Option that was selected. */\n option) {\n this.source = source;\n this.option = option;\n }\n}\n/** Injection token to be used to override the default options for `mat-autocomplete`. */\nconst MAT_AUTOCOMPLETE_DEFAULT_OPTIONS = new InjectionToken('mat-autocomplete-default-options', {\n providedIn: 'root',\n factory: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY,\n});\n/** @docs-private */\nfunction MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY() {\n return {\n autoActiveFirstOption: false,\n autoSelectActiveOption: false,\n hideSingleSelectionIndicator: false,\n requireSelection: false,\n };\n}\n/** Autocomplete component. */\nclass MatAutocomplete {\n /** Whether the autocomplete panel is open. */\n get isOpen() {\n return this._isOpen && this.showPanel;\n }\n /** @docs-private Sets the theme color of the panel. */\n _setColor(value) {\n this._color = value;\n this._changeDetectorRef.markForCheck();\n }\n /**\n * Takes classes set on the host mat-autocomplete element and applies them to the panel\n * inside the overlay container to allow for easy styling.\n */\n set classList(value) {\n this._classList = value;\n this._elementRef.nativeElement.className = '';\n }\n /** Whether checkmark indicator for single-selection options is hidden. */\n get hideSingleSelectionIndicator() {\n return this._hideSingleSelectionIndicator;\n }\n set hideSingleSelectionIndicator(value) {\n this._hideSingleSelectionIndicator = value;\n this._syncParentProperties();\n }\n /** Syncs the parent state with the individual options. */\n _syncParentProperties() {\n if (this.options) {\n for (const option of this.options) {\n option._changeDetectorRef.markForCheck();\n }\n }\n }\n constructor(_changeDetectorRef, _elementRef, _defaults, platform) {\n this._changeDetectorRef = _changeDetectorRef;\n this._elementRef = _elementRef;\n this._defaults = _defaults;\n this._activeOptionChanges = Subscription.EMPTY;\n /** Emits when the panel animation is done. Null if the panel doesn't animate. */\n this._animationDone = new EventEmitter();\n /** Whether the autocomplete panel should be visible, depending on option length. */\n this.showPanel = false;\n this._isOpen = false;\n /** Function that maps an option's control value to its display value in the trigger. */\n this.displayWith = null;\n /** Event that is emitted whenever an option from the list is selected. */\n this.optionSelected = new EventEmitter();\n /** Event that is emitted when the autocomplete panel is opened. */\n this.opened = new EventEmitter();\n /** Event that is emitted when the autocomplete panel is closed. */\n this.closed = new EventEmitter();\n /** Emits whenever an option is activated. */\n this.optionActivated = new EventEmitter();\n /** Unique ID to be used by autocomplete trigger's \"aria-owns\" property. */\n this.id = `mat-autocomplete-${_uniqueAutocompleteIdCounter++}`;\n // TODO(crisbeto): the problem that the `inertGroups` option resolves is only present on\n // Safari using VoiceOver. We should occasionally check back to see whether the bug\n // wasn't resolved in VoiceOver, and if it has, we can remove this and the `inertGroups`\n // option altogether.\n this.inertGroups = platform?.SAFARI || false;\n this.autoActiveFirstOption = !!_defaults.autoActiveFirstOption;\n this.autoSelectActiveOption = !!_defaults.autoSelectActiveOption;\n this.requireSelection = !!_defaults.requireSelection;\n this._hideSingleSelectionIndicator = this._defaults.hideSingleSelectionIndicator ?? false;\n }\n ngAfterContentInit() {\n this._keyManager = new ActiveDescendantKeyManager(this.options)\n .withWrap()\n .skipPredicate(this._skipPredicate);\n this._activeOptionChanges = this._keyManager.change.subscribe(index => {\n if (this.isOpen) {\n this.optionActivated.emit({ source: this, option: this.options.toArray()[index] || null });\n }\n });\n // Set the initial visibility state.\n this._setVisibility();\n }\n ngOnDestroy() {\n this._keyManager?.destroy();\n this._activeOptionChanges.unsubscribe();\n this._animationDone.complete();\n }\n /**\n * Sets the panel scrollTop. This allows us to manually scroll to display options\n * above or below the fold, as they are not actually being focused when active.\n */\n _setScrollTop(scrollTop) {\n if (this.panel) {\n this.panel.nativeElement.scrollTop = scrollTop;\n }\n }\n /** Returns the panel's scrollTop. */\n _getScrollTop() {\n return this.panel ? this.panel.nativeElement.scrollTop : 0;\n }\n /** Panel should hide itself when the option list is empty. */\n _setVisibility() {\n this.showPanel = !!this.options.length;\n this._changeDetectorRef.markForCheck();\n }\n /** Emits the `select` event. */\n _emitSelectEvent(option) {\n const event = new MatAutocompleteSelectedEvent(this, option);\n this.optionSelected.emit(event);\n }\n /** Gets the aria-labelledby for the autocomplete panel. */\n _getPanelAriaLabelledby(labelId) {\n if (this.ariaLabel) {\n return null;\n }\n const labelExpression = labelId ? labelId + ' ' : '';\n return this.ariaLabelledby ? labelExpression + this.ariaLabelledby : labelId;\n }\n // `skipPredicate` determines if key manager should avoid putting a given option in the tab\n // order. Allow disabled list items to receive focus via keyboard to align with WAI ARIA\n // recommendation.\n //\n // Normally WAI ARIA's instructions are to exclude disabled items from the tab order, but it\n // makes a few exceptions for compound widgets.\n //\n // From [Developing a Keyboard Interface](\n // https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/):\n // \"For the following composite widget elements, keep them focusable when disabled: Options in a\n // Listbox...\"\n //\n // The user can focus disabled options using the keyboard, but the user cannot click disabled\n // options.\n _skipPredicate() {\n return false;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocomplete, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS }, { token: i1.Platform }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"16.1.0\", version: \"17.2.0\", type: MatAutocomplete, isStandalone: true, selector: \"mat-autocomplete\", inputs: { ariaLabel: [\"aria-label\", \"ariaLabel\"], ariaLabelledby: [\"aria-labelledby\", \"ariaLabelledby\"], displayWith: \"displayWith\", autoActiveFirstOption: [\"autoActiveFirstOption\", \"autoActiveFirstOption\", booleanAttribute], autoSelectActiveOption: [\"autoSelectActiveOption\", \"autoSelectActiveOption\", booleanAttribute], requireSelection: [\"requireSelection\", \"requireSelection\", booleanAttribute], panelWidth: \"panelWidth\", disableRipple: [\"disableRipple\", \"disableRipple\", booleanAttribute], classList: [\"class\", \"classList\"], hideSingleSelectionIndicator: [\"hideSingleSelectionIndicator\", \"hideSingleSelectionIndicator\", booleanAttribute] }, outputs: { optionSelected: \"optionSelected\", opened: \"opened\", closed: \"closed\", optionActivated: \"optionActivated\" }, host: { classAttribute: \"mat-mdc-autocomplete\" }, providers: [{ provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatAutocomplete }], queries: [{ propertyName: \"options\", predicate: MatOption, descendants: true }, { propertyName: \"optionGroups\", predicate: MAT_OPTGROUP, descendants: true }], viewQueries: [{ propertyName: \"template\", first: true, predicate: TemplateRef, descendants: true, static: true }, { propertyName: \"panel\", first: true, predicate: [\"panel\"], descendants: true }], exportAs: [\"matAutocomplete\"], ngImport: i0, template: \"\\n \\n \\n
\\n \\n\", styles: [\"div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape);box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color)}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}\"], animations: [panelAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocomplete, decorators: [{\n type: Component,\n args: [{ selector: 'mat-autocomplete', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'matAutocomplete', host: {\n 'class': 'mat-mdc-autocomplete',\n }, providers: [{ provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatAutocomplete }], animations: [panelAnimation], standalone: true, template: \"\\n \\n \\n
\\n \\n\", styles: [\"div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape);box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color)}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}\"] }]\n }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: undefined, decorators: [{\n type: Inject,\n args: [MAT_AUTOCOMPLETE_DEFAULT_OPTIONS]\n }] }, { type: i1.Platform }], propDecorators: { template: [{\n type: ViewChild,\n args: [TemplateRef, { static: true }]\n }], panel: [{\n type: ViewChild,\n args: ['panel']\n }], options: [{\n type: ContentChildren,\n args: [MatOption, { descendants: true }]\n }], optionGroups: [{\n type: ContentChildren,\n args: [MAT_OPTGROUP, { descendants: true }]\n }], ariaLabel: [{\n type: Input,\n args: ['aria-label']\n }], ariaLabelledby: [{\n type: Input,\n args: ['aria-labelledby']\n }], displayWith: [{\n type: Input\n }], autoActiveFirstOption: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], autoSelectActiveOption: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], requireSelection: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], panelWidth: [{\n type: Input\n }], disableRipple: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], optionSelected: [{\n type: Output\n }], opened: [{\n type: Output\n }], closed: [{\n type: Output\n }], optionActivated: [{\n type: Output\n }], classList: [{\n type: Input,\n args: ['class']\n }], hideSingleSelectionIndicator: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }] } });\n\n/**\n * Directive applied to an element to make it usable\n * as a connection point for an autocomplete panel.\n */\nclass MatAutocompleteOrigin {\n constructor(\n /** Reference to the element on which the directive is applied. */\n elementRef) {\n this.elementRef = elementRef;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocompleteOrigin, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"17.2.0\", type: MatAutocompleteOrigin, isStandalone: true, selector: \"[matAutocompleteOrigin]\", exportAs: [\"matAutocompleteOrigin\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocompleteOrigin, decorators: [{\n type: Directive,\n args: [{\n selector: '[matAutocompleteOrigin]',\n exportAs: 'matAutocompleteOrigin',\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: i0.ElementRef }] });\n\n/**\n * Provider that allows the autocomplete to register as a ControlValueAccessor.\n * @docs-private\n */\nconst MAT_AUTOCOMPLETE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatAutocompleteTrigger),\n multi: true,\n};\n/**\n * Creates an error to be thrown when attempting to use an autocomplete trigger without a panel.\n * @docs-private\n */\nfunction getMatAutocompleteMissingPanelError() {\n return Error('Attempting to open an undefined instance of `mat-autocomplete`. ' +\n 'Make sure that the id passed to the `matAutocomplete` is correct and that ' +\n \"you're attempting to open it after the ngAfterContentInit hook.\");\n}\n/** Injection token that determines the scroll handling while the autocomplete panel is open. */\nconst MAT_AUTOCOMPLETE_SCROLL_STRATEGY = new InjectionToken('mat-autocomplete-scroll-strategy', {\n providedIn: 'root',\n factory: () => {\n const overlay = inject(Overlay);\n return () => overlay.scrollStrategies.reposition();\n },\n});\n/** @docs-private */\nfunction MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY(overlay) {\n return () => overlay.scrollStrategies.reposition();\n}\n/** @docs-private */\nconst MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER = {\n provide: MAT_AUTOCOMPLETE_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY,\n};\n/** Base class with all of the `MatAutocompleteTrigger` functionality. */\nclass MatAutocompleteTrigger {\n constructor(_element, _overlay, _viewContainerRef, _zone, _changeDetectorRef, scrollStrategy, _dir, _formField, _document, _viewportRuler, _defaults) {\n this._element = _element;\n this._overlay = _overlay;\n this._viewContainerRef = _viewContainerRef;\n this._zone = _zone;\n this._changeDetectorRef = _changeDetectorRef;\n this._dir = _dir;\n this._formField = _formField;\n this._document = _document;\n this._viewportRuler = _viewportRuler;\n this._defaults = _defaults;\n this._componentDestroyed = false;\n /** Whether or not the label state is being overridden. */\n this._manuallyFloatingLabel = false;\n /** Subscription to viewport size changes. */\n this._viewportSubscription = Subscription.EMPTY;\n /**\n * Whether the autocomplete can open the next time it is focused. Used to prevent a focused,\n * closed autocomplete from being reopened if the user switches to another browser tab and then\n * comes back.\n */\n this._canOpenOnNextFocus = true;\n /** Stream of keyboard events that can close the panel. */\n this._closeKeyEventStream = new Subject();\n /**\n * Event handler for when the window is blurred. Needs to be an\n * arrow function in order to preserve the context.\n */\n this._windowBlurHandler = () => {\n // If the user blurred the window while the autocomplete is focused, it means that it'll be\n // refocused when they come back. In this case we want to skip the first focus event, if the\n // pane was closed, in order to avoid reopening it unintentionally.\n this._canOpenOnNextFocus =\n this._document.activeElement !== this._element.nativeElement || this.panelOpen;\n };\n /** `View -> model callback called when value changes` */\n this._onChange = () => { };\n /** `View -> model callback called when autocomplete has been touched` */\n this._onTouched = () => { };\n /**\n * Position of the autocomplete panel relative to the trigger element. A position of `auto`\n * will render the panel underneath the trigger if there is enough space for it to fit in\n * the viewport, otherwise the panel will be shown above it. If the position is set to\n * `above` or `below`, the panel will always be shown above or below the trigger. no matter\n * whether it fits completely in the viewport.\n */\n this.position = 'auto';\n /**\n * `autocomplete` attribute to be set on the input element.\n * @docs-private\n */\n this.autocompleteAttribute = 'off';\n /** Class to apply to the panel when it's above the input. */\n this._aboveClass = 'mat-mdc-autocomplete-panel-above';\n this._overlayAttached = false;\n /** Stream of changes to the selection state of the autocomplete options. */\n this.optionSelections = defer(() => {\n const options = this.autocomplete ? this.autocomplete.options : null;\n if (options) {\n return options.changes.pipe(startWith(options), switchMap(() => merge(...options.map(option => option.onSelectionChange))));\n }\n // If there are any subscribers before `ngAfterViewInit`, the `autocomplete` will be undefined.\n // Return a stream that we'll replace with the real one once everything is in place.\n return this._zone.onStable.pipe(take(1), switchMap(() => this.optionSelections));\n });\n /** Handles keyboard events coming from the overlay panel. */\n this._handlePanelKeydown = (event) => {\n // Close when pressing ESCAPE or ALT + UP_ARROW, based on the a11y guidelines.\n // See: https://www.w3.org/TR/wai-aria-practices-1.1/#textbox-keyboard-interaction\n if ((event.keyCode === ESCAPE && !hasModifierKey(event)) ||\n (event.keyCode === UP_ARROW && hasModifierKey(event, 'altKey'))) {\n // If the user had typed something in before we autoselected an option, and they decided\n // to cancel the selection, restore the input value to the one they had typed in.\n if (this._pendingAutoselectedOption) {\n this._updateNativeInputValue(this._valueBeforeAutoSelection ?? '');\n this._pendingAutoselectedOption = null;\n }\n this._closeKeyEventStream.next();\n this._resetActiveItem();\n // We need to stop propagation, otherwise the event will eventually\n // reach the input itself and cause the overlay to be reopened.\n event.stopPropagation();\n event.preventDefault();\n }\n };\n /**\n * Track which modal we have modified the `aria-owns` attribute of. When the combobox trigger is\n * inside an aria-modal, we apply aria-owns to the parent modal with the `id` of the options\n * panel. Track the modal we have changed so we can undo the changes on destroy.\n */\n this._trackedModal = null;\n this._scrollStrategy = scrollStrategy;\n }\n ngAfterViewInit() {\n const window = this._getWindow();\n if (typeof window !== 'undefined') {\n this._zone.runOutsideAngular(() => window.addEventListener('blur', this._windowBlurHandler));\n }\n }\n ngOnChanges(changes) {\n if (changes['position'] && this._positionStrategy) {\n this._setStrategyPositions(this._positionStrategy);\n if (this.panelOpen) {\n this._overlayRef.updatePosition();\n }\n }\n }\n ngOnDestroy() {\n const window = this._getWindow();\n if (typeof window !== 'undefined') {\n window.removeEventListener('blur', this._windowBlurHandler);\n }\n this._viewportSubscription.unsubscribe();\n this._componentDestroyed = true;\n this._destroyPanel();\n this._closeKeyEventStream.complete();\n this._clearFromModal();\n }\n /** Whether or not the autocomplete panel is open. */\n get panelOpen() {\n return this._overlayAttached && this.autocomplete.showPanel;\n }\n /** Opens the autocomplete suggestion panel. */\n openPanel() {\n this._openPanelInternal();\n }\n /** Closes the autocomplete suggestion panel. */\n closePanel() {\n this._resetLabel();\n if (!this._overlayAttached) {\n return;\n }\n if (this.panelOpen) {\n // Only emit if the panel was visible.\n // The `NgZone.onStable` always emits outside of the Angular zone,\n // so all the subscriptions from `_subscribeToClosingActions()` are also outside of the Angular zone.\n // We should manually run in Angular zone to update UI after panel closing.\n this._zone.run(() => {\n this.autocomplete.closed.emit();\n });\n }\n // Only reset if this trigger is the latest one that opened the\n // autocomplete since another may have taken it over.\n if (this.autocomplete._latestOpeningTrigger === this) {\n this.autocomplete._isOpen = false;\n this.autocomplete._latestOpeningTrigger = null;\n }\n this._overlayAttached = false;\n this._pendingAutoselectedOption = null;\n if (this._overlayRef && this._overlayRef.hasAttached()) {\n this._overlayRef.detach();\n this._closingActionsSubscription.unsubscribe();\n }\n this._updatePanelState();\n // Note that in some cases this can end up being called after the component is destroyed.\n // Add a check to ensure that we don't try to run change detection on a destroyed view.\n if (!this._componentDestroyed) {\n // We need to trigger change detection manually, because\n // `fromEvent` doesn't seem to do it at the proper time.\n // This ensures that the label is reset when the\n // user clicks outside.\n this._changeDetectorRef.detectChanges();\n }\n // Remove aria-owns attribute when the autocomplete is no longer visible.\n if (this._trackedModal) {\n removeAriaReferencedId(this._trackedModal, 'aria-owns', this.autocomplete.id);\n }\n }\n /**\n * Updates the position of the autocomplete suggestion panel to ensure that it fits all options\n * within the viewport.\n */\n updatePosition() {\n if (this._overlayAttached) {\n this._overlayRef.updatePosition();\n }\n }\n /**\n * A stream of actions that should close the autocomplete panel, including\n * when an option is selected, on blur, and when TAB is pressed.\n */\n get panelClosingActions() {\n return merge(this.optionSelections, this.autocomplete._keyManager.tabOut.pipe(filter(() => this._overlayAttached)), this._closeKeyEventStream, this._getOutsideClickStream(), this._overlayRef\n ? this._overlayRef.detachments().pipe(filter(() => this._overlayAttached))\n : of()).pipe(\n // Normalize the output so we return a consistent type.\n map(event => (event instanceof MatOptionSelectionChange ? event : null)));\n }\n /** The currently active option, coerced to MatOption type. */\n get activeOption() {\n if (this.autocomplete && this.autocomplete._keyManager) {\n return this.autocomplete._keyManager.activeItem;\n }\n return null;\n }\n /** Stream of clicks outside of the autocomplete panel. */\n _getOutsideClickStream() {\n return merge(fromEvent(this._document, 'click'), fromEvent(this._document, 'auxclick'), fromEvent(this._document, 'touchend')).pipe(filter(event => {\n // If we're in the Shadow DOM, the event target will be the shadow root, so we have to\n // fall back to check the first element in the path of the click event.\n const clickTarget = _getEventTarget(event);\n const formField = this._formField\n ? this._formField.getConnectedOverlayOrigin().nativeElement\n : null;\n const customOrigin = this.connectedTo ? this.connectedTo.elementRef.nativeElement : null;\n return (this._overlayAttached &&\n clickTarget !== this._element.nativeElement &&\n // Normally focus moves inside `mousedown` so this condition will almost always be\n // true. Its main purpose is to handle the case where the input is focused from an\n // outside click which propagates up to the `body` listener within the same sequence\n // and causes the panel to close immediately (see #3106).\n this._document.activeElement !== this._element.nativeElement &&\n (!formField || !formField.contains(clickTarget)) &&\n (!customOrigin || !customOrigin.contains(clickTarget)) &&\n !!this._overlayRef &&\n !this._overlayRef.overlayElement.contains(clickTarget));\n }));\n }\n // Implemented as part of ControlValueAccessor.\n writeValue(value) {\n Promise.resolve(null).then(() => this._assignOptionValue(value));\n }\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn) {\n this._onChange = fn;\n }\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn) {\n this._onTouched = fn;\n }\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled) {\n this._element.nativeElement.disabled = isDisabled;\n }\n _handleKeydown(event) {\n const keyCode = event.keyCode;\n const hasModifier = hasModifierKey(event);\n // Prevent the default action on all escape key presses. This is here primarily to bring IE\n // in line with other browsers. By default, pressing escape on IE will cause it to revert\n // the input value to the one that it had on focus, however it won't dispatch any events\n // which means that the model value will be out of sync with the view.\n if (keyCode === ESCAPE && !hasModifier) {\n event.preventDefault();\n }\n this._valueOnLastKeydown = this._element.nativeElement.value;\n if (this.activeOption && keyCode === ENTER && this.panelOpen && !hasModifier) {\n this.activeOption._selectViaInteraction();\n this._resetActiveItem();\n event.preventDefault();\n }\n else if (this.autocomplete) {\n const prevActiveItem = this.autocomplete._keyManager.activeItem;\n const isArrowKey = keyCode === UP_ARROW || keyCode === DOWN_ARROW;\n if (keyCode === TAB || (isArrowKey && !hasModifier && this.panelOpen)) {\n this.autocomplete._keyManager.onKeydown(event);\n }\n else if (isArrowKey && this._canOpen()) {\n this._openPanelInternal(this._valueOnLastKeydown);\n }\n if (isArrowKey || this.autocomplete._keyManager.activeItem !== prevActiveItem) {\n this._scrollToOption(this.autocomplete._keyManager.activeItemIndex || 0);\n if (this.autocomplete.autoSelectActiveOption && this.activeOption) {\n if (!this._pendingAutoselectedOption) {\n this._valueBeforeAutoSelection = this._valueOnLastKeydown;\n }\n this._pendingAutoselectedOption = this.activeOption;\n this._assignOptionValue(this.activeOption.value);\n }\n }\n }\n }\n _handleInput(event) {\n let target = event.target;\n let value = target.value;\n // Based on `NumberValueAccessor` from forms.\n if (target.type === 'number') {\n value = value == '' ? null : parseFloat(value);\n }\n // If the input has a placeholder, IE will fire the `input` event on page load,\n // focus and blur, in addition to when the user actually changed the value. To\n // filter out all of the extra events, we save the value on focus and between\n // `input` events, and we check whether it changed.\n // See: https://connect.microsoft.com/IE/feedback/details/885747/\n if (this._previousValue !== value) {\n this._previousValue = value;\n this._pendingAutoselectedOption = null;\n // If selection is required we don't write to the CVA while the user is typing.\n // At the end of the selection either the user will have picked something\n // or we'll reset the value back to null.\n if (!this.autocomplete || !this.autocomplete.requireSelection) {\n this._onChange(value);\n }\n if (!value) {\n this._clearPreviousSelectedOption(null, false);\n }\n else if (this.panelOpen && !this.autocomplete.requireSelection) {\n // Note that we don't reset this when `requireSelection` is enabled,\n // because the option will be reset when the panel is closed.\n const selectedOption = this.autocomplete.options?.find(option => option.selected);\n if (selectedOption) {\n const display = this._getDisplayValue(selectedOption.value);\n if (value !== display) {\n selectedOption.deselect(false);\n }\n }\n }\n if (this._canOpen() && this._document.activeElement === event.target) {\n // When the `input` event fires, the input's value will have already changed. This means\n // that if we take the `this._element.nativeElement.value` directly, it'll be one keystroke\n // behind. This can be a problem when the user selects a value, changes a character while\n // the input still has focus and then clicks away (see #28432). To work around it, we\n // capture the value in `keydown` so we can use it here.\n const valueOnAttach = this._valueOnLastKeydown ?? this._element.nativeElement.value;\n this._valueOnLastKeydown = null;\n this._openPanelInternal(valueOnAttach);\n }\n }\n }\n _handleFocus() {\n if (!this._canOpenOnNextFocus) {\n this._canOpenOnNextFocus = true;\n }\n else if (this._canOpen()) {\n this._previousValue = this._element.nativeElement.value;\n this._attachOverlay(this._previousValue);\n this._floatLabel(true);\n }\n }\n _handleClick() {\n if (this._canOpen() && !this.panelOpen) {\n this._openPanelInternal();\n }\n }\n /**\n * In \"auto\" mode, the label will animate down as soon as focus is lost.\n * This causes the value to jump when selecting an option with the mouse.\n * This method manually floats the label until the panel can be closed.\n * @param shouldAnimate Whether the label should be animated when it is floated.\n */\n _floatLabel(shouldAnimate = false) {\n if (this._formField && this._formField.floatLabel === 'auto') {\n if (shouldAnimate) {\n this._formField._animateAndLockLabel();\n }\n else {\n this._formField.floatLabel = 'always';\n }\n this._manuallyFloatingLabel = true;\n }\n }\n /** If the label has been manually elevated, return it to its normal state. */\n _resetLabel() {\n if (this._manuallyFloatingLabel) {\n if (this._formField) {\n this._formField.floatLabel = 'auto';\n }\n this._manuallyFloatingLabel = false;\n }\n }\n /**\n * This method listens to a stream of panel closing actions and resets the\n * stream every time the option list changes.\n */\n _subscribeToClosingActions() {\n const firstStable = this._zone.onStable.pipe(take(1));\n const optionChanges = this.autocomplete.options.changes.pipe(tap(() => this._positionStrategy.reapplyLastPosition()), \n // Defer emitting to the stream until the next tick, because changing\n // bindings in here will cause \"changed after checked\" errors.\n delay(0));\n // When the zone is stable initially, and when the option list changes...\n return (merge(firstStable, optionChanges)\n .pipe(\n // create a new stream of panelClosingActions, replacing any previous streams\n // that were created, and flatten it so our stream only emits closing events...\n switchMap(() => {\n // The `NgZone.onStable` always emits outside of the Angular zone, thus we have to re-enter\n // the Angular zone. This will lead to change detection being called outside of the Angular\n // zone and the `autocomplete.opened` will also emit outside of the Angular.\n this._zone.run(() => {\n const wasOpen = this.panelOpen;\n this._resetActiveItem();\n this._updatePanelState();\n this._changeDetectorRef.detectChanges();\n if (this.panelOpen) {\n this._overlayRef.updatePosition();\n }\n if (wasOpen !== this.panelOpen) {\n // If the `panelOpen` state changed, we need to make sure to emit the `opened` or\n // `closed` event, because we may not have emitted it. This can happen\n // - if the users opens the panel and there are no options, but the\n // options come in slightly later or as a result of the value changing,\n // - if the panel is closed after the user entered a string that did not match any\n // of the available options,\n // - if a valid string is entered after an invalid one.\n if (this.panelOpen) {\n this._emitOpened();\n }\n else {\n this.autocomplete.closed.emit();\n }\n }\n });\n return this.panelClosingActions;\n }), \n // when the first closing event occurs...\n take(1))\n // set the value, close the panel, and complete.\n .subscribe(event => this._setValueAndClose(event)));\n }\n /**\n * Emits the opened event once it's known that the panel will be shown and stores\n * the state of the trigger right before the opening sequence was finished.\n */\n _emitOpened() {\n this.autocomplete.opened.emit();\n }\n /** Destroys the autocomplete suggestion panel. */\n _destroyPanel() {\n if (this._overlayRef) {\n this.closePanel();\n this._overlayRef.dispose();\n this._overlayRef = null;\n }\n }\n /** Given a value, returns the string that should be shown within the input. */\n _getDisplayValue(value) {\n const autocomplete = this.autocomplete;\n return autocomplete && autocomplete.displayWith ? autocomplete.displayWith(value) : value;\n }\n _assignOptionValue(value) {\n const toDisplay = this._getDisplayValue(value);\n if (value == null) {\n this._clearPreviousSelectedOption(null, false);\n }\n // Simply falling back to an empty string if the display value is falsy does not work properly.\n // The display value can also be the number zero and shouldn't fall back to an empty string.\n this._updateNativeInputValue(toDisplay != null ? toDisplay : '');\n }\n _updateNativeInputValue(value) {\n // If it's used within a `MatFormField`, we should set it through the property so it can go\n // through change detection.\n if (this._formField) {\n this._formField._control.value = value;\n }\n else {\n this._element.nativeElement.value = value;\n }\n this._previousValue = value;\n }\n /**\n * This method closes the panel, and if a value is specified, also sets the associated\n * control to that value. It will also mark the control as dirty if this interaction\n * stemmed from the user.\n */\n _setValueAndClose(event) {\n const panel = this.autocomplete;\n const toSelect = event ? event.source : this._pendingAutoselectedOption;\n if (toSelect) {\n this._clearPreviousSelectedOption(toSelect);\n this._assignOptionValue(toSelect.value);\n // TODO(crisbeto): this should wait until the animation is done, otherwise the value\n // gets reset while the panel is still animating which looks glitchy. It'll likely break\n // some tests to change it at this point.\n this._onChange(toSelect.value);\n panel._emitSelectEvent(toSelect);\n this._element.nativeElement.focus();\n }\n else if (panel.requireSelection &&\n this._element.nativeElement.value !== this._valueOnAttach) {\n this._clearPreviousSelectedOption(null);\n this._assignOptionValue(null);\n // Wait for the animation to finish before clearing the form control value, otherwise\n // the options might change while the animation is running which looks glitchy.\n if (panel._animationDone) {\n panel._animationDone.pipe(take(1)).subscribe(() => this._onChange(null));\n }\n else {\n this._onChange(null);\n }\n }\n this.closePanel();\n }\n /**\n * Clear any previous selected option and emit a selection change event for this option\n */\n _clearPreviousSelectedOption(skip, emitEvent) {\n // Null checks are necessary here, because the autocomplete\n // or its options may not have been assigned yet.\n this.autocomplete?.options?.forEach(option => {\n if (option !== skip && option.selected) {\n option.deselect(emitEvent);\n }\n });\n }\n _openPanelInternal(valueOnAttach = this._element.nativeElement.value) {\n this._attachOverlay(valueOnAttach);\n this._floatLabel();\n // Add aria-owns attribute when the autocomplete becomes visible.\n if (this._trackedModal) {\n const panelId = this.autocomplete.id;\n addAriaReferencedId(this._trackedModal, 'aria-owns', panelId);\n }\n }\n _attachOverlay(valueOnAttach) {\n if (!this.autocomplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatAutocompleteMissingPanelError();\n }\n let overlayRef = this._overlayRef;\n if (!overlayRef) {\n this._portal = new TemplatePortal(this.autocomplete.template, this._viewContainerRef, {\n id: this._formField?.getLabelId(),\n });\n overlayRef = this._overlay.create(this._getOverlayConfig());\n this._overlayRef = overlayRef;\n this._viewportSubscription = this._viewportRuler.change().subscribe(() => {\n if (this.panelOpen && overlayRef) {\n overlayRef.updateSize({ width: this._getPanelWidth() });\n }\n });\n }\n else {\n // Update the trigger, panel width and direction, in case anything has changed.\n this._positionStrategy.setOrigin(this._getConnectedElement());\n overlayRef.updateSize({ width: this._getPanelWidth() });\n }\n if (overlayRef && !overlayRef.hasAttached()) {\n overlayRef.attach(this._portal);\n this._valueOnAttach = valueOnAttach;\n this._valueOnLastKeydown = null;\n this._closingActionsSubscription = this._subscribeToClosingActions();\n }\n const wasOpen = this.panelOpen;\n this.autocomplete._isOpen = this._overlayAttached = true;\n this.autocomplete._latestOpeningTrigger = this;\n this.autocomplete._setColor(this._formField?.color);\n this._updatePanelState();\n this._applyModalPanelOwnership();\n // We need to do an extra `panelOpen` check in here, because the\n // autocomplete won't be shown if there are no options.\n if (this.panelOpen && wasOpen !== this.panelOpen) {\n this._emitOpened();\n }\n }\n /** Updates the panel's visibility state and any trigger state tied to id. */\n _updatePanelState() {\n this.autocomplete._setVisibility();\n // Note that here we subscribe and unsubscribe based on the panel's visiblity state,\n // because the act of subscribing will prevent events from reaching other overlays and\n // we don't want to block the events if there are no options.\n if (this.panelOpen) {\n const overlayRef = this._overlayRef;\n if (!this._keydownSubscription) {\n // Use the `keydownEvents` in order to take advantage of\n // the overlay event targeting provided by the CDK overlay.\n this._keydownSubscription = overlayRef.keydownEvents().subscribe(this._handlePanelKeydown);\n }\n if (!this._outsideClickSubscription) {\n // Subscribe to the pointer events stream so that it doesn't get picked up by other overlays.\n // TODO(crisbeto): we should switch `_getOutsideClickStream` eventually to use this stream,\n // but the behvior isn't exactly the same and it ends up breaking some internal tests.\n this._outsideClickSubscription = overlayRef.outsidePointerEvents().subscribe();\n }\n }\n else {\n this._keydownSubscription?.unsubscribe();\n this._outsideClickSubscription?.unsubscribe();\n this._keydownSubscription = this._outsideClickSubscription = null;\n }\n }\n _getOverlayConfig() {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPosition(),\n scrollStrategy: this._scrollStrategy(),\n width: this._getPanelWidth(),\n direction: this._dir ?? undefined,\n panelClass: this._defaults?.overlayPanelClass,\n });\n }\n _getOverlayPosition() {\n const strategy = this._overlay\n .position()\n .flexibleConnectedTo(this._getConnectedElement())\n .withFlexibleDimensions(false)\n .withPush(false);\n this._setStrategyPositions(strategy);\n this._positionStrategy = strategy;\n return strategy;\n }\n /** Sets the positions on a position strategy based on the directive's input state. */\n _setStrategyPositions(positionStrategy) {\n // Note that we provide horizontal fallback positions, even though by default the dropdown\n // width matches the input, because consumers can override the width. See #18854.\n const belowPositions = [\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },\n ];\n // The overlay edge connected to the trigger should have squared corners, while\n // the opposite end has rounded corners. We apply a CSS class to swap the\n // border-radius based on the overlay position.\n const panelClass = this._aboveClass;\n const abovePositions = [\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', panelClass },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', panelClass },\n ];\n let positions;\n if (this.position === 'above') {\n positions = abovePositions;\n }\n else if (this.position === 'below') {\n positions = belowPositions;\n }\n else {\n positions = [...belowPositions, ...abovePositions];\n }\n positionStrategy.withPositions(positions);\n }\n _getConnectedElement() {\n if (this.connectedTo) {\n return this.connectedTo.elementRef;\n }\n return this._formField ? this._formField.getConnectedOverlayOrigin() : this._element;\n }\n _getPanelWidth() {\n return this.autocomplete.panelWidth || this._getHostWidth();\n }\n /** Returns the width of the input element, so the panel width can match it. */\n _getHostWidth() {\n return this._getConnectedElement().nativeElement.getBoundingClientRect().width;\n }\n /**\n * Reset the active item to -1. This is so that pressing arrow keys will activate the correct\n * option.\n *\n * If the consumer opted-in to automatically activatating the first option, activate the first\n * *enabled* option.\n */\n _resetActiveItem() {\n const autocomplete = this.autocomplete;\n if (autocomplete.autoActiveFirstOption) {\n // Find the index of the first *enabled* option. Avoid calling `_keyManager.setActiveItem`\n // because it activates the first option that passes the skip predicate, rather than the\n // first *enabled* option.\n let firstEnabledOptionIndex = -1;\n for (let index = 0; index < autocomplete.options.length; index++) {\n const option = autocomplete.options.get(index);\n if (!option.disabled) {\n firstEnabledOptionIndex = index;\n break;\n }\n }\n autocomplete._keyManager.setActiveItem(firstEnabledOptionIndex);\n }\n else {\n autocomplete._keyManager.setActiveItem(-1);\n }\n }\n /** Determines whether the panel can be opened. */\n _canOpen() {\n const element = this._element.nativeElement;\n return !element.readOnly && !element.disabled && !this.autocompleteDisabled;\n }\n /** Use defaultView of injected document if available or fallback to global window reference */\n _getWindow() {\n return this._document?.defaultView || window;\n }\n /** Scrolls to a particular option in the list. */\n _scrollToOption(index) {\n // Given that we are not actually focusing active options, we must manually adjust scroll\n // to reveal options below the fold. First, we find the offset of the option from the top\n // of the panel. If that offset is below the fold, the new scrollTop will be the offset -\n // the panel height + the option height, so the active option will be just visible at the\n // bottom of the panel. If that offset is above the top of the visible panel, the new scrollTop\n // will become the offset. If that offset is visible within the panel already, the scrollTop is\n // not adjusted.\n const autocomplete = this.autocomplete;\n const labelCount = _countGroupLabelsBeforeOption(index, autocomplete.options, autocomplete.optionGroups);\n if (index === 0 && labelCount === 1) {\n // If we've got one group label before the option and we're at the top option,\n // scroll the list to the top. This is better UX than scrolling the list to the\n // top of the option, because it allows the user to read the top group's label.\n autocomplete._setScrollTop(0);\n }\n else if (autocomplete.panel) {\n const option = autocomplete.options.toArray()[index];\n if (option) {\n const element = option._getHostElement();\n const newScrollPosition = _getOptionScrollPosition(element.offsetTop, element.offsetHeight, autocomplete._getScrollTop(), autocomplete.panel.nativeElement.offsetHeight);\n autocomplete._setScrollTop(newScrollPosition);\n }\n }\n }\n /**\n * If the autocomplete trigger is inside of an `aria-modal` element, connect\n * that modal to the options panel with `aria-owns`.\n *\n * For some browser + screen reader combinations, when navigation is inside\n * of an `aria-modal` element, the screen reader treats everything outside\n * of that modal as hidden or invisible.\n *\n * This causes a problem when the combobox trigger is _inside_ of a modal, because the\n * options panel is rendered _outside_ of that modal, preventing screen reader navigation\n * from reaching the panel.\n *\n * We can work around this issue by applying `aria-owns` to the modal with the `id` of\n * the options panel. This effectively communicates to assistive technology that the\n * options panel is part of the same interaction as the modal.\n *\n * At time of this writing, this issue is present in VoiceOver.\n * See https://github.com/angular/components/issues/20694\n */\n _applyModalPanelOwnership() {\n // TODO(http://github.com/angular/components/issues/26853): consider de-duplicating this with\n // the `LiveAnnouncer` and any other usages.\n //\n // Note that the selector here is limited to CDK overlays at the moment in order to reduce the\n // section of the DOM we need to look through. This should cover all the cases we support, but\n // the selector can be expanded if it turns out to be too narrow.\n const modal = this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal=\"true\"]');\n if (!modal) {\n // Most commonly, the autocomplete trigger is not inside a modal.\n return;\n }\n const panelId = this.autocomplete.id;\n if (this._trackedModal) {\n removeAriaReferencedId(this._trackedModal, 'aria-owns', panelId);\n }\n addAriaReferencedId(modal, 'aria-owns', panelId);\n this._trackedModal = modal;\n }\n /** Clears the references to the listbox overlay element from the modal it was added to. */\n _clearFromModal() {\n if (this._trackedModal) {\n const panelId = this.autocomplete.id;\n removeAriaReferencedId(this._trackedModal, 'aria-owns', panelId);\n this._trackedModal = null;\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocompleteTrigger, deps: [{ token: i0.ElementRef }, { token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: MAT_AUTOCOMPLETE_SCROLL_STRATEGY }, { token: i2.Directionality, optional: true }, { token: MAT_FORM_FIELD, host: true, optional: true }, { token: DOCUMENT, optional: true }, { token: i3.ViewportRuler }, { token: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"16.1.0\", version: \"17.2.0\", type: MatAutocompleteTrigger, isStandalone: true, selector: \"input[matAutocomplete], textarea[matAutocomplete]\", inputs: { autocomplete: [\"matAutocomplete\", \"autocomplete\"], position: [\"matAutocompletePosition\", \"position\"], connectedTo: [\"matAutocompleteConnectedTo\", \"connectedTo\"], autocompleteAttribute: [\"autocomplete\", \"autocompleteAttribute\"], autocompleteDisabled: [\"matAutocompleteDisabled\", \"autocompleteDisabled\", booleanAttribute] }, host: { listeners: { \"focusin\": \"_handleFocus()\", \"blur\": \"_onTouched()\", \"input\": \"_handleInput($event)\", \"keydown\": \"_handleKeydown($event)\", \"click\": \"_handleClick()\" }, properties: { \"attr.autocomplete\": \"autocompleteAttribute\", \"attr.role\": \"autocompleteDisabled ? null : \\\"combobox\\\"\", \"attr.aria-autocomplete\": \"autocompleteDisabled ? null : \\\"list\\\"\", \"attr.aria-activedescendant\": \"(panelOpen && activeOption) ? activeOption.id : null\", \"attr.aria-expanded\": \"autocompleteDisabled ? null : panelOpen.toString()\", \"attr.aria-controls\": \"(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id\", \"attr.aria-haspopup\": \"autocompleteDisabled ? null : \\\"listbox\\\"\" }, classAttribute: \"mat-mdc-autocomplete-trigger\" }, providers: [MAT_AUTOCOMPLETE_VALUE_ACCESSOR], exportAs: [\"matAutocompleteTrigger\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocompleteTrigger, decorators: [{\n type: Directive,\n args: [{\n selector: `input[matAutocomplete], textarea[matAutocomplete]`,\n host: {\n 'class': 'mat-mdc-autocomplete-trigger',\n '[attr.autocomplete]': 'autocompleteAttribute',\n '[attr.role]': 'autocompleteDisabled ? null : \"combobox\"',\n '[attr.aria-autocomplete]': 'autocompleteDisabled ? null : \"list\"',\n '[attr.aria-activedescendant]': '(panelOpen && activeOption) ? activeOption.id : null',\n '[attr.aria-expanded]': 'autocompleteDisabled ? null : panelOpen.toString()',\n '[attr.aria-controls]': '(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id',\n '[attr.aria-haspopup]': 'autocompleteDisabled ? null : \"listbox\"',\n // Note: we use `focusin`, as opposed to `focus`, in order to open the panel\n // a little earlier. This avoids issues where IE delays the focusing of the input.\n '(focusin)': '_handleFocus()',\n '(blur)': '_onTouched()',\n '(input)': '_handleInput($event)',\n '(keydown)': '_handleKeydown($event)',\n '(click)': '_handleClick()',\n },\n exportAs: 'matAutocompleteTrigger',\n providers: [MAT_AUTOCOMPLETE_VALUE_ACCESSOR],\n standalone: true,\n }]\n }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{\n type: Inject,\n args: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY]\n }] }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }, { type: i4.MatFormField, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_FORM_FIELD]\n }, {\n type: Host\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i3.ViewportRuler }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_AUTOCOMPLETE_DEFAULT_OPTIONS]\n }] }], propDecorators: { autocomplete: [{\n type: Input,\n args: ['matAutocomplete']\n }], position: [{\n type: Input,\n args: ['matAutocompletePosition']\n }], connectedTo: [{\n type: Input,\n args: ['matAutocompleteConnectedTo']\n }], autocompleteAttribute: [{\n type: Input,\n args: ['autocomplete']\n }], autocompleteDisabled: [{\n type: Input,\n args: [{ alias: 'matAutocompleteDisabled', transform: booleanAttribute }]\n }] } });\n\nclass MatAutocompleteModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocompleteModule, imports: [OverlayModule,\n MatOptionModule,\n MatCommonModule,\n CommonModule,\n MatAutocomplete,\n MatAutocompleteTrigger,\n MatAutocompleteOrigin], exports: [CdkScrollableModule,\n MatAutocomplete,\n MatOptionModule,\n MatCommonModule,\n MatAutocompleteTrigger,\n MatAutocompleteOrigin] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocompleteModule, providers: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [OverlayModule,\n MatOptionModule,\n MatCommonModule,\n CommonModule, CdkScrollableModule,\n MatOptionModule,\n MatCommonModule] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatAutocompleteModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [\n OverlayModule,\n MatOptionModule,\n MatCommonModule,\n CommonModule,\n MatAutocomplete,\n MatAutocompleteTrigger,\n MatAutocompleteOrigin,\n ],\n exports: [\n CdkScrollableModule,\n MatAutocomplete,\n MatOptionModule,\n MatCommonModule,\n MatAutocompleteTrigger,\n MatAutocompleteOrigin,\n ],\n providers: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_AUTOCOMPLETE_VALUE_ACCESSOR, MatAutocomplete, MatAutocompleteModule, MatAutocompleteOrigin, MatAutocompleteSelectedEvent, MatAutocompleteTrigger, getMatAutocompleteMissingPanelError };\n","import { Component, Input, OnInit } from '@angular/core'\nimport { FieldType, FieldTypeConfig } from '@ngx-formly/core'\nimport { selectOption } from 'src/types/wizard'\n\n@Component({\n selector: 'gwc-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrls: ['./checkbox.component.scss']\n})\n\nexport class CheckboxComponent extends FieldType {\n public label!: string\n\n ngOnInit(): void {\n this.label = this.props.label as string\n }\n\n // public selectOption(option: selectOption): void {\n // this.formControl.patchValue(option.value)\n // }\n}\n","\n\t\n\t\t{{ label }}\n\t \n \n","\n\t{{ props.label }} \n\t \n\t\n\t\t@if (filteredCommonlyUsed.length > 0) {\n\t\t\t\n\t\t\t\t@for (option of filteredCommonlyUsed(); track option) {\n\t\t\t\t\t\n\t\t\t\t\t\t{{ option.label }}\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t \n\t\t\t\n\t\t\t\t@for (option of filteredOptions(); track option) {\n\t\t\t\t\t\n\t\t\t\t\t\t{{ option.label }}\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t \n\t\t} @else {\n\t\t\t@for (option of filteredOptions(); track option) {\n\t\t\t\t\n\t\t\t\t\t{{ option.label }}\n\t\t\t\t \n\t\t\t}\n\t\t}\n\t \n\t\n\t\t@if (showError) {\n\t\t\t@if (formControl.hasError('required')) {\n\t\t\t\tThis field is required.\n\t\t\t}\n\t\t}\n\t \n \n\n","import { Component, ElementRef, signal, ViewChild, WritableSignal } from '@angular/core'\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms'\nimport { MatAutocompleteModule } from '@angular/material/autocomplete'\nimport { MatFormFieldModule } from '@angular/material/form-field'\nimport { MatInputModule } from '@angular/material/input'\nimport { FieldTypeConfig } from '@ngx-formly/core'\nimport { FieldType } from '@ngx-formly/material'\nimport { selectOption } from 'src/types/wizard'\n\n@Component({\n selector: 'gwc-autocomplete',\n templateUrl: './autocomplete.component.html',\n styleUrls: ['./autocomplete.component.scss'],\n standalone: true,\n imports: [\n FormsModule,\n MatAutocompleteModule,\n MatFormFieldModule,\n MatInputModule,\n ReactiveFormsModule\n ]\n})\n\nexport class AutocompleteComponent extends FieldType {\n @ViewChild('autocomplete_input') input!: ElementRef\n\n public filteredOptions: WritableSignal = signal([])\n public filteredCommonlyUsed: WritableSignal = signal([])\n private select_options: WritableSignal = signal([])\n\n ngOnInit(): void {\n this.resetFilteredOptions()\n this.required\n }\n\n public resetFilteredOptions() {\n const all_options = this.props.options as selectOption[] || []\n if (this.props['filter']) {\n this.select_options.set(all_options.filter(option => this.props['filter'].includes(option.value)))\n } else {\n this.select_options.set(all_options)\n }\n \n this.filteredOptions.set(this.select_options())\n this.filteredCommonlyUsed.set(this.props['commonly_used'] || [])\n }\n\n public displayFunction = (value: string): string => {\n if (this.select_options) {\n const filtered = this.select_options().filter(options => options.value === value)\n\n return filtered[0]?.label || ''\n }\n \n return ''\n }\n\n public filterOptions(): void {\n if (this.input) {\n const filterValue = this.input.nativeElement.value.toLowerCase()\n this.filteredOptions.set(this.select_options().filter(option => option.label.toLowerCase().startsWith(filterValue)))\n\n if (this.props['commonly_used']) {\n if (filterValue) {\n this.filteredCommonlyUsed.set([])\n } else {\n this.filteredCommonlyUsed.set(this.props['commonly_used'])\n }\n }\n }\n }\n}\n","import { FormlyFieldConfig } from \"@ngx-formly/core\"\nimport { selectOption } from \"src/types/wizard\"\nimport * as _ from 'lodash'\n\nexport const COUNTRY_OPTIONS: selectOption[] = [\n {\n label: \"Afghanistan\",\n value: \"AF\"\n },\n {\n label: \"Albania\",\n value: \"AL\"\n },\n {\n label: \"Algeria\",\n value: \"DZ\"\n },\n {\n label: \"Andorra\",\n value: \"AD\"\n },\n {\n label: \"Angola\",\n value: \"AO\"\n },\n {\n label: \"Anguilla\",\n value: \"AI\"\n },\n {\n label: \"Antigua and Barbuda\",\n value: \"AG\"\n },\n {\n label: \"Argentina\",\n value: \"AR\"\n },\n {\n label: \"Armenia\",\n value: \"AM\"\n },\n {\n label: \"Aruba\",\n value: \"AW\"\n },\n {\n label: \"Australia\",\n value: \"AU\"\n },\n {\n label: \"Austria\",\n value: \"AT\"\n },\n {\n label: \"Azerbaijan\",\n value: \"AZ\"\n },\n {\n label: \"Bahamas\",\n value: \"BS\"\n },\n {\n label: \"Bahrain\",\n value: \"BH\"\n },\n {\n label: \"Bangladesh\",\n value: \"BD\"\n },\n {\n label: \"Barbados\",\n value: \"BB\"\n },\n {\n label: \"Belarus\",\n value: \"BY\"\n },\n {\n label: \"Belgium\",\n value: \"BE\"\n },\n {\n label: \"Belize\",\n value: \"BZ\"\n },\n {\n label: \"Benin\",\n value: \"BJ\"\n },\n {\n label: \"Bermuda\",\n value: \"BM\"\n },\n {\n label: \"Bhutan\",\n value: \"BT\"\n },\n {\n label: \"Bolivia\",\n value: \"BO\"\n },\n {\n label: \"Bosnia Herzegovina\",\n value: \"BA\"\n },\n {\n label: \"Botswana\",\n value: \"BW\"\n },\n {\n label: \"Brazil\",\n value: \"BR\"\n },\n {\n label: \"Brunei\",\n value: \"BN\"\n },\n {\n label: \"Bulgaria\",\n value: \"BG\"\n },\n {\n label: \"Burkina Faso\",\n value: \"BF\"\n },\n {\n label: \"Burundi\",\n value: \"BI\"\n },\n {\n label: \"Cambodia\",\n value: \"KH\"\n },\n {\n label: \"Cameroon\",\n value: \"CM\"\n },\n {\n label: \"Canada\",\n value: \"CA\"\n },\n {\n label: \"Cape Verde\",\n value: \"CV\"\n },\n {\n label: \"Cayman Islands\",\n value: \"KY\"\n },\n {\n label: \"Central African Republic\",\n value: \"CF\"\n },\n {\n label: \"Chad\",\n value: \"TD\"\n },\n {\n label: \"Chile\",\n value: \"CL\"\n },\n {\n label: \"China\",\n value: \"CN\"\n },\n {\n label: \"Colombia\",\n value: \"CO\"\n },\n {\n label: \"Comores Islands\",\n value: \"KM\"\n },\n {\n label: \"Congo[Brazzaville]\",\n value: \"CG\"\n },\n {\n label: \"Congo[Kinshasa]\",\n value: \"CD\"\n },\n {\n label: \"Cook Islands\",\n value: \"CK\"\n },\n {\n label: \"Costa Rica\",\n value: \"CR\"\n },\n {\n label: \"Cote dIvoire\",\n value: \"CI\"\n },\n {\n label: \"Croatia\",\n value: \"HR\"\n },\n {\n label: \"Cuba\",\n value: \"CU\"\n },\n {\n label: \"Cyprus\",\n value: \"CY\"\n },\n {\n label: \"Czech Republic\",\n value: \"CZ\"\n },\n {\n label: \"Denmark\",\n value: \"DK\"\n },\n {\n label: \"Djibouti\",\n value: \"DJ\"\n },\n {\n label: \"Dominica\",\n value: \"DM\"\n },\n {\n label: \"Dominican Republic\",\n value: \"DO\"\n },\n {\n label: \"Eswatini [Swaziland]\",\n value: \"SZ\"\n },\n {\n label: \"Ecuador\",\n value: \"EC\"\n },\n {\n label: \"Egypt\",\n value: \"EG\"\n },\n {\n label: \"El Salvador\",\n value: \"SV\"\n },\n {\n label: \"Equatorial Guinea\",\n value: \"GQ\"\n },\n {\n label: \"Eritrea\",\n value: \"ER\"\n },\n {\n label: \"Estonia\",\n value: \"EE\"\n },\n {\n label: \"Ethiopia\",\n value: \"ET\"\n },\n {\n label: \"Faroe Islands\",\n value: \"FO\"\n },\n {\n label: \"Fiji\",\n value: \"FJ\"\n },\n {\n label: \"Finland\",\n value: \"FI\"\n },\n {\n label: \"France\",\n value: \"FR\"\n },\n {\n label: \"French Guiana\",\n value: \"GF\"\n },\n {\n label: \"French Polynesia\",\n value: \"PF\"\n },\n {\n label: \"French West Indies\",\n value: \"GP\"\n },\n {\n label: \"North Macedonia\",\n value: \"MK\"\n },\n {\n label: \"Gabon\",\n value: \"GA\"\n },\n {\n label: \"Gambia\",\n value: \"GM\"\n },\n {\n label: \"Georgia\",\n value: \"GE\"\n },\n {\n label: \"Germany\",\n value: \"DE\"\n },\n {\n label: \"Ghana\",\n value: \"GH\"\n },\n {\n label: \"Gibraltar\",\n value: \"GI\"\n },\n {\n label: \"Greece\",\n value: \"GR\"\n },\n {\n label: \"Greenland\",\n value: \"GL\"\n },\n {\n label: \"Grenada\",\n value: \"GD\"\n },\n {\n label: \"Guam\",\n value: \"GU\"\n },\n {\n label: \"Guatemala\",\n value: \"GT\"\n },\n {\n label: \"Guinea\",\n value: \"GN\"\n },\n {\n label: \"Guinea-Bissau\",\n value: \"GW\"\n },\n {\n label: \"Guyana\",\n value: \"GY\"\n },\n {\n label: \"Haiti\",\n value: \"HT\"\n },\n {\n label: \"Honduras\",\n value: \"HN\"\n },\n {\n label: \"Hong Kong [SAR China]\",\n value: \"HK\"\n },\n {\n label: \"Hungary\",\n value: \"HU\"\n },\n {\n label: \"Iceland\",\n value: \"IS\"\n },\n {\n label: \"India\",\n value: \"IN\"\n },\n {\n label: \"Indonesia\",\n value: \"ID\"\n },\n {\n label: \"Iran\",\n value: \"IR\"\n },\n {\n label: \"Iraq\",\n value: \"IQ\"\n },\n {\n label: \"Ireland\",\n value: \"IE\"\n },\n {\n label: \"Israel\",\n value: \"IL\"\n },\n {\n label: \"Italy\",\n value: \"IT\"\n },\n {\n label: \"Jamaica\",\n value: \"JM\"\n },\n {\n label: \"Japan\",\n value: \"JP\"\n },\n {\n label: \"Jordan\",\n value: \"JO\"\n },\n {\n label: \"Kazakhstan\",\n value: \"KZ\"\n },\n {\n label: \"Kenya\",\n value: \"KE\"\n },\n {\n label: \"Kiribati\",\n value: \"KI\"\n },\n {\n label: \"North Korea[Peoples Rep.]\",\n value: \"KP\"\n },\n {\n label: \"South Korea[Rep.]\",\n value: \"KR\"\n },\n {\n label: \"Kuwait\",\n value: \"KW\"\n },\n {\n label: \"Kyrgyzstan\",\n value: \"KG\"\n },\n {\n label: \"Laos\",\n value: \"LA\"\n },\n {\n label: \"Latvia\",\n value: \"LV\"\n },\n {\n label: \"Lebanon\",\n value: \"LB\"\n },\n {\n label: \"Lesotho\",\n value: \"LS\"\n },\n {\n label: \"Liberia\",\n value: \"LR\"\n },\n {\n label: \"Libya\",\n value: \"LY\"\n },\n {\n label: \"Liechtenstein\",\n value: \"LI\"\n },\n {\n label: \"Lithuania\",\n value: \"LT\"\n },\n {\n label: \"Luxembourg\",\n value: \"LU\"\n },\n {\n label: \"Macao [SAR China]\",\n value: \"MO\"\n },\n {\n label: \"Madagascar\",\n value: \"MG\"\n },\n {\n label: \"Malawi\",\n value: \"MW\"\n },\n {\n label: \"Malaysia\",\n value: \"MY\"\n },\n {\n label: \"Maldives\",\n value: \"MV\"\n },\n {\n label: \"Mali\",\n value: \"ML\"\n },\n {\n label: \"Malta\",\n value: \"MT\"\n },\n {\n label: \"Marshall Islands\",\n value: \"MH\"\n },\n {\n label: \"Mauritania\",\n value: \"MR\"\n },\n {\n label: \"Mauritius\",\n value: \"MU\"\n },\n {\n label: \"Mayotte\",\n value: \"YT\"\n },\n {\n label: \"Mexico\",\n value: \"MX\"\n },\n {\n label: \"Micronesia \",\n value: \"FM\"\n },\n {\n label: \"Moldova\",\n value: \"MD\"\n },\n {\n label: \"Monaco\",\n value: \"MC\"\n },\n {\n label: \"Mongolia\",\n value: \"MN\"\n },\n {\n label: \"Montserrat\",\n value: \"MS\"\n },\n {\n label: \"Morocco\",\n value: \"MA\"\n },\n {\n label: \"Mozambique\",\n value: \"MZ\"\n },\n {\n label: \"Myanmar\",\n value: \"MM\"\n },\n {\n label: \"Namibia\",\n value: \"NA\"\n },\n {\n label: \"Nauru\",\n value: \"NR\"\n },\n {\n label: \"Nepal\",\n value: \"NP\"\n },\n {\n label: \"Netherlands Antilles\",\n value: \"AN\"\n },\n {\n label: \"Netherlands\",\n value: \"NL\"\n },\n {\n label: \"New Caledonia\",\n value: \"NC\"\n },\n {\n label: \"New Zealand\",\n value: \"NZ\"\n },\n {\n label: \"Nicaragua\",\n value: \"NI\"\n },\n {\n label: \"Niger\",\n value: \"NE\"\n },\n {\n label: \"Nigeria\",\n value: \"NG\"\n },\n {\n label: \"Niue\",\n value: \"NU\"\n },\n {\n label: \"Norfolk Island\",\n value: \"NF\"\n },\n {\n label: \"Northern Mariana Isl.\",\n value: \"MP\"\n },\n {\n label: \"Norway\",\n value: \"NO\"\n },\n {\n label: \"Oman\",\n value: \"OM\"\n },\n {\n label: \"Pakistan\",\n value: \"PK\"\n },\n {\n label: \"Palau Islands\",\n value: \"PW\"\n },\n {\n label: \"Panama\",\n value: \"PA\"\n },\n {\n label: \"Papua New Guinea\",\n value: \"PG\"\n },\n {\n label: \"Paraguay\",\n value: \"PY\"\n },\n {\n label: \"Peru\",\n value: \"PE\"\n },\n {\n label: \"Philippines\",\n value: \"PH\"\n },\n {\n label: \"Poland\",\n value: \"PL\"\n },\n {\n label: \"Portugal\",\n value: \"PT\"\n },\n {\n label: \"Puerto Rico\",\n value: \"PR\"\n },\n {\n label: \"Qatar\",\n value: \"QA\"\n },\n {\n label: \"Reunion\",\n value: \"RE\"\n },\n {\n label: \"Romania\",\n value: \"RO\"\n },\n {\n label: \"Russia\",\n value: \"RU\"\n },\n {\n label: \"Rwanda\",\n value: \"RW\"\n },\n {\n label: \"Samoa[American]\",\n value: \"AS\"\n },\n {\n label: \"Samoa\",\n value: \"WS\"\n },\n {\n label: \"San Marino\",\n value: \"SM\"\n },\n {\n label: \"Sao Tome & Principe\",\n value: \"ST\"\n },\n {\n label: \"Saudi Arabia\",\n value: \"SA\"\n },\n {\n label: \"Senegal\",\n value: \"SN\"\n },\n {\n label: \"Serbia\",\n value: \"RS\"\n },\n {\n label: \"Seychelles\",\n value: \"SC\"\n },\n {\n label: \"Sierra Leone\",\n value: \"SL\"\n },\n {\n label: \"Singapore\",\n value: \"SG\"\n },\n {\n label: \"Slovak Republic\",\n value: \"SK\"\n },\n {\n label: \"Slovenia\",\n value: \"SI\"\n },\n {\n label: \"Solomon Islands\",\n value: \"SB\"\n },\n {\n label: \"Somalia\",\n value: \"SO\"\n },\n {\n label: \"South Africa\",\n value: \"ZA\"\n },\n {\n label: \"Spain\",\n value: \"ES\"\n },\n {\n label: \"Sri Lanka\",\n value: \"LK\"\n },\n {\n label: \"St.Kitts-Nevis\",\n value: \"KN\"\n },\n {\n label: \"St.Lucia\",\n value: \"LC\"\n },\n {\n label: \"St.Vincent & Grenadines\",\n value: \"VC\"\n },\n {\n label: \"Sudan\",\n value: \"SD\"\n },\n {\n label: \"Montenegro\",\n value: \"ME\"\n },\n {\n label: \"Suriname\",\n value: \"SR\"\n },\n {\n label: \"South Sudan\",\n value: \"SS\"\n },\n {\n label: \"Sweden\",\n value: \"SE\"\n },\n {\n label: \"Switzerland\",\n value: \"CH\"\n },\n {\n label: \"Syria\",\n value: \"SY\"\n },\n {\n label: \"Taiwan[Rep. of China]\",\n value: \"TW\"\n },\n {\n label: \"Tajikistan\",\n value: \"TJ\"\n },\n {\n label: \"Tanzania\",\n value: \"TZ\"\n },\n {\n label: \"Thailand\",\n value: \"TH\"\n },\n {\n label: \"Timor Leste\",\n value: \"TL\"\n },\n {\n label: \"Togo\",\n value: \"TG\"\n },\n {\n label: \"Tonga\",\n value: \"TO\"\n },\n {\n label: \"Trinidad & Tobago\",\n value: \"TT\"\n },\n {\n label: \"Tunisia\",\n value: \"TN\"\n },\n {\n label: \"Turkey\",\n value: \"TR\"\n },\n {\n label: \"Turkmenistan\",\n value: \"TM\"\n },\n {\n label: \"Turks & Caicos Isl.\",\n value: \"TC\"\n },\n {\n label: \"Tuvalu\",\n value: \"TV\"\n },\n {\n label: \"Uganda\",\n value: \"UG\"\n },\n {\n label: \"Ukraine\",\n value: \"UA\"\n },\n {\n label: \"United Arab Emirates\",\n value: \"AE\"\n },\n {\n label: \"United Kingdom\",\n value: \"GB\"\n },\n {\n label: \"United States\",\n value: \"US\"\n },\n {\n label: \"Uruguay\",\n value: \"UY\"\n },\n {\n label: \"Uzbekistan\",\n value: \"UZ\"\n },\n {\n label: \"Vanuatu\",\n value: \"VU\"\n },\n {\n label: \"Vatican\",\n value: \"VA\"\n },\n {\n label: \"Venezuela\",\n value: \"VE\"\n },\n {\n label: \"Vietnam\",\n value: \"VN\"\n },\n {\n label: \"Virgin Islands [U.S.A.]\",\n value: \"VI\"\n },\n {\n label: \"Virgin Islands [British]\",\n value: \"VG\"\n },\n {\n label: \"Yemen\",\n value: \"YE\"\n },\n {\n label: \"Zambia\",\n value: \"ZM\"\n },\n {\n label: \"Zimbabwe\",\n value: \"ZW\"\n },\n {\n label: \"Curacao\",\n value: \"CW\"\n },\n {\n label: \"Sint Maarten\",\n value: \"SX\"\n },\n {\n label: \"Saint Maarten\",\n value: \"MF\"\n }\n]\n\nexport const STATE_PROVINCE_LIST = {\n \"US\": [\n {\n label: \"Alaska\",\n value: \"AK\"\n },\n {\n label: \"Alabama\",\n value: \"AL\"\n },\n {\n label: \"Arkansas\",\n value: \"AR\"\n },\n {\n label: \"American Samoa\",\n value: \"ASM\"\n },\n {\n label: \"Arizona\",\n value: \"AZ\"\n },\n {\n label: \"California\",\n value: \"CA\"\n },\n {\n label: \"Colorado\",\n value: \"CO\"\n },\n {\n label: \"Connecticut\",\n value: \"CT\"\n },\n {\n label: \"District of Columbia\",\n value: \"DC\"\n },\n {\n label: \"Delaware\",\n value: \"DE\"\n },\n {\n label: \"Florida\",\n value: \"FL\"\n },\n {\n label: \"Georgia\",\n value: \"GA\"\n },\n {\n label: \"Guam\",\n value: \"GUM\"\n },\n {\n label: \"Hawaii\",\n value: \"HI\"\n },\n {\n label: \"Iowa\",\n value: \"IA\"\n },\n {\n label: \"Idaho\",\n value: \"ID\"\n },\n {\n label: \"Illinois\",\n value: \"IL\"\n },\n {\n label: \"Indiana\",\n value: \"IN\"\n },\n {\n label: \"Kansas\",\n value: \"KS\"\n },\n {\n label: \"Kentucky\",\n value: \"KY\"\n },\n {\n label: \"Louisiana\",\n value: \"LA\"\n },\n {\n label: \"Massachusetts\",\n value: \"MA\"\n },\n {\n label: \"Maryland\",\n value: \"MD\"\n },\n {\n label: \"Maine\",\n value: \"ME\"\n },\n {\n label: \"Michigan\",\n value: \"MI\"\n },\n {\n label: \"Minnesota\",\n value: \"MN\"\n },\n {\n label: \"North Mariana Islands\",\n value: \"MNP\"\n },\n {\n label: \"Missouri\",\n value: \"MO\"\n },\n {\n label: \"Mississippi\",\n value: \"MS\"\n },\n {\n label: \"Montana\",\n value: \"MT\"\n },\n {\n label: \"North Carolina\",\n value: \"NC\"\n },\n {\n label: \"North Dakota\",\n value: \"ND\"\n },\n {\n label: \"Nebraska\",\n value: \"NE\"\n },\n {\n label: \"New Hampshire\",\n value: \"NH\"\n },\n {\n label: \"New Jersey\",\n value: \"NJ\"\n },\n {\n label: \"New Mexico\",\n value: \"NM\"\n },\n {\n label: \"Nevada\",\n value: \"NV\"\n },\n {\n label: \"New York\",\n value: \"NY\"\n },\n {\n label: \"Ohio\",\n value: \"OH\"\n },\n {\n label: \"Oklahoma\",\n value: \"OK\"\n },\n {\n label: \"Oregon\",\n value: \"OR\"\n },\n {\n label: \"Pennsylvania\",\n value: \"PA\"\n },\n {\n label: \"Puerto Rico\",\n value: \"PRI\"\n },\n {\n label: \"Rhode Island\",\n value: \"RI\"\n },\n {\n label: \"South Carolina\",\n value: \"SC\"\n },\n {\n label: \"South Dakota\",\n value: \"SD\"\n },\n {\n label: \"Tennessee\",\n value: \"TN\"\n },\n {\n label: \"Texas\",\n value: \"TX\"\n },\n {\n label: \"Utah\",\n value: \"UT\"\n },\n {\n label: \"Virginia\",\n value: \"VA\"\n },\n {\n label: \"U.S. Virgin Islands\",\n value: \"VIR\"\n },\n {\n label: \"Vermont\",\n value: \"VT\"\n },\n {\n label: \"Washington\",\n value: \"WA\"\n },\n {\n label: \"Wisconsin\",\n value: \"WI\"\n },\n {\n label: \"West Virginia\",\n value: \"WV\"\n },\n {\n label: \"Wyoming\",\n value: \"WY\"\n },\n {\n label: \"Midway Islands\",\n value: \"XMI\"\n }\n ],\n \"CA\": [\n {\n label: \"Alberta\",\n value: \"AB\"\n },\n {\n label: \"British Columbia\",\n value: \"BC\"\n },\n {\n label: \"Manitoba\",\n value: \"MB\"\n },\n {\n label: \"New Brunswick\",\n value: \"NB\"\n },\n {\n label: \"New Foundland and Labrador\",\n value: \"NL\"\n },\n {\n label: \"Northwest Territories\",\n value: \"NT\"\n },\n {\n label: \"Nova Scotia\",\n value: \"NS\"\n },\n {\n label: \"Nunavut\",\n value: \"NU\"\n },\n {\n label: \"Ontario\",\n value: \"ON\"\n },\n {\n label: \"Prince Edward Island\",\n value: \"PE\"\n },\n {\n label: \"Quebec\",\n value: \"QC\"\n },\n {\n label: \"Saskatchewan\",\n value: \"SK\"\n },\n {\n label: \"Yukon\",\n value: \"YT\"\n }\n ]\n}\n\nconst ADDRESS_NUMBER_FIELD = {\n key: \"number\",\n type: \"input\",\n props: {\n label: \"Number\",\n maxLength: 5,\n pattern: \"^[ \\\\-a-zA-Z0-9]*$\",\n required: true\n },\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--small\",\n validators: {\n validation: [\n \"pobox\"\n ]\n },\n expressions: {\n 'hide': (field: FormlyFieldConfig) => {\n const parent = field.parent?.parent\n const country = parent ? parent?.model?.country || parent.parent?.props?.['country'] : null\n \n return country === 'US'\n },\n }\n}\n\nconst ADDRESS_STREET_FIELD = {\n key: \"street\",\n type: \"input\",\n props: {\n label: \"Address Street\",\n maxLength: 30,\n required: true\n },\n className: \"gwc-form__field gwc-form__field--grow\",\n validators: {\n validation: [\"pobox\"]\n },\n expressions: {\n 'hide': (field: FormlyFieldConfig) => {\n const parent = field.parent?.parent\n const country = parent ? parent?.model?.country || parent.parent?.props?.['country'] : null\n \n return country === 'US'\n },\n }\n}\n\nconst ADDRESS_STREET_1_FIELD = {\n key: \"address_1\",\n type: \"input\",\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--no-max\",\n expressions: {\n 'hide': (field: FormlyFieldConfig) => {\n const parent = field.parent?.parent\n const country = parent ? parent?.model?.country || parent.parent?.props?.['country'] : null\n \n return country !== 'US'\n },\n }\n}\n\nconst ADDRESS_STREET_2_FIELD = {\n key: \"address_2\",\n type: \"input\",\n props: {\n label: \"Apt\",\n required: false,\n maxLength: 5\n },\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--small\",\n validators: {\n validation: [\"pobox\"]\n }\n}\n\nconst ADDRESS_CITY_FIELD = {\n key: \"city\",\n type: \"name-field\",\n props: {\n label: \"City\",\n maxLength: 30,\n required: true\n },\n className: \"gwc-form__field gwc-form__field--grow\"\n}\n\nconst ADDRESS_STATE_FIELD = {\n key: \"state\",\n type: \"autocomplete\",\n props: {\n required: true,\n mappedOptions: STATE_PROVINCE_LIST,\n },\n expressions: {\n 'props.label': (field: FormlyFieldConfig) => {\n const parent = field.parent?.parent\n const country = parent ? parent?.model?.country || parent.parent?.props?.['country'] : null\n \n return country === 'US' ? 'State' : 'Province'\n },\n 'props.options': (field: FormlyFieldConfig) => {\n const parent = field.parent?.parent\n const country = parent ? parent?.model?.country || parent.parent?.props?.['country'] : null\n\n return field.props?.['mappedOptions'][country]\n },\n 'hide': (field: FormlyFieldConfig) => {\n const parent = field.parent?.parent\n const country = parent ? parent?.model?.country || parent.parent?.props?.['country'] : null\n\n return !(country && field.props?.['mappedOptions'][country])\n }\n },\n className: \"gwc-form__field gwc-form__field--grow\"\n}\n\nconst ADDRESS_ZIP_FIELD = {\n key: \"zip\",\n type: \"input\",\n props: {\n label: \"Zip\",\n required: true\n },\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--small\",\n expressions: {\n 'props.pattern': (field: FormlyFieldConfig) => {\n const country = field.formControl?.parent?.get('country')?.value || field.model?.country || field.parent?.parent?.parent?.props?.['country']\n\n return country === 'US' ? '[0-9]{5}' : '[ABCEGHJKLMNPRSTVXY]\\\\d[ABCEGHJKLMNPRSTVWXYZ] \\\\d[ABCEGHJKLMNPRSTVWXYZ]\\\\d'\n },\n 'props.maxLength': (field: FormlyFieldConfig) => {\n const country = field.formControl?.parent?.get('country')?.value || field.model?.country\n\n return country === 'US' ? 5 : 7\n },\n }\n}\n\nexport const ADDRESS_AUTOCOMPLETE: FormlyFieldConfig[] = [\n {\n key: \"place_id\",\n className: \"gwc-form__field--hidden\",\n type: \"input\"\n },\n {\n key: \"address_line\",\n type: \"google-address\",\n props: {\n required: true\n },\n expressions: {\n 'className': (field: FormlyFieldConfig) => {\n const place_id = field.formControl?.parent?.get('place_id')?.value || null\n\n return place_id ? 'gwc-form__field--hidden' : 'gwc-form__field gwc-form__field--grow'\n },\n 'props.country': (field: FormlyFieldConfig) => {\n const country = field.formControl?.parent?.get('country')?.value || field.parent?.props?.['country'] || ''\n\n return country\n }\n }\n },\n {\n fieldGroup: [\n {\n fieldGroup: [\n ADDRESS_NUMBER_FIELD,\n ADDRESS_STREET_FIELD,\n ADDRESS_STREET_1_FIELD,\n ADDRESS_STREET_2_FIELD\n ],\n fieldGroupClassName: \"gwc-form__field-group\"\n },\n {\n fieldGroup: [\n ADDRESS_CITY_FIELD,\n ADDRESS_STATE_FIELD,\n ADDRESS_ZIP_FIELD\n ],\n fieldGroupClassName: \"gwc-form__field-group\"\n },\n ],\n expressions: {\n 'fieldGroupClassName': (field: FormlyFieldConfig) => {\n const place_id = field.formControl?.get('place_id')?.value\n\n return place_id ? '': 'gwc-form__field-group--hidden'\n }\n }\n }\n]\n\nexport const ADDRESS_COUNTRY_AUTOCOMPLETE = [\n {\n key: \"country\",\n type: \"country-autocomplete\",\n className: \"gwc-form__field gwc-form__field--tight\"\n },\n {\n type: \"address-autocomplete\"\n }\n]\n\nexport const PLAIN_ADDRESS = [\n {\n fieldGroup: [\n {\n fieldGroup: [\n {\n key: \"address_1\",\n type: \"input\",\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--no-max\",\n props: {\n label: \"Address\",\n required: true\n },\n },\n {\n key: \"address_2\",\n type: \"input\",\n props: {\n label: \"Apt\",\n required: false\n },\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--small\"\n },\n ],\n fieldGroupClassName: \"gwc-form__field-group\"\n },\n {\n fieldGroup: [\n ADDRESS_CITY_FIELD,\n ADDRESS_STATE_FIELD,\n ADDRESS_ZIP_FIELD\n ],\n fieldGroupClassName: \"gwc-form__field-group\"\n }\n ],\n expressions: {\n 'hide': (field: FormlyFieldConfig) => {\n const military_address = field.formControl?.get('military_address')?.value\n\n return military_address\n }\n }\n },\n {\n fieldGroup: [\n {\n fieldGroup: [\n {\n key: \"address_1\",\n type: \"input\",\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--no-max\",\n props: {\n label: \"Address\",\n required: true\n },\n },\n ],\n fieldGroupClassName: \"gwc-form__field-group\"\n },\n {\n fieldGroup: [\n {\n key: \"location_type\",\n type: \"select\",\n props: {\n label: \"Location Type\",\n options: [\n { label: 'Army Post Office', value: 'APO' },\n { label: 'Diplomatic Post Office', value: 'DPO' },\n { label: 'Fleet Post Office', value: 'FPO' }\n ],\n required: true\n },\n className: \"gwc-form__field gwc-form__field--grow\"\n },\n {\n key: \"base_location\",\n type: \"select\",\n props: {\n label: \"Base Location\",\n options: [\n { label: 'Pacific', value: 'pacific' },\n { label: 'Europe', value: 'europe' },\n { label: 'Middle East', value: 'middle_east' },\n { label: 'Canada', value: 'canada' },\n { label: 'Africa', value: 'africa' },\n { label: 'Americas', value: 'americas' }\n ],\n required: true\n },\n className: \"gwc-form__field gwc-form__field--grow\"\n },\n ADDRESS_ZIP_FIELD\n ],\n fieldGroupClassName: \"gwc-form__field-group\"\n },\n ],\n expressions: {\n 'hide': (field: FormlyFieldConfig) => {\n const military_address = field.formControl?.get('military_address')?.value\n\n return !military_address\n }\n }\n },\n {\n fieldGroup: [\n {\n \"key\": \"military_address\",\n \"type\": \"gwa-checkbox\",\n \"props\": {\n \"label\": \"Military Address\",\n \"required\": false\n }\n },\n ]\n }\n]\n","import { FormlyFieldConfig } from \"@ngx-formly/core\"\nimport { DateExpression } from \"src/types/wizard\"\nimport { DateTime, DurationLike } from 'luxon'\nimport * as _ from 'lodash'\nimport { AbstractControl } from \"@angular/forms\"\n\nexport const FORM_TO_COMBO: FormlyFieldConfig[] = [\n\t{\n\t\tkey: \"from\",\n\t\ttype: \"datepicker\",\n\t\tprops: {\n\t\t\tview: \"multi-year\",\n\t\t\tlabel: \"From\",\n\t\t\trequired: true,\n\t\t\tbefore: [\n\t\t\t\t{\n\t\t\t\t\tparent: \"local\",\n\t\t\t\t\tkey: \"to\",\n\t\t\t\t\tmessage: \"Date can’t be after the to\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: \"now\",\n\t\t\t\t\tmessage: \"Date can’t be in the future\"\n\t\t\t\t}\n\t\t\t],\n\t\t\tafter: [\n\t\t\t\t{\n\t\t\t\t\tparent: \"global\",\n\t\t\t\t\tkey: \"date_of_birth\",\n\t\t\t\t\tmessage: \"Date can't be before Date of Birth\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tclassName: \"gwc-form__field gwc-form__field--grow\"\n\t},\n\t{\n\t\tkey: \"to\",\n\t\ttype: \"datepicker\",\n\t\tprops: {\n\t\t\tview: \"multi-year\",\n\t\t\tlabel: \"To\",\n\t\t\trequired: true,\n\t\t\tbefore: [\n\t\t\t\t{\n\t\t\t\t\tdate: \"now\",\n\t\t\t\t\tmessage: \"Date can’t be in the future\"\n\t\t\t\t}\n\t\t\t],\n\t\t\tafter: [\n\t\t\t\t{\n\t\t\t\t\tparent: \"local\",\n\t\t\t\t\tkey: \"from\",\n\t\t\t\t\tmessage: \"Date can’t be before the from\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tparent: \"global\",\n\t\t\t\t\tkey: \"date_of_birth\",\n\t\t\t\t\tmessage: \"Date can't be before Date of Birth\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\texpressions: {\n\t\t\t'hide': (field: FormlyFieldConfig) => {\n\t\t\t\tconst current = field.model?.current\n\t\t\t\t\n\t\t\t\treturn current ? true : false\n\t\t\t}\n\t\t},\n\t\tclassName: \"gwc-form__field gwc-form__field--grow\"\n\t},\n\t{\n\t\tkey: \"current\",\n\t\ttype: \"gwa-checkbox\",\n\t\tprops: {\n\t\t\tlabel: \"Current\",\n\t\t\trequired: false\n\t\t},\n\t\tclassName: \"gwc-form__field gwc-form__field--auto\"\n\t}\n]\n\nexport const buildDates = (field: FormlyFieldConfig, type: 'min'|'max'): DateTime | null => {\n\tconst conditions = field.props?.[type === 'max' ? 'before' : 'after']\n\n\tlet result: DateTime | null = null\n\n\tif (conditions) {\n\t\tlet root: FormlyFieldConfig | undefined = field.parent\n\t\n\t\twhile (root && root.parent) {\n\t\t\troot = root.parent\n\t\t}\n\t\n\t\tconst model = root?.model || field.model\n\t\n\t\tconditions.forEach((condition: DateExpression) => {\n\t\t\tlet compare_to: DateTime | null = null\n\n\t\t\tif (condition.date === 'now') {\n\t\t\t\tcompare_to = DateTime.now()\n\t\t\t} else if (condition.date) {\n\t\t\t\tcompare_to = DateTime.fromFormat(condition.date, 'MM/dd/yyyy')\n\t\t\t} else if (condition.key) {\n\t\t\t\tlet value: string | undefined\n\n\t\t\t\tif (condition.parent === 'local') {\n\t\t\t\t\tvalue = _.get(field.model, condition.key)\n\t\t\t\t} else {\n\t\t\t\t\tvalue = _.get(model, condition.key)\n\t\t\t\t}\n\n\t\t\t\tif (value) {\n\t\t\t\t\tcompare_to = DateTime.fromFormat(value, 'MM/dd/yyyy')\n\t\t\t\t}\n\t\t\t} else if (condition.operation) {\n\t\t\t\tconst param: DurationLike = {\n\t\t\t\t\tmonths: condition.months || 0,\n\t\t\t\t\tdays: condition.days || 0,\n\t\t\t\t\tyears: condition.years || 0\n\t\t\t\t}\n\n\t\t\t\tif (condition.operation === 'add') {\n\t\t\t\t\tcompare_to = DateTime.now().plus(param)\n\t\t\t\t} else if (condition.operation === 'subtract') {\n\t\t\t\t\tcompare_to = DateTime.now().minus(param)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (compare_to) {\n\t\t\t\tif (!result || (type === 'min' && result.toMillis() < compare_to.toMillis()) || (type === 'max' && result.toMillis() > compare_to.toMillis())) {\n\t\t\t\t\tresult = compare_to\n\n\t\t\t\t\t_.set(field, `validation.messages.${type}`, condition.message)\n\t\t\t\t\t_.set(field, `validators.${type}`, DateValidator(result, type))\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\treturn result\n}\n\nconst DateValidator = (baseDate: DateTime, type: 'min'|'max') => {\n\treturn (control: AbstractControl, field: FormlyFieldConfig): {[key: string]: any} | null => {\n\t\tif (!control.value || control.value.length < 10) {\n\t\t\treturn {'min': true}\n\t\t}\n\n\t\tconst controlDate = DateTime.fromFormat(control.value, 'MM/dd/yyyy')\n\n\t\tif (type === 'max') {\n\t\t\treturn controlDate.toMillis() >= baseDate.toMillis() ? null : {'max': true}\n\t\t}\n\n\t\treturn controlDate.toMillis() < baseDate.toMillis() ? null : {'min': true}\n\t}\n}\n","import { AbstractControl, ValidationErrors } from \"@angular/forms\"\nimport { FormlyFieldConfig } from \"@ngx-formly/core\"\nimport { DateTime } from \"luxon\"\n\nexport function POBoxboxValidator(control: AbstractControl): ValidationErrors {\n if (!control.value) return {}\n\n let check_string = control.value.toLowerCase().replaceAll('.', '').replaceAll(' ', '')\n return check_string.includes('pobox') ? {pobox: true} : {}\n}\n\nexport const decimalValidator = (control: AbstractControl): ValidationErrors => {\n if (!control.value) return {}\n\n let int_part = parseInt(control.value)\n\n return int_part !== control.value ? {decimal: true} : {}\n}\n\nexport const validDate = (control: AbstractControl, filed: FormlyFieldConfig) => {\n if (control.value && control.valid) {\n return DateTime.fromFormat(control.value, 'MM/dd/yyyy').isValid ? {} : { 'date': true }\n }\n \n return null\n}\n\nexport const futureValidator = (control: AbstractControl, filed: FormlyFieldConfig) => {\n if (control.value && control.valid) {\n return DateTime.fromFormat(control.value, 'MM/dd/yyyy').toMillis() < DateTime.now().toMillis() ? null : { future: true }\n }\n \n return null\n}\n\nexport const fromValidator = (control: AbstractControl, filed: FormlyFieldConfig) => {\n if (control.value && control.valid) {\n const toControl: AbstractControl | undefined | null = filed.formControl?.parent?.get('to')\n\n if (toControl?.valid) {\n const from = DateTime.fromFormat(control.value, 'MM/dd/yyyy').toMillis()\n const to = DateTime.fromFormat(toControl.value, 'MM/dd/yyyy').toMillis()\n\n return from > to ? { from: 'From date must be before To.' } : null\n }\n }\n \n return null\n}\n\nexport const toValidator = (control: AbstractControl, filed: FormlyFieldConfig) => {\n if (control.value && control.valid) {\n const fromControl: AbstractControl | undefined | null = filed.formControl?.parent?.get('from')\n\n if (fromControl?.valid) {\n const to = DateTime.fromFormat(control.value, 'MM/dd/yyyy').toMillis()\n const from = DateTime.fromFormat(fromControl.value, 'MM/dd/yyyy').toMillis()\n\n return from > to ? { from: 'To date must be after From.' } : null\n }\n }\n \n return null\n}\n","\n\tEnter Address \n\t \n\t\n\t\t@if (formControl.hasError('required')) {\n\t\t\tPlease enter a valid address.\n\t\t} @else if (formControl.hasError('selected')) {\n\t\t\tPlease choose an address from the list\n\t\t}\n\t \n \n\n@if (predictions.length > 0 && showPredictions) {\n\t\n\t\t
\n\t\t\t@for (prediction of predictions; track prediction) {\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t \n\t\t\t\t@if(!$last) {\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t}\n\t\t \n\t
\n}","import { ChangeDetectorRef, Component, ElementRef, HostListener, NgZone, ViewChild } from '@angular/core'\nimport { AbstractControl, FormGroup, ReactiveFormsModule } from '@angular/forms'\nimport { MatFormFieldModule } from '@angular/material/form-field'\nimport { MatIconModule, MatIconRegistry } from '@angular/material/icon'\nimport { MatInputModule } from '@angular/material/input'\nimport { MatListModule } from '@angular/material/list'\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser'\nimport { FieldTypeConfig } from '@ngx-formly/core'\nimport { FieldType } from '@ngx-formly/material'\nimport { debounceTime, distinctUntilChanged, Observable, of, switchMap } from 'rxjs'\nimport { Address } from 'src/types/address'\n\n@Component({\n selector: 'gwc-google-address',\n templateUrl: './google.address.component.html',\n styleUrls: ['./google.address.component.scss'],\n standalone: true,\n imports: [\n MatFormFieldModule,\n MatInputModule,\n ReactiveFormsModule,\n MatListModule,\n MatIconModule\n ]\n})\n\nexport class GoogleAddressComponent extends FieldType {\n @ViewChild('shippingAddressInput') shippingAddressInput!: ElementRef\n\n public previousValue: string = ''\n public predictions: google.maps.places.AutocompletePrediction[] = []\n public showPredictions: boolean = false\n\n @HostListener('document:click', ['$event.target'])\n public onClick(targetElement: HTMLElement): void {\n if (this.showPredictions) {\n const clickedInside = this.elementRef.nativeElement.contains(targetElement)\n if (!clickedInside) {\n this.showPredictions = false \n }\n }\n }\n\n constructor(\n private ngZone: NgZone,\n private cdr: ChangeDetectorRef,\n private matIconRegistry: MatIconRegistry,\n private domSanitizer: DomSanitizer,\n private elementRef: ElementRef\n ) {\n super()\n this.matIconRegistry.addSvgIcon('location',this.domSanitizer.bypassSecurityTrustResourceUrl('./assets/svg/location.svg'))\n }\n\n ngAfterViewInit(): void {\n this.getPlaceAutocompleteService()\n }\n\n private getPlaceAutocompleteService(): void {\n const country = this.props['country'] || this.field.model?.country\n const options = {\n componentRestrictions: { country: country },\n types: ['address']\n }\n const autocompleteService = new google.maps.places.AutocompleteService()\n\n this.formControl.valueChanges\n .pipe(\n debounceTime(400),\n distinctUntilChanged(),\n switchMap(inputValue => {\n this.showPredictions = true\n inputValue = inputValue.trim()\n if (inputValue.length > 0 && inputValue !== this.previousValue) {\n this.previousValue = inputValue\n return this.getPlacePredictions(inputValue, options, autocompleteService)\n } else {\n this.previousValue = inputValue\n return of([])\n }\n }))\n .subscribe((predictions: google.maps.places.AutocompletePrediction[]) => {\n this.ngZone.run(() => {\n this.predictions = predictions\n this.cdr.detectChanges()\n })\n })\n }\n\n private getPlacePredictions(inputValue: string, options: any, autocompleteService: google.maps.places.AutocompleteService): Observable {\n return new Observable(subscriber => {\n autocompleteService.getPlacePredictions(\n { input: inputValue, ...options },\n (predictions, status) => {\n if (status === google.maps.places.PlacesServiceStatus.OK && predictions) {\n subscriber.next(predictions)\n } else {\n subscriber.next([])\n }\n subscriber.complete()\n }\n )\n })\n }\n\n private updateAddressFields(prediction: google.maps.places.AutocompletePrediction): void {\n const placesService = new google.maps.places.PlacesService(this.shippingAddressInput.nativeElement)\n placesService.getDetails({ placeId: prediction.place_id }, (place, status) => {\n if (status === google.maps.places.PlacesServiceStatus.OK && place?.address_components) {\n let address: Address = {}\n place.address_components.forEach((component) => {\n if (component.types.includes('street_number')) {\n address.address_1 = component.short_name\n address.number = component.short_name\n } else if (component.types.includes('route')) {\n address.address_1 = `${address.address_1} ${component.short_name}`\n address.street = component.short_name\n } else if (component.types.includes('locality')) {\n address.city = component.short_name\n } else if (!address.city && component.types.includes('sublocality_level_1') && component.short_name.length > 1) {\n address.city = component.short_name\n } else if (!address.city && component.types.includes('administrative_area_level_3') && component.short_name.length > 1) {\n address.city = component.short_name\n } else if (!address.city && component.types.includes('administrative_area_level_2') && component.short_name.length > 1) {\n address.city = component.short_name\n } else if (!address.city && component.types.includes('neighborhood') && component.short_name.length > 1) {\n address.city = component.short_name\n } else if (component.types.includes('administrative_area_level_1')) {\n address.state = component.short_name \n } else if (component.types.includes('postal_code')) {\n address.zip = component.short_name\n }\n })\n const parentGroup = this.formControl.parent as FormGroup\n parentGroup.controls['place_id'].patchValue(place.place_id)\n parentGroup.patchValue(address)\n }\n })\n }\n\n public selectPrediction(prediction: google.maps.places.AutocompletePrediction): void {\n this.formControl.setValue(prediction.description)\n this.ngZone.run(() => {\n this.updateAddressFields(prediction)\n this.showPredictions = false\n this.cdr.detectChanges()\n })\n }\n\n public highlightMatch(text: string, query: string): SafeHtml {\n if (!query) {\n return this.domSanitizer.bypassSecurityTrustHtml(text)\n }\n const regex = new RegExp(`(${query})`, 'gi')\n const highlightedText = text.replace(regex, '$1 ')\n return this.domSanitizer.bypassSecurityTrustHtml(highlightedText)\n } \n\n public hidePredictions(): void {\n const parentGroup = this.formControl.parent as FormGroup\n\n if (!parentGroup.controls['place_id'].value) {\n this.formControl.setErrors({selected: true})\n }\n }\n}\n","import { FormlyFieldConfig } from \"@ngx-formly/core\"\n\nexport const EMPLOYMENT_HISTORY_ENTRY = [\n {\n key: \"type\",\n type: \"buttons\",\n props: {\n options: [\n {\n label: \"Employed\",\n value: \"employed\"\n },\n {\n label: \"School\",\n value: \"school\"\n },\n {\n label: \"Unemployed\",\n value: \"unemployed\"\n }\n ],\n required: true\n },\n className: \"gwc-form__field gwc-form__field--tight\"\n },\n {\n key: \"info\",\n fieldGroup: [\n {\n key: \"name\",\n type: \"input\",\n props: {\n label: \"Employer,School or other\",\n required: true\n },\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--tight\"\n },\n {\n key: \"field\",\n type: \"input\",\n props: {\n label: \"Field of Employment/Studies\",\n required: false\n },\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--tight\"\n }\n ],\n fieldGroupClassName: \"gwc-form__field-group\",\n expressions: {\n 'hide': (field: FormlyFieldConfig) => {\n return false\n }\n }\n },\n {\n fieldGroup: [\n {\n key: \"phone_number\",\n type: \"masked-input\",\n props: {\n mask: \"(000) 000-0000\",\n label: \"Phone Number\",\n required: true\n },\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--grow\"\n },\n {\n key: \"address.country\",\n type: \"country-autocomplete\",\n className: \"gwc-form__field gwc-form__field--grow gwc-form__field--tight\"\n }\n ],\n fieldGroupClassName: \"gwc-form__field-group\"\n },\n {\n key: \"address\",\n type: \"address-autocomplete\"\n },\n {\n type: \"from-to\"\n }\n]","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\n\nimport { OrderRoutingModule } from './order-routing.module'\nimport { OrderComponent } from './order.component'\nimport { FormComponent } from './traveler/form/form.component'\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms'\nimport { FormlyMaterialModule } from '@ngx-formly/material'\nimport { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core'\nimport { LayoutModule } from 'src/app/components/layout/layout.module'\nimport { TravelersComponent } from './order.layout/travelers/travelers.component'\nimport { ButtonSelectComponent } from './traveler/form/button.select/button.select.component'\nimport { DatepickerComponent } from './traveler/form/datepicker/datepicker.component'\nimport { MatDatepickerModule } from '@angular/material/datepicker'\nimport { NgxMaskPipe, NgxMaskDirective, provideNgxMask } from 'ngx-mask'\nimport { MultipleComponent } from './traveler/form/multiple/multiple.component'\nimport { MaskedInputComponent } from './traveler/form/masked.input/masked.input.component'\nimport { LocationService } from 'src/app/services/location.service'\nimport { StepperComponent } from './traveler/form/stepper/stepper.component'\nimport { ItineraryComponent } from './order.layout/itinerary/itinerary.component'\nimport { InvoicesComponent } from './order.layout/invoices/invoices.component'\nimport { FacilityFinderComponent } from './traveler/form/facility.finder/facility.finder.component'\nimport { SocialSecurityComponent } from './traveler/form/social.security/social.security.component'\nimport { GoogleMapsModule } from '@angular/google-maps'\nimport { PhonePipeModule } from 'src/pipes/phone.pipe/phone.pipe.module'\nimport { FilterPipeModule } from 'src/pipes/filter.pipe/filter.pipe.module'\nimport { MultiSelectComponent } from './traveler/form/multi-select/multi-select.component'\nimport { DownloadPacketModule } from 'src/app/dialogs/download.packet/download.packet.module'\nimport { SecureScanComponent } from './traveler/form/secure.scan/secure.scan.component'\nimport { ImageCropperModule } from 'ngx-image-cropper'\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner'\nimport { MatButtonModule } from '@angular/material/button'\nimport { MatFormFieldModule } from '@angular/material/form-field'\nimport { MatInputModule } from '@angular/material/input'\nimport { MatProgressBarModule } from '@angular/material/progress-bar'\nimport { MatCheckboxModule } from '@angular/material/checkbox'\nimport { MatAutocompleteModule } from '@angular/material/autocomplete'\nimport { MatSelectModule } from '@angular/material/select'\nimport { CheckboxComponent } from './traveler/form/checkbox/checkbox.component'\nimport { ShipDateComponent } from 'src/app/dialogs/ship.date/ship.date.component'\nimport { ButtonComponent } from 'src/app/components/button/button.component'\nimport { AutocompleteComponent } from './traveler/form/autocomplete/autocomplete.component'\nimport { ADDRESS_AUTOCOMPLETE, ADDRESS_COUNTRY_AUTOCOMPLETE,COUNTRY_OPTIONS, PLAIN_ADDRESS, STATE_PROVINCE_LIST } from 'src/data/address.form'\nimport { FORM_TO_COMBO, buildDates } from 'src/data/form'\nimport { POBoxboxValidator, decimalValidator, futureValidator, validDate } from 'src/data/validators'\nimport _ from 'lodash'\nimport { GoogleAddressComponent } from './traveler/form/google.address/google.address.component'\nimport { EMPLOYMENT_HISTORY_ENTRY } from 'src/data/employment.form'\nimport { QRCodeModule } from 'angularx-qrcode'\n\n@NgModule({\n declarations: [\n OrderComponent,\n FormComponent,\n TravelersComponent,\n ButtonSelectComponent,\n MultipleComponent,\n MaskedInputComponent,\n StepperComponent,\n ItineraryComponent,\n InvoicesComponent,\n FacilityFinderComponent,\n SocialSecurityComponent,\n MultiSelectComponent,\n SecureScanComponent,\n CheckboxComponent\n ],\n providers: [\n LocationService,\n provideNgxMask()\n ],\n imports: [\n CommonModule,\n FormlyMaterialModule,\n NgxMaskPipe, \n NgxMaskDirective,\n FormlyModule.forRoot({\n types: [\n {\n name: 'name-field', \n extends: 'input',\n defaultOptions: {\n props: {\n pattern: \"^[A-Za-z]+(?:[ \\\\-]?[A-Za-z']+)*$\",\n maxLength: 35\n },\n validation: {\n messages: {\n pattern: \"Please use only letters, spaces, dashes and apostrophes. No contiguous dashes/apostrophes.\"\n }\n }\n }\n },\n { name: 'buttons', component: ButtonSelectComponent },\n { name: 'datepicker', \n component: DatepickerComponent,\n defaultOptions: {\n expressions: {\n 'props.minDate': (field: FormlyFieldConfig) => {\n return buildDates(field, 'min')\n },\n 'props.maxDate': (field: FormlyFieldConfig) => {\n return buildDates(field, 'max')\n }\n },\n validators: {\n validation: ['valid-date']\n }\n }\n },\n { name: 'multiple', component: MultipleComponent },\n { name: 'masked-input', component: MaskedInputComponent },\n { name: 'stepper', component: StepperComponent },\n { name: 'social-security-input', component: SocialSecurityComponent },\n { name: 'location-finder', component: FacilityFinderComponent },\n { name: 'multi-select', component: MultiSelectComponent },\n { name: 'autocomplete', component: AutocompleteComponent },\n { name: 'google-address', component: GoogleAddressComponent },\n {\n name: 'country-autocomplete',\n extends: 'autocomplete',\n defaultOptions: {\n props: {\n required: true,\n label: 'Country',\n options: COUNTRY_OPTIONS\n }\n }\n },\n { name: 'secure-scanner', component: SecureScanComponent },\n { name: 'gwa-checkbox', component: CheckboxComponent },\n {\n name: 'mapped-select',\n extends: 'select',\n defaultOptions: {\n expressions: {\n 'props.options': (field: FormlyFieldConfig) => {\n const parent: string = _.at(field.model, field.props?.['parentKey'])[0] as string\n let options = [...(field.props?.['mappedOptions']?.[parent] || [])]\n\n if (field.props?.['enableNone']) {\n options.unshift({\n label: 'None',\n value: ''\n })\n }\n\n return options\n },\n 'hide': (field: FormlyFieldConfig) => {\n const parent: string = _.at(field.model, field.props?.['parentKey'])[0] as string\n\n return !(field.props?.['mappedOptions'][parent])\n }\n }\n }\n },\n {\n name: 'state-province-autocomplete',\n extends: 'autocomplete',\n defaultOptions: {\n props: {\n mappedOptions: STATE_PROVINCE_LIST,\n },\n expressions: {\n 'props.label': (field: FormlyFieldConfig) => {\n const parent: string = field.props?.['parentKey'] ? _.at(field.model, field.props?.['parentKey'])[0] as string : field.props?.['parentValue']\n\n return parent === 'US' ? 'State' : 'Province'\n },\n 'props.options': (field: FormlyFieldConfig) => {\n const parent: string = field.props?.['parentKey'] ? _.at(field.model, field.props?.['parentKey'])[0] as string : field.props?.['parentValue']\n\n return field.props?.['mappedOptions'][parent]\n },\n 'hide': (field: FormlyFieldConfig) => {\n if (field.props?.['parentDetailKey']) {\n const detail = _.at(field.model, field.props?.['parentDetailKey'])[0]\n\n if (detail) {\n return true\n }\n }\n \n const parent: string = field.props?.['parentKey'] ? _.at(field.model, field.props?.['parentKey'])[0] as string : field.props?.['parentValue']\n\n return !(field.props?.['mappedOptions'][parent])\n }\n }\n }\n },\n {\n name: 'address-autocomplete',\n extends: 'formly-group',\n defaultOptions: {\n fieldGroup: ADDRESS_AUTOCOMPLETE,\n expressions: {\n 'hide': (field: FormlyFieldConfig) => {\n const country = field.model?.country || field.props?.['country']\n return country ? false : true\n }\n }\n },\n },\n {\n name:'address-country-autocomplete',\n extends: 'formly-group',\n defaultOptions: {\n fieldGroup: ADDRESS_COUNTRY_AUTOCOMPLETE\n }\n },\n {\n name:'plain-address',\n extends: 'formly-group',\n defaultOptions: {\n fieldGroup: PLAIN_ADDRESS\n }\n },\n {\n name: 'employment-history',\n extends: 'formly-group',\n defaultOptions: {\n\n }\n },\n {\n name: 'from-to',\n extends: 'formly-group',\n defaultOptions: {\n fieldGroup: FORM_TO_COMBO,\n fieldGroupClassName: \"gwc-form__field-group\"\n }\n },\n {\n name: 'employment-history-entry',\n extends: 'formly-group',\n defaultOptions: {\n fieldGroup: EMPLOYMENT_HISTORY_ENTRY,\n fieldGroupClassName: \"gwc-form__field-group\"\n }\n },\n ],\n validationMessages: [\n { name: 'required', message: 'This field is required.' },\n { name: 'decimal', message: 'You must enter a round number.' },\n { name: 'pobox', message: 'P.O. Box addresses cannot be used on this form.' },\n { name: 'future', message: (error: any, field: FormlyFieldConfig) => {\n return `${field.props?.label} cannot be in the future.`\n }}\n ],\n validators: [\n { name: 'decimal', validation: decimalValidator },\n { name: 'pobox', validation: POBoxboxValidator },\n { name: 'valid-date', validation: validDate},\n { name: 'future', validation: futureValidator}\n ],\n extras: {\n checkExpressionOn: 'modelChange',\n resetFieldOnHide: false\n },\n }),\n FormsModule,\n GoogleMapsModule,\n ImageCropperModule,\n LayoutModule,\n MatAutocompleteModule,\n MatButtonModule,\n MatDatepickerModule,\n MatFormFieldModule,\n MatInputModule,\n MatSelectModule,\n MatProgressBarModule,\n OrderRoutingModule,\n ReactiveFormsModule,\n PhonePipeModule,\n FilterPipeModule,\n MatCheckboxModule,\n ButtonComponent,\n DownloadPacketModule,\n MatProgressSpinnerModule,\n ShipDateComponent,\n QRCodeModule\n ]\n})\n\nexport class OrderModule {\n}\n","import * as i0 from '@angular/core';\nimport { InjectionToken, Injectable, Optional, Inject, NgModule } from '@angular/core';\nimport { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS } from '@angular/material/core';\nimport { DateTime, Info } from 'luxon';\n\n/** InjectionToken for LuxonDateAdapter to configure options. */\nconst MAT_LUXON_DATE_ADAPTER_OPTIONS = new InjectionToken('MAT_LUXON_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY,\n});\n/** @docs-private */\nfunction MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY() {\n return {\n useUtc: false,\n firstDayOfWeek: 0,\n defaultOutputCalendar: 'gregory',\n };\n}\n/** Creates an array and fills it with values. */\nfunction range(length, valueFunction) {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n/** Adapts Luxon Dates for use with Angular Material. */\nclass LuxonDateAdapter extends DateAdapter {\n constructor(dateLocale, options) {\n super();\n this._useUTC = !!options?.useUtc;\n this._firstDayOfWeek = options?.firstDayOfWeek || 0;\n this._defaultOutputCalendar = options?.defaultOutputCalendar || 'gregory';\n this.setLocale(dateLocale || DateTime.local().locale);\n }\n getYear(date) {\n return date.year;\n }\n getMonth(date) {\n // Luxon works with 1-indexed months whereas our code expects 0-indexed.\n return date.month - 1;\n }\n getDate(date) {\n return date.day;\n }\n getDayOfWeek(date) {\n return date.weekday;\n }\n getMonthNames(style) {\n // Adding outputCalendar option, because LuxonInfo doesn't get effected by LuxonSettings\n return Info.months(style, {\n locale: this.locale,\n outputCalendar: this._defaultOutputCalendar,\n });\n }\n getDateNames() {\n // At the time of writing, Luxon doesn't offer similar\n // functionality so we have to fall back to the Intl API.\n const dtf = new Intl.DateTimeFormat(this.locale, { day: 'numeric', timeZone: 'utc' });\n // Format a UTC date in order to avoid DST issues.\n return range(31, i => dtf.format(DateTime.utc(2017, 1, i + 1).toJSDate()));\n }\n getDayOfWeekNames(style) {\n // Note that we shift the array once, because Luxon returns Monday as the\n // first day of the week, whereas our logic assumes that it's Sunday. See:\n // https://moment.github.io/luxon/api-docs/index.html#infoweekdays\n const days = Info.weekdays(style, { locale: this.locale });\n days.unshift(days.pop());\n return days;\n }\n getYearName(date) {\n return date.toFormat('yyyy', this._getOptions());\n }\n getFirstDayOfWeek() {\n return this._firstDayOfWeek;\n }\n getNumDaysInMonth(date) {\n return date.daysInMonth;\n }\n clone(date) {\n return DateTime.fromObject(date.toObject(), this._getOptions());\n }\n createDate(year, month, date) {\n const options = this._getOptions();\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n // Luxon uses 1-indexed months so we need to add one to the month.\n const result = this._useUTC\n ? DateTime.utc(year, month + 1, date, options)\n : DateTime.local(year, month + 1, date, options);\n if (!this.isValid(result)) {\n throw Error(`Invalid date \"${date}\". Reason: \"${result.invalidReason}\".`);\n }\n return result;\n }\n today() {\n const options = this._getOptions();\n return this._useUTC ? DateTime.utc(options) : DateTime.local(options);\n }\n parse(value, parseFormat) {\n const options = this._getOptions();\n if (typeof value == 'string' && value.length > 0) {\n const iso8601Date = DateTime.fromISO(value, options);\n if (this.isValid(iso8601Date)) {\n return iso8601Date;\n }\n const formats = Array.isArray(parseFormat) ? parseFormat : [parseFormat];\n if (!parseFormat.length) {\n throw Error('Formats array must not be empty.');\n }\n for (const format of formats) {\n const fromFormat = DateTime.fromFormat(value, format, options);\n if (this.isValid(fromFormat)) {\n return fromFormat;\n }\n }\n return this.invalid();\n }\n else if (typeof value === 'number') {\n return DateTime.fromMillis(value, options);\n }\n else if (value instanceof Date) {\n return DateTime.fromJSDate(value, options);\n }\n else if (value instanceof DateTime) {\n return DateTime.fromMillis(value.toMillis(), options);\n }\n return null;\n }\n format(date, displayFormat) {\n if (!this.isValid(date)) {\n throw Error('LuxonDateAdapter: Cannot format invalid date.');\n }\n if (this._useUTC) {\n return date.setLocale(this.locale).setZone('utc').toFormat(displayFormat);\n }\n else {\n return date.setLocale(this.locale).toFormat(displayFormat);\n }\n }\n addCalendarYears(date, years) {\n return date.reconfigure(this._getOptions()).plus({ years });\n }\n addCalendarMonths(date, months) {\n return date.reconfigure(this._getOptions()).plus({ months });\n }\n addCalendarDays(date, days) {\n return date.reconfigure(this._getOptions()).plus({ days });\n }\n toIso8601(date) {\n return date.toISO();\n }\n /**\n * Returns the given value if given a valid Luxon or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid DateTime and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value) {\n const options = this._getOptions();\n let date;\n if (value instanceof Date) {\n date = DateTime.fromJSDate(value, options);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = DateTime.fromISO(value, options);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n isDateInstance(obj) {\n return obj instanceof DateTime;\n }\n isValid(date) {\n return date.isValid;\n }\n invalid() {\n return DateTime.invalid('Invalid Luxon DateTime object.');\n }\n /** Gets the options that should be used when constructing a new `DateTime` object. */\n _getOptions() {\n return {\n zone: this._useUTC ? 'utc' : undefined,\n locale: this.locale,\n outputCalendar: this._defaultOutputCalendar,\n };\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: LuxonDateAdapter, deps: [{ token: MAT_DATE_LOCALE, optional: true }, { token: MAT_LUXON_DATE_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: LuxonDateAdapter }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: LuxonDateAdapter, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_DATE_LOCALE]\n }] }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [MAT_LUXON_DATE_ADAPTER_OPTIONS]\n }] }] });\n\nconst MAT_LUXON_DATE_FORMATS = {\n parse: {\n dateInput: 'D',\n },\n display: {\n dateInput: 'D',\n monthYearLabel: 'LLL yyyy',\n dateA11yLabel: 'DD',\n monthYearA11yLabel: 'LLLL yyyy',\n },\n};\n\nclass LuxonDateModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: LuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"17.2.0\", ngImport: i0, type: LuxonDateModule }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: LuxonDateModule, providers: [\n {\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS],\n },\n ] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: LuxonDateModule, decorators: [{\n type: NgModule,\n args: [{\n providers: [\n {\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS],\n },\n ],\n }]\n }] });\nclass MatLuxonDateModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatLuxonDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"17.2.0\", ngImport: i0, type: MatLuxonDateModule }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatLuxonDateModule, providers: [provideLuxonDateAdapter()] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"17.2.0\", ngImport: i0, type: MatLuxonDateModule, decorators: [{\n type: NgModule,\n args: [{\n providers: [provideLuxonDateAdapter()],\n }]\n }] });\nfunction provideLuxonDateAdapter(formats = MAT_LUXON_DATE_FORMATS) {\n return [\n {\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS],\n },\n { provide: MAT_DATE_FORMATS, useValue: formats },\n ];\n}\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { LuxonDateAdapter, LuxonDateModule, MAT_LUXON_DATE_ADAPTER_OPTIONS, MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY, MAT_LUXON_DATE_FORMATS, MatLuxonDateModule, provideLuxonDateAdapter };\n","const ATTRIBUTE_KEY_LENGTH_LIMIT = 128;\nconst ATTRIBUTE_STRING_VALUE_LIMIT_DEFAULT = 1024;\nconst ATTRIBUTE_STRING_VALUE_LIMIT_MAX = 10000;\nconst ATTRIBUTE_ARRAY_LENGTH_LIMIT_DEFAULT = 1000;\nconst ATTRIBUTE_ARRAY_LENGTH_LIMIT_MAX = 10000;\nconst ATTRIBUTE_COUNT_LIMIT_DEFAULT = 128;\nconst ATTRIBUTE_COUNT_LIMIT_MAX = 1000;\nconst defaultSpanAttributeLimits = {\n attributeStringValueLimit: ATTRIBUTE_STRING_VALUE_LIMIT_DEFAULT,\n attributeArrayLengthLimit: ATTRIBUTE_ARRAY_LENGTH_LIMIT_DEFAULT,\n attributeCountLimit: ATTRIBUTE_COUNT_LIMIT_DEFAULT\n};\nconst defaultResourceAttributeLimits = {\n attributeStringValueLimit: Infinity,\n attributeArrayLengthLimit: Infinity,\n attributeCountLimit: Infinity\n};\n\nexport { ATTRIBUTE_ARRAY_LENGTH_LIMIT_DEFAULT, ATTRIBUTE_ARRAY_LENGTH_LIMIT_MAX, ATTRIBUTE_COUNT_LIMIT_DEFAULT, ATTRIBUTE_COUNT_LIMIT_MAX, ATTRIBUTE_KEY_LENGTH_LIMIT, ATTRIBUTE_STRING_VALUE_LIMIT_DEFAULT, ATTRIBUTE_STRING_VALUE_LIMIT_MAX, defaultResourceAttributeLimits, defaultSpanAttributeLimits };\n","const isBoolean = (value) => value === true || value === false;\nconst isObject = (value) => !!value && typeof value === 'object' && !Array.isArray(value);\nconst isNumber = (value) => typeof value === 'number' && Number.isFinite(value) && !Number.isNaN(value);\nconst isString = (value) => typeof value === 'string';\nconst isStringWithLength = (value) => isString(value) && value.length > 0;\nconst isLogger = (value) => isObject(value) &&\n typeof value.debug === 'function' &&\n typeof value.info === 'function' &&\n typeof value.warn === 'function' &&\n typeof value.error === 'function';\nconst isStringArray = (value) => Array.isArray(value) && value.every(isStringWithLength);\nconst isStringOrRegExpArray = (value) => Array.isArray(value) && value.every(item => isStringWithLength(item) || item instanceof RegExp);\nfunction isPersistedProbability(value) {\n return isObject(value) &&\n isNumber(value.value) &&\n isNumber(value.time);\n}\nconst isSpanContext = (value) => isObject(value) &&\n typeof value.id === 'string' &&\n typeof value.traceId === 'string' &&\n typeof value.isValid === 'function';\nconst isParentContext = (value) => isObject(value) &&\n typeof value.id === 'string' &&\n typeof value.traceId === 'string';\nfunction isTime(value) {\n return isNumber(value) || value instanceof Date;\n}\nfunction isPlugin(value) {\n return isObject(value) && typeof value.configure === 'function';\n}\nfunction isPluginArray(value) {\n return Array.isArray(value) && value.every(plugin => isPlugin(plugin));\n}\nfunction isOnSpanEndCallbacks(value) {\n return Array.isArray(value) && value.every(method => typeof method === 'function');\n}\n\nexport { isBoolean, isLogger, isNumber, isObject, isOnSpanEndCallbacks, isParentContext, isPersistedProbability, isPlugin, isPluginArray, isSpanContext, isString, isStringArray, isStringOrRegExpArray, isStringWithLength, isTime };\n","import { ATTRIBUTE_KEY_LENGTH_LIMIT, defaultResourceAttributeLimits } from './custom-attribute-limits.js';\nimport { isNumber } from './validation.js';\n\nfunction truncateString(value, limit) {\n const originalLength = value.length;\n const newString = value.slice(0, limit);\n const truncatedLength = newString.length;\n return `${newString} *** ${originalLength - truncatedLength} CHARS TRUNCATED`;\n}\nclass SpanAttributes {\n get droppedAttributesCount() {\n return this._droppedAttributesCount;\n }\n constructor(initialValues, spanAttributeLimits, spanName, logger) {\n this._droppedAttributesCount = 0;\n this.attributes = initialValues;\n this.spanAttributeLimits = spanAttributeLimits;\n this.spanName = spanName;\n this.logger = logger;\n }\n validateAttribute(name, value) {\n if (typeof value === 'string' && value.length > this.spanAttributeLimits.attributeStringValueLimit) {\n this.attributes.set(name, truncateString(value, this.spanAttributeLimits.attributeStringValueLimit));\n this.logger.warn(`Span attribute ${name} in span ${this.spanName} was truncated as the string exceeds the ${this.spanAttributeLimits.attributeStringValueLimit} character limit set by attributeStringValueLimit.`);\n }\n if (Array.isArray(value) && value.length > this.spanAttributeLimits.attributeArrayLengthLimit) {\n const truncatedValue = value.slice(0, this.spanAttributeLimits.attributeArrayLengthLimit);\n this.attributes.set(name, truncatedValue);\n this.logger.warn(`Span attribute ${name} in span ${this.spanName} was truncated as the array exceeds the ${this.spanAttributeLimits.attributeArrayLengthLimit} element limit set by attributeArrayLengthLimit.`);\n }\n }\n set(name, value) {\n if (typeof name === 'string' && (typeof value === 'string' || typeof value === 'boolean' || isNumber(value) || Array.isArray(value))) {\n this.attributes.set(name, value);\n }\n }\n // Used by the public API to set custom attributes\n setCustom(name, value) {\n if (typeof name === 'string' && (typeof value === 'string' || typeof value === 'boolean' || isNumber(value) || Array.isArray(value))) {\n if (!this.attributes.has(name) && this.attributes.size >= this.spanAttributeLimits.attributeCountLimit) {\n this._droppedAttributesCount++;\n this.logger.warn(`Span attribute ${name} in span ${this.spanName} was dropped as the number of attributes exceeds the ${this.spanAttributeLimits.attributeCountLimit} attribute limit set by attributeCountLimit.`);\n return;\n }\n if (name.length > ATTRIBUTE_KEY_LENGTH_LIMIT) {\n this._droppedAttributesCount++;\n this.logger.warn(`Span attribute ${name} in span ${this.spanName} was dropped as the key length exceeds the ${ATTRIBUTE_KEY_LENGTH_LIMIT} character fixed limit.`);\n return;\n }\n this.attributes.set(name, value);\n }\n }\n remove(name) {\n this.attributes.delete(name);\n }\n toJson() {\n Array.from(this.attributes).forEach(([key, value]) => { this.validateAttribute(key, value); });\n return Array.from(this.attributes).map(([key, value]) => attributeToJson(key, value));\n }\n}\nclass ResourceAttributes extends SpanAttributes {\n constructor(releaseStage, appVersion, serviceName, sdkName, sdkVersion, logger) {\n const initialValues = new Map([\n ['deployment.environment', releaseStage],\n ['telemetry.sdk.name', sdkName],\n ['telemetry.sdk.version', sdkVersion],\n ['service.name', serviceName]\n ]);\n if (appVersion.length > 0) {\n initialValues.set('service.version', appVersion);\n }\n // TODO: this class should be refactored to use a common base class instead of SpanAttributes\n // since we don't need a span name and logger for resource attributes - see PLAT-12820\n super(initialValues, defaultResourceAttributeLimits, 'resource-attributes', logger);\n }\n}\nfunction getJsonAttributeValue(value) {\n switch (typeof value) {\n case 'number':\n if (Number.isNaN(value) || !Number.isFinite(value)) {\n return undefined;\n }\n if (Number.isInteger(value)) {\n return { intValue: `${value}` };\n }\n return { doubleValue: value };\n case 'boolean':\n return { boolValue: value };\n case 'string':\n return { stringValue: value };\n }\n}\nfunction getJsonArrayAttributeValue(attributeArray) {\n return attributeArray\n .map((value) => getJsonAttributeValue(value))\n .filter(value => typeof value !== 'undefined');\n}\n/**\n * Converts a span attribute into an OTEL compliant value i.e. { stringValue: 'value' }\n * @param key the name of the span attribute\n * @param attribute the value of the attribute. Can be of type string | number | boolean | string[] | number[] | boolean[]. Invalid types will be removed from array attributes.\n * @returns\n */\nfunction attributeToJson(key, attribute) {\n switch (typeof attribute) {\n case 'number':\n if (Number.isNaN(attribute) || !Number.isFinite(attribute)) {\n return undefined;\n }\n // 'bugsnag.sampling.p' must always be sent as a doubleValue\n if (key !== 'bugsnag.sampling.p' && Number.isInteger(attribute)) {\n return { key, value: { intValue: `${attribute}` } };\n }\n return { key, value: { doubleValue: attribute } };\n case 'boolean':\n return { key, value: { boolValue: attribute } };\n case 'string':\n return { key, value: { stringValue: attribute } };\n case 'object':\n if (Array.isArray(attribute)) {\n const arrayValues = getJsonArrayAttributeValue(attribute);\n return { key, value: { arrayValue: arrayValues.length > 0 ? { values: arrayValues } : {} } };\n }\n return undefined;\n default:\n return undefined;\n }\n}\n\nexport { ResourceAttributes, SpanAttributes, attributeToJson };\n","const NANOSECONDS_IN_MILLISECONDS = 1000000;\nfunction millisecondsToNanoseconds(milliseconds) {\n return Math.round(milliseconds * NANOSECONDS_IN_MILLISECONDS);\n}\n\nexport { millisecondsToNanoseconds };\n","import { ATTRIBUTE_STRING_VALUE_LIMIT_DEFAULT, ATTRIBUTE_STRING_VALUE_LIMIT_MAX, ATTRIBUTE_ARRAY_LENGTH_LIMIT_DEFAULT, ATTRIBUTE_ARRAY_LENGTH_LIMIT_MAX, ATTRIBUTE_COUNT_LIMIT_DEFAULT, ATTRIBUTE_COUNT_LIMIT_MAX } from './custom-attribute-limits.js';\nimport { isStringWithLength, isString, isLogger, isStringArray, isPluginArray, isObject, isNumber, isOnSpanEndCallbacks } from './validation.js';\n\nconst schema = {\n appVersion: {\n defaultValue: '',\n message: 'should be a string',\n validate: isStringWithLength\n },\n endpoint: {\n defaultValue: 'https://otlp.bugsnag.com/v1/traces',\n message: 'should be a string',\n validate: isStringWithLength\n },\n apiKey: {\n defaultValue: '',\n message: 'should be a 32 character hexadecimal string',\n validate: (value) => isString(value) && /^[a-f0-9]{32}$/.test(value)\n },\n logger: {\n defaultValue: {\n debug(message) { console.debug(message); },\n info(message) { console.info(message); },\n warn(message) { console.warn(message); },\n error(message) { console.error(message); }\n },\n message: 'should be a Logger object',\n validate: isLogger\n },\n releaseStage: {\n defaultValue: 'production',\n message: 'should be a string',\n validate: isStringWithLength\n },\n enabledReleaseStages: {\n defaultValue: null,\n message: 'should be an array of strings',\n validate: (value) => value === null || isStringArray(value)\n },\n plugins: {\n defaultValue: [],\n message: 'should be an array of plugin objects',\n validate: isPluginArray\n },\n bugsnag: {\n defaultValue: undefined,\n message: 'should be an instance of Bugsnag',\n validate: (value) => isObject(value) && typeof value.addOnError === 'function'\n },\n samplingProbability: {\n defaultValue: undefined,\n message: 'should be a number between 0 and 1',\n validate: (value) => value === undefined || (isNumber(value) && value >= 0 && value <= 1)\n },\n onSpanEnd: {\n defaultValue: undefined,\n message: 'should be an array of functions',\n validate: isOnSpanEndCallbacks\n },\n attributeStringValueLimit: {\n defaultValue: ATTRIBUTE_STRING_VALUE_LIMIT_DEFAULT,\n message: `should be a number between 1 and ${ATTRIBUTE_STRING_VALUE_LIMIT_MAX}`,\n validate: (value) => isNumber(value) && value > 0 && value <= ATTRIBUTE_STRING_VALUE_LIMIT_MAX\n },\n attributeArrayLengthLimit: {\n defaultValue: ATTRIBUTE_ARRAY_LENGTH_LIMIT_DEFAULT,\n message: `should be a number between 1 and ${ATTRIBUTE_ARRAY_LENGTH_LIMIT_MAX}`,\n validate: (value) => isNumber(value) && value > 0 && value <= ATTRIBUTE_ARRAY_LENGTH_LIMIT_MAX\n },\n attributeCountLimit: {\n defaultValue: ATTRIBUTE_COUNT_LIMIT_DEFAULT,\n message: `should be a number between 1 and ${ATTRIBUTE_COUNT_LIMIT_MAX}`,\n validate: (value) => isNumber(value) && value > 0 && value <= ATTRIBUTE_COUNT_LIMIT_MAX\n }\n};\nfunction validateConfig(config, schema) {\n if (typeof config === 'string') {\n config = { apiKey: config };\n }\n if (!isObject(config) || !isString(config.apiKey) || config.apiKey.length === 0) {\n throw new Error('No Bugsnag API Key set');\n }\n let warnings = '';\n const cleanConfiguration = {};\n for (const option of Object.keys(schema)) {\n if (Object.prototype.hasOwnProperty.call(config, option)) {\n if (schema[option].validate(config[option])) {\n cleanConfiguration[option] = config[option];\n }\n else {\n warnings += `\\n - ${option} ${schema[option].message}, got ${typeof config[option]}`;\n cleanConfiguration[option] = schema[option].defaultValue;\n }\n }\n else {\n cleanConfiguration[option] = schema[option].defaultValue;\n }\n }\n // If apiKey is set but not valid we should still use it, despite the validation warning.\n cleanConfiguration.apiKey = config.apiKey;\n cleanConfiguration.maximumBatchSize = config.maximumBatchSize || 100;\n cleanConfiguration.batchInactivityTimeoutMs = config.batchInactivityTimeoutMs || 30 * 1000;\n if (warnings.length > 0) {\n cleanConfiguration.logger.warn(`Invalid configuration${warnings}`);\n }\n return cleanConfiguration;\n}\n\nexport { schema, validateConfig };\n","class SpanEvents {\n constructor() {\n this.events = [];\n }\n add(name, time) {\n this.events.push({ name, time });\n }\n toJson(clock) {\n return this.events.map(({ name, time }) => ({ name, timeUnixNano: clock.toUnixTimestampNanoseconds(time) }));\n }\n}\n\nexport { SpanEvents };\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// taken from OpenTelemetry's TraceIdRatioBasedSampler:\n// https://github.com/open-telemetry/opentelemetry-js/blob/ca700c4eef64c14bb5fef2be6f08ace7973a8881/packages/opentelemetry-sdk-trace-base/src/sampler/TraceIdRatioBasedSampler.ts#L47-L55\n// with some small modifications to match our naming conventions\nfunction traceIdToSamplingRate(traceId) {\n let samplingRate = 0;\n for (let i = 0; i < traceId.length / 8; i++) {\n const position = i * 8;\n const segment = Number.parseInt(traceId.slice(position, position + 8), 16);\n samplingRate = (samplingRate ^ segment) >>> 0;\n }\n return samplingRate;\n}\n\nexport { traceIdToSamplingRate as default };\n","import { SpanEvents } from './events.js';\nimport traceIdToSamplingRate from './trace-id-to-sampling-rate.js';\nimport { isTime, isSpanContext, isBoolean } from './validation.js';\n\nconst HOUR_IN_MILLISECONDS = 60 * 60 * 1000;\nfunction spanToJson(span, clock) {\n return {\n name: span.name,\n kind: span.kind,\n spanId: span.id,\n traceId: span.traceId,\n parentSpanId: span.parentSpanId,\n ...(span.attributes.droppedAttributesCount > 0 ? { droppedAttributesCount: span.attributes.droppedAttributesCount } : {}),\n startTimeUnixNano: clock.toUnixTimestampNanoseconds(span.startTime),\n endTimeUnixNano: clock.toUnixTimestampNanoseconds(span.endTime),\n attributes: span.attributes.toJson(),\n events: span.events.toJson(clock)\n };\n}\nfunction spanEndedToSpan(span) {\n return {\n get id() {\n return span.id;\n },\n get traceId() {\n return span.traceId;\n },\n get samplingRate() {\n return span.samplingRate;\n },\n get name() {\n return span.name;\n },\n isValid: () => false,\n end: () => { }, // no-op\n setAttribute: (name, value) => { span.attributes.setCustom(name, value); }\n };\n}\nclass SpanInternal {\n constructor(id, traceId, name, startTime, attributes, clock, parentSpanId) {\n this.kind = 3 /* Kind.Client */; // TODO: How do we define the initial Kind?\n this.events = new SpanEvents();\n this.id = id;\n this.traceId = traceId;\n this.parentSpanId = parentSpanId;\n this.name = name;\n this.startTime = startTime;\n this.attributes = attributes;\n this.samplingRate = traceIdToSamplingRate(this.traceId);\n this.clock = clock;\n }\n addEvent(name, time) {\n this.events.add(name, time);\n }\n setAttribute(name, value) {\n this.attributes.set(name, value);\n }\n setCustomAttribute(name, value) {\n this.attributes.setCustom(name, value);\n }\n end(endTime, samplingProbability) {\n this.endTime = endTime;\n let _samplingProbability = samplingProbability;\n this.attributes.set('bugsnag.sampling.p', _samplingProbability.raw);\n return {\n id: this.id,\n name: this.name,\n kind: this.kind,\n traceId: this.traceId,\n startTime: this.startTime,\n attributes: this.attributes,\n events: this.events,\n samplingRate: this.samplingRate,\n endTime,\n get samplingProbability() {\n return _samplingProbability;\n },\n set samplingProbability(samplingProbability) {\n _samplingProbability = samplingProbability;\n this.attributes.set('bugsnag.sampling.p', _samplingProbability.raw);\n },\n parentSpanId: this.parentSpanId\n };\n }\n isValid() {\n return this.endTime === undefined && this.startTime > (this.clock.now() - HOUR_IN_MILLISECONDS);\n }\n}\nconst coreSpanOptionSchema = {\n startTime: {\n message: 'should be a number or Date',\n getDefaultValue: () => undefined,\n validate: isTime\n },\n parentContext: {\n message: 'should be a SpanContext',\n getDefaultValue: () => undefined,\n validate: (value) => value === null || isSpanContext(value)\n },\n makeCurrentContext: {\n message: 'should be true|false',\n getDefaultValue: () => undefined,\n validate: isBoolean\n },\n isFirstClass: {\n message: 'should be true|false',\n getDefaultValue: () => undefined,\n validate: isBoolean\n }\n};\n\nexport { SpanInternal, coreSpanOptionSchema, spanEndedToSpan, spanToJson };\n","import { millisecondsToNanoseconds } from './clock.js';\nimport { spanEndedToSpan } from './span.js';\n\nclass BatchProcessor {\n constructor(delivery, configuration, retryQueue, sampler, probabilityManager, encoder) {\n this.spans = [];\n this.timeout = null;\n this.flushQueue = Promise.resolve();\n this.delivery = delivery;\n this.configuration = configuration;\n this.retryQueue = retryQueue;\n this.sampler = sampler;\n this.probabilityManager = probabilityManager;\n this.encoder = encoder;\n this.flush = this.flush.bind(this);\n }\n stop() {\n if (this.timeout !== null) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n }\n start() {\n this.stop();\n this.timeout = setTimeout(this.flush, this.configuration.batchInactivityTimeoutMs);\n }\n add(span) {\n if (this.configuration.enabledReleaseStages &&\n !this.configuration.enabledReleaseStages.includes(this.configuration.releaseStage)) {\n return;\n }\n this.spans.push(span);\n if (this.spans.length >= this.configuration.maximumBatchSize) {\n this.flush();\n }\n else {\n this.start();\n }\n }\n async flush() {\n this.stop();\n this.flushQueue = this.flushQueue.then(async () => {\n const batch = await this.prepareBatch();\n // we either had nothing in the batch originally or all spans were discarded\n if (!batch) {\n return;\n }\n const payload = await this.encoder.encode(batch);\n const batchTime = Date.now();\n try {\n const response = await this.delivery.send(payload);\n if (response.samplingProbability !== undefined) {\n this.probabilityManager.setProbability(response.samplingProbability);\n }\n switch (response.state) {\n case 'success':\n this.retryQueue.flush();\n break;\n case 'failure-discard':\n this.configuration.logger.warn('delivery failed');\n break;\n case 'failure-retryable':\n this.configuration.logger.info('delivery failed, adding to retry queue');\n this.retryQueue.add(payload, batchTime);\n break;\n default:\n response.state;\n }\n }\n catch (err) {\n this.configuration.logger.warn('delivery failed');\n }\n });\n await this.flushQueue;\n }\n async runCallbacks(span) {\n if (this.configuration.onSpanEnd) {\n const callbackStartTime = performance.now();\n let continueToBatch = true;\n for (const callback of this.configuration.onSpanEnd) {\n try {\n let result = callback(span);\n // @ts-expect-error result may or may not be a promise\n if (typeof result.then === 'function') {\n result = await result;\n }\n if (result === false) {\n continueToBatch = false;\n break;\n }\n }\n catch (err) {\n this.configuration.logger.error('Error in onSpanEnd callback: ' + err);\n }\n }\n if (continueToBatch) {\n const duration = millisecondsToNanoseconds(performance.now() - callbackStartTime);\n span.setAttribute('bugsnag.span.callbacks_duration', duration);\n }\n return continueToBatch;\n }\n else {\n return true;\n }\n }\n async prepareBatch() {\n if (this.spans.length === 0) {\n return;\n }\n // ensure we have a fresh probability value before building the batch\n await this.probabilityManager.ensureFreshProbability();\n // update sampling values if necessary and re-sample\n const batch = [];\n const probability = this.sampler.spanProbability;\n for (const span of this.spans) {\n if (span.samplingProbability.raw > probability.raw) {\n span.samplingProbability = probability;\n }\n if (this.sampler.sample(span)) {\n // Run any callbacks that have been registered before batching\n // as callbacks could cause the span to be discarded\n const shouldAddToBatch = await this.runCallbacks(spanEndedToSpan(span));\n if (shouldAddToBatch)\n batch.push(span);\n }\n }\n // clear out the current batch so we're ready to start a new one\n this.spans = [];\n // if every span was discarded there's nothing to send\n if (batch.length === 0) {\n return;\n }\n return batch;\n }\n}\n\nexport { BatchProcessor };\n","import { spanToJson } from './span.js';\n\nclass TracePayloadEncoder {\n constructor(clock, configuration, resourceAttributeSource) {\n this.clock = clock;\n this.configuration = configuration;\n this.resourceAttributeSource = resourceAttributeSource;\n }\n async encode(spans) {\n const resourceAttributes = await this.resourceAttributeSource(this.configuration);\n const jsonSpans = Array(spans.length);\n for (let i = 0; i < spans.length; ++i) {\n jsonSpans[i] = spanToJson(spans[i], this.clock);\n }\n const deliveryPayload = {\n resourceSpans: [\n {\n resource: { attributes: resourceAttributes.toJson() },\n scopeSpans: [{ spans: jsonSpans }]\n }\n ]\n };\n return {\n body: deliveryPayload,\n headers: {\n 'Bugsnag-Api-Key': this.configuration.apiKey,\n 'Content-Type': 'application/json',\n // Do not set 'Bugsnag-Span-Sampling' if the SDK is configured with samplingProbability\n ...(this.configuration.samplingProbability !== undefined ? {} : { 'Bugsnag-Span-Sampling': this.generateSamplingHeader(spans) })\n }\n };\n }\n generateSamplingHeader(spans) {\n if (spans.length === 0) {\n return '1:0';\n }\n const spanCounts = Object.create(null);\n for (const span of spans) {\n const existingValue = spanCounts[span.samplingProbability.raw] || 0;\n spanCounts[span.samplingProbability.raw] = existingValue + 1;\n }\n const rawProbabilities = Object.keys(spanCounts);\n const pairs = Array(rawProbabilities.length);\n for (let i = 0; i < rawProbabilities.length; ++i) {\n const rawProbability = rawProbabilities[i];\n pairs[i] = `${rawProbability}:${spanCounts[rawProbability]}`;\n }\n return pairs.join(';');\n }\n}\nconst retryCodes = new Set([402, 407, 408, 429]);\nfunction responseStateFromStatusCode(statusCode) {\n if (statusCode >= 200 && statusCode < 300) {\n return 'success';\n }\n if (statusCode >= 400 && statusCode < 500 && !retryCodes.has(statusCode)) {\n return 'failure-discard';\n }\n return 'failure-retryable';\n}\n\nexport { TracePayloadEncoder, responseStateFromStatusCode };\n","class FixedProbabilityManager {\n static async create(sampler, samplingProbability) {\n sampler.probability = samplingProbability;\n return new FixedProbabilityManager(sampler, samplingProbability);\n }\n constructor(sampler, samplingProbability) {\n this.sampler = sampler;\n this.samplingProbability = samplingProbability;\n }\n setProbability(newProbability) {\n return Promise.resolve();\n }\n ensureFreshProbability() {\n return Promise.resolve();\n }\n}\n\nexport { FixedProbabilityManager as default };\n","// the time to wait before retrying a failed request\nconst RETRY_MILLISECONDS = 30 * 1000;\nclass ProbabilityFetcher {\n constructor(delivery, apiKey) {\n this.delivery = delivery;\n this.payload = {\n body: { resourceSpans: [] },\n headers: {\n 'Bugsnag-Api-Key': apiKey,\n 'Content-Type': 'application/json',\n 'Bugsnag-Span-Sampling': '1.0:0'\n }\n };\n }\n async getNewProbability() {\n // keep making requests until we get a new probability value from the server\n while (true) {\n const response = await this.delivery.send(this.payload);\n // in theory this should always be present, but it's possible the request\n // fails or there's a bug on the server side causing it not to be returned\n if (response.samplingProbability !== undefined) {\n return response.samplingProbability;\n }\n await this.timeBetweenRetries();\n }\n }\n timeBetweenRetries() {\n return new Promise(resolve => {\n setTimeout(resolve, RETRY_MILLISECONDS);\n });\n }\n}\n\nexport { ProbabilityFetcher as default };\n","// the time between requests to fetch a new probability value from the server\nconst PROBABILITY_REFRESH_MILLISECONDS = 24 * 60 * 60 * 1000; // 24 hours\nclass ProbabilityManager {\n static async create(persistence, sampler, probabilityFetcher) {\n const persistedProbability = await persistence.load('bugsnag-sampling-probability');\n let initialProbabilityTime;\n if (persistedProbability === undefined) {\n // If there is no stored probability:\n // - Set the initial probability value to the default\n // - Immediately fetch a new probability value\n sampler.probability = 1.0;\n initialProbabilityTime = 0;\n }\n else if (persistedProbability.time < Date.now() - PROBABILITY_REFRESH_MILLISECONDS) {\n // If it is >= 24 hours old:\n // - Set the initial probability value to the stored value\n // - Immediately fetch a new probability value\n sampler.probability = persistedProbability.value;\n initialProbabilityTime = persistedProbability.time;\n }\n else {\n // If it is < 24 hours old:\n // - Use the stored probability\n // - Fetch a new probability when this value would be 24 hours old\n sampler.probability = persistedProbability.value;\n initialProbabilityTime = persistedProbability.time;\n }\n return new ProbabilityManager(persistence, sampler, probabilityFetcher, initialProbabilityTime);\n }\n constructor(persistence, sampler, probabilityFetcher, initialProbabilityTime) {\n this.outstandingFreshnessCheck = undefined;\n this.persistence = persistence;\n this.sampler = sampler;\n this.probabilityFetcher = probabilityFetcher;\n this.lastProbabilityTime = initialProbabilityTime;\n this.ensureFreshProbability();\n }\n setProbability(newProbability) {\n this.lastProbabilityTime = Date.now();\n this.sampler.probability = newProbability;\n // return this promise for convience in unit tests as it allows us to wait\n // for persistence to finish; in real code we won't ever wait for this but\n // there's no harm in returning it anyway\n return this.persistence.save('bugsnag-sampling-probability', {\n value: newProbability,\n time: this.lastProbabilityTime\n });\n }\n /**\n * Ensure that the current probability value is fresh, i.e. it is less than 24\n * hours old\n *\n * If the probability value is stale then this method will fetch a fresh one\n *\n * This method is idempotent; calling it while there is already an outstanding\n * probability request will not create a second request\n */\n ensureFreshProbability() {\n // we're already fetching a new probability\n if (this.outstandingFreshnessCheck) {\n return this.outstandingFreshnessCheck;\n }\n // if the probability value is >= 24 hours old, fetch a new one\n if (Date.now() - this.lastProbabilityTime >= PROBABILITY_REFRESH_MILLISECONDS) {\n this.outstandingFreshnessCheck = this.probabilityFetcher.getNewProbability()\n .then(probability => {\n this.setProbability(probability);\n this.outstandingFreshnessCheck = undefined;\n });\n return this.outstandingFreshnessCheck;\n }\n return Promise.resolve();\n }\n}\n\nexport { ProbabilityManager as default };\n","// a processor that buffers spans in memory until the client has started\n// not sure if this would need to be platform specific — will we ever care about\n// persisting spans if 'start' is never called?\nclass BufferingProcessor {\n constructor() {\n this.spans = [];\n }\n add(span) {\n this.spans.push(span);\n }\n}\n\nexport { BufferingProcessor };\n","// sampling rates are stored as a number between 0 and 2^32 - 1 (i.e. they are\n// u32s) so we need to scale the probability value to match this range as they\n// are stored as values between 0 and 1\nfunction scaleProbabilityToMatchSamplingRate(probability) {\n return Math.floor(probability * 0xffffffff);\n}\nclass Sampler {\n constructor(initialProbability) {\n // we could just do 'this.probability = initialProbability' but TypeScript\n // doesn't like that as it doesn't directly initialise these properties in\n // the constructor\n this._probability = initialProbability;\n this.scaledProbability = scaleProbabilityToMatchSamplingRate(initialProbability);\n }\n /**\n * The global probability value: a number between 0 & 1\n */\n get probability() {\n return this._probability;\n }\n set probability(probability) {\n this._probability = probability;\n this.scaledProbability = scaleProbabilityToMatchSamplingRate(probability);\n }\n /**\n * The probability value for spans: a number between 0 & 2^32 - 1\n *\n * This is necessary because span sampling rates are generated as unsigned 32\n * bit integers. We scale the global probability value to match that range, so\n * that we can use a simple calculation in 'sample'\n *\n * @see scaleProbabilityToMatchSamplingRate\n */\n get spanProbability() {\n return {\n raw: this._probability,\n scaled: this.scaledProbability\n };\n }\n sample(span) {\n return span.samplingRate <= span.samplingProbability.scaled;\n }\n shouldSample(samplingRate) {\n return samplingRate <= this.spanProbability.scaled;\n }\n}\n\nexport { Sampler as default };\n","function spanContextEquals(span1, span2) {\n if (span1 === span2)\n return true;\n if (span1 !== undefined && span2 !== undefined) {\n return span1.id === span2.id && span1.traceId === span2.traceId;\n }\n return false;\n}\nclass DefaultSpanContextStorage {\n constructor(backgroundingListener, contextStack = []) {\n this.isInForeground = true;\n this.onBackgroundStateChange = (state) => {\n this.isInForeground = state === 'in-foreground';\n // clear the context stack regardless of the new background state\n // since spans are only valid if they start and end while the app is in the foreground\n this.contextStack.length = 0;\n };\n this.contextStack = contextStack;\n backgroundingListener.onStateChange(this.onBackgroundStateChange);\n }\n *[Symbol.iterator]() {\n for (let i = this.contextStack.length - 1; i >= 0; --i) {\n yield this.contextStack[i];\n }\n }\n push(context) {\n if (context.isValid() && this.isInForeground) {\n this.contextStack.push(context);\n }\n }\n pop(context) {\n if (spanContextEquals(context, this.current)) {\n this.contextStack.pop();\n }\n this.removeClosedContexts();\n }\n get first() {\n this.removeClosedContexts();\n return this.contextStack.length > 0\n ? this.contextStack[0]\n : undefined;\n }\n get current() {\n this.removeClosedContexts();\n return this.contextStack.length > 0\n ? this.contextStack[this.contextStack.length - 1]\n : undefined;\n }\n removeClosedContexts() {\n while (this.contextStack.length > 0 &&\n this.contextStack[this.contextStack.length - 1].isValid() === false) {\n this.contextStack.pop();\n }\n }\n}\n\nexport { DefaultSpanContextStorage, spanContextEquals };\n","import { isNumber } from './validation.js';\n\nfunction timeToNumber(clock, time) {\n if (isNumber(time)) {\n // no need to change anything - we want to store numbers anyway\n // we assume this is nanosecond precision\n return time;\n }\n if (time instanceof Date) {\n return clock.convert(time);\n }\n return clock.now();\n}\n\nexport { timeToNumber };\n","import { SpanAttributes } from './attributes.js';\nimport { defaultSpanAttributeLimits } from './custom-attribute-limits.js';\nimport { SpanInternal, coreSpanOptionSchema } from './span.js';\nimport { timeToNumber } from './time.js';\nimport { isParentContext, isObject } from './validation.js';\n\nconst DISCARD_END_TIME = -1;\nclass SpanFactory {\n constructor(processor, sampler, idGenerator, spanAttributesSource, clock, backgroundingListener, logger, spanContextStorage) {\n this.spanAttributeLimits = defaultSpanAttributeLimits;\n this.openSpans = new WeakSet();\n this.isInForeground = true;\n this.onBackgroundStateChange = (state) => {\n this.isInForeground = state === 'in-foreground';\n // clear all open spans regardless of the new background state\n // since spans are only valid if they start and end while the app is in the foreground\n this.openSpans = new WeakSet();\n };\n this.processor = processor;\n this.sampler = sampler;\n this.idGenerator = idGenerator;\n this.spanAttributesSource = spanAttributesSource;\n this.clock = clock;\n this.logger = logger;\n this.spanContextStorage = spanContextStorage;\n // this will fire immediately if the app is already backgrounded\n backgroundingListener.onStateChange(this.onBackgroundStateChange);\n }\n startSpan(name, options) {\n const safeStartTime = timeToNumber(this.clock, options.startTime);\n const spanId = this.idGenerator.generate(64);\n // if the parentContext option is not set use the current context\n // if parentContext is explicitly null, or there is no current context,\n // we are starting a new root span\n const parentContext = isParentContext(options.parentContext) || options.parentContext === null\n ? options.parentContext\n : this.spanContextStorage.current;\n const parentSpanId = parentContext ? parentContext.id : undefined;\n const traceId = parentContext ? parentContext.traceId : this.idGenerator.generate(128);\n const attributes = new SpanAttributes(new Map(), this.spanAttributeLimits, name, this.logger);\n if (typeof options.isFirstClass === 'boolean') {\n attributes.set('bugsnag.span.first_class', options.isFirstClass);\n }\n const span = new SpanInternal(spanId, traceId, name, safeStartTime, attributes, this.clock, parentSpanId);\n // don't track spans that are started while the app is backgrounded\n if (this.isInForeground) {\n this.openSpans.add(span);\n if (options.makeCurrentContext !== false) {\n this.spanContextStorage.push(span);\n }\n }\n return span;\n }\n startNetworkSpan(options) {\n const spanName = `[HTTP/${options.method.toUpperCase()}]`;\n const cleanOptions = this.validateSpanOptions(spanName, options);\n const spanInternal = this.startSpan(cleanOptions.name, { ...cleanOptions.options, makeCurrentContext: false });\n spanInternal.setAttribute('bugsnag.span.category', 'network');\n spanInternal.setAttribute('http.method', options.method);\n spanInternal.setAttribute('http.url', options.url);\n return spanInternal;\n }\n configure(processor, configuration) {\n this.processor = processor;\n this.logger = configuration.logger;\n this.spanAttributeLimits = {\n attributeArrayLengthLimit: configuration.attributeArrayLengthLimit,\n attributeCountLimit: configuration.attributeCountLimit,\n attributeStringValueLimit: configuration.attributeStringValueLimit\n };\n }\n endSpan(span, endTime, additionalAttributes) {\n // remove the span from the context stack (this will also remove any invalid spans)\n this.spanContextStorage.pop(span);\n const untracked = !this.openSpans.delete(span);\n const isValidSpan = span.isValid();\n // log a warning if the span is already invalid and is not being tracked\n if (untracked && !isValidSpan) {\n this.logger.warn('Attempted to end a Span which is no longer valid.');\n }\n // spans should be discarded if:\n // - they are not tracked (i.e. discarded due to backgrounding)\n // - they are already invalid\n // - they have an explicit discard end time\n if (untracked || !isValidSpan || endTime === DISCARD_END_TIME) {\n // we still call end on the span so that it is no longer considered valid\n span.end(endTime, this.sampler.spanProbability);\n return;\n }\n // Set any additional attributes\n for (const [key, value] of Object.entries(additionalAttributes || {})) {\n span.setAttribute(key, value);\n }\n this.spanAttributesSource.requestAttributes(span);\n const spanEnded = span.end(endTime, this.sampler.spanProbability);\n if (this.sampler.sample(spanEnded)) {\n this.processor.add(spanEnded);\n }\n }\n toPublicApi(span) {\n return {\n get id() {\n return span.id;\n },\n get traceId() {\n return span.traceId;\n },\n get samplingRate() {\n return span.samplingRate;\n },\n get name() {\n return span.name;\n },\n isValid: () => span.isValid(),\n setAttribute: (name, value) => {\n span.setCustomAttribute(name, value);\n },\n end: (endTime) => {\n const safeEndTime = timeToNumber(this.clock, endTime);\n this.endSpan(span, safeEndTime);\n }\n };\n }\n validateSpanOptions(name, options, schema = coreSpanOptionSchema) {\n let warnings = '';\n const cleanOptions = {};\n if (typeof name !== 'string') {\n warnings += `\\n - name should be a string, got ${typeof name}`;\n name = String(name);\n }\n if (options !== undefined && !isObject(options)) {\n warnings += '\\n - options is not an object';\n }\n else {\n const spanOptions = options || {};\n for (const option of Object.keys(schema)) {\n if (Object.prototype.hasOwnProperty.call(spanOptions, option) && spanOptions[option] !== undefined) {\n if (schema[option].validate(spanOptions[option])) {\n cleanOptions[option] = spanOptions[option];\n }\n else {\n warnings += `\\n - ${option} ${schema[option].message}, got ${typeof spanOptions[option]}`;\n cleanOptions[option] = schema[option].getDefaultValue(spanOptions[option]);\n }\n }\n else {\n cleanOptions[option] = schema[option].getDefaultValue(spanOptions[option]);\n }\n }\n }\n if (warnings.length > 0) {\n this.logger.warn(`Invalid span options${warnings}`);\n }\n return { name, options: cleanOptions };\n }\n}\n\nexport { DISCARD_END_TIME, SpanFactory };\n","import cuid from '@bugsnag/cuid';\nimport { isPersistedProbability } from './validation.js';\n\nconst { isCuid } = cuid;\nclass InMemoryPersistence {\n constructor() {\n this.persistedItems = new Map();\n }\n async load(key) {\n return this.persistedItems.get(key);\n }\n async save(key, value) {\n this.persistedItems.set(key, value);\n }\n}\nfunction toPersistedPayload(key, raw) {\n switch (key) {\n case 'bugsnag-sampling-probability': {\n const json = JSON.parse(raw);\n return isPersistedProbability(json)\n ? json\n : undefined;\n }\n case 'bugsnag-anonymous-id':\n return isCuid(raw)\n ? raw\n : undefined;\n }\n}\n\nexport { InMemoryPersistence, toPersistedPayload };\n","const msInDay = 24 * 60 * 60000;\nclass InMemoryQueue {\n constructor(delivery, retryQueueMaxSize) {\n this.delivery = delivery;\n this.retryQueueMaxSize = retryQueueMaxSize;\n this.requestQueue = Promise.resolve();\n this.payloads = [];\n }\n add(payload, time) {\n this.payloads.push({ payload, time });\n let spanCount = this.payloads.reduce((count, { payload }) => count + countSpansInPayload(payload), 0);\n while (spanCount > this.retryQueueMaxSize) {\n const payload = this.payloads.shift();\n if (!payload) {\n break;\n }\n spanCount -= countSpansInPayload(payload.payload);\n }\n }\n async flush() {\n if (this.payloads.length === 0)\n return;\n const payloads = this.payloads;\n this.payloads = [];\n this.requestQueue = this.requestQueue.then(async () => {\n for (const { payload, time } of payloads) {\n // discard payloads at least 24 hours old\n if (Date.now() >= time + msInDay)\n continue;\n try {\n const { state } = await this.delivery.send(payload);\n switch (state) {\n case 'success':\n case 'failure-discard':\n break;\n case 'failure-retryable':\n this.add(payload, time);\n break;\n default:\n state;\n }\n }\n catch (err) { }\n }\n });\n await this.requestQueue;\n }\n}\nfunction countSpansInPayload(payload) {\n let count = 0;\n for (let i = 0; i < payload.body.resourceSpans.length; ++i) {\n const scopeSpans = payload.body.resourceSpans[i].scopeSpans;\n for (let j = 0; j < scopeSpans.length; ++j) {\n count += scopeSpans[j].spans.length;\n }\n }\n return count;\n}\n\nexport { InMemoryQueue };\n","import { responseStateFromStatusCode } from '@bugsnag/core-performance';\n\nfunction samplingProbabilityFromHeaders(headers) {\n const value = headers.get('Bugsnag-Sampling-Probability');\n if (typeof value !== 'string') {\n return undefined;\n }\n const asNumber = Number.parseFloat(value);\n if (Number.isNaN(asNumber) || asNumber < 0 || asNumber > 1) {\n return undefined;\n }\n return asNumber;\n}\nfunction createFetchDeliveryFactory(fetch, clock, backgroundingListener) {\n // if a backgrounding listener is supplied, set fetch's 'keepalive' flag\n // when the app is backgrounded/terminated so that we can flush the last batch\n // this may be required on platforms such as browser where without 'keepalive'\n // the request may be cancelled (or never start sending) when backgrounded\n // we don't _always_ set the flag because it imposes a 64k payload limit\n let keepalive = false;\n if (backgroundingListener) {\n backgroundingListener.onStateChange(state => {\n keepalive = state === 'in-background';\n });\n }\n return function fetchDeliveryFactory(endpoint) {\n return {\n async send(payload) {\n const body = JSON.stringify(payload.body);\n payload.headers['Bugsnag-Sent-At'] = clock.date().toISOString();\n try {\n const response = await fetch(endpoint, {\n method: 'POST',\n keepalive,\n body,\n headers: payload.headers\n });\n return {\n state: responseStateFromStatusCode(response.status),\n samplingProbability: samplingProbabilityFromHeaders(response.headers)\n };\n }\n catch (err) {\n if (body.length > 10e5) {\n return { state: 'failure-discard' };\n }\n return { state: 'failure-retryable' };\n }\n }\n };\n };\n}\n\nexport { createFetchDeliveryFactory as default };\n","class RequestTracker {\n constructor() {\n this.callbacks = [];\n }\n onStart(startCallback) {\n this.callbacks.push(startCallback);\n }\n start(context) {\n const results = [];\n for (const startCallback of this.callbacks) {\n const result = startCallback(context);\n if (result)\n results.push(result);\n }\n return {\n onRequestEnd: (endContext) => {\n for (const result of results) {\n if (result && result.onRequestEnd) {\n result.onRequestEnd(endContext);\n }\n }\n },\n extraRequestHeaders: results.map((result) => {\n if (result && result.extraRequestHeaders) {\n return result.extraRequestHeaders;\n }\n return undefined;\n }).filter(isDefined)\n };\n }\n}\nfunction isDefined(argument) {\n return argument !== undefined;\n}\n\nexport { RequestTracker };\n","function getAbsoluteUrl(url, baseUrl) {\n // if it looks like an absolute url do nothing\n if (url.indexOf('https://') === 0 || url.indexOf('http://') === 0)\n return url;\n try {\n const absoluteUrl = new URL(url, baseUrl).href;\n // if a trailing slash has been added inadvertently remove it\n if (!url.endsWith('/') && absoluteUrl.endsWith('/')) {\n return absoluteUrl.slice(0, -1);\n }\n return absoluteUrl;\n }\n catch (_a) {\n // not a valid URL for some reason - simply return it\n return url;\n }\n}\n\nexport { getAbsoluteUrl as default };\n","import { RequestTracker } from './request-tracker.js';\nimport getAbsoluteUrl from './url-helpers.js';\n\nfunction createStartContext(startTime, input, init, baseUrl) {\n const inputIsRequest = isRequest(input);\n const url = inputIsRequest ? input.url : String(input);\n const method = (!!init && init.method) || (inputIsRequest && input.method) || 'GET';\n return { url: getAbsoluteUrl(url, baseUrl), method, startTime, type: 'fetch' };\n}\nfunction isRequest(input) {\n return !!input && typeof input === 'object' && !(input instanceof URL);\n}\nfunction isHeadersInstance(input) {\n return !!input && typeof input === 'object' && input instanceof Headers;\n}\nfunction createFetchRequestTracker(global, clock) {\n const requestTracker = new RequestTracker();\n const originalFetch = global.fetch;\n global.fetch = function fetch(input, init) {\n const startContext = createStartContext(clock.now(), input, init, global.document && global.document.baseURI);\n const { onRequestEnd, extraRequestHeaders } = requestTracker.start(startContext);\n // Add the headers to the `init` received from the caller\n const modifiedParams = mergeRequestHeaders(input, init, extraRequestHeaders);\n return originalFetch.call(this, modifiedParams[0], modifiedParams[1]).then(response => {\n onRequestEnd({ status: response.status, endTime: clock.now(), state: 'success' });\n return response;\n }).catch(error => {\n onRequestEnd({ error, endTime: clock.now(), state: 'error' });\n throw error;\n });\n };\n return requestTracker;\n}\nfunction mergeRequestHeaders(input, init, extraRequestHeaders) {\n if (!extraRequestHeaders)\n return [input, init];\n const extraHeaders = extraRequestHeaders.reduce((headers, current) => ({ ...headers, ...current }), {});\n if (isRequest(input) && (!init || !init.headers)) {\n mergeInputRequestHeaders(extraHeaders, input);\n }\n else {\n init = mergeInitRequestHeaders(extraHeaders, init);\n }\n return [input, init];\n}\nfunction mergeInputRequestHeaders(extraRequestHeaders, input) {\n for (const [name, value] of Object.entries(extraRequestHeaders)) {\n if (!input.headers.has(name)) {\n input.headers.set(name, value);\n }\n }\n}\nfunction mergeInitRequestHeaders(extraRequestHeaders, init) {\n if (!init)\n init = {};\n if (isHeadersInstance(init.headers)) {\n for (const [name, value] of Object.entries(extraRequestHeaders)) {\n if (!init.headers.has(name)) {\n init.headers.set(name, value);\n }\n }\n return init;\n }\n else {\n return { ...init, headers: { ...extraRequestHeaders, ...init.headers } };\n }\n}\n\nexport { createFetchRequestTracker as default };\n","import { isObject } from '@bugsnag/core-performance';\n\nconst defaultSendPageAttributes = {\n referrer: true,\n title: true,\n url: true\n};\nfunction getPermittedAttributes(sendPageAttributes) {\n return {\n ...defaultSendPageAttributes,\n ...sendPageAttributes\n };\n}\nfunction isSendPageAttributes(obj) {\n const allowedTypes = ['undefined', 'boolean'];\n const keys = Object.keys(defaultSendPageAttributes);\n return isObject(obj) && keys.every(key => allowedTypes.includes(typeof obj[key]));\n}\n\nexport { defaultSendPageAttributes, getPermittedAttributes, isSendPageAttributes };\n","function shouldOmitSpan(startTime, endTime) {\n return (startTime === undefined || endTime === undefined) ||\n (startTime === 0 && endTime === 0);\n}\nconst instrumentPageLoadPhaseSpans = (spanFactory, performance, route, parentContext) => {\n function createPageLoadPhaseSpan(phase, startTime, endTime) {\n if (shouldOmitSpan(startTime, endTime))\n return;\n const span = spanFactory.startSpan(`[PageLoadPhase/${phase}]${route}`, {\n startTime,\n parentContext,\n makeCurrentContext: false\n });\n span.setAttribute('bugsnag.span.category', 'page_load_phase');\n span.setAttribute('bugsnag.phase', phase);\n spanFactory.endSpan(span, endTime);\n }\n const entries = performance.getEntriesByType('navigation');\n const entry = Array.isArray(entries) && entries[0];\n if (entry) {\n createPageLoadPhaseSpan('Unload', entry.unloadEventStart, entry.unloadEventEnd);\n createPageLoadPhaseSpan('Redirect', entry.redirectStart, entry.redirectEnd);\n createPageLoadPhaseSpan('LoadFromCache', entry.fetchStart, entry.domainLookupStart);\n createPageLoadPhaseSpan('DNSLookup', entry.domainLookupStart, entry.domainLookupEnd);\n // secureConectionStart will be 0 if no secure connection is used so use connectEnd in that case\n const TCPHandshakeEnd = entry.secureConnectionStart || entry.connectEnd;\n createPageLoadPhaseSpan('TCPHandshake', entry.connectStart, TCPHandshakeEnd);\n createPageLoadPhaseSpan('TLS', entry.secureConnectionStart, entry.connectEnd);\n createPageLoadPhaseSpan('HTTPRequest', entry.requestStart, entry.responseStart);\n createPageLoadPhaseSpan('HTTPResponse', entry.responseStart, entry.responseEnd);\n createPageLoadPhaseSpan('DomContentLoadedEvent', entry.domContentLoadedEventStart, entry.domContentLoadedEventEnd);\n createPageLoadPhaseSpan('LoadEvent', entry.loadEventStart, entry.loadEventEnd);\n }\n};\n\nexport { instrumentPageLoadPhaseSpans };\n","import { getAbsoluteUrl } from '@bugsnag/request-tracker-performance';\n\nconst defaultRouteResolver = (url) => url.pathname || '/';\nconst createNoopRoutingProvider = () => {\n return class NoopRoutingProvider {\n constructor(resolveRoute = defaultRouteResolver) {\n this.resolveRoute = resolveRoute;\n }\n listenForRouteChanges(startRouteChangeSpan) { }\n };\n};\nconst createDefaultRoutingProvider = (onSettle, location) => {\n return class DefaultRoutingProvider {\n constructor(resolveRoute = defaultRouteResolver) {\n this.resolveRoute = resolveRoute;\n }\n listenForRouteChanges(startRouteChangeSpan) {\n addEventListener('popstate', (ev) => {\n const url = new URL(location.href);\n const span = startRouteChangeSpan(url, 'popstate');\n onSettle((endTime) => {\n span.end(endTime);\n });\n });\n const originalPushState = history.pushState;\n history.pushState = function (...args) {\n const url = args[2];\n if (url) {\n const absoluteURL = new URL(getAbsoluteUrl(url.toString(), document.baseURI));\n const span = startRouteChangeSpan(absoluteURL, 'pushState');\n onSettle((endTime) => {\n span.end(endTime);\n });\n }\n originalPushState.apply(this, args);\n };\n }\n };\n};\n\nexport { createDefaultRoutingProvider, createNoopRoutingProvider, defaultRouteResolver };\n","import { getPermittedAttributes } from '../send-page-attributes.js';\nimport { instrumentPageLoadPhaseSpans } from './page-load-phase-spans.js';\nimport { defaultRouteResolver } from '../default-routing-provider.js';\n\nclass FullPageLoadPlugin {\n constructor(document, location, spanFactory, webVitals, onSettle, backgroundingListener, performance) {\n // if the page was backgrounded at any point in the loading process a page\n // load span is invalidated as the browser will deprioritise the page\n this.wasBackgrounded = false;\n this.document = document;\n this.location = location;\n this.spanFactory = spanFactory;\n this.webVitals = webVitals;\n this.onSettle = onSettle;\n this.performance = performance;\n backgroundingListener.onStateChange(state => {\n if (!this.wasBackgrounded && state === 'in-background') {\n this.wasBackgrounded = true;\n }\n });\n }\n configure(configuration) {\n // don't report a page load span if the option is turned off or the page was\n // backgrounded at any point in the loading process\n if (!configuration.autoInstrumentFullPageLoads || this.wasBackgrounded) {\n return;\n }\n let parentContext = null;\n const traceparentMetaTag = document.querySelector('meta[name=\"traceparent\"]');\n if (traceparentMetaTag !== null && traceparentMetaTag.getAttribute('content')) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const traceparent = traceparentMetaTag.getAttribute('content');\n const [, traceId, parentSpanId] = traceparent.split('-');\n parentContext = {\n traceId,\n id: parentSpanId\n };\n }\n const span = this.spanFactory.startSpan('[FullPageLoad]', { startTime: 0, parentContext });\n const permittedAttributes = getPermittedAttributes(configuration.sendPageAttributes);\n const url = new URL(this.location.href);\n this.onSettle((endTime) => {\n if (this.wasBackgrounded)\n return;\n // ensure there's always a route on this span by falling back to the\n // default route resolver - the pipeline will ignore page load spans that\n // don't have a route\n const route = configuration.routingProvider.resolveRoute(url) || defaultRouteResolver(url);\n span.name += route;\n instrumentPageLoadPhaseSpans(this.spanFactory, this.performance, route, span);\n // Browser attributes\n span.setAttribute('bugsnag.span.category', 'full_page_load');\n span.setAttribute('bugsnag.browser.page.route', route);\n if (permittedAttributes.referrer)\n span.setAttribute('bugsnag.browser.page.referrer', this.document.referrer);\n if (permittedAttributes.title)\n span.setAttribute('bugsnag.browser.page.title', this.document.title);\n if (permittedAttributes.url)\n span.setAttribute('bugsnag.browser.page.url', url.toString());\n this.webVitals.attachTo(span);\n this.spanFactory.endSpan(span, endTime);\n });\n }\n}\n\nexport { FullPageLoadPlugin };\n","function defaultNetworkRequestCallback(networkRequestInfo) {\n return networkRequestInfo;\n}\nfunction isNetworkRequestCallback(value) {\n return typeof value === 'function';\n}\n\nexport { defaultNetworkRequestCallback, isNetworkRequestCallback };\n","import { traceIdToSamplingRate } from '@bugsnag/core-performance';\nimport { defaultNetworkRequestCallback } from '@bugsnag/request-tracker-performance';\n\nconst permittedPrefixes = ['http://', 'https://', '/', './', '../'];\nclass NetworkRequestPlugin {\n constructor(spanFactory, spanContextStorage, fetchTracker, xhrTracker) {\n this.spanFactory = spanFactory;\n this.spanContextStorage = spanContextStorage;\n this.fetchTracker = fetchTracker;\n this.xhrTracker = xhrTracker;\n this.configEndpoint = '';\n this.networkRequestCallback = defaultNetworkRequestCallback;\n this.logger = { debug: console.debug, warn: console.warn, info: console.info, error: console.error };\n this.trackRequest = (startContext) => {\n if (!this.shouldTrackRequest(startContext))\n return;\n const shouldPropagateTraceContextByDefault = false;\n const defaultRequestInfo = {\n url: startContext.url,\n type: startContext.type,\n propagateTraceContext: shouldPropagateTraceContextByDefault\n };\n const networkRequestInfo = this.networkRequestCallback(defaultRequestInfo);\n // returning null neither creates a span nor propagates trace context\n if (!networkRequestInfo) {\n return {\n onRequestEnd: undefined,\n extraRequestHeaders: undefined\n };\n }\n if (networkRequestInfo.propagateTraceContext === undefined) {\n networkRequestInfo.propagateTraceContext = shouldPropagateTraceContextByDefault;\n }\n // a span is not created if url is null\n if (!networkRequestInfo.url) {\n return {\n onRequestEnd: undefined,\n // propagate trace context if requested using span context\n extraRequestHeaders: networkRequestInfo.propagateTraceContext ? this.getExtraRequestHeaders() : undefined\n };\n }\n // otherwise, create a span and propagate trace context if requested\n if (typeof networkRequestInfo.url !== 'string') {\n this.logger.warn(`expected url to be a string following network request callback, got ${typeof networkRequestInfo.url}`);\n return;\n }\n const span = this.spanFactory.startNetworkSpan({\n method: startContext.method,\n startTime: startContext.startTime,\n url: networkRequestInfo.url\n });\n return {\n onRequestEnd: (endContext) => {\n if (endContext.state === 'success') {\n this.spanFactory.endSpan(span, endContext.endTime, { 'http.status_code': endContext.status });\n }\n },\n // propagate trace context using network span\n extraRequestHeaders: networkRequestInfo.propagateTraceContext\n ? this.getExtraRequestHeaders(span)\n : undefined\n };\n };\n }\n configure(configuration) {\n this.logger = configuration.logger;\n if (configuration.autoInstrumentNetworkRequests) {\n this.configEndpoint = configuration.endpoint;\n this.xhrTracker.onStart(this.trackRequest);\n this.fetchTracker.onStart(this.trackRequest);\n this.networkRequestCallback = configuration.networkRequestCallback;\n }\n }\n shouldTrackRequest(startContext) {\n return startContext.url !== this.configEndpoint && permittedPrefixes.some((prefix) => startContext.url.startsWith(prefix));\n }\n getExtraRequestHeaders(span) {\n const extraRequestHeaders = {};\n if (span) {\n const traceId = span.traceId;\n const parentSpanId = span.id;\n const sampled = this.spanFactory.sampler.shouldSample(span.samplingRate);\n extraRequestHeaders.traceparent = buildTraceparentHeader(traceId, parentSpanId, sampled);\n extraRequestHeaders.tracestate = buildTracestateHeader(traceId);\n }\n else if (this.spanContextStorage.current) {\n const currentSpanContext = this.spanContextStorage.current;\n const traceId = currentSpanContext.traceId;\n const parentSpanId = currentSpanContext.id;\n const sampled = this.spanFactory.sampler.shouldSample(currentSpanContext.samplingRate);\n extraRequestHeaders.traceparent = buildTraceparentHeader(traceId, parentSpanId, sampled);\n extraRequestHeaders.tracestate = buildTracestateHeader(traceId);\n }\n return extraRequestHeaders;\n }\n}\nfunction buildTraceparentHeader(traceId, parentSpanId, sampled) {\n return `00-${traceId}-${parentSpanId}-${sampled ? '01' : '00'}`;\n}\nfunction buildTracestateHeader(traceId) {\n return `sb=v:1;r32:${traceIdToSamplingRate(traceId)}`;\n}\n\nexport { NetworkRequestPlugin };\n","function getHttpVersion(protocol) {\n switch (protocol) {\n case '':\n return undefined;\n case 'http/1.0':\n return '1.0';\n case 'http/1.1':\n return '1.1';\n case 'h2':\n case 'h2c':\n return '2.0';\n case 'h3':\n return '3.0';\n case 'spdy/1':\n case 'spdy/2':\n case 'spdy/3':\n return 'SPDY';\n default:\n return protocol;\n }\n}\nfunction resourceLoadSupported(PerformanceObserverClass) {\n return PerformanceObserverClass &&\n Array.isArray(PerformanceObserverClass.supportedEntryTypes) &&\n PerformanceObserverClass.supportedEntryTypes.includes('resource');\n}\nclass ResourceLoadPlugin {\n constructor(spanFactory, spanContextStorage, PerformanceObserverClass) {\n this.spanFactory = spanFactory;\n this.spanContextStorage = spanContextStorage;\n this.PerformanceObserverClass = PerformanceObserverClass;\n }\n configure(configuration) {\n if (!resourceLoadSupported(this.PerformanceObserverClass))\n return;\n const observer = new this.PerformanceObserverClass((list) => {\n const entries = list.getEntries();\n for (const entry of entries) {\n if (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest') {\n continue;\n }\n const parentContext = this.spanContextStorage.first;\n if (parentContext) {\n const networkRequestInfo = configuration.networkRequestCallback({ url: entry.name, type: entry.initiatorType });\n if (!networkRequestInfo)\n return;\n if (typeof networkRequestInfo.url !== 'string') {\n configuration.logger.warn(`expected url to be a string following network request callback, got ${typeof networkRequestInfo.url}`);\n return;\n }\n let name = '';\n try {\n const url = new URL(networkRequestInfo.url);\n url.search = '';\n name = url.href;\n }\n catch (err) {\n configuration.logger.warn(`Unable to parse URL returned from networkRequestCallback: ${networkRequestInfo.url}`);\n return;\n }\n const span = this.spanFactory.startSpan(`[ResourceLoad]${name}`, {\n parentContext,\n startTime: entry.startTime,\n makeCurrentContext: false\n });\n span.setAttribute('bugsnag.span.category', 'resource_load');\n span.setAttribute('http.url', networkRequestInfo.url);\n const httpFlavor = getHttpVersion(entry.nextHopProtocol);\n if (httpFlavor) {\n span.setAttribute('http.flavor', httpFlavor);\n }\n if (entry.encodedBodySize && entry.decodedBodySize) {\n span.setAttribute('http.response_content_length', entry.encodedBodySize);\n span.setAttribute('http.response_content_length_uncompressed', entry.decodedBodySize);\n }\n if (entry.responseStatus) {\n span.setAttribute('http.status_code', entry.responseStatus);\n }\n this.spanFactory.endSpan(span, entry.responseEnd);\n }\n }\n });\n try {\n observer.observe({ type: 'resource', buffered: true });\n }\n catch (err) {\n configuration.logger.warn('Unable to get previous resource loads as buffered observer not supported, only showing resource loads from this point on');\n observer.observe({ entryTypes: ['resource'] });\n }\n }\n}\n\nexport { ResourceLoadPlugin, getHttpVersion };\n","import { isObject, isString, coreSpanOptionSchema } from '@bugsnag/core-performance';\nimport { getPermittedAttributes } from '../send-page-attributes.js';\nimport { defaultRouteResolver } from '../default-routing-provider.js';\n\n// exclude isFirstClass from the route change option schema\nconst { startTime, parentContext, makeCurrentContext } = coreSpanOptionSchema;\nconst routeChangeSpanOptionSchema = {\n startTime,\n parentContext,\n makeCurrentContext,\n trigger: {\n getDefaultValue: (value) => String(value),\n message: 'should be a string',\n validate: isString\n }\n};\nclass RouteChangePlugin {\n constructor(spanFactory, location, document) {\n this.spanFactory = spanFactory;\n this.location = location;\n this.document = document;\n }\n configure(configuration) {\n if (!configuration.autoInstrumentRouteChanges)\n return;\n const previousUrl = new URL(this.location.href);\n let previousRoute = configuration.routingProvider.resolveRoute(previousUrl) || defaultRouteResolver(previousUrl);\n const permittedAttributes = getPermittedAttributes(configuration.sendPageAttributes);\n configuration.routingProvider.listenForRouteChanges((url, trigger, options) => {\n let absoluteUrl;\n if (url instanceof URL) {\n absoluteUrl = url;\n }\n else {\n try {\n const stringUrl = String(url);\n absoluteUrl = new URL(stringUrl);\n }\n catch (err) {\n configuration.logger.warn('Invalid span options\\n - url should be a URL');\n return {\n id: '',\n name: '',\n traceId: '',\n samplingRate: 0,\n isValid: () => false,\n setAttribute: () => { },\n end: () => { }\n };\n }\n }\n // create internal options for validation\n const routeChangeSpanOptions = {\n ...options,\n trigger\n };\n const cleanOptions = this.spanFactory.validateSpanOptions('[RouteChange]', routeChangeSpanOptions, routeChangeSpanOptionSchema);\n const route = configuration.routingProvider.resolveRoute(absoluteUrl) || defaultRouteResolver(absoluteUrl);\n // update the span name using the validated route\n cleanOptions.name += route;\n const span = this.spanFactory.startSpan(cleanOptions.name, cleanOptions.options);\n span.setAttribute('bugsnag.span.category', 'route_change');\n span.setAttribute('bugsnag.browser.page.route', route);\n span.setAttribute('bugsnag.browser.page.previous_route', previousRoute);\n span.setAttribute('bugsnag.browser.page.route_change.trigger', cleanOptions.options.trigger);\n if (permittedAttributes.url)\n span.setAttribute('bugsnag.browser.page.url', url.toString());\n previousRoute = route;\n return {\n get id() {\n return span.id;\n },\n get traceId() {\n return span.traceId;\n },\n get samplingRate() {\n return span.samplingRate;\n },\n get name() {\n return span.name;\n },\n isValid: span.isValid,\n setAttribute: span.setAttribute,\n end: (endTimeOrOptions) => {\n const options = isObject(endTimeOrOptions) ? endTimeOrOptions : { endTime: endTimeOrOptions };\n if (permittedAttributes.title) {\n span.setAttribute('bugsnag.browser.page.title', this.document.title);\n }\n if (options.url) {\n const urlObject = ensureUrl(options.url); // convert strings to URL if necessary\n const route = configuration.routingProvider.resolveRoute(urlObject) || defaultRouteResolver(urlObject);\n span.name = `[RouteChange]${route}`;\n span.setAttribute('bugsnag.browser.page.route', route);\n previousRoute = route;\n // update the URL attribute as well\n if (permittedAttributes.url) {\n span.setAttribute('bugsnag.browser.page.url', urlObject.toString());\n }\n }\n this.spanFactory.toPublicApi(span).end(options.endTime);\n }\n };\n });\n }\n}\nfunction ensureUrl(url) {\n if (typeof url === 'string') {\n return new URL(url);\n }\n return url;\n}\n\nexport { RouteChangePlugin };\n","import { millisecondsToNanoseconds } from '@bugsnag/core-performance';\n\n// maximum allowed clock divergence in milliseconds\nconst MAX_CLOCK_DRIFT_MS = 300000;\nfunction recalculateTimeOrigin(timeOrigin, performance) {\n // if the machine has been sleeping the monatomic clock used by performance.now() may have been paused,\n // so we need to check if this has drifted significantly from Date.now()\n // if the drift is > 5 minutes re-set the clock's origin to bring it back in line with Date.now()\n if (Math.abs(Date.now() - (timeOrigin + performance.now())) > MAX_CLOCK_DRIFT_MS) {\n return Date.now() - performance.now();\n }\n return timeOrigin;\n}\nfunction createClock(performance, backgroundingListener) {\n const initialTimeOrigin = performance.timeOrigin === undefined\n ? performance.timing.navigationStart\n : performance.timeOrigin;\n // the performance clock could be shared between different tabs running in the same process\n // so may already have diverged - for this reason we calculate a time origin when we first create the clock\n // as well as when the app returns to the foreground\n let calculatedTimeOrigin = recalculateTimeOrigin(initialTimeOrigin, performance);\n backgroundingListener.onStateChange(state => {\n if (state === 'in-foreground') {\n calculatedTimeOrigin = recalculateTimeOrigin(calculatedTimeOrigin, performance);\n }\n });\n return {\n now: () => performance.now(),\n date: () => new Date(calculatedTimeOrigin + performance.now()),\n convert: (date) => date.getTime() - calculatedTimeOrigin,\n // convert milliseconds since timeOrigin to full timestamp\n toUnixTimestampNanoseconds: (time) => millisecondsToNanoseconds(calculatedTimeOrigin + time).toString()\n };\n}\n\nexport { createClock as default };\n","import { isObject } from '@bugsnag/core-performance';\n\nconst isRoutingProvider = (value) => isObject(value) &&\n typeof value.resolveRoute === 'function' &&\n typeof value.listenForRouteChanges === 'function';\n\nexport { isRoutingProvider };\n","function toHex(value) {\n const hex = value.toString(16);\n // pad hex with a leading 0 if it's not already 2 characters\n if (hex.length === 1) {\n return '0' + hex;\n }\n return hex;\n}\nconst idGenerator = {\n generate(bits) {\n const bytes = new Uint8Array(bits / 8);\n // TODO: do we just read window here?\n // how can we pass this in given it needs to be valid before 'start' is called?\n const randomValues = window.crypto.getRandomValues(bytes);\n return Array.from(randomValues, toHex).join('');\n }\n};\n\nexport { idGenerator as default };\n","class Settler {\n constructor(clock) {\n this.settled = false;\n this.callbacks = new Set();\n this.clock = clock;\n }\n subscribe(callback) {\n this.callbacks.add(callback);\n // if we're already settled, call the callback immediately\n if (this.isSettled()) {\n callback(this.clock.now());\n }\n }\n unsubscribe(callback) {\n this.callbacks.delete(callback);\n }\n isSettled() {\n return this.settled;\n }\n settle(settledTime) {\n this.settled = true;\n for (const callback of this.callbacks) {\n callback(settledTime);\n }\n }\n}\n\nexport { Settler };\n","import { Settler } from './settler.js';\n\nclass DomMutationSettler extends Settler {\n constructor(clock, target) {\n super(clock);\n this.timeout = undefined;\n const observer = new MutationObserver(() => { this.restart(); });\n observer.observe(target, {\n subtree: true,\n childList: true,\n characterData: true\n // we don't track attribute changes as they may or may not be user visible\n // so we assume they won't affect the page appearing settled to the user\n });\n this.restart();\n }\n restart() {\n clearTimeout(this.timeout);\n this.settled = false;\n // we wait 100ms to ensure that DOM mutations have actually stopped but\n // don't want the settled time to reflect that wait, so we record the time\n // here and use that when settling\n const settledTime = this.clock.now();\n this.timeout = setTimeout(() => { this.settle(settledTime); }, 100);\n }\n}\n\nexport { DomMutationSettler as default };\n","import { Settler } from './settler.js';\n\n// check if a PerformanceEntry is a PerformanceNavigationTiming\nfunction isPerformanceNavigationTiming(entry) {\n return !!entry && entry.entryType === 'navigation';\n}\nclass LoadEventEndSettler extends Settler {\n constructor(clock, addEventListener, performance, document) {\n super(clock);\n // we delay settling by a macrotask so that the load event has ended\n // see: https://stackoverflow.com/questions/25915634/difference-between-microtask-and-macrotask-within-an-event-loop-context/25933985#25933985\n // https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/\n if (document.readyState === 'complete') {\n setTimeout(() => { this.settleUsingPerformance(performance); }, 0);\n }\n else {\n addEventListener('load', () => {\n setTimeout(() => { this.settleUsingPerformance(performance); }, 0);\n });\n }\n }\n settleUsingPerformance(performance) {\n const now = this.clock.now();\n // there's only ever one navigation entry\n // PLAT-10204 Prevent snags occuring due to DOM scanning bots like BuiltWith https://builtwith.com/biup\n const entry = typeof performance.getEntriesByType === 'function' ? performance.getEntriesByType('navigation')[0] : undefined;\n let settledTime = 0;\n if (isPerformanceNavigationTiming(entry)) {\n settledTime = entry.loadEventEnd;\n }\n else if (performance.timing) {\n settledTime = performance.timing.loadEventEnd - performance.timing.navigationStart;\n }\n // if the settled time is obviously wrong then use the current time instead\n // this won't be a perfectly accurate value, but it should be close enough\n // for this purpose\n if (settledTime <= 0 || settledTime > now) {\n settledTime = now;\n }\n this.settle(settledTime);\n }\n}\n\nexport { LoadEventEndSettler as default };\n","import { Settler } from './settler.js';\n\nclass RequestSettler extends Settler {\n constructor(clock, requestTracker) {\n super(clock);\n this.timeout = undefined;\n this.urlsToIgnore = [];\n this.outstandingRequests = 0;\n // unlike most other settlers we start settled as it's possible to not make\n // any requests at all\n // TODO: we actually should only be settled if there are no outstanding\n // requests when constructed\n this.settled = true;\n requestTracker.onStart(this.onRequestStart.bind(this));\n }\n setUrlsToIgnore(urlsToIgnore) {\n this.urlsToIgnore = urlsToIgnore;\n }\n onRequestStart(startContext) {\n // if this is an excluded URL, ignore this request\n if (this.shouldIgnoreUrl(startContext.url))\n return;\n clearTimeout(this.timeout);\n this.settled = false;\n ++this.outstandingRequests;\n return {\n onRequestEnd: (endContext) => {\n if (--this.outstandingRequests === 0) {\n // we wait 100ms to ensure that requests have actually stopped but don't\n // want the settled time to reflect that wait, so we record the time\n // here and use that when settling\n const settledTime = this.clock.now();\n this.timeout = setTimeout(() => { this.settle(settledTime); }, 100);\n }\n }\n };\n }\n shouldIgnoreUrl(url) {\n return this.urlsToIgnore.some(regexp => regexp.test(url));\n }\n}\n\nexport { RequestSettler as default };\n","import { Settler } from './settler.js';\n\n/**\n * SettlerAggregate is a Settler that is settled when ALL Settlers it is\n * constructed with are settled themselves\n */\nclass SettlerAggregate extends Settler {\n constructor(clock, settlers) {\n super(clock);\n this.settlers = settlers;\n for (const settler of settlers) {\n settler.subscribe((settledTime) => {\n // we need to check if all of the settlers are settled here as a\n // previously settled settler could have unsettled in the meantime\n if (this.settlersAreSettled()) {\n this.settle(settledTime);\n }\n else {\n this.settled = false;\n }\n });\n }\n }\n isSettled() {\n // ensure all child settlers are settled as well; it's possible for all of\n // them to have settled previously only for one to unsettle\n return super.isSettled() && this.settlersAreSettled();\n }\n settlersAreSettled() {\n for (const settler of this.settlers) {\n if (!settler.isSettled()) {\n return false;\n }\n }\n return true;\n }\n}\n\nexport { SettlerAggregate as default };\n","import { InMemoryPersistence, toPersistedPayload } from '@bugsnag/core-performance';\n\nfunction makeBrowserPersistence(window) {\n // accessing localStorage can throw on some browsers, so we have to catch\n // these errors and provide a fallback\n try {\n if (window.localStorage) {\n return new BrowserPersistence(window.localStorage);\n }\n }\n catch (_a) { }\n // store items in memory if localStorage isn't available\n return new InMemoryPersistence();\n}\nfunction toString(key, value) {\n switch (key) {\n case 'bugsnag-sampling-probability':\n return JSON.stringify(value);\n case 'bugsnag-anonymous-id':\n return value;\n default:\n return key;\n }\n}\nclass BrowserPersistence {\n constructor(localStorage) {\n this.storage = localStorage;\n }\n async load(key) {\n try {\n const raw = this.storage.getItem(key);\n if (raw) {\n return toPersistedPayload(key, raw);\n }\n }\n catch (_a) { }\n }\n async save(key, value) {\n try {\n this.storage.setItem(key, toString(key, value));\n }\n catch (_a) { }\n }\n}\n\nexport { makeBrowserPersistence as default };\n","class WebVitals {\n constructor(performance, clock, PerformanceObserverClass) {\n this.performance = performance;\n this.clock = clock;\n this.observers = [];\n if (PerformanceObserverClass && Array.isArray(PerformanceObserverClass.supportedEntryTypes)) {\n const supportedEntryTypes = PerformanceObserverClass.supportedEntryTypes;\n if (supportedEntryTypes.includes('largest-contentful-paint')) {\n this.observeLargestContentfulPaint(PerformanceObserverClass);\n }\n if (supportedEntryTypes.includes('layout-shift')) {\n this.observeLayoutShift(PerformanceObserverClass);\n }\n }\n }\n attachTo(span) {\n const firstContentfulPaint = this.firstContentfulPaint();\n if (firstContentfulPaint) {\n span.addEvent('fcp', firstContentfulPaint);\n }\n const timeToFirstByte = this.timeToFirstByte();\n if (timeToFirstByte) {\n span.addEvent('ttfb', timeToFirstByte);\n }\n const firstInputDelay = this.firstInputDelay();\n if (firstInputDelay) {\n span.addEvent('fid_start', firstInputDelay.start);\n span.addEvent('fid_end', firstInputDelay.end);\n }\n if (this.cumulativeLayoutShift) {\n span.setAttribute('bugsnag.metrics.cls', this.cumulativeLayoutShift);\n }\n if (this.largestContentfulPaint) {\n span.addEvent('lcp', this.largestContentfulPaint);\n }\n // as there is only 1 page load span, we don't need to keep observing\n // performance events, so can disconnect from any observers we've registered\n for (const observer of this.observers) {\n observer.disconnect();\n }\n }\n firstContentfulPaint() {\n const entries = this.performance.getEntriesByName('first-contentful-paint', 'paint');\n const entry = Array.isArray(entries) && entries[0];\n if (entry) {\n return entry.startTime;\n }\n }\n timeToFirstByte() {\n const entries = this.performance.getEntriesByType('navigation');\n const entry = Array.isArray(entries) && entries[0];\n let responseStart;\n if (entry) {\n responseStart = entry.responseStart;\n }\n else {\n responseStart = this.performance.timing.responseStart - this.performance.timing.navigationStart;\n }\n // only use responseStart if it's valid (between 0 and the current time)\n // any other value cannot be valid because it would mean the response\n // started immediately or hasn't happened yet!\n if (responseStart > 0 && responseStart <= this.clock.now()) {\n return responseStart;\n }\n }\n firstInputDelay() {\n const entries = this.performance.getEntriesByType('first-input');\n const entry = Array.isArray(entries) && entries[0];\n if (entry) {\n return {\n start: entry.startTime,\n end: entry.processingStart\n };\n }\n }\n observeLargestContentfulPaint(PerformanceObserverClass) {\n const observer = new PerformanceObserverClass((list) => {\n const entries = list.getEntries();\n if (entries.length > 0) {\n // Use the latest LCP candidate\n this.largestContentfulPaint = entries[entries.length - 1].startTime;\n }\n });\n observer.observe({ type: 'largest-contentful-paint', buffered: true });\n this.observers.push(observer);\n }\n observeLayoutShift(PerformanceObserverClass) {\n let session;\n const observer = new PerformanceObserverClass((list) => {\n for (const entry of list.getEntries()) {\n // ignore entries with recent input as it's likely the layout shifted due\n // to user input and this metric only cares about unexpected layout\n // shifts\n if (entry.hadRecentInput) {\n continue;\n }\n // include this entry in the current session if we have a current session\n // and this entry fits into the session window (it occurred less than 1\n // second after the previous entry and the session duration is less than\n // 5 seconds), otherwise start a new session\n if (session &&\n entry.startTime - session.previousStartTime < 1000 &&\n entry.startTime - session.firstStartTime < 5000) {\n session.value += entry.value;\n session.previousStartTime = entry.startTime;\n }\n else {\n session = {\n value: entry.value,\n firstStartTime: entry.startTime,\n previousStartTime: entry.startTime\n };\n }\n }\n if (session &&\n (this.cumulativeLayoutShift === undefined || session.value > this.cumulativeLayoutShift)) {\n this.cumulativeLayoutShift = session.value;\n }\n });\n observer.observe({ type: 'layout-shift', buffered: true });\n this.observers.push(observer);\n }\n}\n\nexport { WebVitals };\n","import { createNoopClient, createClient, InMemoryQueue } from '@bugsnag/core-performance';\nimport createFetchDeliveryFactory from '@bugsnag/delivery-fetch-performance';\nimport { createFetchRequestTracker, createXmlHttpRequestTracker } from '@bugsnag/request-tracker-performance';\nimport { FullPageLoadPlugin } from './auto-instrumentation/full-page-load-plugin.js';\nimport { NetworkRequestPlugin } from './auto-instrumentation/network-request-plugin.js';\nimport { ResourceLoadPlugin } from './auto-instrumentation/resource-load-plugin.js';\nimport { RouteChangePlugin } from './auto-instrumentation/route-change-plugin.js';\nimport createBrowserBackgroundingListener from './backgrounding-listener.js';\nimport createClock from './clock.js';\nimport { createSchema } from './config.js';\nimport { createNoopRoutingProvider, createDefaultRoutingProvider } from './default-routing-provider.js';\nimport idGenerator from './id-generator.js';\nimport createOnSettle, { createNoopOnSettle } from './on-settle/index.js';\nimport makeBrowserPersistence from './persistence.js';\nimport createResourceAttributesSource from './resource-attributes-source.js';\nimport { createSpanAttributesSource } from './span-attributes-source.js';\nimport { WebVitals } from './web-vitals.js';\n\nlet onSettle;\nlet DefaultRoutingProvider;\nlet BugsnagPerformance;\nif (typeof window === 'undefined' || typeof document === 'undefined') {\n onSettle = createNoopOnSettle();\n DefaultRoutingProvider = createNoopRoutingProvider();\n BugsnagPerformance = createNoopClient();\n}\nelse {\n const backgroundingListener = createBrowserBackgroundingListener(window);\n const spanAttributesSource = createSpanAttributesSource(document);\n const clock = createClock(performance, backgroundingListener);\n const persistence = makeBrowserPersistence(window);\n const resourceAttributesSource = createResourceAttributesSource(navigator, persistence);\n const fetchRequestTracker = createFetchRequestTracker(window, clock);\n const xhrRequestTracker = createXmlHttpRequestTracker(XMLHttpRequest, clock, document);\n const webVitals = new WebVitals(performance, clock, window.PerformanceObserver);\n onSettle = createOnSettle(clock, window, fetchRequestTracker, xhrRequestTracker, performance);\n DefaultRoutingProvider = createDefaultRoutingProvider(onSettle, window.location);\n BugsnagPerformance = createClient({\n backgroundingListener,\n clock,\n resourceAttributesSource,\n spanAttributesSource,\n deliveryFactory: createFetchDeliveryFactory(window.fetch, clock, backgroundingListener),\n idGenerator,\n schema: createSchema(window.location.hostname, new DefaultRoutingProvider()),\n plugins: (spanFactory, spanContextStorage) => [\n onSettle,\n new FullPageLoadPlugin(document, window.location, spanFactory, webVitals, onSettle, backgroundingListener, performance),\n // ResourceLoadPlugin should always come after FullPageLoad plugin, as it should use that\n // span context as the parent of it's spans\n new ResourceLoadPlugin(spanFactory, spanContextStorage, window.PerformanceObserver),\n new NetworkRequestPlugin(spanFactory, spanContextStorage, fetchRequestTracker, xhrRequestTracker),\n new RouteChangePlugin(spanFactory, window.location, document)\n ],\n persistence,\n retryQueueFactory: (delivery, retryQueueMaxSize) => new InMemoryQueue(delivery, retryQueueMaxSize)\n });\n}\nconst BugsnagPerformance$1 = BugsnagPerformance;\n\nexport { DefaultRoutingProvider, BugsnagPerformance$1 as default, onSettle };\n","import DomMutationSettler from './dom-mutation-settler.js';\nimport LoadEventEndSettler from './load-event-end-settler.js';\nimport RequestSettler from './request-settler.js';\nimport SettlerAggregate from './settler-aggregate.js';\n\nconst TIMEOUT_MILLISECONDS = 60 * 1000;\nfunction createNoopOnSettle() {\n const noop = () => { };\n noop.configure = () => { };\n return noop;\n}\nfunction createOnSettle(clock, window, fetchRequestTracker, xhrRequestTracker, performance) {\n const domMutationSettler = new DomMutationSettler(clock, window.document);\n const fetchRequestSettler = new RequestSettler(clock, fetchRequestTracker);\n const xhrRequestSettler = new RequestSettler(clock, xhrRequestTracker);\n const loadEventEndSettler = new LoadEventEndSettler(clock, window.addEventListener, performance, window.document);\n const settler = new SettlerAggregate(clock, [\n domMutationSettler,\n loadEventEndSettler,\n fetchRequestSettler,\n xhrRequestSettler\n ]);\n function onSettlePlugin(callback) {\n const onSettle = (settledTime) => {\n clearTimeout(timeout);\n // unsubscribe from the settler so we don't call the callback more than\n // once\n settler.unsubscribe(onSettle);\n callback(settledTime);\n };\n const timeout = setTimeout(() => {\n const settledTime = clock.now();\n settler.unsubscribe(onSettle);\n callback(settledTime);\n }, TIMEOUT_MILLISECONDS);\n // if we're already settled apply a 100ms \"cooldown\" period in case we\n // unsettle immediately after this call\n // if we're not settled then this cooldown is irrelevant - we can just\n // subscribe to the settler to be notified of when the page settles\n const cooldown = settler.isSettled() ? 100 : 0;\n const settledTime = clock.now();\n setTimeout(() => {\n if (settler.isSettled()) {\n // if we're still settled call the callback via \"onSettle\"\n onSettle(settledTime);\n }\n else {\n // otherwise wait for the page to settle\n settler.subscribe(onSettle);\n }\n }, cooldown);\n }\n onSettlePlugin.configure = function (configuration) {\n const settleIgnoreUrls = configuration.settleIgnoreUrls.map((url) => typeof url === 'string' ? RegExp(url) : url).concat(RegExp(configuration.endpoint));\n fetchRequestSettler.setUrlsToIgnore(settleIgnoreUrls);\n xhrRequestSettler.setUrlsToIgnore(settleIgnoreUrls);\n };\n return onSettlePlugin;\n}\n\nexport { createNoopOnSettle, createOnSettle as default };\n","import { BatchProcessor } from './batch-processor.js';\nimport { validateConfig, schema } from './config.js';\nimport { TracePayloadEncoder } from './delivery.js';\nimport FixedProbabilityManager from './fixed-probability-manager.js';\nimport ProbabilityFetcher from './probability-fetcher.js';\nimport ProbabilityManager from './probability-manager.js';\nimport { BufferingProcessor } from './processor.js';\nimport Sampler from './sampler.js';\nimport { DefaultSpanContextStorage } from './span-context.js';\nimport { SpanFactory } from './span-factory.js';\nimport { timeToNumber } from './time.js';\n\nfunction createClient(options) {\n const bufferingProcessor = new BufferingProcessor();\n let processor = bufferingProcessor;\n const spanContextStorage = options.spanContextStorage || new DefaultSpanContextStorage(options.backgroundingListener);\n let logger = options.schema.logger.defaultValue;\n const sampler = new Sampler(1.0);\n const spanFactory = new SpanFactory(processor, sampler, options.idGenerator, options.spanAttributesSource, options.clock, options.backgroundingListener, logger, spanContextStorage);\n const plugins = options.plugins(spanFactory, spanContextStorage);\n return {\n start: (config) => {\n const configuration = validateConfig(config, options.schema);\n // if using the default endpoint add the API key as a subdomain\n // e.g. convert URL https://otlp.bugsnag.com/v1/traces to URL https://.otlp.bugsnag.com/v1/traces\n if (configuration.endpoint === schema.endpoint.defaultValue) {\n configuration.endpoint = configuration.endpoint.replace('https://', `https://${configuration.apiKey}.`);\n }\n // Correlate errors with span by monkey patching _notify on the error client\n // and utilizing the setTraceCorrelation method on the event\n if (configuration.bugsnag && typeof configuration.bugsnag.Event.prototype.setTraceCorrelation === 'function' && configuration.bugsnag.Client) {\n const originalNotify = configuration.bugsnag.Client.prototype._notify;\n configuration.bugsnag.Client.prototype._notify = function (...args) {\n const currentSpanContext = spanContextStorage.current;\n if (currentSpanContext && typeof args[0].setTraceCorrelation === 'function') {\n args[0].setTraceCorrelation(currentSpanContext.traceId, currentSpanContext.id);\n }\n originalNotify.apply(this, args);\n };\n }\n const delivery = options.deliveryFactory(configuration.endpoint);\n options.spanAttributesSource.configure(configuration);\n const probabilityManagerPromise = configuration.samplingProbability === undefined\n ? ProbabilityManager.create(options.persistence, sampler, new ProbabilityFetcher(delivery, configuration.apiKey))\n : FixedProbabilityManager.create(sampler, configuration.samplingProbability);\n probabilityManagerPromise.then((manager) => {\n processor = new BatchProcessor(delivery, configuration, options.retryQueueFactory(delivery, configuration.retryQueueMaxSize), sampler, manager, new TracePayloadEncoder(options.clock, configuration, options.resourceAttributesSource));\n // ensure all spans started before .start() are added to the batch\n for (const span of bufferingProcessor.spans) {\n processor.add(span);\n }\n // register with the backgrounding listener - we do this in 'start' as\n // there's nothing to do if we're backgrounded before start is called\n // e.g. we can't trigger delivery until we have the apiKey and endpoint\n // from configuration\n options.backgroundingListener.onStateChange(state => {\n processor.flush();\n // ensure we have a fresh probability value when returning to the\n // foreground\n if (state === 'in-foreground') {\n manager.ensureFreshProbability();\n }\n });\n logger = configuration.logger;\n spanFactory.configure(processor, configuration);\n });\n for (const plugin of configuration.plugins) {\n plugins.push(plugin);\n }\n for (const plugin of plugins) {\n plugin.configure(configuration, spanFactory);\n }\n },\n startSpan: (name, spanOptions) => {\n const cleanOptions = spanFactory.validateSpanOptions(name, spanOptions);\n const span = spanFactory.startSpan(cleanOptions.name, cleanOptions.options);\n span.setAttribute('bugsnag.span.category', 'custom');\n return spanFactory.toPublicApi(span);\n },\n startNetworkSpan: (networkSpanOptions) => {\n const spanInternal = spanFactory.startNetworkSpan(networkSpanOptions);\n const span = spanFactory.toPublicApi(spanInternal);\n // Overwrite end method to set status code attribute\n // once we release the setAttribute API we can simply return the span\n const networkSpan = {\n ...span,\n end: (endOptions) => {\n spanFactory.endSpan(spanInternal, timeToNumber(options.clock, endOptions.endTime), { 'http.status_code': endOptions.status });\n }\n };\n return networkSpan;\n },\n getPlugin: (Constructor) => {\n for (const plugin of plugins) {\n if (plugin instanceof Constructor) {\n return plugin;\n }\n }\n },\n get currentSpanContext() {\n return spanContextStorage.current;\n },\n ...(options.platformExtensions && options.platformExtensions(spanFactory, spanContextStorage))\n };\n}\nfunction createNoopClient() {\n const noop = () => { };\n return {\n start: noop,\n startSpan: () => ({ id: '', traceId: '', end: noop, isValid: () => false }),\n currentSpanContext: undefined\n };\n}\n\nexport { createClient, createNoopClient };\n","function createBrowserBackgroundingListener(window) {\n const callbacks = [];\n let state = window.document.visibilityState === 'hidden'\n ? 'in-background'\n : 'in-foreground';\n const backgroundingListener = {\n onStateChange(backgroundingListenerCallback) {\n callbacks.push(backgroundingListenerCallback);\n // trigger the callback immediately if the document is already 'hidden'\n if (state === 'in-background') {\n backgroundingListenerCallback(state);\n }\n }\n };\n const backgroundStateChanged = (newState) => {\n if (state === newState)\n return;\n state = newState;\n for (const callback of callbacks) {\n callback(state);\n }\n };\n window.document.addEventListener('visibilitychange', function () {\n const newState = window.document.visibilityState === 'hidden'\n ? 'in-background'\n : 'in-foreground';\n backgroundStateChanged(newState);\n });\n // some browsers don't fire the visibilitychange event when the page is suspended,\n // so we also listen for pagehide and pageshow events\n window.addEventListener('pagehide', function () {\n backgroundStateChanged('in-background');\n });\n window.addEventListener('pageshow', function () {\n backgroundStateChanged('in-foreground');\n });\n return backgroundingListener;\n}\n\nexport { createBrowserBackgroundingListener as default };\n","const createSpanAttributesSource = (document) => {\n const defaultAttributes = {\n url: {\n name: 'bugsnag.browser.page.url',\n getValue: () => document.location.href,\n permitted: false\n },\n title: {\n name: 'bugsnag.browser.page.title',\n getValue: () => document.title,\n permitted: false\n }\n };\n return {\n configure(configuration) {\n defaultAttributes.title.permitted = configuration.sendPageAttributes.title || false;\n defaultAttributes.url.permitted = configuration.sendPageAttributes.url || false;\n },\n requestAttributes(span) {\n for (const attribute of Object.values(defaultAttributes)) {\n if (attribute.permitted) {\n span.setAttribute(attribute.name, attribute.getValue());\n }\n }\n }\n };\n};\n\nexport { createSpanAttributesSource, createSpanAttributesSource as default };\n","import cuid from '@bugsnag/cuid';\nimport { ResourceAttributes } from '@bugsnag/core-performance';\n\nfunction createResourceAttributesSource(navigator, persistence) {\n let getDeviceId;\n let deviceId;\n return function resourceAttributesSource(config) {\n const attributes = new ResourceAttributes(config.releaseStage, config.appVersion, config.serviceName, 'bugsnag.performance.browser', '2.10.0', config.logger);\n attributes.set('browser.user_agent', navigator.userAgent);\n // chromium only\n if (navigator.userAgentData) {\n attributes.set('browser.platform', navigator.userAgentData.platform);\n attributes.set('browser.mobile', navigator.userAgentData.mobile);\n }\n if (config.generateAnonymousId) {\n // ensure we only load/generate the anonymous ID once no matter how many\n // times we're called, otherwise we could generate different IDs on\n // different calls as cuids are partly time based\n if (!getDeviceId) {\n getDeviceId = persistence.load('bugsnag-anonymous-id')\n .then(maybeAnonymousId => {\n // use the persisted value or generate a new ID\n const anonymousId = maybeAnonymousId || cuid();\n // if there was no persisted value, save the newly generated ID\n if (!maybeAnonymousId) {\n persistence.save('bugsnag-anonymous-id', anonymousId);\n }\n // store the device ID so we can set it synchronously in future\n deviceId = anonymousId;\n return deviceId;\n });\n }\n if (deviceId) {\n // set device ID synchronously if it's already available\n attributes.set('device.id', deviceId);\n }\n else {\n // otherwise add it when the promise resolves\n return getDeviceId\n .then(deviceId => {\n attributes.set('device.id', deviceId);\n return attributes;\n });\n }\n }\n return Promise.resolve(attributes);\n };\n}\n\nexport { createResourceAttributesSource as default };\n","import { RequestTracker } from './request-tracker.js';\nimport getAbsoluteUrl from './url-helpers.js';\n\nfunction createXmlHttpRequestTracker(xhr, clock, document) {\n const requestTracker = new RequestTracker();\n const trackedRequests = new WeakMap();\n const requestHandlers = new WeakMap();\n const originalOpen = xhr.prototype.open;\n xhr.prototype.open = function open(method, url, ...rest) {\n trackedRequests.set(this, { method, url: getAbsoluteUrl(String(url), document && document.baseURI) });\n // @ts-expect-error rest\n originalOpen.call(this, method, url, ...rest);\n };\n const originalSend = xhr.prototype.send;\n xhr.prototype.send = function send(body) {\n const requestData = trackedRequests.get(this);\n if (requestData) {\n // if there is an existing event listener this request instance is being reused,\n // so we need to remove the listener from the previous send\n const existingHandler = requestHandlers.get(this);\n if (existingHandler)\n this.removeEventListener('readystatechange', existingHandler);\n const { onRequestEnd, extraRequestHeaders } = requestTracker.start({\n type: 'xmlhttprequest',\n method: requestData.method,\n url: requestData.url,\n startTime: clock.now()\n });\n if (extraRequestHeaders) {\n for (const extraHeaders of extraRequestHeaders) {\n for (const [name, value] of Object.entries(extraHeaders)) {\n this.setRequestHeader(name, value);\n }\n }\n }\n const onReadyStateChange = (evt) => {\n if (this.readyState === xhr.DONE && onRequestEnd) {\n // If the status is 0 the request did not complete so report this as an error\n const endContext = this.status > 0\n ? { endTime: clock.now(), status: this.status, state: 'success' }\n : { endTime: clock.now(), state: 'error' };\n onRequestEnd(endContext);\n }\n };\n this.addEventListener('readystatechange', onReadyStateChange);\n requestHandlers.set(this, onReadyStateChange);\n }\n originalSend.call(this, body);\n };\n return requestTracker;\n}\n\nexport { createXmlHttpRequestTracker as default };\n","import { schema, isBoolean, isStringOrRegExpArray, isStringWithLength } from '@bugsnag/core-performance';\nimport { defaultNetworkRequestCallback, isNetworkRequestCallback } from '@bugsnag/request-tracker-performance';\nimport { isRoutingProvider } from './routing-provider.js';\nimport { defaultSendPageAttributes, isSendPageAttributes } from './send-page-attributes.js';\n\nfunction createSchema(hostname, defaultRoutingProvider) {\n return {\n ...schema,\n releaseStage: {\n ...schema.releaseStage,\n defaultValue: hostname === 'localhost' ? 'development' : 'production'\n },\n autoInstrumentFullPageLoads: {\n defaultValue: true,\n message: 'should be true|false',\n validate: isBoolean\n },\n autoInstrumentNetworkRequests: {\n defaultValue: true,\n message: 'should be true|false',\n validate: isBoolean\n },\n autoInstrumentRouteChanges: {\n defaultValue: true,\n message: 'should be true|false',\n validate: isBoolean\n },\n generateAnonymousId: {\n defaultValue: true,\n message: 'should be true|false',\n validate: isBoolean\n },\n routingProvider: {\n defaultValue: defaultRoutingProvider,\n message: 'should be a routing provider',\n validate: isRoutingProvider\n },\n settleIgnoreUrls: {\n defaultValue: [],\n message: 'should be an array of string|RegExp',\n validate: isStringOrRegExpArray\n },\n networkRequestCallback: {\n defaultValue: defaultNetworkRequestCallback,\n message: 'should be a function',\n validate: isNetworkRequestCallback\n },\n sendPageAttributes: {\n defaultValue: defaultSendPageAttributes,\n message: 'should be an object',\n validate: isSendPageAttributes\n },\n serviceName: {\n defaultValue: 'unknown_service',\n message: 'should be a string',\n validate: isStringWithLength\n }\n };\n}\n\nexport { createSchema };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { ErrorHandler, Injectable } from '@angular/core';\nimport Bugsnag, { Client } from '@bugsnag/js';\n// zones are optional, so we need to detect if they are being used\n// see https://angular.io/guide/zone#noopzone\nconst isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.current;\nlet BugsnagErrorHandler = class BugsnagErrorHandler extends ErrorHandler {\n constructor(client) {\n super();\n if (client) {\n this.bugsnagClient = client;\n }\n else {\n this.bugsnagClient = Bugsnag._client;\n }\n }\n handleError(error) {\n const handledState = {\n severity: 'error',\n severityReason: { type: 'unhandledException' },\n unhandled: true\n };\n const event = this.bugsnagClient.Event.create(error, true, handledState, 'angular error handler', 1);\n if (error.ngDebugContext) {\n event.addMetadata('angular', {\n component: error.ngDebugContext.component,\n context: error.ngDebugContext.context\n });\n }\n this.bugsnagClient._notify(event);\n ErrorHandler.prototype.handleError.call(this, error);\n }\n};\nBugsnagErrorHandler = __decorate([\n Injectable(),\n __metadata(\"design:paramtypes\", [Client])\n], BugsnagErrorHandler);\nexport { BugsnagErrorHandler };\nconst ɵ0 = (client) => {\n const originalNotify = client._notify;\n client._notify = function () {\n const originalArguments = arguments;\n if (isNgZoneEnabled) {\n // run notify in the root zone to avoid triggering change detection\n Zone.root.run(() => {\n originalNotify(originalArguments);\n });\n }\n else {\n // if zones are not enabled, change detection will not run anyway\n originalNotify(originalArguments);\n }\n };\n return new BugsnagErrorHandler(client);\n};\nconst plugin = {\n load: ɵ0,\n name: 'Angular'\n};\nexport default plugin;\nexport { ɵ0 };\n","import { ErrorHandler, NgModule } from '@angular/core'\nimport { BrowserModule } from '@angular/platform-browser'\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations'\nimport { AppRoutingModule } from './app-routing.module'\nimport { AppComponent } from './app.component'\nimport { HttpClientModule } from '@angular/common/http'\nimport { HomeModule } from './containers/home/home.module'\nimport { OrderModule } from './containers/order/order.module'\nimport { MatLuxonDateModule } from '@angular/material-luxon-adapter'\nimport { ButtonComponent } from './components/button/button.component'\nimport { environment } from 'src/environments/environment'\nimport Bugsnag from '@bugsnag/js'\nimport BugsnagPerformance from '@bugsnag/browser-performance'\nimport { BugsnagErrorHandler } from '@bugsnag/plugin-angular'\n\n// configure Bugsnag ASAP\nif (environment.production) {\n Bugsnag.start({ apiKey: '548a5ddb7a78076a0d2761c7e047784d', appVersion: '1.0.0' })\n BugsnagPerformance.start({ apiKey: '548a5ddb7a78076a0d2761c7e047784d' })\n}\n\nconst providers = environment.production ? [ { provide: ErrorHandler, useFactory: errorHandlerFactory } ] : []\n\n// create a factory which will return the Bugsnag error handler\nexport function errorHandlerFactory() {\n return new BugsnagErrorHandler()\n}\n\n@NgModule({\n declarations: [\n AppComponent\n ],\n imports: [\n BrowserAnimationsModule,\n BrowserModule,\n ButtonComponent,\n HomeModule, \n HttpClientModule,\n MatLuxonDateModule,\n OrderModule,\n AppRoutingModule\n ],\n providers: providers,\n bootstrap: [AppComponent]\n})\n\nexport class AppModule { }\n","import { enableProdMode } from '@angular/core'\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic'\n\nimport { AppModule } from './app/app.module'\nimport { environment } from './environments/environment'\n\nif (environment.production) {\n enableProdMode()\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n .catch(err => console.error(err))\n","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Bugsnag = f()}})(function(){var define,module,exports;\nvar _$breadcrumbTypes_17 = ['navigation', 'request', 'process', 'log', 'user', 'state', 'error', 'manual'];\n\n// Array#reduce\nvar _$reduce_26 = function (arr, fn, accum) {\n var val = accum;\n for (var i = 0, len = arr.length; i < len; i++) val = fn(val, arr[i], i, arr);\n return val;\n};\n\n/* removed: var _$reduce_26 = require('./reduce'); */;\n\n// Array#filter\nvar _$filter_21 = function (arr, fn) {\n return _$reduce_26(arr, function (accum, item, i, arr) {\n return !fn(item, i, arr) ? accum : accum.concat(item);\n }, []);\n};\n\n/* removed: var _$reduce_26 = require('./reduce'); */;\n// Array#includes\nvar _$includes_22 = function (arr, x) {\n return _$reduce_26(arr, function (accum, item, i, arr) {\n return accum === true || item === x;\n }, false);\n};\n\n// Array#isArray\nvar _$isArray_23 = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n};\n\n/* eslint-disable-next-line no-prototype-builtins */\nvar _hasDontEnumBug = !{\n toString: null\n}.propertyIsEnumerable('toString');\nvar _dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];\n\n// Object#keys\nvar _$keys_24 = function (obj) {\n // stripped down version of\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/Keys\n var result = [];\n var prop;\n for (prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) result.push(prop);\n }\n if (!_hasDontEnumBug) return result;\n for (var i = 0, len = _dontEnums.length; i < len; i++) {\n if (Object.prototype.hasOwnProperty.call(obj, _dontEnums[i])) result.push(_dontEnums[i]);\n }\n return result;\n};\n\nvar _$intRange_33 = function (min, max) {\n if (min === void 0) {\n min = 1;\n }\n if (max === void 0) {\n max = Infinity;\n }\n return function (value) {\n return typeof value === 'number' && parseInt('' + value, 10) === value && value >= min && value <= max;\n };\n};\n\n/* removed: var _$filter_21 = require('../es-utils/filter'); */;\n/* removed: var _$isArray_23 = require('../es-utils/is-array'); */;\nvar _$listOfFunctions_34 = function (value) {\n return typeof value === 'function' || _$isArray_23(value) && _$filter_21(value, function (f) {\n return typeof f === 'function';\n }).length === value.length;\n};\n\nvar _$stringWithLength_35 = function (value) {\n return typeof value === 'string' && !!value.length;\n};\n\nvar _$config_14 = {};\n/* removed: var _$filter_21 = require('./lib/es-utils/filter'); */;\n/* removed: var _$reduce_26 = require('./lib/es-utils/reduce'); */;\n/* removed: var _$keys_24 = require('./lib/es-utils/keys'); */;\n/* removed: var _$isArray_23 = require('./lib/es-utils/is-array'); */;\n/* removed: var _$includes_22 = require('./lib/es-utils/includes'); */;\n/* removed: var _$intRange_33 = require('./lib/validators/int-range'); */;\n/* removed: var _$stringWithLength_35 = require('./lib/validators/string-with-length'); */;\n/* removed: var _$listOfFunctions_34 = require('./lib/validators/list-of-functions'); */;\n/* removed: var _$breadcrumbTypes_17 = require('./lib/breadcrumb-types'); */;\nvar defaultErrorTypes = function () {\n return {\n unhandledExceptions: true,\n unhandledRejections: true\n };\n};\n_$config_14.schema = {\n apiKey: {\n defaultValue: function () {\n return null;\n },\n message: 'is required',\n validate: _$stringWithLength_35\n },\n appVersion: {\n defaultValue: function () {\n return undefined;\n },\n message: 'should be a string',\n validate: function (value) {\n return value === undefined || _$stringWithLength_35(value);\n }\n },\n appType: {\n defaultValue: function () {\n return undefined;\n },\n message: 'should be a string',\n validate: function (value) {\n return value === undefined || _$stringWithLength_35(value);\n }\n },\n autoDetectErrors: {\n defaultValue: function () {\n return true;\n },\n message: 'should be true|false',\n validate: function (value) {\n return value === true || value === false;\n }\n },\n enabledErrorTypes: {\n defaultValue: function () {\n return defaultErrorTypes();\n },\n message: 'should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }',\n allowPartialObject: true,\n validate: function (value) {\n // ensure we have an object\n if (typeof value !== 'object' || !value) return false;\n var providedKeys = _$keys_24(value);\n var defaultKeys = _$keys_24(defaultErrorTypes());\n // ensure it only has a subset of the allowed keys\n if (_$filter_21(providedKeys, function (k) {\n return _$includes_22(defaultKeys, k);\n }).length < providedKeys.length) return false;\n // ensure all of the values are boolean\n if (_$filter_21(_$keys_24(value), function (k) {\n return typeof value[k] !== 'boolean';\n }).length > 0) return false;\n return true;\n }\n },\n onError: {\n defaultValue: function () {\n return [];\n },\n message: 'should be a function or array of functions',\n validate: _$listOfFunctions_34\n },\n onSession: {\n defaultValue: function () {\n return [];\n },\n message: 'should be a function or array of functions',\n validate: _$listOfFunctions_34\n },\n onBreadcrumb: {\n defaultValue: function () {\n return [];\n },\n message: 'should be a function or array of functions',\n validate: _$listOfFunctions_34\n },\n endpoints: {\n defaultValue: function (endpoints) {\n // only apply the default value if no endpoints have been provided, otherwise prevent delivery by setting to null\n if (typeof endpoints === 'undefined') {\n return {\n notify: 'https://notify.bugsnag.com',\n sessions: 'https://sessions.bugsnag.com'\n };\n } else {\n return {\n notify: null,\n sessions: null\n };\n }\n },\n message: 'should be an object containing endpoint URLs { notify, sessions }',\n validate: function (val) {\n return (\n // first, ensure it's an object\n val && typeof val === 'object' &&\n // notify and sessions must always be set\n _$stringWithLength_35(val.notify) && _$stringWithLength_35(val.sessions) &&\n // ensure no keys other than notify/session are set on endpoints object\n _$filter_21(_$keys_24(val), function (k) {\n return !_$includes_22(['notify', 'sessions'], k);\n }).length === 0\n );\n }\n },\n autoTrackSessions: {\n defaultValue: function (val) {\n return true;\n },\n message: 'should be true|false',\n validate: function (val) {\n return val === true || val === false;\n }\n },\n enabledReleaseStages: {\n defaultValue: function () {\n return null;\n },\n message: 'should be an array of strings',\n validate: function (value) {\n return value === null || _$isArray_23(value) && _$filter_21(value, function (f) {\n return typeof f === 'string';\n }).length === value.length;\n }\n },\n releaseStage: {\n defaultValue: function () {\n return 'production';\n },\n message: 'should be a string',\n validate: function (value) {\n return typeof value === 'string' && value.length;\n }\n },\n maxBreadcrumbs: {\n defaultValue: function () {\n return 25;\n },\n message: 'should be a number ≤100',\n validate: function (value) {\n return _$intRange_33(0, 100)(value);\n }\n },\n enabledBreadcrumbTypes: {\n defaultValue: function () {\n return _$breadcrumbTypes_17;\n },\n message: \"should be null or a list of available breadcrumb types (\" + _$breadcrumbTypes_17.join(',') + \")\",\n validate: function (value) {\n return value === null || _$isArray_23(value) && _$reduce_26(value, function (accum, maybeType) {\n if (accum === false) return accum;\n return _$includes_22(_$breadcrumbTypes_17, maybeType);\n }, true);\n }\n },\n context: {\n defaultValue: function () {\n return undefined;\n },\n message: 'should be a string',\n validate: function (value) {\n return value === undefined || typeof value === 'string';\n }\n },\n user: {\n defaultValue: function () {\n return {};\n },\n message: 'should be an object with { id, email, name } properties',\n validate: function (value) {\n return value === null || value && _$reduce_26(_$keys_24(value), function (accum, key) {\n return accum && _$includes_22(['id', 'email', 'name'], key);\n }, true);\n }\n },\n metadata: {\n defaultValue: function () {\n return {};\n },\n message: 'should be an object',\n validate: function (value) {\n return typeof value === 'object' && value !== null;\n }\n },\n logger: {\n defaultValue: function () {\n return undefined;\n },\n message: 'should be null or an object with methods { debug, info, warn, error }',\n validate: function (value) {\n return !value || value && _$reduce_26(['debug', 'info', 'warn', 'error'], function (accum, method) {\n return accum && typeof value[method] === 'function';\n }, true);\n }\n },\n redactedKeys: {\n defaultValue: function () {\n return ['password'];\n },\n message: 'should be an array of strings|regexes',\n validate: function (value) {\n return _$isArray_23(value) && value.length === _$filter_21(value, function (s) {\n return typeof s === 'string' || s && typeof s.test === 'function';\n }).length;\n }\n },\n plugins: {\n defaultValue: function () {\n return [];\n },\n message: 'should be an array of plugin objects',\n validate: function (value) {\n return _$isArray_23(value) && value.length === _$filter_21(value, function (p) {\n return p && typeof p === 'object' && typeof p.load === 'function';\n }).length;\n }\n },\n featureFlags: {\n defaultValue: function () {\n return [];\n },\n message: 'should be an array of objects that have a \"name\" property',\n validate: function (value) {\n return _$isArray_23(value) && value.length === _$filter_21(value, function (feature) {\n return feature && typeof feature === 'object' && typeof feature.name === 'string';\n }).length;\n }\n },\n reportUnhandledPromiseRejectionsAsHandled: {\n defaultValue: function () {\n return false;\n },\n message: 'should be true|false',\n validate: function (value) {\n return value === true || value === false;\n }\n }\n};\n\n// extends helper from babel\n// https://github.com/babel/babel/blob/916429b516e6466fd06588ee820e40e025d7f3a3/packages/babel-helpers/src/helpers.js#L377-L393\nvar _$assign_20 = function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n};\n\n/* removed: var _$reduce_26 = require('./reduce'); */;\n\n// Array#map\nvar _$map_25 = function (arr, fn) {\n return _$reduce_26(arr, function (accum, item, i, arr) {\n return accum.concat(fn(item, i, arr));\n }, []);\n};\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar schema = _$config_14.schema;\n/* removed: var _$map_25 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$assign_20 = require('@bugsnag/core/lib/es-utils/assign'); */;\nvar _$config_10 = {\n releaseStage: _$assign_20({}, schema.releaseStage, {\n defaultValue: function () {\n if (/^localhost(:\\d+)?$/.test(window.location.host)) return 'development';\n return 'production';\n }\n }),\n appType: _extends({}, schema.appType, {\n defaultValue: function () {\n return 'browser';\n }\n }),\n logger: _$assign_20({}, schema.logger, {\n defaultValue: function () {\n return (\n // set logger based on browser capability\n typeof console !== 'undefined' && typeof console.debug === 'function' ? getPrefixedConsole() : undefined\n );\n }\n })\n};\nvar getPrefixedConsole = function () {\n var logger = {};\n var consoleLog = console.log;\n _$map_25(['debug', 'info', 'warn', 'error'], function (method) {\n var consoleMethod = console[method];\n logger[method] = typeof consoleMethod === 'function' ? consoleMethod.bind(console, '[bugsnag]') : consoleLog.bind(console, '[bugsnag]');\n });\n return logger;\n};\n\nvar Breadcrumb = /*#__PURE__*/function () {\n function Breadcrumb(message, metadata, type, timestamp) {\n if (timestamp === void 0) {\n timestamp = new Date();\n }\n this.type = type;\n this.message = message;\n this.metadata = metadata;\n this.timestamp = timestamp;\n }\n var _proto = Breadcrumb.prototype;\n _proto.toJSON = function toJSON() {\n return {\n type: this.type,\n name: this.message,\n timestamp: this.timestamp,\n metaData: this.metadata\n };\n };\n return Breadcrumb;\n}();\nvar _$Breadcrumb_12 = Breadcrumb;\n\nvar _$stackframe_9 = {};\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof _$stackframe_9 === 'object') {\n _$stackframe_9 = factory();\n } else {\n root.StackFrame = factory();\n }\n})(this, function () {\n 'use strict';\n\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];\n var numericProps = ['columnNumber', 'lineNumber'];\n var stringProps = ['fileName', 'functionName', 'source'];\n var arrayProps = ['args'];\n var objectProps = ['evalOrigin'];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps, objectProps);\n function StackFrame(obj) {\n if (!obj) return;\n for (var i = 0; i < props.length; i++) {\n if (obj[props[i]] !== undefined) {\n this['set' + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError('Eval Origin must be an Object or StackFrame');\n }\n },\n toString: function () {\n var fileName = this.getFileName() || '';\n var lineNumber = this.getLineNumber() || '';\n var columnNumber = this.getColumnNumber() || '';\n var functionName = this.getFunctionName() || '';\n if (this.getIsEval()) {\n if (fileName) {\n return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return '[eval]:' + lineNumber + ':' + columnNumber;\n }\n if (functionName) {\n return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return fileName + ':' + lineNumber + ':' + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf('(');\n var argsEndIndex = str.lastIndexOf(')');\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf('@') === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, '');\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + ' must be a Number');\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n});\n\nvar _$stackGenerator_8 = {};\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stack-generator', ['stackframe'], factory);\n } else if (typeof _$stackGenerator_8 === 'object') {\n _$stackGenerator_8 = factory(_$stackframe_9);\n } else {\n root.StackGenerator = factory(root.StackFrame);\n }\n})(this, function (StackFrame) {\n return {\n backtrace: function StackGenerator$$backtrace(opts) {\n var stack = [];\n var maxStackSize = 10;\n if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {\n maxStackSize = opts.maxStackSize;\n }\n var curr = arguments.callee;\n while (curr && stack.length < maxStackSize && curr['arguments']) {\n // Allow V8 optimizations\n var args = new Array(curr['arguments'].length);\n for (var i = 0; i < args.length; ++i) {\n args[i] = curr['arguments'][i];\n }\n if (/function(?:\\s+([\\w$]+))+\\s*\\(/.test(curr.toString())) {\n stack.push(new StackFrame({\n functionName: RegExp.$1 || undefined,\n args: args\n }));\n } else {\n stack.push(new StackFrame({\n args: args\n }));\n }\n try {\n curr = curr.caller;\n } catch (e) {\n break;\n }\n }\n return stack;\n }\n };\n});\n\nvar _$errorStackParser_6 = {};\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof _$errorStackParser_6 === 'object') {\n _$errorStackParser_6 = factory(_$stackframe_9);\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n})(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(\\),.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n var tokens = sanitizedLine.split(/\\s+/).slice(1);\n // if a location was matched, pass it to extractLocation() otherwise pop the last token\n var locationParts = this.extractLocation(location ? location[1] : tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || e.message.indexOf('\\n') > -1 && e.message.split('\\n').length > e.stacktrace.split('\\n').length) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = tokens.shift() || '';\n var functionName = functionCall.replace(//, '$2').replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(',');\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n});\n\nvar _$errorStackParser_19 = _$errorStackParser_6;\n\nvar _$safeJsonStringify_5 = function (data, replacer, space, opts) {\n var redactedKeys = opts && opts.redactedKeys ? opts.redactedKeys : [];\n var redactedPaths = opts && opts.redactedPaths ? opts.redactedPaths : [];\n return JSON.stringify(prepareObjForSerialization(data, redactedKeys, redactedPaths), replacer, space);\n};\nvar MAX_DEPTH = 20;\nvar MAX_EDGES = 25000;\nvar MIN_PRESERVED_DEPTH = 8;\nvar REPLACEMENT_NODE = '...';\nfunction isError(o) {\n return o instanceof Error || /^\\[object (Error|(Dom)?Exception)\\]$/.test(Object.prototype.toString.call(o));\n}\nfunction throwsMessage(err) {\n return '[Throws: ' + (err ? err.message : '?') + ']';\n}\nfunction find(haystack, needle) {\n for (var i = 0, len = haystack.length; i < len; i++) {\n if (haystack[i] === needle) return true;\n }\n return false;\n}\n\n// returns true if the string `path` starts with any of the provided `paths`\nfunction isDescendent(paths, path) {\n for (var i = 0, len = paths.length; i < len; i++) {\n if (path.indexOf(paths[i]) === 0) return true;\n }\n return false;\n}\nfunction shouldRedact(patterns, key) {\n for (var i = 0, len = patterns.length; i < len; i++) {\n if (typeof patterns[i] === 'string' && patterns[i].toLowerCase() === key.toLowerCase()) return true;\n if (patterns[i] && typeof patterns[i].test === 'function' && patterns[i].test(key)) return true;\n }\n return false;\n}\nfunction __isArray_5(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n}\nfunction safelyGetProp(obj, prop) {\n try {\n return obj[prop];\n } catch (err) {\n return throwsMessage(err);\n }\n}\nfunction prepareObjForSerialization(obj, redactedKeys, redactedPaths) {\n var seen = []; // store references to objects we have seen before\n var edges = 0;\n function visit(obj, path) {\n function edgesExceeded() {\n return path.length > MIN_PRESERVED_DEPTH && edges > MAX_EDGES;\n }\n edges++;\n if (path.length > MAX_DEPTH) return REPLACEMENT_NODE;\n if (edgesExceeded()) return REPLACEMENT_NODE;\n if (obj === null || typeof obj !== 'object') return obj;\n if (find(seen, obj)) return '[Circular]';\n seen.push(obj);\n if (typeof obj.toJSON === 'function') {\n try {\n // we're not going to count this as an edge because it\n // replaces the value of the currently visited object\n edges--;\n var fResult = visit(obj.toJSON(), path);\n seen.pop();\n return fResult;\n } catch (err) {\n return throwsMessage(err);\n }\n }\n var er = isError(obj);\n if (er) {\n edges--;\n var eResult = visit({\n name: obj.name,\n message: obj.message\n }, path);\n seen.pop();\n return eResult;\n }\n if (__isArray_5(obj)) {\n var aResult = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n if (edgesExceeded()) {\n aResult.push(REPLACEMENT_NODE);\n break;\n }\n aResult.push(visit(obj[i], path.concat('[]')));\n }\n seen.pop();\n return aResult;\n }\n var result = {};\n try {\n for (var prop in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, prop)) continue;\n if (isDescendent(redactedPaths, path.join('.')) && shouldRedact(redactedKeys, prop)) {\n result[prop] = '[REDACTED]';\n continue;\n }\n if (edgesExceeded()) {\n result[prop] = REPLACEMENT_NODE;\n break;\n }\n result[prop] = visit(safelyGetProp(obj, prop), path.concat(prop));\n }\n } catch (e) {}\n seen.pop();\n return result;\n }\n return visit(obj, []);\n}\n\n/* removed: var _$map_25 = require('./es-utils/map'); */;\n/* removed: var _$filter_21 = require('./es-utils/filter'); */;\n/* removed: var _$isArray_23 = require('./es-utils/is-array'); */;\n/* removed: var _$safeJsonStringify_5 = require('@bugsnag/safe-json-stringify'); */;\nfunction add(existingFeatures, existingFeatureKeys, name, variant) {\n if (typeof name !== 'string') {\n return;\n }\n if (variant === undefined) {\n variant = null;\n } else if (variant !== null && typeof variant !== 'string') {\n variant = _$safeJsonStringify_5(variant);\n }\n var existingIndex = existingFeatureKeys[name];\n if (typeof existingIndex === 'number') {\n existingFeatures[existingIndex] = {\n name: name,\n variant: variant\n };\n return;\n }\n existingFeatures.push({\n name: name,\n variant: variant\n });\n existingFeatureKeys[name] = existingFeatures.length - 1;\n}\nfunction merge(existingFeatures, newFeatures, existingFeatureKeys) {\n if (!_$isArray_23(newFeatures)) {\n return;\n }\n for (var i = 0; i < newFeatures.length; ++i) {\n var feature = newFeatures[i];\n if (feature === null || typeof feature !== 'object') {\n continue;\n }\n\n // 'add' will handle if 'name' doesn't exist & 'variant' is optional\n add(existingFeatures, existingFeatureKeys, feature.name, feature.variant);\n }\n return existingFeatures;\n}\n\n// convert feature flags from a map of 'name -> variant' into the format required\n// by the Bugsnag Event API:\n// [{ featureFlag: 'name', variant: 'variant' }, { featureFlag: 'name 2' }]\nfunction toEventApi(featureFlags) {\n return _$map_25(_$filter_21(featureFlags, Boolean), function (_ref) {\n var name = _ref.name,\n variant = _ref.variant;\n var flag = {\n featureFlag: name\n };\n\n // don't add a 'variant' property unless there's actually a value\n if (typeof variant === 'string') {\n flag.variant = variant;\n }\n return flag;\n });\n}\nfunction clear(features, featuresIndex, name) {\n var existingIndex = featuresIndex[name];\n if (typeof existingIndex === 'number') {\n features[existingIndex] = null;\n delete featuresIndex[name];\n }\n}\nvar _$featureFlagDelegate_27 = {\n add: add,\n clear: clear,\n merge: merge,\n toEventApi: toEventApi\n};\n\n// Given `err` which may be an error, does it have a stack property which is a string?\nvar _$hasStack_28 = function (err) {\n return !!err && (!!err.stack || !!err.stacktrace || !!err['opera#sourceloc']) && typeof (err.stack || err.stacktrace || err['opera#sourceloc']) === 'string' && err.stack !== err.name + \": \" + err.message;\n};\n\n/**\n * Expose `isError`.\n */\n\nvar _$isError_7 = __isError_7;\n\n/**\n * Test whether `value` is error object.\n *\n * @param {*} value\n * @returns {boolean}\n */\n\nfunction __isError_7(value) {\n switch (Object.prototype.toString.call(value)) {\n case '[object Error]':\n return true;\n case '[object Exception]':\n return true;\n case '[object DOMException]':\n return true;\n default:\n return value instanceof Error;\n }\n}\n\nvar _$iserror_29 = _$isError_7;\n\n/* removed: var _$assign_20 = require('./es-utils/assign'); */;\nvar __add_31 = function (state, section, keyOrObj, maybeVal) {\n var _updates;\n if (!section) return;\n var updates;\n\n // addMetadata(\"section\", null) -> clears section\n if (keyOrObj === null) return __clear_31(state, section);\n\n // normalise the two supported input types into object form\n if (typeof keyOrObj === 'object') updates = keyOrObj;\n if (typeof keyOrObj === 'string') updates = (_updates = {}, _updates[keyOrObj] = maybeVal, _updates);\n\n // exit if we don't have an updates object at this point\n if (!updates) return;\n\n // preventing the __proto__ property from being used as a key\n if (section === '__proto__' || section === 'constructor' || section === 'prototype') {\n return;\n }\n\n // ensure a section with this name exists\n if (!state[section]) state[section] = {};\n\n // merge the updates with the existing section\n state[section] = _$assign_20({}, state[section], updates);\n};\nvar get = function (state, section, key) {\n if (typeof section !== 'string') return undefined;\n if (!key) {\n return state[section];\n }\n if (state[section]) {\n return state[section][key];\n }\n return undefined;\n};\nvar __clear_31 = function (state, section, key) {\n if (typeof section !== 'string') return;\n\n // clear an entire section\n if (!key) {\n delete state[section];\n return;\n }\n\n // preventing the __proto__ property from being used as a key\n if (section === '__proto__' || section === 'constructor' || section === 'prototype') {\n return;\n }\n\n // clear a single value from a section\n if (state[section]) {\n delete state[section][key];\n }\n};\nvar _$metadataDelegate_31 = {\n add: __add_31,\n get: get,\n clear: __clear_31\n};\n\nfunction ___extends_15() { ___extends_15 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ___extends_15.apply(this, arguments); }\n/* removed: var _$errorStackParser_19 = require('./lib/error-stack-parser'); */;\n/* removed: var _$stackGenerator_8 = require('stack-generator'); */;\n/* removed: var _$hasStack_28 = require('./lib/has-stack'); */;\n/* removed: var _$map_25 = require('./lib/es-utils/map'); */;\n/* removed: var _$reduce_26 = require('./lib/es-utils/reduce'); */;\n/* removed: var _$filter_21 = require('./lib/es-utils/filter'); */;\n/* removed: var _$assign_20 = require('./lib/es-utils/assign'); */;\n/* removed: var _$metadataDelegate_31 = require('./lib/metadata-delegate'); */;\n/* removed: var _$featureFlagDelegate_27 = require('./lib/feature-flag-delegate'); */;\n/* removed: var _$iserror_29 = require('./lib/iserror'); */;\nvar Event = /*#__PURE__*/function () {\n function Event(errorClass, errorMessage, stacktrace, handledState, originalError) {\n if (stacktrace === void 0) {\n stacktrace = [];\n }\n if (handledState === void 0) {\n handledState = defaultHandledState();\n }\n this.apiKey = undefined;\n this.context = undefined;\n this.groupingHash = undefined;\n this.originalError = originalError;\n this._handledState = handledState;\n this.severity = this._handledState.severity;\n this.unhandled = this._handledState.unhandled;\n this.app = {};\n this.device = {};\n this.request = {};\n this.breadcrumbs = [];\n this.threads = [];\n this._metadata = {};\n this._features = [];\n this._featuresIndex = {};\n this._user = {};\n this._session = undefined;\n this._correlation = undefined;\n this.errors = [createBugsnagError(errorClass, errorMessage, Event.__type, stacktrace)];\n\n // Flags.\n // Note these are not initialised unless they are used\n // to save unnecessary bytes in the browser bundle\n\n /* this.attemptImmediateDelivery, default: true */\n }\n var _proto = Event.prototype;\n _proto.addMetadata = function addMetadata(section, keyOrObj, maybeVal) {\n return _$metadataDelegate_31.add(this._metadata, section, keyOrObj, maybeVal);\n }\n\n /**\n * Associate this event with a specific trace. This is usually done automatically when\n * using bugsnag-js-performance, but can also be set manually if required.\n *\n * @param traceId the ID of the trace the event occurred within\n * @param spanId the ID of the span that the event occurred within\n */;\n _proto.setTraceCorrelation = function setTraceCorrelation(traceId, spanId) {\n if (typeof traceId === 'string') {\n this._correlation = ___extends_15({\n traceId: traceId\n }, typeof spanId === 'string' ? {\n spanId: spanId\n } : {});\n }\n };\n _proto.getMetadata = function getMetadata(section, key) {\n return _$metadataDelegate_31.get(this._metadata, section, key);\n };\n _proto.clearMetadata = function clearMetadata(section, key) {\n return _$metadataDelegate_31.clear(this._metadata, section, key);\n };\n _proto.addFeatureFlag = function addFeatureFlag(name, variant) {\n if (variant === void 0) {\n variant = null;\n }\n _$featureFlagDelegate_27.add(this._features, this._featuresIndex, name, variant);\n };\n _proto.addFeatureFlags = function addFeatureFlags(featureFlags) {\n _$featureFlagDelegate_27.merge(this._features, featureFlags, this._featuresIndex);\n };\n _proto.getFeatureFlags = function getFeatureFlags() {\n return _$featureFlagDelegate_27.toEventApi(this._features);\n };\n _proto.clearFeatureFlag = function clearFeatureFlag(name) {\n _$featureFlagDelegate_27.clear(this._features, this._featuresIndex, name);\n };\n _proto.clearFeatureFlags = function clearFeatureFlags() {\n this._features = [];\n this._featuresIndex = {};\n };\n _proto.getUser = function getUser() {\n return this._user;\n };\n _proto.setUser = function setUser(id, email, name) {\n this._user = {\n id: id,\n email: email,\n name: name\n };\n };\n _proto.toJSON = function toJSON() {\n return {\n payloadVersion: '4',\n exceptions: _$map_25(this.errors, function (er) {\n return _$assign_20({}, er, {\n message: er.errorMessage\n });\n }),\n severity: this.severity,\n unhandled: this._handledState.unhandled,\n severityReason: this._handledState.severityReason,\n app: this.app,\n device: this.device,\n request: this.request,\n breadcrumbs: this.breadcrumbs,\n context: this.context,\n groupingHash: this.groupingHash,\n metaData: this._metadata,\n user: this._user,\n session: this._session,\n featureFlags: this.getFeatureFlags(),\n correlation: this._correlation\n };\n };\n return Event;\n}(); // takes a stacktrace.js style stackframe (https://github.com/stacktracejs/stackframe)\n// and returns a Bugsnag compatible stackframe (https://docs.bugsnag.com/api/error-reporting/#json-payload)\nvar formatStackframe = function (frame) {\n var f = {\n file: frame.fileName,\n method: normaliseFunctionName(frame.functionName),\n lineNumber: frame.lineNumber,\n columnNumber: frame.columnNumber,\n code: undefined,\n inProject: undefined\n };\n // Some instances result in no file:\n // - calling notify() from chrome's terminal results in no file/method.\n // - non-error exception thrown from global code in FF\n // This adds one.\n if (f.lineNumber > -1 && !f.file && !f.method) {\n f.file = 'global code';\n }\n return f;\n};\nvar normaliseFunctionName = function (name) {\n return /^global code$/i.test(name) ? 'global code' : name;\n};\nvar defaultHandledState = function () {\n return {\n unhandled: false,\n severity: 'warning',\n severityReason: {\n type: 'handledException'\n }\n };\n};\nvar ensureString = function (str) {\n return typeof str === 'string' ? str : '';\n};\nfunction createBugsnagError(errorClass, errorMessage, type, stacktrace) {\n return {\n errorClass: ensureString(errorClass),\n errorMessage: ensureString(errorMessage),\n type: type,\n stacktrace: _$reduce_26(stacktrace, function (accum, frame) {\n var f = formatStackframe(frame);\n // don't include a stackframe if none of its properties are defined\n try {\n if (JSON.stringify(f) === '{}') return accum;\n return accum.concat(f);\n } catch (e) {\n return accum;\n }\n }, [])\n };\n}\nfunction getCauseStack(error) {\n if (error.cause) {\n return [error].concat(getCauseStack(error.cause));\n } else {\n return [error];\n }\n}\n\n// Helpers\n\nEvent.getStacktrace = function (error, errorFramesToSkip, backtraceFramesToSkip) {\n if (_$hasStack_28(error)) return _$errorStackParser_19.parse(error).slice(errorFramesToSkip);\n // error wasn't provided or didn't have a stacktrace so try to walk the callstack\n try {\n return _$filter_21(_$stackGenerator_8.backtrace(), function (frame) {\n return (frame.functionName || '').indexOf('StackGenerator$$') === -1;\n }).slice(1 + backtraceFramesToSkip);\n } catch (e) {\n return [];\n }\n};\nEvent.create = function (maybeError, tolerateNonErrors, handledState, component, errorFramesToSkip, logger) {\n if (errorFramesToSkip === void 0) {\n errorFramesToSkip = 0;\n }\n var _normaliseError = normaliseError(maybeError, tolerateNonErrors, component, logger),\n error = _normaliseError[0],\n internalFrames = _normaliseError[1];\n var event;\n try {\n var stacktrace = Event.getStacktrace(error,\n // if an error was created/throw in the normaliseError() function, we need to\n // tell the getStacktrace() function to skip the number of frames we know will\n // be from our own functions. This is added to the number of frames deep we\n // were told about\n internalFrames > 0 ? 1 + internalFrames + errorFramesToSkip : 0,\n // if there's no stacktrace, the callstack may be walked to generated one.\n // this is how many frames should be removed because they come from our library\n 1 + errorFramesToSkip);\n event = new Event(error.name, error.message, stacktrace, handledState, maybeError);\n } catch (e) {\n event = new Event(error.name, error.message, [], handledState, maybeError);\n }\n if (error.name === 'InvalidError') {\n event.addMetadata(\"\" + component, 'non-error parameter', makeSerialisable(maybeError));\n }\n if (error.cause) {\n var _event$errors;\n var causes = getCauseStack(error).slice(1);\n var normalisedCauses = _$map_25(causes, function (cause) {\n // Only get stacktrace for error causes that are a valid JS Error and already have a stack\n var stacktrace = _$iserror_29(cause) && _$hasStack_28(cause) ? _$errorStackParser_19.parse(cause) : [];\n var _normaliseError2 = normaliseError(cause, true, 'error cause'),\n error = _normaliseError2[0];\n if (error.name === 'InvalidError') event.addMetadata('error cause', makeSerialisable(cause));\n return createBugsnagError(error.name, error.message, Event.__type, stacktrace);\n });\n (_event$errors = event.errors).push.apply(_event$errors, normalisedCauses);\n }\n return event;\n};\nvar makeSerialisable = function (err) {\n if (err === null) return 'null';\n if (err === undefined) return 'undefined';\n return err;\n};\nvar normaliseError = function (maybeError, tolerateNonErrors, component, logger) {\n var error;\n var internalFrames = 0;\n var createAndLogInputError = function (reason) {\n var verb = component === 'error cause' ? 'was' : 'received';\n if (logger) logger.warn(component + \" \" + verb + \" a non-error: \\\"\" + reason + \"\\\"\");\n var err = new Error(component + \" \" + verb + \" a non-error. See \\\"\" + component + \"\\\" tab for more detail.\");\n err.name = 'InvalidError';\n return err;\n };\n\n // In some cases:\n //\n // - the promise rejection handler (both in the browser and node)\n // - the node uncaughtException handler\n //\n // We are really limited in what we can do to get a stacktrace. So we use the\n // tolerateNonErrors option to ensure that the resulting error communicates as\n // such.\n if (!tolerateNonErrors) {\n if (_$iserror_29(maybeError)) {\n error = maybeError;\n } else {\n error = createAndLogInputError(typeof maybeError);\n internalFrames += 2;\n }\n } else {\n switch (typeof maybeError) {\n case 'string':\n case 'number':\n case 'boolean':\n error = new Error(String(maybeError));\n internalFrames += 1;\n break;\n case 'function':\n error = createAndLogInputError('function');\n internalFrames += 2;\n break;\n case 'object':\n if (maybeError !== null && _$iserror_29(maybeError)) {\n error = maybeError;\n } else if (maybeError !== null && hasNecessaryFields(maybeError)) {\n error = new Error(maybeError.message || maybeError.errorMessage);\n error.name = maybeError.name || maybeError.errorClass;\n internalFrames += 1;\n } else {\n error = createAndLogInputError(maybeError === null ? 'null' : 'unsupported object');\n internalFrames += 2;\n }\n break;\n default:\n error = createAndLogInputError('nothing');\n internalFrames += 2;\n }\n }\n if (!_$hasStack_28(error)) {\n // in IE10/11 a new Error() doesn't have a stacktrace until you throw it, so try that here\n try {\n throw error;\n } catch (e) {\n if (_$hasStack_28(e)) {\n error = e;\n // if the error only got a stacktrace after we threw it here, we know it\n // will only have one extra internal frame from this function, regardless\n // of whether it went through createAndLogInputError() or not\n internalFrames = 1;\n }\n }\n }\n return [error, internalFrames];\n};\n\n// default value for stacktrace.type\nEvent.__type = 'browserjs';\nvar hasNecessaryFields = function (error) {\n return (typeof error.name === 'string' || typeof error.errorClass === 'string') && (typeof error.message === 'string' || typeof error.errorMessage === 'string');\n};\nvar _$Event_15 = Event;\n\n// This is a heavily modified/simplified version of\n// https://github.com/othiym23/async-some\n// with the logic flipped so that it is akin to the\n// synchronous \"every\" method instead of \"some\".\n\n// run the asynchronous test function (fn) over each item in the array (arr)\n// in series until:\n// - fn(item, cb) => calls cb(null, false)\n// - or the end of the array is reached\n// the callback (cb) will be passed (null, false) if any of the items in arr\n// caused fn to call back with false, otherwise it will be passed (null, true)\nvar _$asyncEvery_16 = function (arr, fn, cb) {\n var index = 0;\n var next = function () {\n if (index >= arr.length) return cb(null, true);\n fn(arr[index], function (err, result) {\n if (err) return cb(err);\n if (result === false) return cb(null, false);\n index++;\n next();\n });\n };\n next();\n};\n\n/* removed: var _$asyncEvery_16 = require('./async-every'); */;\nvar _$callbackRunner_18 = function (callbacks, event, onCallbackError, cb) {\n // This function is how we support different kinds of callback:\n // - synchronous - return value\n // - node-style async with callback - cb(err, value)\n // - promise/thenable - resolve(value)\n // It normalises each of these into the lowest common denominator – a node-style callback\n var runMaybeAsyncCallback = function (fn, cb) {\n if (typeof fn !== 'function') return cb(null);\n try {\n // if function appears sync…\n if (fn.length !== 2) {\n var ret = fn(event);\n // check if it returned a \"thenable\" (promise)\n if (ret && typeof ret.then === 'function') {\n return ret.then(\n // resolve\n function (val) {\n return setTimeout(function () {\n return cb(null, val);\n });\n },\n // reject\n function (err) {\n setTimeout(function () {\n onCallbackError(err);\n return cb(null, true);\n });\n });\n }\n return cb(null, ret);\n }\n // if function is async…\n fn(event, function (err, result) {\n if (err) {\n onCallbackError(err);\n return cb(null);\n }\n cb(null, result);\n });\n } catch (e) {\n onCallbackError(e);\n cb(null);\n }\n };\n _$asyncEvery_16(callbacks, runMaybeAsyncCallback, cb);\n};\n\nvar _$syncCallbackRunner_32 = function (callbacks, callbackArg, callbackType, logger) {\n var ignore = false;\n var cbs = callbacks.slice();\n while (!ignore) {\n if (!cbs.length) break;\n try {\n ignore = cbs.pop()(callbackArg) === false;\n } catch (e) {\n logger.error(\"Error occurred in \" + callbackType + \" callback, continuing anyway\\u2026\");\n logger.error(e);\n }\n }\n return ignore;\n};\n\nvar _$pad_4 = function pad(num, size) {\n var s = '000000000' + num;\n return s.substr(s.length - size);\n};\n\n/* removed: var _$pad_4 = require('./pad.js'); */;\nvar env = typeof window === 'object' ? window : self;\nvar globalCount = 0;\nfor (var prop in env) {\n if (Object.hasOwnProperty.call(env, prop)) globalCount++;\n}\nvar mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;\nvar clientId = _$pad_4((mimeTypesLength + navigator.userAgent.length).toString(36) + globalCount.toString(36), 4);\nvar _$fingerprint_2 = function fingerprint() {\n return clientId;\n};\n\n/**\n * Check the provided value is a valid device id\n * @param {unknown} value\n * @returns\n */\nvar _$isCuid_3 = function isCuid(value) {\n return typeof value === 'string' && /^c[a-z0-9]{20,32}$/.test(value);\n};\n\n/**\n * cuid.js\n * Collision-resistant UID generator for browsers and node.\n * Sequential for fast db lookups and recency sorting.\n * Safe for element IDs and server-side lookups.\n *\n * Extracted from CLCTR\n *\n * Copyright (c) Eric Elliott 2012\n * MIT License\n */\n\n/* removed: var _$fingerprint_2 = require('./lib/fingerprint.js'); */;\n/* removed: var _$isCuid_3 = require('./lib/is-cuid.js'); */;\n/* removed: var _$pad_4 = require('./lib/pad.js'); */;\nvar c = 0,\n blockSize = 4,\n base = 36,\n discreteValues = Math.pow(base, blockSize);\nfunction randomBlock() {\n return _$pad_4((Math.random() * discreteValues << 0).toString(base), blockSize);\n}\nfunction safeCounter() {\n c = c < discreteValues ? c : 0;\n c++; // this is not subliminal\n return c - 1;\n}\nfunction cuid() {\n // Starting with a lowercase letter makes\n // it HTML element ID friendly.\n var letter = 'c',\n // hard-coded allows for sequential access\n\n // timestamp\n // warning: this exposes the exact date and time\n // that the uid was created.\n timestamp = new Date().getTime().toString(base),\n // Prevent same-machine collisions.\n counter = _$pad_4(safeCounter().toString(base), blockSize),\n // A few chars to generate distinct ids for different\n // clients (so different computers are far less\n // likely to generate the same id)\n print = _$fingerprint_2(),\n // Grab some more chars from Math.random()\n random = randomBlock() + randomBlock();\n return letter + timestamp + counter + print + random;\n}\ncuid.fingerprint = _$fingerprint_2;\ncuid.isCuid = _$isCuid_3;\nvar _$cuid_1 = cuid;\n\n/* removed: var _$cuid_1 = require('@bugsnag/cuid'); */;\nvar Session = /*#__PURE__*/function () {\n function Session() {\n this.id = _$cuid_1();\n this.startedAt = new Date();\n this._handled = 0;\n this._unhandled = 0;\n this._user = {};\n this.app = {};\n this.device = {};\n }\n var _proto = Session.prototype;\n _proto.getUser = function getUser() {\n return this._user;\n };\n _proto.setUser = function setUser(id, email, name) {\n this._user = {\n id: id,\n email: email,\n name: name\n };\n };\n _proto.toJSON = function toJSON() {\n return {\n id: this.id,\n startedAt: this.startedAt,\n events: {\n handled: this._handled,\n unhandled: this._unhandled\n }\n };\n };\n _proto._track = function _track(event) {\n this[event._handledState.unhandled ? '_unhandled' : '_handled'] += 1;\n };\n return Session;\n}();\nvar _$Session_36 = Session;\n\n/* removed: var _$config_14 = require('./config'); */;\n/* removed: var _$Event_15 = require('./event'); */;\n/* removed: var _$Breadcrumb_12 = require('./breadcrumb'); */;\n/* removed: var _$Session_36 = require('./session'); */;\n/* removed: var _$map_25 = require('./lib/es-utils/map'); */;\n/* removed: var _$includes_22 = require('./lib/es-utils/includes'); */;\n/* removed: var _$filter_21 = require('./lib/es-utils/filter'); */;\n/* removed: var _$reduce_26 = require('./lib/es-utils/reduce'); */;\n/* removed: var _$keys_24 = require('./lib/es-utils/keys'); */;\n/* removed: var _$assign_20 = require('./lib/es-utils/assign'); */;\n/* removed: var _$callbackRunner_18 = require('./lib/callback-runner'); */;\n/* removed: var _$metadataDelegate_31 = require('./lib/metadata-delegate'); */;\n/* removed: var _$syncCallbackRunner_32 = require('./lib/sync-callback-runner'); */;\n/* removed: var _$breadcrumbTypes_17 = require('./lib/breadcrumb-types'); */;\nvar __add_13 = _$featureFlagDelegate_27.add,\n __clear_13 = _$featureFlagDelegate_27.clear,\n __merge_13 = _$featureFlagDelegate_27.merge;\nvar noop = function () {};\nvar Client = /*#__PURE__*/function () {\n function Client(configuration, schema, internalPlugins, notifier) {\n var _this = this;\n if (schema === void 0) {\n schema = _$config_14.schema;\n }\n if (internalPlugins === void 0) {\n internalPlugins = [];\n }\n // notifier id\n this._notifier = notifier;\n\n // intialise opts and config\n this._config = {};\n this._schema = schema;\n\n // i/o\n this._delivery = {\n sendSession: noop,\n sendEvent: noop\n };\n this._logger = {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop\n };\n\n // plugins\n this._plugins = {};\n\n // state\n this._breadcrumbs = [];\n this._session = null;\n this._metadata = {};\n this._featuresIndex = {};\n this._features = [];\n this._context = undefined;\n this._user = {};\n\n // callbacks:\n // e: onError\n // s: onSession\n // sp: onSessionPayload\n // b: onBreadcrumb\n // (note these names are minified by hand because object\n // properties are not safe to minify automatically)\n this._cbs = {\n e: [],\n s: [],\n sp: [],\n b: []\n };\n\n // expose internal constructors\n this.Client = Client;\n this.Event = _$Event_15;\n this.Breadcrumb = _$Breadcrumb_12;\n this.Session = _$Session_36;\n this._config = this._configure(configuration, internalPlugins);\n _$map_25(internalPlugins.concat(this._config.plugins), function (pl) {\n if (pl) _this._loadPlugin(pl);\n });\n\n // when notify() is called we need to know how many frames are from our own source\n // this inital value is 1 not 0 because we wrap notify() to ensure it is always\n // bound to have the client as its `this` value – see below.\n this._depth = 1;\n var self = this;\n var notify = this.notify;\n this.notify = function () {\n return notify.apply(self, arguments);\n };\n }\n var _proto = Client.prototype;\n _proto.addMetadata = function addMetadata(section, keyOrObj, maybeVal) {\n return _$metadataDelegate_31.add(this._metadata, section, keyOrObj, maybeVal);\n };\n _proto.getMetadata = function getMetadata(section, key) {\n return _$metadataDelegate_31.get(this._metadata, section, key);\n };\n _proto.clearMetadata = function clearMetadata(section, key) {\n return _$metadataDelegate_31.clear(this._metadata, section, key);\n };\n _proto.addFeatureFlag = function addFeatureFlag(name, variant) {\n if (variant === void 0) {\n variant = null;\n }\n __add_13(this._features, this._featuresIndex, name, variant);\n };\n _proto.addFeatureFlags = function addFeatureFlags(featureFlags) {\n __merge_13(this._features, featureFlags, this._featuresIndex);\n };\n _proto.clearFeatureFlag = function clearFeatureFlag(name) {\n __clear_13(this._features, this._featuresIndex, name);\n };\n _proto.clearFeatureFlags = function clearFeatureFlags() {\n this._features = [];\n this._featuresIndex = {};\n };\n _proto.getContext = function getContext() {\n return this._context;\n };\n _proto.setContext = function setContext(c) {\n this._context = c;\n };\n _proto._configure = function _configure(opts, internalPlugins) {\n var schema = _$reduce_26(internalPlugins, function (schema, plugin) {\n if (plugin && plugin.configSchema) return _$assign_20({}, schema, plugin.configSchema);\n return schema;\n }, this._schema);\n\n // accumulate configuration and error messages\n var _reduce = _$reduce_26(_$keys_24(schema), function (accum, key) {\n var defaultValue = schema[key].defaultValue(opts[key]);\n if (opts[key] !== undefined) {\n var valid = schema[key].validate(opts[key]);\n if (!valid) {\n accum.errors[key] = schema[key].message;\n accum.config[key] = defaultValue;\n } else {\n if (schema[key].allowPartialObject) {\n accum.config[key] = _$assign_20(defaultValue, opts[key]);\n } else {\n accum.config[key] = opts[key];\n }\n }\n } else {\n accum.config[key] = defaultValue;\n }\n return accum;\n }, {\n errors: {},\n config: {}\n }),\n errors = _reduce.errors,\n config = _reduce.config;\n if (schema.apiKey) {\n // missing api key is the only fatal error\n if (!config.apiKey) throw new Error('No Bugsnag API Key set');\n // warn about an apikey that is not of the expected format\n if (!/^[0-9a-f]{32}$/i.test(config.apiKey)) errors.apiKey = 'should be a string of 32 hexadecimal characters';\n }\n\n // update and elevate some options\n this._metadata = _$assign_20({}, config.metadata);\n __merge_13(this._features, config.featureFlags, this._featuresIndex);\n this._user = _$assign_20({}, config.user);\n this._context = config.context;\n if (config.logger) this._logger = config.logger;\n\n // add callbacks\n if (config.onError) this._cbs.e = this._cbs.e.concat(config.onError);\n if (config.onBreadcrumb) this._cbs.b = this._cbs.b.concat(config.onBreadcrumb);\n if (config.onSession) this._cbs.s = this._cbs.s.concat(config.onSession);\n\n // finally warn about any invalid config where we fell back to the default\n if (_$keys_24(errors).length) {\n this._logger.warn(generateConfigErrorMessage(errors, opts));\n }\n return config;\n };\n _proto.getUser = function getUser() {\n return this._user;\n };\n _proto.setUser = function setUser(id, email, name) {\n this._user = {\n id: id,\n email: email,\n name: name\n };\n };\n _proto._loadPlugin = function _loadPlugin(plugin) {\n var result = plugin.load(this);\n // JS objects are not the safest way to store arbitrarily keyed values,\n // so bookend the key with some characters that prevent tampering with\n // stuff like __proto__ etc. (only store the result if the plugin had a\n // name)\n if (plugin.name) this._plugins[\"~\" + plugin.name + \"~\"] = result;\n };\n _proto.getPlugin = function getPlugin(name) {\n return this._plugins[\"~\" + name + \"~\"];\n };\n _proto._setDelivery = function _setDelivery(d) {\n this._delivery = d(this);\n };\n _proto.startSession = function startSession() {\n var session = new _$Session_36();\n session.app.releaseStage = this._config.releaseStage;\n session.app.version = this._config.appVersion;\n session.app.type = this._config.appType;\n session._user = _$assign_20({}, this._user);\n\n // run onSession callbacks\n var ignore = _$syncCallbackRunner_32(this._cbs.s, session, 'onSession', this._logger);\n if (ignore) {\n this._logger.debug('Session not started due to onSession callback');\n return this;\n }\n return this._sessionDelegate.startSession(this, session);\n };\n _proto.addOnError = function addOnError(fn, front) {\n if (front === void 0) {\n front = false;\n }\n this._cbs.e[front ? 'unshift' : 'push'](fn);\n };\n _proto.removeOnError = function removeOnError(fn) {\n this._cbs.e = _$filter_21(this._cbs.e, function (f) {\n return f !== fn;\n });\n };\n _proto._addOnSessionPayload = function _addOnSessionPayload(fn) {\n this._cbs.sp.push(fn);\n };\n _proto.addOnSession = function addOnSession(fn) {\n this._cbs.s.push(fn);\n };\n _proto.removeOnSession = function removeOnSession(fn) {\n this._cbs.s = _$filter_21(this._cbs.s, function (f) {\n return f !== fn;\n });\n };\n _proto.addOnBreadcrumb = function addOnBreadcrumb(fn, front) {\n if (front === void 0) {\n front = false;\n }\n this._cbs.b[front ? 'unshift' : 'push'](fn);\n };\n _proto.removeOnBreadcrumb = function removeOnBreadcrumb(fn) {\n this._cbs.b = _$filter_21(this._cbs.b, function (f) {\n return f !== fn;\n });\n };\n _proto.pauseSession = function pauseSession() {\n return this._sessionDelegate.pauseSession(this);\n };\n _proto.resumeSession = function resumeSession() {\n return this._sessionDelegate.resumeSession(this);\n };\n _proto.leaveBreadcrumb = function leaveBreadcrumb(message, metadata, type) {\n // coerce bad values so that the defaults get set\n message = typeof message === 'string' ? message : '';\n type = typeof type === 'string' && _$includes_22(_$breadcrumbTypes_17, type) ? type : 'manual';\n metadata = typeof metadata === 'object' && metadata !== null ? metadata : {};\n\n // if no message, discard\n if (!message) return;\n var crumb = new _$Breadcrumb_12(message, metadata, type);\n\n // run onBreadcrumb callbacks\n var ignore = _$syncCallbackRunner_32(this._cbs.b, crumb, 'onBreadcrumb', this._logger);\n if (ignore) {\n this._logger.debug('Breadcrumb not attached due to onBreadcrumb callback');\n return;\n }\n\n // push the valid crumb onto the queue and maintain the length\n this._breadcrumbs.push(crumb);\n if (this._breadcrumbs.length > this._config.maxBreadcrumbs) {\n this._breadcrumbs = this._breadcrumbs.slice(this._breadcrumbs.length - this._config.maxBreadcrumbs);\n }\n };\n _proto._isBreadcrumbTypeEnabled = function _isBreadcrumbTypeEnabled(type) {\n var types = this._config.enabledBreadcrumbTypes;\n return types === null || _$includes_22(types, type);\n };\n _proto.notify = function notify(maybeError, onError, postReportCallback) {\n if (postReportCallback === void 0) {\n postReportCallback = noop;\n }\n var event = _$Event_15.create(maybeError, true, undefined, 'notify()', this._depth + 1, this._logger);\n this._notify(event, onError, postReportCallback);\n };\n _proto._notify = function _notify(event, onError, postReportCallback) {\n var _this2 = this;\n if (postReportCallback === void 0) {\n postReportCallback = noop;\n }\n event.app = _$assign_20({}, event.app, {\n releaseStage: this._config.releaseStage,\n version: this._config.appVersion,\n type: this._config.appType\n });\n event.context = event.context || this._context;\n event._metadata = _$assign_20({}, event._metadata, this._metadata);\n event._user = _$assign_20({}, event._user, this._user);\n event.breadcrumbs = this._breadcrumbs.slice();\n __merge_13(event._features, this._features, event._featuresIndex);\n\n // exit early if events should not be sent on the current releaseStage\n if (this._config.enabledReleaseStages !== null && !_$includes_22(this._config.enabledReleaseStages, this._config.releaseStage)) {\n this._logger.warn('Event not sent due to releaseStage/enabledReleaseStages configuration');\n return postReportCallback(null, event);\n }\n var originalSeverity = event.severity;\n var onCallbackError = function (err) {\n // errors in callbacks are tolerated but we want to log them out\n _this2._logger.error('Error occurred in onError callback, continuing anyway…');\n _this2._logger.error(err);\n };\n var callbacks = [].concat(this._cbs.e).concat(onError);\n _$callbackRunner_18(callbacks, event, onCallbackError, function (err, shouldSend) {\n if (err) onCallbackError(err);\n if (!shouldSend) {\n _this2._logger.debug('Event not sent due to onError callback');\n return postReportCallback(null, event);\n }\n if (_this2._isBreadcrumbTypeEnabled('error')) {\n // only leave a crumb for the error if actually got sent\n Client.prototype.leaveBreadcrumb.call(_this2, event.errors[0].errorClass, {\n errorClass: event.errors[0].errorClass,\n errorMessage: event.errors[0].errorMessage,\n severity: event.severity\n }, 'error');\n }\n if (originalSeverity !== event.severity) {\n event._handledState.severityReason = {\n type: 'userCallbackSetSeverity'\n };\n }\n if (event.unhandled !== event._handledState.unhandled) {\n event._handledState.severityReason.unhandledOverridden = true;\n event._handledState.unhandled = event.unhandled;\n }\n if (_this2._session) {\n _this2._session._track(event);\n event._session = _this2._session;\n }\n _this2._delivery.sendEvent({\n apiKey: event.apiKey || _this2._config.apiKey,\n notifier: _this2._notifier,\n events: [event]\n }, function (err) {\n return postReportCallback(err, event);\n });\n });\n };\n return Client;\n}();\nvar generateConfigErrorMessage = function (errors, rawInput) {\n var er = new Error(\"Invalid configuration\\n\" + _$map_25(_$keys_24(errors), function (key) {\n return \" - \" + key + \" \" + errors[key] + \", got \" + stringify(rawInput[key]);\n }).join('\\n\\n'));\n return er;\n};\nvar stringify = function (val) {\n switch (typeof val) {\n case 'string':\n case 'number':\n case 'object':\n return JSON.stringify(val);\n default:\n return String(val);\n }\n};\nvar _$Client_13 = Client;\n\nvar _$jsonPayload_30 = {};\n/* removed: var _$safeJsonStringify_5 = require('@bugsnag/safe-json-stringify'); */;\nvar EVENT_REDACTION_PATHS = ['events.[].metaData', 'events.[].breadcrumbs.[].metaData', 'events.[].request'];\n_$jsonPayload_30.event = function (event, redactedKeys) {\n var payload = _$safeJsonStringify_5(event, null, null, {\n redactedPaths: EVENT_REDACTION_PATHS,\n redactedKeys: redactedKeys\n });\n if (payload.length > 10e5) {\n event.events[0]._metadata = {\n notifier: \"WARNING!\\nSerialized payload was \" + payload.length / 10e5 + \"MB (limit = 1MB)\\nmetadata was removed\"\n };\n payload = _$safeJsonStringify_5(event, null, null, {\n redactedPaths: EVENT_REDACTION_PATHS,\n redactedKeys: redactedKeys\n });\n }\n return payload;\n};\n_$jsonPayload_30.session = function (session, redactedKeys) {\n var payload = _$safeJsonStringify_5(session, null, null);\n return payload;\n};\n\nvar _$delivery_37 = {};\n/* removed: var _$jsonPayload_30 = require('@bugsnag/core/lib/json-payload'); */;\n_$delivery_37 = function (client, win) {\n if (win === void 0) {\n win = window;\n }\n return {\n sendEvent: function (event, cb) {\n if (cb === void 0) {\n cb = function () {};\n }\n if (client._config.endpoints.notify === null) {\n var err = new Error('Event not sent due to incomplete endpoint configuration');\n return cb(err);\n }\n var url = getApiUrl(client._config, 'notify', '4', win);\n var body = _$jsonPayload_30.event(event, client._config.redactedKeys);\n var req = new win.XDomainRequest();\n req.onload = function () {\n cb(null);\n };\n req.onerror = function () {\n var err = new Error('Event failed to send');\n client._logger.error('Event failed to send…', err);\n if (body.length > 10e5) {\n client._logger.warn(\"Event oversized (\" + (body.length / 10e5).toFixed(2) + \" MB)\");\n }\n cb(err);\n };\n req.open('POST', url);\n setTimeout(function () {\n try {\n req.send(body);\n } catch (e) {\n client._logger.error(e);\n cb(e);\n }\n }, 0);\n },\n sendSession: function (session, cb) {\n if (cb === void 0) {\n cb = function () {};\n }\n if (client._config.endpoints.sessions === null) {\n var err = new Error('Session not sent due to incomplete endpoint configuration');\n return cb(err);\n }\n var url = getApiUrl(client._config, 'sessions', '1', win);\n var req = new win.XDomainRequest();\n req.onload = function () {\n cb(null);\n };\n req.open('POST', url);\n setTimeout(function () {\n try {\n req.send(_$jsonPayload_30.session(session, client._config.redactedKeys));\n } catch (e) {\n client._logger.error(e);\n cb(e);\n }\n }, 0);\n }\n };\n};\nvar getApiUrl = function (config, endpoint, version, win) {\n // IE8 doesn't support Date.prototype.toISOstring(), but it does convert a date\n // to an ISO string when you use JSON stringify. Simply parsing the result of\n // JSON.stringify is smaller than using a toISOstring() polyfill.\n var isoDate = JSON.parse(JSON.stringify(new Date()));\n var url = matchPageProtocol(config.endpoints[endpoint], win.location.protocol);\n return url + \"?apiKey=\" + encodeURIComponent(config.apiKey) + \"&payloadVersion=\" + version + \"&sentAt=\" + encodeURIComponent(isoDate);\n};\nvar matchPageProtocol = _$delivery_37._matchPageProtocol = function (endpoint, pageProtocol) {\n return pageProtocol === 'http:' ? endpoint.replace(/^https:/, 'http:') : endpoint;\n};\n\n/* removed: var _$jsonPayload_30 = require('@bugsnag/core/lib/json-payload'); */;\nvar _$delivery_38 = function (client, win) {\n if (win === void 0) {\n win = window;\n }\n return {\n sendEvent: function (event, cb) {\n if (cb === void 0) {\n cb = function () {};\n }\n try {\n var url = client._config.endpoints.notify;\n if (url === null) {\n var err = new Error('Event not sent due to incomplete endpoint configuration');\n return cb(err);\n }\n var req = new win.XMLHttpRequest();\n var body = _$jsonPayload_30.event(event, client._config.redactedKeys);\n req.onreadystatechange = function () {\n if (req.readyState === win.XMLHttpRequest.DONE) {\n var status = req.status;\n if (status === 0 || status >= 400) {\n var _err = new Error(\"Request failed with status \" + status);\n client._logger.error('Event failed to send…', _err);\n if (body.length > 10e5) {\n client._logger.warn(\"Event oversized (\" + (body.length / 10e5).toFixed(2) + \" MB)\");\n }\n cb(_err);\n } else {\n cb(null);\n }\n }\n };\n req.open('POST', url);\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('Bugsnag-Api-Key', event.apiKey || client._config.apiKey);\n req.setRequestHeader('Bugsnag-Payload-Version', '4');\n req.setRequestHeader('Bugsnag-Sent-At', new Date().toISOString());\n req.send(body);\n } catch (e) {\n client._logger.error(e);\n }\n },\n sendSession: function (session, cb) {\n if (cb === void 0) {\n cb = function () {};\n }\n try {\n var url = client._config.endpoints.sessions;\n if (url === null) {\n var err = new Error('Session not sent due to incomplete endpoint configuration');\n return cb(err);\n }\n var req = new win.XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState === win.XMLHttpRequest.DONE) {\n var status = req.status;\n if (status === 0 || status >= 400) {\n var _err2 = new Error(\"Request failed with status \" + status);\n client._logger.error('Session failed to send…', _err2);\n cb(_err2);\n } else {\n cb(null);\n }\n }\n };\n req.open('POST', url);\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('Bugsnag-Api-Key', client._config.apiKey);\n req.setRequestHeader('Bugsnag-Payload-Version', '1');\n req.setRequestHeader('Bugsnag-Sent-At', new Date().toISOString());\n req.send(_$jsonPayload_30.session(session, client._config.redactedKeys));\n } catch (e) {\n client._logger.error(e);\n }\n }\n };\n};\n\nvar appStart = new Date();\nvar reset = function () {\n appStart = new Date();\n};\nvar _$app_39 = {\n name: 'appDuration',\n load: function (client) {\n client.addOnError(function (event) {\n var now = new Date();\n event.app.duration = now - appStart;\n }, true);\n return {\n reset: reset\n };\n }\n};\n\n/*\n * Sets the default context to be the current URL\n */\nvar _$context_40 = function (win) {\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n client.addOnError(function (event) {\n if (event.context !== undefined) return;\n event.context = win.location.pathname;\n }, true);\n }\n };\n};\n\n/* removed: var _$assign_20 = require('@bugsnag/core/lib/es-utils/assign'); */;\nvar BUGSNAG_ANONYMOUS_ID_KEY = 'bugsnag-anonymous-id';\nvar getDeviceId = function (win) {\n try {\n var storage = win.localStorage;\n var id = storage.getItem(BUGSNAG_ANONYMOUS_ID_KEY);\n\n // If we get an ID, make sure it looks like a valid cuid. The length can\n // fluctuate slightly, so some leeway is built in\n if (id && /^c[a-z0-9]{20,32}$/.test(id)) {\n return id;\n }\n /* removed: var _$cuid_1 = require('@bugsnag/cuid'); */;\n id = _$cuid_1();\n storage.setItem(BUGSNAG_ANONYMOUS_ID_KEY, id);\n return id;\n } catch (err) {\n // If localStorage is not available (e.g. because it's disabled) then give up\n }\n};\n\n/*\n * Automatically detects browser device details\n */\nvar _$device_41 = function (nav, win) {\n if (nav === void 0) {\n nav = navigator;\n }\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n var device = {\n locale: nav.browserLanguage || nav.systemLanguage || nav.userLanguage || nav.language,\n userAgent: nav.userAgent\n };\n if (win && win.screen && win.screen.orientation && win.screen.orientation.type) {\n device.orientation = win.screen.orientation.type;\n } else if (win && win.document) {\n device.orientation = win.document.documentElement.clientWidth > win.document.documentElement.clientHeight ? 'landscape' : 'portrait';\n }\n if (client._config.generateAnonymousId) {\n device.id = getDeviceId(win);\n }\n client.addOnSession(function (session) {\n session.device = _$assign_20({}, session.device, device);\n // only set device id if collectUserIp is false\n if (!client._config.collectUserIp) setDefaultUserId(session);\n });\n\n // add time just as the event is sent\n client.addOnError(function (event) {\n event.device = _$assign_20({}, event.device, device, {\n time: new Date()\n });\n if (!client._config.collectUserIp) setDefaultUserId(event);\n }, true);\n },\n configSchema: {\n generateAnonymousId: {\n validate: function (value) {\n return value === true || value === false;\n },\n defaultValue: function () {\n return true;\n },\n message: 'should be true|false'\n }\n }\n };\n};\nvar setDefaultUserId = function (eventOrSession) {\n // device id is also used to populate the user id field, if it's not already set\n var user = eventOrSession.getUser();\n if (!user || !user.id) {\n eventOrSession.setUser(eventOrSession.device.id);\n }\n};\n\n/* removed: var _$assign_20 = require('@bugsnag/core/lib/es-utils/assign'); */;\n\n/*\n * Sets the event request: { url } to be the current href\n */\nvar _$request_42 = function (win) {\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n client.addOnError(function (event) {\n if (event.request && event.request.url) return;\n event.request = _$assign_20({}, event.request, {\n url: win.location.href\n });\n }, true);\n }\n };\n};\n\n/* removed: var _$includes_22 = require('@bugsnag/core/lib/es-utils/includes'); */;\nvar _$session_43 = {\n load: function (client) {\n client._sessionDelegate = sessionDelegate;\n }\n};\nvar sessionDelegate = {\n startSession: function (client, session) {\n var sessionClient = client;\n sessionClient._session = session;\n sessionClient._pausedSession = null;\n\n // exit early if the current releaseStage is not enabled\n if (sessionClient._config.enabledReleaseStages !== null && !_$includes_22(sessionClient._config.enabledReleaseStages, sessionClient._config.releaseStage)) {\n sessionClient._logger.warn('Session not sent due to releaseStage/enabledReleaseStages configuration');\n return sessionClient;\n }\n sessionClient._delivery.sendSession({\n notifier: sessionClient._notifier,\n device: session.device,\n app: session.app,\n sessions: [{\n id: session.id,\n startedAt: session.startedAt,\n user: session._user\n }]\n });\n return sessionClient;\n },\n resumeSession: function (client) {\n // Do nothing if there's already an active session\n if (client._session) {\n return client;\n }\n\n // If we have a paused session then make it the active session\n if (client._pausedSession) {\n client._session = client._pausedSession;\n client._pausedSession = null;\n return client;\n }\n\n // Otherwise start a new session\n return client.startSession();\n },\n pauseSession: function (client) {\n client._pausedSession = client._session;\n client._session = null;\n }\n};\n\n/* removed: var _$assign_20 = require('@bugsnag/core/lib/es-utils/assign'); */;\n\n/*\n * Prevent collection of user IPs\n */\nvar _$clientIp_44 = {\n load: function (client) {\n if (client._config.collectUserIp) return;\n client.addOnError(function (event) {\n // If user.id is explicitly undefined, it will be missing from the payload. It needs\n // removing so that the following line replaces it\n if (event._user && typeof event._user.id === 'undefined') delete event._user.id;\n event._user = _$assign_20({\n id: '[REDACTED]'\n }, event._user);\n event.request = _$assign_20({\n clientIp: '[REDACTED]'\n }, event.request);\n });\n },\n configSchema: {\n collectUserIp: {\n defaultValue: function () {\n return true;\n },\n message: 'should be true|false',\n validate: function (value) {\n return value === true || value === false;\n }\n }\n }\n};\n\nvar _$consoleBreadcrumbs_45 = {};\n/* removed: var _$map_25 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$reduce_26 = require('@bugsnag/core/lib/es-utils/reduce'); */;\n/* removed: var _$filter_21 = require('@bugsnag/core/lib/es-utils/filter'); */;\n\n/*\n * Leaves breadcrumbs when console log methods are called\n */\n_$consoleBreadcrumbs_45.load = function (client) {\n var isDev = /^(local-)?dev(elopment)?$/.test(client._config.releaseStage);\n if (isDev || !client._isBreadcrumbTypeEnabled('log')) return;\n _$map_25(CONSOLE_LOG_METHODS, function (method) {\n var original = console[method];\n console[method] = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n client.leaveBreadcrumb('Console output', _$reduce_26(args, function (accum, arg, i) {\n // do the best/simplest stringification of each argument\n var stringified = '[Unknown value]';\n // this may fail if the input is:\n // - an object whose [[Prototype]] is null (no toString)\n // - an object with a broken toString or @@toPrimitive implementation\n try {\n stringified = String(arg);\n } catch (e) {}\n // if it stringifies to [object Object] attempt to JSON stringify\n if (stringified === '[object Object]') {\n // catch stringify errors and fallback to [object Object]\n try {\n stringified = JSON.stringify(arg);\n } catch (e) {}\n }\n accum[\"[\" + i + \"]\"] = stringified;\n return accum;\n }, {\n severity: method.indexOf('group') === 0 ? 'log' : method\n }), 'log');\n original.apply(console, args);\n };\n console[method]._restore = function () {\n console[method] = original;\n };\n });\n};\nif (\"production\" !== 'production') {\n _$consoleBreadcrumbs_45.destroy = function () {\n return CONSOLE_LOG_METHODS.forEach(function (method) {\n if (typeof console[method]._restore === 'function') console[method]._restore();\n });\n };\n}\nvar CONSOLE_LOG_METHODS = _$filter_21(['log', 'debug', 'info', 'warn', 'error'], function (method) {\n return typeof console !== 'undefined' && typeof console[method] === 'function';\n});\n\n/* removed: var _$map_25 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$reduce_26 = require('@bugsnag/core/lib/es-utils/reduce'); */;\n/* removed: var _$filter_21 = require('@bugsnag/core/lib/es-utils/filter'); */;\nvar MAX_LINE_LENGTH = 200;\nvar MAX_SCRIPT_LENGTH = 500000;\nvar _$inlineScriptContent_46 = function (doc, win) {\n if (doc === void 0) {\n doc = document;\n }\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n if (!client._config.trackInlineScripts) return;\n var originalLocation = win.location.href;\n var html = '';\n\n // in IE8-10 the 'interactive' state can fire too soon (before scripts have finished executing), so in those\n // we wait for the 'complete' state before assuming that synchronous scripts are no longer executing\n var isOldIe = !!doc.attachEvent;\n var DOMContentLoaded = isOldIe ? doc.readyState === 'complete' : doc.readyState !== 'loading';\n var getHtml = function () {\n return doc.documentElement.outerHTML;\n };\n\n // get whatever HTML exists at this point in time\n html = getHtml();\n var prev = doc.onreadystatechange;\n // then update it when the DOM content has loaded\n doc.onreadystatechange = function () {\n // IE8 compatible alternative to document#DOMContentLoaded\n if (doc.readyState === 'interactive') {\n html = getHtml();\n DOMContentLoaded = true;\n }\n try {\n prev.apply(this, arguments);\n } catch (e) {}\n };\n var _lastScript = null;\n var updateLastScript = function (script) {\n _lastScript = script;\n };\n var getCurrentScript = function () {\n var script = doc.currentScript || _lastScript;\n if (!script && !DOMContentLoaded) {\n var scripts = doc.scripts || doc.getElementsByTagName('script');\n script = scripts[scripts.length - 1];\n }\n return script;\n };\n var addSurroundingCode = function (lineNumber) {\n // get whatever html has rendered at this point\n if (!DOMContentLoaded || !html) html = getHtml();\n // simulate the raw html\n var htmlLines = [''].concat(html.split('\\n'));\n var zeroBasedLine = lineNumber - 1;\n var start = Math.max(zeroBasedLine - 3, 0);\n var end = Math.min(zeroBasedLine + 3, htmlLines.length);\n return _$reduce_26(htmlLines.slice(start, end), function (accum, line, i) {\n accum[start + 1 + i] = line.length <= MAX_LINE_LENGTH ? line : line.substr(0, MAX_LINE_LENGTH);\n return accum;\n }, {});\n };\n client.addOnError(function (event) {\n // remove any of our own frames that may be part the stack this\n // happens before the inline script check as it happens for all errors\n event.errors[0].stacktrace = _$filter_21(event.errors[0].stacktrace, function (f) {\n return !/__trace__$/.test(f.method);\n });\n var frame = event.errors[0].stacktrace[0];\n\n // remove hash and query string from url\n var cleanUrl = function (url) {\n return url.replace(/#.*$/, '').replace(/\\?.*$/, '');\n };\n\n // if frame.file exists and is not the original location of the page, this can't be an inline script\n if (frame && frame.file && cleanUrl(frame.file) !== cleanUrl(originalLocation)) return;\n\n // grab the last script known to have run\n var currentScript = getCurrentScript();\n if (currentScript) {\n var content = currentScript.innerHTML;\n event.addMetadata('script', 'content', content.length <= MAX_SCRIPT_LENGTH ? content : content.substr(0, MAX_SCRIPT_LENGTH));\n\n // only attempt to grab some surrounding code if we have a line number\n if (frame && frame.lineNumber) {\n frame.code = addSurroundingCode(frame.lineNumber);\n }\n }\n }, true);\n\n // Proxy all the timer functions whose callback is their 0th argument.\n // Keep a reference to the original setTimeout because we need it later\n var _map = _$map_25(['setTimeout', 'setInterval', 'setImmediate', 'requestAnimationFrame'], function (fn) {\n return __proxy(win, fn, function (original) {\n return __traceOriginalScript(original, function (args) {\n return {\n get: function () {\n return args[0];\n },\n replace: function (fn) {\n args[0] = fn;\n }\n };\n });\n });\n }),\n _setTimeout = _map[0];\n\n // Proxy all the host objects whose prototypes have an addEventListener function\n _$map_25(['EventTarget', 'Window', 'Node', 'ApplicationCache', 'AudioTrackList', 'ChannelMergerNode', 'CryptoOperation', 'EventSource', 'FileReader', 'HTMLUnknownElement', 'IDBDatabase', 'IDBRequest', 'IDBTransaction', 'KeyOperation', 'MediaController', 'MessagePort', 'ModalWindow', 'Notification', 'SVGElementInstance', 'Screen', 'TextTrack', 'TextTrackCue', 'TextTrackList', 'WebSocket', 'WebSocketWorker', 'Worker', 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'XMLHttpRequestUpload'], function (o) {\n if (!win[o] || !win[o].prototype || !Object.prototype.hasOwnProperty.call(win[o].prototype, 'addEventListener')) return;\n __proxy(win[o].prototype, 'addEventListener', function (original) {\n return __traceOriginalScript(original, eventTargetCallbackAccessor);\n });\n __proxy(win[o].prototype, 'removeEventListener', function (original) {\n return __traceOriginalScript(original, eventTargetCallbackAccessor, true);\n });\n });\n function __traceOriginalScript(fn, callbackAccessor, alsoCallOriginal) {\n if (alsoCallOriginal === void 0) {\n alsoCallOriginal = false;\n }\n return function () {\n // this is required for removeEventListener to remove anything added with\n // addEventListener before the functions started being wrapped by Bugsnag\n var args = [].slice.call(arguments);\n try {\n var cba = callbackAccessor(args);\n var cb = cba.get();\n if (alsoCallOriginal) fn.apply(this, args);\n if (typeof cb !== 'function') return fn.apply(this, args);\n if (cb.__trace__) {\n cba.replace(cb.__trace__);\n } else {\n var script = getCurrentScript();\n // this function mustn't be annonymous due to a bug in the stack\n // generation logic, meaning it gets tripped up\n // see: https://github.com/stacktracejs/stack-generator/issues/6\n cb.__trace__ = function __trace__() {\n // set the script that called this function\n updateLastScript(script);\n // immediately unset the currentScript synchronously below, however\n // if this cb throws an error the line after will not get run so schedule\n // an almost-immediate aysnc update too\n _setTimeout(function () {\n updateLastScript(null);\n }, 0);\n var ret = cb.apply(this, arguments);\n updateLastScript(null);\n return ret;\n };\n cb.__trace__.__trace__ = cb.__trace__;\n cba.replace(cb.__trace__);\n }\n } catch (e) {\n // swallow these errors on Selenium:\n // Permission denied to access property '__trace__'\n // WebDriverException: Message: Permission denied to access property \"handleEvent\"\n }\n // IE8 doesn't let you call .apply() on setTimeout/setInterval\n if (fn.apply) return fn.apply(this, args);\n switch (args.length) {\n case 1:\n return fn(args[0]);\n case 2:\n return fn(args[0], args[1]);\n default:\n return fn();\n }\n };\n }\n },\n configSchema: {\n trackInlineScripts: {\n validate: function (value) {\n return value === true || value === false;\n },\n defaultValue: function () {\n return true;\n },\n message: 'should be true|false'\n }\n }\n };\n};\nfunction __proxy(host, name, replacer) {\n var original = host[name];\n if (!original) return original;\n var replacement = replacer(original);\n host[name] = replacement;\n return original;\n}\nfunction eventTargetCallbackAccessor(args) {\n var isEventHandlerObj = !!args[1] && typeof args[1].handleEvent === 'function';\n return {\n get: function () {\n return isEventHandlerObj ? args[1].handleEvent : args[1];\n },\n replace: function (fn) {\n if (isEventHandlerObj) {\n args[1].handleEvent = fn;\n } else {\n args[1] = fn;\n }\n }\n };\n}\n\n/*\n * Leaves breadcrumbs when the user interacts with the DOM\n */\nvar _$interactionBreadcrumbs_47 = function (win) {\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n if (!('addEventListener' in win)) return;\n if (!client._isBreadcrumbTypeEnabled('user')) return;\n win.addEventListener('click', function (event) {\n var targetText, targetSelector;\n try {\n targetText = getNodeText(event.target);\n targetSelector = getNodeSelector(event.target, win);\n } catch (e) {\n targetText = '[hidden]';\n targetSelector = '[hidden]';\n client._logger.error('Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z');\n }\n client.leaveBreadcrumb('UI click', {\n targetText: targetText,\n targetSelector: targetSelector\n }, 'user');\n }, true);\n }\n };\n};\nvar trim = /^\\s*([^\\s][\\s\\S]{0,139}[^\\s])?\\s*/;\nfunction getNodeText(el) {\n var text = el.textContent || el.innerText || '';\n if (!text && (el.type === 'submit' || el.type === 'button')) {\n text = el.value;\n }\n text = text.replace(trim, '$1');\n if (text.length > 140) {\n return text.slice(0, 135) + '(...)';\n }\n return text;\n}\n\n// Create a label from tagname, id and css class of the element\nfunction getNodeSelector(el, win) {\n var parts = [el.tagName];\n if (el.id) parts.push('#' + el.id);\n if (el.className && el.className.length) parts.push(\".\" + el.className.split(' ').join('.'));\n // Can't get much more advanced with the current browser\n if (!win.document.querySelectorAll || !Array.prototype.indexOf) return parts.join('');\n try {\n if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('');\n } catch (e) {\n // Sometimes the query selector can be invalid just return it as-is\n return parts.join('');\n }\n // try to get a more specific selector if this one matches more than one element\n if (el.parentNode.childNodes.length > 1) {\n var index = Array.prototype.indexOf.call(el.parentNode.childNodes, el) + 1;\n parts.push(\":nth-child(\" + index + \")\");\n }\n if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('');\n // try prepending the parent node selector\n if (el.parentNode) return getNodeSelector(el.parentNode, win) + \" > \" + parts.join('');\n return parts.join('');\n}\n\nvar _$navigationBreadcrumbs_48 = {};\n/*\n* Leaves breadcrumbs when navigation methods are called or events are emitted\n*/\n_$navigationBreadcrumbs_48 = function (win) {\n if (win === void 0) {\n win = window;\n }\n var plugin = {\n load: function (client) {\n if (!('addEventListener' in win)) return;\n if (!client._isBreadcrumbTypeEnabled('navigation')) return;\n\n // returns a function that will drop a breadcrumb with a given name\n var drop = function (name) {\n return function () {\n return client.leaveBreadcrumb(name, {}, 'navigation');\n };\n };\n\n // simple drops – just names, no meta\n win.addEventListener('pagehide', drop('Page hidden'), true);\n win.addEventListener('pageshow', drop('Page shown'), true);\n win.addEventListener('load', drop('Page loaded'), true);\n win.document.addEventListener('DOMContentLoaded', drop('DOMContentLoaded'), true);\n // some browsers like to emit popstate when the page loads, so only add the popstate listener after that\n win.addEventListener('load', function () {\n return win.addEventListener('popstate', drop('Navigated back'), true);\n });\n\n // hashchange has some metadata that we care about\n win.addEventListener('hashchange', function (event) {\n var metadata = event.oldURL ? {\n from: relativeLocation(event.oldURL, win),\n to: relativeLocation(event.newURL, win),\n state: getCurrentState(win)\n } : {\n to: relativeLocation(win.location.href, win)\n };\n client.leaveBreadcrumb('Hash changed', metadata, 'navigation');\n }, true);\n\n // the only way to know about replaceState/pushState is to wrap them… >_<\n if (win.history.pushState) wrapHistoryFn(client, win.history, 'pushState', win, true);\n if (win.history.replaceState) wrapHistoryFn(client, win.history, 'replaceState', win);\n }\n };\n if (\"production\" !== 'production') {\n plugin.destroy = function (win) {\n if (win === void 0) {\n win = window;\n }\n win.history.replaceState._restore();\n win.history.pushState._restore();\n };\n }\n return plugin;\n};\nif (\"production\" !== 'production') {\n _$navigationBreadcrumbs_48.destroy = function (win) {\n if (win === void 0) {\n win = window;\n }\n win.history.replaceState._restore();\n win.history.pushState._restore();\n };\n}\n\n// takes a full url like http://foo.com:1234/pages/01.html?yes=no#section-2 and returns\n// just the path and hash parts, e.g. /pages/01.html?yes=no#section-2\nvar relativeLocation = function (url, win) {\n var a = win.document.createElement('A');\n a.href = url;\n return \"\" + a.pathname + a.search + a.hash;\n};\nvar stateChangeToMetadata = function (win, state, title, url) {\n var currentPath = relativeLocation(win.location.href, win);\n return {\n title: title,\n state: state,\n prevState: getCurrentState(win),\n to: url || currentPath,\n from: currentPath\n };\n};\nvar wrapHistoryFn = function (client, target, fn, win, resetEventCount) {\n if (resetEventCount === void 0) {\n resetEventCount = false;\n }\n var orig = target[fn];\n target[fn] = function (state, title, url) {\n client.leaveBreadcrumb(\"History \" + fn, stateChangeToMetadata(win, state, title, url), 'navigation');\n // if throttle plugin is in use, reset the event sent count\n if (resetEventCount && typeof client.resetEventCount === 'function') client.resetEventCount();\n // Internet Explorer will convert `undefined` to a string when passed, causing an unintended redirect\n // to '/undefined'. therefore we only pass the url if it's not undefined.\n orig.apply(target, [state, title].concat(url !== undefined ? url : []));\n };\n if (\"production\" !== 'production') {\n target[fn]._restore = function () {\n target[fn] = orig;\n };\n }\n};\nvar getCurrentState = function (win) {\n try {\n return win.history.state;\n } catch (e) {}\n};\n\nvar BREADCRUMB_TYPE = 'request';\n/* removed: var _$includes_22 = require('@bugsnag/core/lib/es-utils/includes'); */;\n\n/*\n * Leaves breadcrumbs when network requests occur\n */\nvar _$networkBreadcrumbs_49 = function (_ignoredUrls, win) {\n if (_ignoredUrls === void 0) {\n _ignoredUrls = [];\n }\n if (win === void 0) {\n win = window;\n }\n var restoreFunctions = [];\n var plugin = {\n load: function (client) {\n if (!client._isBreadcrumbTypeEnabled('request')) return;\n var ignoredUrls = [client._config.endpoints.notify, client._config.endpoints.sessions].concat(_ignoredUrls);\n monkeyPatchXMLHttpRequest();\n monkeyPatchFetch();\n\n // XMLHttpRequest monkey patch\n function monkeyPatchXMLHttpRequest() {\n if (!('addEventListener' in win.XMLHttpRequest.prototype) || !('WeakMap' in win)) return;\n var trackedRequests = new WeakMap();\n var requestHandlers = new WeakMap();\n var originalOpen = win.XMLHttpRequest.prototype.open;\n win.XMLHttpRequest.prototype.open = function open(method, url) {\n // it's possible for `this` to be `undefined`, which is not a valid key for a WeakMap\n if (this) {\n trackedRequests.set(this, {\n method: method,\n url: url\n });\n }\n originalOpen.apply(this, arguments);\n };\n var originalSend = win.XMLHttpRequest.prototype.send;\n win.XMLHttpRequest.prototype.send = function send(body) {\n var _this = this;\n var requestData = trackedRequests.get(this);\n if (requestData) {\n // if we have already setup listeners then this request instance is being reused,\n // so we need to remove the listeners from the previous send\n var listeners = requestHandlers.get(this);\n if (listeners) {\n this.removeEventListener('load', listeners.load);\n this.removeEventListener('error', listeners.error);\n }\n var requestStart = new Date();\n var error = function () {\n return handleXHRError(requestData.method, requestData.url, getDuration(requestStart));\n };\n var load = function () {\n return handleXHRLoad(requestData.method, requestData.url, _this.status, getDuration(requestStart));\n };\n this.addEventListener('load', load);\n this.addEventListener('error', error);\n // it's possible for `this` to be `undefined`, which is not a valid key for a WeakMap\n if (this) {\n requestHandlers.set(this, {\n load: load,\n error: error\n });\n }\n }\n originalSend.apply(this, arguments);\n };\n if (\"production\" !== 'production') {\n restoreFunctions.push(function () {\n win.XMLHttpRequest.prototype.open = originalOpen;\n win.XMLHttpRequest.prototype.send = originalSend;\n });\n }\n }\n function handleXHRLoad(method, url, status, duration) {\n if (url === undefined) {\n client._logger.warn('The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.');\n return;\n }\n\n // an XMLHttpRequest's URL can be an object as long as its 'toString'\n // returns a URL, e.g. a HTMLAnchorElement\n if (typeof url === 'string' && _$includes_22(ignoredUrls, url.replace(/\\?.*$/, ''))) {\n // don't leave a network breadcrumb from bugsnag notify calls\n return;\n }\n var metadata = {\n status: status,\n method: String(method),\n url: String(url),\n duration: duration\n };\n if (status >= 400) {\n // contacted server but got an error response\n client.leaveBreadcrumb('XMLHttpRequest failed', metadata, BREADCRUMB_TYPE);\n } else {\n client.leaveBreadcrumb('XMLHttpRequest succeeded', metadata, BREADCRUMB_TYPE);\n }\n }\n function handleXHRError(method, url, duration) {\n if (url === undefined) {\n client._logger.warn('The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.');\n return;\n }\n if (typeof url === 'string' && _$includes_22(ignoredUrls, url.replace(/\\?.*$/, ''))) {\n // don't leave a network breadcrumb from bugsnag notify calls\n return;\n }\n\n // failed to contact server\n client.leaveBreadcrumb('XMLHttpRequest error', {\n method: String(method),\n url: String(url),\n duration: duration\n }, BREADCRUMB_TYPE);\n }\n\n // window.fetch monkey patch\n function monkeyPatchFetch() {\n // only patch it if it exists and if it is not a polyfill (patching a polyfilled\n // fetch() results in duplicate breadcrumbs for the same request because the\n // implementation uses XMLHttpRequest which is also patched)\n if (!('fetch' in win) || win.fetch.polyfill) return;\n var oldFetch = win.fetch;\n win.fetch = function fetch() {\n var _arguments = arguments;\n var urlOrRequest = arguments[0];\n var options = arguments[1];\n var method;\n var url = null;\n if (urlOrRequest && typeof urlOrRequest === 'object') {\n url = urlOrRequest.url;\n if (options && 'method' in options) {\n method = options.method;\n } else if (urlOrRequest && 'method' in urlOrRequest) {\n method = urlOrRequest.method;\n }\n } else {\n url = urlOrRequest;\n if (options && 'method' in options) {\n method = options.method;\n }\n }\n if (method === undefined) {\n method = 'GET';\n }\n return new Promise(function (resolve, reject) {\n var requestStart = new Date();\n\n // pass through to native fetch\n oldFetch.apply(void 0, _arguments).then(function (response) {\n handleFetchSuccess(response, method, url, getDuration(requestStart));\n resolve(response);\n })[\"catch\"](function (error) {\n handleFetchError(method, url, getDuration(requestStart));\n reject(error);\n });\n });\n };\n if (\"production\" !== 'production') {\n restoreFunctions.push(function () {\n win.fetch = oldFetch;\n });\n }\n }\n var handleFetchSuccess = function (response, method, url, duration) {\n var metadata = {\n method: String(method),\n status: response.status,\n url: String(url),\n duration: duration\n };\n if (response.status >= 400) {\n // when the request comes back with a 4xx or 5xx status it does not reject the fetch promise,\n client.leaveBreadcrumb('fetch() failed', metadata, BREADCRUMB_TYPE);\n } else {\n client.leaveBreadcrumb('fetch() succeeded', metadata, BREADCRUMB_TYPE);\n }\n };\n var handleFetchError = function (method, url, duration) {\n client.leaveBreadcrumb('fetch() error', {\n method: String(method),\n url: String(url),\n duration: duration\n }, BREADCRUMB_TYPE);\n };\n }\n };\n if (\"production\" !== 'production') {\n plugin.destroy = function () {\n restoreFunctions.forEach(function (fn) {\n return fn();\n });\n restoreFunctions = [];\n };\n }\n return plugin;\n};\nvar getDuration = function (startTime) {\n return startTime && new Date() - startTime;\n};\n\n/* removed: var _$intRange_33 = require('@bugsnag/core/lib/validators/int-range'); */;\n\n/*\n * Throttles and dedupes events\n */\n\nvar _$throttle_50 = {\n load: function (client) {\n // track sent events for each init of the plugin\n var n = 0;\n\n // add onError hook\n client.addOnError(function (event) {\n // have max events been sent already?\n if (n >= client._config.maxEvents) {\n client._logger.warn(\"Cancelling event send due to maxEvents per session limit of \" + client._config.maxEvents + \" being reached\");\n return false;\n }\n n++;\n });\n client.resetEventCount = function () {\n n = 0;\n };\n },\n configSchema: {\n maxEvents: {\n defaultValue: function () {\n return 10;\n },\n message: 'should be a positive integer ≤100',\n validate: function (val) {\n return _$intRange_33(1, 100)(val);\n }\n }\n }\n};\n\nvar _$stripQueryString_51 = {};\n/*\n * Remove query strings (and fragments) from stacktraces\n */\n/* removed: var _$map_25 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$reduce_26 = require('@bugsnag/core/lib/es-utils/reduce'); */;\n_$stripQueryString_51 = {\n load: function (client) {\n client.addOnError(function (event) {\n var allFrames = _$reduce_26(event.errors, function (accum, er) {\n return accum.concat(er.stacktrace);\n }, []);\n _$map_25(allFrames, function (frame) {\n frame.file = strip(frame.file);\n });\n });\n }\n};\nvar strip = _$stripQueryString_51._strip = function (str) {\n return typeof str === 'string' ? str.replace(/\\?.*$/, '').replace(/#.*$/, '') : str;\n};\n\n/*\n * Automatically notifies Bugsnag when window.onerror is called\n */\n\nvar _$onerror_52 = function (win, component) {\n if (win === void 0) {\n win = window;\n }\n if (component === void 0) {\n component = 'window onerror';\n }\n return {\n load: function (client) {\n if (!client._config.autoDetectErrors) return;\n if (!client._config.enabledErrorTypes.unhandledExceptions) return;\n function onerror(messageOrEvent, url, lineNo, charNo, error) {\n // Ignore errors with no info due to CORS settings\n if (lineNo === 0 && /Script error\\.?/.test(messageOrEvent)) {\n client._logger.warn('Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z');\n } else {\n // any error sent to window.onerror is unhandled and has severity=error\n var handledState = {\n severity: 'error',\n unhandled: true,\n severityReason: {\n type: 'unhandledException'\n }\n };\n var event;\n\n // window.onerror can be called in a number of ways. This big if-else is how we\n // figure out which arguments were supplied, and what kind of values it received.\n\n if (error) {\n // if the last parameter (error) was supplied, this is a modern browser's\n // way of saying \"this value was thrown and not caught\"\n event = client.Event.create(error, true, handledState, component, 1);\n decorateStack(event.errors[0].stacktrace, url, lineNo, charNo);\n } else if (\n // This complex case detects \"error\" events that are typically synthesised\n // by jquery's trigger method (although can be created in other ways). In\n // order to detect this:\n // - the first argument (message) must exist and be an object (most likely it's a jQuery event)\n // - the second argument (url) must either not exist or be something other than a string (if it\n // exists and is not a string, it'll be the extraParameters argument from jQuery's trigger()\n // function)\n // - the third, fourth and fifth arguments must not exist (lineNo, charNo and error)\n typeof messageOrEvent === 'object' && messageOrEvent !== null && (!url || typeof url !== 'string') && !lineNo && !charNo && !error) {\n // The jQuery event may have a \"type\" property, if so use it as part of the error message\n var name = messageOrEvent.type ? \"Event: \" + messageOrEvent.type : 'Error';\n // attempt to find a message from one of the conventional properties, but\n // default to empty string (the event will fill it with a placeholder)\n var message = messageOrEvent.message || messageOrEvent.detail || '';\n event = client.Event.create({\n name: name,\n message: message\n }, true, handledState, component, 1);\n\n // provide the original thing onerror received – not our error-like object we passed to _notify\n event.originalError = messageOrEvent;\n\n // include the raw input as metadata – it might contain more info than we extracted\n event.addMetadata(component, {\n event: messageOrEvent,\n extraParameters: url\n });\n } else {\n // Lastly, if there was no \"error\" parameter this event was probably from an old\n // browser that doesn't support that. Instead we need to generate a stacktrace.\n event = client.Event.create(messageOrEvent, true, handledState, component, 1);\n decorateStack(event.errors[0].stacktrace, url, lineNo, charNo);\n }\n client._notify(event);\n }\n if (typeof prevOnError === 'function') prevOnError.apply(this, arguments);\n }\n var prevOnError = win.onerror;\n win.onerror = onerror;\n }\n };\n};\n\n// Sometimes the stacktrace has less information than was passed to window.onerror.\n// This function will augment the first stackframe with any useful info that was\n// received as arguments to the onerror callback.\nvar decorateStack = function (stack, url, lineNo, charNo) {\n if (!stack[0]) stack.push({});\n var culprit = stack[0];\n if (!culprit.file && typeof url === 'string') culprit.file = url;\n if (!culprit.lineNumber && isActualNumber(lineNo)) culprit.lineNumber = lineNo;\n if (!culprit.columnNumber) {\n if (isActualNumber(charNo)) {\n culprit.columnNumber = charNo;\n } else if (window.event && isActualNumber(window.event.errorCharacter)) {\n culprit.columnNumber = window.event.errorCharacter;\n }\n }\n};\nvar isActualNumber = function (n) {\n return typeof n === 'number' && String.call(n) !== 'NaN';\n};\n\n/* removed: var _$map_25 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$iserror_29 = require('@bugsnag/core/lib/iserror'); */;\nvar _listener;\n/*\n * Automatically notifies Bugsnag when window.onunhandledrejection is called\n */\nvar _$unhandledRejection_53 = function (win) {\n if (win === void 0) {\n win = window;\n }\n var plugin = {\n load: function (client) {\n if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return;\n var listener = function (evt) {\n var error = evt.reason;\n var isBluebird = false;\n\n // accessing properties on evt.detail can throw errors (see #394)\n try {\n if (evt.detail && evt.detail.reason) {\n error = evt.detail.reason;\n isBluebird = true;\n }\n } catch (e) {}\n\n // Report unhandled promise rejections as handled if the user has configured it\n var unhandled = !client._config.reportUnhandledPromiseRejectionsAsHandled;\n var event = client.Event.create(error, false, {\n severity: 'error',\n unhandled: unhandled,\n severityReason: {\n type: 'unhandledPromiseRejection'\n }\n }, 'unhandledrejection handler', 1, client._logger);\n if (isBluebird) {\n _$map_25(event.errors[0].stacktrace, fixBluebirdStacktrace(error));\n }\n client._notify(event, function (event) {\n if (_$iserror_29(event.originalError) && !event.originalError.stack) {\n var _event$addMetadata;\n event.addMetadata('unhandledRejection handler', (_event$addMetadata = {}, _event$addMetadata[Object.prototype.toString.call(event.originalError)] = {\n name: event.originalError.name,\n message: event.originalError.message,\n code: event.originalError.code\n }, _event$addMetadata));\n }\n });\n };\n if ('addEventListener' in win) {\n win.addEventListener('unhandledrejection', listener);\n } else {\n win.onunhandledrejection = function (reason, promise) {\n listener({\n detail: {\n reason: reason,\n promise: promise\n }\n });\n };\n }\n _listener = listener;\n }\n };\n if (\"production\" !== 'production') {\n plugin.destroy = function (win) {\n if (win === void 0) {\n win = window;\n }\n if (_listener) {\n if ('addEventListener' in win) {\n win.removeEventListener('unhandledrejection', _listener);\n } else {\n win.onunhandledrejection = null;\n }\n }\n _listener = null;\n };\n }\n return plugin;\n};\n\n// The stack parser on bluebird stacks in FF get a suprious first frame:\n//\n// Error: derp\n// b@http://localhost:5000/bluebird.html:22:24\n// a@http://localhost:5000/bluebird.html:18:9\n// @http://localhost:5000/bluebird.html:14:9\n//\n// results in\n// […]\n// 0: Object { file: \"Error: derp\", method: undefined, lineNumber: undefined, … }\n// 1: Object { file: \"http://localhost:5000/bluebird.html\", method: \"b\", lineNumber: 22, … }\n// 2: Object { file: \"http://localhost:5000/bluebird.html\", method: \"a\", lineNumber: 18, … }\n// 3: Object { file: \"http://localhost:5000/bluebird.html\", lineNumber: 14, columnNumber: 9, … }\n//\n// so the following reduce/accumulator function removes such frames\n//\n// Bluebird pads method names with spaces so trim that too…\n// https://github.com/petkaantonov/bluebird/blob/b7f21399816d02f979fe434585334ce901dcaf44/src/debuggability.js#L568-L571\nvar fixBluebirdStacktrace = function (error) {\n return function (frame) {\n if (frame.file === error.toString()) return;\n if (frame.method) {\n frame.method = frame.method.replace(/^\\s+/, '');\n }\n };\n};\n\nvar _$notifier_11 = {};\nvar name = 'Bugsnag JavaScript';\nvar version = '8.1.2';\nvar url = 'https://github.com/bugsnag/bugsnag-js';\n/* removed: var _$Client_13 = require('@bugsnag/core/client'); */;\n/* removed: var _$Event_15 = require('@bugsnag/core/event'); */;\n/* removed: var _$Session_36 = require('@bugsnag/core/session'); */;\n/* removed: var _$Breadcrumb_12 = require('@bugsnag/core/breadcrumb'); */;\n/* removed: var _$map_25 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$keys_24 = require('@bugsnag/core/lib/es-utils/keys'); */;\n/* removed: var _$assign_20 = require('@bugsnag/core/lib/es-utils/assign'); */;\n\n// extend the base config schema with some browser-specific options\nvar __schema_11 = _$assign_20({}, _$config_14.schema, _$config_10);\n/* removed: var _$onerror_52 = require('@bugsnag/plugin-window-onerror'); */;\n/* removed: var _$unhandledRejection_53 = require('@bugsnag/plugin-window-unhandled-rejection'); */;\n/* removed: var _$app_39 = require('@bugsnag/plugin-app-duration'); */;\n/* removed: var _$device_41 = require('@bugsnag/plugin-browser-device'); */;\n/* removed: var _$context_40 = require('@bugsnag/plugin-browser-context'); */;\n/* removed: var _$request_42 = require('@bugsnag/plugin-browser-request'); */;\n/* removed: var _$throttle_50 = require('@bugsnag/plugin-simple-throttle'); */;\n/* removed: var _$consoleBreadcrumbs_45 = require('@bugsnag/plugin-console-breadcrumbs'); */;\n/* removed: var _$networkBreadcrumbs_49 = require('@bugsnag/plugin-network-breadcrumbs'); */;\n/* removed: var _$navigationBreadcrumbs_48 = require('@bugsnag/plugin-navigation-breadcrumbs'); */;\n/* removed: var _$interactionBreadcrumbs_47 = require('@bugsnag/plugin-interaction-breadcrumbs'); */;\n/* removed: var _$inlineScriptContent_46 = require('@bugsnag/plugin-inline-script-content'); */;\n/* removed: var _$session_43 = require('@bugsnag/plugin-browser-session'); */;\n/* removed: var _$clientIp_44 = require('@bugsnag/plugin-client-ip'); */;\n/* removed: var _$stripQueryString_51 = require('@bugsnag/plugin-strip-query-string'); */;\n\n// delivery mechanisms\n/* removed: var _$delivery_37 = require('@bugsnag/delivery-x-domain-request'); */;\n/* removed: var _$delivery_38 = require('@bugsnag/delivery-xml-http-request'); */;\nvar Bugsnag = {\n _client: null,\n createClient: function (opts) {\n // handle very simple use case where user supplies just the api key as a string\n if (typeof opts === 'string') opts = {\n apiKey: opts\n };\n if (!opts) opts = {};\n var internalPlugins = [\n // add browser-specific plugins\n _$app_39, _$device_41(), _$context_40(), _$request_42(), _$throttle_50, _$session_43, _$clientIp_44, _$stripQueryString_51, _$onerror_52(), _$unhandledRejection_53(), _$navigationBreadcrumbs_48(), _$interactionBreadcrumbs_47(), _$networkBreadcrumbs_49(), _$consoleBreadcrumbs_45,\n // this one added last to avoid wrapping functionality before bugsnag uses it\n _$inlineScriptContent_46()];\n\n // configure a client with user supplied options\n var bugsnag = new _$Client_13(opts, __schema_11, internalPlugins, {\n name: name,\n version: version,\n url: url\n });\n\n // set delivery based on browser capability (IE 8+9 have an XDomainRequest object)\n bugsnag._setDelivery(window.XDomainRequest ? _$delivery_37 : _$delivery_38);\n bugsnag._logger.debug('Loaded!');\n bugsnag.leaveBreadcrumb('Bugsnag loaded', {}, 'state');\n return bugsnag._config.autoTrackSessions ? bugsnag.startSession() : bugsnag;\n },\n start: function (opts) {\n if (Bugsnag._client) {\n Bugsnag._client._logger.warn('Bugsnag.start() was called more than once. Ignoring.');\n return Bugsnag._client;\n }\n Bugsnag._client = Bugsnag.createClient(opts);\n return Bugsnag._client;\n },\n isStarted: function () {\n return Bugsnag._client != null;\n }\n};\n_$map_25(['resetEventCount'].concat(_$keys_24(_$Client_13.prototype)), function (m) {\n if (/^_/.test(m)) return;\n Bugsnag[m] = function () {\n if (!Bugsnag._client) return console.log(\"Bugsnag.\" + m + \"() was called before Bugsnag.start()\");\n Bugsnag._client._depth += 1;\n var ret = Bugsnag._client[m].apply(Bugsnag._client, arguments);\n Bugsnag._client._depth -= 1;\n return ret;\n };\n});\n_$notifier_11 = Bugsnag;\n_$notifier_11.Client = _$Client_13;\n_$notifier_11.Event = _$Event_15;\n_$notifier_11.Session = _$Session_36;\n_$notifier_11.Breadcrumb = _$Breadcrumb_12;\n\n// Export a \"default\" property for compatibility with ESM imports\n_$notifier_11[\"default\"] = Bugsnag;\n\nreturn _$notifier_11;\n\n});\n","/**\n * cuid.js\n * Collision-resistant UID generator for browsers and node.\n * Sequential for fast db lookups and recency sorting.\n * Safe for element IDs and server-side lookups.\n *\n * Extracted from CLCTR\n *\n * Copyright (c) Eric Elliott 2012\n * MIT License\n */\n\nvar fingerprint = require('./lib/fingerprint.js');\nvar isCuid = require('./lib/is-cuid.js');\nvar pad = require('./lib/pad.js');\n\nvar c = 0,\n blockSize = 4,\n base = 36,\n discreteValues = Math.pow(base, blockSize);\n\nfunction randomBlock () {\n return pad((Math.random() *\n discreteValues << 0)\n .toString(base), blockSize);\n}\n\nfunction safeCounter () {\n c = c < discreteValues ? c : 0;\n c++; // this is not subliminal\n return c - 1;\n}\n\nfunction cuid () {\n // Starting with a lowercase letter makes\n // it HTML element ID friendly.\n var letter = 'c', // hard-coded allows for sequential access\n\n // timestamp\n // warning: this exposes the exact date and time\n // that the uid was created.\n timestamp = new Date().getTime().toString(base),\n\n // Prevent same-machine collisions.\n counter = pad(safeCounter().toString(base), blockSize),\n\n // A few chars to generate distinct ids for different\n // clients (so different computers are far less\n // likely to generate the same id)\n print = fingerprint(),\n\n // Grab some more chars from Math.random()\n random = randomBlock() + randomBlock();\n\n return letter + timestamp + counter + print + random;\n}\n\ncuid.fingerprint = fingerprint;\ncuid.isCuid = isCuid;\n\nmodule.exports = cuid;\n","var pad = require('./pad.js');\n\nvar env = typeof window === 'object' ? window : self;\nvar globalCount = 0;\nfor (var prop in env) {\n if (Object.hasOwnProperty.call(env, prop)) globalCount++;\n}\nvar mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;\nvar clientId = pad((mimeTypesLength +\n navigator.userAgent.length).toString(36) +\n globalCount.toString(36), 4);\n\nmodule.exports = function fingerprint () {\n return clientId;\n};\n","/**\n * Check the provided value is a valid device id\n * @param {unknown} value\n * @returns\n */\nmodule.exports = function isCuid (value) {\n return typeof value === 'string' && (/^c[a-z0-9]{20,32}$/).test(value);\n};\n","module.exports = function pad (num, size) {\n var s = '000000000' + num;\n return s.substr(s.length - size);\n};\n","module.exports = require('@bugsnag/browser')\n","'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nvar dijkstra = {\n single_source_shortest_paths: function(graph, s, d) {\n // Predecessor map for each node that has been encountered.\n // node ID => predecessor node ID\n var predecessors = {};\n\n // Costs of shortest paths from s to all nodes encountered.\n // node ID => cost\n var costs = {};\n costs[s] = 0;\n\n // Costs of shortest paths from s to all nodes encountered; differs from\n // `costs` in that it provides easy access to the node that currently has\n // the known shortest path from s.\n // XXX: Do we actually need both `costs` and `open`?\n var open = dijkstra.PriorityQueue.make();\n open.push(s, 0);\n\n var closest,\n u, v,\n cost_of_s_to_u,\n adjacent_nodes,\n cost_of_e,\n cost_of_s_to_u_plus_cost_of_e,\n cost_of_s_to_v,\n first_visit;\n while (!open.empty()) {\n // In the nodes remaining in graph that have a known cost from s,\n // find the node, u, that currently has the shortest path from s.\n closest = open.pop();\n u = closest.value;\n cost_of_s_to_u = closest.cost;\n\n // Get nodes adjacent to u...\n adjacent_nodes = graph[u] || {};\n\n // ...and explore the edges that connect u to those nodes, updating\n // the cost of the shortest paths to any or all of those nodes as\n // necessary. v is the node across the current edge from u.\n for (v in adjacent_nodes) {\n if (adjacent_nodes.hasOwnProperty(v)) {\n // Get the cost of the edge running from u to v.\n cost_of_e = adjacent_nodes[v];\n\n // Cost of s to u plus the cost of u to v across e--this is *a*\n // cost from s to v that may or may not be less than the current\n // known cost to v.\n cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n // If we haven't visited v yet OR if the current known cost from s to\n // v is greater than the new cost we just found (cost of s to u plus\n // cost of u to v across e), update v's cost in the cost list and\n // update v's predecessor in the predecessor list (it's now u).\n cost_of_s_to_v = costs[v];\n first_visit = (typeof costs[v] === 'undefined');\n if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n costs[v] = cost_of_s_to_u_plus_cost_of_e;\n open.push(v, cost_of_s_to_u_plus_cost_of_e);\n predecessors[v] = u;\n }\n }\n }\n }\n\n if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n throw new Error(msg);\n }\n\n return predecessors;\n },\n\n extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n var nodes = [];\n var u = d;\n var predecessor;\n while (u) {\n nodes.push(u);\n predecessor = predecessors[u];\n u = predecessors[u];\n }\n nodes.reverse();\n return nodes;\n },\n\n find_path: function(graph, s, d) {\n var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n return dijkstra.extract_shortest_path_from_predecessor_list(\n predecessors, d);\n },\n\n /**\n * A very naive priority queue implementation.\n */\n PriorityQueue: {\n make: function (opts) {\n var T = dijkstra.PriorityQueue,\n t = {},\n key;\n opts = opts || {};\n for (key in T) {\n if (T.hasOwnProperty(key)) {\n t[key] = T[key];\n }\n }\n t.queue = [];\n t.sorter = opts.sorter || T.default_sorter;\n return t;\n },\n\n default_sorter: function (a, b) {\n return a.cost - b.cost;\n },\n\n /**\n * Add a new item to the queue and ensure the highest priority element\n * is at the front of the queue.\n */\n push: function (value, cost) {\n var item = {value: value, cost: cost};\n this.queue.push(item);\n this.queue.sort(this.sorter);\n },\n\n /**\n * Return the highest priority element in the queue.\n */\n pop: function () {\n return this.queue.shift();\n },\n\n empty: function () {\n return this.queue.length === 0;\n }\n }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n module.exports = dijkstra;\n}\n","'use strict'\n\nmodule.exports = function encodeUtf8 (input) {\n var result = []\n var size = input.length\n\n for (var index = 0; index < size; index++) {\n var point = input.charCodeAt(index)\n\n if (point >= 0xD800 && point <= 0xDBFF && size > index + 1) {\n var second = input.charCodeAt(index + 1)\n\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n point = (point - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n index += 1\n }\n }\n\n // US-ASCII\n if (point < 0x80) {\n result.push(point)\n continue\n }\n\n // 2-byte UTF-8\n if (point < 0x800) {\n result.push((point >> 6) | 192)\n result.push((point & 63) | 128)\n continue\n }\n\n // 3-byte UTF-8\n if (point < 0xD800 || (point >= 0xE000 && point < 0x10000)) {\n result.push((point >> 12) | 224)\n result.push(((point >> 6) & 63) | 128)\n result.push((point & 63) | 128)\n continue\n }\n\n // 4-byte UTF-8\n if (point >= 0x10000 && point <= 0x10FFFF) {\n result.push((point >> 18) | 240)\n result.push(((point >> 12) & 63) | 128)\n result.push(((point >> 6) & 63) | 128)\n result.push((point & 63) | 128)\n continue\n }\n\n // Invalid character\n result.push(0xEF, 0xBF, 0xBD)\n }\n\n return new Uint8Array(result).buffer\n}\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '' + func(text) + '
';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles
'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %> ');\n * compiled({ 'value': '