diff --git a/package-lock.json b/package-lock.json index 30440ab..5e891fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,18 +10,17 @@ "dependencies": { "@types/google.maps": "^3.54.10", "rollup-plugin-svelte-svg": "^1.0.0-beta.6", - "sass": "^1.53.0", - "sirv-cli": "^2.0.0", - "svelte-portal": "^2.2.0" + "sass": "^1.69.0", + "sirv-cli": "^2.0.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^17.0.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-replace": "^4.0.0", - "@rollup/plugin-typescript": "^8.0.0", + "@rollup/plugin-typescript": "^11.1.0", "@sveltejs/adapter-static": "^1.0.0-next.34", - "@tsconfig/svelte": "^2.0.0", - "autoprefixer": "^10.4.7", + "@tsconfig/svelte": "^4.0.1", + "autoprefixer": "^10.4.0", "ngrok": "^4.3.1", "postcss": "^8.4.14", "rollup": "^2.3.4", @@ -32,9 +31,9 @@ "rollup-plugin-terser": "^7.0.0", "svelte": "^3.0.0", "svelte-check": "^2.8.0", - "svelte-preprocess": "^4.10.6", - "tslib": "^2.0.0", - "typescript": "^4.0.0" + "svelte-preprocess": "^5.0.0", + "tslib": "^2.5.0", + "typescript": "^5.0.0" } }, "node_modules/@babel/code-frame": { @@ -931,29 +930,75 @@ } }, "node_modules/@rollup/plugin-typescript": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.5.0.tgz", - "integrity": "sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ==", + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", + "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", "dev": true, "license": "MIT", "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "resolve": "^1.17.0" + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" }, "engines": { - "node": ">=8.0.0" + "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.14.0", + "rollup": "^2.14.0||^3.0.0||^4.0.0", "tslib": "*", "typescript": ">=3.7.0" }, "peerDependenciesMeta": { + "rollup": { + "optional": true + }, "tslib": { "optional": true } } }, + "node_modules/@rollup/plugin-typescript/node_modules/@rollup/pluginutils": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-typescript/node_modules/@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/plugin-typescript/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@rollup/pluginutils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", @@ -1124,9 +1169,9 @@ } }, "node_modules/@tsconfig/svelte": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/svelte/-/svelte-2.0.1.tgz", - "integrity": "sha512-aqkICXbM1oX5FfgZd2qSSAGdyo/NRxjWCamxoyi3T8iVQnzGge19HhDYzZ6NrVOW7bhcWNSq9XexWFtMzbB24A==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/svelte/-/svelte-4.0.1.tgz", + "integrity": "sha512-B+XlGpmuAQzJqDoBATNCvEPqQg0HkO7S8pM14QDI5NsmtymzRexQ1N+nX2H6RTtFbuFgaZD4I8AAi8voGg0GLg==", "dev": true, "license": "MIT" }, @@ -1267,9 +1312,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.4.20", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", - "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", + "version": "10.4.21", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.21.tgz", + "integrity": "sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==", "dev": true, "funding": [ { @@ -1287,11 +1332,11 @@ ], "license": "MIT", "dependencies": { - "browserslist": "^4.23.3", - "caniuse-lite": "^1.0.30001646", + "browserslist": "^4.24.4", + "caniuse-lite": "^1.0.30001702", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", - "picocolors": "^1.0.1", + "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "bin": { @@ -1355,9 +1400,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.3.tgz", - "integrity": "sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "dev": true, "funding": [ { @@ -1457,9 +1502,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001690", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz", - "integrity": "sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==", + "version": "1.0.30001714", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001714.tgz", + "integrity": "sha512-mtgapdwDLSSBnCI3JokHM7oEQBLxiJKVRtg10AxM1AyeiKcM96f0Mkbqeq+1AbiCtvMcHRulAAEMu693JrSWqg==", "dev": true, "funding": [ { @@ -1765,9 +1810,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.78", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.78.tgz", - "integrity": "sha512-UmwIt7HRKN1rsJfddG5UG7rCTCTAKoS9JeOy/R0zSenAyaZ8SU3RuXlwcratxhdxGRNpk03iq8O7BA3W7ibLVw==", + "version": "1.5.138", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.138.tgz", + "integrity": "sha512-FWlQc52z1dXqm+9cCJ2uyFgJkESd+16j6dBEjsgDNuHjBpuIzL8/lRc0uvh1k8RNI6waGo6tcy2DvwkTBJOLDg==", "dev": true, "license": "ISC" }, @@ -1847,9 +1892,9 @@ } }, "node_modules/esm-env": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.1.tgz", - "integrity": "sha512-U9JedYYjCnadUlXk7e1Kr+aENQhtUaoaV9+gZm1T8LC/YBAPJx3NSPIAurFOC0U5vrdSevnUJS2/wUVxGwPhng==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", "dev": true, "license": "MIT", "peer": true @@ -3340,27 +3385,7 @@ "svelte": "^3.24.0" } }, - "node_modules/svelte-hmr": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz", - "integrity": "sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==", - "dev": true, - "license": "ISC", - "peer": true, - "engines": { - "node": "^12.20 || ^14.13.1 || >= 16" - }, - "peerDependencies": { - "svelte": "^3.19.0 || ^4.0.0" - } - }, - "node_modules/svelte-portal": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/svelte-portal/-/svelte-portal-2.2.1.tgz", - "integrity": "sha512-uF7is5sM4aq5iN7QF/67XLnTUvQCf2iiG/B1BHTqLwYVY1dsVmTeXZ/LeEyU6dLjApOQdbEG9lkqHzxiQtOLEQ==", - "license": "MIT" - }, - "node_modules/svelte-preprocess": { + "node_modules/svelte-check/node_modules/svelte-preprocess": { "version": "4.10.7", "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.10.7.tgz", "integrity": "sha512-sNPBnqYD6FnmdBrUmBCaqS00RyCsCpj2BG58A1JBswNF7b0OKviwxqVrOL/CKyJrLSClrSeqQv5BXNg2RUbPOw==", @@ -3427,6 +3452,133 @@ } } }, + "node_modules/svelte-check/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/svelte-hmr": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz", + "integrity": "sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": "^12.20 || ^14.13.1 || >= 16" + }, + "peerDependencies": { + "svelte": "^3.19.0 || ^4.0.0" + } + }, + "node_modules/svelte-preprocess": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-5.1.4.tgz", + "integrity": "sha512-IvnbQ6D6Ao3Gg6ftiM5tdbR6aAETwjhHV+UKGf5bHGYR69RQvF1ho0JKPcbUON4vy4R7zom13jPjgdOWCQ5hDA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@types/pug": "^2.0.6", + "detect-indent": "^6.1.0", + "magic-string": "^0.30.5", + "sorcery": "^0.11.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">= 16.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.10.2", + "coffeescript": "^2.5.1", + "less": "^3.11.3 || ^4.0.0", + "postcss": "^7 || ^8", + "postcss-load-config": "^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0", + "pug": "^3.0.0", + "sass": "^1.26.8", + "stylus": "^0.55.0", + "sugarss": "^2.0.0 || ^3.0.0 || ^4.0.0", + "svelte": "^3.23.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0", + "typescript": ">=3.9.5 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "coffeescript": { + "optional": true + }, + "less": { + "optional": true + }, + "postcss": { + "optional": true + }, + "postcss-load-config": { + "optional": true + }, + "pug": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/svelte-preprocess/node_modules/buffer-crc32": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", + "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/svelte-preprocess/node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/svelte-preprocess/node_modules/sorcery": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/sorcery/-/sorcery-0.11.1.tgz", + "integrity": "sha512-o7npfeJE6wi6J9l0/5LKshFzZ2rMatRiCDwYeDQaOzqdzRJwALhX7mk/A/ecg6wjMu7wdZbmXfD2S/vpOg0bdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.14", + "buffer-crc32": "^1.0.0", + "minimist": "^1.2.0", + "sander": "^0.5.0" + }, + "bin": { + "sorcery": "bin/sorcery" + } + }, "node_modules/svgo": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", @@ -3525,9 +3677,9 @@ "license": "0BSD" }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -3535,13 +3687,13 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/undici": { - "version": "5.28.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", - "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", "dev": true, "license": "MIT", "peer": true, @@ -3560,9 +3712,9 @@ "license": "MIT" }, "node_modules/update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "dev": true, "funding": [ { @@ -3581,7 +3733,7 @@ "license": "MIT", "dependencies": { "escalade": "^3.2.0", - "picocolors": "^1.1.0" + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -3601,9 +3753,9 @@ } }, "node_modules/vite": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz", - "integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==", + "version": "4.5.13", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.13.tgz", + "integrity": "sha512-Hgp8IF/yZDzKsN1hQWOuQZbrKiaFsbQud+07jJ8h9m9PaHWkpvZ5u55Xw5yYjWRXwRQ4jwFlJvY7T7FUJG9MCA==", "dev": true, "license": "MIT", "peer": true, diff --git a/package.json b/package.json index a04282b..93b0ab9 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,9 @@ "@rollup/plugin-commonjs": "^17.0.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-replace": "^4.0.0", - "@rollup/plugin-typescript": "^8.0.0", + "@rollup/plugin-typescript": "^11.1.0", "@sveltejs/adapter-static": "^1.0.0-next.34", - "@tsconfig/svelte": "^2.0.0", - "autoprefixer": "^10.4.7", - "ngrok": "^4.3.1", + "@tsconfig/svelte": "^4.0.1", "postcss": "^8.4.14", "rollup": "^2.3.4", "rollup-plugin-css-only": "^3.1.0", @@ -26,15 +24,16 @@ "rollup-plugin-terser": "^7.0.0", "svelte": "^3.0.0", "svelte-check": "^2.8.0", - "svelte-preprocess": "^4.10.6", - "tslib": "^2.0.0", - "typescript": "^4.0.0" + "svelte-preprocess": "^5.0.0", + "tslib": "^2.5.0", + "typescript": "^5.0.0", + "autoprefixer": "^10.4.0", + "ngrok": "^4.3.1" }, "dependencies": { "@types/google.maps": "^3.54.10", "rollup-plugin-svelte-svg": "^1.0.0-beta.6", - "sass": "^1.53.0", - "sirv-cli": "^2.0.0", - "svelte-portal": "^2.2.0" + "sass": "^1.69.0", + "sirv-cli": "^2.0.0" } } diff --git a/public/global.css b/public/global.css index e69de29..580f2c1 100644 --- a/public/global.css +++ b/public/global.css @@ -0,0 +1,9 @@ +#zip-code-entry { + margin-bottom: 200px !important; +} + +.signup_wrapper { + display: flex; + flex-direction: column; + gap: 200px; +} diff --git a/public/index.html b/public/index.html index 350394d..bd6aa69 100644 --- a/public/index.html +++ b/public/index.html @@ -381,14 +381,16 @@

