import{k as z,l as B,s as E,J as F,m as y,n as w,q as m,v as q,w as k,x as p,ay as G,K as I,M as J,N as K,D as U,F as V,G as g,U as Z,V as j,am as H,Z as A,aN as L,ao as O,an as P,t as M,z as Q,A as S}from"./index.e0fbc3e4.js";function C(a,e,s){const t=a.slice();return t[11]=e[s],t}function R(a){let e,s=a[11].name+"",t,f,o,n;function i(){return a[9](a[11])}return{c(){e=y("button"),t=M(s),f=w(),m(e,"class","px-4 pb-2 pt-1.5 border-transparent text-gray-400 hover:text-gray-700 -mb-[2px] border-2 border-b-0")},m(d,u){k(d,e,u),p(e,t),p(e,f),o||(n=Q(e,"click",i),o=!0)},p(d,u){a=d,u&4&&s!==(s=a[11].name+"")&&S(t,s)},d(d){d&&g(e),o=!1,n()}}}function W(a){let e,s=a[11].name+"",t,f;return{c(){e=y("button"),t=M(s),f=w(),m(e,"class","bg-white px-4 pb-2 pt-1.5 rounded-t-lg border-gray-200 -mb-[2px] border-2 border-b-0")},m(o,n){k(o,e,n),p(e,t),p(e,f)},p(o,n){n&4&&s!==(s=o[11].name+"")&&S(t,s)},d(o){o&&g(e)}}}function D(a,e){let s,t;function f(i,d){return i[11].id===i[3]?W:R}let o=f(e),n=o(e);return{key:a,first:null,c(){s=A(),n.c(),t=A(),this.first=s},m(i,d){k(i,s,d),n.m(i,d),k(i,t,d)},p(i,d){e=i,o===(o=f(e))&&n?n.p(e,d):(n.d(1),n=o(e),n&&(n.c(),n.m(t.parentNode,t)))},d(i){i&&g(s),n.d(i),i&&g(t)}}}function X(a){let e,s,t=[],f=new Map,o,n,i=a[2];const d=l=>l[11].id;for(let l=0;l<i.length;l+=1){let c=C(a,i,l),b=d(c);f.set(b,t[l]=D(b,c))}const u=a[8].default,_=F(u,a,a[7],null);return{c(){e=y("div"),s=y("div");for(let l=0;l<t.length;l+=1)t[l].c();o=w(),_&&_.c(),m(s,"class","flex border-b-2 flex-wrap dark:border-gray-700"),m(e,"class","tabs flex flex-col my-4"),m(e,"id",a[1]),q(e,"hidden",!a[0])},m(l,c){k(l,e,c),p(e,s);for(let b=0;b<t.length;b+=1)t[b].m(s,null);p(e,o),_&&_.m(e,null),n=!0},p(l,[c]){c&44&&(i=l[2],t=G(t,c,d,1,l,i,f,s,L,D,null,C)),_&&_.p&&(!n||c&128)&&I(_,u,l,l[7],n?K(u,l[7],c,null):J(l[7]),null),(!n||c&2)&&m(e,"id",l[1]),c&1&&q(e,"hidden",!l[0])},i(l){n||(U(_,l),n=!0)},o(l){V(_,l),n=!1},d(l){l&&g(e);for(let c=0;c<t.length;c+=1)t[c].d();_&&_.d(l)}}}const Y={};function x(a,e,s){let t,{$$slots:f={},$$scope:o}=e,{visible:n=!0}=e,{elem_id:i}=e,{selected:d}=e,u=[];const _=O(!1);Z(a,_,r=>s(3,t=r));const l=j();H(Y,{register_tab:r=>{u.push({name:r.name,id:r.id}),_.update(h=>h!=null?h:r.id),s(2,u)},unregister_tab:r=>{const h=u.findIndex(v=>v.id===r.id);u.splice(h,1),_.update(v=>{var N,T;return v===r.id?((N=u[h])==null?void 0:N.id)||((T=u[u.length-1])==null?void 0:T.id):v})},selected_tab:_});function c(r){P(_,t=r,t),l("change")}const b=r=>c(r.id);return a.$$set=r=>{"visible"in r&&s(0,n=r.visible),"elem_id"in r&&s(1,i=r.elem_id),"selected"in r&&s(6,d=r.selected),"$$scope"in r&&s(7,o=r.$$scope)},a.$$.update=()=>{a.$$.dirty&64&&d!==null&&c(d)},[n,i,u,t,_,c,d,o,f,b]}class ee extends z{constructor(e){super(),B(this,e,x,X,E,{visible:0,elem_id:1,selected:6})}}export{ee as T,Y as a};
