var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
(function () {
try {
var obj = {};
var result = Object.defineProperty(obj, "a", {
get: function () {
return 1;
}
});
if (result.a !== 1) {
throw new Error("fail");
}
}
catch (e) {
var isIE8 = false;
try {
var div = document.createElement("a");
isIE8 =
Object.defineProperty(div, "a", {
value: 1
}).a === 1;
}
catch (e) {
// ignore
}
var hasDp = "defineProperty" in Object;
if (!hasDp || isIE8) {
Object.defineProperty = function (object, property, descriptor) {
if (object === void 0) { object = {}; }
if (property === void 0) { property = "property"; }
if (descriptor === void 0) { descriptor = {}; }
if ("value" in descriptor) {
object[property] = descriptor.value;
}
else if ("get" in descriptor) {
object[property] = descriptor.get();
}
return object;
};
}
else {
var oldDp_1 = Object.defineProperty;
Object.defineProperty = function (object, property, descriptor) {
var descriptor2Use = descriptor;
if ("get" in descriptor) {
var value = descriptor.get();
delete descriptor.get;
descriptor2Use = __assign({}, descriptor, { value: value });
}
return oldDp_1(object, property, descriptor2Use);
};
}
}
})();
var __assign = this && this.__assign || function () { return (__assign = Object.assign || function (e) { for (var t, s = 1, r = arguments.length; s < r; s++)
for (var i in t = arguments[s])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }).apply(this, arguments); };
!function () { try {
if (1 !== Object.defineProperty({}, "a", { get: function () { return 1; } }).a)
throw new Error("fail");
}
catch (e) {
var t = !1;
try {
var s = document.createElement("a");
t = 1 === Object.defineProperty(s, "a", { value: 1 }).a;
}
catch (e) { }
if (!("defineProperty" in Object) || t)
Object.defineProperty = function (e, t, s) { return void 0 === e && (e = {}), void 0 === t && (t = "property"), void 0 === s && (s = {}), "value" in s ? e[t] = s.value : "get" in s && (e[t] = s.get()), e; };
else {
var n = Object.defineProperty;
Object.defineProperty = function (e, t, s) { var r = s; if ("get" in s) {
var i = s.get();
delete s.get, r = __assign({}, s, { value: i });
} return n(e, t, r); };
}
} }(), function (e, t) { "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.AddressFinder = t() : e.AddressFinder = t(); }(window, function () { return function (s) { var r = {}; function i(e) { if (r[e])
return r[e].exports; var t = r[e] = { i: e, l: !1, exports: {} }; return s[e].call(t.exports, t, t.exports, i), t.l = !0, t.exports; } return i.m = s, i.c = r, i.d = function (e, t, s) { i.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: s }); }, i.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }, i.t = function (t, e) { if (1 & e && (t = i(t)), 8 & e)
return t; if (4 & e && "object" == typeof t && t && t.__esModule)
return t; var s = Object.create(null); if (i.r(s), Object.defineProperty(s, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t)
for (var r in t)
i.d(s, r, function (e) { return t[e]; }.bind(null, r)); return s; }, i.n = function (e) { var t = e && e.__esModule ? function () { return e["default"]; } : function () { return e; }; return i.d(t, "a", t), t; }, i.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }, i.p = "", i(i.s = 10); }([, function (module, exports) { window.JSON || (window.JSON = { parse: function (sJSON) { return eval("(" + sJSON + ")"); } }); }, , , function (e, t, r) { var n; (function () { var o = [].slice, a = function (e, t) { return function () { return e.apply(t, arguments); }; }, s = function (e, t) { for (var s in t)
i.call(t, s) && (e[s] = t[s]); function r() { this.constructor = e; } return r.prototype = t.prototype, e.prototype = new r, e.__super__ = t.prototype, e; }, i = {}.hasOwnProperty; void 0 === (n = function () { return (n = { VERSION: "1.6.1", addDomEvent: function (e, t, s) { var r; return e.addEventListener ? e.addEventListener(t, s, !1) : (r = function () { return s.apply(e, arguments); }, e.attachEvent("on" + t, r)); }, removeDomEvent: function (e, t, s) { e.removeEventListener ? e.removeEventListener(t, s, !1) : e.detachEvent && e.detachEvent("on" + t, null); } }).addClass = function (e, t) { return n.classNameExists(e, t) || (t = " " + t, e.className += t), e; }, n.removeClass = function (e, t) { var s, r, i, n, o; for (o = [], i = 0, n = (r = e.className.split(" ")).length; i < n; i++)
(s = r[i]) !== t && o.push(s); return e.className = o.join(" "), e; }, n.classNameExists = function (e, t) { var s, r, i; for (r = 0, i = (s = e.className.split(" ")).length; r < i; r++)
if (s[r] === t)
return !0; return !1; }, Array.prototype.indexOf || (Array.prototype.indexOf = function (e) { var t, s, r, i; if (null == this)
throw new TypeError; if (i = Object(this), 0 == (s = i.length >>> 0))
return -1; if ((r = 0) < arguments.length && ((r = Number(arguments[1])) != r ? r = 0 : 0 !== r && Infinity !== r && -Infinity !== r && (r = (0 < r || -1) * Math.floor(Math.abs(r)))), s <= r)
return -1; for (t = 0 <= r ? r : Math.max(s - Math.abs(r), 0); t < s;) {
if (t in i && i[t] === e)
return t;
t++;
} return -1; }), n.Dispatch = function () { function e() { } return e.prototype.setOption = function (e, t) { return this.options[e] = t, this; }, e.prototype.getOption = function (e) { return this.options[e]; }, e.prototype.on = function (e, t) { var s; return null == this.subs && (this.subs = {}), null == (s = this.subs)[e] && (s[e] = []), this.subs[e].push(t), this; }, e.prototype.trigger = function () { var e, t, s, r, i, n; if (t = arguments[0], e = 2 <= arguments.length ? o.call(arguments, 1) : [], null != (null != (i = this.subs) ? i[t] : void 0))
for (s = 0, r = (n = this.subs[t]).length; s < r; s++)
n[s].apply(this, e); return this; }, e; }(), n.Widget = function (e) { function t(e, t) { this.element = e, this.options = null != t ? t : {}, this._onPaste = a(this._onPaste, this), this._onBlur = a(this._onBlur, this), this._onKeyDown = a(this._onKeyDown, this), this._onKeyPress = a(this._onKeyPress, this), this._onFocus = a(this._onFocus, this), this._triggerEnabledEvent = a(this._triggerEnabledEvent, this), this.enable = a(this.enable, this), this.disable = a(this.disable, this), this.enable(), this.searchQueued = !1, this.element.getAttribute("autocomplete") || this.element.setAttribute("autocomplete", "off"), this.services = [], this._applyDefaults(), null == this.getOption("container") && this.setOption("container", window.document.body), this._addListeners(), this.output = document.createElement("ul"), this.output.className = this.options.list_class, this._applyStyle("display", "none"), this._applyStyle("position", this.options.position), this.options.container.appendChild(this.output); } return s(t, e), t.prototype.defaults = { max_results: 10, list_class: "nc_list", item_class: "nc_item", hover_class: "nc_hover", footer_class: "nc_footer", empty_class: "nc_empty", error_class: "nc_error", icon_class: "nc_icon", hidden_icon_class: "nc_hidden", position: "absolute", timeout: 400, ignore_returns: !0 }, t.prototype.addService = function (e, t, s) { var r; return null == s && (s = {}), this.services.push(r = new n.Service(this, e, t, s)), r; }, t.prototype.disable = function () { return this.enabled = !1, this.icon && n.addClass(this.icon, this.options.hidden_icon_class), this.output.innerHTML = "", n.removeDomEvent(this.element, "enabled", this.disable), this; }, t.prototype.enable = function () { return this.enabled = !0, this.icon && n.removeClass(this.icon, this.options.hidden_icon_class), this.enableDelay && clearTimeout(this.enableDelay), this.enableDelay = setTimeout(this._triggerEnabledEvent, 500), this; }, t.prototype.destroy = function () { document.body.removeChild(this.output), this.element.removeAttribute("autocomplete"), this.icon && (document.body.removeChild(this.icon), window.removeEventListener("resize", this._resetIconPosition)); }, t.prototype._triggerEnabledEvent = function () { if (this.enabled)
return n.removeDomEvent(this.element, "enabled", this.disable), this._dispatchDOMEvent("enabled"), n.addDomEvent(this.element, "enabled", this.disable); }, t.prototype._applyDefaults = function () { var e, t, s, r; for (e in s = [], t = this.defaults)
r = t[e], null == this.getOption(e) ? s.push(this.setOption(e, r)) : s.push(void 0); return s; }, t.prototype._addListeners = function () { return n.addDomEvent(this.element, "focus", this._onFocus), n.addDomEvent(this.element, "keypress", this._onKeyPress), n.addDomEvent(this.element, "keydown", this._onKeyDown), n.addDomEvent(this.element, "blur", this._onBlur), n.addDomEvent(this.element, "paste", this._onPaste); }, t.prototype._removeListeners = function () { return n.removeDomEvent(this.element, "focus", this._onFocus), n.removeDomEvent(this.element, "keypress", this._onKeyPress), n.removeDomEvent(this.element, "keydown", this._onKeyDown), n.removeDomEvent(this.element, "blur", this._onBlur), n.removeDomEvent(this.element, "paste", this._onPaste); }, t.prototype._onFocus = function (e) { return this.focused = !0; }, t.prototype._onKeyPress = function (e) { var t, s, r; if (s = e.which || e.keyCode, this.visible && 13 === s)
return null != (r = this.highlighted) && r.selectItem(), (t = this.getOption("ignore_returns")) && e.preventDefault ? e.preventDefault() : t && (e.returnValue = !1), this.highlighted = null; }, t.prototype._onKeyDown = function (e) { var t; switch (e.which || e.keyCode) {
case 38: return this.visible && this._moveHighlight(-1), !1;
case 40: return this.visible && this._moveHighlight(1), !1;
case 9:
if (this.visible)
return null != (t = this.highlighted) ? t.selectItem() : void 0;
break;
case 27: return this._hideResults();
case 37:
case 39:
case 13: break;
default: return this._getSuggestionsWithTimeout();
} }, t.prototype._onBlur = function (e) { if (!this.mouseDownOnSelect)
return this.focused = !1, this._hideResults(); }, t.prototype._onPaste = function (e) { return this._getSuggestionsWithTimeout(); }, t.prototype._moveHighlight = function (e) { var t, s, r, i; return t = null != this.highlighted ? this.results.indexOf(this.highlighted) : -1, null != (r = this.highlighted) && r.unhighlight(), (t += e) < -1 ? t = this.results.length - 1 : t >= this.results.length && (t = -1), null != (i = this.results[t]) && i.highlight(), s = void 0 !== this._val ? this._val : "", this.element.value = null != this.highlighted ? this.highlighted.value : s; }, t.prototype._getSuggestionsWithTimeout = function () { return null != this._timeout && clearTimeout(this._timeout), this._timeout = setTimeout((e = this, function () { return e._getSuggestions(); }), this.options.timeout); var e; }, t.prototype._getSuggestions = function () { var e, t, s, r, i; if (this.enabled) {
if (this._servicesReady()) {
if (this._val = this.element.value, this.error_content = null, "" === this._val)
return this._hideResults();
for (r = [], e = 0, t = (s = this.services).length; e < t; e++)
i = s[e], r.push(i.search(this._val));
return r;
}
this.searchQueued = !0;
} }, t.prototype._applyStyle = function (e, t) { return this.output.style[e] = t; }, t.prototype._getVerticalOffset = function () { return window.pageYOffset || document.documentElement && document.documentElement.scrollTop; }, t.prototype._getPosition = function () { var e; return e = this.element, { top: this._getVerticalOffset() + e.getBoundingClientRect().top + e.offsetHeight, left: e.getBoundingClientRect().left }; }, t.prototype._hideResults = function () { var e, t, s, r, i; for (this.visible = !1, this._applyStyle("display", "none"), this.results = [], r = [], e = 0, t = (s = this.services).length; e < t; e++)
i = s[e], r.push(i.results = []); return r; }, t.prototype._displayResults = function () { var e; return this.visible = !0, e = this._getPosition(), this.options.container === document.body && (this._applyStyle("left", e.left + "px"), this._applyStyle("top", e.top + "px")), this._applyStyle("display", "block"); }, t.prototype._renderItem = function (e, t) { var s, r, i; return (s = document.createElement("li")).innerHTML = e, null != t && (s.className = t), n.addDomEvent(s, "mousedown", (r = this, function () { return r.mouseDownOnSelect = !0; })), n.addDomEvent(s, "mouseup", (i = this, function () { return i.mouseDownOnSelect = !1; })), s; }, t.prototype._renderFooter = function () { return this._renderItem(this.options.footer_content, this.options.footer_class); }, t.prototype._renderEmpty = function () { return this._renderItem(this.options.empty_content, this.options.empty_class); }, t.prototype._servicesReady = function () { var e, t, s, r, i; for (i = [], e = 0, t = (s = this.services).length; e < t; e++)
r = s[e], i.push(r.ready()); return i.indexOf(!1) < 0; }, t.prototype.showResults = function () { var e, t, s, r, i, n, o, a, l; if (this._servicesReady()) {
for (this.searchQueued && (this._getSuggestions(), this.searchQueued = !1), this.results = [], this.output.innerHTML = "", t = 0, r = (n = this.services).length; t < r; t++)
l = n[t], this.results = this.results.concat(l.results);
if (this.results.length) {
for (this.results = this.results.sort(function (e, t) { return t.score - e.score; }), this.results = this.results.slice(0, +(this.getOption("max_results") - 1) + 1 || 9e9), s = 0, i = (o = this.results).length; s < i; s++)
a = o[s], this.output.appendChild(a.render());
null != this.options.footer_content && "" !== (e = this._renderFooter()) && this.output.appendChild(e), this._displayResults();
}
else
this.error_content ? (this.output.appendChild(this._renderItem(this.error_content, this.options.error_class)), this._displayResults()) : (null != this.options.empty_content ? (this.output.appendChild(this._renderEmpty()), this._displayResults()) : this._hideResults(), this.trigger("results:empty"));
this.trigger("results:update");
} }, t.prototype.selectHighlighted = function () { this.element.value = this.highlighted.value, this._hideResults(), this.trigger("result:select", this.highlighted.value, this.highlighted.data), this._dispatchDOMEvent("change"); }, t.prototype._dispatchDOMEvent = function (e) { var t; if ("function" == typeof Event)
t = new Event(e, { bubbles: !0, cancellable: !0 });
else {
if (void 0 === document.createEvent)
return;
(t = document.createEvent("Event")).initEvent(e, !0, !0);
} return this.element.dispatchEvent(t); }, t.prototype.setIcon = function (e, t) { var s, r, i; return this.removeIcon(e), r = e["class"] || "nc_icon", s = document.createElement("a"), n.addClass(s, r), i = this._calculateIconPosition(), s.style.top = i.coords.top + "px", s.style.left = i.coords.left + "px", s.style.height = i.size + "px", s.style.width = i.size + "px", s.addEventListener("click", t), this._resetIconPosition = this.setIcon.bind(this, e, t), window.addEventListener("resize", this._resetIconPosition), this.options.container.appendChild(s), this.icon = s; }, t.prototype.removeIcon = function (e) { return this.icon && (this.icon.parentNode.removeChild(this.icon), window.removeEventListener("resize", this._resetIconPosition)), this.icon = null; }, t.prototype._calculateIconPosition = function () { var e, t, s, r; return r = this.element.offsetWidth, e = (t = this.element.offsetHeight / 2) / 2.4, { coords: { top: (s = this._getPosition()).top - t - e, left: s.left + r - t - e }, size: t }; }, t.prototype.setInfoPanel = function (e, t) { var s, r; return s = (t = t || {})["class"] || "af_info_panel", !1 === t.persistant ? (this.output.innerHTML = "", r = this._renderItem(e, s), t.cancellable && this._addCancelButton(r, t), this.output.appendChild(r), this._displayResults()) : (this.infoPanel = {}, this.infoPanel.content = e, this.infoPanel.options = t); }, t.prototype._addCancelButton = function (e, t) { var s, r, i; return s = -1 < (i = navigator.userAgent).indexOf("MSIE ") || -1 < i.indexOf("Trident/"), r = document.createElement("span"), n.addClass(r, "cancel_button"), s && n.addClass(r, "IE"), r.addEventListener("click", function () { return this.output.innerHTML = "", t.cancelHandler(); }.bind(this)), e.appendChild(r); }, t; }(n.Dispatch), n.Service = function (e) { function t(e, t, s, r) { var i; this.widget = e, this.name = t, this.search_fn = s, this.options = null != r ? r : {}, this._response = a(this._response, this), this.ready = a(this.ready, this), this.results = [], this._ready = !0, this.response = (i = this, function (e, t) { return i._response.apply(i, arguments); }); } return s(t, e), t.prototype.ready = function () { return this._ready; }, t.prototype.search = function (e) { return this.last_query = e, this._ready = !1, this.search_fn(e, this.response); }, t.prototype._response = function (e, t) { var s, r, i; if (this.results = [], this.last_query === e) {
for (this.results = [], r = 0, i = t.length; r < i; r++)
s = t[r], this.results.push(new n._Result(this, s));
return this._ready = !0, this.widget.showResults();
} }, t; }(n.Dispatch), n._Result = function () { function e(e, t) { var s, r, i, n; this.service = e, this.options = t, this.widget = this.service.widget, this.renderer = this.service.options.renderer || this.widget.options.renderer, this.value = null != (s = this.options) ? s.value : void 0, this.score = (null != (r = this.options) ? r.score : void 0) || 0, this.identifier = null != (i = this.options) ? i.identifier : void 0, this.data = (null != (n = this.options) ? n.data : void 0) || {}; } return e.prototype.render = function () { return this.li = document.createElement("li"), this.li.innerHTML = null != this.renderer ? this.renderer(this.value, this.data) : this.value, this.li.className = this.widget.options.item_class, this.addEvents(), this.li; }, e.prototype.addEvents = function () { var t, e, s, r, i; return n.addDomEvent(this.li, "click", (t = this, function (e) { return t.selectItem(), e.preventDefault ? e.preventDefault() : e.returnValue = !1; })), n.addDomEvent(this.li, "mouseover", (e = this, function () { return e.highlight(); })), n.addDomEvent(this.li, "mouseout", (s = this, function () { return s.unhighlight(); })), n.addDomEvent(this.li, "mousedown", (r = this, function () { return r.widget.mouseDownOnSelect = !0; })), n.addDomEvent(this.li, "mouseup", (i = this, function () { return i.widget.mouseDownOnSelect = !1; })); }, e.prototype.selectItem = function () { return this.service.trigger("result:select", this.value, this.data), (this.widget.highlighted = this).widget.selectHighlighted(); }, e.prototype.highlight = function () { var e; return null != (e = this.widget.highlighted) && e.unhighlight(), this.li.className = this.li.className + " " + this.widget.options.hover_class, this.widget.highlighted = this; }, e.prototype.unhighlight = function () { return this.widget.highlighted = null, this.li.className = this.li.className.replace(new RegExp(this.widget.options.hover_class, "gi"), ""); }, e; }(), n; var n; }.call(t, r, t, e)) || (e.exports = n); }).call(this); }, , , , function (module, __webpack_exports__, __webpack_require__) {
"use strict";
var reqwest_v1_reqwest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9), reqwest_v1_reqwest__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(reqwest_v1_reqwest__WEBPACK_IMPORTED_MODULE_0__), neat_complete_v1_6_neat_complete__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4), neat_complete_v1_6_neat_complete__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(neat_complete_v1_6_neat_complete__WEBPACK_IMPORTED_MODULE_1__), _style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11), _style__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_style__WEBPACK_IMPORTED_MODULE_2__), AddressFinder, bind = function (e, t) { return function () { return e.apply(t, arguments); }; }, extend = function (e, t) { for (var s in t)
hasProp.call(t, s) && (e[s] = t[s]); function r() { this.constructor = e; } return r.prototype = t.prototype, e.prototype = new r, e.__super__ = t.prototype, e; }, hasProp = {}.hasOwnProperty;
__webpack_exports__.a = AddressFinder = function () { return AddressFinder = { SERVER: "https://api.addressfinder.io", BROCHURE: "https://addressfinder.nz", CSS: "/assets/v2.css", VERSION: "15.32.1", WIDGET_VERSION: "2.8.2", MIN_SEARCH_CHARS: "3", MAX_QUERY_TIME: "3000", KEYPRESS_INTERVAL: "200", objParams: function (t) { var s, r; return function () { var e; for (s in e = [], t)
r = t[s], e.push(s + "=" + r); return e; }().join("&"); }, executeCallback: function () { var afScript, callback_name, i, len, regex, script, scripts; for (scripts = document.getElementsByTagName("script"), regex = /\/assets\/v2\/widget/gi, i = 0, len = scripts.length; i < len; i++)
if (script = scripts[i], regex.test(script.src)) {
afScript = script;
break;
} if (null != afScript && (callback_name = afScript.getAttribute("data-callback"), null != callback_name))
return eval("window." + callback_name + "()"); } }, AddressFinder.Widget = function (e) { function c(e, t, s) { var r, i, n, o, a, l, u; (this.element = e, this.api_key = t, this.options = null != s ? s : {}, this._generateFooter = bind(this._generateFooter, this), this.checkSuppliedParameters = bind(this.checkSuppliedParameters, this), this.checkSuppliedParameters()) && (c.__super__.constructor.call(this, this.element, this.options), this.paid = !0, this.reqwest = reqwest_v1_reqwest__WEBPACK_IMPORTED_MODULE_0___default.a, this.options.manual_style || this._addCSS(), this._generateFooter(), this._applyStyle("position", this.options.position), this.country = new AddressFinder.Country(this.options.country_code), n = { renderer: this.options.renderer }, (r = new AddressFinder._AddressService(this, n)).on("result:select:pre", (o = this, function (e, t) { return o.trigger("address:select:pre", e, t); })), r.on("result:select", (a = this, function (e, t) { return a.trigger("address:select", e, t); })), (i = new AddressFinder._LocationService(this, n)).on("result:select:pre", (l = this, function (e, t) { return l.trigger("location:select:pre", e, t); })), i.on("result:select", (u = this, function (e, t) { return u.trigger("location:select", e, t); })), this.services.push(r), this.services.push(i)); } return extend(c, e), c.prototype.defaults = { max_results: 10, list_class: "af_list", item_class: "af_item", hover_class: "af_hover", footer_class: "af_footer", empty_class: "af_empty", error_class: "af_error", manual_style: !1, show_addresses: !0, show_locations: !0, position: "absolute", ignore_returns: !0, timeout: AddressFinder.KEYPRESS_INTERVAL }, c.prototype.checkSuppliedParameters = function () { return this.element ? this.api_key ? !("container" in this.options && !this.options.container) || (this.logError("Option 'container' was supplied, but the value is null. Check your call to the AddressFinder.Widget constructor."), !1) : (this.logError("Parameter api_key was null. Check your call to the AddressFinder.Widget constructor."), !1) : (this.logError("Input element was null. Check your call to the AddressFinder.Widget constructor."), !1); }, c.prototype.logError = function (e) { return "undefined" != typeof console && null !== console ? console.error(e) : void 0; }, c.prototype.addService = function (e, t, s) { var r; return null == s && (s = {}), this.services.push(r = new AddressFinder.Service(this, e, t, s)), r; }, c.prototype.showResults = function () { var e; return (e = this.options).footer_content || (e.footer_content = ""), c.__super__.showResults.apply(this, arguments); }, c.prototype._addCSS = function () { var e; return (e = document.createElement("link")).type = "text/css", e.rel = "stylesheet", e.href = AddressFinder.SERVER + AddressFinder.CSS, e.media = "screen", null != document.createStyleSheet ? document.createStyleSheet(AddressFinder.SERVER + AddressFinder.CSS) : document.getElementsByTagName("head")[0].appendChild(e); }, c.prototype._generateFooter = function () { return this._random_byline_url = AddressFinder.BROCHURE, this._byline_content = "Powered by Addressfinder. Free trials available"; }, c.prototype._renderFooter = function () { var e; return this.demo ? ((e = this._renderItem("You are using the Addressfinder demo key Free trials available. ")).style.cssText = "background-color: #F0F0F0; padding: 15px; text-align: center;font-family:sans-serif;line-height:1.4;min-width:250px;display:block !important;visibility: visible !important; opacity: 1 !important; height: auto !important;", e) : this.paid ? this.options.footer_content ? this._renderItem(this.options.footer_content, this.options.footer_class) : this.options.byline ? ((e = this._renderItem("Powered by Addressfinder", this.options.footer_class)).style.cssText = "display: block !important; visibility: visible !important; opacity: 1 !important; height: auto !important;", e) : "" : ((e = this._renderItem(this._byline_content, this.options.footer_class)).style.cssText = "display: block !important; visibility: visible !important; opacity: 1 !important; height: auto !important;", e); }, c; }(neat_complete_v1_6_neat_complete__WEBPACK_IMPORTED_MODULE_1___default.a.Widget), AddressFinder.Service = function (e) { function t() { return t.__super__.constructor.apply(this, arguments); } return extend(t, e), t; }(neat_complete_v1_6_neat_complete__WEBPACK_IMPORTED_MODULE_1___default.a.Service), AddressFinder.Country = function () { function e(e) { this.country_code = e, this.id_attribute = bind(this.id_attribute, this), this.namespace = bind(this.namespace, this); } return e.prototype.namespace = function () { switch (this.country_code) {
case "AU":
case "au": return "api/au";
default: return "api";
} }, e.prototype.id_attribute = function () { switch (this.country_code) {
case "AU":
case "au": return "id";
default: return "pxid";
} }, e; }(), AddressFinder._AFService = function (e) { function t(e, t) { this.widget = e, this.options = null != t ? t : {}, this._unlockSearchRequests = bind(this._unlockSearchRequests, this), this._lockSearchRequests = bind(this._lockSearchRequests, this), this.ready = bind(this.ready, this), this.results = [], this._ready = !0, this._resume_requests_timer = null; } return extend(t, e), t.prototype.ready = function () { return this._ready; }, t.prototype._lockSearchRequests = function () { return this._ready = !1, this._resume_requests_timer = setTimeout((e = this, function () { return e._ready = !0; }), AddressFinder.MAX_QUERY_TIME); var e; }, t.prototype._unlockSearchRequests = function () { return null != this._resume_requests_timer && clearTimeout(this._resume_requests_timer), this._ready = !0; }, t.prototype.search = function (e) { var t, n; if (this.performSearch() && e.length >= AddressFinder.MIN_SEARCH_CHARS)
return this.widget.error = null, this.last_query = e, this._lockSearchRequests(), t = AddressFinder.objParams({ q: encodeURIComponent(e), key: this.widget.api_key, format: "json", max: this.widget.options.max_results, wv: AddressFinder.WIDGET_VERSION }), this.extraParams() && (t += "&" + this.extraParams()), this.widget.reqwest({ url: AddressFinder.SERVER + "/" + this.widget.country.namespace() + "/" + this.search_type + "?" + t, type: "jsonp", jsonpCallback: "callback", method: "get", success: (n = this, function (e) { var t, s, r, i; for (n.results = [], t = 0, s = (r = e.completions.slice(0, +n.widget.options.max_results + 1 || 9e9)).length; t < s; t++)
i = r[t], n.results.push(new AddressFinder._Result(n, { value: i.a || i.full_address, score: n.sort_value, data: i })); return n.widget.paid = e.paid, null != e.error_code && (n.widget.error_content = "Error: " + e.message + ""), n._unlockSearchRequests(), n.widget.showResults(); }) }); }, t; }(neat_complete_v1_6_neat_complete__WEBPACK_IMPORTED_MODULE_1___default.a.Dispatch), AddressFinder._AddressService = function (e) { function t() { return t.__super__.constructor.apply(this, arguments); } return extend(t, e), t.prototype.search_type = "address", t.prototype.sort_value = -10, t.prototype.performSearch = function () { return this.widget.getOption("show_addresses"); }, t.prototype.extraParams = function () { if (null != this.widget.getOption("address_params"))
return AddressFinder.objParams(this.widget.getOption("address_params")); }, t; }(AddressFinder._AFService), AddressFinder._LocationService = function (e) { function t() { return t.__super__.constructor.apply(this, arguments); } return extend(t, e), t.prototype.search_type = "location", t.prototype.sort_value = -1, t.prototype.performSearch = function () { return this.widget.getOption("show_locations"); }, t.prototype.extraParams = function () { if (null != this.widget.getOption("location_params"))
return AddressFinder.objParams(this.widget.getOption("location_params")); }, t; }(AddressFinder._AFService), AddressFinder._Result = function (e) { function t() { return t.__super__.constructor.apply(this, arguments); } return extend(t, e), t.prototype.selectItem = function () { var e, t; if (null != this.data && (null != this.data.pxid || null != this.data.id) && !this.widget.info_loading)
return this.widget.info_loading = !0, this.service.trigger("result:select:pre", this.value, this.data), (e = { format: "json", key: this.widget.api_key, wv: AddressFinder.WIDGET_VERSION })[this.widget.country.id_attribute()] = this.data.pxid || this.data.id, this.widget.reqwest({ url: AddressFinder.SERVER + "/" + this.widget.country.namespace() + "/" + this.service.search_type + "/metadata", data: e, type: "jsonp", jsonpCallback: "callback", success: (t = this, function (e) { return t.data = e, t.service.trigger("result:select", t.value, t.data), (t.widget.highlighted = t).widget.selectHighlighted(), t.widget.info_loading = !1, t.widget.highlighted = null; }) }); }, t; }(neat_complete_v1_6_neat_complete__WEBPACK_IMPORTED_MODULE_1___default.a._Result), AddressFinder; }(), AddressFinder.executeCallback();
}, function (module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__, ue; ue = function () { var win = window, doc = document, httpsRe = /^http/, protocolRe = /(^\w+):\/\//, twoHundo = /^(20\d|1223)$/, byTag = "getElementsByTagName", readyState = "readyState", contentType = "Content-Type", requestedWith = "X-Requested-With", head = doc[byTag]("head")[0], uniqid = 0, callbackPrefix = "reqwest_" + +new Date, lastValue, xmlHttpRequest = "XMLHttpRequest", xDomainRequest = "XDomainRequest", noop = function () { }, isArray = "function" == typeof Array.isArray ? Array.isArray : function (e) { return e instanceof Array; }, defaultHeaders = { contentType: "application/x-www-form-urlencoded", requestedWith: xmlHttpRequest, accept: { "*": "text/javascript, text/html, application/xml, text/xml, */*", xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", js: "application/javascript, text/javascript" } }, xhr = function (e) { if (!0 !== e.crossOrigin)
return win[xmlHttpRequest] ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"); var t = win[xmlHttpRequest] ? new XMLHttpRequest : null; if (t && "withCredentials" in t)
return t; if (win[xDomainRequest])
return new XDomainRequest; throw new Error("Browser does not support cross-origin requests"); }, globalSetupOptions = { dataFilter: function (e) { return e; } }; function succeed(e) { var t = protocolRe.exec(e.url); return t = t && t[1] || window.location.protocol, httpsRe.test(t) ? twoHundo.test(e.request.status) : !!e.request.response; } function handleReadyState(e, t, s) { return function () { return e._aborted ? s(e.request) : e._timedOut ? s(e.request, "Request is aborted: timeout") : void (e.request && 4 == e.request[readyState] && (e.request.onreadystatechange = noop, succeed(e) ? t(e.request) : s(e.request))); }; } function setHeaders(e, t) { var s, r = t.headers || {}; r.Accept = r.Accept || defaultHeaders.accept[t.type] || defaultHeaders.accept["*"]; var i = "function" == typeof FormData && t.data instanceof FormData; for (s in t.crossOrigin || r[requestedWith] || (r[requestedWith] = defaultHeaders.requestedWith), r[contentType] || i || (r[contentType] = t.contentType || defaultHeaders.contentType), r)
r.hasOwnProperty(s) && "setRequestHeader" in e && e.setRequestHeader(s, r[s]); } function setCredentials(e, t) { void 0 !== t.withCredentials && void 0 !== e.withCredentials && (e.withCredentials = !!t.withCredentials); } function generalCallback(e) { lastValue = e; } function urlappend(e, t) { return e + (/\?/.test(e) ? "&" : "?") + t; } function handleJsonp(e, t, s, r) { var i = uniqid++, n = e.jsonpCallback || "callback", o = e.jsonpCallbackName || reqwest.getcallbackPrefix(i), a = new RegExp("((^|\\?|&)" + n + ")=([^&]+)"), l = r.match(a), u = doc.createElement("script"), c = 0, d = -1 !== navigator.userAgent.indexOf("MSIE 10.0"); return l ? "?" === l[3] ? r = r.replace(a, "$1=" + o) : o = l[3] : r = urlappend(r, n + "=" + o), win[o] = generalCallback, u.type = "text/javascript", u.src = r, u.async = !0, void 0 === u.onreadystatechange || d || (u.htmlFor = u.id = "_reqwest_" + i), u.onload = u.onreadystatechange = function () { if (u[readyState] && "complete" !== u[readyState] && "loaded" !== u[readyState] || c)
return !1; u.onload = u.onreadystatechange = null, u.onclick && u.onclick(), t(lastValue), lastValue = void 0, head.removeChild(u), c = 1; }, head.appendChild(u), { abort: function () { u.onload = u.onreadystatechange = null, s({}, "Request is aborted: timeout", {}), lastValue = void 0, head.removeChild(u), c = 1; } }; } function getRequest(e, t) { var s, r = this.o, i = (r.method || "GET").toUpperCase(), n = "string" == typeof r ? r : r.url, o = !1 !== r.processData && r.data && "string" != typeof r.data ? reqwest.toQueryString(r.data) : r.data || null, a = !1; return "jsonp" != r.type && "GET" != i || !o || (n = urlappend(n, o), o = null), "jsonp" == r.type ? handleJsonp(r, e, t, n) : ((s = r.xhr && r.xhr(r) || xhr(r)).open(i, n, !1 !== r.async), setHeaders(s, r), setCredentials(s, r), win[xDomainRequest] && s instanceof win[xDomainRequest] ? (s.onload = e, s.onerror = t, s.onprogress = function () { }, a = !0) : s.onreadystatechange = handleReadyState(this, e, t), r.before && r.before(s), a ? setTimeout(function () { s.send(o); }, 200) : s.send(o), s); } function Reqwest(e, t) { this.o = e, this.fn = t, init.apply(this, arguments); } function setType(e) { return e.match("json") ? "json" : e.match("javascript") ? "js" : e.match("text") ? "html" : e.match("xml") ? "xml" : void 0; } function init(o, fn) { this.url = "string" == typeof o ? o : o.url, this.timeout = null, this._fulfilled = !1, this._successHandler = function () { }, this._fulfillmentHandlers = [], this._errorHandlers = [], this._completeHandlers = [], this._erred = !1, this._responseArgs = {}; var self = this; function complete(e) { for (o.timeout && clearTimeout(self.timeout), self.timeout = null; 0 < self._completeHandlers.length;)
self._completeHandlers.shift()(e); } function success(resp) { var type = o.type || resp && setType(resp.getResponseHeader("Content-Type")); resp = "jsonp" !== type ? self.request : resp; var filteredResponse = globalSetupOptions.dataFilter(resp.responseText, type), r = filteredResponse; try {
resp.responseText = r;
}
catch (e) { } if (r)
switch (type) {
case "json":
try {
resp = win.JSON ? win.JSON.parse(r) : eval("(" + r + ")");
}
catch (e) {
return error(resp, "Could not parse JSON in response", e);
}
break;
case "js":
resp = eval(r);
break;
case "html":
resp = r;
break;
case "xml": resp = resp.responseXML && resp.responseXML.parseError && resp.responseXML.parseError.errorCode && resp.responseXML.parseError.reason ? null : resp.responseXML;
} for (self._responseArgs.resp = resp, self._fulfilled = !0, fn(resp), self._successHandler(resp); 0 < self._fulfillmentHandlers.length;)
resp = self._fulfillmentHandlers.shift()(resp); complete(resp); } function timedOut() { self._timedOut = !0, self.request.abort(); } function error(e, t, s) { for (e = self.request, self._responseArgs.resp = e, self._responseArgs.msg = t, self._responseArgs.t = s, self._erred = !0; 0 < self._errorHandlers.length;)
self._errorHandlers.shift()(e, t, s); complete(e); } fn = fn || function () { }, o.timeout && (this.timeout = setTimeout(function () { timedOut(); }, o.timeout)), o.success && (this._successHandler = function () { o.success.apply(o, arguments); }), o.error && this._errorHandlers.push(function () { o.error.apply(o, arguments); }), o.complete && this._completeHandlers.push(function () { o.complete.apply(o, arguments); }), this.request = getRequest.call(this, success, error); } function reqwest(e, t) { return new Reqwest(e, t); } function normalize(e) { return e ? e.replace(/\r?\n/g, "\r\n") : ""; } function serial(e, t) { var s, r, i, n, o = e.name, a = e.tagName.toLowerCase(), l = function (e) { e && !e.disabled && t(o, normalize(e.attributes.value && e.attributes.value.specified ? e.value : e.text)); }; if (!e.disabled && o)
switch (a) {
case "input":
/reset|button|image|file/i.test(e.type) || (s = /checkbox/i.test(e.type), r = /radio/i.test(e.type), i = e.value, (!s && !r || e.checked) && t(o, normalize(s && "" === i ? "on" : i)));
break;
case "textarea":
t(o, normalize(e.value));
break;
case "select": if ("select-one" === e.type.toLowerCase())
l(0 <= e.selectedIndex ? e.options[e.selectedIndex] : null);
else
for (n = 0; e.length && n < e.length; n++)
e.options[n].selected && l(e.options[n]);
} } function eachFormElement() { var e, t, n = this, s = function (e, t) { var s, r, i; for (s = 0; s < t.length; s++)
for (i = e[byTag](t[s]), r = 0; r < i.length; r++)
serial(i[r], n); }; for (t = 0; t < arguments.length; t++)
e = arguments[t], /input|select|textarea/i.test(e.tagName) && serial(e, n), s(e, ["input", "select", "textarea"]); } function serializeQueryString() { return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments)); } function serializeHash() { var s = {}; return eachFormElement.apply(function (e, t) { e in s ? (s[e] && !isArray(s[e]) && (s[e] = [s[e]]), s[e].push(t)) : s[e] = t; }, arguments), s; } function buildParams(e, t, s, r) { var i, n, o, a = /\[\]$/; if (isArray(t))
for (n = 0; t && n < t.length; n++)
o = t[n], s || a.test(e) ? r(e, o) : buildParams(e + "[" + ("object" == typeof o ? n : "") + "]", o, s, r);
else if (t && "[object Object]" === t.toString())
for (i in t)
buildParams(e + "[" + i + "]", t[i], s, r);
else
r(e, t); } return Reqwest.prototype = { abort: function () { this._aborted = !0, this.request.abort(); }, retry: function () { init.call(this, this.o, this.fn); }, then: function (e, t) { return e = e || function () { }, t = t || function () { }, this._fulfilled ? this._responseArgs.resp = e(this._responseArgs.resp) : this._erred ? t(this._responseArgs.resp, this._responseArgs.msg, this._responseArgs.t) : (this._fulfillmentHandlers.push(e), this._errorHandlers.push(t)), this; }, always: function (e) { return this._fulfilled || this._erred ? e(this._responseArgs.resp) : this._completeHandlers.push(e), this; }, fail: function (e) { return this._erred ? e(this._responseArgs.resp, this._responseArgs.msg, this._responseArgs.t) : this._errorHandlers.push(e), this; }, "catch": function (e) { return this.fail(e); } }, reqwest.serializeArray = function () { var s = []; return eachFormElement.apply(function (e, t) { s.push({ name: e, value: t }); }, arguments), s; }, reqwest.serialize = function () { if (0 === arguments.length)
return ""; var e, t = Array.prototype.slice.call(arguments, 0); return (e = t.pop()) && e.nodeType && t.push(e) && (e = null), e && (e = e.type), ("map" == e ? serializeHash : "array" == e ? reqwest.serializeArray : serializeQueryString).apply(null, t); }, reqwest.toQueryString = function (e, t) { var s, r, i = t || !1, n = [], o = encodeURIComponent, a = function (e, t) { t = "function" == typeof t ? t() : null == t ? "" : t, n[n.length] = o(e) + "=" + o(t); }; if (isArray(e))
for (r = 0; e && r < e.length; r++)
a(e[r].name, e[r].value);
else
for (s in e)
e.hasOwnProperty(s) && buildParams(s, e[s], i, a); return n.join("&").replace(/%20/g, "+"); }, reqwest.getcallbackPrefix = function () { return callbackPrefix; }, reqwest.compat = function (e, t) { return e && (e.type && (e.method = e.type) && delete e.type, e.dataType && (e.type = e.dataType), e.jsonpCallback && (e.jsonpCallbackName = e.jsonpCallback) && delete e.jsonpCallback, e.jsonp && (e.jsonpCallback = e.jsonp)), new Reqwest(e, t); }, reqwest.ajaxSetup = function (e) { for (var t in e = e || {})
globalSetupOptions[t] = e[t]; }, reqwest; }, module.exports ? module.exports = ue() : void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof (__WEBPACK_AMD_DEFINE_FACTORY__ = ue) ? __WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module) : __WEBPACK_AMD_DEFINE_FACTORY__) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); }, function (e, t, s) {
"use strict";
s.r(t);
s(1);
var r = s(8);
s.d(t, "default", function () { return r.a; });
}, function (e, t, s) { }])["default"]; });