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