P&&--f!=0);return H<=t.lookahead?H:t.lookahead}function ct(t){var F,B,y,f,E,H,G,P,K,X,$=t.w_size;do{if(f=t.window_size-t.lookahead-t.strstart,t.strstart>=$+($-W)){for(h.arraySet(t.window,t.window,$,$,0),t.match_start-=$,t.strstart-=$,t.block_start-=$,F=B=t.hash_size;y=t.head[--F],t.head[F]=$<=y?y-$:0,--B;);for(F=B=$;y=t.prev[--F],t.prev[F]=$<=y?y-$:0,--B;);f+=$}if(t.strm.avail_in===0)break;if(H=t.strm,G=t.window,P=t.strstart+t.lookahead,K=f,X=void 0,X=H.avail_in,K=p)for(E=t.strstart-t.insert,t.ins_h=t.window[E],t.ins_h=(t.ins_h< =p&&(t.ins_h=(t.ins_h< =p)if(y=r._tr_tally(t,t.strstart-t.match_start,t.match_length-p),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=p){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h< =p&&(t.ins_h=(t.ins_h< =p&&t.match_length<=t.prev_length){for(f=t.strstart+t.lookahead-p,y=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-p),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=f&&(t.ins_h=(t.ins_h< t.pending_buf_size-5&&(B=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ct(t),t.lookahead===0&&F===g)return n;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var y=t.block_start+B;if((t.strstart===0||t.strstart>=y)&&(t.lookahead=t.strstart-y,t.strstart=y,I(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-W&&(I(t,!1),t.strm.avail_out===0))return n}return t.insert=0,F===j?(I(t,!0),t.strm.avail_out===0?it:U):(t.strstart>t.block_start&&(I(t,!1),t.strm.avail_out),n)}),new nt(4,4,8,4,ft),new nt(4,5,16,8,ft),new nt(4,6,32,32,ft),new nt(4,4,16,16,tt),new nt(8,16,32,32,tt),new nt(8,16,128,128,tt),new nt(8,32,128,256,tt),new nt(32,128,258,1024,tt),new nt(32,258,258,4096,tt)],s.deflateInit=function(t,F){return dt(t,F,w,15,8,0)},s.deflateInit2=dt,s.deflateReset=ht,s.deflateResetKeep=et,s.deflateSetHeader=function(t,F){return t&&t.state?t.state.wrap!==2?b:(t.state.gzhead=F,u):b},s.deflate=function(t,F){var B,y,f,E;if(!t||!t.state||5 >8&255),V(y,y.gzhead.time>>16&255),V(y,y.gzhead.time>>24&255),V(y,y.level===9?2:2<=y.strategy||y.level<2?4:0),V(y,255&y.gzhead.os),y.gzhead.extra&&y.gzhead.extra.length&&(V(y,255&y.gzhead.extra.length),V(y,y.gzhead.extra.length>>8&255)),y.gzhead.hcrc&&(t.adler=c(t.adler,y.pending_buf,y.pending,0)),y.gzindex=0,y.status=69):(V(y,0),V(y,0),V(y,0),V(y,0),V(y,0),V(y,y.level===9?2:2<=y.strategy||y.level<2?4:0),V(y,3),y.status=O);else{var H=w+(y.w_bits-8<<4)<<8;H|=(2<=y.strategy||y.level<2?0:y.level<6?1:y.level===6?2:3)<<6,y.strstart!==0&&(H|=32),H+=31-H%31,y.status=O,Y(y,H),y.strstart!==0&&(Y(y,t.adler>>>16),Y(y,65535&t.adler)),t.adler=1}if(y.status===69)if(y.gzhead.extra){for(f=y.pending;y.gzindex<(65535&y.gzhead.extra.length)&&(y.pending!==y.pending_buf_size||(y.gzhead.hcrc&&y.pending>f&&(t.adler=c(t.adler,y.pending_buf,y.pending-f,f)),z(t),f=y.pending,y.pending!==y.pending_buf_size));)V(y,255&y.gzhead.extra[y.gzindex]),y.gzindex++;y.gzhead.hcrc&&y.pending>f&&(t.adler=c(t.adler,y.pending_buf,y.pending-f,f)),y.gzindex===y.gzhead.extra.length&&(y.gzindex=0,y.status=73)}else y.status=73;if(y.status===73)if(y.gzhead.name){f=y.pending;do{if(y.pending===y.pending_buf_size&&(y.gzhead.hcrc&&y.pending>f&&(t.adler=c(t.adler,y.pending_buf,y.pending-f,f)),z(t),f=y.pending,y.pending===y.pending_buf_size)){E=1;break}E=y.gzindex f&&(t.adler=c(t.adler,y.pending_buf,y.pending-f,f)),E===0&&(y.gzindex=0,y.status=91)}else y.status=91;if(y.status===91)if(y.gzhead.comment){f=y.pending;do{if(y.pending===y.pending_buf_size&&(y.gzhead.hcrc&&y.pending>f&&(t.adler=c(t.adler,y.pending_buf,y.pending-f,f)),z(t),f=y.pending,y.pending===y.pending_buf_size)){E=1;break}E=y.gzindex f&&(t.adler=c(t.adler,y.pending_buf,y.pending-f,f)),E===0&&(y.status=103)}else y.status=103;if(y.status===103&&(y.gzhead.hcrc?(y.pending+2>y.pending_buf_size&&z(t),y.pending+2<=y.pending_buf_size&&(V(y,255&t.adler),V(y,t.adler>>8&255),t.adler=0,y.status=O)):y.status=O),y.pending!==0){if(z(t),t.avail_out===0)return y.last_flush=-1,u}else if(t.avail_in===0&&D(F)<=D(B)&&F!==j)return st(t,-5);if(y.status===666&&t.avail_in!==0)return st(t,-5);if(t.avail_in!==0||y.lookahead!==0||F!==g&&y.status!==666){var G=y.strategy===2?function(P,K){for(var X;;){if(P.lookahead===0&&(ct(P),P.lookahead===0)){if(K===g)return n;break}if(P.match_length=0,X=r._tr_tally(P,0,P.window[P.strstart]),P.lookahead--,P.strstart++,X&&(I(P,!1),P.strm.avail_out===0))return n}return P.insert=0,K===j?(I(P,!0),P.strm.avail_out===0?it:U):P.last_lit&&(I(P,!1),P.strm.avail_out===0)?n:Z}(y,F):y.strategy===3?function(P,K){for(var X,$,Q,lt,at=P.window;;){if(P.lookahead<=C){if(ct(P),P.lookahead<=C&&K===g)return n;if(P.lookahead===0)break}if(P.match_length=0,P.lookahead>=p&&0 P.lookahead&&(P.match_length=P.lookahead)}if(P.match_length>=p?(X=r._tr_tally(P,1,P.match_length-p),P.lookahead-=P.match_length,P.strstart+=P.match_length,P.match_length=0):(X=r._tr_tally(P,0,P.window[P.strstart]),P.lookahead--,P.strstart++),X&&(I(P,!1),P.strm.avail_out===0))return n}return P.insert=0,K===j?(I(P,!0),P.strm.avail_out===0?it:U):P.last_lit&&(I(P,!1),P.strm.avail_out===0)?n:Z}(y,F):o[y.level].func(y,F);if(G!==it&&G!==U||(y.status=666),G===n||G===it)return t.avail_out===0&&(y.last_flush=-1),u;if(G===Z&&(F===1?r._tr_align(y):F!==5&&(r._tr_stored_block(y,0,0,!1),F===3&&(rt(y.head),y.lookahead===0&&(y.strstart=0,y.block_start=0,y.insert=0))),z(t),t.avail_out===0))return y.last_flush=-1,u}return F!==j?u:y.wrap<=0?1:(y.wrap===2?(V(y,255&t.adler),V(y,t.adler>>8&255),V(y,t.adler>>16&255),V(y,t.adler>>24&255),V(y,255&t.total_in),V(y,t.total_in>>8&255),V(y,t.total_in>>16&255),V(y,t.total_in>>24&255)):(Y(y,t.adler>>>16),Y(y,65535&t.adler)),z(t),0 =B.w_size&&(E===0&&(rt(B.head),B.strstart=0,B.block_start=0,B.insert=0),K=new h.Buf8(B.w_size),h.arraySet(K,F,X-B.w_size,B.w_size,0),F=K,X=B.w_size),H=t.avail_in,G=t.next_in,P=t.input,t.avail_in=X,t.next_in=0,t.input=F,ct(B);B.lookahead>=p;){for(y=B.strstart,f=B.lookahead-(p-1);B.ins_h=(B.ins_h< >>=p=_>>>24,S-=p,(p=_>>>16&255)===0)Z[x++]=65535&_;else{if(!(16&p)){if(!(64&p)){_=A[(65535&_)+(w&(1< >>=p,S-=p),S<15&&(w+=n[l++]<
>>=p=_>>>24,S-=p,!(16&(p=_>>>16&255))){if(!(64&p)){_=T[(65535&_)+(w&(1<>>=p,S-=p,(p=x-g)
>3,w&=(1<<(S-=C<<3))-1,o.next_in=l,o.next_out=x,o.avail_in=l >>24&255)+(v>>>8&65280)+((65280&v)<<8)+((255&v)<<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 o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(v){var O;return v&&v.state?(O=v.state,v.total_in=v.total_out=O.total=0,v.msg="",O.wrap&&(v.adler=1&O.wrap),O.mode=b,O.last=0,O.havedict=0,O.dmax=32768,O.head=null,O.hold=0,O.bits=0,O.lencode=O.lendyn=new o.Buf32(a),O.distcode=O.distdyn=new o.Buf32(m),O.sane=1,O.back=-1,j):u}function A(v){var O;return v&&v.state?((O=v.state).wsize=0,O.whave=0,O.wnext=0,S(v)):u}function T(v,O){var n,Z;return v&&v.state?(Z=v.state,O<0?(n=0,O=-O):(n=1+(O>>4),O<48&&(O&=15)),O&&(O<8||15 =U.wsize?(o.arraySet(U.window,O,n-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(Z<(it=U.wsize-U.wnext)&&(it=Z),o.arraySet(U.window,O,n-Z,it,U.wnext),(Z-=it)?(o.arraySet(U.window,O,n-Z,Z,0),U.wnext=Z,U.whave=U.wsize):(U.wnext+=it,U.wnext===U.wsize&&(U.wnext=0),U.whave >>8&255,n.check=r(n.check,E,2,0),I=z=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&z)<<8)+(z>>8))%31){v.msg="incorrect header check",n.mode=30;break}if((15&z)!=8){v.msg="unknown compression method",n.mode=30;break}if(I-=4,t=8+(15&(z>>>=4)),n.wbits===0)n.wbits=t;else if(t>n.wbits){v.msg="invalid window size",n.mode=30;break}n.dmax=1< >8&1),512&n.flags&&(E[0]=255&z,E[1]=z>>>8&255,n.check=r(n.check,E,2,0)),I=z=0,n.mode=3;case 3:for(;I<32;){if(D===0)break t;D--,z+=Z[U++]<>>8&255,E[2]=z>>>16&255,E[3]=z>>>24&255,n.check=r(n.check,E,4,0)),I=z=0,n.mode=4;case 4:for(;I<16;){if(D===0)break t;D--,z+=Z[U++]<>8),512&n.flags&&(E[0]=255&z,E[1]=z>>>8&255,n.check=r(n.check,E,2,0)),I=z=0,n.mode=5;case 5:if(1024&n.flags){for(;I<16;){if(D===0)break t;D--,z+=Z[U++]<>>8&255,n.check=r(n.check,E,2,0)),I=z=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(D<(q=n.length)&&(q=D),q&&(n.head&&(t=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),o.arraySet(n.head.extra,Z,U,q,t)),512&n.flags&&(n.check=r(n.check,Z,q,U)),D-=q,U+=q,n.length-=q),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(D===0)break t;for(q=0;t=Z[U+q++],n.head&&t&&n.length<65536&&(n.head.name+=String.fromCharCode(t)),t&&q >9&1,n.head.done=!0),v.adler=n.check=0,n.mode=12;break;case 10:for(;I<32;){if(D===0)break t;D--,z+=Z[U++]<>>=7&I,I-=7&I,n.mode=27;break}for(;I<3;){if(D===0)break t;D--,z+=Z[U++]<>>=1)){case 0:n.mode=14;break;case 1:if(C(n),n.mode=20,O!==6)break;z>>>=2,I-=2;break t;case 2:n.mode=17;break;case 3:v.msg="invalid block type",n.mode=30}z>>>=2,I-=2;break;case 14:for(z>>>=7&I,I-=7&I;I<32;){if(D===0)break t;D--,z+=Z[U++]<>>16^65535)){v.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&z,I=z=0,n.mode=15,O===6)break t;case 15:n.mode=16;case 16:if(q=n.length){if(D >>=5,I-=5,n.ndist=1+(31&z),z>>>=5,I-=5,n.ncode=4+(15&z),z>>>=4,I-=4,286>>=3,I-=3}for(;n.have<19;)n.lens[H[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,B={bits:n.lenbits},F=c(0,n.lens,0,19,n.lencode,0,n.work,B),n.lenbits=B.bits,F){v.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have >>16&255,ot=65535&f,!((tt=f>>>24)<=I);){if(D===0)break t;D--,z+=Z[U++]<>>=tt,I-=tt,n.lens[n.have++]=ot;else{if(ot===16){for(y=tt+2;I >>=tt,I-=tt,n.have===0){v.msg="invalid bit length repeat",n.mode=30;break}t=n.lens[n.have-1],q=3+(3&z),z>>>=2,I-=2}else if(ot===17){for(y=tt+3;I >>=tt)),z>>>=3,I-=3}else{for(y=tt+7;I >>=tt)),z>>>=7,I-=7}if(n.have+q>n.nlen+n.ndist){v.msg="invalid bit length repeat",n.mode=30;break}for(;q--;)n.lens[n.have++]=t}}if(n.mode===30)break;if(n.lens[256]===0){v.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,B={bits:n.lenbits},F=c(x,n.lens,0,n.nlen,n.lencode,0,n.work,B),n.lenbits=B.bits,F){v.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,B={bits:n.distbits},F=c(g,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,B),n.distbits=B.bits,F){v.msg="invalid distances set",n.mode=30;break}if(n.mode=20,O===6)break t;case 20:n.mode=21;case 21:if(6<=D&&258<=rt){v.next_out=st,v.avail_out=rt,v.next_in=U,v.avail_in=D,n.hold=z,n.bits=I,l(v,Y),st=v.next_out,it=v.output,rt=v.avail_out,U=v.next_in,Z=v.input,D=v.avail_in,z=n.hold,I=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;nt=(f=n.lencode[z&(1< >>16&255,ot=65535&f,!((tt=f>>>24)<=I);){if(D===0)break t;D--,z+=Z[U++]<>et)])>>>16&255,ot=65535&f,!(et+(tt=f>>>24)<=I);){if(D===0)break t;D--,z+=Z[U++]<>>=et,I-=et,n.back+=et}if(z>>>=tt,I-=tt,n.back+=tt,n.length=ot,nt===0){n.mode=26;break}if(32&nt){n.back=-1,n.mode=12;break}if(64&nt){v.msg="invalid literal/length code",n.mode=30;break}n.extra=15&nt,n.mode=22;case 22:if(n.extra){for(y=n.extra;I >>=n.extra,I-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;nt=(f=n.distcode[z&(1< >>16&255,ot=65535&f,!((tt=f>>>24)<=I);){if(D===0)break t;D--,z+=Z[U++]<>et)])>>>16&255,ot=65535&f,!(et+(tt=f>>>24)<=I);){if(D===0)break t;D--,z+=Z[U++]<>>=et,I-=et,n.back+=et}if(z>>>=tt,I-=tt,n.back+=tt,64&nt){v.msg="invalid distance code",n.mode=30;break}n.offset=ot,n.extra=15&nt,n.mode=24;case 24:if(n.extra){for(y=n.extra;I >>=n.extra,I-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){v.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(rt===0)break t;if(q=Y-rt,n.offset>q){if((q=n.offset-q)>n.whave&&n.sane){v.msg="invalid distance too far back",n.mode=30;break}ct=q>n.wnext?(q-=n.wnext,n.wsize-q):n.wnext-q,q>n.length&&(q=n.length),ft=n.window}else ft=it,ct=st-n.offset,q=n.length;for(rt N?(p=ct[ft+m[O]],I[V+m[O]]):(p=96,0),w=1<>st)+(S-=w)]=_<<24|p<<16|C|0,S!==0;);for(w=1< >=1;if(w!==0?(z&=w-1,z+=w):z=0,O++,--Y[v]==0){if(v===Z)break;v=g[j+m[O]]}if(it >>7)]}function V(f,E){f.pending_buf[f.pending++]=255&E,f.pending_buf[f.pending++]=E>>>8&255}function Y(f,E,H){f.bi_valid>d-H?(f.bi_buf|=E< >d-f.bi_valid,f.bi_valid+=H-d):(f.bi_buf|=E< >>=1,H<<=1,0<--E;);return H>>>1}function ft(f,E,H){var G,P,K=new Array(m+1),X=0;for(G=1;G<=m;G++)K[G]=X=X+H[G-1]<<1;for(P=0;P<=E;P++){var $=f[2*P+1];$!==0&&(f[2*P]=ct(K[$]++,$))}}function tt(f){var E;for(E=0;E >1;1<=H;H--)et(f,K,H);for(P=Q;H=f.heap[1],f.heap[1]=f.heap[f.heap_len--],et(f,K,1),G=f.heap[1],f.heap[--f.heap_max]=H,f.heap[--f.heap_max]=G,K[2*P]=K[2*H]+K[2*G],f.depth[P]=(f.depth[H]>=f.depth[G]?f.depth[H]:f.depth[G])+1,K[2*H+1]=K[2*G+1]=P,f.heap[1]=P++,et(f,K,1),2<=f.heap_len;);f.heap[--f.heap_max]=f.heap[1],function(at,bt){var yt,gt,vt,pt,kt,Ut,wt=bt.dyn_tree,qt=bt.max_code,ye=bt.stat_desc.static_tree,ke=bt.stat_desc.has_stree,je=bt.stat_desc.extra_bits,$t=bt.stat_desc.extra_base,Tt=bt.stat_desc.max_length,zt=0;for(pt=0;pt<=m;pt++)at.bl_count[pt]=0;for(wt[2*at.heap[at.heap_max]+1]=0,yt=at.heap_max+1;yt>=7;P>>=1)if(1<&&$.dyn_ltree[2*Q]!==0)return h;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return r;for(Q=32;Q >>3,(K=f.static_len+3+7>>>3)<=P&&(P=K)):P=K=H+5,H+4<=P&&E!==-1?y(f,E,H,G):f.strategy===4||K===P?(Y(f,2+(G?1:0),3),ht(f,W,v)):(Y(f,4+(G?1:0),3),function($,Q,lt,at){var bt;for(Y($,Q-257,5),Y($,lt-1,5),Y($,at-4,4),bt=0;bt >>8&255,f.pending_buf[f.d_buf+2*f.last_lit+1]=255&E,f.pending_buf[f.l_buf+f.last_lit]=255&H,f.last_lit++,E===0?f.dyn_ltree[2*H]++:(f.matches++,E--,f.dyn_ltree[2*(n[H]+g+1)]++,f.dyn_dtree[2*I(E)]++),f.last_lit===f.lit_bufsize-1},s._tr_align=function(f){Y(f,2,3),q(f,S,W),function(E){E.bi_valid===16?(V(E,E.bi_buf),E.bi_buf=0,E.bi_valid=0):8<=E.bi_valid&&(E.pending_buf[E.pending++]=255&E.bi_buf,E.bi_buf>>=8,E.bi_valid-=8)}(f)}},{"../utils/common":41}],53:[function(i,k,s){k.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(i,k,s){(function(o){(function(h,r){if(!h.setImmediate){var l,c,x,g,j=1,u={},b=!1,a=h.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(h);m=m&&m.setTimeout?m:h,l={}.toString.call(h.process)==="[object process]"?function(A){process.nextTick(function(){w(A)})}:function(){if(h.postMessage&&!h.importScripts){var A=!0,T=h.onmessage;return h.onmessage=function(){A=!1},h.postMessage("","*"),h.onmessage=T,A}}()?(g="setImmediate$"+Math.random()+"$",h.addEventListener?h.addEventListener("message",S,!1):h.attachEvent("onmessage",S),function(A){h.postMessage(g+A,"*")}):h.MessageChannel?((x=new MessageChannel).port1.onmessage=function(A){w(A.data)},function(A){x.port2.postMessage(A)}):a&&"onreadystatechange"in a.createElement("script")?(c=a.documentElement,function(A){var T=a.createElement("script");T.onreadystatechange=function(){w(A),T.onreadystatechange=null,c.removeChild(T),T=null},c.appendChild(T)}):function(A){setTimeout(w,0,A)},m.setImmediate=function(A){typeof A!="function"&&(A=new Function(""+A));for(var T=new Array(arguments.length-1),L=0;L "u"?o===void 0?this:o:self)}).call(this,typeof At<"u"?At:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(be);var cr=be.exports;const hr=le(cr);var ve={exports:{}};/* @license Papa Parse v5.5.3 https://github.com/mholt/PapaParse License: MIT */(function(R,M){((i,k)=>{R.exports=k()})(At,function i(){var k=typeof self<"u"?self:typeof window<"u"?window:k!==void 0?k:{},s,o=!k.document&&!!k.postMessage,h=k.IS_PAPA_WORKER||!1,r={},l=0,c={};function x(_){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(p){var C=T(p);C.chunkSize=parseInt(C.chunkSize),p.step||p.chunk||(C.chunkSize=null),this._handle=new a(C),(this._handle.streamer=this)._config=C}).call(this,_),this.parseChunk=function(p,C){var W=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0 =this._config.preview),h)k.postMessage({results:v,workerId:c.WORKER_ID,finished:W});else if(N(this._config.chunk)&&!C){if(this._config.chunk(v,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=v=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(v.data),this._completeResults.errors=this._completeResults.errors.concat(v.errors),this._completeResults.meta=v.meta),this._completed||!W||!N(this._config.complete)||v&&v.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),W||v&&v.meta.paused||this._nextChunk(),v}this._halted=!0},this._sendError=function(p){N(this._config.error)?this._config.error(p):h&&this._config.error&&k.postMessage({workerId:c.WORKER_ID,error:p,finished:!1})}}function g(_){var p;(_=_||{}).chunkSize||(_.chunkSize=c.RemoteChunkSize),x.call(this,_),this._nextChunk=o?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(C){this._input=C,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(p=new XMLHttpRequest,this._config.withCredentials&&(p.withCredentials=this._config.withCredentials),o||(p.onload=L(this._chunkLoaded,this),p.onerror=L(this._chunkError,this)),p.open(this._config.downloadRequestBody?"POST":"GET",this._input,!o),this._config.downloadRequestHeaders){var C,W=this._config.downloadRequestHeaders;for(C in W)p.setRequestHeader(C,W[C])}var v;this._config.chunkSize&&(v=this._start+this._config.chunkSize-1,p.setRequestHeader("Range","bytes="+this._start+"-"+v));try{p.send(this._config.downloadRequestBody)}catch(O){this._chunkError(O.message)}o&&p.status===0&&this._chunkError()}},this._chunkLoaded=function(){p.readyState===4&&(p.status<200||400<=p.status?this._chunkError():(this._start+=this._config.chunkSize||p.responseText.length,this._finished=!this._config.chunkSize||this._start>=(C=>(C=C.getResponseHeader("Content-Range"))!==null?parseInt(C.substring(C.lastIndexOf("/")+1)):-1)(p),this.parseChunk(p.responseText)))},this._chunkError=function(C){C=p.statusText||C,this._sendError(new Error(C))}}function j(_){(_=_||{}).chunkSize||(_.chunkSize=c.LocalChunkSize),x.call(this,_);var p,C,W=typeof FileReader<"u";this.stream=function(v){this._input=v,C=v.slice||v.webkitSlice||v.mozSlice,W?((p=new FileReader).onload=L(this._chunkLoaded,this),p.onerror=L(this._chunkError,this)):p=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount =this._input.size,this.parseChunk(v.target.result)},this._chunkError=function(){this._sendError(p.error)}}function u(_){var p;x.call(this,_=_||{}),this.stream=function(C){return p=C,this._nextChunk()},this._nextChunk=function(){var C,W;if(!this._finished)return C=this._config.chunkSize,p=C?(W=p.substring(0,C),p.substring(C)):(W=p,""),this._finished=!p,this.parseChunk(W)}}function b(_){x.call(this,_=_||{});var p=[],C=!0,W=!1;this.pause=function(){x.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){x.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(v){this._input=v,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){W&&p.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),p.length?this.parseChunk(p.shift()):C=!0},this._streamData=L(function(v){try{p.push(typeof v=="string"?v:v.toString(this._config.encoding)),C&&(C=!1,this._checkIsFinished(),this.parseChunk(p.shift()))}catch(O){this._streamError(O)}},this),this._streamError=L(function(v){this._streamCleanUp(),this._sendError(v)},this),this._streamEnd=L(function(){this._streamCleanUp(),W=!0,this._streamData("")},this),this._streamCleanUp=L(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function a(_){var p,C,W,v,O=Math.pow(2,53),n=-O,Z=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,it=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,U=this,st=0,D=0,rt=!1,z=!1,I=[],V={data:[],errors:[],meta:{}};function Y(tt){return _.skipEmptyLines==="greedy"?tt.join("").trim()==="":tt.length===1&&tt[0].length===0}function q(){if(V&&W&&(ft("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),W=!1),_.skipEmptyLines&&(V.data=V.data.filter(function(et){return!Y(et)})),ct()){let et=function(ht,dt){N(_.transformHeader)&&(ht=_.transformHeader(ht,dt)),I.push(ht)};if(V)if(Array.isArray(V.data[0])){for(var tt=0;ct()&&tt (E=>(_.dynamicTypingFunction&&_.dynamicTyping[E]===void 0&&(_.dynamicTyping[E]=_.dynamicTypingFunction(E)),(_.dynamicTyping[E]||_.dynamicTyping)===!0))(y)?f==="true"||f==="TRUE"||f!=="false"&&f!=="FALSE"&&((E=>{if(Z.test(E)&&(E=parseFloat(E),n =I.length?"__parsed_extra":I[t]:F,B=_.transform?_.transform(B,F):B);F==="__parsed_extra"?(dt[F]=dt[F]||[],dt[F].push(B)):dt[F]=B}return _.header&&(t>I.length?ft("FieldMismatch","TooManyFields","Too many fields: expected "+I.length+" fields but parsed "+t,D+ht):t _.preview?C.abort():(V.data=V.data[0],v(V,U))))}),this.parse=function(tt,nt,ot){var et=_.quoteChar||'"',et=(_.newline||(_.newline=this.guessLineEndings(tt,et)),W=!1,_.delimiter?N(_.delimiter)&&(_.delimiter=_.delimiter(tt),V.meta.delimiter=_.delimiter):((et=((ht,dt,t,F,B)=>{var y,f,E,H;B=B||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var G=0;G =ot.length/2?`\r `:"\r"}}function m(_){return _.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(_){var p=(_=_||{}).delimiter,C=_.newline,W=_.comments,v=_.step,O=_.preview,n=_.fastMode,Z=null,it=!1,U=_.quoteChar==null?'"':_.quoteChar,st=U;if(_.escapeChar!==void 0&&(st=_.escapeChar),(typeof p!="string"||-1 =O)return X(!0);break}ot.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:nt.length,index:D}),f++}}else if(W&&et.length===0&&z.substring(D,D+ft)===W){if(B===-1)return X();D=B+ct,B=z.indexOf(C,D),F=z.indexOf(p,D)}else if(F!==-1&&(F=O)return X(!0)}return P();function H(Q){nt.push(Q),ht=D}function G(Q){var lt=0;return lt=Q!==-1&&(Q=z.substring(f+1,Q))&&Q.trim()===""?Q.length:lt}function P(Q){return V||(Q===void 0&&(Q=z.substring(D)),et.push(Q),D=Y,H(et),tt&&$()),X()}function K(Q){D=Q,H(et),et=[],B=z.indexOf(C,D)}function X(Q){if(_.header&&!I&&nt.length&&!it){var lt=nt[0],at=Object.create(null),bt=new Set(lt);let yt=!1;for(let gt=0;gt W.charCodeAt(0)!==65279?W:W.slice(1))(_),C=new(p.download?g:u)(p)):_.readable===!0&&N(_.read)&&N(_.on)?C=new b(p):(k.File&&_ instanceof File||_ instanceof Object)&&(C=new j(p)),C.stream(_);(C=(()=>{var W;return!!c.WORKERS_SUPPORTED&&(W=(()=>{var v=k.URL||k.webkitURL||null,O=i.toString();return c.BLOB_URL||(c.BLOB_URL=v.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",O,")();"],{type:"text/javascript"})))})(),(W=new k.Worker(W)).onmessage=w,W.id=l++,r[W.id]=W)})()).userStep=p.step,C.userChunk=p.chunk,C.userComplete=p.complete,C.userError=p.error,p.step=N(p.step),p.chunk=N(p.chunk),p.complete=N(p.complete),p.error=N(p.error),delete p.worker,C.postMessage({input:_,config:p,workerId:C.id})},c.unparse=function(_,p){var C=!1,W=!0,v=",",O=`\r `,n='"',Z=n+n,it=!1,U=null,st=!1,D=((()=>{if(typeof p=="object"){if(typeof p.delimiter!="string"||c.BAD_DELIMITERS.filter(function(I){return p.delimiter.indexOf(I)!==-1}).length||(v=p.delimiter),typeof p.quotes!="boolean"&&typeof p.quotes!="function"&&!Array.isArray(p.quotes)||(C=p.quotes),typeof p.skipEmptyLines!="boolean"&&typeof p.skipEmptyLines!="string"||(it=p.skipEmptyLines),typeof p.newline=="string"&&(O=p.newline),typeof p.quoteChar=="string"&&(n=p.quoteChar),typeof p.header=="boolean"&&(W=p.header),Array.isArray(p.columns)){if(p.columns.length===0)throw new Error("Option columns is empty");U=p.columns}p.escapeChar!==void 0&&(Z=p.escapeChar+n),p.escapeFormulae instanceof RegExp?st=p.escapeFormulae:typeof p.escapeFormulae=="boolean"&&p.escapeFormulae&&(st=/^[=+\-@\t\r].*$/)}})(),new RegExp(m(n),"g"));if(typeof _=="string"&&(_=JSON.parse(_)),Array.isArray(_)){if(!_.length||Array.isArray(_[0]))return rt(null,_,it);if(typeof _[0]=="object")return rt(U||Object.keys(_[0]),_,it)}else if(typeof _=="object")return typeof _.data=="string"&&(_.data=JSON.parse(_.data)),Array.isArray(_.data)&&(_.fields||(_.fields=_.meta&&_.meta.fields||U),_.fields||(_.fields=Array.isArray(_.data[0])?_.fields:typeof _.data[0]=="object"?Object.keys(_.data[0]):[]),Array.isArray(_.data[0])||typeof _.data[0]=="object"||(_.data=[_.data])),rt(_.fields||[],_.data||[],it);throw new Error("Unable to serialize unrecognized input");function rt(I,V,Y){var q="",ct=(typeof I=="string"&&(I=JSON.parse(I)),typeof V=="string"&&(V=JSON.parse(V)),Array.isArray(I)&&0 {for(var tt=0;tt s.trim(),...M});return i.errors.length>0&&console.warn("CSV parsing warnings:",i.errors),i.data.map(s=>Array.isArray(s)?s.map(o=>String(o||"")):[String(s||"")])}const fr=R=>new Promise(M=>{const i=new FileReader;i.onload=function(k){var s;(s=k.target)!=null&&s.result&&hr.loadAsync(k.target.result).then(function(o){M(o)})},i.readAsArrayBuffer(R)}),Jt=async R=>{const M=[],i=[];for(let k=0;k {for(let i=0;i {const M=Vt(R);if(!M)return;const{props:i,table:k,innerBlocks:s,tableProps:o}=M;return i.table=o,JSON.stringify(ce(i,k.desktop,s,"table"))},xe=R=>{var h;((h=R.at(-1))==null?void 0:h.length)===1&&R.pop();const M=R.reduce((r,l)=>Math.max(r,l.length),0),k={table:{...Xe,colCount:M,rowCount:R.length}},s={},o=[];for(let r=0;r new Promise((M,i)=>{R.async("text").then(k=>{if(R.name.endsWith(".csv"))M(xe(_e(k)));else if(R.name.endsWith(".xml")){const s=we(k);M(JSON.stringify(s))}else i("Unsupported file: "+R.name),M(null)})}),gr=async({setLoadings:R,zips:M,rawFiles:i,keepTitles:k})=>{R.current({});const s=ut("Preparing tables...","progress",0),o=[];for(let g=0;g ({...w,[a]:m})),r++,l++;continue}R.current(w=>({...w,[a]:1})),g.push(new Promise(w=>{Et("/save",{title:k?d:void 0,content:b}).then(([,S])=>{R.current(A=>({...A,[a]:S.ok?2:S.statusText})),S.ok||l++}).catch(S=>{R.current(A=>({...A,[a]:S instanceof Error?S.message:"Something went wrong..."})),l++}).finally(()=>{r++,w(!0)})})),Rt(s,{progress:r/h*100,message:`[${r}/${h}] Importing tables...`})}try{await Promise.all(g)}catch{}c+=5}const x=h-l;x>0?Rt(s,{type:"success",message:`${x} tables imported successfully!`,spawned_at:Date.now(),duration:5e3}):Rt(s,{type:"error",message:"No tables imported.",duration:5e3,spawned_at:Date.now()-1e4}),l>0&&ut(`${l} tables failed to import.`,"error")},Qt=R=>R?R===1?se:R===2?Be:e.jsx(he,{content:R,style:{color:"red"},children:Pe}):"",br=({setPage:R})=>{const[M,i]=J.useState(!1),[k,s]=J.useState(!0),[o,h]=J.useState([]),[r,l]=J.useState([]),[c,x]=J.useState({}),[g,j]=J.useState(!1),u=J.useRef(x);J.useEffect(()=>{u.current=x},[x]);const b=async S=>{if(S.preventDefault(),S.stopPropagation(),i(!1),g){ut("Please wait for the previous import to finish.","error");return}const[A,T]=await Jt(S.dataTransfer.files);h([...o,...A]),l([...r,...T])},a=async S=>{if(g){S.target.value="",ut("Please wait for the previous import to finish.","error");return}const[A,T]=await Jt(Array.from(S.target.files));h([...o,...A]),l([...r,...T]),S.target.value=""},m=(S,A)=>{h(T=>{const L=[...T];return A!==void 0?L[S].files.splice(A,1):L.splice(S,1),L})},d=S=>{l(A=>{if(S===void 0)return[];const T=[...A];return T.splice(S,1),T})},w=async()=>{if(g){ut("Please wait for the previous import to finish.","error");return}j(!0),await gr({setLoadings:u,zips:o,rawFiles:r,keepTitles:k}),j(!1)};return e.jsxs("div",{className:"wptb-v2-page",children:[e.jsx(It,{setPage:R,page:"import"}),e.jsxs("div",{className:"wptb-v2-page-content",children:[e.jsx("div",{className:"wptb-v2-page-content-top",children:e.jsx("h3",{children:"Import Table"})}),e.jsxs("div",{className:mt("wptb-v2-page-content-main wptb-v2-import-page",{"wptb-v2-import-page-has-files":o.length>0||r.length>0}),children:[e.jsxs("div",{className:"wptb-v2-import-page-main-area",children:[e.jsxs("div",{className:"wptb-v2-import-page-file-area",children:[e.jsx("h3",{children:"Pick files"}),e.jsxs("div",{className:mt("wptb-v2-import-page-dropzone",{"wptb-v2-import-page-dropzone-dragover":M}),onDragOver:S=>{i(!0),S.preventDefault(),S.stopPropagation()},onDragLeave:()=>i(!1),onDrop:b,children:[e.jsx("p",{className:"wptb-v2-import-page-dropzone-text",children:"Drag and drop your files here"}),e.jsx("p",{className:"wptb-v2-import-page-dropzone-types",children:"(csv, xml, zip)"}),e.jsx("div",{className:"wptb-v2-divider",children:"or"}),e.jsxs("label",{children:["Browse files",e.jsx("input",{type:"file",accept:".csv, .xml, .zip",onChange:a,multiple:!0})]})]})]}),(o.length>0||r.length>0)&&e.jsxs("div",{className:"wptb-v2-import-page-preview",children:[e.jsxs("h3",{children:["To be imported",e.jsx("button",{type:"button",title:"Clear Files",onClick:()=>{h([]),l([])},children:Ft})]}),r.length>0&&e.jsxs("div",{className:"wptb-v2-import-page-preview-item",children:[e.jsxs("p",{children:["Single tables",!g&&e.jsx("button",{type:"button",onClick:()=>d(),children:Ot})]}),e.jsx("ul",{children:r.map((S,A)=>e.jsxs("li",{children:[S.name,e.jsxs("div",{className:"wptb-v2-import-page-preview-status",children:[Qt(c[A]),!g&&e.jsx("button",{type:"button",onClick:()=>d(A),children:Ot})]})]},`${S.name}_${A}`))})]}),o.map((S,A)=>e.jsxs("div",{className:"wptb-v2-import-page-preview-item",children:[e.jsxs("p",{children:[S.name,!g&&e.jsx("button",{type:"button",onClick:()=>m(A),children:Ot})]}),e.jsx("ul",{children:S.files.map((T,L)=>e.jsxs("li",{children:[T.object.name,e.jsxs("div",{className:"wptb-v2-import-page-preview-status",children:[Qt(c[`${A}_${L}`]),!g&&e.jsx("button",{type:"button",onClick:()=>m(A,L),children:Ot})]})]},`${T.object.name}_${L}`))})]},S.name))]})]}),e.jsxs("div",{className:"wptb-v2-import-page-form",children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:k,onChange:()=>s(!k)}),e.jsx("p",{children:"Preserve table titles"})]}),e.jsxs("button",{type:"button",onClick:w,disabled:g,children:[g?e.jsx(Oe,{}):e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:e.jsx("path",{fill:"currentColor",d:"M9 6c0-1.6.8-3 2-4h-1c-3.9 0-7 .9-7 2c0 1 2.6 1.8 6 2m3.8 4.8c-.9.1-1.9.2-2.8.2c-3.9 0-7-.9-7-2v3c0 1.1 3.1 2 7 2s7-.9 7-2v-2c-.9.7-1.9 1-3 1c-.4 0-.8-.1-1.2-.2M10 15c-3.9 0-7-.9-7-2v3c0 1.1 3.1 2 7 2s7-.9 7-2v-3c0 1.1-3.1 2-7 2m0-5h1c-1-.7-1.7-1.8-1.9-3C5.7 6.9 3 6 3 5v3c0 1.1 3.1 2 7 2m4 0c2.2 0 4-1.8 4-4s-1.8-4-4-4s-4 1.8-4 4s1.8 4 4 4m-1-4V3h2v3h2l-3 3l-3-3z"})}),"Import"]})]})]})]})]})},vr=({onSelect:R,onAllSelect:M,apiData:i,searchTxt:k,setSearch:s,items:o,sorting:h})=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"wptb-v2-export-page-header",children:[e.jsx("h2",{children:"All Tables"}),e.jsxs("div",{className:"wptb-v2-export-page-search",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:e.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"4",children:[e.jsx("path",{d:"M21 38c9.389 0 17-7.611 17-17S30.389 4 21 4S4 11.611 4 21s7.611 17 17 17Z"}),e.jsx("path",{strokeLinecap:"round",d:"M26.657 14.343A7.98 7.98 0 0 0 21 12a7.98 7.98 0 0 0-5.657 2.343m17.879 18.879l8.485 8.485"})]})}),e.jsx("input",{type:"search",placeholder:"Search...",value:k,onChange:r=>s(r.target.value)})]})]}),e.jsxs("p",{className:"wptb-pagination-info",children:["Showing ",e.jsx("b",{children:i.page_start})," to ",e.jsx("b",{children:i.page_end})," of"," ",e.jsx("b",{children:i.total_count})," entries"]}),e.jsx(ue,{onSelect:R,onAllCheck:M,sorting:h,isLoading:i.loading,items:o,columns:["title","modified","id"],htmlColumns:{title:!0},checkbox:!0})]}),_r=({onUnSelect:R,onAllUnSelect:M,items:i})=>{const k=pe("modified","desc"),[s,o]=J.useState(""),[h,r]=J.useState(i);J.useEffect(()=>{r(i)},[i]),J.useEffect(()=>{if(s==="")return r(i);const c=i.filter(x=>x.title.toLowerCase().includes(s.toLowerCase()));r(c)},[s,i]);const l=k[0];return J.useEffect(()=>r(c=>(l.order==="asc"?c.sort((x,g)=>x[l.by].toString().localeCompare(g[l.by].toString())):c.sort((x,g)=>g[l.by].toString().localeCompare(x[l.by].toString())),[...c])),[l]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"wptb-v2-export-page-header",children:[e.jsx("h2",{children:"To Export"}),e.jsxs("div",{className:"wptb-v2-export-page-search",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:e.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"4",children:[e.jsx("path",{d:"M21 38c9.389 0 17-7.611 17-17S30.389 4 21 4S4 11.611 4 21s7.611 17 17 17Z"}),e.jsx("path",{strokeLinecap:"round",d:"M26.657 14.343A7.98 7.98 0 0 0 21 12a7.98 7.98 0 0 0-5.657 2.343m17.879 18.879l8.485 8.485"})]})}),e.jsx("input",{type:"search",placeholder:"Search...",value:s,onChange:c=>o(c.target.value)})]})]}),e.jsx(ue,{onSelect:R,onAllCheck:M,sorting:k,items:h,columns:["title","modified","id"],htmlColumns:{title:!0},checkbox:!0,checked:!0,noItemsMessage:"No tables selected"})]})},Zt=document.createElement("a"),wr=async(R,M)=>{try{const i=new URLSearchParams({ids:R,type:M.toLowerCase()}),k=await Le(`/export?${i}`);if(!k.ok){const g=await k.json();throw new Error(g.message||"Export failed")}if(k.headers.get("content-type")!=="application/octet-stream"){const g=await k.json();throw new Error(g.message||"Unexpected response format")}const o=k.headers.get("content-disposition"),r=/filename="(.+\..+)"/.exec(o||"");if(r===null)throw new Error("Invalid file name header!");const l=r[1],c=await k.blob(),x=window.URL.createObjectURL(c);Zt.href=x,Zt.download=l,Zt.click(),window.URL.revokeObjectURL(x),ut('File downloaded as "'+l+'"',"success")}catch(i){ut(i.message||"Something went wrong","error")}},xr={xml:e.jsxs(e.Fragment,{children:[e.jsx("b",{children:"XML:"})," an exact copy of your tables will be exported, ideal for backing up and sharing your tables with your other WordPress sites that uses WP Table Builder."]}),csv:e.jsxs(e.Fragment,{children:[e.jsx("b",{children:"CSV:"})," only text content of your tables will be exported, ideal for usage within other apps/plugins."]})},yr=({setPage:R})=>{const M=J.useRef(),[i,k]=J.useState(1),s=pe("modified","desc"),[o,h]=J.useState(""),[r,l]=J.useState([]),[c,x]=J.useState(""),[g,j]=J.useState("xml"),[u,b]=J.useState(!1),[a,m,d]=me({page:i,search:o,sort:s[0],abortCtrl:M.current,skipTables:c});J.useEffect(()=>{l(a.posts)},[a.posts]);const[w,S]=J.useState([]),A=p=>{const C=c+","+p.id;x(C.replace(/^,/,"")),S([...w,p]),l(r.filter(W=>W.id!==p.id)),r.length<=1&&d()},T=p=>{S(w.filter(W=>W.id!==p.id)),l([...r,p]);let C=c.replace(p.id.toString(),"");C=C.replace(/,,/,","),C=C.replace(/(^,)|(,$)/,""),x(C)},L=()=>{if(!r.length)return;const p=[...w];let C=c;r.forEach(W=>{p.push(W),C=C+","+W.id}),C=C.replace(/^,/,""),S(p),x(C),d()},N=()=>{w.length&&(S([]),x(""),l([...r,...w]))},_=()=>{if(!u){if(!c){ut("No tables selected","error");return}b(!0),wr(c,g).then(()=>{b(!1),N()})}};return e.jsxs("div",{className:"wptb-v2-page",children:[e.jsx(It,{setPage:R,page:"export"}),e.jsxs("div",{className:"wptb-v2-page-content",children:[e.jsx("div",{className:"wptb-v2-page-content-top",children:e.jsx("h3",{children:"Export Table"})}),e.jsxs("div",{className:"wptb-v2-export-page",children:[e.jsxs("div",{className:"wptb-v2-export-page-unselected",children:[e.jsx(vr,{onSelect:A,onAllSelect:L,apiData:a,setSearch:h,searchTxt:o,items:r,sorting:s}),e.jsx(Fe,{apiData:a,setPage:k})]}),e.jsxs("div",{className:"wptb-v2-export-page-exchange",children:[e.jsx("button",{type:"button",onClick:L,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsxs("g",{fill:"none",children:[e.jsx("path",{d:"M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),e.jsx("path",{fill:"currentColor",d:"m15.06 5.283l5.657 5.657a1.5 1.5 0 0 1 0 2.12l-5.656 5.658a1.5 1.5 0 0 1-2.122-2.122l3.096-3.096H4.5a1.5 1.5 0 0 1 0-3h11.535L12.94 7.404a1.5 1.5 0 0 1 2.122-2.121Z"})]})})}),e.jsx("button",{type:"button",onClick:N,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsxs("g",{fill:"none",children:[e.jsx("path",{d:"M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),e.jsx("path",{fill:"currentColor",d:"M3.283 10.94a1.5 1.5 0 0 0 0 2.12l5.656 5.658a1.5 1.5 0 1 0 2.122-2.122L7.965 13.5H19.5a1.5 1.5 0 0 0 0-3H7.965l3.096-3.096a1.5 1.5 0 1 0-2.122-2.121z"})]})})})]}),e.jsxs("div",{className:"wptb-v2-export-page-selected",children:[e.jsx(_r,{onUnSelect:T,onAllUnSelect:N,items:w}),e.jsxs("div",{className:"wptb-v2-export-page-form",children:[e.jsx("p",{children:"Format:"}),e.jsxs("select",{value:g,onChange:p=>j(p.target.value),children:[e.jsx("option",{value:"xml",children:"XML"}),e.jsx("option",{value:"csv",children:"CSV"})]}),e.jsx(he,{content:xr[g],className:"wptb-v2-export-page-form-info",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-1-7v2h2v-2zm2-1.645A3.502 3.502 0 0 0 12 6.5a3.5 3.5 0 0 0-3.433 2.813l1.962.393A1.5 1.5 0 1 1 12 11.5a1 1 0 0 0-1 1V14h2z"})})}),e.jsxs("button",{type:"button",disabled:u,onClick:_,children:[u?e.jsx(Gt,{}):e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",children:e.jsx("path",{fill:"currentColor",d:"M74.34 85.66a8 8 0 0 1 11.32-11.32L120 108.69V24a8 8 0 0 1 16 0v84.69l34.34-34.35a8 8 0 0 1 11.32 11.32l-48 48a8 8 0 0 1-11.32 0ZM240 136v64a16 16 0 0 1-16 16H32a16 16 0 0 1-16-16v-64a16 16 0 0 1 16-16h52.4a4 4 0 0 1 2.83 1.17L111 145a24 24 0 0 0 34 0l23.8-23.8a4 4 0 0 1 2.8-1.2H224a16 16 0 0 1 16 16m-40 32a12 12 0 1 0-12 12a12 12 0 0 0 12-12"})}),"Export"]})]})]})]})]})]})},kr=R=>typeof R=="number"||parseInt(R).toString()===R,jr=({table:R,setPage:M})=>{const i=De(),[k,s]=J.useState(!1),[o,h]=J.useState(),[r,l]=J.useState(null),c=(b,a)=>{const m=Vt(b),{props:d,table:w,innerBlocks:S,tableProps:A,corruption:T}=m;if(T){h(T),l({table:b,...a});return}Ct.dispatch(ie({id:R,table:{...w,id:R,title:a.name,tags:a.tags,is_template:a.is_template},tableProps:A,props:d,innerBlocks:S})),Ct.dispatch(ae(R)),oe.init(),s(!0)},x=()=>{if(!r)return;const b=Je(r.table);h(void 0),l(null),c(b,{name:r.name,tags:r.tags,is_template:r.is_template}),ut("Table repaired successfully","success",3e3)},g=()=>{if(h(void 0),l(null),history.length>2){history.back();return}M("tables")};J.useEffect(()=>{if(i(Ue({isSaving:!1,activeBlock:void 0,timeTravel:{lastSaved:/[^0-9]/.test(R)?void 0:0,cursor:0,total:0}})),!kr(R)){if(!Ct.getState().tables[R]){history.replaceState(null,"","?page=wptb"),M("tables");return}s(!0);return}s(!1),h(void 0),l(null);const b=new AbortController;return Lt(`/table?id=${R}`,{signal:b.signal}).then(a=>{if(!a.table){ut("Table not found","error",5e3),history.replaceState(null,"","?page=wptb"),M("tables");return}c(a.table,{name:a.name,tags:a.tags,is_template:a.is_template})}).catch(a=>null),()=>b.abort()},[R,M,i]);const j=({id:b,is_new:a})=>{a&&history.replaceState(null,"","?page=wptb-builder&table="+b)},u=()=>{if(history.length>2){history.back();return}M("tables")};return e.jsx(We,{isLoaded:k,onSave:j,onClose:u,corruption:o,onRecover:x,onCancelRecovery:g})},Sr=()=>{const[R,M]=J.useState(!1),[i,k]=J.useState(WPTB_CFG.SETTINGS.general||{}),s=l=>{var c;if((c=i.allowed_roles)!=null&&c.includes(l)){const x=i.allowed_roles.filter(g=>g!==l);k({...i,allowed_roles:x})}else{const x=[...i.allowed_roles||[],l];k({...i,allowed_roles:x})}},o=async()=>{if(!R){M(!0);try{const[l,c]=await Et("/settings",{general:i});if(!c.ok){ut(l.error||l.message||"Something went wrong","error");return}if(l.error){ut(l.error,"error");return}ut(l.message||"Settings saved successfully","success"),WPTB_CFG.SETTINGS.general=l.settings.general}catch(l){console.log(l),ut("Something went wrong","error")}finally{M(!1)}}},h=()=>{k(WPTB_CFG.SETTINGS.general||{})},r=WPTB_CFG.SETTINGS.all_roles||{};return e.jsxs("div",{children:[e.jsxs("div",{className:"wptb-v2-general-settings wptb-v2-settings-area",children:[e.jsxs("div",{className:"wptb-v2-setting-group",children:[e.jsx("h3",{children:"Allowed User Roles"}),e.jsx("div",{className:"wptb-v2-setting-group-items",children:Object.keys(r).map(l=>{var c;return e.jsx(jt,{label:r[l].name,checked:(c=i.allowed_roles)==null?void 0:c.includes(l),onChange:()=>s(l)},l)})})]}),e.jsxs("div",{className:"wptb-v2-setting-group",children:[e.jsx("h3",{children:"Table Settings"}),e.jsxs("div",{className:"wptb-v2-setting-group-items",children:[e.jsx(jt,{label:"Show edit link in frontend",checked:!!i.display_edit_link_frontend,onChange:()=>k({...i,display_edit_link_frontend:!i.display_edit_link_frontend})}),e.jsx(jt,{label:"Give credits to WP Table Builder",checked:!!i.display_credits,onChange:()=>k({...i,display_credits:!i.display_credits})}),e.jsx(jt,{label:"Restrict users access to own tables",checked:!!i.restrict_users_to_their_tables,onChange:()=>k({...i,restrict_users_to_their_tables:!i.restrict_users_to_their_tables})}),e.jsx(jt,{label:"Disable Emoji to Image conversion",checked:!!i.disable_emoji_image_conversion,onChange:()=>k({...i,disable_emoji_image_conversion:!i.disable_emoji_image_conversion})}),e.jsx(jt,{label:"Disable theme styles",checked:!!i.disable_theme_styles,onChange:()=>k({...i,disable_theme_styles:!i.disable_theme_styles})})]})]}),e.jsxs("div",{className:"wptb-v2-setting-group",children:[e.jsx("h3",{children:"Plugin Options"}),e.jsxs("div",{className:"wptb-v2-setting-group-items",children:[e.jsx(de,{rtl:!0,label:"Take over the entire screen in builder",checked:!!i.take_over_entire_screen,onChange:l=>k({...i,take_over_entire_screen:l})}),e.jsx(Nt,{label:"Sidebar Location",value:i.sidebar_position||"left",onChange:l=>k({...i,sidebar_position:l}),options:[{value:"left",label:"Left"},{value:"right",label:"Right"}]}),e.jsx(jt,{label:"Enable Version Sync",checked:!!i.enable_version_sync,onChange:()=>k({...i,enable_version_sync:!i.enable_version_sync})})]})]})]}),e.jsxs("div",{className:"wptb-v2-setting-btns",children:[e.jsx("button",{type:"button",className:"wptb-btn-revert",onClick:h,disabled:R,children:"Revert"}),e.jsxs("button",{type:"button",className:"wptb-btn-save",onClick:o,disabled:R,children:[R&&Dt," Save"]})]})]})},Cr=()=>{var h;const[R,M]=J.useState(((h=WPTB_CFG.SETTINGS)==null?void 0:h.table_style)||""),[i,k]=J.useState(!1),s=async()=>{if(!i){k(!0);try{const[r,l]=await Et("/settings",{global_styles:R});if(!l.ok){ut(r.error||r.message||"Something went wrong","error");return}if(r.error){ut(r.error,"error");return}ut(r.message||"Settings saved successfully","success"),WPTB_CFG.SETTINGS.table_style=r.settings.global_styles}catch(r){console.log(r),ut("Something went wrong","error")}finally{k(!1)}}},o=()=>{M(WPTB_CFG.SETTINGS.table_style||"")};return e.jsxs("div",{children:[e.jsxs("div",{className:"wptb-v2-settings-area wptb-v2-table-settings",children:[e.jsx("p",{children:"These styles will be applied to all tables."}),e.jsx(Me,{label:"Custom CSS",rows:10,value:R,onChange:M})]}),e.jsxs("div",{className:"wptb-v2-setting-btns",children:[e.jsx("button",{type:"button",className:"wptb-btn-revert",onClick:o,disabled:i,children:"Revert"}),e.jsxs("button",{type:"button",className:"wptb-btn-save",onClick:s,disabled:i,children:[i&&Dt," Save"]})]})]})},Er=()=>{const[R,M]=J.useState(!1),[i,k]=J.useState(!1),[s,o]=J.useState(WPTB_CFG.SETTINGS.lazy_load),h=async()=>{if(!R){M(!0);try{const l={lazy_load:s},[c,x]=await Et("/settings",l);if(!x.ok){ut(c.error||c.message||"Something went wrong","error");return}if(c.error){ut(c.error,"error");return}ut(c.message||"Settings saved successfully","success"),WPTB_CFG.SETTINGS.lazy_load=c.settings.lazy_load}catch(l){console.log(l),ut("Something went wrong","error")}finally{M(!1)}}},r=()=>{o(WPTB_CFG.SETTINGS.lazy_load)};return e.jsxs("div",{children:[e.jsxs("div",{className:"wptb-v2-settings-area wptb-v2-lazy-load-settings",children:[e.jsxs("div",{children:[e.jsx(Bt,{title:"Enable Lazy Load",initialOpen:!0,className:"wptb-v2-lazy-load-group",children:e.jsx(de,{label:"Enable Lazy Loading Images",checked:!!s.enabled,onChange:l=>o({...s,enabled:l})})}),e.jsxs("div",{className:"wptb-v2-lazy-load-preview",children:[e.jsx("h4",{children:"Preview"}),e.jsxs("div",{className:"wptb-v2-lazy-load-preview-image",children:[e.jsx("img",{src:WPTB_CFG.PLUGIN_URL+"/assets/images/wptb-logo.png",className:`${s.imageLoadAnimation} to-${s.imageLoadAnimationDirection}`,style:{"--transition-speed":1/Number(s.imageLoadAnimationSpeed)+"s"},"data-visible":i}),(s==null?void 0:s.imageLoadAnimation)==="flash"&&e.jsx("div",{style:{background:s.flashColor}})]}),e.jsxs("div",{className:"wptb-v2-lazy-load-preview-btns",children:[e.jsx("button",{type:"button",className:"wptb-v2-lazy-load-preview-reset",disabled:!i,onClick:()=>k(!1),children:"Reset"}),e.jsx("button",{type:"button",className:"wptb-v2-lazy-load-preview-reload",disabled:i,onClick:()=>k(!0),children:"Load Image"})]}),e.jsxs("div",{className:"wptb-v2-lazy-load-notice",children:[e.jsx("h5",{children:"important:"}),e.jsx("p",{children:"After enable, if you are getting any conflicts with your third party lazy load plugin, please whitelist table image elements with wptb-image-element-target class name from plugin settings."})]})]})]}),e.jsxs("div",{className:"wptb-v2-lazy-load-pro",children:[e.jsx(Ze,{name:"global.lazy_load",props:s,setProps:o}),e.jsxs(He,{name:"global.lazy_load",children:[e.jsxs(Bt,{title:"General Options",initialOpen:!0,className:"wptb-v2-lazy-load-group",children:[e.jsx(Wt,{label:"Visibility Percentage",value:s==null?void 0:s.visibilityPercentage,allowedUnits:{"%":{}}}),e.jsx(Mt,{label:"Background Color",value:s==null?void 0:s.backgroundColor})]}),e.jsxs(Bt,{title:"Icon Options",initialOpen:!0,className:"wptb-v2-lazy-load-group",children:[e.jsx(Ge,{label:"Icon",value:s==null?void 0:s.iconName}),e.jsx(Mt,{label:"Icon Color",value:s==null?void 0:s.iconColor}),e.jsx(Wt,{label:"Icon Size",value:s==null?void 0:s.iconSize}),e.jsx(Nt,{label:"Icon Animation",value:s==null?void 0:s.iconAnimation,options:[{value:"none",label:"None"},{value:"heartbeat",label:"Heartbeat"},{value:"rotate",label:"Rotate"},{value:"flip",label:"Flip"},{value:"jump",label:"Jump"}]})]}),e.jsxs(Bt,{title:"Image Load Options",initialOpen:!0,className:"wptb-v2-lazy-load-group",children:[e.jsx(Nt,{label:"Animation",value:s==null?void 0:s.imageLoadAnimation,options:[{value:"none",label:"None"},{value:"slide-in",label:"Slide In"},{value:"grow-sling",label:"Grow Sling"},{value:"flash",label:"Flash"},{value:"flip",label:"Flip"}]}),(s==null?void 0:s.imageLoadAnimation)==="slide-in"&&e.jsx(Nt,{label:"Direction",value:s==null?void 0:s.imageLoadAnimationDirection,options:[{value:"left",label:"To Left"},{value:"right",label:"To Right"},{value:"top",label:"To Top"},{value:"bottom",label:"To Bottom"}]}),(s==null?void 0:s.imageLoadAnimation)==="flash"&&e.jsx(Mt,{label:"Flash Color",value:s==null?void 0:s.flashColor}),(s==null?void 0:s.imageLoadAnimation)==="flip"&&e.jsxs(e.Fragment,{children:[e.jsx(Nt,{label:"Direction",value:s==null?void 0:s.imageLoadAnimationDirection,options:[{value:"left",label:"To Left"},{value:"right",label:"To Right"}]}),e.jsx(Wt,{label:"Perspective",value:s==null?void 0:s.imageLoadAnimationPerspective})]}),e.jsx(Ht,{label:"Speed",value:Number(s==null?void 0:s.imageLoadAnimationSpeed)||5,max:10})]})]})]})]}),e.jsxs("div",{className:"wptb-v2-setting-btns",children:[e.jsx("button",{type:"button",className:"wptb-btn-revert",onClick:r,disabled:R,children:"Revert"}),e.jsxs("button",{type:"button",className:"wptb-btn-save",onClick:h,disabled:R,children:[R&&Dt," Save"]})]})]})};let _t=null;const Tr=R=>{const M={},i=document.createElement("div");return i.innerHTML=R,i.querySelectorAll("h4").forEach(s=>{var h,r;const o=(h=s.textContent)==null?void 0:h.trim();o&&(M[o]=((r=s.nextElementSibling)==null?void 0:r.outerHTML)||"")}),M},te=(R,M)=>{const i=R.replace(/^v/,"").split(".").map(Number),k=M.replace(/^v/,"").split(".").map(Number),s=Math.max(i.length,k.length);for(;i.length k[o])return 1;if(i[o]{const[R,M]=J.useState(_t===null),[i,k]=J.useState(!1),[s,o]=J.useState(_t),[h,r]=J.useState((_t==null?void 0:_t.version)||"");J.useEffect(()=>{if(_t!==null){M(!1),o(_t),r(_t.version);return}fetch("https://api.wordpress.org/plugins/info/1.0/wp-table-builder.json").then(c=>c.json()).then(c=>{if(_t)return;const x={};Object.keys(c.versions).sort(te).reverse().slice(0,6).forEach(j=>{x[j]=c.versions[j]}),_t={version:c.version,versions:x,changelog:Tr(c.sections.changelog),latest:Object.keys(c.versions).sort(te).at(-1)},o(_t),r(_t.version)}).finally(()=>{M(!1)})},[]);const l=async()=>{if(!i){k(!0);try{const[c,x]=await Et("/settings/install-version",{version:h});if(!x.ok){ut(c.error||c.message||"Something went wrong","error");return}if(c.error){ut(c.error,"error");return}ut(c.message||"Settings saved successfully","success"),window.location.reload()}catch{ut("Something went wrong","error")}k(!1)}};return e.jsxs("div",{className:"wptb-v2-settings-area wptb-v2-version-settings",children:[R||!s?e.jsx("div",{className:"wptb-v2-loading",children:e.jsx(Gt,{})}):e.jsxs("div",{className:"wptb-v2-version-settings-content",children:[e.jsxs("div",{className:"wptb-v2-version-settings-control",children:[e.jsx("p",{className:"wptb-v2-version-settings-encourage",children:"If you are having issues with the current version of the plugin, you can rollback to a previous version."}),e.jsxs("div",{className:"wptb-v2-version-settings-info",children:[e.jsx("div",{children:"Current Version"}),e.jsxs("div",{children:[e.jsx("div",{className:mt({"wptb-v2-version-settings-info-success":s.latest===WPTB_CFG.SETTINGS.version,"wptb-v2-version-settings-info-warning":s.latest!==WPTB_CFG.SETTINGS.version})}),e.jsx("span",{children:WPTB_CFG.SETTINGS.version})]}),e.jsx("div",{children:"Latest Version"}),e.jsxs("div",{children:[e.jsx("div",{className:mt({"wptb-v2-version-settings-info-success":s.latest===WPTB_CFG.SETTINGS.version,"wptb-v2-version-settings-info-warning":s.latest!==WPTB_CFG.SETTINGS.version})}),e.jsx("span",{children:s.latest})]}),e.jsx("div",{children:"Install"}),e.jsx("div",{children:e.jsx("select",{value:h,onChange:c=>r(c.target.value),children:Object.keys(s.versions).map(c=>e.jsx("option",{value:c,children:c},c))})})]}),e.jsxs("div",{className:"wptb-v2-version-settings-warning",children:[e.jsx("h5",{children:"warning:"}),e.jsx("p",{children:"Previous versions may be unstable and unsecure, continue with your own risk and take a backup."})]})]}),e.jsxs("div",{className:"wptb-v2-version-settings-log",children:[e.jsx("h4",{children:h}),e.jsx("div",{dangerouslySetInnerHTML:{__html:s.changelog[h]||""}})]})]}),e.jsx("div",{className:"wptb-v2-setting-btns",children:e.jsxs("button",{type:"button",className:"wptb-btn-save",disabled:i,onClick:l,children:[i&&Dt," Install ",h]})})]})},ee={general:Sr,tableStyles:Cr,lazyLoad:Er,version:Ar},Nr=({setPage:R})=>{const[M,i]=J.useState("general");return e.jsxs("div",{className:"wptb-v2-page wptb-v2-settings-page",children:[e.jsx(It,{setPage:R,page:"settings"}),e.jsxs("div",{className:"wptb-v2-page-content",children:[e.jsx("div",{className:"wptb-v2-page-content-top",children:e.jsx("h2",{children:St("WP Table Builder")})}),e.jsxs("div",{className:"wptb-v2-page-content-main",children:[e.jsxs("div",{className:"wptb-v2-settings-tabs",children:[e.jsx("button",{className:M==="general"?"wptb-v2-active":"",onClick:()=>i("general"),children:"General"}),e.jsx("button",{className:M==="tableStyles"?"wptb-v2-active":"",onClick:()=>i("tableStyles"),children:"Table Styles"}),e.jsx("button",{className:M==="lazyLoad"?"wptb-v2-active":"",onClick:()=>i("lazyLoad"),children:"Lazy Load"}),e.jsx("button",{className:M==="version"?"wptb-v2-active":"",onClick:()=>i("version"),children:"Version Control"})]}),e.jsx("div",{children:ee[M]&&J.createElement(ee[M])})]})]})]})},Ir=({setPage:R})=>{const M=()=>{R&&R("create")},i=()=>{window.open("https://wptablebuilder.com/docs/create-first-table-wp-table-builder/","_blank")};return e.jsx("div",{className:"wptb-welcome-page",children:e.jsxs("div",{className:"wptb-welcome-card",children:[e.jsxs("div",{className:"wptb-welcome-card-header",children:[e.jsx(fe,{className:"wptb-welcome-logo"}),e.jsx("h1",{className:"wptb-welcome-title",children:"Getting Started"})]}),e.jsxs("div",{className:"wptb-welcome-card-body",children:[e.jsx("h2",{className:"wptb-welcome-heading",children:"Welcome to WP Table Builder!"}),e.jsx("p",{className:"wptb-welcome-text",children:"We recommend you to watch this short getting started video, and then start dragging and dropping elements to create your first table."}),e.jsx("div",{className:"wptb-welcome-video",children:e.jsx("iframe",{width:"100%",height:"100%",src:"https://www.youtube.com/embed/VPW0-3bNReY",title:"Getting Started with WP Table Builder",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),e.jsxs("div",{className:"wptb-welcome-actions",children:[e.jsx("button",{className:"wptb-welcome-btn wptb-welcome-btn-primary",onClick:M,children:"Create Your First Table"}),e.jsx("button",{className:"wptb-welcome-btn wptb-welcome-btn-secondary",onClick:i,children:"Learn More"})]})]})]})})},zr={tables:sr,builder:jr,create:lr,import:br,export:yr,settings:Nr,welcome:Ir},re=()=>{var i,k;const R=new URLSearchParams(window.location.search),M={};for(const[s,o]of R)M[s]=o;return M.page=((k=(i=M.page)==null?void 0:i.replace("wptb",""))==null?void 0:k.substring(1))||"tables",M};function Rr(){const[R,M]=J.useState({}),i=(k,s)=>{s=s||{};const h={page:k==="tables"?"wptb":`wptb-${k}`};for(const l in s){const c=s[l];c&&(h[l]=c)}const r=new URLSearchParams(h).toString();window.history.pushState(null,"","?"+r),s.page=k,M(s)};return J.useEffect(()=>{const k=()=>{const s=re();M(s)};return M(re()),window.addEventListener("popstate",k),()=>{window.removeEventListener("popstate",k)}},[]),[R,i]}const Or=()=>{const[R,M]=Rr(),i=zr[R.page];if(i)return e.jsx(i,{...R,setPage:M})};document.addEventListener("DOMContentLoaded",()=>{const R=document.querySelector("#wptb-app-root");!R||typeof WPTB>"u"||Ve(R).render(e.jsx(qe.StrictMode,{children:e.jsxs($e,{store:Ct,children:[e.jsx(Or,{}),e.jsx(Ke,{}),e.jsx(Ye,{})]})}))}); /*! elementor-pro - v3.31.0 - 10-08-2025 */ "use strict"; (self["webpackChunkelementor_pro"] = self["webpackChunkelementor_pro"] || []).push([["nested-carousel"],{ /***/ "../modules/nested-carousel/assets/js/frontend/handlers/nested-carousel.js": /*!*********************************************************************************!*\ !*** ../modules/nested-carousel/assets/js/frontend/handlers/nested-carousel.js ***! \*********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _runElementHandlers = _interopRequireDefault(__webpack_require__(/*! elementor-pro/frontend/utils/run-element-handlers */ "../assets/dev/js/frontend/utils/run-element-handlers.js")); class NestedCarousel extends elementorModules.frontend.handlers.CarouselBase { getDefaultSettings() { const defaultSettings = super.getDefaultSettings(); defaultSettings.selectors.carousel = '.e-n-carousel'; defaultSettings.selectors.slidesWrapper = '.e-n-carousel > .swiper-wrapper'; return defaultSettings; } getSwiperSettings() { const swiperOptions = super.getSwiperSettings(), elementSettings = this.getElementSettings(), isRtl = elementorFrontend.config.is_rtl, widgetSelector = `.elementor-element-${this.getID()}`; if (elementorFrontend.isEditMode()) { delete swiperOptions.autoplay; swiperOptions.loop = false; swiperOptions.noSwipingSelector = '.swiper-slide > .e-con .elementor-element'; } if ('yes' === elementSettings.arrows) { swiperOptions.navigation = { prevEl: isRtl ? `${widgetSelector} .elementor-swiper-button-next` : `${widgetSelector} .elementor-swiper-button-prev`, nextEl: isRtl ? `${widgetSelector} .elementor-swiper-button-prev` : `${widgetSelector} .elementor-swiper-button-next` }; } this.applySwipeOptions(swiperOptions); return swiperOptions; } async onInit() { this.wrapSlideContent(); super.onInit(...arguments); this.ranElementHandlers = false; } async initSwiper() { const Swiper = elementorFrontend.utils.swiper; this.swiper = await new Swiper(this.elements.$swiperContainer, this.getSwiperSettings()); // Expose the swiper instance in the frontend this.elements.$swiperContainer.data('swiper', this.swiper); } handleElementHandlers() { if (this.ranElementHandlers || !this.swiper) { return; } const duplicatedSlides = Array.from(this.swiper.slides).filter(slide => slide.classList.contains(this.swiper.params.slideDuplicateClass)); (0, _runElementHandlers.default)(duplicatedSlides); this.ranElementHandlers = true; } wrapSlideContent() { if (!elementorFrontend.isEditMode()) { return; } const settings = this.getSettings(), slideContentClass = settings.selectors.slideContent.replace('.', ''), $widget = this.$element; let index = 1; this.findElement(`${settings.selectors.slidesWrapper} > .e-con`).each(function () { const $currentContainer = jQuery(this), hasSwiperSlideWrapper = $currentContainer.closest('div').hasClass(slideContentClass), $currentSlide = $widget.find(`${settings.selectors.slidesWrapper} > .${slideContentClass}:nth-child(${index})`); if (!hasSwiperSlideWrapper) { $currentSlide.append($currentContainer); } index++; }); } togglePauseOnHover(toggleOn) { if (elementorFrontend.isEditMode()) { return; } super.togglePauseOnHover(toggleOn); } getChangeableProperties() { return { arrows_position: 'arrows_position' // Not a Swiper setting. }; } applySwipeOptions(swiperOptions) { if (!this.isTouchDevice()) { swiperOptions.shortSwipes = false; } else { swiperOptions.touchRatio = 1; swiperOptions.longSwipesRatio = 0.3; swiperOptions.followFinger = true; swiperOptions.threshold = 10; } } isTouchDevice() { return elementorFrontend.utils.environment.isTouchDevice; } async linkContainer(event) { const { container, index, targetContainer, action: { type } } = event.detail, view = container.view.$el, id = container.model.get('id'), currentId = this.$element.data('id'); if (id === currentId) { const { $slides } = this.getDefaultElements(); let carouselItemWrapper, contentContainer; switch (type) { case 'move': [carouselItemWrapper, contentContainer] = this.move(view, index, targetContainer, $slides); break; case 'duplicate': [carouselItemWrapper, contentContainer] = this.duplicate(view, index, targetContainer, $slides); break; default: break; } if (undefined !== carouselItemWrapper) { carouselItemWrapper.appendChild(contentContainer); } this.shouldHideNavButtons(view, $slides); this.updateIndexValues($slides); const isSwiperActive = this.swiper && !this.swiper.destroyed, hasMultipleSlides = $slides.length > 1; if (!isSwiperActive && hasMultipleSlides) { await this.initSwiper(); } else if (isSwiperActive && !hasMultipleSlides) { this.swiper.destroy(true); } this.updateListeners(); } } updateListeners() { this.swiper.initialized = false; this.swiper.init(); } move(view, index, targetContainer, slides) { return [slides[index], targetContainer.view.$el[0]]; } duplicate(view, index, targetContainer, slides) { return [slides[index + 1], targetContainer.view.$el[0]]; } updateIndexValues($slides) { $slides.each((index, element) => { const newIndex = index + 1; element.setAttribute('data-slide', newIndex); }); } bindEvents() { super.bindEvents(); elementorFrontend.elements.$window.on('elementor/nested-container/atomic-repeater', this.linkContainer.bind(this)); } shouldHideNavButtons(view, $slides) { const widget = view[0], navButtons = widget.querySelectorAll('.elementor-swiper-button'), shouldHide = 1 === $slides.length, isHidden = navButtons[0]?.classList.contains('hide'); if (shouldHide !== isHidden) { navButtons.forEach(button => { button.classList.toggle('hide', shouldHide); }); } } } exports["default"] = NestedCarousel; /***/ }) }]); //# sourceMappingURL=nested-carousel.4d07ea83632034f2e72e.bundle.js.mapimport { Dialog, DialogHeader, DialogTitle, DialogContent, DialogActions, Button, } from '@elementor/ui'; import { __ } from '@wordpress/i18n'; import * as PropTypes from 'prop-types'; export function KitCustomizationDialog( { open, title, handleClose, handleSaveChanges, children, saveDisabled = false, } ) { return ( ); } KitCustomizationDialog.propTypes = { open: PropTypes.bool.isRequired, handleClose: PropTypes.func.isRequired, handleSaveChanges: PropTypes.func.isRequired, children: PropTypes.node.isRequired, title: PropTypes.string.isRequired, saveDisabled: PropTypes.bool, };