diff --git a/docs/backend.md b/docs/backend.md index 4a3a27815..83396d67e 100644 --- a/docs/backend.md +++ b/docs/backend.md @@ -4,9 +4,47 @@ This site is built using Drupal and combination of modules and themes. ## Drupal As of the writing of this document the foundation of the site is built using Drupal + Symphony + Composer. Drupal documentation can be found here: https://www.drupal.org/docs. This site follows Drupal coding standards and best practices. +### Drupal & Module Discovering Available Updates via Composer +Part of managing Drupal is keeping Drupal Core and Modules updated with latest versions to help alleviate potential security issues as well as providing users with the best experience offered. + +To perform a simple audit of available updates you can use `composer outdated "drupal/*"` to see what updates are available by referring to the section, "Direct dependencies required in composer.json" located at the top of the output from the issued command. These are modules/pakages which we have specifically required as part of our project. The other listings under the section, "Transitive dependencies not required in composer.json" are dependencies added via our required modules. + +If you ever need to track where a "Transitive dependency" is coming from you can issue the command `composer why {project/package}`. From there you will be given the package(s) which require this dependency. + +### Updating Drupal via Composer +Drupal projects managed through Composer typically use `drupal/core-recommended`, which ensures that Drupal core and its dependencies are installed with secure and tested versions. + +For ongoing updates we use the following command `composer update drupal/core-* -W` which will take care of both updating Drupal core and any dependencies that it may require. This will result in an updated `composer.lock` file which will be committed to the repository once the update has been tested locally. + +Once updated, the following drush command should be issued, `drush updatedb && drush cr`. This will check for any pending database updates followed up by a clearing of the cache. + +Run `drush cex`, to export and review any related configuration changes that is related to the update. Updates could affect other configurations such as field settings or other aspects of the site, so review carefully, test, and verify that the changes are valid. + +Finally, use `git status` and `git diff {file_name}` to reveal and review both file and configuration changes before comitting them to your branch. + ## Modules Modules are located in `/web/modules/` directory. Each module has an module page located on https://www.drupal.org/project/project_module. The modules page include documentation, versions, change details and an issue queue. Also most modules contain additional details in a README file in the module root. +### Installing modules via Composer +To add modules, use the Composer `require` command. For example, to add the **Admin Toolbar** module: + +`composer require drupal/admin_toolbar` + +This will download the module and ensure it is included in your `composer.json` file, allowing it to be version-controlled and managed by Composer. Additionally this will update your `composer.lock` file which will reflect the details of installed packages and dependencies as it relates to the module being installed. These changes will, again, require you to commit the files to the repository once testing has been done locally. + +### Updating modules via Composer +To update a specific module, for example, **Admin Toolbar**: + +`composer update drupal/admin_toolbar` + +This ensures that both the module and its dependencies are updated according to Drupal's compatibility guidelines. + +Once updated, the following drush command should be issued, `drush updatedb && drush cr`. This will check for any pending database updates followed up by a clearing of the cache. + +Run `drush cex`, to export and review any related configuration changes that is related to the module. Updates could affect other configurations such as field settings or other aspects of the site, so review carefully, test, and verify that the changes are valid. + +Finally, use `git status` and `git diff {config_file.yml}` to reveal and review configuration changes that are located in `config/...` directory before comitting them to your branch. + ### Contrib I've included some of the non-standard Drupal contrib modules and their use below. To see all the modules in the system review the modules dashboard page located at `/admin/modules`. These modules are maintained by the Drupal community and have regular updates for enhancements and security patches. @@ -67,18 +105,36 @@ Adds the ability to override a menu link per translation. ### Custom Below is a list of custom modules created for use on Vote.gov. These modules can be found in the codebase at `/web/modules/custom`. These modules are maintained by project developers and need to be re-evaulated for each Drupal upgrade. +#### Embedded Content - Placeholder +Provides replacement placeholder for Ckeditor5 embedded content. + #### Embedded Content - Touchpoints survey A CKEditor5 Embedded Content plugin that provides a means for embedding a Touchpoints survey in the wysiwyg. +#### Embedded Content - USWDS +Provides USWDS components for Ckeditor5 embedded content. + #### USAgov login Adds the ability to disable the default Drupal login form and replace with a button to log in via SSO. +#### Vote Fields +Adds custom field types to use across content types and/or block types. + +#### Vote NVRF +Provides custom functionality and handlers as it relates to the NVRF app. + +#### Vote Users +Provides custom functionality regarding user accounts. Currently this simply enables or blocks users who have the Site Builder role when installed or uninstalled, respectively. + #### Vote utility Provides custom token for use in pathauto settings. Adds the ability to limit the storage of block content revisions. Stores the source po files for importing string translations in the system. ## Module Patches Review the details in composer.json file under `extra.patches` additionally look at the `/patches/` directory at the root. These patches need to be re-evaluated when the original module gets updated to determine if the work has been included in the latest release or if the patch needs to be rerolled. +## Repositories +In addition to Module Patches, it is worth reviewing the `repositories` section of the composer.json file. Here we can choose/define where a package is installed from (its source code). This can be used to reference another source which could serve as an alternative to the project's public main repository. So three may be instances where this section will need to be updated to add or remove a repository source for a given module or package. + ## Database - Mysql The site utilizes Mysql for its database. diff --git a/testing/cypress/e2e/backEndTests/basic-page.cy.js b/testing/cypress/e2e/backEndTests/basic-page.cy.js index b43668b69..64dfb09f6 100644 --- a/testing/cypress/e2e/backEndTests/basic-page.cy.js +++ b/testing/cypress/e2e/backEndTests/basic-page.cy.js @@ -1,27 +1,43 @@ /// +import { pageObjects } from '../../support/pageObjects.js' describe('test for basic page', () => { + + beforeEach('visit site', () => { + cy.signin(Cypress.env('roles').site_admin.username, Cypress.env('test_pass')) + cy.visit('/node/add/page') + }) + it('test url alias', () => { - cy.signin(Cypress.env('roles').site_admin.username, Cypress.env('test_pass')) - + // Can set url alias - cy.visit('/node/add/page') - cy.get('[data-drupal-selector="edit-title-0-value"]').type('Test Page') - cy.get('[class="ck-blurred ck ck-content ck-editor__editable ck-rounded-corners ck-editor__editable_inline"]').then(field => { + pageObjects + .pageTitle() + .type('Test Page') + + pageObjects + .pageContent() + .then(field => { cy.get(field[0]).clear().realType('test page') }) - cy.get('[class="claro-details__summary claro-details__summary--accordion-item"]').then(dropdown => { + + pageObjects + .pageDetails().then(dropdown => { cy.get(dropdown[1]).click() - cy.get('[data-drupal-selector="edit-path-0"]').click() - cy.get('[data-drupal-selector="edit-path-0-pathauto"]').click() - cy.get('[data-drupal-selector="edit-path-0-alias"]').type('/cypress-url-alias-test') + pageObjects + .urlAlias().click() + pageObjects + .urlAuto().click() + pageObjects + .setAlias().type('/cypress-url-alias-test') }) - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .submitBtn().click() cy.url().should('contain', 'cypress-url-alias-test') cy.logout() }) -}) \ No newline at end of file +}) diff --git a/testing/cypress/e2e/backEndTests/content-editor-access.cy.js b/testing/cypress/e2e/backEndTests/content-editor-access.cy.js index 2c81649c3..13e609c25 100644 --- a/testing/cypress/e2e/backEndTests/content-editor-access.cy.js +++ b/testing/cypress/e2e/backEndTests/content-editor-access.cy.js @@ -1,4 +1,5 @@ /// +import { pageObjects } from '../../support/pageObjects.js' describe('Test Content Editor Role Access', () => { beforeEach('login as content editor', () => { @@ -8,7 +9,7 @@ describe('Test Content Editor Role Access', () => { after('logout of content editor role', () => { cy.logout() }) - + it('verify access to email signup', () => { cy.request({ url: '/block/4', @@ -102,9 +103,10 @@ describe('Test Content Editor Role Access', () => { it('verify ability to publish', () => { cy.visit('/node/add/page') - cy.get('[data-drupal-selector="edit-moderation-state-0-state"]').find('option').then(option => { + pageObjects + .publishState().find('option').then(option => { cy.wrap(option).should('not.contain', 'Published') }) }) -}) \ No newline at end of file +}) diff --git a/testing/cypress/e2e/backEndTests/content-manager-access.cy.js b/testing/cypress/e2e/backEndTests/content-manager-access.cy.js index 5dcf22a4e..45df5bd26 100644 --- a/testing/cypress/e2e/backEndTests/content-manager-access.cy.js +++ b/testing/cypress/e2e/backEndTests/content-manager-access.cy.js @@ -1,4 +1,6 @@ -// +/// +import { pageObjects } from '../../support/pageObjects.js' + describe('Test Content Manager Role Access', () => { beforeEach('login as content manager', () => { @@ -33,7 +35,7 @@ describe('Test Content Manager Role Access', () => { cy.request('/node/63/edit').then((response) => { expect(response.status).to.eq(200) }) - + cy.request('/node/add/landing').then((response) => { expect(response.status).to.eq(200) }) @@ -78,8 +80,9 @@ describe('Test Content Manager Role Access', () => { it('verify ability to publish', () => { cy.visit('/node/add/page') - cy.get('[data-drupal-selector="edit-moderation-state-0-state"]').find('option').then(option => { + pageObjects + .publishState().find('option').then(option => { cy.wrap(option).should('contain', 'Published') }) }) -}) \ No newline at end of file +}) diff --git a/testing/cypress/e2e/backEndTests/footer-menu-editor.cy.js b/testing/cypress/e2e/backEndTests/footer-menu-editor.cy.js index 66ddae5cc..485c1ad09 100644 --- a/testing/cypress/e2e/backEndTests/footer-menu-editor.cy.js +++ b/testing/cypress/e2e/backEndTests/footer-menu-editor.cy.js @@ -1,5 +1,5 @@ -// - +/// +import { pageObjects } from '../../support/pageObjects.js' describe('Footer Menu Function', () => { @@ -9,18 +9,25 @@ describe('Footer Menu Function', () => { cy.signin(Cypress.env('roles').site_admin.username, Cypress.env('test_pass')) cy.visit('/admin/structure/menu/manage/footer/add') - - cy.get('[data-drupal-selector="edit-title-0-value"]').type('Cypress Test Link') - cy.get('[data-drupal-selector="edit-link-0-uri"]').type('https://www.bixal.com/') - cy.get('[data-drupal-selector="edit-menu-link-display-settings"]').click().get('[data-drupal-selector="edit-weight-0-value"]').clear().type('-99') - - - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .linkTitle().type('Cypress Test Link') + pageObjects + .linkUrl().type('https://www.bixal.com/') + pageObjects + .displaySettings().click() + pageObjects + .linkWeight().clear().type('-99') + + pageObjects + .submitBtn().click() // check that the link is working as expected cy.visit('/') - cy.get('[data-test="footer"]').find('[data-test="footerLinks"]').then(link => { + pageObjects + .footer() + pageObjects + .footerLinks().then(link => { cy.get(link[0]).find('a').should('contain', 'Cypress Test Link') .should('have.attr', 'href').and('contain', 'bixal.com') }) @@ -29,11 +36,16 @@ describe('Footer Menu Function', () => { cy.visit('/admin/structure/menu/manage/footer') - cy.get('[class="edit dropbutton__item dropbutton-action"]').then(dropDown => { + pageObjects + .editDropdown() + .then(dropDown => { cy.get(dropDown[0]).click() - cy.get('[data-drupal-selector="edit-delete"]').click() - - cy.get('[class="ui-dialog-buttonset form-actions"]').find('button').then(btn => { + pageObjects + .deleteBtn().click() + + pageObjects + .confirmDelete() + .find('button').then(btn => { cy.get(btn[0]).click() }) }) diff --git a/testing/cypress/e2e/backEndTests/site-admin-access.cy.js b/testing/cypress/e2e/backEndTests/site-admin-access.cy.js index dc9652a36..495885989 100644 --- a/testing/cypress/e2e/backEndTests/site-admin-access.cy.js +++ b/testing/cypress/e2e/backEndTests/site-admin-access.cy.js @@ -1,5 +1,7 @@ // +import { pageObjects } from "../../support/pageObjects" + describe('Test Site Admin Role access', () => { beforeEach('login as site admin', () => { cy.signin(Cypress.env('roles').site_admin.username, Cypress.env('test_pass')) @@ -19,7 +21,7 @@ describe('Test Site Admin Role access', () => { cy.request('/block/1').then((response) => { expect(response.status).to.eq(200) }) - + // only site admin should be able to create banner cy.request('//block/add/government_banner').then((response) => { expect(response.status).to.eq(200) @@ -30,7 +32,7 @@ describe('Test Site Admin Role access', () => { cy.request('/node/63/edit').then((response) => { expect(response.status).to.eq(200) }) - + cy.request('/node/add/landing').then((response) => { expect(response.status).to.eq(200) }) @@ -59,8 +61,8 @@ describe('Test Site Admin Role access', () => { cy.request('/media/add').then((response) => { expect(response.status).to.eq(200) }) - - // admin cole should be able to delete + + // admin cole should be able to delete cy.request('/media/6/delete?').then((response) => { expect(response.status).to.eq(200) }) @@ -74,9 +76,10 @@ describe('Test Site Admin Role access', () => { it('verify ability to publish', () => { cy.visit('/node/add/page') - cy.get('[data-drupal-selector="edit-moderation-state-0-state"]').find('option').then(option => { + pageObjects + .publishState().find('option').then(option => { cy.wrap(option).should('contain', 'Published') }) }) -}) \ No newline at end of file +}) diff --git a/testing/cypress/e2e/backEndTests/user-content-access.cy.js b/testing/cypress/e2e/backEndTests/user-content-access.cy.js index 517313121..c990b3708 100644 --- a/testing/cypress/e2e/backEndTests/user-content-access.cy.js +++ b/testing/cypress/e2e/backEndTests/user-content-access.cy.js @@ -1,4 +1,6 @@ /// +import { pageObjects } from "../../support/pageObjects" + describe('Test User Role Access to Content Moderation', () => { @@ -7,70 +9,91 @@ describe('Test User Role Access to Content Moderation', () => { // Can create a draft cy.visit('/node/add/page') - cy.get('[data-drupal-selector="edit-title-0-value"]').type('Test Page') - - cy.get('[class="ck-blurred ck ck-content ck-editor__editable ck-rounded-corners ck-editor__editable_inline"]').then(field => { - cy.get(field[0]).clear().realType('test page') - }) - cy.get('[class="claro-details__summary claro-details__summary--accordion-item"]').then(dropdown => { - cy.get(dropdown[1]).click() - cy.get('[data-drupal-selector="edit-path-0"]').click() - cy.get('[data-drupal-selector="edit-path-0-pathauto"]').click() - cy.get('[data-drupal-selector="edit-path-0-alias"]').type('/cypress-content-moderation-test') - }) - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .pageTitle().type('Test Page') + + pageObjects + .pageContent().then(field => { + cy.get(field[0]).clear().realType('test page') + }) + + pageObjects + .pageDetails().then(dropdown => { + cy.get(dropdown[1]).click() + pageObjects + .urlAlias().click() + pageObjects + .urlAuto().click() + pageObjects + .setAlias().type('/cypress-content-moderation-test') + }) + pageObjects + .submitBtn().click() cy.url().should('contain', 'cypress-content-moderation-test') - // Can view draft content + // Can view draft content cy.request('/cypress-content-moderation-test').then((response) => { - expect(response.status).to.eq(200)}) - + expect(response.status).to.eq(200) + }) + // Can modify draft content cy.visit('/cypress-content-moderation-test') - cy.get('[class="usa-button-group__item"]').then(btn => { - cy.get(btn[1]).click() - }) + pageObjects + .editBar().then(btn => { + cy.get(btn[1]).click() + }) cy.url().should('contain', 'edit') // Can publish content cy.visit('/cypress-content-moderation-test') - cy.get('[data-drupal-selector="edit-new-state"]').select('Published') - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .publishOpt().select('Published') + pageObjects + .submitBtn().click() cy.get('[class="usa-alert__body"]').should('contain', 'The moderation state has been updated.') - // Can move content to archived status + // Can move content to archived status cy.visit('/cypress-content-moderation-test') - cy.get('[class="usa-button-group__item"]').then(btn => { - cy.get(btn[1]).click() - }) - cy.get('[data-drupal-selector="edit-moderation-state-0-state"]').select('Archived') - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .editBar().then(btn => { + cy.get(btn[1]).click() + }) + pageObjects + .publishState().select('Archived') + pageObjects + .submitBtn().click() cy.get('[id="edit-current"]').should('contain', 'Archived') // Can move archived content to draft cy.visit('/cypress-content-moderation-test') - cy.get('[data-drupal-selector="edit-new-state"]').select('Draft') - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .publishOpt().select('Draft') + pageObjects + .submitBtn().click() cy.get('[id="edit-current"]').should('contain', 'Draft') // Can delete content cy.visit('/cypress-content-moderation-test') - cy.get('[class="usa-button-group__item"]').then(btn => { - cy.get(btn[2]).click() - }) + pageObjects + .editBar().then(btn => { + cy.get(btn[2]).click() + }) cy.get('[class="page-title"]').should('contain', 'delete') // Can create and delete media cy.request('/admin/structure/media/add').then((response) => { - expect(response.status).to.eq(200)}) + expect(response.status).to.eq(200) + }) cy.visit('/admin/content/media') - cy.get('[class="edit dropbutton__item dropbutton-action"]').should('contain', 'Edit') + pageObjects + .editDropdown().should('contain', 'Edit') - // Can update the content moderation settings - cy.request('/admin/config/workflow/workflows/manage/publishing_content').then((response) => { - expect(response.status).to.eq(200)}) + // Can update the content moderation settings + cy.request('/admin/config/workflow/workflows/manage/publishing_content').then((response) => { + expect(response.status).to.eq(200) + }) - cy.logout() + cy.logout() }) it('Test Content Manager', () => { @@ -78,60 +101,75 @@ describe('Test User Role Access to Content Moderation', () => { // Can create a draft cy.visit('/node/add/page') - cy.get('[data-drupal-selector="edit-title-0-value"]').type('Test Page') + pageObjects + .pageTitle().type('Test Page') - cy.get('[class="ck-blurred ck ck-content ck-editor__editable ck-rounded-corners ck-editor__editable_inline"]').then(field => { - cy.get(field[0]).clear().realType('test page') - }) + pageObjects + .pageContent().then(field => { + cy.get(field[0]).clear().realType('test page') + }) - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .submitBtn().click() cy.url().should('contain', 'test-page') - // Can view draft content + // Can view draft content cy.request('/test-page').then((response) => { - expect(response.status).to.eq(200)}) - + expect(response.status).to.eq(200) + }) + // Can modify draft content cy.visit('/test-page') - cy.get('[class="usa-button-group__item"]').then(btn => { - cy.get(btn[1]).click() - }) + pageObjects + .editBar().then(btn => { + cy.get(btn[1]).click() + }) cy.url().should('contain', 'edit') // Can publish content cy.visit('/test-page') - cy.get('[data-drupal-selector="edit-new-state"]').select('Published') - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .publishOpt().select('Published') + pageObjects + .submitBtn().click() cy.get('[class="usa-alert__body"]').should('contain', 'The moderation state has been updated.') - // Can move content to archived status + // Can move content to archived status cy.visit('/test-page') - cy.get('[class="usa-button-group__item"]').then(btn => { - cy.get(btn[1]).click() - }) - cy.get('[data-drupal-selector="edit-moderation-state-0-state"]').select('Archived') - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .editBar().then(btn => { + cy.get(btn[1]).click() + }) + pageObjects + .publishState().select('Archived') + pageObjects + .submitBtn().click() cy.get('[id="edit-current"]').should('contain', 'Archived') // Can move archived content to draft cy.visit('/test-page') - cy.get('[data-drupal-selector="edit-new-state"]').select('Draft') - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .publishOpt().select('Draft') + pageObjects + .submitBtn().click() cy.get('[id="edit-current"]').should('contain', 'Draft') // Can delete content cy.visit('/test-page') - cy.get('[class="usa-button-group__item"]').then(btn => { - cy.get(btn[2]).click() - }) + pageObjects + .editBar().then(btn => { + cy.get(btn[2]).click() + }) cy.get('[class="page-title"]').should('contain', 'delete') // Can create and delete media cy.request('/media/add').then((response) => { - expect(response.status).to.eq(200)}) + expect(response.status).to.eq(200) + }) cy.visit('/admin/content/media') - cy.get('[class="edit dropbutton__item dropbutton-action"]').should('contain', 'Edit') + pageObjects + .editDropdown().should('contain', 'Edit') // should not be able to update the content moderation settings cy.request({ @@ -149,56 +187,70 @@ describe('Test User Role Access to Content Moderation', () => { // Can create a draft cy.visit('/node/add/page') - cy.get('[data-drupal-selector="edit-title-0-value"]').type('Test Page') - - cy.get('[class="ck-blurred ck ck-content ck-editor__editable ck-rounded-corners ck-editor__editable_inline"]').then(field => { - cy.get(field[0]).clear().realType('test page') - }) - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .pageTitle().type('Test Page') + + pageObjects + .pageContent().then(field => { + cy.get(field[0]).clear().realType('test page') + }) + pageObjects + .submitBtn().click() cy.url().should('contain', 'test') - // Can view own draft content + // Can view own draft content cy.request('/test-page').then((response) => { - expect(response.status).to.eq(200)}) + expect(response.status).to.eq(200) + }) // can view other draft content cy.request('/cypress-content-moderation-test').then((response) => { - expect(response.status).to.eq(200)}) - - // Can modify draft content - cy.visit('/test-page-0') - cy.get('[class="usa-button-group__item"]').then(btn => { - cy.get(btn[1]).click() + expect(response.status).to.eq(200) }) + + // Can modify draft content + cy.visit('/test-page-0') + pageObjects + .editBar().then(btn => { + cy.get(btn[1]).click() + }) cy.url().should('contain', 'edit') - + // Can not publish content cy.visit('/test-page-0') - cy.get('[data-drupal-selector="edit-submit"]').should('not.exist') + pageObjects + .submitBtn().should('not.exist') // can view archived content cy.request('/admin/content/moderated').then((response) => { - expect(response.status).to.eq(200)}) + expect(response.status).to.eq(200) + }) // Can move archived content to draft cy.visit('/cypress-content-moderation-test') - cy.get('[class="usa-button-group__item"]').then(btn => { - cy.get(btn[1]).click() - }) - cy.get('[data-drupal-selector="edit-submit"]').click() + pageObjects + .editBar().then(btn => { + cy.get(btn[1]).click() + }) + pageObjects + .submitBtn().click() // Can not delete content cy.visit('/admin/content') - cy.get('[class="dropbutton__toggle"]').then(btn => { - cy.get(btn[0]).click() - }) - cy.get('[class="translate dropbutton__item dropbutton-action secondary-action"]').should('not.contain', 'delete') + pageObjects + .editDropDown().then(btn => { + cy.get(btn[0]).click() + }) + pageObjects + .editOpt().should('not.contain', 'delete') // Can create media but not delete media cy.request('/media/add').then((response) => { - expect(response.status).to.eq(200)}) + expect(response.status).to.eq(200) + }) cy.visit('/admin/content/media') - cy.get('[class="translate dropbutton__item dropbutton-action"]').should('not.contain', 'edit') + pageObjects + .editOpt().should('not.contain', 'edit') // should not be able to update the content moderation settings cy.request({ @@ -211,28 +263,28 @@ describe('Test User Role Access to Content Moderation', () => { cy.logout() }) - // ! commenting out this test for the time being until content is published. it('test anonymous user access', () => { - // Can view published content - cy.request('/').then((response) => { - expect(response.status).to.eq(200)}) + // Can view published content + cy.request('/').then((response) => { + expect(response.status).to.eq(200) + }) - // Can not view draft content + // Can not view draft content cy.request({ url: '/cypress-content-moderation-test', - failOnStatusCode:false, - }).then((resp) => { + failOnStatusCode: false, + }).then((resp) => { expect(resp.status).to.eq(403) - }) + }) - // can not view archived content + // can not view archived content cy.request({ url: '/admin/content/moderated', - failOnStatusCode:false, - }).then((resp) => { + failOnStatusCode: false, + }).then((resp) => { expect(resp.status).to.eq(403) - }) + }) }) }) diff --git a/testing/cypress/support/pageObjects.js b/testing/cypress/support/pageObjects.js index d76294a35..cccec506b 100644 --- a/testing/cypress/support/pageObjects.js +++ b/testing/cypress/support/pageObjects.js @@ -1,7 +1,13 @@ class PageObjects { - // frontend test page objects + // frontend test page objects + footer() { + return cy.get('[data-test="footer"]') + } + + footerLinks() { + return cy.get('[data-test="footerLinks"]') + } - // * accessability tool bar themeSwitcher() { return cy.get('[data-test="themeSwitcher"]') } @@ -11,20 +17,17 @@ class PageObjects { } themeText() { - return cy.get('[data-test="themeText"]') + return cy.get('[data-test="themeText"]') } - // * email signup emailSignup() { return cy.get('[data-test="emailSignup"]') } - // * footer contact footerContact() { return cy.get('[data-test="footerContact"]') } - // * govt banner headerLogo() { return cy.get('[data-test="headerLogo"]') } @@ -33,11 +36,10 @@ class PageObjects { return cy.get('[data-test="headerButton"]') } - headerBanner() { + headerBanner() { return cy.get('[data-test="headerBanner"]') } - // * language selector languageButton() { return cy.get('[data-test="languageButton"]') } @@ -50,7 +52,6 @@ class PageObjects { return cy.get('[ data-test="langItem"]') } - // * main menu mainNav() { return cy.get('[data-test="mainNav"]') } @@ -79,12 +80,10 @@ class PageObjects { return cy.get('[data-test="mainCloseBtn"]') } - // * nvrf download nvrfDownload() { return cy.get('[data-test="nvrfDownload"]') } - // * search bar searchBox() { return cy.get('[data-test="searchBox"]') } @@ -93,7 +92,6 @@ class PageObjects { return cy.get('[data-test="searchBtn"]') } - // * state pages registrationInfo() { return cy.get('[data-test="registrationInfo"]') } @@ -102,7 +100,6 @@ class PageObjects { return cy.get('[data-test="nvrfForm"]') } - // * state registration stateInput() { return cy.get('[data-test="stateInput"]') } @@ -111,6 +108,82 @@ class PageObjects { return cy.get('[data-test="stateList"]') } + // Backend Tests + pageTitle() { + return cy.get('[data-drupal-selector="edit-title-0-value"]') + } + + pageContent() { + return cy.get('[class="ck-blurred ck ck-content ck-editor__editable ck-rounded-corners ck-editor__editable_inline"]') + } + + pageDetails() { + return cy.get('[class="claro-details__summary claro-details__summary--accordion-item"]') + } + + urlAlias() { + return cy.get('[data-drupal-selector="edit-path-0"]') + } + + urlAuto() { + return cy.get('[data-drupal-selector="edit-path-0-pathauto"]') + } + + setAlias() { + return cy.get('[data-drupal-selector="edit-path-0-alias"]') + } + + submitBtn() { + return cy.get('[data-drupal-selector="edit-submit"]') + } + + publishState() { + return cy.get('[data-drupal-selector="edit-moderation-state-0-state"]') + } + + linkTitle() { + return cy.get('[data-drupal-selector="edit-title-0-value"]') + } + + linkUrl() { + return cy.get('[data-drupal-selector="edit-link-0-uri"]') + } + + displaySettings() { + return cy.get('[data-drupal-selector="edit-menu-link-display-settings"]') + } + + linkWeight() { + return cy.get('[data-drupal-selector="edit-weight-0-value"]') + } + + editDropdown() { + return cy.get('[class="edit dropbutton__item dropbutton-action"]') + } + + deleteBtn() { + return cy.get('[data-drupal-selector="edit-delete"]') + } + + confirmDelete() { + return cy.get('[class="ui-dialog-buttonset form-actions"]') + } + + editBar() { + return cy.get('[data-test="editMenu"]') + } + + publishOpt() { + return cy.get('[data-drupal-selector="edit-new-state"]') + } + + editDropDown() { + return cy.get('[class="dropbutton__toggle"]') + } + + editOpt() { + return cy.get('[class="translate dropbutton__item dropbutton-action"]') + } } -export const pageObjects = new PageObjects() \ No newline at end of file +export const pageObjects = new PageObjects() diff --git a/web/modules/custom/vote_nvrf/dist/assets/index.js b/web/modules/custom/vote_nvrf/dist/assets/index.js index c6d651a63..cfefeb779 100644 --- a/web/modules/custom/vote_nvrf/dist/assets/index.js +++ b/web/modules/custom/vote_nvrf/dist/assets/index.js @@ -118,4 +118,4 @@ end end`},wS=function(){for(var e=[],t=0;t"},wf=function(e){return pc(e,4)},qX=function(e){if(KG(e))return wf(e);if(XG(e)){var t=mC(e),r=gC(e);return""+wf(t)+wf(r)}var n=Uh(e),a="0x"+n+" is not a valid UTF-8 or UTF-16 codepoint.";throw new Error(a)},KX=function(e){var t=0,r=function(n){t|=1<=T.Zero&&d<=T.Seven?(n+=o,(n.length===3||!(p>="0"&&p<="7"))&&(i(parseInt(n,8)),n="")):i(d):d===T.BackSlash?a=!0:i(d)}return new Uint8Array(r)},t.prototype.decodeText=function(){var r=this.asBytes();return xC(r)?yC(r):fT(r)},t.prototype.decodeDate=function(){var r=this.decodeText(),n=pC(r);if(!n)throw new hT(r);return n},t.prototype.asString=function(){return this.value},t.prototype.clone=function(){return t.of(this.value)},t.prototype.toString=function(){return"("+this.value+")"},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(r,n){return r[n++]=T.LeftParen,n+=Tr(this.value,r,n),r[n++]=T.RightParen,this.value.length+2},t.of=function(r){return new t(r)},t.fromDate=function(r){var n=va(String(r.getUTCFullYear()),4,"0"),a=va(String(r.getUTCMonth()+1),2,"0"),i=va(String(r.getUTCDate()),2,"0"),s=va(String(r.getUTCHours()),2,"0"),h=va(String(r.getUTCMinutes()),2,"0"),o=va(String(r.getUTCSeconds()),2,"0");return new t("D:"+n+a+i+s+h+o+"Z")},t}(Yr),Ob=function(){function e(t,r,n,a){var i=this;this.allGlyphsInFontSortedById=function(){for(var s=new Array(i.font.characterSet.length),h=0,o=s.length;h>3)]>>7-((g&7)<<0)&1,_=3*G;h[E]=k[_],h[E+1]=k[_+1],h[E+2]=k[_+2],h[E+3]=G>2)]>>6-((g&3)<<1)&3,_=3*G;h[E]=k[_],h[E+1]=k[_+1],h[E+2]=k[_+2],h[E+3]=G>1)]>>4-((g&1)<<2)&15,_=3*G;h[E]=k[_],h[E+1]=k[_+1],h[E+2]=k[_+2],h[E+3]=G>>3)]>>>7-(ve&7)&1),Q=K==S*255?0:255;o[be+ve]=Q<<24|K<<16|K<<8|K}else if(p==2)for(var ve=0;ve>>2)]>>>6-((ve&3)<<1)&3),Q=K==S*85?0:255;o[be+ve]=Q<<24|K<<16|K<<8|K}else if(p==4)for(var ve=0;ve>>1)]>>>4-((ve&1)<<2)&15),Q=K==S*17?0:255;o[be+ve]=Q<<24|K<<16|K<<8|K}else if(p==8)for(var ve=0;ve>>2<<3));a==0;){if(a=S(t,m,1),i=S(t,m+1,2),m+=3,i==0){m&7&&(m+=8-(m&7));var R=(m>>>3)+4,H=t[R-4]|t[R-3]<<8;M&&(r=e.H.W(r,v+H)),r.set(new n(t.buffer,t.byteOffset+R,H),v),m=R+H<<3,v+=H;continue}if(M&&(r=e.H.W(r,v+(1<<17))),i==1&&(g=A.J,w=A.h,d=512-1,p=32-1),i==2){s=y(t,m,5)+257,h=y(t,m+5,5)+1,o=y(t,m+10,4)+4,m+=14;for(var G=1,_=0;_<38;_+=2)A.Q[_]=0,A.Q[_+1]=0;for(var _=0;_G&&(G=X)}m+=3*o,E(A.Q,G),k(A.Q,G,A.u),g=A.w,w=A.d,m=x(A.u,(1<>>4;if(!(ve>>>8))r[v++]=ve;else{if(ve==256)break;var Q=v+ve-254;if(ve>264){var W=A.q[ve-257];Q=v+(W>>>3)+y(t,m,W&7),m+=W&7}var Y=w[F(t,m)&p];m+=Y&15;var $=Y>>>4,ue=A.c[$],oe=(ue>>>4)+S(t,m,ue&15);for(m+=ue&15;v>>4;if(v<=15)s[d]=v,d++;else{var m=0,g=0;v==16?(g=3+h(a,i,2),i+=2,m=s[d-1]):v==17?(g=3+h(a,i,3),i+=3):v==18&&(g=11+h(a,i,7),i+=7);for(var w=d+g;d>>1;si&&(i=o),s++}for(;s>1,d=t[h+1],p=o<<4|d,v=r-d,m=t[h]<>>15-r;n[w]=p,m++}},e.H.l=function(t,r){for(var n=e.H.m.r,a=15-r,i=0;i>>a}},e.H.M=function(t,r,n){n=n<<(r&7);var a=r>>>3;t[a]|=n,t[a+1]|=n>>>8},e.H.I=function(t,r,n){n=n<<(r&7);var a=r>>>3;t[a]|=n,t[a+1]|=n>>>8,t[a+2]|=n>>>16},e.H.e=function(t,r,n){return(t[r>>>3]|t[(r>>>3)+1]<<8)>>>(r&7)&(1<>>3]|t[(r>>>3)+1]<<8|t[(r>>>3)+2]<<16)>>>(r&7)&(1<>>3]|t[(r>>>3)+1]<<8|t[(r>>>3)+2]<<16)>>>(r&7)},e.H.i=function(t,r){return(t[r>>>3]|t[(r>>>3)+1]<<8|t[(r>>>3)+2]<<16|t[(r>>>3)+3]<<24)>>>(r&7)},e.H.m=function(){var t=Uint16Array,r=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new r(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new r(286),Y:new r(30),a:new r(19),t:new r(15e3),k:new t(65536),g:new t(32768)}}(),function(){for(var t=e.H.m,r=32768,n=0;n>>1|(a&1431655765)<<1,a=(a&3435973836)>>>2|(a&858993459)<<2,a=(a&4042322160)>>>4|(a&252645135)<<4,a=(a&4278255360)>>>8|(a&16711935)<<8,t.r[n]=(a>>>16|a<<16)>>>17}function i(s,h,o){for(;h--!=0;)s.push(0,o)}for(var n=0;n<32;n++)t.q[n]=t.S[n]<<3|t.T[n],t.c[n]=t.p[n]<<4|t.z[n];i(t._,144,8),i(t._,255-143,9),i(t._,279-255,7),i(t._,287-279,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),i(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),i(t.Q,19,0),i(t.C,286,0),i(t.D,30,0),i(t.v,320,0)}(),e.H.N}();re.decode._readInterlace=function(e,t){for(var r=t.width,n=t.height,a=re.decode._getBPP(t),i=a>>3,s=Math.ceil(r*a/8),h=new Uint8Array(n*s),o=0,d=[0,0,4,0,2,0,1],p=[0,4,0,2,0,1,0],v=[8,8,8,4,4,2,2],m=[8,8,4,4,2,2,1],g=0;g<7;){for(var w=v[g],O=m[g],S=0,y=0,x=d[g];x>3];H=H>>7-(R&7)&1,h[A*s+(M>>3)]|=H<<7-((M&7)<<0)}if(a==2){var H=e[R>>3];H=H>>6-(R&7)&3,h[A*s+(M>>2)]|=H<<6-((M&3)<<1)}if(a==4){var H=e[R>>3];H=H>>4-(R&7)&15,h[A*s+(M>>1)]|=H<<4-((M&1)<<2)}if(a>=8)for(var G=A*s+M*i,_=0;_>3)+_];R+=a,M+=O}F++,A+=w}S*y!=0&&(o+=y*(1+k)),g=g+1}return h};re.decode._getBPP=function(e){var t=[1,null,3,1,2,null,4][e.ctype];return t*e.depth};re.decode._filterZero=function(e,t,r,n,a){var i=re.decode._getBPP(t),s=Math.ceil(n*i/8),h=re.decode._paeth;i=Math.ceil(i/8);var o=0,d=1,p=e[r],v=0;if(p>1&&(e[r]=[0,0,1][p-2]),p==3)for(v=i;v>>1)&255;for(var m=0;m>>1);for(;v>>1)}else{for(;v>8&255,e[t+1]=r&255},readUint:function(e,t){return e[t]*(256*256*256)+(e[t+1]<<16|e[t+2]<<8|e[t+3])},writeUint:function(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=r&255},readASCII:function(e,t,r){for(var n="",a=0;a=0&&h>=0?(v=g*t+w<<2,m=(h+g)*a+s+w<<2):(v=(-h+g)*t-s+w<<2,m=g*a+w<<2),o==0)n[m]=e[v],n[m+1]=e[v+1],n[m+2]=e[v+2],n[m+3]=e[v+3];else if(o==1){var O=e[v+3]*.00392156862745098,S=e[v]*O,y=e[v+1]*O,x=e[v+2]*O,E=n[m+3]*(1/255),k=n[m]*E,F=n[m+1]*E,A=n[m+2]*E,M=1-O,R=O+E*M,H=R==0?0:1/R;n[m+3]=255*R,n[m+0]=(S+k*M)*H,n[m+1]=(y+F*M)*H,n[m+2]=(x+A*M)*H}else if(o==2){var O=e[v+3],S=e[v],y=e[v+1],x=e[v+2],E=n[m+3],k=n[m],F=n[m+1],A=n[m+2];O==E&&S==k&&y==F&&x==A?(n[m]=0,n[m+1]=0,n[m+2]=0,n[m+3]=0):(n[m]=S,n[m+1]=y,n[m+2]=x,n[m+3]=O)}else if(o==3){var O=e[v+3],S=e[v],y=e[v+1],x=e[v+2],E=n[m+3],k=n[m],F=n[m+1],A=n[m+2];if(O==E&&S==k&&y==F&&x==A)continue;if(O<220&&E>20)return!1}return!0};re.encode=function(e,t,r,n,a,i,s){n==null&&(n=0),s==null&&(s=!1);var h=re.encode.compress(e,t,r,n,[!1,!1,!1,0,s]);return re.encode.compressPNG(h,-1),re.encode._main(h,t,r,a,i)};re.encodeLL=function(e,t,r,n,a,i,s,h){for(var o={ctype:0+(n==1?0:2)+(a==0?0:4),depth:i,frames:[]},d=(n+a)*i,p=d*t,v=0;v1,v=!1,m=8+(16+5+4)+(p?20:0);if(a.sRGB!=null&&(m+=8+1+4),a.pHYs!=null&&(m+=8+9+4),e.ctype==3){for(var g=e.plte.length,w=0;w>>24!=255&&(v=!0);m+=8+g*3+4+(v?8+g*1+4:0)}for(var O=0;O>>8&255,M=k>>>16&255;y[d+E+0]=F,y[d+E+1]=A,y[d+E+2]=M}if(d+=g*3,s(y,d,i(y,d-g*3-4,g*3+4)),d+=4,v){s(y,d,g),d+=4,o(y,d,"tRNS"),d+=4;for(var w=0;w>>24&255;d+=g,s(y,d,i(y,d-g-4,g+4)),d+=4}}for(var R=0,O=0;O>2,X>>2));for(var g=0;gbe&&Q==se[S-be])ve[S]=ve[S-be];else{var W=E[Q];if(W==null&&(E[Q]=W=k.length,k.push(Q),k.length>=300))break;ve[S]=W}}}var Y=k.length;Y<=256&&d==!1&&(Y<=2?v=1:Y<=4?v=2:Y<=16?v=4:v=8,v=Math.max(v,o));for(var g=0;g>1)]|=ke[At+tt]<<4-(tt&1)*4;else if(v==2)for(var tt=0;tt>2)]|=ke[At+tt]<<6-(tt&3)*2;else if(v==1)for(var tt=0;tt>3)]|=ke[At+tt]<<7-(tt&7)*1}ue=_e,p=3,Ae=1}else if(y==!1&&x.length==1){for(var _e=new Uint8Array(be*$*3),Er=be*$,S=0;SM&&(M=G),HR&&(R=H))}M==-1&&(F=A=M=R=0),a&&((F&1)==1&&F--,(A&1)==1&&A--);var X=(M-F+1)*(R-A+1);XS&&(S=k),Fy&&(y=F))}S==-1&&(w=O=S=y=0),s&&((w&1)==1&&w--,(O&1)==1&&O--),i={x:w,y:O,width:S-w+1,height:y-O+1};var R=n[a];R.rect=i,R.blend=1,R.img=new Uint8Array(i.width*i.height*4),n[a-1].dispose==0?(re._copyTile(d,t,r,R.img,i.width,i.height,-i.x,-i.y,0),re.encode._prepareDiff(m,t,r,R.img,i)):re._copyTile(m,t,r,R.img,i.width,i.height,-i.x,-i.y,0)};re.encode._prepareDiff=function(e,t,r,n,a){re._copyTile(e,t,r,n,a.width,a.height,-a.x,-a.y,2)};re.encode._filterZero=function(e,t,r,n,a,i,s){var h=[],o=[0,1,2,3,4];i!=-1?o=[i]:(t*n>5e5||r==1)&&(o=[0]);var d;s&&(d={level:0});for(var p=s&&UZIP!=null?UZIP:Kh,v=0;v>1)+256&255;if(i==4)for(var d=a;d>1)&255;for(var d=a;d>1)&255}if(i==4){for(var d=0;d>>1:r=r>>>1;e[t]=r}return e}(),update:function(e,t,r,n){for(var a=0;a>>8;return e},crc:function(e,t,r){return re.crc.update(4294967295,e,t,r)^4294967295}};re.quantize=function(e,t){var r=new Uint8Array(e),n=r.slice(0),a=new Uint32Array(n.buffer),i=re.quantize.getKDtree(n,t),s=i[0],h=i[1];re.quantize.planeDst;for(var o=r,d=a,p=o.length,v=new Uint8Array(r.length>>2),m=0;m>2]=y.ind,d[m>>2]=y.est.rgba}return{abuf:n.buffer,inds:v,plte:h}};re.quantize.getKDtree=function(e,t,r){r==null&&(r=1e-4);var n=new Uint32Array(e.buffer),a={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};a.bst=re.quantize.stats(e,a.i0,a.i1),a.est=re.quantize.estats(a.bst);for(var i=[a];i.lengths&&(s=i[o].est.L,h=o);if(s=p||d.i1<=p;if(v){d.est.L=0;continue}var m={i0:d.i0,i1:p,bst:null,est:null,tdst:0,left:null,right:null};m.bst=re.quantize.stats(e,m.i0,m.i1),m.est=re.quantize.estats(m.bst);var g={i0:p,i1:d.i1,bst:null,est:null,tdst:0,left:null,right:null};g.bst={R:[],m:[],N:d.bst.N-m.bst.N};for(var o=0;o<16;o++)g.bst.R[o]=d.bst.R[o]-m.bst.R[o];for(var o=0;o<4;o++)g.bst.m[o]=d.bst.m[o]-m.bst.m[o];g.est=re.quantize.estats(g.bst),d.left=m,d.right=g,i[h]=m,i.push(g)}i.sort(function(w,O){return O.bst.N-w.bst.N});for(var o=0;o0&&(s=e.right,h=e.left);var o=re.quantize.getNearest(s,t,r,n,a);if(o.tdst<=i*i)return o;var d=re.quantize.getNearest(h,t,r,n,a);return d.tdsti;)n-=4;if(r>=n)break;var h=t[r>>2];t[r>>2]=t[n>>2],t[n>>2]=h,r+=4,n-=4}for(;s(e,r,a)>i;)r-=4;return r+4};re.quantize.vecDot=function(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]+e[t+3]*r[3]};re.quantize.stats=function(e,t,r){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=[0,0,0,0],i=r-t>>2,s=t;s>>0}};re.M4={multVec:function(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]]},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},sml:function(e,t){return[e*t[0],e*t[1],e*t[2],e*t[3]]}};re.encode.concatRGBA=function(e){for(var t=0,r=0;r1)throw new Error("Animated PNGs are not supported");var a=new Uint8Array(n[0]),i=$X(a),s=i.rgbChannel,h=i.alphaChannel;this.rgbChannel=s;var o=h.some(function(d){return d<255});o&&(this.alphaChannel=h),this.type=JX(r.ctype),this.width=r.width,this.height=r.height,this.bitsPerComponent=8}return e.load=function(t){return new e(t)},e}(),wT=function(){function e(t){this.image=t,this.bitsPerComponent=t.bitsPerComponent,this.width=t.width,this.height=t.height,this.colorSpace="DeviceRGB"}return e.for=function(t){return Ye(this,void 0,void 0,function(){var r;return Qe(this,function(n){return r=eZ.load(t),[2,new e(r)]})})},e.prototype.embedIntoContext=function(t,r){return Ye(this,void 0,void 0,function(){var n,a;return Qe(this,function(i){return n=this.embedAlphaChannel(t),a=t.flateStream(this.image.rgbChannel,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),r?(t.assign(r,a),[2,r]):[2,t.register(a)]})})},e.prototype.embedAlphaChannel=function(t){if(this.image.alphaChannel){var r=t.flateStream(this.image.alphaChannel,{Type:"XObject",Subtype:"Image",Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:"DeviceGray",Decode:[0,1]});return t.register(r)}},e}(),bT=function(){function e(t,r,n){this.bytes=t,this.start=r||0,this.pos=this.start,this.end=r&&n?r+n:this.bytes.length}return Object.defineProperty(e.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),e.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},e.prototype.getUint16=function(){var t=this.getByte(),r=this.getByte();return t===-1||r===-1?-1:(t<<8)+r},e.prototype.getInt32=function(){var t=this.getByte(),r=this.getByte(),n=this.getByte(),a=this.getByte();return(t<<24)+(r<<16)+(n<<8)+a},e.prototype.getBytes=function(t,r){r===void 0&&(r=!1);var n=this.bytes,a=this.pos,i=this.end;if(t){var h=a+t;h>i&&(h=i),this.pos=h;var s=n.subarray(a,h);return r?new Uint8ClampedArray(s):s}else{var s=n.subarray(a,i);return r?new Uint8ClampedArray(s):s}},e.prototype.peekByte=function(){var t=this.getByte();return this.pos--,t},e.prototype.peekBytes=function(t,r){r===void 0&&(r=!1);var n=this.getBytes(t,r);return this.pos-=n.length,n},e.prototype.skip=function(t){t||(t=1),this.pos+=t},e.prototype.reset=function(){this.pos=this.start},e.prototype.moveStart=function(){this.start=this.pos},e.prototype.makeSubStream=function(t,r){return new e(this.bytes,t,r)},e.prototype.decode=function(){return this.bytes},e}(),tZ=new Uint8Array(0),xc=function(){function e(t){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=tZ,this.minBufferLength=512,t)for(;this.minBufferLengthi&&(n=i)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var s=this.buffer.subarray(a,n);return r&&!(s instanceof Uint8ClampedArray)?new Uint8ClampedArray(s):s},e.prototype.peekByte=function(){var t=this.getByte();return this.pos--,t},e.prototype.peekBytes=function(t,r){r===void 0&&(r=!1);var n=this.getBytes(t,r);return this.pos-=n.length,n},e.prototype.skip=function(t){t||(t=1),this.pos+=t},e.prototype.reset=function(){this.pos=0},e.prototype.makeSubStream=function(t,r){for(var n=t+r;this.bufferLength<=n&&!this.eof;)this.readBlock();return new bT(this.buffer,t,r)},e.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},e.prototype.readBlock=function(){throw new Xn(this.constructor.name,"readBlock")},e.prototype.ensureBuffer=function(t){var r=this.buffer;if(t<=r.byteLength)return r;for(var n=this.minBufferLength;n=0;--d)o[h+d]=v&255,v>>=8}},t}(xc),nZ=function(e){pe(t,e);function t(r,n){var a=e.call(this,n)||this;return a.stream=r,a.firstDigit=-1,n&&(n=.5*n),a}return t.prototype.readBlock=function(){var r=8e3,n=this.stream.getBytes(r);if(!n.length){this.eof=!0;return}for(var a=n.length+1>>1,i=this.ensureBuffer(this.bufferLength+a),s=this.bufferLength,h=this.firstDigit,o=0,d=n.length;o=48&&p<=57)v=p&15;else if(p>=65&&p<=70||p>=97&&p<=102)v=(p&15)+9;else if(p===62){this.eof=!0;break}else continue;h<0?h=v:(i[s++]=h<<4|v,h=-1)}h>=0&&this.eof&&(i[s++]=h<<4,h=-1),this.firstDigit=h,this.bufferLength=s},t}(xc),OS=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aZ=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),iZ=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),oZ=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],sZ=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],lZ=function(e){pe(t,e);function t(r,n){var a=e.call(this,n)||this;a.stream=r;var i=r.getByte(),s=r.getByte();if(i===-1||s===-1)throw new Error("Invalid header in flate stream: "+i+", "+s);if((i&15)!==8)throw new Error("Unknown compression method in flate stream: "+i+", "+s);if(((i<<8)+s)%31!==0)throw new Error("Bad FCHECK in flate stream: "+i+", "+s);if(s&32)throw new Error("FDICT bit set in flate stream: "+i+", "+s);return a.codeSize=0,a.codeBuf=0,a}return t.prototype.readBlock=function(){var r,n,a=this.stream,i=this.getBits(3);if(i&1&&(this.eof=!0),i>>=1,i===0){var s=void 0;if((s=a.getByte())===-1)throw new Error("Bad block header in flate stream");var h=s;if((s=a.getByte())===-1)throw new Error("Bad block header in flate stream");if(h|=s<<8,(s=a.getByte())===-1)throw new Error("Bad block header in flate stream");var o=s;if((s=a.getByte())===-1)throw new Error("Bad block header in flate stream");if(o|=s<<8,o!==(~h&65535)&&(h!==0||o!==0))throw new Error("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var d=this.bufferLength;r=this.ensureBuffer(d+h);var p=d+h;if(this.bufferLength=p,h===0)a.peekByte()===-1&&(this.eof=!0);else for(var v=d;v0;)F[x++]=R}m=this.generateHuffmanTable(F.subarray(0,w)),g=this.generateHuffmanTable(F.subarray(w,k))}else throw new Error("Unknown block type in flate stream");r=this.buffer;for(var _=r?r.length:0,X=this.bufferLength;;){var K=this.getCode(m);if(K<256){X+1>=_&&(r=this.ensureBuffer(X+1),_=r.length),r[X++]=K;continue}if(K===256){this.bufferLength=X;return}K-=257,K=aZ[K];var se=K>>16;se>0&&(se=this.getBits(se)),n=(K&65535)+se,K=this.getCode(g),K=iZ[K],se=K>>16,se>0&&(se=this.getBits(se));var be=(K&65535)+se;X+n>=_&&(r=this.ensureBuffer(X+n),_=r.length);for(var ve=0;ve>r,this.codeSize=a-=r,s},t.prototype.getCode=function(r){for(var n=this.stream,a=r[0],i=r[1],s=this.codeSize,h=this.codeBuf,o;s>16,v=d&65535;if(p<1||s>p,this.codeSize=s-p,v},t.prototype.generateHuffmanTable=function(r){var n=r.length,a=0,i;for(i=0;ia&&(a=r[i]);for(var s=1<>=1;for(i=m;i0;if(!F||F<256)S[0]=F,y=1;else if(F>=258)if(F=0;s--)S[s]=v[h],h=g[h];else S[y++]=S[0];else if(F===256){w=9,p=258,y=0;continue}else{this.eof=!0,delete this.lzwState;break}if(A&&(g[p]=O,m[p]=m[O]+1,v[p]=S[0],p++,w=p+d&p+d-1?w:Math.min(Math.log(p+d)/.6931471805599453+1,12)|0),O=F,x+=y,n>>n&(1<0){var s=this.stream.getBytes(i);n.set(s,a),a+=i}}else{i=257-i;var h=r[1];n=this.ensureBuffer(a+i+1);for(var o=0;on.size())throw new ch(r,0,n.size());n.remove(r)}else{if(r!==0)throw new ch(r,0,0);this.setKids([])}},t.prototype.normalizedEntries=function(){var r=this.Kids();return r||(r=this.dict.context.obj([this.ref]),this.dict.set(j.of("Kids"),r)),{Kids:r}},t.fromDict=function(r,n){return new t(r,n)},t}(ET),Eb=function(e){pe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.Opt=function(){return this.dict.lookupMaybe(j.of("Opt"),Tt,He,Et)},t.prototype.setOpt=function(r){this.dict.set(j.of("Opt"),this.dict.context.obj(r))},t.prototype.getExportValues=function(){var r=this.Opt();if(r){if(r instanceof Tt||r instanceof He)return[r];for(var n=[],a=0,i=r.size();an.size())throw new ch(r,0,n.size());n.remove(r)}},t.prototype.normalizeExportValues=function(){for(var r,n,a,i,s=(r=this.getExportValues())!==null&&r!==void 0?r:[],h=[],o=this.getWidgets(),d=0,p=o.length;d1){if(!this.hasFlag(Ct.MultiSelect))throw new SX;this.dict.set(j.of("V"),this.dict.context.obj(r))}this.updateSelectedIndices(r)},t.prototype.valuesAreValid=function(r){for(var n=this.getOptions(),a=function(o,d){var p=r[o].decodeText();if(!n.find(function(v){return p===(v.display||v.value).decodeText()}))return{value:!1}},i=0,s=r.length;i1){for(var n=new Array(r.length),a=this.getOptions(),i=function(o,d){var p=r[o].decodeText();n[o]=a.findIndex(function(v){return p===(v.display||v.value).decodeText()})},s=0,h=r.length;s0){var h=s.lookup(0,Tt,He),o=s.lookupMaybe(1,Tt,He);n.push({value:h,display:o||h})}}return n}return[]},t}(ul),Jh=function(e){pe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(r,n){return new t(r,n)},t.create=function(r){var n=r.obj({FT:"Ch",Ff:Ct.Combo,Kids:[]}),a=r.register(n);return new t(n,a)},t}(ST),hh=function(e){pe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.addField=function(r){var n=this.normalizedEntries().Kids;n==null||n.push(r)},t.prototype.normalizedEntries=function(){var r=this.Kids();return r||(r=this.dict.context.obj([]),this.dict.set(j.of("Kids"),r)),{Kids:r}},t.fromDict=function(r,n){return new t(r,n)},t.create=function(r){var n=r.obj({}),a=r.register(n);return new t(n,a)},t}(ET),Sb=function(e){pe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(r,n){return new t(r,n)},t}(ul),$h=function(e){pe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.MaxLen=function(){var r=this.dict.lookup(j.of("MaxLen"));if(r instanceof We)return r},t.prototype.Q=function(){var r=this.dict.lookup(j.of("Q"));if(r instanceof We)return r},t.prototype.setMaxLength=function(r){this.dict.set(j.of("MaxLen"),We.of(r))},t.prototype.removeMaxLength=function(){this.dict.delete(j.of("MaxLen"))},t.prototype.getMaxLength=function(){var r;return(r=this.MaxLen())===null||r===void 0?void 0:r.asNumber()},t.prototype.setQuadding=function(r){this.dict.set(j.of("Q"),We.of(r))},t.prototype.getQuadding=function(){var r;return(r=this.Q())===null||r===void 0?void 0:r.asNumber()},t.prototype.setValue=function(r){this.dict.set(j.of("V"),r)},t.prototype.removeValue=function(){this.dict.delete(j.of("V"))},t.prototype.getValue=function(){var r=this.V();if(r instanceof Tt||r instanceof He)return r},t.fromDict=function(r,n){return new t(r,n)},t.create=function(r){var n=r.obj({FT:"Tx",Kids:[]}),a=r.register(n);return new t(n,a)},t}(ul),e0=function(e){pe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(r,n){return new t(r,n)},t.create=function(r){var n=r.obj({FT:"Btn",Ff:Gn.PushButton,Kids:[]}),a=r.register(n);return new t(n,a)},t}(Eb),t0=function(e){pe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setValue=function(r){var n=this.getOnValues();if(!n.includes(r)&&r!==j.of("Off"))throw new yb;this.dict.set(j.of("V"),r);for(var a=this.getWidgets(),i=0,s=a.length;ii)throw new dS(n,i);for(var s=n,h=0,o=a.size();hs)return p.insertLeafNode(r,s)||d;s-=p.Count().asNumber()}p instanceof $a&&(s-=1)}if(s===0){this.insertLeafKid(a.size(),r);return}throw new fS(n,"insertLeafNode")},t.prototype.removeLeafNode=function(r,n){n===void 0&&(n=!0);var a=this.Kids(),i=this.Count().asNumber();if(r>=i)throw new dS(r,i);for(var s=r,h=0,o=a.size();hs){p.removeLeafNode(s,n),n&&p.Kids().size()===0&&a.remove(h);return}else s-=p.Count().asNumber();if(p instanceof $a)if(s===0){this.removeKid(h);return}else s-=1}throw new fS(r,"removeLeafNode")},t.prototype.ascend=function(r){r(this);var n=this.Parent();n&&n.ascend(r)},t.prototype.traverse=function(r){for(var n=this.Kids(),a=0,i=n.size();aNumber.MAX_SAFE_INTEGER)if(this.capNumbers){var a="Parsed number that is too large for some PDF readers: "+t+", using Number.MAX_SAFE_INTEGER instead.";return console.warn(a),Number.MAX_SAFE_INTEGER}else{var a="Parsed number that is too large for some PDF readers: "+t+", not capping.";console.warn(a)}return n},e.prototype.skipWhitespace=function(){for(;!this.bytes.done()&&li[this.bytes.peek()];)this.bytes.next()},e.prototype.skipLine=function(){for(;!this.bytes.done();){var t=this.bytes.peek();if(t===kS||t===jS)return;this.bytes.next()}},e.prototype.skipComment=function(){if(this.bytes.peek()!==T.Percent)return!1;for(;!this.bytes.done();){var t=this.bytes.peek();if(t===kS||t===jS)return!0;this.bytes.next()}return!0},e.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},e.prototype.matchKeyword=function(t){for(var r=this.bytes.offset(),n=0,a=t.length;n=this.length},e.prototype.offset=function(){return this.idx},e.prototype.slice=function(t,r){return this.bytes.slice(t,r)},e.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},e.of=function(t){return new e(t)},e.fromPDFRawStream=function(t){return e.of(xT(t).decode())},e}(),xZ=T.Space,Wl=T.CarriageReturn,Gl=T.Newline,ql=[T.s,T.t,T.r,T.e,T.a,T.m],Rd=[T.e,T.n,T.d,T.s,T.t,T.r,T.e,T.a,T.m],Rt={header:[T.Percent,T.P,T.D,T.F,T.Dash],eof:[T.Percent,T.Percent,T.E,T.O,T.F],obj:[T.o,T.b,T.j],endobj:[T.e,T.n,T.d,T.o,T.b,T.j],xref:[T.x,T.r,T.e,T.f],trailer:[T.t,T.r,T.a,T.i,T.l,T.e,T.r],startxref:[T.s,T.t,T.a,T.r,T.t,T.x,T.r,T.e,T.f],true:[T.t,T.r,T.u,T.e],false:[T.f,T.a,T.l,T.s,T.e],null:[T.n,T.u,T.l,T.l],stream:ql,streamEOF1:yt(ql,[xZ,Wl,Gl]),streamEOF2:yt(ql,[Wl,Gl]),streamEOF3:yt(ql,[Wl]),streamEOF4:yt(ql,[Gl]),endstream:Rd,EOF1endstream:yt([Wl,Gl],Rd),EOF2endstream:yt([Wl],Rd),EOF3endstream:yt([Gl],Rd)},FT=function(e){pe(t,e);function t(r,n,a){a===void 0&&(a=!1);var i=e.call(this,r,a)||this;return i.context=n,i}return t.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(Rt.true))return ac.True;if(this.matchKeyword(Rt.false))return ac.False;if(this.matchKeyword(Rt.null))return cn;var r=this.bytes.peek();if(r===T.LessThan&&this.bytes.peekAhead(1)===T.LessThan)return this.parseDictOrStream();if(r===T.LessThan)return this.parseHexString();if(r===T.LeftParen)return this.parseString();if(r===T.ForwardSlash)return this.parseName();if(r===T.LeftSquareBracket)return this.parseArray();if(Cb[r])return this.parseNumberOrRef();throw new TX(this.bytes.position(),r)},t.prototype.parseNumberOrRef=function(){var r=this.parseRawNumber();this.skipWhitespaceAndComments();var n=this.bytes.offset();if(Br[this.bytes.peek()]){var a=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===T.R)return this.bytes.assertNext(T.R),Ft.of(r,a)}return this.bytes.moveTo(n),We.of(r)},t.prototype.parseHexString=function(){var r="";for(this.bytes.assertNext(T.LessThan);!this.bytes.done()&&this.bytes.peek()!==T.GreaterThan;)r+=Qa(this.bytes.next());return this.bytes.assertNext(T.GreaterThan),He.of(r)},t.prototype.parseString=function(){for(var r=0,n=!1,a="";!this.bytes.done();){var i=this.bytes.next();if(a+=Qa(i),n||(i===T.LeftParen&&(r+=1),i===T.RightParen&&(r-=1)),i===T.BackSlash?n=!n:n&&(n=!1),r===0)return Tt.of(a.substring(1,a.length-1))}throw new NX(this.bytes.position())},t.prototype.parseName=function(){this.bytes.assertNext(T.ForwardSlash);for(var r="";!this.bytes.done();){var n=this.bytes.peek();if(li[n]||ia[n])break;r+=Qa(n),this.bytes.next()}return j.of(r)},t.prototype.parseArray=function(){this.bytes.assertNext(T.LeftSquareBracket),this.skipWhitespaceAndComments();for(var r=Et.withContext(this.context);this.bytes.peek()!==T.RightSquareBracket;){var n=this.parseObject();r.push(n),this.skipWhitespaceAndComments()}return this.bytes.assertNext(T.RightSquareBracket),r},t.prototype.parseDict=function(){this.bytes.assertNext(T.LessThan),this.bytes.assertNext(T.LessThan),this.skipWhitespaceAndComments();for(var r=new Map;!this.bytes.done()&&this.bytes.peek()!==T.GreaterThan&&this.bytes.peekAhead(1)!==T.GreaterThan;){var n=this.parseName(),a=this.parseObject();r.set(n,a),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(T.GreaterThan),this.bytes.assertNext(T.GreaterThan);var i=r.get(j.of("Type"));return i===j.of("Catalog")?CT.fromMapWithContext(r,this.context):i===j.of("Pages")?TT.fromMapWithContext(r,this.context):i===j.of("Page")?$a.fromMapWithContext(r,this.context):Ze.fromMapWithContext(r,this.context)},t.prototype.parseDictOrStream=function(){var r=this.bytes.position(),n=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(Rt.streamEOF1)&&!this.matchKeyword(Rt.streamEOF2)&&!this.matchKeyword(Rt.streamEOF3)&&!this.matchKeyword(Rt.streamEOF4)&&!this.matchKeyword(Rt.stream))return n;var a=this.bytes.offset(),i,s=n.get(j.of("Length"));s instanceof We?(i=a+s.asNumber(),this.bytes.moveTo(i),this.skipWhitespaceAndComments(),this.matchKeyword(Rt.endstream)||(this.bytes.moveTo(a),i=this.findEndOfStreamFallback(r))):i=this.findEndOfStreamFallback(r);var h=this.bytes.slice(a,i);return ic.of(n,h)},t.prototype.findEndOfStreamFallback=function(r){for(var n=1,a=this.bytes.offset();!this.bytes.done()&&(a=this.bytes.offset(),this.matchKeyword(Rt.stream)?n+=1:this.matchKeyword(Rt.EOF1endstream)||this.matchKeyword(Rt.EOF2endstream)||this.matchKeyword(Rt.EOF3endstream)||this.matchKeyword(Rt.endstream)?n-=1:this.bytes.next(),n!==0););if(n!==0)throw new PX(r);return a},t.forBytes=function(r,n,a){return new t(a0.of(r),n,a)},t.forByteStream=function(r,n,a){return a===void 0&&(a=!1),new t(r,n,a)},t}(bZ),OZ=function(e){pe(t,e);function t(r,n){var a=e.call(this,a0.fromPDFRawStream(r),r.dict.context)||this,i=r.dict;return a.alreadyParsed=!1,a.shouldWaitForTick=n||function(){return!1},a.firstOffset=i.lookup(j.of("First"),We).asNumber(),a.objectCount=i.lookup(j.of("N"),We).asNumber(),a}return t.prototype.parseIntoContext=function(){return Ye(this,void 0,void 0,function(){var r,n,a,i,s,h,o,d;return Qe(this,function(p){switch(p.label){case 0:if(this.alreadyParsed)throw new gb("PDFObjectStreamParser","parseIntoContext");this.alreadyParsed=!0,r=this.parseOffsetsAndObjectNumbers(),n=0,a=r.length,p.label=1;case 1:return n=T.Space&&n<=T.Tilde;if(a&&(this.matchKeyword(Rt.xref)||this.matchKeyword(Rt.trailer)||this.matchKeyword(Rt.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(r);break}this.bytes.next()}},t.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var r=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(r)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},t.forBytesWithOptions=function(r,n,a,i){return new t(r,n,a,i)},t}(FT),Fa=function(e){return 1<0&&(n[n.length]=+a),r[r.length]={cmd:t,args:n},n=[],a="",i=!1),t=d;else if([" ",","].includes(d)||d==="-"&&a.length>0&&a[a.length-1]!=="e"||d==="."&&i){if(a.length===0)continue;n.length===s?(r[r.length]={cmd:t,args:n},n=[+a],t==="M"&&(t="L"),t==="m"&&(t="l")):n[n.length]=+a,i=d===".",a=["-","."].includes(d)?d:""}else a+=d,d==="."&&(i=!0)}return a.length>0&&(n.length===s?(r[r.length]={cmd:t,args:n},n=[+a],t==="M"&&(t="L"),t==="m"&&(t="l")):n[n.length]=+a),r[r.length]={cmd:t,args:n},r},LZ=function(e){Re=Le=pt=vt=ou=su=0;for(var t=[],r=0;r1&&(m=Math.sqrt(m),r*=m,n*=m);var g=v/r,w=p/r,O=-p/n,S=v/n,y=g*h+w*o,x=O*h+S*o,E=g*e+w*t,k=O*e+S*t,F=(E-y)*(E-y)+(k-x)*(k-x),A=1/F-.25;A<0&&(A=0);var M=Math.sqrt(A);i===a&&(M=-M);var R=.5*(y+E)-M*(k-x),H=.5*(x+k)+M*(E-y),G=Math.atan2(x-H,y-R),_=Math.atan2(k-H,E-R),X=_-G;X<0&&i===1?X+=2*Math.PI:X>0&&i===0&&(X-=2*Math.PI);for(var K=Math.ceil(Math.abs(X/(Math.PI*.5+.001))),se=[],be=0;bee.length)return a-1;var S=t.heightAtSize(a),y=S+S*.2,x=y*i;if(x>Math.abs(r.height))return a-1;a+=1}return a},iY=function(e,t,r,n){for(var a=r.width/n,i=r.height,s=KT,h=zG(e);sa*.75;if(v)return s-1}var m=t.heightAtSize(s,{descender:!1});if(m>i)return s-1;s+=1}return s},oY=function(e){for(var t=e.length;t>0;t--)if(/\s/.test(e[t]))return t},sY=function(e,t,r,n){for(var a,i=e.length;i>0;){var s=e.substring(0,i),h=r.encodeText(s),o=r.widthOfTextAtSize(s,n);if(om&&(m=M+F),w+h>g&&(g=w+h),d.push({text:E,encoded:k,width:F,height:h,x:M,y:w}),y=A==null?void 0:A.trim()}return{fontSize:n,lineHeight:o,lines:d,bounds:{x:p,y:v,width:m-p,height:g-v}}},lY=function(e,t){var r=t.fontSize,n=t.font,a=t.bounds,i=t.cellCount,s=fC(vc(e));if(s.length>i)throw new rY(s.length,i);(r===void 0||r===0)&&(r=iY(s,n,a,i));for(var h=a.width/i,o=n.heightAtSize(r,{descender:!1}),d=a.y+(a.height/2-o/2),p=[],v=a.x,m=a.y,g=a.x+a.width,w=a.y+a.height,O=0,S=0;Og&&(g=M+F),d+o>w&&(w=d+o),p.push({text:s,encoded:k,width:F,height:o,x:M,y:d}),O+=1,S+=E}return{fontSize:r,cells:p,bounds:{x:v,y:m,width:g-v,height:w-m}}},wh=function(e,t){var r=t.alignment,n=t.fontSize,a=t.font,i=t.bounds,s=fC(vc(e));(n===void 0||n===0)&&(n=ZT([s],a,i));var h=a.encodeText(s),o=a.widthOfTextAtSize(s,n),d=a.heightAtSize(n,{descender:!1}),p=r===hr.Left?i.x:r===hr.Center?i.x+i.width/2-o/2:r===hr.Right?i.x+i.width-o:i.x,v=i.y+(i.height/2-d/2);return{fontSize:n,line:{text:s,encoded:h,width:o,height:d,x:p,y:v},bounds:{x:p,y:v,width:o,height:d}}},dl=function(e){return"normal"in e?e:{normal:e}},uY=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,$i=function(e){var t,r,n=(t=e.getDefaultAppearance())!==null&&t!==void 0?t:"",a=(r=lb(n,uY).match)!==null&&r!==void 0?r:[],i=Number(a[2]);return isFinite(i)?i:void 0},cY=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,na=function(e){var t,r=(t=e.getDefaultAppearance())!==null&&t!==void 0?t:"",n=lb(r,cY).match,a=n??[],i=a[1],s=a[2],h=a[3],o=a[4],d=a[5];if(d==="g"&&i)return HT(Number(i));if(d==="rg"&&i&&s&&h)return Pt(Number(i),Number(s),Number(h));if(d==="k"&&i&&s&&h&&o)return UT(Number(i),Number(s),Number(h),Number(o))},aa=function(e,t,r,n){var a;n===void 0&&(n=0);var i=[Ko(t).toString(),Nb((a=r==null?void 0:r.name)!==null&&a!==void 0?a:"dummy__noop",n).toString()].join(` `);e.setDefaultAppearance(i)},dY=function(e,t){var r,n,a,i=na(t),s=na(e.acroField),h=t.getRectangle(),o=t.getAppearanceCharacteristics(),d=t.getBorderStyle(),p=(r=d==null?void 0:d.getWidth())!==null&&r!==void 0?r:0,v=ui(o==null?void 0:o.getRotation()),m=Go(h,v),g=m.width,w=m.height,O=io(Ke(Ke({},h),{rotation:v})),S=Pt(0,0,0),y=(n=Qr(o==null?void 0:o.getBorderColor()))!==null&&n!==void 0?n:S,x=Qr(o==null?void 0:o.getBackgroundColor()),E=Qr(o==null?void 0:o.getBackgroundColor(),.8),k=(a=i??s)!==null&&a!==void 0?a:S;aa(i?t:e.acroField,k);var F={x:0+p/2,y:0+p/2,width:g-p,height:w-p,thickness:1.5,borderWidth:p,borderColor:y,markColor:k};return{normal:{on:yt(O,_d(Ke(Ke({},F),{color:x,filled:!0}))),off:yt(O,_d(Ke(Ke({},F),{color:x,filled:!1})))},down:{on:yt(O,_d(Ke(Ke({},F),{color:E,filled:!0}))),off:yt(O,_d(Ke(Ke({},F),{color:E,filled:!1})))}}},fY=function(e,t){var r,n,a,i=na(t),s=na(e.acroField),h=t.getRectangle(),o=t.getAppearanceCharacteristics(),d=t.getBorderStyle(),p=(r=d==null?void 0:d.getWidth())!==null&&r!==void 0?r:0,v=ui(o==null?void 0:o.getRotation()),m=Go(h,v),g=m.width,w=m.height,O=io(Ke(Ke({},h),{rotation:v})),S=Pt(0,0,0),y=(n=Qr(o==null?void 0:o.getBorderColor()))!==null&&n!==void 0?n:S,x=Qr(o==null?void 0:o.getBackgroundColor()),E=Qr(o==null?void 0:o.getBackgroundColor(),.8),k=(a=i??s)!==null&&a!==void 0?a:S;aa(i?t:e.acroField,k);var F={x:g/2,y:w/2,width:g-p,height:w-p,borderWidth:p,borderColor:y,dotColor:k};return{normal:{on:yt(O,Bd(Ke(Ke({},F),{color:x,filled:!0}))),off:yt(O,Bd(Ke(Ke({},F),{color:x,filled:!1})))},down:{on:yt(O,Bd(Ke(Ke({},F),{color:E,filled:!0}))),off:yt(O,Bd(Ke(Ke({},F),{color:E,filled:!1})))}}},hY=function(e,t,r){var n,a,i,s,h,o=na(t),d=na(e.acroField),p=$i(t),v=$i(e.acroField),m=t.getRectangle(),g=t.getAppearanceCharacteristics(),w=t.getBorderStyle(),O=g==null?void 0:g.getCaptions(),S=(n=O==null?void 0:O.normal)!==null&&n!==void 0?n:"",y=(i=(a=O==null?void 0:O.down)!==null&&a!==void 0?a:S)!==null&&i!==void 0?i:"",x=(s=w==null?void 0:w.getWidth())!==null&&s!==void 0?s:0,E=ui(g==null?void 0:g.getRotation()),k=Go(m,E),F=k.width,A=k.height,M=io(Ke(Ke({},m),{rotation:E})),R=Pt(0,0,0),H=Qr(g==null?void 0:g.getBorderColor()),G=Qr(g==null?void 0:g.getBackgroundColor()),_=Qr(g==null?void 0:g.getBackgroundColor(),.8),X={x,y:x,width:F-x*2,height:A-x*2},K=wh(S,{alignment:hr.Center,fontSize:p??v,font:r,bounds:X}),se=wh(y,{alignment:hr.Center,fontSize:p??v,font:r,bounds:X}),be=Math.min(K.fontSize,se.fontSize),ve=(h=o??d)!==null&&h!==void 0?h:R;aa(o||p!==void 0?t:e.acroField,ve,r,be);var Q={x:0+x/2,y:0+x/2,width:F-x,height:A-x,borderWidth:x,borderColor:H,textColor:ve,font:r.name,fontSize:be};return{normal:yt(M,MS(Ke(Ke({},Q),{color:G,textLines:[K.line]}))),down:yt(M,MS(Ke(Ke({},Q),{color:_,textLines:[se.line]})))}},pY=function(e,t,r){var n,a,i,s,h=na(t),o=na(e.acroField),d=$i(t),p=$i(e.acroField),v=t.getRectangle(),m=t.getAppearanceCharacteristics(),g=t.getBorderStyle(),w=(n=e.getText())!==null&&n!==void 0?n:"",O=(a=g==null?void 0:g.getWidth())!==null&&a!==void 0?a:0,S=ui(m==null?void 0:m.getRotation()),y=Go(v,S),x=y.width,E=y.height,k=io(Ke(Ke({},v),{rotation:S})),F=Pt(0,0,0),A=Qr(m==null?void 0:m.getBorderColor()),M=Qr(m==null?void 0:m.getBackgroundColor()),R,H,G=e.isCombed()?0:1,_={x:O+G,y:O+G,width:x-(O+G)*2,height:E-(O+G)*2};if(e.isMultiline()){var X=YT(w,{alignment:e.getAlignment(),fontSize:d??p,font:r,bounds:_});R=X.lines,H=X.fontSize}else if(e.isCombed()){var X=lY(w,{fontSize:d??p,font:r,bounds:_,cellCount:(i=e.getMaxLength())!==null&&i!==void 0?i:0});R=X.cells,H=X.fontSize}else{var X=wh(w,{alignment:e.getAlignment(),fontSize:d??p,font:r,bounds:_});R=[X.line],H=X.fontSize}var K=(s=h??o)!==null&&s!==void 0?s:F;aa(h||d!==void 0?t:e.acroField,K,r,H);var se={x:0+O/2,y:0+O/2,width:x-O,height:E-O,borderWidth:O??0,borderColor:A,textColor:K,font:r.name,fontSize:H,color:M,textLines:R,padding:G};return yt(k,GT(se))},vY=function(e,t,r){var n,a,i,s=na(t),h=na(e.acroField),o=$i(t),d=$i(e.acroField),p=t.getRectangle(),v=t.getAppearanceCharacteristics(),m=t.getBorderStyle(),g=(n=e.getSelected()[0])!==null&&n!==void 0?n:"",w=(a=m==null?void 0:m.getWidth())!==null&&a!==void 0?a:0,O=ui(v==null?void 0:v.getRotation()),S=Go(p,O),y=S.width,x=S.height,E=io(Ke(Ke({},p),{rotation:O})),k=Pt(0,0,0),F=Qr(v==null?void 0:v.getBorderColor()),A=Qr(v==null?void 0:v.getBackgroundColor()),M=1,R={x:w+M,y:w+M,width:y-(w+M)*2,height:x-(w+M)*2},H=wh(g,{alignment:hr.Left,fontSize:o??d,font:r,bounds:R}),G=H.line,_=H.fontSize,X=(i=s??h)!==null&&i!==void 0?i:k;aa(s||o!==void 0?t:e.acroField,X,r,_);var K={x:0+w/2,y:0+w/2,width:y-w,height:x-w,borderWidth:w??0,borderColor:F,textColor:X,font:r.name,fontSize:_,color:A,textLines:[G],padding:M};return yt(E,GT(K))},mY=function(e,t,r){var n,a,i=na(t),s=na(e.acroField),h=$i(t),o=$i(e.acroField),d=t.getRectangle(),p=t.getAppearanceCharacteristics(),v=t.getBorderStyle(),m=(n=v==null?void 0:v.getWidth())!==null&&n!==void 0?n:0,g=ui(p==null?void 0:p.getRotation()),w=Go(d,g),O=w.width,S=w.height,y=io(Ke(Ke({},d),{rotation:g})),x=Pt(0,0,0),E=Qr(p==null?void 0:p.getBorderColor()),k=Qr(p==null?void 0:p.getBackgroundColor()),F=e.getOptions(),A=e.getSelected();e.isSorted()&&F.sort();for(var M="",R=0,H=F.length;R1||a.length===1&&n)&&this.enableMultiselect();for(var h=new Array(a.length),o=0,d=a.length;o1||a.length===1&&n)&&this.enableMultiselect();for(var s=new Array(a.length),h=0,o=a.length;hn)throw new nY(r.length,n,this.getName());this.markAsDirty(),this.disableRichFormatting(),r?this.acroField.setValue(He.fromText(r)):this.acroField.removeValue()},t.prototype.getAlignment=function(){var r=this.acroField.getQuadding();return r===0?hr.Left:r===1?hr.Center:r===2?hr.Right:hr.Left},t.prototype.setAlignment=function(r){Li(r,"alignment",hr),this.markAsDirty(),this.acroField.setQuadding(r)},t.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},t.prototype.setMaxLength=function(r){if(ua(r,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),r===void 0)this.acroField.removeMaxLength();else{var n=this.getText();if(n&&n.length>r)throw new aY(n.length,r,this.getName());this.acroField.setMaxLength(r)}},t.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},t.prototype.setImage=function(r){for(var n=this.getAlignment(),a=n===hr.Center?Xi.Center:n===hr.Right?Xi.Right:Xi.Left,i=this.acroField.getWidgets(),s=0,h=i.length;s{const e=document.documentElement.lang,t=e!=="en"?`/${e}`:"",r=`${[]}${t}/nvrf/data/Federal_Voter_Registration_${e}.pdf`,n=await fetch(r).then(s=>s.arrayBuffer()),a=await eo.load(n),i=a.getForm();return{pdfDoc:a,form:i}},SY=async function(e,t,r){const{pdfDoc:n,form:a}=await Lb(),i=a.getRadioGroup("citizen"),s=a.getRadioGroup("eighteen_years"),h=a.getRadioGroup("salutation"),o=a.getTextField("first_name"),d=a.getTextField("middle_names"),p=a.getTextField("last_name"),v=a.getRadioGroup("suffix"),m=a.getRadioGroup("salutation_2"),g=a.getTextField("first_name_2"),w=a.getTextField("middle_names_2"),O=a.getTextField("last_name_2"),S=a.getRadioGroup("suffix_2"),y=a.getTextField("dob_month"),x=a.getTextField("dob_day"),E=a.getTextField("dob_year"),k=a.getTextField("telephone_number"),F=a.getTextField("race_ethnic_group"),A=a.getTextField("home_address"),M=a.getTextField("apt_lot_number"),R=a.getTextField("city"),H=a.getTextField("state"),G=a.getTextField("zip_code"),_=a.getTextField("mail_address"),X=a.getTextField("mail_city"),K=a.getTextField("mail_state"),se=a.getTextField("mail_zip_code"),be=a.getTextField("prev_address"),ve=a.getTextField("prev_apt_lot_number"),Q=a.getTextField("prev_city"),W=a.getTextField("prev_state"),Y=a.getTextField("prev_zip_code"),$=a.getTextField("id_number"),ue=a.getTextField("choice_of_party");i.select("yes"),s.select("yes"),t.title&&h.select(t.title),o.setText(t.first_name),d.setText(t.middle_name),p.setText(t.last_name),t.suffix&&v.select(t.suffix),t.prev_title&&m.select(t.prev_title),g.setText(t.prev_first_name),w.setText(t.prev_middle_name),O.setText(t.prev_last_name),t.prev_suffix&&S.select(t.prev_suffix),y.setText(t.date_of_birth_month),y.setFontSize(12),x.setText(t.date_of_birth_day),x.setFontSize(12),E.setText(t.date_of_birth_year),E.setFontSize(5),k.setText(t.phone_number),F.setText(t.race),t.street_address+t.apt_num+t.city+t.zip_code&&(A.setText(t.street_address),M.setText(t.apt_num),R.setText(t.city),H.setText(t.state),G.setText(t.zip_code)),_.setText(`${t.mail_street_address} ${t.mail_apt_num}`),X.setText(t.mail_city),K.setText(t.mail_state),se.setText(t.mail_zip_code),t.state=="Maine"&&t.prev_street_address==""?be.setText("N/A"):be.setText(t.prev_street_address),ve.setText(t.prev_apt_num),Q.setText(t.prev_city),W.setText(t.prev_state),Y.setText(t.prev_zip_code),t.id_number===""&&t.ssn_number===""?$.setText("None"):t.id_number!=""&&t.ssn_number!=""?$.setText(t.id_number+", "+t.ssn_number):$.setText(t.id_number+t.ssn_number),ue.setText(t.party_choice);let Ae=0;const _e=n.getPageCount();let ke=r.split(",");(!r||r.trim()==="")&&(ke=Array.from({length:_e},(dt,sr)=>sr.toString()));for(let dt=0;dt<_e;dt++)ke.includes(dt.toString())||(n.removePage(dt-Ae),Ae++);const nt=ke.splice(0,2);ke.splice(2,0,nt[0],nt[1]),((dt,sr)=>{const lr=dt.getPages();for(let Qt=0;Qtsr.toString()));for(let dt=0;dt<_e;dt++)ke.includes(dt.toString())||(n.removePage(dt-Ae),Ae++);const nt=ke.splice(0,2);ke.splice(2,0,nt[0],nt[1]),((dt,sr)=>{const lr=dt.getPages();for(let Qt=0;Qtg.uuid==="229f283c-6a70-43f6-a80f-15cfa158f062"),d=nr(h.body.replace("@state_name",e.stateData.name).replace("@mailing_address_inst",r.mailing_address_inst)).split("@download_mail-in_form_button"),p=d[0].split("@print_mail-in_form_button"),v=b.jsxs("svg",{"aria-hidden":"true",focusable:"false",width:"49",height:"48",viewBox:"0 0 49 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("path",{d:"M17.3497 23.0564L16.9974 22.7041L16.6439 23.0552L15.2239 24.4652L14.8678 24.8187L15.2226 25.1736L20.8126 30.7636L21.1662 31.1171L21.5197 30.7636L33.5197 18.7636L33.8733 18.41L33.5197 18.0564L32.1097 16.6464L31.7563 16.2931L31.4028 16.6463L21.1663 26.8731L17.3497 23.0564Z",fill:"#5CBF72",stroke:"#5CBF72"}),b.jsx("circle",{cx:"24.5762",cy:"24",r:"22",stroke:"#5CBF72",strokeWidth:"4"})]}),m=()=>b.jsxs("p",{children:[b.jsx("strong",{children:n.mailDeadlineLabel})," ",b.jsx("span",{dangerouslySetInnerHTML:{__html:r.postmarked_mail_deadline||r.received_mail_deadline}})]});return b.jsxs(b.Fragment,{children:[b.jsxs(ie.Grid,{row:!0,children:[b.jsx(ie.Grid,{col:1,children:v}),b.jsx(ie.Grid,{col:11,className:"padding-left-2",children:b.jsx("h1",{style:{fontSize:"2rem"},"data-test":"addressConfirm",children:h.title.replace("@state_name",e.stateData.name)})})]}),b.jsx("div",{className:"margin-top-2",dangerouslySetInnerHTML:{__html:p[0]}}),b.jsx(ie.Button,{"data-test":"pdfBtnNewTab",onClick:()=>{i("newTab",e.fieldData,e.stateData.nvrf_pages_list,e.pdfDoc,e.form),dataLayer.push({NVRF_PDF_button:s.pdfTabButton,event:"NVRF_PDF_BUTTON_CLICK"})},type:"submit",children:b.jsx("span",{children:n.newTab})}),b.jsx("div",{className:"margin-top-2",dangerouslySetInnerHTML:{__html:p[1]}}),b.jsx(ie.Button,{"data-test":"pdfBtnDownload",onClick:()=>{i("download",e.fieldData,e.stateData.nvrf_pages_list,e.pdfDoc,e.form),dataLayer.push({NVRF_PDF_button:s.pdfDownloadButton,event:"NVRF_PDF_BUTTON_CLICK"})},type:"submit",children:b.jsx("span",{children:n.download})}),b.jsx("div",{className:"margin-top-6",dangerouslySetInnerHTML:{__html:d[1].replace("@mail_deadline",$j(m()))}})]})}}function CY(e){const t="fd516f06-11bb-4c39-9080-735ed98100cc",r=Ie(e.fieldContent,t),n=Ie(e.stateData.nvrf_fields,r.uuid);return b.jsx(Nt,{fieldType:"text",inputData:{id:"party_choice",dataTest:"politicalParty",required:n.required,label:r.label,error_msg:r.error_msg,help_text:r.help_text},saveFieldData:e.saveFieldData,fieldData:e.fieldData})}function TY(e){const t=e.headings,r=e.stateData,n=e.fieldContent,a=e.stateData.nvrf_fields,i=nr(r.political_party_inst),s=n.find(d=>d.uuid==="fd516f06-11bb-4c39-9080-735ed98100cc"),h=nr(s.instructions),o=a.find(d=>d.uuid===s.uuid);return b.jsxs(b.Fragment,{children:[b.jsx("h2",{children:t.step_label_4}),(i||h)&&b.jsx("div",{className:"usa-alert usa-alert--info",role:"region","aria-live":"polite",children:b.jsx("div",{className:"usa-alert__body",children:b.jsx("div",{className:"usa-alert__text",dangerouslySetInnerHTML:{__html:i}})})}),o&&b.jsx(b.Fragment,{children:b.jsxs("div",{className:"input-parent",children:[b.jsxs(ie.Label,{className:"text-bold",htmlFor:"political-party",children:[s.name,o.required==="1"&&b.jsx("span",{className:"required-text",children:"*"})]}),b.jsx("div",{className:"usa-hint",id:"political-party_hint",dangerouslySetInnerHTML:{__html:h}}),b.jsx(CY,{...e})]})})]})}var FY=typeof Element<"u",PY=typeof Map=="function",NY=typeof Set=="function",AY=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Sf(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,a;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Sf(e[n],t[n]))return!1;return!0}var i;if(PY&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;for(i=e.entries();!(n=i.next()).done;)if(!Sf(n.value[1],t.get(n.value[0])))return!1;return!0}if(NY&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(AY&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[n]))return!1;if(FY&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((a[n]==="_owner"||a[n]==="__v"||a[n]==="__o")&&e.$$typeof)&&!Sf(e[a[n]],t[a[n]]))return!1;return!0}return e!==e&&t!==t}var MY=function(t,r){try{return Sf(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const zY=el(MY);var DY=function(e,t,r,n,a,i,s,h){if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,n,a,i,s,h],p=0;o=new Error(t.replace(/%s/g,function(){return d[p++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}},RY=DY;const zS=el(RY);var LY=function(t,r,n,a){var i=n?n.call(a,t,r):void 0;if(i!==void 0)return!!i;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var s=Object.keys(t),h=Object.keys(r);if(s.length!==h.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(r),d=0;d(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(JT||{}),gy={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},DS=Object.values(JT),Ib={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},_Y=Object.entries(Ib).reduce((e,[t,r])=>(e[r]=t,e),{}),ya="data-rh",Hs={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Us=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},BY=e=>{let t=Us(e,"title");const r=Us(e,Hs.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Us(e,Hs.DEFAULT_TITLE);return t||n||void 0},VY=e=>Us(e,Hs.ON_CHANGE_CLIENT_STATE)||(()=>{}),yy=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),HY=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const a=Object.keys(n);for(let i=0;iconsole&&typeof console.warn=="function"&&console.warn(e),Kl=(e,t,r)=>{const n={};return r.filter(a=>Array.isArray(a[e])?!0:(typeof a[e]<"u"&&UY(`Helmet: ${e} should be of type "Array". Instead found type "${typeof a[e]}"`),!1)).map(a=>a[e]).reverse().reduce((a,i)=>{const s={};i.filter(o=>{let d;const p=Object.keys(o);for(let m=0;ma.push(o));const h=Object.keys(s);for(let o=0;o{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:HY(["href"],e),bodyAttributes:yy("bodyAttributes",e),defer:Us(e,Hs.DEFER),encode:Us(e,Hs.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:yy("htmlAttributes",e),linkTags:Kl("link",["rel","href"],e),metaTags:Kl("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Kl("noscript",["innerHTML"],e),onChangeClientState:VY(e),scriptTags:Kl("script",["src","innerHTML"],e),styleTags:Kl("style",["cssText"],e),title:BY(e),titleAttributes:yy("titleAttributes",e),prioritizeSeoTags:WY(e,Hs.PRIORITIZE_SEO_TAGS)}),$T=e=>Array.isArray(e)?e.join(""):e,qY=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(qY(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},RS=(e,t)=>({...e,[t]:void 0}),KY=["noscript","script","style"],qw=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),eF=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),XY=(e,t,r,n)=>{const a=eF(r),i=$T(t);return a?`<${e} ${ya}="true" ${a}>${qw(i,n)}`:`<${e} ${ya}="true">${qw(i,n)}`},ZY=(e,t,r=!0)=>t.reduce((n,a)=>{const i=a,s=Object.keys(i).filter(d=>!(d==="innerHTML"||d==="cssText")).reduce((d,p)=>{const v=typeof i[p]>"u"?p:`${p}="${qw(i[p],r)}"`;return d?`${d} ${v}`:v},""),h=i.innerHTML||i.cssText||"",o=KY.indexOf(e)===-1;return`${n}<${e} ${ya}="true" ${s}${o?"/>":`>${h}`}`},""),tF=(e,t={})=>Object.keys(e).reduce((r,n)=>{const a=Ib[n];return r[a||n]=e[n],r},t),YY=(e,t,r)=>{const n={key:t,[ya]:!0},a=tF(r,n);return[ma.createElement("title",a,t)]},kf=(e,t)=>t.map((r,n)=>{const a={key:n,[ya]:!0};return Object.keys(r).forEach(i=>{const h=Ib[i]||i;if(h==="innerHTML"||h==="cssText"){const o=r.innerHTML||r.cssText;a.dangerouslySetInnerHTML={__html:o}}else a[h]=r[i]}),ma.createElement(e,a)}),Hn=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>YY(e,t.title,t.titleAttributes),toString:()=>XY(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>tF(t),toString:()=>eF(t)};default:return{toComponent:()=>kf(e,t),toString:()=>ZY(e,t,r)}}},QY=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const a=wy(e,gy.meta),i=wy(t,gy.link),s=wy(r,gy.script);return{priorityMethods:{toComponent:()=>[...kf("meta",a.priority),...kf("link",i.priority),...kf("script",s.priority)],toString:()=>`${Hn("meta",a.priority,n)} ${Hn("link",i.priority,n)} ${Hn("script",s.priority,n)}`},metaTags:a.default,linkTags:i.default,scriptTags:s.default}},JY=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:a,noscriptTags:i,styleTags:s,title:h="",titleAttributes:o,prioritizeSeoTags:d}=e;let{linkTags:p,metaTags:v,scriptTags:m}=e,g={toComponent:()=>{},toString:()=>""};return d&&({priorityMethods:g,linkTags:p,metaTags:v,scriptTags:m}=QY(e)),{priority:g,base:Hn("base",t,n),bodyAttributes:Hn("bodyAttributes",r,n),htmlAttributes:Hn("htmlAttributes",a,n),link:Hn("link",p,n),meta:Hn("meta",v,n),noscript:Hn("noscript",i,n),script:Hn("script",m,n),style:Hn("style",s,n),title:Hn("title",{title:h,titleAttributes:o},n)}},Kw=JY,Vd=[],rF=!!(typeof window<"u"&&window.document&&window.document.createElement),Xw=class{constructor(e,t){N(this,"instances",[]);N(this,"canUseDOM",rF);N(this,"context");N(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Vd:this.instances,add:e=>{(this.canUseDOM?Vd:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Vd:this.instances).indexOf(e);(this.canUseDOM?Vd:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Kw({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},$Y={},nF=ma.createContext($Y),Ws,aF=(Ws=class extends at.Component{constructor(r){super(r);N(this,"helmetData");this.helmetData=new Xw(this.props.context||{},Ws.canUseDOM)}render(){return ma.createElement(nF.Provider,{value:this.helmetData.value},this.props.children)}},N(Ws,"canUseDOM",rF),Ws),vs=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${ya}]`),a=[].slice.call(n),i=[];let s;return t&&t.length&&t.forEach(h=>{const o=document.createElement(e);for(const d in h)if(Object.prototype.hasOwnProperty.call(h,d))if(d==="innerHTML")o.innerHTML=h.innerHTML;else if(d==="cssText")o.styleSheet?o.styleSheet.cssText=h.cssText:o.appendChild(document.createTextNode(h.cssText));else{const p=d,v=typeof h[p]>"u"?"":h[p];o.setAttribute(d,v)}o.setAttribute(ya,"true"),a.some((d,p)=>(s=p,o.isEqualNode(d)))?a.splice(s,1):i.push(o)}),a.forEach(h=>{var o;return(o=h.parentNode)==null?void 0:o.removeChild(h)}),i.forEach(h=>r.appendChild(h)),{oldTags:a,newTags:i}},Zw=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(ya),a=n?n.split(","):[],i=[...a],s=Object.keys(t);for(const h of s){const o=t[h]||"";r.getAttribute(h)!==o&&r.setAttribute(h,o),a.indexOf(h)===-1&&a.push(h);const d=i.indexOf(h);d!==-1&&i.splice(d,1)}for(let h=i.length-1;h>=0;h-=1)r.removeAttribute(i[h]);a.length===i.length?r.removeAttribute(ya):r.getAttribute(ya)!==s.join(",")&&r.setAttribute(ya,s.join(","))},eQ=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=$T(e)),Zw("title",t)},LS=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:a,linkTags:i,metaTags:s,noscriptTags:h,onChangeClientState:o,scriptTags:d,styleTags:p,title:v,titleAttributes:m}=e;Zw("body",n),Zw("html",a),eQ(v,m);const g={baseTag:vs("base",r),linkTags:vs("link",i),metaTags:vs("meta",s),noscriptTags:vs("noscript",h),scriptTags:vs("script",d),styleTags:vs("style",p)},w={},O={};Object.keys(g).forEach(S=>{const{newTags:y,oldTags:x}=g[S];y.length&&(w[S]=y),x.length&&(O[S]=g[S].oldTags)}),t&&t(),o(e,w,O)},Xl=null,tQ=e=>{Xl&&cancelAnimationFrame(Xl),e.defer?Xl=requestAnimationFrame(()=>{LS(e,()=>{Xl=null})}):(LS(e),Xl=null)},rQ=tQ,IS=class extends at.Component{constructor(){super(...arguments);N(this,"rendered",!1)}shouldComponentUpdate(t){return!IY(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const a=GY(t.get().map(i=>{const s={...i.props};return delete s.context,s}));aF.canUseDOM?rQ(a):Kw&&(n=Kw(a)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},by,nQ=(by=class extends at.Component{shouldComponentUpdate(e){return!zY(RS(this.props,"helmetData"),RS(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return zS(DS.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${DS.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),zS(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return ma.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:a,...i}=n.props,s=Object.keys(i).reduce((o,d)=>(o[_Y[d]||d]=i[d],o),{});let{type:h}=n;switch(typeof h=="symbol"?h=h.toString():this.warnOnInvalidChildren(n,a),h){case"Symbol(react.fragment)":t=this.mapChildrenToProps(a,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,s,a);break;default:t=this.mapObjectTypeChildren(n,t,s,a);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof Xw)){const a=n;n=new Xw(a.context,!0),delete r.helmetData}return n?ma.createElement(IS,{...r,context:n.value}):ma.createElement(nF.Consumer,null,a=>ma.createElement(IS,{...r,context:a}))}},N(by,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),by);function aQ(e){const t=e.content,r=e.navContent,n=e.fieldContent,a=e.stringContent,i=t.find(Z=>Z.uuid==="2c597df4-53b6-4ef5-8301-7817b04e1099"),s=nr(i.title),h=nr(i.body),o=document.getElementById("scroll-to-top"),d=document.documentElement.lang,p={stepLabel1:"Personal information page",stepLabel2:"Address and location page",stepLabel3:"Identification page",stepLabel4:"Political party page",stepLabel5:"Confirmation page",stepLabel6:"PDF Delivery page"},[v,m]=at.useState({title:"",first_name:"",middle_name:"",last_name:"",suffix:"",prev_title:"",prev_first_name:"",prev_middle_name:"",prev_last_name:"",prev_suffix:"",date_of_birth_month:"",date_of_birth_day:"",date_of_birth_year:"",phone_number:"",race:"",street_address:"",apt_num:"",city:"",state:"",zip_code:"",prev_street_address:"",prev_apt_num:"",prev_city:"",prev_state:"",prev_zip_code:"",mail_street_address:"",mail_apt_num:"",mail_city:"",mail_state:"",mail_zip_code:"",id_number:"",ssn_number:"",party_choice:"",email_address:""}),[g,w]=at.useState(!1),O=Z=>Me=>{Me.target.value.length>0&&w(!0),m(Z==="phone_number"?{...v,[Z]:RW(Me.target.value)}:{...v,[Z]:Me.target.value})},S=(Z,Me)=>{if(Z.target.value.length===0)m({...v,[Me]:""});else if(Z.target.value.length===1){let ft=0+Z.target.value;m({...v,[Me]:ft}),Z.target.setCustomValidity("")}else Z.target.value.length===2&&m({...v,[Me]:Z.target.value})};at.useEffect(()=>{const Z=Me=>{Me.preventDefault(),Me.returnValue=""};g!==!1?window.addEventListener("beforeunload",Z):window.removeEventListener("beforeunload",Z)},[g]);const[y,x]=at.useState(1),E=()=>{o.focus(),o.scrollIntoView({behavior:"instant"})},k=()=>{y!==6&&x(y+1),y!==6&&E()},F=()=>{y!==1&&x(y-1),E(),y===1&&e.handlePrev()},A=Z=>()=>{y!==1&&x(y-Z),E()},M=Z=>{dataLayer.push({NVRF_page_title:Z,event:"NVRF_STEP_SUBMIT"})},R=Z=>{Z.preventDefault(Z)},[H,G]=at.useState("email"),_=Z=>{Z==="email"?G("email"):Z==="print"&&G("print")},[X,K]=at.useState(!1),se=Z=>{K(Z.target.checked),!Z.target.checked&&m({...v,prev_title:"",prev_first_name:"",prev_middle_name:"",prev_last_name:"",prev_suffix:""})},[be,ve]=at.useState(!1),[Q,W]=at.useState(!1),Y=Z=>{W(Z.target.checked),!Z.target.checked&&m({...v,mail_street_address:"",mail_apt_num:"",mail_city:"",mail_state:"",mail_zip_code:""})},$=Z=>{ve(Z.target.checked),m({...v,street_address:"",apt_num:"",city:"",state:"",zip_code:""}),!Z.target.checked&&document.getElementById("alt-mail-addr")&&(Q||m({...v,mail_street_address:"",mail_apt_num:"",mail_city:"",mail_state:"",mail_zip_code:""}))},[ue,oe]=at.useState(!1),Ae=Z=>{oe(Z.target.checked),!Z.target.checked&&m({...v,prev_street_address:"",prev_apt_num:"",prev_city:"",prev_state:"",prev_zip_code:""})},[_e,ke]=at.useState(""),nt=Z=>{ke(Z.target.value),Z.target.value==="none"?m({...v,id_number:"none",ssn_number:""}):m({...v,id_number:"",ssn_number:""}),document.getElementById("state-id").className="",dataLayer.push({NVRF_id_type:Z.target.value,event:"NVRF_SELECT_ID"})},[At,tt]=at.useState(!1),Er=Z=>{tt(Z.target.checked),m({...v,id_number:"",ssn_number:""}),Z.target.checked?ke("none"):ke("")},[dt,sr]=at.useState(null),lr=Z=>{sr(Z)},Qt=()=>{const Z=document.getElementById("voter-contact");v.email_address?Z.value="":Z.removeAttribute("required")},Vr=()=>{switch(y){case 1:Qt();break}},Sa=Z=>{switch(Z){case 1:return r.back.reg_options;case 2:return r.back.personal_info;case 3:return r.back.address_location;case 4:return r.back.identification;case 5:return r.back.edit_info}},xe=Z=>{switch(Z){case 1:return r.next.address_location;case 2:return r.next.identification;case 3:return r.next.political_party;case 4:return r.next.confirm_info;case 5:return r.next.delivery}};return b.jsxs(b.Fragment,{children:[y!=6&&b.jsx(ej,{stringContent:a,type:"button","data-analytics":"backBtn",onClick:F,text:Sa(y)}),b.jsx(_W,{step:y,content:r,handleGoBack:A,setStep:x}),b.jsxs("div",{className:"margin-top-8 maxw-tablet margin-x-auto",children:[y<5&&b.jsxs(b.Fragment,{children:[b.jsx("h1",{children:s.replace("@state_name",e.stateData.name)}),b.jsx("div",{dangerouslySetInnerHTML:{__html:h}})]}),b.jsxs(ie.Form,{autoComplete:"off",id:"nvrf",className:"margin-top-5",style:{maxWidth:"none"},onSubmit:Z=>{R(Z),k(),M(p["stepLabel"+y])},children:[y===1&&b.jsx(nG,{state:e.state,stateData:e.stateData,fieldData:v,saveFieldData:O,dateFormat:S,registrationPath:e.registrationPath,previousName:X,onChangePreviousName:se,handlePrev:e.handlePrev,headings:r,content:t,fieldContent:n,stringContent:a}),y===2&&b.jsx(yG,{state:e.state,statesList:e.statesList,stateData:e.stateData,fieldData:v,saveFieldData:O,registrationPath:e.registrationPath,handlePrev:F,hasNoAddress:be,hasNoAddressCheckbox:$,hasPreviousAddress:ue,onChangePreviousAddressCheckbox:Ae,hasMailAddress:Q,onChangeMailAddressCheckbox:Y,headings:r,content:t,fieldContent:n,stringContent:a}),y===3&&b.jsx(EG,{state:e.state,stateData:e.stateData,fieldData:v,saveFieldData:O,dateFormat:S,registrationPath:e.registrationPath,handlePrev:F,saveIdType:nt,onChangeHasNoIdCheckbox:Er,hasNoID:At,idType:_e,headings:r,content:t,fieldContent:n,stringContent:a}),y===4&&b.jsx(TY,{state:e.state,stateData:e.stateData,fieldData:v,saveFieldData:O,registrationPath:e.registrationPath,handlePrev:F,headings:r,content:t,fieldContent:n,stringContent:a}),y===5&&b.jsx(SG,{state:e.state,stateData:e.stateData,headings:r,content:e.content,fieldData:v,saveFieldData:O,registrationPath:e.registrationPath,handlePrev:F,handleGoBackSteps:A,hasAcknowledged:dt,acknowledgeCheckbox:lr,fieldContent:n,stringContent:a}),y===6&&b.jsx(jY,{state:e.state,stateData:e.stateData,headings:r,content:e.content,fieldData:v,saveFieldData:O,registrationPath:e.registrationPath,handlePrev:F,deliveryButtonSelected:H,handleClickDeliveryButton:_,stringContent:a,pdfDoc:e.pdfDoc,form:e.form}),y!=6&&b.jsx(tj,{stringContent:a,type:"submit",onClick:()=>{Vr(),sC("nvrf")},text:xe(y)})]}),y===6&&d==="en"&&b.jsxs(b.Fragment,{children:[b.jsx("div",{id:"touchpoints-form-embed",className:"margin-top-6"}),b.jsx(nQ,{children:b.jsx("script",{src:"https://touchpoints.app.cloud.gov/touchpoints/4da46508.js",async:!0})})]})]})]})}const iQ=document.getElementById("root").getAttribute("data-stateId"),oQ=document.getElementById("root").getAttribute("data-returnPath");function sQ(){const[e,t]=at.useState(""),[r,n]=at.useState(""),[a,i]=at.useState(""),[s,h]=at.useState(""),[o,d]=at.useState(""),[p,v]=at.useState(""),[m,g]=at.useState(null),[w,O]=at.useState(null),[S,y]=at.useState(null);at.useEffect(()=>{Lb().then(({pdfDoc:_e,form:ke})=>{O(_e),y(ke)}).catch(()=>g(!0))},[]),at.useEffect(()=>{Sd("states.json",t,g),Sd("pages.json",n,g),Sd("cards.json",h,g),Sd("fields.json",d,g),pE("navigation.json",i,g),pE("strings.json",v,g)},[]);const[x,E]=at.useState(1),[k,F]=at.useState(""),[A,M]=at.useState(""),[R,H]=at.useState(""),[G,_]=at.useState(1),X=nr(A.nvrf_last_updated_date),K=p?p.lastUpdated:null,se=document.getElementById("scroll-to-top"),[be,ve]=at.useState(null),Q=_e=>{ve(_e)},W=()=>{se.focus(),se.scrollIntoView({behavior:"instant"})},Y=()=>{x!=3&&E(x+1),W()},$=()=>{x!=1&&E(x-1),W(),x===2&&ve(null)},ue=_e=>{if(!A&&_e!==""&&e)for(let ke=0;ke{ue(iQ)},[ue,e]);const oe=_e=>{H(_e)},Ae=_e=>{G===4||_(_e+1)};if(m)return b.jsxs("div",{children:[b.jsx(ie.Alert,{type:"error",heading:"Error",headingLevel:"h1",children:b.jsx("p",{children:"The form filler tool failed to load."})}),b.jsx("p",{children:b.jsx("button",{className:"usa-button",onClick:()=>window.location.reload(),children:"Try loading the tool again"})}),b.jsxs("p",{children:["If you were unable to use our form filler tool, ",b.jsx("a",{href:"https://touchpoints.app.cloud.gov/touchpoints/c169d3b2/submit",target:"_blank",children:"submit feedback"}),"."]})]});if(e&&s&&r&&a&&o&&p){const _e=s.find(nt=>nt.uuid==="5922e06c-ac2f-475d-ab10-abfdeb65de43"),ke=[];for(let nt=0;nt=1&&b.jsxs("div",{className:"text-base margin-top-5 maxw-tablet margin-x-auto",children:[b.jsxs("p",{children:[K.replace("@state_name",A.name)," ",b.jsx("span",{dangerouslySetInnerHTML:{__html:X}})]}),_e&&b.jsx("div",{dangerouslySetInnerHTML:{__html:nr(_e.body)}})]})]})})}}xy.createRoot(document.getElementById("root")).render(b.jsx(ma.StrictMode,{children:b.jsx(sQ,{})})); +`+Ko(n).toString();this.acroField.setDefaultAppearance(k)}return O},e.prototype.updateWidgetAppearanceWithFont=function(t,r,n){var a=n.normal,i=n.rollover,s=n.down;this.updateWidgetAppearances(t,{normal:this.createAppearanceStream(t,a,r),rollover:i&&this.createAppearanceStream(t,i,r),down:s&&this.createAppearanceStream(t,s,r)})},e.prototype.updateOnOffWidgetAppearance=function(t,r,n){var a=n.normal,i=n.rollover,s=n.down;this.updateWidgetAppearances(t,{normal:this.createAppearanceDict(t,a,r),rollover:i&&this.createAppearanceDict(t,i,r),down:s&&this.createAppearanceDict(t,s,r)})},e.prototype.updateWidgetAppearances=function(t,r){var n=r.normal,a=r.rollover,i=r.down;t.setNormalAppearance(n),a?t.setRolloverAppearance(a):t.removeRolloverAppearance(),i?t.setDownAppearance(i):t.removeDownAppearance()},e.prototype.createAppearanceStream=function(t,r,n){var a,i=this.acroField.dict.context,s=t.getRectangle(),h=s.width,o=s.height,d=n&&{Font:(a={},a[n.name]=n.ref,a)},p=i.formXObject(r,{Resources:d,BBox:i.obj([0,0,h,o]),Matrix:i.obj([1,0,0,1,0,0])}),v=i.register(p);return v},e.prototype.createImageAppearanceStream=function(t,r,n){var a,i,s=this.acroField.dict.context,h=t.getRectangle(),o=t.getAppearanceCharacteristics(),d=t.getBorderStyle(),p=(i=d==null?void 0:d.getWidth())!==null&&i!==void 0?i:0,v=ui(o==null?void 0:o.getRotation()),m=io(Ke(Ke({},h),{rotation:v})),g=Go(h,v),w=r.scaleToFit(g.width-p*2,g.height-p*2),O={x:p,y:p,width:w.width,height:w.height,rotate:Ue(0),xSkew:Ue(0),ySkew:Ue(0)};n===Xi.Center?(O.x+=(g.width-p*2)/2-w.width/2,O.y+=(g.height-p*2)/2-w.height/2):n===Xi.Right&&(O.x=g.width-p-w.width,O.y=g.height-p-w.height);var S=this.doc.context.addRandomSuffix("Image",10),y=yt(m,WT(S,O)),x={XObject:(a={},a[S]=r.ref,a)},E=s.formXObject(y,{Resources:x,BBox:s.obj([0,0,h.width,h.height]),Matrix:s.obj([1,0,0,1,0,0])});return s.register(E)},e.prototype.createAppearanceDict=function(t,r,n){var a=this.acroField.dict.context,i=this.createAppearanceStream(t,r.on),s=this.createAppearanceStream(t,r.off),h=a.obj({});return h.set(n,i),h.set(j.of("Off"),s),h},e}(),lu=function(e){pe(t,e);function t(r,n,a){var i=e.call(this,r,n,a)||this;return U(r,"acroCheckBox",[[Qh,"PDFAcroCheckBox"]]),i.acroField=r,i}return t.prototype.check=function(){var r,n=(r=this.acroField.getOnValue())!==null&&r!==void 0?r:j.of("Yes");this.markAsDirty(),this.acroField.setValue(n)},t.prototype.uncheck=function(){this.markAsDirty(),this.acroField.setValue(j.of("Off"))},t.prototype.isChecked=function(){var r=this.acroField.getOnValue();return!!r&&r===this.acroField.getValue()},t.prototype.addToPage=function(r,n){var a,i,s,h,o,d;U(r,"page",[[qn,"PDFPage"]]),fl(n),n||(n={}),"textColor"in n||(n.textColor=Pt(0,0,0)),"backgroundColor"in n||(n.backgroundColor=Pt(1,1,1)),"borderColor"in n||(n.borderColor=Pt(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var p=this.createWidget({x:(a=n.x)!==null&&a!==void 0?a:0,y:(i=n.y)!==null&&i!==void 0?i:0,width:(s=n.width)!==null&&s!==void 0?s:50,height:(h=n.height)!==null&&h!==void 0?h:50,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(o=n.borderWidth)!==null&&o!==void 0?o:0,rotate:(d=n.rotate)!==null&&d!==void 0?d:Ue(0),hidden:n.hidden,page:r.ref}),v=this.doc.context.register(p.dict);this.acroField.addWidget(v),p.setAppearanceState(j.of("Off")),this.updateWidgetAppearance(p,j.of("Yes")),r.node.addAnnot(v)},t.prototype.needsAppearancesUpdate=function(){for(var r,n=this.acroField.getWidgets(),a=0,i=n.length;a1||a.length===1&&n)&&this.enableMultiselect();for(var h=new Array(a.length),o=0,d=a.length;o1||a.length===1&&n)&&this.enableMultiselect();for(var s=new Array(a.length),h=0,o=a.length;hn)throw new nY(r.length,n,this.getName());this.markAsDirty(),this.disableRichFormatting(),r?this.acroField.setValue(He.fromText(r)):this.acroField.removeValue()},t.prototype.getAlignment=function(){var r=this.acroField.getQuadding();return r===0?hr.Left:r===1?hr.Center:r===2?hr.Right:hr.Left},t.prototype.setAlignment=function(r){Li(r,"alignment",hr),this.markAsDirty(),this.acroField.setQuadding(r)},t.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},t.prototype.setMaxLength=function(r){if(ua(r,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),r===void 0)this.acroField.removeMaxLength();else{var n=this.getText();if(n&&n.length>r)throw new aY(n.length,r,this.getName());this.acroField.setMaxLength(r)}},t.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},t.prototype.setImage=function(r){for(var n=this.getAlignment(),a=n===hr.Center?Xi.Center:n===hr.Right?Xi.Right:Xi.Left,i=this.acroField.getWidgets(),s=0,h=i.length;s{const e=document.documentElement.lang,t=e!=="en"?`/${e}`:"",r=`${[]}${t}/nvrf/data/Federal_Voter_Registration_${e}.pdf`,n=await fetch(r).then(s=>s.arrayBuffer()),a=await eo.load(n),i=a.getForm();return{pdfDoc:a,form:i}},SY=async function(e,t,r){const{pdfDoc:n,form:a}=await Lb(),i=a.getRadioGroup("citizen"),s=a.getRadioGroup("eighteen_years"),h=a.getRadioGroup("salutation"),o=a.getTextField("first_name"),d=a.getTextField("middle_names"),p=a.getTextField("last_name"),v=a.getRadioGroup("suffix"),m=a.getRadioGroup("salutation_2"),g=a.getTextField("first_name_2"),w=a.getTextField("middle_names_2"),O=a.getTextField("last_name_2"),S=a.getRadioGroup("suffix_2"),y=a.getTextField("dob_month"),x=a.getTextField("dob_day"),E=a.getTextField("dob_year"),k=a.getTextField("telephone_number"),F=a.getTextField("race_ethnic_group"),A=a.getTextField("home_address"),M=a.getTextField("apt_lot_number"),R=a.getTextField("city"),H=a.getTextField("state"),G=a.getTextField("zip_code"),_=a.getTextField("mail_address"),X=a.getTextField("mail_city"),K=a.getTextField("mail_state"),se=a.getTextField("mail_zip_code"),be=a.getTextField("prev_address"),ve=a.getTextField("prev_apt_lot_number"),Q=a.getTextField("prev_city"),W=a.getTextField("prev_state"),Y=a.getTextField("prev_zip_code"),$=a.getTextField("id_number"),ue=a.getTextField("choice_of_party");i.select("yes"),s.select("yes"),t.title&&h.select(t.title),o.setText(t.first_name),d.setText(t.middle_name),p.setText(t.last_name),t.suffix&&v.select(t.suffix),t.prev_title&&m.select(t.prev_title),g.setText(t.prev_first_name),w.setText(t.prev_middle_name),O.setText(t.prev_last_name),t.prev_suffix&&S.select(t.prev_suffix),y.setText(t.date_of_birth_month),y.setFontSize(12),x.setText(t.date_of_birth_day),x.setFontSize(12),E.setText(t.date_of_birth_year),E.setFontSize(5),k.setText(t.phone_number),F.setText(t.race),t.street_address+t.apt_num+t.city+t.zip_code&&(A.setText(t.street_address),M.setText(t.apt_num),R.setText(t.city),H.setText(t.state),G.setText(t.zip_code)),_.setText(`${t.mail_street_address} ${t.mail_apt_num}`),X.setText(t.mail_city),K.setText(t.mail_state),se.setText(t.mail_zip_code),t.state=="Maine"&&t.prev_street_address==""?be.setText("N/A"):be.setText(t.prev_street_address),ve.setText(t.prev_apt_num),Q.setText(t.prev_city),W.setText(t.prev_state),Y.setText(t.prev_zip_code),t.id_number===""&&t.ssn_number===""?$.setText("None"):t.id_number!=""&&t.ssn_number!=""?$.setText(t.id_number+", "+t.ssn_number):$.setText(t.id_number+t.ssn_number),ue.setText(t.party_choice);let Ae=0;const _e=n.getPageCount();let ke=r.split(",");(!r||r.trim()==="")&&(ke=Array.from({length:_e},(dt,sr)=>sr.toString()));for(let dt=0;dt<_e;dt++)ke.includes(dt.toString())||(n.removePage(dt-Ae),Ae++);const nt=ke.splice(0,2);ke.splice(2,0,nt[0],nt[1]),((dt,sr)=>{const lr=dt.getPages();for(let Qt=0;Qtsr.toString()));for(let dt=0;dt<_e;dt++)ke.includes(dt.toString())||(n.removePage(dt-Ae),Ae++);const nt=ke.splice(0,2);ke.splice(2,0,nt[0],nt[1]),((dt,sr)=>{const lr=dt.getPages();for(let Qt=0;Qtg.uuid==="229f283c-6a70-43f6-a80f-15cfa158f062"),d=nr(h.body.replace("@state_name",e.stateData.name).replace("@mailing_address_inst",r.mailing_address_inst)).split("@download_mail-in_form_button"),p=d[0].split("@print_mail-in_form_button"),v=b.jsxs("svg",{"aria-hidden":"true",focusable:"false",width:"49",height:"48",viewBox:"0 0 49 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("path",{d:"M17.3497 23.0564L16.9974 22.7041L16.6439 23.0552L15.2239 24.4652L14.8678 24.8187L15.2226 25.1736L20.8126 30.7636L21.1662 31.1171L21.5197 30.7636L33.5197 18.7636L33.8733 18.41L33.5197 18.0564L32.1097 16.6464L31.7563 16.2931L31.4028 16.6463L21.1663 26.8731L17.3497 23.0564Z",fill:"#5CBF72",stroke:"#5CBF72"}),b.jsx("circle",{cx:"24.5762",cy:"24",r:"22",stroke:"#5CBF72",strokeWidth:"4"})]}),m=()=>b.jsxs("p",{children:[b.jsx("strong",{children:n.mailDeadlineLabel})," ",b.jsx("span",{dangerouslySetInnerHTML:{__html:r.postmarked_mail_deadline||r.received_mail_deadline}})]});return b.jsxs(b.Fragment,{children:[b.jsxs(ie.Grid,{row:!0,children:[b.jsx(ie.Grid,{col:1,children:v}),b.jsx(ie.Grid,{col:11,className:"padding-left-2",children:b.jsx("h1",{style:{fontSize:"2rem"},"data-test":"addressConfirm",children:h.title.replace("@state_name",e.stateData.name)})})]}),b.jsx("div",{className:"margin-top-2",dangerouslySetInnerHTML:{__html:p[0]}}),b.jsx(ie.Button,{"data-test":"pdfBtnNewTab",onClick:()=>{i("newTab",e.fieldData,e.stateData.nvrf_pages_list,e.pdfDoc,e.form),dataLayer.push({NVRF_button_click:s.pdfTabButton,event:"NVRF_PDF_BUTTON_CLICK"})},type:"submit",children:b.jsx("span",{children:n.newTab})}),b.jsx("div",{className:"margin-top-2",dangerouslySetInnerHTML:{__html:p[1]}}),b.jsx(ie.Button,{"data-test":"pdfBtnDownload",onClick:()=>{i("download",e.fieldData,e.stateData.nvrf_pages_list,e.pdfDoc,e.form),dataLayer.push({NVRF_button_click:s.pdfDownloadButton,event:"NVRF_PDF_BUTTON_CLICK"})},type:"submit",children:b.jsx("span",{children:n.download})}),b.jsx("div",{className:"margin-top-6",dangerouslySetInnerHTML:{__html:d[1].replace("@mail_deadline",$j(m()))}})]})}}function CY(e){const t="fd516f06-11bb-4c39-9080-735ed98100cc",r=Ie(e.fieldContent,t),n=Ie(e.stateData.nvrf_fields,r.uuid);return b.jsx(Nt,{fieldType:"text",inputData:{id:"party_choice",dataTest:"politicalParty",required:n.required,label:r.label,error_msg:r.error_msg,help_text:r.help_text},saveFieldData:e.saveFieldData,fieldData:e.fieldData})}function TY(e){const t=e.headings,r=e.stateData,n=e.fieldContent,a=e.stateData.nvrf_fields,i=nr(r.political_party_inst),s=n.find(d=>d.uuid==="fd516f06-11bb-4c39-9080-735ed98100cc"),h=nr(s.instructions),o=a.find(d=>d.uuid===s.uuid);return b.jsxs(b.Fragment,{children:[b.jsx("h2",{children:t.step_label_4}),(i||h)&&b.jsx("div",{className:"usa-alert usa-alert--info",role:"region","aria-live":"polite",children:b.jsx("div",{className:"usa-alert__body",children:b.jsx("div",{className:"usa-alert__text",dangerouslySetInnerHTML:{__html:i}})})}),o&&b.jsx(b.Fragment,{children:b.jsxs("div",{className:"input-parent",children:[b.jsxs(ie.Label,{className:"text-bold",htmlFor:"political-party",children:[s.name,o.required==="1"&&b.jsx("span",{className:"required-text",children:"*"})]}),b.jsx("div",{className:"usa-hint",id:"political-party_hint",dangerouslySetInnerHTML:{__html:h}}),b.jsx(CY,{...e})]})})]})}var FY=typeof Element<"u",PY=typeof Map=="function",NY=typeof Set=="function",AY=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Sf(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,a;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Sf(e[n],t[n]))return!1;return!0}var i;if(PY&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;for(i=e.entries();!(n=i.next()).done;)if(!Sf(n.value[1],t.get(n.value[0])))return!1;return!0}if(NY&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(AY&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[n]))return!1;if(FY&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((a[n]==="_owner"||a[n]==="__v"||a[n]==="__o")&&e.$$typeof)&&!Sf(e[a[n]],t[a[n]]))return!1;return!0}return e!==e&&t!==t}var MY=function(t,r){try{return Sf(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const zY=el(MY);var DY=function(e,t,r,n,a,i,s,h){if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,n,a,i,s,h],p=0;o=new Error(t.replace(/%s/g,function(){return d[p++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}},RY=DY;const zS=el(RY);var LY=function(t,r,n,a){var i=n?n.call(a,t,r):void 0;if(i!==void 0)return!!i;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var s=Object.keys(t),h=Object.keys(r);if(s.length!==h.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(r),d=0;d(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(JT||{}),gy={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},DS=Object.values(JT),Ib={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},_Y=Object.entries(Ib).reduce((e,[t,r])=>(e[r]=t,e),{}),ya="data-rh",Hs={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Us=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},BY=e=>{let t=Us(e,"title");const r=Us(e,Hs.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Us(e,Hs.DEFAULT_TITLE);return t||n||void 0},VY=e=>Us(e,Hs.ON_CHANGE_CLIENT_STATE)||(()=>{}),yy=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),HY=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const a=Object.keys(n);for(let i=0;iconsole&&typeof console.warn=="function"&&console.warn(e),Kl=(e,t,r)=>{const n={};return r.filter(a=>Array.isArray(a[e])?!0:(typeof a[e]<"u"&&UY(`Helmet: ${e} should be of type "Array". Instead found type "${typeof a[e]}"`),!1)).map(a=>a[e]).reverse().reduce((a,i)=>{const s={};i.filter(o=>{let d;const p=Object.keys(o);for(let m=0;ma.push(o));const h=Object.keys(s);for(let o=0;o{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:HY(["href"],e),bodyAttributes:yy("bodyAttributes",e),defer:Us(e,Hs.DEFER),encode:Us(e,Hs.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:yy("htmlAttributes",e),linkTags:Kl("link",["rel","href"],e),metaTags:Kl("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Kl("noscript",["innerHTML"],e),onChangeClientState:VY(e),scriptTags:Kl("script",["src","innerHTML"],e),styleTags:Kl("style",["cssText"],e),title:BY(e),titleAttributes:yy("titleAttributes",e),prioritizeSeoTags:WY(e,Hs.PRIORITIZE_SEO_TAGS)}),$T=e=>Array.isArray(e)?e.join(""):e,qY=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(qY(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},RS=(e,t)=>({...e,[t]:void 0}),KY=["noscript","script","style"],qw=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),eF=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),XY=(e,t,r,n)=>{const a=eF(r),i=$T(t);return a?`<${e} ${ya}="true" ${a}>${qw(i,n)}`:`<${e} ${ya}="true">${qw(i,n)}`},ZY=(e,t,r=!0)=>t.reduce((n,a)=>{const i=a,s=Object.keys(i).filter(d=>!(d==="innerHTML"||d==="cssText")).reduce((d,p)=>{const v=typeof i[p]>"u"?p:`${p}="${qw(i[p],r)}"`;return d?`${d} ${v}`:v},""),h=i.innerHTML||i.cssText||"",o=KY.indexOf(e)===-1;return`${n}<${e} ${ya}="true" ${s}${o?"/>":`>${h}`}`},""),tF=(e,t={})=>Object.keys(e).reduce((r,n)=>{const a=Ib[n];return r[a||n]=e[n],r},t),YY=(e,t,r)=>{const n={key:t,[ya]:!0},a=tF(r,n);return[ma.createElement("title",a,t)]},kf=(e,t)=>t.map((r,n)=>{const a={key:n,[ya]:!0};return Object.keys(r).forEach(i=>{const h=Ib[i]||i;if(h==="innerHTML"||h==="cssText"){const o=r.innerHTML||r.cssText;a.dangerouslySetInnerHTML={__html:o}}else a[h]=r[i]}),ma.createElement(e,a)}),Hn=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>YY(e,t.title,t.titleAttributes),toString:()=>XY(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>tF(t),toString:()=>eF(t)};default:return{toComponent:()=>kf(e,t),toString:()=>ZY(e,t,r)}}},QY=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const a=wy(e,gy.meta),i=wy(t,gy.link),s=wy(r,gy.script);return{priorityMethods:{toComponent:()=>[...kf("meta",a.priority),...kf("link",i.priority),...kf("script",s.priority)],toString:()=>`${Hn("meta",a.priority,n)} ${Hn("link",i.priority,n)} ${Hn("script",s.priority,n)}`},metaTags:a.default,linkTags:i.default,scriptTags:s.default}},JY=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:a,noscriptTags:i,styleTags:s,title:h="",titleAttributes:o,prioritizeSeoTags:d}=e;let{linkTags:p,metaTags:v,scriptTags:m}=e,g={toComponent:()=>{},toString:()=>""};return d&&({priorityMethods:g,linkTags:p,metaTags:v,scriptTags:m}=QY(e)),{priority:g,base:Hn("base",t,n),bodyAttributes:Hn("bodyAttributes",r,n),htmlAttributes:Hn("htmlAttributes",a,n),link:Hn("link",p,n),meta:Hn("meta",v,n),noscript:Hn("noscript",i,n),script:Hn("script",m,n),style:Hn("style",s,n),title:Hn("title",{title:h,titleAttributes:o},n)}},Kw=JY,Vd=[],rF=!!(typeof window<"u"&&window.document&&window.document.createElement),Xw=class{constructor(e,t){N(this,"instances",[]);N(this,"canUseDOM",rF);N(this,"context");N(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Vd:this.instances,add:e=>{(this.canUseDOM?Vd:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Vd:this.instances).indexOf(e);(this.canUseDOM?Vd:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Kw({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},$Y={},nF=ma.createContext($Y),Ws,aF=(Ws=class extends at.Component{constructor(r){super(r);N(this,"helmetData");this.helmetData=new Xw(this.props.context||{},Ws.canUseDOM)}render(){return ma.createElement(nF.Provider,{value:this.helmetData.value},this.props.children)}},N(Ws,"canUseDOM",rF),Ws),vs=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${ya}]`),a=[].slice.call(n),i=[];let s;return t&&t.length&&t.forEach(h=>{const o=document.createElement(e);for(const d in h)if(Object.prototype.hasOwnProperty.call(h,d))if(d==="innerHTML")o.innerHTML=h.innerHTML;else if(d==="cssText")o.styleSheet?o.styleSheet.cssText=h.cssText:o.appendChild(document.createTextNode(h.cssText));else{const p=d,v=typeof h[p]>"u"?"":h[p];o.setAttribute(d,v)}o.setAttribute(ya,"true"),a.some((d,p)=>(s=p,o.isEqualNode(d)))?a.splice(s,1):i.push(o)}),a.forEach(h=>{var o;return(o=h.parentNode)==null?void 0:o.removeChild(h)}),i.forEach(h=>r.appendChild(h)),{oldTags:a,newTags:i}},Zw=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(ya),a=n?n.split(","):[],i=[...a],s=Object.keys(t);for(const h of s){const o=t[h]||"";r.getAttribute(h)!==o&&r.setAttribute(h,o),a.indexOf(h)===-1&&a.push(h);const d=i.indexOf(h);d!==-1&&i.splice(d,1)}for(let h=i.length-1;h>=0;h-=1)r.removeAttribute(i[h]);a.length===i.length?r.removeAttribute(ya):r.getAttribute(ya)!==s.join(",")&&r.setAttribute(ya,s.join(","))},eQ=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=$T(e)),Zw("title",t)},LS=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:a,linkTags:i,metaTags:s,noscriptTags:h,onChangeClientState:o,scriptTags:d,styleTags:p,title:v,titleAttributes:m}=e;Zw("body",n),Zw("html",a),eQ(v,m);const g={baseTag:vs("base",r),linkTags:vs("link",i),metaTags:vs("meta",s),noscriptTags:vs("noscript",h),scriptTags:vs("script",d),styleTags:vs("style",p)},w={},O={};Object.keys(g).forEach(S=>{const{newTags:y,oldTags:x}=g[S];y.length&&(w[S]=y),x.length&&(O[S]=g[S].oldTags)}),t&&t(),o(e,w,O)},Xl=null,tQ=e=>{Xl&&cancelAnimationFrame(Xl),e.defer?Xl=requestAnimationFrame(()=>{LS(e,()=>{Xl=null})}):(LS(e),Xl=null)},rQ=tQ,IS=class extends at.Component{constructor(){super(...arguments);N(this,"rendered",!1)}shouldComponentUpdate(t){return!IY(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const a=GY(t.get().map(i=>{const s={...i.props};return delete s.context,s}));aF.canUseDOM?rQ(a):Kw&&(n=Kw(a)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},by,nQ=(by=class extends at.Component{shouldComponentUpdate(e){return!zY(RS(this.props,"helmetData"),RS(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return zS(DS.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${DS.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),zS(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return ma.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:a,...i}=n.props,s=Object.keys(i).reduce((o,d)=>(o[_Y[d]||d]=i[d],o),{});let{type:h}=n;switch(typeof h=="symbol"?h=h.toString():this.warnOnInvalidChildren(n,a),h){case"Symbol(react.fragment)":t=this.mapChildrenToProps(a,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,s,a);break;default:t=this.mapObjectTypeChildren(n,t,s,a);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof Xw)){const a=n;n=new Xw(a.context,!0),delete r.helmetData}return n?ma.createElement(IS,{...r,context:n.value}):ma.createElement(nF.Consumer,null,a=>ma.createElement(IS,{...r,context:a}))}},N(by,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),by);function aQ(e){const t=e.content,r=e.navContent,n=e.fieldContent,a=e.stringContent,i=t.find(Z=>Z.uuid==="2c597df4-53b6-4ef5-8301-7817b04e1099"),s=nr(i.title),h=nr(i.body),o=document.getElementById("scroll-to-top"),d=document.documentElement.lang,p={stepLabel1:"Personal information page",stepLabel2:"Address and location page",stepLabel3:"Identification page",stepLabel4:"Political party page",stepLabel5:"Confirmation page",stepLabel6:"PDF Delivery page"},[v,m]=at.useState({title:"",first_name:"",middle_name:"",last_name:"",suffix:"",prev_title:"",prev_first_name:"",prev_middle_name:"",prev_last_name:"",prev_suffix:"",date_of_birth_month:"",date_of_birth_day:"",date_of_birth_year:"",phone_number:"",race:"",street_address:"",apt_num:"",city:"",state:"",zip_code:"",prev_street_address:"",prev_apt_num:"",prev_city:"",prev_state:"",prev_zip_code:"",mail_street_address:"",mail_apt_num:"",mail_city:"",mail_state:"",mail_zip_code:"",id_number:"",ssn_number:"",party_choice:"",email_address:""}),[g,w]=at.useState(!1),O=Z=>Me=>{Me.target.value.length>0&&w(!0),m(Z==="phone_number"?{...v,[Z]:RW(Me.target.value)}:{...v,[Z]:Me.target.value})},S=(Z,Me)=>{if(Z.target.value.length===0)m({...v,[Me]:""});else if(Z.target.value.length===1){let ft=0+Z.target.value;m({...v,[Me]:ft}),Z.target.setCustomValidity("")}else Z.target.value.length===2&&m({...v,[Me]:Z.target.value})};at.useEffect(()=>{const Z=Me=>{Me.preventDefault(),Me.returnValue=""};g!==!1?window.addEventListener("beforeunload",Z):window.removeEventListener("beforeunload",Z)},[g]);const[y,x]=at.useState(1),E=()=>{o.focus(),o.scrollIntoView({behavior:"instant"})},k=()=>{y!==6&&x(y+1),y!==6&&E()},F=()=>{y!==1&&x(y-1),E(),y===1&&e.handlePrev()},A=Z=>()=>{y!==1&&x(y-Z),E()},M=Z=>{dataLayer.push({NVRF_page_title:Z,event:"NVRF_STEP_SUBMIT"})},R=Z=>{Z.preventDefault(Z)},[H,G]=at.useState("email"),_=Z=>{Z==="email"?G("email"):Z==="print"&&G("print")},[X,K]=at.useState(!1),se=Z=>{K(Z.target.checked),!Z.target.checked&&m({...v,prev_title:"",prev_first_name:"",prev_middle_name:"",prev_last_name:"",prev_suffix:""})},[be,ve]=at.useState(!1),[Q,W]=at.useState(!1),Y=Z=>{W(Z.target.checked),!Z.target.checked&&m({...v,mail_street_address:"",mail_apt_num:"",mail_city:"",mail_state:"",mail_zip_code:""})},$=Z=>{ve(Z.target.checked),m({...v,street_address:"",apt_num:"",city:"",state:"",zip_code:""}),!Z.target.checked&&document.getElementById("alt-mail-addr")&&(Q||m({...v,mail_street_address:"",mail_apt_num:"",mail_city:"",mail_state:"",mail_zip_code:""}))},[ue,oe]=at.useState(!1),Ae=Z=>{oe(Z.target.checked),!Z.target.checked&&m({...v,prev_street_address:"",prev_apt_num:"",prev_city:"",prev_state:"",prev_zip_code:""})},[_e,ke]=at.useState(""),nt=Z=>{ke(Z.target.value),Z.target.value==="none"?m({...v,id_number:"none",ssn_number:""}):m({...v,id_number:"",ssn_number:""}),document.getElementById("state-id").className="",dataLayer.push({NVRF_id_type:Z.target.value,event:"NVRF_SELECT_ID"})},[At,tt]=at.useState(!1),Er=Z=>{tt(Z.target.checked),m({...v,id_number:"",ssn_number:""}),Z.target.checked?ke("none"):ke("")},[dt,sr]=at.useState(null),lr=Z=>{sr(Z)},Qt=()=>{const Z=document.getElementById("voter-contact");v.email_address?Z.value="":Z.removeAttribute("required")},Vr=()=>{switch(y){case 1:Qt();break}},Sa=Z=>{switch(Z){case 1:return r.back.reg_options;case 2:return r.back.personal_info;case 3:return r.back.address_location;case 4:return r.back.identification;case 5:return r.back.edit_info}},xe=Z=>{switch(Z){case 1:return r.next.address_location;case 2:return r.next.identification;case 3:return r.next.political_party;case 4:return r.next.confirm_info;case 5:return r.next.delivery}};return b.jsxs(b.Fragment,{children:[y!=6&&b.jsx(ej,{stringContent:a,type:"button","data-analytics":"backBtn",onClick:F,text:Sa(y)}),b.jsx(_W,{step:y,content:r,handleGoBack:A,setStep:x}),b.jsxs("div",{className:"margin-top-8 maxw-tablet margin-x-auto",children:[y<5&&b.jsxs(b.Fragment,{children:[b.jsx("h1",{children:s.replace("@state_name",e.stateData.name)}),b.jsx("div",{dangerouslySetInnerHTML:{__html:h}})]}),b.jsxs(ie.Form,{autoComplete:"off",id:"nvrf",className:"margin-top-5",style:{maxWidth:"none"},onSubmit:Z=>{R(Z),k(),M(p["stepLabel"+y])},children:[y===1&&b.jsx(nG,{state:e.state,stateData:e.stateData,fieldData:v,saveFieldData:O,dateFormat:S,registrationPath:e.registrationPath,previousName:X,onChangePreviousName:se,handlePrev:e.handlePrev,headings:r,content:t,fieldContent:n,stringContent:a}),y===2&&b.jsx(yG,{state:e.state,statesList:e.statesList,stateData:e.stateData,fieldData:v,saveFieldData:O,registrationPath:e.registrationPath,handlePrev:F,hasNoAddress:be,hasNoAddressCheckbox:$,hasPreviousAddress:ue,onChangePreviousAddressCheckbox:Ae,hasMailAddress:Q,onChangeMailAddressCheckbox:Y,headings:r,content:t,fieldContent:n,stringContent:a}),y===3&&b.jsx(EG,{state:e.state,stateData:e.stateData,fieldData:v,saveFieldData:O,dateFormat:S,registrationPath:e.registrationPath,handlePrev:F,saveIdType:nt,onChangeHasNoIdCheckbox:Er,hasNoID:At,idType:_e,headings:r,content:t,fieldContent:n,stringContent:a}),y===4&&b.jsx(TY,{state:e.state,stateData:e.stateData,fieldData:v,saveFieldData:O,registrationPath:e.registrationPath,handlePrev:F,headings:r,content:t,fieldContent:n,stringContent:a}),y===5&&b.jsx(SG,{state:e.state,stateData:e.stateData,headings:r,content:e.content,fieldData:v,saveFieldData:O,registrationPath:e.registrationPath,handlePrev:F,handleGoBackSteps:A,hasAcknowledged:dt,acknowledgeCheckbox:lr,fieldContent:n,stringContent:a}),y===6&&b.jsx(jY,{state:e.state,stateData:e.stateData,headings:r,content:e.content,fieldData:v,saveFieldData:O,registrationPath:e.registrationPath,handlePrev:F,deliveryButtonSelected:H,handleClickDeliveryButton:_,stringContent:a,pdfDoc:e.pdfDoc,form:e.form}),y!=6&&b.jsx(tj,{stringContent:a,type:"submit",onClick:()=>{Vr(),sC("nvrf")},text:xe(y)})]}),y===6&&d==="en"&&b.jsxs(b.Fragment,{children:[b.jsx("div",{id:"touchpoints-form-embed",className:"margin-top-6"}),b.jsx(nQ,{children:b.jsx("script",{src:"https://touchpoints.app.cloud.gov/touchpoints/4da46508.js",async:!0})})]})]})]})}const iQ=document.getElementById("root").getAttribute("data-stateId"),oQ=document.getElementById("root").getAttribute("data-returnPath");function sQ(){const[e,t]=at.useState(""),[r,n]=at.useState(""),[a,i]=at.useState(""),[s,h]=at.useState(""),[o,d]=at.useState(""),[p,v]=at.useState(""),[m,g]=at.useState(null),[w,O]=at.useState(null),[S,y]=at.useState(null);at.useEffect(()=>{Lb().then(({pdfDoc:_e,form:ke})=>{O(_e),y(ke)}).catch(()=>g(!0))},[]),at.useEffect(()=>{Sd("states.json",t,g),Sd("pages.json",n,g),Sd("cards.json",h,g),Sd("fields.json",d,g),pE("navigation.json",i,g),pE("strings.json",v,g)},[]);const[x,E]=at.useState(1),[k,F]=at.useState(""),[A,M]=at.useState(""),[R,H]=at.useState(""),[G,_]=at.useState(1),X=nr(A.nvrf_last_updated_date),K=p?p.lastUpdated:null,se=document.getElementById("scroll-to-top"),[be,ve]=at.useState(null),Q=_e=>{ve(_e)},W=()=>{se.focus(),se.scrollIntoView({behavior:"instant"})},Y=()=>{x!=3&&E(x+1),W()},$=()=>{x!=1&&E(x-1),W(),x===2&&ve(null)},ue=_e=>{if(!A&&_e!==""&&e)for(let ke=0;ke{ue(iQ)},[ue,e]);const oe=_e=>{H(_e)},Ae=_e=>{G===4||_(_e+1)};if(m)return b.jsxs("div",{children:[b.jsx(ie.Alert,{type:"error",heading:"Error",headingLevel:"h1",children:b.jsx("p",{children:"The form filler tool failed to load."})}),b.jsx("p",{children:b.jsx("button",{className:"usa-button",onClick:()=>window.location.reload(),children:"Try loading the tool again"})}),b.jsxs("p",{children:["If you were unable to use our form filler tool, ",b.jsx("a",{href:"https://touchpoints.app.cloud.gov/touchpoints/c169d3b2/submit",target:"_blank",children:"submit feedback"}),"."]})]});if(e&&s&&r&&a&&o&&p){const _e=s.find(nt=>nt.uuid==="5922e06c-ac2f-475d-ab10-abfdeb65de43"),ke=[];for(let nt=0;nt=1&&b.jsxs("div",{className:"text-base margin-top-5 maxw-tablet margin-x-auto",children:[b.jsxs("p",{children:[K.replace("@state_name",A.name)," ",b.jsx("span",{dangerouslySetInnerHTML:{__html:X}})]}),_e&&b.jsx("div",{dangerouslySetInnerHTML:{__html:nr(_e.body)}})]})]})})}}xy.createRoot(document.getElementById("root")).render(b.jsx(ma.StrictMode,{children:b.jsx(sQ,{})})); diff --git a/web/modules/custom/vote_nvrf/package-lock.json b/web/modules/custom/vote_nvrf/package-lock.json index 2dcc2f945..94fdf18b7 100644 --- a/web/modules/custom/vote_nvrf/package-lock.json +++ b/web/modules/custom/vote_nvrf/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "hasInstallScript": true, "dependencies": { - "vote-gov-nvrf-app": "github:usagov/vote-gov-nvrf-app#v0.18.0" + "vote-gov-nvrf-app": "github:usagov/vote-gov-nvrf-app#v0.18.1" } }, "node_modules/@ampproject/remapping": { @@ -1327,9 +1327,9 @@ } }, "node_modules/vite": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", - "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz", + "integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==", "dependencies": { "esbuild": "^0.18.10", "postcss": "^8.4.27", @@ -1382,7 +1382,7 @@ }, "node_modules/vote-gov-nvrf-app": { "version": "0.1.0", - "resolved": "git+ssh://git@github.com/usagov/vote-gov-nvrf-app.git#d5233ad3066a0c6188499013ea3340187515259d", + "resolved": "git+ssh://git@github.com/usagov/vote-gov-nvrf-app.git#15b27c47e3d033326fb4d75c2eceb8815be81700", "hasInstallScript": true, "dependencies": { "@trussworks/react-uswds": "^6.2.0", diff --git a/web/modules/custom/vote_nvrf/package.json b/web/modules/custom/vote_nvrf/package.json index 67a9a176c..58861a22d 100644 --- a/web/modules/custom/vote_nvrf/package.json +++ b/web/modules/custom/vote_nvrf/package.json @@ -11,6 +11,6 @@ "copy-data-es": "mkdir -p ../../../es/nvrf && rm -rf ../../../es/nvrf/data && cp -r ./node_modules/vote-gov-nvrf-app/dist/es/nvrf/data ../../../es/nvrf/data" }, "dependencies": { - "vote-gov-nvrf-app": "github:usagov/vote-gov-nvrf-app#v0.18.0" + "vote-gov-nvrf-app": "github:usagov/vote-gov-nvrf-app#v0.18.1" } } diff --git a/web/themes/custom/votegov/src/sass/components/page-content.scss b/web/themes/custom/votegov/src/sass/components/page-content.scss index ad82f30f7..b3d4654cc 100644 --- a/web/themes/custom/votegov/src/sass/components/page-content.scss +++ b/web/themes/custom/votegov/src/sass/components/page-content.scss @@ -2,14 +2,19 @@ @use "variables" as *; @use "mixins" as *; -.vote-main-content-row { - display: flex; +.vote-main-content-row, .usa-in-page-nav-container { + @include u-display('block'); + + @include at-media('tablet-lg') { + @include u-display('flex'); + } } .vote-page-content { @include u-margin-top(4); @include u-margin-bottom(6); @include u-position('relative'); + word-wrap: break-word; .field--name-field-media { @include at-media('desktop') { diff --git a/web/themes/custom/votegov/templates/navigation/menu-local-task.html.twig b/web/themes/custom/votegov/templates/navigation/menu-local-task.html.twig index e22b684f9..6e991f086 100644 --- a/web/themes/custom/votegov/templates/navigation/menu-local-task.html.twig +++ b/web/themes/custom/votegov/templates/navigation/menu-local-task.html.twig @@ -15,6 +15,6 @@ * @see template_preprocess_menu_local_task() */ #} - + {{ link['#title'] }}