import{l as E,m as K,s as S,V as G,q as d,z as h,G as g,H as v,K as w,Z as H,$ as J,a8 as V,ae as Y,o as T,x as D,a1 as Z,a2 as F,af as I,J as q,a5 as k,aw as L,n as z,v as N,y as B,ay as C,A as y,aK as j,ad as M,Y as O,t as P,D as Q,az as R}from"./index.881b9b68.js";function U(l){let e;return{c(){e=P(l[2])},m(t,a){D(t,e,a)},p(t,a){a&4&&Q(e,t[2])},d(t){t&&q(e)}}}function W(l){let e,t,a,s,u,_,b;return t=new L({props:{show_label:l[3],$$slots:{default:[U]},$$scope:{ctx:l}}}),{c(){e=z("label"),d(t.$$.fragment),a=T(),s=z("input"),N(s,"type","number"),N(s,"class","gr-box gr-input w-full gr-text-input"),s.disabled=l[1],N(e,"class","block")},m(r,o){D(r,e,o),h(t,e,null),B(e,a),B(e,s),C(s,l[0]),u=!0,_||(b=[y(s,"input",l[6]),y(s,"keypress",l[4]),y(s,"blur",l[5])],_=!0)},p(r,[o]){const n={};o&8&&(n.show_label=r[3]),o&516&&(n.$$scope={dirty:o,ctx:r}),t.$set(n),(!u||o&2)&&(s.disabled=r[1]),o&1&&j(s.value)!==r[0]&&C(s,r[0])},i(r){u||(g(t.$$.fragment,r),u=!0)},o(r){v(t.$$.fragment,r),u=!1},d(r){r&&q(e),w(t),_=!1,M(b)}}}function X(l,e,t){let{value:a=0}=e,{disabled:s=!1}=e,{label:u}=e,{show_label:_}=e;const b=O();function r(f){!isNaN(f)&&f!==null&&b("change",f)}async function o(f){await R(),f.key==="Enter"&&(f.preventDefault(),b("submit"))}function n(f){b("blur")}function c(){a=j(this.value),t(0,a)}return l.$$set=f=>{"value"in f&&t(0,a=f.value),"disabled"in f&&t(1,s=f.disabled),"label"in f&&t(2,u=f.label),"show_label"in f&&t(3,_=f.show_label)},l.$$.update=()=>{l.$$.dirty&1&&r(a)},[a,s,u,_,o,n,c]}class p extends E{constructor(e){super(),K(this,e,X,W,S,{value:0,disabled:1,label:2,show_label:3})}}function x(l){let e,t,a,s,u;const _=[l[6]];let b={};for(let n=0;n<_.length;n+=1)b=H(b,_[n]);e=new J({props:b});function r(n){l[8](n)}let o={label:l[1],show_label:l[5],disabled:l[7]==="static"};return l[0]!==void 0&&(o.value=l[0]),a=new p({props:o}),V.push(()=>Y(a,"value",r)),a.$on("change",l[9]),a.$on("submit",l[10]),a.$on("blur",l[11]),{c(){d(e.$$.fragment),t=T(),d(a.$$.fragment)},m(n,c){h(e,n,c),D(n,t,c),h(a,n,c),u=!0},p(n,c){const f=c&64?Z(_,[F(n[6])]):{};e.$set(f);const m={};c&2&&(m.label=n[1]),c&32&&(m.show_label=n[5]),c&128&&(m.disabled=n[7]==="static"),!s&&c&1&&(s=!0,m.value=n[0],I(()=>s=!1)),a.$set(m)},i(n){u||(g(e.$$.fragment,n),g(a.$$.fragment,n),u=!0)},o(n){v(e.$$.fragment,n),v(a.$$.fragment,n),u=!1},d(n){w(e,n),n&&q(t),w(a,n)}}}function $(l){let e,t;return e=new G({props:{visible:l[3],elem_id:l[2],disable:typeof l[4].container=="boolean"&&!l[4].container,$$slots:{default:[x]},$$scope:{ctx:l}}}),{c(){d(e.$$.fragment)},m(a,s){h(e,a,s),t=!0},p(a,[s]){const u={};s&8&&(u.visible=a[3]),s&4&&(u.elem_id=a[2]),s&16&&(u.disable=typeof a[4].container=="boolean"&&!a[4].container),s&4323&&(u.$$scope={dirty:s,ctx:a}),e.$set(u)},i(a){t||(g(e.$$.fragment,a),t=!0)},o(a){v(e.$$.fragment,a),t=!1},d(a){w(e,a)}}}function ee(l,e,t){let{label:a="Number"}=e,{elem_id:s=""}=e,{visible:u=!0}=e,{style:_={}}=e,{value:b=0}=e,{show_label:r}=e,{loading_status:o}=e,{mode:n}=e;function c(i){b=i,t(0,b)}function f(i){k.call(this,l,i)}function m(i){k.call(this,l,i)}function A(i){k.call(this,l,i)}return l.$$set=i=>{"label"in i&&t(1,a=i.label),"elem_id"in i&&t(2,s=i.elem_id),"visible"in i&&t(3,u=i.visible),"style"in i&&t(4,_=i.style),"value"in i&&t(0,b=i.value),"show_label"in i&&t(5,r=i.show_label),"loading_status"in i&&t(6,o=i.loading_status),"mode"in i&&t(7,n=i.mode)},[b,a,s,u,_,r,o,n,c,f,m,A]}class ae extends E{constructor(e){super(),K(this,e,ee,$,S,{label:1,elem_id:2,visible:3,style:4,value:0,show_label:5,loading_status:6,mode:7})}}var te=ae;const ne=["static","dynamic"],se=l=>{var e;return{type:"number",description:"numeric value",example_data:(e=l.value)!=null?e:1}};export{te as Component,se as document,ne as modes};
