1/*! Zippykind LLC - Proprietary and confidential. Copyright (c) Zippykind LLC. All rights reserved. 2 * zk-signature: sha256=5a6972bcbcf26437d18f95df1e458d39cd061b94284f5ec4ba99d2e3ee4bfb9b file=zk-instant-demo.js by=Zippykind LLC 3 */ 4// fe-894 5;(function(){var s="Zippykind LLC|zk-signature|sha256=5a6972bcbcf26437d18f95df1e458d39cd061b94284f5ec4ba99d2e3ee4bfb9b|file=zk-instant-demo.js";return s;})(); 6(function (w, d) { 7 "use strict"; 8 9 var card = null; 10 var current = null; // fe-895 11 var hideTimer = 0; 12 var overCard = false; 13 14 function el() { 15 if (!card) { card = d.getElementById("zk-instant-capture"); } 16 return card; 17 } 18 19 // fe-896 20 function functionalOptedOut() { 21 return !!(w.ZKConsent && w.ZKConsent.optedOut("functional")); 22 } 23 24 function track(step, props) { 25 if (w.zkTrack) { try { w.zkTrack(step, props); } catch (e) {} } 26 } 27 28 // fe-897 29 function setLabel(btn, hovered) { 30 var main = btn.querySelector(".zk-idemo-main"); 31 var sub = btn.querySelector(".zk-idemo-sub"); 32 if (!main || !sub) { return; } 33 main.textContent = btn.getAttribute(hovered ? "data-idemo-hmain" : "data-idemo-main") || main.textContent; 34 sub.textContent = btn.getAttribute(hovered ? "data-idemo-hsub" : "data-idemo-sub") || sub.textContent; 35 } 36 37 // fe-898 38 function place(x, y) { 39 var c = el(); 40 if (!c) { return; } 41 var inner = c.firstElementChild; 42 var w0 = inner ? inner.offsetWidth : 372; 43 var h0 = inner ? inner.offsetHeight : 120; 44 // fe-899 45 var left = x + 5; 46 var top = y + 5; 47 if (left + w0 > w.innerWidth - 12) { left = x - w0 - 5; } 48 if (left < 12) { left = 12; } 49 if (top + h0 > w.innerHeight - 12) { top = y - h0 - 5; } 50 if (top < 12) { top = 12; } 51 c.style.left = left + "px"; 52 c.style.top = top + "px"; 53 } 54 55 function show(btn, x, y) { 56 var c = el(); 57 if (!c) { return; } 58 w.clearTimeout(hideTimer); 59 if (current !== btn) { 60 current = btn; 61 setLabel(btn, true); 62 track("qo_hover", { source: "instant_demo" }); 63 } 64 c.hidden = false; 65 place(x, y); 66 // fe-900 67 w.requestAnimationFrame(function () { c.classList.add("is-open"); }); 68 } 69 70 function hide() { 71 var c = el(); 72 if (!c) { return; } 73 c.classList.remove("is-open"); 74 if (current) { setLabel(current, false); } 75 current = null; 76 // fe-901 77 w.setTimeout(function () { 78 if (!current && c) { c.hidden = true; } 79 }, 200); 80 } 81 82 // fe-902 83 function scheduleHide() { 84 w.clearTimeout(hideTimer); 85 hideTimer = w.setTimeout(function () { 86 if (!overCard) { hide(); } 87 }, 400); // fe-903 88 } 89 90 // fe-904 91 var submitBusy = false; 92 93 // fe-905 94 function submit(e, opts) { 95 // fe-906 96 if (e && e.preventDefault) { e.preventDefault(); } 97 var c = el(); 98 if (!c) { return; } 99 var form = c.querySelector("[data-zk-instant-form]"); 100 var field = c.querySelector("[data-zk-instant-email]"); 101 var err = c.querySelector("[data-zk-instant-error]"); 102 var btn = form ? form.querySelector(".zkq-cap-go") : null; 103 var email = field ? String(field.value || "").trim() : ""; 104 if (err) { err.hidden = true; } 105 106 if (!email || email.indexOf("@") < 1) { 107 if (err) { err.textContent = "Please enter a valid email address."; err.hidden = false; } 108 if (field) { field.focus(); } 109 return; 110 } 111 112 // fe-907 113 var isResend = !!(opts && opts.resend); 114 var btnHTML = btn ? btn.innerHTML : ""; 115 if (!isResend) { 116 if (submitBusy) { return; } 117 submitBusy = true; 118 if (btn) { 119 btn.disabled = true; 120 btn.style.minWidth = btn.offsetWidth + "px"; 121 btn.innerHTML = '<i class="fas fa-spinner fa-spin" aria-hidden="true"></i> Sending...'; 122 } 123 } 124 function reenable() { 125 if (isResend) { return; } 126 submitBusy = false; 127 if (btn) { 128 btn.disabled = false; 129 btn.innerHTML = btnHTML; 130 btn.style.minWidth = ""; 131 } 132 } 133 134 var body = new FormData(form); 135 body.set("action", "quickOnboard"); 136 body.set("email", email); 137 // fe-908 138 if (opts && opts.resend) { 139 body.set("resend", "1"); 140 // fe-909 141 body.delete("cf-turnstile-response"); 142 } 143 144 track(opts && opts.resend ? "qo_resend" : "qo_submit", { source: "instant_demo" }); 145 146 w.fetch("/ajaxfront/quickOnboard", { 147 method: "POST", credentials: "same-origin", body: body 148 }).then(function (r) { return r.json(); }).then(function (j) { 149 // fe-910 150 if (!j || parseInt(j.code, 10) !== 1) {
151 if (err) { err.textContent = "Something went wrong. Please try again."; err.hidden = false; } 152 reenable(); 153 return; 154 } 155 var sent = c.querySelector("[data-zk-instant-sentto]"); 156 if (sent) { sent.textContent = email; } 157 var formView = c.querySelector('[data-zkq-view="form"]'); 158 var sentView = c.querySelector('[data-zkq-view="sent"]'); 159 if (formView) { formView.hidden = true; } 160 if (sentView) { sentView.hidden = false; } 161 track("qo_sent", { source: "instant_demo" }); 162 })["catch"](function () { 163 if (err) { err.textContent = "Something went wrong. Please try again."; err.hidden = false; } 164 reenable(); 165 }); 166 } 167 168 // fe-911 169 function init() { 170 if (functionalOptedOut()) { return; } 171 var buttons = d.querySelectorAll("[data-zk-instant-demo]"); 172 if (!buttons.length) { return; } 173 174 // fe-912 175 if (w.matchMedia && w.matchMedia("(hover: none)").matches) { return; } 176 177 Array.prototype.forEach.call(buttons, function (btn) { 178 btn.addEventListener("mouseenter", function (e) { show(btn, e.clientX, e.clientY); }); 179 btn.addEventListener("mousemove", function (e) { 180 if (current === btn && !overCard) { place(e.clientX, e.clientY); } 181 }); 182 btn.addEventListener("mouseleave", scheduleHide); 183 }); 184 185 var c = el(); 186 if (c) { 187 // fe-913 188 c.addEventListener("mouseenter", function () { overCard = true; w.clearTimeout(hideTimer); }); 189 c.addEventListener("mouseleave", function () { overCard = false; scheduleHide(); }); 190 var form = c.querySelector("[data-zk-instant-form]"); 191 if (form) { form.addEventListener("submit", submit); } 192 } 193 194 // fe-914 195 d.addEventListener("keydown", function (e) { 196 if (e.key === "Escape" && current) { overCard = false; hide(); } 197 }); 198 } 199 200 if (d.readyState === "loading") { 201 d.addEventListener("DOMContentLoaded", init); 202 } else { 203 init(); 204 } 205 206 // fe-915 207 document.addEventListener("click", function (ev) { 208 var link = ev.target && ev.target.closest ? ev.target.closest("[data-zk-instant-resend]") : null; 209 if (!link) { return; } 210 ev.preventDefault(); 211 if (link.getAttribute("data-busy") === "1") { return; } 212 link.setAttribute("data-busy", "1"); 213 link.style.opacity = "0.55"; 214 link.style.pointerEvents = "none"; 215 try { submit(null, { resend: true }); } catch (e) {} 216 var done = document.querySelector("[data-zk-instant-resent]"); 217 if (done) { done.hidden = false; } 218 setTimeout(function () { 219 link.removeAttribute("data-busy"); 220 link.style.opacity = ""; 221 link.style.pointerEvents = ""; 222 if (done) { done.hidden = true; } 223 }, 60000); 224 }); 225 226})(window, document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.