GeneralAire 3200A Humidifier: Replacement and New Installation Prices
Whole-house humidifiers › GeneralAire humidifiers › GeneralAire 3200A
Replacing an existing GeneralAire 3200A costs $634.46 with GSHA. Installing one on a heating system that has never had a humidifier costs $1,110.71. Each price includes the humidifier, its control and standard installation.
Schedule installation
Replace an existing humidifier: $634.46. Install a new humidifier: $1,110.71. Tell us which job is yours.
Copy your request and send it through the GSHA request form or the chat button in the corner of this page. Add your ZIP code and the days and times that suit you. GSHA confirms the fit in a written estimate and then sets the installation time with you. A time is a request until GSHA confirms it.
Request for GSHA: GeneralAire 3200A humidifier. Replacement $634.46, new installation $1,110.71. My job (replacement or new installation): ZIP code: Days and times that suit me:
Schedule an estimate
This estimate is for the GeneralAire 3200A. GSHA checks your heating system, ductwork, water, drain and power, then sends a written estimate you can review and approve. Say whether it is a replacement or a first installation. A photo of the furnace and the humidifier you have now helps.
Financing options
GSHA’s financing page shows the payment options and how to apply. You can also ask about them in your estimate request.
Help me choose
Not sure the GeneralAire 3200A is the right humidifier? Answer these five questions and send them with your request. GSHA recommends a model and prices it for your home. Or see all GeneralAire models.
- Is this a first installation, or are you replacing a humidifier?
- Does the home have forced-air ductwork?
- What is the model number of the humidifier you have now? A photo works too.
- About how large is the home, and what do you want to fix?
- What is your ZIP code?
About the GeneralAire 3200A
The 3200A is GeneralAire’s small bypass humidifier. The furnace blower moves air through a wet evaporator pad, so the humidifier needs no fan or outlet of its own. The A in the model number means an automatic digital humidistat is included.
Fit and output
- Type: Small bypass evaporative humidifier
- Rated output: Up to 12 gallons per day at a 120-degree plenum temperature
- Coverage: Homes up to 3,200 square feet, by GeneralAire’s rating
- Control: Automatic digital humidistat included
What the installation needs
- Power: 24 volts, no outlet of its own
- Water and drain: A water supply and a drain
- Mounting: Return or supply plenum, with a 6-inch bypass duct to the other side
Upkeep
- Upkeep: GA10 evaporator pad, replaced as part of regular upkeep
Ratings are GeneralAire’s. See the GeneralAire 3200A manufacturer page.
What the two GeneralAire 3200A prices cover
The replacement price is for a like-for-like swap: the same type of humidifier going back in the same place, reusing the existing duct opening, water line, drain and wiring where they fit and work. The new-installation price is for a heating system that has never had a humidifier. Both include the humidifier, its control and standard installation, and both are confirmed in a written estimate after we check your system. See what each GeneralAire price includes and what is quoted separately.
GeneralAire 3200A questions
How much does it cost to replace a GeneralAire 3200A humidifier?
A like-for-like GeneralAire 3200A replacement from GSHA costs $634.46. That includes the new humidifier and its control, removal of the old unit, and reconnection to the existing duct opening, water line, drain and wiring where they fit and work.
How much does it cost to install a new GeneralAire 3200A humidifier?
A first-time GeneralAire 3200A installation from GSHA costs $1,110.71. That price is for a heating system that has never had a humidifier and includes the humidifier, its control and standard installation.
What does a GeneralAire 3200A need for installation?
Power: 24 volts, no outlet of its own. Water and drain: A water supply and a drain. Mounting: Return or supply plenum, with a 6-inch bypass duct to the other side. GSHA checks each of these in your home before the written estimate.
What upkeep does a GeneralAire 3200A need?
GA10 evaporator pad, replaced as part of regular upkeep. That is the manufacturer’s upkeep for this model, and GSHA can do it on a service visit.
How do I schedule a GeneralAire 3200A installation?
Open Schedule installation at the top of this page and send your request with your ZIP code and the times that suit you. GSHA sends a written estimate first. After you approve it, GSHA sets the installation time with you. A time is a request until GSHA confirms it.
Back to all GeneralAire humidifier models, or compare brands on our whole-house humidifier installation page.
GSHA installs humidifiers across 456 ZIP codes in northern Illinois and southeast Wisconsin, from Woodstock, Crystal Lake and Lake Bluff to Kenosha and Lake Geneva. Check your ZIP code on our service area page.
'use strict';
var W = window;
var D = document;
if (W.GSHAAssistant) { return W.GSHAAssistant; }
var NAV_ID = 'gsha-assistant-launcher';
var LINK_ID = 'gsha-assistant-form-link';
var PANEL_ID = 'gsha-assistant-panel';
var MODAL_ID = 'omw-117909';
var NOTES_NAME = 'textarea-1';
var SUCCESS_EVENT = 'forminator:form:submit:success';
var PHONE_HREF = 'tel:+12242203660';
var PHONE_TEXT = '(224) 220-3660';
var URL_FINANCING = 'https://gshaservices.com/financing/';
var URL_CONTACT = 'https://gshaservices.com/contact/';
var URL_AREA = 'https://gshaservices.com/about-gsha-services/service-area/';
var QUOTE = 'Written quote';
var STORE_KEY = 'gsha-assistant:' + W.location.pathname;
var PRICE_RE = /^\$[0-9][0-9,]*(\.[0-9][0-9])?$/;
var ZIP_RE = /^[0-9]{5}$/;
var LABELS = {
'schedule-installation': 'Schedule installation',
'estimate': 'Schedule an estimate',
'financing': 'Financing options',
'help-me-choose': 'Help me choose',
'schedule-service': 'Schedule service or repair',
'talk-to-a-person': 'Talk to a person'
};
var REQUESTS = ['schedule-installation', 'estimate', 'help-me-choose', 'schedule-service'];
var ANSWER_KEYS = ['scope', 'zip', 'existing', 'heat', 'times', 'estType', 'duct', 'size', 'symptom'];
var END_STEPS = ['summary', 'person', 'financing', 'menu'];
var SCOPE_WORDS = { 'replacement': 'Replacing an existing humidifier', 'new': 'First installation' };
var CSS_PANEL = 'position:fixed;z-index:1150;box-sizing:border-box;display:flex;flex-direction:column;margin:0;padding:0;overflow:hidden;background:#fff;color:#333;border:1px solid #d8dde3;box-shadow:0 8px 28px rgba(0,0,0,.24);font-size:16px;line-height:1.5;text-align:left;';
var CSS_PANEL_WIDE = 'right:126px;bottom:16px;width:380px;max-width:calc(100vw - 142px);max-height:calc(100vh - 32px);border-radius:10px;';
var CSS_PANEL_PHONE = 'left:0;right:0;width:auto;border-radius:10px 10px 0 0;';
var CSS_HEAD = 'flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;margin:0;padding:10px 12px 10px 16px;background:#151515;color:#fff;';
var CSS_TITLE = 'margin:0 12px 0 0;padding:0;border:0;background:none;font-size:16px;font-weight:700;line-height:1.3;letter-spacing:0;text-transform:none;color:#fff;';
var CSS_BTN = 'box-sizing:border-box;font:inherit;font-weight:700;line-height:1.3;letter-spacing:0;text-transform:none;text-decoration:none;white-space:normal;box-shadow:none;cursor:pointer;';
var CSS_CLOSE = CSS_BTN + 'flex:0 0 auto;min-height:40px;margin:0;padding:6px 14px;font-size:14px;color:#fff;background:transparent;border:1px solid #fff;border-radius:6px;';
var CSS_BODY = 'flex:1 1 auto;overflow-y:auto;margin:0;padding:14px 16px 6px;';
var CSS_BOX = 'margin:0 0 12px;padding:10px 12px;background:#f4f6f8;border:1px solid #d8dde3;border-radius:8px;font-size:14px;line-height:1.55;color:#333;white-space:pre-wrap;word-wrap:break-word;';
var CSS_TEXT = 'margin:0 0 10px;padding:0;font-size:16px;line-height:1.5;color:#333;';
var CSS_ASK = 'margin:0 0 10px;padding:0;font-size:16px;font-weight:700;line-height:1.45;color:#151515;';
var CSS_WIDE_BTN = CSS_BTN + 'display:block;width:100%;min-height:46px;margin:0 0 8px;padding:10px 14px;font-size:16px;border-radius:6px;';
var CSS_OPTION = CSS_WIDE_BTN + 'text-align:left;color:#151515;background:#fff;border:1px solid #d8dde3;border-left:4px solid #c9002d;';
var CSS_MAIN = CSS_WIDE_BTN + 'text-align:center;color:#fff;background:#c9002d;border:1px solid #c9002d;';
var CSS_PLAIN = CSS_WIDE_BTN + 'text-align:center;color:#151515;background:#fff;border:1px solid #151515;';
var CSS_LINK = 'color:#c9002d;font-weight:700;text-decoration:underline;';
var CSS_LABEL = 'display:block;margin:0 0 6px;padding:0;font-size:16px;font-weight:700;line-height:1.45;color:#151515;';
var CSS_INPUT = 'box-sizing:border-box;display:block;width:100%;min-height:46px;margin:0 0 8px;padding:8px 12px;font:inherit;font-size:16px;line-height:1.4;color:#151515;background:#fff;border:1px solid #6b7280;border-radius:6px;box-shadow:none;';
var CSS_ERROR = 'margin:0 0 8px;padding:0;font-size:14px;font-weight:700;line-height:1.4;color:#c9002d;';
var CSS_FOOT = 'flex:0 0 auto;box-sizing:border-box;margin:0;padding:10px 16px 6px;background:#fff;border-top:1px solid #d8dde3;';
var CSS_SMALL = 'margin:0 0 6px;padding:0;font-size:13px;line-height:1.4;color:#333;';
var CSS_FOOT_TOP = 'display:flex;align-items:center;justify-content:space-between;margin:0 0 6px;padding:0;font-size:13px;line-height:1.4;color:#333;';
var CSS_RESET = CSS_BTN + 'min-height:32px;margin:0;padding:4px 8px;font-size:13px;color:#151515;background:#fff;border:1px solid #d8dde3;border-radius:6px;';
var CSS_CHIP = CSS_BTN + 'display:inline-block;min-height:38px;margin:0 6px 6px 0;padding:6px 10px;font-size:13px;color:#151515;background:#f4f6f8;border:1px solid #d8dde3;border-radius:6px;';
var state = {
ctx: null,
intent: '',
request: '',
answers: {},
trigger: null,
open: false,
loaded: false,
keyboard: false,
share: false,
finDone: false,
failed: false,
written: '',
sentText: '',
sentMeta: null,
receivedText: '',
openedAt: 0,
renderedAt: 0,
watching: false,
bound: false
};
var ui = { panel: null, title: null, body: null, foot: null, focus: null };
var api = {};
function each(list, fn) {
var i;
for (i = 0; list.length > i; i++) { fn(list[i], i); }
}
function clean(value) {
return String(value === null || value === undefined ? '' : value).replace(/\s+/g, ' ').replace(/^ | $/g, '');
}
function attr(node, name) {
return node && node.getAttribute ? clean(node.getAttribute(name)) : '';
}
function make(tag, css, text) {
var node = D.createElement(tag);
if (css) { node.style.cssText = css; }
if (text) { node.appendChild(D.createTextNode(text)); }
return node;
}
function empty(node) {
while (node.firstChild) { node.removeChild(node.firstChild); }
}
function fire(node, type) {
var ev = D.createEvent('Event');
ev.initEvent(type, true, true);
node.dispatchEvent(ev);
}
function shown(node) {
return !!(node && node.getClientRects && node.getClientRects().length);
}
function wide() {
return W.matchMedia ? W.matchMedia('(min-width:768px)').matches : W.innerWidth >= 768;
}
function priceText(raw) {
return PRICE_RE.test(raw) ? raw : QUOTE;
}
function readContext(trigger) {
var nav = D.getElementById(NAV_ID);
var h1 = D.querySelector('h1');
var all = D.querySelectorAll('[data-gsha-product]');
var ctx = { type: attr(nav, 'data-gsha-page-type'), service: attr(nav, 'data-gsha-service'), product: '', brand: '', replacement: QUOTE, install: QUOTE };
var named = null;
var priced = null;
var names = [];
var node = trigger;
if (!ctx.service && h1) { ctx.service = clean(h1.textContent); }
while (node && node.nodeType === 1) {
if (node.hasAttribute('data-gsha-product')) {
if (!named) { named = node; }
if (!priced && node.hasAttribute('data-gsha-replacement')) { priced = node; }
}
node = node.parentNode;
}
if (!named) {
each(all, function (item) {
var name = attr(item, 'data-gsha-product');
if (name && names.indexOf(name) === -1) { names.push(name); }
});
if (names.length === 1) {
each(all, function (item) {
if (!named && attr(item, 'data-gsha-product') === names[0]) { named = item; }
});
}
}
if (named) {
ctx.product = attr(named, 'data-gsha-product');
if (priced && attr(priced, 'data-gsha-product') !== ctx.product) { priced = null; }
each(all, function (item) {
if (!priced && attr(item, 'data-gsha-product') === ctx.product && item.hasAttribute('data-gsha-replacement')) { priced = item; }
});
ctx.brand = attr(priced || named, 'data-gsha-brand');
ctx.replacement = priceText(attr(priced, 'data-gsha-replacement'));
ctx.install = priceText(attr(priced, 'data-gsha-new-installation'));
}
if (ctx.type !== 'product' && ctx.type !== 'service') { ctx.type = ctx.product ? 'product' : 'service'; }
return ctx;
}
function subject() {
return state.ctx.product || state.ctx.service || 'GSHA service request';
}
function topic() {
return state.ctx.product ? 'the ' + state.ctx.product : (state.ctx.service || 'this service');
}
function choices() {
return state.ctx.type === 'product' && state.ctx.product
? ['schedule-installation', 'estimate', 'financing', 'help-me-choose', 'talk-to-a-person']
: ['schedule-service', 'estimate', 'financing', 'talk-to-a-person'];
}
function save() {
var copy = {};
var text = state.answers.times || '';
each(ANSWER_KEYS, function (k) {
if (state.answers[k] !== undefined) { copy[k] = state.answers[k]; }
});
if (/@/.test(text) || text.replace(/[^0-9]/g, '').length >= 7) { delete copy.times; }
try {
W.sessionStorage.setItem(STORE_KEY, JSON.stringify({ v: 1, product: state.ctx.product, intent: state.intent, request: state.request, answers: copy }));
} catch (err) {}
}
function restore() {
var raw;
var data = null;
var kept = {};
try {
raw = W.sessionStorage.getItem(STORE_KEY);
data = raw ? JSON.parse(raw) : null;
} catch (err) { data = null; }
if (!data || data.v !== 1 || data.product !== state.ctx.product || !data.answers) { return; }
each(ANSWER_KEYS, function (k) {
var v = data.answers[k];
if (typeof v === 'string' && 120 >= v.length) { kept[k] = v; }
});
if (kept.zip !== undefined && !ZIP_RE.test(kept.zip)) { delete kept.zip; }
if (kept.scope !== undefined && !SCOPE_WORDS.hasOwnProperty(kept.scope)) { delete kept.scope; }
state.answers = kept;
if (LABELS.hasOwnProperty(data.intent)) { state.intent = data.intent; }
if (REQUESTS.indexOf(data.request) !== -1) { state.request = data.request; }
}
function requestIntent() {
return REQUESTS.indexOf(state.intent) !== -1 ? state.intent : state.request;
}
function plan() {
var a = state.answers;
var intent = state.intent;
if (intent === 'schedule-installation') {
return ['scope', 'zip', a.scope === 'replacement' ? 'existing' : 'heat', 'times', 'summary'];
}
if (intent === 'estimate') {
return ['estType'].concat(state.ctx.product ? ['scope'] : [], ['zip'], a.estType === 'visit' ? ['times'] : [], ['summary']);
}
if (intent === 'help-me-choose') { return ['duct', 'scope', 'size', 'zip', 'summary']; }
if (intent === 'schedule-service') { return ['symptom', 'zip', 'times', 'summary']; }
if (intent === 'talk-to-a-person') { return [state.share ? 'summary' : 'person']; }
return [intent];
}
function currentStep() {
var found = '';
each(plan(), function (k) {
if (!found && (END_STEPS.indexOf(k) !== -1 || state.answers[k] === undefined)) { found = k; }
});
return found;
}
function question(k) {
var c = state.ctx;
var bothQuoted = c.replacement === QUOTE && c.install === QUOTE;
if (k === 'scope' && state.intent === 'help-me-choose') {
return { text: 'Is this a first installation, or are you replacing a humidifier?', options: [['new', 'First installation'], ['replacement', 'Replacing a humidifier']] };
}
if (k === 'scope') {
return {
text: (state.intent === 'schedule-installation' ? 'You selected the ' + c.product + '. ' : '') + 'Are we replacing an existing humidifier or adding one for the first time?',
note: bothQuoted ? 'GSHA prepares a written quote for the ' + c.product + '.' : '',
options: [['replacement', 'Replacing an existing one - ' + c.replacement], ['new', 'First installation - ' + c.install]]
};
}
if (k === 'existing') { return { text: 'What humidifier is there now?', options: ['Same model', 'A different model', 'Not sure'] }; }
if (k === 'heat') { return { text: 'What heats the home?', options: ['Furnace with ductwork', 'Heat pump with ductwork', 'No ductwork or not sure'] }; }
if (k === 'estType') {
return { text: 'Would you like a written estimate for ' + topic() + ', or a visit so GSHA can look at it?', options: [['written', 'Written estimate'], ['visit', 'A visit to look at it']] };
}
if (k === 'duct') { return { text: 'Does your home have a forced-air furnace or air handler with ductwork?', options: ['Yes', 'No', 'I am not sure'] }; }
if (k === 'size') {
return { text: 'About how large is the home?', options: [['Under 2,000 square feet', 'Under 2,000 square feet'], ['2,000 to 4,000 square feet', '2,000 to 4,000'], ['Over 4,000 square feet', 'Over 4,000'], ['Not sure', 'Not sure']] };
}
return { text: 'What is the ' + (/furnace/i.test(c.service) ? 'furnace' : 'equipment') + ' doing now?', options: ['No heat', 'Heat comes and goes', 'Noise, smell or leak', 'Something else'] };
}
function detailLines() {
var a = state.answers;
var c = state.ctx;
var r = requestIntent();
var lines = [];
if (c.product && a.scope) {
lines.push('Job: ' + SCOPE_WORDS[a.scope]);
if (r !== 'help-me-choose') { lines.push('Price shown on the page: ' + (a.scope === 'replacement' ? c.replacement : c.install)); }
}
if (a.estType && r === 'estimate') { lines.push('Estimate: ' + (a.estType === 'visit' ? 'A visit to look at it' : 'Written estimate')); }
if (a.existing && a.scope === 'replacement') { lines.push('Humidifier there now: ' + a.existing); }
if (a.heat && a.scope === 'new') { lines.push('Heating: ' + a.heat); }
if (a.duct) { lines.push('Ductwork: ' + a.duct); }
if (a.size) { lines.push('Home size: ' + a.size); }
if (a.symptom) { lines.push('Problem: ' + a.symptom); }
if (a.zip) { lines.push('ZIP: ' + a.zip); }
if (a.times) { lines.push('Days and times: ' + a.times); }
return lines;
}
function summaryLines() {
var r = requestIntent();
var words = LABELS[r] || '';
var forWhat = subject();
if (state.intent === 'talk-to-a-person') { words = LABELS[state.intent] + (words ? ' about: ' + words : ''); }
if (r === 'help-me-choose' && state.ctx.product) { forWhat = 'Help choosing a humidifier (viewing the ' + state.ctx.product + ')'; }
return ['Request: ' + words, 'For: ' + forWhat].concat(detailLines(), ['Page: ' + W.location.pathname]);
}
function modalNode() {
return D.getElementById(MODAL_ID);
}
function formIsOpen() {
var modal = modalNode();
return !!modal && (' ' + modal.className + ' ').indexOf(' omw-open ') !== -1;
}
function notesField() {
var modal = modalNode();
var found = null;
if (modal) {
each(modal.getElementsByTagName('textarea'), function (item) {
if (!found && item.name === NOTES_NAME) { found = item; }
});
}
return found;
}
function writeSummary(field, text) {
var current = String(field.value || '');
var next;
if (current.indexOf(text) !== -1) { return; }
if (state.written && current.indexOf(state.written) !== -1) {
next = current.split(state.written).join(text);
} else {
next = current.replace(/\s+$/, '');
next = next ? next + '\n' + text : text;
}
field.value = next;
state.written = text;
fire(field, 'input');
fire(field, 'change');
}
function openForm() {
var link = D.getElementById(LINK_ID);
var modal = modalNode();
if (!link || !modal) { return false; }
if (!formIsOpen()) {
state.openedAt = new Date().getTime();
link.click();
}
if (!formIsOpen()) {
fire(link, 'init-omw-for-element');
link.click();
}
if (!formIsOpen()) { return false; }
if (!modal.hasAttribute('tabindex')) { modal.setAttribute('tabindex', '-1'); }
try { modal.focus(); } catch (err) {}
watchForm(modal);
return true;
}
function watchForm(modal) {
if (state.watching || !W.MutationObserver) { return; }
state.watching = true;
new W.MutationObserver(function () {
var active = D.activeElement;
if (formIsOpen() || !state.open) { return; }
if (!active || active === D.body || modal.contains(active)) { (ui.focus || ui.title).focus(); }
}).observe(modal, { attributes: true, attributeFilter: ['class'] });
}
function onFormSuccess(ev) {
var modal = modalNode();
var target = ev ? ev.target : null;
if (!modal || !target || !modal.contains(target)) { return; }
if (!state.sentText || state.receivedText === state.sentText) { return; }
state.receivedText = state.sentText;
try { W.sessionStorage.removeItem(STORE_KEY); } catch (err) {}
if (W.dataLayer && typeof W.dataLayer.push === 'function' && state.sentMeta) { W.dataLayer.push(state.sentMeta); }
if (state.open) { render(false); }
}
function bindSuccess() {
var jq = W['jQ' + 'uery'];
if (state.bound || !jq || !jq.fn) { return; }
state.bound = true;
jq(D).on(SUCCESS_EVENT, onFormSuccess);
}
function handOff() {
var text = summaryLines().join('\n');
var field = notesField();
state.failed = true;
if (field) {
writeSummary(field, text);
bindSuccess();
if (openForm()) {
state.failed = false;
state.sentText = text;
state.sentMeta = { event: 'gsha_assistant_request', intent: requestIntent() || state.intent, product_or_service: subject(), scope: state.answers.scope || '' };
}
}
render(state.failed);
}
function button(css, text, onPress) {
var node = make('button', css, text);
node.type = 'button';
node.addEventListener('click', onPress);
return node;
}
function link(text, href) {
var node = make('a', CSS_LINK, text);
node.href = href;
return node;
}
function say(css, text) {
var node = make('p', css, text);
ui.body.appendChild(node);
return node;
}
function lead(css, text) {
var node = say(css, text);
node.tabIndex = -1;
ui.focus = node;
return node;
}
function option(css, text, onPress) {
ui.body.appendChild(button(css, text, onPress));
}
function answer(k, value) {
state.answers[k] = value;
save();
render(true);
}
function go(intent) {
if (REQUESTS.indexOf(intent) !== -1) { state.request = intent; }
state.intent = intent;
state.share = false;
state.finDone = false;
state.failed = false;
save();
render(true);
}
function startOver() {
state.answers = {};
state.share = false;
state.finDone = false;
state.failed = false;
state.sentText = '';
state.receivedText = '';
save();
render(true);
}
function renderContext(step) {
var lines = ['For: ' + subject()];
var p;
if (step !== 'summary') {
ui.body.appendChild(make('div', CSS_BOX, lines.concat(step === 'menu' ? [] : detailLines()).join('\n')));
}
if (state.ctx.type === 'service' && state.intent === 'schedule-service') {
say(CSS_TEXT, 'If you smell gas or think there is carbon monoxide, leave the home and call your gas utility or 911 first.');
if (state.answers.symptom === 'No heat') {
p = say(CSS_TEXT, 'For an urgent no-heat call, phone ');
p.appendChild(link(PHONE_TEXT, PHONE_HREF));
p.appendChild(D.createTextNode('.'));
}
}
}
function renderOptions(k) {
var q = question(k);
lead(CSS_ASK, q.text);
if (q.note) { say(CSS_TEXT, q.note); }
each(q.options, function (item) {
var value = typeof item === 'string' ? item : item[0];
var text = typeof item === 'string' ? item : item[1];
option(CSS_OPTION, text, function () { answer(k, value); });
});
}
function renderZip() {
var id = PANEL_ID + '-zip';
var label = make('label', CSS_LABEL, 'What is the ZIP code for the work?');
var input = make('input', CSS_INPUT);
var error = make('p', CSS_ERROR, '');
var note;
function next() {
var value = clean(input.value);
if (!ZIP_RE.test(value)) {
empty(error);
error.appendChild(D.createTextNode('Enter a 5-digit ZIP code.'));
input.setAttribute('aria-invalid', 'true');
input.focus();
return;
}
answer('zip', value);
}
label.htmlFor = id;
input.id = id;
input.type = 'text';
input.maxLength = 5;
input.setAttribute('inputmode', 'numeric');
input.setAttribute('autocomplete', 'postal-code');
input.setAttribute('aria-describedby', id + '-error');
input.addEventListener('keydown', function (ev) { if (ev.key === 'Enter' || ev.keyCode === 13) { ev.preventDefault(); next(); } });
error.id = id + '-error';
error.setAttribute('role', 'alert');
ui.body.appendChild(label);
ui.body.appendChild(input);
ui.body.appendChild(error);
option(CSS_MAIN, 'Continue', next);
note = say(CSS_SMALL, 'GSHA confirms the address is in its service area. ');
note.appendChild(link('See the GSHA service area', URL_AREA));
ui.focus = input;
}
function renderTimes() {
var id = PANEL_ID + '-times';
var label = make('label', CSS_LABEL, 'Which days and times suit you? (optional)');
var input = make('input', CSS_INPUT);
function next() { answer('times', clean(input.value).slice(0, 120)); }
label.htmlFor = id;
input.id = id;
input.type = 'text';
input.maxLength = 120;
input.setAttribute('autocomplete', 'off');
input.addEventListener('keydown', function (ev) { if (ev.key === 'Enter' || ev.keyCode === 13) { ev.preventDefault(); next(); } });
ui.body.appendChild(label);
ui.body.appendChild(input);
option(CSS_MAIN, 'Continue', next);
option(CSS_PLAIN, 'Skip', function () { answer('times', ''); });
say(CSS_SMALL, 'Days and times only. Your contact details go in the GSHA form at the end.');
ui.focus = input;
}
function renderMenu() {
lead(CSS_ASK, 'What would you like to do?');
each(choices(), function (c) {
option(CSS_OPTION, LABELS[c], function () { go(c); });
});
}
function renderFinancing() {
var p = lead(CSS_TEXT, "GSHA's financing page shows the payment options and how to apply. ");
p.appendChild(link('See financing options', URL_FINANCING));
if (state.finDone) {
say(CSS_TEXT, 'Okay. You can pick another choice below or close this window.');
return;
}
say(CSS_ASK, 'Would you like a written estimate for this as well?');
option(CSS_OPTION, 'Yes', function () { state.answers.estType = 'written'; go('estimate'); });
option(CSS_OPTION, 'Back to my request', function () { go(state.request || 'menu'); });
option(CSS_OPTION, 'No thanks', function () { state.finDone = true; render(true); });
}
function renderPerson() {
var p;
lead(CSS_ASK, 'You can reach the GSHA team directly.');
p = say(CSS_TEXT, 'Call ');
p.appendChild(link(PHONE_TEXT, PHONE_HREF));
p = say(CSS_TEXT, '');
p.appendChild(link('GSHA contact page', URL_CONTACT));
option(CSS_OPTION, 'Send what I have so far to GSHA', function () { state.share = true; render(true); });
}
function renderSummary() {
var text = summaryLines().join('\n');
var c = state.ctx;
var a = state.answers;
var p;
if (state.receivedText === text) {
lead(CSS_ASK, 'Request received. GSHA will contact you to confirm the next step.');
ui.body.appendChild(make('div', CSS_BOX, text));
return;
}
if (state.sentText === text && !state.failed) {
lead(CSS_ASK, 'Your request is ready in the GSHA form. Add your contact details there and send the form.');
ui.body.appendChild(make('div', CSS_BOX, text));
option(CSS_PLAIN, 'Open the GSHA form', handOff);
return;
}
if (state.failed) {
p = lead(CSS_ASK, 'The GSHA form did not open on this page. Call ');
p.appendChild(link(PHONE_TEXT, PHONE_HREF));
p.appendChild(D.createTextNode(' or use the '));
p.appendChild(link('GSHA contact page', URL_CONTACT));
p.appendChild(D.createTextNode(' and mention the details below.'));
} else {
lead(CSS_ASK, 'Here is your request. Check it, then send it to GSHA.');
}
if (requestIntent() === 'help-me-choose') { say(CSS_TEXT, 'GSHA will recommend a model and price it.'); }
if (c.product && a.scope && requestIntent() !== 'help-me-choose' && (a.scope === 'replacement' ? c.replacement : c.install) === QUOTE) {
say(CSS_TEXT, 'GSHA prepares a written quote for the ' + c.product + '.');
}
ui.body.appendChild(make('div', CSS_BOX, text));
option(CSS_MAIN, 'Send my request to GSHA', handOff);
}
function renderFoot(step) {
var top = make('div', CSS_FOOT_TOP);
var row = make('div', 'margin:0;padding:0;');
var hasAnswers = false;
each(ANSWER_KEYS, function (k) { if (state.answers[k] !== undefined) { hasAnswers = true; } });
top.appendChild(make('span', '', step === 'menu' ? ' ' : 'Other choices'));
if (hasAnswers) { top.appendChild(button(CSS_RESET, 'Start over', startOver)); }
ui.foot.appendChild(top);
ui.foot.style.display = step === 'menu' && !hasAnswers && wide() ? 'none' : 'block';
if (step !== 'menu') {
each(choices(), function (c) {
if (c !== state.intent) { row.appendChild(button(CSS_CHIP, LABELS[c], function () { go(c); })); }
});
}
ui.foot.appendChild(row);
}
function layout() {
var view = W.visualViewport;
var height = view ? view.height : W.innerHeight;
var gap = view ? Math.max(0, Math.round(W.innerHeight - view.height - view.offsetTop)) : 0;
if (wide()) {
ui.panel.style.cssText = CSS_PANEL + CSS_PANEL_WIDE;
ui.foot.style.paddingRight = '16px';
ui.foot.style.minHeight = '0';
} else {
ui.panel.style.cssText = CSS_PANEL + CSS_PANEL_PHONE + 'bottom:' + gap + 'px;max-height:' + Math.round(height * 0.8) + 'px;';
ui.foot.style.paddingRight = '118px';
ui.foot.style.minHeight = '166px';
}
}
function render(moveFocus) {
var step = currentStep();
var slot;
layout();
empty(ui.body);
empty(ui.foot);
ui.focus = null;
renderContext(step);
if (step === 'menu') { renderMenu(); }
else if (step === 'financing') { renderFinancing(); }
else if (step === 'person') { renderPerson(); }
else if (step === 'summary') { renderSummary(); }
else if (step === 'zip') { renderZip(); }
else if (step === 'times') { renderTimes(); }
else { renderOptions(step); }
slot = make('div', '');
slot.setAttribute('data-gsha-assistant-slot', 'ask');
ui.body.appendChild(slot);
renderFoot(step);
ui.body.scrollTop = 0;
if (moveFocus && ui.focus) { ui.focus.focus(); }
state.renderedAt = new Date().getTime();
announce('gsha-assistant-render');
}
function publicState() {
var c = state.ctx || readContext(null);
var scope = state.answers.scope;
return {
open: state.open,
intent: LABELS.hasOwnProperty(state.intent) ? state.intent : null,
pageType: c.type,
product: c.product || null,
brand: c.brand || null,
service: c.type === 'service' ? (c.service || null) : null,
scope: scope === 'replacement' ? 'replacement' : (scope === 'new' ? 'new-installation' : null),
replacementPrice: c.product ? c.replacement : null,
newPrice: c.product ? c.install : null,
pagePath: W.location.pathname
};
}
function announce(name) {
var ev;
try {
ev = D.createEvent('CustomEvent');
ev.initCustomEvent(name, false, false, { panel: ui.panel, state: publicState() });
D.dispatchEvent(ev);
} catch (err) {}
}
function ring(node, on) {
if (!node || !node.style || node === ui.panel) { return; }
if (on) {
node.style.setProperty('outline', '3px solid ' + (node.getAttribute('data-gsha-ring') || '#151515'), 'important');
node.style.setProperty('outline-offset', '2px', 'important');
} else {
node.style.removeProperty('outline');
node.style.removeProperty('outline-offset');
}
}
function build() {
var head = make('div', CSS_HEAD);
var close = button(CSS_CLOSE, 'Close', function () { closePanel(); });
ui.panel = make('div', '');
ui.panel.id = PANEL_ID;
ui.panel.setAttribute('role', 'dialog');
ui.panel.setAttribute('aria-label', 'GSHA virtual assistant');
ui.title = make('h2', CSS_TITLE, 'GSHA virtual assistant');
ui.title.tabIndex = -1;
ui.title.setAttribute('data-gsha-ring', '#fff');
close.setAttribute('data-gsha-ring', '#fff');
ui.body = make('div', CSS_BODY);
ui.foot = make('div', CSS_FOOT);
head.appendChild(ui.title);
head.appendChild(close);
ui.panel.appendChild(head);
ui.panel.appendChild(ui.body);
ui.panel.appendChild(ui.foot);
ui.panel.addEventListener('click', function (ev) {
if (350 > new Date().getTime() - state.renderedAt) {
ev.preventDefault();
ev.stopPropagation();
}
}, true);
ui.panel.addEventListener('focusin', function (ev) {
var tag = ev.target.tagName;
if (state.keyboard || tag === 'INPUT') { ring(ev.target, true); }
});
ui.panel.addEventListener('focusout', function (ev) { ring(ev.target, false); });
D.body.appendChild(ui.panel);
}
function openPanel(intent, trigger) {
var ctx;
var nav = D.getElementById(NAV_ID);
if (intent !== 'menu' && !LABELS.hasOwnProperty(intent)) { return false; }
ctx = readContext(trigger);
if (state.ctx && state.ctx.product !== ctx.product) { state.answers = {}; state.request = ''; state.intent = ''; }
state.ctx = ctx;
if (!state.loaded) { state.loaded = true; restore(); }
if (intent === 'menu' && state.intent) { intent = state.intent; }
if (!ctx.product && (intent === 'schedule-installation' || intent === 'help-me-choose')) { intent = 'estimate'; }
if (REQUESTS.indexOf(intent) !== -1) { state.request = intent; }
state.intent = intent;
state.share = false;
state.finDone = false;
state.failed = false;
if (trigger) { state.trigger = trigger; }
if (!ui.panel) { build(); }
state.open = true;
if (nav) { nav.style.visibility = 'hidden'; }
save();
render(false);
ui.title.focus();
return true;
}
function closePanel() {
var nav = D.getElementById(NAV_ID);
var target = state.trigger;
if (!state.open) { return; }
state.open = false;
ui.panel.style.display = 'none';
if (nav) { nav.style.visibility = ''; }
if (!shown(target) && nav) {
target = null;
each(nav.getElementsByTagName('button'), function (item) { if (!target && shown(item)) { target = item; } });
}
if (target && target.focus) { target.focus(); }
announce('gsha-assistant-close');
}
function onKeyDown(ev) {
var active = D.activeElement;
state.keyboard = true;
if (!state.open || !(ev.key === 'Escape' || ev.key === 'Esc' || ev.keyCode === 27)) { return; }
if (formIsOpen()) { return; }
if (active && active !== D.body && !ui.panel.contains(active)) { return; }
closePanel();
}
function onPointer() {
state.keyboard = false;
}
function onResize() {
if (state.open) { layout(); }
}
function onEarlyFormClick(ev) {
var modal = modalNode();
var target = ev.target;
var name = target && typeof target.className === 'string' ? target.className : '';
if (700 > new Date().getTime() - state.openedAt && ((modal && modal.contains(target)) || name.indexOf('omw-modal-overlay') !== -1)) {
ev.preventDefault();
ev.stopPropagation();
}
}
api.open = function (intent, trigger) {
return openPanel(String(intent || ''), trigger || null);
};
api.close = function () {
closePanel();
};
api.getState = function () {
return publicState();
};
api.launch = function (control, ev) {
var intent = '';
var parent;
var opened = false;
try {
intent = control.getAttribute('data-gsha-launch') || '';
if (!intent && control.tagName === 'SUMMARY') {
parent = control.parentNode;
if (parent && parent.tagName === 'DETAILS') { intent = parent.getAttribute('data-gsha-intent') || ''; }
}
state.keyboard = !!ev && ev.detail === 0;
opened = api.open(intent, control);
} catch (err) { opened = false; }
if (opened && ev && ev.preventDefault) { ev.preventDefault(); }
return !opened;
};
D.addEventListener('keydown', onKeyDown, true);
D.addEventListener('mousedown', onPointer, true);
D.addEventListener('touchstart', onPointer, true);
D.addEventListener('click', onEarlyFormClick, true);
W.addEventListener('resize', onResize);
if (W.visualViewport && W.visualViewport.addEventListener) {
W.visualViewport.addEventListener('resize', onResize);
W.visualViewport.addEventListener('scroll', onResize);
}
if (D.getElementById(LINK_ID)) {
D.getElementById(LINK_ID).addEventListener('click', function (ev) {
if (!ev.defaultPrevented) { ev.preventDefault(); ev.stopPropagation(); }
});
}
W.GSHAAssistant = api;
return api;