-
+
+ +
+
+
+

!!e,t=["zip","state","country","city","address","street_2","formatted_address","postal_code_availability","postal_code_availability_serving_now"],n=(e,t,n)=>{try{e.querySelector(`input[name="${t}"]`).value=n}catch(e){console.log("cannot set field value",t,n)}},o=(t,o,r)=>{n(t,"zip",o.postalCode),n(t,"state",o.stateShort),n(t,"country",o.countryCode),n(t,"city",o.city),n(t,"street_2",o.street_2),n(t,"address",[o.houseNumber,o.street].filter(e).join(" ")),n(t,"formatted_address",o.formattedAddress),r&&(n(t,"postal_code_availability",r.availability),n(t,"postal_code_availability_serving_now",r.servingNow))},r=e=>{t.forEach((t=>((e,t)=>{try{e.querySelector(`input[name="${t}"]`).parentElement.parentElement.style.display="none"}catch(e){console.log("cannot hide field",t)}})(e,t)))},s=e=>{r(e),e.appendChild((()=>{let e='\n html, body, input, button, label, select {\n font-family: PP Neue Montreal Variable, sans-serif !important,\n }\n input, button {\n -webkit-appearance:none;\n }\n .form-preview-container {\n background-color: #ffffff;\n }\n /* reset */\n form[class*="hs-form"] *,\n form[class*="hs-form"] *::before,\n form[class*="hs-form"] *::after {\n box-sizing: border-box;\n }\n form[class*="hs-form"] {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n gap: 1rem;\n font-family: PP Neue Montreal Variable, sans-serif,\n }\n form[class*="hs-form"] fieldset { max-width: none; display: flex; flex-wrap: wrap; }\n form[class*="hs-form"] fieldset > .field.hs-form-field { width: 1px; flex-grow: 1; min-width: 230px; }\n form[class*="hs-form"] .field.hs-form-field { flex-grow: 1; min-width: 230px; }\n form[class*="hs-form"] .field.hs-form-field .input { margin-right: 0; }\n form[class*="hs-form"] .field.hs-form-field .input input,\n form[class*="hs-form"] .field.hs-form-field .input select,\n form[class*="hs-form"] .field.hs-form-field .input textarea\n {\n width: 100%;\n resize: none;\n background: white;\n outline: none;\n border: 1px solid black;\n transition: .2s all;\n font-family: PP Neue Montreal Variable, sans-serif,\n }\n \n form[class*="hs-form"] .field.hs-form-field .input textarea {\n min-height: 150px;\n }\n \n \n form[class*="hs-form"] fieldset { \n gap: 1rem 12px; \n }\n \n\n form[class*="hs-form"] .field.hs-form-field .input input,\n form[class*="hs-form"] .field.hs-form-field .input select {\n height: 44px;\n line-height: 44px;\n padding: 0 24px;\n border: none;\n }\n\n form[class*="hs-form"] .field.hs-form-field .input input,\n form[class*="hs-form"] .field.hs-form-field .input select,\n form[class*="hs-form"] .field.hs-form-field .input textarea {\n font-weight: 400;\n border-style: solid;\n font-size: 15px;\n letter-spacing: 0px;\n height: 44px;\n padding: 0 16px !important;\n border-color: #EFF1F2;\n color: #090D0FEB;\n background-color: #EFF1F2;\n border-width: 0px;\n border-radius: 12px;\n }\n form[class*="hs-form"] .field.hs-form-field .input textarea {\n height: 150px;\n padding: 16px !important;\n }\n\n form[class*="hs-form"] .field.hs-form-field .input input::placeholder,\n form[class*="hs-form"] .field.hs-form-field .input select:invalid,\n form[class*="hs-form"] .field.hs-form-field .input textarea::placeholder {\n color: #020B0F5C;font-weight: 400;letter-spacing: 0px;\n }\n\n\n form[class*="hs-form"] .field.hs-form-field > label {\n display: block;\n font-weight: 600;color: #000000;font-size: 15px;margin-bottom: 8px;letter-spacing: 0px;text-transform: capitalize;\n }\n\n form[class*="hs-form"] .inputs-list label {\n display: block;\n border-style: solid;border-width: 0px;border-radius: 0px;padding: 8px 0px 0px 0px;color: #c95151;border-color: #d02525;font-size: 14px;font-weight: 400;\n }\n\n\n form[class*="hs-form"] .actions input[type="submit"] {\n display: flex;\n justify-content: center;\n width: 100%;\n cursor: pointer;\n line-height: 44px;\n outline: none;\n border: none;\n transition: .2s all;\n border-style: solid;\n color: white;\n font-weight: 400;font-size: 15px;letter-spacing: 0px;height: 44px;padding: 0 32px;color: white;background-color: #0F9954;border-width: 0px;border-radius: 12px;text-align: center;\n }\n\n form[class*="hs-form"] .actions input[type="submit"]:hover {\n font-size: 15px;\n background-color: #0F9954;\n }\n\n form[class*="hs-form"] .hs_error_rollup {\n display: none;\n }\n\n form[class*="hs-form"] .hs-error-msgs li { list-style: none; margin-left: 0; }\n\n div[class*="hs-form"].submitted-message {\n background-color: #6c42e0;border-width: 1px;border-radius: 8px;padding: 16px;text-align: center;color: #ffffff;font-size: 18px;\n }\n\n div[class*="hs-form"].submitted-message p {\n color: #ffffff;\n}';e+='\n.hs-form__virality-link {\n display: none !important;\n}\n.hs-form .field {\n margin-bottom: 0 !important;\n}\n\nform[class*="hs-form"] .field.hs-form-field > label {\n display: none;\n}\n\n.hs_submit.hs-submit .actions {\n padding: 0 !important;\n margin: 0 !important;\n}\n\nform[class*="hs-form"] {\n padding-bottom: 30px;\n}\n\n';const t=document.createElement("style");return t.innerHTML=e.trim(),t})())},i=e=>({update:t=>{try{window[e]=Object.assign(Object.assign({},window[e]),t)}catch(e){}},get:()=>{try{return window[e]}catch(e){return{}}}}),a=i("hsFormStateBooking"),l=i("hsFormStateNewsletter"),c=e=>"0"in e&&"length"in e&&1===e.length?e[0]:e;function d(){}function u(e,t){for(const n in t)e[n]=t[n];return e}function f(e){return e()}function p(){return Object.create(null)}function m(e){e.forEach(f)}function h(e){return"function"==typeof e}function g(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let b;function y(e,t){return b||(b=document.createElement("a")),b.href=t,e===b.href}function v(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return d;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function w(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}const x="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function _(e,t){e.appendChild(t)}function S(e,t,n){e.insertBefore(t,n||null)}function $(e){e.parentNode&&e.parentNode.removeChild(e)}function E(e){return document.createElement(e)}function A(e){return document.createTextNode(e)}function C(){return A(" ")}function j(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function k(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function P(e,t){t=""+t,e.data!==t&&(e.data=t)}function F(e,t,n){e.classList[n?"add":"remove"](t)}let N;function z(e){N=e}function T(){if(!N)throw new Error("Function called outside component initialization");return N}function q(e){T().$$.on_mount.push(e)}function O(){const e=T();return(t,n,{cancelable:o=!1}={})=>{const r=e.$$.callbacks[t];if(r){const s=function(e,t,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,n,o,t),r}(t,n,{cancelable:o});return r.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const B=[],K=[];let D=[];const L=[],Q=Promise.resolve();let I=!1;function M(e){D.push(e)}const V=new Set;let R=0;function H(){if(0!==R)return;const e=N;do{try{for(;R{const t=e.$$.on_mount.map(f).filter(h);e.$$.on_destroy?e.$$.on_destroy.push(...t):m(t),e.$$.on_mount=[]})),s.forEach(M)}function W(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];D.forEach((o=>-1===e.indexOf(o)?t.push(o):n.push(o))),n.forEach((e=>e())),D=t}(n.after_update),m(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function X(e,t){-1===e.$$.dirty[0]&&(B.push(e),I||(I=!0,Q.then(H)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const s=o.length?o[0]:n;return c.ctx&&r(c.ctx[t],c.ctx[t]=s)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](s),u&&X(e,t)),n})):[],c.update(),u=!0,m(c.before_update),c.fragment=!!o&&o(c.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);c.fragment&&c.fragment.l(e),e.forEach($)}else c.fragment&&c.fragment.c();t.intro&&G(e.$$.fragment),J(e,t.target,t.anchor,t.customElement),H()}z(l)}class ee{$destroy(){W(this,1),this.$destroy=d}$on(e,t){if(!h(t))return d;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}let te=!1;const ne=[];function oe(e,t){if(window.google&&window.google.maps&&window.google.maps.places)return void t();if(t&&ne.push(t),te)return;te=!0;const n=document.createElement("script");n.async=!0,n.defer=!0,n.onload=re,n.src=`https://maps.googleapis.com/maps/api/js?key=${encodeURIComponent(e)}&libraries=places`,n.type="text/javascript",document.head.appendChild(n)}function re(){let e;for(te=!1;e=ne.pop();)e()}function se(e){let t,n,o,r;return{c(){t=E("input"),k(t,"class",n=e[7].class),k(t,"placeholder",e[0]),t.value=e[1],t.required=e[2],k(t,"pattern",e[3]),F(t,"input",!0)},m(n,s){S(n,t,s),e[11](t),o||(r=[j(t,"change",e[5]),j(t,"keydown",e[6])],o=!0)},p(e,[o]){128&o&&n!==(n=e[7].class)&&k(t,"class",n),1&o&&k(t,"placeholder",e[0]),2&o&&t.value!==e[1]&&(t.value=e[1]),4&o&&(t.required=e[2]),8&o&&k(t,"pattern",e[3]),128&o&&F(t,"input",!0)},i:d,o:d,d(n){n&&$(t),e[11](null),o=!1,m(r)}}}function ie(e,t,n){let o,{apiKey:r}=t,{options:s}=t,{placeholder:i}=t,{value:a=""}=t,{required:l=!1}=t,{pattern:c=""}=t,{onSelect:d}=t;const f=O();let p;function m(){n(4,p.value="",p),h()}function h(){""===p.value&&g(null)}function g(e){o=e&&e.text||"",f("place_changed",e)}return q((()=>{oe(r,(()=>{n(8,s.types=["street_address","premise","subpremise","point_of_interest"],s);const e=new google.maps.places.Autocomplete(p,Object.assign({},s));e.addListener("place_changed",(()=>{const t=e.getPlace();(function(e){const t=s&&s.fields||["geometry"];return e.hasOwnProperty(t[0])})(t)&&(d(t),g({place:t,text:p.value}))})),f("ready"),setTimeout((()=>{p.setAttribute("autocomplete","one-time-code")}),2e3)}))})),e.$$set=e=>{n(7,t=u(u({},t),w(e))),"apiKey"in e&&n(9,r=e.apiKey),"options"in e&&n(8,s=e.options),"placeholder"in e&&n(0,i=e.placeholder),"value"in e&&n(1,a=e.value),"required"in e&&n(2,l=e.required),"pattern"in e&&n(3,c=e.pattern),"onSelect"in e&&n(10,d=e.onSelect)},e.$$.update=()=>{2&e.$$.dirty&&(o=a||"")},t=w(t),[i,a,l,c,p,h,function(e){const t=document.getElementsByClassName("pac-item").length;if("Enter"===e.key||"Tab"===e.key)if(t){document.getElementsByClassName("pac-item-selected").length||function(){const e=new KeyboardEvent("keydown",{key:"ArrowDown",code:"ArrowDown",keyCode:40});p.dispatchEvent(e)}()}else(function(e){return o!==e})(p.value)&&setTimeout(m,10);else"Escape"===e.key&&setTimeout(m,10);t&&"Enter"===e.key&&e.preventDefault()},t,s,r,d,function(e){K[e?"unshift":"push"]((()=>{p=e,n(4,p)}))}]}class ae extends ee{constructor(e){super(),Z(this,e,ie,se,g,{apiKey:9,options:8,placeholder:0,value:1,required:2,pattern:3,onSelect:10})}}const le=e=>{e.style.display="none"},ce=(e,t="block")=>{e.style.display=t};const de=[];const ue=["stateShort","zip","availability","servingNow"],fe=["state_id","zip","Availability","serving_now"];const pe={state_id:"stateShort",zip:"zip",Availability:"availability",serving_now:"servingNow"},me=e=>{const t=e.split("\n");if(t.length<1)return;const[n,...o]=t,r=n.split(",");if(function(e){return fe.reduce(((t,n)=>t&&e.includes(n)),!0)}(r))return o.map((e=>{const t={},n=e.split(",");if(r.forEach(((e,o)=>{const r=pe[e];void 0!==r&&(t[r]=`${n[o]}`)})),function(e){const t=Object.keys(e);return ue.reduce(((e,n)=>e&&t.includes(n)),!0)}(t))return t;console.warn(`Found invalid deregulated row: ${t}`)}),[]);throw new Error(`Missing required deregulated zip column names: ${r}`)},he=[],ge=e=>{const t=function(e,t=d){let n;const o=new Set;function r(t){if(g(e,t)&&(e=t,n)){const t=!de.length;for(const t of o)t[1](),de.push(t,e);if(t){for(let e=0;e{o.delete(a),0===o.size&&n&&(n(),n=null)}}}}(he);return{store:t,load:async()=>{try{const n=await(async e=>{const t=await fetch(e.zipsCsvUrl),n=await(await t.blob()).text();return me(n)})(e);t.set(n)}catch(e){console.error("Cannot load zips",e)}}}},{document:be}=x;function ye(e){let t,n;return{c(){t=E("p"),n=A(e[4]),k(t,"class","preorder-address-error-message")},m(e,o){S(e,t,o),_(t,n)},p(e,t){16&t&&P(n,e[4])},d(e){e&&$(t)}}}function ve(e){let t,n,o,r,s,i,a,l,c,d,u,f,p,m,h,g;i=new ae({props:{class:"location-search-input",apiKey:e[0],placeholder:"Enter your home address",onSelect:e[17],options:{componentRestrictions:{country:"us"}}}});let b=e[4]&&ye(e);return{c(){var g;t=E("div"),n=E("div"),o=E("img"),s=C(),(g=i.$$.fragment)&&g.c(),a=C(),l=E("button"),c=A(e[1]),d=C(),b&&b.c(),u=C(),f=E("div"),p=C(),m=E("script"),y(o.src,r="https://cdn.jsdelivr.net/gh/BasePowerCompany/preorder-booking@1.0.1/public/Base_files/map-pin.svg")||k(o,"src","https://cdn.jsdelivr.net/gh/BasePowerCompany/preorder-booking@1.0.1/public/Base_files/map-pin.svg"),k(o,"alt","Map pin icon"),k(n,"class","input-address-container"),k(l,"class","submitAddressButton button secondary w-button"),k(t,"class","input-address-wrap"),k(f,"class","focus_overlay"),k(m,"charset","utf-8"),y(m.src,h="//js-eu1.hsforms.net/forms/embed/v2.js")||k(m,"src","//js-eu1.hsforms.net/forms/embed/v2.js")},m(e,r){S(e,t,r),_(t,n),_(n,o),_(n,s),J(i,n,null),_(t,a),_(t,l),_(l,c),_(t,d),b&&b.m(t,null),S(e,u,r),S(e,f,r),S(e,p,r),_(be.head,m),g=!0},p(e,[n]){const o={};1&n&&(o.apiKey=e[0]),28&n&&(o.onSelect=e[17]),i.$set(o),(!g||2&n)&&P(c,e[1]),e[4]?b?b.p(e,n):(b=ye(e),b.c(),b.m(t,null)):b&&(b.d(1),b=null)},i(e){g||(G(i.$$.fragment,e),g=!0)},o(e){!function(e,t,n,o){if(e&&e.o){if(Y.has(e))return;Y.add(e),(void 0).c.push((()=>{Y.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}else o&&o()}(i.$$.fragment,e),g=!1},d(e){e&&$(t),W(i),b&&b.d(),e&&$(u),e&&$(f),e&&$(p),$(m)}}}function we(e,t,n){let r,s,{targetAvailableText:i}=t,{targetDisplayAddress:l}=t,{googlePublicApiKey:c}=t,{googleSheetConfig:d}=t,{addressCtaText:u="See if my home qualifies"}=t;const{store:f,load:p}=ge(d);v(e,f,(e=>n(18,s=e))),q((async()=>{p(),jQuery(".input-address-container").on("click",(function(){jQuery(".focus_overlay").show(),jQuery(".input-address-container").addClass("focused"),jQuery("input.location-search-input").attr("placeholder","Enter your home address"),jQuery("button.submitAddressButton").hide()})),jQuery(".input-address-container").on("keydown",(function(){jQuery("input.location-search-input").attr("placeholder","")})),jQuery(".focus_overlay").on("click",(function(){jQuery(".focus_overlay").hide(),jQuery(".submitAddressButton").show(),jQuery(".input-address-container").removeClass("focused")}))}));let m,{panelEl:h}=t,{stateContainerEl:g}=t,{addressPanelEl:b}=t,{targetAvailableStateEl:y}=t,{targetNotAvailableStateEl:w}=t,{onAddressSelect:x}=t,{onAddressSubmitSuccess:_=()=>{}}=t,{hidePanelEl:S=!1}=t;const $=()=>{if(!m)return void n(4,r="Please enter a full address.");if(!m.postalCode||!m.houseNumber||!m.street)return void n(4,r="Please enter a full address.");S||function(e,t="block"){let n=.1;e.style.opacity="0",e.style.display=t;const o=setInterval((function(){n>=1&&clearInterval(o),e.style.opacity=`${n}`,e.style.filter="alpha(opacity="+100*n+")",n+=.3*n}),1)}(h),ce(g),le(b);document.querySelector(l).innerHTML=m.formattedAddress;const e=s.find((e=>e.zip===m.postalCode))||null;e?(document.querySelector(i).innerHTML=e.availability,ce(y),le(w),o(window.hsFormPreorder,m,e),a.update({selectedAddress:m,zipConfig:e}),null==_||_(m,"lead-preorder-form",e)):(ce(w),le(y),o(window.hsFormNewsletter,m),a.update({selectedAddress:m,zipConfig:null}),null==_||_(m,"lead-newsletter-form",e))};return e.$$set=e=>{"targetAvailableText"in e&&n(7,i=e.targetAvailableText),"targetDisplayAddress"in e&&n(8,l=e.targetDisplayAddress),"googlePublicApiKey"in e&&n(0,c=e.googlePublicApiKey),"googleSheetConfig"in e&&n(9,d=e.googleSheetConfig),"addressCtaText"in e&&n(1,u=e.addressCtaText),"panelEl"in e&&n(10,h=e.panelEl),"stateContainerEl"in e&&n(11,g=e.stateContainerEl),"addressPanelEl"in e&&n(12,b=e.addressPanelEl),"targetAvailableStateEl"in e&&n(13,y=e.targetAvailableStateEl),"targetNotAvailableStateEl"in e&&n(14,w=e.targetNotAvailableStateEl),"onAddressSelect"in e&&n(2,x=e.onAddressSelect),"onAddressSubmitSuccess"in e&&n(15,_=e.onAddressSubmitSuccess),"hidePanelEl"in e&&n(16,S=e.hidePanelEl)},n(4,r=""),n(3,m=void 0),[c,u,x,m,r,f,$,i,l,d,h,g,b,y,w,_,S,e=>{const t=(e=>{console.log(e);const t=(e.address_components||[]).reduce((function(e,t){return t.types.forEach((function(n){e[n]=t})),e}),{}),n=(e,n=!1)=>e in t?n?t[e].short_name:t[e].long_name:null;return{title:e.name,formattedAddress:e.formatted_address,externalId:e.place_id,externalUrl:e.url,houseNumber:n("street_number"),street:n("route"),street_2:[n("floor"),n("subpremise")].filter((e=>!!e)).join(",")||null,city:n("locality")||n("sublocality")||n("sublocality_level_1")||n("neighborhood")||n("administrative_area_level_3")||n("administrative_area_level_2"),county:n("administrative_area_level_2"),stateShort:n("administrative_area_level_1",!0),stateLong:n("administrative_area_level_1"),countryCode:n("country",!0),countryLong:n("country"),postalCode:n("postal_code")}})(e);x?.(t),window.blur(),n(4,r=""),n(3,m=t),$()}]}class xe extends ee{constructor(e){super(),Z(this,e,we,ve,g,{targetAvailableText:7,targetDisplayAddress:8,googlePublicApiKey:0,googleSheetConfig:9,addressCtaText:1,panelEl:10,stateContainerEl:11,addressPanelEl:12,targetAvailableStateEl:13,targetNotAvailableStateEl:14,onAddressSelect:2,onAddressSubmitSuccess:15,hidePanelEl:16})}}const _e={initialize:e=>{const{targetElAddressInput:t=document.getElementById("hero-address-entry"),googlePublicApiKey:n,targetPanel:o,targetAddressPanel:r,targetAvailableState:i,targetNotAvailableState:d,targetStateContainer:u,targetAvailableText:f,targetDisplayAddress:p,googleSheetConfig:m,hsFormSuccess:h,hsFormNewsletter:g,querySelectorClickToOpenForm:b,onAddressSelect:y,onAddressSubmitSuccess:v,hidePanelEl:w,addressCtaText:x}=e;(({hsFormSuccess:e,hsFormNewsletter:t})=>{window.hbspt.forms.create(Object.assign(Object.assign({},e),{onFormReady:e=>{const t=c(e);window.hsFormPreorder=t,s(t)},onFormSubmit:t=>{var n;const o=c(t);o.querySelector('input[name="email"]').value,null===(n=e.onFormSubmit)||void 0===n||n.call(e,o)},onFormSubmitted:(t,n)=>{var o;null===(o=e.onFormSubmitted)||void 0===o||o.call(e,t,Object.assign(Object.assign({},n),{submissionValues:Object.assign(Object.assign({},n.submissionValues),a.get())}))}})),window.hbspt.forms.create(Object.assign(Object.assign({},t),{onFormReady:e=>{const t=c(e);window.hsFormNewsletter=t,s(t)},onFormSubmitted:(e,n)=>{var o;null===(o=t.onFormSubmitted)||void 0===o||o.call(t,e,Object.assign(Object.assign({},n),{submissionValues:Object.assign(Object.assign({},n.submissionValues),l.get())}))}}))})({hsFormSuccess:h,hsFormNewsletter:g});const _=document.querySelector(o),S=document.querySelector(u),$=document.querySelector(r),E=document.querySelector(i),A=document.querySelector(d);document.querySelectorAll(b).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),t.scrollIntoView({behavior:"smooth"});const n=t.getBoundingClientRect().top+window.scrollY-300;window.scrollTo({top:n,behavior:"smooth"}),setTimeout((()=>{t.querySelector("input").focus()}),1e3)}))})),document.querySelectorAll(".close-button").forEach((e=>{e.addEventListener("click",(()=>{!function(e){let t=1;const n=setInterval((function(){t<=.1&&(clearInterval(n),e.style.display="none"),e.style.opacity=`${t}`,e.style.filter="alpha(opacity="+100*t+")",t-=.3*t}),1)}(_)}))}));return new xe({target:t,props:{googlePublicApiKey:n,googleSheetConfig:m,targetAvailableText:f,targetDisplayAddress:p,addressPanelEl:$,targetAvailableStateEl:E,stateContainerEl:S,panelEl:_,targetNotAvailableStateEl:A,onAddressSelect:y,onAddressSubmitSuccess:v,hidePanelEl:w,addressCtaText:"See if my home qualifies"}})}};window.BasePreorderApp=_e})); +!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e=e=>!!e,t=["zip","state","country","city","address","street_2","formatted_address","postal_code_availability","postal_code_availability_serving_now"],n=(e,t,n)=>{try{e.querySelector(`input[name="${t}"]`).value=n}catch(e){console.log("cannot set field value",t,n)}},o=(t,o,s)=>{n(t,"zip",o.postalCode),n(t,"state",o.stateShort),n(t,"country",o.countryCode),n(t,"city",o.city),n(t,"street_2",o.street_2),n(t,"address",[o.houseNumber,o.street].filter(e).join(" ")),n(t,"formatted_address",o.formattedAddress),s&&(n(t,"postal_code_availability",s.availability),n(t,"postal_code_availability_serving_now",s.servingNow))},s=e=>{t.forEach((t=>((e,t)=>{try{e.querySelector(`input[name="${t}"]`).parentElement.parentElement.style.display="none"}catch(e){console.log("cannot hide field",t)}})(e,t)))},r=e=>{s(e),e.appendChild((()=>{let e='\n html, body, input, button, label, select {\n font-family: PP Neue Montreal Variable, sans-serif !important,\n }\n input, button {\n -webkit-appearance:none;\n }\n .form-preview-container {\n background-color: #ffffff;\n }\n /* reset */\n form[class*="hs-form"] *,\n form[class*="hs-form"] *::before,\n form[class*="hs-form"] *::after {\n box-sizing: border-box;\n }\n form[class*="hs-form"] {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n gap: 1rem;\n font-family: PP Neue Montreal Variable, sans-serif,\n }\n form[class*="hs-form"] fieldset { max-width: none; display: flex; flex-wrap: wrap; }\n form[class*="hs-form"] fieldset > .field.hs-form-field { width: 1px; flex-grow: 1; min-width: 230px; }\n form[class*="hs-form"] .field.hs-form-field { flex-grow: 1; min-width: 230px; }\n form[class*="hs-form"] .field.hs-form-field .input { margin-right: 0; }\n form[class*="hs-form"] .field.hs-form-field .input input,\n form[class*="hs-form"] .field.hs-form-field .input select,\n form[class*="hs-form"] .field.hs-form-field .input textarea\n {\n width: 100%;\n resize: none;\n background: white;\n outline: none;\n border: 1px solid black;\n transition: .2s all;\n font-family: PP Neue Montreal Variable, sans-serif,\n }\n \n form[class*="hs-form"] .field.hs-form-field .input textarea {\n min-height: 150px;\n }\n \n \n form[class*="hs-form"] fieldset { \n gap: 1rem 12px; \n }\n \n\n form[class*="hs-form"] .field.hs-form-field .input input,\n form[class*="hs-form"] .field.hs-form-field .input select {\n height: 44px;\n line-height: 44px;\n padding: 0 24px;\n border: none;\n }\n\n form[class*="hs-form"] .field.hs-form-field .input input,\n form[class*="hs-form"] .field.hs-form-field .input select,\n form[class*="hs-form"] .field.hs-form-field .input textarea {\n font-weight: 400;\n border-style: solid;\n font-size: 15px;\n letter-spacing: 0px;\n height: 44px;\n padding: 0 16px !important;\n border-color: #EFF1F2;\n color: #090D0FEB;\n background-color: #EFF1F2;\n border-width: 0px;\n border-radius: 12px;\n }\n form[class*="hs-form"] .field.hs-form-field .input textarea {\n height: 150px;\n padding: 16px !important;\n }\n\n form[class*="hs-form"] .field.hs-form-field .input input::placeholder,\n form[class*="hs-form"] .field.hs-form-field .input select:invalid,\n form[class*="hs-form"] .field.hs-form-field .input textarea::placeholder {\n color: #020B0F5C;font-weight: 400;letter-spacing: 0px;\n }\n\n\n form[class*="hs-form"] .field.hs-form-field > label {\n display: block;\n font-weight: 600;color: #000000;font-size: 15px;margin-bottom: 8px;letter-spacing: 0px;text-transform: capitalize;\n }\n\n form[class*="hs-form"] .inputs-list label {\n display: block;\n border-style: solid;border-width: 0px;border-radius: 0px;padding: 8px 0px 0px 0px;color: #c95151;border-color: #d02525;font-size: 14px;font-weight: 400;\n }\n\n\n form[class*="hs-form"] .actions input[type="submit"] {\n display: flex;\n justify-content: center;\n width: 100%;\n cursor: pointer;\n line-height: 44px;\n outline: none;\n border: none;\n transition: .2s all;\n border-style: solid;\n color: white;\n font-weight: 400;font-size: 15px;letter-spacing: 0px;height: 44px;padding: 0 32px;color: white;background-color: #0F9954;border-width: 0px;border-radius: 12px;text-align: center;\n }\n\n form[class*="hs-form"] .actions input[type="submit"]:hover {\n font-size: 15px;\n background-color: #0F9954;\n }\n\n form[class*="hs-form"] .hs_error_rollup {\n display: none;\n }\n\n form[class*="hs-form"] .hs-error-msgs li { list-style: none; margin-left: 0; }\n\n div[class*="hs-form"].submitted-message {\n background-color: #6c42e0;border-width: 1px;border-radius: 8px;padding: 16px;text-align: center;color: #ffffff;font-size: 18px;\n }\n\n div[class*="hs-form"].submitted-message p {\n color: #ffffff;\n}';e+='\n.hs-form__virality-link {\n display: none !important;\n}\n.hs-form .field {\n margin-bottom: 0 !important;\n}\n\nform[class*="hs-form"] .field.hs-form-field > label {\n display: none;\n}\n\n.hs_submit.hs-submit .actions {\n padding: 0 !important;\n margin: 0 !important;\n}\n\nform[class*="hs-form"] {\n padding-bottom: 30px;\n}\n\n';const t=document.createElement("style");return t.innerHTML=e.trim(),t})())},i=e=>({update:t=>{try{window[e]=Object.assign(Object.assign({},window[e]),t)}catch(e){}},get:()=>{try{return window[e]}catch(e){return{}}}}),l=i("hsFormStateBooking"),a=i("hsFormStateNewsletter"),c=e=>"0"in e&&"length"in e&&1===e.length?e[0]:e,d=({hsFormSuccess:e,hsFormNewsletter:t})=>{window.hbspt.forms.create(Object.assign(Object.assign({},e),{onFormReady:e=>{const t=c(e);window.hsFormPreorder=t,r(t)},onFormSubmit:t=>{var n;const o=c(t);o.querySelector('input[name="email"]').value,null===(n=e.onFormSubmit)||void 0===n||n.call(e,o)},onFormSubmitted:(t,n)=>{var o;null===(o=e.onFormSubmitted)||void 0===o||o.call(e,t,Object.assign(Object.assign({},n),{submissionValues:Object.assign(Object.assign({},n.submissionValues),l.get())}))}})),window.hbspt.forms.create(Object.assign(Object.assign({},t),{onFormReady:e=>{const t=c(e);window.hsFormNewsletter=t,r(t)},onFormSubmitted:(e,n)=>{var o;null===(o=t.onFormSubmitted)||void 0===o||o.call(t,e,Object.assign(Object.assign({},n),{submissionValues:Object.assign(Object.assign({},n.submissionValues),a.get())}))}}))};function u(){}function f(e,t){for(const n in t)e[n]=t[n];return e}function p(e){return e()}function m(){return Object.create(null)}function h(e){e.forEach(p)}function g(e){return"function"==typeof e}function b(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let y;function v(e,t){return y||(y=document.createElement("a")),y.href=t,e===y.href}function w(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return u;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function S(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}const x="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function _(e,t){e.appendChild(t)}function E(e,t,n){e.insertBefore(t,n||null)}function A(e){e.parentNode&&e.parentNode.removeChild(e)}function $(e){return document.createElement(e)}function C(e){return document.createTextNode(e)}function k(){return C(" ")}function z(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function j(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function P(e,t){t=""+t,e.data!==t&&(e.data=t)}function F(e,t,n){e.classList[n?"add":"remove"](t)}let q;function T(e){q=e}function N(){if(!q)throw new Error("Function called outside component initialization");return q}function O(e){N().$$.on_mount.push(e)}function B(){const e=N();return(t,n,{cancelable:o=!1}={})=>{const s=e.$$.callbacks[t];if(s){const r=function(e,t,{bubbles:n=!1,cancelable:o=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(e,n,o,t),s}(t,n,{cancelable:o});return s.slice().forEach((t=>{t.call(e,r)})),!r.defaultPrevented}return!0}}const L=[],D=[];let K=[];const I=[],Q=Promise.resolve();let M=!1;function V(e){K.push(e)}const R=new Set;let U=0;function H(){if(0!==U)return;const e=q;do{try{for(;U{const t=e.$$.on_mount.map(p).filter(g);e.$$.on_destroy?e.$$.on_destroy.push(...t):h(t),e.$$.on_mount=[]})),r.forEach(V)}function W(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];K.forEach((o=>-1===e.indexOf(o)?t.push(o):n.push(o))),n.forEach((e=>e())),K=t}(n.after_update),h(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function X(e,t){-1===e.$$.dirty[0]&&(L.push(e),M||(M=!0,Q.then(H)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const r=o.length?o[0]:n;return c.ctx&&s(c.ctx[t],c.ctx[t]=r)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](r),d&&X(e,t)),n})):[],c.update(),d=!0,h(c.before_update),c.fragment=!!o&&o(c.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);c.fragment&&c.fragment.l(e),e.forEach(A)}else c.fragment&&c.fragment.c();t.intro&&G(e.$$.fragment),J(e,t.target,t.anchor,t.customElement),H()}T(a)}class te{$destroy(){W(this,1),this.$destroy=u}$on(e,t){if(!g(t))return u;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}let ne=!1;const oe=[];function se(e,t){if(window.google&&window.google.maps&&window.google.maps.places)return void t();if(t&&oe.push(t),ne)return;ne=!0;const n=document.createElement("script");n.async=!0,n.defer=!0,n.onload=re,n.src=`https://maps.googleapis.com/maps/api/js?key=${encodeURIComponent(e)}&libraries=places`,n.type="text/javascript",document.head.appendChild(n)}function re(){let e;for(ne=!1;e=oe.pop();)e()}function ie(e){let t,n,o,s;return{c(){t=$("input"),j(t,"class",n=e[7].class),j(t,"placeholder",e[0]),t.value=e[1],t.required=e[2],j(t,"pattern",e[3]),F(t,"input",!0)},m(n,r){E(n,t,r),e[11](t),o||(s=[z(t,"change",e[5]),z(t,"keydown",e[6])],o=!0)},p(e,[o]){128&o&&n!==(n=e[7].class)&&j(t,"class",n),1&o&&j(t,"placeholder",e[0]),2&o&&t.value!==e[1]&&(t.value=e[1]),4&o&&(t.required=e[2]),8&o&&j(t,"pattern",e[3]),128&o&&F(t,"input",!0)},i:u,o:u,d(n){n&&A(t),e[11](null),o=!1,h(s)}}}function le(e,t,n){let o,{apiKey:s}=t,{options:r}=t,{placeholder:i}=t,{value:l=""}=t,{required:a=!1}=t,{pattern:c=""}=t,{onSelect:d}=t;const u=B();let p;function m(){n(4,p.value="",p),h()}function h(){""===p.value&&g(null)}function g(e){o=e&&e.text||"",u("place_changed",e)}return O((()=>{se(s,(()=>{n(8,r.types=["street_address","premise","subpremise","point_of_interest"],r);const e=new google.maps.places.Autocomplete(p,Object.assign({},r));e.addListener("place_changed",(()=>{const t=e.getPlace();(function(e){const t=r&&r.fields||["geometry"];return e.hasOwnProperty(t[0])})(t)&&(d(t),g({place:t,text:p.value}))})),u("ready"),setTimeout((()=>{p.setAttribute("autocomplete","one-time-code")}),2e3)}))})),e.$$set=e=>{n(7,t=f(f({},t),S(e))),"apiKey"in e&&n(9,s=e.apiKey),"options"in e&&n(8,r=e.options),"placeholder"in e&&n(0,i=e.placeholder),"value"in e&&n(1,l=e.value),"required"in e&&n(2,a=e.required),"pattern"in e&&n(3,c=e.pattern),"onSelect"in e&&n(10,d=e.onSelect)},e.$$.update=()=>{2&e.$$.dirty&&(o=l||"")},t=S(t),[i,l,a,c,p,h,function(e){const t=document.getElementsByClassName("pac-item").length;if("Enter"===e.key||"Tab"===e.key)if(t){document.getElementsByClassName("pac-item-selected").length||function(){const e=new KeyboardEvent("keydown",{key:"ArrowDown",code:"ArrowDown",keyCode:40});p.dispatchEvent(e)}()}else(function(e){return o!==e})(p.value)&&setTimeout(m,10);else"Escape"===e.key&&setTimeout(m,10);t&&"Enter"===e.key&&e.preventDefault()},t,r,s,d,function(e){D[e?"unshift":"push"]((()=>{p=e,n(4,p)}))}]}class ae extends te{constructor(e){super(),ee(this,e,le,ie,b,{apiKey:9,options:8,placeholder:0,value:1,required:2,pattern:3,onSelect:10})}}const ce=e=>{e.style.display="none"},de=(e,t="block")=>{e.style.display=t};function ue(e){let t=1;const n=setInterval((function(){t<=.1&&(clearInterval(n),e.style.display="none"),e.style.opacity=`${t}`,e.style.filter="alpha(opacity="+100*t+")",t-=.3*t}),1)}const fe=[];const pe=["stateShort","zip","availability","servingNow"],me=["state_id","zip","Availability","serving_now"];const he={state_id:"stateShort",zip:"zip",Availability:"availability",serving_now:"servingNow"},ge=e=>{const t=e.split("\n");if(t.length<1)return;const[n,...o]=t,s=n.split(",");if(function(e){return me.reduce(((t,n)=>t&&e.includes(n)),!0)}(s))return o.map((e=>{const t={},n=e.split(",");if(s.forEach(((e,o)=>{const s=he[e];void 0!==s&&(t[s]=`${n[o]}`)})),function(e){const t=Object.keys(e);return pe.reduce(((e,n)=>e&&t.includes(n)),!0)}(t))return t;console.warn(`Found invalid deregulated row: ${t}`)}),[]);throw new Error(`Missing required deregulated zip column names: ${s}`)},be=[],ye=e=>{const t=function(e,t=u){let n;const o=new Set;function s(t){if(b(e,t)&&(e=t,n)){const t=!fe.length;for(const t of o)t[1](),fe.push(t,e);if(t){for(let e=0;e{o.delete(l),0===o.size&&n&&(n(),n=null)}}}}(be);return{store:t,load:async()=>{try{const n=await(async e=>{const t=await fetch(e.zipsCsvUrl),n=await(await t.blob()).text();return ge(n)})(e);t.set(n)}catch(e){console.error("Cannot load zips",e)}}}},{document:ve}=x;function we(e){let t,n;return{c(){t=$("p"),n=C(e[4]),j(t,"class","preorder-address-error-message")},m(e,o){E(e,t,o),_(t,n)},p(e,t){16&t&&P(n,e[4])},d(e){e&&A(t)}}}function Se(e){let t,n,o,s,r,i,l,a,c,d,u,f,p,m,h,g;i=new ae({props:{class:"location-search-input",apiKey:e[0],placeholder:"Enter your home address",onSelect:e[17],options:{componentRestrictions:{country:"us"}}}});let b=e[4]&&we(e);return{c(){var g;t=$("div"),n=$("div"),o=$("img"),r=k(),(g=i.$$.fragment)&&g.c(),l=k(),a=$("button"),c=C(e[1]),d=k(),b&&b.c(),u=k(),f=$("div"),p=k(),m=$("script"),v(o.src,s="https://cdn.jsdelivr.net/gh/BasePowerCompany/preorder-booking@1.0.1/public/Base_files/map-pin.svg")||j(o,"src","https://cdn.jsdelivr.net/gh/BasePowerCompany/preorder-booking@1.0.1/public/Base_files/map-pin.svg"),j(o,"alt","Map pin icon"),j(n,"class","input-address-container"),j(a,"class","submitAddressButton button secondary w-button"),j(t,"class","input-address-wrap"),j(f,"class","focus_overlay"),j(m,"charset","utf-8"),v(m.src,h="//js-eu1.hsforms.net/forms/embed/v2.js")||j(m,"src","//js-eu1.hsforms.net/forms/embed/v2.js")},m(e,s){E(e,t,s),_(t,n),_(n,o),_(n,r),J(i,n,null),_(t,l),_(t,a),_(a,c),_(t,d),b&&b.m(t,null),E(e,u,s),E(e,f,s),E(e,p,s),_(ve.head,m),g=!0},p(e,[n]){const o={};1&n&&(o.apiKey=e[0]),28&n&&(o.onSelect=e[17]),i.$set(o),(!g||2&n)&&P(c,e[1]),e[4]?b?b.p(e,n):(b=we(e),b.c(),b.m(t,null)):b&&(b.d(1),b=null)},i(e){g||(G(i.$$.fragment,e),g=!0)},o(e){!function(e,t,n,o){if(e&&e.o){if(Z.has(e))return;Z.add(e),(void 0).c.push((()=>{Z.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}else o&&o()}(i.$$.fragment,e),g=!1},d(e){e&&A(t),W(i),b&&b.d(),e&&A(u),e&&A(f),e&&A(p),A(m)}}}function xe(e,t,n){let s,r,{targetAvailableText:i}=t,{targetDisplayAddress:a}=t,{googlePublicApiKey:c}=t,{googleSheetConfig:d}=t,{addressCtaText:u="See if my home qualifies"}=t;const{store:f,load:p}=ye(d);w(e,f,(e=>n(18,r=e))),O((async()=>{p(),jQuery(".input-address-container").on("click",(function(){jQuery(".focus_overlay").show(),jQuery(".input-address-container").addClass("focused"),jQuery("input.location-search-input").attr("placeholder","Enter your home address"),jQuery("button.submitAddressButton").hide()})),jQuery(".input-address-container").on("keydown",(function(){jQuery("input.location-search-input").attr("placeholder","")})),jQuery(".focus_overlay").on("click",(function(){jQuery(".focus_overlay").hide(),jQuery(".submitAddressButton").show(),jQuery(".input-address-container").removeClass("focused")}))}));let m,{panelEl:h}=t,{stateContainerEl:g}=t,{addressPanelEl:b}=t,{targetAvailableStateEl:y}=t,{targetNotAvailableStateEl:v}=t,{onAddressSelect:S}=t,{onAddressSubmitSuccess:x=()=>{}}=t,{hidePanelEl:_=!1}=t;const E=()=>{if(!m)return void n(4,s="Please enter a full address.");if(!m.postalCode||!m.houseNumber||!m.street)return void n(4,s="Please enter a full address.");_||function(e,t="block"){let n=.1;e.style.opacity="0",e.style.display=t;const o=setInterval((function(){n>=1&&clearInterval(o),e.style.opacity=`${n}`,e.style.filter="alpha(opacity="+100*n+")",n+=.3*n}),1)}(h),de(g),ce(b);document.querySelector(a).innerHTML=m.formattedAddress;const e=r.find((e=>e.zip===m.postalCode))||null;e?(document.querySelector(i).innerHTML=e.availability,de(y),ce(v),o(window.hsFormPreorder,m,e),l.update({selectedAddress:m,zipConfig:e}),null==x||x(m,"lead-preorder-form",e)):(de(v),ce(y),o(window.hsFormNewsletter,m),l.update({selectedAddress:m,zipConfig:null}),null==x||x(m,"lead-newsletter-form",e))};return e.$$set=e=>{"targetAvailableText"in e&&n(7,i=e.targetAvailableText),"targetDisplayAddress"in e&&n(8,a=e.targetDisplayAddress),"googlePublicApiKey"in e&&n(0,c=e.googlePublicApiKey),"googleSheetConfig"in e&&n(9,d=e.googleSheetConfig),"addressCtaText"in e&&n(1,u=e.addressCtaText),"panelEl"in e&&n(10,h=e.panelEl),"stateContainerEl"in e&&n(11,g=e.stateContainerEl),"addressPanelEl"in e&&n(12,b=e.addressPanelEl),"targetAvailableStateEl"in e&&n(13,y=e.targetAvailableStateEl),"targetNotAvailableStateEl"in e&&n(14,v=e.targetNotAvailableStateEl),"onAddressSelect"in e&&n(2,S=e.onAddressSelect),"onAddressSubmitSuccess"in e&&n(15,x=e.onAddressSubmitSuccess),"hidePanelEl"in e&&n(16,_=e.hidePanelEl)},n(4,s=""),n(3,m=void 0),[c,u,S,m,s,f,E,i,a,d,h,g,b,y,v,x,_,e=>{const t=(e=>{console.log(e);const t=(e.address_components||[]).reduce((function(e,t){return t.types.forEach((function(n){e[n]=t})),e}),{}),n=(e,n=!1)=>e in t?n?t[e].short_name:t[e].long_name:null;return{title:e.name,formattedAddress:e.formatted_address,externalId:e.place_id,externalUrl:e.url,houseNumber:n("street_number"),street:n("route"),street_2:[n("floor"),n("subpremise")].filter((e=>!!e)).join(",")||null,city:n("locality")||n("sublocality")||n("sublocality_level_1")||n("neighborhood")||n("administrative_area_level_3")||n("administrative_area_level_2"),county:n("administrative_area_level_2"),stateShort:n("administrative_area_level_1",!0),stateLong:n("administrative_area_level_1"),countryCode:n("country",!0),countryLong:n("country"),postalCode:n("postal_code")}})(e);S?.(t),window.blur(),n(4,s=""),n(3,m=t),E()}]}class _e extends te{constructor(e){super(),ee(this,e,xe,Se,b,{targetAvailableText:7,targetDisplayAddress:8,googlePublicApiKey:0,googleSheetConfig:9,addressCtaText:1,panelEl:10,stateContainerEl:11,addressPanelEl:12,targetAvailableStateEl:13,targetNotAvailableStateEl:14,onAddressSelect:2,onAddressSubmitSuccess:15,hidePanelEl:16})}}function Ee(e){let t,n,o,s,r,i,l,a,c,d,f,p,m,g,b,y,v,w,S,x,q,T,N,O,B,L,D,K,I,Q,M=(e[1][0]||"")+"",V=(e[1][1]||"")+"",R=(e[1][2]||"")+"",U=(e[1][3]||"")+"",H=(e[1][4]||"")+"";return{c(){t=$("div"),n=$("div"),n.textContent="Enter your zip code",o=k(),s=$("div"),r=$("div"),i=$("input"),l=k(),a=$("div"),c=$("div"),d=C(M),f=k(),p=$("div"),m=C(V),g=k(),b=$("div"),y=C(R),v=k(),w=$("div"),S=C(U),x=k(),q=$("div"),T=C(H),N=k(),O=$("button"),B=C(e[0]),D=k(),K=$("div"),j(n,"class","zip-badge"),j(i,"type","text"),j(i,"inputmode","numeric"),j(i,"pattern","[0-9]*"),j(i,"class","zip-search-input"),j(i,"maxlength","5"),j(c,"class","zip-box"),F(c,"filled",e[1].length>=1),j(p,"class","zip-box"),F(p,"filled",e[1].length>=2),j(b,"class","zip-box"),F(b,"filled",e[1].length>=3),j(w,"class","zip-box"),F(w,"filled",e[1].length>=4),j(q,"class","zip-box"),F(q,"filled",e[1].length>=5),j(a,"class","zip-boxes"),j(r,"class","zip-input-layout"),j(O,"class","submitZipButton button secondary w-button"),O.disabled=L=!e[2],j(s,"class","input-zip-container"),j(t,"class","input-zip-wrap"),j(K,"class","focus_overlay")},m(u,h){E(u,t,h),_(t,n),_(t,o),_(t,s),_(s,r),_(r,i),_(r,l),_(r,a),_(a,c),_(c,d),_(a,f),_(a,p),_(p,m),_(a,g),_(a,b),_(b,y),_(a,v),_(a,w),_(w,S),_(a,x),_(a,q),_(q,T),_(s,N),_(s,O),_(O,B),E(u,D,h),E(u,K,h),I||(Q=[z(i,"input",e[4]),z(i,"keydown",e[8]),z(O,"click",e[5])],I=!0)},p(e,[t]){2&t&&M!==(M=(e[1][0]||"")+"")&&P(d,M),2&t&&F(c,"filled",e[1].length>=1),2&t&&V!==(V=(e[1][1]||"")+"")&&P(m,V),2&t&&F(p,"filled",e[1].length>=2),2&t&&R!==(R=(e[1][2]||"")+"")&&P(y,R),2&t&&F(b,"filled",e[1].length>=3),2&t&&U!==(U=(e[1][3]||"")+"")&&P(S,U),2&t&&F(w,"filled",e[1].length>=4),2&t&&H!==(H=(e[1][4]||"")+"")&&P(T,H),2&t&&F(q,"filled",e[1].length>=5),1&t&&P(B,e[0]),4&t&&L!==(L=!e[2])&&(O.disabled=L)},i:u,o:u,d(e){e&&A(t),e&&A(D),e&&A(K),I=!1,h(Q)}}}function Ae(e,t,n){let o,s,{googleSheetConfig:r}=t,{addressCtaText:i="Get started"}=t,{onAddressSubmitSuccess:l=()=>{}}=t;const{store:a,load:c}=ye(r);w(e,a,(e=>n(10,s=e))),O((async()=>{c();const e=document.querySelector(".input-zip-container"),t=document.querySelector(".focus_overlay"),n=document.querySelector(".zip-search-input");e&&t&&(e.addEventListener("click",(()=>{5!==d.length&&(t.style.display="block",e.classList.add("focused")),null==n||n.focus()})),t.addEventListener("click",(()=>{t.style.display="none",e.classList.remove("focused")})))}));let d="";const u=()=>{if(!d)return;if(5!==d.length)return;console.log("Submitting zip code:",d);const e=s.find((e=>e.zip===d))||null;console.log("Found zip config:",e);const t={title:"",formattedAddress:d,externalId:"",externalUrl:"",houseNumber:"",street:"",street_2:"",city:"",county:"",stateShort:(null==e?void 0:e.stateShort)||"",stateLong:"",countryCode:"US",countryLong:"United States",postalCode:d};console.log("Calling onAddressSubmitSuccess with:",{address:t,type:e?"lead-preorder-form":"lead-newsletter-form",zipConfig:e}),null==l||l(t,e?"lead-preorder-form":"lead-newsletter-form",e)};return e.$$set=e=>{"googleSheetConfig"in e&&n(6,r=e.googleSheetConfig),"addressCtaText"in e&&n(0,i=e.addressCtaText),"onAddressSubmitSuccess"in e&&n(7,l=e.onAddressSubmitSuccess)},e.$$.update=()=>{2&e.$$.dirty&&n(2,o=5===d.length)},[i,d,o,a,e=>{const t=e.target,o=t.value.replace(/\D/g,"");o.length>5?t.value=o.slice(0,5):t.value=o,n(1,d=t.value)},u,r,l,e=>"Enter"===e.key&&o&&u()]}class $e extends te{constructor(e){super(),ee(this,e,Ae,Ee,b,{googleSheetConfig:6,addressCtaText:0,onAddressSubmitSuccess:7})}}const Ce={initialize:e=>{const{targetElAddressInput:t=document.getElementById("hero-address-entry"),googlePublicApiKey:n,targetPanel:o,targetAddressPanel:s,targetAvailableState:r,targetNotAvailableState:i,targetStateContainer:l,targetAvailableText:a,targetDisplayAddress:c,googleSheetConfig:u,hsFormSuccess:f,hsFormNewsletter:p,querySelectorClickToOpenForm:m,onAddressSelect:h,onAddressSubmitSuccess:g,hidePanelEl:b,addressCtaText:y}=e;d({hsFormSuccess:f,hsFormNewsletter:p});const v=document.querySelector(o),w=document.querySelector(l),S=document.querySelector(s),x=document.querySelector(r),_=document.querySelector(i);document.querySelectorAll(m).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),t.scrollIntoView({behavior:"smooth"});const n=t.getBoundingClientRect().top+window.scrollY-300;window.scrollTo({top:n,behavior:"smooth"}),setTimeout((()=>{t.querySelector("input").focus()}),1e3)}))})),document.querySelectorAll(".close-button").forEach((e=>{e.addEventListener("click",(()=>{ue(v)}))}));return new _e({target:t,props:{googlePublicApiKey:n,googleSheetConfig:u,targetAvailableText:a,targetDisplayAddress:c,addressPanelEl:S,targetAvailableStateEl:x,stateContainerEl:w,panelEl:v,targetNotAvailableStateEl:_,onAddressSelect:h,onAddressSubmitSuccess:g,hidePanelEl:b,addressCtaText:"See if my home qualifies"}})},initializeZipCode:e=>{const{targetElAddressInput:t=document.getElementById("zip-code-entry"),googlePublicApiKey:n,targetPanel:o,targetAddressPanel:s,targetAvailableState:r,targetNotAvailableState:i,targetStateContainer:l,targetAvailableText:a,targetDisplayAddress:c,googleSheetConfig:u,hsFormSuccess:f,hsFormNewsletter:p,querySelectorClickToOpenForm:m,onAddressSubmitSuccess:h,hidePanelEl:g,addressCtaText:b}=e;d({hsFormSuccess:f,hsFormNewsletter:p});const y=document.querySelector(o);document.querySelector(l),document.querySelector(s),document.querySelector(r),document.querySelector(i),document.querySelectorAll(m).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),t.scrollIntoView({behavior:"smooth"});const n=t.getBoundingClientRect().top+window.scrollY-300;window.scrollTo({top:n,behavior:"smooth"}),setTimeout((()=>{t.querySelector("input").focus()}),1e3)}))})),document.querySelectorAll(".close-button").forEach((e=>{e.addEventListener("click",(()=>{ue(y)}))}));return new $e({target:t,props:{googleSheetConfig:u,onAddressSubmitSuccess:h,addressCtaText:b}})}};window.BasePreorderApp=Ce})); //# sourceMappingURL=embed.js.map diff --git a/public/preorder-app/embed.js.map b/public/preorder-app/embed.js.map index 02371ef..5eb8ea7 100644 --- a/public/preorder-app/embed.js.map +++ b/public/preorder-app/embed.js.map @@ -1 +1 @@ -{"version":3,"file":"embed.js","sources":["../../src/location-input/utils/isTruthy.ts","../../src/location-input/hubspot/hsFormUtils.ts","../../src/windowVars.ts","../../src/initializeForms.ts","../../node_modules/svelte/internal/index.mjs","../../src/location-input/googlePlace/googlePlaceLibraryLoader.ts","../../src/location-input/googlePlace/GooglePlaceAutocomplete.svelte","../../src/location-input/googlePlace/utils.ts","../../src/visibilityUtils.ts","../../node_modules/svelte/store/index.mjs","../../src/location-input/zipData/types.ts","../../src/location-input/zipData/fetchZipCodes.ts","../../src/location-input/zipData/zipStore.ts","../../src/location-input/LocationInput.svelte","../../src/PreorderApp.ts","../../src/embed.ts"],"sourcesContent":["export const isTruthy = (x) => !!x;\n","import { isTruthy } from \"../utils/isTruthy\";\nexport const getStyleEl = () => {\n let styles = `\n html, body, input, button, label, select {\n font-family: PP Neue Montreal Variable, sans-serif !important,\n }\n input, button {\n -webkit-appearance:none;\n }\n .form-preview-container {\n background-color: #ffffff;\n }\n /* reset */\n form[class*=\"hs-form\"] *,\n form[class*=\"hs-form\"] *::before,\n form[class*=\"hs-form\"] *::after {\n box-sizing: border-box;\n }\n form[class*=\"hs-form\"] {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n gap: 1rem;\n font-family: PP Neue Montreal Variable, sans-serif,\n }\n form[class*=\"hs-form\"] fieldset { max-width: none; display: flex; flex-wrap: wrap; }\n form[class*=\"hs-form\"] fieldset > .field.hs-form-field { width: 1px; flex-grow: 1; min-width: 230px; }\n form[class*=\"hs-form\"] .field.hs-form-field { flex-grow: 1; min-width: 230px; }\n form[class*=\"hs-form\"] .field.hs-form-field .input { margin-right: 0; }\n form[class*=\"hs-form\"] .field.hs-form-field .input input,\n form[class*=\"hs-form\"] .field.hs-form-field .input select,\n form[class*=\"hs-form\"] .field.hs-form-field .input textarea\n {\n width: 100%;\n resize: none;\n background: white;\n outline: none;\n border: 1px solid black;\n transition: .2s all;\n font-family: PP Neue Montreal Variable, sans-serif,\n }\n \n form[class*=\"hs-form\"] .field.hs-form-field .input textarea {\n min-height: 150px;\n }\n \n \n form[class*=\"hs-form\"] fieldset { \n gap: 1rem 12px; \n }\n \n\n form[class*=\"hs-form\"] .field.hs-form-field .input input,\n form[class*=\"hs-form\"] .field.hs-form-field .input select {\n height: 44px;\n line-height: 44px;\n padding: 0 24px;\n border: none;\n }\n\n form[class*=\"hs-form\"] .field.hs-form-field .input input,\n form[class*=\"hs-form\"] .field.hs-form-field .input select,\n form[class*=\"hs-form\"] .field.hs-form-field .input textarea {\n font-weight: 400;\n border-style: solid;\n font-size: 15px;\n letter-spacing: 0px;\n height: 44px;\n padding: 0 16px !important;\n border-color: #EFF1F2;\n color: #090D0FEB;\n background-color: #EFF1F2;\n border-width: 0px;\n border-radius: 12px;\n }\n form[class*=\"hs-form\"] .field.hs-form-field .input textarea {\n height: 150px;\n padding: 16px !important;\n }\n\n form[class*=\"hs-form\"] .field.hs-form-field .input input::placeholder,\n form[class*=\"hs-form\"] .field.hs-form-field .input select:invalid,\n form[class*=\"hs-form\"] .field.hs-form-field .input textarea::placeholder {\n color: #020B0F5C;font-weight: 400;letter-spacing: 0px;\n }\n\n\n form[class*=\"hs-form\"] .field.hs-form-field > label {\n display: block;\n font-weight: 600;color: #000000;font-size: 15px;margin-bottom: 8px;letter-spacing: 0px;text-transform: capitalize;\n }\n\n form[class*=\"hs-form\"] .inputs-list label {\n display: block;\n border-style: solid;border-width: 0px;border-radius: 0px;padding: 8px 0px 0px 0px;color: #c95151;border-color: #d02525;font-size: 14px;font-weight: 400;\n }\n\n\n form[class*=\"hs-form\"] .actions input[type=\"submit\"] {\n display: flex;\n justify-content: center;\n width: 100%;\n cursor: pointer;\n line-height: 44px;\n outline: none;\n border: none;\n transition: .2s all;\n border-style: solid;\n color: white;\n font-weight: 400;font-size: 15px;letter-spacing: 0px;height: 44px;padding: 0 32px;color: white;background-color: #0F9954;border-width: 0px;border-radius: 12px;text-align: center;\n }\n\n form[class*=\"hs-form\"] .actions input[type=\"submit\"]:hover {\n font-size: 15px;\n background-color: #0F9954;\n }\n\n form[class*=\"hs-form\"] .hs_error_rollup {\n display: none;\n }\n\n form[class*=\"hs-form\"] .hs-error-msgs li { list-style: none; margin-left: 0; }\n\n div[class*=\"hs-form\"].submitted-message {\n background-color: #6c42e0;border-width: 1px;border-radius: 8px;padding: 16px;text-align: center;color: #ffffff;font-size: 18px;\n }\n\n div[class*=\"hs-form\"].submitted-message p {\n color: #ffffff;\n}`;\n styles += `\n.hs-form__virality-link {\n display: none !important;\n}\n.hs-form .field {\n margin-bottom: 0 !important;\n}\n\nform[class*=\"hs-form\"] .field.hs-form-field > label {\n display: none;\n}\n\n.hs_submit.hs-submit .actions {\n padding: 0 !important;\n margin: 0 !important;\n}\n\nform[class*=\"hs-form\"] {\n padding-bottom: 30px;\n}\n\n`;\n const styleEl = document.createElement(\"style\");\n styleEl.innerHTML = styles.trim();\n return styleEl;\n};\nconst formFields = [\n \"zip\",\n \"state\",\n \"country\",\n \"city\",\n \"address\",\n \"street_2\",\n \"formatted_address\",\n \"postal_code_availability\",\n \"postal_code_availability_serving_now\",\n];\nconst setInputValue = (form, fieldName, value) => {\n try {\n const input = form.querySelector(`input[name=\"${fieldName}\"]`);\n input.value = value;\n }\n catch (_a) {\n console.log(\"cannot set field value\", fieldName, value);\n }\n};\nexport const setHiddenHubspotInputs = (form, parsedData, zipConfig) => {\n setInputValue(form, \"zip\", parsedData.postalCode);\n setInputValue(form, \"state\", parsedData.stateShort);\n setInputValue(form, \"country\", parsedData.countryCode);\n setInputValue(form, \"city\", parsedData.city);\n setInputValue(form, \"street_2\", parsedData.street_2);\n setInputValue(form, \"address\", [parsedData.houseNumber, parsedData.street].filter(isTruthy).join(\" \"));\n setInputValue(form, \"formatted_address\", parsedData.formattedAddress);\n if (zipConfig) {\n setInputValue(form, \"postal_code_availability\", zipConfig.availability);\n setInputValue(form, \"postal_code_availability_serving_now\", zipConfig.servingNow);\n }\n};\nconst hideField = (form, fieldName) => {\n try {\n const inputZip = form.querySelector(`input[name=\"${fieldName}\"]`);\n inputZip.parentElement.parentElement.style.display = \"none\";\n }\n catch (_a) {\n console.log(\"cannot hide field\", fieldName);\n }\n};\nconst hideFields = (form) => {\n formFields.forEach((fieldName) => hideField(form, fieldName));\n};\nexport const modifyFormOnLoad = (form) => {\n hideFields(form);\n // append styles\n form.appendChild(getStyleEl());\n};\n","// exchanging data with initialized HS form is hard, creating some window vars here\nconst hsFormWindowState = (key) => ({\n update: (data) => {\n try {\n window[key] = Object.assign(Object.assign({}, window[key]), data);\n }\n catch (e) { }\n },\n get: () => {\n try {\n return window[key];\n }\n catch (_a) {\n return {};\n }\n },\n});\nexport const hsFormStateBooking = hsFormWindowState(\"hsFormStateBooking\");\nexport const hsFormStateNewsletter = hsFormWindowState(\"hsFormStateNewsletter\");\n","import { modifyFormOnLoad } from \"./location-input/hubspot/hsFormUtils\";\nimport { hsFormStateBooking, hsFormStateNewsletter } from \"./windowVars\";\nconst getFormFromCb = (cbArg) => {\n if (\"0\" in cbArg && \"length\" in cbArg && cbArg.length === 1) {\n return cbArg[\"0\"];\n }\n return cbArg;\n};\nlet submittedSuccessEmail = undefined;\nexport const initializeHubspotForms = ({ hsFormSuccess, hsFormNewsletter, }) => {\n // initialize success hs\n window.hbspt.forms.create(Object.assign(Object.assign({}, hsFormSuccess), { onFormReady: (args) => {\n const form = getFormFromCb(args);\n window.hsFormPreorder = form;\n modifyFormOnLoad(form);\n }, onFormSubmit: (args) => {\n var _a;\n const form = getFormFromCb(args);\n const submittedEmail = form.querySelector('input[name=\"email\"]').value;\n submittedSuccessEmail = submittedEmail;\n (_a = hsFormSuccess.onFormSubmit) === null || _a === void 0 ? void 0 : _a.call(hsFormSuccess, form);\n }, onFormSubmitted: (form, args) => {\n var _a;\n (_a = hsFormSuccess.onFormSubmitted) === null || _a === void 0 ? void 0 : _a.call(hsFormSuccess, form, Object.assign(Object.assign({}, args), { submissionValues: Object.assign(Object.assign({}, args.submissionValues), hsFormStateBooking.get()) }));\n } }));\n // newsletter hs\n window.hbspt.forms.create(Object.assign(Object.assign({}, hsFormNewsletter), { onFormReady: (args) => {\n const form = getFormFromCb(args);\n window.hsFormNewsletter = form;\n modifyFormOnLoad(form);\n }, onFormSubmitted: (form, args) => {\n /**\n * redirect to the payment page\n */\n var _a;\n (_a = hsFormNewsletter.onFormSubmitted) === null || _a === void 0 ? void 0 : _a.call(hsFormNewsletter, form, Object.assign(Object.assign({}, args), { submissionValues: Object.assign(Object.assign({}, args.submissionValues), hsFormStateNewsletter.get()) }));\n } }));\n};\n","function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\nfunction is_promise(value) {\n return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nfunction split_css_unit(value) {\n const split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px'];\n}\nconst contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nclass ResizeObserverSingleton {\n constructor(options) {\n this.options = options;\n this._listeners = 'WeakMap' in globals ? new WeakMap() : undefined;\n }\n observe(element, listener) {\n this._listeners.set(element, listener);\n this._getObserver().observe(element, this.options);\n return () => {\n this._listeners.delete(element);\n this._observer.unobserve(element); // this line can probably be removed\n };\n }\n _getObserver() {\n var _a;\n return (_a = this._observer) !== null && _a !== void 0 ? _a : (this._observer = new ResizeObserver((entries) => {\n var _a;\n for (const entry of entries) {\n ResizeObserverSingleton.entries.set(entry.target, entry);\n (_a = this._listeners.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n }\n }));\n }\n}\n// Needs to be written like this to pass the tree-shake-test\nResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined;\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not \n let children = target.childNodes;\n // If target is , there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n return style.sheet;\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction comment(content) {\n return document.createComment(content);\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_immediate_propagation(fn) {\n return function (event) {\n event.stopImmediatePropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data_map(node, data_map) {\n Object.keys(data_map).forEach((key) => {\n set_custom_element_data(node, key, data_map[key]);\n });\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction set_dynamic_element_data(tag) {\n return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes;\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction init_binding_group(group) {\n let _inputs;\n return {\n /* push */ p(...inputs) {\n _inputs = inputs;\n _inputs.forEach(input => group.push(input));\n },\n /* remove */ r() {\n _inputs.forEach(input => group.splice(group.indexOf(input), 1));\n }\n };\n}\nfunction init_binding_group_dynamic(group, indexes) {\n let _group = get_binding_group(group);\n let _inputs;\n function get_binding_group(group) {\n for (let i = 0; i < indexes.length; i++) {\n group = group[indexes[i]] = group[indexes[i]] || [];\n }\n return group;\n }\n function push() {\n _inputs.forEach(input => _group.push(input));\n }\n function remove() {\n _inputs.forEach(input => _group.splice(_group.indexOf(input), 1));\n }\n return {\n /* update */ u(new_indexes) {\n indexes = new_indexes;\n const new_group = get_binding_group(group);\n if (new_group !== _group) {\n remove();\n _group = new_group;\n push();\n }\n },\n /* push */ p(...inputs) {\n _inputs = inputs;\n push();\n },\n /* remove */ r: remove\n };\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction claim_comment(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 8, (node) => {\n node.data = '' + data;\n return undefined;\n }, () => comment(data), true);\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n text.data = data;\n}\nfunction set_data_contenteditable(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n text.data = data;\n}\nfunction set_data_maybe_contenteditable(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable(text, data);\n }\n else {\n set_data(text, data);\n }\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value == null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value, mounting) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n if (!mounting || value !== undefined) {\n select.selectedIndex = -1; // no option should be selected\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked');\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_iframe_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n // see https://github.com/sveltejs/svelte/issues/4233\n fn();\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nconst resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'content-box' });\nconst resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'border-box' });\nconst resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'device-pixel-content-box' });\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n /** #7364 target for