>>1:a>>>1;r[s]=a}return r}();o.exports=function(a,r,s,c){var f=i,p=c+s;a^=-1;for(var y=c;y>>8^f[255&(a^r[y])];return-1^a}},{}],46:[function(n,o,t){var i,a=n("../utils/common"),r=n("./trees"),s=n("./adler32"),c=n("./crc32"),f=n("./messages"),p=0,y=4,u=0,g=-2,d=-1,b=4,m=2,w=8,_=9,C=286,I=30,P=19,E=2*C+1,D=15,j=3,U=258,q=U+j+1,O=42,L=113,v=1,B=2,te=3,T=4;function J(h,$){return h.msg=f[$],$}function N(h){return(h<<1)-(4h.avail_out&&(V=h.avail_out),V!==0&&(a.arraySet(h.output,$.pending_buf,$.pending_out,V,h.next_out),h.next_out+=V,$.pending_out+=V,h.total_out+=V,h.avail_out-=V,$.pending-=V,$.pending===0&&($.pending_out=0))}function z(h,$){r._tr_flush_block(h,0<=h.block_start?h.block_start:-1,h.strstart-h.block_start,$),h.block_start=h.strstart,A(h.strm)}function ee(h,$){h.pending_buf[h.pending++]=$}function X(h,$){h.pending_buf[h.pending++]=$>>>8&255,h.pending_buf[h.pending++]=255&$}function Z(h,$){var V,k,S=h.max_chain_length,M=h.strstart,W=h.prev_length,H=h.nice_match,R=h.strstart>h.w_size-q?h.strstart-(h.w_size-q):0,G=h.window,Q=h.w_mask,Y=h.prev,ne=h.strstart+U,fe=G[M+W-1],ue=G[M+W];h.prev_length>=h.good_match&&(S>>=2),H>h.lookahead&&(H=h.lookahead);do if(G[(V=$)+W]===ue&&G[V+W-1]===fe&&G[V]===G[M]&&G[++V]===G[M+1]){M+=2,V++;do;while(G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&MR&&--S!=0);return W<=h.lookahead?W:h.lookahead}function ce(h){var $,V,k,S,M,W,H,R,G,Q,Y=h.w_size;do{if(S=h.window_size-h.lookahead-h.strstart,h.strstart>=Y+(Y-q)){for(a.arraySet(h.window,h.window,Y,Y,0),h.match_start-=Y,h.strstart-=Y,h.block_start-=Y,$=V=h.hash_size;k=h.head[--$],h.head[$]=Y<=k?k-Y:0,--V;);for($=V=Y;k=h.prev[--$],h.prev[$]=Y<=k?k-Y:0,--V;);S+=Y}if(h.strm.avail_in===0)break;if(W=h.strm,H=h.window,R=h.strstart+h.lookahead,G=S,Q=void 0,Q=W.avail_in,G=j)for(M=h.strstart-h.insert,h.ins_h=h.window[M],h.ins_h=(h.ins_h<=j&&(h.ins_h=(h.ins_h<=j)if(k=r._tr_tally(h,h.strstart-h.match_start,h.match_length-j),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=j){for(h.match_length--;h.strstart++,h.ins_h=(h.ins_h<=j&&(h.ins_h=(h.ins_h<=j&&h.match_length<=h.prev_length){for(S=h.strstart+h.lookahead-j,k=r._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-j),h.lookahead-=h.prev_length-1,h.prev_length-=2;++h.strstart<=S&&(h.ins_h=(h.ins_h<h.pending_buf_size-5&&(V=h.pending_buf_size-5);;){if(h.lookahead<=1){if(ce(h),h.lookahead===0&&$===p)return v;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var k=h.block_start+V;if((h.strstart===0||h.strstart>=k)&&(h.lookahead=h.strstart-k,h.strstart=k,z(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-q&&(z(h,!1),h.strm.avail_out===0))return v}return h.insert=0,$===y?(z(h,!0),h.strm.avail_out===0?te:T):(h.strstart>h.block_start&&(z(h,!1),h.strm.avail_out),v)}),new le(4,4,8,4,he),new le(4,5,16,8,he),new le(4,6,32,32,he),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(h,$){return ke(h,$,w,15,8,0)},t.deflateInit2=ke,t.deflateReset=Ce,t.deflateResetKeep=pe,t.deflateSetHeader=function(h,$){return h&&h.state?h.state.wrap!==2?g:(h.state.gzhead=$,u):g},t.deflate=function(h,$){var V,k,S,M;if(!h||!h.state||5<$||$<0)return h?J(h,g):g;if(k=h.state,!h.output||!h.input&&h.avail_in!==0||k.status===666&&$!==y)return J(h,h.avail_out===0?-5:g);if(k.strm=h,V=k.last_flush,k.last_flush=$,k.status===O)if(k.wrap===2)h.adler=0,ee(k,31),ee(k,139),ee(k,8),k.gzhead?(ee(k,(k.gzhead.text?1:0)+(k.gzhead.hcrc?2:0)+(k.gzhead.extra?4:0)+(k.gzhead.name?8:0)+(k.gzhead.comment?16:0)),ee(k,255&k.gzhead.time),ee(k,k.gzhead.time>>8&255),ee(k,k.gzhead.time>>16&255),ee(k,k.gzhead.time>>24&255),ee(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),ee(k,255&k.gzhead.os),k.gzhead.extra&&k.gzhead.extra.length&&(ee(k,255&k.gzhead.extra.length),ee(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(h.adler=c(h.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=69):(ee(k,0),ee(k,0),ee(k,0),ee(k,0),ee(k,0),ee(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),ee(k,3),k.status=L);else{var W=w+(k.w_bits-8<<4)<<8;W|=(2<=k.strategy||k.level<2?0:k.level<6?1:k.level===6?2:3)<<6,k.strstart!==0&&(W|=32),W+=31-W%31,k.status=L,X(k,W),k.strstart!==0&&(X(k,h.adler>>>16),X(k,65535&h.adler)),h.adler=1}if(k.status===69)if(k.gzhead.extra){for(S=k.pending;k.gzindex<(65535&k.gzhead.extra.length)&&(k.pending!==k.pending_buf_size||(k.gzhead.hcrc&&k.pending>S&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),A(h),S=k.pending,k.pending!==k.pending_buf_size));)ee(k,255&k.gzhead.extra[k.gzindex]),k.gzindex++;k.gzhead.hcrc&&k.pending>S&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),k.gzindex===k.gzhead.extra.length&&(k.gzindex=0,k.status=73)}else k.status=73;if(k.status===73)if(k.gzhead.name){S=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>S&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),A(h),S=k.pending,k.pending===k.pending_buf_size)){M=1;break}M=k.gzindexS&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),M===0&&(k.gzindex=0,k.status=91)}else k.status=91;if(k.status===91)if(k.gzhead.comment){S=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>S&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),A(h),S=k.pending,k.pending===k.pending_buf_size)){M=1;break}M=k.gzindexS&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),M===0&&(k.status=103)}else k.status=103;if(k.status===103&&(k.gzhead.hcrc?(k.pending+2>k.pending_buf_size&&A(h),k.pending+2<=k.pending_buf_size&&(ee(k,255&h.adler),ee(k,h.adler>>8&255),h.adler=0,k.status=L)):k.status=L),k.pending!==0){if(A(h),h.avail_out===0)return k.last_flush=-1,u}else if(h.avail_in===0&&N($)<=N(V)&&$!==y)return J(h,-5);if(k.status===666&&h.avail_in!==0)return J(h,-5);if(h.avail_in!==0||k.lookahead!==0||$!==p&&k.status!==666){var H=k.strategy===2?function(R,G){for(var Q;;){if(R.lookahead===0&&(ce(R),R.lookahead===0)){if(G===p)return v;break}if(R.match_length=0,Q=r._tr_tally(R,0,R.window[R.strstart]),R.lookahead--,R.strstart++,Q&&(z(R,!1),R.strm.avail_out===0))return v}return R.insert=0,G===y?(z(R,!0),R.strm.avail_out===0?te:T):R.last_lit&&(z(R,!1),R.strm.avail_out===0)?v:B}(k,$):k.strategy===3?function(R,G){for(var Q,Y,ne,fe,ue=R.window;;){if(R.lookahead<=U){if(ce(R),R.lookahead<=U&&G===p)return v;if(R.lookahead===0)break}if(R.match_length=0,R.lookahead>=j&&0R.lookahead&&(R.match_length=R.lookahead)}if(R.match_length>=j?(Q=r._tr_tally(R,1,R.match_length-j),R.lookahead-=R.match_length,R.strstart+=R.match_length,R.match_length=0):(Q=r._tr_tally(R,0,R.window[R.strstart]),R.lookahead--,R.strstart++),Q&&(z(R,!1),R.strm.avail_out===0))return v}return R.insert=0,G===y?(z(R,!0),R.strm.avail_out===0?te:T):R.last_lit&&(z(R,!1),R.strm.avail_out===0)?v:B}(k,$):i[k.level].func(k,$);if(H!==te&&H!==T||(k.status=666),H===v||H===te)return h.avail_out===0&&(k.last_flush=-1),u;if(H===B&&($===1?r._tr_align(k):$!==5&&(r._tr_stored_block(k,0,0,!1),$===3&&(K(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),A(h),h.avail_out===0))return k.last_flush=-1,u}return $!==y?u:k.wrap<=0?1:(k.wrap===2?(ee(k,255&h.adler),ee(k,h.adler>>8&255),ee(k,h.adler>>16&255),ee(k,h.adler>>24&255),ee(k,255&h.total_in),ee(k,h.total_in>>8&255),ee(k,h.total_in>>16&255),ee(k,h.total_in>>24&255)):(X(k,h.adler>>>16),X(k,65535&h.adler)),A(h),0=V.w_size&&(M===0&&(K(V.head),V.strstart=0,V.block_start=0,V.insert=0),G=new a.Buf8(V.w_size),a.arraySet(G,$,Q-V.w_size,V.w_size,0),$=G,Q=V.w_size),W=h.avail_in,H=h.next_in,R=h.input,h.avail_in=Q,h.next_in=0,h.input=$,ce(V);V.lookahead>=j;){for(k=V.strstart,S=V.lookahead-(j-1);V.ins_h=(V.ins_h<>>=j=D>>>24,_-=j,(j=D>>>16&255)===0)B[f++]=65535&D;else{if(!(16&j)){if(!(64&j)){D=C[(65535&D)+(w&(1<>>=j,_-=j),_<15&&(w+=v[s++]<<_,_+=8,w+=v[s++]<<_,_+=8),D=I[w&E];n:for(;;){if(w>>>=j=D>>>24,_-=j,!(16&(j=D>>>16&255))){if(!(64&j)){D=I[(65535&D)+(w&(1<>>=j,_-=j,(j=f-p)>3,w&=(1<<(_-=U<<3))-1,i.next_in=s,i.next_out=f,i.avail_in=s>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function w(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(O){var L;return O&&O.state?(L=O.state,O.total_in=O.total_out=L.total=0,O.msg="",L.wrap&&(O.adler=1&L.wrap),L.mode=g,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new i.Buf32(d),L.distcode=L.distdyn=new i.Buf32(b),L.sane=1,L.back=-1,y):u}function C(O){var L;return O&&O.state?((L=O.state).wsize=0,L.whave=0,L.wnext=0,_(O)):u}function I(O,L){var v,B;return O&&O.state?(B=O.state,L<0?(v=0,L=-L):(v=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15=T.wsize?(i.arraySet(T.window,L,v-T.wsize,T.wsize,0),T.wnext=0,T.whave=T.wsize):(B<(te=T.wsize-T.wnext)&&(te=B),i.arraySet(T.window,L,v-B,te,T.wnext),(B-=te)?(i.arraySet(T.window,L,v-B,B,0),T.wnext=B,T.whave=T.wsize):(T.wnext+=te,T.wnext===T.wsize&&(T.wnext=0),T.whave>>8&255,v.check=r(v.check,M,2,0),z=A=0,v.mode=2;break}if(v.flags=0,v.head&&(v.head.done=!1),!(1&v.wrap)||(((255&A)<<8)+(A>>8))%31){O.msg="incorrect header check",v.mode=30;break}if((15&A)!=8){O.msg="unknown compression method",v.mode=30;break}if(z-=4,h=8+(15&(A>>>=4)),v.wbits===0)v.wbits=h;else if(h>v.wbits){O.msg="invalid window size",v.mode=30;break}v.dmax=1<>8&1),512&v.flags&&(M[0]=255&A,M[1]=A>>>8&255,v.check=r(v.check,M,2,0)),z=A=0,v.mode=3;case 3:for(;z<32;){if(N===0)break e;N--,A+=B[T++]<>>8&255,M[2]=A>>>16&255,M[3]=A>>>24&255,v.check=r(v.check,M,4,0)),z=A=0,v.mode=4;case 4:for(;z<16;){if(N===0)break e;N--,A+=B[T++]<>8),512&v.flags&&(M[0]=255&A,M[1]=A>>>8&255,v.check=r(v.check,M,2,0)),z=A=0,v.mode=5;case 5:if(1024&v.flags){for(;z<16;){if(N===0)break e;N--,A+=B[T++]<>>8&255,v.check=r(v.check,M,2,0)),z=A=0}else v.head&&(v.head.extra=null);v.mode=6;case 6:if(1024&v.flags&&(N<(Z=v.length)&&(Z=N),Z&&(v.head&&(h=v.head.extra_len-v.length,v.head.extra||(v.head.extra=new Array(v.head.extra_len)),i.arraySet(v.head.extra,B,T,Z,h)),512&v.flags&&(v.check=r(v.check,B,Z,T)),N-=Z,T+=Z,v.length-=Z),v.length))break e;v.length=0,v.mode=7;case 7:if(2048&v.flags){if(N===0)break e;for(Z=0;h=B[T+Z++],v.head&&h&&v.length<65536&&(v.head.name+=String.fromCharCode(h)),h&&Z>9&1,v.head.done=!0),O.adler=v.check=0,v.mode=12;break;case 10:for(;z<32;){if(N===0)break e;N--,A+=B[T++]<>>=7&z,z-=7&z,v.mode=27;break}for(;z<3;){if(N===0)break e;N--,A+=B[T++]<>>=1)){case 0:v.mode=14;break;case 1:if(U(v),v.mode=20,L!==6)break;A>>>=2,z-=2;break e;case 2:v.mode=17;break;case 3:O.msg="invalid block type",v.mode=30}A>>>=2,z-=2;break;case 14:for(A>>>=7&z,z-=7&z;z<32;){if(N===0)break e;N--,A+=B[T++]<>>16^65535)){O.msg="invalid stored block lengths",v.mode=30;break}if(v.length=65535&A,z=A=0,v.mode=15,L===6)break e;case 15:v.mode=16;case 16:if(Z=v.length){if(N>>=5,z-=5,v.ndist=1+(31&A),A>>>=5,z-=5,v.ncode=4+(15&A),A>>>=4,z-=4,286>>=3,z-=3}for(;v.have<19;)v.lens[W[v.have++]]=0;if(v.lencode=v.lendyn,v.lenbits=7,V={bits:v.lenbits},$=c(0,v.lens,0,19,v.lencode,0,v.work,V),v.lenbits=V.bits,$){O.msg="invalid code lengths set",v.mode=30;break}v.have=0,v.mode=19;case 19:for(;v.have>>16&255,ge=65535&S,!((se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>>=se,z-=se,v.lens[v.have++]=ge;else{if(ge===16){for(k=se+2;z>>=se,z-=se,v.have===0){O.msg="invalid bit length repeat",v.mode=30;break}h=v.lens[v.have-1],Z=3+(3&A),A>>>=2,z-=2}else if(ge===17){for(k=se+3;z>>=se)),A>>>=3,z-=3}else{for(k=se+7;z>>=se)),A>>>=7,z-=7}if(v.have+Z>v.nlen+v.ndist){O.msg="invalid bit length repeat",v.mode=30;break}for(;Z--;)v.lens[v.have++]=h}}if(v.mode===30)break;if(v.lens[256]===0){O.msg="invalid code -- missing end-of-block",v.mode=30;break}if(v.lenbits=9,V={bits:v.lenbits},$=c(f,v.lens,0,v.nlen,v.lencode,0,v.work,V),v.lenbits=V.bits,$){O.msg="invalid literal/lengths set",v.mode=30;break}if(v.distbits=6,v.distcode=v.distdyn,V={bits:v.distbits},$=c(p,v.lens,v.nlen,v.ndist,v.distcode,0,v.work,V),v.distbits=V.bits,$){O.msg="invalid distances set",v.mode=30;break}if(v.mode=20,L===6)break e;case 20:v.mode=21;case 21:if(6<=N&&258<=K){O.next_out=J,O.avail_out=K,O.next_in=T,O.avail_in=N,v.hold=A,v.bits=z,s(O,X),J=O.next_out,te=O.output,K=O.avail_out,T=O.next_in,B=O.input,N=O.avail_in,A=v.hold,z=v.bits,v.mode===12&&(v.back=-1);break}for(v.back=0;le=(S=v.lencode[A&(1<>>16&255,ge=65535&S,!((se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>pe)])>>>16&255,ge=65535&S,!(pe+(se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>>=pe,z-=pe,v.back+=pe}if(A>>>=se,z-=se,v.back+=se,v.length=ge,le===0){v.mode=26;break}if(32&le){v.back=-1,v.mode=12;break}if(64&le){O.msg="invalid literal/length code",v.mode=30;break}v.extra=15&le,v.mode=22;case 22:if(v.extra){for(k=v.extra;z>>=v.extra,z-=v.extra,v.back+=v.extra}v.was=v.length,v.mode=23;case 23:for(;le=(S=v.distcode[A&(1<>>16&255,ge=65535&S,!((se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>pe)])>>>16&255,ge=65535&S,!(pe+(se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>>=pe,z-=pe,v.back+=pe}if(A>>>=se,z-=se,v.back+=se,64&le){O.msg="invalid distance code",v.mode=30;break}v.offset=ge,v.extra=15&le,v.mode=24;case 24:if(v.extra){for(k=v.extra;z>>=v.extra,z-=v.extra,v.back+=v.extra}if(v.offset>v.dmax){O.msg="invalid distance too far back",v.mode=30;break}v.mode=25;case 25:if(K===0)break e;if(Z=X-K,v.offset>Z){if((Z=v.offset-Z)>v.whave&&v.sane){O.msg="invalid distance too far back",v.mode=30;break}ce=Z>v.wnext?(Z-=v.wnext,v.wsize-Z):v.wnext-Z,Z>v.length&&(Z=v.length),he=v.window}else he=te,ce=J-v.offset,Z=v.length;for(KE?(j=ce[he+b[L]],z[ee+b[L]]):(j=96,0),w=1<>J)+(_-=w)]=D<<24|j<<16|U|0,_!==0;);for(w=1<>=1;if(w!==0?(A&=w-1,A+=w):A=0,L++,--X[O]==0){if(O===B)break;O=p[y+b[L]]}if(te>>7)]}function ee(S,M){S.pending_buf[S.pending++]=255&M,S.pending_buf[S.pending++]=M>>>8&255}function X(S,M,W){S.bi_valid>m-W?(S.bi_buf|=M<>m-S.bi_valid,S.bi_valid+=W-m):(S.bi_buf|=M<>>=1,W<<=1,0<--M;);return W>>>1}function he(S,M,W){var H,R,G=new Array(b+1),Q=0;for(H=1;H<=b;H++)G[H]=Q=Q+W[H-1]<<1;for(R=0;R<=M;R++){var Y=S[2*R+1];Y!==0&&(S[2*R]=ce(G[Y]++,Y))}}function se(S){var M;for(M=0;M>1;1<=W;W--)pe(S,G,W);for(R=ne;W=S.heap[1],S.heap[1]=S.heap[S.heap_len--],pe(S,G,1),H=S.heap[1],S.heap[--S.heap_max]=W,S.heap[--S.heap_max]=H,G[2*R]=G[2*W]+G[2*H],S.depth[R]=(S.depth[W]>=S.depth[H]?S.depth[W]:S.depth[H])+1,G[2*W+1]=G[2*H+1]=R,S.heap[1]=R++,pe(S,G,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ue,Ee){var qe,ze,Je,ve,st,zt,Ae=Ee.dyn_tree,un=Ee.max_code,Vr=Ee.stat_desc.static_tree,Br=Ee.stat_desc.has_stree,Nr=Ee.stat_desc.extra_bits,cn=Ee.stat_desc.extra_base,Qe=Ee.stat_desc.max_length,lt=0;for(ve=0;ve<=b;ve++)ue.bl_count[ve]=0;for(Ae[2*ue.heap[ue.heap_max]+1]=0,qe=ue.heap_max+1;qe>=7;R>>=1)if(1&fe&&Y.dyn_ltree[2*ne]!==0)return a;if(Y.dyn_ltree[18]!==0||Y.dyn_ltree[20]!==0||Y.dyn_ltree[26]!==0)return r;for(ne=32;ne>>3,(G=S.static_len+3+7>>>3)<=R&&(R=G)):R=G=W+5,W+4<=R&&M!==-1?k(S,M,W,H):S.strategy===4||G===R?(X(S,2+(H?1:0),3),Ce(S,q,O)):(X(S,4+(H?1:0),3),function(Y,ne,fe,ue){var Ee;for(X(Y,ne-257,5),X(Y,fe-1,5),X(Y,ue-4,4),Ee=0;Ee>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&M,S.pending_buf[S.l_buf+S.last_lit]=255&W,S.last_lit++,M===0?S.dyn_ltree[2*W]++:(S.matches++,M--,S.dyn_ltree[2*(v[W]+p+1)]++,S.dyn_dtree[2*z(M)]++),S.last_lit===S.lit_bufsize-1},t._tr_align=function(S){X(S,2,3),Z(S,_,q),function(M){M.bi_valid===16?(ee(M,M.bi_buf),M.bi_buf=0,M.bi_valid=0):8<=M.bi_valid&&(M.pending_buf[M.pending++]=255&M.bi_buf,M.bi_buf>>=8,M.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(n,o,t){o.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,o,t){(function(i){(function(a,r){if(!a.setImmediate){var s,c,f,p,y=1,u={},g=!1,d=a.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(a);b=b&&b.setTimeout?b:a,s={}.toString.call(a.process)==="[object process]"?function(C){process.nextTick(function(){w(C)})}:function(){if(a.postMessage&&!a.importScripts){var C=!0,I=a.onmessage;return a.onmessage=function(){C=!1},a.postMessage("","*"),a.onmessage=I,C}}()?(p="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",_,!1):a.attachEvent("onmessage",_),function(C){a.postMessage(p+C,"*")}):a.MessageChannel?((f=new MessageChannel).port1.onmessage=function(C){w(C.data)},function(C){f.port2.postMessage(C)}):d&&"onreadystatechange"in d.createElement("script")?(c=d.documentElement,function(C){var I=d.createElement("script");I.onreadystatechange=function(){w(C),I.onreadystatechange=null,c.removeChild(I),I=null},c.appendChild(I)}):function(C){setTimeout(w,0,C)},b.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var I=new Array(arguments.length-1),P=0;P"u"?i===void 0?this:i:self)}).call(this,typeof ut<"u"?ut:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ir);var ta=ir.exports;const na=Wr(ta),ar=async l=>{var t;const e=`ComfyUI workspace workflows ${Yn(Date.now())}`,n=new na,o=await((t=ye)==null?void 0:t.getSetting("twoWaySync"));for(const i of l){let a;o?a=i.parentFolderID??"":a=await oi(i.parentFolderID??null).then(async s=>si(s??""));const r=n.folder(a);r==null||r.file(`${i.name}.json`,i.json)}n.generateAsync({type:"blob"}).then(function(i){const a=document.createElement("a");a.href=window.URL.createObjectURL(i),a.download=`${e}.zip`,document.body.appendChild(a),a.click(),document.body.removeChild(a)})};function ra(){const[l,e]=F.useState(!1),[n,o]=F.useState(""),{showDialog:t}=$n(),i=()=>{var r;(r=ye)==null||r.getSettings().then(s=>{o((s==null?void 0:s.myWorkflowsDir)??"undefined"),e(!!(s!=null&&s.twoWaySync))})};F.useEffect(()=>{i()},[]);const a=async r=>{var c,f;if(!r.target.checked){await((c=ye)==null?void 0:c.upsert({twoWaySync:r.target.checked})),i();return}const s=await((f=ye)==null?void 0:f.getSetting("myWorkflowsDir"));t(x.jsx(ia,{myWorkflowsDir:s??"undefined"}),[{label:"I have downloaded all my workflows and ready to enable",onClick:async()=>{var p;await((p=ye)==null?void 0:p.upsert({twoWaySync:!0})),i()}}])};return x.jsxs(Le,{children:[x.jsxs(Oe,{children:["If enabled, your workflows will be synced to and from ",x.jsx("b",{children:n}),x.jsx("br",{}),"You can manually move files into this folder using File Explorer or Finder to import them into your workspace."]}),x.jsx(ot,{isChecked:l,onChange:a,children:"Enable two way sync (DO NOT USE!! EXPERIMENTAL!)"})]})}function ia({myWorkflowsDir:l}){return x.jsxs(Le,{gap:3,children:[x.jsx("p",{children:"Your workflows will be synced to and from path:"}),x.jsx("p",{children:x.jsx("b",{children:l})}),x.jsxs("p",{children:["Please make sure this path is valid. You can change this path anytime in Settings ",">"," Workspace Save Direcotry"]}),x.jsxs("p",{children:[x.jsx("b",{children:"Please download all your workflows before enabling two way sync!"})," ","So you can manually import some workflows into your my_workflows/ directory on your disk in case something unexpected happens."]}),x.jsx(Se,{colorScheme:"teal",variant:"outline",width:"fit-content",size:"sm",onClick:async()=>{var n;const e=await((n=be)==null?void 0:n.listAll());ar(e??[])},children:"Download All My Workflows"})]})}function vn({settingKey:l,text:e,defaultChecked:n=!1}){const[o,t]=F.useState(n),i=()=>{var a;(a=ye)==null||a.getSetting(l).then(r=>{t(!!r)})};return F.useEffect(()=>{i()},[]),x.jsx(Le,{children:x.jsx(ot,{isChecked:o,onChange:async a=>{var r;await((r=ye)==null?void 0:r.upsert({[l]:a.target.checked})),i()},children:e})})}function aa({onClose:l}){const[e,n]=F.useState(!1),[o,t]=F.useState(!1),[i,a]=F.useState(""),[r,s]=F.useState([]),[c,f]=F.useState([]),[p,y]=F.useState(!1),u=F.useRef(null),g=li();F.useEffect(()=>{var E;(E=ye)==null||E.getSetting("myWorkflowsDir").then(D=>{a(D)})},[]);const d=async E=>{const{dir_path:D="",dir_contents:j=[],error:U=""}=await hn(E??"");return U.includes("Operation not permitted")?(y(!0),m(),{isError:!0}):{dirList:j,dirPath:D}},b=async()=>{const{isError:E=!1,dirList:D=[]}=await d(i);E||(f(D),t(!0),s(i&&i.split("/").filter(j=>!!j)||[]))},m=()=>{t(!1),n(!1),s([])},w=async E=>{var q,O,L;if(E){const{error:v=""}=await hn(E);if(v.includes("Not a directory")){g({title:"The directory address you entered is invalid, please re-enter it.",status:"warning",duration:5e3,position:"top",isClosable:!0});return}}const D=E??`/${r.join("/")}`;await((q=ye)==null?void 0:q.upsert({myWorkflowsDir:D}));const j=await((O=ye)==null?void 0:O.getSetting("myWorkflowsDir"))??"";a(j),E&&y(!1),m(),await((L=ye)==null?void 0:L.getSetting("twoWaySync"))||ci()},_=async()=>{const{dirPath:E,dirList:D}=await d("");s(E.split("/").filter(j=>!!j)),f(D)},C=async(E,D)=>{var O;let j="";E===-1&&D?j=`/${r.concat([D]).join("/")}`:j=`/${r.slice(0,E+1).join("/")}`;const{isError:U=!1,dirList:q=[]}=await d(j);U||(f(q),s((O=j.slice(1))==null?void 0:O.split("/")))},I=()=>{t(!0),n(!0)},P=x.jsxs(de,{textAlign:"end",mb:4,children:[x.jsx(it,{placeholder:"Please enter the absolute path directory address",ref:u,mt:2,mb:2}),x.jsx(Se,{colorScheme:"teal",mr:3,size:"sm",onClick:()=>{var E,D;(E=u==null?void 0:u.current)!=null&&E.value&&w((D=u==null?void 0:u.current)==null?void 0:D.value)},children:"Save"})]});return x.jsxs(x.Fragment,{children:[x.jsxs(vt,{isOpen:!0,onClose:l,size:"xl",children:[x.jsx(gt,{}),x.jsxs(bt,{children:[x.jsx(yt,{children:"Settings"}),x.jsx(wt,{}),x.jsx(xt,{pb:14,children:x.jsx(we,{children:x.jsxs(pn,{divider:x.jsx(ui,{borderColor:"gray.500"}),spacing:4,align:"stretch",w:"100%",children:[x.jsxs(de,{mb:4,children:[x.jsx(Oe,{mb:2,fontWeight:500,children:"Workspace Save Directory"}),o?e?P:x.jsxs(pn,{spacing:2,alignItems:"start",children:[x.jsx(Le,{spacing:"2px",direction:"row",wrap:"wrap",children:r.map((E,D)=>x.jsxs(x.Fragment,{children:["/",x.jsx(Se,{colorScheme:"teal",variant:"link",minW:1,onClick:()=>{C(D)},children:E},`${E}-${D}`)]}))}),x.jsx(Di,{columns:2,spacing:3,maxHeight:500,width:"100%",overflowY:"auto",children:c.map((E,D)=>x.jsx(Se,{size:"sm",leftIcon:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#EFC54D",style:{width:"1.2rem",height:"1.2rem"},children:x.jsx("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"})}),justifyContent:"start",onClick:()=>{C(-1,E)},children:E},`${E}-${D}`))}),x.jsxs(de,{w:"100%",textAlign:"end",children:[x.jsx(Se,{colorScheme:"teal",size:"sm",onClick:()=>{w()},children:"Save"}),x.jsx(Se,{size:"sm",onClick:_,mr:2,ml:2,children:"Reset"}),x.jsx(Se,{size:"sm",onClick:m,children:"Cancel"})]})]}):x.jsxs(nt,{children:[x.jsx(qn,{overflowWrap:"anywhere",children:i}),x.jsx(Fe,{label:"Choose folder",children:x.jsx(xe,{"aria-label":"Select folder",size:"sm",ml:2,icon:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#EFC54D",style:{width:"1.4rem",height:"1.4srem"},children:x.jsx("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"})}),onClick:b})}),x.jsx(Fe,{label:"Input absolute path",children:x.jsx(xe,{"aria-label":"Enter folder address",size:"sm",ml:2,icon:x.jsx(Ui,{size:19}),onClick:I,variant:"ghost"})})]})]}),x.jsx(Qi,{}),x.jsx(vn,{settingKey:"autoSave",text:"Enable auto save workflow"}),x.jsx(ra,{}),x.jsx(ea,{}),x.jsx(vn,{settingKey:"overwriteCurWorkflowWhenDroppingFileToCanvas",text:"Overwrite current workflow when drag and drop workflow file to canvas"})]})})})]})]}),x.jsxs(vt,{isOpen:p,onClose:()=>y(!1),size:"xl",children:[x.jsx(gt,{}),x.jsxs(bt,{children:[x.jsx(yt,{children:"Kind tips"}),x.jsx(wt,{}),x.jsx(xt,{children:x.jsxs(de,{children:[navigator.userAgent.indexOf("Mac OS X")!==-1?x.jsxs(Oe,{fontWeight:500,children:["There is no permission to access the folder. You need to grant full disk access permission to the terminal that starts the ComfyUI program. For details, refer to the",x.jsx(Se,{colorScheme:"teal",variant:"link",as:"a",ml:2,target:"_block",href:`https://stackoverflow.com/questions/58479686/permissionerror-errno-1-operation-not-permitted-after-macos
- -catalina-update`,children:"Document"}),", or you can manually enter the absolute path of the folder in the input box below to save."]}):x.jsx(Oe,{fontWeight:500,children:"You do not have permission to access the folder. It is recommended that you manually enter the absolute path address of the required folder."}),P]})})]})]})]})}const Rt=16;function oa({}){const[l,e]=F.useState(!1),[n,o]=F.useState(!1),{colorMode:t,toggleColorMode:i}=qt();return x.jsxs(x.Fragment,{children:[x.jsxs(Xe,{isLazy:!0,children:[x.jsx(jt,{as:xe,"aria-label":"Options",icon:x.jsx(Zi,{}),size:"sm",variant:"outline"}),x.jsxs(at,{children:[x.jsx(Re,{onClick:()=>o(!0),icon:x.jsx(Xi,{size:16}),fontSize:16,children:"Settings"}),x.jsx(Re,{onClick:()=>e(!0),icon:x.jsx(rr,{size:Rt}),fontSize:16,children:"Manage Tags"}),x.jsxs(Re,{onClick:i,icon:t==="light"?x.jsx(Gi,{size:Rt}):x.jsx(qi,{size:Rt}),fontSize:16,children:[t==="light"?"Dark":"Light"," Mode"]})]})]}),l&&x.jsx(Ji,{onclose:()=>e(!1)}),n&&x.jsx(aa,{onClose:()=>o(!1)})]})}function sa(l){const{multipleState:e,changeMultipleState:n,selectedKeys:o,isSelectedAll:t,batchOperationCallback:i}=l,a=async()=>{var c;const s=await((c=be)==null?void 0:c.batchQuery(o))??[];ar(s)},r=o.length===0;return x.jsx(we,{spacing:2,wrap:"wrap",mb:0,children:e?x.jsxs(x.Fragment,{children:[x.jsx(ot,{isChecked:t,onChange:s=>{i("selectAll",s.target.checked)}}),x.jsx(Fe,{hasArrow:!0,label:"Download Zip",placement:"bottom",children:x.jsx(xe,{isDisabled:r,"aria-label":"Batch export",size:"sm",icon:x.jsx(di,{size:21}),onClick:a})}),x.jsx(Fe,{hasArrow:!0,label:"Batch deletion",children:x.jsx(Kn,{isDisabled:r,variant:"solid",promptMessage:`Are you sure you want to delete these ${o.length} checked workflows?`,tooltipText:"Delete selected",onDelete:async()=>{var s;await((s=be)==null?void 0:s.batchDeleteFlow(o)),i("batchDelete")}})}),o.length>0&&x.jsx(Oe,{fontWeight:600,children:`Selected ${o.length}`}),x.jsx(Fe,{hasArrow:!0,label:"Exit multi-select",children:x.jsx(xe,{"aria-label":"Close multi-select operation",size:"sm",icon:x.jsx(Qt,{}),onClick:()=>{n(!1)}})})]}):x.jsx(Fe,{hasArrow:!0,label:"Select multiple",placement:"bottom-start",children:x.jsx(xe,{"aria-label":"Start multi-select operation",size:"sm",variant:"outline",icon:x.jsx(Hi,{size:21}),onClick:()=>{n(!0)}})})})}const la=(l,e)=>{const[n,o]=F.useState(l);return F.useEffect(()=>{const t=setTimeout(()=>{o(l)},e);return()=>{clearTimeout(t)}},[l,e]),n},ua={position:"absolute",marginLeft:"10px",width:"20px",height:"20px",top:"50%",color:"#A0AEC0",transform:"translateY(-50%)"};function ca(l){const{searchValue:e,onUpdateSearchValue:n}=l,o=e!=="";return x.jsxs(de,{style:{position:"relative"},mb:2,children:[x.jsx(Ki,{style:ua}),o&&x.jsx(xe,{size:"xs",position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"none",zIndex:"100",icon:x.jsx(Qt,{width:15,height:15}),onClick:()=>n(""),"aria-label":"clear input button"}),x.jsx(it,{placeholder:"Search",size:"sm",paddingLeft:"35px",paddingBlock:"5px",value:e,onChange:({target:t})=>n(t.value)})]})}const gn=6;function da({setSelectedTag:l,selectedTag:e}){const[n,o]=F.useState(!1),[t,i]=F.useState([]);return F.useEffect(()=>{var a;(a=We)==null||a.listAll().then(r=>{i(r)})},[]),x.jsxs(we,{spacing:2,wrap:"wrap",mb:0,children:[e!=null&&x.jsx(xe,{"aria-label":"Close",size:"sm",icon:x.jsx(Qt,{}),onClick:()=>{l(void 0)}}),t.slice(0,n?void 0:gn).map(a=>x.jsx(Se,{variant:"solid",width:"auto",flexShrink:0,size:"sm",borderRadius:15,py:4,onClick:()=>{l(a.name)},isActive:e===a.name,children:a.name},a.name)),(t.length??0)>gn&&x.jsx(xe,{"aria-label":"Show-all-tags",size:"sm",icon:n?x.jsx($i,{}):x.jsx(en,{}),onClick:()=>o(!n)})]})}function or({parentFolderID:l,onlyImportFile:e=!1}){const{onRefreshFilesList:n}=F.useContext(Be),[o,t]=F.useState("file"),i=F.useRef(null),a=f=>{var p;t(f),f==="folder"?i.current.setAttribute("webkitdirectory",""):i.current.removeAttribute("webkitdirectory"),(p=i.current)==null||p.click()},r=async f=>{var p;if(f.type==="image/png"){const y=await zi(f),u=y==null?void 0:y.workflow;if(u)return{json:u,name:f.name.replace(".png","")}}else if(f.type==="application/json"||(p=f.name)!=null&&p.endsWith(".json"))return await new Promise((y,u)=>{const g=new FileReader;g.onload=d=>{var b;try{const m=(b=d.target)==null?void 0:b.result;typeof m=="string"?y({json:m,name:f.name.replace(".json","")}):u(new Error("File content is not a string"))}catch(m){u(m)}},g.onerror=u,g.readAsText(f)});return null},s=async f=>{var y,u;const p=[f];for(;p.length>0;){const g=p.shift();if(g&&!g.isFile){const d=await((y=Ve)==null?void 0:y.create({name:g.name,parentFolderID:g.parentFolderID}));if(g.children&&g.children.length){const b=[];g.children.forEach(m=>{m.isFile&&m.file?b.push(m.file):(m.parentFolderID=d==null?void 0:d.id,p.push(m))}),b.length&&await((u=be)==null?void 0:u.batchCreateFlows(b,void 0,d==null?void 0:d.id))}}}n==null||n()},c=async f=>{var y;const p=f.target.files;if(p)if(o==="folder"){const u={name:p[0].webkitRelativePath.split("/")[0],isFile:!1,children:[]};for(const g of p)if(g.name!==".DS_Store"){const d=g.webkitRelativePath.split("/");let b=u.children??[];for(let m=1;mC.name===w);if(!_){if(_={name:w,isFile:m===d.length-1,children:m===d.length-1?void 0:[]},_.isFile){const C=await r(g);C&&(_.file=C)}b.push(_)}_&&!_.isFile&&(b=_.children)}}s(u)}else{const u=[];for(const g of p){const d=await r(g);d&&u.push(d)}u.length&&(await((y=be)==null?void 0:y.batchCreateFlows(u,void 0,l)),n&&n())}};return x.jsxs(x.Fragment,{children:[e?x.jsx(Re,{onClick:f=>{f.stopPropagation(),a("file")},icon:x.jsx(mn,{size:19}),children:"Import workflows"}):x.jsxs(Xe,{closeOnSelect:!0,children:[x.jsx(jt,{as:Se,leftIcon:x.jsx(mn,{size:18}),variant:"outline",iconSpacing:1,size:"sm",colorScheme:"teal",children:"Import"}),x.jsx(at,{children:hi.map((f,p)=>x.jsx(Re,{onClick:()=>{a(f.type)},iconSpacing:2,icon:f.type==="folder"?x.jsx(Xn,{size:18}):x.jsx(Wi,{size:18}),children:f.title},p))})]}),x.jsx("input",{style:{display:"none"},ref:i,type:"file",accept:".json,image/png",multiple:!0,onChange:c,onClick:f=>{f.stopPropagation()}})]})}function ha({folder:l,onclose:e}){const[n,o]=F.useState(l.name),[t,i]=F.useState(""),{onRefreshFilesList:a}=F.useContext(Be),r=c=>{o(c.target.value),t&&i("")},s=async()=>{var p,y;const c=n.trim();if(o(c),c===l.name)return e();await((p=Ve)==null?void 0:p.generateUniqueName(c,l.parentFolderID??""))!==c?i("The name is duplicated, please modify it and submit again."):(await((y=Ve)==null?void 0:y.update(l.id,{name:c})),a&&a(),e())};return x.jsxs(vt,{isOpen:!0,onClose:e,children:[x.jsx(gt,{}),x.jsxs(bt,{children:[x.jsx(yt,{children:"Edit folder name"}),x.jsx(wt,{}),x.jsx(xt,{children:x.jsxs(fi,{isInvalid:!!t,children:[x.jsx(pi,{children:"Folder name"}),x.jsx(it,{value:n,onChange:r,autoFocus:!0,onKeyUp:c=>{c.code==="Enter"&&!t&&n&&s()}}),t&&x.jsx(mi,{children:t})]})}),x.jsxs(Hr,{children:[x.jsx(Se,{colorScheme:"teal",mr:3,onClick:s,isDisabled:!n||!!t,children:"Save"}),x.jsx(Se,{onClick:e,children:"Cancel"})]})]})]})}function fa({menuPosition:l,isopen:e,folder:n,onClose:o}){const[t,i]=F.useState(!1),{onRefreshFilesList:a}=F.useContext(Be),{showDialog:r}=$n(),s=async y=>{var u;y.stopPropagation(),await((u=Ve)==null?void 0:u.create({name:"New Folder",parentFolderID:n.id})),a&&a()},c=async y=>{var u;y.stopPropagation(),await((u=be)==null?void 0:u.createFlow({json:JSON.stringify(vi),parentFolderID:n.id})),a&&a()},f=async y=>{y.stopPropagation();const u=await gi(n.id);r(`Do you want to delete the ${u} files inside the folder too?`,[{label:"Delete all files",colorScheme:"red",onClick:()=>{p(bi.DELETE)}}])},p=async y=>{var u;await((u=Ve)==null?void 0:u.deleteFolder(n.id,y)),o(),a&&a()};return x.jsxs(x.Fragment,{children:[x.jsx(de,{position:"absolute",top:l.y,left:l.x,children:x.jsx(Xe,{isOpen:e,onClose:o,isLazy:!0,lazyBehavior:"keepMounted",children:x.jsxs(at,{children:[x.jsx(Re,{icon:x.jsx(Yi,{size:19}),onClick:y=>{y.preventDefault(),y.stopPropagation(),i(!0)},children:"Rename"}),x.jsx(Re,{icon:x.jsx(Gn,{size:19}),onClick:f,children:"Delete"}),x.jsx(Re,{onClick:s,icon:x.jsx(nr,{size:19}),children:"New folder"}),x.jsx(Re,{onClick:c,icon:x.jsx(tn,{size:19}),children:"New file"}),x.jsx(or,{parentFolderID:n.id,onlyImportFile:!0})]})})}),t&&x.jsx(ha,{folder:n,onclose:()=>i(!1)})]})}const bn=F.memo(function({folder:e}){const[n,o]=F.useState(!1),[t,i]=F.useState(e.isCollapse??!0),[a,r]=F.useState([]),[s,c]=F.useState({x:0,y:0}),[f,p]=F.useState(!1),{colorMode:y}=qt(),{draggingFile:u,setDraggingFile:g,refreshFolderStamp:d,onRefreshFilesList:b}=F.useContext(Be),m=y==="light"?{backgroundColor:"#E2E8F0"}:{backgroundColor:"#4A5568"};F.useEffect(()=>{var C;t||(C=be)==null||C.listFolderContent(e.id,window.localStorage.getItem($t)).then(I=>{r(I)})},[e.id,d,t]);const w=C=>{C.preventDefault(),c({x:C.clientX,y:C.clientY}),p(!0)},_=async C=>{var I,P;if(C.preventDefault(),C.stopPropagation(),!u)return o(!1);if(He(u)){if(u.id===e.id)return o(!1);await((I=Ve)==null?void 0:I.update(u.id,{parentFolderID:e.id}))}else He(u)||await((P=be)==null?void 0:P.updateFolder(u.id,{parentFolderID:e.id}));await(b==null?void 0:b()),o(!1)};return F.useEffect(()=>{var C;!!e.isCollapse!==t&&((C=Ve)==null||C.update(e.id,{isCollapse:t}))},[t]),F.useEffect(()=>{var D;const C=(D=be)==null?void 0:D.curWorkflow,I=(C==null?void 0:C.parentFolderID)+"/",P=e.id+"/";I.startsWith(P)&&i(!1)},[]),x.jsxs(Le,{children:[x.jsxs(we,{w:"100%",as:"button",py:1,onClick:()=>{i(!t)},onContextMenu:w,draggable:"true",onDragOver:C=>{C.preventDefault(),C.stopPropagation(),o(!0)},onDragLeave:C=>{C.preventDefault(),C.stopPropagation(),o(!1)},onDragStart:()=>g==null?void 0:g(e),onDrop:_,_hover:m,style:n||f?m:void 0,className:"droppable",children:[x.jsxs(we,{gap:1,children:[t?x.jsx(Fi,{size:20}):x.jsx(en,{size:20}),x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#EFC54D",style:{width:"1.2rem",height:"1.2rem"},children:x.jsx("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"})})]}),x.jsx(Oe,{children:e.name})]}),x.jsx(fa,{isopen:f,menuPosition:s,onClose:()=>p(!1),folder:e}),!t&&x.jsx(Le,{ml:4,gap:0,children:x.jsx(Lr,{items:a})})]})});function yn(l,e){var n=Object.keys(l);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(l);e&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(l,t).enumerable})),n.push.apply(n,o)}return n}function re(l){for(var e=1;el.length)&&(e=l.length);for(var n=0,o=new Array(e);n=this.index;s--)c=(c<<8)+this.byteAt(s);return this.index+=r,c},readString:function(r){return i.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},o.exports=a},{"../utils":32}],19:[function(n,o,t){var i=n("./Uint8ArrayReader");function a(r){i.call(this,r)}n("../utils").inherits(a,i),a.prototype.readData=function(r){this.checkOffset(r);var s=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,s},o.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,o,t){var i=n("./DataReader");function a(r){i.call(this,r)}n("../utils").inherits(a,i),a.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},a.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},a.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},a.prototype.readData=function(r){this.checkOffset(r);var s=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,s},o.exports=a},{"../utils":32,"./DataReader":18}],21:[function(n,o,t){var i=n("./ArrayReader");function a(r){i.call(this,r)}n("../utils").inherits(a,i),a.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var s=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,s},o.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(n,o,t){var i=n("../utils"),a=n("../support"),r=n("./ArrayReader"),s=n("./StringReader"),c=n("./NodeBufferReader"),f=n("./Uint8ArrayReader");o.exports=function(p){var y=i.getTypeOf(p);return i.checkSupport(y),y!=="string"||a.uint8array?y==="nodebuffer"?new c(p):a.uint8array?new f(i.transformTo("uint8array",p)):new r(i.transformTo("array",p)):new s(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,o,t){t.LOCAL_FILE_HEADER="PK",t.CENTRAL_FILE_HEADER="PK",t.CENTRAL_DIRECTORY_END="PK",t.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",t.ZIP64_CENTRAL_DIRECTORY_END="PK",t.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,o,t){var i=n("./GenericWorker"),a=n("../utils");function r(s){i.call(this,"ConvertWorker to "+s),this.destType=s}a.inherits(r,i),r.prototype.processChunk=function(s){this.push({data:a.transformTo(this.destType,s.data),meta:s.meta})},o.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(n,o,t){var i=n("./GenericWorker"),a=n("../crc32");function r(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(r,i),r.prototype.processChunk=function(s){this.streamInfo.crc32=a(s.data,this.streamInfo.crc32||0),this.push(s)},o.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,o,t){var i=n("../utils"),a=n("./GenericWorker");function r(s){a.call(this,"DataLengthProbe for "+s),this.propName=s,this.withStreamInfo(s,0)}i.inherits(r,a),r.prototype.processChunk=function(s){if(s){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+s.data.length}a.prototype.processChunk.call(this,s)},o.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(n,o,t){var i=n("../utils"),a=n("./GenericWorker");function r(s){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,s.then(function(f){c.dataIsReady=!0,c.data=f,c.max=f&&f.length||0,c.type=i.getTypeOf(f),c.isPaused||c._tickAndRepeat()},function(f){c.error(f)})}i.inherits(r,a),r.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var s=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":s=this.data.substring(this.index,c);break;case"uint8array":s=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":s=this.data.slice(this.index,c)}return this.index=c,this.push({data:s,meta:{percent:this.max?this.index/this.max*100:0}})},o.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(n,o,t){function i(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,r){return this._listeners[a].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,r){if(this._listeners[a])for(var s=0;s "+a:a}},o.exports=i},{}],29:[function(n,o,t){var i=n("../utils"),a=n("./ConvertWorker"),r=n("./GenericWorker"),s=n("../base64"),c=n("../support"),f=n("../external"),p=null;if(c.nodestream)try{p=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function y(g,d){return new f.Promise(function(b,m){var w=[],_=g._internalType,C=g._outputType,I=g._mimeType;g.on("data",function(P,E){w.push(P),d&&d(E)}).on("error",function(P){w=[],m(P)}).on("end",function(){try{var P=function(E,D,j){switch(E){case"blob":return i.newBlob(i.transformTo("arraybuffer",D),j);case"base64":return s.encode(D);default:return i.transformTo(E,D)}}(C,function(E,D){var j,U=0,q=null,O=0;for(j=0;j"u")t.blob=!1;else{var i=new ArrayBuffer(0);try{t.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(i),t.blob=a.getBlob("application/zip").size===0}catch{t.blob=!1}}}try{t.nodestream=!!n("readable-stream").Readable}catch{t.nodestream=!1}},{"readable-stream":16}],31:[function(n,o,t){for(var i=n("./utils"),a=n("./support"),r=n("./nodejsUtils"),s=n("./stream/GenericWorker"),c=new Array(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;c[254]=c[254]=1;function p(){s.call(this,"utf-8 decode"),this.leftOver=null}function y(){s.call(this,"utf-8 encode")}t.utf8encode=function(u){return a.nodebuffer?r.newBufferFrom(u,"utf-8"):function(g){var d,b,m,w,_,C=g.length,I=0;for(w=0;w>>6:(b<65536?d[_++]=224|b>>>12:(d[_++]=240|b>>>18,d[_++]=128|b>>>12&63),d[_++]=128|b>>>6&63),d[_++]=128|63&b);return d}(u)},t.utf8decode=function(u){return a.nodebuffer?i.transformTo("nodebuffer",u).toString("utf-8"):function(g){var d,b,m,w,_=g.length,C=new Array(2*_);for(d=b=0;d<_;)if((m=g[d++])<128)C[b++]=m;else if(4<(w=c[m]))C[b++]=65533,d+=w-1;else{for(m&=w===2?31:w===3?15:7;1>10&1023,C[b++]=56320|1023&m)}return C.length!==b&&(C.subarray?C=C.subarray(0,b):C.length=b),i.applyFromCharCode(C)}(u=i.transformTo(a.uint8array?"uint8array":"array",u))},i.inherits(p,s),p.prototype.processChunk=function(u){var g=i.transformTo(a.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var d=g;(g=new Uint8Array(d.length+this.leftOver.length)).set(this.leftOver,0),g.set(d,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var b=function(w,_){var C;for((_=_||w.length)>w.length&&(_=w.length),C=_-1;0<=C&&(192&w[C])==128;)C--;return C<0||C===0?_:C+c[w[C]]>_?C:_}(g),m=g;b!==g.length&&(a.uint8array?(m=g.subarray(0,b),this.leftOver=g.subarray(b,g.length)):(m=g.slice(0,b),this.leftOver=g.slice(b,g.length))),this.push({data:t.utf8decode(m),meta:u.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=p,i.inherits(y,s),y.prototype.processChunk=function(u){this.push({data:t.utf8encode(u.data),meta:u.meta})},t.Utf8EncodeWorker=y},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,o,t){var i=n("./support"),a=n("./base64"),r=n("./nodejsUtils"),s=n("./external");function c(d){return d}function f(d,b){for(var m=0;m>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=i(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var g,d,b,m=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4>>6:(u<65536?y[b++]=224|u>>>12:(y[b++]=240|u>>>18,y[b++]=128|u>>>12&63),y[b++]=128|u>>>6&63),y[b++]=128|63&u);return y},t.buf2binstring=function(p){return f(p,p.length)},t.binstring2buf=function(p){for(var y=new i.Buf8(p.length),u=0,g=y.length;u>10&1023,w[g++]=56320|1023&d)}return f(w,g)},t.utf8border=function(p,y){var u;for((y=y||p.length)>p.length&&(y=p.length),u=y-1;0<=u&&(192&p[u])==128;)u--;return u<0||u===0?y:u+s[p[u]]>y?u:y}},{"./common":41}],43:[function(n,o,t){o.exports=function(i,a,r,s){for(var c=65535&i|0,f=i>>>16&65535|0,p=0;r!==0;){for(r-=p=2e3>>1:a>>>1;r[s]=a}return r}();o.exports=function(a,r,s,c){var f=i,p=c+s;a^=-1;for(var y=c;y>>8^f[255&(a^r[y])];return-1^a}},{}],46:[function(n,o,t){var i,a=n("../utils/common"),r=n("./trees"),s=n("./adler32"),c=n("./crc32"),f=n("./messages"),p=0,y=4,u=0,g=-2,d=-1,b=4,m=2,w=8,_=9,C=286,I=30,P=19,E=2*C+1,D=15,j=3,U=258,q=U+j+1,O=42,L=113,v=1,B=2,te=3,T=4;function J(h,$){return h.msg=f[$],$}function N(h){return(h<<1)-(4h.avail_out&&(V=h.avail_out),V!==0&&(a.arraySet(h.output,$.pending_buf,$.pending_out,V,h.next_out),h.next_out+=V,$.pending_out+=V,h.total_out+=V,h.avail_out-=V,$.pending-=V,$.pending===0&&($.pending_out=0))}function z(h,$){r._tr_flush_block(h,0<=h.block_start?h.block_start:-1,h.strstart-h.block_start,$),h.block_start=h.strstart,A(h.strm)}function ee(h,$){h.pending_buf[h.pending++]=$}function X(h,$){h.pending_buf[h.pending++]=$>>>8&255,h.pending_buf[h.pending++]=255&$}function Z(h,$){var V,k,S=h.max_chain_length,M=h.strstart,W=h.prev_length,H=h.nice_match,R=h.strstart>h.w_size-q?h.strstart-(h.w_size-q):0,G=h.window,Q=h.w_mask,Y=h.prev,ne=h.strstart+U,fe=G[M+W-1],ue=G[M+W];h.prev_length>=h.good_match&&(S>>=2),H>h.lookahead&&(H=h.lookahead);do if(G[(V=$)+W]===ue&&G[V+W-1]===fe&&G[V]===G[M]&&G[++V]===G[M+1]){M+=2,V++;do;while(G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&G[++M]===G[++V]&&MR&&--S!=0);return W<=h.lookahead?W:h.lookahead}function ce(h){var $,V,k,S,M,W,H,R,G,Q,Y=h.w_size;do{if(S=h.window_size-h.lookahead-h.strstart,h.strstart>=Y+(Y-q)){for(a.arraySet(h.window,h.window,Y,Y,0),h.match_start-=Y,h.strstart-=Y,h.block_start-=Y,$=V=h.hash_size;k=h.head[--$],h.head[$]=Y<=k?k-Y:0,--V;);for($=V=Y;k=h.prev[--$],h.prev[$]=Y<=k?k-Y:0,--V;);S+=Y}if(h.strm.avail_in===0)break;if(W=h.strm,H=h.window,R=h.strstart+h.lookahead,G=S,Q=void 0,Q=W.avail_in,G=j)for(M=h.strstart-h.insert,h.ins_h=h.window[M],h.ins_h=(h.ins_h<=j&&(h.ins_h=(h.ins_h<=j)if(k=r._tr_tally(h,h.strstart-h.match_start,h.match_length-j),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=j){for(h.match_length--;h.strstart++,h.ins_h=(h.ins_h<=j&&(h.ins_h=(h.ins_h<=j&&h.match_length<=h.prev_length){for(S=h.strstart+h.lookahead-j,k=r._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-j),h.lookahead-=h.prev_length-1,h.prev_length-=2;++h.strstart<=S&&(h.ins_h=(h.ins_h<h.pending_buf_size-5&&(V=h.pending_buf_size-5);;){if(h.lookahead<=1){if(ce(h),h.lookahead===0&&$===p)return v;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var k=h.block_start+V;if((h.strstart===0||h.strstart>=k)&&(h.lookahead=h.strstart-k,h.strstart=k,z(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-q&&(z(h,!1),h.strm.avail_out===0))return v}return h.insert=0,$===y?(z(h,!0),h.strm.avail_out===0?te:T):(h.strstart>h.block_start&&(z(h,!1),h.strm.avail_out),v)}),new le(4,4,8,4,he),new le(4,5,16,8,he),new le(4,6,32,32,he),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(h,$){return ke(h,$,w,15,8,0)},t.deflateInit2=ke,t.deflateReset=Ce,t.deflateResetKeep=pe,t.deflateSetHeader=function(h,$){return h&&h.state?h.state.wrap!==2?g:(h.state.gzhead=$,u):g},t.deflate=function(h,$){var V,k,S,M;if(!h||!h.state||5<$||$<0)return h?J(h,g):g;if(k=h.state,!h.output||!h.input&&h.avail_in!==0||k.status===666&&$!==y)return J(h,h.avail_out===0?-5:g);if(k.strm=h,V=k.last_flush,k.last_flush=$,k.status===O)if(k.wrap===2)h.adler=0,ee(k,31),ee(k,139),ee(k,8),k.gzhead?(ee(k,(k.gzhead.text?1:0)+(k.gzhead.hcrc?2:0)+(k.gzhead.extra?4:0)+(k.gzhead.name?8:0)+(k.gzhead.comment?16:0)),ee(k,255&k.gzhead.time),ee(k,k.gzhead.time>>8&255),ee(k,k.gzhead.time>>16&255),ee(k,k.gzhead.time>>24&255),ee(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),ee(k,255&k.gzhead.os),k.gzhead.extra&&k.gzhead.extra.length&&(ee(k,255&k.gzhead.extra.length),ee(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(h.adler=c(h.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=69):(ee(k,0),ee(k,0),ee(k,0),ee(k,0),ee(k,0),ee(k,k.level===9?2:2<=k.strategy||k.level<2?4:0),ee(k,3),k.status=L);else{var W=w+(k.w_bits-8<<4)<<8;W|=(2<=k.strategy||k.level<2?0:k.level<6?1:k.level===6?2:3)<<6,k.strstart!==0&&(W|=32),W+=31-W%31,k.status=L,X(k,W),k.strstart!==0&&(X(k,h.adler>>>16),X(k,65535&h.adler)),h.adler=1}if(k.status===69)if(k.gzhead.extra){for(S=k.pending;k.gzindex<(65535&k.gzhead.extra.length)&&(k.pending!==k.pending_buf_size||(k.gzhead.hcrc&&k.pending>S&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),A(h),S=k.pending,k.pending!==k.pending_buf_size));)ee(k,255&k.gzhead.extra[k.gzindex]),k.gzindex++;k.gzhead.hcrc&&k.pending>S&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),k.gzindex===k.gzhead.extra.length&&(k.gzindex=0,k.status=73)}else k.status=73;if(k.status===73)if(k.gzhead.name){S=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>S&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),A(h),S=k.pending,k.pending===k.pending_buf_size)){M=1;break}M=k.gzindexS&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),M===0&&(k.gzindex=0,k.status=91)}else k.status=91;if(k.status===91)if(k.gzhead.comment){S=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>S&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),A(h),S=k.pending,k.pending===k.pending_buf_size)){M=1;break}M=k.gzindexS&&(h.adler=c(h.adler,k.pending_buf,k.pending-S,S)),M===0&&(k.status=103)}else k.status=103;if(k.status===103&&(k.gzhead.hcrc?(k.pending+2>k.pending_buf_size&&A(h),k.pending+2<=k.pending_buf_size&&(ee(k,255&h.adler),ee(k,h.adler>>8&255),h.adler=0,k.status=L)):k.status=L),k.pending!==0){if(A(h),h.avail_out===0)return k.last_flush=-1,u}else if(h.avail_in===0&&N($)<=N(V)&&$!==y)return J(h,-5);if(k.status===666&&h.avail_in!==0)return J(h,-5);if(h.avail_in!==0||k.lookahead!==0||$!==p&&k.status!==666){var H=k.strategy===2?function(R,G){for(var Q;;){if(R.lookahead===0&&(ce(R),R.lookahead===0)){if(G===p)return v;break}if(R.match_length=0,Q=r._tr_tally(R,0,R.window[R.strstart]),R.lookahead--,R.strstart++,Q&&(z(R,!1),R.strm.avail_out===0))return v}return R.insert=0,G===y?(z(R,!0),R.strm.avail_out===0?te:T):R.last_lit&&(z(R,!1),R.strm.avail_out===0)?v:B}(k,$):k.strategy===3?function(R,G){for(var Q,Y,ne,fe,ue=R.window;;){if(R.lookahead<=U){if(ce(R),R.lookahead<=U&&G===p)return v;if(R.lookahead===0)break}if(R.match_length=0,R.lookahead>=j&&0R.lookahead&&(R.match_length=R.lookahead)}if(R.match_length>=j?(Q=r._tr_tally(R,1,R.match_length-j),R.lookahead-=R.match_length,R.strstart+=R.match_length,R.match_length=0):(Q=r._tr_tally(R,0,R.window[R.strstart]),R.lookahead--,R.strstart++),Q&&(z(R,!1),R.strm.avail_out===0))return v}return R.insert=0,G===y?(z(R,!0),R.strm.avail_out===0?te:T):R.last_lit&&(z(R,!1),R.strm.avail_out===0)?v:B}(k,$):i[k.level].func(k,$);if(H!==te&&H!==T||(k.status=666),H===v||H===te)return h.avail_out===0&&(k.last_flush=-1),u;if(H===B&&($===1?r._tr_align(k):$!==5&&(r._tr_stored_block(k,0,0,!1),$===3&&(K(k.head),k.lookahead===0&&(k.strstart=0,k.block_start=0,k.insert=0))),A(h),h.avail_out===0))return k.last_flush=-1,u}return $!==y?u:k.wrap<=0?1:(k.wrap===2?(ee(k,255&h.adler),ee(k,h.adler>>8&255),ee(k,h.adler>>16&255),ee(k,h.adler>>24&255),ee(k,255&h.total_in),ee(k,h.total_in>>8&255),ee(k,h.total_in>>16&255),ee(k,h.total_in>>24&255)):(X(k,h.adler>>>16),X(k,65535&h.adler)),A(h),0=V.w_size&&(M===0&&(K(V.head),V.strstart=0,V.block_start=0,V.insert=0),G=new a.Buf8(V.w_size),a.arraySet(G,$,Q-V.w_size,V.w_size,0),$=G,Q=V.w_size),W=h.avail_in,H=h.next_in,R=h.input,h.avail_in=Q,h.next_in=0,h.input=$,ce(V);V.lookahead>=j;){for(k=V.strstart,S=V.lookahead-(j-1);V.ins_h=(V.ins_h<>>=j=D>>>24,_-=j,(j=D>>>16&255)===0)B[f++]=65535&D;else{if(!(16&j)){if(!(64&j)){D=C[(65535&D)+(w&(1<>>=j,_-=j),_<15&&(w+=v[s++]<<_,_+=8,w+=v[s++]<<_,_+=8),D=I[w&E];n:for(;;){if(w>>>=j=D>>>24,_-=j,!(16&(j=D>>>16&255))){if(!(64&j)){D=I[(65535&D)+(w&(1<>>=j,_-=j,(j=f-p)>3,w&=(1<<(_-=U<<3))-1,i.next_in=s,i.next_out=f,i.avail_in=s>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function w(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(O){var L;return O&&O.state?(L=O.state,O.total_in=O.total_out=L.total=0,O.msg="",L.wrap&&(O.adler=1&L.wrap),L.mode=g,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new i.Buf32(d),L.distcode=L.distdyn=new i.Buf32(b),L.sane=1,L.back=-1,y):u}function C(O){var L;return O&&O.state?((L=O.state).wsize=0,L.whave=0,L.wnext=0,_(O)):u}function I(O,L){var v,B;return O&&O.state?(B=O.state,L<0?(v=0,L=-L):(v=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15=T.wsize?(i.arraySet(T.window,L,v-T.wsize,T.wsize,0),T.wnext=0,T.whave=T.wsize):(B<(te=T.wsize-T.wnext)&&(te=B),i.arraySet(T.window,L,v-B,te,T.wnext),(B-=te)?(i.arraySet(T.window,L,v-B,B,0),T.wnext=B,T.whave=T.wsize):(T.wnext+=te,T.wnext===T.wsize&&(T.wnext=0),T.whave>>8&255,v.check=r(v.check,M,2,0),z=A=0,v.mode=2;break}if(v.flags=0,v.head&&(v.head.done=!1),!(1&v.wrap)||(((255&A)<<8)+(A>>8))%31){O.msg="incorrect header check",v.mode=30;break}if((15&A)!=8){O.msg="unknown compression method",v.mode=30;break}if(z-=4,h=8+(15&(A>>>=4)),v.wbits===0)v.wbits=h;else if(h>v.wbits){O.msg="invalid window size",v.mode=30;break}v.dmax=1<>8&1),512&v.flags&&(M[0]=255&A,M[1]=A>>>8&255,v.check=r(v.check,M,2,0)),z=A=0,v.mode=3;case 3:for(;z<32;){if(N===0)break e;N--,A+=B[T++]<>>8&255,M[2]=A>>>16&255,M[3]=A>>>24&255,v.check=r(v.check,M,4,0)),z=A=0,v.mode=4;case 4:for(;z<16;){if(N===0)break e;N--,A+=B[T++]<>8),512&v.flags&&(M[0]=255&A,M[1]=A>>>8&255,v.check=r(v.check,M,2,0)),z=A=0,v.mode=5;case 5:if(1024&v.flags){for(;z<16;){if(N===0)break e;N--,A+=B[T++]<>>8&255,v.check=r(v.check,M,2,0)),z=A=0}else v.head&&(v.head.extra=null);v.mode=6;case 6:if(1024&v.flags&&(N<(Z=v.length)&&(Z=N),Z&&(v.head&&(h=v.head.extra_len-v.length,v.head.extra||(v.head.extra=new Array(v.head.extra_len)),i.arraySet(v.head.extra,B,T,Z,h)),512&v.flags&&(v.check=r(v.check,B,Z,T)),N-=Z,T+=Z,v.length-=Z),v.length))break e;v.length=0,v.mode=7;case 7:if(2048&v.flags){if(N===0)break e;for(Z=0;h=B[T+Z++],v.head&&h&&v.length<65536&&(v.head.name+=String.fromCharCode(h)),h&&Z>9&1,v.head.done=!0),O.adler=v.check=0,v.mode=12;break;case 10:for(;z<32;){if(N===0)break e;N--,A+=B[T++]<>>=7&z,z-=7&z,v.mode=27;break}for(;z<3;){if(N===0)break e;N--,A+=B[T++]<>>=1)){case 0:v.mode=14;break;case 1:if(U(v),v.mode=20,L!==6)break;A>>>=2,z-=2;break e;case 2:v.mode=17;break;case 3:O.msg="invalid block type",v.mode=30}A>>>=2,z-=2;break;case 14:for(A>>>=7&z,z-=7&z;z<32;){if(N===0)break e;N--,A+=B[T++]<>>16^65535)){O.msg="invalid stored block lengths",v.mode=30;break}if(v.length=65535&A,z=A=0,v.mode=15,L===6)break e;case 15:v.mode=16;case 16:if(Z=v.length){if(N>>=5,z-=5,v.ndist=1+(31&A),A>>>=5,z-=5,v.ncode=4+(15&A),A>>>=4,z-=4,286>>=3,z-=3}for(;v.have<19;)v.lens[W[v.have++]]=0;if(v.lencode=v.lendyn,v.lenbits=7,V={bits:v.lenbits},$=c(0,v.lens,0,19,v.lencode,0,v.work,V),v.lenbits=V.bits,$){O.msg="invalid code lengths set",v.mode=30;break}v.have=0,v.mode=19;case 19:for(;v.have>>16&255,ge=65535&S,!((se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>>=se,z-=se,v.lens[v.have++]=ge;else{if(ge===16){for(k=se+2;z>>=se,z-=se,v.have===0){O.msg="invalid bit length repeat",v.mode=30;break}h=v.lens[v.have-1],Z=3+(3&A),A>>>=2,z-=2}else if(ge===17){for(k=se+3;z>>=se)),A>>>=3,z-=3}else{for(k=se+7;z>>=se)),A>>>=7,z-=7}if(v.have+Z>v.nlen+v.ndist){O.msg="invalid bit length repeat",v.mode=30;break}for(;Z--;)v.lens[v.have++]=h}}if(v.mode===30)break;if(v.lens[256]===0){O.msg="invalid code -- missing end-of-block",v.mode=30;break}if(v.lenbits=9,V={bits:v.lenbits},$=c(f,v.lens,0,v.nlen,v.lencode,0,v.work,V),v.lenbits=V.bits,$){O.msg="invalid literal/lengths set",v.mode=30;break}if(v.distbits=6,v.distcode=v.distdyn,V={bits:v.distbits},$=c(p,v.lens,v.nlen,v.ndist,v.distcode,0,v.work,V),v.distbits=V.bits,$){O.msg="invalid distances set",v.mode=30;break}if(v.mode=20,L===6)break e;case 20:v.mode=21;case 21:if(6<=N&&258<=K){O.next_out=J,O.avail_out=K,O.next_in=T,O.avail_in=N,v.hold=A,v.bits=z,s(O,X),J=O.next_out,te=O.output,K=O.avail_out,T=O.next_in,B=O.input,N=O.avail_in,A=v.hold,z=v.bits,v.mode===12&&(v.back=-1);break}for(v.back=0;le=(S=v.lencode[A&(1<>>16&255,ge=65535&S,!((se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>pe)])>>>16&255,ge=65535&S,!(pe+(se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>>=pe,z-=pe,v.back+=pe}if(A>>>=se,z-=se,v.back+=se,v.length=ge,le===0){v.mode=26;break}if(32&le){v.back=-1,v.mode=12;break}if(64&le){O.msg="invalid literal/length code",v.mode=30;break}v.extra=15&le,v.mode=22;case 22:if(v.extra){for(k=v.extra;z>>=v.extra,z-=v.extra,v.back+=v.extra}v.was=v.length,v.mode=23;case 23:for(;le=(S=v.distcode[A&(1<>>16&255,ge=65535&S,!((se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>pe)])>>>16&255,ge=65535&S,!(pe+(se=S>>>24)<=z);){if(N===0)break e;N--,A+=B[T++]<>>=pe,z-=pe,v.back+=pe}if(A>>>=se,z-=se,v.back+=se,64&le){O.msg="invalid distance code",v.mode=30;break}v.offset=ge,v.extra=15&le,v.mode=24;case 24:if(v.extra){for(k=v.extra;z>>=v.extra,z-=v.extra,v.back+=v.extra}if(v.offset>v.dmax){O.msg="invalid distance too far back",v.mode=30;break}v.mode=25;case 25:if(K===0)break e;if(Z=X-K,v.offset>Z){if((Z=v.offset-Z)>v.whave&&v.sane){O.msg="invalid distance too far back",v.mode=30;break}ce=Z>v.wnext?(Z-=v.wnext,v.wsize-Z):v.wnext-Z,Z>v.length&&(Z=v.length),he=v.window}else he=te,ce=J-v.offset,Z=v.length;for(KE?(j=ce[he+b[L]],z[ee+b[L]]):(j=96,0),w=1<>J)+(_-=w)]=D<<24|j<<16|U|0,_!==0;);for(w=1<>=1;if(w!==0?(A&=w-1,A+=w):A=0,L++,--X[O]==0){if(O===B)break;O=p[y+b[L]]}if(te>>7)]}function ee(S,M){S.pending_buf[S.pending++]=255&M,S.pending_buf[S.pending++]=M>>>8&255}function X(S,M,W){S.bi_valid>m-W?(S.bi_buf|=M<>m-S.bi_valid,S.bi_valid+=W-m):(S.bi_buf|=M<>>=1,W<<=1,0<--M;);return W>>>1}function he(S,M,W){var H,R,G=new Array(b+1),Q=0;for(H=1;H<=b;H++)G[H]=Q=Q+W[H-1]<<1;for(R=0;R<=M;R++){var Y=S[2*R+1];Y!==0&&(S[2*R]=ce(G[Y]++,Y))}}function se(S){var M;for(M=0;M>1;1<=W;W--)pe(S,G,W);for(R=ne;W=S.heap[1],S.heap[1]=S.heap[S.heap_len--],pe(S,G,1),H=S.heap[1],S.heap[--S.heap_max]=W,S.heap[--S.heap_max]=H,G[2*R]=G[2*W]+G[2*H],S.depth[R]=(S.depth[W]>=S.depth[H]?S.depth[W]:S.depth[H])+1,G[2*W+1]=G[2*H+1]=R,S.heap[1]=R++,pe(S,G,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ue,Ee){var qe,ze,Je,ve,st,zt,Ae=Ee.dyn_tree,un=Ee.max_code,Vr=Ee.stat_desc.static_tree,Br=Ee.stat_desc.has_stree,Nr=Ee.stat_desc.extra_bits,cn=Ee.stat_desc.extra_base,Qe=Ee.stat_desc.max_length,lt=0;for(ve=0;ve<=b;ve++)ue.bl_count[ve]=0;for(Ae[2*ue.heap[ue.heap_max]+1]=0,qe=ue.heap_max+1;qe>=7;R>>=1)if(1&fe&&Y.dyn_ltree[2*ne]!==0)return a;if(Y.dyn_ltree[18]!==0||Y.dyn_ltree[20]!==0||Y.dyn_ltree[26]!==0)return r;for(ne=32;ne>>3,(G=S.static_len+3+7>>>3)<=R&&(R=G)):R=G=W+5,W+4<=R&&M!==-1?k(S,M,W,H):S.strategy===4||G===R?(X(S,2+(H?1:0),3),Ce(S,q,O)):(X(S,4+(H?1:0),3),function(Y,ne,fe,ue){var Ee;for(X(Y,ne-257,5),X(Y,fe-1,5),X(Y,ue-4,4),Ee=0;Ee>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&M,S.pending_buf[S.l_buf+S.last_lit]=255&W,S.last_lit++,M===0?S.dyn_ltree[2*W]++:(S.matches++,M--,S.dyn_ltree[2*(v[W]+p+1)]++,S.dyn_dtree[2*z(M)]++),S.last_lit===S.lit_bufsize-1},t._tr_align=function(S){X(S,2,3),Z(S,_,q),function(M){M.bi_valid===16?(ee(M,M.bi_buf),M.bi_buf=0,M.bi_valid=0):8<=M.bi_valid&&(M.pending_buf[M.pending++]=255&M.bi_buf,M.bi_buf>>=8,M.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(n,o,t){o.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,o,t){(function(i){(function(a,r){if(!a.setImmediate){var s,c,f,p,y=1,u={},g=!1,d=a.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(a);b=b&&b.setTimeout?b:a,s={}.toString.call(a.process)==="[object process]"?function(C){process.nextTick(function(){w(C)})}:function(){if(a.postMessage&&!a.importScripts){var C=!0,I=a.onmessage;return a.onmessage=function(){C=!1},a.postMessage("","*"),a.onmessage=I,C}}()?(p="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",_,!1):a.attachEvent("onmessage",_),function(C){a.postMessage(p+C,"*")}):a.MessageChannel?((f=new MessageChannel).port1.onmessage=function(C){w(C.data)},function(C){f.port2.postMessage(C)}):d&&"onreadystatechange"in d.createElement("script")?(c=d.documentElement,function(C){var I=d.createElement("script");I.onreadystatechange=function(){w(C),I.onreadystatechange=null,c.removeChild(I),I=null},c.appendChild(I)}):function(C){setTimeout(w,0,C)},b.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var I=new Array(arguments.length-1),P=0;P"u"?i===void 0?this:i:self)}).call(this,typeof ut<"u"?ut:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ir);var ta=ir.exports;const na=Wr(ta),ar=async l=>{var t;const e=`ComfyUI workspace workflows ${Kn(Date.now())}`,n=new na,o=await((t=ye)==null?void 0:t.getSetting("twoWaySync"));for(const i of l){let a;o?a=i.parentFolderID??"":a=await oi(i.parentFolderID??null).then(async s=>si(s??""));const r=n.folder(a);r==null||r.file(`${i.name}.json`,i.json)}n.generateAsync({type:"blob"}).then(function(i){const a=document.createElement("a");a.href=window.URL.createObjectURL(i),a.download=`${e}.zip`,document.body.appendChild(a),a.click(),document.body.removeChild(a)})};function ra(){const[l,e]=F.useState(!1),[n,o]=F.useState(""),{showDialog:t}=$n(),i=()=>{var r;(r=ye)==null||r.getSettings().then(s=>{o((s==null?void 0:s.myWorkflowsDir)??"undefined"),e(!!(s!=null&&s.twoWaySync))})};F.useEffect(()=>{i()},[]);const a=async r=>{var c,f;if(!r.target.checked){await((c=ye)==null?void 0:c.upsert({twoWaySync:r.target.checked})),i();return}const s=await((f=ye)==null?void 0:f.getSetting("myWorkflowsDir"));t(x.jsx(ia,{myWorkflowsDir:s??"undefined"}),[{label:"I have downloaded all my workflows and ready to enable",onClick:async()=>{var p;await((p=ye)==null?void 0:p.upsert({twoWaySync:!0})),i()}}])};return x.jsxs(Le,{children:[x.jsxs(Oe,{children:["If enabled, your workflows will be synced to and from ",x.jsx("b",{children:n}),x.jsx("br",{}),"You can manually move files into this folder using File Explorer or Finder to import them into your workspace."]}),x.jsx(ot,{isChecked:l,onChange:a,children:"Enable two way sync (🧪🧪beta)"})]})}function ia({myWorkflowsDir:l}){return x.jsxs(Le,{gap:3,children:[x.jsx("p",{children:"Your workflows will be synced to and from path:"}),x.jsx("p",{children:x.jsx("b",{children:l})}),x.jsxs("p",{children:["Please make sure this path is valid. You can change this path anytime in Settings ",">"," Workspace Save Direcotry"]}),x.jsxs("p",{children:[x.jsx("b",{children:"Please download all your workflows before enabling two way sync!"})," ","So you can manually import some workflows into your my_workflows/ directory on your disk in case something unexpected happens."]}),x.jsx(Se,{colorScheme:"teal",variant:"outline",width:"fit-content",size:"sm",onClick:async()=>{var n;const e=await((n=be)==null?void 0:n.listAll());ar(e??[])},children:"Download All My Workflows"})]})}function vn({settingKey:l,text:e,defaultChecked:n=!1}){const[o,t]=F.useState(n),i=()=>{var a;(a=ye)==null||a.getSetting(l).then(r=>{t(!!r)})};return F.useEffect(()=>{i()},[]),x.jsx(Le,{children:x.jsx(ot,{isChecked:o,onChange:async a=>{var r;await((r=ye)==null?void 0:r.upsert({[l]:a.target.checked})),i()},children:e})})}function aa({onClose:l}){const[e,n]=F.useState(!1),[o,t]=F.useState(!1),[i,a]=F.useState(""),[r,s]=F.useState([]),[c,f]=F.useState([]),[p,y]=F.useState(!1),u=F.useRef(null),g=li();F.useEffect(()=>{var E;(E=ye)==null||E.getSetting("myWorkflowsDir").then(D=>{a(D)})},[]);const d=async E=>{const{dir_path:D="",dir_contents:j=[],error:U=""}=await hn(E??"");return U.includes("Operation not permitted")?(y(!0),m(),{isError:!0}):{dirList:j,dirPath:D}},b=async()=>{const{isError:E=!1,dirList:D=[]}=await d(i);E||(f(D),t(!0),s(i&&i.split("/").filter(j=>!!j)||[]))},m=()=>{t(!1),n(!1),s([])},w=async E=>{var q,O,L;if(E){const{error:v=""}=await hn(E);if(v.includes("Not a directory")){g({title:"The directory address you entered is invalid, please re-enter it.",status:"warning",duration:5e3,position:"top",isClosable:!0});return}}const D=E??`/${r.join("/")}`;await((q=ye)==null?void 0:q.upsert({myWorkflowsDir:D}));const j=await((O=ye)==null?void 0:O.getSetting("myWorkflowsDir"))??"";a(j),E&&y(!1),m(),await((L=ye)==null?void 0:L.getSetting("twoWaySync"))||ci()},_=async()=>{const{dirPath:E,dirList:D}=await d("");s(E.split("/").filter(j=>!!j)),f(D)},C=async(E,D)=>{var O;let j="";E===-1&&D?j=`/${r.concat([D]).join("/")}`:j=`/${r.slice(0,E+1).join("/")}`;const{isError:U=!1,dirList:q=[]}=await d(j);U||(f(q),s((O=j.slice(1))==null?void 0:O.split("/")))},I=()=>{t(!0),n(!0)},P=x.jsxs(de,{textAlign:"end",mb:4,children:[x.jsx(it,{placeholder:"Please enter the absolute path directory address",ref:u,mt:2,mb:2}),x.jsx(Se,{colorScheme:"teal",mr:3,size:"sm",onClick:()=>{var E,D;(E=u==null?void 0:u.current)!=null&&E.value&&w((D=u==null?void 0:u.current)==null?void 0:D.value)},children:"Save"})]});return x.jsxs(x.Fragment,{children:[x.jsxs(vt,{isOpen:!0,onClose:l,size:"xl",children:[x.jsx(gt,{}),x.jsxs(bt,{children:[x.jsx(yt,{children:"Settings"}),x.jsx(wt,{}),x.jsx(xt,{pb:14,children:x.jsx(we,{children:x.jsxs(pn,{divider:x.jsx(ui,{borderColor:"gray.500"}),spacing:4,align:"stretch",w:"100%",children:[x.jsxs(de,{mb:4,children:[x.jsx(Oe,{mb:2,fontWeight:500,children:"Workspace Save Directory"}),o?e?P:x.jsxs(pn,{spacing:2,alignItems:"start",children:[x.jsx(Le,{spacing:"2px",direction:"row",wrap:"wrap",children:r.map((E,D)=>x.jsxs(x.Fragment,{children:["/",x.jsx(Se,{colorScheme:"teal",variant:"link",minW:1,onClick:()=>{C(D)},children:E},`${E}-${D}`)]}))}),x.jsx(Di,{columns:2,spacing:3,maxHeight:500,width:"100%",overflowY:"auto",children:c.map((E,D)=>x.jsx(Se,{size:"sm",leftIcon:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#EFC54D",style:{width:"1.2rem",height:"1.2rem"},children:x.jsx("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"})}),justifyContent:"start",onClick:()=>{C(-1,E)},children:E},`${E}-${D}`))}),x.jsxs(de,{w:"100%",textAlign:"end",children:[x.jsx(Se,{colorScheme:"teal",size:"sm",onClick:()=>{w()},children:"Save"}),x.jsx(Se,{size:"sm",onClick:_,mr:2,ml:2,children:"Reset"}),x.jsx(Se,{size:"sm",onClick:m,children:"Cancel"})]})]}):x.jsxs(nt,{children:[x.jsx(Gn,{overflowWrap:"anywhere",children:i}),x.jsx(Fe,{label:"Choose folder",children:x.jsx(xe,{"aria-label":"Select folder",size:"sm",ml:2,icon:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#EFC54D",style:{width:"1.4rem",height:"1.4srem"},children:x.jsx("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"})}),onClick:b})}),x.jsx(Fe,{label:"Input absolute path",children:x.jsx(xe,{"aria-label":"Enter folder address",size:"sm",ml:2,icon:x.jsx(Ui,{size:19}),onClick:I,variant:"ghost"})})]})]}),x.jsx(Qi,{}),x.jsx(vn,{settingKey:"autoSave",text:"Enable auto save workflow"}),x.jsx(ra,{}),x.jsx(ea,{}),x.jsx(vn,{settingKey:"overwriteCurWorkflowWhenDroppingFileToCanvas",text:"Overwrite current workflow when drag and drop workflow file to canvas"})]})})})]})]}),x.jsxs(vt,{isOpen:p,onClose:()=>y(!1),size:"xl",children:[x.jsx(gt,{}),x.jsxs(bt,{children:[x.jsx(yt,{children:"Kind tips"}),x.jsx(wt,{}),x.jsx(xt,{children:x.jsxs(de,{children:[navigator.userAgent.indexOf("Mac OS X")!==-1?x.jsxs(Oe,{fontWeight:500,children:["There is no permission to access the folder. You need to grant full disk access permission to the terminal that starts the ComfyUI program. For details, refer to the",x.jsx(Se,{colorScheme:"teal",variant:"link",as:"a",ml:2,target:"_block",href:`https://stackoverflow.com/questions/58479686/permissionerror-errno-1-operation-not-permitted-after-macos
+ -catalina-update`,children:"Document"}),", or you can manually enter the absolute path of the folder in the input box below to save."]}):x.jsx(Oe,{fontWeight:500,children:"You do not have permission to access the folder. It is recommended that you manually enter the absolute path address of the required folder."}),P]})})]})]})]})}const Rt=16;function oa({}){const[l,e]=F.useState(!1),[n,o]=F.useState(!1),{colorMode:t,toggleColorMode:i}=qt();return x.jsxs(x.Fragment,{children:[x.jsxs(Xe,{isLazy:!0,children:[x.jsx(jt,{as:xe,"aria-label":"Options",icon:x.jsx(Zi,{}),size:"sm",variant:"outline"}),x.jsxs(at,{children:[x.jsx(Re,{onClick:()=>o(!0),icon:x.jsx(Xi,{size:16}),fontSize:16,children:"Settings"}),x.jsx(Re,{onClick:()=>e(!0),icon:x.jsx(rr,{size:Rt}),fontSize:16,children:"Manage Tags"}),x.jsxs(Re,{onClick:i,icon:t==="light"?x.jsx(Gi,{size:Rt}):x.jsx(qi,{size:Rt}),fontSize:16,children:[t==="light"?"Dark":"Light"," Mode"]})]})]}),l&&x.jsx(Ji,{onclose:()=>e(!1)}),n&&x.jsx(aa,{onClose:()=>o(!1)})]})}function sa(l){const{multipleState:e,changeMultipleState:n,selectedKeys:o,isSelectedAll:t,batchOperationCallback:i}=l,a=async()=>{var c;const s=await((c=be)==null?void 0:c.batchQuery(o))??[];ar(s)},r=o.length===0;return x.jsx(we,{spacing:2,wrap:"wrap",mb:0,children:e?x.jsxs(x.Fragment,{children:[x.jsx(ot,{isChecked:t,onChange:s=>{i("selectAll",s.target.checked)}}),x.jsx(Fe,{hasArrow:!0,label:"Download Zip",placement:"bottom",children:x.jsx(xe,{isDisabled:r,"aria-label":"Batch export",size:"sm",icon:x.jsx(di,{size:21}),onClick:a})}),x.jsx(Fe,{hasArrow:!0,label:"Batch deletion",children:x.jsx(Xn,{isDisabled:r,variant:"solid",promptMessage:`Are you sure you want to delete these ${o.length} checked workflows?`,tooltipText:"Delete selected",onDelete:async()=>{var s;await((s=be)==null?void 0:s.batchDeleteFlow(o)),i("batchDelete")}})}),o.length>0&&x.jsx(Oe,{fontWeight:600,children:`Selected ${o.length}`}),x.jsx(Fe,{hasArrow:!0,label:"Exit multi-select",children:x.jsx(xe,{"aria-label":"Close multi-select operation",size:"sm",icon:x.jsx(Qt,{}),onClick:()=>{n(!1)}})})]}):x.jsx(Fe,{hasArrow:!0,label:"Select multiple",placement:"bottom-start",children:x.jsx(xe,{"aria-label":"Start multi-select operation",size:"sm",variant:"outline",icon:x.jsx(Hi,{size:21}),onClick:()=>{n(!0)}})})})}const la=(l,e)=>{const[n,o]=F.useState(l);return F.useEffect(()=>{const t=setTimeout(()=>{o(l)},e);return()=>{clearTimeout(t)}},[l,e]),n},ua={position:"absolute",marginLeft:"10px",width:"20px",height:"20px",top:"50%",color:"#A0AEC0",transform:"translateY(-50%)"};function ca(l){const{searchValue:e,onUpdateSearchValue:n}=l,o=e!=="";return x.jsxs(de,{style:{position:"relative"},mb:2,children:[x.jsx(Ki,{style:ua}),o&&x.jsx(xe,{size:"xs",position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"none",zIndex:"100",icon:x.jsx(Qt,{width:15,height:15}),onClick:()=>n(""),"aria-label":"clear input button"}),x.jsx(it,{placeholder:"Search",size:"sm",paddingLeft:"35px",paddingBlock:"5px",value:e,onChange:({target:t})=>n(t.value)})]})}const gn=6;function da({setSelectedTag:l,selectedTag:e}){const[n,o]=F.useState(!1),[t,i]=F.useState([]);return F.useEffect(()=>{var a;(a=We)==null||a.listAll().then(r=>{i(r)})},[]),x.jsxs(we,{spacing:2,wrap:"wrap",mb:0,children:[e!=null&&x.jsx(xe,{"aria-label":"Close",size:"sm",icon:x.jsx(Qt,{}),onClick:()=>{l(void 0)}}),t.slice(0,n?void 0:gn).map(a=>x.jsx(Se,{variant:"solid",width:"auto",flexShrink:0,size:"sm",borderRadius:15,py:4,onClick:()=>{l(a.name)},isActive:e===a.name,children:a.name},a.name)),(t.length??0)>gn&&x.jsx(xe,{"aria-label":"Show-all-tags",size:"sm",icon:n?x.jsx($i,{}):x.jsx(en,{}),onClick:()=>o(!n)})]})}function or({parentFolderID:l,onlyImportFile:e=!1}){const{onRefreshFilesList:n}=F.useContext(Be),[o,t]=F.useState("file"),i=F.useRef(null),a=f=>{var p;t(f),f==="folder"?i.current.setAttribute("webkitdirectory",""):i.current.removeAttribute("webkitdirectory"),(p=i.current)==null||p.click()},r=async f=>{var p;if(f.type==="image/png"){const y=await zi(f),u=y==null?void 0:y.workflow;if(u)return{json:u,name:f.name.replace(".png","")}}else if(f.type==="application/json"||(p=f.name)!=null&&p.endsWith(".json"))return await new Promise((y,u)=>{const g=new FileReader;g.onload=d=>{var b;try{const m=(b=d.target)==null?void 0:b.result;typeof m=="string"?y({json:m,name:f.name.replace(".json","")}):u(new Error("File content is not a string"))}catch(m){u(m)}},g.onerror=u,g.readAsText(f)});return null},s=async f=>{var y,u;const p=[f];for(;p.length>0;){const g=p.shift();if(g&&!g.isFile){const d=await((y=Ve)==null?void 0:y.create({name:g.name,parentFolderID:g.parentFolderID}));if(g.children&&g.children.length){const b=[];g.children.forEach(m=>{m.isFile&&m.file?b.push(m.file):(m.parentFolderID=d==null?void 0:d.id,p.push(m))}),b.length&&await((u=be)==null?void 0:u.batchCreateFlows(b,void 0,d==null?void 0:d.id))}}}n==null||n()},c=async f=>{var y;const p=f.target.files;if(p)if(o==="folder"){const u={name:p[0].webkitRelativePath.split("/")[0],isFile:!1,children:[]};for(const g of p)if(g.name!==".DS_Store"){const d=g.webkitRelativePath.split("/");let b=u.children??[];for(let m=1;mC.name===w);if(!_){if(_={name:w,isFile:m===d.length-1,children:m===d.length-1?void 0:[]},_.isFile){const C=await r(g);C&&(_.file=C)}b.push(_)}_&&!_.isFile&&(b=_.children)}}s(u)}else{const u=[];for(const g of p){const d=await r(g);d&&u.push(d)}u.length&&(await((y=be)==null?void 0:y.batchCreateFlows(u,void 0,l)),n&&n())}};return x.jsxs(x.Fragment,{children:[e?x.jsx(Re,{onClick:f=>{f.stopPropagation(),a("file")},icon:x.jsx(mn,{size:19}),children:"Import workflows"}):x.jsxs(Xe,{closeOnSelect:!0,children:[x.jsx(jt,{as:Se,leftIcon:x.jsx(mn,{size:18}),variant:"outline",iconSpacing:1,size:"sm",colorScheme:"teal",children:"Import"}),x.jsx(at,{children:hi.map((f,p)=>x.jsx(Re,{onClick:()=>{a(f.type)},iconSpacing:2,icon:f.type==="folder"?x.jsx(qn,{size:18}):x.jsx(Wi,{size:18}),children:f.title},p))})]}),x.jsx("input",{style:{display:"none"},ref:i,type:"file",accept:".json,image/png",multiple:!0,onChange:c,onClick:f=>{f.stopPropagation()}})]})}function ha({folder:l,onclose:e}){const[n,o]=F.useState(l.name),[t,i]=F.useState(""),{onRefreshFilesList:a}=F.useContext(Be),r=c=>{o(c.target.value),t&&i("")},s=async()=>{var p,y;const c=n.trim();if(o(c),c===l.name)return e();await((p=Ve)==null?void 0:p.generateUniqueName(c,l.parentFolderID??""))!==c?i("The name is duplicated, please modify it and submit again."):(await((y=Ve)==null?void 0:y.update(l.id,{name:c})),a&&a(),e())};return x.jsxs(vt,{isOpen:!0,onClose:e,children:[x.jsx(gt,{}),x.jsxs(bt,{children:[x.jsx(yt,{children:"Edit folder name"}),x.jsx(wt,{}),x.jsx(xt,{children:x.jsxs(fi,{isInvalid:!!t,children:[x.jsx(pi,{children:"Folder name"}),x.jsx(it,{value:n,onChange:r,autoFocus:!0,onKeyUp:c=>{c.code==="Enter"&&!t&&n&&s()}}),t&&x.jsx(mi,{children:t})]})}),x.jsxs(Hr,{children:[x.jsx(Se,{colorScheme:"teal",mr:3,onClick:s,isDisabled:!n||!!t,children:"Save"}),x.jsx(Se,{onClick:e,children:"Cancel"})]})]})]})}function fa({menuPosition:l,isopen:e,folder:n,onClose:o}){const[t,i]=F.useState(!1),{onRefreshFilesList:a}=F.useContext(Be),{showDialog:r}=$n(),s=async y=>{var u;y.stopPropagation(),await((u=Ve)==null?void 0:u.create({name:"New Folder",parentFolderID:n.id})),a&&a()},c=async y=>{var u;y.stopPropagation(),await((u=be)==null?void 0:u.createFlow({json:JSON.stringify(vi),parentFolderID:n.id})),a&&a()},f=async y=>{y.stopPropagation();const u=await gi(n.id);r(`Do you want to delete the ${u} files inside the folder too?`,[{label:"Delete all files",colorScheme:"red",onClick:()=>{p(bi.DELETE)}}])},p=async y=>{var u;await((u=Ve)==null?void 0:u.deleteFolder(n.id,y)),o(),a&&a()};return x.jsxs(x.Fragment,{children:[x.jsx(de,{position:"absolute",top:l.y,left:l.x,children:x.jsx(Xe,{isOpen:e,onClose:o,isLazy:!0,lazyBehavior:"keepMounted",children:x.jsxs(at,{children:[x.jsx(Re,{icon:x.jsx(Yi,{size:19}),onClick:y=>{y.preventDefault(),y.stopPropagation(),i(!0)},children:"Rename"}),x.jsx(Re,{icon:x.jsx(Yn,{size:19}),onClick:f,children:"Delete"}),x.jsx(Re,{onClick:s,icon:x.jsx(nr,{size:19}),children:"New folder"}),x.jsx(Re,{onClick:c,icon:x.jsx(tn,{size:19}),children:"New file"}),x.jsx(or,{parentFolderID:n.id,onlyImportFile:!0})]})})}),t&&x.jsx(ha,{folder:n,onclose:()=>i(!1)})]})}const bn=F.memo(function({folder:e}){const[n,o]=F.useState(!1),[t,i]=F.useState(e.isCollapse??!0),[a,r]=F.useState([]),[s,c]=F.useState({x:0,y:0}),[f,p]=F.useState(!1),{colorMode:y}=qt(),{draggingFile:u,setDraggingFile:g,refreshFolderStamp:d,onRefreshFilesList:b}=F.useContext(Be),m=y==="light"?{backgroundColor:"#E2E8F0"}:{backgroundColor:"#4A5568"};F.useEffect(()=>{var C;t||(C=be)==null||C.listFolderContent(e.id,window.localStorage.getItem($t)).then(I=>{r(I)})},[e.id,d,t]);const w=C=>{C.preventDefault(),c({x:C.clientX,y:C.clientY}),p(!0)},_=async C=>{var I,P;if(C.preventDefault(),C.stopPropagation(),!u)return o(!1);if(He(u)){if(u.id===e.id)return o(!1);await((I=Ve)==null?void 0:I.update(u.id,{parentFolderID:e.id}))}else He(u)||await((P=be)==null?void 0:P.updateFolder(u.id,{parentFolderID:e.id}));await(b==null?void 0:b()),o(!1)};return F.useEffect(()=>{var C;!!e.isCollapse!==t&&((C=Ve)==null||C.update(e.id,{isCollapse:t}))},[t]),F.useEffect(()=>{var D;const C=(D=be)==null?void 0:D.curWorkflow,I=(C==null?void 0:C.parentFolderID)+"/",P=e.id+"/";I.startsWith(P)&&i(!1)},[]),x.jsxs(Le,{children:[x.jsxs(we,{w:"100%",as:"button",py:1,onClick:()=>{i(!t)},onContextMenu:w,draggable:"true",onDragOver:C=>{C.preventDefault(),C.stopPropagation(),o(!0)},onDragLeave:C=>{C.preventDefault(),C.stopPropagation(),o(!1)},onDragStart:()=>g==null?void 0:g(e),onDrop:_,_hover:m,style:n||f?m:void 0,className:"droppable",children:[x.jsxs(we,{gap:1,children:[t?x.jsx(Fi,{size:20}):x.jsx(en,{size:20}),x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#EFC54D",style:{width:"1.2rem",height:"1.2rem"},children:x.jsx("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"})})]}),x.jsx(Oe,{children:e.name})]}),x.jsx(fa,{isopen:f,menuPosition:s,onClose:()=>p(!1),folder:e}),!t&&x.jsx(Le,{ml:4,gap:0,children:x.jsx(Lr,{items:a})})]})});function yn(l,e){var n=Object.keys(l);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(l);e&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(l,t).enumerable})),n.push.apply(n,o)}return n}function re(l){for(var e=1;el.length)&&(e=l.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(l,o)&&(n[o]=l[o])}return n}var ga=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function ba(l){var e=l.defaultInputValue,n=e===void 0?"":e,o=l.defaultMenuIsOpen,t=o===void 0?!1:o,i=l.defaultValue,a=i===void 0?null:i,r=l.inputValue,s=l.menuIsOpen,c=l.onChange,f=l.onInputChange,p=l.onMenuClose,y=l.onMenuOpen,u=l.value,g=Ne(l,ga),d=F.useState(r!==void 0?r:n),b=Te(d,2),m=b[0],w=b[1],_=F.useState(s!==void 0?s:t),C=Te(_,2),I=C[0],P=C[1],E=F.useState(u!==void 0?u:a),D=Te(E,2),j=D[0],U=D[1],q=F.useCallback(function(J,N){typeof c=="function"&&c(J,N),U(J)},[c]),O=F.useCallback(function(J,N){var K;typeof f=="function"&&(K=f(J,N)),w(K!==void 0?K:J)},[f]),L=F.useCallback(function(){typeof y=="function"&&y(),P(!0)},[y]),v=F.useCallback(function(){typeof p=="function"&&p(),P(!1)},[p]),B=r!==void 0?r:m,te=s!==void 0?s:I,T=u!==void 0?u:j;return re(re({},g),{},{inputValue:B,menuIsOpen:te,onChange:q,onInputChange:O,onMenuClose:v,onMenuOpen:L,value:T})}function ya(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function wn(l,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _a(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function Ca(l,e){if(e&&(Un(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _a(l)}function ka(l){var e=Sa();return function(){var o=St(l),t;if(e){var i=St(this).constructor;t=Reflect.construct(o,arguments,i)}else t=o.apply(this,arguments);return Ca(this,t)}}function Oa(l){if(Array.isArray(l))return Ut(l)}function Ia(l){if(typeof Symbol<"u"&&l[Symbol.iterator]!=null||l["@@iterator"]!=null)return Array.from(l)}function Ea(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lr(l){return Oa(l)||Ia(l)||sr(l)||Ea()}function Pa(l,e){return e||(e=l.slice(0)),Object.freeze(Object.defineProperties(l,{raw:{value:Object.freeze(e)}}))}const Ma=Math.min,ja=Math.max,_t=Math.round,ht=Math.floor,Ct=l=>({x:l,y:l});function Da(l){return{...l,top:l.y,left:l.x,right:l.x+l.width,bottom:l.y+l.height}}function ur(l){return dr(l)?(l.nodeName||"").toLowerCase():"#document"}function je(l){var e;return(l==null||(e=l.ownerDocument)==null?void 0:e.defaultView)||window}function cr(l){var e;return(e=(dr(l)?l.ownerDocument:l.document)||window.document)==null?void 0:e.documentElement}function dr(l){return l instanceof Node||l instanceof je(l).Node}function Wt(l){return l instanceof Element||l instanceof je(l).Element}function an(l){return l instanceof HTMLElement||l instanceof je(l).HTMLElement}function xn(l){return typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof je(l).ShadowRoot}function hr(l){const{overflow:e,overflowX:n,overflowY:o,display:t}=on(l);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(t)}function za(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fa(l){return["html","body","#document"].includes(ur(l))}function on(l){return je(l).getComputedStyle(l)}function Ra(l){if(ur(l)==="html")return l;const e=l.assignedSlot||l.parentNode||xn(l)&&l.host||cr(l);return xn(e)?e.host:e}function fr(l){const e=Ra(l);return Fa(e)?l.ownerDocument?l.ownerDocument.body:l.body:an(e)&&hr(e)?e:fr(e)}function kt(l,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const t=fr(l),i=t===((o=l.ownerDocument)==null?void 0:o.body),a=je(t);return i?e.concat(a,a.visualViewport||[],hr(t)?t:[],a.frameElement&&n?kt(a.frameElement):[]):e.concat(t,kt(t,[],n))}function Aa(l){const e=on(l);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const t=an(l),i=t?l.offsetWidth:n,a=t?l.offsetHeight:o,r=_t(n)!==i||_t(o)!==a;return r&&(n=i,o=a),{width:n,height:o,$:r}}function sn(l){return Wt(l)?l:l.contextElement}function At(l){const e=sn(l);if(!an(e))return Ct(1);const n=e.getBoundingClientRect(),{width:o,height:t,$:i}=Aa(e);let a=(i?_t(n.width):n.width)/o,r=(i?_t(n.height):n.height)/t;return(!a||!Number.isFinite(a))&&(a=1),(!r||!Number.isFinite(r))&&(r=1),{x:a,y:r}}const Ta=Ct(0);function La(l){const e=je(l);return!za()||!e.visualViewport?Ta:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Va(l,e,n){return e===void 0&&(e=!1),!n||e&&n!==je(l)?!1:e}function Sn(l,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const t=l.getBoundingClientRect(),i=sn(l);let a=Ct(1);e&&(o?Wt(o)&&(a=At(o)):a=At(l));const r=Va(i,n,o)?La(i):Ct(0);let s=(t.left+r.x)/a.x,c=(t.top+r.y)/a.y,f=t.width/a.x,p=t.height/a.y;if(i){const y=je(i),u=o&&Wt(o)?je(o):o;let g=y.frameElement;for(;g&&o&&u!==y;){const d=At(g),b=g.getBoundingClientRect(),m=on(g),w=b.left+(g.clientLeft+parseFloat(m.paddingLeft))*d.x,_=b.top+(g.clientTop+parseFloat(m.paddingTop))*d.y;s*=d.x,c*=d.y,f*=d.x,p*=d.y,s+=w,c+=_,g=je(g).frameElement}}return Da({width:f,height:p,x:s,y:c})}function Ba(l,e){let n=null,o;const t=cr(l);function i(){clearTimeout(o),n&&n.disconnect(),n=null}function a(r,s){r===void 0&&(r=!1),s===void 0&&(s=1),i();const{left:c,top:f,width:p,height:y}=l.getBoundingClientRect();if(r||e(),!p||!y)return;const u=ht(f),g=ht(t.clientWidth-(c+p)),d=ht(t.clientHeight-(f+y)),b=ht(c),w={rootMargin:-u+"px "+-g+"px "+-d+"px "+-b+"px",threshold:ja(0,Ma(1,s))||1};let _=!0;function C(I){const P=I[0].intersectionRatio;if(P!==s){if(!_)return a();P?a(!1,P):o=setTimeout(()=>{a(!1,1e-7)},100)}_=!1}try{n=new IntersectionObserver(C,{...w,root:t.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(l)}return a(!0),i}function Na(l,e,n,o){o===void 0&&(o={});const{ancestorScroll:t=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:r=typeof IntersectionObserver=="function",animationFrame:s=!1}=o,c=sn(l),f=t||i?[...c?kt(c):[],...kt(e)]:[];f.forEach(m=>{t&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const p=c&&r?Ba(c,n):null;let y=-1,u=null;a&&(u=new ResizeObserver(m=>{let[w]=m;w&&w.target===c&&u&&(u.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{u&&u.observe(e)})),n()}),c&&!s&&u.observe(c),u.observe(e));let g,d=s?Sn(l):null;s&&b();function b(){const m=Sn(l);d&&(m.x!==d.x||m.y!==d.y||m.width!==d.width||m.height!==d.height)&&n(),d=m,g=requestAnimationFrame(b)}return n(),()=>{f.forEach(m=>{t&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),p&&p(),u&&u.disconnect(),u=null,s&&cancelAnimationFrame(g)}}var Ht=F.useLayoutEffect,$a=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ot=function(){};function Ua(l,e){return e?e[0]==="-"?l+e:l+"__"+e:l}function Wa(l,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),t=2;t-1}function Ha(l){return Dt(l)?window.innerHeight:l.clientHeight}function mr(l){return Dt(l)?window.pageYOffset:l.scrollTop}function It(l,e){if(Dt(l)){window.scrollTo(0,e);return}l.scrollTop=e}function Za(l){var e=getComputedStyle(l),n=e.position==="absolute",o=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var t=l;t=t.parentElement;)if(e=getComputedStyle(t),!(n&&e.position==="static")&&o.test(e.overflow+e.overflowY+e.overflowX))return t;return document.documentElement}function Ga(l,e,n,o){return n*((l=l/o-1)*l*l+1)+e}function ft(l,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ot,t=mr(l),i=e-t,a=10,r=0;function s(){r+=a;var c=Ga(r,t,i,n);It(l,c),rn.bottom?It(l,Math.min(e.offsetTop+e.clientHeight-l.offsetHeight+t,l.scrollHeight)):o.top-t1?n-1:0),t=1;t=g)return{placement:"bottom",maxHeight:e};if(j>=g&&!a)return i&&ft(s,U,O),{placement:"bottom",maxHeight:e};if(!a&&j>=o||a&&E>=o){i&&ft(s,U,O);var L=a?E-C:j-C;return{placement:"bottom",maxHeight:L}}if(t==="auto"||a){var v=e,B=a?P:D;return B>=o&&(v=Math.min(B-C-r,e)),{placement:"top",maxHeight:v}}if(t==="bottom")return i&&It(s,U),{placement:"bottom",maxHeight:e};break;case"top":if(P>=g)return{placement:"top",maxHeight:e};if(D>=g&&!a)return i&&ft(s,q,O),{placement:"top",maxHeight:e};if(!a&&D>=o||a&&P>=o){var te=e;return(!a&&D>=o||a&&P>=o)&&(te=a?P-I:D-I),i&&ft(s,q,O),{placement:"top",maxHeight:te}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(t,'".'))}return c}function io(l){var e={bottom:"top",top:"bottom"};return l?e[l]:"bottom"}var gr=function(e){return e==="auto"?"bottom":e},ao=function(e,n){var o,t=e.placement,i=e.theme,a=i.borderRadius,r=i.spacing,s=i.colors;return re((o={label:"menu"},tt(o,io(t),"100%"),tt(o,"position","absolute"),tt(o,"width","100%"),tt(o,"zIndex",1),o),n?{}:{backgroundColor:s.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:r.menuGutter,marginTop:r.menuGutter})},br=F.createContext(null),oo=function(e){var n=e.children,o=e.minMenuHeight,t=e.maxMenuHeight,i=e.menuPlacement,a=e.menuPosition,r=e.menuShouldScrollIntoView,s=e.theme,c=F.useContext(br)||{},f=c.setPortalPlacement,p=F.useRef(null),y=F.useState(t),u=Te(y,2),g=u[0],d=u[1],b=F.useState(null),m=Te(b,2),w=m[0],_=m[1],C=s.spacing.controlHeight;return Ht(function(){var I=p.current;if(I){var P=a==="fixed",E=r&&!P,D=ro({maxHeight:t,menuEl:I,minHeight:o,placement:i,shouldScroll:E,isFixedPosition:P,controlHeight:C});d(D.maxHeight),_(D.placement),f==null||f(D.placement)}},[t,i,a,r,o,f,C]),n({ref:p,placerProps:re(re({},e),{},{placement:w||gr(i),maxHeight:g})})},so=function(e){var n=e.children,o=e.innerRef,t=e.innerProps;return ie("div",ae({},me(e,"menu",{menu:!0}),{ref:o},t),n)},lo=so,uo=function(e,n){var o=e.maxHeight,t=e.theme.spacing.baseUnit;return re({maxHeight:o,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:t,paddingTop:t})},co=function(e){var n=e.children,o=e.innerProps,t=e.innerRef,i=e.isMulti;return ie("div",ae({},me(e,"menuList",{"menu-list":!0,"menu-list--is-multi":i}),{ref:t},o),n)},yr=function(e,n){var o=e.theme,t=o.spacing.baseUnit,i=o.colors;return re({textAlign:"center"},n?{}:{color:i.neutral40,padding:"".concat(t*2,"px ").concat(t*3,"px")})},ho=yr,fo=yr,po=function(e){var n=e.children,o=n===void 0?"No options":n,t=e.innerProps,i=Ne(e,to);return ie("div",ae({},me(re(re({},i),{},{children:o,innerProps:t}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),t),o)},mo=function(e){var n=e.children,o=n===void 0?"Loading...":n,t=e.innerProps,i=Ne(e,no);return ie("div",ae({},me(re(re({},i),{},{children:o,innerProps:t}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),t),o)},vo=function(e){var n=e.rect,o=e.offset,t=e.position;return{left:n.left,position:t,top:o,width:n.width,zIndex:1}},go=function(e){var n=e.appendTo,o=e.children,t=e.controlElement,i=e.innerProps,a=e.menuPlacement,r=e.menuPosition,s=F.useRef(null),c=F.useRef(null),f=F.useState(gr(a)),p=Te(f,2),y=p[0],u=p[1],g=F.useMemo(function(){return{setPortalPlacement:u}},[]),d=F.useState(null),b=Te(d,2),m=b[0],w=b[1],_=F.useCallback(function(){if(t){var E=Ya(t),D=r==="fixed"?0:window.pageYOffset,j=E[y]+D;(j!==(m==null?void 0:m.offset)||E.left!==(m==null?void 0:m.rect.left)||E.width!==(m==null?void 0:m.rect.width))&&w({offset:j,rect:E})}},[t,r,y,m==null?void 0:m.offset,m==null?void 0:m.rect.left,m==null?void 0:m.rect.width]);Ht(function(){_()},[_]);var C=F.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),t&&s.current&&(c.current=Na(t,s.current,_,{elementResize:"ResizeObserver"in window}))},[t,_]);Ht(function(){C()},[C]);var I=F.useCallback(function(E){s.current=E,C()},[C]);if(!n&&r!=="fixed"||!m)return null;var P=ie("div",ae({ref:I},me(re(re({},e),{},{offset:m.offset,position:r,rect:m.rect}),"menuPortal",{"menu-portal":!0}),i),o);return ie(br.Provider,{value:g},n?Xr.createPortal(P,n):P)},bo=function(e){var n=e.isDisabled,o=e.isRtl;return{label:"container",direction:o?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},yo=function(e){var n=e.children,o=e.innerProps,t=e.isDisabled,i=e.isRtl;return ie("div",ae({},me(e,"container",{"--is-disabled":t,"--is-rtl":i}),o),n)},wo=function(e,n){var o=e.theme.spacing,t=e.isMulti,i=e.hasValue,a=e.selectProps.controlShouldRenderValue;return re({alignItems:"center",display:t&&i&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(o.baseUnit/2,"px ").concat(o.baseUnit*2,"px")})},xo=function(e){var n=e.children,o=e.innerProps,t=e.isMulti,i=e.hasValue;return ie("div",ae({},me(e,"valueContainer",{"value-container":!0,"value-container--is-multi":t,"value-container--has-value":i}),o),n)},So=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},_o=function(e){var n=e.children,o=e.innerProps;return ie("div",ae({},me(e,"indicatorsContainer",{indicators:!0}),o),n)},On,Co=["size"],ko=["innerProps","isRtl","size"],Oo={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},wr=function(e){var n=e.size,o=Ne(e,Co);return ie("svg",ae({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Oo},o))},ln=function(e){return ie(wr,ae({size:20},e),ie("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},xr=function(e){return ie(wr,ae({size:20},e),ie("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Sr=function(e,n){var o=e.isFocused,t=e.theme,i=t.spacing.baseUnit,a=t.colors;return re({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:o?a.neutral60:a.neutral20,padding:i*2,":hover":{color:o?a.neutral80:a.neutral40}})},Io=Sr,Eo=function(e){var n=e.children,o=e.innerProps;return ie("div",ae({},me(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),o),n||ie(xr,null))},Po=Sr,Mo=function(e){var n=e.children,o=e.innerProps;return ie("div",ae({},me(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),o),n||ie(ln,null))},jo=function(e,n){var o=e.isDisabled,t=e.theme,i=t.spacing.baseUnit,a=t.colors;return re({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:o?a.neutral10:a.neutral20,marginBottom:i*2,marginTop:i*2})},Do=function(e){var n=e.innerProps;return ie("span",ae({},n,me(e,"indicatorSeparator",{"indicator-separator":!0})))},zo=Kr(On||(On=Pa([`
0%, 80%, 100% { opacity: 0; }
40% { opacity: 1; }
-`]))),Fo=function(e,n){var o=e.isFocused,t=e.size,i=e.theme,a=i.colors,r=i.spacing.baseUnit;return re({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:t,lineHeight:1,marginRight:t,textAlign:"center",verticalAlign:"middle"},n?{}:{color:o?a.neutral60:a.neutral20,padding:r*2})},Tt=function(e){var n=e.delay,o=e.offset;return ie("span",{css:Wn({animation:"".concat(zo," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:o?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Ro=function(e){var n=e.innerProps,o=e.isRtl,t=e.size,i=t===void 0?4:t,a=Ne(e,ko);return ie("div",ae({},me(re(re({},a),{},{innerProps:n,isRtl:o,size:i}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),ie(Tt,{delay:0,offset:o}),ie(Tt,{delay:160,offset:!0}),ie(Tt,{delay:320,offset:!o}))},Ao=function(e,n){var o=e.isDisabled,t=e.isFocused,i=e.theme,a=i.colors,r=i.borderRadius,s=i.spacing;return re({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:o?a.neutral5:a.neutral0,borderColor:o?a.neutral10:t?a.primary:a.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:t?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:t?a.primary:a.neutral30}})},To=function(e){var n=e.children,o=e.isDisabled,t=e.isFocused,i=e.innerRef,a=e.innerProps,r=e.menuIsOpen;return ie("div",ae({ref:i},me(e,"control",{control:!0,"control--is-disabled":o,"control--is-focused":t,"control--menu-is-open":r}),a,{"aria-disabled":o||void 0}),n)},Lo=To,Vo=["data"],Bo=function(e,n){var o=e.theme.spacing;return n?{}:{paddingBottom:o.baseUnit*2,paddingTop:o.baseUnit*2}},No=function(e){var n=e.children,o=e.cx,t=e.getStyles,i=e.getClassNames,a=e.Heading,r=e.headingProps,s=e.innerProps,c=e.label,f=e.theme,p=e.selectProps;return ie("div",ae({},me(e,"group",{group:!0}),s),ie(a,ae({},r,{selectProps:p,theme:f,getStyles:t,getClassNames:i,cx:o}),c),ie("div",null,n))},$o=function(e,n){var o=e.theme,t=o.colors,i=o.spacing;return re({label:"group",cursor:"default",display:"block"},n?{}:{color:t.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:i.baseUnit*3,paddingRight:i.baseUnit*3,textTransform:"uppercase"})},Uo=function(e){var n=pr(e);n.data;var o=Ne(n,Vo);return ie("div",ae({},me(e,"groupHeading",{"group-heading":!0}),o))},Wo=No,Ho=["innerRef","isDisabled","isHidden","inputClassName"],Zo=function(e,n){var o=e.isDisabled,t=e.value,i=e.theme,a=i.spacing,r=i.colors;return re(re({visibility:o?"hidden":"visible",transform:t?"translateZ(0)":""},Go),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:r.neutral80})},_r={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Go={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":re({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},_r)},Yo=function(e){return re({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},_r)},Ko=function(e){var n=e.cx,o=e.value,t=pr(e),i=t.innerRef,a=t.isDisabled,r=t.isHidden,s=t.inputClassName,c=Ne(t,Ho);return ie("div",ae({},me(e,"input",{"input-container":!0}),{"data-value":o||""}),ie("input",ae({className:n({input:!0},s),ref:i,style:Yo(r),disabled:a},c)))},Xo=Ko,qo=function(e,n){var o=e.theme,t=o.spacing,i=o.borderRadius,a=o.colors;return re({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:i/2,margin:t.baseUnit/2})},Jo=function(e,n){var o=e.theme,t=o.borderRadius,i=o.colors,a=e.cropWithEllipsis;return re({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:t/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Qo=function(e,n){var o=e.theme,t=o.spacing,i=o.borderRadius,a=o.colors,r=e.isFocused;return re({alignItems:"center",display:"flex"},n?{}:{borderRadius:i/2,backgroundColor:r?a.dangerLight:void 0,paddingLeft:t.baseUnit,paddingRight:t.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Cr=function(e){var n=e.children,o=e.innerProps;return ie("div",o,n)},es=Cr,ts=Cr;function ns(l){var e=l.children,n=l.innerProps;return ie("div",ae({role:"button"},n),e||ie(ln,{size:14}))}var rs=function(e){var n=e.children,o=e.components,t=e.data,i=e.innerProps,a=e.isDisabled,r=e.removeProps,s=e.selectProps,c=o.Container,f=o.Label,p=o.Remove;return ie(c,{data:t,innerProps:re(re({},me(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),i),selectProps:s},ie(f,{data:t,innerProps:re({},me(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),ie(p,{data:t,innerProps:re(re({},me(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},r),selectProps:s}))},is=rs,as=function(e,n){var o=e.isDisabled,t=e.isFocused,i=e.isSelected,a=e.theme,r=a.spacing,s=a.colors;return re({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:i?s.primary:t?s.primary25:"transparent",color:o?s.neutral20:i?s.neutral0:"inherit",padding:"".concat(r.baseUnit*2,"px ").concat(r.baseUnit*3,"px"),":active":{backgroundColor:o?void 0:i?s.primary:s.primary50}})},os=function(e){var n=e.children,o=e.isDisabled,t=e.isFocused,i=e.isSelected,a=e.innerRef,r=e.innerProps;return ie("div",ae({},me(e,"option",{option:!0,"option--is-disabled":o,"option--is-focused":t,"option--is-selected":i}),{ref:a,"aria-disabled":o},r),n)},ss=os,ls=function(e,n){var o=e.theme,t=o.spacing,i=o.colors;return re({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:i.neutral50,marginLeft:t.baseUnit/2,marginRight:t.baseUnit/2})},us=function(e){var n=e.children,o=e.innerProps;return ie("div",ae({},me(e,"placeholder",{placeholder:!0}),o),n)},cs=us,ds=function(e,n){var o=e.isDisabled,t=e.theme,i=t.spacing,a=t.colors;return re({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:o?a.neutral40:a.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},hs=function(e){var n=e.children,o=e.isDisabled,t=e.innerProps;return ie("div",ae({},me(e,"singleValue",{"single-value":!0,"single-value--is-disabled":o}),t),n)},fs=hs,ps={ClearIndicator:Mo,Control:Lo,DropdownIndicator:Eo,DownChevron:xr,CrossIcon:ln,Group:Wo,GroupHeading:Uo,IndicatorsContainer:_o,IndicatorSeparator:Do,Input:Xo,LoadingIndicator:Ro,Menu:lo,MenuList:co,MenuPortal:go,LoadingMessage:mo,NoOptionsMessage:po,MultiValue:is,MultiValueContainer:es,MultiValueLabel:ts,MultiValueRemove:ns,Option:ss,Placeholder:cs,SelectContainer:yo,SingleValue:fs,ValueContainer:xo},ms=function(e){return re(re({},ps),e.components)},In=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function vs(l,e){return!!(l===e||In(l)&&In(e))}function gs(l,e){if(l.length!==e.length)return!1;for(var n=0;n1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return a?"option ".concat(t," is disabled. Select another option."):"option ".concat(t,", selected.");default:return""}},onFocus:function(e){var n=e.context,o=e.focused,t=e.options,i=e.label,a=i===void 0?"":i,r=e.selectValue,s=e.isDisabled,c=e.isSelected,f=function(g,d){return g&&g.length?"".concat(g.indexOf(d)+1," of ").concat(g.length):""};if(n==="value"&&r)return"value ".concat(a," focused, ").concat(f(r,o),".");if(n==="menu"){var p=s?" disabled":"",y="".concat(c?"selected":"focused").concat(p);return"option ".concat(a," ").concat(y,", ").concat(f(t,o),".")}return""},onFilter:function(e){var n=e.inputValue,o=e.resultsMessage;return"".concat(o).concat(n?" for search term "+n:"",".")}},Ss=function(e){var n=e.ariaSelection,o=e.focusedOption,t=e.focusedValue,i=e.focusableOptions,a=e.isFocused,r=e.selectValue,s=e.selectProps,c=e.id,f=s.ariaLiveMessages,p=s.getOptionLabel,y=s.inputValue,u=s.isMulti,g=s.isOptionDisabled,d=s.isSearchable,b=s.menuIsOpen,m=s.options,w=s.screenReaderStatus,_=s.tabSelectsValue,C=s["aria-label"],I=s["aria-live"],P=F.useMemo(function(){return re(re({},xs),f||{})},[f]),E=F.useMemo(function(){var v="";if(n&&P.onChange){var B=n.option,te=n.options,T=n.removedValue,J=n.removedValues,N=n.value,K=function(he){return Array.isArray(he)?null:he},A=T||B||K(N),z=A?p(A):"",ee=te||J||void 0,X=ee?ee.map(p):[],Z=re({isDisabled:A&&g(A,r),label:z,labels:X},n);v=P.onChange(Z)}return v},[n,P,g,r,p]),D=F.useMemo(function(){var v="",B=o||t,te=!!(o&&r&&r.includes(o));if(B&&P.onFocus){var T={focused:B,label:p(B),isDisabled:g(B,r),isSelected:te,options:i,context:B===o?"menu":"value",selectValue:r};v=P.onFocus(T)}return v},[o,t,p,g,P,i,r]),j=F.useMemo(function(){var v="";if(b&&m.length&&P.onFilter){var B=w({count:i.length});v=P.onFilter({inputValue:y,resultsMessage:B})}return v},[i,y,b,P,m,w]),U=F.useMemo(function(){var v="";if(P.guidance){var B=t?"value":b?"menu":"input";v=P.guidance({"aria-label":C,context:B,isDisabled:o&&g(o,r),isMulti:u,isSearchable:d,tabSelectsValue:_})}return v},[C,o,t,u,g,d,b,P,r,_]),q="".concat(D," ").concat(j," ").concat(U),O=ie(F.Fragment,null,ie("span",{id:"aria-selection"},E),ie("span",{id:"aria-context"},q)),L=(n==null?void 0:n.action)==="initial-input-focus";return ie(F.Fragment,null,ie(En,{id:c},L&&O),ie(En,{"aria-live":I,"aria-atomic":"false","aria-relevant":"additions text"},a&&!L&&O))},_s=Ss,Zt=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Cs=new RegExp("["+Zt.map(function(l){return l.letters}).join("")+"]","g"),kr={};for(var Lt=0;Lt-1}},Es=["innerRef"];function Ps(l){var e=l.innerRef,n=Ne(l,Es),o=eo(n,"onExited","in","enter","exit","appear");return ie("input",ae({ref:e},o,{css:Wn({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Ms=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function js(l){var e=l.isEnabled,n=l.onBottomArrive,o=l.onBottomLeave,t=l.onTopArrive,i=l.onTopLeave,a=F.useRef(!1),r=F.useRef(!1),s=F.useRef(0),c=F.useRef(null),f=F.useCallback(function(b,m){if(c.current!==null){var w=c.current,_=w.scrollTop,C=w.scrollHeight,I=w.clientHeight,P=c.current,E=m>0,D=C-I-_,j=!1;D>m&&a.current&&(o&&o(b),a.current=!1),E&&r.current&&(i&&i(b),r.current=!1),E&&m>D?(n&&!a.current&&n(b),P.scrollTop=C,j=!0,a.current=!0):!E&&-m>_&&(t&&!r.current&&t(b),P.scrollTop=0,j=!0,r.current=!0),j&&Ms(b)}},[n,o,t,i]),p=F.useCallback(function(b){f(b,b.deltaY)},[f]),y=F.useCallback(function(b){s.current=b.changedTouches[0].clientY},[]),u=F.useCallback(function(b){var m=s.current-b.changedTouches[0].clientY;f(b,m)},[f]),g=F.useCallback(function(b){if(b){var m=qa?{passive:!1}:!1;b.addEventListener("wheel",p,m),b.addEventListener("touchstart",y,m),b.addEventListener("touchmove",u,m)}},[u,y,p]),d=F.useCallback(function(b){b&&(b.removeEventListener("wheel",p,!1),b.removeEventListener("touchstart",y,!1),b.removeEventListener("touchmove",u,!1))},[u,y,p]);return F.useEffect(function(){if(e){var b=c.current;return g(b),function(){d(b)}}},[e,g,d]),function(b){c.current=b}}var Mn=["boxSizing","height","overflow","paddingRight","position"],jn={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Dn(l){l.preventDefault()}function zn(l){l.stopPropagation()}function Fn(){var l=this.scrollTop,e=this.scrollHeight,n=l+this.offsetHeight;l===0?this.scrollTop=1:n===e&&(this.scrollTop=l-1)}function Rn(){return"ontouchstart"in window||navigator.maxTouchPoints}var An=!!(typeof window<"u"&&window.document&&window.document.createElement),et=0,Ze={capture:!1,passive:!1};function Ds(l){var e=l.isEnabled,n=l.accountForScrollbars,o=n===void 0?!0:n,t=F.useRef({}),i=F.useRef(null),a=F.useCallback(function(s){if(An){var c=document.body,f=c&&c.style;if(o&&Mn.forEach(function(g){var d=f&&f[g];t.current[g]=d}),o&&et<1){var p=parseInt(t.current.paddingRight,10)||0,y=document.body?document.body.clientWidth:0,u=window.innerWidth-y+p||0;Object.keys(jn).forEach(function(g){var d=jn[g];f&&(f[g]=d)}),f&&(f.paddingRight="".concat(u,"px"))}c&&Rn()&&(c.addEventListener("touchmove",Dn,Ze),s&&(s.addEventListener("touchstart",Fn,Ze),s.addEventListener("touchmove",zn,Ze))),et+=1}},[o]),r=F.useCallback(function(s){if(An){var c=document.body,f=c&&c.style;et=Math.max(et-1,0),o&&et<1&&Mn.forEach(function(p){var y=t.current[p];f&&(f[p]=y)}),c&&Rn()&&(c.removeEventListener("touchmove",Dn,Ze),s&&(s.removeEventListener("touchstart",Fn,Ze),s.removeEventListener("touchmove",zn,Ze)))}},[o]);return F.useEffect(function(){if(e){var s=i.current;return a(s),function(){r(s)}}},[e,a,r]),function(s){i.current=s}}var zs=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Fs={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Rs(l){var e=l.children,n=l.lockEnabled,o=l.captureEnabled,t=o===void 0?!0:o,i=l.onBottomArrive,a=l.onBottomLeave,r=l.onTopArrive,s=l.onTopLeave,c=js({isEnabled:t,onBottomArrive:i,onBottomLeave:a,onTopArrive:r,onTopLeave:s}),f=Ds({isEnabled:n}),p=function(u){c(u),f(u)};return ie(F.Fragment,null,n&&ie("div",{onClick:zs,css:Fs}),e(p))}var As={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Ts=function(e){var n=e.name,o=e.onFocus;return ie("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:o,css:As,value:"",onChange:function(){}})},Ls=Ts,Vs=function(e){return e.label},Bs=function(e){return e.label},Ns=function(e){return e.value},$s=function(e){return!!e.isDisabled},Us={clearIndicator:Po,container:bo,control:Ao,dropdownIndicator:Io,group:Bo,groupHeading:$o,indicatorsContainer:So,indicatorSeparator:jo,input:Zo,loadingIndicator:Fo,loadingMessage:fo,menu:ao,menuList:uo,menuPortal:vo,multiValue:qo,multiValueLabel:Jo,multiValueRemove:Qo,noOptionsMessage:ho,option:as,placeholder:ls,singleValue:ds,valueContainer:wo},Ws={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Hs=4,Ir=4,Zs=38,Gs=Ir*2,Ys={baseUnit:Ir,controlHeight:Zs,menuGutter:Gs},Nt={borderRadius:Hs,colors:Ws,spacing:Ys},Ks={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:kn(),captureMenuScroll:!kn(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Is(),formatGroupLabel:Vs,getOptionLabel:Bs,getOptionValue:Ns,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:$s,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Ka(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Tn(l,e,n,o){var t=jr(l,e,n),i=Dr(l,e,n),a=Mr(l,e),r=Et(l,e);return{type:"option",data:e,isDisabled:t,isSelected:i,label:a,value:r,index:o}}function Er(l,e){return l.options.map(function(n,o){if("options"in n){var t=n.options.map(function(a,r){return Tn(l,a,e,r)}).filter(function(a){return Ln(l,a)});return t.length>0?{type:"group",data:n,options:t,index:o}:void 0}var i=Tn(l,n,e,o);return Ln(l,i)?i:void 0}).filter(Ja)}function Pr(l){return l.reduce(function(e,n){return n.type==="group"?e.push.apply(e,lr(n.options.map(function(o){return o.data}))):e.push(n.data),e},[])}function Xs(l,e){return Pr(Er(l,e))}function Ln(l,e){var n=l.inputValue,o=n===void 0?"":n,t=e.data,i=e.isSelected,a=e.label,r=e.value;return(!Fr(l)||!i)&&zr(l,{label:a,value:r,data:t},o)}function qs(l,e){var n=l.focusedValue,o=l.selectValue,t=o.indexOf(n);if(t>-1){var i=e.indexOf(n);if(i>-1)return n;if(t-1?n:e[0]}var Mr=function(e,n){return e.getOptionLabel(n)},Et=function(e,n){return e.getOptionValue(n)};function jr(l,e,n){return typeof l.isOptionDisabled=="function"?l.isOptionDisabled(e,n):!1}function Dr(l,e,n){if(n.indexOf(e)>-1)return!0;if(typeof l.isOptionSelected=="function")return l.isOptionSelected(e,n);var o=Et(l,e);return n.some(function(t){return Et(l,t)===o})}function zr(l,e,n){return l.filterOption?l.filterOption(e,n):!0}var Fr=function(e){var n=e.hideSelectedOptions,o=e.isMulti;return n===void 0?o:n},Qs=1,Rr=function(l){xa(n,l);var e=ka(n);function n(o){var t;if(ya(this,n),t=e.call(this,o),t.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(r){t.controlRef=r},t.focusedOptionRef=null,t.getFocusedOptionRef=function(r){t.focusedOptionRef=r},t.menuListRef=null,t.getMenuListRef=function(r){t.menuListRef=r},t.inputRef=null,t.getInputRef=function(r){t.inputRef=r},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(r,s){var c=t.props,f=c.onChange,p=c.name;s.name=p,t.ariaOnChange(r,s),f(r,s)},t.setValue=function(r,s,c){var f=t.props,p=f.closeMenuOnSelect,y=f.isMulti,u=f.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:u}),p&&(t.setState({inputIsHiddenAfterUpdate:!y}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(r,{action:s,option:c})},t.selectOption=function(r){var s=t.props,c=s.blurInputOnSelect,f=s.isMulti,p=s.name,y=t.state.selectValue,u=f&&t.isOptionSelected(r,y),g=t.isOptionDisabled(r,y);if(u){var d=t.getOptionValue(r);t.setValue(y.filter(function(b){return t.getOptionValue(b)!==d}),"deselect-option",r)}else if(!g)f?t.setValue([].concat(lr(y),[r]),"select-option",r):t.setValue(r,"select-option");else{t.ariaOnChange(r,{action:"select-option",option:r,name:p});return}c&&t.blurInput()},t.removeValue=function(r){var s=t.props.isMulti,c=t.state.selectValue,f=t.getOptionValue(r),p=c.filter(function(u){return t.getOptionValue(u)!==f}),y=mt(s,p,p[0]||null);t.onChange(y,{action:"remove-value",removedValue:r}),t.focusInput()},t.clearValue=function(){var r=t.state.selectValue;t.onChange(mt(t.props.isMulti,[],null),{action:"clear",removedValues:r})},t.popValue=function(){var r=t.props.isMulti,s=t.state.selectValue,c=s[s.length-1],f=s.slice(0,s.length-1),p=mt(r,f,f[0]||null);t.onChange(p,{action:"pop-value",removedValue:c})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var r=arguments.length,s=new Array(r),c=0;cy||p>y}},t.onTouchEnd=function(r){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(r.target)&&t.menuListRef&&!t.menuListRef.contains(r.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(r){t.userIsDragging||t.onControlMouseDown(r)},t.onClearIndicatorTouchEnd=function(r){t.userIsDragging||t.onClearIndicatorMouseDown(r)},t.onDropdownIndicatorTouchEnd=function(r){t.userIsDragging||t.onDropdownIndicatorMouseDown(r)},t.handleInputChange=function(r){var s=t.props.inputValue,c=r.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(c,{action:"input-change",prevInputValue:s}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(r){t.props.onFocus&&t.props.onFocus(r),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(r){var s=t.props.inputValue;if(t.menuListRef&&t.menuListRef.contains(document.activeElement)){t.inputRef.focus();return}t.props.onBlur&&t.props.onBlur(r),t.onInputChange("",{action:"input-blur",prevInputValue:s}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1})},t.onOptionHover=function(r){t.blockOptionHover||t.state.focusedOption===r||t.setState({focusedOption:r})},t.shouldHideSelectedOptions=function(){return Fr(t.props)},t.onValueInputFocus=function(r){r.preventDefault(),r.stopPropagation(),t.focus()},t.onKeyDown=function(r){var s=t.props,c=s.isMulti,f=s.backspaceRemovesValue,p=s.escapeClearsValue,y=s.inputValue,u=s.isClearable,g=s.isDisabled,d=s.menuIsOpen,b=s.onKeyDown,m=s.tabSelectsValue,w=s.openMenuOnFocus,_=t.state,C=_.focusedOption,I=_.focusedValue,P=_.selectValue;if(!g&&!(typeof b=="function"&&(b(r),r.defaultPrevented))){switch(t.blockOptionHover=!0,r.key){case"ArrowLeft":if(!c||y)return;t.focusValue("previous");break;case"ArrowRight":if(!c||y)return;t.focusValue("next");break;case"Delete":case"Backspace":if(y)return;if(I)t.removeValue(I);else{if(!f)return;c?t.popValue():u&&t.clearValue()}break;case"Tab":if(t.isComposing||r.shiftKey||!d||!m||!C||w&&t.isOptionSelected(C,P))return;t.selectOption(C);break;case"Enter":if(r.keyCode===229)break;if(d){if(!C||t.isComposing)return;t.selectOption(C);break}return;case"Escape":d?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:y}),t.onMenuClose()):u&&p&&t.clearValue();break;case" ":if(y)return;if(!d){t.openMenu("first");break}if(!C)return;t.selectOption(C);break;case"ArrowUp":d?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":d?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!d)return;t.focusOption("pageup");break;case"PageDown":if(!d)return;t.focusOption("pagedown");break;case"Home":if(!d)return;t.focusOption("first");break;case"End":if(!d)return;t.focusOption("last");break;default:return}r.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++Qs),t.state.selectValue=_n(o.value),o.menuIsOpen&&t.state.selectValue.length){var i=t.buildFocusableOptions(),a=i.indexOf(t.state.selectValue[0]);t.state.focusedOption=i[a]}return t}return wa(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Cn(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(t){var i=this.props,a=i.isDisabled,r=i.menuIsOpen,s=this.state.isFocused;(s&&!a&&t.isDisabled||s&&r&&!t.menuIsOpen)&&this.focusInput(),s&&a&&!t.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!a&&t.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Cn(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(t,i){this.props.onInputChange(t,i)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(t){var i=this,a=this.state,r=a.selectValue,s=a.isFocused,c=this.buildFocusableOptions(),f=t==="first"?0:c.length-1;if(!this.props.isMulti){var p=c.indexOf(r[0]);p>-1&&(f=p)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[f]},function(){return i.onMenuOpen()})}},{key:"focusValue",value:function(t){var i=this.state,a=i.selectValue,r=i.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=a.indexOf(r);r||(s=-1);var c=a.length-1,f=-1;if(a.length){switch(t){case"previous":s===0?f=0:s===-1?f=c:f=s-1;break;case"next":s>-1&&s0&&arguments[0]!==void 0?arguments[0]:"first",i=this.props.pageSize,a=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var s=0,c=r.indexOf(a);a||(c=-1),t==="up"?s=c>0?c-1:r.length-1:t==="down"?s=(c+1)%r.length:t==="pageup"?(s=c-i,s<0&&(s=0)):t==="pagedown"?(s=c+i,s>r.length-1&&(s=r.length-1)):t==="last"&&(s=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[s],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Nt):re(re({},Nt),this.props.theme):Nt}},{key:"getCommonProps",value:function(){var t=this.clearValue,i=this.cx,a=this.getStyles,r=this.getClassNames,s=this.getValue,c=this.selectOption,f=this.setValue,p=this.props,y=p.isMulti,u=p.isRtl,g=p.options,d=this.hasValue();return{clearValue:t,cx:i,getStyles:a,getClassNames:r,getValue:s,hasValue:d,isMulti:y,isRtl:u,options:g,selectOption:c,selectProps:p,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var t=this.state.selectValue;return t.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var t=this.props,i=t.isClearable,a=t.isMulti;return i===void 0?a:i}},{key:"isOptionDisabled",value:function(t,i){return jr(this.props,t,i)}},{key:"isOptionSelected",value:function(t,i){return Dr(this.props,t,i)}},{key:"filterOption",value:function(t,i){return zr(this.props,t,i)}},{key:"formatOptionLabel",value:function(t,i){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(t,{context:i,inputValue:a,selectValue:r})}else return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,i=t.isDisabled,a=t.isSearchable,r=t.inputId,s=t.inputValue,c=t.tabIndex,f=t.form,p=t.menuIsOpen,y=t.required,u=this.getComponents(),g=u.Input,d=this.state,b=d.inputIsHidden,m=d.ariaSelection,w=this.commonProps,_=r||this.getElementId("input"),C=re(re(re({"aria-autocomplete":"list","aria-expanded":p,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":y,role:"combobox"},p&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(m==null?void 0:m.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?F.createElement(g,ae({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:_,innerRef:this.getInputRef,isDisabled:i,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:f,type:"text",value:s},C)):F.createElement(Ps,ae({id:_,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ot,onFocus:this.onInputFocus,disabled:i,tabIndex:c,inputMode:"none",form:f,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,i=this.getComponents(),a=i.MultiValue,r=i.MultiValueContainer,s=i.MultiValueLabel,c=i.MultiValueRemove,f=i.SingleValue,p=i.Placeholder,y=this.commonProps,u=this.props,g=u.controlShouldRenderValue,d=u.isDisabled,b=u.isMulti,m=u.inputValue,w=u.placeholder,_=this.state,C=_.selectValue,I=_.focusedValue,P=_.isFocused;if(!this.hasValue()||!g)return m?null:F.createElement(p,ae({},y,{key:"placeholder",isDisabled:d,isFocused:P,innerProps:{id:this.getElementId("placeholder")}}),w);if(b)return C.map(function(D,j){var U=D===I,q="".concat(t.getOptionLabel(D),"-").concat(t.getOptionValue(D));return F.createElement(a,ae({},y,{components:{Container:r,Label:s,Remove:c},isFocused:U,isDisabled:d,key:q,index:j,removeProps:{onClick:function(){return t.removeValue(D)},onTouchEnd:function(){return t.removeValue(D)},onMouseDown:function(L){L.preventDefault()}},data:D}),t.formatOptionLabel(D,"value"))});if(m)return null;var E=C[0];return F.createElement(f,ae({},y,{data:E,isDisabled:d}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents(),i=t.ClearIndicator,a=this.commonProps,r=this.props,s=r.isDisabled,c=r.isLoading,f=this.state.isFocused;if(!this.isClearable()||!i||s||!this.hasValue()||c)return null;var p={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return F.createElement(i,ae({},a,{innerProps:p,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents(),i=t.LoadingIndicator,a=this.commonProps,r=this.props,s=r.isDisabled,c=r.isLoading,f=this.state.isFocused;if(!i||!c)return null;var p={"aria-hidden":"true"};return F.createElement(i,ae({},a,{innerProps:p,isDisabled:s,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),i=t.DropdownIndicator,a=t.IndicatorSeparator;if(!i||!a)return null;var r=this.commonProps,s=this.props.isDisabled,c=this.state.isFocused;return F.createElement(a,ae({},r,{isDisabled:s,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents(),i=t.DropdownIndicator;if(!i)return null;var a=this.commonProps,r=this.props.isDisabled,s=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return F.createElement(i,ae({},a,{innerProps:c,isDisabled:r,isFocused:s}))}},{key:"renderMenu",value:function(){var t=this,i=this.getComponents(),a=i.Group,r=i.GroupHeading,s=i.Menu,c=i.MenuList,f=i.MenuPortal,p=i.LoadingMessage,y=i.NoOptionsMessage,u=i.Option,g=this.commonProps,d=this.state.focusedOption,b=this.props,m=b.captureMenuScroll,w=b.inputValue,_=b.isLoading,C=b.loadingMessage,I=b.minMenuHeight,P=b.maxMenuHeight,E=b.menuIsOpen,D=b.menuPlacement,j=b.menuPosition,U=b.menuPortalTarget,q=b.menuShouldBlockScroll,O=b.menuShouldScrollIntoView,L=b.noOptionsMessage,v=b.onMenuScrollToTop,B=b.onMenuScrollToBottom;if(!E)return null;var te=function(ee,X){var Z=ee.type,ce=ee.data,he=ee.isDisabled,se=ee.isSelected,le=ee.label,ge=ee.value,pe=d===ce,Ce=he?void 0:function(){return t.onOptionHover(ce)},ke=he?void 0:function(){return t.selectOption(ce)},h="".concat(t.getElementId("option"),"-").concat(X),$={id:h,onClick:ke,onMouseMove:Ce,onMouseOver:Ce,tabIndex:-1};return F.createElement(u,ae({},g,{innerProps:$,data:ce,isDisabled:he,isSelected:se,key:h,label:le,type:Z,value:ge,isFocused:pe,innerRef:pe?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(ee.data,"menu"))},T;if(this.hasOptions())T=this.getCategorizedOptions().map(function(z){if(z.type==="group"){var ee=z.data,X=z.options,Z=z.index,ce="".concat(t.getElementId("group"),"-").concat(Z),he="".concat(ce,"-heading");return F.createElement(a,ae({},g,{key:ce,data:ee,options:X,Heading:r,headingProps:{id:he,data:z.data},label:t.formatGroupLabel(z.data)}),z.options.map(function(se){return te(se,"".concat(Z,"-").concat(se.index))}))}else if(z.type==="option")return te(z,"".concat(z.index))});else if(_){var J=C({inputValue:w});if(J===null)return null;T=F.createElement(p,g,J)}else{var N=L({inputValue:w});if(N===null)return null;T=F.createElement(y,g,N)}var K={minMenuHeight:I,maxMenuHeight:P,menuPlacement:D,menuPosition:j,menuShouldScrollIntoView:O},A=F.createElement(oo,ae({},g,K),function(z){var ee=z.ref,X=z.placerProps,Z=X.placement,ce=X.maxHeight;return F.createElement(s,ae({},g,K,{innerRef:ee,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:_,placement:Z}),F.createElement(Rs,{captureEnabled:m,onTopArrive:v,onBottomArrive:B,lockEnabled:q},function(he){return F.createElement(c,ae({},g,{innerRef:function(le){t.getMenuListRef(le),he(le)},isLoading:_,maxHeight:ce,focusedOption:d}),T)}))});return U||j==="fixed"?F.createElement(f,ae({},g,{appendTo:U,controlElement:this.controlRef,menuPlacement:D,menuPosition:j}),A):A}},{key:"renderFormField",value:function(){var t=this,i=this.props,a=i.delimiter,r=i.isDisabled,s=i.isMulti,c=i.name,f=i.required,p=this.state.selectValue;if(f&&!this.hasValue()&&!r)return F.createElement(Ls,{name:c,onFocus:this.onValueInputFocus});if(!(!c||r))if(s)if(a){var y=p.map(function(d){return t.getOptionValue(d)}).join(a);return F.createElement("input",{name:c,type:"hidden",value:y})}else{var u=p.length>0?p.map(function(d,b){return F.createElement("input",{key:"i-".concat(b),name:c,type:"hidden",value:t.getOptionValue(d)})}):F.createElement("input",{name:c,type:"hidden",value:""});return F.createElement("div",null,u)}else{var g=p[0]?this.getOptionValue(p[0]):"";return F.createElement("input",{name:c,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,i=this.state,a=i.ariaSelection,r=i.focusedOption,s=i.focusedValue,c=i.isFocused,f=i.selectValue,p=this.getFocusableOptions();return F.createElement(_s,ae({},t,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:r,focusedValue:s,isFocused:c,selectValue:f,focusableOptions:p}))}},{key:"render",value:function(){var t=this.getComponents(),i=t.Control,a=t.IndicatorsContainer,r=t.SelectContainer,s=t.ValueContainer,c=this.props,f=c.className,p=c.id,y=c.isDisabled,u=c.menuIsOpen,g=this.state.isFocused,d=this.commonProps=this.getCommonProps();return F.createElement(r,ae({},d,{className:f,innerProps:{id:p,onKeyDown:this.onKeyDown},isDisabled:y,isFocused:g}),this.renderLiveRegion(),F.createElement(i,ae({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:y,isFocused:g,menuIsOpen:u}),F.createElement(s,ae({},d,{isDisabled:y}),this.renderPlaceholderOrValue(),this.renderInput()),F.createElement(a,ae({},d,{isDisabled:y}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(t,i){var a=i.prevProps,r=i.clearFocusValueOnUpdate,s=i.inputIsHiddenAfterUpdate,c=i.ariaSelection,f=i.isFocused,p=i.prevWasFocused,y=t.options,u=t.value,g=t.menuIsOpen,d=t.inputValue,b=t.isMulti,m=_n(u),w={};if(a&&(u!==a.value||y!==a.options||g!==a.menuIsOpen||d!==a.inputValue)){var _=g?Xs(t,m):[],C=r?qs(i,m):null,I=Js(i,_);w={selectValue:m,focusedOption:I,focusedValue:C,clearFocusValueOnUpdate:!1}}var P=s!=null&&t!==a?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},E=c,D=f&&p;return f&&!D&&(E={value:mt(b,m,m[0]||null),options:m,action:"initial-input-focus"},D=!p),(c==null?void 0:c.action)==="initial-input-focus"&&(E=null),re(re(re({},w),P),{},{prevProps:t,ariaSelection:E,prevWasFocused:D})}}]),n}(F.Component);Rr.defaultProps=Ks;var el=F.forwardRef(function(l,e){var n=ba(l);return F.createElement(Rr,ae({ref:e},n))}),tl=el,nl=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"];function Gt(){return Gt=Object.assign?Object.assign.bind():function(l){for(var e=1;e=0)&&(n[t]=l[t]);return n}var Ar=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=rl(e,nl);return Gt({},n)},il=function(e){var n=typeof e=="string";return n&&["sm","md","lg"].includes(e)},al=function(e){return il(e)?e:e==="xs"?"sm":e==="xl"?"lg":"md"},De=function(e){var n=Mt(),o=al(n.components.Input.defaultProps.size),t=e??o,i=Vi(typeof t=="string"?[t]:t,{fallback:"md"})||o;return i};function Ge(){return Ge=Object.assign?Object.assign.bind():function(l){for(var e=1;e=0)&&(n[t]=l[t]);return n}var dl=function(e){var n=e.className,o=e.cx,t=e.children,i=e.innerRef,a=e.innerProps,r=e.isDisabled,s=e.isFocused,c=e.menuIsOpen,f=e.selectProps,p=f.chakraStyles,y=f.size,u=f.variant,g=f.focusBorderColor,d=f.errorBorderColor,b=f.isInvalid,m=f.isReadOnly,w=De(y),_=$e("Input",{size:w,variant:u,focusBorderColor:g,errorBorderColor:d}),C=_.field,I=C.height,P=C.h,E=cl(C,ul),D=I||P,j=Pe({},E,{position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",padding:0,overflow:"hidden",height:"auto",minH:D},r?{pointerEvents:"none"}:{}),U=p!=null&&p.control?p.control(j,e):j;return oe.createElement(de,Pe({ref:i,className:o({control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":c},n),sx:U},a,{"data-focus":s?!0:void 0,"data-focus-visible":s?!0:void 0,"data-invalid":b?!0:void 0,"data-disabled":r?!0:void 0,"data-readonly":m?!0:void 0}),t)},hl=function(e){var n=e.className,o=e.cx,t=e.selectProps,i=t.chakraStyles,a=t.useBasicStyles,r=t.variant,s=Pe({opacity:1},a||r!=="outline"?{display:"none"}:{}),c=i!=null&&i.indicatorSeparator?i.indicatorSeparator(s,e):s;return oe.createElement(Jn,{className:o({"indicator-separator":!0},n),sx:c,orientation:"vertical"})},fl=function(e){return oe.createElement(Jt,Pe({role:"presentation",focusable:"false","aria-hidden":"true"},e),oe.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))},pl=function(e){var n=e.children,o=e.className,t=e.cx,i=e.innerProps,a=e.selectProps,r=a.chakraStyles,s=a.useBasicStyles,c=a.size,f=a.focusBorderColor,p=a.errorBorderColor,y=a.variant,u=De(c),g=$e("Input",{size:u,variant:y,focusBorderColor:f,errorBorderColor:p}),d={sm:"16px",md:"20px",lg:"24px"},b=d[u],m=Pe({},g.addon,{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",borderRadius:0,borderWidth:0,fontSize:b},s&&{background:"transparent",padding:0,width:6,marginRight:2,marginLeft:1,cursor:"inherit"}),w=r!=null&&r.dropdownIndicator?r.dropdownIndicator(m,e):m,_={height:"1em",width:"1em"},C=r!=null&&r.downChevron?r.downChevron(_,e):_;return oe.createElement(de,Pe({},i,{className:t({indicator:!0,"dropdown-indicator":!0},o),sx:w}),n||oe.createElement(fl,{sx:C}))},ml=function(e){return oe.createElement(Jt,Pe({focusable:"false","aria-hidden":!0},e),oe.createElement("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}))},vl=function(e){var n=e.children,o=e.className,t=e.cx,i=e.innerProps,a=e.selectProps,r=a.chakraStyles,s=a.size,c=De(s),f=Bn("CloseButton",{size:c}),p=Pe({},f,{marginX:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,cursor:"pointer"}),y=r!=null&&r.clearIndicator?r.clearIndicator(p,e):p,u={width:"1em",height:"1em"},g=r!=null&&r.crossIcon?r.crossIcon(u,e):u;return oe.createElement(de,Pe({role:"button",className:t({indicator:!0,"clear-indicator":!0},o),sx:y,"aria-label":"Clear selected options"},i),n||oe.createElement(ml,{sx:g}))},gl=function(e){var n=e.className,o=e.cx,t=e.innerProps,i=e.selectProps,a=i.chakraStyles,r=i.size,s=e.color,c=e.emptyColor,f=e.speed,p=e.thickness,y=e.spinnerSize,u=De(r),g={sm:"xs",md:"sm",lg:"md"},d=g[u],b={marginRight:3},m=a!=null&&a.loadingIndicator?a.loadingIndicator(b,e):b;return oe.createElement(qr,Pe({className:o({indicator:!0,"loading-indicator":!0},n),sx:m},t,{size:y||d,color:s,emptyColor:c,speed:f,thickness:p}))};const bl=dl;var yl=["innerRef","isDisabled","isHidden","inputClassName"];function rt(){return rt=Object.assign?Object.assign.bind():function(l){for(var e=1;e=0)&&(n[t]=l[t]);return n}var xl=function(e){var n=e.className,o=e.cx,t=e.value,i=e.selectProps,a=i.chakraStyles,r=i.isReadOnly,s=Ar(e),c=s.innerRef,f=s.isDisabled,p=s.isHidden,y=s.inputClassName,u=wl(s,yl),g={gridArea:"1 / 2",minW:"2px",border:0,margin:0,outline:0,padding:0},d={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content",color:"inherit",marginX:"0.125rem",paddingY:"0.125rem",visibility:f?"hidden":"visible",transform:t?"translateZ(0)":"",_after:rt({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre",padding:0},g)},b=a!=null&&a.inputContainer?a.inputContainer(d,e):d,m=rt({background:0,opacity:p?0:1,width:"100%"},g),w=a!=null&&a.input?a.input(m,e):m;return oe.createElement(de,{className:o({"input-container":!0},n),"data-value":t||"",sx:b},oe.createElement(Ue.input,rt({className:o({input:!0},y),ref:c,sx:w,disabled:f,readOnly:r?!0:void 0},u)))};const Sl=xl;var _l=["data"];function Cl(l,e){if(l==null)return{};var n={},o=Object.keys(l),t,i;for(i=0;i=0)&&(n[t]=l[t]);return n}function _e(){return _e=Object.assign?Object.assign.bind():function(l){for(var e=1;e=0)&&(n[t]=l[t]);return n}var ql=function(e){var n,o=e.components,t=o===void 0?{}:o;e.theme;var i=e.size,a=e.colorScheme,r=a===void 0?"gray":a,s=e.isDisabled,c=e.isInvalid,f=e.isReadOnly,p=e.required,y=e.isRequired,u=e.inputId,g=e.tagVariant,d=e.selectedOptionStyle,b=d===void 0?"color":d,m=e.selectedOptionColorScheme,w=e.selectedOptionColor,_=e.variant,C=e.focusBorderColor,I=e.errorBorderColor,P=e.chakraStyles,E=P===void 0?{}:P,D=e.onFocus,j=e.onBlur,U=e.menuIsOpen,q=Xl(e,Kl),O=Mt(),L=O.components.Input.defaultProps.variant,v=yi({id:u,isDisabled:s,isInvalid:c,isRequired:y,isReadOnly:f,onFocus:D,onBlur:j}),B=U??(v.readOnly?!1:void 0),te=b,T=["color","check"];T.includes(b)||(te="color");var J=m||w||"blue";typeof J!="string"&&(J="blue");var N=Pt({components:Pt({},Yl,t),colorScheme:r,size:i,tagVariant:g,selectedOptionStyle:te,selectedOptionColorScheme:J,variant:_??L,chakraStyles:E,focusBorderColor:C,errorBorderColor:I,onFocus:v.onFocus,onBlur:v.onBlur,isDisabled:v.disabled,isInvalid:!!v["aria-invalid"],inputId:v.id,isReadOnly:v.readOnly,required:p??v.required,menuIsOpen:B},q,{"aria-invalid":(n=q["aria-invalid"])!=null?n:v["aria-invalid"]});return N};const Jl=ql;function Xt(){return Xt=Object.assign?Object.assign.bind():function(l){for(var e=1;e({value:g,label:g})))??[],[r,s]=F.useState(a),c=async()=>{var g,d;await((g=We)==null?void 0:g.put({name:t,workflowIDs:[],updateTime:Date.now()})),await((d=We)==null?void 0:d.listAll().then(b=>o(b??[]))),i("")},f=async()=>{var d;const g=await((d=We)==null?void 0:d.listAll());o(g??[])};if(We==null)return alert("Error: TagsTable is not loaded"),null;const p=n.map(g=>({value:g.name,label:g.name})),y=37*5;return x.jsxs(wi,{isLazy:!0,onOpen:f,children:[x.jsx(xi,{children:x.jsx(xe,{"aria-label":"Delete confirm",size:"sm",variant:"ghost",icon:x.jsx(rr,{color:"#718096"})})}),x.jsxs(Si,{children:[x.jsx(_i,{}),x.jsx(Ci,{}),x.jsx(tr,{children:x.jsx("b",{children:l.name})}),x.jsxs(ki,{children:[x.jsx(eu,{isMulti:!0,name:"tags",options:p,menuIsOpen:!0,value:r,onChange:async g=>{var d;s(g),await((d=be)==null?void 0:d.updateMetaInfo(l.id,{tags:g.map(b=>b.value)})),await(e==null?void 0:e())},chakraStyles:{dropdownIndicator:g=>({...g,p:0,w:"30px"}),menuList:g=>({...g,shadow:"none",pt:0})},placeholder:"Select tags",closeMenuOnSelect:!1,maxMenuHeight:y}),x.jsxs(we,{gap:4,mt:Math.min(y,Math.max(n.length,3)*37),children:[x.jsx(it,{placeholder:"New tag name",size:"sm",mt:6,mb:6,variant:"flushed",value:t,onChange:g=>{i(g.target.value.trim())}}),x.jsx(Se,{iconSpacing:1,leftIcon:x.jsx(tn,{size:16}),colorScheme:"teal",variant:"solid",size:"xs",px:5,isDisabled:t.length===0,onClick:c,children:"New Tag"})]})]})]})]})}function nu({menuPosition:l,workflowID:e,onClose:n}){const{onDuplicateWorkflow:o}=F.useContext(nn);return x.jsx(x.Fragment,{children:x.jsx(de,{position:"absolute",top:l.y,left:l.x,children:x.jsx(Xe,{isOpen:!0,onClose:n,children:x.jsx(at,{children:x.jsx(Re,{onClick:()=>o&&o(e),children:"Duplicate"})})})})})}const Vn=F.memo(function({workflow:e}){const{colorMode:n}=qt(),[o,t]=F.useState({x:0,y:0}),[i,a]=F.useState(!1),{setDraggingFile:r,isMultiSelecting:s,onMultiSelectFlow:c,onDeleteFlow:f,multiSelectedFlowsID:p}=F.useContext(Be),y=p&&p.length>0&&p.includes(e.id),{curFlowID:u,loadWorkflowID:g}=F.useContext(nn),d=u===e.id,b=P=>{P.preventDefault(),t({x:P.clientX,y:P.clientY}),a(!0)},[m,w]=F.useState(!1),_=()=>{a(!1)},C=n==="light"?"gray.200":"#4A5568",I=x.jsx(de,{flexShrink:1,flexGrow:1,backgroundColor:d?"teal.200":i?C:void 0,color:d&&!s?"#333":void 0,draggable:!s,onDragStart:()=>r==null?void 0:r(e),borderRadius:6,px:1,py:1,onClick:()=>{!s&&g(e.id)},_hover:{bg:C},children:x.jsxs(we,{children:[e.coverMediaPath!=null&&x.jsx(Ri,{mediaLocalPath:e.coverMediaPath,size:60,hideBrokenImage:!0,isPreview:!0}),x.jsxs(Le,{textAlign:"left",gap:0,children:[x.jsx(Oe,{fontWeight:"500",children:e.name??"untitled"}),x.jsxs(Oe,{color:"GrayText",ml:2,fontSize:"sm",children:["Updated: ",Yn(e.updateTime)]})]})]})});return x.jsxs(we,{w:"100%",mb:1,justify:"space-between",onContextMenu:b,onMouseEnter:()=>{w(!0)},onMouseLeave:()=>{w(!1)},children:[s?x.jsx(ot,{isChecked:y,spacing:4,onChange:P=>{c&&c(e.id,P.target.checked)},children:I}):x.jsxs(x.Fragment,{children:[I,x.jsxs(nt,{width:"90px",justifyContent:"flex-end",children:[m&&x.jsx(tu,{workflow:e}),x.jsx(Fe,{label:"Open in new tab",children:x.jsx(xe,{"aria-label":"Open in new tab",size:"sm",variant:"ghost",onClick:()=>Oi(e.id),icon:x.jsx(Ii,{color:"#718096",size:23})})}),x.jsx(Kn,{promptMessage:"Are you sure you want to delete this workflow?",onDelete:()=>{f&&f(e.id)}})]})]}),i&&x.jsx(nu,{menuPosition:o,onClose:_,workflowID:e.id})]})});function Lr({items:l}){var y;const[e,n]=F.useState(!1),o=l.filter(He),t=l.filter(u=>!He(u)),i=(y=t[0])==null?void 0:y.parentFolderID,[a,r]=F.useState(!1),{onRefreshFilesList:s,draggingFile:c,refreshFolderStamp:f}=F.useContext(Be),p=async u=>{var g,d;if(u.preventDefault(),u.stopPropagation(),!c)return r(!1);if(He(c)){if(c.id===i)return r(!1);await((g=Ve)==null?void 0:g.update(c.id,{parentFolderID:i}))}else await((d=be)==null?void 0:d.updateFolder(c.id,{parentFolderID:i}));await(s==null?void 0:s()),r(!1)};return F.useEffect(()=>{var u;(u=ye)==null||u.getSetting("foldersOnTop").then(g=>{n(g??!1)})},[f]),x.jsxs(x.Fragment,{children:[e&&o.map(u=>x.jsx(bn,{folder:u},u.id)),x.jsx(de,{border:a?"2px dashed #718096":"2px dashed transparent",onDragOver:u=>{u.preventDefault(),u.stopPropagation(),r(!0)},onDragLeave:u=>{u.preventDefault(),u.stopPropagation(),r(!1)},onDrop:p,className:"droppable",children:e?t.map(u=>x.jsx(Vn,{workflow:u},u.id)):l.map(u=>He(u)?x.jsx(bn,{folder:u},u.id):x.jsx(Vn,{workflow:u},u.id))})]})}function hu({onClose:l,onClickNewFlow:e}){const[n,o]=F.useState([]),t=F.useRef([]),i=F.useRef([]),{loadWorkflowID:a,curFlowID:r}=F.useContext(nn),[s,c]=F.useState(),[f,p]=F.useState(!1),[y,u]=F.useState([]),[g,d]=F.useState(0),[b,m]=F.useState(""),w=la(b,400),_=F.useRef(null),[C,I]=F.useState(null),P=F.useRef(window.localStorage.getItem($t)??fn.RECENTLY_MODIFIED),E=async()=>{var J,N;const T=await((J=be)==null?void 0:J.listFolderContent())??[];t.current=T,await((N=be)==null?void 0:N.listAll().then(K=>{i.current=K})),j(),d(Date.now())},D=!!s||!!w,j=()=>{if(D){const T=i.current.filter(J=>{var A;let N=!0,K=!0;return s&&(N=!!((A=J.tags)!=null&&A.includes(s))),w&&(K=!!J.name.toLocaleLowerCase().includes(w.toLocaleLowerCase())),N&&K});o(Ft(T,P.current))}else o(Ft(t.current,P.current))},U=T=>{o(Ft(n,T)),P.current=T,window.localStorage.setItem($t,T),!D&&d(Date.now())};F.useEffect(()=>{j()},[w,s]);const q=F.useCallback(async T=>{var J,N,K;await((J=be)==null?void 0:J.deleteFlow(T)),((K=(N=be)==null?void 0:N.curWorkflow)==null?void 0:K.id)===T&&await(a==null?void 0:a(null)),await E()},[s,w]);F.useEffect(()=>{E();const T=async J=>{var N;if(_.current){const K=await((N=be)==null?void 0:N.get(_.current));K&&K.json&&ji(K.json,[J.canvasX,J.canvasY])}};return ct.canvasEl.addEventListener("drop",T),ct.canvasEl.addEventListener("click",l),()=>{ct.canvasEl.removeEventListener("drop",T),ct.canvasEl.removeEventListener("click",l)}},[]);const O=F.useCallback((T,J)=>{u(N=>{const K=[...N];return J?K.push(T):K.splice(K.indexOf(T),1),K})},[]),L=(T,J)=>{var N;switch(T){case"batchDelete":r&&((N=be)==null||N.get(r).then(K=>{K||a==null||a(null)})),E(),p(!1),u([]);return;case"selectAll":u(J?i.current.map(K=>K.id):[]);return}},v=T=>{I(T),He(T)||(_.current=T.id)},B=T=>{m(T)},te=450;return x.jsx(Be.Provider,{value:{onRefreshFilesList:E,draggingFile:C??void 0,setDraggingFile:v,isMultiSelecting:f,onMultiSelectFlow:O,multiSelectedFlowsID:y,onDeleteFlow:q,refreshFolderStamp:g,setRefreshFolderStamp:d},children:x.jsx(de,{style:{width:te},children:x.jsxs(Ei,{width:te,height:"100vh",pl:4,pr:5,pt:4,gap:4,position:"absolute",top:0,left:0,shadow:"xl",zIndex:Pi,children:[x.jsxs(nt,{alignItems:"center",justifyContent:"space-between",children:[x.jsxs(we,{gap:4,children:[x.jsx(we,{gap:2,children:x.jsx(Oe,{fontSize:19,fontWeight:600,children:"☕️Workspace"})}),x.jsx(or,{}),x.jsx(Fe,{label:"Open workspace save directory",children:x.jsx(xe,{"aria-label":"Open workspace save directory",size:"sm",icon:x.jsx(Xn,{}),variant:"outline",colorScheme:"teal",onClick:()=>Mi()})}),x.jsx(Fe,{label:"New workflow",children:x.jsx(xe,{"aria-label":"New workflow",size:"sm",icon:x.jsx(tn,{}),variant:"outline",colorScheme:"teal",onClick:e})})]}),x.jsx(we,{alignItems:"center",children:x.jsx(oa,{})})]}),x.jsxs(nt,{direction:"column",h:"calc(100% - 64px)",children:[x.jsx(da,{selectedTag:s,setSelectedTag:c}),x.jsxs(we,{mb:2,mt:2,p:0,justifyContent:"space-between",children:[x.jsxs(we,{children:[i.current.length>0?x.jsx(sa,{multipleState:f,changeMultipleState:T=>{p(T),!T&&u([])},selectedKeys:y,isSelectedAll:y.length===i.current.length,batchOperationCallback:L}):x.jsx(de,{}),!f&&x.jsx(Fe,{hasArrow:!0,label:"New folder",placement:"bottom-start",children:x.jsx(xe,{size:"sm",variant:"outline",icon:x.jsx(nr,{size:21}),onClick:async()=>{var T;await((T=Ve)==null?void 0:T.create({name:"New Folder"})),E()},"aria-label":"new folder button"})})]}),x.jsxs(Xe,{closeOnSelect:!0,children:[x.jsx(jt,{as:Se,variant:"ghost",size:"xs",pr:0,rightIcon:x.jsx(en,{size:"16"}),children:x.jsxs(we,{children:[x.jsx(Oe,{children:"Sort by:"}),x.jsx(Oe,{display:"inline-block",children:P.current})]})}),x.jsx(at,{children:x.jsx(er,{value:P.current,type:"radio",onChange:T=>U(T),children:Object.values(fn).map((T,J)=>x.jsx(rn,{value:T,children:T},J))})})]})]}),x.jsx(ca,{searchValue:b,onUpdateSearchValue:B}),x.jsx(nt,{overflowY:"auto",overflowX:"hidden",direction:"column",children:x.jsx(Lr,{items:n})})]})]})})})}export{hu as default};
+`]))),Fo=function(e,n){var o=e.isFocused,t=e.size,i=e.theme,a=i.colors,r=i.spacing.baseUnit;return re({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:t,lineHeight:1,marginRight:t,textAlign:"center",verticalAlign:"middle"},n?{}:{color:o?a.neutral60:a.neutral20,padding:r*2})},Tt=function(e){var n=e.delay,o=e.offset;return ie("span",{css:Wn({animation:"".concat(zo," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:o?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Ro=function(e){var n=e.innerProps,o=e.isRtl,t=e.size,i=t===void 0?4:t,a=Ne(e,ko);return ie("div",ae({},me(re(re({},a),{},{innerProps:n,isRtl:o,size:i}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),ie(Tt,{delay:0,offset:o}),ie(Tt,{delay:160,offset:!0}),ie(Tt,{delay:320,offset:!o}))},Ao=function(e,n){var o=e.isDisabled,t=e.isFocused,i=e.theme,a=i.colors,r=i.borderRadius,s=i.spacing;return re({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:o?a.neutral5:a.neutral0,borderColor:o?a.neutral10:t?a.primary:a.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:t?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:t?a.primary:a.neutral30}})},To=function(e){var n=e.children,o=e.isDisabled,t=e.isFocused,i=e.innerRef,a=e.innerProps,r=e.menuIsOpen;return ie("div",ae({ref:i},me(e,"control",{control:!0,"control--is-disabled":o,"control--is-focused":t,"control--menu-is-open":r}),a,{"aria-disabled":o||void 0}),n)},Lo=To,Vo=["data"],Bo=function(e,n){var o=e.theme.spacing;return n?{}:{paddingBottom:o.baseUnit*2,paddingTop:o.baseUnit*2}},No=function(e){var n=e.children,o=e.cx,t=e.getStyles,i=e.getClassNames,a=e.Heading,r=e.headingProps,s=e.innerProps,c=e.label,f=e.theme,p=e.selectProps;return ie("div",ae({},me(e,"group",{group:!0}),s),ie(a,ae({},r,{selectProps:p,theme:f,getStyles:t,getClassNames:i,cx:o}),c),ie("div",null,n))},$o=function(e,n){var o=e.theme,t=o.colors,i=o.spacing;return re({label:"group",cursor:"default",display:"block"},n?{}:{color:t.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:i.baseUnit*3,paddingRight:i.baseUnit*3,textTransform:"uppercase"})},Uo=function(e){var n=pr(e);n.data;var o=Ne(n,Vo);return ie("div",ae({},me(e,"groupHeading",{"group-heading":!0}),o))},Wo=No,Ho=["innerRef","isDisabled","isHidden","inputClassName"],Zo=function(e,n){var o=e.isDisabled,t=e.value,i=e.theme,a=i.spacing,r=i.colors;return re(re({visibility:o?"hidden":"visible",transform:t?"translateZ(0)":""},Go),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:r.neutral80})},_r={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Go={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":re({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},_r)},Yo=function(e){return re({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},_r)},Ko=function(e){var n=e.cx,o=e.value,t=pr(e),i=t.innerRef,a=t.isDisabled,r=t.isHidden,s=t.inputClassName,c=Ne(t,Ho);return ie("div",ae({},me(e,"input",{"input-container":!0}),{"data-value":o||""}),ie("input",ae({className:n({input:!0},s),ref:i,style:Yo(r),disabled:a},c)))},Xo=Ko,qo=function(e,n){var o=e.theme,t=o.spacing,i=o.borderRadius,a=o.colors;return re({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:i/2,margin:t.baseUnit/2})},Jo=function(e,n){var o=e.theme,t=o.borderRadius,i=o.colors,a=e.cropWithEllipsis;return re({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:t/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Qo=function(e,n){var o=e.theme,t=o.spacing,i=o.borderRadius,a=o.colors,r=e.isFocused;return re({alignItems:"center",display:"flex"},n?{}:{borderRadius:i/2,backgroundColor:r?a.dangerLight:void 0,paddingLeft:t.baseUnit,paddingRight:t.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Cr=function(e){var n=e.children,o=e.innerProps;return ie("div",o,n)},es=Cr,ts=Cr;function ns(l){var e=l.children,n=l.innerProps;return ie("div",ae({role:"button"},n),e||ie(ln,{size:14}))}var rs=function(e){var n=e.children,o=e.components,t=e.data,i=e.innerProps,a=e.isDisabled,r=e.removeProps,s=e.selectProps,c=o.Container,f=o.Label,p=o.Remove;return ie(c,{data:t,innerProps:re(re({},me(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),i),selectProps:s},ie(f,{data:t,innerProps:re({},me(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),ie(p,{data:t,innerProps:re(re({},me(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},r),selectProps:s}))},is=rs,as=function(e,n){var o=e.isDisabled,t=e.isFocused,i=e.isSelected,a=e.theme,r=a.spacing,s=a.colors;return re({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:i?s.primary:t?s.primary25:"transparent",color:o?s.neutral20:i?s.neutral0:"inherit",padding:"".concat(r.baseUnit*2,"px ").concat(r.baseUnit*3,"px"),":active":{backgroundColor:o?void 0:i?s.primary:s.primary50}})},os=function(e){var n=e.children,o=e.isDisabled,t=e.isFocused,i=e.isSelected,a=e.innerRef,r=e.innerProps;return ie("div",ae({},me(e,"option",{option:!0,"option--is-disabled":o,"option--is-focused":t,"option--is-selected":i}),{ref:a,"aria-disabled":o},r),n)},ss=os,ls=function(e,n){var o=e.theme,t=o.spacing,i=o.colors;return re({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:i.neutral50,marginLeft:t.baseUnit/2,marginRight:t.baseUnit/2})},us=function(e){var n=e.children,o=e.innerProps;return ie("div",ae({},me(e,"placeholder",{placeholder:!0}),o),n)},cs=us,ds=function(e,n){var o=e.isDisabled,t=e.theme,i=t.spacing,a=t.colors;return re({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:o?a.neutral40:a.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},hs=function(e){var n=e.children,o=e.isDisabled,t=e.innerProps;return ie("div",ae({},me(e,"singleValue",{"single-value":!0,"single-value--is-disabled":o}),t),n)},fs=hs,ps={ClearIndicator:Mo,Control:Lo,DropdownIndicator:Eo,DownChevron:xr,CrossIcon:ln,Group:Wo,GroupHeading:Uo,IndicatorsContainer:_o,IndicatorSeparator:Do,Input:Xo,LoadingIndicator:Ro,Menu:lo,MenuList:co,MenuPortal:go,LoadingMessage:mo,NoOptionsMessage:po,MultiValue:is,MultiValueContainer:es,MultiValueLabel:ts,MultiValueRemove:ns,Option:ss,Placeholder:cs,SelectContainer:yo,SingleValue:fs,ValueContainer:xo},ms=function(e){return re(re({},ps),e.components)},In=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function vs(l,e){return!!(l===e||In(l)&&In(e))}function gs(l,e){if(l.length!==e.length)return!1;for(var n=0;n1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return a?"option ".concat(t," is disabled. Select another option."):"option ".concat(t,", selected.");default:return""}},onFocus:function(e){var n=e.context,o=e.focused,t=e.options,i=e.label,a=i===void 0?"":i,r=e.selectValue,s=e.isDisabled,c=e.isSelected,f=function(g,d){return g&&g.length?"".concat(g.indexOf(d)+1," of ").concat(g.length):""};if(n==="value"&&r)return"value ".concat(a," focused, ").concat(f(r,o),".");if(n==="menu"){var p=s?" disabled":"",y="".concat(c?"selected":"focused").concat(p);return"option ".concat(a," ").concat(y,", ").concat(f(t,o),".")}return""},onFilter:function(e){var n=e.inputValue,o=e.resultsMessage;return"".concat(o).concat(n?" for search term "+n:"",".")}},Ss=function(e){var n=e.ariaSelection,o=e.focusedOption,t=e.focusedValue,i=e.focusableOptions,a=e.isFocused,r=e.selectValue,s=e.selectProps,c=e.id,f=s.ariaLiveMessages,p=s.getOptionLabel,y=s.inputValue,u=s.isMulti,g=s.isOptionDisabled,d=s.isSearchable,b=s.menuIsOpen,m=s.options,w=s.screenReaderStatus,_=s.tabSelectsValue,C=s["aria-label"],I=s["aria-live"],P=F.useMemo(function(){return re(re({},xs),f||{})},[f]),E=F.useMemo(function(){var v="";if(n&&P.onChange){var B=n.option,te=n.options,T=n.removedValue,J=n.removedValues,N=n.value,K=function(he){return Array.isArray(he)?null:he},A=T||B||K(N),z=A?p(A):"",ee=te||J||void 0,X=ee?ee.map(p):[],Z=re({isDisabled:A&&g(A,r),label:z,labels:X},n);v=P.onChange(Z)}return v},[n,P,g,r,p]),D=F.useMemo(function(){var v="",B=o||t,te=!!(o&&r&&r.includes(o));if(B&&P.onFocus){var T={focused:B,label:p(B),isDisabled:g(B,r),isSelected:te,options:i,context:B===o?"menu":"value",selectValue:r};v=P.onFocus(T)}return v},[o,t,p,g,P,i,r]),j=F.useMemo(function(){var v="";if(b&&m.length&&P.onFilter){var B=w({count:i.length});v=P.onFilter({inputValue:y,resultsMessage:B})}return v},[i,y,b,P,m,w]),U=F.useMemo(function(){var v="";if(P.guidance){var B=t?"value":b?"menu":"input";v=P.guidance({"aria-label":C,context:B,isDisabled:o&&g(o,r),isMulti:u,isSearchable:d,tabSelectsValue:_})}return v},[C,o,t,u,g,d,b,P,r,_]),q="".concat(D," ").concat(j," ").concat(U),O=ie(F.Fragment,null,ie("span",{id:"aria-selection"},E),ie("span",{id:"aria-context"},q)),L=(n==null?void 0:n.action)==="initial-input-focus";return ie(F.Fragment,null,ie(En,{id:c},L&&O),ie(En,{"aria-live":I,"aria-atomic":"false","aria-relevant":"additions text"},a&&!L&&O))},_s=Ss,Zt=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Cs=new RegExp("["+Zt.map(function(l){return l.letters}).join("")+"]","g"),kr={};for(var Lt=0;Lt-1}},Es=["innerRef"];function Ps(l){var e=l.innerRef,n=Ne(l,Es),o=eo(n,"onExited","in","enter","exit","appear");return ie("input",ae({ref:e},o,{css:Wn({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Ms=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function js(l){var e=l.isEnabled,n=l.onBottomArrive,o=l.onBottomLeave,t=l.onTopArrive,i=l.onTopLeave,a=F.useRef(!1),r=F.useRef(!1),s=F.useRef(0),c=F.useRef(null),f=F.useCallback(function(b,m){if(c.current!==null){var w=c.current,_=w.scrollTop,C=w.scrollHeight,I=w.clientHeight,P=c.current,E=m>0,D=C-I-_,j=!1;D>m&&a.current&&(o&&o(b),a.current=!1),E&&r.current&&(i&&i(b),r.current=!1),E&&m>D?(n&&!a.current&&n(b),P.scrollTop=C,j=!0,a.current=!0):!E&&-m>_&&(t&&!r.current&&t(b),P.scrollTop=0,j=!0,r.current=!0),j&&Ms(b)}},[n,o,t,i]),p=F.useCallback(function(b){f(b,b.deltaY)},[f]),y=F.useCallback(function(b){s.current=b.changedTouches[0].clientY},[]),u=F.useCallback(function(b){var m=s.current-b.changedTouches[0].clientY;f(b,m)},[f]),g=F.useCallback(function(b){if(b){var m=qa?{passive:!1}:!1;b.addEventListener("wheel",p,m),b.addEventListener("touchstart",y,m),b.addEventListener("touchmove",u,m)}},[u,y,p]),d=F.useCallback(function(b){b&&(b.removeEventListener("wheel",p,!1),b.removeEventListener("touchstart",y,!1),b.removeEventListener("touchmove",u,!1))},[u,y,p]);return F.useEffect(function(){if(e){var b=c.current;return g(b),function(){d(b)}}},[e,g,d]),function(b){c.current=b}}var Mn=["boxSizing","height","overflow","paddingRight","position"],jn={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Dn(l){l.preventDefault()}function zn(l){l.stopPropagation()}function Fn(){var l=this.scrollTop,e=this.scrollHeight,n=l+this.offsetHeight;l===0?this.scrollTop=1:n===e&&(this.scrollTop=l-1)}function Rn(){return"ontouchstart"in window||navigator.maxTouchPoints}var An=!!(typeof window<"u"&&window.document&&window.document.createElement),et=0,Ze={capture:!1,passive:!1};function Ds(l){var e=l.isEnabled,n=l.accountForScrollbars,o=n===void 0?!0:n,t=F.useRef({}),i=F.useRef(null),a=F.useCallback(function(s){if(An){var c=document.body,f=c&&c.style;if(o&&Mn.forEach(function(g){var d=f&&f[g];t.current[g]=d}),o&&et<1){var p=parseInt(t.current.paddingRight,10)||0,y=document.body?document.body.clientWidth:0,u=window.innerWidth-y+p||0;Object.keys(jn).forEach(function(g){var d=jn[g];f&&(f[g]=d)}),f&&(f.paddingRight="".concat(u,"px"))}c&&Rn()&&(c.addEventListener("touchmove",Dn,Ze),s&&(s.addEventListener("touchstart",Fn,Ze),s.addEventListener("touchmove",zn,Ze))),et+=1}},[o]),r=F.useCallback(function(s){if(An){var c=document.body,f=c&&c.style;et=Math.max(et-1,0),o&&et<1&&Mn.forEach(function(p){var y=t.current[p];f&&(f[p]=y)}),c&&Rn()&&(c.removeEventListener("touchmove",Dn,Ze),s&&(s.removeEventListener("touchstart",Fn,Ze),s.removeEventListener("touchmove",zn,Ze)))}},[o]);return F.useEffect(function(){if(e){var s=i.current;return a(s),function(){r(s)}}},[e,a,r]),function(s){i.current=s}}var zs=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Fs={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Rs(l){var e=l.children,n=l.lockEnabled,o=l.captureEnabled,t=o===void 0?!0:o,i=l.onBottomArrive,a=l.onBottomLeave,r=l.onTopArrive,s=l.onTopLeave,c=js({isEnabled:t,onBottomArrive:i,onBottomLeave:a,onTopArrive:r,onTopLeave:s}),f=Ds({isEnabled:n}),p=function(u){c(u),f(u)};return ie(F.Fragment,null,n&&ie("div",{onClick:zs,css:Fs}),e(p))}var As={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Ts=function(e){var n=e.name,o=e.onFocus;return ie("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:o,css:As,value:"",onChange:function(){}})},Ls=Ts,Vs=function(e){return e.label},Bs=function(e){return e.label},Ns=function(e){return e.value},$s=function(e){return!!e.isDisabled},Us={clearIndicator:Po,container:bo,control:Ao,dropdownIndicator:Io,group:Bo,groupHeading:$o,indicatorsContainer:So,indicatorSeparator:jo,input:Zo,loadingIndicator:Fo,loadingMessage:fo,menu:ao,menuList:uo,menuPortal:vo,multiValue:qo,multiValueLabel:Jo,multiValueRemove:Qo,noOptionsMessage:ho,option:as,placeholder:ls,singleValue:ds,valueContainer:wo},Ws={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Hs=4,Ir=4,Zs=38,Gs=Ir*2,Ys={baseUnit:Ir,controlHeight:Zs,menuGutter:Gs},Nt={borderRadius:Hs,colors:Ws,spacing:Ys},Ks={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:kn(),captureMenuScroll:!kn(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Is(),formatGroupLabel:Vs,getOptionLabel:Bs,getOptionValue:Ns,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:$s,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Ka(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Tn(l,e,n,o){var t=jr(l,e,n),i=Dr(l,e,n),a=Mr(l,e),r=Et(l,e);return{type:"option",data:e,isDisabled:t,isSelected:i,label:a,value:r,index:o}}function Er(l,e){return l.options.map(function(n,o){if("options"in n){var t=n.options.map(function(a,r){return Tn(l,a,e,r)}).filter(function(a){return Ln(l,a)});return t.length>0?{type:"group",data:n,options:t,index:o}:void 0}var i=Tn(l,n,e,o);return Ln(l,i)?i:void 0}).filter(Ja)}function Pr(l){return l.reduce(function(e,n){return n.type==="group"?e.push.apply(e,lr(n.options.map(function(o){return o.data}))):e.push(n.data),e},[])}function Xs(l,e){return Pr(Er(l,e))}function Ln(l,e){var n=l.inputValue,o=n===void 0?"":n,t=e.data,i=e.isSelected,a=e.label,r=e.value;return(!Fr(l)||!i)&&zr(l,{label:a,value:r,data:t},o)}function qs(l,e){var n=l.focusedValue,o=l.selectValue,t=o.indexOf(n);if(t>-1){var i=e.indexOf(n);if(i>-1)return n;if(t-1?n:e[0]}var Mr=function(e,n){return e.getOptionLabel(n)},Et=function(e,n){return e.getOptionValue(n)};function jr(l,e,n){return typeof l.isOptionDisabled=="function"?l.isOptionDisabled(e,n):!1}function Dr(l,e,n){if(n.indexOf(e)>-1)return!0;if(typeof l.isOptionSelected=="function")return l.isOptionSelected(e,n);var o=Et(l,e);return n.some(function(t){return Et(l,t)===o})}function zr(l,e,n){return l.filterOption?l.filterOption(e,n):!0}var Fr=function(e){var n=e.hideSelectedOptions,o=e.isMulti;return n===void 0?o:n},Qs=1,Rr=function(l){xa(n,l);var e=ka(n);function n(o){var t;if(ya(this,n),t=e.call(this,o),t.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(r){t.controlRef=r},t.focusedOptionRef=null,t.getFocusedOptionRef=function(r){t.focusedOptionRef=r},t.menuListRef=null,t.getMenuListRef=function(r){t.menuListRef=r},t.inputRef=null,t.getInputRef=function(r){t.inputRef=r},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(r,s){var c=t.props,f=c.onChange,p=c.name;s.name=p,t.ariaOnChange(r,s),f(r,s)},t.setValue=function(r,s,c){var f=t.props,p=f.closeMenuOnSelect,y=f.isMulti,u=f.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:u}),p&&(t.setState({inputIsHiddenAfterUpdate:!y}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(r,{action:s,option:c})},t.selectOption=function(r){var s=t.props,c=s.blurInputOnSelect,f=s.isMulti,p=s.name,y=t.state.selectValue,u=f&&t.isOptionSelected(r,y),g=t.isOptionDisabled(r,y);if(u){var d=t.getOptionValue(r);t.setValue(y.filter(function(b){return t.getOptionValue(b)!==d}),"deselect-option",r)}else if(!g)f?t.setValue([].concat(lr(y),[r]),"select-option",r):t.setValue(r,"select-option");else{t.ariaOnChange(r,{action:"select-option",option:r,name:p});return}c&&t.blurInput()},t.removeValue=function(r){var s=t.props.isMulti,c=t.state.selectValue,f=t.getOptionValue(r),p=c.filter(function(u){return t.getOptionValue(u)!==f}),y=mt(s,p,p[0]||null);t.onChange(y,{action:"remove-value",removedValue:r}),t.focusInput()},t.clearValue=function(){var r=t.state.selectValue;t.onChange(mt(t.props.isMulti,[],null),{action:"clear",removedValues:r})},t.popValue=function(){var r=t.props.isMulti,s=t.state.selectValue,c=s[s.length-1],f=s.slice(0,s.length-1),p=mt(r,f,f[0]||null);t.onChange(p,{action:"pop-value",removedValue:c})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var r=arguments.length,s=new Array(r),c=0;cy||p>y}},t.onTouchEnd=function(r){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(r.target)&&t.menuListRef&&!t.menuListRef.contains(r.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(r){t.userIsDragging||t.onControlMouseDown(r)},t.onClearIndicatorTouchEnd=function(r){t.userIsDragging||t.onClearIndicatorMouseDown(r)},t.onDropdownIndicatorTouchEnd=function(r){t.userIsDragging||t.onDropdownIndicatorMouseDown(r)},t.handleInputChange=function(r){var s=t.props.inputValue,c=r.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(c,{action:"input-change",prevInputValue:s}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(r){t.props.onFocus&&t.props.onFocus(r),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(r){var s=t.props.inputValue;if(t.menuListRef&&t.menuListRef.contains(document.activeElement)){t.inputRef.focus();return}t.props.onBlur&&t.props.onBlur(r),t.onInputChange("",{action:"input-blur",prevInputValue:s}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1})},t.onOptionHover=function(r){t.blockOptionHover||t.state.focusedOption===r||t.setState({focusedOption:r})},t.shouldHideSelectedOptions=function(){return Fr(t.props)},t.onValueInputFocus=function(r){r.preventDefault(),r.stopPropagation(),t.focus()},t.onKeyDown=function(r){var s=t.props,c=s.isMulti,f=s.backspaceRemovesValue,p=s.escapeClearsValue,y=s.inputValue,u=s.isClearable,g=s.isDisabled,d=s.menuIsOpen,b=s.onKeyDown,m=s.tabSelectsValue,w=s.openMenuOnFocus,_=t.state,C=_.focusedOption,I=_.focusedValue,P=_.selectValue;if(!g&&!(typeof b=="function"&&(b(r),r.defaultPrevented))){switch(t.blockOptionHover=!0,r.key){case"ArrowLeft":if(!c||y)return;t.focusValue("previous");break;case"ArrowRight":if(!c||y)return;t.focusValue("next");break;case"Delete":case"Backspace":if(y)return;if(I)t.removeValue(I);else{if(!f)return;c?t.popValue():u&&t.clearValue()}break;case"Tab":if(t.isComposing||r.shiftKey||!d||!m||!C||w&&t.isOptionSelected(C,P))return;t.selectOption(C);break;case"Enter":if(r.keyCode===229)break;if(d){if(!C||t.isComposing)return;t.selectOption(C);break}return;case"Escape":d?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:y}),t.onMenuClose()):u&&p&&t.clearValue();break;case" ":if(y)return;if(!d){t.openMenu("first");break}if(!C)return;t.selectOption(C);break;case"ArrowUp":d?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":d?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!d)return;t.focusOption("pageup");break;case"PageDown":if(!d)return;t.focusOption("pagedown");break;case"Home":if(!d)return;t.focusOption("first");break;case"End":if(!d)return;t.focusOption("last");break;default:return}r.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++Qs),t.state.selectValue=_n(o.value),o.menuIsOpen&&t.state.selectValue.length){var i=t.buildFocusableOptions(),a=i.indexOf(t.state.selectValue[0]);t.state.focusedOption=i[a]}return t}return wa(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Cn(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(t){var i=this.props,a=i.isDisabled,r=i.menuIsOpen,s=this.state.isFocused;(s&&!a&&t.isDisabled||s&&r&&!t.menuIsOpen)&&this.focusInput(),s&&a&&!t.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!a&&t.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Cn(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(t,i){this.props.onInputChange(t,i)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(t){var i=this,a=this.state,r=a.selectValue,s=a.isFocused,c=this.buildFocusableOptions(),f=t==="first"?0:c.length-1;if(!this.props.isMulti){var p=c.indexOf(r[0]);p>-1&&(f=p)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[f]},function(){return i.onMenuOpen()})}},{key:"focusValue",value:function(t){var i=this.state,a=i.selectValue,r=i.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=a.indexOf(r);r||(s=-1);var c=a.length-1,f=-1;if(a.length){switch(t){case"previous":s===0?f=0:s===-1?f=c:f=s-1;break;case"next":s>-1&&s0&&arguments[0]!==void 0?arguments[0]:"first",i=this.props.pageSize,a=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var s=0,c=r.indexOf(a);a||(c=-1),t==="up"?s=c>0?c-1:r.length-1:t==="down"?s=(c+1)%r.length:t==="pageup"?(s=c-i,s<0&&(s=0)):t==="pagedown"?(s=c+i,s>r.length-1&&(s=r.length-1)):t==="last"&&(s=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[s],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Nt):re(re({},Nt),this.props.theme):Nt}},{key:"getCommonProps",value:function(){var t=this.clearValue,i=this.cx,a=this.getStyles,r=this.getClassNames,s=this.getValue,c=this.selectOption,f=this.setValue,p=this.props,y=p.isMulti,u=p.isRtl,g=p.options,d=this.hasValue();return{clearValue:t,cx:i,getStyles:a,getClassNames:r,getValue:s,hasValue:d,isMulti:y,isRtl:u,options:g,selectOption:c,selectProps:p,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var t=this.state.selectValue;return t.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var t=this.props,i=t.isClearable,a=t.isMulti;return i===void 0?a:i}},{key:"isOptionDisabled",value:function(t,i){return jr(this.props,t,i)}},{key:"isOptionSelected",value:function(t,i){return Dr(this.props,t,i)}},{key:"filterOption",value:function(t,i){return zr(this.props,t,i)}},{key:"formatOptionLabel",value:function(t,i){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(t,{context:i,inputValue:a,selectValue:r})}else return this.getOptionLabel(t)}},{key:"formatGroupLabel",value:function(t){return this.props.formatGroupLabel(t)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,i=t.isDisabled,a=t.isSearchable,r=t.inputId,s=t.inputValue,c=t.tabIndex,f=t.form,p=t.menuIsOpen,y=t.required,u=this.getComponents(),g=u.Input,d=this.state,b=d.inputIsHidden,m=d.ariaSelection,w=this.commonProps,_=r||this.getElementId("input"),C=re(re(re({"aria-autocomplete":"list","aria-expanded":p,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":y,role:"combobox"},p&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(m==null?void 0:m.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?F.createElement(g,ae({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:_,innerRef:this.getInputRef,isDisabled:i,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:f,type:"text",value:s},C)):F.createElement(Ps,ae({id:_,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ot,onFocus:this.onInputFocus,disabled:i,tabIndex:c,inputMode:"none",form:f,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,i=this.getComponents(),a=i.MultiValue,r=i.MultiValueContainer,s=i.MultiValueLabel,c=i.MultiValueRemove,f=i.SingleValue,p=i.Placeholder,y=this.commonProps,u=this.props,g=u.controlShouldRenderValue,d=u.isDisabled,b=u.isMulti,m=u.inputValue,w=u.placeholder,_=this.state,C=_.selectValue,I=_.focusedValue,P=_.isFocused;if(!this.hasValue()||!g)return m?null:F.createElement(p,ae({},y,{key:"placeholder",isDisabled:d,isFocused:P,innerProps:{id:this.getElementId("placeholder")}}),w);if(b)return C.map(function(D,j){var U=D===I,q="".concat(t.getOptionLabel(D),"-").concat(t.getOptionValue(D));return F.createElement(a,ae({},y,{components:{Container:r,Label:s,Remove:c},isFocused:U,isDisabled:d,key:q,index:j,removeProps:{onClick:function(){return t.removeValue(D)},onTouchEnd:function(){return t.removeValue(D)},onMouseDown:function(L){L.preventDefault()}},data:D}),t.formatOptionLabel(D,"value"))});if(m)return null;var E=C[0];return F.createElement(f,ae({},y,{data:E,isDisabled:d}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents(),i=t.ClearIndicator,a=this.commonProps,r=this.props,s=r.isDisabled,c=r.isLoading,f=this.state.isFocused;if(!this.isClearable()||!i||s||!this.hasValue()||c)return null;var p={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return F.createElement(i,ae({},a,{innerProps:p,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents(),i=t.LoadingIndicator,a=this.commonProps,r=this.props,s=r.isDisabled,c=r.isLoading,f=this.state.isFocused;if(!i||!c)return null;var p={"aria-hidden":"true"};return F.createElement(i,ae({},a,{innerProps:p,isDisabled:s,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),i=t.DropdownIndicator,a=t.IndicatorSeparator;if(!i||!a)return null;var r=this.commonProps,s=this.props.isDisabled,c=this.state.isFocused;return F.createElement(a,ae({},r,{isDisabled:s,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents(),i=t.DropdownIndicator;if(!i)return null;var a=this.commonProps,r=this.props.isDisabled,s=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return F.createElement(i,ae({},a,{innerProps:c,isDisabled:r,isFocused:s}))}},{key:"renderMenu",value:function(){var t=this,i=this.getComponents(),a=i.Group,r=i.GroupHeading,s=i.Menu,c=i.MenuList,f=i.MenuPortal,p=i.LoadingMessage,y=i.NoOptionsMessage,u=i.Option,g=this.commonProps,d=this.state.focusedOption,b=this.props,m=b.captureMenuScroll,w=b.inputValue,_=b.isLoading,C=b.loadingMessage,I=b.minMenuHeight,P=b.maxMenuHeight,E=b.menuIsOpen,D=b.menuPlacement,j=b.menuPosition,U=b.menuPortalTarget,q=b.menuShouldBlockScroll,O=b.menuShouldScrollIntoView,L=b.noOptionsMessage,v=b.onMenuScrollToTop,B=b.onMenuScrollToBottom;if(!E)return null;var te=function(ee,X){var Z=ee.type,ce=ee.data,he=ee.isDisabled,se=ee.isSelected,le=ee.label,ge=ee.value,pe=d===ce,Ce=he?void 0:function(){return t.onOptionHover(ce)},ke=he?void 0:function(){return t.selectOption(ce)},h="".concat(t.getElementId("option"),"-").concat(X),$={id:h,onClick:ke,onMouseMove:Ce,onMouseOver:Ce,tabIndex:-1};return F.createElement(u,ae({},g,{innerProps:$,data:ce,isDisabled:he,isSelected:se,key:h,label:le,type:Z,value:ge,isFocused:pe,innerRef:pe?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(ee.data,"menu"))},T;if(this.hasOptions())T=this.getCategorizedOptions().map(function(z){if(z.type==="group"){var ee=z.data,X=z.options,Z=z.index,ce="".concat(t.getElementId("group"),"-").concat(Z),he="".concat(ce,"-heading");return F.createElement(a,ae({},g,{key:ce,data:ee,options:X,Heading:r,headingProps:{id:he,data:z.data},label:t.formatGroupLabel(z.data)}),z.options.map(function(se){return te(se,"".concat(Z,"-").concat(se.index))}))}else if(z.type==="option")return te(z,"".concat(z.index))});else if(_){var J=C({inputValue:w});if(J===null)return null;T=F.createElement(p,g,J)}else{var N=L({inputValue:w});if(N===null)return null;T=F.createElement(y,g,N)}var K={minMenuHeight:I,maxMenuHeight:P,menuPlacement:D,menuPosition:j,menuShouldScrollIntoView:O},A=F.createElement(oo,ae({},g,K),function(z){var ee=z.ref,X=z.placerProps,Z=X.placement,ce=X.maxHeight;return F.createElement(s,ae({},g,K,{innerRef:ee,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:_,placement:Z}),F.createElement(Rs,{captureEnabled:m,onTopArrive:v,onBottomArrive:B,lockEnabled:q},function(he){return F.createElement(c,ae({},g,{innerRef:function(le){t.getMenuListRef(le),he(le)},isLoading:_,maxHeight:ce,focusedOption:d}),T)}))});return U||j==="fixed"?F.createElement(f,ae({},g,{appendTo:U,controlElement:this.controlRef,menuPlacement:D,menuPosition:j}),A):A}},{key:"renderFormField",value:function(){var t=this,i=this.props,a=i.delimiter,r=i.isDisabled,s=i.isMulti,c=i.name,f=i.required,p=this.state.selectValue;if(f&&!this.hasValue()&&!r)return F.createElement(Ls,{name:c,onFocus:this.onValueInputFocus});if(!(!c||r))if(s)if(a){var y=p.map(function(d){return t.getOptionValue(d)}).join(a);return F.createElement("input",{name:c,type:"hidden",value:y})}else{var u=p.length>0?p.map(function(d,b){return F.createElement("input",{key:"i-".concat(b),name:c,type:"hidden",value:t.getOptionValue(d)})}):F.createElement("input",{name:c,type:"hidden",value:""});return F.createElement("div",null,u)}else{var g=p[0]?this.getOptionValue(p[0]):"";return F.createElement("input",{name:c,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,i=this.state,a=i.ariaSelection,r=i.focusedOption,s=i.focusedValue,c=i.isFocused,f=i.selectValue,p=this.getFocusableOptions();return F.createElement(_s,ae({},t,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:r,focusedValue:s,isFocused:c,selectValue:f,focusableOptions:p}))}},{key:"render",value:function(){var t=this.getComponents(),i=t.Control,a=t.IndicatorsContainer,r=t.SelectContainer,s=t.ValueContainer,c=this.props,f=c.className,p=c.id,y=c.isDisabled,u=c.menuIsOpen,g=this.state.isFocused,d=this.commonProps=this.getCommonProps();return F.createElement(r,ae({},d,{className:f,innerProps:{id:p,onKeyDown:this.onKeyDown},isDisabled:y,isFocused:g}),this.renderLiveRegion(),F.createElement(i,ae({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:y,isFocused:g,menuIsOpen:u}),F.createElement(s,ae({},d,{isDisabled:y}),this.renderPlaceholderOrValue(),this.renderInput()),F.createElement(a,ae({},d,{isDisabled:y}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(t,i){var a=i.prevProps,r=i.clearFocusValueOnUpdate,s=i.inputIsHiddenAfterUpdate,c=i.ariaSelection,f=i.isFocused,p=i.prevWasFocused,y=t.options,u=t.value,g=t.menuIsOpen,d=t.inputValue,b=t.isMulti,m=_n(u),w={};if(a&&(u!==a.value||y!==a.options||g!==a.menuIsOpen||d!==a.inputValue)){var _=g?Xs(t,m):[],C=r?qs(i,m):null,I=Js(i,_);w={selectValue:m,focusedOption:I,focusedValue:C,clearFocusValueOnUpdate:!1}}var P=s!=null&&t!==a?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},E=c,D=f&&p;return f&&!D&&(E={value:mt(b,m,m[0]||null),options:m,action:"initial-input-focus"},D=!p),(c==null?void 0:c.action)==="initial-input-focus"&&(E=null),re(re(re({},w),P),{},{prevProps:t,ariaSelection:E,prevWasFocused:D})}}]),n}(F.Component);Rr.defaultProps=Ks;var el=F.forwardRef(function(l,e){var n=ba(l);return F.createElement(Rr,ae({ref:e},n))}),tl=el,nl=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"];function Gt(){return Gt=Object.assign?Object.assign.bind():function(l){for(var e=1;e=0)&&(n[t]=l[t]);return n}var Ar=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=rl(e,nl);return Gt({},n)},il=function(e){var n=typeof e=="string";return n&&["sm","md","lg"].includes(e)},al=function(e){return il(e)?e:e==="xs"?"sm":e==="xl"?"lg":"md"},De=function(e){var n=Mt(),o=al(n.components.Input.defaultProps.size),t=e??o,i=Vi(typeof t=="string"?[t]:t,{fallback:"md"})||o;return i};function Ge(){return Ge=Object.assign?Object.assign.bind():function(l){for(var e=1;e=0)&&(n[t]=l[t]);return n}var dl=function(e){var n=e.className,o=e.cx,t=e.children,i=e.innerRef,a=e.innerProps,r=e.isDisabled,s=e.isFocused,c=e.menuIsOpen,f=e.selectProps,p=f.chakraStyles,y=f.size,u=f.variant,g=f.focusBorderColor,d=f.errorBorderColor,b=f.isInvalid,m=f.isReadOnly,w=De(y),_=$e("Input",{size:w,variant:u,focusBorderColor:g,errorBorderColor:d}),C=_.field,I=C.height,P=C.h,E=cl(C,ul),D=I||P,j=Pe({},E,{position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",padding:0,overflow:"hidden",height:"auto",minH:D},r?{pointerEvents:"none"}:{}),U=p!=null&&p.control?p.control(j,e):j;return oe.createElement(de,Pe({ref:i,className:o({control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":c},n),sx:U},a,{"data-focus":s?!0:void 0,"data-focus-visible":s?!0:void 0,"data-invalid":b?!0:void 0,"data-disabled":r?!0:void 0,"data-readonly":m?!0:void 0}),t)},hl=function(e){var n=e.className,o=e.cx,t=e.selectProps,i=t.chakraStyles,a=t.useBasicStyles,r=t.variant,s=Pe({opacity:1},a||r!=="outline"?{display:"none"}:{}),c=i!=null&&i.indicatorSeparator?i.indicatorSeparator(s,e):s;return oe.createElement(Jn,{className:o({"indicator-separator":!0},n),sx:c,orientation:"vertical"})},fl=function(e){return oe.createElement(Jt,Pe({role:"presentation",focusable:"false","aria-hidden":"true"},e),oe.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))},pl=function(e){var n=e.children,o=e.className,t=e.cx,i=e.innerProps,a=e.selectProps,r=a.chakraStyles,s=a.useBasicStyles,c=a.size,f=a.focusBorderColor,p=a.errorBorderColor,y=a.variant,u=De(c),g=$e("Input",{size:u,variant:y,focusBorderColor:f,errorBorderColor:p}),d={sm:"16px",md:"20px",lg:"24px"},b=d[u],m=Pe({},g.addon,{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",borderRadius:0,borderWidth:0,fontSize:b},s&&{background:"transparent",padding:0,width:6,marginRight:2,marginLeft:1,cursor:"inherit"}),w=r!=null&&r.dropdownIndicator?r.dropdownIndicator(m,e):m,_={height:"1em",width:"1em"},C=r!=null&&r.downChevron?r.downChevron(_,e):_;return oe.createElement(de,Pe({},i,{className:t({indicator:!0,"dropdown-indicator":!0},o),sx:w}),n||oe.createElement(fl,{sx:C}))},ml=function(e){return oe.createElement(Jt,Pe({focusable:"false","aria-hidden":!0},e),oe.createElement("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}))},vl=function(e){var n=e.children,o=e.className,t=e.cx,i=e.innerProps,a=e.selectProps,r=a.chakraStyles,s=a.size,c=De(s),f=Bn("CloseButton",{size:c}),p=Pe({},f,{marginX:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,cursor:"pointer"}),y=r!=null&&r.clearIndicator?r.clearIndicator(p,e):p,u={width:"1em",height:"1em"},g=r!=null&&r.crossIcon?r.crossIcon(u,e):u;return oe.createElement(de,Pe({role:"button",className:t({indicator:!0,"clear-indicator":!0},o),sx:y,"aria-label":"Clear selected options"},i),n||oe.createElement(ml,{sx:g}))},gl=function(e){var n=e.className,o=e.cx,t=e.innerProps,i=e.selectProps,a=i.chakraStyles,r=i.size,s=e.color,c=e.emptyColor,f=e.speed,p=e.thickness,y=e.spinnerSize,u=De(r),g={sm:"xs",md:"sm",lg:"md"},d=g[u],b={marginRight:3},m=a!=null&&a.loadingIndicator?a.loadingIndicator(b,e):b;return oe.createElement(qr,Pe({className:o({indicator:!0,"loading-indicator":!0},n),sx:m},t,{size:y||d,color:s,emptyColor:c,speed:f,thickness:p}))};const bl=dl;var yl=["innerRef","isDisabled","isHidden","inputClassName"];function rt(){return rt=Object.assign?Object.assign.bind():function(l){for(var e=1;e=0)&&(n[t]=l[t]);return n}var xl=function(e){var n=e.className,o=e.cx,t=e.value,i=e.selectProps,a=i.chakraStyles,r=i.isReadOnly,s=Ar(e),c=s.innerRef,f=s.isDisabled,p=s.isHidden,y=s.inputClassName,u=wl(s,yl),g={gridArea:"1 / 2",minW:"2px",border:0,margin:0,outline:0,padding:0},d={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content",color:"inherit",marginX:"0.125rem",paddingY:"0.125rem",visibility:f?"hidden":"visible",transform:t?"translateZ(0)":"",_after:rt({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre",padding:0},g)},b=a!=null&&a.inputContainer?a.inputContainer(d,e):d,m=rt({background:0,opacity:p?0:1,width:"100%"},g),w=a!=null&&a.input?a.input(m,e):m;return oe.createElement(de,{className:o({"input-container":!0},n),"data-value":t||"",sx:b},oe.createElement(Ue.input,rt({className:o({input:!0},y),ref:c,sx:w,disabled:f,readOnly:r?!0:void 0},u)))};const Sl=xl;var _l=["data"];function Cl(l,e){if(l==null)return{};var n={},o=Object.keys(l),t,i;for(i=0;i=0)&&(n[t]=l[t]);return n}function _e(){return _e=Object.assign?Object.assign.bind():function(l){for(var e=1;e=0)&&(n[t]=l[t]);return n}var ql=function(e){var n,o=e.components,t=o===void 0?{}:o;e.theme;var i=e.size,a=e.colorScheme,r=a===void 0?"gray":a,s=e.isDisabled,c=e.isInvalid,f=e.isReadOnly,p=e.required,y=e.isRequired,u=e.inputId,g=e.tagVariant,d=e.selectedOptionStyle,b=d===void 0?"color":d,m=e.selectedOptionColorScheme,w=e.selectedOptionColor,_=e.variant,C=e.focusBorderColor,I=e.errorBorderColor,P=e.chakraStyles,E=P===void 0?{}:P,D=e.onFocus,j=e.onBlur,U=e.menuIsOpen,q=Xl(e,Kl),O=Mt(),L=O.components.Input.defaultProps.variant,v=yi({id:u,isDisabled:s,isInvalid:c,isRequired:y,isReadOnly:f,onFocus:D,onBlur:j}),B=U??(v.readOnly?!1:void 0),te=b,T=["color","check"];T.includes(b)||(te="color");var J=m||w||"blue";typeof J!="string"&&(J="blue");var N=Pt({components:Pt({},Yl,t),colorScheme:r,size:i,tagVariant:g,selectedOptionStyle:te,selectedOptionColorScheme:J,variant:_??L,chakraStyles:E,focusBorderColor:C,errorBorderColor:I,onFocus:v.onFocus,onBlur:v.onBlur,isDisabled:v.disabled,isInvalid:!!v["aria-invalid"],inputId:v.id,isReadOnly:v.readOnly,required:p??v.required,menuIsOpen:B},q,{"aria-invalid":(n=q["aria-invalid"])!=null?n:v["aria-invalid"]});return N};const Jl=ql;function Xt(){return Xt=Object.assign?Object.assign.bind():function(l){for(var e=1;e({value:g,label:g})))??[],[r,s]=F.useState(a),c=async()=>{var g,d;await((g=We)==null?void 0:g.put({name:t,workflowIDs:[],updateTime:Date.now()})),await((d=We)==null?void 0:d.listAll().then(b=>o(b??[]))),i("")},f=async()=>{var d;const g=await((d=We)==null?void 0:d.listAll());o(g??[])};if(We==null)return alert("Error: TagsTable is not loaded"),null;const p=n.map(g=>({value:g.name,label:g.name})),y=37*5;return x.jsxs(wi,{isLazy:!0,onOpen:f,children:[x.jsx(xi,{children:x.jsx(xe,{"aria-label":"Delete confirm",size:"sm",variant:"ghost",icon:x.jsx(rr,{color:"#718096"})})}),x.jsxs(Si,{children:[x.jsx(_i,{}),x.jsx(Ci,{}),x.jsx(tr,{children:x.jsx("b",{children:l.name})}),x.jsxs(ki,{children:[x.jsx(eu,{isMulti:!0,name:"tags",options:p,menuIsOpen:!0,value:r,onChange:async g=>{var d;s(g),await((d=be)==null?void 0:d.updateMetaInfo(l.id,{tags:g.map(b=>b.value)})),await(e==null?void 0:e())},chakraStyles:{dropdownIndicator:g=>({...g,p:0,w:"30px"}),menuList:g=>({...g,shadow:"none",pt:0})},placeholder:"Select tags",closeMenuOnSelect:!1,maxMenuHeight:y}),x.jsxs(we,{gap:4,mt:Math.min(y,Math.max(n.length,3)*37),children:[x.jsx(it,{placeholder:"New tag name",size:"sm",mt:6,mb:6,variant:"flushed",value:t,onChange:g=>{i(g.target.value.trim())}}),x.jsx(Se,{iconSpacing:1,leftIcon:x.jsx(tn,{size:16}),colorScheme:"teal",variant:"solid",size:"xs",px:5,isDisabled:t.length===0,onClick:c,children:"New Tag"})]})]})]})]})}function nu({menuPosition:l,workflowID:e,onClose:n}){const{onDuplicateWorkflow:o}=F.useContext(nn);return x.jsx(x.Fragment,{children:x.jsx(de,{position:"absolute",top:l.y,left:l.x,children:x.jsx(Xe,{isOpen:!0,onClose:n,children:x.jsx(at,{children:x.jsx(Re,{onClick:()=>o&&o(e),children:"Duplicate"})})})})})}const Vn=F.memo(function({workflow:e}){const{colorMode:n}=qt(),[o,t]=F.useState({x:0,y:0}),[i,a]=F.useState(!1),{setDraggingFile:r,isMultiSelecting:s,onMultiSelectFlow:c,onDeleteFlow:f,multiSelectedFlowsID:p}=F.useContext(Be),y=p&&p.length>0&&p.includes(e.id),{curFlowID:u,loadWorkflowID:g}=F.useContext(nn),d=u===e.id,b=P=>{P.preventDefault(),t({x:P.clientX,y:P.clientY}),a(!0)},[m,w]=F.useState(!1),_=()=>{a(!1)},C=n==="light"?"gray.200":"#4A5568",I=x.jsx(de,{flexShrink:1,flexGrow:1,backgroundColor:d?"teal.200":i?C:void 0,color:d&&!s?"#333":void 0,draggable:!s,onDragStart:()=>r==null?void 0:r(e),borderRadius:6,px:1,py:1,onClick:()=>{!s&&g(e.id)},_hover:{bg:C},children:x.jsxs(we,{children:[e.coverMediaPath!=null&&x.jsx(Ri,{mediaLocalPath:e.coverMediaPath,size:60,hideBrokenImage:!0,isPreview:!0}),x.jsxs(Le,{textAlign:"left",gap:0,children:[x.jsx(Oe,{fontWeight:"500",children:e.name??"untitled"}),x.jsxs(Oe,{color:"GrayText",ml:2,fontSize:"sm",children:["Updated: ",Kn(e.updateTime)]})]})]})});return x.jsxs(we,{w:"100%",mb:1,justify:"space-between",onContextMenu:b,onMouseEnter:()=>{w(!0)},onMouseLeave:()=>{w(!1)},children:[s?x.jsx(ot,{isChecked:y,spacing:4,onChange:P=>{c&&c(e.id,P.target.checked)},children:I}):x.jsxs(x.Fragment,{children:[I,x.jsxs(nt,{width:"90px",justifyContent:"flex-end",children:[m&&x.jsx(tu,{workflow:e}),x.jsx(Fe,{label:"Open in new tab",children:x.jsx(xe,{"aria-label":"Open in new tab",size:"sm",variant:"ghost",onClick:()=>Oi(e.id),icon:x.jsx(Ii,{color:"#718096",size:23})})}),x.jsx(Xn,{promptMessage:"Are you sure you want to delete this workflow?",onDelete:()=>{f&&f(e.id)}})]})]}),i&&x.jsx(nu,{menuPosition:o,onClose:_,workflowID:e.id})]})});function Lr({items:l}){var y;const[e,n]=F.useState(!1),o=l.filter(He),t=l.filter(u=>!He(u)),i=(y=t[0])==null?void 0:y.parentFolderID,[a,r]=F.useState(!1),{onRefreshFilesList:s,draggingFile:c,refreshFolderStamp:f}=F.useContext(Be),p=async u=>{var g,d;if(u.preventDefault(),u.stopPropagation(),!c)return r(!1);if(He(c)){if(c.id===i)return r(!1);await((g=Ve)==null?void 0:g.update(c.id,{parentFolderID:i}))}else await((d=be)==null?void 0:d.updateFolder(c.id,{parentFolderID:i}));await(s==null?void 0:s()),r(!1)};return F.useEffect(()=>{var u;(u=ye)==null||u.getSetting("foldersOnTop").then(g=>{n(g??!1)})},[f]),x.jsxs(x.Fragment,{children:[e&&o.map(u=>x.jsx(bn,{folder:u},u.id)),x.jsx(de,{border:a?"2px dashed #718096":"2px dashed transparent",onDragOver:u=>{u.preventDefault(),u.stopPropagation(),r(!0)},onDragLeave:u=>{u.preventDefault(),u.stopPropagation(),r(!1)},onDrop:p,className:"droppable",children:e?t.map(u=>x.jsx(Vn,{workflow:u},u.id)):l.map(u=>He(u)?x.jsx(bn,{folder:u},u.id):x.jsx(Vn,{workflow:u},u.id))})]})}function du({onClose:l,onClickNewFlow:e}){const[n,o]=F.useState([]),t=F.useRef([]),i=F.useRef([]),{loadWorkflowID:a,curFlowID:r}=F.useContext(nn),[s,c]=F.useState(),[f,p]=F.useState(!1),[y,u]=F.useState([]),[g,d]=F.useState(0),[b,m]=F.useState(""),w=la(b,400),_=F.useRef(null),[C,I]=F.useState(null),P=F.useRef(window.localStorage.getItem($t)??fn.RECENTLY_MODIFIED),E=async()=>{var J,N;const T=await((J=be)==null?void 0:J.listFolderContent())??[];t.current=T,await((N=be)==null?void 0:N.listAll().then(K=>{i.current=K})),j(),d(Date.now())},D=!!s||!!w,j=()=>{if(D){const T=i.current.filter(J=>{var A;let N=!0,K=!0;return s&&(N=!!((A=J.tags)!=null&&A.includes(s))),w&&(K=!!J.name.toLocaleLowerCase().includes(w.toLocaleLowerCase())),N&&K});o(Ft(T,P.current))}else o(Ft(t.current,P.current))},U=T=>{o(Ft(n,T)),P.current=T,window.localStorage.setItem($t,T),!D&&d(Date.now())};F.useEffect(()=>{j()},[w,s]);const q=F.useCallback(async T=>{var J,N,K;await((J=be)==null?void 0:J.deleteFlow(T)),((K=(N=be)==null?void 0:N.curWorkflow)==null?void 0:K.id)===T&&await(a==null?void 0:a(null)),await E()},[s,w]);F.useEffect(()=>{E();const T=async J=>{var N;if(_.current){const K=await((N=be)==null?void 0:N.get(_.current));K&&K.json&&ji(K.json,[J.canvasX,J.canvasY])}};return ct.canvasEl.addEventListener("drop",T),ct.canvasEl.addEventListener("click",l),()=>{ct.canvasEl.removeEventListener("drop",T),ct.canvasEl.removeEventListener("click",l)}},[]);const O=F.useCallback((T,J)=>{u(N=>{const K=[...N];return J?K.push(T):K.splice(K.indexOf(T),1),K})},[]),L=(T,J)=>{var N;switch(T){case"batchDelete":r&&((N=be)==null||N.get(r).then(K=>{K||a==null||a(null)})),E(),p(!1),u([]);return;case"selectAll":u(J?i.current.map(K=>K.id):[]);return}},v=T=>{I(T),He(T)||(_.current=T.id)},B=T=>{m(T)},te=450;return x.jsx(Be.Provider,{value:{onRefreshFilesList:E,draggingFile:C??void 0,setDraggingFile:v,isMultiSelecting:f,onMultiSelectFlow:O,multiSelectedFlowsID:y,onDeleteFlow:q,refreshFolderStamp:g,setRefreshFolderStamp:d},children:x.jsx(de,{style:{width:te},children:x.jsxs(Ei,{width:te,height:"100vh",pl:4,pr:5,pt:4,gap:4,position:"absolute",top:0,left:0,shadow:"xl",zIndex:Pi,children:[x.jsxs(nt,{alignItems:"center",justifyContent:"space-between",children:[x.jsxs(we,{gap:4,children:[x.jsx(we,{gap:2,children:x.jsx(Oe,{fontSize:19,fontWeight:600,children:"☕️Workspace"})}),x.jsx(or,{}),x.jsx(Fe,{label:"Open workspace save directory",children:x.jsx(xe,{"aria-label":"Open workspace save directory",size:"sm",icon:x.jsx(qn,{}),variant:"outline",colorScheme:"teal",onClick:()=>Mi()})}),x.jsx(Fe,{label:"New workflow",children:x.jsx(xe,{"aria-label":"New workflow",size:"sm",icon:x.jsx(tn,{}),variant:"outline",colorScheme:"teal",onClick:e})})]}),x.jsx(we,{alignItems:"center",children:x.jsx(oa,{})})]}),x.jsxs(nt,{direction:"column",h:"calc(100% - 64px)",children:[x.jsx(da,{selectedTag:s,setSelectedTag:c}),x.jsxs(we,{mb:2,mt:2,p:0,justifyContent:"space-between",children:[x.jsxs(we,{children:[i.current.length>0?x.jsx(sa,{multipleState:f,changeMultipleState:T=>{p(T),!T&&u([])},selectedKeys:y,isSelectedAll:y.length===i.current.length,batchOperationCallback:L}):x.jsx(de,{}),!f&&x.jsx(Fe,{hasArrow:!0,label:"New folder",placement:"bottom-start",children:x.jsx(xe,{size:"sm",variant:"outline",icon:x.jsx(nr,{size:21}),onClick:async()=>{var T;await((T=Ve)==null?void 0:T.create({name:"New Folder"})),E()},"aria-label":"new folder button"})})]}),x.jsxs(Xe,{closeOnSelect:!0,children:[x.jsx(jt,{as:Se,variant:"ghost",size:"xs",pr:0,rightIcon:x.jsx(en,{size:"16"}),children:x.jsxs(we,{children:[x.jsx(Oe,{children:"Sort by:"}),x.jsx(Oe,{display:"inline-block",children:P.current})]})}),x.jsx(at,{children:x.jsx(er,{value:P.current,type:"radio",onChange:T=>U(T),children:Object.values(fn).map((T,J)=>x.jsx(rn,{value:T,children:T},J))})})]})]}),x.jsx(ca,{searchValue:b,onUpdateSearchValue:B}),x.jsx(nt,{overflowY:"auto",overflowX:"hidden",direction:"column",children:x.jsx(Lr,{items:n})})]})]})})})}export{du as default};
diff --git a/dist/workspace_web/ShareDialog-17qMdssr.js b/dist/workspace_web/ShareDialog-17qMdssr.js
new file mode 100644
index 0000000..d4ad791
--- /dev/null
+++ b/dist/workspace_web/ShareDialog-17qMdssr.js
@@ -0,0 +1 @@
+import{r as n,m as he,v as ne,b as fe,f as re,j as e,g as J,h as pe,k as y,p as E,n as X,i as ge,o as ve,G as we,ab as me,B as K,M as be,L as ke,N as xe,O as ye,R as Ce}from"./input.js";import{av as je,B as Se,G as De,a8 as Ie,H as Y,k as Q,n as Pe,aw as Re,a6 as ie,p as _e,m as ae,j as le,ax as Fe,l as Ee,F as Me,w as G,ay as U,az as Ne,aA as We,aB as Le,T as Te,aC as Ve,af as Oe,ae as He}from"./App-GluzE5n7.js";import{app as Be}from"/scripts/app.js";import{t as Ae}from"./index-pz0vT7Or.js";import"/scripts/api.js";function Ge(t){return t&&ne(t)&&ne(t.target)}function Ke(t={}){const{onChange:p,value:c,defaultValue:s,name:d,isDisabled:h,isFocusable:u,isNative:g,...f}=t,[b,C]=n.useState(s||""),m=typeof c<"u",j=m?c:b,k=n.useRef(null),S=n.useCallback(()=>{const a=k.current;if(!a)return;let i="input:not(:disabled):checked";const D=a.querySelector(i);if(D){D.focus();return}i="input:not(:disabled)";const o=a.querySelector(i);o==null||o.focus()},[]),v=`radio-${n.useId()}`,N=d||v,R=n.useCallback(a=>{const i=Ge(a)?a.target.value:a;m||C(i),p==null||p(String(i))},[p,m]),H=n.useCallback((a={},i=null)=>({...a,ref:he(i,k),role:"radiogroup"}),[]),_=n.useCallback((a={},i=null)=>({...a,ref:i,name:N,[g?"checked":"isChecked"]:j!=null?a.value===j:void 0,onChange(o){R(o)},"data-radiogroup":!0}),[g,N,R,j]);return{getRootProps:H,getRadioProps:_,name:N,ref:k,focus:S,setValue:C,value:j,onChange:R,isDisabled:h,isFocusable:u,htmlProps:f}}var[$e,ce]=fe({name:"RadioGroupContext",strict:!1}),de=re((t,p)=>{const{colorScheme:c,size:s,variant:d,children:h,className:u,isDisabled:g,isFocusable:f,...b}=t,{value:C,onChange:m,getRootProps:j,name:k,htmlProps:S}=Ke(b),M=n.useMemo(()=>({name:k,size:s,onChange:m,colorScheme:c,value:C,variant:d,isDisabled:g,isFocusable:f}),[k,s,m,c,C,d,g,f]);return e.jsx($e,{value:M,children:e.jsx(J.div,{...j(S,p),className:pe("chakra-radio-group",u),children:h})})});de.displayName="RadioGroup";var qe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function ze(t={}){const{defaultChecked:p,isChecked:c,isFocusable:s,isDisabled:d,isReadOnly:h,isRequired:u,onChange:g,isInvalid:f,name:b,value:C,id:m,"data-radiogroup":j,"aria-describedby":k,...S}=t,M=`radio-${n.useId()}`,v=je(),R=!!ce()||!!j;let _=!!v&&!R?v.id:M;_=m??_;const a=d??(v==null?void 0:v.isDisabled),i=h??(v==null?void 0:v.isReadOnly),D=u??(v==null?void 0:v.isRequired),o=f??(v==null?void 0:v.isInvalid),[l,P]=n.useState(!1),[w,I]=n.useState(!1),[x,W]=n.useState(!1),[L,T]=n.useState(!1),[$,q]=n.useState(!!p),B=typeof c<"u",F=B?c:$;n.useEffect(()=>Ae(P),[]);const V=n.useCallback(r=>{if(i||a){r.preventDefault();return}B||q(r.target.checked),g==null||g(r)},[B,a,i,g]),A=n.useCallback(r=>{r.key===" "&&T(!0)},[T]),z=n.useCallback(r=>{r.key===" "&&T(!1)},[T]),ee=n.useCallback((r={},O=null)=>({...r,ref:O,"data-active":y(L),"data-hover":y(x),"data-disabled":y(a),"data-invalid":y(o),"data-checked":y(F),"data-focus":y(w),"data-focus-visible":y(w&&l),"data-readonly":y(i),"aria-hidden":!0,onMouseDown:E(r.onMouseDown,()=>T(!0)),onMouseUp:E(r.onMouseUp,()=>T(!1)),onMouseEnter:E(r.onMouseEnter,()=>W(!0)),onMouseLeave:E(r.onMouseLeave,()=>W(!1))}),[L,x,a,o,F,w,i,l]),{onFocus:oe,onBlur:se}=v??{},ue=n.useCallback((r={},O=null)=>{const te=a&&!s;return{...r,id:_,ref:O,type:"radio",name:b,value:C,onChange:E(r.onChange,V),onBlur:E(se,r.onBlur,()=>I(!1)),onFocus:E(oe,r.onFocus,()=>I(!0)),onKeyDown:E(r.onKeyDown,A),onKeyUp:E(r.onKeyUp,z),checked:F,disabled:te,readOnly:i,required:D,"aria-invalid":X(o),"aria-disabled":X(te),"aria-required":X(D),"data-readonly":y(i),"aria-describedby":k,style:qe}},[a,s,_,b,C,V,se,oe,A,z,F,i,D,o,k]);return{state:{isInvalid:o,isFocused:w,isChecked:F,isActive:L,isHovered:x,isDisabled:a,isReadOnly:i,isRequired:D},getCheckboxProps:ee,getRadioProps:ee,getInputProps:ue,getLabelProps:(r={},O=null)=>({...r,ref:O,onMouseDown:E(r.onMouseDown,Ue),"data-disabled":y(a),"data-checked":y(F),"data-invalid":y(o)}),getRootProps:(r,O=null)=>({...r,ref:O,"data-disabled":y(a),"data-checked":y(F),"data-invalid":y(o)}),htmlProps:S}}function Ue(t){t.preventDefault(),t.stopPropagation()}function Je(t,p){const c={},s={};for(const[d,h]of Object.entries(t))p.includes(d)?c[d]=h:s[d]=h;return[c,s]}var Z=re((t,p)=>{var c;const s=ce(),{onChange:d,value:h}=t,u=ge("Radio",{...s,...t}),g=ve(t),{spacing:f="0.5rem",children:b,isDisabled:C=s==null?void 0:s.isDisabled,isFocusable:m=s==null?void 0:s.isFocusable,inputProps:j,...k}=g;let S=t.isChecked;(s==null?void 0:s.value)!=null&&h!=null&&(S=s.value===h);let M=d;s!=null&&s.onChange&&h!=null&&(M=we(s.onChange,d));const v=(c=t==null?void 0:t.name)!=null?c:s==null?void 0:s.name,{getInputProps:N,getCheckboxProps:R,getLabelProps:H,getRootProps:_,htmlProps:a}=ze({...k,isChecked:S,isFocusable:m,isDisabled:C,onChange:M,name:v}),[i,D]=Je(a,me),o=R(D),l=N(j,p),P=H(),w=Object.assign({},i,_()),I={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...u.container},x={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...u.control},W={userSelect:"none",marginStart:f,...u.label};return e.jsxs(J.label,{className:"chakra-radio",...w,__css:I,children:[e.jsx("input",{className:"chakra-radio__input",...l}),e.jsx(J.span,{className:"chakra-radio__control",...o,__css:x}),b&&e.jsx(J.span,{className:"chakra-radio__label",...P,__css:W,children:b})]})});Z.displayName="Radio";function Ye({options:t,value:p,onChange:c}){const[s,d]=n.useState(!1),h=n.useRef(null),u=t.find(f=>f.value===p);n.useEffect(()=>{const f=b=>{h.current&&!h.current.contains(b.target)&&d(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[h]);const g=()=>d(!s);return e.jsxs(Se,{position:"relative",children:[e.jsx(K,{onClick:g,rightIcon:e.jsx(De,{}),leftIcon:u==null?void 0:u.icon,children:u==null?void 0:u.label}),s&&e.jsx(Ie,{gap:4,ref:h,mt:"2",shadow:"md",borderWidth:"1px",p:"2",position:"absolute",zIndex:100,children:t.map(f=>e.jsx(K,{onClick:()=>{d(!1),c(f.value)},leftIcon:f.icon,justifyContent:"flex-start",variant:"ghost",width:"full",children:f.label},f.label))})]})}function Qe({version:t,cloudHost:p,cloudWorkflowID:c}){const s=t,d=e.jsxs(Y,{spacing:4,alignItems:"center",children:[e.jsx(Q,{children:s.name}),e.jsx(Q,{color:"GrayText",children:Pe(s.createTime,!1)}),s.cloudID&&c&&e.jsx("a",{href:p+"/workflow/"+c+"/"+s.cloudID,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none"},children:e.jsx(K,{size:"xs",colorScheme:"teal",variant:"outline",leftIcon:e.jsx(Re,{}),rightIcon:e.jsx(ie,{size:18}),children:"Shared"})})]});return t.cloudID?e.jsx(e.Fragment,{children:d}):e.jsx(Z,{value:s.id,mb:5,children:d},s.id)}function ro({onClose:t}){var i,D;const[p,c]=n.useState("version "+Xe()),[s,d]=n.useState([]),[h,u]=n.useState(!1),[g,f]=n.useState(""),[b,C]=n.useState("PRIVATE"),[m,j]=n.useState("new_version"),k=n.useRef(""),[S,M]=n.useState(),v=_e(),N=async o=>{var W,L;const l=o.data;if(o.origin!==k.current||l.type!=="share_workflow_success")return;const P=l.localWorkflowID,w=l.localVersionID,I=l.version.id,x=l.version.workflowID;x&&P&&await((W=G)==null?void 0:W.updateMetaInfo(P,{cloudID:x,cloudOrigin:o.origin})),w&&I&&await((L=U)==null?void 0:L.update(w,{cloudID:I,cloudOrigin:o.origin})),R(),window.open(k.current+"/workflow/"+x+"/"+I,"_blank"),u(!1)};n.useEffect(()=>(R(),window.addEventListener("message",N),()=>{window.removeEventListener("message",N)}),[]);const R=async()=>{var P,w,I;const o=await((P=ae)==null?void 0:P.getSetting("cloudHost"));o&&(f(o),k.current=o);const l=((w=G)==null?void 0:w.curWorkflow)??void 0;M(l),l!=null&&l.cloudID&&l.cloudOrigin&&Le(l).then(x=>{C(x)}),(I=U)==null||I.listByWorkflowID(l.id).then(x=>{d(x)})},H=o=>{navigator.clipboard.writeText(o).then(()=>{v({title:"Copied to clipboard",status:"success",duration:2e3,isClosable:!0})}).catch(l=>{console.error("Failed to copy text: ",l)})},_=async()=>{var q,B,F;u(!0);const o=Ne(32),l=await((q=ae)==null?void 0:q.getSetting("cloudHost"));let P,w;try{if(P=We(),m==="new_version"?w=await((B=U)==null?void 0:B.add({workflowID:S.id,name:p,createTime:Date.now(),json:JSON.stringify(Be.graph.serialize())})):w=await((F=U)==null?void 0:F.get(m)),!w){alert(`Failed to find version: ${m}, please try again.`),u(!1);return}}catch(V){console.error(V),u(!1),alert("Failed to share workflow, please try again.");return}const I=window.location.protocol,x=window.location.host,W=`${I}//${x}`,L=l+`/share_workflow_confirm/${o}?redirectUrl=${W}`,T=window.open(L,"Share Workflow","width=800,height=800"),$=V=>{var A;if(V.origin===l&&V.data==="child_ready"){const z=(A=G)==null?void 0:A.curWorkflow;T.postMessage({workflow:z,version:w,nodeDefs:P,privacy:b},l),window.removeEventListener("message",$)}};window.addEventListener("message",$)},a=(D=(i=G)==null?void 0:i.curWorkflow)==null?void 0:D.cloudID;return e.jsxs(be,{isOpen:!0,onClose:t,size:"lg",children:[e.jsx(ke,{}),e.jsxs(xe,{width:["98%","90%","50%"],maxWidth:"600px",children:[e.jsxs(ye,{children:['Share "',S==null?void 0:S.name,'"']}),e.jsxs(Ce,{pb:10,children:[e.jsxs(le,{gap:5,children:[a==null?e.jsx(Ye,{options:Fe,value:b,onChange:o=>{C(o)}}):e.jsx(Te,{variant:"outline",borderRadius:"full",width:"fit-content",children:e.jsx(Ve,{privacy:b,showEmoji:!0})}),a&&e.jsxs(Y,{spacing:2,color:"teal.400",children:[e.jsxs(Oe,{href:g+"/workflow/"+a,isExternal:!0,children:[g+"/workflow/"+a," ",e.jsx(ie,{size:20,style:{display:"inline-block",verticalAlign:"middle"}})]}),e.jsx(K,{width:"180px",size:"sm",leftIcon:e.jsx(He,{}),onClick:()=>{var o,l;H(g+"/workflow/"+((l=(o=G)==null?void 0:o.curWorkflow)==null?void 0:l.cloudID))},children:"Copy link"})]}),e.jsx(Q,{children:"Choose a version to share:"}),e.jsx(de,{gap:4,onChange:o=>{j(o)},value:m,children:e.jsxs(le,{children:[e.jsxs(Y,{mb:5,alignItems:"center",children:[e.jsx(Z,{value:"new_version"},"new_version"),e.jsx(Ee,{value:p,width:"60%",onFocus:()=>{j("new_version")},onChange:o=>{c(o.target.value)}}),e.jsx(Me,{color:"green",children:e.jsx(Q,{children:"New version"})})]}),s.slice(0,4).map(o=>e.jsx(Qe,{version:o,cloudHost:g,cloudWorkflowID:a??null},o.id))]})})]}),e.jsx(Y,{justifyContent:"flex-end",mt:16,children:e.jsx(K,{colorScheme:"teal",onClick:_,isDisabled:h,children:h?"Sharing":"Share"})})]})]})]})}function Xe(){const t=new Date,p=t.getFullYear(),c=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${p}-${c}-${s}`}export{ro as default};
diff --git a/dist/workspace_web/ShareDialog-yZ9MQqaN.js b/dist/workspace_web/ShareDialog-yZ9MQqaN.js
deleted file mode 100644
index 13981d6..0000000
--- a/dist/workspace_web/ShareDialog-yZ9MQqaN.js
+++ /dev/null
@@ -1 +0,0 @@
-import{r as n,m as he,v as ne,b as fe,f as re,j as e,g as J,h as pe,k as y,p as E,n as X,i as ge,o as ve,G as me,ab as we,B as K,M as be,L as ke,N as xe,O as ye,R as Ce}from"./input.js";import{au as je,B as Se,E as De,a7 as Ie,H as Y,T as Q,m as Pe,av as Re,a5 as ie,o as _e,l as ae,j as le,aw as Fe,k as Ee,F as Me,w as G,ax as U,ay as Ne,az as We,aA as Le,aB as Te,ae as Ve,ad as Oe}from"./App-Fl7cObcs.js";import{app as He}from"/scripts/app.js";import{t as Be}from"./index-pz0vT7Or.js";import{T as Ae}from"./chunk-RPO2WXNL-dt-e86vT.js";import"/scripts/api.js";function Ge(t){return t&&ne(t)&&ne(t.target)}function Ke(t={}){const{onChange:p,value:c,defaultValue:s,name:d,isDisabled:h,isFocusable:u,isNative:g,...f}=t,[b,C]=n.useState(s||""),w=typeof c<"u",j=w?c:b,k=n.useRef(null),S=n.useCallback(()=>{const a=k.current;if(!a)return;let i="input:not(:disabled):checked";const D=a.querySelector(i);if(D){D.focus();return}i="input:not(:disabled)";const o=a.querySelector(i);o==null||o.focus()},[]),v=`radio-${n.useId()}`,N=d||v,R=n.useCallback(a=>{const i=Ge(a)?a.target.value:a;w||C(i),p==null||p(String(i))},[p,w]),H=n.useCallback((a={},i=null)=>({...a,ref:he(i,k),role:"radiogroup"}),[]),_=n.useCallback((a={},i=null)=>({...a,ref:i,name:N,[g?"checked":"isChecked"]:j!=null?a.value===j:void 0,onChange(o){R(o)},"data-radiogroup":!0}),[g,N,R,j]);return{getRootProps:H,getRadioProps:_,name:N,ref:k,focus:S,setValue:C,value:j,onChange:R,isDisabled:h,isFocusable:u,htmlProps:f}}var[$e,ce]=fe({name:"RadioGroupContext",strict:!1}),de=re((t,p)=>{const{colorScheme:c,size:s,variant:d,children:h,className:u,isDisabled:g,isFocusable:f,...b}=t,{value:C,onChange:w,getRootProps:j,name:k,htmlProps:S}=Ke(b),M=n.useMemo(()=>({name:k,size:s,onChange:w,colorScheme:c,value:C,variant:d,isDisabled:g,isFocusable:f}),[k,s,w,c,C,d,g,f]);return e.jsx($e,{value:M,children:e.jsx(J.div,{...j(S,p),className:pe("chakra-radio-group",u),children:h})})});de.displayName="RadioGroup";var qe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function ze(t={}){const{defaultChecked:p,isChecked:c,isFocusable:s,isDisabled:d,isReadOnly:h,isRequired:u,onChange:g,isInvalid:f,name:b,value:C,id:w,"data-radiogroup":j,"aria-describedby":k,...S}=t,M=`radio-${n.useId()}`,v=je(),R=!!ce()||!!j;let _=!!v&&!R?v.id:M;_=w??_;const a=d??(v==null?void 0:v.isDisabled),i=h??(v==null?void 0:v.isReadOnly),D=u??(v==null?void 0:v.isRequired),o=f??(v==null?void 0:v.isInvalid),[l,P]=n.useState(!1),[m,I]=n.useState(!1),[x,W]=n.useState(!1),[L,T]=n.useState(!1),[$,q]=n.useState(!!p),B=typeof c<"u",F=B?c:$;n.useEffect(()=>Be(P),[]);const V=n.useCallback(r=>{if(i||a){r.preventDefault();return}B||q(r.target.checked),g==null||g(r)},[B,a,i,g]),A=n.useCallback(r=>{r.key===" "&&T(!0)},[T]),z=n.useCallback(r=>{r.key===" "&&T(!1)},[T]),ee=n.useCallback((r={},O=null)=>({...r,ref:O,"data-active":y(L),"data-hover":y(x),"data-disabled":y(a),"data-invalid":y(o),"data-checked":y(F),"data-focus":y(m),"data-focus-visible":y(m&&l),"data-readonly":y(i),"aria-hidden":!0,onMouseDown:E(r.onMouseDown,()=>T(!0)),onMouseUp:E(r.onMouseUp,()=>T(!1)),onMouseEnter:E(r.onMouseEnter,()=>W(!0)),onMouseLeave:E(r.onMouseLeave,()=>W(!1))}),[L,x,a,o,F,m,i,l]),{onFocus:oe,onBlur:se}=v??{},ue=n.useCallback((r={},O=null)=>{const te=a&&!s;return{...r,id:_,ref:O,type:"radio",name:b,value:C,onChange:E(r.onChange,V),onBlur:E(se,r.onBlur,()=>I(!1)),onFocus:E(oe,r.onFocus,()=>I(!0)),onKeyDown:E(r.onKeyDown,A),onKeyUp:E(r.onKeyUp,z),checked:F,disabled:te,readOnly:i,required:D,"aria-invalid":X(o),"aria-disabled":X(te),"aria-required":X(D),"data-readonly":y(i),"aria-describedby":k,style:qe}},[a,s,_,b,C,V,se,oe,A,z,F,i,D,o,k]);return{state:{isInvalid:o,isFocused:m,isChecked:F,isActive:L,isHovered:x,isDisabled:a,isReadOnly:i,isRequired:D},getCheckboxProps:ee,getRadioProps:ee,getInputProps:ue,getLabelProps:(r={},O=null)=>({...r,ref:O,onMouseDown:E(r.onMouseDown,Ue),"data-disabled":y(a),"data-checked":y(F),"data-invalid":y(o)}),getRootProps:(r,O=null)=>({...r,ref:O,"data-disabled":y(a),"data-checked":y(F),"data-invalid":y(o)}),htmlProps:S}}function Ue(t){t.preventDefault(),t.stopPropagation()}function Je(t,p){const c={},s={};for(const[d,h]of Object.entries(t))p.includes(d)?c[d]=h:s[d]=h;return[c,s]}var Z=re((t,p)=>{var c;const s=ce(),{onChange:d,value:h}=t,u=ge("Radio",{...s,...t}),g=ve(t),{spacing:f="0.5rem",children:b,isDisabled:C=s==null?void 0:s.isDisabled,isFocusable:w=s==null?void 0:s.isFocusable,inputProps:j,...k}=g;let S=t.isChecked;(s==null?void 0:s.value)!=null&&h!=null&&(S=s.value===h);let M=d;s!=null&&s.onChange&&h!=null&&(M=me(s.onChange,d));const v=(c=t==null?void 0:t.name)!=null?c:s==null?void 0:s.name,{getInputProps:N,getCheckboxProps:R,getLabelProps:H,getRootProps:_,htmlProps:a}=ze({...k,isChecked:S,isFocusable:w,isDisabled:C,onChange:M,name:v}),[i,D]=Je(a,we),o=R(D),l=N(j,p),P=H(),m=Object.assign({},i,_()),I={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...u.container},x={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...u.control},W={userSelect:"none",marginStart:f,...u.label};return e.jsxs(J.label,{className:"chakra-radio",...m,__css:I,children:[e.jsx("input",{className:"chakra-radio__input",...l}),e.jsx(J.span,{className:"chakra-radio__control",...o,__css:x}),b&&e.jsx(J.span,{className:"chakra-radio__label",...P,__css:W,children:b})]})});Z.displayName="Radio";function Ye({options:t,value:p,onChange:c}){const[s,d]=n.useState(!1),h=n.useRef(null),u=t.find(f=>f.value===p);n.useEffect(()=>{const f=b=>{h.current&&!h.current.contains(b.target)&&d(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[h]);const g=()=>d(!s);return e.jsxs(Se,{position:"relative",children:[e.jsx(K,{onClick:g,rightIcon:e.jsx(De,{}),leftIcon:u==null?void 0:u.icon,children:u==null?void 0:u.label}),s&&e.jsx(Ie,{gap:4,ref:h,mt:"2",shadow:"md",borderWidth:"1px",p:"2",position:"absolute",zIndex:100,children:t.map(f=>e.jsx(K,{onClick:()=>{d(!1),c(f.value)},leftIcon:f.icon,justifyContent:"flex-start",variant:"ghost",width:"full",children:f.label},f.label))})]})}function Qe({version:t,cloudHost:p,cloudWorkflowID:c}){const s=t,d=e.jsxs(Y,{spacing:4,alignItems:"center",children:[e.jsx(Q,{children:s.name}),e.jsx(Q,{color:"GrayText",children:Pe(s.createTime,!1)}),s.cloudID&&c&&e.jsx("a",{href:p+"/workflow/"+c+"/"+s.cloudID,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none"},children:e.jsx(K,{size:"xs",colorScheme:"teal",variant:"outline",leftIcon:e.jsx(Re,{}),rightIcon:e.jsx(ie,{size:18}),children:"Shared"})})]});return t.cloudID?e.jsx(e.Fragment,{children:d}):e.jsx(Z,{value:s.id,mb:5,children:d},s.id)}function io({onClose:t}){var i,D;const[p,c]=n.useState("version "+Xe()),[s,d]=n.useState([]),[h,u]=n.useState(!1),[g,f]=n.useState(""),[b,C]=n.useState("PRIVATE"),[w,j]=n.useState("new_version"),k=n.useRef(""),[S,M]=n.useState(),v=_e(),N=async o=>{var W,L;const l=o.data;if(o.origin!==k.current||l.type!=="share_workflow_success")return;const P=l.localWorkflowID,m=l.localVersionID,I=l.version.id,x=l.version.workflowID;x&&P&&await((W=G)==null?void 0:W.updateMetaInfo(P,{cloudID:x,cloudOrigin:o.origin})),m&&I&&await((L=U)==null?void 0:L.update(m,{cloudID:I,cloudOrigin:o.origin})),R(),window.open(k.current+"/workflow/"+x+"/"+I,"_blank"),u(!1)};n.useEffect(()=>(R(),window.addEventListener("message",N),()=>{window.removeEventListener("message",N)}),[]);const R=async()=>{var P,m,I;const o=await((P=ae)==null?void 0:P.getSetting("cloudHost"));o&&(f(o),k.current=o);const l=((m=G)==null?void 0:m.curWorkflow)??void 0;M(l),l!=null&&l.cloudID&&l.cloudOrigin&&Le(l).then(x=>{C(x)}),(I=U)==null||I.listByWorkflowID(l.id).then(x=>{d(x)})},H=o=>{navigator.clipboard.writeText(o).then(()=>{v({title:"Copied to clipboard",status:"success",duration:2e3,isClosable:!0})}).catch(l=>{console.error("Failed to copy text: ",l)})},_=async()=>{var q,B,F;u(!0);const o=Ne(32),l=await((q=ae)==null?void 0:q.getSetting("cloudHost"));let P,m;try{if(P=We(),w==="new_version"?m=await((B=U)==null?void 0:B.add({workflowID:S.id,name:p,createTime:Date.now(),json:JSON.stringify(He.graph.serialize())})):m=await((F=U)==null?void 0:F.get(w)),!m){alert(`Failed to find version: ${w}, please try again.`),u(!1);return}}catch(V){console.error(V),u(!1),alert("Failed to share workflow, please try again.");return}const I=window.location.protocol,x=window.location.host,W=`${I}//${x}`,L=l+`/share_workflow_confirm/${o}?redirectUrl=${W}`,T=window.open(L,"Share Workflow","width=800,height=800"),$=V=>{var A;if(V.origin===l&&V.data==="child_ready"){const z=(A=G)==null?void 0:A.curWorkflow;T.postMessage({workflow:z,version:m,nodeDefs:P,privacy:b},l),window.removeEventListener("message",$)}};window.addEventListener("message",$)},a=(D=(i=G)==null?void 0:i.curWorkflow)==null?void 0:D.cloudID;return e.jsxs(be,{isOpen:!0,onClose:t,size:"lg",children:[e.jsx(ke,{}),e.jsxs(xe,{width:["98%","90%","50%"],maxWidth:"600px",children:[e.jsxs(ye,{children:['Share "',S==null?void 0:S.name,'"']}),e.jsxs(Ce,{pb:10,children:[e.jsxs(le,{gap:5,children:[a==null?e.jsx(Ye,{options:Fe,value:b,onChange:o=>{C(o)}}):e.jsx(Ae,{variant:"outline",borderRadius:"full",width:"fit-content",children:e.jsx(Te,{privacy:b,showEmoji:!0})}),a&&e.jsxs(Y,{spacing:2,color:"teal.400",children:[e.jsxs(Ve,{href:g+"/workflow/"+a,isExternal:!0,children:[g+"/workflow/"+a," ",e.jsx(ie,{size:20,style:{display:"inline-block",verticalAlign:"middle"}})]}),e.jsx(K,{width:"180px",size:"sm",leftIcon:e.jsx(Oe,{}),onClick:()=>{var o,l;H(g+"/workflow/"+((l=(o=G)==null?void 0:o.curWorkflow)==null?void 0:l.cloudID))},children:"Copy link"})]}),e.jsx(Q,{children:"Choose a version to share:"}),e.jsx(de,{gap:4,onChange:o=>{j(o)},value:w,children:e.jsxs(le,{children:[e.jsxs(Y,{mb:5,alignItems:"center",children:[e.jsx(Z,{value:"new_version"},"new_version"),e.jsx(Ee,{value:p,width:"60%",onFocus:()=>{j("new_version")},onChange:o=>{c(o.target.value)}}),e.jsx(Me,{color:"green",children:e.jsx(Q,{children:"New version"})})]}),s.slice(0,4).map(o=>e.jsx(Qe,{version:o,cloudHost:g,cloudWorkflowID:a??null},o.id))]})})]}),e.jsx(Y,{justifyContent:"flex-end",mt:16,children:e.jsx(K,{colorScheme:"teal",onClick:_,isDisabled:h,children:h?"Sharing":"Share"})})]})]})]})}function Xe(){const t=new Date,p=t.getFullYear(),c=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${p}-${c}-${s}`}export{io as default};
diff --git a/dist/workspace_web/chunk-JARCRF6W-aHchqwnR.js b/dist/workspace_web/chunk-JARCRF6W-IwBcFM3i.js
similarity index 99%
rename from dist/workspace_web/chunk-JARCRF6W-aHchqwnR.js
rename to dist/workspace_web/chunk-JARCRF6W-IwBcFM3i.js
index 643983f..48f5f6d 100644
--- a/dist/workspace_web/chunk-JARCRF6W-aHchqwnR.js
+++ b/dist/workspace_web/chunk-JARCRF6W-IwBcFM3i.js
@@ -1 +1 @@
-import{f as q,j as f,r as l,x as $,g as P,b as ue,d as W,w as fe,k as i,p as y,m as oe,a3 as J,i as me,o as he,G as ge,h as be}from"./input.js";import{at as ke}from"./App-Fl7cObcs.js";import{t as ve}from"./index-pz0vT7Or.js";var X=q(function(n,e){const{htmlWidth:a,htmlHeight:c,alt:s,...d}=n;return f.jsx("img",{width:a,height:c,ref:e,alt:s,...d})});X.displayName="NativeImage";function pe(o){const{loading:n,src:e,srcSet:a,onLoad:c,onError:s,crossOrigin:d,sizes:p,ignoreFallback:C}=o,[m,g]=l.useState("pending");l.useEffect(()=>{g(e?"loading":"pending")},[e]);const u=l.useRef(),x=l.useCallback(()=>{if(!e)return;k();const r=new Image;r.src=e,d&&(r.crossOrigin=d),a&&(r.srcset=a),p&&(r.sizes=p),n&&(r.loading=n),r.onload=b=>{k(),g("loaded"),c==null||c(b)},r.onerror=b=>{k(),g("failed"),s==null||s(b)},u.current=r},[e,d,a,p,c,s,n]),k=()=>{u.current&&(u.current.onload=null,u.current.onerror=null,u.current=null)};return $(()=>{if(!C)return m==="loading"&&x(),()=>{k()}},[m,x,C]),C?"loaded":m}var Ce=(o,n)=>o!=="loaded"&&n==="beforeLoadOrError"||o==="failed"&&n==="onError";function ye(o,n=[]){const e=Object.assign({},o);for(const a of n)a in e&&delete e[a];return e}var xe=q(function(n,e){const{fallbackSrc:a,fallback:c,src:s,srcSet:d,align:p,fit:C,loading:m,ignoreFallback:g,crossOrigin:u,fallbackStrategy:x="beforeLoadOrError",referrerPolicy:k,...r}=n,b=a!==void 0||c!==void 0,R=m!=null||g||!b,_=pe({...n,crossOrigin:u,ignoreFallback:R}),A=Ce(_,x),j={ref:e,objectFit:C,objectPosition:p,...R?r:ye(r,["onError","onLoad"])};return A?c||f.jsx(P.img,{as:X,className:"chakra-image__placeholder",src:a,...j}):f.jsx(P.img,{as:X,src:s,srcSet:d,crossOrigin:u,loading:m,referrerPolicy:k,className:"chakra-image",...j})});xe.displayName="Image";var[$e,Ie]=ue({name:"CheckboxGroupContext",strict:!1});function Se(o){const[n,e]=l.useState(o),[a,c]=l.useState(!1);return o!==n&&(c(!0),e(o)),a}function we(o){return f.jsx(P.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...o,children:f.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function Pe(o){return f.jsx(P.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...o,children:f.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function je(o){const{isIndeterminate:n,isChecked:e,...a}=o,c=n?Pe:we;return e||n?f.jsx(P.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:f.jsx(c,{...a})}):null}var Fe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Re(o,n=[]){const e=Object.assign({},o);for(const a of n)a in e&&delete e[a];return e}function Ae(o={}){const n=ke(o),{isDisabled:e,isReadOnly:a,isRequired:c,isInvalid:s,id:d,onBlur:p,onFocus:C,"aria-describedby":m}=n,{defaultChecked:g,isChecked:u,isFocusable:x,onChange:k,isIndeterminate:r,name:b,value:R,tabIndex:_=void 0,"aria-label":A,"aria-labelledby":j,"aria-invalid":w,...z}=o,L=Re(z,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),N=W(k),O=W(p),B=W(C),[D,T]=l.useState(!1),[F,K]=l.useState(!1),[G,Q]=l.useState(!1),[M,E]=l.useState(!1);l.useEffect(()=>ve(T),[]);const I=l.useRef(null),[Y,ne]=l.useState(!0),[se,U]=l.useState(!!g),V=u!==void 0,h=V?u:se,Z=l.useCallback(t=>{if(a||e){t.preventDefault();return}V||U(h?t.target.checked:r?!0:t.target.checked),N==null||N(t)},[a,e,h,V,r,N]);$(()=>{I.current&&(I.current.indeterminate=!!r)},[r]),fe(()=>{e&&K(!1)},[e,K]),$(()=>{const t=I.current;if(!(t!=null&&t.form))return;const v=()=>{U(!!g)};return t.form.addEventListener("reset",v),()=>{var S;return(S=t.form)==null?void 0:S.removeEventListener("reset",v)}},[]);const ee=e&&!x,ae=l.useCallback(t=>{t.key===" "&&E(!0)},[E]),te=l.useCallback(t=>{t.key===" "&&E(!1)},[E]);$(()=>{if(!I.current)return;I.current.checked!==h&&U(I.current.checked)},[I.current]);const re=l.useCallback((t={},v=null)=>{const S=H=>{F&&H.preventDefault(),E(!0)};return{...t,ref:v,"data-active":i(M),"data-hover":i(G),"data-checked":i(h),"data-focus":i(F),"data-focus-visible":i(F&&D),"data-indeterminate":i(r),"data-disabled":i(e),"data-invalid":i(s),"data-readonly":i(a),"aria-hidden":!0,onMouseDown:y(t.onMouseDown,S),onMouseUp:y(t.onMouseUp,()=>E(!1)),onMouseEnter:y(t.onMouseEnter,()=>Q(!0)),onMouseLeave:y(t.onMouseLeave,()=>Q(!1))}},[M,h,e,F,D,G,r,s,a]),ie=l.useCallback((t={},v=null)=>({...t,ref:v,"data-active":i(M),"data-hover":i(G),"data-checked":i(h),"data-focus":i(F),"data-focus-visible":i(F&&D),"data-indeterminate":i(r),"data-disabled":i(e),"data-invalid":i(s),"data-readonly":i(a)}),[M,h,e,F,D,G,r,s,a]),le=l.useCallback((t={},v=null)=>({...L,...t,ref:oe(v,S=>{S&&ne(S.tagName==="LABEL")}),onClick:y(t.onClick,()=>{var S;Y||((S=I.current)==null||S.click(),requestAnimationFrame(()=>{var H;(H=I.current)==null||H.focus({preventScroll:!0})}))}),"data-disabled":i(e),"data-checked":i(h),"data-invalid":i(s)}),[L,e,h,s,Y]),ce=l.useCallback((t={},v=null)=>({...t,ref:oe(I,v),type:"checkbox",name:b,value:R,id:d,tabIndex:_,onChange:y(t.onChange,Z),onBlur:y(t.onBlur,O,()=>K(!1)),onFocus:y(t.onFocus,B,()=>K(!0)),onKeyDown:y(t.onKeyDown,ae),onKeyUp:y(t.onKeyUp,te),required:c,checked:h,disabled:ee,readOnly:a,"aria-label":A,"aria-labelledby":j,"aria-invalid":w?!!w:s,"aria-describedby":m,"aria-disabled":e,style:Fe}),[b,R,d,Z,O,B,ae,te,c,h,ee,a,A,j,w,s,m,e,_]),de=l.useCallback((t={},v=null)=>({...t,ref:v,onMouseDown:y(t.onMouseDown,_e),"data-disabled":i(e),"data-checked":i(h),"data-invalid":i(s)}),[h,e,s]);return{state:{isInvalid:s,isFocused:F,isChecked:h,isActive:M,isHovered:G,isIndeterminate:r,isDisabled:e,isReadOnly:a,isRequired:c},getRootProps:le,getCheckboxProps:re,getIndicatorProps:ie,getInputProps:ce,getLabelProps:de,htmlProps:L}}function _e(o){o.preventDefault(),o.stopPropagation()}var De={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},Ee={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},Le=J({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),Ne=J({from:{opacity:0},to:{opacity:1}}),Be=J({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Ge=q(function(n,e){const a=Ie(),c={...a,...n},s=me("Checkbox",c),d=he(n),{spacing:p="0.5rem",className:C,children:m,iconColor:g,iconSize:u,icon:x=f.jsx(je,{}),isChecked:k,isDisabled:r=a==null?void 0:a.isDisabled,onChange:b,inputProps:R,..._}=d;let A=k;a!=null&&a.value&&d.value&&(A=a.value.includes(d.value));let j=b;a!=null&&a.onChange&&d.value&&(j=ge(a.onChange,b));const{state:w,getInputProps:z,getCheckboxProps:L,getLabelProps:N,getRootProps:O}=Ae({..._,isDisabled:r,isChecked:A,onChange:j}),B=Se(w.isChecked),D=l.useMemo(()=>({animation:B?w.isIndeterminate?`${Ne} 20ms linear, ${Be} 200ms linear`:`${Le} 200ms linear`:void 0,fontSize:u,color:g,...s.icon}),[g,u,B,w.isIndeterminate,s.icon]),T=l.cloneElement(x,{__css:D,isIndeterminate:w.isIndeterminate,isChecked:w.isChecked});return f.jsxs(P.label,{__css:{...Ee,...s.container},className:be("chakra-checkbox",C),...O(),children:[f.jsx("input",{className:"chakra-checkbox__input",...z(R,e)}),f.jsx(P.span,{__css:{...De,...s.control},className:"chakra-checkbox__control",...L(),children:T}),m&&f.jsx(P.span,{className:"chakra-checkbox__label",...N(),__css:{marginStart:p,...s.label},children:m})]})});Ge.displayName="Checkbox";var Me=q(function(n,e){const{templateAreas:a,gap:c,rowGap:s,columnGap:d,column:p,row:C,autoFlow:m,autoRows:g,templateRows:u,autoColumns:x,templateColumns:k,...r}=n,b={display:"grid",gridTemplateAreas:a,gridGap:c,gridRowGap:s,gridColumnGap:d,gridAutoColumns:x,gridColumn:p,gridRow:C,gridAutoFlow:m,gridAutoRows:g,gridTemplateRows:u,gridTemplateColumns:k};return f.jsx(P.div,{ref:e,__css:b,...r})});Me.displayName="Grid";export{Ge as C,Me as G,xe as I};
+import{f as q,j as f,r as l,x as $,g as P,b as ue,d as W,w as fe,k as i,p as y,m as oe,a3 as J,i as me,o as he,G as ge,h as be}from"./input.js";import{au as ke}from"./App-GluzE5n7.js";import{t as ve}from"./index-pz0vT7Or.js";var X=q(function(n,e){const{htmlWidth:a,htmlHeight:c,alt:s,...d}=n;return f.jsx("img",{width:a,height:c,ref:e,alt:s,...d})});X.displayName="NativeImage";function pe(o){const{loading:n,src:e,srcSet:a,onLoad:c,onError:s,crossOrigin:d,sizes:p,ignoreFallback:C}=o,[m,g]=l.useState("pending");l.useEffect(()=>{g(e?"loading":"pending")},[e]);const u=l.useRef(),x=l.useCallback(()=>{if(!e)return;k();const r=new Image;r.src=e,d&&(r.crossOrigin=d),a&&(r.srcset=a),p&&(r.sizes=p),n&&(r.loading=n),r.onload=b=>{k(),g("loaded"),c==null||c(b)},r.onerror=b=>{k(),g("failed"),s==null||s(b)},u.current=r},[e,d,a,p,c,s,n]),k=()=>{u.current&&(u.current.onload=null,u.current.onerror=null,u.current=null)};return $(()=>{if(!C)return m==="loading"&&x(),()=>{k()}},[m,x,C]),C?"loaded":m}var Ce=(o,n)=>o!=="loaded"&&n==="beforeLoadOrError"||o==="failed"&&n==="onError";function ye(o,n=[]){const e=Object.assign({},o);for(const a of n)a in e&&delete e[a];return e}var xe=q(function(n,e){const{fallbackSrc:a,fallback:c,src:s,srcSet:d,align:p,fit:C,loading:m,ignoreFallback:g,crossOrigin:u,fallbackStrategy:x="beforeLoadOrError",referrerPolicy:k,...r}=n,b=a!==void 0||c!==void 0,R=m!=null||g||!b,_=pe({...n,crossOrigin:u,ignoreFallback:R}),A=Ce(_,x),j={ref:e,objectFit:C,objectPosition:p,...R?r:ye(r,["onError","onLoad"])};return A?c||f.jsx(P.img,{as:X,className:"chakra-image__placeholder",src:a,...j}):f.jsx(P.img,{as:X,src:s,srcSet:d,crossOrigin:u,loading:m,referrerPolicy:k,className:"chakra-image",...j})});xe.displayName="Image";var[$e,Ie]=ue({name:"CheckboxGroupContext",strict:!1});function Se(o){const[n,e]=l.useState(o),[a,c]=l.useState(!1);return o!==n&&(c(!0),e(o)),a}function we(o){return f.jsx(P.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...o,children:f.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function Pe(o){return f.jsx(P.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...o,children:f.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function je(o){const{isIndeterminate:n,isChecked:e,...a}=o,c=n?Pe:we;return e||n?f.jsx(P.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:f.jsx(c,{...a})}):null}var Fe={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Re(o,n=[]){const e=Object.assign({},o);for(const a of n)a in e&&delete e[a];return e}function Ae(o={}){const n=ke(o),{isDisabled:e,isReadOnly:a,isRequired:c,isInvalid:s,id:d,onBlur:p,onFocus:C,"aria-describedby":m}=n,{defaultChecked:g,isChecked:u,isFocusable:x,onChange:k,isIndeterminate:r,name:b,value:R,tabIndex:_=void 0,"aria-label":A,"aria-labelledby":j,"aria-invalid":w,...z}=o,L=Re(z,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),N=W(k),O=W(p),B=W(C),[D,T]=l.useState(!1),[F,K]=l.useState(!1),[G,Q]=l.useState(!1),[M,E]=l.useState(!1);l.useEffect(()=>ve(T),[]);const I=l.useRef(null),[Y,ne]=l.useState(!0),[se,U]=l.useState(!!g),V=u!==void 0,h=V?u:se,Z=l.useCallback(t=>{if(a||e){t.preventDefault();return}V||U(h?t.target.checked:r?!0:t.target.checked),N==null||N(t)},[a,e,h,V,r,N]);$(()=>{I.current&&(I.current.indeterminate=!!r)},[r]),fe(()=>{e&&K(!1)},[e,K]),$(()=>{const t=I.current;if(!(t!=null&&t.form))return;const v=()=>{U(!!g)};return t.form.addEventListener("reset",v),()=>{var S;return(S=t.form)==null?void 0:S.removeEventListener("reset",v)}},[]);const ee=e&&!x,ae=l.useCallback(t=>{t.key===" "&&E(!0)},[E]),te=l.useCallback(t=>{t.key===" "&&E(!1)},[E]);$(()=>{if(!I.current)return;I.current.checked!==h&&U(I.current.checked)},[I.current]);const re=l.useCallback((t={},v=null)=>{const S=H=>{F&&H.preventDefault(),E(!0)};return{...t,ref:v,"data-active":i(M),"data-hover":i(G),"data-checked":i(h),"data-focus":i(F),"data-focus-visible":i(F&&D),"data-indeterminate":i(r),"data-disabled":i(e),"data-invalid":i(s),"data-readonly":i(a),"aria-hidden":!0,onMouseDown:y(t.onMouseDown,S),onMouseUp:y(t.onMouseUp,()=>E(!1)),onMouseEnter:y(t.onMouseEnter,()=>Q(!0)),onMouseLeave:y(t.onMouseLeave,()=>Q(!1))}},[M,h,e,F,D,G,r,s,a]),ie=l.useCallback((t={},v=null)=>({...t,ref:v,"data-active":i(M),"data-hover":i(G),"data-checked":i(h),"data-focus":i(F),"data-focus-visible":i(F&&D),"data-indeterminate":i(r),"data-disabled":i(e),"data-invalid":i(s),"data-readonly":i(a)}),[M,h,e,F,D,G,r,s,a]),le=l.useCallback((t={},v=null)=>({...L,...t,ref:oe(v,S=>{S&&ne(S.tagName==="LABEL")}),onClick:y(t.onClick,()=>{var S;Y||((S=I.current)==null||S.click(),requestAnimationFrame(()=>{var H;(H=I.current)==null||H.focus({preventScroll:!0})}))}),"data-disabled":i(e),"data-checked":i(h),"data-invalid":i(s)}),[L,e,h,s,Y]),ce=l.useCallback((t={},v=null)=>({...t,ref:oe(I,v),type:"checkbox",name:b,value:R,id:d,tabIndex:_,onChange:y(t.onChange,Z),onBlur:y(t.onBlur,O,()=>K(!1)),onFocus:y(t.onFocus,B,()=>K(!0)),onKeyDown:y(t.onKeyDown,ae),onKeyUp:y(t.onKeyUp,te),required:c,checked:h,disabled:ee,readOnly:a,"aria-label":A,"aria-labelledby":j,"aria-invalid":w?!!w:s,"aria-describedby":m,"aria-disabled":e,style:Fe}),[b,R,d,Z,O,B,ae,te,c,h,ee,a,A,j,w,s,m,e,_]),de=l.useCallback((t={},v=null)=>({...t,ref:v,onMouseDown:y(t.onMouseDown,_e),"data-disabled":i(e),"data-checked":i(h),"data-invalid":i(s)}),[h,e,s]);return{state:{isInvalid:s,isFocused:F,isChecked:h,isActive:M,isHovered:G,isIndeterminate:r,isDisabled:e,isReadOnly:a,isRequired:c},getRootProps:le,getCheckboxProps:re,getIndicatorProps:ie,getInputProps:ce,getLabelProps:de,htmlProps:L}}function _e(o){o.preventDefault(),o.stopPropagation()}var De={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},Ee={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},Le=J({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),Ne=J({from:{opacity:0},to:{opacity:1}}),Be=J({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Ge=q(function(n,e){const a=Ie(),c={...a,...n},s=me("Checkbox",c),d=he(n),{spacing:p="0.5rem",className:C,children:m,iconColor:g,iconSize:u,icon:x=f.jsx(je,{}),isChecked:k,isDisabled:r=a==null?void 0:a.isDisabled,onChange:b,inputProps:R,..._}=d;let A=k;a!=null&&a.value&&d.value&&(A=a.value.includes(d.value));let j=b;a!=null&&a.onChange&&d.value&&(j=ge(a.onChange,b));const{state:w,getInputProps:z,getCheckboxProps:L,getLabelProps:N,getRootProps:O}=Ae({..._,isDisabled:r,isChecked:A,onChange:j}),B=Se(w.isChecked),D=l.useMemo(()=>({animation:B?w.isIndeterminate?`${Ne} 20ms linear, ${Be} 200ms linear`:`${Le} 200ms linear`:void 0,fontSize:u,color:g,...s.icon}),[g,u,B,w.isIndeterminate,s.icon]),T=l.cloneElement(x,{__css:D,isIndeterminate:w.isIndeterminate,isChecked:w.isChecked});return f.jsxs(P.label,{__css:{...Ee,...s.container},className:be("chakra-checkbox",C),...O(),children:[f.jsx("input",{className:"chakra-checkbox__input",...z(R,e)}),f.jsx(P.span,{__css:{...De,...s.control},className:"chakra-checkbox__control",...L(),children:T}),m&&f.jsx(P.span,{className:"chakra-checkbox__label",...N(),__css:{marginStart:p,...s.label},children:m})]})});Ge.displayName="Checkbox";var Me=q(function(n,e){const{templateAreas:a,gap:c,rowGap:s,columnGap:d,column:p,row:C,autoFlow:m,autoRows:g,templateRows:u,autoColumns:x,templateColumns:k,...r}=n,b={display:"grid",gridTemplateAreas:a,gridGap:c,gridRowGap:s,gridColumnGap:d,gridAutoColumns:x,gridColumn:p,gridRow:C,gridAutoFlow:m,gridAutoRows:g,gridTemplateRows:u,gridTemplateColumns:k};return f.jsx(P.div,{ref:e,__css:b,...r})});Me.displayName="Grid";export{Ge as C,Me as G,xe as I};
diff --git a/dist/workspace_web/chunk-NTCQBYKE-EEXlKSMU.js b/dist/workspace_web/chunk-NTCQBYKE-ZsMy4OBB.js
similarity index 65%
rename from dist/workspace_web/chunk-NTCQBYKE-EEXlKSMU.js
rename to dist/workspace_web/chunk-NTCQBYKE-ZsMy4OBB.js
index f97e0ff..ad19976 100644
--- a/dist/workspace_web/chunk-NTCQBYKE-EEXlKSMU.js
+++ b/dist/workspace_web/chunk-NTCQBYKE-ZsMy4OBB.js
@@ -1 +1 @@
-import{j as t}from"./App-Fl7cObcs.js";import{f as o,j as s}from"./input.js";var e=o((a,r)=>s.jsx(t,{align:"center",...a,direction:"column",ref:r}));e.displayName="VStack";export{e as V};
+import{j as t}from"./App-GluzE5n7.js";import{f as o,j as s}from"./input.js";var e=o((a,r)=>s.jsx(t,{align:"center",...a,direction:"column",ref:r}));e.displayName="VStack";export{e as V};
diff --git a/dist/workspace_web/chunk-RPO2WXNL-dt-e86vT.js b/dist/workspace_web/chunk-RPO2WXNL-dt-e86vT.js
deleted file mode 100644
index fc91c18..0000000
--- a/dist/workspace_web/chunk-RPO2WXNL-dt-e86vT.js
+++ /dev/null
@@ -1 +0,0 @@
-import{b as y,f as n,i as m,o as p,j as s,g as r,I as i}from"./input.js";var[u,c]=y({name:"TagStylesContext",errorMessage:`useTagStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),T=n((e,a)=>{const t=m("Tag",e),l=p(e),o={display:"inline-flex",verticalAlign:"top",alignItems:"center",maxWidth:"100%",...t.container};return s.jsx(u,{value:t,children:s.jsx(r.span,{ref:a,...l,__css:o})})});T.displayName="Tag";var x=n((e,a)=>{const t=c();return s.jsx(r.span,{ref:a,noOfLines:1,...e,__css:t.label})});x.displayName="TagLabel";var f=n((e,a)=>s.jsx(i,{ref:a,verticalAlign:"top",marginEnd:"0.5rem",...e}));f.displayName="TagLeftIcon";var v=n((e,a)=>s.jsx(i,{ref:a,verticalAlign:"top",marginStart:"0.5rem",...e}));v.displayName="TagRightIcon";var g=e=>s.jsx(i,{verticalAlign:"inherit",viewBox:"0 0 512 512",...e,children:s.jsx("path",{fill:"currentColor",d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})});g.displayName="TagCloseIcon";var h=n((e,a)=>{const{isDisabled:t,children:l,...o}=e,d={display:"flex",alignItems:"center",justifyContent:"center",outline:"0",...c().closeButton};return s.jsx(r.button,{ref:a,"aria-label":"close",...o,type:"button",disabled:t,__css:d,children:l||s.jsx(g,{})})});h.displayName="TagCloseButton";export{T};
diff --git a/dist/workspace_web/input.js b/dist/workspace_web/input.js
index 1f702b8..b8c30c0 100644
--- a/dist/workspace_web/input.js
+++ b/dist/workspace_web/input.js
@@ -679,10 +679,10 @@ Error generating stack: `+i.message+`
}
${fB}
- `}),Lw=document.createElement("div");document.body.append(Lw);const pB=Ar.lazy(()=>Jk(()=>import("./App-Fl7cObcs.js").then(e=>e.aD),__vite__mapDeps([0,1])).then(({default:e})=>({default:e}))),mB={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e7,sticky:11e6,banner:12e6,overlay:13e6,modal:14e6,popover:15e6,skipLink:16e6,toast:17e6,tooltip:18e6},vB=Mz({zIndices:mB});bd.createRoot(Lw).render(E.jsx(Ar.StrictMode,{children:E.jsxs(HI,{resetCSS:!1,disableGlobalStyle:!0,theme:vB,children:[E.jsx(hB,{scope:".workspace_manager"}),E.jsx(NP,{initialColorMode:"dark"}),E.jsx(dB,{children:E.jsx(S.Suspense,{children:E.jsx(pB,{})})})]})}));const Yf=document.body,gB={attributes:!0,attributeFilter:["class"]},yB=function(e,t){const r=document.documentElement;r.style.colorScheme==="dark"&&r.style.removeProperty("color-scheme");for(const n of e)if(n.type==="attributes"&&n.attributeName==="class")for(const o of Yf.classList)o.includes("chakra")&&Yf.classList.remove(o)},bB=new MutationObserver(yB);bB.observe(Yf,gB);export{rL as $,IB as A,Ix as B,FB as C,zP as D,lr as E,ii as F,CB as G,Ip as H,Xa as I,PB as J,Ya as K,Mw as L,ww as M,$w as N,Rw as O,Na as P,Fw as Q,zw as R,Aw as S,Pb as T,LB as U,Ar as V,$B as W,is as X,Du as Y,vL as Z,Jk as _,MB as a,mL as a0,Wf as a1,Ra as a2,wP as a3,SB as a4,Hn as a5,Uh as a6,xP as a7,zp as a8,xB as a9,wB as aa,_B as ab,lB as ac,uB as ad,mn as b,RB as c,d3 as d,EB as e,pt as f,_e as g,Be as h,eS as i,E as j,Rv as k,Nu as l,Bf as m,kB as n,Ou as o,$i as p,Xf as q,S as r,hw as s,TB as t,VP as u,Kt as v,Cg as w,ka as x,mO as y,DB as z};
+ `}),Lw=document.createElement("div");document.body.append(Lw);const pB=Ar.lazy(()=>Jk(()=>import("./App-GluzE5n7.js").then(e=>e.aE),__vite__mapDeps([0,1])).then(({default:e})=>({default:e}))),mB={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e7,sticky:11e6,banner:12e6,overlay:13e6,modal:14e6,popover:15e6,skipLink:16e6,toast:17e6,tooltip:18e6},vB=Mz({zIndices:mB});bd.createRoot(Lw).render(E.jsx(Ar.StrictMode,{children:E.jsxs(HI,{resetCSS:!1,disableGlobalStyle:!0,theme:vB,children:[E.jsx(hB,{scope:".workspace_manager"}),E.jsx(NP,{initialColorMode:"dark"}),E.jsx(dB,{children:E.jsx(S.Suspense,{children:E.jsx(pB,{})})})]})}));const Yf=document.body,gB={attributes:!0,attributeFilter:["class"]},yB=function(e,t){const r=document.documentElement;r.style.colorScheme==="dark"&&r.style.removeProperty("color-scheme");for(const n of e)if(n.type==="attributes"&&n.attributeName==="class")for(const o of Yf.classList)o.includes("chakra")&&Yf.classList.remove(o)},bB=new MutationObserver(yB);bB.observe(Yf,gB);export{rL as $,IB as A,Ix as B,FB as C,zP as D,lr as E,ii as F,CB as G,Ip as H,Xa as I,PB as J,Ya as K,Mw as L,ww as M,$w as N,Rw as O,Na as P,Fw as Q,zw as R,Aw as S,Pb as T,LB as U,Ar as V,$B as W,is as X,Du as Y,vL as Z,Jk as _,MB as a,mL as a0,Wf as a1,Ra as a2,wP as a3,SB as a4,Hn as a5,Uh as a6,xP as a7,zp as a8,xB as a9,wB as aa,_B as ab,lB as ac,uB as ad,mn as b,RB as c,d3 as d,EB as e,pt as f,_e as g,Be as h,eS as i,E as j,Rv as k,Nu as l,Bf as m,kB as n,Ou as o,$i as p,Xf as q,S as r,hw as s,TB as t,VP as u,Kt as v,Cg as w,ka as x,mO as y,DB as z};
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
- __vite__mapDeps.viteFileDeps = ["workspace_web/App-Fl7cObcs.js","workspace_web/assets/App-JXePnJiV.css"]
+ __vite__mapDeps.viteFileDeps = ["workspace_web/App-GluzE5n7.js","workspace_web/assets/App-JXePnJiV.css"]
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
\ No newline at end of file
diff --git a/ui/src/apis/TwowaySyncApi.ts b/ui/src/apis/TwowaySyncApi.ts
index 31a6c14..8824eaa 100644
--- a/ui/src/apis/TwowaySyncApi.ts
+++ b/ui/src/apis/TwowaySyncApi.ts
@@ -247,7 +247,6 @@ export namespace TwowaySyncAPI {
const absPath = sanitizeAbsPath(
`${myWorkflowsDir}/${parentFolderID ?? ""}/${name}.json`,
);
- console.warn("get abs path 🔥 workfoow", absPath);
try {
const response = await fetch("/workspace/get_workflow_file", {
method: "POST",
diff --git a/ui/src/components/DropdownTitle.tsx b/ui/src/components/DropdownTitle.tsx
index ffdb2e9..39a4c5a 100644
--- a/ui/src/components/DropdownTitle.tsx
+++ b/ui/src/components/DropdownTitle.tsx
@@ -24,6 +24,8 @@ import {
Input,
Tooltip,
DarkMode,
+ Tag,
+ HStack,
} from "@chakra-ui/react";
import {
IconArrowBackUpDouble,
@@ -127,8 +129,8 @@ export default function DropdownTitle() {
height={"29px"}
aria-label="menu"
size={"sm"}
- colorScheme="gray"
- backgroundColor={"gray.700"}
+ // backgroundColor={"gray.700"}
+ backgroundColor={"teal.600"}
>
File
@@ -187,8 +189,11 @@ export default function DropdownTitle() {
onClick={() => setIsShareOpen(true)}
icon={}
iconSpacing={1}
+ alignItems={"center"}
>
- Share
+
+ Share
🧪🧪beta
+