import{S as j,i as z,s as H,e as S,d as J,b as k,f as q,g as K,h as D,o as b,k as L,a as B,a6 as y,q as m,a7 as C,l as A,u as g,v as w,w as v,m as F,z as G,a8 as I,J as M,B as N,H as O,K as P,L as Q,E as R,D as U}from"./index.c156a17d.js";import{B as V}from"./Block.dfe8f898.js";import{B as W}from"./BlockTitle.58147fe7.js";import{S as X}from"./StatusTracker.f0d63e01.js";function E(n,e,t){const a=n.slice();return a[8]=e[t],a[10]=t,a}function Y(n){let e;return{c(){e=J(n[1])},m(t,a){k(t,e,a)},p(t,a){a&2&&K(e,t[1])},d(t){t&&D(e)}}}function T(n){let e,t=n[8]+"",a,s;return{c(){e=S("option"),a=J(t),e.__value=s=n[8],e.value=e.__value},m(i,c){k(i,e,c),q(e,a)},p(i,c){c&4&&t!==(t=i[8]+"")&&K(a,t),c&4&&s!==(s=i[8])&&(e.__value=s,e.value=e.__value)},d(i){i&&D(e)}}}function Z(n){let e,t,a,s,i,c,d;t=new W({props:{show_label:n[5],$$slots:{default:[Y]},$$scope:{ctx:n}}});let r=n[2],u=[];for(let l=0;l<r.length;l+=1)u[l]=T(E(n,r,l));return{c(){e=S("label"),b(t.$$.fragment),a=L(),s=S("select");for(let l=0;l<u.length;l+=1)u[l].c();B(s,"class","gr-box gr-input w-full disabled:cursor-not-allowed"),s.disabled=n[4],B(s,"style",n[3]),n[0]===void 0&&y(()=>n[6].call(s))},m(l,o){k(l,e,o),m(t,e,null),q(e,a),q(e,s);for(let h=0;h<u.length;h+=1)u[h].m(s,null);C(s,n[0]),i=!0,c||(d=A(s,"change",n[6]),c=!0)},p(l,[o]){const h={};if(o&32&&(h.show_label=l[5]),o&2050&&(h.$$scope={dirty:o,ctx:l}),t.$set(h),o&4){r=l[2];let _;for(_=0;_<r.length;_+=1){const f=E(l,r,_);u[_]?u[_].p(f,o):(u[_]=T(f),u[_].c(),u[_].m(s,null))}for(;_<u.length;_+=1)u[_].d(1);u.length=r.length}(!i||o&16)&&(s.disabled=l[4]),(!i||o&8)&&B(s,"style",l[3]),o&5&&C(s,l[0])},i(l){i||(g(t.$$.fragment,l),i=!0)},o(l){w(t.$$.fragment,l),i=!1},d(l){l&&D(e),v(t),F(u,l),c=!1,d()}}}function p(n,e,t){let{label:a}=e,{value:s=void 0}=e,{choices:i}=e,{style:c=""}=e,{disabled:d=!1}=e,{show_label:r}=e;const u=G();function l(){s=I(this),t(0,s),t(2,i)}return n.$$set=o=>{"label"in o&&t(1,a=o.label),"value"in o&&t(0,s=o.value),"choices"in o&&t(2,i=o.choices),"style"in o&&t(3,c=o.style),"disabled"in o&&t(4,d=o.disabled),"show_label"in o&&t(5,r=o.show_label)},n.$$.update=()=>{n.$$.dirty&1&&u("change",s)},[s,a,i,c,d,r,l]}class x extends j{constructor(e){super(),z(this,e,p,Z,H,{label:1,value:0,choices:2,style:3,disabled:4,show_label:5})}}function $(n){let e,t,a,s,i;const c=[n[6]];let d={};for(let l=0;l<c.length;l+=1)d=M(d,c[l]);e=new X({props:d});function r(l){n[9](l)}let u={style:n[2],choices:n[3],label:n[1],show_label:n[5],disabled:n[7]==="static"};return n[0]!==void 0&&(u.value=n[0]),a=new x({props:u}),N.push(()=>O(a,"value",r)),a.$on("change",n[10]),{c(){b(e.$$.fragment),t=L(),b(a.$$.fragment)},m(l,o){m(e,l,o),k(l,t,o),m(a,l,o),i=!0},p(l,o){const h=o&64?P(c,[Q(l[6])]):{};e.$set(h);const _={};o&4&&(_.style=l[2]),o&8&&(_.choices=l[3]),o&2&&(_.label=l[1]),o&32&&(_.show_label=l[5]),o&128&&(_.disabled=l[7]==="static"),!s&&o&1&&(s=!0,_.value=l[0],R(()=>s=!1)),a.$set(_)},i(l){i||(g(e.$$.fragment,l),g(a.$$.fragment,l),i=!0)},o(l){w(e.$$.fragment,l),w(a.$$.fragment,l),i=!1},d(l){v(e,l),l&&D(t),v(a,l)}}}function ee(n){let e,t;return e=new V({props:{form_position:n[4],$$slots:{default:[$]},$$scope:{ctx:n}}}),{c(){b(e.$$.fragment)},m(a,s){m(e,a,s),t=!0},p(a,[s]){const i={};s&16&&(i.form_position=a[4]),s&2287&&(i.$$scope={dirty:s,ctx:a}),e.$set(i)},i(a){t||(g(e.$$.fragment,a),t=!0)},o(a){w(e.$$.fragment,a),t=!1},d(a){v(e,a)}}}function le(n,e,t){let{label:a="Dropdown"}=e,{value:s=""}=e,{default_value:i=""}=e,{style:c=""}=e,{choices:d}=e,{form_position:r="single"}=e,{show_label:u}=e,{loading_status:l}=e,{mode:o}=e;i&&(s=i);function h(f){s=f,t(0,s)}function _(f){U.call(this,n,f)}return n.$$set=f=>{"label"in f&&t(1,a=f.label),"value"in f&&t(0,s=f.value),"default_value"in f&&t(8,i=f.default_value),"style"in f&&t(2,c=f.style),"choices"in f&&t(3,d=f.choices),"form_position"in f&&t(4,r=f.form_position),"show_label"in f&&t(5,u=f.show_label),"loading_status"in f&&t(6,l=f.loading_status),"mode"in f&&t(7,o=f.mode)},[s,a,c,d,r,u,l,o,i,h,_]}class te extends j{constructor(e){super(),z(this,e,le,ee,H,{label:1,value:0,default_value:8,style:2,choices:3,form_position:4,show_label:5,loading_status:6,mode:7})}}var ie=te;const fe=["static","dynamic"];export{ie as Component,fe as modes};
