UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

7 lines (6 loc) 44.9 kB
(function(O,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("vue"),require("lodash-es"),require("../button-edit/index.umd.js"),require("../layout/index.umd.js"),require("../tree-view/index.umd.js"),require("../data-grid/index.umd.js"),require("../notify/index.umd.js"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../button-edit/index.umd.js","../layout/index.umd.js","../tree-view/index.umd.js","../data-grid/index.umd.js","../notify/index.umd.js","../common/index.umd.js"],S):(O=typeof globalThis<"u"?globalThis:O||self,S(O["menu-lookup"]={},O.Vue,O.LodashES,O.buttonEdit,O.FLayout,O.FTreeView,O.FDataGrid,O.notify,O.common))})(this,function(O,S,ee,lt,te,ft,dt,pt,ht){"use strict";const mt={},yt={};function we(e){const{properties:t,title:r,ignore:n}=e,o=n&&Array.isArray(n),s=Object.keys(t).reduce((i,u)=>((!o||!n.find(d=>d===u))&&(i[u]=t[u].type==="object"&&t[u].properties?we(t[u]):ee.cloneDeep(t[u].default)),i),{});if(r&&(!o||!n.find(i=>i==="id"))){const i=r.toLowerCase().replace(/-/g,"_");s.id=`${i}_${Math.random().toString().slice(2,6)}`}return s}function gt(e,t){const r=we(t);return Object.keys(r).reduce((n,o)=>(Object.prototype.hasOwnProperty.call(e,o)&&(n[o]&&ee.isPlainObject(n[o])&&ee.isPlainObject(e[o]||!e[o])?Object.assign(n[o],e[o]||{}):n[o]=e[o]),n),r),r}function Ee(e,t){return Object.keys(e).filter(n=>e[n]!=null).reduce((n,o)=>{if(t.has(o)){const s=t.get(o);if(typeof s=="string")n[s]=e[o];else{const i=s(o,e[o],e);Object.assign(n,i)}}else n[o]=e[o];return n},{})}function bt(e,t,r=new Map){const n=gt(e,t);return Ee(n,r)}function wt(e={}){function t(a,l,f,g){if(typeof f=="number")return g[a].length===f;if(typeof f=="object"){const h=Object.keys(f)[0],p=f[h];if(h==="not")return Number(g[a].length)!==Number(p);if(h==="moreThan")return Number(g[a].length)>=Number(p);if(h==="lessThan")return Number(g[a].length)<=Number(p)}return!1}function r(a,l,f,g){return g[a]&&g[a].propertyValue&&String(g[a].propertyValue.value)===String(f)}const n=new Map([["length",t],["getProperty",r]]);Object.keys(e).reduce((a,l)=>(a.set(l,e[l]),a),n);function o(a,l){const f=a;return typeof l=="number"?[{target:f,operator:"length",param:null,value:Number(l)}]:typeof l=="boolean"?[{target:f,operator:"getProperty",param:a,value:!!l}]:typeof l=="object"?Object.keys(l).map(g=>{if(g==="length")return{target:f,operator:"length",param:null,value:l[g]};const h=g,p=l[g];return{target:f,operator:"getProperty",param:h,value:p}}):[]}function s(a){return Object.keys(a).reduce((f,g)=>{const h=o(g,a[g]);return f.push(...h),f},[])}function i(a,l){if(n.has(a.operator)){const f=n.get(a.operator);return f&&f(a.target,a.param,a.value,l)||!1}return!1}function u(a,l){return s(a).reduce((h,p)=>h&&i(p,l),!0)}function d(a,l){const f=Object.keys(a),g=f.includes("allOf"),h=f.includes("anyOf"),p=g||h,y=(p?a[p?g?"allOf":"anyOf":"allOf"]:[a]).map(R=>u(R,l));return g?!y.includes(!1):y.includes(!0)}return{parseValueSchema:d}}const Et={},St={};wt();function Rt(e,t,r=new Map,n=(i,u,d,a)=>u,o={},s=i=>i){return mt[t.title]=t,yt[t.title]=n,Et[t.title]=o,St[t.title]=s,(i={},u=!0)=>{if(!u)return Ee(i,r);const d=bt(i,t,r),a=Object.keys(e).reduce((l,f)=>(l[f]=e[f].default,l),{});return Object.assign(a,d)}}const Tt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/menu-lookup.schema.json",title:"menu-lookup",description:"A Farris Component",type:"object",properties:{type:{description:"The type string of menu-lookup",type:"string",default:"menu-lookup"},targetType:{description:"",type:"string",enum:["menu","app"],default:"menu"},fetchNodeApi:{description:"",type:"function"}},required:["type","fetchNodeApi"],ignore:[]},Ot=new Map([]);function Nt(e,t,r){return t}const ne={targetType:{type:String,default:"menu"},fetchNodeApi:{type:[String,Function],require:!0},modelValue:{type:String,default:""}},Se=Rt(ne,Tt,Ot,Nt),Ct={targetType:{type:String,default:"menu"},useTreeGridCoordinatorComposition:{type:Object,default:()=>({})}};function Re(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!S.isVNode(e)}const At=S.defineComponent({name:"FMenuLookupModalContainer",props:Ct,emits:[],setup(e){const t=S.ref(),r=S.ref(),{treeData:n,gridData:o,onNavTreeExpandNode:s,onNavTreeSelectionChange:i,onDataGridSelectionChange:u,onDataGridUnSelectItem:d}=e.useTreeGridCoordinatorComposition,a={parentIdField:"parentId",collapseField:"collapse",hasChildrenField:"hasChildren"},l={enabelSelectRow:!0,clearSelectionOnEmpty:!1,keepSelectingOnClick:!0,multiSelect:!1,showCheckbox:!0,selectOnCheck:!0,focusSelection:!0,checkOnSelect:!0},f=[{field:"code",title:"编号",dataType:"string"},{field:"name",title:"名称",dataType:"string"}],g=[{field:"code",title:"编号",dataType:"string"},{field:"name",title:"名称",dataType:"string"},{field:"appEntrance",title:"入口",dataType:"string"}],h=e.targetType==="app"?g:f;function p(){t.value&&t.value.updateDataSource(n.value)}S.watch(n,p);function b(){r.value&&r.value.updateDataSource(o.value)}S.watch(o,b);function m(){return S.createVNode(ft,{ref:t,data:n.value,hierarchy:a,virtualized:!1,onSelectionChange:i,onExpandNode:s},null)}function y(){return S.createVNode(dt,{ref:r,columns:h,data:o.value,fit:!0,showStripe:!1,columnOption:{fitColumns:!0},rowNumber:{enable:!1},selection:l,virtualized:!1,onSelectionChange:u,onUnSelectItem:d},null)}return()=>{let E,R;return S.createVNode(te,{class:"fv-menu-lookup-container"},{default:()=>[S.createVNode(te.FLayoutPane,{position:"left",width:300,"min-width":200},Re(E=m())?E:{default:()=>[E]}),S.createVNode(te.FLayoutPane,{position:"center","min-width":400},Re(R=y())?R:{default:()=>[R]})]})}}});function Te(e,t){return function(){return e.apply(t,arguments)}}const{toString:xt}=Object.prototype,{getPrototypeOf:re}=Object,V=(e=>t=>{const r=xt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),L=e=>(e=e.toLowerCase(),t=>V(t)===e),z=e=>t=>typeof t===e,{isArray:U}=Array,q=z("undefined");function Pt(e){return e!==null&&!q(e)&&e.constructor!==null&&!q(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Oe=L("ArrayBuffer");function Lt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Oe(e.buffer),t}const Dt=z("string"),x=z("function"),Ne=z("number"),$=e=>e!==null&&typeof e=="object",Ft=e=>e===!0||e===!1,G=e=>{if(V(e)!=="object")return!1;const t=re(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},_t=L("Date"),jt=L("File"),Bt=L("Blob"),kt=L("FileList"),Ut=e=>$(e)&&x(e.pipe),Mt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=V(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},qt=L("URLSearchParams"),[It,Ht,vt,Vt]=["ReadableStream","Request","Response","Headers"].map(L),zt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function I(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),U(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let u;for(n=0;n<i;n++)u=s[n],t.call(null,e[u],u,e)}}function Ce(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const _=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ae=e=>!q(e)&&e!==_;function oe(){const{caseless:e}=Ae(this)&&this||{},t={},r=(n,o)=>{const s=e&&Ce(t,o)||o;G(t[s])&&G(n)?t[s]=oe(t[s],n):G(n)?t[s]=oe({},n):U(n)?t[s]=n.slice():t[s]=n};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&I(arguments[n],r);return t}const $t=(e,t,r,{allOwnKeys:n}={})=>(I(t,(o,s)=>{r&&x(o)?e[s]=Te(o,r):e[s]=o},{allOwnKeys:n}),e),Gt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Jt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Wt=(e,t,r,n)=>{let o,s,i;const u={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=r!==!1&&re(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Xt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Kt=e=>{if(!e)return null;if(U(e))return e;let t=e.length;if(!Ne(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Qt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&re(Uint8Array)),Zt=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Yt=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},en=L("HTMLFormElement"),tn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),xe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),nn=L("RegExp"),Pe=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};I(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},rn=e=>{Pe(e,(t,r)=>{if(x(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(x(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},on=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return U(e)?n(e):n(String(e).split(t)),r},sn=()=>{},an=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,se="abcdefghijklmnopqrstuvwxyz",Le="0123456789",De={DIGIT:Le,ALPHA:se,ALPHA_DIGIT:se+se.toUpperCase()+Le},cn=(e=16,t=De.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function un(e){return!!(e&&x(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ln=e=>{const t=new Array(10),r=(n,o)=>{if($(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[o]=n;const s=U(n)?[]:{};return I(n,(i,u)=>{const d=r(i,o+1);!q(d)&&(s[u]=d)}),t[o]=void 0,s}}return n};return r(e,0)},fn=L("AsyncFunction"),dn=e=>e&&($(e)||x(e))&&x(e.then)&&x(e.catch),Fe=((e,t)=>e?setImmediate:t?((r,n)=>(_.addEventListener("message",({source:o,data:s})=>{o===_&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),_.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",x(_.postMessage)),pn=typeof queueMicrotask<"u"?queueMicrotask.bind(_):typeof process<"u"&&process.nextTick||Fe,c={isArray:U,isArrayBuffer:Oe,isBuffer:Pt,isFormData:Mt,isArrayBufferView:Lt,isString:Dt,isNumber:Ne,isBoolean:Ft,isObject:$,isPlainObject:G,isReadableStream:It,isRequest:Ht,isResponse:vt,isHeaders:Vt,isUndefined:q,isDate:_t,isFile:jt,isBlob:Bt,isRegExp:nn,isFunction:x,isStream:Ut,isURLSearchParams:qt,isTypedArray:Qt,isFileList:kt,forEach:I,merge:oe,extend:$t,trim:zt,stripBOM:Gt,inherits:Jt,toFlatObject:Wt,kindOf:V,kindOfTest:L,endsWith:Xt,toArray:Kt,forEachEntry:Zt,matchAll:Yt,isHTMLForm:en,hasOwnProperty:xe,hasOwnProp:xe,reduceDescriptors:Pe,freezeMethods:rn,toObjectSet:on,toCamelCase:tn,noop:sn,toFiniteNumber:an,findKey:Ce,global:_,isContextDefined:Ae,ALPHABET:De,generateString:cn,isSpecCompliantForm:un,toJSONObject:ln,isAsyncFn:fn,isThenable:dn,setImmediate:Fe,asap:pn};function w(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}c.inherits(w,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:c.toJSONObject(this.config),code:this.code,status:this.status}}});const _e=w.prototype,je={};["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=>{je[e]={value:e}}),Object.defineProperties(w,je),Object.defineProperty(_e,"isAxiosError",{value:!0}),w.from=(e,t,r,n,o,s)=>{const i=Object.create(_e);return c.toFlatObject(e,i,function(d){return d!==Error.prototype},u=>u!=="isAxiosError"),w.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const hn=null;function ie(e){return c.isPlainObject(e)||c.isArray(e)}function Be(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function ke(e,t,r){return e?e.concat(t).map(function(o,s){return o=Be(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function mn(e){return c.isArray(e)&&!e.some(ie)}const yn=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function J(e,t,r){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,m){return!c.isUndefined(m[b])});const n=r.metaTokens,o=r.visitor||l,s=r.dots,i=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function a(p){if(p===null)return"";if(c.isDate(p))return p.toISOString();if(!d&&c.isBlob(p))throw new w("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(p)||c.isTypedArray(p)?d&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,b,m){let y=p;if(p&&!m&&typeof p=="object"){if(c.endsWith(b,"{}"))b=n?b:b.slice(0,-2),p=JSON.stringify(p);else if(c.isArray(p)&&mn(p)||(c.isFileList(p)||c.endsWith(b,"[]"))&&(y=c.toArray(p)))return b=Be(b),y.forEach(function(R,P){!(c.isUndefined(R)||R===null)&&t.append(i===!0?ke([b],P,s):i===null?b:b+"[]",a(R))}),!1}return ie(p)?!0:(t.append(ke(m,b,s),a(p)),!1)}const f=[],g=Object.assign(yn,{defaultVisitor:l,convertValue:a,isVisitable:ie});function h(p,b){if(!c.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+b.join("."));f.push(p),c.forEach(p,function(y,E){(!(c.isUndefined(y)||y===null)&&o.call(t,y,c.isString(E)?E.trim():E,b,g))===!0&&h(y,b?b.concat(E):[E])}),f.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Ue(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ae(e,t){this._pairs=[],e&&J(e,this,t)}const Me=ae.prototype;Me.append=function(t,r){this._pairs.push([t,r])},Me.toString=function(t){const r=t?function(n){return t.call(this,n,Ue)}:Ue;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function gn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function qe(e,t,r){if(!t)return e;const n=r&&r.encode||gn,o=r&&r.serialize;let s;if(o?s=o(t,r):s=c.isURLSearchParams(t)?t.toString():new ae(t,r).toString(n),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Ie{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const He={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ae,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ce=typeof window<"u"&&typeof document<"u",ue=typeof navigator=="object"&&navigator||void 0,wn=ce&&(!ue||["ReactNative","NativeScript","NS"].indexOf(ue.product)<0),En=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sn=ce&&window.location.href||"http://localhost",C={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ce,hasStandardBrowserEnv:wn,hasStandardBrowserWebWorkerEnv:En,navigator:ue,origin:Sn},Symbol.toStringTag,{value:"Module"})),...bn};function Rn(e,t){return J(e,new C.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,s){return C.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function Tn(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function On(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function ve(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const u=Number.isFinite(+i),d=s>=r.length;return i=!i&&c.isArray(o)?o.length:i,d?(c.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!u):((!o[i]||!c.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&c.isArray(o[i])&&(o[i]=On(o[i])),!u)}if(c.isFormData(e)&&c.isFunction(e.entries)){const r={};return c.forEachEntry(e,(n,o)=>{t(Tn(n),o,r,0)}),r}return null}function Nn(e,t,r){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(e)}const H={transitional:He,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=c.isObject(t);if(s&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return o?JSON.stringify(ve(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Rn(t,this.formSerializer).toString();if((u=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return J(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Nn(t)):t}],transformResponse:[function(t){const r=this.transitional||H.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(n&&!this.responseType||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?w.from(u,w.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{H.headers[e]={}});const Cn=c.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"]),An=e=>{const t={};let r,n,o;return e&&e.split(` `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Cn[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Ve=Symbol("internals");function v(e){return e&&String(e).trim().toLowerCase()}function W(e){return e===!1||e==null?e:c.isArray(e)?e.map(W):String(e)}function xn(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Pn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function le(e,t,r,n,o){if(c.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function Ln(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Dn(e,t){const r=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}class A{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(u,d,a){const l=v(d);if(!l)throw new Error("header name must be a non-empty string");const f=c.findKey(o,l);(!f||o[f]===void 0||a===!0||a===void 0&&o[f]!==!1)&&(o[f||d]=W(u))}const i=(u,d)=>c.forEach(u,(a,l)=>s(a,l,d));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(c.isString(t)&&(t=t.trim())&&!Pn(t))i(An(t),r);else if(c.isHeaders(t))for(const[u,d]of t.entries())s(d,u,n);else t!=null&&s(r,t,n);return this}get(t,r){if(t=v(t),t){const n=c.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return xn(o);if(c.isFunction(r))return r.call(this,o,n);if(c.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=v(t),t){const n=c.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||le(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(i){if(i=v(i),i){const u=c.findKey(n,i);u&&(!r||le(n,n[u],u,r))&&(delete n[u],o=!0)}}return c.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||le(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return c.forEach(this,(o,s)=>{const i=c.findKey(n,s);if(i){r[i]=W(o),delete r[s];return}const u=t?Ln(s):String(s).trim();u!==s&&delete r[s],r[u]=W(o),n[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return c.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Ve]=this[Ve]={accessors:{}}).accessors,o=this.prototype;function s(i){const u=v(i);n[u]||(Dn(o,i),n[u]=!0)}return c.isArray(t)?t.forEach(s):s(t),this}}A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(A.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),c.freezeMethods(A);function fe(e,t){const r=this||H,n=t||r,o=A.from(n.headers);let s=n.data;return c.forEach(e,function(u){s=u.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function ze(e){return!!(e&&e.__CANCEL__)}function M(e,t,r){w.call(this,e??"canceled",w.ERR_CANCELED,t,r),this.name="CanceledError"}c.inherits(M,w,{__CANCEL__:!0});function $e(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new w("Request failed with status code "+r.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Fn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function _n(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(d){const a=Date.now(),l=n[s];i||(i=a),r[o]=d,n[o]=a;let f=s,g=0;for(;f!==o;)g+=r[f++],f=f%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),a-i<t)return;const h=l&&a-l;return h?Math.round(g*1e3/h):void 0}}function jn(e,t){let r=0,n=1e3/t,o,s;const i=(a,l=Date.now())=>{r=l,o=null,s&&(clearTimeout(s),s=null),e.apply(null,a)};return[(...a)=>{const l=Date.now(),f=l-r;f>=n?i(a,l):(o=a,s||(s=setTimeout(()=>{s=null,i(o)},n-f)))},()=>o&&i(o)]}const X=(e,t,r=3)=>{let n=0;const o=_n(50,250);return jn(s=>{const i=s.loaded,u=s.lengthComputable?s.total:void 0,d=i-n,a=o(d),l=i<=u;n=i;const f={loaded:i,total:u,progress:u?i/u:void 0,bytes:d,rate:a||void 0,estimated:a&&u&&l?(u-i)/a:void 0,event:s,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(f)},r)},Ge=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Je=e=>(...t)=>c.asap(()=>e(...t)),Bn=C.hasStandardBrowserEnv?function(){const t=C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent),r=document.createElement("a");let n;function o(s){let i=s;return t&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(i){const u=c.isString(i)?o(i):i;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}(),kn=C.hasStandardBrowserEnv?{write(e,t,r,n,o,s){const i=[e+"="+encodeURIComponent(t)];c.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),c.isString(n)&&i.push("path="+n),c.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.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 Un(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Mn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function We(e,t){return e&&!Un(t)?Mn(e,t):t}const Xe=e=>e instanceof A?{...e}:e;function j(e,t){t=t||{};const r={};function n(a,l,f){return c.isPlainObject(a)&&c.isPlainObject(l)?c.merge.call({caseless:f},a,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function o(a,l,f){if(c.isUndefined(l)){if(!c.isUndefined(a))return n(void 0,a,f)}else return n(a,l,f)}function s(a,l){if(!c.isUndefined(l))return n(void 0,l)}function i(a,l){if(c.isUndefined(l)){if(!c.isUndefined(a))return n(void 0,a)}else return n(void 0,l)}function u(a,l,f){if(f in t)return n(a,l);if(f in e)return n(void 0,a)}const d={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(a,l)=>o(Xe(a),Xe(l),!0)};return c.forEach(Object.keys(Object.assign({},e,t)),function(l){const f=d[l]||o,g=f(e[l],t[l],l);c.isUndefined(g)&&f!==u||(r[l]=g)}),r}const Ke=e=>{const t=j({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:u}=t;t.headers=i=A.from(i),t.url=qe(We(t.baseURL,t.url),e.params,e.paramsSerializer),u&&i.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let d;if(c.isFormData(r)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((d=i.getContentType())!==!1){const[a,...l]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];i.setContentType([a||"multipart/form-data",...l].join("; "))}}if(C.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&Bn(t.url))){const a=o&&s&&kn.read(s);a&&i.set(o,a)}return t},qn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ke(e);let s=o.data;const i=A.from(o.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:a}=o,l,f,g,h,p;function b(){h&&h(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(l),o.signal&&o.signal.removeEventListener("abort",l)}let m=new XMLHttpRequest;m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout;function y(){if(!m)return;const R=A.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),N={data:!u||u==="text"||u==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:R,config:e,request:m};$e(function(k){r(k),b()},function(k){n(k),b()},N),m=null}"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(y)},m.onabort=function(){m&&(n(new w("Request aborted",w.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new w("Network Error",w.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let P=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const N=o.transitional||He;o.timeoutErrorMessage&&(P=o.timeoutErrorMessage),n(new w(P,N.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,m)),m=null},s===void 0&&i.setContentType(null),"setRequestHeader"in m&&c.forEach(i.toJSON(),function(P,N){m.setRequestHeader(N,P)}),c.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),u&&u!=="json"&&(m.responseType=o.responseType),a&&([g,p]=X(a,!0),m.addEventListener("progress",g)),d&&m.upload&&([f,h]=X(d),m.upload.addEventListener("progress",f),m.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(l=R=>{m&&(n(!R||R.type?new M(null,e,m):R),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(l),o.signal&&(o.signal.aborted?l():o.signal.addEventListener("abort",l)));const E=Fn(o.url);if(E&&C.protocols.indexOf(E)===-1){n(new w("Unsupported protocol "+E+":",w.ERR_BAD_REQUEST,e));return}m.send(s||null)})},In=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const s=function(a){if(!o){o=!0,u();const l=a instanceof Error?a:this.reason;n.abort(l instanceof w?l:new M(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,s(new w(`timeout ${t} of ms exceeded`,w.ETIMEDOUT))},t);const u=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(a=>{a.unsubscribe?a.unsubscribe(s):a.removeEventListener("abort",s)}),e=null)};e.forEach(a=>a.addEventListener("abort",s));const{signal:d}=n;return d.unsubscribe=()=>c.asap(u),d}},Hn=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},vn=async function*(e,t){for await(const r of Vn(e))yield*Hn(r,t)},Vn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Qe=(e,t,r,n)=>{const o=vn(e,t);let s=0,i,u=d=>{i||(i=!0,n&&n(d))};return new ReadableStream({async pull(d){try{const{done:a,value:l}=await o.next();if(a){u(),d.close();return}let f=l.byteLength;if(r){let g=s+=f;r(g)}d.enqueue(new Uint8Array(l))}catch(a){throw u(a),a}},cancel(d){return u(d),o.return()}},{highWaterMark:2})},K=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ze=K&&typeof ReadableStream=="function",zn=K&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ye=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$n=Ze&&Ye(()=>{let e=!1;const t=new Request(C.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),et=64*1024,de=Ze&&Ye(()=>c.isReadableStream(new Response("").body)),Q={stream:de&&(e=>e.body)};K&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Q[t]&&(Q[t]=c.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new w(`Response type '${t}' is not supported`,w.ERR_NOT_SUPPORT,n)})})})(new Response);const Gn=async e=>{if(e==null)return 0;if(c.isBlob(e))return e.size;if(c.isSpecCompliantForm(e))return(await new Request(C.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(c.isArrayBufferView(e)||c.isArrayBuffer(e))return e.byteLength;if(c.isURLSearchParams(e)&&(e=e+""),c.isString(e))return(await zn(e)).byteLength},Jn=async(e,t)=>{const r=c.toFiniteNumber(e.getContentLength());return r??Gn(t)},pe={http:hn,xhr:qn,fetch:K&&(async e=>{let{url:t,method:r,data:n,signal:o,cancelToken:s,timeout:i,onDownloadProgress:u,onUploadProgress:d,responseType:a,headers:l,withCredentials:f="same-origin",fetchOptions:g}=Ke(e);a=a?(a+"").toLowerCase():"text";let h=In([o,s&&s.toAbortSignal()],i),p;const b=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(d&&$n&&r!=="get"&&r!=="head"&&(m=await Jn(l,n))!==0){let N=new Request(t,{method:"POST",body:n,duplex:"half"}),F;if(c.isFormData(n)&&(F=N.headers.get("content-type"))&&l.setContentType(F),N.body){const[k,Y]=Ge(m,X(Je(d)));n=Qe(N.body,et,k,Y)}}c.isString(f)||(f=f?"include":"omit");const y="credentials"in Request.prototype;p=new Request(t,{...g,signal:h,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:y?f:void 0});let E=await fetch(p);const R=de&&(a==="stream"||a==="response");if(de&&(u||R&&b)){const N={};["status","statusText","headers"].forEach(ut=>{N[ut]=E[ut]});const F=c.toFiniteNumber(E.headers.get("content-length")),[k,Y]=u&&Ge(F,X(Je(u),!0))||[];E=new Response(Qe(E.body,et,k,()=>{Y&&Y(),b&&b()}),N)}a=a||"text";let P=await Q[c.findKey(Q,a)||"text"](E,e);return!R&&b&&b(),await new Promise((N,F)=>{$e(N,F,{data:P,headers:A.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:p})})}catch(y){throw b&&b(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,e,p),{cause:y.cause||y}):w.from(y,y&&y.code,e,p)}})};c.forEach(pe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const tt=e=>`- ${e}`,Wn=e=>c.isFunction(e)||e===null||e===!1,nt={getAdapter:e=>{e=c.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let s=0;s<t;s++){r=e[s];let i;if(n=r,!Wn(r)&&(n=pe[(i=String(r)).toLowerCase()],n===void 0))throw new w(`Unknown adapter '${i}'`);if(n)break;o[i||"#"+s]=n}if(!n){const s=Object.entries(o).map(([u,d])=>`adapter ${u} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since : `+s.map(tt).join(` `):" "+tt(s[0]):"as no adapter specified";throw new w("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n},adapters:pe};function he(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new M(null,e)}function rt(e){return he(e),e.headers=A.from(e.headers),e.data=fe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),nt.getAdapter(e.adapter||H.adapter)(e).then(function(n){return he(e),n.data=fe.call(e,e.transformResponse,n),n.headers=A.from(n.headers),n},function(n){return ze(n)||(he(e),n&&n.response&&(n.response.data=fe.call(e,e.transformResponse,n.response),n.response.headers=A.from(n.response.headers))),Promise.reject(n)})}const ot="1.7.7",me={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{me[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const st={};me.transitional=function(t,r,n){function o(s,i){return"[Axios v"+ot+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,u)=>{if(t===!1)throw new w(o(i," has been removed"+(r?" in "+r:"")),w.ERR_DEPRECATED);return r&&!st[i]&&(st[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,u):!0}};function Xn(e,t,r){if(typeof e!="object")throw new w("options must be an object",w.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const u=e[s],d=u===void 0||i(u,s,e);if(d!==!0)throw new w("option "+s+" must be "+d,w.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new w("Unknown option "+s,w.ERR_BAD_OPTION)}}const ye={assertOptions:Xn,validators:me},D=ye.validators;class B{constructor(t){this.defaults=t,this.interceptors={request:new Ie,response:new Ie}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=j(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&ye.assertOptions(n,{silentJSONParsing:D.transitional(D.boolean),forcedJSONParsing:D.transitional(D.boolean),clarifyTimeoutError:D.transitional(D.boolean)},!1),o!=null&&(c.isFunction(o)?r.paramsSerializer={serialize:o}:ye.assertOptions(o,{encode:D.function,serialize:D.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&c.merge(s.common,s[r.method]);s&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),r.headers=A.concat(i,s);const u=[];let d=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(d=d&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const a=[];this.interceptors.response.forEach(function(b){a.push(b.fulfilled,b.rejected)});let l,f=0,g;if(!d){const p=[rt.bind(this),void 0];for(p.unshift.apply(p,u),p.push.apply(p,a),g=p.length,l=Promise.resolve(r);f<g;)l=l.then(p[f++],p[f++]);return l}g=u.length;let h=r;for(f=0;f<g;){const p=u[f++],b=u[f++];try{h=p(h)}catch(m){b.call(this,m);break}}try{l=rt.call(this,h)}catch(p){return Promise.reject(p)}for(f=0,g=a.length;f<g;)l=l.then(a[f++],a[f++]);return l}getUri(t){t=j(this.defaults,t);const r=We(t.baseURL,t.url);return qe(r,t.params,t.paramsSerializer)}}c.forEach(["delete","get","head","options"],function(t){B.prototype[t]=function(r,n){return this.request(j(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,u){return this.request(j(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}B.prototype[t]=r(),B.prototype[t+"Form"]=r(!0)});class ge{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(u=>{n.subscribe(u),s=u}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,u){n.reason||(n.reason=new M(s,i,u),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new ge(function(o){t=o}),cancel:t}}}function Kn(e){return function(r){return e.apply(null,r)}}function Qn(e){return c.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 it(e){const t=new B(e),r=Te(B.prototype.request,t);return c.extend(r,B.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return it(j(e,o))},r}const T=it(H);T.Axios=B,T.CanceledError=M,T.CancelToken=ge,T.isCancel=ze,T.VERSION=ot,T.toFormData=J,T.AxiosError=w,T.Cancel=T.CanceledError,T.all=function(t){return Promise.all(t)},T.spread=Kn,T.isAxiosError=Qn,T.mergeConfig=j,T.AxiosHeaders=A,T.formToJSON=e=>ve(c.isHTMLForm(e)?new FormData(e):e),T.getAdapter=nt.getAdapter,T.HttpStatusCode=be,T.default=T;var at=(e=>(e.KeyApp="1",e.Module="2",e.MenuGroup="3",e.Menu="4",e))(at||{});function Zn(e){const t=S.computed(()=>{const d=new Map;return e.value.forEach(a=>{d.set(a.id,a)}),d}),r=S.computed(()=>{const d=new Map;return e.value.forEach(a=>{const{parentId:l}=a;l&&(d.has(l)||d.set(l,[]),d.get(l).push(a))}),d}),n=S.computed(()=>e.value.filter(d=>{const{parentId:a}=d;return!a||!t.value.get(a)})),o=S.ref([]);function s(){const d=[],a=[];for([...n.value].reverse().forEach(l=>a.push(l.id));a.length>0;){const l=a.pop(),f=t.value.get(l);d.push(f),[...r.value.get(l)||[]].reverse().forEach(h=>{a.push(h.id)})}return d}S.watch(e,()=>{o.value=s()});function i(d,a){const l=[],f=[d];for(;f.length>0;){const g=f.shift();if(!g)continue;const h=r.value.get(g.id)||[];for(const p of h)a(p)&&l.push(p),f.push(p)}return l}function u(d){return r.value.get(d==null?void 0:d.id)||[]}return{orderedTreeNodes:o,getLeafDescendants:i,getChildNodes:u}}function Yn(e){const t=S.ref([]),r=new Set,n=Zn(t),{orderedTreeNodes:o}=n,s=S.computed(()=>o.value.filter(d));function i(y){return r.has(y)}function u(y){const E=y;return(E==null?void 0:E.funcType)===at.Menu}function d(y){return!u(y)}function a(y){y&&(y.layer=Number(y.layer)-1,y.collapse=typeof y.collapse=="boolean"?y.collapse:!0)}function l(y){return typeof e.fetchNodeApi=="function"?e.fetchNodeApi(y):!y&&typeof e.fetchNodeApi=="string"?e.fetchNodeApi:""}async function f(y){const E=l(y);if(!E)return Promise.resolve([]);const R={headers:{"Content-Type":"application/json"}},N=(await T.get(E,R)).data||[];return N.forEach(a),N}function g(){t.value.forEach(y=>{const P=!!n.getChildNodes(y).find(d);y.hasChildren=P}),t.value=[...t.value]}function h(y){!y||!y.length||(t.value.push(...y),g())}function p(y){const E=(y==null?void 0:y.id)||"";i(E)||f(y).then(R=>{i(E)||(r.add(E),h(R))})}function b(y){return n.getLeafDescendants(y,u)}function m(){t.value=[],r.clear()}return{treeData:s,loadNodesByLevel:p,getLeafDescendants:b,clearCache:m}}function er(e){const t=S.ref([]);function r(s){}function n(s){return[]}function o(){}return{treeData:t,loadNodesByLevel:r,getLeafDescendants:n,clearCache:o}}function tr(e){return ct(Yn(e))}function nr(e){return ct(er())}function ct(e){const{treeData:t,loadNodesByLevel:r,getLeafDescendants:n}=e,o=S.ref([]),s=S.ref();function i(h){const p=h==null?void 0:h[0];if(!p)return;const b=n(p);o.value=[...b]}function u(h){const p=h==null?void 0:h[0];s.value=p}function d(){s.value=void 0}function a(h){var p;return(p=h==null?void 0:h.row)==null?void 0:p.raw}function l(h){const p=a(h);r(p)}function f(){s.value=void 0,o.value=[],e.clearCache()}function g(){f(),r()}return{treeData:t,gridData:o,selectedData:s,onNavTreeSelectionChange:i,onNavTreeExpandNode:l,onDataGridSelectionChange:u,onDataGridUnSelectItem:d,initialize:g,clearCache:f}}function rr(e,t,r){const n=S.inject(pt.F_NOTIFY_SERVICE_TOKEN,null),o=e.targetType==="app"?"选择应用":"选择功能菜单",{selectedData:s,initialize:i,clearCache:u}=r;function d(h,p){t.emit("change",h,h,p),t.emit("update:modelValue",h)}function a(){if(!s.value)return n==null||n.warning({message:"请选择数据!",position:"top-center"}),!1;const h=s.value.id,p=s.value;return d(h,p),!0}function l(){d("")}const f=S.reactive({title:o,width:800,height:550,fitContent:!1,showHeader:!0,showCloseButton:!0,showMaxButton:!1,resizeable:!1,draggable:!0,closedCallback:()=>{u()},buttons:[{class:"btn btn-secondary",text:"取消",handle:()=>!0},{class:"btn btn-primary",text:"确定",handle:()=>a()}]});function g(){i()}return{modalConfigs:f,beforeOpenModalDialog:g,onClear:l}}const Z=S.defineComponent({name:"FMenuLookup",props:ne,emits:["change","update:modelValue"],setup(e,t){const r=e.targetType==="app"?nr():tr(e),{modalConfigs:n,beforeOpenModalDialog:o,onClear:s}=rr(e,t,r);return()=>S.createVNode(lt.FButtonEdit,{modelValue:e.modelValue,enableClear:!0,buttonBehavior:"Modal",modalOptions:n,beforeOpen:o,onClear:s},{default:()=>[S.createVNode(At,{targetType:e.targetType,useTreeGridCoordinatorComposition:r},null)]})}});Z.register=(e,t,r,n)=>{e["menu-lookup"]=Z,t["menu-lookup"]=Se};const or=ht.withInstall(Z);O.FMenuLookup=Z,O.default=or,O.menuLookupProps=ne,O.propsResolver=Se,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});