vendor: 4,152 bytes, line 1
1import{p as P,u as Q}from"./index-b2d8d4c2.js";import{a as R}from"./SelectSource.svelte_svelte_type_style_lang-a1c177eb.js";import"./svelte/svelte.js";import"./Index-25fb47ed.js";const{SvelteComponent:T,attr:h,binding_callbacks:V,create_component:X,create_slot:Y,destroy_component:Z,detach:A,element:G,flush:g,get_all_dirty_from_scope:x,get_slot_changes:$,init:p,insert:D,listen:N,mount_component:ee,run_all:te,safe_not_equal:ie,space:H,src_url_equal:W,transition_in:J,transition_out:K,update_slot_base:le}=window.__gradio__svelte__internal,{tick:ne,createEventDispatcher:se,getContext:ae}=window.__gradio__svelte__internal;function F(l){let e,t,i;return{c(){e=G("img"),h(e,"class","button-icon svelte-1rvxzzt"),W(e.src,t=l[7].url)||h(e,"src",t),h(e,"alt",i=`${l[0]} icon`)},m(n,s){D(n,e,s)},p(n,s){s&128&&!W(e.src,t=n[7].url)&&h(e,"src",t),s&1&&i!==(i=`${n[0]} icon`)&&h(e,"alt",i)},d(n){n&&A(e)}}}function ue(l){let e,t,i=l[7]&&F(l);const n=l[18].default,s=Y(n,l,l[20],null);return{c(){i&&i.c(),e=H(),s&&s.c()},m(f,o){i&&i.m(f,o),D(f,e,o),s&&s.m(f,o),t=!0},p(f,o){f[7]?i?i.p(f,o):(i=F(f),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),s&&s.p&&(!t||o&1048576)&&le(s,n,f,f[20],t?$(n,f[20],o,null):x(f[20]),null)},i(f){t||(J(s,f),t=!0)},o(f){K(s,f),t=!1},d(f){f&&A(e),i&&i.d(f),s&&s.d(f)}}}function _e(l){let e,t,i,n,s,f,o,r,b,v;return o=new R({props:{size:l[6],variant:l[10],elem_id:l[1],elem_classes:l[2],visible:l[3],scale:l[8],min_width:l[9],disabled:l[11],$$slots:{default:[ue]},$$scope:{ctx:l}}}),o.$on("click",l[14]),{c(){e=G("input"),f=H(),X(o.$$.fragment),h(e,"class","hide svelte-1rvxzzt"),h(e,"accept",l[13]),h(e,"type","file"),e.multiple=t=l[5]==="multiple"||void 0,h(e,"webkitdirectory",i=l[5]==="directory"||void 0),h(e,"mozdirectory",n=l[5]==="directory"||void 0),h(e,"data-testid",s=l[4]+"-upload-button")},m(_,c){D(_,e,c),l[19](e),D(_,f,c),ee(o,_,c),r=!0,b||(v=[N(e,"change",l[15]),N(e,"click",fe)],b=!0)},p(_,[c]){(!r||c&8192)&&h(e,"accept",_[13]),(!r||c&32&&t!==(t=_[5]==="multiple"||void 0))&&(e.multiple=t),(!r||c&32&&i!==(i=_[5]==="directory"||void 0))&&h(e,"webkitdirectory",i),(!r||c&32&&n!==(n=_[5]==="directory"||void 0))&&h(e,"mozdirectory",n),(!r||c&16&&s!==(s=_[4]+"-upload-button"))&&h(e,"data-testid",s);const m={};c&64&&(m.size=_[6]),c&1024&&(m.variant=_[10]),c&2&&(m.elem_id=_[1]),c&4&&(m.elem_classes=_[2]),c&8&&(m.visible=_[3]),c&256&&(m.scale=_[8]),c&512&&(m.min_width=_[9]),c&2048&&(m.disabled=_[11]),c&1048705&&(m.$$scope={dirty:c,ctx:_}),o.$set(m)},i(_){r||(J(o.$$.fragment,_),r=!0)},o(_){K(o.$$.fragment,_),r=!1},d(_){_&&(A(e),A(f)),l[19](null),Z(o,_),b=!1,te(v)}}}function fe(l){const e=l.target;e.value&&(e.value="")}function ce(l,e,t){let{$$slots:i={},$$scope:n}=e,{elem_id:s=""}=e,{elem_classes:f=[]}=e,{visible:o=!0}=e,{label:r}=e,{value:b}=e,{file_count:v}=e,{file_types:_=[]}=e,{root:c}=e,{size:m="lg"}=e,{icon:B=null}=e,{scale:q=null}=e,{min_width:C=void 0}=e,{variant:w="secondary"}=e,{disabled:k=!1}=e;const z=se(),E=ae("upload_files");let y,U;_==null?U=null:(_=_.map(a=>a.startsWith(".")?a:a+"/*"),U=_.join(", "));function u(){z("click"),y.click()}async function I(a){let S=Array.from(a);if(!a.length)return;v==="single"&&(S=[a[0]]);let j=await P(S);await ne(),j=(await Q(j,c,void 0,E))?.filter(O=>O!==null),t(0,b=v==="single"?j?.[0]:j),z("change",b),z("upload",b)}async function L(a){const S=a.target;S.files&&await I(S.files)}function M(a){V[a?"unshift":"push"](()=>{y=a,t(12,y)})}return l.$$set=a=>{"elem_id"in a&&t(1,s=a.elem_id),"elem_classes"in a&&t(2,f=a.elem_classes),"visible"in a&&t(3,o=a.visible),"label"in a&&t(4,r=a.label),"value"in a&&t(0,b=a.value),"file_count"in a&&t(5,v=a.file_count),"file_types"in a&&t(16,_=a.file_types),"root"in a&&t(17,c=a.root),"size"in a&&t(6,m=a.size),"icon"in a&&t(7,B=a.icon),"scale"in a&&t(8,q=a.scale),"min_width"in a&&t(9,C=a.min_width),"variant"in a&&t(10,w=a.variant),"disabled"in a&&t(11,k=a.disabled),"$$scope"in a&&t(20,n=a.$$scope)},[b,s,f,o,r,v,m,B,q,C,w,k,y,U,u,L,_,c,i,M,n]}class oe extends T{constructor(e){super(),p(this,e,ce,_e,ie,{elem_id:1,elem_classes:2,visible:3,label:4,value:0,file_count:5,file_types:16,root:17,size:6,icon:7,scale:8,min_
1width:9,variant:10,disabled:11})}get elem_id(){return this.$$.ctx[1]}set elem_id(e){this.$$set({elem_id:e}),g()}get elem_classes(){return this.$$.ctx[2]}set elem_classes(e){this.$$set({elem_classes:e}),g()}get visible(){return this.$$.ctx[3]}set visible(e){this.$$set({visible:e}),g()}get label(){return this.$$.ctx[4]}set label(e){this.$$set({label:e}),g()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),g()}get file_count(){return this.$$.ctx[5]}set file_count(e){this.$$set({file_count:e}),g()}get file_types(){return this.$$.ctx[16]}set file_types(e){this.$$set({file_types:e}),g()}get root(){return this.$$.ctx[17]}set root(e){this.$$set({root:e}),g()}get size(){return this.$$.ctx[6]}set size(e){this.$$set({size:e}),g()}get icon(){return this.$$.ctx[7]}set icon(e){this.$$set({icon:e}),g()}get scale(){return this.$$.ctx[8]}set scale(e){this.$$set({scale:e}),g()}get min_width(){return this.$$.ctx[9]}set min_width(e){this.$$set({min_width:e}),g()}get variant(){return this.$$.ctx[10]}set variant(e){this.$$set({variant:e}),g()}get disabled(){return this.$$.ctx[11]}set disabled(e){this.$$set({disabled:e}),g()}}const re=oe,{SvelteComponent:me,create_component:de,destroy_component:he,detach:ge,flush:d,init:be,insert:ve,mount_component:we,safe_not_equal:ze,set_data:ke,text:ye,transition_in:Be,transition_out:qe}=window.__gradio__svelte__internal;function Ce(l){let e=(l[4]?l[13].i18n(l[4]):"")+"",t;return{c(){t=ye(e)},m(i,n){ve(i,t,n)},p(i,n){n&8208&&e!==(e=(i[4]?i[13].i18n(i[4]):"")+"")&&ke(t,e)},d(i){i&&ge(t)}}}function Ue(l){let e,t;return e=new re({props:{elem_id:l[1],elem_classes:l[2],visible:l[3],file_count:l[5],file_types:l[6],size:l[8],scale:l[9],icon:l[10],min_width:l[11],root:l[7],value:l[0],disabled:l[14],variant:l[12],label:l[4],$$slots:{default:[Ce]},$$scope:{ctx:l}}}),e.$on("click",l[17]),e.$on("change",l[18]),e.$on("upload",l[19]),{c(){de(e.$$.fragment)},m(i,n){we(e,i,n),t=!0},p(i,[n]){const s={};n&2&&(s.elem_id=i[1]),n&4&&(s.elem_classes=i[2]),n&8&&(s.visible=i[3]),n&32&&(s.file_count=i[5]),n&64&&(s.file_types=i[6]),n&256&&(s.size=i[8]),n&512&&(s.scale=i[9]),n&1024&&(s.icon=i[10]),n&2048&&(s.min_width=i[11]),n&128&&(s.root=i[7]),n&1&&(s.value=i[0]),n&16384&&(s.disabled=i[14]),n&4096&&(s.variant=i[12]),n&16&&(s.label=i[4]),n&1056784&&(s.$$scope={dirty:n,ctx:i}),e.$set(s)},i(i){t||(Be(e.$$.fragment,i),t=!0)},o(i){qe(e.$$.fragment,i),t=!1},d(i){he(e,i)}}}function Se(l,e,t){let i,{elem_id:n=""}=e,{elem_classes:s=[]}=e,{visible:f=!0}=e,{label:o}=e,{value:r}=e,{file_count:b}=e,{file_types:v=[]}=e,{root:_}=e,{size:c="lg"}=e,{scale:m=null}=e,{icon:B=null}=e,{min_width:q=void 0}=e,{variant:C="secondary"}=e,{gradio:w}=e,{interactive:k}=e;async function z(u,I){t(0,r=u),w.dispatch(I)}const E=()=>w.dispatch("click"),y=({detail:u})=>z(u,"change"),U=({detail:u})=>z(u,"upload");return l.$$set=u=>{"elem_id"in u&&t(1,n=u.elem_id),"elem_classes"in u&&t(2,s=u.elem_classes),"visible"in u&&t(3,f=u.visible),"label"in u&&t(4,o=u.label),"value"in u&&t(0,r=u.value),"file_count"in u&&t(5,b=u.file_count),"file_types"in u&&t(6,v=u.file_types),"root"in u&&t(7,_=u.root),"size"in u&&t(8,c=u.size),"scale"in u&&t(9,m=u.scale),"icon"in u&&t(10,B=u.icon),"min_width"in u&&t(11,q=u.min_width),"variant"in u&&t(12,C=u.variant),"gradio"in u&&t(13,w=u.gradio),"interactive"in u&&t(16,k=u.interactive)},l.$$.update=()=>{l.$$.dirty&65536&&t(14,i=!k)},[r,n,s,f,o,b,v,_,c,m,B,q,C,w,i,z,k,E,y,U]}class Ie extends me{constructor(e){super(),be(this,e,Se,Ue,ze,{elem_id:1,elem_classes:2,visible:3,label:4,value:0,file_count:5,file_types:6,root:7,size:8,scale:9,icon:10,min_width:11,variant:12,gradio:13,interactive:16})}get elem_id(){return this.$$.ctx[1]}set elem_id(e){this.$$set({elem_id:e}),d()}get elem_classes(){return this.$$.ctx[2]}set elem_classes(e){this.$$set({elem_classes:e}),d()}get visible(){return this.$$.ctx[3]}set visible(e){this.$$set({visible:e}),d()}get label(){return this.$$.ctx[4]}set label(e){this.$$set({label:e}),d()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),d()}get file_count(){return this.$$.ctx[5]}set file_count(e){this.$$set({file_count:e}),d()}get file_types(){return this.$$.ctx[6]}set file_types(e){this.$$set({file_types:e}),d()}get root(){return this.$$.ctx[7]}set root(e){this.$$set({root:e}),d()}get size(){return this.$$.ctx[8]}set size(e){this.$$set({size:e}),d()}get scale(){return this.$$.ctx[9]}set scale(e){this.$$set({scale:e}),d()}get icon(){return this.$$.ctx[10]}set icon(e){this.$$set({icon:e}),d()}get min_width(){return this.$$.ctx[11]}set min_width(e){this.$$set({min_width:e}),d()}get variant(){return this.$$.ctx[12]}set variant(e){this.$$set({variant:e}),d()}get gradio(){return this.$$.ctx[13]}set gradio(e){this.$$set({gradio:e}),d()}get interactive(){return this.$$.ctx[16]}set interactive(e){this.$$set({interactive:e}),d()}}export{re as BaseUploadButton,Ie as default}; 2//# sourceMappingURL=Index-ed71ae03.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.