diff --git a/assets/Manage-8dbada9a.js b/assets/Manage-8dbada9a.js deleted file mode 100644 index c77ba44..0000000 --- a/assets/Manage-8dbada9a.js +++ /dev/null @@ -1,530 +0,0 @@ -import{u as yt,j as r,c as kt,C as Ve,a as ue,b as _,A as jt,L as wt,d as vt,q as xt,g as $e,e as je,f as se,h as Tt,i as Ot,s as Lt,k as At,l as St,T as Vt,m as $t,n as Nt}from"./index-bd11f4a6.js";import{r as b,A as pe,_ as me,f as ae,j as we,I as Ne,d as Y,M as Ee,S as z,k as ve,B as R,l as Et,n as It,h as Bt,i as Ft,T as _t,o as zt,p as Mt,E as Rt,q as Ut,P as Dt,D as Ht,s as Jt,u as Pt,v as Wt,w as re,x as P,y as qt,C as $,L as he,R as ge,z as Gt,G as Qt,H as Xt,J as be}from"./antd-15fa66a0.js";var Zt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};const Yt=Zt;var Kt=function(s,n){return b.createElement(pe,me({},s,{ref:n,icon:Yt}))},Ct=b.forwardRef(Kt);const tt=Ct;var en={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"};const tn=en;var nn=function(s,n){return b.createElement(pe,me({},s,{ref:n,icon:tn}))},sn=b.forwardRef(nn);const ln=sn;var rn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};const on=rn;var an=function(s,n){return b.createElement(pe,me({},s,{ref:n,icon:on}))},cn=b.forwardRef(an);const un=cn;var fn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"};const dn=fn;var pn=function(s,n){return b.createElement(pe,me({},s,{ref:n,icon:dn}))},mn=b.forwardRef(pn);const hn=mn;function nt(e,s=!1){const n=e.length;let t=0,l="",i=0,f=16,o=0,a=0,u=0,c=0,m=0;function j(h,p){let d=0,g=0;for(;d=48&&y<=57)g=g*16+y-48;else if(y>=65&&y<=70)g=g*16+y-65+10;else if(y>=97&&y<=102)g=g*16+y-97+10;else break;t++,d++}return d=n){h+=e.substring(p,t),m=2;break}const d=e.charCodeAt(t);if(d===34){h+=e.substring(p,t),t++;break}if(d===92){if(h+=e.substring(p,t),t++,t>=n){m=2;break}switch(e.charCodeAt(t++)){case 34:h+='"';break;case 92:h+="\\";break;case 47:h+="/";break;case 98:h+="\b";break;case 102:h+="\f";break;case 110:h+=` -`;break;case 114:h+="\r";break;case 116:h+=" ";break;case 117:const y=j(4,!0);y>=0?h+=String.fromCharCode(y):m=4;break;default:m=5}p=t;continue}if(d>=0&&d<=31)if(le(d)){h+=e.substring(p,t),m=2;break}else m=6;t++}return h}function v(){if(l="",m=0,i=t,a=o,c=u,t>=n)return i=n,f=17;let h=e.charCodeAt(t);if(ye(h)){do t++,l+=String.fromCharCode(h),h=e.charCodeAt(t);while(ye(h));return f=15}if(le(h))return t++,l+=String.fromCharCode(h),h===13&&e.charCodeAt(t)===10&&(t++,l+=` -`),o++,u=t,f=14;switch(h){case 123:return t++,f=1;case 125:return t++,f=2;case 91:return t++,f=3;case 93:return t++,f=4;case 58:return t++,f=6;case 44:return t++,f=5;case 34:return t++,l=T(),f=10;case 47:const p=t-1;if(e.charCodeAt(t+1)===47){for(t+=2;t=12&&h<=15);return h}return{setPosition:k,getPosition:()=>t,scan:s?O:v,getToken:()=>f,getTokenValue:()=>l,getTokenOffset:()=>i,getTokenLength:()=>t-i,getTokenStartLine:()=>a,getTokenStartCharacter:()=>i-c,getTokenError:()=>m}}function ye(e){return e===32||e===9}function le(e){return e===10||e===13}function K(e){return e>=48&&e<=57}var Fe;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(Fe||(Fe={}));const M=new Array(20).fill(0).map((e,s)=>" ".repeat(s)),C=200,_e={" ":{"\n":new Array(C).fill(0).map((e,s)=>` -`+" ".repeat(s)),"\r":new Array(C).fill(0).map((e,s)=>"\r"+" ".repeat(s)),"\r\n":new Array(C).fill(0).map((e,s)=>`\r -`+" ".repeat(s))}," ":{"\n":new Array(C).fill(0).map((e,s)=>` -`+" ".repeat(s)),"\r":new Array(C).fill(0).map((e,s)=>"\r"+" ".repeat(s)),"\r\n":new Array(C).fill(0).map((e,s)=>`\r -`+" ".repeat(s))}},gn=[` -`,"\r",`\r -`];function st(e,s,n){let t,l,i,f,o;if(s){for(f=s.offset,o=f+s.length,i=f;i>0&&!de(e,i-1);)i--;let d=o;for(;d1)return ee(a,c)+ee(j,t+m);const d=j.length*(t+m);return!u||d>_e[k][a].length?a+ee(j,t+m):d<=0?a:_e[k][a][d]}function L(){let d=w.scan();for(c=0;d===15||d===14;)d===14&&n.keepLines?c+=1:d===14&&(c=1),d=w.scan();return T=d===16||w.getTokenError()!==0,d}const O=[];function h(d,g,y){!T&&(!s||gf)&&e.substring(g,y)!==d&&O.push({offset:g,length:y-g,content:d})}let p=L();if(n.keepLines&&c>0&&h(ee(a,c),0,0),p!==17){let d=w.getTokenOffset()+i,g=j.length*t<20&&n.insertSpaces?M[j.length*t]:ee(j,t);h(g,i,d)}for(;p!==17;){let d=w.getTokenOffset()+w.getTokenLength()+i,g=L(),y="",V=!1;for(;c===0&&(g===12||g===13);){let N=w.getTokenOffset()+i;h(M[1],d,N),d=w.getTokenOffset()+w.getTokenLength()+i,V=g===12,y=V?v():"",g=L()}if(g===2)p!==1&&m--,n.keepLines&&c>0||!n.keepLines&&p!==1?y=v():n.keepLines&&(y=M[1]);else if(g===4)p!==3&&m--,n.keepLines&&c>0||!n.keepLines&&p!==3?y=v():n.keepLines&&(y=M[1]);else{switch(p){case 3:case 1:m++,n.keepLines&&c>0||!n.keepLines?y=v():y=M[1];break;case 5:n.keepLines&&c>0||!n.keepLines?y=v():y=M[1];break;case 12:y=v();break;case 13:c>0?y=v():V||(y=M[1]);break;case 6:n.keepLines&&c>0?y=v():V||(y=M[1]);break;case 10:n.keepLines&&c>0?y=v():g===6&&!V&&(y="");break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&c>0?y=v():(g===12||g===13)&&!V?y=M[1]:g!==5&&g!==17&&(T=!0);break;case 16:T=!0;break}c>0&&(g===12||g===13)&&(y=v())}g===17&&(n.keepLines&&c>0?y=v():y=n.insertFinalNewline?a:"");const q=w.getTokenOffset()+i;h(y,d,q),p=g}return O}function ee(e,s){let n="";for(let t=0;t{const a={};f(a),i.push(l),l=a,t=null},onObjectProperty:a=>{t=a},onObjectEnd:()=>{l=i.pop()},onArrayBegin:()=>{const a=[];f(a),i.push(l),l=a,t=null},onArrayEnd:()=>{l=i.pop()},onLiteralValue:f,onError:(a,u,c)=>{s.push({error:a,offset:u,length:c})}},n),l[0]}function lt(e,s=[],n=ce.DEFAULT){let t={type:"array",offset:-1,length:-1,children:[],parent:void 0};function l(a){t.type==="property"&&(t.length=a-t.offset,t=t.parent)}function i(a){return t.children.push(a),a}rt(e,{onObjectBegin:a=>{t=i({type:"object",offset:a,length:-1,parent:t,children:[]})},onObjectProperty:(a,u,c)=>{t=i({type:"property",offset:u,length:-1,parent:t,children:[]}),t.children.push({type:"string",value:a,offset:u,length:c,parent:t})},onObjectEnd:(a,u)=>{l(a+u),t.length=a+u-t.offset,t=t.parent,l(a+u)},onArrayBegin:(a,u)=>{t=i({type:"array",offset:a,length:-1,parent:t,children:[]})},onArrayEnd:(a,u)=>{t.length=a+u-t.offset,t=t.parent,l(a+u)},onLiteralValue:(a,u,c)=>{i({type:jn(a),offset:u,length:c,parent:t,value:a}),l(u+c)},onSeparator:(a,u,c)=>{t.type==="property"&&(a===":"?t.colonOffset=u:a===","&&l(u))},onError:(a,u,c)=>{s.push({error:a,offset:u,length:c})}},n);const o=t.children[0];return o&&delete o.parent,o}function xe(e,s){if(!e)return;let n=e;for(let t of s)if(typeof t=="string"){if(n.type!=="object"||!Array.isArray(n.children))return;let l=!1;for(const i of n.children)if(Array.isArray(i.children)&&i.children[0].value===t&&i.children.length===2){n=i.children[1],l=!0;break}if(!l)return}else{const l=t;if(n.type!=="array"||l<0||!Array.isArray(n.children)||l>=n.children.length)return;n=n.children[l]}return n}function rt(e,s,n=ce.DEFAULT){const t=nt(e,!1),l=[];function i(x){return x?()=>x(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function f(x){return x?()=>x(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>l.slice()):()=>!0}function o(x){return x?A=>x(A,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function a(x){return x?A=>x(A,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>l.slice()):()=>!0}const u=f(s.onObjectBegin),c=a(s.onObjectProperty),m=i(s.onObjectEnd),j=f(s.onArrayBegin),k=i(s.onArrayEnd),w=a(s.onLiteralValue),T=o(s.onSeparator),v=i(s.onComment),L=o(s.onError),O=n&&n.disallowComments,h=n&&n.allowTrailingComma;function p(){for(;;){const x=t.scan();switch(t.getTokenError()){case 4:d(14);break;case 5:d(15);break;case 3:d(13);break;case 1:O||d(11);break;case 2:d(12);break;case 6:d(16);break}switch(x){case 12:case 13:O?d(10):v();break;case 16:d(1);break;case 15:case 14:break;default:return x}}}function d(x,A=[],J=[]){if(L(x),A.length+J.length>0){let I=t.getToken();for(;I!==17;){if(A.indexOf(I)!==-1){p();break}else if(J.indexOf(I)!==-1)break;I=p()}}}function g(x){const A=t.getTokenValue();return x?w(A):(c(A),l.push(A)),p(),!0}function y(){switch(t.getToken()){case 11:const x=t.getTokenValue();let A=Number(x);isNaN(A)&&(d(2),A=0),w(A);break;case 7:w(null);break;case 8:w(!0);break;case 9:w(!1);break;default:return!1}return p(),!0}function V(){return t.getToken()!==10?(d(3,[],[2,5]),!1):(g(!1),t.getToken()===6?(T(":"),p(),S()||d(4,[],[2,5])):d(5,[],[2,5]),l.pop(),!0)}function q(){u(),p();let x=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(x||d(4,[],[]),T(","),p(),t.getToken()===2&&h)break}else x&&d(6,[],[]);V()||d(4,[],[2,5]),x=!0}return m(),t.getToken()!==2?d(7,[2],[]):p(),!0}function N(){j(),p();let x=!0,A=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(A||d(4,[],[]),T(","),p(),t.getToken()===4&&h)break}else A&&d(6,[],[]);x?(l.push(0),x=!1):l[l.length-1]++,S()||d(4,[],[4,5]),A=!0}return k(),x||l.pop(),t.getToken()!==4?d(8,[4],[]):p(),!0}function S(){switch(t.getToken()){case 3:return N();case 1:return q();case 10:return g(!0);default:return y()}}return p(),t.getToken()===17?n.allowEmptyContent?!0:(d(4,[],[]),!1):S()?(t.getToken()!==17&&d(9,[],[]),!0):(d(4,[],[]),!1)}function jn(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(e){if(Array.isArray(e))return"array"}else return"null";return"object"}default:return"null"}}function wn(e,s,n,t){const l=s.slice(),f=lt(e,[]);let o,a;for(;l.length>0&&(a=l.pop(),o=xe(f,l),o===void 0&&n!==void 0);)typeof a=="string"?n={[a]:n}:n=[n];if(o)if(o.type==="object"&&typeof a=="string"&&Array.isArray(o.children)){const u=xe(o,[a]);if(u!==void 0)if(n===void 0){if(!u.parent)throw new Error("Malformed AST");const c=o.children.indexOf(u.parent);let m,j=u.parent.offset+u.parent.length;if(c>0){let k=o.children[c-1];m=k.offset+k.length}else m=o.offset+1,o.children.length>1&&(j=o.children[1].offset);return Z(e,{offset:m,length:j-m,content:""},t)}else return Z(e,{offset:u.offset,length:u.length,content:JSON.stringify(n)},t);else{if(n===void 0)return[];const c=`${JSON.stringify(a)}: ${JSON.stringify(n)}`,m=t.getInsertionIndex?t.getInsertionIndex(o.children.map(k=>k.children[0].value)):o.children.length;let j;if(m>0){let k=o.children[m-1];j={offset:k.offset+k.length,length:0,content:","+c}}else o.children.length===0?j={offset:o.offset+1,length:0,content:c}:j={offset:o.offset+1,length:0,content:c+","};return Z(e,j,t)}}else if(o.type==="array"&&typeof a=="number"&&Array.isArray(o.children)){const u=a;if(u===-1){const c=`${JSON.stringify(n)}`;let m;if(o.children.length===0)m={offset:o.offset+1,length:0,content:c};else{const j=o.children[o.children.length-1];m={offset:j.offset+j.length,length:0,content:","+c}}return Z(e,m,t)}else if(n===void 0&&o.children.length>=0){const c=a,m=o.children[c];let j;if(o.children.length===1)j={offset:o.offset+1,length:o.length-2,content:""};else if(o.children.length-1===c){let k=o.children[c-1],w=k.offset+k.length,T=o.offset+o.length;j={offset:w,length:T-2-w,content:""}}else j={offset:m.offset,length:o.children[c+1].offset-m.offset,content:""};return Z(e,j,t)}else if(n!==void 0){let c;const m=`${JSON.stringify(n)}`;if(!t.isArrayInsertion&&o.children.length>a){const j=o.children[a];c={offset:j.offset,length:j.length,content:m}}else if(o.children.length===0||a===0)c={offset:o.offset+1,length:0,content:o.children.length===0?m:m+","};else{const j=a>o.children.length?o.children.length:a,k=o.children[j-1];c={offset:k.offset+k.length,length:0,content:","+m}}return Z(e,c,t)}else throw new Error(`Can not ${n===void 0?"remove":t.isArrayInsertion?"insert":"modify"} Array index ${u} as length is not sufficient`)}else throw new Error(`Can not add ${typeof a!="number"?"index":"property"} to parent of type ${o.type}`);else{if(n===void 0)throw new Error("Can not delete in empty document");return Z(e,{offset:f?f.offset:0,length:f?f.length:0,content:JSON.stringify(n)},t)}}function Z(e,s,n){if(!n.formattingOptions)return[s];let t=Te(e,s),l=s.offset,i=s.offset+s.content.length;if(s.length===0||s.content.length===0){for(;l>0&&!de(t,l-1);)l--;for(;i=0;a--){const u=f[a];t=Te(t,u),l=Math.min(l,u.offset),i=Math.max(i,u.offset+u.length),i+=u.content.length-u.length}const o=e.length-(t.length-i)-l;return[{offset:l,length:o,content:t.substring(l,i)}]}function Te(e,s){return e.substring(0,s.offset)+s.content+e.substring(s.offset+s.length)}var ze;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ze||(ze={}));var Me;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Me||(Me={}));const vn=kn,xn=lt,Tn=xe;var Re;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(Re||(Re={}));function On(e,s,n){return st(e,s,n)}function fe(e,s,n,t){return wn(e,s,n,t)}function Ie(e,s){let n=s.slice(0).sort((l,i)=>{const f=l.offset-i.offset;return f===0?l.length-i.length:f}),t=e.length;for(let l=n.length-1;l>=0;l--){let i=n[l];if(i.offset+i.length<=t)e=Te(e,i);else throw new Error("Overlapping edit");t=i.offset}return e}const Ln=["_id_","_key_","_type_"],Oe=e=>JSON.stringify(e,null,4),ie=e=>{const s={...e};for(const n of Ln)delete s[n];return Oe(s)},An=e=>Ie(e,On(e,void 0,{tabSize:4,insertSpaces:!0})),Q=e=>{const s=[],n=vn(e,s,{allowTrailingComma:!0});if(s.length)throw console.error(s),s[0];return n},Sn=(e,s)=>{const n=[],t=fe.bind(null,e);return s.forEach(({path:l,value:i,options:f},o)=>{l=Array.isArray(l)?l:l.split("."),n.push(...t(l,i,f||{}))}),Ie(e,n)},Vn=(e,s)=>{const n=URL.createObjectURL(new Blob([e])),t=document.createElement("a");t.download=s,t.href=n,t.click(),URL.revokeObjectURL(n)};function Le(e,s,n){const t=e!==void 0,l=s!==void 0,[i,f]=b.useState(t?e:l?s:n),o=b.useRef({value:i,setValue:u=>{let c;typeof u=="function"?c=u(o.current.value):c=u,o.current.value=c,f(c)}});return[b.useMemo(()=>{const c=e!==void 0?e:i;return o.current.value=c,c},[e,i]),o.current.setValue]}(function(){const e=window.require;e&&e.config({"vs/nls":{availableLanguages:{"*":"zh-cn"}}}),window.monacoIsReady=new Promise((s,n)=>{if(!e)return n("Not loaded monaco loader.js");e(["vs/editor/editor.main"],function(){s(monaco)})})})();monacoIsReady.then(()=>{monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!0,trailingCommas:"warning",validate:!0})});const $n={minimap:{enabled:!1},automaticLayout:!0},Nn=(e,s)=>{const{onChange:n,options:t,height:l,className:i,theme:f,style:o}=e,[a,u]=Le(e.language,"javascript"),[c,m]=Le(e.value,e.defaultValue,""),[j,k]=b.useState(!1),w=b.useRef(null),T=b.useRef(null),v=b.useRef({}),L=yt(),O=b.useMemo(()=>f||(L?"vs-dark":"vs"),[f,L]);return ae.useImperativeHandle(s,()=>T.current),ae.useImperativeHandle(v,()=>({onChange:n}),[n]),b.useEffect(()=>{monacoIsReady.then(()=>{k(!0)})},[]),b.useEffect(()=>{if(j&&w.current){const h=w.current;let p;return monacoIsReady.then(()=>{p=T.current=monaco.editor.create(h,{value:c,language:a,theme:O,...$n,...t}),p.onDidChangeModelContent(function(d){var y,V;const g=p.getValue();m(g),(V=(y=v.current)==null?void 0:y.onChange)==null||V.call(y,g)}),p.addCommand(monaco.KeyMod.Alt|monaco.KeyCode.KeyX,d=>{var g;(g=p.getAction("my-autoWrap-toggle"))==null||g.run()}),p.addAction({id:"my-autoWrap-toggle",label:"切换自动换行",keybindings:[monaco.KeyMod.Alt|monaco.KeyCode.KeyZ],run:function(d,g){const y=d.getOption(monaco.editor.EditorOption.wordWrap);d.updateOptions({wordWrap:y==="on"?"off":"on"})}})}),()=>{var d;(d=p==null?void 0:p.dispose)==null||d.call(p)}}},[j]),b.useEffect(()=>{T.current&&c!=T.current.getValue()&&T.current.setValue(c)},[c]),j?r.jsx("div",{className:we(i),style:{height:l||"100%",minHeight:0,minWidth:0,boxSizing:"border-box",...o},ref:w}):r.jsx(Ne.TextArea,{style:{height:l||"100%"},className:we(i),value:c,onChange:h=>{var d,g;const p=h.target.value;m(p),(g=(d=v.current)==null?void 0:d.onChange)==null||g.call(d,p)}})},it=ae.forwardRef(Nn),En=e=>{const{onFinish:s,trigger:n,open:t,onOpenChange:l,modalProps:i,title:f,width:o,formRef:a,children:u,...c}=e,[m,j]=Le(t,!1),[k]=Y.useForm(),w=b.useCallback(()=>{var O;j(!1),l==null||l(!1),(O=i==null?void 0:i.onCancel)==null||O.call(i,{})},[l]),T=b.useCallback(()=>{var O;k.resetFields(),(O=i==null?void 0:i.afterClose)==null||O.call(i)},[k,i]),v=b.useMemo(()=>async function(O){await(s==null?void 0:s.apply(null,[O]))===!0&&w()},[s,w]),L=b.useMemo(()=>({...i,onCancel:w,onOk:()=>{k.submit()},afterClose:T,open:m,title:f,width:o}),[T,k,i,w,m,f,o]);return b.useEffect(()=>{if(!a)return;switch(typeof a){case"function":a(k);break;case"object":a.current=k;break}},[k,a]),r.jsxs(r.Fragment,{children:[r.jsx(Ee,{...L,children:r.jsx(Y,{form:k,onFinish:v,...c,children:u})}),n&&ae.cloneElement(n,{onClick:()=>{j(!0)}})]})},ot=e=>{const{templates:s,...n}=e,t=b.useRef(),l=o=>{var u,c,m;let a=o;if((u=e.initialValues)!=null&&u.value){const j=Q(e.initialValues.value);a=j.name?Sn(o,[{path:"name",value:j.name}]):o}a=An(a),(c=t.current)==null||c.setFieldValue("value",a),(m=t.current)==null||m.validateFields()},i=o=>{const{children:a,...u}=o,{json:c,cli:m}=o;if(a)return{...u,children:a.map(i)};if(c)return{...u,title:m,onClick:()=>l(c)}},f=s==null?void 0:s.length;return r.jsx(r.Fragment,{children:r.jsxs(En,{...n,formRef:t,modalProps:{destroyOnClose:!0,maskClosable:!1},children:[f?r.jsxs(z,{size:"small",style:{marginBottom:5},children:[r.jsx("span",{children:"模板:"}),s.map((o,a)=>{var u;if((u=o.children)!=null&&u.length){const c={items:o.children.map(i)};return o.json?r.jsx(ve.Button,{size:"small",onClick:()=>l(o.json),menu:c,children:o.label},a):r.jsx(ve,{menu:c,children:r.jsx(R,{size:"small",children:r.jsxs(z,{children:[o.label,r.jsx(Et,{})]})})},a)}else return o.json?r.jsx(R,{size:"small",title:o.cli,onClick:()=>l(o.json),children:r.jsx(z,{children:o.label})},a):null})]}):null,r.jsx(Y.Item,{name:"value",rules:[{required:!0,message:"不能为空"},{validator:(o,a)=>new Promise((u,c)=>{a&&Q(a),u(null)}).catch(u=>{throw console.error(u),new Error("json 格式错误")})}],children:r.jsx(it,{className:"g-boder",height:300,language:"json",options:{minimap:{enabled:!1}}})})]})})},oe=e=>{const{onOpenChange:s,open:n,...t}=e;let l;const i=document.createDocumentFragment(),f=kt.createRoot(i);function o({...u}){clearTimeout(l);const c=It();l=setTimeout(()=>{document.body.append(i),f.render(r.jsx(Bt,{theme:c.getTheme(),children:r.jsx(ot,{...u})}))},100)}function a(){f.unmount(),document.body.removeChild(i)}o({...t,open:!0,onOpenChange:u=>{!u&&a()}})},at=`{ - "services": [ - { - "name": "service-0", - "addr": ":8080", - // "interface": "eth0", - // "admission": "admission-0", - // "bypass": "bypass-0", - // "resolver": "resolver-0", - // "hosts": "hosts-0", - "handler": { - "type": "auto", - // "auth": { - // "username": "gost", - // "password": "gost" - // }, - // "auther": "auther-0", - // "retries": 1, - // "chain": "chain-0", - // "metadata": { - // "bar": "baz", - // "foo": "bar" - // } - }, - "listener": { - "type": "tcp", - // "auth": { - // "username": "user", - // "password": "pass" - // }, - // "auther": "auther-0", - // "chain": "chain-0", - // "tls": { - // "certFile": "cert.pem", - // "keyFile": "key.pem", - // "caFile": "ca.pem" - // }, - // "metadata": { - // "abc": "xyz", - // "def": 456 - // } - }, - // "forwarder": { - // "nodes": [ - // { - // "name": "target-0", - // "addr": "192.168.1.1:1234" - // }, - // { - // "name": "target-1", - // "addr": "192.168.1.2:2345" - // } - // ], - // "selector": { - // "strategy": "round", - // "maxFails": 1, - // "failTimeout": 30 - // } - // } - } - ], - "chains": [ - { - "name": "chain-0", - // "selector": { - // "strategy": "round", - // "maxFails": 1, - // "failTimeout": 30 - // }, - "hops": [ - { - "name": "hop-0", - // "interface": "192.168.1.2", - // "selector": { - // "strategy": "rand", - // "maxFails": 3, - // "failTimeout": 60 - // }, - // "bypass": "bypass-0", - "nodes": [ - { - "name": "node-0", - "addr": ":1080", - // "interface": "eth1", - // "bypass": "bypass-0", - "connector": { - "type": "socks5", - "auth": { - "username": "user", - "password": "pass" - }, - // "metadata": { - // "foo": "bar" - // } - }, - "dialer": { - "type": "tcp", - // "auth": { - // "username": "user", - // "password": "pass" - // }, - // "tls": { - // "caFile": "ca.pem", - // "secure": true, - // "serverName": "example.com" - // }, - // "metadata": { - // "bar": "baz" - // } - } - } - ] - } - ] - } - ], - "authers": [ - { - "name": "auther-0", - "auths": [ - { - "username": "user1", - "password": "pass1" - }, - { - "username": "user2", - "password": "pass2" - } - ] - } - ], - "admissions": [ - { - "name": "admission-0", - "whitelist": false, - "matchers": [ - "127.0.0.1", - "192.168.0.0/16" - ] - } - ], - "bypasses": [ - { - "name": "bypass-0", - "whitelist": false, - "matchers": [ - "*.example.com", - ".example.org", - "0.0.0.0/8" - ] - } - ], - "resolvers": [ - { - "name": "resolver-0", - "nameservers": [ - { - "addr": "udp://8.8.8.8:53", - "chain": "chain-0", - "prefer": "ipv4", - "clientIP": "1.2.3.4", - "ttl": 60, - "timeout": 30 - }, - { - "addr": "tcp://1.1.1.1:53" - }, - { - "addr": "tls://1.1.1.1:853" - }, - { - "addr": "https://1.0.0.1/dns-query", - "hostname": "cloudflare-dns.com" - } - ] - } - ], - "hosts": [ - { - "name": "hosts-0", - "mappings": [ - { - "ip": "127.0.0.1", - "hostname": "localhost" - }, - { - "ip": "192.168.1.10", - "hostname": "foo.mydomain.org", - "aliases": [ - "foo" - ] - }, - { - "ip": "192.168.1.13", - "hostname": "bar.mydomain.org", - "aliases": [ - "bar", - "baz" - ] - } - ] - } - ], - "tls": { - "certFile": "cert.pem", - "keyFile": "key.pem", - "caFile": "ca.pem" - }, - "log": { - "output": "stderr", - "level": "debug", - "format": "json", - "rotation": { - "maxSize": 100, - "maxAge": 10, - "maxBackups": 3, - "localTime": false, - "compress": false - } - }, - "profiling": { - "addr": ":6060", - "enabled": true - }, - "api": { - "addr": ":18080", - "pathPrefix": "/api", - "accesslog": true, - "auth": { - "username": "user", - "password": "password" - }, - "auther": "auther-0" - }, - "metrics": { - "addr": ":9000", - "path": "/metrics" - } -}`,In=[],Ue=xn(at,In,{allowTrailingComma:!0}),Bn=e=>{if(!Ue)return;const s=Tn(Ue,[e,0]);if(s){const{offset:n,length:t}=s;return at.substring(n,n+t)}},E=(e,s="默认")=>{const n=Bn(e);if(n)return{label:s,json:n}},Fn=e=>`{ - "name": "${e}-0", - "file": { - "path": "/path/to/file" - } - }`,_n=(e,s)=>`{ - "name": "${e}-0", - "redis": { - "addr": "127.0.0.1:6379", - "db": "1", - "password": "123456", - ${s?`"type": "${s}",`:""} - "key": "gost:${e}-0" - } - }`,zn=e=>`{ - "name": "${e}-0", - "http": { - "url": "http://127.0.0.1:8000", - "timeout": "10s" - } - }`,ct=e=>`{ - "name": "${e}-0", - "plugin": { - "type": "grpc", - // "type": "http", - "addr": "127.0.0.1:8000", - "token": "gost", - // "tls": {} - } - }`,W=(e,s="",n)=>{const t=s?`// ${s} -`:"";return[{label:"文件",json:t+Fn(e)},{label:"Redis",json:t+_n(e,n==null?void 0:n.redisType)},{label:"HTTP",json:t+zn(e)},{label:"插件",json:t+ct(e)}]},De=E("admissions"),Mn=[De||{label:"内联",json:` - // https://gost.run/concepts/admission - { - "name": "admission-0", - "matchers": [ - "127.0.0.1", - "192.168.0.0/16", - "example.com" - ] - }`},...W("admission","https://gost.run/concepts/admission")],He=E("authers"),Rn=[He||{label:"内联",json:` - // https://gost.run/concepts/auth - { - "name": "auther-0", - "auths": [ - { - "username": "user1", - "password": "pass1" - }, - { - "username": "user2", - "password": "pass2" - } - ] - }`},...W("auther","https://gost.run/concepts/auth")],Un=E("chains"),Dn=[Un,{label:"典型转发链",cli:"",json:` -{ - "name": "chain-0", - "hops": [ - { - "name": "hop-0", - "nodes": [ - { - "name": "node-0", - "addr": "proxy.xxx.com:1080", - "connector": { - "type": "socks5", - "auth": { - "username": "username", - "password": "password" - } - }, - "dialer": { - "type": "tcp", - "tls": { - "serverName": "proxy.xxx.com" - } - } - } - ] - } - ] -} - `}],Je=E("bypasses"),Hn=[Je||{label:"内联",json:` - // https://gost.run/concepts/bypass/ - { - "name": "bypass-0", - "matchers": [ - "127.0.0.1", - "172.10.0.0/16", - "localhost", - "*.example.com", - ".example.org" - ] - }`},...W("bypass","https://gost.run/concepts/bypass/")],Pe=E("hops"),Jn=[Pe||{label:"内联",json:` - // https://gost.run/concepts/hop - { - "name": "hop-0", - "nodes": [ - { - "name": "node-0", - "addr": ":8888", - "connector": { - "type": "http" - }, - "dialer": { - "type": "tcp" - } - }, - { - "name": "node-1", - "addr": ":9999", - "connector": { - "type": "socks5" - }, - "dialer": { - "type": "tcp" - } - } - ] - }`},...W("hop","https://gost.run/concepts/hop")],We=E("hosts"),Pn=[We||{label:"内联",json:` - // https://gost.run/concepts/hosts/ - { - "name": "hosts-0", - "mappings": [ - { - "ip": "127.0.0.1", - "hostname": "example.com" - }, - { - "ip": "2001:db8::1", - "hostname": "example.com" - } - ] - }`},...W("hosts","https://gost.run/concepts/hosts/")],qe=E("ingresses"),Wn=[qe||{label:"内联",json:`{ - "name": "ingress-0", - "rules": [ - { - "hostname": "example.com", - "endpoint": "4d21094e-b74c-4916-86c1-d9fa36ea677b" - }, - { - "hostname": "example.org", - "endpoint": "ac74d9dd-3125-442a-a7c1-f9e49e05faca" - } - ] - }`},...W("ingress","https://gost.run/concepts/ingress/",{redisType:"hash"})],Ge=E("routers"),qn=[Ge||{label:"内联",json:` - // https://gost.run/concepts/router/ - { - "name": "router-0", - "routes": [ - { - "net": "192.168.1.0/24", - "gateway": "192.168.123.2" - }, - { - "net": "172.10.0.0/16", - "gateway": "192.168.123.3" - } - ] - }`},...W("router","https://gost.run/concepts/router/")],D=(e,s,n)=>{let t=` - { - "name": "service-0", - "addr": ":1080", - "handler": { - "type": "${e}", - // "auth": { - // "username": "user", - // "password": "password" - // } - }, - "listener": { - "type": "${s}" - } - }`;if(n){const l=fe(t,["metadata"],n,{});l.push(...fe(t,["handler","metadata"],n,{})),l.push(...fe(t,["listener","metadata"],n,{})),t=Ie(t,l)}return t},Gn=E("services"),Qn=[Gn,{label:"端口转发",cli:"-L tcp://:80/:8080",json:` - { - "name": "service-0", // 服务名称 - "addr": ":80", - "handler": { - "type": "tcp" - }, - "listener": { - "type": "tcp" - }, - "forwarder": { - "nodes": [ - { - "name": "target-0", - "addr": ":8080" - } - ] - } - }`},{label:"反向代理",cli:"",json:` - { - "name": "service-0", - "addr": ":80", - "handler": { - "type": "tcp", - "metadata": { - "sniffing": "true" - } - }, - "listener": { - "type": "tcp" - }, - "forwarder": { - "nodes": [ - { - "name": "target-1", - "addr": "www.baidu.com:80", - // "host": "myhost.com", - // "path": "/" - "http": { - "host": "www.baidu.com" - } - } - ] - } - }`},{label:"代理服务",children:[{label:"http",children:[{label:"http",json:D("http","tcp")},{label:"https(http+tsl)",json:D("http","tls")},{label:"http+wss",json:D("http","wss")},{label:"http2",json:D("http2","http2")}]},{label:"relay",children:[{label:"relay+tcp",json:D("relay","tcp")},{label:"relay+tls",json:D("relay","tls")},{label:"relay+wss",json:D("relay","tls")}]},{label:"socks",children:[{label:"socks4",json:D("socks","tcp")},{label:"socks5",json:D("socks5","tcp")},{label:"socks5(支持udp)",json:D("socks5","tcp",{udp:"true"})},{label:"socks5+tls",json:D("socks5","tls",{notls:"true"})}]}]},{label:"代理转发",cli:"-L socks5://:1080 -F socks5://xxx.com:1080",json:` - { - "name": "service-0", - "addr": ":1080", - "handler": { - "type": "socks5", - "chain": "chain-0" - }, - "listener": { - "type": "tcp" - } - }`}],Qe=E("climiter"),Xn=[Qe||{label:"内联",json:` - // https://gost.run/concepts/limiter/ - { - "name": "climiter-0", - "limits": [ - "$ 1000", - "$$ 100", - "192.168.1.1 10" - ] - }`},...W("climiter","https://gost.run/concepts/limiter/",{redisType:"set"})],Xe=E("limiters"),Zn=[Xe||{label:"内联",json:` - // https://gost.run/concepts/limiter/ - { - "name": "limiter-0", - "limits": [ - "$ 100MB 100MB", - "$$ 10MB", - "192.168.1.1 512KB 1MB", - "192.168.0.0/16 1MB 5MB" - ] - }`},...W("limiters","https://gost.run/concepts/limiter/",{redisType:"set"})],Ze=E("rlimiter"),Yn=[Ze||{label:"内联",json:` - // https://gost.run/concepts/limiter/ - { - "name": "rlimiter-0", - "limits": [ - "$ 100", - "$$ 10", - "192.168.1.1 50", - "192.168.0.0/16 5" - ] - }`},...W("rlimiter","https://gost.run/concepts/limiter/",{redisType:"set"})],Kn=E("resolvers"),Cn=[Kn,{label:"插件",json:ct("resolver")}],Ye=E("sds"),es=[Ye||{label:"HTTP插件",json:` - // https://gost.run/concepts/sd/ - { - "name": "sd-0", - "plugin": { - "type": "http", - "addr": "http://127.0.0.1:8000/sd", - // "token": "gost", - // "tls": {} - } - }`}],Ke=E("observers"),ts=[Ke||{label:"插件",json:` - // https://gost.run/concepts/observer/ - { - "name": "observer-0", - "plugin": { - "type": "grpc", - // "type": "http", - "addr": "127.0.0.1:8000", - "token": "gost", - // "tls": {} - } - }`}],ns={admissions:Mn,authers:Rn,bypasses:Hn,chains:Dn,climiters:Xn,limiters:Zn,rlimiters:Yn,hops:Jn,hosts:Pn,ingresses:Wn,resolvers:Cn,routers:qn,sds:es,observers:ts,services:Qn},ut=e=>{const{name:s}=e;return b.useMemo(()=>ns[s],[s])},ft=e=>{const{name:s,localApi:n,gostConfig:t,localConfig:l}=e,i=b.useMemo(()=>(t==null?void 0:t[s])||[],[t,s]),f=b.useMemo(()=>n?(l==null?void 0:l[s])||[]:[],[l,s,n]),o=b.useMemo(()=>[...i,...f],[i,f]);return{dataList:i,dataSource:o}},te=ae.createContext({}),Ce=(e,s,n)=>JSON.stringify(s),ss=(e,s)=>{var n,t;return((t=(n=e==null?void 0:e.name)==null?void 0:n.toLowerCase())==null?void 0:t.indexOf(s))!==-1},ls=e=>{const{name:s,title:n,api:t,localApi:l,keyName:i,rowKey:f="name",keyword:o,renderConfig:a=Ce,filter:u=ss}=e,{localList:c,comm:m}=b.useContext(Ve),{gostConfig:j,localConfig:k}=b.useContext(ue),{dataList:w,dataSource:T}=ft({localApi:l,name:i,gostConfig:j,localConfig:k}),v=ut({name:i});Ft.useApp();const{deleteValue:L,updateValue:O,dispatch:h,enable:p,updateLocal:d,deleteLocal:g,addValue:y}=m,V=b.useRef({dataList:w,dataSource:T});b.useImperativeHandle(V,()=>({dataList:w,dataSource:T}),[w,T]);const q=b.useMemo(()=>o?T.filter(N=>u(N,o)):T,[T,u,o]);return b.useEffect(()=>{function N({path:S,record:x}){const{dataList:A,dataSource:J}=V.current,I=A.includes(x),U=x.name,G=S.split(","),ht=G.reduce((X,ne)=>X==null?void 0:X[ne],x),gt=X=>{let ne=x;G.forEach((Be,bt)=>{bt===G.length-1?ne[Be]=X:ne=ne[Be]})};oe({title:"修改",initialValues:{value:ie(ht)},onFinish:async X=>(gt(Q(X.value)),I?await O(U,x):await d(U,x),!0)})}return _.on(`edit:${s}`,N),()=>{_.off(`edit:${s}`,N)}},[]),r.jsx("div",{style:{height:348,overflow:"auto"},children:r.jsx(_t,{rowKey:N=>N._id_||N.name,scroll:{y:290},size:"small",dataSource:q,columns:[{title:f,dataIndex:f,ellipsis:!0,width:100},{title:"详情",ellipsis:!0,render:(N,S,x)=>{const J=w.includes(S)?U=>O(S.name,U||S):U=>d(S.name,U||S);let I;try{I=a(N,S,x)}catch{I=Ce(N,S)}return r.jsx(te.Provider,{value:{update:J},children:I})}},{title:"操作",width:l?120:90,align:"right",dataIndex:f,render:(N,S,x)=>{const A=w.includes(S),J={...S};return delete J.status,r.jsxs(z,{size:2,children:[l?A?r.jsx(R,{title:"点击禁用",icon:r.jsx(tt,{style:{color:zt.primary}}),type:"link",size:"small",onClick:async()=>{await h(S)}}):r.jsx(R,{title:"点击启用",type:"link",icon:r.jsx(hn,{style:{color:Mt.primary}}),size:"small",onClick:async()=>{await p(S)}}):null,r.jsx(R,{title:"修改",icon:r.jsx(Rt,{}),type:"link",size:"small",onClick:()=>{oe({title:`修改 ${N||""}`,templates:v,initialValues:{value:ie(J)},onFinish:async I=>{const{value:U}=I,G=Q(U);return A?await O(S.name,G):await d(S.name,{...J,...G}),!0}})}}),r.jsx(R,{title:"复制",icon:r.jsx(Ut,{}),type:"link",size:"small",onClick:()=>{oe({title:`复制自 ${N||""}`,templates:v,initialValues:{value:ie(J)},onFinish:async I=>{const{value:U}=I,G=Q(U);return await m.addValue(G),!0}})}}),r.jsx(Dt,{title:"警告",description:"确定要删除吗?",onConfirm:()=>{A?L(S):g(S)},children:r.jsx(R,{title:"删除",icon:r.jsx(Ht,{}),type:"link",size:"small"})})]})}}],pagination:!1})})},rs=e=>{const{keyName:s,title:n}=e,{comm:t}=b.useContext(Ve),l=ut({name:s});return r.jsx(ot,{title:`添加 ${n||""}`,templates:l,trigger:r.jsx(R,{icon:r.jsx(Jt,{}),size:"small"}),onFinish:async i=>{const{value:f}=i,o=Q(f);return await t.addValue(o),!0}})},B=e=>({keyName:e,api:jt[e],localApi:wt[e],rowKey:"name"}),is=[{name:"admission",title:"准入控制器(Admission)",subTitle:"准入控制器",...B("admissions")},{name:"auther",title:"认证器(Auther)",subTitle:"认证器",...B("authers")},{name:"bypass",title:"分流器(Bypass)",subTitle:"分流器",...B("bypasses")},{name:"chain",title:"转发链(Chain)",subTitle:"转发链",...B("chains")},{name:"climiter",title:"并发连接数限制",subTitle:"",...B("climiters")},{name:"limiter",title:"流量速率限制",subTitle:"",...B("limiters")},{name:"rlimiter",title:"请求速率限制",subTitle:"",...B("rlimiters")},{name:"hop",title:"跳跃点(Hop)",subTitle:"跳跃点",...B("hops")},{name:"host",title:"主机映射器(Hosts)",subTitle:"主机映射器",...B("hosts")},{name:"ingress",title:"Ingress",subTitle:"Ingress",...B("ingresses")},{name:"resolver",title:"域名解析器(Resolver)",subTitle:"域名解析器",...B("resolvers")},{name:"service",title:"服务(Service)",subTitle:"服务",...B("services")},{name:"sd",title:"服务发现(SD)",subTitle:"服务发现",...B("sds")},{name:"observer",title:"观测器(Observer)",subTitle:"观测器",...B("observers")}],os=e=>is.find(s=>s.name===e),Ae=e=>{const{boxShadow:s,className:n,...t}=e,l=we(n,{"antd-cord-boxShadow":s});return r.jsx(Pt,{className:l,...t})},F=e=>{const{title:s,subTitle:n,name:t,keyName:l,api:i,boxShadow:f=!0,bordered:o=!1,rowKey:a="name",renderConfig:u,localApi:c,filter:m}=b.useMemo(()=>({...os(e.module||""),...e}),[e]),[j,k]=b.useState(""),w={title:n||"",keyword:j,name:t,api:i,keyName:l,rowKey:a,localApi:c,renderConfig:u,filter:m},{gostConfig:T,localConfig:v}=b.useContext(ue),{dataSource:L}=ft({localApi:c,name:l,gostConfig:T,localConfig:v}),O=b.useMemo(()=>{const h=async p=>{await i.post(p)};return{updateValue:async(p,d,g=!0)=>{await i.put(p,d),g&&_.emit("apiUpdate",{})},deleteValue:async(p,d=!0)=>{await i.delete(p.name),d&&_.emit("apiUpdate",{})},addValue:async(p,d=!0)=>{let g=p.name||`${t}-0`;const y=()=>L==null?void 0:L.find(V=>V.name===g);if(y()&&!await new Promise((q,N)=>{Ee.confirm({title:"name无效",content:"是否自动分配name",zIndex:2e3,onOk:()=>q(!0),onCancel:()=>q(!1)})}))throw!1;for(;y();)g=g.replace(/\d*$/,V=>String(V==""?"-0":Number(V)+1));await h({...p,name:g}),p.name!==g&&Wt.info({description:`新分配 name 为 "${g}"`,message:"自动修正提醒"}),d&&_.emit("apiUpdate",{})},dispatch:async p=>{c&&(await i.delete(p.name),await c.add(p),_.emit("update"))},enable:async p=>{c&&(await i.post(p),await c.delete(p.name),_.emit("update"))},updateLocal:async(p,d)=>{c&&(await c.put(p,{...d,name:p}),_.emit("localUpdate"))},deleteLocal:async p=>{c&&(await c.delete(p.name),_.emit("localUpdate"))}}},[i,L,c,t]);return b.useEffect(()=>vt(t,O),[O,t]),r.jsx(Ve.Provider,{value:{name:t,comm:O},children:r.jsx(Ae,{boxShadow:f,bordered:o,title:s,extra:r.jsxs(z,{children:[r.jsx(Ne.Search,{allowClear:!0,onChange:h=>{const p=h.target.value;k(p)},size:"small"}),r.jsx(rs,{...w})]}),children:r.jsx(ls,{...w})})})},as=e=>{const{name:s,addr:n,connector:{type:t,metadata:l}={},dialer:{type:i}={}}=e,f=l?xt.stringify(l):"";return r.jsxs(z,{children:[(t||i)&&r.jsx(P,{color:"#87d068",children:`${t}${i?"+"+i:""}`}),r.jsx(P,{color:"green",children:n}),f&&r.jsx(P,{color:"purple",title:"_metadata",children:"metadata"})]})},Se=({node:e,upjson:s,isLink:n=!1})=>{const{name:t}=e,{update:l}=b.useContext(te);return r.jsx(re,{color:"#ddffbf",title:r.jsx(as,{...e}),children:r.jsx(P,{bordered:!1,color:"green",className:"editor-json",title:"双击修改",onDoubleClick:()=>{s&&oe({title:"修改",initialValues:{value:ie(e)},onFinish:async i=>(s(Q(i.value)),l(),!0)})},children:t})})},dt=e=>{var f;let s=e,n=!1;const{gostConfig:t,localConfig:l}=b.useContext(ue);if(!s.nodes){const o=[...(t==null?void 0:t.hops)||[],...(l==null?void 0:l.hops)||[]].find(a=>a.name===s.name);o&&(n=!0,s=o)}const{nodes:i}=s;if(!i||(i==null?void 0:i.length)<=0)return`[${e.name}(noNodes)]`;if(n){const o=(f=t==null?void 0:t.hops)==null?void 0:f.includes(s),a=s.name;return r.jsx(te.Provider,{value:{update:async u=>{const c=await $e("hop");return(o?j=>c.updateValue(a,j||s):j=>c.updateLocal(a,j||s))(u)}},children:r.jsx(z,{size:5,children:i.map((u,c)=>r.jsx(Se,{node:u,isLink:!0,upjson:m=>i[c]=m},c))})})}return r.jsx(z,{size:5,children:i.map((o,a)=>r.jsx(Se,{node:o,upjson:u=>i[a]=u},o.name+a))})};function cs(e){const{update:s}=b.useContext(te);return r.jsx(z,{size:5,children:e.hops.map((n,t)=>{const l=r.jsx(dt,{...n});return r.jsx(re,{title:l,color:"#c7e7ff",arrow:!1,children:r.jsx(P,{bordered:!1,color:"blue",className:"editor-json",title:"双击修改",onDoubleClick:()=>{oe({title:"修改",initialValues:{value:ie(n)},onFinish:async i=>(e.hops[t]=Q(i.value),s(),!0)})},children:n.name})},n.name+t)}).reduce((n,t,l)=>(n.length>0&&n.push(r.jsx(qt,{style:{color:"blue",fontSize:12}},"_sp_"+l)),n.push(t),n),[])})}function pt(e){const{hops:s}=e;return r.jsx(cs,{hops:s,root:e})}const us=e=>{b.useContext(ue);const s={module:"chain",renderConfig:(n,t,l)=>r.jsx(pt,{...t})};return r.jsx(F,{...s})},mt=(e,s)=>{const{gostConfig:n,localConfig:t}=b.useContext(ue),l=b.useMemo(()=>{var o;return(o=n==null?void 0:n[s])==null?void 0:o.find(a=>a.name===e)},[n,e,s]),i=b.useMemo(()=>{var o;return(o=t==null?void 0:t[s])==null?void 0:o.find(a=>a.name===e)},[t,e,s]);return[l??i,!!l]},fs=e=>{const[s,n]=mt(e.name,"hops");let t=e,l=!1;t.nodes||(t=s,l=!!s);const{nodes:i}=t;if(!i||(i==null?void 0:i.length)<=0)return`[${e.name}(noNodes)]`;const f=r.jsx(z,{size:5,children:i.map((o,a)=>r.jsx(Se,{node:o,upjson:u=>i[a]=u},o.name+a))});if(l){const o=t.name;return r.jsx(te.Provider,{value:{update:async a=>{const u=await $e("hop");return(n?m=>u.updateValue(o,m||t):m=>u.updateLocal(o,m||t))(a)}},children:f})}return f},et=e=>{const[s,n]=mt(e.chainName,"chains");if(!s)return"[no chain]";const t=e.chainName;return r.jsx(te.Provider,{value:{update:async l=>{const i=await $e("chain");return(n?o=>i.updateValue(t,o||s):o=>i.updateLocal(t,o||s))(l)}},children:r.jsx(pt,{...s})})},ds=e=>{const{name:s,addr:n,handler:t,listener:l,forwarder:i}=e,f=b.useMemo(()=>{const o=t==null?void 0:t.type,a=l==null?void 0:l.type;return o===a?o:`${o}+${a}`},[t,l]);return r.jsxs(z,{children:[r.jsx(P,{color:"#87d068",children:f}),r.jsx(P,{color:"green",children:n}),t.chain&&r.jsx(re,{title:r.jsx(et,{chainName:t.chain}),color:"#c7e7ff",arrow:!1,children:r.jsx(P,{children:"转发链"})}),l.chain&&r.jsx(re,{title:r.jsx(et,{chainName:l.chain}),color:"#fff0d7",arrow:!1,children:r.jsx(P,{color:"orange",children:"远程端口转发"})}),i&&r.jsx(re,{title:r.jsx(fs,{...i}),color:"#c7e7ff",arrow:!1,children:r.jsx(P,{children:"转发/反代 节点"})})]})},ps=e=>{const{colSpan:s}=e;je();const n={module:"service",renderConfig:(t,l,i)=>r.jsx(ds,{...l}),filter:(t,l)=>{const{name:i,addr:f,handler:o,listener:a}=t;function u(c){const m=c==null?void 0:c.toLowerCase();return m?m.indexOf(l)!==-1:!1}return u(i)||u(f)||u(o==null?void 0:o.type)||u(a==null?void 0:a.type)}};return r.jsx($,{...s,xxl:16,children:r.jsx(F,{...n})})},ms=e=>r.jsx(F,{module:"hop",renderConfig:(s,n,t)=>r.jsx(dt,{...n})}),H={xs:24,sm:24,md:12,lg:12,xl:12,xxl:8},ke={sm:24,xxl:8},bs=()=>{const e=se(),s=je(),[n,t]=b.useState(!1),[l,i]=b.useState(!1),[f,o]=b.useState(!0),[a,u]=b.useState([]),c=b.useRef({}),m=b.useCallback(async()=>Tt().then(k=>k.sort((w,T)=>{const v=w.time||0;return(T.time||0)-v})).then(k=>u(k.filter(w=>w.addr!==e.addr).map(w=>({key:w.addr,label:r.jsx("a",{href:`./?use=${w.addr}`,children:w.addr})})))),[]);b.useEffect(()=>{Ot().then(v=>{v&&_.emit("update")});const k=c.current.onSave=async()=>{try{i(!0);const{saveFormat:v,savePath:L}=se.get()||{};await Lt(v,L),o(!0)}finally{i(!1)}},w=()=>{var v;if(o(!1),!!((v=se.get())!=null&&v.autoSave))return k()},T=async v=>{var L;if(o(!1),!!((L=se.get())!=null&&L.autoSave)&&(v==null?void 0:v.url)!==Nt.config)return k()};return m(),_.on("update",w),_.on("apiUpdate",T),()=>{_.off("update",w),_.off("apiUpdate",T)}},[]);const j=b.useMemo(()=>{const k=[];return a.length&&(k.push({key:"2",label:" 切换 ",children:a}),k.push({type:"divider"})),k.push({key:"new",label:"打开新链接",onClick:()=>{window.open(location.href,void 0,"noopener")}}),k},[a]);return r.jsxs(he,{style:{height:"100vh",overflow:"hidden"},children:[r.jsxs(he.Header,{style:{color:"#FFF",paddingInline:20},children:[r.jsxs(ge,{align:"middle",justify:"space-between",wrap:!1,children:[r.jsx($,{color:"",children:r.jsx(R,{type:"link",icon:r.jsx(Gt,{}),onClick:async()=>{je.set(await At())},children:"刷新配置"})}),r.jsx($,{children:e.addr}),r.jsx($,{children:r.jsxs(z,{children:[r.jsxs(z.Compact,{children:[r.jsx(R,{icon:f?r.jsx(tt,{}):r.jsx(ln,{}),loading:l,onClick:()=>{var k,w;return(w=(k=c.current)==null?void 0:k.onSave)==null?void 0:w.call(k)},children:"保存到服务器"}),r.jsx(R,{icon:r.jsx(un,{}),onClick:()=>t(!0)})]}),r.jsx(R,{icon:r.jsx(Qt,{}),onClick:()=>{Vn(Oe(s),"gost.json")},children:"下载当前配置"}),r.jsx(ve.Button,{menu:{items:j},onClick:St,children:"退出"}),r.jsx(Vt,{size:"small"})]})})]}),r.jsx(Ee,{destroyOnClose:!0,open:n,onCancel:()=>t(!1),footer:!1,children:r.jsxs(Y,{initialValues:e,layout:"horizontal",labelCol:{span:4},onValuesChange:(k,w)=>{Object.assign(e,k),se.set(e),e.isLocal&&$t(e.addr,e)},children:[r.jsx(Y.Item,{name:"autoSave",label:"自动保存",valuePropName:"checked",children:r.jsx(Xt,{})}),r.jsx(Y.Item,{name:"saveFormat",label:"格式",initialValue:"json",children:r.jsxs(be.Group,{optionType:"button",buttonStyle:"solid",children:[r.jsx(be,{value:"json",children:"json"}),r.jsx(be,{value:"yaml",children:"yaml"})]})}),r.jsx(Y.Item,{name:"savePath",label:"保存路径",trigger:"onChange",children:r.jsx(Ne,{placeholder:"指定保存,默认保存到上下文目录"})})]})})]}),r.jsx(he.Content,{style:{height:"100%",padding:16,boxSizing:"border-box",overflow:"auto"},children:r.jsxs(ge,{gutter:[16,16],style:{overflow:"hidden"},children:[r.jsx(ps,{colSpan:H}),r.jsx($,{...H,children:r.jsx(us,{})}),r.jsx($,{...H,children:r.jsx(ms,{})}),r.jsx($,{...H,children:r.jsx(F,{module:"auther"})}),r.jsx($,{...H,children:r.jsx(F,{module:"admission"})}),r.jsx($,{...H,children:r.jsx(F,{module:"bypass"})}),r.jsx($,{...H,children:r.jsx(F,{module:"host"})}),r.jsx($,{...H,children:r.jsx(F,{module:"ingress"})}),r.jsx($,{...H,children:r.jsx(F,{module:"resolver"})}),r.jsx($,{...H,children:r.jsx(F,{module:"sd"})}),r.jsx($,{...H,children:r.jsx(F,{module:"observer"})}),r.jsx($,{span:24,children:r.jsx(Ae,{boxShadow:!0,title:"限速限流",children:r.jsxs(ge,{gutter:[16,16],children:[r.jsx($,{...ke,children:r.jsx(F,{module:"limiter",bordered:!0,boxShadow:!1})}),r.jsx($,{...ke,children:r.jsx(F,{module:"rlimiter",bordered:!0,boxShadow:!1})}),r.jsx($,{...ke,children:r.jsx(F,{module:"climiter",bordered:!0,boxShadow:!1})})]})})}),r.jsx($,{span:24,children:r.jsx(Ae,{boxShadow:!0,title:"All Config JSON",styles:{body:{padding:20}},children:r.jsx(it,{className:"g-boder",value:Oe(s),height:500,language:"json",options:{minimap:{enabled:!1},readOnly:!0}})})})]})})]})};export{bs as default}; diff --git a/assets/Manage-a4e861d9.js b/assets/Manage-a4e861d9.js new file mode 100644 index 0000000..e8ce862 --- /dev/null +++ b/assets/Manage-a4e861d9.js @@ -0,0 +1,508 @@ +import{g as wt,u as G,a as vt,j as r,b as me,c as xt,C as Ne,d as fe,e as V,A as Tt,L as Ot,f as Lt,q as At,h as Ee,i as Te,k as re,l as $t,m as Ut,s as St,n as _t,o as It,T as Nt,p as Et,r as Vt,t as zt}from"./index-4864998e.js";import{r as b,A as be,_ as ye,f as ue,j as Oe,I as Ve,d as C,M as ze,S as z,k as Le,B as M,l as Bt,n as Ft,h as Mt,i as Rt,T as Dt,o as Pt,p as Ht,E as Jt,q as Wt,P as qt,D as Gt,s as Qt,u as Xt,v as Zt,w as ie,x as H,y as Yt,C as U,L as ke,R as je,z as Kt,G as Ct,H as en,J as we}from"./antd-15fa66a0.js";var tn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};const nn=tn;var sn=function(n,s){return b.createElement(be,ye({},n,{ref:s,icon:nn}))},ln=b.forwardRef(sn);const lt=ln;var rn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"};const on=rn;var an=function(n,s){return b.createElement(be,ye({},n,{ref:s,icon:on}))},cn=b.forwardRef(an);const un=cn;var dn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};const fn=dn;var mn=function(n,s){return b.createElement(be,ye({},n,{ref:s,icon:fn}))},pn=b.forwardRef(mn);const hn=pn;var gn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"};const bn=gn;var yn=function(n,s){return b.createElement(be,ye({},n,{ref:s,icon:bn}))},kn=b.forwardRef(yn);const jn=kn;function rt(e,n=!1){const s=e.length;let t=0,l="",o=0,u=16,a=0,i=0,d=0,c=0,m=0;function y(h,v){let f=0,g=0;for(;f=48&&p<=57)g=g*16+p-48;else if(p>=65&&p<=70)g=g*16+p-65+10;else if(p>=97&&p<=102)g=g*16+p-97+10;else break;t++,f++}return f=s){h+=e.substring(v,t),m=2;break}const f=e.charCodeAt(t);if(f===34){h+=e.substring(v,t),t++;break}if(f===92){if(h+=e.substring(v,t),t++,t>=s){m=2;break}switch(e.charCodeAt(t++)){case 34:h+='"';break;case 92:h+="\\";break;case 47:h+="/";break;case 98:h+="\b";break;case 102:h+="\f";break;case 110:h+=` +`;break;case 114:h+="\r";break;case 116:h+=" ";break;case 117:const p=y(4,!0);p>=0?h+=String.fromCharCode(p):m=4;break;default:m=5}v=t;continue}if(f>=0&&f<=31)if(oe(f)){h+=e.substring(v,t),m=2;break}else m=6;t++}return h}function T(){if(l="",m=0,o=t,i=a,c=d,t>=s)return o=s,u=17;let h=e.charCodeAt(t);if(ve(h)){do t++,l+=String.fromCharCode(h),h=e.charCodeAt(t);while(ve(h));return u=15}if(oe(h))return t++,l+=String.fromCharCode(h),h===13&&e.charCodeAt(t)===10&&(t++,l+=` +`),a++,d=t,u=14;switch(h){case 123:return t++,u=1;case 125:return t++,u=2;case 91:return t++,u=3;case 93:return t++,u=4;case 58:return t++,u=6;case 44:return t++,u=5;case 34:return t++,l=x(),u=10;case 47:const v=t-1;if(e.charCodeAt(t+1)===47){for(t+=2;t=12&&h<=15);return h}return{setPosition:w,getPosition:()=>t,scan:n?O:T,getToken:()=>u,getTokenValue:()=>l,getTokenOffset:()=>o,getTokenLength:()=>t-o,getTokenStartLine:()=>i,getTokenStartCharacter:()=>o-c,getTokenError:()=>m}}function ve(e){return e===32||e===9}function oe(e){return e===10||e===13}function ee(e){return e>=48&&e<=57}var Me;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(Me||(Me={}));const F=new Array(20).fill(0).map((e,n)=>" ".repeat(n)),te=200,Re={" ":{"\n":new Array(te).fill(0).map((e,n)=>` +`+" ".repeat(n)),"\r":new Array(te).fill(0).map((e,n)=>"\r"+" ".repeat(n)),"\r\n":new Array(te).fill(0).map((e,n)=>`\r +`+" ".repeat(n))}," ":{"\n":new Array(te).fill(0).map((e,n)=>` +`+" ".repeat(n)),"\r":new Array(te).fill(0).map((e,n)=>"\r"+" ".repeat(n)),"\r\n":new Array(te).fill(0).map((e,n)=>`\r +`+" ".repeat(n))}},wn=[` +`,"\r",`\r +`];function ot(e,n,s){let t,l,o,u,a;if(n){for(u=n.offset,a=u+n.length,o=u;o>0&&!ge(e,o-1);)o--;let f=a;for(;f1)return ne(i,c)+ne(y,t+m);const f=y.length*(t+m);return!d||f>Re[w][i].length?i+ne(y,t+m):f<=0?i:Re[w][i][f]}function L(){let f=k.scan();for(c=0;f===15||f===14;)f===14&&s.keepLines?c+=1:f===14&&(c=1),f=k.scan();return x=f===16||k.getTokenError()!==0,f}const O=[];function h(f,g,p){!x&&(!n||gu)&&e.substring(g,p)!==f&&O.push({offset:g,length:p-g,content:f})}let v=L();if(s.keepLines&&c>0&&h(ne(i,c),0,0),v!==17){let f=k.getTokenOffset()+o,g=y.length*t<20&&s.insertSpaces?F[y.length*t]:ne(y,t);h(g,o,f)}for(;v!==17;){let f=k.getTokenOffset()+k.getTokenLength()+o,g=L(),p="",$=!1;for(;c===0&&(g===12||g===13);){let Q=k.getTokenOffset()+o;h(F[1],f,Q),f=k.getTokenOffset()+k.getTokenLength()+o,$=g===12,p=$?T():"",g=L()}if(g===2)v!==1&&m--,s.keepLines&&c>0||!s.keepLines&&v!==1?p=T():s.keepLines&&(p=F[1]);else if(g===4)v!==3&&m--,s.keepLines&&c>0||!s.keepLines&&v!==3?p=T():s.keepLines&&(p=F[1]);else{switch(v){case 3:case 1:m++,s.keepLines&&c>0||!s.keepLines?p=T():p=F[1];break;case 5:s.keepLines&&c>0||!s.keepLines?p=T():p=F[1];break;case 12:p=T();break;case 13:c>0?p=T():$||(p=F[1]);break;case 6:s.keepLines&&c>0?p=T():$||(p=F[1]);break;case 10:s.keepLines&&c>0?p=T():g===6&&!$&&(p="");break;case 7:case 8:case 9:case 11:case 2:case 4:s.keepLines&&c>0?p=T():(g===12||g===13)&&!$?p=F[1]:g!==5&&g!==17&&(x=!0);break;case 16:x=!0;break}c>0&&(g===12||g===13)&&(p=T())}g===17&&(s.keepLines&&c>0?p=T():p=s.insertFinalNewline?i:"");const _=k.getTokenOffset()+o;h(p,f,_),v=g}return O}function ne(e,n){let s="";for(let t=0;t{const i={};u(i),o.push(l),l=i,t=null},onObjectProperty:i=>{t=i},onObjectEnd:()=>{l=o.pop()},onArrayBegin:()=>{const i=[];u(i),o.push(l),l=i,t=null},onArrayEnd:()=>{l=o.pop()},onLiteralValue:u,onError:(i,d,c)=>{n.push({error:i,offset:d,length:c})}},s),l[0]}function it(e,n=[],s=de.DEFAULT){let t={type:"array",offset:-1,length:-1,children:[],parent:void 0};function l(i){t.type==="property"&&(t.length=i-t.offset,t=t.parent)}function o(i){return t.children.push(i),i}at(e,{onObjectBegin:i=>{t=o({type:"object",offset:i,length:-1,parent:t,children:[]})},onObjectProperty:(i,d,c)=>{t=o({type:"property",offset:d,length:-1,parent:t,children:[]}),t.children.push({type:"string",value:i,offset:d,length:c,parent:t})},onObjectEnd:(i,d)=>{l(i+d),t.length=i+d-t.offset,t=t.parent,l(i+d)},onArrayBegin:(i,d)=>{t=o({type:"array",offset:i,length:-1,parent:t,children:[]})},onArrayEnd:(i,d)=>{t.length=i+d-t.offset,t=t.parent,l(i+d)},onLiteralValue:(i,d,c)=>{o({type:On(i),offset:d,length:c,parent:t,value:i}),l(d+c)},onSeparator:(i,d,c)=>{t.type==="property"&&(i===":"?t.colonOffset=d:i===","&&l(d))},onError:(i,d,c)=>{n.push({error:i,offset:d,length:c})}},s);const a=t.children[0];return a&&delete a.parent,a}function Ae(e,n){if(!e)return;let s=e;for(let t of n)if(typeof t=="string"){if(s.type!=="object"||!Array.isArray(s.children))return;let l=!1;for(const o of s.children)if(Array.isArray(o.children)&&o.children[0].value===t&&o.children.length===2){s=o.children[1],l=!0;break}if(!l)return}else{const l=t;if(s.type!=="array"||l<0||!Array.isArray(s.children)||l>=s.children.length)return;s=s.children[l]}return s}function at(e,n,s=de.DEFAULT){const t=rt(e,!1),l=[];function o(j){return j?()=>j(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function u(j){return j?()=>j(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>l.slice()):()=>!0}function a(j){return j?A=>j(A,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function i(j){return j?A=>j(A,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>l.slice()):()=>!0}const d=u(n.onObjectBegin),c=i(n.onObjectProperty),m=o(n.onObjectEnd),y=u(n.onArrayBegin),w=o(n.onArrayEnd),k=i(n.onLiteralValue),x=a(n.onSeparator),T=o(n.onComment),L=a(n.onError),O=s&&s.disallowComments,h=s&&s.allowTrailingComma;function v(){for(;;){const j=t.scan();switch(t.getTokenError()){case 4:f(14);break;case 5:f(15);break;case 3:f(13);break;case 1:O||f(11);break;case 2:f(12);break;case 6:f(16);break}switch(j){case 12:case 13:O?f(10):T();break;case 16:f(1);break;case 15:case 14:break;default:return j}}}function f(j,A=[],W=[]){if(L(j),A.length+W.length>0){let B=t.getToken();for(;B!==17;){if(A.indexOf(B)!==-1){v();break}else if(W.indexOf(B)!==-1)break;B=v()}}}function g(j){const A=t.getTokenValue();return j?k(A):(c(A),l.push(A)),v(),!0}function p(){switch(t.getToken()){case 11:const j=t.getTokenValue();let A=Number(j);isNaN(A)&&(f(2),A=0),k(A);break;case 7:k(null);break;case 8:k(!0);break;case 9:k(!1);break;default:return!1}return v(),!0}function $(){return t.getToken()!==10?(f(3,[],[2,5]),!1):(g(!1),t.getToken()===6?(x(":"),v(),S()||f(4,[],[2,5])):f(5,[],[2,5]),l.pop(),!0)}function _(){d(),v();let j=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(j||f(4,[],[]),x(","),v(),t.getToken()===2&&h)break}else j&&f(6,[],[]);$()||f(4,[],[2,5]),j=!0}return m(),t.getToken()!==2?f(7,[2],[]):v(),!0}function Q(){y(),v();let j=!0,A=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(A||f(4,[],[]),x(","),v(),t.getToken()===4&&h)break}else A&&f(6,[],[]);j?(l.push(0),j=!1):l[l.length-1]++,S()||f(4,[],[4,5]),A=!0}return w(),j||l.pop(),t.getToken()!==4?f(8,[4],[]):v(),!0}function S(){switch(t.getToken()){case 3:return Q();case 1:return _();case 10:return g(!0);default:return p()}}return v(),t.getToken()===17?s.allowEmptyContent?!0:(f(4,[],[]),!1):S()?(t.getToken()!==17&&f(9,[],[]),!0):(f(4,[],[]),!1)}function On(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(e){if(Array.isArray(e))return"array"}else return"null";return"object"}default:return"null"}}function Ln(e,n,s,t){const l=n.slice(),u=it(e,[]);let a,i;for(;l.length>0&&(i=l.pop(),a=Ae(u,l),a===void 0&&s!==void 0);)typeof i=="string"?s={[i]:s}:s=[s];if(a)if(a.type==="object"&&typeof i=="string"&&Array.isArray(a.children)){const d=Ae(a,[i]);if(d!==void 0)if(s===void 0){if(!d.parent)throw new Error("Malformed AST");const c=a.children.indexOf(d.parent);let m,y=d.parent.offset+d.parent.length;if(c>0){let w=a.children[c-1];m=w.offset+w.length}else m=a.offset+1,a.children.length>1&&(y=a.children[1].offset);return K(e,{offset:m,length:y-m,content:""},t)}else return K(e,{offset:d.offset,length:d.length,content:JSON.stringify(s)},t);else{if(s===void 0)return[];const c=`${JSON.stringify(i)}: ${JSON.stringify(s)}`,m=t.getInsertionIndex?t.getInsertionIndex(a.children.map(w=>w.children[0].value)):a.children.length;let y;if(m>0){let w=a.children[m-1];y={offset:w.offset+w.length,length:0,content:","+c}}else a.children.length===0?y={offset:a.offset+1,length:0,content:c}:y={offset:a.offset+1,length:0,content:c+","};return K(e,y,t)}}else if(a.type==="array"&&typeof i=="number"&&Array.isArray(a.children)){const d=i;if(d===-1){const c=`${JSON.stringify(s)}`;let m;if(a.children.length===0)m={offset:a.offset+1,length:0,content:c};else{const y=a.children[a.children.length-1];m={offset:y.offset+y.length,length:0,content:","+c}}return K(e,m,t)}else if(s===void 0&&a.children.length>=0){const c=i,m=a.children[c];let y;if(a.children.length===1)y={offset:a.offset+1,length:a.length-2,content:""};else if(a.children.length-1===c){let w=a.children[c-1],k=w.offset+w.length,x=a.offset+a.length;y={offset:k,length:x-2-k,content:""}}else y={offset:m.offset,length:a.children[c+1].offset-m.offset,content:""};return K(e,y,t)}else if(s!==void 0){let c;const m=`${JSON.stringify(s)}`;if(!t.isArrayInsertion&&a.children.length>i){const y=a.children[i];c={offset:y.offset,length:y.length,content:m}}else if(a.children.length===0||i===0)c={offset:a.offset+1,length:0,content:a.children.length===0?m:m+","};else{const y=i>a.children.length?a.children.length:i,w=a.children[y-1];c={offset:w.offset+w.length,length:0,content:","+m}}return K(e,c,t)}else throw new Error(`Can not ${s===void 0?"remove":t.isArrayInsertion?"insert":"modify"} Array index ${d} as length is not sufficient`)}else throw new Error(`Can not add ${typeof i!="number"?"index":"property"} to parent of type ${a.type}`);else{if(s===void 0)throw new Error("Can not delete in empty document");return K(e,{offset:u?u.offset:0,length:u?u.length:0,content:JSON.stringify(s)},t)}}function K(e,n,s){if(!s.formattingOptions)return[n];let t=$e(e,n),l=n.offset,o=n.offset+n.content.length;if(n.length===0||n.content.length===0){for(;l>0&&!ge(t,l-1);)l--;for(;o=0;i--){const d=u[i];t=$e(t,d),l=Math.min(l,d.offset),o=Math.max(o,d.offset+d.length),o+=d.content.length-d.length}const a=e.length-(t.length-o)-l;return[{offset:l,length:a,content:t.substring(l,o)}]}function $e(e,n){return e.substring(0,n.offset)+n.content+e.substring(n.offset+n.length)}var De;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(De||(De={}));var Pe;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Pe||(Pe={}));const An=Tn,$n=it,Un=Ae;var He;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(He||(He={}));function Sn(e,n,s){return ot(e,n,s)}function pe(e,n,s,t){return Ln(e,n,s,t)}function Be(e,n){let s=n.slice(0).sort((l,o)=>{const u=l.offset-o.offset;return u===0?l.length-o.length:u}),t=e.length;for(let l=s.length-1;l>=0;l--){let o=s[l];if(o.offset+o.length<=t)e=$e(e,o);else throw new Error("Overlapping edit");t=o.offset}return e}const _n=["_id_","_key_","_type_"],Ue=e=>JSON.stringify(e,null,4),ae=e=>{const n={...e};for(const s of _n)delete n[s];return Ue(n)},In=e=>Be(e,Sn(e,void 0,{tabSize:4,insertSpaces:!0})),Z=e=>{const n=[],s=An(e,n,{allowTrailingComma:!0});if(n.length)throw console.error(n),n[0];return s},Nn=(e,n)=>{const s=[],t=pe.bind(null,e);return n.forEach(({path:l,value:o,options:u},a)=>{l=Array.isArray(l)?l:l.split("."),s.push(...t(l,o,u||{}))}),Be(e,s)},En=(e,n)=>{const s=URL.createObjectURL(new Blob([e])),t=document.createElement("a");t.download=n,t.href=s,t.click(),URL.revokeObjectURL(s)};function Se(e,n,s){const t=e!==void 0,l=n!==void 0,[o,u]=b.useState(t?e:l?n:s),a=b.useRef({value:o,setValue:d=>{let c;typeof d=="function"?c=d(a.current.value):c=d,a.current.value=c,u(c)}});return[b.useMemo(()=>{const c=e!==void 0?e:o;return a.current.value=c,c},[e,o]),a.current.setValue]}(function(){const e=window.require;if(e){const n=wt();n.on("languageChanged",s=>{console.log("languageChanged",s)}),e.config({"vs/nls":{availableLanguages:{"*":n.resolvedLanguage==="zh"?"zh-cn":"en"}}})}window.monacoIsReady=new Promise((n,s)=>{if(!e)return s("Not loaded monaco loader.js");e(["vs/editor/editor.main"],function(){n(monaco)})})})();monacoIsReady.then(()=>{monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!0,trailingCommas:"warning",validate:!0})});const Vn={minimap:{enabled:!1},automaticLayout:!0},zn=(e,n)=>{const{onChange:s,options:t,height:l,className:o,theme:u,style:a}=e,{t:i}=G(),[d,c]=Se(e.language,"javascript"),[m,y]=Se(e.value,e.defaultValue,""),[w,k]=b.useState(!1),x=b.useRef(null),T=b.useRef(null),L=b.useRef({}),O=vt(),h=b.useMemo(()=>u||(O?"vs-dark":"vs"),[u,O]);return ue.useImperativeHandle(n,()=>T.current),ue.useImperativeHandle(L,()=>({onChange:s}),[s]),b.useEffect(()=>{monacoIsReady.then(()=>{k(!0)})},[]),b.useEffect(()=>{if(w&&x.current){const v=x.current;let f;return monacoIsReady.then(()=>{f=T.current=monaco.editor.create(v,{value:m,language:d,theme:h,...Vn,...t}),f.onDidChangeModelContent(function(g){var $,_;const p=f.getValue();y(p),(_=($=L.current)==null?void 0:$.onChange)==null||_.call($,p)}),f.addCommand(monaco.KeyMod.Alt|monaco.KeyCode.KeyX,g=>{var p;(p=f.getAction("my-autoWrap-toggle"))==null||p.run()}),f.addAction({id:"my-autoWrap-toggle",label:i("msg.wordWrap"),keybindings:[monaco.KeyMod.Alt|monaco.KeyCode.KeyZ],run:function(g,p){const $=g.getOption(monaco.editor.EditorOption.wordWrap);g.updateOptions({wordWrap:$==="on"?"off":"on"})}})}),()=>{var g;(g=f==null?void 0:f.dispose)==null||g.call(f)}}},[w]),b.useEffect(()=>{T.current&&m!=T.current.getValue()&&T.current.setValue(m)},[m]),w?r.jsx("div",{className:Oe(o),style:{height:l||"100%",minHeight:0,minWidth:0,boxSizing:"border-box",...a},ref:x}):r.jsx(Ve.TextArea,{style:{height:l||"100%"},className:Oe(o),value:m,onChange:v=>{var g,p;const f=v.target.value;y(f),(p=(g=L.current)==null?void 0:g.onChange)==null||p.call(g,f)}})},ct=ue.forwardRef(zn),Bn=e=>{const{onFinish:n,trigger:s,open:t,onOpenChange:l,modalProps:o,title:u,width:a,formRef:i,children:d,...c}=e,[m,y]=Se(t,!1),[w]=C.useForm(),k=b.useCallback(()=>{var O;y(!1),l==null||l(!1),(O=o==null?void 0:o.onCancel)==null||O.call(o,{})},[l]),x=b.useCallback(()=>{var O;w.resetFields(),(O=o==null?void 0:o.afterClose)==null||O.call(o)},[w,o]),T=b.useMemo(()=>async function(O){await(n==null?void 0:n.apply(null,[O]))===!0&&k()},[n,k]),L=b.useMemo(()=>({...o,onCancel:k,onOk:()=>{w.submit()},afterClose:x,open:m,title:u,width:a}),[x,w,o,k,m,u,a]);return b.useEffect(()=>{if(!i)return;switch(typeof i){case"function":i(w);break;case"object":i.current=w;break}},[w,i]),r.jsxs(r.Fragment,{children:[r.jsx(ze,{...L,children:r.jsx(C,{form:w,onFinish:T,...c,children:d})}),s&&ue.cloneElement(s,{onClick:()=>{y(!0)}})]})},ut=e=>{const{templates:n,...s}=e,{t}=G(),l=b.useRef(),o=i=>{var c,m,y;let d=i;if((c=e.initialValues)!=null&&c.value){const w=Z(e.initialValues.value);d=w.name?Nn(i,[{path:"name",value:w.name}]):i}d=In(d),(m=l.current)==null||m.setFieldValue("value",d),(y=l.current)==null||y.validateFields()},u=i=>{const{children:d,...c}=i,{json:m,cli:y}=i;if(d)return{...c,children:d.map(u)};if(m){const{label:w}=c;return{...c,label:me(w),title:y,onClick:()=>o(m)}}},a=n==null?void 0:n.length;return r.jsx(r.Fragment,{children:r.jsxs(Bn,{...s,formRef:l,modalProps:{destroyOnClose:!0,maskClosable:!1},children:[a?r.jsxs(z,{size:"small",style:{marginBottom:5,width:"100%",overflow:"auto"},children:[r.jsxs("span",{children:[t("terms.template"),":"]}),n.map((i,d)=>{var c;if((c=i.children)!=null&&c.length){const m={items:i.children.map(u)};return i.json?r.jsx(Le.Button,{size:"small",onClick:()=>o(i.json),menu:m,children:me(i.label)},d):r.jsx(Le,{menu:m,children:r.jsx(M,{size:"small",children:r.jsxs(z,{children:[me(i.label),r.jsx(Bt,{})]})})},d)}else return i.json?r.jsx(M,{size:"small",title:i.cli,onClick:()=>o(i.json),children:r.jsx(z,{children:me(i.label)})},d):null})]}):null,r.jsx(C.Item,{name:"value",rules:[{required:!0,message:t("msg.require")},{validator:(i,d)=>new Promise((c,m)=>{d&&Z(d),c(null)}).catch(c=>{throw console.error(c),new Error(t("msg.formatError",{name:"JSON"}))})}],children:r.jsx(ct,{className:"g-boder",height:300,language:"json",options:{minimap:{enabled:!1}}})})]})})},ce=e=>{const{onOpenChange:n,open:s,...t}=e;let l;const o=document.createDocumentFragment(),u=xt.createRoot(o);function a({...d}){clearTimeout(l);const c=Ft();l=setTimeout(()=>{document.body.append(o),u.render(r.jsx(Mt,{theme:c.getTheme(),children:r.jsx(ut,{...d})}))},100)}function i(){u.unmount(),document.body.removeChild(o)}a({...t,open:!0,onOpenChange:d=>{!d&&i()}})},dt=`{ + "services": [ + { + "name": "service-0", + "addr": ":8080", + // "interface": "eth0", + // "admission": "admission-0", + // "bypass": "bypass-0", + // "resolver": "resolver-0", + // "hosts": "hosts-0", + "handler": { + "type": "auto", + // "auth": { + // "username": "gost", + // "password": "gost" + // }, + // "auther": "auther-0", + // "retries": 1, + // "chain": "chain-0", + // "metadata": { + // "bar": "baz", + // "foo": "bar" + // } + }, + "listener": { + "type": "tcp", + // "auth": { + // "username": "user", + // "password": "pass" + // }, + // "auther": "auther-0", + // "chain": "chain-0", + // "tls": { + // "certFile": "cert.pem", + // "keyFile": "key.pem", + // "caFile": "ca.pem" + // }, + // "metadata": { + // "abc": "xyz", + // "def": 456 + // } + }, + // "forwarder": { + // "nodes": [ + // { + // "name": "target-0", + // "addr": "192.168.1.1:1234" + // }, + // { + // "name": "target-1", + // "addr": "192.168.1.2:2345" + // } + // ], + // "selector": { + // "strategy": "round", + // "maxFails": 1, + // "failTimeout": 30 + // } + // } + } + ], + "chains": [ + { + "name": "chain-0", + // "selector": { + // "strategy": "round", + // "maxFails": 1, + // "failTimeout": 30 + // }, + "hops": [ + { + "name": "hop-0", + // "interface": "192.168.1.2", + // "selector": { + // "strategy": "rand", + // "maxFails": 3, + // "failTimeout": 60 + // }, + // "bypass": "bypass-0", + "nodes": [ + { + "name": "node-0", + "addr": ":1080", + // "interface": "eth1", + // "bypass": "bypass-0", + "connector": { + "type": "socks5", + "auth": { + "username": "user", + "password": "pass" + }, + // "metadata": { + // "foo": "bar" + // } + }, + "dialer": { + "type": "tcp", + // "auth": { + // "username": "user", + // "password": "pass" + // }, + // "tls": { + // "caFile": "ca.pem", + // "secure": true, + // "serverName": "example.com" + // }, + // "metadata": { + // "bar": "baz" + // } + } + } + ] + } + ] + } + ], + "authers": [ + { + "name": "auther-0", + "auths": [ + { + "username": "user1", + "password": "pass1" + }, + { + "username": "user2", + "password": "pass2" + } + ] + } + ], + "admissions": [ + { + "name": "admission-0", + "whitelist": false, + "matchers": [ + "127.0.0.1", + "192.168.0.0/16" + ] + } + ], + "bypasses": [ + { + "name": "bypass-0", + "whitelist": false, + "matchers": [ + "*.example.com", + ".example.org", + "0.0.0.0/8" + ] + } + ], + "resolvers": [ + { + "name": "resolver-0", + "nameservers": [ + { + "addr": "udp://8.8.8.8:53", + "chain": "chain-0", + "prefer": "ipv4", + "clientIP": "1.2.3.4", + "ttl": 60, + "timeout": 30 + }, + { + "addr": "tcp://1.1.1.1:53" + }, + { + "addr": "tls://1.1.1.1:853" + }, + { + "addr": "https://1.0.0.1/dns-query", + "hostname": "cloudflare-dns.com" + } + ] + } + ], + "hosts": [ + { + "name": "hosts-0", + "mappings": [ + { + "ip": "127.0.0.1", + "hostname": "localhost" + }, + { + "ip": "192.168.1.10", + "hostname": "foo.mydomain.org", + "aliases": [ + "foo" + ] + }, + { + "ip": "192.168.1.13", + "hostname": "bar.mydomain.org", + "aliases": [ + "bar", + "baz" + ] + } + ] + } + ], + "tls": { + "certFile": "cert.pem", + "keyFile": "key.pem", + "caFile": "ca.pem" + }, + "log": { + "output": "stderr", + "level": "debug", + "format": "json", + "rotation": { + "maxSize": 100, + "maxAge": 10, + "maxBackups": 3, + "localTime": false, + "compress": false + } + }, + "profiling": { + "addr": ":6060", + "enabled": true + }, + "api": { + "addr": ":18080", + "pathPrefix": "/api", + "accesslog": true, + "auth": { + "username": "user", + "password": "password" + }, + "auther": "auther-0" + }, + "metrics": { + "addr": ":9000", + "path": "/metrics" + } +}`,Fn={en:"Default",zh:"默认"},Mn={admissions:"https://gost.run/concepts/admission/",authers:"https://gost.run/concepts/auth/",bypasses:"https://gost.run/concepts/bypass/",chains:"https://gost.run/concepts/chain/",hops:"https://gost.run/concepts/hop/",hosts:"https://gost.run/concepts/hosts/",ingresses:"https://gost.run/concepts/ingress/",observers:"https://gost.run/concepts/observer/",resolvers:"https://gost.run/concepts/resolver/",limiters:"https://gost.run/concepts/limiter/",rlimiter:"https://gost.run/concepts/limiter/",climiter:"https://gost.run/concepts/limiter/",routers:"https://gost.run/concepts/router/",sds:"https://gost.run/concepts/sd/",services:"https://gost.run/concepts/service/"},Rn=[],Je=$n(dt,Rn,{allowTrailingComma:!0}),Dn=e=>{if(!Je)return;const n=Un(Je,[e,0]);if(n){const{offset:s,length:t}=n;return dt.substring(s,s+t)}},I=(e,n=Fn)=>{const s=Dn(e),t=Mn[e],l="// "+t+` +`;let o;return s&&(o={label:n,json:l+s}),{def:o,docUrl:t,_docUrl:l}},Pn=e=>`{ + "name": "${e}-0", + "file": { + "path": "/path/to/file" + } + }`,Hn=(e,n)=>`{ + "name": "${e}-0", + "redis": { + "addr": "127.0.0.1:6379", + "db": "1", + "password": "123456", + ${n?`"type": "${n}",`:""} + "key": "gost:${e}-0" + } + }`,Jn=e=>`{ + "name": "${e}-0", + "http": { + "url": "http://127.0.0.1:8000", + "timeout": "10s" + } + }`,ft=e=>`{ + "name": "${e}-0", + "plugin": { + "type": "grpc", + // "type": "http", + "addr": "127.0.0.1:8000", + "token": "gost", + // "tls": {} + } + }`,J=(e,n="",s)=>{const t=n?`// ${n} +`:"";return[{label:"File",json:t+Pn(e)},{label:"Redis",json:t+Hn(e,s==null?void 0:s.redisType)},{label:"HTTP",json:t+Jn(e)},{label:"Plugin",json:t+ft(e)}]},{def:We,docUrl:Wn,_docUrl:qn}=I("admissions"),Gn=[We||{label:{zh:"内联",en:"Inline"},json:qn+` + { + "name": "admission-0", + "matchers": [ + "127.0.0.1", + "192.168.0.0/16", + "example.com" + ] + }`},...J("admission",Wn)],{def:Qn,docUrl:Xn}=I("authers"),Zn=[Qn,...J("auther",Xn)],{def:Yn,docUrl:Qs,_docUrl:Kn}=I("chains"),Cn=[Yn,{label:{zh:"典型转发链",en:"Typical"},cli:"",json:Kn+` +{ + "name": "chain-0", + "hops": [ + { + "name": "hop-0", + "nodes": [ + { + "name": "node-0", + "addr": "proxy.xxx.com:1080", + "connector": { + "type": "socks5", + "auth": { + "username": "username", + "password": "password" + } + }, + "dialer": { + "type": "tcp", + "tls": { + "serverName": "proxy.xxx.com" + } + } + } + ] + } + ] +} + `}],{def:qe,docUrl:es,_docUrl:ts}=I("bypasses"),ns=[qe||{label:{zh:"内联",en:"Inline"},json:ts+` + { + "name": "bypass-0", + "matchers": [ + "127.0.0.1", + "172.10.0.0/16", + "localhost", + "*.example.com", + ".example.org" + ] + }`},...J("bypass",es)],{def:Ge,docUrl:ss,_docUrl:ls}=I("hops"),rs=[Ge||{label:{zh:"内联",en:"Inline"},json:ls+` + { + "name": "hop-0", + "nodes": [ + { + "name": "node-0", + "addr": ":8888", + "connector": { + "type": "http" + }, + "dialer": { + "type": "tcp" + } + }, + { + "name": "node-1", + "addr": ":9999", + "connector": { + "type": "socks5" + }, + "dialer": { + "type": "tcp" + } + } + ] + }`},...J("hop",ss)],{def:Qe,docUrl:os,_docUrl:is}=I("hosts"),as=[Qe||{label:{zh:"内联",en:"Inline"},json:is+` +{ + "name": "hosts-0", + "mappings": [ + { + "ip": "127.0.0.1", + "hostname": "example.com" + }, + { + "ip": "2001:db8::1", + "hostname": "example.com" + } + ] +}`},...J("hosts",os)],{def:Xe,docUrl:cs,_docUrl:us}=I("ingresses"),ds=[Xe||{label:{zh:"内联",en:"Inline"},json:us+`{ + "name": "ingress-0", + "rules": [ + { + "hostname": "example.com", + "endpoint": "4d21094e-b74c-4916-86c1-d9fa36ea677b" + }, + { + "hostname": "example.org", + "endpoint": "ac74d9dd-3125-442a-a7c1-f9e49e05faca" + } + ] + }`},...J("ingress",cs,{redisType:"hash"})],{def:Ze,docUrl:fs,_docUrl:ms}=I("routers"),ps=[Ze||{label:{zh:"内联",en:"Inline"},json:ms+` + { + "name": "router-0", + "routes": [ + { + "net": "192.168.1.0/24", + "gateway": "192.168.123.2" + }, + { + "net": "172.10.0.0/16", + "gateway": "192.168.123.3" + } + ] + }`},...J("router",fs)],{def:hs,docUrl:Xs,_docUrl:he}=I("services"),D=(e,n,s)=>{let t=he+` + { + "name": "service-0", + "addr": ":1080", + "handler": { + "type": "${e}", + // "auth": { + // "username": "user", + // "password": "password" + // } + }, + "listener": { + "type": "${n}" + } + }`;if(s){const l=pe(t,["metadata"],s,{});l.push(...pe(t,["handler","metadata"],s,{})),l.push(...pe(t,["listener","metadata"],s,{})),t=Be(t,l)}return t},gs=[hs,{label:{zh:"端口转发",en:"Port Forwarding"},cli:"-L tcp://:80/:8080",json:he+` + { + "name": "service-0", + "addr": ":80", + "handler": { + "type": "tcp" + }, + "listener": { + "type": "tcp" + }, + "forwarder": { + "nodes": [ + { + "name": "target-0", + "addr": ":8080" + } + ] + } + }`},{label:{zh:"反向代理",en:"Reverse Proxy"},cli:"",json:he+` + { + "name": "service-0", + "addr": ":80", + "handler": { + "type": "tcp", + "metadata": { + "sniffing": "true" + } + }, + "listener": { + "type": "tcp" + }, + "forwarder": { + "nodes": [ + { + "name": "target-1", + "addr": "www.baidu.com:80", + // "host": "myhost.com", + // "path": "/" + "http": { + "host": "www.baidu.com" + } + } + ] + } + }`},{label:{zh:"代理服务",en:"Proxy Service"},children:[{label:"http",children:[{label:"http",json:D("http","tcp")},{label:"https(http+tsl)",json:D("http","tls")},{label:"http+wss",json:D("http","wss")},{label:"http2",json:D("http2","http2")}]},{label:"relay",children:[{label:"relay+tcp",json:D("relay","tcp")},{label:"relay+tls",json:D("relay","tls")},{label:"relay+wss",json:D("relay","tls")}]},{label:"socks",children:[{label:"socks4",json:D("socks","tcp")},{label:"socks5",json:D("socks5","tcp")},{label:"socks5(udp)",json:D("socks5","tcp",{udp:"true"})},{label:"socks5+tls",json:D("socks5","tls",{notls:"true"})}]}]},{label:{zh:"代理转发",en:"Porxy Forwarding"},cli:"-L socks5://:1080 -F socks5://xxx.com:1080",json:he+` + { + "name": "service-0", + "addr": ":1080", + "handler": { + "type": "socks5", + "chain": "chain-0" + }, + "listener": { + "type": "tcp" + } + }`}],{def:Ye,docUrl:bs,_docUrl:ys}=I("climiter"),ks=[Ye||{label:{zh:"内联",en:"Inline"},json:ys+` + { + "name": "climiter-0", + "limits": [ + "$ 1000", + "$$ 100", + "192.168.1.1 10" + ] + }`},...J("climiter",bs,{redisType:"set"})],{def:Ke,docUrl:js,_docUrl:ws}=I("limiters"),vs=[Ke||{label:{zh:"内联",en:"Inline"},json:ws+` + { + "name": "limiter-0", + "limits": [ + "$ 100MB 100MB", + "$$ 10MB", + "192.168.1.1 512KB 1MB", + "192.168.0.0/16 1MB 5MB" + ] + }`},...J("limiters",js,{redisType:"set"})],{def:Ce,docUrl:xs,_docUrl:Ts}=I("rlimiter"),Os=[Ce||{label:{zh:"内联",en:"Inline"},json:Ts+` + { + "name": "rlimiter-0", + "limits": [ + "$ 100", + "$$ 10", + "192.168.1.1 50", + "192.168.0.0/16 5" + ] + }`},...J("rlimiter",xs,{redisType:"set"})],{def:Ls,docUrl:Zs,_docUrl:As}=I("resolvers"),$s=[Ls,{label:"Plugin",json:As+ft("resolver")}],{def:et,docUrl:Ys,_docUrl:Us}=I("sds"),Ss=[et||{label:"HTTP Plugin",json:Us+` + // https://gost.run/concepts/sd/ + { + "name": "sd-0", + "plugin": { + "type": "http", + "addr": "http://127.0.0.1:8000/sd", + // "token": "gost", + // "tls": {} + } + }`}],{def:tt,docUrl:Ks,_docUrl:_s}=I("observers"),Is=[tt||{label:"Plugin",json:_s+` + { + "name": "observer-0", + "plugin": { + "type": "grpc", + // "type": "http", + "addr": "127.0.0.1:8000", + "token": "gost", + // "tls": {} + } + }`}],Ns={admissions:Gn,authers:Zn,bypasses:ns,chains:Cn,climiters:ks,limiters:vs,rlimiters:Os,hops:rs,hosts:as,ingresses:ds,resolvers:$s,routers:ps,sds:Ss,observers:Is,services:gs},mt=e=>{const{name:n}=e;return b.useMemo(()=>Ns[n],[n])},pt=e=>{const{name:n,localApi:s,gostConfig:t,localConfig:l}=e,o=b.useMemo(()=>(t==null?void 0:t[n])||[],[t,n]),u=b.useMemo(()=>s?(l==null?void 0:l[n])||[]:[],[l,n,s]),a=b.useMemo(()=>[...o,...u],[o,u]);return{dataList:o,dataSource:a}},se=ue.createContext({}),nt=(e,n,s)=>JSON.stringify(n),Es=(e,n)=>{var s,t;return((t=(s=e==null?void 0:e.name)==null?void 0:s.toLowerCase())==null?void 0:t.indexOf(n))!==-1},Vs=e=>{const{name:n,title:s,api:t,localApi:l,keyName:o,rowKey:u="name",keyword:a,renderConfig:i=nt,filter:d=Es}=e,{t:c}=G(),{localList:m,comm:y}=b.useContext(Ne),{gostConfig:w,localConfig:k}=b.useContext(fe),{dataList:x,dataSource:T}=pt({localApi:l,name:o,gostConfig:w,localConfig:k}),L=mt({name:o});Rt.useApp();const{deleteValue:O,updateValue:h,dispatch:v,enable:f,updateLocal:g,deleteLocal:p,addValue:$}=y,_=b.useRef({dataList:x,dataSource:T});b.useImperativeHandle(_,()=>({dataList:x,dataSource:T}),[x,T]);const Q=b.useMemo(()=>a?T.filter(S=>d(S,a)):T,[T,d,a]);return b.useEffect(()=>{function S({path:j,record:A}){const{dataList:W,dataSource:B}=_.current,q=W.includes(A),R=A.name,X=j.split(","),yt=X.reduce((Y,le)=>Y==null?void 0:Y[le],A),kt=Y=>{let le=A;X.forEach((Fe,jt)=>{jt===X.length-1?le[Fe]=Y:le=le[Fe]})};ce({title:c("base.cmd.edit"),initialValues:{value:ae(yt)},onFinish:async Y=>(kt(Z(Y.value)),q?await h(R,A):await g(R,A),!0)})}return V.on(`edit:${n}`,S),()=>{V.off(`edit:${n}`,S)}},[]),r.jsx("div",{style:{height:348,overflow:"auto"},children:r.jsx(Dt,{rowKey:S=>S._id_||S.name,scroll:{y:290},size:"small",dataSource:Q,columns:[{title:c("base.form.name"),dataIndex:u,ellipsis:!0,width:100},{title:c("base.form.details"),ellipsis:!0,render:(S,j,A)=>{const B=x.includes(j)?R=>h(j.name,R||j):R=>g(j.name,R||j);let q;try{q=i(S,j,A)}catch{q=nt(S,j)}return r.jsx(se.Provider,{value:{update:B},children:q})}},{title:c("base.cmd.controls"),width:l?120:90,align:"right",dataIndex:u,render:(S,j,A)=>{const W=x.includes(j),B={...j};return delete B.status,r.jsxs(z,{size:2,children:[l?W?r.jsx(M,{title:c("base.cmd.disable"),icon:r.jsx(lt,{style:{color:Pt.primary}}),type:"link",size:"small",onClick:async()=>{await v(j)}}):r.jsx(M,{title:c("base.cmd.enabled"),type:"link",icon:r.jsx(jn,{style:{color:Ht.primary}}),size:"small",onClick:async()=>{await f(j)}}):null,r.jsx(M,{title:c("base.cmd.edit"),icon:r.jsx(Jt,{}),type:"link",size:"small",onClick:()=>{ce({title:c("title.edit",{name:S||""}),templates:L,initialValues:{value:ae(B)},onFinish:async q=>{const{value:R}=q,X=Z(R);return W?await h(j.name,X):await g(j.name,{...B,...X}),!0}})}}),r.jsx(M,{title:c("base.cmd.copy"),icon:r.jsx(Wt,{}),type:"link",size:"small",onClick:()=>{ce({title:c("title.copied",{name:S||""}),templates:L,initialValues:{value:ae(B)},onFinish:async q=>{const{value:R}=q,X=Z(R);return await y.addValue(X),!0}})}}),r.jsx(qt,{title:c("text.warn"),description:c("text.deleteing"),onConfirm:()=>{W?O(j):p(j)},children:r.jsx(M,{title:c("base.cmd.del"),icon:r.jsx(Gt,{}),type:"link",size:"small"})})]})}}],pagination:!1})})},zs=e=>{const{t:n}=G(),{keyName:s,title:t}=e,{comm:l}=b.useContext(Ne),o=mt({name:s});return r.jsx(ut,{title:n("title.add",{name:t}),templates:o,trigger:r.jsx(M,{icon:r.jsx(Qt,{}),size:"small"}),onFinish:async u=>{const{value:a}=u,i=Z(a);return await l.addValue(i),!0}})},N=e=>({keyName:e,api:Tt[e],localApi:Ot[e],rowKey:"name"}),Bs=[{name:"admission",title:"准入控制器(Admission)",subTitle:"准入控制器",...N("admissions")},{name:"auther",title:"认证器(Auther)",subTitle:"认证器",...N("authers")},{name:"bypass",title:"分流器(Bypass)",subTitle:"分流器",...N("bypasses")},{name:"chain",title:"转发链(Chain)",subTitle:"转发链",...N("chains")},{name:"climiter",title:"并发连接数限制",subTitle:"",...N("climiters")},{name:"limiter",title:"流量速率限制",subTitle:"",...N("limiters")},{name:"rlimiter",title:"请求速率限制",subTitle:"",...N("rlimiters")},{name:"hop",title:"跳跃点(Hop)",subTitle:"跳跃点",...N("hops")},{name:"host",title:"主机映射器(Hosts)",subTitle:"主机映射器",...N("hosts")},{name:"ingress",title:"Ingress",subTitle:"Ingress",...N("ingresses")},{name:"resolver",title:"域名解析器(Resolver)",subTitle:"域名解析器",...N("resolvers")},{name:"service",title:"服务(Service)",subTitle:"服务",...N("services")},{name:"sd",title:"服务发现(SD)",subTitle:"服务发现",...N("sds")},{name:"observer",title:"观测器(Observer)",subTitle:"观测器",...N("observers")}],Fs=e=>Bs.find(n=>n.name===e),_e=e=>{const{boxShadow:n,className:s,...t}=e,l=Oe(s,{"antd-cord-boxShadow":n});return r.jsx(Xt,{className:l,...t})},E=e=>{const{t:n}=G(),{title:s,subTitle:t,name:l,keyName:o,api:u,boxShadow:a=!0,bordered:i=!1,rowKey:d="name",renderConfig:c,localApi:m,filter:y}=b.useMemo(()=>({...Fs(e.module||""),title:n(`modules.${e.module}.title`),subTitle:n(`modules.${e.module}.subTitle`),...e}),[e]),[w,k]=b.useState(""),x={title:t||"",keyword:w,name:l,api:u,keyName:o,rowKey:d,localApi:m,renderConfig:c,filter:y},{gostConfig:T,localConfig:L}=b.useContext(fe),{dataSource:O}=pt({localApi:m,name:o,gostConfig:T,localConfig:L}),h=b.useMemo(()=>{const v=async f=>{await u.post(f)};return{updateValue:async(f,g,p=!0)=>{await u.put(f,g),p&&V.emit("apiUpdate",{})},deleteValue:async(f,g=!0)=>{await u.delete(f.name),g&&V.emit("apiUpdate",{})},addValue:async(f,g=!0)=>{let p=f.name||`${l}-0`;const $=()=>O==null?void 0:O.find(_=>_.name===p);if($()&&!await new Promise((Q,S)=>{ze.confirm({title:n("msg.invalidName"),content:n("msg.autofixName"),zIndex:2e3,onOk:()=>Q(!0),onCancel:()=>Q(!1)})}))throw!1;for(;$();)p=p.replace(/\d*$/,_=>String(_==""?"-0":Number(_)+1));await v({...f,name:p}),f.name!==p&&Zt.info({description:n("msg.fixName",{name:p}),message:n("msg.autofix")}),g&&V.emit("apiUpdate",{})},dispatch:async f=>{m&&(await u.delete(f.name),await m.add(f),V.emit("update"))},enable:async f=>{m&&(await u.post(f),await m.delete(f.name),V.emit("update"))},updateLocal:async(f,g)=>{m&&(await m.put(f,{...g,name:f}),V.emit("localUpdate"))},deleteLocal:async f=>{m&&(await m.delete(f.name),V.emit("localUpdate"))}}},[u,O,m,l]);return b.useEffect(()=>Lt(l,h),[h,l]),r.jsx(Ne.Provider,{value:{name:l,comm:h},children:r.jsx(_e,{boxShadow:a,bordered:i,title:s,extra:r.jsxs(z,{children:[r.jsx(Ve.Search,{allowClear:!0,onChange:v=>{const f=v.target.value;k(f)},size:"small"}),r.jsx(zs,{...x})]}),children:r.jsx(Vs,{...x})})})},Ms=e=>{const{name:n,addr:s,connector:{type:t,metadata:l}={},dialer:{type:o}={}}=e,u=l?At.stringify(l):"";return r.jsxs(z,{children:[(t||o)&&r.jsx(H,{color:"#87d068",children:`${t}${o?"+"+o:""}`}),r.jsx(H,{color:"green",children:s}),u&&r.jsx(H,{color:"purple",title:"_metadata",children:"metadata"})]})},Ie=({node:e,upjson:n,isLink:s=!1})=>{const{t}=G(),{name:l}=e,{update:o}=b.useContext(se);return r.jsx(ie,{color:"#ddffbf",title:r.jsx(Ms,{...e}),children:r.jsx(H,{bordered:!1,color:"green",className:"editor-json",title:t("text.doubleClickEdit"),onDoubleClick:()=>{n&&ce({title:t("base.cmd.edit"),initialValues:{value:ae(e)},onFinish:async u=>(n(Z(u.value)),o(),!0)})},children:l})})},ht=e=>{var u;let n=e,s=!1;const{gostConfig:t,localConfig:l}=b.useContext(fe);if(!n.nodes){const a=[...(t==null?void 0:t.hops)||[],...(l==null?void 0:l.hops)||[]].find(i=>i.name===n.name);a&&(s=!0,n=a)}const{nodes:o}=n;if(!o||(o==null?void 0:o.length)<=0)return`[${e.name}(noNodes)]`;if(s){const a=(u=t==null?void 0:t.hops)==null?void 0:u.includes(n),i=n.name;return r.jsx(se.Provider,{value:{update:async d=>{const c=await Ee("hop");return(a?y=>c.updateValue(i,y||n):y=>c.updateLocal(i,y||n))(d)}},children:r.jsx(z,{size:5,children:o.map((d,c)=>r.jsx(Ie,{node:d,isLink:!0,upjson:m=>o[c]=m},c))})})}return r.jsx(z,{size:5,children:o.map((a,i)=>r.jsx(Ie,{node:a,upjson:d=>o[i]=d},a.name+i))})};function Rs(e){const{update:n}=b.useContext(se),{t:s}=G();return r.jsx(z,{size:5,children:e.hops.map((t,l)=>{const o=r.jsx(ht,{...t});return r.jsx(ie,{title:o,color:"#c7e7ff",arrow:!1,children:r.jsx(H,{bordered:!1,color:"blue",className:"editor-json",title:s("text.doubleClickEdit"),onDoubleClick:()=>{ce({title:s("base.cmd.edit"),initialValues:{value:ae(t)},onFinish:async u=>(e.hops[l]=Z(u.value),n(),!0)})},children:t.name})},t.name+l)}).reduce((t,l,o)=>(t.length>0&&t.push(r.jsx(Yt,{style:{color:"blue",fontSize:12}},"_sp_"+o)),t.push(l),t),[])})}function gt(e){const{hops:n}=e;return r.jsx(Rs,{hops:n,root:e})}const Ds=e=>{b.useContext(fe);const n={module:"chain",renderConfig:(s,t,l)=>r.jsx(gt,{...t})};return r.jsx(E,{...n})},bt=(e,n)=>{const{gostConfig:s,localConfig:t}=b.useContext(fe),l=b.useMemo(()=>{var a;return(a=s==null?void 0:s[n])==null?void 0:a.find(i=>i.name===e)},[s,e,n]),o=b.useMemo(()=>{var a;return(a=t==null?void 0:t[n])==null?void 0:a.find(i=>i.name===e)},[t,e,n]);return[l??o,!!l]},Ps=e=>{const[n,s]=bt(e.name,"hops");let t=e,l=!1;t.nodes||(t=n,l=!!n);const{nodes:o}=t;if(!o||(o==null?void 0:o.length)<=0)return`[${e.name}(noNodes)]`;const u=r.jsx(z,{size:5,children:o.map((a,i)=>r.jsx(Ie,{node:a,upjson:d=>o[i]=d},a.name+i))});if(l){const a=t.name;return r.jsx(se.Provider,{value:{update:async i=>{const d=await Ee("hop");return(s?m=>d.updateValue(a,m||t):m=>d.updateLocal(a,m||t))(i)}},children:u})}return u},st=e=>{const[n,s]=bt(e.chainName,"chains");if(!n)return"[no chain]";const t=e.chainName;return r.jsx(se.Provider,{value:{update:async l=>{const o=await Ee("chain");return(s?a=>o.updateValue(t,a||n):a=>o.updateLocal(t,a||n))(l)}},children:r.jsx(gt,{...n})})},Hs=e=>{const{name:n,addr:s,handler:t,listener:l,forwarder:o}=e,{t:u}=G(),a=b.useMemo(()=>{const i=t==null?void 0:t.type,d=l==null?void 0:l.type;return i===d?i:`${i}+${d}`},[t,l]);return r.jsxs(z,{children:[r.jsx(H,{color:"#87d068",children:a}),r.jsx(H,{color:"green",children:s}),t.chain&&r.jsx(ie,{title:r.jsx(st,{chainName:t.chain}),color:"#c7e7ff",arrow:!1,children:r.jsx(H,{children:u("modules.chain.subTitle")})}),l.chain&&r.jsx(ie,{title:r.jsx(st,{chainName:l.chain}),color:"#fff0d7",arrow:!1,children:r.jsx(H,{color:"orange",children:u("terms.key0")})}),o&&r.jsx(ie,{title:r.jsx(Ps,{...o}),color:"#c7e7ff",arrow:!1,children:r.jsx(H,{children:u("terms.forwarder")})})]})},Js=e=>{const{colSpan:n}=e;Te();const s={module:"service",renderConfig:(t,l,o)=>r.jsx(Hs,{...l}),filter:(t,l)=>{const{name:o,addr:u,handler:a,listener:i}=t;function d(c){const m=c==null?void 0:c.toLowerCase();return m?m.indexOf(l)!==-1:!1}return d(o)||d(u)||d(a==null?void 0:a.type)||d(i==null?void 0:i.type)}};return r.jsx(U,{...n,xxl:16,children:r.jsx(E,{...s})})},Ws=e=>r.jsx(E,{module:"hop",renderConfig:(n,s,t)=>r.jsx(ht,{...s})}),P={xs:24,sm:24,md:12,lg:12,xl:12,xxl:8},xe={sm:24,xxl:8},Cs=()=>{const e=re(),{t:n}=G(),s=Te(),[t,l]=b.useState(!1),[o,u]=b.useState(!1),[a,i]=b.useState(!0),[d,c]=b.useState([]),m=b.useRef({}),y=b.useCallback(async()=>$t().then(k=>k.sort((x,T)=>{const L=x.time||0;return(T.time||0)-L})).then(k=>c(k.filter(x=>x.addr!==e.addr).map(x=>({key:x.addr,label:r.jsx("a",{href:`./?use=${x.addr}`,children:x.addr})})))),[]);b.useEffect(()=>{Ut().then(L=>{L&&V.emit("update")});const k=m.current.onSave=async()=>{try{u(!0);const{saveFormat:L,savePath:O}=re.get()||{};await St(L,O),i(!0)}finally{u(!1)}},x=()=>{var L;if(i(!1),!!((L=re.get())!=null&&L.autoSave))return k()},T=async L=>{var O;if(i(!1),!!((O=re.get())!=null&&O.autoSave)&&(L==null?void 0:L.url)!==zt.config)return k()};return y(),V.on("update",x),V.on("apiUpdate",T),()=>{V.off("update",x),V.off("apiUpdate",T)}},[]);const w=b.useMemo(()=>{const k=[];return d.length&&(k.push({key:"2",label:n("manage.cmd.switch"),children:d}),k.push({type:"divider"})),k.push({key:"new",label:n("manage.cmd.new"),onClick:()=>{window.open(location.href,void 0,"noopener")}}),k},[d,n]);return r.jsxs(ke,{style:{height:"100vh",overflow:"hidden"},children:[r.jsxs(ke.Header,{style:{color:"#FFF",paddingInline:20},children:[r.jsxs(je,{align:"middle",justify:"space-between",wrap:!1,children:[r.jsx(U,{color:"",children:r.jsx(M,{type:"link",icon:r.jsx(Kt,{}),onClick:async()=>{Te.set(await _t())},children:n("manage.cmd.reload")})}),r.jsx(U,{children:e.addr}),r.jsx(U,{children:r.jsxs(z,{children:[r.jsxs(z.Compact,{children:[r.jsx(M,{icon:a?r.jsx(lt,{}):r.jsx(un,{}),loading:o,onClick:()=>{var k,x;return(x=(k=m.current)==null?void 0:k.onSave)==null?void 0:x.call(k)},children:n("manage.cmd.save")}),r.jsx(M,{icon:r.jsx(hn,{}),onClick:()=>l(!0)})]}),r.jsx(M,{icon:r.jsx(Ct,{}),onClick:()=>{En(Ue(s),"gost.json")},children:n("manage.cmd.download")}),r.jsx(Le.Button,{menu:{items:w},onClick:It,children:n("manage.cmd.logout")}),r.jsx(Nt,{}),r.jsx(Et,{})]})})]}),r.jsx(ze,{destroyOnClose:!0,open:t,onCancel:()=>l(!1),footer:!1,children:r.jsxs(C,{initialValues:e,layout:"horizontal",labelCol:{span:4},onValuesChange:(k,x)=>{Object.assign(e,k),re.set(e),e.isLocal&&Vt(e.addr,e)},children:[r.jsx(C.Item,{name:"autoSave",label:n("manage.label.autoSave"),valuePropName:"checked",children:r.jsx(en,{})}),r.jsx(C.Item,{name:"saveFormat",label:n("manage.label.format"),initialValue:"json",children:r.jsxs(we.Group,{optionType:"button",buttonStyle:"solid",children:[r.jsx(we,{value:"json",children:"json"}),r.jsx(we,{value:"yaml",children:"yaml"})]})}),r.jsx(C.Item,{name:"savePath",label:n("manage.label.path"),trigger:"onChange",children:r.jsx(Ve,{placeholder:n("placeholder.savePath")})})]})})]}),r.jsx(ke.Content,{style:{height:"100%",padding:16,boxSizing:"border-box",overflow:"auto"},children:r.jsxs(je,{gutter:[16,16],style:{overflow:"hidden"},children:[r.jsx(Js,{colSpan:P}),r.jsx(U,{...P,children:r.jsx(Ds,{})}),r.jsx(U,{...P,children:r.jsx(Ws,{})}),r.jsx(U,{...P,children:r.jsx(E,{module:"auther"})}),r.jsx(U,{...P,children:r.jsx(E,{module:"admission"})}),r.jsx(U,{...P,children:r.jsx(E,{module:"bypass"})}),r.jsx(U,{...P,children:r.jsx(E,{module:"host"})}),r.jsx(U,{...P,children:r.jsx(E,{module:"ingress"})}),r.jsx(U,{...P,children:r.jsx(E,{module:"resolver"})}),r.jsx(U,{...P,children:r.jsx(E,{module:"sd"})}),r.jsx(U,{...P,children:r.jsx(E,{module:"observer"})}),r.jsx(U,{span:24,children:r.jsx(_e,{boxShadow:!0,title:n("manage.label.limit"),children:r.jsxs(je,{gutter:[16,16],children:[r.jsx(U,{...xe,children:r.jsx(E,{module:"limiter",bordered:!0,boxShadow:!1})}),r.jsx(U,{...xe,children:r.jsx(E,{module:"rlimiter",bordered:!0,boxShadow:!1})}),r.jsx(U,{...xe,children:r.jsx(E,{module:"climiter",bordered:!0,boxShadow:!1})})]})})}),r.jsx(U,{span:24,children:r.jsx(_e,{boxShadow:!0,title:n("manage.label.allConfig"),styles:{body:{padding:20}},children:r.jsx(ct,{className:"g-boder",value:Ue(s),height:500,language:"json",options:{minimap:{enabled:!1},readOnly:!0}})})})]})})]})};export{Cs as default}; diff --git a/assets/index-4864998e.js b/assets/index-4864998e.js new file mode 100644 index 0000000..4a63387 --- /dev/null +++ b/assets/index-4864998e.js @@ -0,0 +1,17 @@ +var Bi=Object.defineProperty;var Ui=(t,e,r)=>e in t?Bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var X=(t,e,r)=>(Ui(t,typeof e!="symbol"?e+"":e,r),r);import{r as O,a as zi,g as Vi,c as Hi,b as Kr,m as br,A as Qe,_ as Xe,S as vo,R as Ki,C as qi,F as Wi,D as Gi,B as qr,d as xe,I as Qt,e as Ji,f as Ct,h as ht,t as Yi,i as Qi}from"./antd-15fa66a0.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var bo={exports:{}},Nt={};/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Xi=O,Zi=Symbol.for("react.element"),es=Symbol.for("react.fragment"),ts=Object.prototype.hasOwnProperty,rs=Xi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ns={key:!0,ref:!0,__self:!0,__source:!0};function wo(t,e,r){var n,o={},i=null,s=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)ts.call(e,n)&&!ns.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:Zi,type:t,key:i,ref:s,props:o,_owner:rs.current}}Nt.Fragment=es;Nt.jsx=wo;Nt.jsxs=wo;bo.exports=Nt;var x=bo.exports,wr={},fn=zi;wr.createRoot=fn.createRoot,wr.hydrateRoot=fn.hydrateRoot;const os="modulepreload",is=function(t,e){return new URL(t,e).href},dn={},ss=function(e,r,n){if(!r||r.length===0)return e();const o=document.getElementsByTagName("link");return Promise.all(r.map(i=>{if(i=is(i,n),i in dn)return;dn[i]=!0;const s=i.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!n)for(let c=o.length-1;c>=0;c--){const d=o[c];if(d.href===i&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":os,s||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),s)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};var Wr={exports:{}},$e=typeof Reflect=="object"?Reflect:null,pn=$e&&typeof $e.apply=="function"?$e.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},gt;$e&&typeof $e.ownKeys=="function"?gt=$e.ownKeys:Object.getOwnPropertySymbols?gt=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:gt=function(e){return Object.getOwnPropertyNames(e)};function as(t){console&&console.warn&&console.warn(t)}var So=Number.isNaN||function(e){return e!==e};function L(){L.init.call(this)}Wr.exports=L;Wr.exports.once=fs;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount=0;L.prototype._maxListeners=void 0;var hn=10;function _t(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(L,"defaultMaxListeners",{enumerable:!0,get:function(){return hn},set:function(t){if(typeof t!="number"||t<0||So(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");hn=t}});L.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};L.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||So(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function xo(t){return t._maxListeners===void 0?L.defaultMaxListeners:t._maxListeners}L.prototype.getMaxListeners=function(){return xo(this)};L.prototype.emit=function(e){for(var r=[],n=1;n0&&(s=r[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[e];if(l===void 0)return!1;if(typeof l=="function")pn(l,this,r);else for(var u=l.length,c=Ro(l,u),n=0;n0&&s.length>o&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,as(a)}return t}L.prototype.addListener=function(e,r){return Oo(this,e,r,!1)};L.prototype.on=L.prototype.addListener;L.prototype.prependListener=function(e,r){return Oo(this,e,r,!0)};function ls(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Eo(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=ls.bind(n);return o.listener=r,n.wrapFn=o,o}L.prototype.once=function(e,r){return _t(r),this.on(e,Eo(this,e,r)),this};L.prototype.prependOnceListener=function(e,r){return _t(r),this.prependListener(e,Eo(this,e,r)),this};L.prototype.removeListener=function(e,r){var n,o,i,s,a;if(_t(r),o=this._events,o===void 0)return this;if(n=o[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){a=n[s].listener,i=s;break}if(i<0)return this;i===0?n.shift():us(n,i),n.length===1&&(o[e]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners=function(e){var r,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),s;for(o=0;o=0;o--)this.removeListener(e,r[o]);return this};function Po(t,e,r){var n=t._events;if(n===void 0)return[];var o=n[e];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?cs(o):Ro(o,o.length)}L.prototype.listeners=function(e){return Po(this,e,!0)};L.prototype.rawListeners=function(e){return Po(this,e,!1)};L.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Ao.call(t,e)};L.prototype.listenerCount=Ao;function Ao(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}L.prototype.eventNames=function(){return this._eventsCount>0?gt(this._events):[]};function Ro(t,e){for(var r=new Array(e),n=0;ni,e=s=>{i=s}}const n=new Lo.EventEmitter;n.on("setValue",function(i){e(i),n.emit("upValue",i)}),r&&e(r);const o=i=>{const[s,a]=O.useState(t?t():void 0);return O.useEffect(()=>(i&&n.emit("setValue",i),n.on("upValue",a),()=>{n.off("upValue",a)}),[]),s};return o.set=i=>{n.emit("setValue",i)},o.get=()=>t==null?void 0:t(),o}function Co(t,e){return function(){return t.apply(e,arguments)}}const{toString:ps}=Object.prototype,{getPrototypeOf:Gr}=Object,Tt=(t=>e=>{const r=ps.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),oe=t=>(t=t.toLowerCase(),e=>Tt(e)===t),kt=t=>e=>typeof e===t,{isArray:Te}=Array,Je=kt("undefined");function hs(t){return t!==null&&!Je(t)&&t.constructor!==null&&!Je(t.constructor)&&J(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const No=oe("ArrayBuffer");function gs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&No(t.buffer),e}const ms=kt("string"),J=kt("function"),_o=kt("number"),Dt=t=>t!==null&&typeof t=="object",ys=t=>t===!0||t===!1,mt=t=>{if(Tt(t)!=="object")return!1;const e=Gr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},vs=oe("Date"),bs=oe("File"),ws=oe("Blob"),Ss=oe("FileList"),xs=t=>Dt(t)&&J(t.pipe),Os=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||J(t.append)&&((e=Tt(t))==="formdata"||e==="object"&&J(t.toString)&&t.toString()==="[object FormData]"))},Es=oe("URLSearchParams"),Ps=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ze(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,o;if(typeof t!="object"&&(t=[t]),Te(t))for(n=0,o=t.length;n0;)if(o=r[n],e===o.toLowerCase())return o;return null}const To=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),ko=t=>!Je(t)&&t!==To;function Sr(){const{caseless:t}=ko(this)&&this||{},e={},r=(n,o)=>{const i=t&&Io(e,o)||o;mt(e[i])&&mt(n)?e[i]=Sr(e[i],n):mt(n)?e[i]=Sr({},n):Te(n)?e[i]=n.slice():e[i]=n};for(let n=0,o=arguments.length;n(Ze(e,(o,i)=>{r&&J(o)?t[i]=Co(o,r):t[i]=o},{allOwnKeys:n}),t),Rs=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),$s=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Ls=(t,e,r,n)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!n||n(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=r!==!1&&Gr(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Cs=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},Ns=t=>{if(!t)return null;if(Te(t))return t;let e=t.length;if(!_o(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},_s=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Gr(Uint8Array)),Is=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=n.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},Ts=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},ks=oe("HTMLFormElement"),Ds=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),gn=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Fs=oe("RegExp"),Do=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Ze(r,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(n[i]=s||o)}),Object.defineProperties(t,n)},js=t=>{Do(t,(e,r)=>{if(J(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(J(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Ms=(t,e)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Te(t)?n(t):n(String(t).split(e)),r},Bs=()=>{},Us=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Xt="abcdefghijklmnopqrstuvwxyz",mn="0123456789",Fo={DIGIT:mn,ALPHA:Xt,ALPHA_DIGIT:Xt+Xt.toUpperCase()+mn},zs=(t=16,e=Fo.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Vs(t){return!!(t&&J(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Hs=t=>{const e=new Array(10),r=(n,o)=>{if(Dt(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[o]=n;const i=Te(n)?[]:{};return Ze(n,(s,a)=>{const l=r(s,o+1);!Je(l)&&(i[a]=l)}),e[o]=void 0,i}}return n};return r(t,0)},Ks=oe("AsyncFunction"),qs=t=>t&&(Dt(t)||J(t))&&J(t.then)&&J(t.catch),g={isArray:Te,isArrayBuffer:No,isBuffer:hs,isFormData:Os,isArrayBufferView:gs,isString:ms,isNumber:_o,isBoolean:ys,isObject:Dt,isPlainObject:mt,isUndefined:Je,isDate:vs,isFile:bs,isBlob:ws,isRegExp:Fs,isFunction:J,isStream:xs,isURLSearchParams:Es,isTypedArray:_s,isFileList:Ss,forEach:Ze,merge:Sr,extend:As,trim:Ps,stripBOM:Rs,inherits:$s,toFlatObject:Ls,kindOf:Tt,kindOfTest:oe,endsWith:Cs,toArray:Ns,forEachEntry:Is,matchAll:Ts,isHTMLForm:ks,hasOwnProperty:gn,hasOwnProp:gn,reduceDescriptors:Do,freezeMethods:js,toObjectSet:Ms,toCamelCase:Ds,noop:Bs,toFiniteNumber:Us,findKey:Io,global:To,isContextDefined:ko,ALPHABET:Fo,generateString:zs,isSpecCompliantForm:Vs,toJSONObject:Hs,isAsyncFn:Ks,isThenable:qs};function $(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}g.inherits($,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:g.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jo=$.prototype,Mo={};["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(t=>{Mo[t]={value:t}});Object.defineProperties($,Mo);Object.defineProperty(jo,"isAxiosError",{value:!0});$.from=(t,e,r,n,o,i)=>{const s=Object.create(jo);return g.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),$.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const Ws=null;function xr(t){return g.isPlainObject(t)||g.isArray(t)}function Bo(t){return g.endsWith(t,"[]")?t.slice(0,-2):t}function yn(t,e,r){return t?t.concat(e).map(function(o,i){return o=Bo(o),!r&&i?"["+o+"]":o}).join(r?".":""):e}function Gs(t){return g.isArray(t)&&!t.some(xr)}const Js=g.toFlatObject(g,{},null,function(e){return/^is[A-Z]/.test(e)});function Ft(t,e,r){if(!g.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=g.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!g.isUndefined(y[h])});const n=r.metaTokens,o=r.visitor||c,i=r.dots,s=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&g.isSpecCompliantForm(e);if(!g.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(g.isDate(p))return p.toISOString();if(!l&&g.isBlob(p))throw new $("Blob is not supported. Use a Buffer instead.");return g.isArrayBuffer(p)||g.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,h,y){let v=p;if(p&&!y&&typeof p=="object"){if(g.endsWith(h,"{}"))h=n?h:h.slice(0,-2),p=JSON.stringify(p);else if(g.isArray(p)&&Gs(p)||(g.isFileList(p)||g.endsWith(h,"[]"))&&(v=g.toArray(p)))return h=Bo(h),v.forEach(function(w,S){!(g.isUndefined(w)||w===null)&&e.append(s===!0?yn([h],S,i):s===null?h:h+"[]",u(w))}),!1}return xr(p)?!0:(e.append(yn(y,h,i),u(p)),!1)}const d=[],f=Object.assign(Js,{defaultVisitor:c,convertValue:u,isVisitable:xr});function m(p,h){if(!g.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));d.push(p),g.forEach(p,function(v,b){(!(g.isUndefined(v)||v===null)&&o.call(e,v,g.isString(b)?b.trim():b,h,f))===!0&&m(v,h?h.concat(b):[b])}),d.pop()}}if(!g.isObject(t))throw new TypeError("data must be an object");return m(t),e}function vn(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Jr(t,e){this._pairs=[],t&&Ft(t,this,e)}const Uo=Jr.prototype;Uo.append=function(e,r){this._pairs.push([e,r])};Uo.toString=function(e){const r=e?function(n){return e.call(this,n,vn)}:vn;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Ys(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function zo(t,e,r){if(!e)return t;const n=r&&r.encode||Ys,o=r&&r.serialize;let i;if(o?i=o(e,r):i=g.isURLSearchParams(e)?e.toString():new Jr(e,r).toString(n),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Qs{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){g.forEach(this.handlers,function(n){n!==null&&e(n)})}}const bn=Qs,Vo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xs=typeof URLSearchParams<"u"?URLSearchParams:Jr,Zs=typeof FormData<"u"?FormData:null,ea=typeof Blob<"u"?Blob:null,ta={isBrowser:!0,classes:{URLSearchParams:Xs,FormData:Zs,Blob:ea},protocols:["http","https","file","blob","url","data"]},Ho=typeof window<"u"&&typeof document<"u",ra=(t=>Ho&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),na=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),oa=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ho,hasStandardBrowserEnv:ra,hasStandardBrowserWebWorkerEnv:na},Symbol.toStringTag,{value:"Module"})),re={...oa,...ta};function ia(t,e){return Ft(t,new re.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,i){return re.isNode&&g.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function sa(t){return g.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function aa(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n=r.length;return s=!s&&g.isArray(o)?o.length:s,l?(g.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!g.isObject(o[s]))&&(o[s]=[]),e(r,n,o[s],i)&&g.isArray(o[s])&&(o[s]=aa(o[s])),!a)}if(g.isFormData(t)&&g.isFunction(t.entries)){const r={};return g.forEachEntry(t,(n,o)=>{e(sa(n),o,r,0)}),r}return null}function la(t,e,r){if(g.isString(t))try{return(e||JSON.parse)(t),g.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const Yr={transitional:Vo,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=g.isObject(e);if(i&&g.isHTMLForm(e)&&(e=new FormData(e)),g.isFormData(e))return o?JSON.stringify(Ko(e)):e;if(g.isArrayBuffer(e)||g.isBuffer(e)||g.isStream(e)||g.isFile(e)||g.isBlob(e))return e;if(g.isArrayBufferView(e))return e.buffer;if(g.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ia(e,this.formSerializer).toString();if((a=g.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ft(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),la(e)):e}],transformResponse:[function(e){const r=this.transitional||Yr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(e&&g.isString(e)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?$.from(a,$.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:re.classes.FormData,Blob:re.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};g.forEach(["delete","get","head","post","put","patch"],t=>{Yr.headers[t]={}});const Qr=Yr,ua=g.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"]),ca=t=>{const e={};let r,n,o;return t&&t.split(` +`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||e[r]&&ua[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},wn=Symbol("internals");function Me(t){return t&&String(t).trim().toLowerCase()}function yt(t){return t===!1||t==null?t:g.isArray(t)?t.map(yt):String(t)}function fa(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const da=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Zt(t,e,r,n,o){if(g.isFunction(n))return n.call(this,e,r);if(o&&(e=r),!!g.isString(e)){if(g.isString(n))return e.indexOf(n)!==-1;if(g.isRegExp(n))return n.test(e)}}function pa(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function ha(t,e){const r=g.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(o,i,s){return this[n].call(this,e,o,i,s)},configurable:!0})})}class jt{constructor(e){e&&this.set(e)}set(e,r,n){const o=this;function i(a,l,u){const c=Me(l);if(!c)throw new Error("header name must be a non-empty string");const d=g.findKey(o,c);(!d||o[d]===void 0||u===!0||u===void 0&&o[d]!==!1)&&(o[d||l]=yt(a))}const s=(a,l)=>g.forEach(a,(u,c)=>i(u,c,l));return g.isPlainObject(e)||e instanceof this.constructor?s(e,r):g.isString(e)&&(e=e.trim())&&!da(e)?s(ca(e),r):e!=null&&i(r,e,n),this}get(e,r){if(e=Me(e),e){const n=g.findKey(this,e);if(n){const o=this[n];if(!r)return o;if(r===!0)return fa(o);if(g.isFunction(r))return r.call(this,o,n);if(g.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=Me(e),e){const n=g.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||Zt(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let o=!1;function i(s){if(s=Me(s),s){const a=g.findKey(n,s);a&&(!r||Zt(n,n[a],a,r))&&(delete n[a],o=!0)}}return g.isArray(e)?e.forEach(i):i(e),o}clear(e){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!e||Zt(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const r=this,n={};return g.forEach(this,(o,i)=>{const s=g.findKey(n,i);if(s){r[s]=yt(o),delete r[i];return}const a=e?pa(i):String(i).trim();a!==i&&delete r[i],r[a]=yt(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return g.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=e&&g.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(o=>n.set(o)),n}static accessor(e){const n=(this[wn]=this[wn]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Me(s);n[a]||(ha(o,s),n[a]=!0)}return g.isArray(e)?e.forEach(i):i(e),this}}jt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(jt.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});g.freezeMethods(jt);const ae=jt;function er(t,e){const r=this||Qr,n=e||r,o=ae.from(n.headers);let i=n.data;return g.forEach(t,function(a){i=a.call(r,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function qo(t){return!!(t&&t.__CANCEL__)}function et(t,e,r){$.call(this,t??"canceled",$.ERR_CANCELED,e,r),this.name="CanceledError"}g.inherits(et,$,{__CANCEL__:!0});function ga(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new $("Request failed with status code "+r.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const ma=re.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const s=[t+"="+encodeURIComponent(e)];g.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),g.isString(n)&&s.push("path="+n),g.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ya(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function va(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Wo(t,e){return t&&!ya(e)?va(t,e):e}const ba=re.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(i){let s=i;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{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(s){const a=g.isString(s)?o(s):s;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function wa(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Sa(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=n[i];s||(s=u),r[o]=l,n[o]=u;let d=i,f=0;for(;d!==o;)f+=r[d++],d=d%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),u-s{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-r,l=n(a),u=i<=s;r=i;const c={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&u?(s-i)/l:void 0,event:o};c[e?"download":"upload"]=!0,t(c)}}const xa=typeof XMLHttpRequest<"u",Oa=xa&&function(t){return new Promise(function(r,n){let o=t.data;const i=ae.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,l;function u(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}let c;if(g.isFormData(o)){if(re.hasStandardBrowserEnv||re.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((c=i.getContentType())!==!1){const[h,...y]=c?c.split(";").map(v=>v.trim()).filter(Boolean):[];i.setContentType([h||"multipart/form-data",...y].join("; "))}}let d=new XMLHttpRequest;if(t.auth){const h=t.auth.username||"",y=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(h+":"+y))}const f=Wo(t.baseURL,t.url);d.open(t.method.toUpperCase(),zo(f,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function m(){if(!d)return;const h=ae.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),v={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:h,config:t,request:d};ga(function(w){r(w),u()},function(w){n(w),u()},v),d=null}if("onloadend"in d?d.onloadend=m:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(m)},d.onabort=function(){d&&(n(new $("Request aborted",$.ECONNABORTED,t,d)),d=null)},d.onerror=function(){n(new $("Network Error",$.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let y=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const v=t.transitional||Vo;t.timeoutErrorMessage&&(y=t.timeoutErrorMessage),n(new $(y,v.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,t,d)),d=null},re.hasStandardBrowserEnv&&(a&&g.isFunction(a)&&(a=a(t)),a||a!==!1&&ba(f))){const h=t.xsrfHeaderName&&t.xsrfCookieName&&ma.read(t.xsrfCookieName);h&&i.set(t.xsrfHeaderName,h)}o===void 0&&i.setContentType(null),"setRequestHeader"in d&&g.forEach(i.toJSON(),function(y,v){d.setRequestHeader(v,y)}),g.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),s&&s!=="json"&&(d.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&d.addEventListener("progress",Sn(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Sn(t.onUploadProgress)),(t.cancelToken||t.signal)&&(l=h=>{d&&(n(!h||h.type?new et(null,t,d):h),d.abort(),d=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l)));const p=wa(f);if(p&&re.protocols.indexOf(p)===-1){n(new $("Unsupported protocol "+p+":",$.ERR_BAD_REQUEST,t));return}d.send(o||null)})},Or={http:Ws,xhr:Oa};g.forEach(Or,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const xn=t=>`- ${t}`,Ea=t=>g.isFunction(t)||t===null||t===!1,Go={getAdapter:t=>{t=g.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since : +`+i.map(xn).join(` +`):" "+xn(i[0]):"as no adapter specified";throw new $("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:Or};function tr(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new et(null,t)}function On(t){return tr(t),t.headers=ae.from(t.headers),t.data=er.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Go.getAdapter(t.adapter||Qr.adapter)(t).then(function(n){return tr(t),n.data=er.call(t,t.transformResponse,n),n.headers=ae.from(n.headers),n},function(n){return qo(n)||(tr(t),n&&n.response&&(n.response.data=er.call(t,t.transformResponse,n.response),n.response.headers=ae.from(n.response.headers))),Promise.reject(n)})}const En=t=>t instanceof ae?{...t}:t;function Ce(t,e){e=e||{};const r={};function n(u,c,d){return g.isPlainObject(u)&&g.isPlainObject(c)?g.merge.call({caseless:d},u,c):g.isPlainObject(c)?g.merge({},c):g.isArray(c)?c.slice():c}function o(u,c,d){if(g.isUndefined(c)){if(!g.isUndefined(u))return n(void 0,u,d)}else return n(u,c,d)}function i(u,c){if(!g.isUndefined(c))return n(void 0,c)}function s(u,c){if(g.isUndefined(c)){if(!g.isUndefined(u))return n(void 0,u)}else return n(void 0,c)}function a(u,c,d){if(d in e)return n(u,c);if(d in t)return n(void 0,u)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,c)=>o(En(u),En(c),!0)};return g.forEach(Object.keys(Object.assign({},t,e)),function(c){const d=l[c]||o,f=d(t[c],e[c],c);g.isUndefined(f)&&d!==a||(r[c]=f)}),r}const Jo="1.6.8",Xr={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Xr[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Pn={};Xr.transitional=function(e,r,n){function o(i,s){return"[Axios v"+Jo+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(e===!1)throw new $(o(s," has been removed"+(r?" in "+r:"")),$.ERR_DEPRECATED);return r&&!Pn[s]&&(Pn[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,s,a):!0}};function Pa(t,e,r){if(typeof t!="object")throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],s=e[i];if(s){const a=t[i],l=a===void 0||s(a,i,t);if(l!==!0)throw new $("option "+i+" must be "+l,$.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new $("Unknown option "+i,$.ERR_BAD_OPTION)}}const Er={assertOptions:Pa,validators:Xr},ue=Er.validators;class St{constructor(e){this.defaults=e,this.interceptors={request:new bn,response:new bn}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+i):n.stack=i}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=Ce(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Er.assertOptions(n,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),o!=null&&(g.isFunction(o)?r.paramsSerializer={serialize:o}:Er.assertOptions(o,{encode:ue.function,serialize:ue.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&g.merge(i.common,i[r.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=ae.concat(s,i);const a=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(l=l&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let c,d=0,f;if(!l){const p=[On.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,u),f=p.length,c=Promise.resolve(r);d{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},e(function(i,s,a){n.reason||(n.reason=new et(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new Zr(function(o){e=o}),cancel:e}}}const Aa=Zr;function Ra(t){return function(r){return t.apply(null,r)}}function $a(t){return g.isObject(t)&&t.isAxiosError===!0}const Pr={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(Pr).forEach(([t,e])=>{Pr[e]=t});const La=Pr;function Yo(t){const e=new vt(t),r=Co(vt.prototype.request,e);return g.extend(r,vt.prototype,e,{allOwnKeys:!0}),g.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return Yo(Ce(t,o))},r}const N=Yo(Qr);N.Axios=vt;N.CanceledError=et;N.CancelToken=Aa;N.isCancel=qo;N.VERSION=Jo;N.toFormData=Ft;N.AxiosError=$;N.Cancel=N.CanceledError;N.all=function(e){return Promise.all(e)};N.spread=Ra;N.isAxiosError=$a;N.mergeConfig=Ce;N.AxiosHeaders=ae;N.formToJSON=t=>Ko(g.isHTMLForm(t)?new FormData(t):t);N.getAdapter=Go.getAdapter;N.HttpStatusCode=La;N.default=N;const Qo=N;var Ca=Error,Na=EvalError,_a=RangeError,Ia=ReferenceError,Xo=SyntaxError,tt=TypeError,Ta=URIError,ka=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==o||s.enumerable!==!0)return!1}return!0},An=typeof Symbol<"u"&&Symbol,Da=ka,Fa=function(){return typeof An!="function"||typeof Symbol!="function"||typeof An("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Da()},rr={__proto__:null,foo:{}},ja=Object,Ma=function(){return{__proto__:rr}.foo===rr.foo&&!(rr instanceof ja)},Ba="Function.prototype.bind called on incompatible ",Ua=Object.prototype.toString,za=Math.max,Va="[object Function]",Rn=function(e,r){for(var n=[],o=0;o"u"||!I?A:I(Uint8Array),ye={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?A:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?A:ArrayBuffer,"%ArrayIteratorPrototype%":Oe&&I?I([][Symbol.iterator]()):A,"%AsyncFromSyncIteratorPrototype%":A,"%AsyncFunction%":Re,"%AsyncGenerator%":Re,"%AsyncGeneratorFunction%":Re,"%AsyncIteratorPrototype%":Re,"%Atomics%":typeof Atomics>"u"?A:Atomics,"%BigInt%":typeof BigInt>"u"?A:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?A:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?A:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?A:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Xa,"%eval%":eval,"%EvalError%":Za,"%Float32Array%":typeof Float32Array>"u"?A:Float32Array,"%Float64Array%":typeof Float64Array>"u"?A:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?A:FinalizationRegistry,"%Function%":Zo,"%GeneratorFunction%":Re,"%Int8Array%":typeof Int8Array>"u"?A:Int8Array,"%Int16Array%":typeof Int16Array>"u"?A:Int16Array,"%Int32Array%":typeof Int32Array>"u"?A:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Oe&&I?I(I([][Symbol.iterator]())):A,"%JSON%":typeof JSON=="object"?JSON:A,"%Map%":typeof Map>"u"?A:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Oe||!I?A:I(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?A:Promise,"%Proxy%":typeof Proxy>"u"?A:Proxy,"%RangeError%":el,"%ReferenceError%":tl,"%Reflect%":typeof Reflect>"u"?A:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?A:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Oe||!I?A:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?A:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Oe&&I?I(""[Symbol.iterator]()):A,"%Symbol%":Oe?Symbol:A,"%SyntaxError%":Ne,"%ThrowTypeError%":nl,"%TypedArray%":il,"%TypeError%":Le,"%Uint8Array%":typeof Uint8Array>"u"?A:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?A:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?A:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?A:Uint32Array,"%URIError%":rl,"%WeakMap%":typeof WeakMap>"u"?A:WeakMap,"%WeakRef%":typeof WeakRef>"u"?A:WeakRef,"%WeakSet%":typeof WeakSet>"u"?A:WeakSet};if(I)try{null.error}catch(t){var sl=I(I(t));ye["%Error.prototype%"]=sl}var al=function t(e){var r;if(e==="%AsyncFunction%")r=nr("async function () {}");else if(e==="%GeneratorFunction%")r=nr("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=nr("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&I&&(r=I(o.prototype))}return ye[e]=r,r},$n={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},rt=en,xt=Qa,ll=rt.call(Function.call,Array.prototype.concat),ul=rt.call(Function.apply,Array.prototype.splice),Ln=rt.call(Function.call,String.prototype.replace),Ot=rt.call(Function.call,String.prototype.slice),cl=rt.call(Function.call,RegExp.prototype.exec),fl=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,dl=/\\(\\)?/g,pl=function(e){var r=Ot(e,0,1),n=Ot(e,-1);if(r==="%"&&n!=="%")throw new Ne("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ne("invalid intrinsic syntax, expected opening `%`");var o=[];return Ln(e,fl,function(i,s,a,l){o[o.length]=a?Ln(l,dl,"$1"):s||i}),o},hl=function(e,r){var n=e,o;if(xt($n,n)&&(o=$n[n],n="%"+o[0]+"%"),xt(ye,n)){var i=ye[n];if(i===Re&&(i=al(n)),typeof i>"u"&&!r)throw new Le("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Ne("intrinsic "+e+" does not exist!")},ke=function(e,r){if(typeof e!="string"||e.length===0)throw new Le("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Le('"allowMissing" argument must be a boolean');if(cl(/^%?[^%]*%?$/,e)===null)throw new Ne("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=pl(e),o=n.length>0?n[0]:"",i=hl("%"+o+"%",r),s=i.name,a=i.value,l=!1,u=i.alias;u&&(o=u[0],ul(n,ll([0,1],u)));for(var c=1,d=!0;c=n.length){var h=me(a,f);d=!!h,d&&"get"in h&&!("originalValue"in h.get)?a=h.get:a=a[f]}else d=xt(a,f),a=a[f];d&&!l&&(ye[s]=a)}}return a},ei={exports:{}},ir,Cn;function tn(){if(Cn)return ir;Cn=1;var t=ke,e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return ir=e,ir}var gl=ke,bt=gl("%Object.getOwnPropertyDescriptor%",!0);if(bt)try{bt([],"length")}catch{bt=null}var ti=bt,Nn=tn(),ml=Xo,Ee=tt,_n=ti,yl=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Ee("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Ee("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ee("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ee("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ee("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ee("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!_n&&_n(e,r);if(Nn)Nn(e,r,{configurable:s===null&&l?l.configurable:!s,enumerable:o===null&&l?l.enumerable:!o,value:n,writable:i===null&&l?l.writable:!i});else if(a||!o&&!i&&!s)e[r]=n;else throw new ml("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ar=tn(),ri=function(){return!!Ar};ri.hasArrayLengthDefineBug=function(){if(!Ar)return null;try{return Ar([],"length",{value:1}).length!==1}catch{return!0}};var vl=ri,bl=ke,In=yl,wl=vl(),Tn=ti,kn=tt,Sl=bl("%Math.floor%"),xl=function(e,r){if(typeof e!="function")throw new kn("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Sl(r)!==r)throw new kn("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in e&&Tn){var s=Tn(e,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(i=!1)}return(o||i||!n)&&(wl?In(e,"length",r,!0,!0):In(e,"length",r)),e};(function(t){var e=en,r=ke,n=xl,o=tt,i=r("%Function.prototype.apply%"),s=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(s,i),l=tn(),u=r("%Math.max%");t.exports=function(f){if(typeof f!="function")throw new o("a function is required");var m=a(e,s,arguments);return n(m,1+u(0,f.length-(arguments.length-1)),!0)};var c=function(){return a(e,i,arguments)};l?l(t.exports,"apply",{value:c}):t.exports.apply=c})(ei);var Ol=ei.exports,ni=ke,oi=Ol,El=oi(ni("String.prototype.indexOf")),Pl=function(e,r){var n=ni(e,!!r);return typeof n=="function"&&El(e,".prototype.")>-1?oi(n):n};const Al={},Rl=Object.freeze(Object.defineProperty({__proto__:null,default:Al},Symbol.toStringTag,{value:"Module"})),$l=Vi(Rl);var rn=typeof Map=="function"&&Map.prototype,sr=Object.getOwnPropertyDescriptor&&rn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Et=rn&&sr&&typeof sr.get=="function"?sr.get:null,Dn=rn&&Map.prototype.forEach,nn=typeof Set=="function"&&Set.prototype,ar=Object.getOwnPropertyDescriptor&&nn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Pt=nn&&ar&&typeof ar.get=="function"?ar.get:null,Fn=nn&&Set.prototype.forEach,Ll=typeof WeakMap=="function"&&WeakMap.prototype,Ke=Ll?WeakMap.prototype.has:null,Cl=typeof WeakSet=="function"&&WeakSet.prototype,qe=Cl?WeakSet.prototype.has:null,Nl=typeof WeakRef=="function"&&WeakRef.prototype,jn=Nl?WeakRef.prototype.deref:null,_l=Boolean.prototype.valueOf,Il=Object.prototype.toString,Tl=Function.prototype.toString,kl=String.prototype.match,on=String.prototype.slice,de=String.prototype.replace,Dl=String.prototype.toUpperCase,Mn=String.prototype.toLowerCase,ii=RegExp.prototype.test,Bn=Array.prototype.concat,te=Array.prototype.join,Fl=Array.prototype.slice,Un=Math.floor,Rr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,lr=Object.getOwnPropertySymbols,$r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,_e=typeof Symbol=="function"&&typeof Symbol.iterator=="object",D=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===_e||"symbol")?Symbol.toStringTag:null,si=Object.prototype.propertyIsEnumerable,zn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Vn(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||ii.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Un(-t):Un(t);if(n!==t){var o=String(n),i=on.call(e,o.length+1);return de.call(o,r,"$&_")+"."+de.call(de.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return de.call(e,r,"$&_")}var Lr=$l,Hn=Lr.custom,Kn=li(Hn)?Hn:null,jl=function t(e,r,n,o){var i=r||{};if(ce(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ce(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=ce(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ce(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ce(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=i.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ci(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?Vn(e,l):l}if(typeof e=="bigint"){var u=String(e)+"n";return a?Vn(e,u):u}var c=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=c&&c>0&&typeof e=="object")return Cr(e)?"[Array]":"[Object]";var d=ru(i,n);if(typeof o>"u")o=[];else if(ui(o,e)>=0)return"[Circular]";function f(K,V,H){if(V&&(o=Fl.call(o),o.push(V)),H){var Y={depth:i.depth};return ce(i,"quoteStyle")&&(Y.quoteStyle=i.quoteStyle),t(K,Y,n+1,o)}return t(K,i,n+1,o)}if(typeof e=="function"&&!qn(e)){var m=Wl(e),p=at(e,f);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(p.length>0?" { "+te.call(p,", ")+" }":"")}if(li(e)){var h=_e?de.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):$r.call(e);return typeof e=="object"&&!_e?Be(h):h}if(Zl(e)){for(var y="<"+Mn.call(String(e.nodeName)),v=e.attributes||[],b=0;b",y}if(Cr(e)){if(e.length===0)return"[]";var w=at(e,f);return d&&!tu(w)?"["+Nr(w,d)+"]":"[ "+te.call(w,", ")+" ]"}if(Ul(e)){var S=at(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!si.call(e,"cause")?"{ ["+String(e)+"] "+te.call(Bn.call("[cause]: "+f(e.cause),S),", ")+" }":S.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+te.call(S,", ")+" }"}if(typeof e=="object"&&s){if(Kn&&typeof e[Kn]=="function"&&Lr)return Lr(e,{depth:c-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Gl(e)){var R=[];return Dn&&Dn.call(e,function(K,V){R.push(f(V,e,!0)+" => "+f(K,e))}),Wn("Map",Et.call(e),R,d)}if(Ql(e)){var P=[];return Fn&&Fn.call(e,function(K){P.push(f(K,e))}),Wn("Set",Pt.call(e),P,d)}if(Jl(e))return ur("WeakMap");if(Xl(e))return ur("WeakSet");if(Yl(e))return ur("WeakRef");if(Vl(e))return Be(f(Number(e)));if(Kl(e))return Be(f(Rr.call(e)));if(Hl(e))return Be(_l.call(e));if(zl(e))return Be(f(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===Hi)return"{ [object globalThis] }";if(!Bl(e)&&!qn(e)){var E=at(e,f),M=zn?zn(e)===Object.prototype:e instanceof Object||e.constructor===Object,B=e instanceof Object?"":"null prototype",U=!M&&D&&Object(e)===e&&D in e?on.call(pe(e),8,-1):B?"Object":"",z=M||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",he=z+(U||B?"["+te.call(Bn.call([],U||[],B||[]),": ")+"] ":"");return E.length===0?he+"{}":d?he+"{"+Nr(E,d)+"}":he+"{ "+te.call(E,", ")+" }"}return String(e)};function ai(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Ml(t){return de.call(String(t),/"/g,""")}function Cr(t){return pe(t)==="[object Array]"&&(!D||!(typeof t=="object"&&D in t))}function Bl(t){return pe(t)==="[object Date]"&&(!D||!(typeof t=="object"&&D in t))}function qn(t){return pe(t)==="[object RegExp]"&&(!D||!(typeof t=="object"&&D in t))}function Ul(t){return pe(t)==="[object Error]"&&(!D||!(typeof t=="object"&&D in t))}function zl(t){return pe(t)==="[object String]"&&(!D||!(typeof t=="object"&&D in t))}function Vl(t){return pe(t)==="[object Number]"&&(!D||!(typeof t=="object"&&D in t))}function Hl(t){return pe(t)==="[object Boolean]"&&(!D||!(typeof t=="object"&&D in t))}function li(t){if(_e)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!$r)return!1;try{return $r.call(t),!0}catch{}return!1}function Kl(t){if(!t||typeof t!="object"||!Rr)return!1;try{return Rr.call(t),!0}catch{}return!1}var ql=Object.prototype.hasOwnProperty||function(t){return t in this};function ce(t,e){return ql.call(t,e)}function pe(t){return Il.call(t)}function Wl(t){if(t.name)return t.name;var e=kl.call(Tl.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function ui(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return ci(on.call(t,0,e.maxStringLength),e)+n}var o=de.call(de.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,eu);return ai(o,"single",e)}function eu(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Dl.call(e.toString(16))}function Be(t){return"Object("+t+")"}function ur(t){return t+" { ? }"}function Wn(t,e,r,n){var o=n?Nr(r,n):te.call(r,", ");return t+" ("+e+") {"+o+"}"}function tu(t){for(var e=0;e=0)return!1;return!0}function ru(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=te.call(Array(t.indent+1)," ");else return null;return{base:r,prev:te.call(Array(e+1),r)}}function Nr(t,e){if(t.length===0)return"";var r=` +`+e.prev+e.base;return r+te.call(t,","+r)+` +`+e.prev}function at(t,e){var r=Cr(t),n=[];if(r){n.length=t.length;for(var o=0;o1;){var r=e.pop(),n=r.obj[r.prop];if(ge(n)){for(var o=[],i=0;i=dr?s.slice(l,l+dr):s,c=[],d=0;d=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===yu.RFC1738&&(f===40||f===41)){c[c.length]=u.charAt(d);continue}if(f<128){c[c.length]=Z[f];continue}if(f<2048){c[c.length]=Z[192|f>>6]+Z[128|f&63];continue}if(f<55296||f>=57344){c[c.length]=Z[224|f>>12]+Z[128|f>>6&63]+Z[128|f&63];continue}d+=1,f=65536+((f&1023)<<10|u.charCodeAt(d)&1023),c[c.length]=Z[240|f>>18]+Z[128|f>>12&63]+Z[128|f>>6&63]+Z[128|f&63]}a+=c.join("")}return a},Ou=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o"u"&&(R=0)}if(typeof c=="function"?w=c(r,w):w instanceof Date?w=m(w):n==="comma"&&ee(w)&&(w=wt.maybeMap(w,function(ie){return ie instanceof Date?m(ie):ie})),w===null){if(s)return u&&!y?u(r,_.encoder,v,"key",p):r;w=""}if(Nu(w)||wt.isBuffer(w)){if(u){var M=y?r:u(r,_.encoder,v,"key",p);return[h(M)+"="+h(u(w,_.encoder,v,"value",p))]}return[h(r)+"="+h(String(w))]}var B=[];if(typeof w>"u")return B;var U;if(n==="comma"&&ee(w))y&&u&&(w=wt.maybeMap(w,u)),U=[{value:w.length>0?w.join(",")||null:void 0}];else if(ee(c))U=c;else{var z=Object.keys(w);U=d?z.sort(d):z}var he=l?r.replace(/\./g,"%2E"):r,K=o&&ee(w)&&w.length===1?he+"[]":he;if(i&&ee(w)&&w.length===0)return K+"[]";for(var V=0;V"u"?e.encodeDotInKeys===!0?!0:_.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:_.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:_.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?_.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:_.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:_.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:_.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:_.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:_.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:_.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_.strictNullHandling}},Tu=function(t,e){var r=t,n=Iu(e),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):ee(n.filter)&&(i=n.filter,o=i);var s=[];if(typeof r!="object"||r===null)return"";var a=gi[n.arrayFormat],l=a==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var u=hi(),c=0;c0?m+f:""},Ie=pi,_r=Object.prototype.hasOwnProperty,ku=Array.isArray,C={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Ie.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Du=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},yi=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Fu="utf8=%26%2310003%3B",ju="utf8=%E2%9C%93",Mu=function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=r.parameterLimit===1/0?void 0:r.parameterLimit,s=o.split(r.delimiter,i),a=-1,l,u=r.charset;if(r.charsetSentinel)for(l=0;l-1&&(p=ku(p)?[p]:p);var h=_r.call(n,m);h&&r.duplicates==="combine"?n[m]=Ie.combine(n[m],p):(!h||r.duplicates==="last")&&(n[m]=p)}return n},Bu=function(t,e,r,n){for(var o=n?e:yi(e,r),i=t.length-1;i>=0;--i){var s,a=t[i];if(a==="[]"&&r.parseArrays)s=r.allowEmptyArrays&&o===""?[]:[].concat(o);else{s=r.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=r.decodeDotInKeys?l.replace(/%2E/g,"."):l,c=parseInt(u,10);!r.parseArrays&&u===""?s={0:o}:!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[],s[c]=o):u!=="__proto__"&&(s[u]=o)}o=s}return o},Uu=function(e,r,n,o){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=n.depth>0&&s.exec(i),u=l?i.slice(0,l.index):i,c=[];if(u){if(!n.plainObjects&&_r.call(Object.prototype,u)&&!n.allowPrototypes)return;c.push(u)}for(var d=0;n.depth>0&&(l=a.exec(i))!==null&&d"u"?C.charset:e.charset,n=typeof e.duplicates>"u"?C.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:C.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:C.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:C.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:C.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:C.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:C.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:C.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:C.decoder,delimiter:typeof e.delimiter=="string"||Ie.isRegExp(e.delimiter)?e.delimiter:C.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:C.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:C.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:C.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:C.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},Vu=function(t,e){var r=zu(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Mu(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),s=0;s1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,r)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=e||Ju,this.options=r,this.debug=r.debug}log(){for(var e=arguments.length,r=new Array(e),n=0;n{this.observers[n]||(this.observers[n]=new Map);const o=this.observers[n].get(r)||0;this.observers[n].set(r,o+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o{let[a,l]=s;for(let u=0;u{let[a,l]=s;for(let u=0;u{t=n,e=o});return r.resolve=t,r.reject=e,r}function Jn(t){return t==null?"":""+t}function Yu(t,e,r){t.forEach(n=>{e[n]&&(r[n]=e[n])})}const Qu=/###/g;function Ge(t,e,r){function n(a){return a&&a.indexOf("###")>-1?a.replace(Qu,"."):a}function o(){return!t||typeof t=="string"}const i=typeof e!="string"?e:e.split(".");let s=0;for(;s":">",'"':""","'":"'","/":"/"};function tc(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>ec[e]):t}class rc{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const nc=[" ",",","?","!",";"],oc=new rc(20);function ic(t,e,r){e=e||"",r=r||"";const n=nc.filter(s=>e.indexOf(s)<0&&r.indexOf(s)<0);if(n.length===0)return!0;const o=oc.getRegExp(`(${n.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!o.test(t);if(!i){const s=t.indexOf(r);s>0&&!o.test(t.substring(0,s))&&(i=!0)}return i}function Ir(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const n=e.split(r);let o=t;for(let i=0;i-1&&l0?t.replace("_","-"):t}class Qn extends Mt{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,r],n&&(Array.isArray(n)?a.push(...n):typeof n=="string"&&i?a.push(...n.split(i)):a.push(n)));const l=Rt(this.data,a);return!l&&!r&&!n&&e.indexOf(".")>-1&&(e=a[0],r=a[1],n=a.slice(2).join(".")),l||!s||typeof n!="string"?l:Ir(this.data&&this.data[e]&&this.data[e][r],n,i)}addResource(e,r,n,o){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,r];n&&(a=a.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(a=e.split("."),o=r,r=a[1]),this.addNamespaces(r),Yn(this.data,a,o),i.silent||this.emit("added",e,r,n,o)}addResources(e,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in n)(typeof n[i]=="string"||Array.isArray(n[i]))&&this.addResource(e,r,i,n[i],{silent:!0});o.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,o,i){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,r];e.indexOf(".")>-1&&(a=e.split("."),o=n,n=r,r=a[1]),this.addNamespaces(r);let l=Rt(this.data,a)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?vi(l,n,i):l={...l,...n},Yn(this.data,a,l),s.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,r)}:this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var bi={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,o){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,r,n,o))}),e}};const Xn={};class Lt extends Mt{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Yu(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ne.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const n=this.resolve(e,r);return n&&n.res!==void 0}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let i=r.ns||this.options.defaultNS||[];const s=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!ic(e,n,o);if(s&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:i};const u=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(o)}return typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const o=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],r),l=a[a.length-1],u=r.lng||this.language,c=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const S=r.nsSeparator||this.options.nsSeparator;return o?{res:`${l}${S}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${S}${s}`}return o?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:s}const d=this.resolve(e,r);let f=d&&d.res;const m=d&&d.usedKey||s,p=d&&d.exactUsedKey||s,h=Object.prototype.toString.apply(f),y=["[object Number]","[object Function]","[object RegExp]"],v=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&y.indexOf(h)<0&&!(typeof v=="string"&&Array.isArray(f))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,f,{...r,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(d.res=S,d.usedParams=this.getUsedParamsDetails(r),d):S}if(i){const S=Array.isArray(f),R=S?[]:{},P=S?p:m;for(const E in f)if(Object.prototype.hasOwnProperty.call(f,E)){const M=`${P}${i}${E}`;R[E]=this.translate(M,{...r,joinArrays:!1,ns:a}),R[E]===M&&(R[E]=f[E])}f=R}}else if(b&&typeof v=="string"&&Array.isArray(f))f=f.join(v),f&&(f=this.extendTranslation(f,e,r,n));else{let S=!1,R=!1;const P=r.count!==void 0&&typeof r.count!="string",E=Lt.hasDefaultValue(r),M=P?this.pluralResolver.getSuffix(u,r.count,r):"",B=r.ordinal&&P?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",U=P&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),z=U&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${M}`]||r[`defaultValue${B}`]||r.defaultValue;!this.isValidLookup(f)&&E&&(S=!0,f=z),this.isValidLookup(f)||(R=!0,f=s);const K=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:f,V=E&&z!==f&&this.options.updateMissing;if(R||S||V){if(this.logger.log(V?"updateKey":"missingKey",u,l,s,V?z:f),i){const F=this.resolve(s,{...r,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let F=0;F{const cn=E&&ie!==f?ie:K;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,Q,cn,V,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(F,l,Q,cn,V,r),this.emit("missingKey",F,l,Q,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?H.forEach(F=>{const Q=this.pluralResolver.getSuffixes(F,r);U&&r[`defaultValue${this.options.pluralSeparator}zero`]&&Q.indexOf(`${this.options.pluralSeparator}zero`)<0&&Q.push(`${this.options.pluralSeparator}zero`),Q.forEach(ie=>{Se([F],s+ie,r[`defaultValue${ie}`]||z)})}):Se(H,s,z))}f=this.extendTranslation(f,e,r,d,n),R&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${s}`),(R||S)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,S?f:void 0):f=this.options.parseMissingKeyHandler(f))}return o?(d.res=f,d.usedParams=this.getUsedParamsDetails(r),d):f}extendTranslation(e,r,n,o,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=typeof e=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=e.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language,n),u){const f=e.match(this.interpolator.nestingRegexp),m=f&&f.length;c1&&arguments[1]!==void 0?arguments[1]:{},n,o,i,s,a;return typeof e=="string"&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),c=u.key;o=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=r.count!==void 0&&typeof r.count!="string",m=f&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),p=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",h=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);d.forEach(y=>{this.isValidLookup(n)||(a=y,!Xn[`${h[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(Xn[`${h[0]}-${y}`]=!0,this.logger.warn(`key "${o}" for languages "${h.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(v=>{if(this.isValidLookup(n))return;s=v;const b=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(b,c,v,y,r);else{let S;f&&(S=this.pluralResolver.getSuffix(v,r.count,r));const R=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(b.push(c+S),r.ordinal&&S.indexOf(P)===0&&b.push(c+S.replace(P,this.options.pluralSeparator)),m&&b.push(c+R)),p){const E=`${c}${this.options.contextSeparator}${r.context}`;b.push(E),f&&(b.push(E+S),r.ordinal&&S.indexOf(P)===0&&b.push(E+S.replace(P,this.options.pluralSeparator)),m&&b.push(E+R))}}let w;for(;w=b.pop();)this.isValidLookup(n)||(i=w,n=this.getResource(v,y,w,r))}))})}),{res:n,usedKey:o,exactUsedKey:i,usedLng:s,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,n,o):this.resourceStore.getResource(e,r,n,o)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&typeof e.replace!="string";let o=n?e.replace:e;if(n&&typeof e.count<"u"&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!n){o={...o};for(const i of r)delete o[i]}return o}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}}function hr(t){return t.charAt(0).toUpperCase()+t.slice(1)}class Zn{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ne.create("languageUtils")}getScriptPartFromCode(e){if(e=$t(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=$t(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map(o=>o.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=hr(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=hr(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=hr(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const o=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const o=this.getLanguagePartFromCode(n);if(this.isSupportedCode(o))return r=o;r=this.options.supportedLngs.find(i=>{if(i===o)return i;if(!(i.indexOf("-")<0&&o.indexOf("-")<0)&&(i.indexOf("-")>0&&o.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===o||i.indexOf(o)===0&&o.length>1))return i})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),typeof e=="string"&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],e),o=[],i=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),n.forEach(s=>{o.indexOf(s)<0&&i(this.formatLanguageCode(s))}),o}}let sc=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ac={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}};const lc=["v1","v2","v3"],uc=["v4"],eo={zero:0,one:1,two:2,few:3,many:4,other:5};function cc(){const t={};return sc.forEach(e=>{e.lngs.forEach(r=>{t[r]={numbers:e.nr,plurals:ac[e.fc]}})}),t}class fc{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=r,this.logger=ne.create("pluralResolver"),(!this.options.compatibilityJSON||uc.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=cc()}addRule(e,r){this.rules[e]=r}getRule(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules($t(e==="dev"?"en":e),{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(e,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(o=>`${r}${o}`)}getSuffixes(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((o,i)=>eo[o]-eo[i]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):n.numbers.map(o=>this.getSuffix(e,o,r)):[]}getSuffix(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(e,n);return o?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:this.getSuffixRetroCompatible(o,r):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,r){const n=e.noAbs?e.plurals(r):e.plurals(Math.abs(r));let o=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const i=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!lc.includes(this.options.compatibilityJSON)}}function to(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=Zu(t,e,r);return!i&&o&&typeof r=="string"&&(i=Ir(t,r,n),i===void 0&&(i=Ir(e,r,n))),i}class dc{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ne.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:o,prefix:i,prefixEscaped:s,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:y,maxReplaces:v,alwaysFormat:b}=e.interpolation;this.escape=r!==void 0?r:tc,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?Pe(i):s||"{{",this.suffix=a?Pe(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=f?Pe(f):m||Pe("$t("),this.nestingSuffix=p?Pe(p):h||Pe(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=v||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>r&&r.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,r,n,o){let i,s,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(p){return p.replace(/\$/g,"$$$$")}const c=p=>{if(p.indexOf(this.formatSeparator)<0){const b=to(r,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,n,{...o,...r,interpolationkey:p}):b}const h=p.split(this.formatSeparator),y=h.shift().trim(),v=h.join(this.formatSeparator).trim();return this.format(to(r,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),v,n,{...o,...r,interpolationkey:y})};this.resetRegExp();const d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,f=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>u(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?u(this.escape(p)):u(p)}].forEach(p=>{for(a=0;i=p.regex.exec(e);){const h=i[1].trim();if(s=c(h),s===void 0)if(typeof d=="function"){const v=d(e,i,o);s=typeof v=="string"?v:""}else if(o&&Object.prototype.hasOwnProperty.call(o,h))s="";else if(f){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${e}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=Jn(s));const y=p.safeValue(s);if(e=e.replace(i[0],y),f?(p.regex.lastIndex+=s.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,i,s;function a(l,u){const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,s);const m=f.match(/'/g),p=f.match(/"/g);(m&&m.length%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(h){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,h),`${l}${c}${f}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l}for(;o=this.nestingRegexp.exec(e);){let l=[];s={...n},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const c=o[1].split(this.formatSeparator).map(d=>d.trim());o[1]=c.shift(),l=c,u=!0}if(i=r(a.call(this,o[1].trim(),s),s),i&&o[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=Jn(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),i=""),u&&(i=l.reduce((c,d)=>this.format(c,d,n.lng,{...n,interpolationkey:o[1].trim()}),i.trim())),e=e.replace(o[0],i),this.regexp.lastIndex=0}return e}}function pc(t){let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);e==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):e==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(s=>{if(s){const[a,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();r[c]||(r[c]=u),u==="false"&&(r[c]=!1),u==="true"&&(r[c]=!0),isNaN(u)||(r[c]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}}function Ae(t){const e={};return function(n,o,i){const s=o+JSON.stringify(i);let a=e[s];return a||(a=t($t(o),i),e[s]=a),a(n)}}class hc{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ne.create("formatter"),this.options=e,this.formats={number:Ae((r,n)=>{const o=new Intl.NumberFormat(r,{...n});return i=>o.format(i)}),currency:Ae((r,n)=>{const o=new Intl.NumberFormat(r,{...n,style:"currency"});return i=>o.format(i)}),datetime:Ae((r,n)=>{const o=new Intl.DateTimeFormat(r,{...n});return i=>o.format(i)}),relativetime:Ae((r,n)=>{const o=new Intl.RelativeTimeFormat(r,{...n});return i=>o.format(i,n.range||"day")}),list:Ae((r,n)=>{const o=new Intl.ListFormat(r,{...n});return i=>o.format(i)})},this.init(e)}init(e){const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Ae(r)}format(e,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return r.split(this.formatSeparator).reduce((a,l)=>{const{formatName:u,formatOptions:c}=pc(l);if(this.formats[u]){let d=a;try{const f=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},m=f.locale||f.lng||o.locale||o.lng||n;d=this.formats[u](a,m,{...c,...o,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}function gc(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}class mc extends Mt{constructor(e,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=ne.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,o.backend,o)}queueLoad(e,r,n,o){const i={},s={},a={},l={};return e.forEach(u=>{let c=!0;r.forEach(d=>{const f=`${u}|${d}`;!n.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,c=!1,s[f]===void 0&&(s[f]=!0),i[f]===void 0&&(i[f]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(a[u]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const o=e.split("|"),i=o[0],s=o[1];r&&this.emit("failedLoading",i,s,r),n&&this.store.addResourceBundle(i,s,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2;const a={};this.queue.forEach(l=>{Xu(l.loaded,[i],s),gc(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{a[u][d]===void 0&&(a[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:o,wait:i,callback:s});return}this.readingCalls++;const a=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&o{this.read.call(this,e,r,n,o+1,i*2,s)},i);return}s(u,c)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(e,r,a)}prepareLoading(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof r=="string"&&(r=[r]);const i=this.queueLoad(e,r,n,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=e.split("|"),o=n[0],i=n[1];this.read(o,i,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${r}loading namespace ${i} for language ${o} failed`,s),!s&&a&&this.logger.log(`${r}loaded namespace ${i} for language ${o}`,a),this.loaded(e,s,a)})}saveMissing(e,r,n,o,i){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const l={...s,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(e,r,n,o,l):c=u(e,r,n,o),c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}else u(e,r,n,o,a,l)}!e||!e[0]||this.store.addResource(e[0],r,n,o)}}}function ro(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let r={};if(typeof e[1]=="object"&&(r=e[1]),typeof e[1]=="string"&&(r.defaultValue=e[1]),typeof e[2]=="string"&&(r.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(o=>{r[o]=n[o]})}return r},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function no(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function ct(){}function yc(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})}class Ye extends Mt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=no(e),this.services={},this.logger=ne,this.modules={external:[]},yc(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(){var e=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const o=ro();this.options={...o,...this.options,...no(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);function i(c){return c?typeof c=="function"?new c:c:null}if(!this.options.isClone){this.modules.logger?ne.init(i(this.modules.logger),this.options):ne.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=hc);const d=new Zn(this.options);this.store=new Qn(this.options.resources,this.options);const f=this.services;f.logger=ne,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new fc(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(f.formatter=i(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new dc(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new mc(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(m){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y1?p-1:0),y=1;y{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,n||(n=ct),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=function(){return e.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return e.store[c](...arguments),e}});const l=Ue(),u=()=>{const c=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ct;const o=typeof e=="string"?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const i=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(a)})}else n(null)}reloadResources(e,r,n){const o=Ue();return e||(e=this.languages),r||(r=this.options.ns),n||(n=ct),this.services.backendConnector.reload(e,r,i=>{o.resolve(),n(i)}),o}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&bi.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let r=0;r-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(e,r){var n=this;this.isLanguageChangingTo=e;const o=Ue();this.emit("languageChanging",e);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,o.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},a=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{s(c,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),o}getFixedT(e,r,n){var o=this;const i=function(s,a){let l;if(typeof a!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d`${l.keyPrefix}${f}${p}`):m=l.keyPrefix?`${l.keyPrefix}${f}${s}`:s,o.t(m,l)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=r,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const s=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===2};if(r.precheck){const a=r.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,e)&&(!o||s(i,e)))}loadNamespaces(e,r){const n=Ue();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=Ue();typeof e=="string"&&(e=[e]);const o=this.options.preload||[],i=e.filter(s=>o.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=o.concat(i),this.loadResources(s=>{n.resolve(),r&&r(s)}),n):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new Zn(ro());return r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Ye(e,r)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ct;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},i=new Ye(o);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n&&(i.store=new Qn(this.store.data,o),i.services.resourceStore=i.store),i.translator=new Lt(i.services,o),i.translator.on("*",function(a){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;ct.split(",").map((e,r)=>{e=e.trim();const n=e.replace(/([&*]|\+\+)/g,""),o=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Dr(n,o,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Array.isArray(o),r===0)});function wc(t,e,r,n){const o=t.db.createObjectStore(e,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach(i=>kr(o,i)),o}function kr(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})}function Dr(t,e,r,n,o,i,s){return{name:t,keyPath:e,unique:r,multi:n,auto:o,compound:i,src:(r&&!s?"&":"")+(n?"*":"")+(o?"++":"")+wi(e)}}function Si(t,e,r){return{name:t,primKey:e,indexes:r,mappedClass:null,idxByName:Sc(r,n=>[n.name,n])}}function xi(t,e){const r={};return[...t.objectStoreNames].forEach(o=>{const i=e.objectStore(o);let s=i.keyPath;const a=Dr(wi(s),s||"",!1,!1,!!i.autoIncrement,s&&typeof s!="string",!0),l=[];for(let c=0;c0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}}return n}function Sc(t,e){return t.reduce((r,n,o)=>{var i=e(n,o);return i&&(r[i[0]]=i[1]),r},{})}function oo(t,e,r,n){const o=xi(e,r),i={};return Object.keys(t).forEach(a=>{const[l,...u]=bc(t[a]);i[a]=Si(a,l,u)}),Oi(o,i,n)}function xc(t,e,r){t.add.forEach(n=>{wc(r,n[0],n[1].primKey,n[1].indexes)}),t.change.forEach(n=>{if(n.recreate)throw"Not yet support for changing primary key";{const o=r.objectStore(n.name);n.add.forEach(i=>kr(o,i)),n.change.forEach(i=>{o.deleteIndex(i.name),kr(o,i)}),n.del.forEach(i=>o.deleteIndex(i))}}),t.del.forEach(n=>{e.deleteObjectStore(n)})}function Oc(t){const e=new Map;return{idbOpen:async(o,{store:i,incrementalUpdate:s}={})=>{if(!o||typeof o!="string")return Promise.reject(new TypeError("dbName must be a string"));let a=e.get(o);if(a)try{return await c(await a)}catch(f){if(e.delete(o),!(f instanceof Error&&Object.prototype.toString.call(f)==="[object DOMException]"&&f.message.indexOf("The database connection is closing.")!==-1))return Promise.reject(f)}let l=d();return e.set(o,l),l.catch(()=>{l===e.get(o)&&e.delete(o)}),l;function u(f,m){const p=function(h){var v,b,w;const y=oo(h,f,m,s);return!((v=y.add)!=null&&v.length||(b=y.change)!=null&&b.length||(w=y.del)!=null&&w.length)};switch(typeof i){case"string":{const[h,y]=i.split("|");return p({[h]:y||"++"})}case"function":try{return typeof i.call(this,f,m)!="function"}catch(h){throw h}case"object":if(i)return p(i);default:return!0}}function c(f){if(u(f,f.objectStoreNames.length?f.transaction([...f.objectStoreNames],"readonly"):void 0))return Promise.resolve(f);{let m=f.version+1;return d(m)}}function d(f){return new Promise((m,p)=>{let h=t.indexedDB.open(o,f);h.onerror=function(y){p(this.error)},h.onupgradeneeded=function(y){var w,S,R;const v=this.result,b=this.transaction;try{switch(typeof i){case"function":{const P=()=>i.call(this,v,b),E=()=>xi(v,b);let M,B=E();for(;typeof(M=P())=="function";){M.call(this,v,b,y);const U=E(),z=Oi(B,U,!1);if(B=U,!((w=z.add)!=null&&w.length||(S=z.change)!=null&&S.length||(R=z.del)!=null&&R.length))throw new Error('Parameter "store" contradicts "upgradeneeded"')}break}case"string":case"object":{let P;if(typeof i=="string"){const[M,B]=i.split("|");P={[M]:B||"++"}}else P=i;const E=oo(P,v,b,s);xc(E,v,b);break}default:if(!u.call(this,v,b))throw new TypeError('Missing or wrong type of "upgradeneeded" parameter')}}catch(P){console.error(P),b.abort(),v.close(),p(P)}},h.onsuccess=function(y){const v=this.result;v.onversionchange=function(){v.close(),e.delete(o)},v.onclose=function(){e.delete(o)},e.set(o,v);try{m(c(v))}catch(b){p(b)}},h.onblocked=function(y){var b;let v=e.get(o);v&&((b=v==null?void 0:v.close)==null||b.call(v))}})}},idbDelete:o=>new Promise((i,s)=>{let a=t.indexedDB.deleteDatabase(o);a.onerror=function(l){s(this.error)},a.onsuccess=function(l){i(null)}})}}const Ec=Oc(window),{idbOpen:Ei,idbDelete:pp}=Ec,Pc=(t,e)=>e.some(r=>t instanceof r);let io,so;function Ac(){return io||(io=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Rc(){return so||(so=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Pi=new WeakMap,Fr=new WeakMap,Ai=new WeakMap,gr=new WeakMap,ln=new WeakMap;function $c(t){const e=new Promise((r,n)=>{const o=()=>{t.removeEventListener("success",i),t.removeEventListener("error",s)},i=()=>{r(le(t.result)),o()},s=()=>{n(t.error),o()};t.addEventListener("success",i),t.addEventListener("error",s)});return e.then(r=>{r instanceof IDBCursor&&Pi.set(r,t)}).catch(()=>{}),ln.set(e,t),e}function Lc(t){if(Fr.has(t))return;const e=new Promise((r,n)=>{const o=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",s),t.removeEventListener("abort",s)},i=()=>{r(),o()},s=()=>{n(t.error||new DOMException("AbortError","AbortError")),o()};t.addEventListener("complete",i),t.addEventListener("error",s),t.addEventListener("abort",s)});Fr.set(t,e)}let jr={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return Fr.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Ai.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return le(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Cc(t){jr=t(jr)}function Nc(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(mr(this),e,...r);return Ai.set(n,e.sort?e.sort():[e]),le(n)}:Rc().includes(t)?function(...e){return t.apply(mr(this),e),le(Pi.get(this))}:function(...e){return le(t.apply(mr(this),e))}}function _c(t){return typeof t=="function"?Nc(t):(t instanceof IDBTransaction&&Lc(t),Pc(t,Ac())?new Proxy(t,jr):t)}function le(t){if(t instanceof IDBRequest)return $c(t);if(gr.has(t))return gr.get(t);const e=_c(t);return e!==t&&(gr.set(t,e),ln.set(e,t)),e}const mr=t=>ln.get(t);function Ic(t,e,{blocked:r,upgrade:n,blocking:o,terminated:i}={}){const s=indexedDB.open(t,e),a=le(s);return n&&s.addEventListener("upgradeneeded",l=>{n(le(s.result),l.oldVersion,l.newVersion,le(s.transaction),l)}),r&&s.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),a.then(l=>{i&&l.addEventListener("close",()=>i()),o&&l.addEventListener("versionchange",u=>o(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const Tc=["get","getKey","getAll","getAllKeys","count"],kc=["put","add","delete","clear"],yr=new Map;function ao(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(yr.get(e))return yr.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,o=kc.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||Tc.includes(r)))return;const i=async function(s,...a){const l=this.transaction(s,o?"readwrite":"readonly");let u=l.store;return n&&(u=u.index(a.shift())),(await Promise.all([u[r](...a),o&&l.done]))[0]};return yr.set(e,i),i}Cc(t=>({...t,get:(e,r,n)=>ao(e,r)||t.get(e,r,n),has:(e,r)=>!!ao(e,r)||t.has(e,r)}));const Mr="GOST-UI",un=async t=>le(await Ei(Mr,{store:t})),Dc=async t=>{const e=await Ei(Mr),r=e.version+1;e.close(),Ic(Mr,r,{upgrade:(n,o,i,s,a)=>{t(s)}})},fe="localCache",ze="savedServer";class G{constructor(e){X(this,"dsName",fe);X(this,"type");X(this,"_getIdb",()=>un(`${this.dsName}|++_id_,_key_,_type_,[_type_+_key_],[name+_type_+_key_]`));X(this,"_getTransaction",async()=>{const r=(await this._getIdb()).transaction(this.dsName,"readwrite"),n=r.objectStore(this.dsName);return{transaction:r,store:n}});X(this,"getList",async()=>(await this._getIdb()).getAllFromIndex(this.dsName,"[_type_+_key_]",IDBKeyRange.only([this.type,this.key])));X(this,"get",async e=>(await this._getIdb()).getFromIndex(this.dsName,"[name+_type_+_key_]",IDBKeyRange.only([e,this.type,this.key])));X(this,"add",async e=>{await(await this._getIdb()).add(this.dsName,{...e,_key_:this.key,_type_:this.type})});X(this,"put",async(e,r)=>{if(r._id_)await(await this._getIdb()).put(this.dsName,r);else{const{transaction:n,store:o}=await this._getTransaction(),i=await o.index("[name+_type_+_key_]").get(IDBKeyRange.only([e,this.type,this.key]));return r._id_=i._id_,await o.put({...i,...r,_id_:i._id_}),n.done}});X(this,"delete",async e=>{const{transaction:r,store:n}=await this._getTransaction(),o=await n.index("[name+_type_+_key_]").get(IDBKeyRange.only([e,this.type,this.key]));return await n.delete(o._id_),r.done});this.type=e}get key(){var e;return(e=Ri())==null?void 0:e.addr}}const Fc=new G("admissions"),jc=new G("authers"),Mc=new G("bypasses"),Bc=new G("chains"),Uc=new G("climiters"),zc=new G("limiters"),Vc=new G("rlimiters"),Hc=new G("hops"),Kc=new G("hosts"),qc=new G("ingresses"),Wc=new G("resolvers"),Gc=new G("services");class Fe{static _getIdb(){return un({[ze]:"addr",[fe]:"++_id_,_key_"})}static async getAllServer(){return(await this._getIdb()).getAll(ze)}static async getServer(e){return(await this._getIdb()).get(ze,e)}static async setServer(e){await(await this._getIdb()).put(ze,e)}static async deleteServer(e,r=!1){await(await this._getIdb()).delete(ze,e),r&&await this.deleteCacheConfig(e)}static async deleteCacheConfig(e){const o=await(await this._getIdb()).transaction([fe],"readwrite").objectStore(fe),i=await o.index("_key_").getAllKeys(IDBKeyRange.only(e));await o.delete(i)}static async getAllCacheConfig(e){const r=await this._getIdb();return e?r.getAllFromIndex(fe,"_key_",IDBKeyRange.only(e)):r.getAll(fe)}}const Jc=async()=>{const t=await un(`${fe}|++_id_`),e=t.objectStoreNames,r=/^services-/,n="services",o=[...e].filter(s=>r.test(s)),i=t.transaction(e,"readwrite");for(const s of o){const a=await i.objectStore(s).getAll();let l=decodeURIComponent(s.replace(/^services-/,""));/^(https?:)?\/\//.test(l)?/^\/\//.test(l)&&(l=`${location.protocol}`+l):l=`${location.protocol}//`+l,a.length>0&&await a.map(u=>i.objectStore(fe).add({...u,_type_:n,_key_:l})),await i.objectStore(s).clear()}return await i.done,o.length&&Dc(s=>{const a=[...s.objectStoreNames],l=/^services-/;[...a.filter(c=>l.test(c)),"services","localConfigStore"].forEach(c=>{a.includes(c)&&s.db.deleteObjectStore(c)})}),o.length>0},hp=Object.freeze(Object.defineProperty({__proto__:null,GostCommit:G,ServerComm:Fe,admissions:Fc,authers:jc,bypasses:Mc,chains:Bc,climiters:Uc,fixOldCacheConfig:Jc,hops:Hc,hosts:Kc,ingresses:qc,limiters:zc,resolvers:Wc,rlimiters:Vc,services:Gc},Symbol.toStringTag,{value:"Module"})),ve="__GOST_SERVER__",ft="__USE_SERVER__",vr="__SETTINGS__",be=It();Object.defineProperty(window,ve,{get:be.get,set:be.set});const dt=It(),pt=It(),Br=It(()=>{const t=localStorage.getItem(vr)||"{}";try{return JSON.parse(t)}catch(e){return console.error(e),{}}},t=>{t==null&&localStorage.removeItem(vr),localStorage.setItem(vr,JSON.stringify(t))}),Ri=()=>be.get(),Yc=async()=>{if(window[ve])return!0;const t=Gu.parse(location.search,{ignoreQueryPrefix:!0});t.use&&(window[ft]=t.use,window.history.replaceState(null,"",location.pathname),$i());const e=sessionStorage.getItem(ve);if(e){const r=JSON.parse(e);return await Ur(r),!0}if(window[ft]){const r=await Xc(window[ft]);r&&(r.isLocal=!0,await Ur(r),r&&(r.time=Date.now(),Li(window[ft],r)))}},Qc=async t=>{const e=t.addr.replace(/\/+$/,"");return Qo.get(e+"/config",{auth:t.auth}).catch(r=>{throw"verify error"})},Ur=async(t,e)=>{try{await Qc(t),window[ve]=t,window.sessionStorage.setItem(ve,JSON.stringify(t)),e&&(t.isLocal=!0,window[ve]=t,await Li(t.addr,t))}catch(r){throw r==="verify error"&&($i(),br.error((r==null?void 0:r.message)||Tr("msg.connectionFailed"))),r}},$i=async()=>{be.set(null),window.sessionStorage.removeItem(ve)},Li=async(t,e)=>Fe.setServer({...e,isLocal:!0,time:Date.now()}),Xc=async t=>Fe.getServer(t),Zc=async t=>Fe.deleteServer(t),ef=async()=>Fe.getAllServer(),we=Qo.create();we.interceptors.request.use(t=>{const e=Ri();return t.baseURL=e==null?void 0:e.addr,t.auth=e==null?void 0:e.auth,t});we.interceptors.response.use(t=>{var e;return t.config.method!=="get"&&!((e=t.config)!=null&&e.noMsg)&&br.success(Tr("msg.success")),t.data?t.data:t},t=>{var n,o;const{response:e}=t||{};let r=t.message||Tr("msg.unknown");throw(n=e==null?void 0:e.data)!=null&&n.msg&&(r=(o=e==null?void 0:e.data)==null?void 0:o.msg),br.error(r),t});const T={config:"/config",admissions:"/config/admissions",authers:"/config/authers",bypasses:"/config/bypasses",chains:"/config/chains",climiters:"/config/climiters",limiters:"/config/limiters",rlimiters:"/config/rlimiters",hops:"/config/hops",hosts:"/config/hosts",ingresses:"/config/ingresses",observers:"/config/observers",resolvers:"/config/resolvers",sds:"/config/sds",services:"/config/services"},j=t=>({post:e=>we.post(t,e),put:(e,r)=>we.put(`${t}/${e}`,r),delete:e=>we.delete(`${t}/${e}`)}),tf=j(T.admissions),rf=j(T.authers),nf=j(T.bypasses),of=j(T.chains),sf=j(T.climiters),af=j(T.limiters),lf=j(T.rlimiters),uf=j(T.hops),cf=j(T.hosts),ff=j(T.ingresses),df=j(T.resolvers),pf=j(T.services),hf=j(T.sds),gf=j(T.observers),zr=t=>we.get(T.config),mf=(t="json",e)=>we.post(T.config,null,{params:{format:t,path:e},noMsg:!0}),gp=Object.freeze(Object.defineProperty({__proto__:null,admissions:tf,apis:T,authers:rf,bypasses:nf,chains:of,climiters:sf,getConfig:zr,getRESTfulApi:j,hops:uf,hosts:cf,ingresses:ff,limiters:af,observers:gf,resolvers:df,rlimiters:lf,saveCofnig:mf,sds:hf,services:pf},Symbol.toStringTag,{value:"Module"}));var yf={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"};const vf=yf;var bf=function(e,r){return O.createElement(Qe,Xe({},e,{ref:r,icon:vf}))},wf=O.forwardRef(bf);const Sf=wf;var xf={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"};const Of=xf;var Ef=function(e,r){return O.createElement(Qe,Xe({},e,{ref:r,icon:Of}))},Pf=O.forwardRef(Ef);const Af=Pf;var Rf={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z"}}]},name:"moon",theme:"outlined"};const $f=Rf;var Lf=function(e,r){return O.createElement(Qe,Xe({},e,{ref:r,icon:$f}))},Cf=O.forwardRef(Lf);const Nf=Cf;var _f={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z"}}]},name:"sun",theme:"outlined"};const If=_f;var Tf=function(e,r){return O.createElement(Qe,Xe({},e,{ref:r,icon:If}))},kf=O.forwardRef(Tf);const Df=kf;var Ff={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"};const jf=Ff;var Mf=function(e,r){return O.createElement(Qe,Xe({},e,{ref:r,icon:jf}))},Bf=O.forwardRef(Mf);const Uf=Bf;function zf(){if(console&&console.warn){for(var t=arguments.length,e=new Array(t),r=0;r()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}};function uo(t,e,r){t.loadNamespaces(e,Ci(t,r))}function co(t,e,r,n){typeof r=="string"&&(r=[r]),r.forEach(o=>{t.options.ns.indexOf(o)<0&&t.options.ns.push(o)}),t.loadLanguages(e,Ci(t,n))}function Vf(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=e.languages[0],o=e.options?e.options.fallbackLng:!1,i=e.languages[e.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const s=(a,l)=>{const u=e.services.backendConnector.state[`${a}|${l}`];return u===-1||u===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(n,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(n,t)&&(!o||s(i,t)))}function Hf(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(Vr("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:r.lng,precheck:(o,i)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!i(o.isLanguageChangingTo,t))return!1}}):Vf(t,e,r)}const Kf=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qf={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Wf=t=>qf[t],Gf=t=>t.replace(Kf,Wf);let Hr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Gf};function Jf(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Hr={...Hr,...t}}function Yf(){return Hr}let Ni;function Qf(t){Ni=t}function Xf(){return Ni}const Zf={type:"3rdParty",init(t){Jf(t.options.react),Qf(t)}},ed=O.createContext();class td{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const rd=(t,e)=>{const r=O.useRef();return O.useEffect(()=>{r.current=e?r.current:t},[t,e]),r.current};function _i(t,e,r,n){return t.getFixedT(e,r,n)}function nd(t,e,r,n){return O.useCallback(_i(t,e,r,n),[t,e,r,n])}function Bt(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:r}=e,{i18n:n,defaultNS:o}=O.useContext(ed)||{},i=r||n||Xf();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new td),!i){Vr("You will need to pass in an i18next instance by using initReactI18next");const S=(P,E)=>typeof E=="string"?E:E&&typeof E=="object"&&typeof E.defaultValue=="string"?E.defaultValue:Array.isArray(P)?P[P.length-1]:P,R=[S,{},!1];return R.t=S,R.i18n={},R.ready=!1,R}i.options.react&&i.options.react.wait!==void 0&&Vr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...Yf(),...i.options.react,...e},{useSuspense:a,keyPrefix:l}=s;let u=t||o||i.options&&i.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(u);const c=(i.isInitialized||i.initializedStoreOnce)&&u.every(S=>Hf(S,i,s)),d=nd(i,e.lng||null,s.nsMode==="fallback"?u:u[0],l),f=()=>d,m=()=>_i(i,e.lng||null,s.nsMode==="fallback"?u:u[0],l),[p,h]=O.useState(f);let y=u.join();e.lng&&(y=`${e.lng}${y}`);const v=rd(y),b=O.useRef(!0);O.useEffect(()=>{const{bindI18n:S,bindI18nStore:R}=s;b.current=!0,!c&&!a&&(e.lng?co(i,e.lng,u,()=>{b.current&&h(m)}):uo(i,u,()=>{b.current&&h(m)})),c&&v&&v!==y&&b.current&&h(m);function P(){b.current&&h(m)}return S&&i&&i.on(S,P),R&&i&&i.store.on(R,P),()=>{b.current=!1,S&&i&&S.split(" ").forEach(E=>i.off(E,P)),R&&i&&R.split(" ").forEach(E=>i.store.off(E,P))}},[i,y]),O.useEffect(()=>{b.current&&c&&h(f)},[i,l,c]);const w=[p,i,c];if(w.t=p,w.i18n=i,w.ready=c,c||!c&&!a)return w;throw new Promise(S=>{e.lng?co(i,e.lng,u,()=>S()):uo(i,u,()=>S())})}const od=()=>{const{t}=Bt(),[e,r]=O.useState(),n=O.useCallback(async()=>ef().then(o=>o.sort((i,s)=>{const a=i.time||0;return(s.time||0)-a})).then(o=>r(o)),[]);return O.useEffect(()=>{n()},[]),x.jsx(x.Fragment,{children:e&&(e==null?void 0:e.length)>0?x.jsxs(vo,{direction:"vertical",style:{display:"flex"},children:[x.jsx("div",{children:t("home.quickConnect")}),x.jsx(Ki,{gutter:10,children:e.map(o=>x.jsx(qi,{span:12,title:o.addr,style:{overflow:"hidden",textOverflow:"ellipsis"},children:x.jsxs(Wi,{gap:5,style:{overflow:"hidden"},children:[x.jsx("a",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:"auto"},href:`?use=${o.addr}`,children:o.addr}),x.jsx(Gi,{style:{color:"red"},onClick:async()=>{await Zc(o.addr),n()}})]})},o.addr))})]}):null})},id=()=>{const[t,e]=O.useState(window.matchMedia("(prefers-color-scheme: dark)").matches);return O.useEffect(()=>{const r=window.matchMedia("(prefers-color-scheme: dark)"),n=o=>{e(o.matches)};return r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),t},Ii=()=>{const t=id(),{theme:e}=Br();return O.useMemo(()=>!e||e==="system"?t:e==="dark",[e,t])},sd=t=>{const e=Br(),r=Ii(),n=r?x.jsx(Nf,{}):x.jsx(Df,{});return x.jsx(qr,{shape:"circle",icon:n,...t,onClick:()=>{const o={...e};o.theme=r?"light":"dark",Br.set(o)}})},ad=t=>{const{i18n:e}=Bt();return x.jsx(qr,{shape:"circle",...t,onClick:()=>{e.changeLanguage(e.resolvedLanguage==="en"?"zh":"en")},children:e.resolvedLanguage==="en"?"中":"En"})},ld=()=>{const{t,i18n:e}=Bt();return x.jsxs(x.Fragment,{children:[x.jsxs(xe,{className:"home-form",size:"large",layout:"horizontal",initialValues:{baseURL:"http://",save:!0},onFinish:r=>{let n=r.baseURL;return/^(https?:)?\/\//.test(n)?/^\/\//.test(n)&&(n=`${location.protocol}`+n):n=`${location.protocol}//`+n,Ur({addr:n,auth:{username:r.username,password:r.password}},r.save)},children:[x.jsx("h1",{children:t("base.title")}),x.jsx("h2",{children:t("base.description")}),x.jsx(xe.Item,{name:"baseURL",rules:[{required:!0,message:t("msg.baseURL.required")},{validator(r,n,o){n==="http://"&&o(t("msg.baseURL.required")),o()}}],children:x.jsx(Qt,{placeholder:t("placeholder.baseURL"),prefix:x.jsx(Sf,{className:"prefixIcon"})})}),x.jsx(xe.Item,{name:"username",children:x.jsx(Qt,{placeholder:"username",prefix:x.jsx(Uf,{className:"prefixIcon"})})}),x.jsx(xe.Item,{name:"password",children:x.jsx(Qt.Password,{placeholder:"password",prefix:x.jsx(Af,{className:"prefixIcon"})})}),x.jsx(xe.Item,{name:"save",valuePropName:"checked",children:x.jsx(Ji,{children:t("base.form.local")})}),x.jsx(xe.Item,{noStyle:!0,style:{marginBottom:"1em"},children:x.jsx(qr,{block:!0,type:"primary",htmlType:"submit",children:t("base.cmd.connect")})}),x.jsx(od,{})]}),x.jsx("div",{style:{position:"absolute",top:"1em",right:"1em"},children:x.jsxs(vo,{children:[x.jsx(sd,{}),x.jsx(ad,{})]})})]})};const se=new Lo.EventEmitter;var Ut={},Ti={exports:{}};(function(t){function e(r){return r&&r.__esModule?r:{default:r}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(Ti);var je=Ti.exports,zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.default=void 0;var ud={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};zt.default=ud;var Vt={},nt={},Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.default=void 0;var cd={locale:"zh_CN",yearFormat:"YYYY年",cellDateFormat:"D",cellMeridiemFormat:"A",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"};Ht.default=cd;var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.default=void 0;const fd={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};ot.default=fd;var ki=je.default;Object.defineProperty(nt,"__esModule",{value:!0});nt.default=void 0;var dd=ki(Ht),pd=ki(ot);const Di={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},dd.default),timePickerLocale:Object.assign({},pd.default)};Di.lang.ok="确定";nt.default=Di;var hd=je.default;Object.defineProperty(Vt,"__esModule",{value:!0});Vt.default=void 0;var gd=hd(nt);Vt.default=gd.default;var Kt=je.default;Object.defineProperty(Ut,"__esModule",{value:!0});Ut.default=void 0;var md=Kt(zt),yd=Kt(Vt),vd=Kt(nt),bd=Kt(ot);const q="${label}不是一个有效的${type}",wd={locale:"zh-cn",Pagination:md.default,DatePicker:vd.default,TimePicker:bd.default,Calendar:yd.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:q,method:q,array:q,object:q,number:q,date:q,boolean:q,integer:q,float:q,regexp:q,email:q,url:q,hex:q},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无"}};Ut.default=wd;var Sd=Ut;const fo=Kr(Sd);var qt={},Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.default=void 0;var xd={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"};Wt.default=xd;var Gt={},it={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.default=void 0;var Od={locale:"en_GB",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"Select time",dateSelect:"Select date",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"D/M/YYYY",dayFormat:"D",dateTimeFormat:"D/M/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};Jt.default=Od;var st={};Object.defineProperty(st,"__esModule",{value:!0});st.default=void 0;const Ed={placeholder:"Select time"};st.default=Ed;var Fi=je.default;Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var Pd=Fi(Jt),Ad=Fi(st);const Rd={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},Pd.default),timePickerLocale:Object.assign({},Ad.default)};it.default=Rd;var $d=je.default;Object.defineProperty(Gt,"__esModule",{value:!0});Gt.default=void 0;var Ld=$d(it);Gt.default=Ld.default;var Yt=je.default;Object.defineProperty(qt,"__esModule",{value:!0});qt.default=void 0;var Cd=Yt(Wt),Nd=Yt(Gt),_d=Yt(it),Id=Yt(st);const W="${label} is not a valid ${type}",Td={locale:"en-gb",Pagination:Cd.default,DatePicker:_d.default,TimePicker:Id.default,Calendar:Nd.default,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No Data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:W,method:W,array:W,object:W,number:W,date:W,boolean:W,integer:W,float:W,regexp:W,email:W,url:W,hex:W},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"}};qt.default=Td;var kd=qt;const Dd=Kr(kd),Fd=Ct.createContext({}),mp=Ct.createContext({localList:[],name:""}),yp=(t,e)=>{const r=`${t}:getComm`,n=o=>{o(e)};return se.on(r,n),()=>{se.off(r,n)}},vp=t=>new Promise((e,r)=>{const n=`${t}:getComm`;se.emit(n,e)}),{slice:jd,forEach:Md}=[];function Bd(t){return Md.call(jd.call(arguments,1),e=>{if(e)for(const r in e)t[r]===void 0&&(t[r]=e[r])}),t}const po=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ud=(t,e,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(e);let i=`${t}=${o}`;if(n.maxAge>0){const s=n.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(s)}`}if(n.domain){if(!po.test(n.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${n.domain}`}if(n.path){if(!po.test(n.path))throw new TypeError("option path is invalid");i+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},ho={create(t,e,r,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),n&&(o.domain=n),document.cookie=Ud(t,encodeURIComponent(e),o)},read(t){const e=`${t}=`,r=document.cookie.split(";");for(let n=0;n-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const s=o.substring(1).split("&");for(let a=0;a0&&s[a].substring(0,l)===e&&(r=s[a].substring(l+1))}}return r}};let Ve=null;const go=()=>{if(Ve!==null)return Ve;try{Ve=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ve=!1}return Ve};var Hd={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&go())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:r}=e;r&&go()&&window.localStorage.setItem(r,t)}};let He=null;const mo=()=>{if(He!==null)return He;try{He=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{He=!1}return He};var Kd={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&mo())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:r}=e;r&&mo()&&window.sessionStorage.setItem(r,t)}},qd={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:o}=navigator;if(r)for(let i=0;i0?e:void 0}},Wd={name:"htmlTag",lookup(t){let{htmlTag:e}=t,r;const n=e||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},Gd={name:"path",lookup(t){var o;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(o=r[typeof e=="number"?e:0])==null?void 0:o.replace("/",""):void 0}},Jd={name:"subdomain",lookup(t){var o,i;let{lookupFromSubdomainIndex:e}=t;const r=typeof e=="number"?e+1:1,n=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[r]}};function Yd(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class ji{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,r)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=Bd(r,this.options||{},Yd()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(zd),this.addDetector(Vd),this.addDetector(Hd),this.addDetector(Kd),this.addDetector(qd),this.addDetector(Wd),this.addDetector(Gd),this.addDetector(Jd)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let r=[];return e.forEach(n=>{if(this.detectors[n]){let o=this.detectors[n].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.map(n=>this.options.convertDetectedLanguage(n)),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(e,r){r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(e,this.options)}))}}ji.type="languageDetector";const Qd="English",Xd={title:"GOST API Manage",description:"Connecting to API Services",form:{username:"Username",password:"Password",local:"Save to local",name:"Name",details:"Details"},cmd:{connect:"Connect",controls:"Operation",enabled:"Enabled",disable:"Disable",copy:"Copy",edit:"Edit",del:"Delete"}},Zd={warn:"Warning",deleteing:"Are you sure you want to delete?",doubleClickEdit:"Double click to modify"},ep={admission:{title:"Admission",subTitle:"admission"},auther:{title:"Auther",subTitle:"auther"},bypass:{title:"Bypass",subTitle:"bypass"},chain:{title:"Chain",subTitle:"chain"},climiter:{title:"climiter",subTitle:"climiter"},limiter:{title:"limiter",subTitle:"limiter"},rlimiter:{title:"rlimiter",subTitle:"rlimiter"},hop:{title:"Hop",subTitle:"hop"},host:{title:"Hosts",subTitle:"hosts"},ingress:{title:"Ingress",subTitle:"Ingress"},resolver:{title:"Resolver",subTitle:"resolver"},service:{title:"Service",subTitle:"service"},sd:{title:"SD",subTitle:"SD"},observer:{title:"Observer",subTitle:"observer"}},tp={baseURL:{required:"BaseURL cannot be empty"},require:"Can not be empty!",success:"Success!",unknown:"Unknown error!",connectionFailed:"Connection failed!",wordWrap:"Word Wrap",invalidName:"Invalid name",autofixName:"Whether to automatically assign a name?",autofix:"Autofix Reminder",fixName:"Reassign name to {{name}}",formatError:"{{name}}Format error!"},rp={baseURL:"API baseURL",savePath:"By default, it is saved to the context directory."},np={quickConnect:"Quick Connect"},op={cmd:{reload:"Reload Config",save:"Save to server",download:"Download Config",logout:"Logout",switch:"Switch Services",new:"Connect to new Services"},label:{autoSave:"Autosave",format:"Format",path:"Save path",limit:"Speed and current limit",allConfig:"All Config JSON"}},ip={edit:"Edit {{name}}",add:"Add {{name}}",copied:"Copied from {{name}}"},sp={default:"Default",inline:"Inline"},ap={template:"Template",forwarder:"Forwarder",key0:"Remote Port Forwarding"},yo={language:Qd,base:Xd,text:Zd,modules:ep,msg:tp,placeholder:rp,home:np,manage:op,title:ip,template:sp,terms:ap},Mi="en";k.use(ji).use(Zf).init({debug:!0,fallbackLng:Mi,interpolation:{escapeValue:!1},resources:{en:{translation:yo},zh:{translation:yo}}});function bp(t){if(typeof t=="string"||O.isValidElement(t))return t;const e=k.resolvedLanguage;return t[e]||t[Mi]||""}const lp=Ct.lazy(()=>ss(()=>import("./Manage-a4e861d9.js"),["./Manage-a4e861d9.js","./antd-15fa66a0.js"],import.meta.url)),up=t=>{const{locale:e,theme:r}=O.useContext(ht.ConfigContext);return O.useLayoutEffect(()=>{ht.config({theme:r,holderRender:n=>x.jsx(ht,{theme:r,children:n})})},[e,r]),x.jsx(Qi,{children:t.children})};function cp(){const t=be(),{t:e,i18n:r}=Bt(),n=dt(),o=pt(),i=Ii(),[s,a]=O.useState(!1),[l,u]=O.useState(!1),[c,d]=O.useState(fo),f=O.useMemo(()=>s||l,[s,l]),m=O.useRef({update:async()=>{var p;try{a(!0),u(!0);const[h,y]=await Promise.all([zr(),m.current.updateLocalConfig((p=be.get())==null?void 0:p.addr)]);return dt.set(h),pt.set(y),[h,y]}finally{a(!1),u(!1)}},updateLocalConfig:async p=>{try{p||pt.set(null),u(!0);const h=await Fe.getAllCacheConfig(p),y={};return h.forEach(v=>{const{_type_:b}=v;(y[b]?y[b]:y[b]=[]).push(v)}),y}finally{u(!1)}},defaultTitle:document.title});return O.useEffect(()=>{Yc();const p=async v=>{if((v==null?void 0:v.url)!==T.config)return dt.set(await zr())},h=async()=>{var v;return pt.set(await m.current.updateLocalConfig((v=be.get())==null?void 0:v.addr))},y=m.current.update;return se.on("apiUpdate",p),se.on("localUpdate",h),se.on("update",y),()=>{se.off("apiUpdate",p),se.off("localUpdate",h),se.off("update",y)}},[]),O.useEffect(()=>{t?m.current.update().then(([p])=>{dt.set(p),document.title=t.addr.replace(/^(https?:)?\/\//,"")}):document.title=m.current.defaultTitle},[t]),O.useEffect(()=>{var p,h;i?(document.documentElement.classList.add("theme-dark"),(p=window==null?void 0:window.monaco)==null||p.editor.setTheme("vs-dark")):(document.documentElement.classList.remove("theme-dark"),(h=window==null?void 0:window.monaco)==null||h.editor.setTheme("vs"))},[i]),O.useEffect(()=>{const p=r.resolvedLanguage;d(p==="zh"?fo:Dd)},[r.resolvedLanguage]),x.jsx(Fd.Provider,{value:{gostConfig:n,localConfig:o,isLoading:f},children:x.jsx(ht,{theme:{algorithm:i?Yi.darkAlgorithm:void 0},locale:c,children:x.jsx(up,{children:x.jsx(Ct.Suspense,{fallback:"loading...",children:t?x.jsx(lp,{}):x.jsx(ld,{})})})})})}wr.createRoot(document.getElementById("root")).render(x.jsx(cp,{}));export{gp as A,mp as C,hp as L,sd as T,Ii as a,bp as b,wr as c,Fd as d,se as e,yp as f,Xf as g,vp as h,dt as i,x as j,be as k,ef as l,Jc as m,zr as n,$i as o,ad as p,Gu as q,Li as r,mf as s,T as t,Bt as u}; diff --git a/assets/index-bd11f4a6.js b/assets/index-bd11f4a6.js deleted file mode 100644 index b3f8adc..0000000 --- a/assets/index-bd11f4a6.js +++ /dev/null @@ -1,17 +0,0 @@ -var Bo=Object.defineProperty;var Mo=(t,e,r)=>e in t?Bo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var H=(t,e,r)=>(Mo(t,typeof e!="symbol"?e+"":e,r),r);import{r as _,a as ko,g as jo,c as Uo,b as wn,m as Wt,A as Fe,_ as Be,S as zo,R as Ho,C as Vo,F as Wo,D as qo,B as Sn,d as ye,I as _t,e as Ko,f as ct,h as Qe,t as Go,i as Jo}from"./antd-15fa66a0.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();var En={exports:{}},lt={};/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Qo=_,Yo=Symbol.for("react.element"),Xo=Symbol.for("react.fragment"),Zo=Object.prototype.hasOwnProperty,ea=Qo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ta={key:!0,ref:!0,__self:!0,__source:!0};function On(t,e,r){var n,o={},a=null,i=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(i=e.ref);for(n in e)Zo.call(e,n)&&!ta.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:Yo,type:t,key:a,ref:i,props:o,_owner:ea.current}}lt.Fragment=Xo;lt.jsx=On;lt.jsxs=On;En.exports=lt;var w=En.exports,qt={},Cr=ko;qt.createRoot=Cr.createRoot,qt.hydrateRoot=Cr.hydrateRoot;const ra="modulepreload",na=function(t,e){return new URL(t,e).href},Tr={},oa=function(e,r,n){if(!r||r.length===0)return e();const o=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=na(a,n),a in Tr)return;Tr[a]=!0;const i=a.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(!!n)for(let l=o.length-1;l>=0;l--){const u=o[l];if(u.href===a&&(!i||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${s}`))return;const f=document.createElement("link");if(f.rel=i?"stylesheet":ra,i||(f.as="script",f.crossOrigin=""),f.href=a,document.head.appendChild(f),i)return new Promise((l,u)=>{f.addEventListener("load",l),f.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=a,window.dispatchEvent(i),!i.defaultPrevented)throw a})};var pr={exports:{}},ge=typeof Reflect=="object"?Reflect:null,Nr=ge&&typeof ge.apply=="function"?ge.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Ye;ge&&typeof ge.ownKeys=="function"?Ye=ge.ownKeys:Object.getOwnPropertySymbols?Ye=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ye=function(e){return Object.getOwnPropertyNames(e)};function aa(t){console&&console.warn&&console.warn(t)}var _n=Number.isNaN||function(e){return e!==e};function x(){x.init.call(this)}pr.exports=x;pr.exports.once=la;x.EventEmitter=x;x.prototype._events=void 0;x.prototype._eventsCount=0;x.prototype._maxListeners=void 0;var Lr=10;function ut(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(x,"defaultMaxListeners",{enumerable:!0,get:function(){return Lr},set:function(t){if(typeof t!="number"||t<0||_n(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Lr=t}});x.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};x.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||_n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function xn(t){return t._maxListeners===void 0?x.defaultMaxListeners:t._maxListeners}x.prototype.getMaxListeners=function(){return xn(this)};x.prototype.emit=function(e){for(var r=[],n=1;n0&&(i=r[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var c=a[e];if(c===void 0)return!1;if(typeof c=="function")Nr(c,this,r);else for(var f=c.length,l=$n(c,f),n=0;n0&&i.length>o&&!i.warned){i.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=i.length,aa(s)}return t}x.prototype.addListener=function(e,r){return An(this,e,r,!1)};x.prototype.on=x.prototype.addListener;x.prototype.prependListener=function(e,r){return An(this,e,r,!0)};function ia(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Pn(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=ia.bind(n);return o.listener=r,n.wrapFn=o,o}x.prototype.once=function(e,r){return ut(r),this.on(e,Pn(this,e,r)),this};x.prototype.prependOnceListener=function(e,r){return ut(r),this.prependListener(e,Pn(this,e,r)),this};x.prototype.removeListener=function(e,r){var n,o,a,i,s;if(ut(r),o=this._events,o===void 0)return this;if(n=o[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(a=-1,i=n.length-1;i>=0;i--)if(n[i]===r||n[i].listener===r){s=n[i].listener,a=i;break}if(a<0)return this;a===0?n.shift():sa(n,a),n.length===1&&(o[e]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",e,s||r)}return this};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(e){var r,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),i;for(o=0;o=0;o--)this.removeListener(e,r[o]);return this};function Rn(t,e,r){var n=t._events;if(n===void 0)return[];var o=n[e];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?ca(o):$n(o,o.length)}x.prototype.listeners=function(e){return Rn(this,e,!0)};x.prototype.rawListeners=function(e){return Rn(this,e,!1)};x.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):In.call(t,e)};x.prototype.listenerCount=In;function In(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}x.prototype.eventNames=function(){return this._eventsCount>0?Ye(this._events):[]};function $n(t,e){for(var r=new Array(e),n=0;na,e=i=>{a=i}}const n=new Tn.EventEmitter;n.on("setValue",function(a){e(a),n.emit("upValue",a)}),r&&e(r);const o=a=>{const[i,s]=_.useState(t?t():void 0);return _.useEffect(()=>(a&&n.emit("setValue",a),n.on("upValue",s),()=>{n.off("upValue",s)}),[]),i};return o.set=a=>{n.emit("setValue",a)},o.get=()=>t==null?void 0:t(),o}function Nn(t,e){return function(){return t.apply(e,arguments)}}const{toString:fa}=Object.prototype,{getPrototypeOf:yr}=Object,dt=(t=>e=>{const r=fa.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),G=t=>(t=t.toLowerCase(),e=>dt(e)===t),pt=t=>e=>typeof e===t,{isArray:_e}=Array,De=pt("undefined");function da(t){return t!==null&&!De(t)&&t.constructor!==null&&!De(t.constructor)&&M(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ln=G("ArrayBuffer");function pa(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ln(t.buffer),e}const ya=pt("string"),M=pt("function"),Dn=pt("number"),yt=t=>t!==null&&typeof t=="object",ha=t=>t===!0||t===!1,Xe=t=>{if(dt(t)!=="object")return!1;const e=yr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ma=G("Date"),va=G("File"),ga=G("Blob"),ba=G("FileList"),wa=t=>yt(t)&&M(t.pipe),Sa=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||M(t.append)&&((e=dt(t))==="formdata"||e==="object"&&M(t.toString)&&t.toString()==="[object FormData]"))},Ea=G("URLSearchParams"),Oa=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Me(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,o;if(typeof t!="object"&&(t=[t]),_e(t))for(n=0,o=t.length;n0;)if(o=r[n],e===o.toLowerCase())return o;return null}const Bn=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Mn=t=>!De(t)&&t!==Bn;function Kt(){const{caseless:t}=Mn(this)&&this||{},e={},r=(n,o)=>{const a=t&&Fn(e,o)||o;Xe(e[a])&&Xe(n)?e[a]=Kt(e[a],n):Xe(n)?e[a]=Kt({},n):_e(n)?e[a]=n.slice():e[a]=n};for(let n=0,o=arguments.length;n(Me(e,(o,a)=>{r&&M(o)?t[a]=Nn(o,r):t[a]=o},{allOwnKeys:n}),t),xa=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Aa=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Pa=(t,e,r,n)=>{let o,a,i;const s={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),a=o.length;a-- >0;)i=o[a],(!n||n(i,t,e))&&!s[i]&&(e[i]=t[i],s[i]=!0);t=r!==!1&&yr(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Ra=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},Ia=t=>{if(!t)return null;if(_e(t))return t;let e=t.length;if(!Dn(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},$a=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&yr(Uint8Array)),Ca=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=n.next())&&!o.done;){const a=o.value;e.call(t,a[0],a[1])}},Ta=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Na=G("HTMLFormElement"),La=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Dr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Da=G("RegExp"),kn=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Me(r,(o,a)=>{let i;(i=e(o,a,t))!==!1&&(n[a]=i||o)}),Object.defineProperties(t,n)},Fa=t=>{kn(t,(e,r)=>{if(M(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(M(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Ba=(t,e)=>{const r={},n=o=>{o.forEach(a=>{r[a]=!0})};return _e(t)?n(t):n(String(t).split(e)),r},Ma=()=>{},ka=(t,e)=>(t=+t,Number.isFinite(t)?t:e),xt="abcdefghijklmnopqrstuvwxyz",Fr="0123456789",jn={DIGIT:Fr,ALPHA:xt,ALPHA_DIGIT:xt+xt.toUpperCase()+Fr},ja=(t=16,e=jn.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Ua(t){return!!(t&&M(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const za=t=>{const e=new Array(10),r=(n,o)=>{if(yt(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[o]=n;const a=_e(n)?[]:{};return Me(n,(i,s)=>{const c=r(i,o+1);!De(c)&&(a[s]=c)}),e[o]=void 0,a}}return n};return r(t,0)},Ha=G("AsyncFunction"),Va=t=>t&&(yt(t)||M(t))&&M(t.then)&&M(t.catch),p={isArray:_e,isArrayBuffer:Ln,isBuffer:da,isFormData:Sa,isArrayBufferView:pa,isString:ya,isNumber:Dn,isBoolean:ha,isObject:yt,isPlainObject:Xe,isUndefined:De,isDate:ma,isFile:va,isBlob:ga,isRegExp:Da,isFunction:M,isStream:wa,isURLSearchParams:Ea,isTypedArray:$a,isFileList:ba,forEach:Me,merge:Kt,extend:_a,trim:Oa,stripBOM:xa,inherits:Aa,toFlatObject:Pa,kindOf:dt,kindOfTest:G,endsWith:Ra,toArray:Ia,forEachEntry:Ca,matchAll:Ta,isHTMLForm:Na,hasOwnProperty:Dr,hasOwnProp:Dr,reduceDescriptors:kn,freezeMethods:Fa,toObjectSet:Ba,toCamelCase:La,noop:Ma,toFiniteNumber:ka,findKey:Fn,global:Bn,isContextDefined:Mn,ALPHABET:jn,generateString:ja,isSpecCompliantForm:Ua,toJSONObject:za,isAsyncFn:Ha,isThenable:Va};function E(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}p.inherits(E,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:p.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Un=E.prototype,zn={};["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(t=>{zn[t]={value:t}});Object.defineProperties(E,zn);Object.defineProperty(Un,"isAxiosError",{value:!0});E.from=(t,e,r,n,o,a)=>{const i=Object.create(Un);return p.toFlatObject(t,i,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),E.call(i,t.message,e,r,n,o),i.cause=t,i.name=t.name,a&&Object.assign(i,a),i};const Wa=null;function Gt(t){return p.isPlainObject(t)||p.isArray(t)}function Hn(t){return p.endsWith(t,"[]")?t.slice(0,-2):t}function Br(t,e,r){return t?t.concat(e).map(function(o,a){return o=Hn(o),!r&&a?"["+o+"]":o}).join(r?".":""):e}function qa(t){return p.isArray(t)&&!t.some(Gt)}const Ka=p.toFlatObject(p,{},null,function(e){return/^is[A-Z]/.test(e)});function ht(t,e,r){if(!p.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=p.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,b){return!p.isUndefined(b[h])});const n=r.metaTokens,o=r.visitor||l,a=r.dots,i=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&p.isSpecCompliantForm(e);if(!p.isFunction(o))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(p.isDate(y))return y.toISOString();if(!c&&p.isBlob(y))throw new E("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(y)||p.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function l(y,h,b){let v=y;if(y&&!b&&typeof y=="object"){if(p.endsWith(h,"{}"))h=n?h:h.slice(0,-2),y=JSON.stringify(y);else if(p.isArray(y)&&qa(y)||(p.isFileList(y)||p.endsWith(h,"[]"))&&(v=p.toArray(y)))return h=Hn(h),v.forEach(function(g,L){!(p.isUndefined(g)||g===null)&&e.append(i===!0?Br([h],L,a):i===null?h:h+"[]",f(g))}),!1}return Gt(y)?!0:(e.append(Br(b,h,a),f(y)),!1)}const u=[],d=Object.assign(Ka,{defaultVisitor:l,convertValue:f,isVisitable:Gt});function m(y,h){if(!p.isUndefined(y)){if(u.indexOf(y)!==-1)throw Error("Circular reference detected in "+h.join("."));u.push(y),p.forEach(y,function(v,O){(!(p.isUndefined(v)||v===null)&&o.call(e,v,p.isString(O)?O.trim():O,h,d))===!0&&m(v,h?h.concat(O):[O])}),u.pop()}}if(!p.isObject(t))throw new TypeError("data must be an object");return m(t),e}function Mr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function hr(t,e){this._pairs=[],t&&ht(t,this,e)}const Vn=hr.prototype;Vn.append=function(e,r){this._pairs.push([e,r])};Vn.toString=function(e){const r=e?function(n){return e.call(this,n,Mr)}:Mr;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Ga(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wn(t,e,r){if(!e)return t;const n=r&&r.encode||Ga,o=r&&r.serialize;let a;if(o?a=o(e,r):a=p.isURLSearchParams(e)?e.toString():new hr(e,r).toString(n),a){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class Ja{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){p.forEach(this.handlers,function(n){n!==null&&e(n)})}}const kr=Ja,qn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Qa=typeof URLSearchParams<"u"?URLSearchParams:hr,Ya=typeof FormData<"u"?FormData:null,Xa=typeof Blob<"u"?Blob:null,Za={isBrowser:!0,classes:{URLSearchParams:Qa,FormData:Ya,Blob:Xa},protocols:["http","https","file","blob","url","data"]},Kn=typeof window<"u"&&typeof document<"u",ei=(t=>Kn&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),ti=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ri=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Kn,hasStandardBrowserEnv:ei,hasStandardBrowserWebWorkerEnv:ti},Symbol.toStringTag,{value:"Module"})),K={...ri,...Za};function ni(t,e){return ht(t,new K.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,a){return K.isNode&&p.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function oi(t){return p.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ai(t){const e={},r=Object.keys(t);let n;const o=r.length;let a;for(n=0;n=r.length;return i=!i&&p.isArray(o)?o.length:i,c?(p.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!s):((!o[i]||!p.isObject(o[i]))&&(o[i]=[]),e(r,n,o[i],a)&&p.isArray(o[i])&&(o[i]=ai(o[i])),!s)}if(p.isFormData(t)&&p.isFunction(t.entries)){const r={};return p.forEachEntry(t,(n,o)=>{e(oi(n),o,r,0)}),r}return null}function ii(t,e,r){if(p.isString(t))try{return(e||JSON.parse)(t),p.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const mr={transitional:qn,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,a=p.isObject(e);if(a&&p.isHTMLForm(e)&&(e=new FormData(e)),p.isFormData(e))return o?JSON.stringify(Gn(e)):e;if(p.isArrayBuffer(e)||p.isBuffer(e)||p.isStream(e)||p.isFile(e)||p.isBlob(e))return e;if(p.isArrayBufferView(e))return e.buffer;if(p.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ni(e,this.formSerializer).toString();if((s=p.isFileList(e))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return ht(s?{"files[]":e}:e,c&&new c,this.formSerializer)}}return a||o?(r.setContentType("application/json",!1),ii(e)):e}],transformResponse:[function(e){const r=this.transitional||mr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(e&&p.isString(e)&&(n&&!this.responseType||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(s){if(i)throw s.name==="SyntaxError"?E.from(s,E.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:K.classes.FormData,Blob:K.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],t=>{mr.headers[t]={}});const vr=mr,si=p.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"]),ci=t=>{const e={};let r,n,o;return t&&t.split(` -`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||e[r]&&si[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},jr=Symbol("internals");function Ie(t){return t&&String(t).trim().toLowerCase()}function Ze(t){return t===!1||t==null?t:p.isArray(t)?t.map(Ze):String(t)}function li(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const ui=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function At(t,e,r,n,o){if(p.isFunction(n))return n.call(this,e,r);if(o&&(e=r),!!p.isString(e)){if(p.isString(n))return e.indexOf(n)!==-1;if(p.isRegExp(n))return n.test(e)}}function fi(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function di(t,e){const r=p.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(o,a,i){return this[n].call(this,e,o,a,i)},configurable:!0})})}class mt{constructor(e){e&&this.set(e)}set(e,r,n){const o=this;function a(s,c,f){const l=Ie(c);if(!l)throw new Error("header name must be a non-empty string");const u=p.findKey(o,l);(!u||o[u]===void 0||f===!0||f===void 0&&o[u]!==!1)&&(o[u||c]=Ze(s))}const i=(s,c)=>p.forEach(s,(f,l)=>a(f,l,c));return p.isPlainObject(e)||e instanceof this.constructor?i(e,r):p.isString(e)&&(e=e.trim())&&!ui(e)?i(ci(e),r):e!=null&&a(r,e,n),this}get(e,r){if(e=Ie(e),e){const n=p.findKey(this,e);if(n){const o=this[n];if(!r)return o;if(r===!0)return li(o);if(p.isFunction(r))return r.call(this,o,n);if(p.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=Ie(e),e){const n=p.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||At(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let o=!1;function a(i){if(i=Ie(i),i){const s=p.findKey(n,i);s&&(!r||At(n,n[s],s,r))&&(delete n[s],o=!0)}}return p.isArray(e)?e.forEach(a):a(e),o}clear(e){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const a=r[n];(!e||At(this,this[a],a,e,!0))&&(delete this[a],o=!0)}return o}normalize(e){const r=this,n={};return p.forEach(this,(o,a)=>{const i=p.findKey(n,a);if(i){r[i]=Ze(o),delete r[a];return}const s=e?fi(a):String(a).trim();s!==a&&delete r[a],r[s]=Ze(o),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return p.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=e&&p.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(o=>n.set(o)),n}static accessor(e){const n=(this[jr]=this[jr]={accessors:{}}).accessors,o=this.prototype;function a(i){const s=Ie(i);n[s]||(di(o,i),n[s]=!0)}return p.isArray(e)?e.forEach(a):a(e),this}}mt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(mt.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});p.freezeMethods(mt);const Y=mt;function Pt(t,e){const r=this||vr,n=e||r,o=Y.from(n.headers);let a=n.data;return p.forEach(t,function(s){a=s.call(r,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function Jn(t){return!!(t&&t.__CANCEL__)}function ke(t,e,r){E.call(this,t??"canceled",E.ERR_CANCELED,e,r),this.name="CanceledError"}p.inherits(ke,E,{__CANCEL__:!0});function pi(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new E("Request failed with status code "+r.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const yi=K.hasStandardBrowserEnv?{write(t,e,r,n,o,a){const i=[t+"="+encodeURIComponent(e)];p.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),p.isString(n)&&i.push("path="+n),p.isString(o)&&i.push("domain="+o),a===!0&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hi(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function mi(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Qn(t,e){return t&&!hi(e)?mi(t,e):e}const vi=K.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(a){let i=a;return e&&(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 s=p.isString(i)?o(i):i;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}();function gi(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function bi(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o=0,a=0,i;return e=e!==void 0?e:1e3,function(c){const f=Date.now(),l=n[a];i||(i=f),r[o]=c,n[o]=f;let u=a,d=0;for(;u!==o;)d+=r[u++],u=u%t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),f-i{const a=o.loaded,i=o.lengthComputable?o.total:void 0,s=a-r,c=n(s),f=a<=i;r=a;const l={loaded:a,total:i,progress:i?a/i:void 0,bytes:s,rate:c||void 0,estimated:c&&i&&f?(i-a)/c:void 0,event:o};l[e?"download":"upload"]=!0,t(l)}}const wi=typeof XMLHttpRequest<"u",Si=wi&&function(t){return new Promise(function(r,n){let o=t.data;const a=Y.from(t.headers).normalize();let{responseType:i,withXSRFToken:s}=t,c;function f(){t.cancelToken&&t.cancelToken.unsubscribe(c),t.signal&&t.signal.removeEventListener("abort",c)}let l;if(p.isFormData(o)){if(K.hasStandardBrowserEnv||K.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((l=a.getContentType())!==!1){const[h,...b]=l?l.split(";").map(v=>v.trim()).filter(Boolean):[];a.setContentType([h||"multipart/form-data",...b].join("; "))}}let u=new XMLHttpRequest;if(t.auth){const h=t.auth.username||"",b=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(h+":"+b))}const d=Qn(t.baseURL,t.url);u.open(t.method.toUpperCase(),Wn(d,t.params,t.paramsSerializer),!0),u.timeout=t.timeout;function m(){if(!u)return;const h=Y.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),v={data:!i||i==="text"||i==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:h,config:t,request:u};pi(function(g){r(g),f()},function(g){n(g),f()},v),u=null}if("onloadend"in u?u.onloadend=m:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(m)},u.onabort=function(){u&&(n(new E("Request aborted",E.ECONNABORTED,t,u)),u=null)},u.onerror=function(){n(new E("Network Error",E.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let b=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const v=t.transitional||qn;t.timeoutErrorMessage&&(b=t.timeoutErrorMessage),n(new E(b,v.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,t,u)),u=null},K.hasStandardBrowserEnv&&(s&&p.isFunction(s)&&(s=s(t)),s||s!==!1&&vi(d))){const h=t.xsrfHeaderName&&t.xsrfCookieName&&yi.read(t.xsrfCookieName);h&&a.set(t.xsrfHeaderName,h)}o===void 0&&a.setContentType(null),"setRequestHeader"in u&&p.forEach(a.toJSON(),function(b,v){u.setRequestHeader(v,b)}),p.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),i&&i!=="json"&&(u.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&u.addEventListener("progress",Ur(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Ur(t.onUploadProgress)),(t.cancelToken||t.signal)&&(c=h=>{u&&(n(!h||h.type?new ke(null,t,u):h),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(c),t.signal&&(t.signal.aborted?c():t.signal.addEventListener("abort",c)));const y=gi(d);if(y&&K.protocols.indexOf(y)===-1){n(new E("Unsupported protocol "+y+":",E.ERR_BAD_REQUEST,t));return}u.send(o||null)})},Jt={http:Wa,xhr:Si};p.forEach(Jt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const zr=t=>`- ${t}`,Ei=t=>p.isFunction(t)||t===null||t===!1,Yn={getAdapter:t=>{t=p.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let a=0;a`adapter ${s} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=e?a.length>1?`since : -`+a.map(zr).join(` -`):" "+zr(a[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n},adapters:Jt};function Rt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ke(null,t)}function Hr(t){return Rt(t),t.headers=Y.from(t.headers),t.data=Pt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Yn.getAdapter(t.adapter||vr.adapter)(t).then(function(n){return Rt(t),n.data=Pt.call(t,t.transformResponse,n),n.headers=Y.from(n.headers),n},function(n){return Jn(n)||(Rt(t),n&&n.response&&(n.response.data=Pt.call(t,t.transformResponse,n.response),n.response.headers=Y.from(n.response.headers))),Promise.reject(n)})}const Vr=t=>t instanceof Y?{...t}:t;function we(t,e){e=e||{};const r={};function n(f,l,u){return p.isPlainObject(f)&&p.isPlainObject(l)?p.merge.call({caseless:u},f,l):p.isPlainObject(l)?p.merge({},l):p.isArray(l)?l.slice():l}function o(f,l,u){if(p.isUndefined(l)){if(!p.isUndefined(f))return n(void 0,f,u)}else return n(f,l,u)}function a(f,l){if(!p.isUndefined(l))return n(void 0,l)}function i(f,l){if(p.isUndefined(l)){if(!p.isUndefined(f))return n(void 0,f)}else return n(void 0,l)}function s(f,l,u){if(u in e)return n(f,l);if(u in t)return n(void 0,f)}const c={url:a,method:a,data:a,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:s,headers:(f,l)=>o(Vr(f),Vr(l),!0)};return p.forEach(Object.keys(Object.assign({},t,e)),function(l){const u=c[l]||o,d=u(t[l],e[l],l);p.isUndefined(d)&&u!==s||(r[l]=d)}),r}const Xn="1.6.8",gr={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{gr[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Wr={};gr.transitional=function(e,r,n){function o(a,i){return"[Axios v"+Xn+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,s)=>{if(e===!1)throw new E(o(i," has been removed"+(r?" in "+r:"")),E.ERR_DEPRECATED);return r&&!Wr[i]&&(Wr[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,i,s):!0}};function Oi(t,e,r){if(typeof t!="object")throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const a=n[o],i=e[a];if(i){const s=t[a],c=s===void 0||i(s,a,t);if(c!==!0)throw new E("option "+a+" must be "+c,E.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new E("Unknown option "+a,E.ERR_BAD_OPTION)}}const Qt={assertOptions:Oi,validators:gr},re=Qt.validators;class nt{constructor(e){this.defaults=e,this.interceptors={request:new kr,response:new kr}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` -`+a):n.stack=a}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=we(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:a}=r;n!==void 0&&Qt.assertOptions(n,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Qt.assertOptions(o,{encode:re.function,serialize:re.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&p.merge(a.common,a[r.method]);a&&p.forEach(["delete","get","head","post","put","patch","common"],y=>{delete a[y]}),r.headers=Y.concat(i,a);const s=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(c=c&&h.synchronous,s.unshift(h.fulfilled,h.rejected))});const f=[];this.interceptors.response.forEach(function(h){f.push(h.fulfilled,h.rejected)});let l,u=0,d;if(!c){const y=[Hr.bind(this),void 0];for(y.unshift.apply(y,s),y.push.apply(y,f),d=y.length,l=Promise.resolve(r);u{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](o);n._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(s=>{n.subscribe(s),a=s}).then(o);return i.cancel=function(){n.unsubscribe(a)},i},e(function(a,i,s){n.reason||(n.reason=new ke(a,i,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new br(function(o){e=o}),cancel:e}}}const _i=br;function xi(t){return function(r){return t.apply(null,r)}}function Ai(t){return p.isObject(t)&&t.isAxiosError===!0}const Yt={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(Yt).forEach(([t,e])=>{Yt[e]=t});const Pi=Yt;function Zn(t){const e=new et(t),r=Nn(et.prototype.request,e);return p.extend(r,et.prototype,e,{allOwnKeys:!0}),p.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return Zn(we(t,o))},r}const P=Zn(vr);P.Axios=et;P.CanceledError=ke;P.CancelToken=_i;P.isCancel=Jn;P.VERSION=Xn;P.toFormData=ht;P.AxiosError=E;P.Cancel=P.CanceledError;P.all=function(e){return Promise.all(e)};P.spread=xi;P.isAxiosError=Ai;P.mergeConfig=we;P.AxiosHeaders=Y;P.formToJSON=t=>Gn(p.isHTMLForm(t)?new FormData(t):t);P.getAdapter=Yn.getAdapter;P.HttpStatusCode=Pi;P.default=P;const eo=P;var Ri=Error,Ii=EvalError,$i=RangeError,Ci=ReferenceError,to=SyntaxError,je=TypeError,Ti=URIError,Ni=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(e,r);if(i.value!==o||i.enumerable!==!0)return!1}return!0},qr=typeof Symbol<"u"&&Symbol,Li=Ni,Di=function(){return typeof qr!="function"||typeof Symbol!="function"||typeof qr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Li()},It={__proto__:null,foo:{}},Fi=Object,Bi=function(){return{__proto__:It}.foo===It.foo&&!(It instanceof Fi)},Mi="Function.prototype.bind called on incompatible ",ki=Object.prototype.toString,ji=Math.max,Ui="[object Function]",Kr=function(e,r){for(var n=[],o=0;o"u"||!I?S:I(Uint8Array),le={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?S:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?S:ArrayBuffer,"%ArrayIteratorPrototype%":he&&I?I([][Symbol.iterator]()):S,"%AsyncFromSyncIteratorPrototype%":S,"%AsyncFunction%":ve,"%AsyncGenerator%":ve,"%AsyncGeneratorFunction%":ve,"%AsyncIteratorPrototype%":ve,"%Atomics%":typeof Atomics>"u"?S:Atomics,"%BigInt%":typeof BigInt>"u"?S:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?S:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?S:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?S:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Qi,"%eval%":eval,"%EvalError%":Yi,"%Float32Array%":typeof Float32Array>"u"?S:Float32Array,"%Float64Array%":typeof Float64Array>"u"?S:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?S:FinalizationRegistry,"%Function%":ro,"%GeneratorFunction%":ve,"%Int8Array%":typeof Int8Array>"u"?S:Int8Array,"%Int16Array%":typeof Int16Array>"u"?S:Int16Array,"%Int32Array%":typeof Int32Array>"u"?S:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":he&&I?I(I([][Symbol.iterator]())):S,"%JSON%":typeof JSON=="object"?JSON:S,"%Map%":typeof Map>"u"?S:Map,"%MapIteratorPrototype%":typeof Map>"u"||!he||!I?S:I(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?S:Promise,"%Proxy%":typeof Proxy>"u"?S:Proxy,"%RangeError%":Xi,"%ReferenceError%":Zi,"%Reflect%":typeof Reflect>"u"?S:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?S:Set,"%SetIteratorPrototype%":typeof Set>"u"||!he||!I?S:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?S:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":he&&I?I(""[Symbol.iterator]()):S,"%Symbol%":he?Symbol:S,"%SyntaxError%":Se,"%ThrowTypeError%":ts,"%TypedArray%":ns,"%TypeError%":be,"%Uint8Array%":typeof Uint8Array>"u"?S:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?S:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?S:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?S:Uint32Array,"%URIError%":es,"%WeakMap%":typeof WeakMap>"u"?S:WeakMap,"%WeakRef%":typeof WeakRef>"u"?S:WeakRef,"%WeakSet%":typeof WeakSet>"u"?S:WeakSet};if(I)try{null.error}catch(t){var os=I(I(t));le["%Error.prototype%"]=os}var as=function t(e){var r;if(e==="%AsyncFunction%")r=$t("async function () {}");else if(e==="%GeneratorFunction%")r=$t("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=$t("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&I&&(r=I(o.prototype))}return le[e]=r,r},Gr={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ue=wr,ot=Ji,is=Ue.call(Function.call,Array.prototype.concat),ss=Ue.call(Function.apply,Array.prototype.splice),Jr=Ue.call(Function.call,String.prototype.replace),at=Ue.call(Function.call,String.prototype.slice),cs=Ue.call(Function.call,RegExp.prototype.exec),ls=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,us=/\\(\\)?/g,fs=function(e){var r=at(e,0,1),n=at(e,-1);if(r==="%"&&n!=="%")throw new Se("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Se("invalid intrinsic syntax, expected opening `%`");var o=[];return Jr(e,ls,function(a,i,s,c){o[o.length]=s?Jr(c,us,"$1"):i||a}),o},ds=function(e,r){var n=e,o;if(ot(Gr,n)&&(o=Gr[n],n="%"+o[0]+"%"),ot(le,n)){var a=le[n];if(a===ve&&(a=as(n)),typeof a>"u"&&!r)throw new be("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new Se("intrinsic "+e+" does not exist!")},xe=function(e,r){if(typeof e!="string"||e.length===0)throw new be("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new be('"allowMissing" argument must be a boolean');if(cs(/^%?[^%]*%?$/,e)===null)throw new Se("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=fs(e),o=n.length>0?n[0]:"",a=ds("%"+o+"%",r),i=a.name,s=a.value,c=!1,f=a.alias;f&&(o=f[0],ss(n,is([0,1],f)));for(var l=1,u=!0;l=n.length){var h=ce(s,d);u=!!h,u&&"get"in h&&!("originalValue"in h.get)?s=h.get:s=s[d]}else u=ot(s,d),s=s[d];u&&!c&&(le[i]=s)}}return s},no={exports:{}},Tt,Qr;function Sr(){if(Qr)return Tt;Qr=1;var t=xe,e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Tt=e,Tt}var ps=xe,tt=ps("%Object.getOwnPropertyDescriptor%",!0);if(tt)try{tt([],"length")}catch{tt=null}var oo=tt,Yr=Sr(),ys=to,me=je,Xr=oo,hs=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new me("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new me("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new me("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new me("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new me("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new me("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,c=!!Xr&&Xr(e,r);if(Yr)Yr(e,r,{configurable:i===null&&c?c.configurable:!i,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:a===null&&c?c.writable:!a});else if(s||!o&&!a&&!i)e[r]=n;else throw new ys("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Xt=Sr(),ao=function(){return!!Xt};ao.hasArrayLengthDefineBug=function(){if(!Xt)return null;try{return Xt([],"length",{value:1}).length!==1}catch{return!0}};var ms=ao,vs=xe,Zr=hs,gs=ms(),en=oo,tn=je,bs=vs("%Math.floor%"),ws=function(e,r){if(typeof e!="function")throw new tn("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||bs(r)!==r)throw new tn("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in e&&en){var i=en(e,"length");i&&!i.configurable&&(o=!1),i&&!i.writable&&(a=!1)}return(o||a||!n)&&(gs?Zr(e,"length",r,!0,!0):Zr(e,"length",r)),e};(function(t){var e=wr,r=xe,n=ws,o=je,a=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(i,a),c=Sr(),f=r("%Math.max%");t.exports=function(d){if(typeof d!="function")throw new o("a function is required");var m=s(e,i,arguments);return n(m,1+f(0,d.length-(arguments.length-1)),!0)};var l=function(){return s(e,a,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l})(no);var Ss=no.exports,io=xe,so=Ss,Es=so(io("String.prototype.indexOf")),Os=function(e,r){var n=io(e,!!r);return typeof n=="function"&&Es(e,".prototype.")>-1?so(n):n};const _s={},xs=Object.freeze(Object.defineProperty({__proto__:null,default:_s},Symbol.toStringTag,{value:"Module"})),As=jo(xs);var Er=typeof Map=="function"&&Map.prototype,Nt=Object.getOwnPropertyDescriptor&&Er?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,it=Er&&Nt&&typeof Nt.get=="function"?Nt.get:null,rn=Er&&Map.prototype.forEach,Or=typeof Set=="function"&&Set.prototype,Lt=Object.getOwnPropertyDescriptor&&Or?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,st=Or&&Lt&&typeof Lt.get=="function"?Lt.get:null,nn=Or&&Set.prototype.forEach,Ps=typeof WeakMap=="function"&&WeakMap.prototype,Te=Ps?WeakMap.prototype.has:null,Rs=typeof WeakSet=="function"&&WeakSet.prototype,Ne=Rs?WeakSet.prototype.has:null,Is=typeof WeakRef=="function"&&WeakRef.prototype,on=Is?WeakRef.prototype.deref:null,$s=Boolean.prototype.valueOf,Cs=Object.prototype.toString,Ts=Function.prototype.toString,Ns=String.prototype.match,_r=String.prototype.slice,ae=String.prototype.replace,Ls=String.prototype.toUpperCase,an=String.prototype.toLowerCase,co=RegExp.prototype.test,sn=Array.prototype.concat,q=Array.prototype.join,Ds=Array.prototype.slice,cn=Math.floor,Zt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Dt=Object.getOwnPropertySymbols,er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="object",C=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ee||"symbol")?Symbol.toStringTag:null,lo=Object.prototype.propertyIsEnumerable,ln=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function un(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||co.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-cn(-t):cn(t);if(n!==t){var o=String(n),a=_r.call(e,o.length+1);return ae.call(o,r,"$&_")+"."+ae.call(ae.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ae.call(e,r,"$&_")}var tr=As,fn=tr.custom,dn=fo(fn)?fn:null,Fs=function t(e,r,n,o){var a=r||{};if(ne(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ne(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=ne(a,"customInspect")?a.customInspect:!0;if(typeof i!="boolean"&&i!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ne(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ne(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return yo(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return s?un(e,c):c}if(typeof e=="bigint"){var f=String(e)+"n";return s?un(e,f):f}var l=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return rr(e)?"[Array]":"[Object]";var u=ec(a,n);if(typeof o>"u")o=[];else if(po(o,e)>=0)return"[Circular]";function d(U,ee,te){if(ee&&(o=Ds.call(o),o.push(ee)),te){var Re={depth:a.depth};return ne(a,"quoteStyle")&&(Re.quoteStyle=a.quoteStyle),t(U,Re,n+1,o)}return t(U,a,n+1,o)}if(typeof e=="function"&&!pn(e)){var m=Ws(e),y=Ve(e,d);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(y.length>0?" { "+q.call(y,", ")+" }":"")}if(fo(e)){var h=Ee?ae.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):er.call(e);return typeof e=="object"&&!Ee?$e(h):h}if(Ys(e)){for(var b="<"+an.call(String(e.nodeName)),v=e.attributes||[],O=0;O",b}if(rr(e)){if(e.length===0)return"[]";var g=Ve(e,d);return u&&!Zs(g)?"["+nr(g,u)+"]":"[ "+q.call(g,", ")+" ]"}if(ks(e)){var L=Ve(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!lo.call(e,"cause")?"{ ["+String(e)+"] "+q.call(sn.call("[cause]: "+d(e.cause),L),", ")+" }":L.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+q.call(L,", ")+" }"}if(typeof e=="object"&&i){if(dn&&typeof e[dn]=="function"&&tr)return tr(e,{depth:l-n});if(i!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(qs(e)){var z=[];return rn&&rn.call(e,function(U,ee){z.push(d(ee,e,!0)+" => "+d(U,e))}),yn("Map",it.call(e),z,u)}if(Js(e)){var N=[];return nn&&nn.call(e,function(U){N.push(d(U,e))}),yn("Set",st.call(e),N,u)}if(Ks(e))return Ft("WeakMap");if(Qs(e))return Ft("WeakSet");if(Gs(e))return Ft("WeakRef");if(Us(e))return $e(d(Number(e)));if(Hs(e))return $e(d(Zt.call(e)));if(zs(e))return $e($s.call(e));if(js(e))return $e(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===Uo)return"{ [object globalThis] }";if(!Ms(e)&&!pn(e)){var k=Ve(e,d),J=ln?ln(e)===Object.prototype:e instanceof Object||e.constructor===Object,B=e instanceof Object?"":"null prototype",j=!J&&C&&Object(e)===e&&C in e?_r.call(ie(e),8,-1):B?"Object":"",Z=J||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",pe=Z+(j||B?"["+q.call(sn.call([],j||[],B||[]),": ")+"] ":"");return k.length===0?pe+"{}":u?pe+"{"+nr(k,u)+"}":pe+"{ "+q.call(k,", ")+" }"}return String(e)};function uo(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Bs(t){return ae.call(String(t),/"/g,""")}function rr(t){return ie(t)==="[object Array]"&&(!C||!(typeof t=="object"&&C in t))}function Ms(t){return ie(t)==="[object Date]"&&(!C||!(typeof t=="object"&&C in t))}function pn(t){return ie(t)==="[object RegExp]"&&(!C||!(typeof t=="object"&&C in t))}function ks(t){return ie(t)==="[object Error]"&&(!C||!(typeof t=="object"&&C in t))}function js(t){return ie(t)==="[object String]"&&(!C||!(typeof t=="object"&&C in t))}function Us(t){return ie(t)==="[object Number]"&&(!C||!(typeof t=="object"&&C in t))}function zs(t){return ie(t)==="[object Boolean]"&&(!C||!(typeof t=="object"&&C in t))}function fo(t){if(Ee)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!er)return!1;try{return er.call(t),!0}catch{}return!1}function Hs(t){if(!t||typeof t!="object"||!Zt)return!1;try{return Zt.call(t),!0}catch{}return!1}var Vs=Object.prototype.hasOwnProperty||function(t){return t in this};function ne(t,e){return Vs.call(t,e)}function ie(t){return Cs.call(t)}function Ws(t){if(t.name)return t.name;var e=Ns.call(Ts.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function po(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return yo(_r.call(t,0,e.maxStringLength),e)+n}var o=ae.call(ae.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Xs);return uo(o,"single",e)}function Xs(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Ls.call(e.toString(16))}function $e(t){return"Object("+t+")"}function Ft(t){return t+" { ? }"}function yn(t,e,r,n){var o=n?nr(r,n):q.call(r,", ");return t+" ("+e+") {"+o+"}"}function Zs(t){for(var e=0;e=0)return!1;return!0}function ec(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=q.call(Array(t.indent+1)," ");else return null;return{base:r,prev:q.call(Array(e+1),r)}}function nr(t,e){if(t.length===0)return"";var r=` -`+e.prev+e.base;return r+q.call(t,","+r)+` -`+e.prev}function Ve(t,e){var r=rr(t),n=[];if(r){n.length=t.length;for(var o=0;o1;){var r=e.pop(),n=r.obj[r.prop];if(se(n)){for(var o=[],a=0;a=kt?i.slice(c,c+kt):i,l=[],u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||a===hc.RFC1738&&(d===40||d===41)){l[l.length]=f.charAt(u);continue}if(d<128){l[l.length]=V[d];continue}if(d<2048){l[l.length]=V[192|d>>6]+V[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=V[224|d>>12]+V[128|d>>6&63]+V[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|f.charCodeAt(u)&1023),l[l.length]=V[240|d>>18]+V[128|d>>12&63]+V[128|d>>6&63]+V[128|d&63]}s+=l.join("")}return s},Sc=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o"u"&&(z=0)}if(typeof l=="function"?g=l(r,g):g instanceof Date?g=m(g):n==="comma"&&W(g)&&(g=rt.maybeMap(g,function(Ot){return Ot instanceof Date?m(Ot):Ot})),g===null){if(i)return f&&!b?f(r,R.encoder,v,"key",y):r;g=""}if(Ic(g)||rt.isBuffer(g)){if(f){var J=b?r:f(r,R.encoder,v,"key",y);return[h(J)+"="+h(f(g,R.encoder,v,"value",y))]}return[h(r)+"="+h(String(g))]}var B=[];if(typeof g>"u")return B;var j;if(n==="comma"&&W(g))b&&f&&(g=rt.maybeMap(g,f)),j=[{value:g.length>0?g.join(",")||null:void 0}];else if(W(l))j=l;else{var Z=Object.keys(g);j=u?Z.sort(u):Z}var pe=c?r.replace(/\./g,"%2E"):r,U=o&&W(g)&&g.length===1?pe+"[]":pe;if(a&&W(g)&&g.length===0)return U+"[]";for(var ee=0;ee"u"?e.encodeDotInKeys===!0?!0:R.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:R.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:R.allowEmptyArrays,arrayFormat:i,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:R.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?R.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:R.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:R.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:R.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:R.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:R.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:R.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:R.strictNullHandling}},Tc=function(t,e){var r=t,n=Cc(e),o,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):W(n.filter)&&(a=n.filter,o=a);var i=[];if(typeof r!="object"||r===null)return"";var s=bo[n.arrayFormat],c=s==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var f=go(),l=0;l0?m+d:""},Oe=vo,or=Object.prototype.hasOwnProperty,Nc=Array.isArray,A={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Oe.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Lc=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},So=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Dc="utf8=%26%2310003%3B",Fc="utf8=%E2%9C%93",Bc=function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=r.parameterLimit===1/0?void 0:r.parameterLimit,i=o.split(r.delimiter,a),s=-1,c,f=r.charset;if(r.charsetSentinel)for(c=0;c-1&&(y=Nc(y)?[y]:y);var h=or.call(n,m);h&&r.duplicates==="combine"?n[m]=Oe.combine(n[m],y):(!h||r.duplicates==="last")&&(n[m]=y)}return n},Mc=function(t,e,r,n){for(var o=n?e:So(e,r),a=t.length-1;a>=0;--a){var i,s=t[a];if(s==="[]"&&r.parseArrays)i=r.allowEmptyArrays&&o===""?[]:[].concat(o);else{i=r.plainObjects?Object.create(null):{};var c=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,f=r.decodeDotInKeys?c.replace(/%2E/g,"."):c,l=parseInt(f,10);!r.parseArrays&&f===""?i={0:o}:!isNaN(l)&&s!==f&&String(l)===f&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(i=[],i[l]=o):f!=="__proto__"&&(i[f]=o)}o=i}return o},kc=function(e,r,n,o){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&i.exec(a),f=c?a.slice(0,c.index):a,l=[];if(f){if(!n.plainObjects&&or.call(Object.prototype,f)&&!n.allowPrototypes)return;l.push(f)}for(var u=0;n.depth>0&&(c=s.exec(a))!==null&&u"u"?A.charset:e.charset,n=typeof e.duplicates>"u"?A.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:A.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:A.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:A.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:A.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:A.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:A.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:A.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:A.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:A.decoder,delimiter:typeof e.delimiter=="string"||Oe.isRegExp(e.delimiter)?e.delimiter:A.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:A.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:A.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:A.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:A.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:A.strictNullHandling}},Uc=function(t,e){var r=jc(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Bc(t,r):t,o=r.plainObjects?Object.create(null):{},a=Object.keys(n),i=0;it.split(",").map((e,r)=>{e=e.trim();const n=e.replace(/([&*]|\+\+)/g,""),o=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return ir(n,o,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Array.isArray(o),r===0)});function Jc(t,e,r,n){const o=t.db.createObjectStore(e,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach(a=>ar(o,a)),o}function ar(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})}function ir(t,e,r,n,o,a,i){return{name:t,keyPath:e,unique:r,multi:n,auto:o,compound:a,src:(r&&!i?"&":"")+(n?"*":"")+(o?"++":"")+Eo(e)}}function Oo(t,e,r){return{name:t,primKey:e,indexes:r,mappedClass:null,idxByName:Qc(r,n=>[n.name,n])}}function _o(t,e){const r={};return[...t.objectStoreNames].forEach(o=>{const a=e.objectStore(o);let i=a.keyPath;const s=ir(Eo(i),i||"",!1,!1,!!a.autoIncrement,i&&typeof i!="string",!0),c=[];for(let l=0;l0||s.add.length>0||s.change.length>0)&&n.change.push(s)}}}return n}function Qc(t,e){return t.reduce((r,n,o)=>{var a=e(n,o);return a&&(r[a[0]]=a[1]),r},{})}function mn(t,e,r,n){const o=_o(e,r),a={};return Object.keys(t).forEach(s=>{const[c,...f]=Gc(t[s]);a[s]=Oo(s,c,f)}),xo(o,a,n)}function Yc(t,e,r){t.add.forEach(n=>{Jc(r,n[0],n[1].primKey,n[1].indexes)}),t.change.forEach(n=>{if(n.recreate)throw"Not yet support for changing primary key";{const o=r.objectStore(n.name);n.add.forEach(a=>ar(o,a)),n.change.forEach(a=>{o.deleteIndex(a.name),ar(o,a)}),n.del.forEach(a=>o.deleteIndex(a))}}),t.del.forEach(n=>{e.deleteObjectStore(n)})}function Xc(t){const e=new Map;return{idbOpen:async(o,{store:a,incrementalUpdate:i}={})=>{if(!o||typeof o!="string")return Promise.reject(new TypeError("dbName must be a string"));let s=e.get(o);if(s)try{return await l(await s)}catch(d){if(e.delete(o),!(d instanceof Error&&Object.prototype.toString.call(d)==="[object DOMException]"&&d.message.indexOf("The database connection is closing.")!==-1))return Promise.reject(d)}let c=u();return e.set(o,c),c.catch(()=>{c===e.get(o)&&e.delete(o)}),c;function f(d,m){const y=function(h){var v,O,g;const b=mn(h,d,m,i);return!((v=b.add)!=null&&v.length||(O=b.change)!=null&&O.length||(g=b.del)!=null&&g.length)};switch(typeof a){case"string":{const[h,b]=a.split("|");return y({[h]:b||"++"})}case"function":try{return typeof a.call(this,d,m)!="function"}catch(h){throw h}case"object":if(a)return y(a);default:return!0}}function l(d){if(f(d,d.objectStoreNames.length?d.transaction([...d.objectStoreNames],"readonly"):void 0))return Promise.resolve(d);{let m=d.version+1;return u(m)}}function u(d){return new Promise((m,y)=>{let h=t.indexedDB.open(o,d);h.onerror=function(b){y(this.error)},h.onupgradeneeded=function(b){var g,L,z;const v=this.result,O=this.transaction;try{switch(typeof a){case"function":{const N=()=>a.call(this,v,O),k=()=>_o(v,O);let J,B=k();for(;typeof(J=N())=="function";){J.call(this,v,O,b);const j=k(),Z=xo(B,j,!1);if(B=j,!((g=Z.add)!=null&&g.length||(L=Z.change)!=null&&L.length||(z=Z.del)!=null&&z.length))throw new Error('Parameter "store" contradicts "upgradeneeded"')}break}case"string":case"object":{let N;if(typeof a=="string"){const[J,B]=a.split("|");N={[J]:B||"++"}}else N=a;const k=mn(N,v,O,i);Yc(k,v,O);break}default:if(!f.call(this,v,O))throw new TypeError('Missing or wrong type of "upgradeneeded" parameter')}}catch(N){console.error(N),O.abort(),v.close(),y(N)}},h.onsuccess=function(b){const v=this.result;v.onversionchange=function(){v.close(),e.delete(o)},v.onclose=function(){e.delete(o)},e.set(o,v);try{m(l(v))}catch(O){y(O)}},h.onblocked=function(b){var O;let v=e.get(o);v&&((O=v==null?void 0:v.close)==null||O.call(v))}})}},idbDelete:o=>new Promise((a,i)=>{let s=t.indexedDB.deleteDatabase(o);s.onerror=function(c){i(this.error)},s.onsuccess=function(c){a(null)}})}}const Zc=Xc(window),{idbOpen:Ao,idbDelete:ju}=Zc,el=(t,e)=>e.some(r=>t instanceof r);let vn,gn;function tl(){return vn||(vn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function rl(){return gn||(gn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Po=new WeakMap,sr=new WeakMap,Ro=new WeakMap,Ut=new WeakMap,Pr=new WeakMap;function nl(t){const e=new Promise((r,n)=>{const o=()=>{t.removeEventListener("success",a),t.removeEventListener("error",i)},a=()=>{r(X(t.result)),o()},i=()=>{n(t.error),o()};t.addEventListener("success",a),t.addEventListener("error",i)});return e.then(r=>{r instanceof IDBCursor&&Po.set(r,t)}).catch(()=>{}),Pr.set(e,t),e}function ol(t){if(sr.has(t))return;const e=new Promise((r,n)=>{const o=()=>{t.removeEventListener("complete",a),t.removeEventListener("error",i),t.removeEventListener("abort",i)},a=()=>{r(),o()},i=()=>{n(t.error||new DOMException("AbortError","AbortError")),o()};t.addEventListener("complete",a),t.addEventListener("error",i),t.addEventListener("abort",i)});sr.set(t,e)}let cr={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return sr.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Ro.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return X(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function al(t){cr=t(cr)}function il(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(zt(this),e,...r);return Ro.set(n,e.sort?e.sort():[e]),X(n)}:rl().includes(t)?function(...e){return t.apply(zt(this),e),X(Po.get(this))}:function(...e){return X(t.apply(zt(this),e))}}function sl(t){return typeof t=="function"?il(t):(t instanceof IDBTransaction&&ol(t),el(t,tl())?new Proxy(t,cr):t)}function X(t){if(t instanceof IDBRequest)return nl(t);if(Ut.has(t))return Ut.get(t);const e=sl(t);return e!==t&&(Ut.set(t,e),Pr.set(e,t)),e}const zt=t=>Pr.get(t);function cl(t,e,{blocked:r,upgrade:n,blocking:o,terminated:a}={}){const i=indexedDB.open(t,e),s=X(i);return n&&i.addEventListener("upgradeneeded",c=>{n(X(i.result),c.oldVersion,c.newVersion,X(i.transaction),c)}),r&&i.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),s.then(c=>{a&&c.addEventListener("close",()=>a()),o&&c.addEventListener("versionchange",f=>o(f.oldVersion,f.newVersion,f))}).catch(()=>{}),s}const ll=["get","getKey","getAll","getAllKeys","count"],ul=["put","add","delete","clear"],Ht=new Map;function bn(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Ht.get(e))return Ht.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,o=ul.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||ll.includes(r)))return;const a=async function(i,...s){const c=this.transaction(i,o?"readwrite":"readonly");let f=c.store;return n&&(f=f.index(s.shift())),(await Promise.all([f[r](...s),o&&c.done]))[0]};return Ht.set(e,a),a}al(t=>({...t,get:(e,r,n)=>bn(e,r)||t.get(e,r,n),has:(e,r)=>!!bn(e,r)||t.has(e,r)}));const lr="GOST-UI",Rr=async t=>X(await Ao(lr,{store:t})),fl=async t=>{const e=await Ao(lr),r=e.version+1;e.close(),cl(lr,r,{upgrade:(n,o,a,i,s)=>{t(i)}})},oe="localCache",Ce="savedServer";class F{constructor(e){H(this,"dsName",oe);H(this,"type");H(this,"_getIdb",()=>Rr(`${this.dsName}|++_id_,_key_,_type_,[_type_+_key_],[name+_type_+_key_]`));H(this,"_getTransaction",async()=>{const r=(await this._getIdb()).transaction(this.dsName,"readwrite"),n=r.objectStore(this.dsName);return{transaction:r,store:n}});H(this,"getList",async()=>(await this._getIdb()).getAllFromIndex(this.dsName,"[_type_+_key_]",IDBKeyRange.only([this.type,this.key])));H(this,"get",async e=>(await this._getIdb()).getFromIndex(this.dsName,"[name+_type_+_key_]",IDBKeyRange.only([e,this.type,this.key])));H(this,"add",async e=>{await(await this._getIdb()).add(this.dsName,{...e,_key_:this.key,_type_:this.type})});H(this,"put",async(e,r)=>{if(r._id_)await(await this._getIdb()).put(this.dsName,r);else{const{transaction:n,store:o}=await this._getTransaction(),a=await o.index("[name+_type_+_key_]").get(IDBKeyRange.only([e,this.type,this.key]));return r._id_=a._id_,await o.put({...a,...r,_id_:a._id_}),n.done}});H(this,"delete",async e=>{const{transaction:r,store:n}=await this._getTransaction(),o=await n.index("[name+_type_+_key_]").get(IDBKeyRange.only([e,this.type,this.key]));return await n.delete(o._id_),r.done});this.type=e}get key(){var e;return(e=Io())==null?void 0:e.addr}}const dl=new F("admissions"),pl=new F("authers"),yl=new F("bypasses"),hl=new F("chains"),ml=new F("climiters"),vl=new F("limiters"),gl=new F("rlimiters"),bl=new F("hops"),wl=new F("hosts"),Sl=new F("ingresses"),El=new F("resolvers"),Ol=new F("services");class Pe{static _getIdb(){return Rr({[Ce]:"addr",[oe]:"++_id_,_key_"})}static async getAllServer(){return(await this._getIdb()).getAll(Ce)}static async getServer(e){return(await this._getIdb()).get(Ce,e)}static async setServer(e){await(await this._getIdb()).put(Ce,e)}static async deleteServer(e,r=!1){await(await this._getIdb()).delete(Ce,e),r&&await this.deleteCacheConfig(e)}static async deleteCacheConfig(e){const o=await(await this._getIdb()).transaction([oe],"readwrite").objectStore(oe),a=await o.index("_key_").getAllKeys(IDBKeyRange.only(e));await o.delete(a)}static async getAllCacheConfig(e){const r=await this._getIdb();return e?r.getAllFromIndex(oe,"_key_",IDBKeyRange.only(e)):r.getAll(oe)}}const _l=async()=>{const t=await Rr(`${oe}|++_id_`),e=t.objectStoreNames,r=/^services-/,n="services",o=[...e].filter(i=>r.test(i)),a=t.transaction(e,"readwrite");for(const i of o){const s=await a.objectStore(i).getAll();let c=decodeURIComponent(i.replace(/^services-/,""));/^(https?:)?\/\//.test(c)?/^\/\//.test(c)&&(c=`${location.protocol}`+c):c=`${location.protocol}//`+c,s.length>0&&await s.map(f=>a.objectStore(oe).add({...f,_type_:n,_key_:c})),await a.objectStore(i).clear()}return await a.done,o.length&&fl(i=>{const s=[...i.objectStoreNames],c=/^services-/;[...s.filter(l=>c.test(l)),"services","localConfigStore"].forEach(l=>{s.includes(l)&&i.db.deleteObjectStore(l)})}),o.length>0},Uu=Object.freeze(Object.defineProperty({__proto__:null,GostCommit:F,ServerComm:Pe,admissions:dl,authers:pl,bypasses:yl,chains:hl,climiters:ml,fixOldCacheConfig:_l,hops:bl,hosts:wl,ingresses:Sl,limiters:vl,resolvers:El,rlimiters:gl,services:Ol},Symbol.toStringTag,{value:"Module"})),ue="__GOST_SERVER__",Ke="__USE_SERVER__",Vt="__SETTINGS__",fe=ft();Object.defineProperty(window,ue,{get:fe.get,set:fe.set});const Ge=ft(),Je=ft(),ur=ft(()=>{const t=localStorage.getItem(Vt)||"{}";try{return JSON.parse(t)}catch(e){return console.error(e),{}}},t=>{t==null&&localStorage.removeItem(Vt),localStorage.setItem(Vt,JSON.stringify(t))}),Io=()=>fe.get(),xl=async()=>{if(window[ue])return!0;const t=qc.parse(location.search,{ignoreQueryPrefix:!0});t.use&&(window[Ke]=t.use,window.history.replaceState(null,"",location.pathname),$o());const e=sessionStorage.getItem(ue);if(e){const r=JSON.parse(e);return await fr(r),!0}if(window[Ke]){const r=await Pl(window[Ke]);r&&(r.isLocal=!0,await fr(r),r&&(r.time=Date.now(),Co(window[Ke],r)))}},Al=async t=>{const e=t.addr.replace(/\/+$/,"");return eo.get(e+"/config",{auth:t.auth}).catch(r=>{throw"verify error"})},fr=async(t,e)=>{try{await Al(t),window[ue]=t,window.sessionStorage.setItem(ue,JSON.stringify(t)),e&&(t.isLocal=!0,window[ue]=t,await Co(t.addr,t))}catch(r){throw r==="verify error"&&($o(),Wt.error((r==null?void 0:r.message)||"连接失败")),r}},$o=async()=>{fe.set(null),window.sessionStorage.removeItem(ue)},Co=async(t,e)=>Pe.setServer({...e,isLocal:!0,time:Date.now()}),Pl=async t=>Pe.getServer(t),Rl=async t=>Pe.deleteServer(t),Il=async()=>Pe.getAllServer(),de=eo.create();de.interceptors.request.use(t=>{const e=Io();return t.baseURL=e==null?void 0:e.addr,t.auth=e==null?void 0:e.auth,t});de.interceptors.response.use(t=>{var e;return t.config.method!=="get"&&!((e=t.config)!=null&&e.noMsg)&&Wt.success("操作成功!"),t.data?t.data:t},t=>{var n,o;const{response:e}=t||{};let r=t.message||"出现未知错误!";throw(n=e==null?void 0:e.data)!=null&&n.msg&&(r=(o=e==null?void 0:e.data)==null?void 0:o.msg),Wt.error(r),t});const $={config:"/config",admissions:"/config/admissions",authers:"/config/authers",bypasses:"/config/bypasses",chains:"/config/chains",climiters:"/config/climiters",limiters:"/config/limiters",rlimiters:"/config/rlimiters",hops:"/config/hops",hosts:"/config/hosts",ingresses:"/config/ingresses",observers:"/config/observers",resolvers:"/config/resolvers",sds:"/config/sds",services:"/config/services"},T=t=>({post:e=>de.post(t,e),put:(e,r)=>de.put(`${t}/${e}`,r),delete:e=>de.delete(`${t}/${e}`)}),$l=T($.admissions),Cl=T($.authers),Tl=T($.bypasses),Nl=T($.chains),Ll=T($.climiters),Dl=T($.limiters),Fl=T($.rlimiters),Bl=T($.hops),Ml=T($.hosts),kl=T($.ingresses),jl=T($.resolvers),Ul=T($.services),zl=T($.sds),Hl=T($.observers),dr=t=>de.get($.config),Vl=(t="json",e)=>de.post($.config,null,{params:{format:t,path:e},noMsg:!0}),zu=Object.freeze(Object.defineProperty({__proto__:null,admissions:$l,apis:$,authers:Cl,bypasses:Tl,chains:Nl,climiters:Ll,getConfig:dr,getRESTfulApi:T,hops:Bl,hosts:Ml,ingresses:kl,limiters:Dl,observers:Hl,resolvers:jl,rlimiters:Fl,saveCofnig:Vl,sds:zl,services:Ul},Symbol.toStringTag,{value:"Module"}));var Wl={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"};const ql=Wl;var Kl=function(e,r){return _.createElement(Fe,Be({},e,{ref:r,icon:ql}))},Gl=_.forwardRef(Kl);const Jl=Gl;var Ql={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"};const Yl=Ql;var Xl=function(e,r){return _.createElement(Fe,Be({},e,{ref:r,icon:Yl}))},Zl=_.forwardRef(Xl);const eu=Zl;var tu={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z"}}]},name:"moon",theme:"outlined"};const ru=tu;var nu=function(e,r){return _.createElement(Fe,Be({},e,{ref:r,icon:ru}))},ou=_.forwardRef(nu);const au=ou;var iu={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z"}}]},name:"sun",theme:"outlined"};const su=iu;var cu=function(e,r){return _.createElement(Fe,Be({},e,{ref:r,icon:su}))},lu=_.forwardRef(cu);const uu=lu;var fu={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"};const du=fu;var pu=function(e,r){return _.createElement(Fe,Be({},e,{ref:r,icon:du}))},yu=_.forwardRef(pu);const hu=yu,mu=()=>{const[t,e]=_.useState(),r=_.useCallback(async()=>Il().then(n=>n.sort((o,a)=>{const i=o.time||0;return(a.time||0)-i})).then(n=>e(n)),[]);return _.useEffect(()=>{r()},[]),w.jsx(w.Fragment,{children:t&&(t==null?void 0:t.length)>0?w.jsxs(zo,{direction:"vertical",style:{display:"flex"},children:[w.jsx("div",{children:"快速连接"}),w.jsx(Ho,{gutter:10,children:t.map(n=>w.jsx(Vo,{span:12,title:n.addr,style:{overflow:"hidden",textOverflow:"ellipsis"},children:w.jsxs(Wo,{gap:5,style:{overflow:"hidden"},children:[w.jsx("a",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:"auto"},href:`?use=${n.addr}`,children:n.addr}),w.jsx(qo,{style:{color:"red"},onClick:async()=>{await Rl(n.addr),r()}})]})},n.addr))})]}):null})},vu=()=>{const[t,e]=_.useState(window.matchMedia("(prefers-color-scheme: dark)").matches);return _.useEffect(()=>{const r=window.matchMedia("(prefers-color-scheme: dark)"),n=o=>{e(o.matches)};return r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),t},To=()=>{const t=vu(),{theme:e}=ur();return _.useMemo(()=>!e||e==="system"?t:e==="dark",[e,t])},gu=t=>{const e=ur(),r=To(),n=r?w.jsx(au,{}):w.jsx(uu,{});return w.jsx(Sn,{...t,shape:"circle",icon:n,onClick:()=>{const o={...e};o.theme=r?"light":"dark",ur.set(o)}})},bu=()=>w.jsxs(w.Fragment,{children:[w.jsxs(ye,{className:"home-form",size:"large",layout:"horizontal",initialValues:{baseURL:"http://",save:!0},onFinish:t=>{let e=t.baseURL;return/^(https?:)?\/\//.test(e)?/^\/\//.test(e)&&(e=`${location.protocol}`+e):e=`${location.protocol}//`+e,fr({addr:e,auth:{username:t.username,password:t.password}},t.save)},children:[w.jsx("h1",{children:"GOST API Manage"}),w.jsx("h2",{children:"首先连接API服务"}),w.jsx(ye.Item,{name:"baseURL",rules:[{required:!0,message:"请输入API地址"},{validator(t,e,r){e==="http://"&&r("请输入API地址"),r()}}],children:w.jsx(_t,{placeholder:"API baseURL",prefix:w.jsx(Jl,{className:"prefixIcon"})})}),w.jsx(ye.Item,{name:"username",children:w.jsx(_t,{placeholder:"username",prefix:w.jsx(hu,{className:"prefixIcon"})})}),w.jsx(ye.Item,{name:"password",children:w.jsx(_t.Password,{placeholder:"password",prefix:w.jsx(eu,{className:"prefixIcon"})})}),w.jsx(ye.Item,{name:"save",valuePropName:"checked",children:w.jsx(Ko,{children:"保存到本地"})}),w.jsx(ye.Item,{noStyle:!0,style:{marginBottom:"1em"},children:w.jsx(Sn,{block:!0,type:"primary",htmlType:"submit",children:"链接"})}),w.jsx(mu,{})]}),w.jsx(gu,{style:{position:"absolute",top:"1em",right:"1em"}})]});const Q=new Tn.EventEmitter;var vt={},No={exports:{}};(function(t){function e(r){return r&&r.__esModule?r:{default:r}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(No);var Ir=No.exports,gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.default=void 0;var wu={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};gt.default=wu;var bt={},ze={},wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.default=void 0;var Su={locale:"zh_CN",yearFormat:"YYYY年",cellDateFormat:"D",cellMeridiemFormat:"A",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"};wt.default=Su;var He={};Object.defineProperty(He,"__esModule",{value:!0});He.default=void 0;const Eu={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};He.default=Eu;var Lo=Ir.default;Object.defineProperty(ze,"__esModule",{value:!0});ze.default=void 0;var Ou=Lo(wt),_u=Lo(He);const Do={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},Ou.default),timePickerLocale:Object.assign({},_u.default)};Do.lang.ok="确定";ze.default=Do;var xu=Ir.default;Object.defineProperty(bt,"__esModule",{value:!0});bt.default=void 0;var Au=xu(ze);bt.default=Au.default;var St=Ir.default;Object.defineProperty(vt,"__esModule",{value:!0});vt.default=void 0;var Pu=St(gt),Ru=St(bt),Iu=St(ze),$u=St(He);const D="${label}不是一个有效的${type}",Cu={locale:"zh-cn",Pagination:Pu.default,DatePicker:Iu.default,TimePicker:$u.default,Calendar:Ru.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:D,method:D,array:D,object:D,number:D,date:D,boolean:D,integer:D,float:D,regexp:D,email:D,url:D,hex:D},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无"}};vt.default=Cu;var Tu=vt;const Nu=wn(Tu),Lu=ct.createContext({}),Hu=ct.createContext({localList:[],name:""}),Vu=(t,e)=>{const r=`${t}:getComm`,n=o=>{o(e)};return Q.on(r,n),()=>{Q.off(r,n)}},Wu=t=>new Promise((e,r)=>{const n=`${t}:getComm`;Q.emit(n,e)}),Du=ct.lazy(()=>oa(()=>import("./Manage-8dbada9a.js"),["./Manage-8dbada9a.js","./antd-15fa66a0.js"],import.meta.url)),Fu=t=>{const{locale:e,theme:r}=_.useContext(Qe.ConfigContext);return _.useLayoutEffect(()=>{Qe.config({theme:r,holderRender:n=>w.jsx(Qe,{theme:r,children:n})})},[e,r]),w.jsx(Jo,{children:t.children})};function Bu(){const t=fe(),e=Ge(),r=Je(),n=To(),[o,a]=_.useState(!1),[i,s]=_.useState(!1),c=_.useMemo(()=>o||i,[o,i]),f=_.useRef({update:async()=>{var l;try{a(!0),s(!0);const[u,d]=await Promise.all([dr(),f.current.updateLocalConfig((l=fe.get())==null?void 0:l.addr)]);return Ge.set(u),Je.set(d),[u,d]}finally{a(!1),s(!1)}},updateLocalConfig:async l=>{try{l||Je.set(null),s(!0);const u=await Pe.getAllCacheConfig(l),d={};return u.forEach(m=>{const{_type_:y}=m;(d[y]?d[y]:d[y]=[]).push(m)}),d}finally{s(!1)}},defaultTitle:document.title});return _.useEffect(()=>{xl();const l=async m=>{if((m==null?void 0:m.url)!==$.config)return Ge.set(await dr())},u=async()=>{var m;return Je.set(await f.current.updateLocalConfig((m=fe.get())==null?void 0:m.addr))},d=f.current.update;return Q.on("apiUpdate",l),Q.on("localUpdate",u),Q.on("update",d),()=>{Q.off("apiUpdate",l),Q.off("localUpdate",u),Q.off("update",d)}},[]),_.useEffect(()=>{t?f.current.update().then(([l])=>{Ge.set(l),document.title=t.addr.replace(/^(https?:)?\/\//,"")}):document.title=f.current.defaultTitle},[t]),_.useEffect(()=>{var l,u;n?(document.documentElement.classList.add("theme-dark"),(l=window==null?void 0:window.monaco)==null||l.editor.setTheme("vs-dark")):(document.documentElement.classList.remove("theme-dark"),(u=window==null?void 0:window.monaco)==null||u.editor.setTheme("vs"))},[n]),w.jsx(Lu.Provider,{value:{gostConfig:e,localConfig:r,isLoading:c},children:w.jsx(Qe,{theme:{algorithm:n?Go.darkAlgorithm:void 0},locale:Nu,children:w.jsx(Fu,{children:w.jsx(ct.Suspense,{fallback:"loading...",children:t?w.jsx(Du,{}):w.jsx(bu,{})})})})})}qt.createRoot(document.getElementById("root")).render(w.jsx(Bu,{}));export{zu as A,Hu as C,Uu as L,gu as T,Lu as a,Q as b,qt as c,Vu as d,Ge as e,fe as f,Wu as g,Il as h,_l as i,w as j,dr as k,$o as l,Co as m,$ as n,qc as q,Vl as s,To as u}; diff --git a/index.html b/index.html index 6e82d14..23441c6 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@ require.config({ paths: { vs: document.getElementById("nonaco").src.replace(/\/loader\.js/,'') } }); })(); - +