/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@ideal-postcodes/postcode-lookup-bundled@3.0.3/dist/postcode-lookup.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/**
 * @license
 * Ideal Postcodes <https://ideal-postcodes.co.uk>
 * Copyright IDDQD Limited
 * Postcode Lookup Bundled 3.0.3
 * Built on Postcode Lookup ~3.1.6
 * AGPL-3.0 Licence
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IdealPostcodes=e.IdealPostcodes||{})}(this,function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t,n){return t=s(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,u=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return u}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(a())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&f(o,n.prototype),o}(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)},m(e)}var b=setTimeout;function g(e){return Boolean(e&&void 0!==e.length)}function w(){}function E(e){if(!(this instanceof E))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],C(e,this)}function S(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,E._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void A(t.promise,e)}O(t.promise,r)}else(1===e._state?O:A)(t.promise,e._value)})):e._deferreds.push(t)}function O(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof E)return e._state=3,e._value=t,void T(e);if("function"==typeof n)return void C((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,T(e)}catch(t){A(e,t)}var r,o}function A(e,t){e._state=2,e._value=t,T(e)}function T(e){2===e._state&&0===e._deferreds.length&&E._immediateFn(function(){e._handled||E._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)S(e,e._deferreds[t]);e._deferreds=null}function _(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function C(e,t){var n=!1;try{e(function(e){n||(n=!0,O(t,e))},function(e){n||(n=!0,A(t,e))})}catch(e){if(n)return;n=!0,A(t,e)}}E.prototype.catch=function(e){return this.then(null,e)},E.prototype.then=function(e,t){var n=new this.constructor(w);return S(this,new _(e,t,n)),n},E.prototype.finally=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})},E.all=function(e){return new E(function(t,n){if(!g(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var u=s.then;if("function"==typeof u)return void u.call(s,function(t){i(e,t)},n)}r[e]=s,0===--o&&t(r)}catch(e){n(e)}}for(var s=0;s<r.length;s++)i(s,r[s])})},E.allSettled=function(e){return new this(function(t,n){if(!e||void 0===e.length)return n(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,n){if(n&&("object"==typeof n||"function"==typeof n)){var s=n.then;if("function"==typeof s)return void s.call(n,function(t){i(e,t)},function(n){r[e]={status:"rejected",reason:n},0===--o&&t(r)})}r[e]={status:"fulfilled",value:n},0===--o&&t(r)}for(var s=0;s<r.length;s++)i(s,r[s])})},E.resolve=function(e){return e&&"object"==typeof e&&e.constructor===E?e:new E(function(t){t(e)})},E.reject=function(e){return new E(function(t,n){n(e)})},E.race=function(e){return new E(function(t,n){if(!g(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)E.resolve(e[r]).then(t,n)})},E._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){b(e,0)},E._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var j={tls:!0,api_key:"",baseUrl:"api.ideal-postcodes.co.uk",version:"v1",strictAuthorisation:!1,timeout:1e4,header:{Accept:"application/json","Content-Type":"application/json"},tags:[],agent:{}},k=function(){return o(function e(t){r(this,e),this.config=l(l({},j),t),this.config.header=l(l({},j.header),t.header&&t.header)},[{key:"url",value:function(){var e=this.config,t=e.baseUrl,n=e.version;return"".concat(this.protocol(),"://").concat(t,"/").concat(n)}},{key:"protocol",value:function(){return this.config.tls?"https":"http"}}])}(),R=function(e){return void 0===e?{}:Object.keys(e).reduce(function(t,n){var r=e[n],o=P(r);return o.length>0&&(t[n]=o),t},{})},x=function(e){return"string"==typeof e},P=function(e){var t,n=[];return t=e,Array.isArray(t)?(e.forEach(function(e){L(e)&&n.push(e.toString()),x(e)&&n.push(e)}),n.join(",")):L(e)?e.toString():x(e)?e:""},L=function(e){return"number"==typeof e},F=function(e,t){var n=e.timeout;return L(n)?n:t.config.timeout},N=function(e,t){var n=e.header,r=void 0===n?{}:n;return l(l({},t.config.header),R(r))},U=function(e){var t=e.header,n=e.options,r=e.client;return t.Authorization=function(e,t){var n=[],r=t.api_key||e.config.api_key;n.push(["api_key",r]);var o=t.licensee;void 0!==o&&n.push(["licensee",o]);var i=t.user_token;return void 0!==i&&n.push(["user_token",i]),"IDEALPOSTCODES ".concat(D(n))}(r,n),t},D=function(e){return e.map(function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')}).join(" ")},B=function(e){var t=e.header,n=e.options.sourceIp;return void 0!==n&&(t["IDPC-Source-IP"]=n),t},q=function(e){var t=e.query,n=e.options.filter;return void 0!==n&&(t.filter=n.join(",")),t},I=function(e){var t,n=e.client,r=e.query,o=e.options;return n.config.tags.length&&(t=n.config.tags),o.tags&&(t=o.tags),void 0!==t&&(r.tags=t.join(",")),r},M=function(e){function t(e){var o;r(this,t);var i=(this instanceof t?this.constructor:void 0).prototype;(o=n(this,t)).__proto__=i;var s=e.message,u=e.httpStatus,a=e.metadata,c=void 0===a?{}:a;return o.message=s,o.name="Ideal Postcodes Error",o.httpStatus=u,o.metadata=c,Error.captureStackTrace&&Error.captureStackTrace(o,t),o}return u(t,e),o(t)}(m(Error)),H=function(e){function t(e){var o;return r(this,t),(o=n(this,t,[{httpStatus:e.httpStatus,message:e.body.message}])).response=e,o}return u(t,e),o(t)}(M),z=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}(H),J=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}(H),W=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}(J),K=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}(H),V=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}(K),G=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}(K),$=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}(H),X=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}($),Y=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}($),Q=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}($),Z=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}($),ee=function(e){function t(){return r(this,t),n(this,t,arguments)}return u(t,e),o(t)}(H),te=function(e){return null!==(t=e)&&"object"===y(t)&&("string"==typeof e.message&&"number"==typeof e.code);var t},ne=function(e){var t=e.httpStatus,n=e.body;if(!function(e){return!(e<200||e>=300)}(t)){if(te(n)){var r=n.code;if(4010===r)return new W(e);if(4040===r)return new X(e);if(4042===r)return new Y(e);if(4044===r)return new Q(e);if(4046===r)return new Z(e);if(4020===r)return new V(e);if(4021===r)return new G(e);if(404===t)return new $(e);if(400===t)return new z(e);if(402===t)return new K(e);if(401===t)return new J(e);if(500===t)return new ee(e)}return new M({httpStatus:t,message:JSON.stringify(n)})}},re=function(e,t){return[e.client.url(),e.resource,encodeURIComponent(t),e.action].filter(function(e){return void 0!==e}).join("/")},oe=function(e){var t=e.client;return function(n,r){return t.config.agent.http({method:"GET",url:re(e,n),query:R(r.query),header:N(r,t),timeout:F(r,t)}).then(function(e){var t=ne(e);if(t)throw t;return e})}},ie=function(e,t){return function(e){var t=e.client,n=e.resource;return function(e){return t.config.agent.http({method:"GET",url:"".concat(t.url(),"/").concat(n),query:R(e.query),header:N(e,t),timeout:F(e,t)}).then(function(e){var t=ne(e);if(t)throw t;return e})}}({resource:"addresses",client:e})(t)},se=function(e){var t=e.client,n=e.timeout,r=e.api_key||e.client.config.api_key,o=e.licensee,i={query:void 0===o?{}:{licensee:o},header:{}};return void 0!==n&&(i.timeout=n),function(e,t,n){return oe({resource:"keys",client:e})(t,n)}(t,r,i).then(function(e){return e.body.result})},ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ce,le,fe,de,he={};function pe(){if(le)return ce;le=1;var e=function(e){return e&&e.Math==Math&&e};return ce=e("object"==("undefined"==typeof globalThis?"undefined":y(globalThis))&&globalThis)||e("object"==("undefined"==typeof window?"undefined":y(window))&&window)||e("object"==("undefined"==typeof self?"undefined":y(self))&&self)||e("object"==y(ue)&&ue)||function(){return this}()||Function("return this")()}function ye(){return de?fe:(de=1,fe=function(e){return"function"==typeof e})}var ve,me,be,ge,we={};function Ee(){return me?ve:(me=1,ve=function(e){try{return!!e()}catch(e){return!0}})}function Se(){if(ge)return be;ge=1;var e=Ee();return be=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})}var Oe,Ae,Te,_e,Ce,je,ke,Re,xe,Pe,Le,Fe,Ne,Ue,De,Be,qe,Ie,Me,He,ze,Je,We,Ke,Ve,Ge,$e,Xe,Ye,Qe,Ze,et,tt,nt,rt,ot={};function it(){if(Oe)return ot;Oe=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return ot.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,ot}function st(){return Te?Ae:(Te=1,Ae=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function ut(){if(ke)return je;ke=1;var e=Ee(),t=function(){if(Ce)return _e;Ce=1;var e={}.toString;return _e=function(t){return e.call(t).slice(8,-1)}}(),n="".split;return je=e(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==t(e)?n.call(e,""):Object(e)}:Object}function at(){return xe?Re:(xe=1,Re=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e})}function ct(){if(Le)return Pe;Le=1;var e=ut(),t=at();return Pe=function(n){return e(t(n))}}function lt(){if(Ne)return Fe;Ne=1;var e=ye();return Fe=function(t){return"object"===y(t)?null!==t:e(t)}}function ft(){return De?Ue:(De=1,Ue={})}function dt(){if(qe)return Be;qe=1;var e=ft(),t=pe(),n=ye(),r=function(e){return n(e)?e:void 0};return Be=function(n,o){return arguments.length<2?r(e[n])||r(t[n]):e[n]&&e[n][o]||t[n]&&t[n][o]},Be}function ht(){if(ze)return He;ze=1;var e,t,n=pe(),r=function(){if(Me)return Ie;Me=1;var e=dt();return Ie=e("navigator","userAgent")||""}(),o=n.process,i=n.Deno,s=o&&o.versions||i&&i.version,u=s&&s.v8;return u?t=(e=u.split("."))[0]<4?1:e[0]+e[1]:r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=e[1]),He=t&&+t}function pt(){if(We)return Je;We=1;var e=ht(),t=Ee();return Je=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function yt(){if(Ve)return Ke;Ve=1;var e=pt();return Ke=e&&!Symbol.sham&&"symbol"==y(Symbol.iterator)}function vt(){if($e)return Ge;$e=1;var e=ye(),t=dt(),n=yt();return Ge=n?function(e){return"symbol"==y(e)}:function(n){var r=t("Symbol");return e(r)&&Object(n)instanceof r}}function mt(){return Ye?Xe:(Ye=1,Xe=function(e){try{return String(e)}catch(e){return"Object"}})}function bt(){if(Ze)return Qe;Ze=1;var e=ye(),t=mt();return Qe=function(n){if(e(n))return n;throw TypeError(t(n)+" is not a function")}}function gt(){if(tt)return et;tt=1;var e=bt();return et=function(t,n){var r=t[n];return null==r?void 0:e(r)}}function wt(){if(rt)return nt;rt=1;var e=ye(),t=lt();return nt=function(n,r){var o,i;if("string"===r&&e(o=n.toString)&&!t(i=o.call(n)))return i;if(e(o=n.valueOf)&&!t(i=o.call(n)))return i;if("string"!==r&&e(o=n.toString)&&!t(i=o.call(n)))return i;throw TypeError("Can't convert object to primitive value")}}var Et,St,Ot,At,Tt,_t,Ct,jt,kt,Rt,xt,Pt,Lt,Ft,Nt,Ut,Dt,Bt,qt,It,Mt,Ht,zt,Jt,Wt,Kt,Vt,Gt,$t={exports:{}};function Xt(){if(At)return Ot;At=1;var e=pe();return Ot=function(t,n){try{Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0})}catch(r){e[t]=n}return n}}function Yt(){if(Ct)return $t.exports;Ct=1;var e=St?Et:(St=1,Et=!0),t=function(){if(_t)return Tt;_t=1;var e=pe(),t=Xt(),n="__core-js_shared__",r=e[n]||t(n,{});return Tt=r}();return($t.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.18.3",mode:e?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"}),$t.exports}function Qt(){if(kt)return jt;kt=1;var e=at();return jt=function(t){return Object(e(t))}}function Zt(){if(xt)return Rt;xt=1;var e=Qt(),t={}.hasOwnProperty;return Rt=Object.hasOwn||function(n,r){return t.call(e(n),r)}}function en(){if(Lt)return Pt;Lt=1;var e=0,t=Math.random();return Pt=function(n){return"Symbol("+String(void 0===n?"":n)+")_"+(++e+t).toString(36)}}function tn(){if(Nt)return Ft;Nt=1;var e=pe(),t=Yt(),n=Zt(),r=en(),o=pt(),i=yt(),s=t("wks"),u=e.Symbol,a=i?u:u&&u.withoutSetter||r;return Ft=function(e){return n(s,e)&&(o||"string"==typeof s[e])||(o&&n(u,e)?s[e]=u[e]:s[e]=a("Symbol."+e)),s[e]}}function nn(){if(Dt)return Ut;Dt=1;var e=lt(),t=vt(),n=gt(),r=wt(),o=tn()("toPrimitive");return Ut=function(i,s){if(!e(i)||t(i))return i;var u,a=n(i,o);if(a){if(void 0===s&&(s="default"),u=a.call(i,s),!e(u)||t(u))return u;throw TypeError("Can't convert object to primitive value")}return void 0===s&&(s="number"),r(i,s)}}function rn(){if(qt)return Bt;qt=1;var e=nn(),t=vt();return Bt=function(n){var r=e(n,"string");return t(r)?r:String(r)}}function on(){if(zt)return Ht;zt=1;var e=Se(),t=Ee(),n=function(){if(Mt)return It;Mt=1;var e=pe(),t=lt(),n=e.document,r=t(n)&&t(n.createElement);return It=function(e){return r?n.createElement(e):{}}}();return Ht=!e&&!t(function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}var sn,un,an,cn,ln,fn,dn,hn,pn,yn,vn,mn,bn,gn,wn,En,Sn,On,An,Tn,_n,Cn,jn,kn,Rn,xn={};function Pn(){if(un)return sn;un=1;var e=lt();return sn=function(t){if(e(t))return t;throw TypeError(String(t)+" is not an object")}}function Ln(){if(ln)return cn;ln=1;var e=Se(),t=function(){if(an)return xn;an=1;var e=Se(),t=on(),n=Pn(),r=rn(),o=Object.defineProperty;return xn.f=e?o:function(e,i,s){if(n(e),i=r(i),n(s),t)try{return o(e,i,s)}catch(e){}if("get"in s||"set"in s)throw TypeError("Accessors not supported");return"value"in s&&(e[i]=s.value),e},xn}(),n=st();return cn=e?function(e,r,o){return t.f(e,r,n(1,o))}:function(e,t,n){return e[t]=n,e}}function Fn(){if(dn)return fn;dn=1;var e=pe(),t=ye(),n=function(){if(Jt)return we;Jt=1;var e=Se(),t=it(),n=st(),r=ct(),o=rn(),i=Zt(),s=on(),u=Object.getOwnPropertyDescriptor;return we.f=e?u:function(e,a){if(e=r(e),a=o(a),s)try{return u(e,a)}catch(e){}if(i(e,a))return n(!t.f.call(e,a),e[a])},we}().f,r=function(){if(Kt)return Wt;Kt=1;var e=Ee(),t=ye(),n=/#|\.prototype\./,r=function(n,r){var a=i[o(n)];return a==u||a!=s&&(t(r)?e(r):!!r)},o=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},i=r.data={},s=r.NATIVE="N",u=r.POLYFILL="P";return Wt=r}(),o=ft(),i=function(){if(Gt)return Vt;Gt=1;var e=bt();return Vt=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}},Vt}(),s=Ln(),u=Zt(),a=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};return fn=function(c,l){var f,d,h,p,v,m,b,g,w=c.target,E=c.global,S=c.stat,O=c.proto,A=E?e:S?e[w]:(e[w]||{}).prototype,T=E?o:o[w]||s(o,w,{})[w],_=T.prototype;for(h in l)f=!r(E?h:w+(S?".":"#")+h,c.forced)&&A&&u(A,h),v=T[h],f&&(m=c.noTargetGet?(g=n(A,h))&&g.value:A[h]),p=f&&m?m:l[h],f&&y(v)===y(p)||(b=c.bind&&f?i(p,e):c.wrap&&f?a(p):O&&t(p)?i(Function.call,p):p,(c.sham||p&&p.sham||v&&v.sham)&&s(b,"sham",!0),s(T,h,b),O&&(u(o,d=w+"Prototype")||s(o,d,{}),s(o[d],h,p),c.real&&_&&!_[h]&&s(_,h,p)))}}function Nn(){if(pn)return hn;pn=1;var e=Math.ceil,t=Math.floor;return hn=function(n){var r=+n;return r!=r||0===r?0:(r>0?t:e)(r)}}function Un(){if(vn)return yn;vn=1;var e=Nn(),t=Math.max,n=Math.min;return yn=function(r,o){var i=e(r);return i<0?t(i+o,0):n(i,o)}}function Dn(){if(bn)return mn;bn=1;var e=Nn(),t=Math.min;return mn=function(n){return n>0?t(e(n),9007199254740991):0}}function Bn(){if(wn)return gn;wn=1;var e=Dn();return gn=function(t){return e(t.length)}}function qn(){return An?On:(An=1,On={})}function In(){if(_n)return Tn;_n=1;var e=Zt(),t=ct(),n=function(){if(Sn)return En;Sn=1;var e=ct(),t=Un(),n=Bn(),r=function(r){return function(o,i,s){var u,a=e(o),c=n(a),l=t(s,c);if(r&&i!=i){for(;c>l;)if((u=a[l++])!=u)return!0}else for(;c>l;l++)if((r||l in a)&&a[l]===i)return r||l||0;return!r&&-1}};return En={includes:r(!0),indexOf:r(!1)}}().indexOf,r=qn();return Tn=function(o,i){var s,u=t(o),a=0,c=[];for(s in u)!e(r,s)&&e(u,s)&&c.push(s);for(;i.length>a;)e(u,s=i[a++])&&(~n(c,s)||c.push(s));return c}}function Mn(){return jn?Cn:(jn=1,Cn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function Hn(){if(Rn)return kn;Rn=1;var e=In(),t=Mn();return kn=Object.keys||function(n){return e(n,t)}}var zn,Jn,Wn,Kn,Vn,Gn,$n,Xn,Yn,Qn,Zn={};function er(){if(Wn)return Jn;Wn=1;var e=Se(),t=Ee(),n=Hn(),r=(zn||(zn=1,Zn.f=Object.getOwnPropertySymbols),Zn),o=it(),i=Qt(),s=ut(),u=nr,a=Object.defineProperty;return Jn=!u||t(function(){if(e&&1!==u({b:1},u(a({},"a",{enumerable:!0,get:function(){a(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},r={},o=Symbol(),i="abcdefghijklmnopqrst";return t[o]=7,i.split("").forEach(function(e){r[e]=e}),7!=u({},t)[o]||n(u({},r)).join("")!=i})?function(t,u){for(var a=i(t),c=arguments.length,l=1,f=r.f,d=o.f;c>l;)for(var h,p=s(arguments[l++]),y=f?n(p).concat(f(p)):n(p),v=y.length,m=0;v>m;)h=y[m++],e&&!d.call(p,h)||(a[h]=p[h]);return a}:u,Jn}function tr(){if(Gn)return Vn;Gn=1,function(){if(Kn)return he;Kn=1;var e=Fn(),t=er();e({target:"Object",stat:!0,forced:nr!==t},{assign:t})}();var e=ft();return Vn=e.Object.assign}var nr=ae(function(){if(Qn)return Yn;Qn=1;var e=function(){if(Xn)return $n;Xn=1;var e=tr();return $n=e}();return Yn=e}());function rr(e,t){return function(){return e.apply(t,arguments)}}const{toString:or}=Object.prototype,{getPrototypeOf:ir}=Object,{iterator:sr,toStringTag:ur}=Symbol,ar=(cr=Object.create(null),e=>{const t=or.call(e);return cr[t]||(cr[t]=t.slice(8,-1).toLowerCase())});var cr;const lr=e=>(e=e.toLowerCase(),t=>ar(t)===e),fr=e=>t=>typeof t===e,{isArray:dr}=Array,hr=fr("undefined");function pr(e){return null!==e&&!hr(e)&&null!==e.constructor&&!hr(e.constructor)&&mr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const yr=lr("ArrayBuffer");const vr=fr("string"),mr=fr("function"),br=fr("number"),gr=e=>null!==e&&"object"==typeof e,wr=e=>{if("object"!==ar(e))return!1;const t=ir(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ur in e||sr in e)},Er=lr("Date"),Sr=lr("File"),Or=lr("Blob"),Ar=lr("FileList"),Tr=lr("URLSearchParams"),[_r,Cr,jr,kr]=["ReadableStream","Request","Response","Headers"].map(lr);function Rr(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),dr(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(pr(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function xr(e,t){if(pr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Pr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Lr=e=>!hr(e)&&e!==Pr;const Fr=(Nr="undefined"!=typeof Uint8Array&&ir(Uint8Array),e=>Nr&&e instanceof Nr);var Nr;const Ur=lr("HTMLFormElement"),Dr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Br=lr("RegExp"),qr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Rr(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Ir=lr("AsyncFunction"),Mr=(Hr="function"==typeof setImmediate,zr=mr(Pr.postMessage),Hr?setImmediate:zr?(Jr=`axios@${Math.random()}`,Wr=[],Pr.addEventListener("message",({source:e,data:t})=>{e===Pr&&t===Jr&&Wr.length&&Wr.shift()()},!1),e=>{Wr.push(e),Pr.postMessage(Jr,"*")}):e=>setTimeout(e));var Hr,zr,Jr,Wr;const Kr="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Pr):"undefined"!=typeof process&&process.nextTick||Mr;var Vr={isArray:dr,isArrayBuffer:yr,isBuffer:pr,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||mr(e.append)&&("formdata"===(t=ar(e))||"object"===t&&mr(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&yr(e.buffer),t},isString:vr,isNumber:br,isBoolean:e=>!0===e||!1===e,isObject:gr,isPlainObject:wr,isEmptyObject:e=>{if(!gr(e)||pr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:_r,isRequest:Cr,isResponse:jr,isHeaders:kr,isUndefined:hr,isDate:Er,isFile:Sr,isBlob:Or,isRegExp:Br,isFunction:mr,isStream:e=>gr(e)&&mr(e.pipe),isURLSearchParams:Tr,isTypedArray:Fr,isFileList:Ar,forEach:Rr,merge:function e(){const{caseless:t,skipUndefined:n}=Lr(this)&&this||{},r={},o=(o,i)=>{const s=t&&xr(r,i)||i;wr(r[s])&&wr(o)?r[s]=e(r[s],o):wr(o)?r[s]=e({},o):dr(o)?r[s]=o.slice():n&&hr(o)||(r[s]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Rr(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(Rr(t,(t,r)=>{n&&mr(t)?e[r]=rr(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&nr(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==n&&ir(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:ar,kindOfTest:lr,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(dr(e))return e;let t=e.length;if(!br(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[sr]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Ur,hasOwnProperty:Dr,hasOwnProp:Dr,reduceDescriptors:qr,freezeMethods:e=>{qr(e,(t,n)=>{if(mr(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];mr(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return dr(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:xr,global:Pr,isContextDefined:Lr,isSpecCompliantForm:function(e){return!!(e&&mr(e.append)&&"FormData"===e[ur]&&e[sr])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(gr(e)){if(t.indexOf(e)>=0)return;if(pr(e))return e;if(!("toJSON"in e)){t[r]=e;const o=dr(e)?[]:{};return Rr(e,(e,t)=>{const i=n(e,r+1);!hr(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ir,isThenable:e=>e&&(gr(e)||mr(e))&&mr(e.then)&&mr(e.catch),setImmediate:Mr,asap:Kr,isIterable:e=>null!=e&&mr(e[sr])};function Gr(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Vr.inherits(Gr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Vr.toJSONObject(this.config),code:this.code,status:this.status}}});const $r=Gr.prototype,Xr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Xr[e]={value:e}}),Object.defineProperties(Gr,Xr),Object.defineProperty($r,"isAxiosError",{value:!0}),Gr.from=(e,t,n,r,o,i)=>{const s=Object.create($r);Vr.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const u=e&&e.message?e.message:"Error",a=null==t&&e?e.code:t;return Gr.call(s,u,a,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&nr(s,i),s};function Yr(e){return Vr.isPlainObject(e)||Vr.isArray(e)}function Qr(e){return Vr.endsWith(e,"[]")?e.slice(0,-2):e}function Zr(e,t,n){return e?e.concat(t).map(function(e,t){return e=Qr(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const eo=Vr.toFlatObject(Vr,{},null,function(e){return/^is[A-Z]/.test(e)});function to(e,t,n){if(!Vr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Vr.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Vr.isUndefined(t[e])})).metaTokens,o=n.visitor||c,i=n.dots,s=n.indexes,u=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Vr.isSpecCompliantForm(t);if(!Vr.isFunction(o))throw new TypeError("visitor must be a function");function a(e){if(null===e)return"";if(Vr.isDate(e))return e.toISOString();if(Vr.isBoolean(e))return e.toString();if(!u&&Vr.isBlob(e))throw new Gr("Blob is not supported. Use a Buffer instead.");return Vr.isArrayBuffer(e)||Vr.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let u=e;if(e&&!o&&"object"==typeof e)if(Vr.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Vr.isArray(e)&&function(e){return Vr.isArray(e)&&!e.some(Yr)}(e)||(Vr.isFileList(e)||Vr.endsWith(n,"[]"))&&(u=Vr.toArray(e)))return n=Qr(n),u.forEach(function(e,r){!Vr.isUndefined(e)&&null!==e&&t.append(!0===s?Zr([n],r,i):null===s?n:n+"[]",a(e))}),!1;return!!Yr(e)||(t.append(Zr(o,n,i),a(e)),!1)}const l=[],f=nr(eo,{defaultVisitor:c,convertValue:a,isVisitable:Yr});if(!Vr.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Vr.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Vr.forEach(n,function(n,i){!0===(!(Vr.isUndefined(n)||null===n)&&o.call(t,n,Vr.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t}function no(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ro(e,t){this._pairs=[],e&&to(e,this,t)}const oo=ro.prototype;function io(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function so(e,t,n){if(!t)return e;const r=n&&n.encode||io;Vr.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Vr.isURLSearchParams(t)?t.toString():new ro(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}oo.append=function(e,t){this._pairs.push([e,t])},oo.toString=function(e){const t=e?function(t){return e.call(this,t,no)}:no;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class uo{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Vr.forEach(this.handlers,function(t){null!==t&&e(t)})}}var ao={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},co={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ro,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const lo="undefined"!=typeof window&&"undefined"!=typeof document,fo="object"==typeof navigator&&navigator||void 0,ho=lo&&(!fo||["ReactNative","NativeScript","NS"].indexOf(fo.product)<0),po="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,yo=lo&&window.location.href||"http://localhost";var vo={...Object.freeze({__proto__:null,hasBrowserEnv:lo,hasStandardBrowserEnv:ho,hasStandardBrowserWebWorkerEnv:po,navigator:fo,origin:yo}),...co};function mo(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),u=o>=e.length;if(i=!i&&Vr.isArray(r)?r.length:i,u)return Vr.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&Vr.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Vr.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(Vr.isFormData(e)&&Vr.isFunction(e.entries)){const n={};return Vr.forEachEntry(e,(e,r)=>{t(function(e){return Vr.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const bo={transitional:ao,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Vr.isObject(e);o&&Vr.isHTMLForm(e)&&(e=new FormData(e));if(Vr.isFormData(e))return r?JSON.stringify(mo(e)):e;if(Vr.isArrayBuffer(e)||Vr.isBuffer(e)||Vr.isStream(e)||Vr.isFile(e)||Vr.isBlob(e)||Vr.isReadableStream(e))return e;if(Vr.isArrayBufferView(e))return e.buffer;if(Vr.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return to(e,new vo.classes.URLSearchParams,{visitor:function(e,t,n,r){return vo.isNode&&Vr.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Vr.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return to(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Vr.isString(e))try{return(t||JSON.parse)(e),Vr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||bo.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Vr.isResponse(e)||Vr.isReadableStream(e))return e;if(e&&Vr.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw Gr.from(e,Gr.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vo.classes.FormData,Blob:vo.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Vr.forEach(["delete","get","head","post","put","patch"],e=>{bo.headers[e]={}});const go=Vr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const wo=Symbol("internals");function Eo(e){return e&&String(e).trim().toLowerCase()}function So(e){return!1===e||null==e?e:Vr.isArray(e)?e.map(So):String(e)}function Oo(e,t,n,r,o){return Vr.isFunction(r)?r.call(this,t,n):(o&&(t=n),Vr.isString(t)?Vr.isString(r)?-1!==t.indexOf(r):Vr.isRegExp(r)?r.test(t):void 0:void 0)}let Ao=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Eo(t);if(!o)throw new Error("header name must be a non-empty string");const i=Vr.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=So(e))}const i=(e,t)=>Vr.forEach(e,(e,n)=>o(e,n,t));if(Vr.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Vr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&go[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Vr.isObject(e)&&Vr.isIterable(e)){let n,r,o={};for(const t of e){if(!Vr.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Vr.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Eo(e)){const n=Vr.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Vr.isFunction(t))return t.call(this,e,n);if(Vr.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Eo(e)){const n=Vr.findKey(this,e);return!(!n||void 0===this[n]||t&&!Oo(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Eo(e)){const o=Vr.findKey(n,e);!o||t&&!Oo(0,n[o],o,t)||(delete n[o],r=!0)}}return Vr.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Oo(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Vr.forEach(this,(r,o)=>{const i=Vr.findKey(n,o);if(i)return t[i]=So(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=So(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Vr.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Vr.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[wo]=this[wo]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Eo(e);t[r]||(!function(e,t){const n=Vr.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Vr.isArray(e)?e.forEach(r):r(e),this}};function To(e,t){const n=this||bo,r=t||n,o=Ao.from(r.headers);let i=r.data;return Vr.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function _o(e){return!(!e||!e.__CANCEL__)}function Co(e,t,n){Gr.call(this,null==e?"canceled":e,Gr.ERR_CANCELED,t,n),this.name="CanceledError"}function jo(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Gr("Request failed with status code "+n.status,[Gr.ERR_BAD_REQUEST,Gr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Ao.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Vr.reduceDescriptors(Ao.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Vr.freezeMethods(Ao),Vr.inherits(Co,Gr,{__CANCEL__:!0});const ko=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(u){const a=Date.now(),c=r[s];o||(o=a),n[i]=u,r[i]=a;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),a-o<t)return;const d=c&&a-c;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),u=t-o;u>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-u)))},()=>n&&s(n)]}(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,u=i-r,a=o(u);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:u,rate:a||void 0,estimated:a&&s&&i<=s?(s-i)/a:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Ro=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},xo=e=>(...t)=>Vr.asap(()=>e(...t));var Po=vo.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,vo.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(vo.origin),vo.navigator&&/(msie|trident)/i.test(vo.navigator.userAgent)):()=>!0,Lo=vo.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];Vr.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Vr.isString(r)&&s.push("path="+r),Vr.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Fo(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const No=e=>e instanceof Ao?{...e}:e;function Uo(e,t){t=t||{};const n={};function r(e,t,n,r){return Vr.isPlainObject(e)&&Vr.isPlainObject(t)?Vr.merge.call({caseless:r},e,t):Vr.isPlainObject(t)?Vr.merge({},t):Vr.isArray(t)?t.slice():t}function o(e,t,n,o){return Vr.isUndefined(t)?Vr.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Vr.isUndefined(t))return r(void 0,t)}function s(e,t){return Vr.isUndefined(t)?Vr.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function u(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const a={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(e,t,n)=>o(No(e),No(t),0,!0)};return Vr.forEach(Object.keys({...e,...t}),function(r){const i=a[r]||o,s=i(e[r],t[r],r);Vr.isUndefined(s)&&i!==u||(n[r]=s)}),n}var Do=e=>{const t=Uo({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:u}=t;if(t.headers=s=Ao.from(s),t.url=so(Fo(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&s.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),Vr.isFormData(n))if(vo.hasStandardBrowserEnv||vo.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Vr.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(vo.hasStandardBrowserEnv&&(r&&Vr.isFunction(r)&&(r=r(t)),r||!1!==r&&Po(t.url))){const e=o&&i&&Lo.read(i);e&&s.set(o,e)}return t};var Bo="undefined"!=typeof XMLHttpRequest&&function(e){return new E(function(t,n){const r=Do(e);let o=r.data;const i=Ao.from(r.headers).normalize();let s,u,a,c,l,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function v(){if(!y)return;const r=Ao.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());jo(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(v)},y.onabort=function(){y&&(n(new Gr("Request aborted",Gr.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=new Gr(t&&t.message?t.message:"Network Error",Gr.ERR_NETWORK,e,y);r.event=t||null,n(r),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ao;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Gr(t,o.clarifyTimeoutError?Gr.ETIMEDOUT:Gr.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Vr.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Vr.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),f&&"json"!==f&&(y.responseType=r.responseType),h&&([a,l]=ko(h,!0),y.addEventListener("progress",a)),d&&y.upload&&([u,c]=ko(d),y.upload.addEventListener("progress",u),y.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{y&&(n(!t||t.type?new Co(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===vo.protocols.indexOf(m)?n(new Gr("Unsupported protocol "+m+":",Gr.ERR_BAD_REQUEST,e)):y.send(o||null)})};const qo=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Gr?t:new Co(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Gr(`timeout ${t} of ms exceeded`,Gr.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:u}=r;return u.unsubscribe=()=>Vr.asap(s),u}},Io=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Mo=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ho=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Mo(e))yield*Io(n,t)}(e,t);let i,s=0,u=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return u(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw u(e),e}},cancel:e=>(u(e),o.return())},{highWaterMark:2})},{isFunction:zo}=Vr,Jo=(({Request:e,Response:t})=>({Request:e,Response:t}))(Vr.global),{ReadableStream:Wo,TextEncoder:Ko}=Vr.global,Vo=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Go=e=>{e=Vr.merge.call({skipUndefined:!0},Jo,e);const{fetch:t,Request:n,Response:r}=e,o=t?zo(t):"function"==typeof fetch,i=zo(n),s=zo(r);if(!o)return!1;const u=o&&zo(Wo),a=o&&("function"==typeof Ko?(c=new Ko,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const l=i&&u&&Vo(()=>{let e=!1;const t=new n(vo.origin,{body:new Wo,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=s&&u&&Vo(()=>Vr.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Gr(`Response type '${e}' is not supported`,Gr.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=Vr.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Vr.isBlob(e))return e.size;if(Vr.isSpecCompliantForm(e)){const t=new n(vo.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Vr.isArrayBufferView(e)||Vr.isArrayBuffer(e)?e.byteLength:(Vr.isURLSearchParams(e)&&(e+=""),Vr.isString(e)?(await a(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:u,signal:a,cancelToken:c,timeout:p,onDownloadProgress:y,onUploadProgress:v,responseType:m,headers:b,withCredentials:g="same-origin",fetchOptions:w}=Do(e),S=t||fetch;m=m?(m+"").toLowerCase():"text";let O=qo([a,c&&c.toAbortSignal()],p),A=null;const T=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let _;try{if(v&&l&&"get"!==s&&"head"!==s&&0!==(_=await h(b,u))){let e,t=new n(o,{method:"POST",body:u,duplex:"half"});if(Vr.isFormData(u)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=Ro(_,ko(xo(v)));u=Ho(t.body,65536,e,n)}}Vr.isString(g)||(g=g?"include":"omit");const t=i&&"credentials"in n.prototype,a={...w,signal:O,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:u,duplex:"half",credentials:t?g:void 0};A=i&&new n(o,a);let c=await(i?S(A,w):S(o,a));const p=f&&("stream"===m||"response"===m);if(f&&(y||p&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=Vr.toFiniteNumber(c.headers.get("content-length")),[n,o]=y&&Ro(t,ko(xo(y),!0))||[];c=new r(Ho(c.body,65536,n,()=>{o&&o(),T&&T()}),e)}m=m||"text";let C=await d[Vr.findKey(d,m)||"text"](c,e);return!p&&T&&T(),await new E((t,n)=>{jo(t,n,{data:C,headers:Ao.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:A})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw nr(new Gr("Network Error",Gr.ERR_NETWORK,e,A),{cause:t.cause||t});throw Gr.from(t,t&&t.code,e,A)}}},$o=new Map,Xo=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,u,a=i.length,c=$o;for(;a--;)s=i[a],u=c.get(s),void 0===u&&c.set(s,u=a?new Map:Go(t)),c=u;return u};Xo();const Yo={http:null,xhr:Bo,fetch:{get:Xo}};Vr.forEach(Yo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Qo=e=>`- ${e}`,Zo=e=>Vr.isFunction(e)||null===e||!1===e;var ei=(e,t)=>{e=Vr.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!Zo(r)&&(o=Yo[(n=String(r)).toLowerCase()],void 0===o))throw new Gr(`Unknown adapter '${n}'`);if(o&&(Vr.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Gr("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Qo).join("\n"):" "+Qo(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function ti(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Co(null,e)}function ni(e){ti(e),e.headers=Ao.from(e.headers),e.data=To.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ei(e.adapter||bo.adapter,e)(e).then(function(t){return ti(e),t.data=To.call(e,e.transformResponse,t),t.headers=Ao.from(t.headers),t},function(t){return _o(t)||(ti(e),t&&t.response&&(t.response.data=To.call(e,e.transformResponse,t.response),t.response.headers=Ao.from(t.response.headers))),E.reject(t)})}const ri="1.12.2",oi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{oi[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ii={};oi.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ri+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Gr(r(o," has been removed"+(t?" in "+t:"")),Gr.ERR_DEPRECATED);return t&&!ii[o]&&(ii[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},oi.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var si={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Gr("options must be an object",Gr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new Gr("option "+i+" must be "+n,Gr.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Gr("Unknown option "+i,Gr.ERR_BAD_OPTION)}},validators:oi};const ui=si.validators;let ai=class{constructor(e){this.defaults=e||{},this.interceptors={request:new uo,response:new uo}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Uo(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&si.assertOptions(n,{silentJSONParsing:ui.transitional(ui.boolean),forcedJSONParsing:ui.transitional(ui.boolean),clarifyTimeoutError:ui.transitional(ui.boolean)},!1),null!=r&&(Vr.isFunction(r)?t.paramsSerializer={serialize:r}:si.assertOptions(r,{encode:ui.function,serialize:ui.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),si.assertOptions(t,{baseUrl:ui.spelling("baseURL"),withXsrfToken:ui.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Vr.merge(o.common,o[t.method]);o&&Vr.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ao.concat(i,o);const s=[];let u=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const a=[];let c;this.interceptors.response.forEach(function(e){a.push(e.fulfilled,e.rejected)});let l,f=0;if(!u){const e=[ni.bind(this),void 0];for(e.unshift(...s),e.push(...a),l=e.length,c=E.resolve(t);f<l;)c=c.then(e[f++],e[f++]);return c}l=s.length;let d=t;for(;f<l;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{c=ni.call(this,d)}catch(e){return E.reject(e)}for(f=0,l=a.length;f<l;)c=c.then(a[f++],a[f++]);return c}getUri(e){return so(Fo((e=Uo(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Vr.forEach(["delete","get","head","options"],function(e){ai.prototype[e]=function(t,n){return this.request(Uo(n||{},{method:e,url:t,data:(n||{}).data}))}}),Vr.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Uo(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ai.prototype[e]=t(),ai.prototype[e+"Form"]=t(!0)});const ci={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ci).forEach(([e,t])=>{ci[t]=e});const li=function e(t){const n=new ai(t),r=rr(ai.prototype.request,n);return Vr.extend(r,ai.prototype,n,{allOwnKeys:!0}),Vr.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Uo(t,n))},r}(bo);li.Axios=ai,li.CanceledError=Co,li.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new E(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new E(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Co(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},li.isCancel=_o,li.VERSION=ri,li.toFormData=to,li.AxiosError=Gr,li.Cancel=li.CanceledError,li.all=function(e){return E.all(e)},li.spread=function(e){return function(t){return e.apply(null,t)}},li.isAxiosError=function(e){return Vr.isObject(e)&&!0===e.isAxiosError},li.mergeConfig=Uo,li.AxiosHeaders=Ao,li.formToJSON=e=>mo(Vr.isHTMLForm(e)?new FormData(e):e),li.getAdapter=ei,li.HttpStatusCode=ci,li.default=li;const{Axios:fi,AxiosError:di,CanceledError:hi,isCancel:pi,CancelToken:yi,VERSION:vi,all:mi,Cancel:bi,isAxiosError:gi,spread:wi,toFormData:Ei,AxiosHeaders:Si,HttpStatusCode:Oi,formToJSON:Ai,getAdapter:Ti,mergeConfig:_i}=li;var Ci=M,ji=function(e,t){return{httpRequest:e,body:t.data,httpStatus:t.status||0,header:(n=t.headers,Object.keys(n).reduce(function(e,t){var r=n[t];return"string"==typeof r?e[t]=r:Array.isArray(r)&&(e[t]=r.join(",")),e},{})),metadata:{response:t}};var n},ki=function(e){var t=new Ci({message:"[".concat(e.name,"] ").concat(e.message),httpStatus:0,metadata:{axios:e}});return E.reject(t)},Ri=function(){return!0},xi=function(){return o(function e(){r(this,e),this.Axios=li.create({validateStatus:Ri})},[{key:"requestWithBody",value:function(e){var t=e.body,n=e.method,r=e.timeout,o=e.url,i=e.header,s=e.query;return this.Axios.request({url:o,method:n,headers:i,params:s,data:t,timeout:r}).then(function(t){return ji(e,t)}).catch(ki)}},{key:"request",value:function(e){var t=e.method,n=e.timeout,r=e.url,o=e.header,i=e.query;return this.Axios.request({url:r,method:t,headers:o,params:i,timeout:n}).then(function(t){return ji(e,t)}).catch(ki)}},{key:"http",value:function(e){return void 0!==e.body?this.requestWithBody(e):this.request(e)}}])}(),Pi=function(e){function t(e){return r(this,t),n(this,t,[l({agent:new xi},e)])}return u(t,e),o(t)}(k),Li=function(e){return"string"==typeof e},Fi=function(){return!0},Ni=function(e,t){return Li(e)?t.querySelector(e):e},Ui=function(){return window.document},Di=function(e){return Li(e)?Ui().querySelector(e):null===e?Ui():e},Bi=function(e,t){var n=e.getAttribute("style");return Object.keys(t).forEach(function(n){return e.style[n]=t[n]}),n},qi=function(e){return e.style.display="none",e},Ii=function(e){return e.style.display="",e},Mi=function(e){null!==e&&null!==e.parentNode&&e.parentNode.removeChild(e)},Hi=function(e,t,n){for(var r=e.querySelectorAll(t),o=0;o<r.length;o++){var i=r[o],s=i.innerText;if(s&&s.trim()===n)return i}return null},zi=function(e){for(var t,n=(e=String(e)).length,r=-1,o="",i=e.charCodeAt(0);++r<n;)0!=(t=e.charCodeAt(r))?o+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==i?"\\"+t.toString(16)+" ":(0!=r||1!=n||45!=t)&&(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?e.charAt(r):"\\"+e.charAt(r):o+="�";return o},Ji=function(e){return void 0!==e.post_town},Wi=function(e,t){return e.dispatchEvent(function(e){var t=e.event,n=e.bubbles,r=void 0===n||n,o=e.cancelable,i=void 0===o||o;if("function"==typeof window.Event)return new window.Event(t,{bubbles:r,cancelable:i});var s=document.createEvent("Event");return s.initEvent(t,r,i),s}({event:t}))},Ki=function(e){return null!==e&&(e instanceof HTMLSelectElement||"HTMLSelectElement"===e.constructor.name)},Vi=function(e){return null!==e&&(e instanceof HTMLInputElement||"HTMLInputElement"===e.constructor.name)},Gi=function(e){return null!==e&&(e instanceof HTMLTextAreaElement||"HTMLTextAreaElement"===e.constructor.name)},$i=function(e){return Vi(e)||Gi(e)||Ki(e)},Xi=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e&&(Vi(e)||Gi(e))&&es({e:e,value:t,skipTrigger:n})},Yi=function(e,t){return null!==t&&null!==e.querySelector('[value="'.concat(t,'"]'))},Qi=function(e,t){if(null===t)return[];var n=e.querySelectorAll("option");return Array.from(n).filter(function(e){return(e.textContent?e.textContent.replace(/[\n\r]/g,"").replace(/\s+/g," ").trim():"")===t})},Zi=function(e,t){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value");void 0!==n&&(void 0!==n.set&&n.set.call(e,t))},es=function(e){var t,n,r,o;null!==e.value&&(n=(t=e).e,r=t.value,o=t.skipTrigger,null!==r&&Ki(n)&&(Zi(n,r),o||Wi(n,"select"),Wi(n,"change")),function(e){var t=e.e,n=e.value,r=e.skipTrigger;null!==n&&(Vi(t)||Gi(t))&&(Zi(t,n),r||Wi(t,"input"),Wi(t,"change"))}(e))},ts="United Kingdom",ns="Isle of Man",rs=function(e){var t=e.country;if("England"===t)return ts;if("Scotland"===t)return ts;if("Wales"===t)return ts;if("Northern Ireland"===t)return ts;if(t===ns)return ns;if(Ji(e)&&"Channel Islands"===t){if(/^GY/.test(e.postcode))return"Guernsey";if(/^JE/.test(e.postcode))return"Jersey"}return t},os={};"undefined"!=typeof window&&(window.idpcGlobal?os=window.idpcGlobal:window.idpcGlobal=os);var is=function(e){return e.filter(function(e){return Li(e)?!!e.trim():!!e}).join(", ")},ss=function(e,t){if(e.length<=t)return[e,""];for(var n=e.split(" "),r="",o="",i=0;i<n.length;i++){var s=n[i];if(r.length+s.length>t){o=n.slice(i).join(" ");break}r+="".concat(s," ")}return[r.trim(),o.trim()]},us=function(e,t){return 0===t.length?e:"".concat(e,", ").concat(t)},as=function(e,t,n){var r=t.line_1,o=t.line_2,i="line_3"in t?t.line_3:"";return n.maxLineOne||n.maxLineTwo||n.maxLineThree?function(e,t){var n=t.lineCount,r=t.maxLineOne,o=t.maxLineTwo,i=t.maxLineThree,s=["","",""],u=h(e);if(r){var a=d(ss(u[0],r),2),c=a[0],l=a[1];if(s[0]=c,l&&(u[1]=us(l,u[1])),1===n)return s}else if(s[0]=u[0],1===n)return[is(u),"",""];if(o){var f=d(ss(u[1],o),2),p=f[0],y=f[1];if(s[1]=p,y&&(u[2]=us(y,u[2])),2===n)return s}else if(s[1]=u[1],2===n)return[s[0],is(u.slice(1)),""];if(i){var v=d(ss(u[2],i),2),m=v[0],b=v[1];s[2]=m,b&&(u[3]=us(b,u[3]))}else s[2]=u[2];return s}([r,o,i],l({lineCount:e},n)):3===e?[r,o,i]:2===e?[r,is([o,i]),""]:[is([r,o,i]),"",""]},cs=function(e,t){var n=e[t];return"number"==typeof n?n.toString():void 0===n?"":n},ls=function(e,t){var n,r={};for(n in e){var o=e[n];if(void 0!==o){var i=Ni(o,t);$i(i)&&(r[n]=i)}}return r},fs=function(e,t){var n,r={};for(n in e)if(e.hasOwnProperty(n)){var o=e[n],i=Ni('[name="'.concat(o,'"]'),t);if(i)r[n]=i;else{var s=Ni('[aria-name="'.concat(o,'"]'),t);s&&(r[n]=s)}}return r},ds=function(e,t){var n,r={};if(void 0===e)return e;for(n in e)if(e.hasOwnProperty(n)){var o=e[n];if(o){var i=Hi(t,"label",o),s=Ni(i,t);if(s){var u=s.getAttribute("for");if(u){var a=t.querySelector("#".concat(zi(u)));if(a){r[n]=a;continue}}var c=s.querySelector("input");c&&(r[n]=c)}}}return r},hs=["country","country_iso_2","country_iso"],ps=function(e){var t,n,r,o,i=e.config,s=l(l(l({},ls((t=e).outputFields||{},t.config.scope)),fs(t.names||{},t.config.scope)),ds(t.labels||{},t.config.scope));void 0===i.lines&&(i.lines=(r=(n=s).line_2,o=n.line_3,r?o?3:2:1));var u=function(e,t){Ji(e)&&t.removeOrganisation&&vs(e);var n=d(as(t.lines||3,e,t),3),r=n[0],o=n[1],i=n[2];return e.line_1=r,e.line_2=o,Ji(e)&&(e.line_3=i),e}(l({},e.address),i),a=i.scope,c=i.populateCounty,f=[].concat(hs);Ji(u)&&(i.removeOrganisation&&vs(u),!1===c&&f.push("county")),function(e,t){if(e){if(Ki(e)){var n=rs(t);if(Yi(e,n))return void es({e:e,value:n});if(Yi(e,t.country_iso_2))return void es({e:e,value:t.country_iso_2});if(Yi(e,t.country_iso))return void es({e:e,value:t.country_iso});var r=Qi(e,n);if(r.length>0)return void es({e:e,value:r[0].value||""});if((r=Qi(e,t.country_iso_2)).length>0)return void es({e:e,value:r[0].value||""});if((r=Qi(e,t.country_iso)).length>0)return void es({e:e,value:r[0].value||""})}if(Vi(e)){var o=rs(t);es({e:e,value:o})}}}(Ni(s.country||null,a),u);var h=Ni(s.country_iso_2||null,a);if(Ki(h))if(Yi(h,u.country_iso_2))es({e:h,value:u.country_iso_2});else{var p=Qi(h,u.country_iso_2);(p.length>0||(p=Qi(h,rs(u))).length>0)&&es({e:h,value:p[0].value||""})}Vi(h)&&Xi(h,u.country_iso_2||"");var y=Ni(s.country_iso||null,a);if(Ki(y))if(Yi(y,u.country_iso))es({e:y,value:u.country_iso});else{var v=Qi(y,u.country_iso);(v.length>0||(v=Qi(y,rs(u))).length>0)&&es({e:y,value:v[0].value||""})}Vi(y)&&Xi(y,u.country_iso||"");var m,b=Ni(ms(s),a),g=bs(u),w=gs(u);if(Ki(b))if(Yi(b,g))es({e:b,value:g});else if(Yi(b,w||""))es({e:b,value:w||""});else{var E=Qi(b,w);(E.length>0||(E=Qi(b,g)))&&es({e:b,value:E[0].value||""})}for(m in Vi(b)&&Xi(b,g),s)if(!f.includes(m))if(m.startsWith("native."))ys(m,s,u,a);else if(void 0!==u[m]&&s.hasOwnProperty(m)){var S=s[m];if(!S)continue;Xi(Ni(S,a),cs(u,m))}},ys=function(e,t,n,r){var o=e.replace("native.",""),i=n.native;if(void 0!==i&&(void 0!==i[o]&&t.hasOwnProperty(e))){var s=t[e];if(!s)return;Xi(Ni(s,r),cs(i,o))}},vs=function(e){return 0===e.organisation_name.length||0===e.line_2.length&&0===e.line_3.length||e.line_1===e.organisation_name&&(e.line_1=e.line_2,e.line_2=e.line_3,e.line_3=""),e},ms=function(e){return function(e){return e.hasOwnProperty("state_abbreviation")}(e)?e.state_abbreviation||null:e.county_code||null},bs=function(e){return Ji(e)?e.county_code:e.state_abbreviation},gs=function(e){return Ji(e)?e.county:e.state},ws={13:"Enter",38:"ArrowUp",40:"ArrowDown",36:"Home",35:"End",27:"Escape",8:"Backspace"},Es=["Enter","ArrowUp","ArrowDown","Home","End","Escape","Backspace"],Ss=function(e){return e.keyCode?ws[e.keyCode]||null:(t=e.key,-1!==Es.indexOf(t)?e.key:null);var t},Os=function(e,t,n){var r,o,i,s,u;if("function"!=typeof e)throw new TypeError("Expected a function");function a(e){var n=e-u;return void 0===u||n>=t||n<0||false}function c(){var n=Date.now();if(a(n))return function(){if(s=void 0,r)return t=r,n=o,r=o=void 0,i=e.apply(n,t);var t,n;return r=o=void 0,i}();s=setTimeout(c,function(e){return t-(e-u)}(n))}function l(){for(var e=Date.now(),n=a(e),l=arguments.length,f=new Array(l),d=0;d<l;d++)f[d]=arguments[d];return r=f,o=this,u=e,n&&void 0===s?(s=setTimeout(c,t),i):(void 0===s&&(s=setTimeout(c,t)),i)}return t=+t||0,y(n),l.cancel=function(){void 0!==s&&clearTimeout(s),r=u=o=s=void 0},l.pending=function(){return void 0!==s},l},As=function(e){var t=e.bind,n=e.interval,r=void 0===n?1e3:n,o=null,i=function(){null!==o&&(window.clearInterval(o),o=null)};return{start:function(){return o=window.setInterval(function(){try{t()}catch(e){i()}},r)},stop:i}},Ts=function(e){return window&&window.MutationObserver&&e.mutationObserver?function(e){var t=e.bind,n=e.interval,r=void 0===n?1e3:n,o=e.target,i=void 0===o?window.document:o,s=e.observerConfig,u=void 0===s?{subtree:!0,childList:!0}:s,a=new MutationObserver(Os(function(){try{t()}catch(e){c()}},r)),c=function(){return a.disconnect()};return{start:function(){return a.observe(i,u),null},stop:c}}(e):As(e)},_s=function(e){return e.preventDefault&&e.preventDefault(),!1},Cs=function(){},js=function(){return!1},ks=function(e){if("Enter"===Ss(e))return e.preventDefault(),this.handleClick(),!1},Rs=function(e){return e.cancelable&&e.preventDefault(),this.options.onButtonTrigger.call(this),this.handleClick(),!1},xs=function(){var e=this.select.value.split("-");if("next"!==e[0]){var t=parseInt(this.select.value,10);isNaN(t)||this.selectAddress(t)}else{var n=parseInt(e[1],10);if(isNaN(n))return;this.executeSearch(this.lastLookup,n)}},Ps={apiKey:"",checkKey:!0,context:"",outputScope:null,onButtonTrigger:Cs,onSearchCompleted:Cs,onAddressesRetrieved:Cs,onAddressSelected:Cs,onSelectCreated:Cs,onSelectRemoved:Cs,onLookupTriggered:Cs,shouldLookupTrigger:function(){return!0},onSearchError:Cs,onLoaded:Cs,onFailedCheck:Cs,onRemove:Cs,onAddressPopulated:Cs,onUnhide:Cs,input:null,inputId:null,inputClass:"idpc-input",inputAriaLabel:"Search a postcode to retrieve your address",placeholder:"Search your postcode",button:null,buttonId:null,buttonLabel:"Find my Address",buttonClass:"idpc-button",selectContainer:null,selectId:null,selectClass:"idpc-select",selectContainerId:null,selectContainerClass:"idpc-select-container",selectAriaLabel:"Select your address",unhide:null,unhideClass:"idpc-unhide",message:null,messageId:null,messageClass:"idpc-error",msgSelect:"Please select your address",msgDisabled:"Finding addresses...",msgNotFound:"Your postcode could not be found. Please type in your address",msgAddressNotFound:"We could not find a match for your address. Please type in your address",msgError:"Sorry, we weren't able to get the address you were looking for. Please type in your address",msgUnhide:"Enter address manually",cooloff:500,removeOrganisation:!1,selectSinglePremise:!1,titleizePostTown:!0,postcodeSearchFormatter:function(e){var t=[e.line_1];return""!==e.line_2&&t.push(e.line_2),""!==e.line_3&&t.push(e.line_3),t.join(", ")},addressSearchFormatter:function(e){var t=[e.line_1];return""!==e.line_2&&t.push(e.line_2),t.push(e.post_town),t.push(e.postcode_outward),t.join(", ")},outputFields:{},strictlyPostcodes:!0,limit:10,inputStyle:{},buttonStyle:{},messageStyle:{},selectStyle:{},contextStyle:{},hide:[],autocomplete:"none",populateCounty:!0},Ls=function(){return o(function e(t){var n,o=this;r(this,e),this.prevContext=null,this.options=l(l(l({},{scope:window.document,document:window.document}),Ps),t),this.client=new Pi(l(l({},this.options),{},{api_key:this.options.apiKey})),this.scope=Di(this.options.scope),this.document=(n=this.scope)instanceof Document||"HTMLDocument"===n.constructor.name?n:n.ownerDocument?n.ownerDocument:Ui(),this.outputScope=this.findOrCreate(this.options.outputScope,function(){return o.scope}),this.data=[],this.lastLookup="",this.context=this.findOrCreate(this.options.context),this.prevContext=Bi(this.context,this.options.contextStyle),this.keypress=ks.bind(this),this.click=Rs.bind(this),this.selectEvent=xs.bind(this),this.unhideEvent=this.unhideFields.bind(this),this.input=this.createInput(),this.button=this.createButton(),this.message=this.createMessage(),this.select=this.createSelect(),this.selectContainer=this.createContainer(),this.unhide=this.createUnhide(),this.init()},[{key:"findOrCreate",value:function(e,t){return Li(e)?this.scope.querySelector(e):t&&null===e?t():e}},{key:"createUnhide",value:function(){var e=this,t=this.findOrCreate(this.options.unhide,function(){var t=e.document.createElement("p");return t.innerText=e.options.msgUnhide,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),e.options.unhideClass&&(t.className=e.options.unhideClass),t});return t.addEventListener("click",this.unhideEvent),t.addEventListener("keyup",function(t){return"Enter"===t.key&&e.unhideEvent(t)}),t}},{key:"unmountUnhide",value:function(){this.unhide.removeEventListener("click",this.unhideEvent),!this.options.unhide&&this.options.hide.length&&Mi(this.unhide)}},{key:"createContainer",value:function(){var e=this;return this.findOrCreate(this.options.selectContainer,function(){var t=e.options,n=e.document.createElement("div");return t.selectContainerId&&(n.id=t.selectContainerId),t.selectContainerClass&&(n.className=t.selectContainerClass),n.setAttribute("aria-live","polite"),qi(n),n})}},{key:"unmountContainer",value:function(){Mi(this.selectContainer)}},{key:"createInput",value:function(){var e=this,t=this.findOrCreate(this.options.input,function(){var t=e.document.createElement("input"),n=e.options;return t.type="text",n.inputId&&(t.id=n.inputId),n.inputClass&&(t.className=n.inputClass),n.placeholder&&(t.placeholder=n.placeholder),n.inputAriaLabel&&t.setAttribute("aria-label",n.inputAriaLabel),n.autocomplete&&t.setAttribute("autocomplete",n.autocomplete),Bi(t,e.options.inputStyle),t});return t.addEventListener("keypress",this.keypress),t.addEventListener("submit",js),t}},{key:"unmountInput",value:function(){this.input.removeEventListener("keypress",this.keypress),this.input.removeEventListener("submit",js),null===this.options.input&&Mi(this.input)}},{key:"createButton",value:function(){var e=this,t=this.findOrCreate(this.options.button,function(){var t=e.document.createElement("button"),n=e.options;return t.type="button",n.buttonLabel&&(t.innerText=n.buttonLabel),n.buttonId&&(t.id=n.buttonId),n.buttonClass&&(t.className=n.buttonClass),Bi(t,e.options.buttonStyle),t.onclick=_s,t});return t.addEventListener("submit",js),t.addEventListener("click",this.click),t}},{key:"unmountButton",value:function(){this.button.removeEventListener("submit",js),this.button.removeEventListener("click",this.click),null===this.options.button&&Mi(this.button)}},{key:"createMessage",value:function(){var e=this;return this.findOrCreate(this.options.message,function(){var t=e.document.createElement("p"),n=e.options;return n.messageClass&&(t.className=n.messageClass),n.messageId&&(t.id=n.messageId),t.setAttribute("role","alert"),Bi(t,e.options.messageStyle),qi(t),t})}},{key:"unmountMessage",value:function(){null===this.options.message&&Mi(this.message)}},{key:"createSelect",value:function(){var e=this.document.createElement("select"),t=this.options;return t.selectId&&(e.id=t.selectId),t.selectClass&&(e.className=t.selectClass),Bi(e,this.options.selectStyle),t.selectAriaLabel&&e.setAttribute("aria-label",t.selectAriaLabel),e.addEventListener("change",this.selectEvent),e}},{key:"mountSelect",value:function(e,t){e&&(this.data=e),function(e){var t;for(t=e.options.length-1;t>=0;t--)e.remove(t)}(this.select),this.select.appendChild(this.createOption("ideal",this.options.msgSelect));for(var n=0;n<this.data.length;n+=1)this.select.appendChild(this.createOption(n.toString(),this.formatAddress(this.data[n])));t&&(this.select.appendChild(this.createOption("blank","")),this.select.appendChild(this.createOption("next-"+String(t),"-- Show more addresses at this postcode (page "+(t+1)+") --"))),this.selectContainer.appendChild(this.select),Ii(this.selectContainer),this.options.onSelectCreated.call(this,this.select)}},{key:"unmountSelect",value:function(){Mi(this.select),qi(this.selectContainer),this.options.onSelectRemoved.call(this)}},{key:"selectAddress",value:function(e){var t=this.data[e];t&&(this.populateAddress(t),this.options.onAddressSelected.call(this,t))}},{key:"handleClick",value:function(){if(!this.options.shouldLookupTrigger.call(this))return!1;this.options.onLookupTriggered.call(this);var e=this.input.value;return this.lastLookup===e||(this.lastLookup=e,this.reset(),this.disableButton(),this.executeSearch(e)),!1}},{key:"disableButton",value:function(e){this.options.button||(this.button.setAttribute("disabled","true"),this.button.innerText=e||this.options.msgDisabled)}},{key:"enableButton",value:function(){this.options.button||(this.button.removeAttribute("disabled"),this.button.innerText=this.options.buttonLabel)}},{key:"enableLookup",value:function(){var e=this;if(!this.options.button){var t=this.options.cooloff;if(0===t)return this.enableButton();setTimeout(function(){return e.enableButton()},t)}}},{key:"reset",value:function(){this.unmountSelect(),this.hideMessage()}},{key:"removeAll",value:function(){var e,t;this.unmountInput(),this.unmountButton(),this.unmountContainer(),this.unmountMessage(),this.unmountUnhide(),e=this.context,t=this.prevContext,e.setAttribute("style",t||""),this.options.onRemove.call(this)}},{key:"notFoundMessage",value:function(){return this.options.strictlyPostcodes?this.options.msgNotFound:this.options.msgAddressNotFound}},{key:"executeSearch",value:function(e,t){var n=this;return this.enableLookup(),(this.options.strictlyPostcodes?this.searchPostcode(e,t):this.searchAddress(e,t)).catch(function(e){if(e instanceof X==!1)throw e;var t=e.response.body.suggestions||[];return t.length>1?(n.suggestionsMessage(t),null):1===t.length?(n.input.value=t[0],n.executeSearch(t[0]),null):"not_found"}).then(function(t){if(null!==t){if("not_found"===t)return n.options.onSearchCompleted.call(n,null,[]),n.setMessage(n.notFoundMessage());var r,o=t.addresses,i=t.total,s=t.page,u=t.limit;if(n.options.onSearchCompleted.call(n,null,o),0===o.length)return n.setMessage(n.notFoundMessage());if(n.setMessage(),n.lastLookup=e,n.data=o,n.options.onAddressesRetrieved.call(n,o),n.options.selectSinglePremise&&1===o.length)return n.selectAddress(0);i>(s+1)*u&&(r=s+1),n.mountSelect(o,r)}}).catch(function(e){n.setMessage(n.options.msgError),n.options.onSearchCompleted.call(n,null,[]),n.options.onSearchError.call(n,e)})}},{key:"suggestionsMessage",value:function(e){var t=this,n=this.document.createElement("span");n.innerHTML="We couldn't find <b>".concat(this.input.value,"</b>. Did you mean "),e.forEach(function(r,o){var i=t.document.createElement("a");0===o?i.innerText="".concat(r):o===e.length-1?i.innerText=" or ".concat(r):i.innerText=", ".concat(r),i.style.cursor="pointer",i.addEventListener("click",function(e){e.preventDefault(),t.input.value=r,t.executeSearch(r),t.hideMessage()}),n.appendChild(i)}),Ii(this.message),this.message.innerHTML="",this.message.appendChild(n)}},{key:"searchPostcode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=function(e){var t={},n={},r=e.client;U({client:r,header:t,options:e}),B({header:t,options:e}),q({query:n,options:e}),I({client:r,query:n,options:e});var o={header:t,query:n};return void 0!==e.timeout&&(o.timeout=e.timeout),o}({client:this.client});return t>0&&(n.query.page=String(t)),function(e,t,n){return oe({resource:"postcodes",client:e})(t,n)}(this.client,e,n).then(function(e){return{addresses:e.body.result,page:e.body.page,total:e.body.total,limit:e.body.limit}})}},{key:"searchAddress",value:function(e,t){var n=function(e){var t={},n={query:e.query},r=e.client;U({client:r,header:t,options:e}),B({header:t,options:e}),q({query:n,options:e}),I({client:r,query:n,options:e}),function(e){var t=e.query,n=e.options,r=n.page,o=n.limit;void 0!==r&&(t.page=r.toString()),void 0!==o&&(t.limit=o.toString())}({query:n,options:e});var o={header:t,query:n};return void 0!==e.timeout&&(o.timeout=e.timeout),o}({client:this.client,query:e,limit:this.options.limit});return ie(this.client,n).then(function(e){return{addresses:e.body.result.hits,page:e.body.result.page,total:e.body.result.hits.length,limit:e.body.result.limit}})}},{key:"formatAddress",value:function(e){return(this.options.strictlyPostcodes?this.options.postcodeSearchFormatter:this.options.addressSearchFormatter)(e)}},{key:"createOption",value:function(e,t){var n=this.document.createElement("option");return n.text=t,n.value=e,n}},{key:"setMessage",value:function(e){if(this.message){if(void 0===e)return this.hideMessage();Ii(this.message),this.message.innerText=e}}},{key:"hideMessage",value:function(){this.message&&(this.message.innerText="",qi(this.message))}},{key:"init",value:function(){var e=this,t=function(){e.render(),e.hideFields(),e.options.onLoaded.call(e)};if(!this.options.checkKey)return t();se({client:this.client}).then(function(e){return e.available?t():E.reject("Key not available")}).catch(function(t){e.options.onFailedCheck&&e.options.onFailedCheck(t)})}},{key:"populateAddress",value:function(e){this.unhideFields();var t=this.options.outputFields,n=l(l({},this.options),{},{scope:this.outputScope});ps({outputFields:t,address:e,config:n}),this.options.onAddressPopulated.call(this,e)}},{key:"hiddenFields",value:function(){var e=this;return this.options.hide.map(function(t){return Li(t)?(n=e.scope,(r=t)?n.querySelector(r):null):t;var n,r}).filter(function(e){return null!==e})}},{key:"hideFields",value:function(){this.hiddenFields().forEach(qi)}},{key:"unhideFields",value:function(){this.hiddenFields().forEach(Ii),this.options.onUnhide.call(this)}},{key:"render",value:function(){this.context.innerHTML="",this.options.input||this.context.appendChild(this.input),this.options.button||this.context.appendChild(this.button),this.options.selectContainer||this.context.appendChild(this.selectContainer),this.options.message||this.context.appendChild(this.message),!this.options.unhide&&this.options.hide.length&&this.context.appendChild(this.unhide)}}])}(),Fs=function(e){var t=new Ls(e);return Ns.push(t),t},Ns=[],Us=function(){return!0},Ds=function(){},Bs=function(e){return function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Fi,r=e,o=t.toUpperCase();"HTML"!==r.tagName;){if(r.tagName===o&&n(r))return r;if(null===r.parentNode)return null;r=r.parentNode}return null}(e,"FORM")},qs=function(e,t){var n,r=Di(e.scope||null).querySelectorAll(e.anchor||e.context||e.scope);return(n=r,Array.prototype.slice.call(n)).filter(function(e){return!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"idpc";return"true"===e.getAttribute(t)}(e,t)})},Is=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.pageTest,o=void 0===r?Us:r,i=n.onError,s=void 0===i?Ds:i,u=n.onBindAttempt,a=void 0===u?Ds:u,c=n.onBind,f=void 0===c?Ds:c,d=n.anchor,h=n.onAnchorFound,p=void 0===h?Ds:h,y=n.getScope,v=void 0===y?Bs:y,m=n.marker,b=void 0===m?"idpc-pl":m,g=Ts({bind:function(){try{a(e),qs(l({anchor:d},e),b).forEach(function(n){if(o()){var r=v(n);p({anchor:n,scope:r,config:e}),t=Fs(e),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"idpc";e.setAttribute(t,"true")}(n,b),f(t)}})}catch(e){s(e)}}}),w=g.start,E=g.stop;return w(),{start:w,stop:E,controller:t}},Ms={controllers:Ns,setup:Fs,Controller:Ls,defaults:Ps,watch:Is};e.Controller=Ls,e.PostcodeLookup=Ms,e.watch=Is});
