UNPKG

vue-dadata

Version:

Vue component for hinting addresses using dadata.ru

7 lines (6 loc) 50.6 kB
(function(O,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],E):(O=typeof globalThis<"u"?globalThis:O||self,E(O.VueDadata={},O.Vue))})(this,function(O,E){"use strict";function ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M={},Ae;function lt(){if(Ae)return M;Ae=1,M.remove=u;for(var e=[{base:" ",chars:" "},{base:"0",chars:"߀"},{base:"A",chars:"ⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",chars:"Ꜳ"},{base:"AE",chars:"ÆǼǢ"},{base:"AO",chars:"Ꜵ"},{base:"AU",chars:"Ꜷ"},{base:"AV",chars:"ꜸꜺ"},{base:"AY",chars:"Ꜽ"},{base:"B",chars:"ⒷBḂḄḆɃƁ"},{base:"C",chars:"ⒸCꜾḈĆCĈĊČÇƇȻ"},{base:"D",chars:"ⒹDḊĎḌḐḒḎĐƊƉᴅꝹ"},{base:"Dh",chars:"Ð"},{base:"DZ",chars:"DZDŽ"},{base:"Dz",chars:"DzDž"},{base:"E",chars:"ɛⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎᴇ"},{base:"F",chars:"ꝼⒻFḞƑꝻ"},{base:"G",chars:"ⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾɢ"},{base:"H",chars:"ⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",chars:"ⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",chars:"ⒿJĴɈȷ"},{base:"K",chars:"ⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",chars:"ⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",chars:"LJ"},{base:"Lj",chars:"Lj"},{base:"M",chars:"ⓂMḾṀṂⱮƜϻ"},{base:"N",chars:"ꞤȠⓃNǸŃÑṄŇṆŅṊṈƝꞐᴎ"},{base:"NJ",chars:"NJ"},{base:"Nj",chars:"Nj"},{base:"O",chars:"ⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OE",chars:"Œ"},{base:"OI",chars:"Ƣ"},{base:"OO",chars:"Ꝏ"},{base:"OU",chars:"Ȣ"},{base:"P",chars:"ⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",chars:"ⓆQꝖꝘɊ"},{base:"R",chars:"ⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",chars:"ⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",chars:"ⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"Th",chars:"Þ"},{base:"TZ",chars:"Ꜩ"},{base:"U",chars:"ⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",chars:"ⓋVṼṾƲꝞɅ"},{base:"VY",chars:"Ꝡ"},{base:"W",chars:"ⓌWẀẂŴẆẄẈⱲ"},{base:"X",chars:"ⓍXẊẌ"},{base:"Y",chars:"ⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",chars:"ⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",chars:"ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐɑ"},{base:"aa",chars:"ꜳ"},{base:"ae",chars:"æǽǣ"},{base:"ao",chars:"ꜵ"},{base:"au",chars:"ꜷ"},{base:"av",chars:"ꜹꜻ"},{base:"ay",chars:"ꜽ"},{base:"b",chars:"ⓑbḃḅḇƀƃɓƂ"},{base:"c",chars:"cⓒćĉċčçḉƈȼꜿↄ"},{base:"d",chars:"ⓓdḋďḍḑḓḏđƌɖɗƋᏧԁꞪ"},{base:"dh",chars:"ð"},{base:"dz",chars:"dzdž"},{base:"e",chars:"ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇǝ"},{base:"f",chars:"ⓕfḟƒ"},{base:"ff",chars:"ff"},{base:"fi",chars:"fi"},{base:"fl",chars:"fl"},{base:"ffi",chars:"ffi"},{base:"ffl",chars:"ffl"},{base:"g",chars:"ⓖgǵĝḡğġǧģǥɠꞡꝿᵹ"},{base:"h",chars:"ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",chars:"ƕ"},{base:"i",chars:"ⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",chars:"ⓙjĵǰɉ"},{base:"k",chars:"ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",chars:"ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇɭ"},{base:"lj",chars:"lj"},{base:"m",chars:"ⓜmḿṁṃɱɯ"},{base:"n",chars:"ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥлԉ"},{base:"nj",chars:"nj"},{base:"o",chars:"ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿꝋꝍɵɔᴑ"},{base:"oe",chars:"œ"},{base:"oi",chars:"ƣ"},{base:"oo",chars:"ꝏ"},{base:"ou",chars:"ȣ"},{base:"p",chars:"ⓟpṕṗƥᵽꝑꝓꝕρ"},{base:"q",chars:"ⓠqɋꝗꝙ"},{base:"r",chars:"ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",chars:"ⓢsśṥŝṡšṧṣṩșşȿꞩꞅẛʂ"},{base:"ss",chars:"ß"},{base:"t",chars:"ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"th",chars:"þ"},{base:"tz",chars:"ꜩ"},{base:"u",chars:"ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",chars:"ⓥvṽṿʋꝟʌ"},{base:"vy",chars:"ꝡ"},{base:"w",chars:"ⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",chars:"ⓧxẋẍ"},{base:"y",chars:"ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",chars:"ⓩzźẑżžẓẕƶȥɀⱬꝣ"}],t={},n=0;n<e.length;n+=1)for(var s=e[n].chars,r=0;r<s.length;r+=1)t[s[r]]=e[n].base;function u(o){return o.replace(/[^\u0000-\u007e]/g,function(a){return t[a]||a})}return M.replacementList=e,M.diacriticsMap=t,M}var ft=lt();const oe=ct(ft),Fe=e=>e.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),dt=e=>{let t;if(e.query instanceof RegExp)return new RegExp(String.raw`(${e.query.source})`,"g"+(e.caseSensitive?"":"i"));const n=(s=>{if(s==="partial")return r=>Fe(r);{const r=String.raw`[\s/(\[{<'"|(『「\u3000]`,u=String.raw`[.,\s/)\]}>:;'"!?|)』」。、\u3000]`;return o=>String.raw`(?<=^|${r})${Fe(o)}(?=$|${u})`}})(e.matchMode);if(e.splitBySpace){const s=e.query.trim().replace(/\s+/g," ");t=String.raw`(${s.split(/\s/).map(n).join("|")})`}else t=String.raw`(${n(e.query)})`;return new RegExp(String.raw`${t}`,"g"+(e.caseSensitive?"":"i"))},ie=(e,t,n=!1)=>{if(!t.query||t.query instanceof String&&!t.query.trim())return e;let s=e,r=t.query,u=!1;t.diacriticsSensitive||(s=oe.remove(s),r=t.query instanceof RegExp?new RegExp(oe.remove(t.query.source)):oe.remove(t.query),u=s!==e);const o=dt({query:r,splitBySpace:t.splitBySpace,caseSensitive:t.caseSensitive,matchMode:t.matchMode}),a=s.split(o),f=u?((l,c)=>{const d=[];return c.forEach(y=>{const A=d.join("").length,h=A+y.length;d.push(l.slice(A,h))}),d})(e,a):a;return n?a.map((l,c)=>{if(o.test(l)){const d=t.highlightClass?` class="${t.highlightClass}"`:"",y=t.highlightStyle?` style="${t.highlightStyle}"`:"";return`<${t.highlightTag}${d}${y}>${f[c]}</${t.highlightTag}>`}return f[c]}).join(""):a.map((l,c)=>o.test(l)?E.h(t.highlightTag,{class:t.highlightClass,style:t.highlightStyle},f[c]):f[c])},Ce=e=>typeof e=="string"?[]:e.filter(t=>typeof t!="string").map(t=>typeof t=="string"?t:t.children);var ht=E.defineComponent({name:"VueWordHighlighter",props:{query:{type:[String,RegExp],required:!0,default:""},caseSensitive:{type:Boolean,default:!1},diacriticsSensitive:{type:Boolean,default:!1},splitBySpace:{type:Boolean,default:!1},matchMode:{type:String,default:"partial"},highlightClass:{type:[Object,String,Array],default:""},highlightStyle:{type:[Object,String,Array],default:""},highlightTag:{type:String,default:"mark"},wrapperTag:{type:String,default:"span"},wrapperClass:{type:[Object,String,Array],default:""},textToHighlight:{type:String,default:""},htmlToHighlight:{type:String,default:""}},emits:["matches"],setup:(e,t)=>()=>{if(e.htmlToHighlight){const n=`(<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)`,s=e.htmlToHighlight.split(new RegExp(n,"gs")),r=s.map((u,o)=>new RegExp(n).test(u)||o>0&&s[o-1].startsWith("<script")?u:ie(u,{query:e.query,splitBySpace:e.splitBySpace,caseSensitive:e.caseSensitive,diacriticsSensitive:e.diacriticsSensitive,matchMode:e.matchMode,highlightTag:e.highlightTag,highlightClass:e.highlightClass,highlightStyle:e.highlightStyle},!0)).join("");return E.h(e.wrapperTag,{class:e.wrapperClass,innerHTML:r})}if(e.textToHighlight){const n=ie(e.textToHighlight,{query:e.query,splitBySpace:e.splitBySpace,caseSensitive:e.caseSensitive,diacriticsSensitive:e.diacriticsSensitive,matchMode:e.matchMode,highlightTag:e.highlightTag,highlightClass:e.highlightClass,highlightStyle:e.highlightStyle});return t.emit("matches",Ce(n)),E.h(e.wrapperTag,{class:e.wrapperClass},n)}if(t.slots&&t.slots.default){const n=r=>{if(r.type===E.Comment)return r;if(typeof r.children=="string"){const u=ie(r.children,{query:e.query,splitBySpace:e.splitBySpace,caseSensitive:e.caseSensitive,diacriticsSensitive:e.diacriticsSensitive,matchMode:e.matchMode,highlightTag:e.highlightTag,highlightClass:e.highlightClass,highlightStyle:e.highlightStyle}),o=Ce(u);return t.emit("matches",o),o.length===0?r:typeof r.type=="string"?E.h(r.type,{...r.props},[E.h(e.wrapperTag,{class:e.wrapperClass},u)]):E.h(e.wrapperTag,{class:e.wrapperClass},u)}return E.h(r.type,{...r.props},Array.isArray(r.children)?r.children.map(u=>n(u)):[])},s=t.slots.default();return Array.isArray(s)?s.map(r=>n(r)):s}}}),k=(e=>(e.Enter="enter",e.Esc="esc",e.Up="up",e.Down="down",e))(k||{});const pt={COUNTRY:"country",REGION:"region",AREA:"area",CITY:"city",SETTLEMENT:"settlement",STREET:"street",HOUSE:"house",FLAT:"flat"},q={container:"vue-dadata",search:"vue-dadata__search",input:"vue-dadata__input",suggestions:"vue-dadata__suggestions",suggestionItem:"vue-dadata__suggestions-item",suggestionCurrentItem:"vue-dadata__suggestions-item_current"},L={caseSensitive:!1,splitBySpace:!1,highlightTag:"mark",highlightClass:"vue-dadata__suggestion-item-text_highlight",highlightStyle:"",wrapperTag:"span",wrapperClass:""},Et=e=>E.computed(()=>({container:e?.container??q.container,search:e?.search??q.search,input:e?.input??q.input,suggestions:e?.suggestions??q.suggestions,suggestionItem:e?.suggestionItem??q.suggestionItem,suggestionCurrentItem:e?.suggestionCurrentItem??q.suggestionCurrentItem})),mt=e=>E.computed(()=>({caseSensitive:e?.caseSensitive??L.caseSensitive,splitBySpace:e?.splitBySpace??L.splitBySpace,highlightTag:e?.highlightTag??L.highlightTag,highlightClass:e?.highlightClass??L.highlightClass,highlightStyle:e?.highlightStyle??L.highlightStyle,wrapperTag:e?.wrapperTag??L.wrapperTag,wrapperClass:e?.wrapperClass??L.wrapperClass}));function gt(e){const[t,n="ms"]=String(e).split(/(ms|s)/i),s={ms:1,s:1e3};return Number(t)*s[n]}function yt(e,t){let n=null;const s=typeof t=="number"?t:gt(t),r=function(...u){const o=()=>{n=null,e.apply(this,u)};clearTimeout(n),n=setTimeout(o,s),n||e.apply(this,u)};return r.cancel=()=>{clearTimeout(n),n=null},r}function Se(e,t){return function(){return e.apply(t,arguments)}}const{toString:bt}=Object.prototype,{getPrototypeOf:ae}=Object,{iterator:J,toStringTag:we}=Symbol,W=(e=>t=>{const n=bt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),x=e=>(e=e.toLowerCase(),t=>W(t)===e),X=e=>t=>typeof t===e,{isArray:v}=Array,$=X("undefined");function At(e){return e!==null&&!$(e)&&e.constructor!==null&&!$(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const De=x("ArrayBuffer");function Ft(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&De(e.buffer),t}const Ct=X("string"),T=X("function"),Be=X("number"),G=e=>e!==null&&typeof e=="object",St=e=>e===!0||e===!1,Y=e=>{if(W(e)!=="object")return!1;const t=ae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(we in e)&&!(J in e)},wt=x("Date"),Dt=x("File"),Bt=x("Blob"),Tt=x("FileList"),Rt=e=>G(e)&&T(e.pipe),Ot=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||T(e.append)&&((t=W(e))==="formdata"||t==="object"&&T(e.toString)&&e.toString()==="[object FormData]"))},xt=x("URLSearchParams"),[Nt,Pt,Lt,Ut]=["ReadableStream","Request","Response","Headers"].map(x),qt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function V(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),v(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{const u=n?Object.getOwnPropertyNames(e):Object.keys(e),o=u.length;let a;for(s=0;s<o;s++)a=u[s],t.call(null,e[a],a,e)}}function Te(e,t){t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const I=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Re=e=>!$(e)&&e!==I;function ce(){const{caseless:e}=Re(this)&&this||{},t={},n=(s,r)=>{const u=e&&Te(t,r)||r;Y(t[u])&&Y(s)?t[u]=ce(t[u],s):Y(s)?t[u]=ce({},s):v(s)?t[u]=s.slice():t[u]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&V(arguments[s],n);return t}const kt=(e,t,n,{allOwnKeys:s}={})=>(V(t,(r,u)=>{n&&T(r)?e[u]=Se(r,n):e[u]=r},{allOwnKeys:s}),e),It=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jt=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},_t=(e,t,n,s)=>{let r,u,o;const a={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),u=r.length;u-- >0;)o=r[u],(!s||s(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&ae(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Ht=e=>{if(!e)return null;if(v(e))return e;let t=e.length;if(!Be(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Mt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ae(Uint8Array)),$t=(e,t)=>{const s=(e&&e[J]).call(e);let r;for(;(r=s.next())&&!r.done;){const u=r.value;t.call(e,u[0],u[1])}},Vt=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},zt=x("HTMLFormElement"),Kt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),Oe=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Jt=x("RegExp"),xe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};V(n,(r,u)=>{let o;(o=t(r,u,e))!==!1&&(s[u]=o||r)}),Object.defineProperties(e,s)},Wt=e=>{xe(e,(t,n)=>{if(T(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(T(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Xt=(e,t)=>{const n={},s=r=>{r.forEach(u=>{n[u]=!0})};return v(e)?s(e):s(String(e).split(t)),n},Gt=()=>{},Yt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Zt(e){return!!(e&&T(e.append)&&e[we]==="FormData"&&e[J])}const Qt=e=>{const t=new Array(10),n=(s,r)=>{if(G(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[r]=s;const u=v(s)?[]:{};return V(s,(o,a)=>{const f=n(o,r+1);!$(f)&&(u[a]=f)}),t[r]=void 0,u}}return s};return n(e,0)},en=x("AsyncFunction"),tn=e=>e&&(G(e)||T(e))&&T(e.then)&&T(e.catch),Ne=((e,t)=>e?setImmediate:t?((n,s)=>(I.addEventListener("message",({source:r,data:u})=>{r===I&&u===n&&s.length&&s.shift()()},!1),r=>{s.push(r),I.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",T(I.postMessage)),nn=typeof queueMicrotask<"u"?queueMicrotask.bind(I):typeof process<"u"&&process.nextTick||Ne,i={isArray:v,isArrayBuffer:De,isBuffer:At,isFormData:Ot,isArrayBufferView:Ft,isString:Ct,isNumber:Be,isBoolean:St,isObject:G,isPlainObject:Y,isReadableStream:Nt,isRequest:Pt,isResponse:Lt,isHeaders:Ut,isUndefined:$,isDate:wt,isFile:Dt,isBlob:Bt,isRegExp:Jt,isFunction:T,isStream:Rt,isURLSearchParams:xt,isTypedArray:Mt,isFileList:Tt,forEach:V,merge:ce,extend:kt,trim:qt,stripBOM:It,inherits:jt,toFlatObject:_t,kindOf:W,kindOfTest:x,endsWith:vt,toArray:Ht,forEachEntry:$t,matchAll:Vt,isHTMLForm:zt,hasOwnProperty:Oe,hasOwnProp:Oe,reduceDescriptors:xe,freezeMethods:Wt,toObjectSet:Xt,toCamelCase:Kt,noop:Gt,toFiniteNumber:Yt,findKey:Te,global:I,isContextDefined:Re,isSpecCompliantForm:Zt,toJSONObject:Qt,isAsyncFn:en,isThenable:tn,setImmediate:Ne,asap:nn,isIterable:e=>e!=null&&T(e[J])};function g(e,t,n,s,r){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),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}i.inherits(g,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:i.toJSONObject(this.config),code:this.code,status:this.status}}});const Pe=g.prototype,Le={};["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=>{Le[e]={value:e}}),Object.defineProperties(g,Le),Object.defineProperty(Pe,"isAxiosError",{value:!0}),g.from=(e,t,n,s,r,u)=>{const o=Object.create(Pe);return i.toFlatObject(e,o,function(f){return f!==Error.prototype},a=>a!=="isAxiosError"),g.call(o,e.message,t,n,s,r),o.cause=e,o.name=e.name,u&&Object.assign(o,u),o};const sn=null;function le(e){return i.isPlainObject(e)||i.isArray(e)}function Ue(e){return i.endsWith(e,"[]")?e.slice(0,-2):e}function qe(e,t,n){return e?e.concat(t).map(function(r,u){return r=Ue(r),!n&&u?"["+r+"]":r}).join(n?".":""):t}function rn(e){return i.isArray(e)&&!e.some(le)}const un=i.toFlatObject(i,{},null,function(t){return/^is[A-Z]/.test(t)});function Z(e,t,n){if(!i.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=i.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!i.isUndefined(p[m])});const s=n.metaTokens,r=n.visitor||c,u=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&i.isSpecCompliantForm(t);if(!i.isFunction(r))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(i.isDate(h))return h.toISOString();if(i.isBoolean(h))return h.toString();if(!f&&i.isBlob(h))throw new g("Blob is not supported. Use a Buffer instead.");return i.isArrayBuffer(h)||i.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function c(h,m,p){let F=h;if(h&&!p&&typeof h=="object"){if(i.endsWith(m,"{}"))m=s?m:m.slice(0,-2),h=JSON.stringify(h);else if(i.isArray(h)&&rn(h)||(i.isFileList(h)||i.endsWith(m,"[]"))&&(F=i.toArray(h)))return m=Ue(m),F.forEach(function(w,P){!(i.isUndefined(w)||w===null)&&t.append(o===!0?qe([m],P,u):o===null?m:m+"[]",l(w))}),!1}return le(h)?!0:(t.append(qe(p,m,u),l(h)),!1)}const d=[],y=Object.assign(un,{defaultVisitor:c,convertValue:l,isVisitable:le});function A(h,m){if(!i.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),i.forEach(h,function(F,S){(!(i.isUndefined(F)||F===null)&&r.call(t,F,i.isString(S)?S.trim():S,m,y))===!0&&A(F,m?m.concat(S):[S])}),d.pop()}}if(!i.isObject(e))throw new TypeError("data must be an object");return A(e),t}function ke(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function fe(e,t){this._pairs=[],e&&Z(e,this,t)}const Ie=fe.prototype;Ie.append=function(t,n){this._pairs.push([t,n])},Ie.toString=function(t){const n=t?function(s){return t.call(this,s,ke)}:ke;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function on(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function je(e,t,n){if(!t)return e;const s=n&&n.encode||on;i.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let u;if(r?u=r(t,n):u=i.isURLSearchParams(t)?t.toString():new fe(t,n).toString(s),u){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+u}return e}class _e{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){i.forEach(this.handlers,function(s){s!==null&&t(s)})}}const ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},an={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:fe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},de=typeof window<"u"&&typeof document<"u",he=typeof navigator=="object"&&navigator||void 0,cn=de&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),ln=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",fn=de&&window.location.href||"http://localhost",B={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:de,hasStandardBrowserEnv:cn,hasStandardBrowserWebWorkerEnv:ln,navigator:he,origin:fn},Symbol.toStringTag,{value:"Module"})),...an};function dn(e,t){return Z(e,new B.classes.URLSearchParams,Object.assign({visitor:function(n,s,r,u){return B.isNode&&i.isBuffer(n)?(this.append(s,n.toString("base64")),!1):u.defaultVisitor.apply(this,arguments)}},t))}function hn(e){return i.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function pn(e){const t={},n=Object.keys(e);let s;const r=n.length;let u;for(s=0;s<r;s++)u=n[s],t[u]=e[u];return t}function He(e){function t(n,s,r,u){let o=n[u++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),f=u>=n.length;return o=!o&&i.isArray(r)?r.length:o,f?(i.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!i.isObject(r[o]))&&(r[o]=[]),t(n,s,r[o],u)&&i.isArray(r[o])&&(r[o]=pn(r[o])),!a)}if(i.isFormData(e)&&i.isFunction(e.entries)){const n={};return i.forEachEntry(e,(s,r)=>{t(hn(s),r,n,0)}),n}return null}function En(e,t,n){if(i.isString(e))try{return(t||JSON.parse)(e),i.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const z={transitional:ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,u=i.isObject(t);if(u&&i.isHTMLForm(t)&&(t=new FormData(t)),i.isFormData(t))return r?JSON.stringify(He(t)):t;if(i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)||i.isReadableStream(t))return t;if(i.isArrayBufferView(t))return t.buffer;if(i.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(u){if(s.indexOf("application/x-www-form-urlencoded")>-1)return dn(t,this.formSerializer).toString();if((a=i.isFileList(t))||s.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Z(a?{"files[]":t}:t,f&&new f,this.formSerializer)}}return u||r?(n.setContentType("application/json",!1),En(t)):t}],transformResponse:[function(t){const n=this.transitional||z.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(i.isResponse(t)||i.isReadableStream(t))return t;if(t&&i.isString(t)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?g.from(a,g.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};i.forEach(["delete","get","head","post","put","patch"],e=>{z.headers[e]={}});const mn=i.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"]),gn=e=>{const t={};let n,s,r;return e&&e.split(` `).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||t[n]&&mn[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},Me=Symbol("internals");function K(e){return e&&String(e).trim().toLowerCase()}function Q(e){return e===!1||e==null?e:i.isArray(e)?e.map(Q):String(e)}function yn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const bn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function pe(e,t,n,s,r){if(i.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!i.isString(t)){if(i.isString(s))return t.indexOf(s)!==-1;if(i.isRegExp(s))return s.test(t)}}function An(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Fn(e,t){const n=i.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,u,o){return this[s].call(this,t,r,u,o)},configurable:!0})})}let R=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function u(a,f,l){const c=K(f);if(!c)throw new Error("header name must be a non-empty string");const d=i.findKey(r,c);(!d||r[d]===void 0||l===!0||l===void 0&&r[d]!==!1)&&(r[d||f]=Q(a))}const o=(a,f)=>i.forEach(a,(l,c)=>u(l,c,f));if(i.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(i.isString(t)&&(t=t.trim())&&!bn(t))o(gn(t),n);else if(i.isObject(t)&&i.isIterable(t)){let a={},f,l;for(const c of t){if(!i.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[l=c[0]]=(f=a[l])?i.isArray(f)?[...f,c[1]]:[f,c[1]]:c[1]}o(a,n)}else t!=null&&u(n,t,s);return this}get(t,n){if(t=K(t),t){const s=i.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return yn(r);if(i.isFunction(n))return n.call(this,r,s);if(i.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=K(t),t){const s=i.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||pe(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function u(o){if(o=K(o),o){const a=i.findKey(s,o);a&&(!n||pe(s,s[a],a,n))&&(delete s[a],r=!0)}}return i.isArray(t)?t.forEach(u):u(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const u=n[s];(!t||pe(this,this[u],u,t,!0))&&(delete this[u],r=!0)}return r}normalize(t){const n=this,s={};return i.forEach(this,(r,u)=>{const o=i.findKey(s,u);if(o){n[o]=Q(r),delete n[u];return}const a=t?An(u):String(u).trim();a!==u&&delete n[u],n[a]=Q(r),s[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return i.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&i.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[Me]=this[Me]={accessors:{}}).accessors,r=this.prototype;function u(o){const a=K(o);s[a]||(Fn(r,o),s[a]=!0)}return i.isArray(t)?t.forEach(u):u(t),this}};R.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),i.reduceDescriptors(R.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),i.freezeMethods(R);function Ee(e,t){const n=this||z,s=t||n,r=R.from(s.headers);let u=s.data;return i.forEach(e,function(a){u=a.call(n,u,r.normalize(),t?t.status:void 0)}),r.normalize(),u}function $e(e){return!!(e&&e.__CANCEL__)}function H(e,t,n){g.call(this,e??"canceled",g.ERR_CANCELED,t,n),this.name="CanceledError"}i.inherits(H,g,{__CANCEL__:!0});function Ve(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new g("Request failed with status code "+n.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Sn(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,u=0,o;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),c=s[u];o||(o=l),n[r]=f,s[r]=l;let d=u,y=0;for(;d!==r;)y+=n[d++],d=d%e;if(r=(r+1)%e,r===u&&(u=(u+1)%e),l-o<t)return;const A=c&&l-c;return A?Math.round(y*1e3/A):void 0}}function wn(e,t){let n=0,s=1e3/t,r,u;const o=(l,c=Date.now())=>{n=c,r=null,u&&(clearTimeout(u),u=null),e.apply(null,l)};return[(...l)=>{const c=Date.now(),d=c-n;d>=s?o(l,c):(r=l,u||(u=setTimeout(()=>{u=null,o(r)},s-d)))},()=>r&&o(r)]}const ee=(e,t,n=3)=>{let s=0;const r=Sn(50,250);return wn(u=>{const o=u.loaded,a=u.lengthComputable?u.total:void 0,f=o-s,l=r(f),c=o<=a;s=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:f,rate:l||void 0,estimated:l&&a&&c?(a-o)/l:void 0,event:u,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},ze=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Ke=e=>(...t)=>i.asap(()=>e(...t)),Dn=B.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,B.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(B.origin),B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent)):()=>!0,Bn=B.hasStandardBrowserEnv?{write(e,t,n,s,r,u){const o=[e+"="+encodeURIComponent(t)];i.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),i.isString(s)&&o.push("path="+s),i.isString(r)&&o.push("domain="+r),u===!0&&o.push("secure"),document.cookie=o.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(){return null},remove(){}};function Tn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Rn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Je(e,t,n){let s=!Tn(t);return e&&(s||n==!1)?Rn(e,t):t}const We=e=>e instanceof R?{...e}:e;function j(e,t){t=t||{};const n={};function s(l,c,d,y){return i.isPlainObject(l)&&i.isPlainObject(c)?i.merge.call({caseless:y},l,c):i.isPlainObject(c)?i.merge({},c):i.isArray(c)?c.slice():c}function r(l,c,d,y){if(i.isUndefined(c)){if(!i.isUndefined(l))return s(void 0,l,d,y)}else return s(l,c,d,y)}function u(l,c){if(!i.isUndefined(c))return s(void 0,c)}function o(l,c){if(i.isUndefined(c)){if(!i.isUndefined(l))return s(void 0,l)}else return s(void 0,c)}function a(l,c,d){if(d in t)return s(l,c);if(d in e)return s(void 0,l)}const f={url:u,method:u,data:u,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,c,d)=>r(We(l),We(c),d,!0)};return i.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=f[c]||r,y=d(e[c],t[c],c);i.isUndefined(y)&&d!==a||(n[c]=y)}),n}const Xe=e=>{const t=j({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:u,headers:o,auth:a}=t;t.headers=o=R.from(o),t.url=je(Je(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let f;if(i.isFormData(n)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((f=o.getContentType())!==!1){const[l,...c]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...c].join("; "))}}if(B.hasStandardBrowserEnv&&(s&&i.isFunction(s)&&(s=s(t)),s||s!==!1&&Dn(t.url))){const l=r&&u&&Bn.read(u);l&&o.set(r,l)}return t},On=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const r=Xe(e);let u=r.data;const o=R.from(r.headers).normalize();let{responseType:a,onUploadProgress:f,onDownloadProgress:l}=r,c,d,y,A,h;function m(){A&&A(),h&&h(),r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let p=new XMLHttpRequest;p.open(r.method.toUpperCase(),r.url,!0),p.timeout=r.timeout;function F(){if(!p)return;const w=R.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:w,config:e,request:p};Ve(function(U){n(U),m()},function(U){s(U),m()},b),p=null}"onloadend"in p?p.onloadend=F:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(F)},p.onabort=function(){p&&(s(new g("Request aborted",g.ECONNABORTED,e,p)),p=null)},p.onerror=function(){s(new g("Network Error",g.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let P=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const b=r.transitional||ve;r.timeoutErrorMessage&&(P=r.timeoutErrorMessage),s(new g(P,b.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,p)),p=null},u===void 0&&o.setContentType(null),"setRequestHeader"in p&&i.forEach(o.toJSON(),function(P,b){p.setRequestHeader(b,P)}),i.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),a&&a!=="json"&&(p.responseType=r.responseType),l&&([y,h]=ee(l,!0),p.addEventListener("progress",y)),f&&p.upload&&([d,A]=ee(f),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",A)),(r.cancelToken||r.signal)&&(c=w=>{p&&(s(!w||w.type?new H(null,e,p):w),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));const S=Cn(r.url);if(S&&B.protocols.indexOf(S)===-1){s(new g("Unsupported protocol "+S+":",g.ERR_BAD_REQUEST,e));return}p.send(u||null)})},xn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const u=function(l){if(!r){r=!0,a();const c=l instanceof Error?l:this.reason;s.abort(c instanceof g?c:new H(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,u(new g(`timeout ${t} of ms exceeded`,g.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(u):l.removeEventListener("abort",u)}),e=null)};e.forEach(l=>l.addEventListener("abort",u));const{signal:f}=s;return f.unsubscribe=()=>i.asap(a),f}},Nn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,r;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},Pn=async function*(e,t){for await(const n of Ln(e))yield*Nn(n,t)},Ln=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},Ge=(e,t,n,s)=>{const r=Pn(e,t);let u=0,o,a=f=>{o||(o=!0,s&&s(f))};return new ReadableStream({async pull(f){try{const{done:l,value:c}=await r.next();if(l){a(),f.close();return}let d=c.byteLength;if(n){let y=u+=d;n(y)}f.enqueue(new Uint8Array(c))}catch(l){throw a(l),l}},cancel(f){return a(f),r.return()}},{highWaterMark:2})},te=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ye=te&&typeof ReadableStream=="function",Un=te&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ze=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qn=Ye&&Ze(()=>{let e=!1;const t=new Request(B.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Qe=64*1024,me=Ye&&Ze(()=>i.isReadableStream(new Response("").body)),ne={stream:me&&(e=>e.body)};te&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ne[t]&&(ne[t]=i.isFunction(e[t])?n=>n[t]():(n,s)=>{throw new g(`Response type '${t}' is not supported`,g.ERR_NOT_SUPPORT,s)})})})(new Response);const kn=async e=>{if(e==null)return 0;if(i.isBlob(e))return e.size;if(i.isSpecCompliantForm(e))return(await new Request(B.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(i.isArrayBufferView(e)||i.isArrayBuffer(e))return e.byteLength;if(i.isURLSearchParams(e)&&(e=e+""),i.isString(e))return(await Un(e)).byteLength},In=async(e,t)=>{const n=i.toFiniteNumber(e.getContentLength());return n??kn(t)},ge={http:sn,xhr:On,fetch:te&&(async e=>{let{url:t,method:n,data:s,signal:r,cancelToken:u,timeout:o,onDownloadProgress:a,onUploadProgress:f,responseType:l,headers:c,withCredentials:d="same-origin",fetchOptions:y}=Xe(e);l=l?(l+"").toLowerCase():"text";let A=xn([r,u&&u.toAbortSignal()],o),h;const m=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let p;try{if(f&&qn&&n!=="get"&&n!=="head"&&(p=await In(c,s))!==0){let b=new Request(t,{method:"POST",body:s,duplex:"half"}),D;if(i.isFormData(s)&&(D=b.headers.get("content-type"))&&c.setContentType(D),b.body){const[U,ue]=ze(p,ee(Ke(f)));s=Ge(b.body,Qe,U,ue)}}i.isString(d)||(d=d?"include":"omit");const F="credentials"in Request.prototype;h=new Request(t,{...y,signal:A,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:s,duplex:"half",credentials:F?d:void 0});let S=await fetch(h,y);const w=me&&(l==="stream"||l==="response");if(me&&(a||w&&m)){const b={};["status","statusText","headers"].forEach(it=>{b[it]=S[it]});const D=i.toFiniteNumber(S.headers.get("content-length")),[U,ue]=a&&ze(D,ee(Ke(a),!0))||[];S=new Response(Ge(S.body,Qe,U,()=>{ue&&ue(),m&&m()}),b)}l=l||"text";let P=await ne[i.findKey(ne,l)||"text"](S,e);return!w&&m&&m(),await new Promise((b,D)=>{Ve(b,D,{data:P,headers:R.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:h})})}catch(F){throw m&&m(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,e,h),{cause:F.cause||F}):g.from(F,F&&F.code,e,h)}})};i.forEach(ge,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const et=e=>`- ${e}`,jn=e=>i.isFunction(e)||e===null||e===!1,tt={getAdapter:e=>{e=i.isArray(e)?e:[e];const{length:t}=e;let n,s;const r={};for(let u=0;u<t;u++){n=e[u];let o;if(s=n,!jn(n)&&(s=ge[(o=String(n)).toLowerCase()],s===void 0))throw new g(`Unknown adapter '${o}'`);if(s)break;r[o||"#"+u]=s}if(!s){const u=Object.entries(r).map(([a,f])=>`adapter ${a} `+(f===!1?"is not supported by the environment":"is not available in the build"));let o=t?u.length>1?`since : `+u.map(et).join(` `):" "+et(u[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:ge};function ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new H(null,e)}function nt(e){return ye(e),e.headers=R.from(e.headers),e.data=Ee.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tt.getAdapter(e.adapter||z.adapter)(e).then(function(s){return ye(e),s.data=Ee.call(e,e.transformResponse,s),s.headers=R.from(s.headers),s},function(s){return $e(s)||(ye(e),s&&s.response&&(s.response.data=Ee.call(e,e.transformResponse,s.response),s.response.headers=R.from(s.response.headers))),Promise.reject(s)})}const st="1.10.0",se={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{se[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const rt={};se.transitional=function(t,n,s){function r(u,o){return"[Axios v"+st+"] Transitional option '"+u+"'"+o+(s?". "+s:"")}return(u,o,a)=>{if(t===!1)throw new g(r(o," has been removed"+(n?" in "+n:"")),g.ERR_DEPRECATED);return n&&!rt[o]&&(rt[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(u,o,a):!0}},se.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function _n(e,t,n){if(typeof e!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const u=s[r],o=t[u];if(o){const a=e[u],f=a===void 0||o(a,u,e);if(f!==!0)throw new g("option "+u+" must be "+f,g.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new g("Unknown option "+u,g.ERR_BAD_OPTION)}}const re={assertOptions:_n,validators:se},N=re.validators;let _=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _e,response:new _e}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const u=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?u&&!String(s.stack).endsWith(u.replace(/^.+\n.+\n/,""))&&(s.stack+=` `+u):s.stack=u}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:u}=n;s!==void 0&&re.assertOptions(s,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),r!=null&&(i.isFunction(r)?n.paramsSerializer={serialize:r}:re.assertOptions(r,{encode:N.function,serialize:N.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),re.assertOptions(n,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=u&&i.merge(u.common,u[n.method]);u&&i.forEach(["delete","get","head","post","put","patch","common"],h=>{delete u[h]}),n.headers=R.concat(o,u);const a=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let c,d=0,y;if(!f){const h=[nt.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,l),y=h.length,c=Promise.resolve(n);d<y;)c=c.then(h[d++],h[d++]);return c}y=a.length;let A=n;for(d=0;d<y;){const h=a[d++],m=a[d++];try{A=h(A)}catch(p){m.call(this,p);break}}try{c=nt.call(this,A)}catch(h){return Promise.reject(h)}for(d=0,y=l.length;d<y;)c=c.then(l[d++],l[d++]);return c}getUri(t){t=j(this.defaults,t);const n=Je(t.baseURL,t.url,t.allowAbsoluteUrls);return je(n,t.params,t.paramsSerializer)}};i.forEach(["delete","get","head","options"],function(t){_.prototype[t]=function(n,s){return this.request(j(s||{},{method:t,url:n,data:(s||{}).data}))}}),i.forEach(["post","put","patch"],function(t){function n(s){return function(u,o,a){return this.request(j(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:u,data:o}))}}_.prototype[t]=n(),_.prototype[t+"Form"]=n(!0)});let vn=class at{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(u){n=u});const s=this;this.promise.then(r=>{if(!s._listeners)return;let u=s._listeners.length;for(;u-- >0;)s._listeners[u](r);s._listeners=null}),this.promise.then=r=>{let u;const o=new Promise(a=>{s.subscribe(a),u=a}).then(r);return o.cancel=function(){s.unsubscribe(u)},o},t(function(u,o,a){s.reason||(s.reason=new H(u,o,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new at(function(r){t=r}),cancel:t}}};function Hn(e){return function(n){return e.apply(null,n)}}function Mn(e){return i.isObject(e)&&e.isAxiosError===!0}const be={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(be).forEach(([e,t])=>{be[t]=e});function ut(e){const t=new _(e),n=Se(_.prototype.request,t);return i.extend(n,_.prototype,t,{allOwnKeys:!0}),i.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return ut(j(e,r))},n}const C=ut(z);C.Axios=_,C.CanceledError=H,C.CancelToken=vn,C.isCancel=$e,C.VERSION=st,C.toFormData=Z,C.AxiosError=g,C.Cancel=C.CanceledError,C.all=function(t){return Promise.all(t)},C.spread=Hn,C.isAxiosError=Mn,C.mergeConfig=j,C.AxiosHeaders=R,C.formToJSON=e=>He(i.isHTMLForm(e)?new FormData(e):e),C.getAdapter=tt.getAdapter,C.HttpStatusCode=be,C.default=C;const{Axios:rs,AxiosError:us,CanceledError:os,isCancel:is,CancelToken:as,VERSION:cs,all:ls,Cancel:fs,isAxiosError:ds,spread:hs,toFormData:ps,AxiosHeaders:Es,HttpStatusCode:ms,formToJSON:gs,getAdapter:ys,mergeConfig:bs}=C,$n="https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address",Vn={"Content-Type":"application/json",Accept:"application/json"},ot=async e=>{const t=e.url??$n,n=e.count??10;let s={query:e.query,count:n};e.toBound&&(s={...s,to_bound:{value:e.toBound}}),e.fromBound&&(s={...s,from_bound:{value:e.fromBound}}),e.locationOptions&&(s={...s,language:e.locationOptions.language,locations:e.locationOptions.locations,locations_boost:e.locationOptions.locationsBoost},e.locationOptions.restrictValue!==void 0&&(s={...s,restrict_value:e.locationOptions.restrictValue}));const r={headers:{...Vn,Authorization:`Token ${e.token}`}},{data:{suggestions:u}}=await C.post(t,s,r);return u},zn=(e,t)=>{const n=E.computed({get:()=>e.modelValue,set:b=>t("update:modelValue",b)}),s=E.computed({get:()=>e.suggestion,set:b=>t("update:suggestion",b)}),r=E.ref(!1),u=E.ref(!0),o=E.ref(-1),a=E.ref([]),f=E.ref(void 0),l=async b=>{try{const D={token:e.token,query:n.value,url:e.url,toBound:e.toBound,fromBound:e.fromBound,locationOptions:e.locationOptions,count:b};return ot(D)}catch(D){return t("handleError",D),new Promise(U=>{U([])})}},c=yt(async()=>{a.value=await l()},e.debounceWait);E.watch(n,async()=>{c()});const d=()=>{e.disabled||(u.value=!1,o.value=-1)},y=b=>{e.disabled||a.value.length>=b-1&&(n.value=a.value[b].value,f.value=a.value[b],s.value=a.value[b])},A=()=>{e.disabled||(u.value=!0)},h=E.computed(()=>o.value<a.value.length-1),m=E.computed(()=>o.value>=0),p=E.computed(()=>m.value&&h.value);return{queryProxy:n,suggestionProxy:s,inputFocused:r,suggestionsVisible:u,suggestionIndex:o,suggestionList:a,onInputChange:A,onKeyPress:(b,D)=>{e.disabled||(b.preventDefault(),D===k.Enter&&p.value&&(y(o.value),d()),D===k.Esc&&(u.value=!1),D===k.Up&&m.value&&(o.value-=1),D===k.Down&&h.value&&(o.value+=1))},onInputFocus:()=>{e.disabled||(r.value=!0)},onInputBlur:()=>{e.disabled||(e.autocomplete&&(n.value=f.value?f.value?.value:""),r.value=!1)},onSuggestionClick:b=>{e.disabled||(y(b),d())}}},Kn=E.defineComponent({name:"VueDadata",components:{WordHighlighter:ht},props:{token:{type:String,required:!0},modelValue:{type:String,required:!0},suggestion:{type:Object,default:()=>{}},placeholder:{type:String,default:""},url:{type:String,default:void 0},debounceWait:{type:String||Number,default:"1000ms"},disabled:{type:Boolean,default:!1},fromBound:{type:String,default:void 0},toBound:{type:String,default:void 0},inputName:{type:String,default:"vue-dadata-input"},locationOptions:{type:Object,default:void 0},classes:{type:Object,default:()=>q},highlightOptions:{type:Object,default:()=>L},autocomplete:{type:Boolean,default:!1}},emits:["update:modelValue","update:suggestion","handleError"],setup(e,{emit:t}){const n=Et(e.classes),s=mt(e.highlightOptions),{queryProxy:r,suggestionProxy:u,inputFocused:o,suggestionsVisible:a,suggestionIndex:f,suggestionList:l,onInputChange:c,onKeyPress:d,onInputFocus:y,onInputBlur:A,onSuggestionClick:h}=zn(e,t);return{KeyEvent:k,queryProxy:r,suggestionProxy:u,inputFocused:o,suggestionsVisible:a,suggestionList:l,proxyClasses:n,proxyHighlightOptions:s,suggestionIndex:f,onInputChange:c,onKeyPress:d,onInputFocus:y,onInputBlur:A,onSuggestionClick:h}}}),Jn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Wn=["name","disabled","placeholder"];function Xn(e,t,n,s,r,u){const o=E.resolveComponent("word-highlighter");return E.openBlock(),E.createElementBlock("div",{class:E.normalizeClass(e.proxyClasses.container)},[E.createElementVNode("div",{class:E.normalizeClass(e.proxyClasses.search)},[E.withDirectives(E.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>e.queryProxy=a),type:"text",name:e.inputName,class:E.normalizeClass(e.proxyClasses.input),disabled:e.disabled,placeholder:e.placeholder,onInput:t[1]||(t[1]=(...a)=>e.onInputChange&&e.onInputChange(...a)),onKeyup:[t[2]||(t[2]=E.withKeys(a=>e.onKeyPress(a,e.KeyEvent.Enter),["enter"])),t[3]||(t[3]=E.withKeys(a=>e.onKeyPress(a,e.KeyEvent.Esc),["esc"])),t[4]||(t[4]=E.withKeys(a=>e.onKeyPress(a,e.KeyEvent.Up),["up"])),t[5]||(t[5]=E.withKeys(a=>e.onKeyPress(a,e.KeyEvent.Down),["down"]))],onFocus:t[6]||(t[6]=(...a)=>e.onInputFocus&&e.onInputFocus(...a)),onBlur:t[7]||(t[7]=(...a)=>e.onInputBlur&&e.onInputBlur(...a))},null,42,Wn),[[E.vModelText,e.queryProxy]])],2),e.inputFocused&&e.suggestionsVisible&&!e.disabled?(E.openBlock(),E.createElementBlock("div",{key:0,class:E.normalizeClass(e.proxyClasses.suggestions)},[E.renderSlot(e.$slots,"suggestions",{suggestionList:e.suggestionList,suggestionIndex:e.suggestionIndex,query:e.queryProxy,suggestion:e.suggestionProxy},()=>[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(e.suggestionList,(a,f)=>(E.openBlock(),E.createBlock(o,E.mergeProps({key:`suggestion_${f}`},{ref_for:!0},e.proxyHighlightOptions,{"wrapper-class":e.proxyClasses.suggestionItem,class:f===e.suggestionIndex?e.proxyClasses.suggestionCurrentItem:"",query:e.queryProxy,"text-to-highlight":a.value,onMousedown:l=>e.onSuggestionClick(f)}),null,16,["wrapper-class","class","query","text-to-highlight","onMousedown"]))),128))])],2)):E.createCommentVNode("",!0)],2)}const Gn=Jn(Kn,[["render",Xn]]);O.BOUNDS=pt,O.DEFAULT_CLASSES=q,O.DEFAULT_HIGHLIGHT_OPTIONS=L,O.KeyEvent=k,O.VueDadata=Gn,O.getSuggestions=ot,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});