mirror of
https://github.com/Ladebeze66/projetcbaollm.git
synced 2025-12-18 19:47:50 +01:00
3 lines
11 KiB
JavaScript
3 lines
11 KiB
JavaScript
import{B as ke}from"./Block-DZqtZLFP.js";import"./MarkdownCode.svelte_svelte_type_style_lang-3tofWDHK.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-BOpxTcdu.js";import{B as ve}from"./BlockLabel-DqHge3FF.js";import{E as pe}from"./Empty-CxRQfWXb.js";import{I as ne,F as Be}from"./FullscreenButton-CqFNG1Hv.js";import{I as Ie}from"./IconButtonWrapper-Cg16aIPK.js";import{S as Me}from"./index-B1gfMDT9.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import"./index-C7PS0jJm.js";import{r as Y}from"./file-url-DgijyRSD.js";/* empty css */import"./prism-python-qapVsvY8.js";import"./IconButton-B-aAVSzy.js";import"./Minimize-OAHZO2Ge.js";import"./Clear-By3xiIwg.js";import"./svelte/svelte.js";import"./context-TgWPFwN2.js";const{SvelteComponent:Se,append:L,assign:qe,attr:k,binding_callbacks:ze,check_outros:ie,create_component:q,destroy_component:z,destroy_each:se,detach:B,element:j,empty:ae,ensure_array_like:A,flush:w,get_spread_object:Ee,get_spread_update:Fe,group_outros:oe,init:Ne,insert:I,listen:C,mount_component:E,run_all:Pe,safe_not_equal:je,set_data:Ce,set_style:Z,space:P,src_url_equal:D,text:Le,toggle_class:S,transition_in:v,transition_out:p}=window.__gradio__svelte__internal;function $(t,e,n){const l=t.slice();return l[32]=e[n],l[34]=n,l}function y(t,e,n){const l=t.slice();return l[32]=e[n],l[34]=n,l}function We(t){let e,n,l,i,s,a,c,b,g;n=new Ie({props:{$$slots:{default:[De]},$$scope:{ctx:t}}});let h=A(t[15]?t[15]?.annotations:[]),f=[];for(let u=0;u<h.length;u+=1)f[u]=ee(y(t,h,u));let _=t[6]&&t[15]&&le(t);return{c(){e=j("div"),q(n.$$.fragment),l=P(),i=j("img"),a=P();for(let u=0;u<f.length;u+=1)f[u].c();c=P(),_&&_.c(),b=ae(),k(i,"class","base-image svelte-303fln"),D(i.src,s=t[15]?t[15].image.url:null)||k(i,"src",s),k(i,"alt","the base file that is annotated"),S(i,"fit-height",t[7]&&!t[18]),k(e,"class","image-container svelte-303fln")},m(u,r){I(u,e,r),E(n,e,null),L(e,l),L(e,i),L(e,a);for(let m=0;m<f.length;m+=1)f[m]&&f[m].m(e,null);t[26](e),I(u,c,r),_&&_.m(u,r),I(u,b,r),g=!0},p(u,r){const m={};if(r[0]&409600|r[1]&32&&(m.$$scope={dirty:r,ctx:u}),n.$set(m),(!g||r[0]&32768&&!D(i.src,s=u[15]?u[15].image.url:null))&&k(i,"src",s),(!g||r[0]&262272)&&S(i,"fit-height",u[7]&&!u[18]),r[0]&360976){h=A(u[15]?u[15]?.annotations:[]);let d;for(d=0;d<h.length;d+=1){const M=y(u,h,d);f[d]?f[d].p(M,r):(f[d]=ee(M),f[d].c(),f[d].m(e,null))}for(;d<f.length;d+=1)f[d].d(1);f.length=h.length}u[6]&&u[15]?_?_.p(u,r):(_=le(u),_.c(),_.m(b.parentNode,b)):_&&(_.d(1),_=null)},i(u){g||(v(n.$$.fragment,u),g=!0)},o(u){p(n.$$.fragment,u),g=!1},d(u){u&&(B(e),B(c),B(b)),z(n),se(f,u),t[26](null),_&&_.d(u)}}}function Ae(t){let e,n;return e=new pe({props:{size:"large",unpadded_box:!0,$$slots:{default:[Ge]},$$scope:{ctx:t}}}),{c(){q(e.$$.fragment)},m(l,i){E(e,l,i),n=!0},p(l,i){const s={};i[1]&32&&(s.$$scope={dirty:i,ctx:l}),e.$set(s)},i(l){n||(v(e.$$.fragment,l),n=!0)},o(l){p(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function x(t){let e,n;return e=new Be({props:{container:t[17]}}),e.$on("fullscreenchange",t[25]),{c(){q(e.$$.fragment)},m(l,i){E(e,l,i),n=!0},p(l,i){const s={};i[0]&131072&&(s.container=l[17]),e.$set(s)},i(l){n||(v(e.$$.fragment,l),n=!0)},o(l){p(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function De(t){let e,n,l=t[14]&&x(t);return{c(){l&&l.c(),e=ae()},m(i,s){l&&l.m(i,s),I(i,e,s),n=!0},p(i,s){i[14]?l?(l.p(i,s),s[0]&16384&&v(l,1)):(l=x(i),l.c(),v(l,1),l.m(e.parentNode,e)):l&&(oe(),p(l,1,1,()=>{l=null}),ie())},i(i){n||(v(l),n=!0)},o(i){p(l),n=!1},d(i){i&&B(e),l&&l.d(i)}}}function ee(t){let e,n,l,i;return{c(){e=j("img"),k(e,"alt",n="segmentation mask identifying "+t[4]+" within the uploaded file"),k(e,"class","mask fit-height svelte-303fln"),D(e.src,l=t[32].image.url)||k(e,"src",l),k(e,"style",i=t[9]&&t[32].label in t[9]?null:`filter: hue-rotate(${Math.round(t[34]*360/t[15]?.annotations.length)}deg);`),S(e,"fit-height",!t[18]),S(e,"active",t[16]==t[32].label),S(e,"inactive",t[16]!=t[32].label&&t[16]!=null)},m(s,a){I(s,e,a)},p(s,a){a[0]&16&&n!==(n="segmentation mask identifying "+s[4]+" within the uploaded file")&&k(e,"alt",n),a[0]&32768&&!D(e.src,l=s[32].image.url)&&k(e,"src",l),a[0]&33280&&i!==(i=s[9]&&s[32].label in s[9]?null:`filter: hue-rotate(${Math.round(s[34]*360/s[15]?.annotations.length)}deg);`)&&k(e,"style",i),a[0]&262144&&S(e,"fit-height",!s[18]),a[0]&98304&&S(e,"active",s[16]==s[32].label),a[0]&98304&&S(e,"inactive",s[16]!=s[32].label&&s[16]!=null)},d(s){s&&B(e)}}}function le(t){let e,n=A(t[15].annotations),l=[];for(let i=0;i<n.length;i+=1)l[i]=te($(t,n,i));return{c(){e=j("div");for(let i=0;i<l.length;i+=1)l[i].c();k(e,"class","legend svelte-303fln")},m(i,s){I(i,e,s);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null)},p(i,s){if(s[0]&3703296){n=A(i[15].annotations);let a;for(a=0;a<n.length;a+=1){const c=$(i,n,a);l[a]?l[a].p(c,s):(l[a]=te(c),l[a].c(),l[a].m(e,null))}for(;a<l.length;a+=1)l[a].d(1);l.length=n.length}},d(i){i&&B(e),se(l,i)}}}function te(t){let e,n=t[32].label+"",l,i,s,a;function c(){return t[27](t[32])}function b(){return t[28](t[32])}function g(){return t[31](t[34],t[32])}return{c(){e=j("button"),l=Le(n),i=P(),k(e,"class","legend-item svelte-303fln"),Z(e,"background-color",t[9]&&t[32].label in t[9]?t[9][t[32].label]+"88":`hsla(${Math.round(t[34]*360/t[15].annotations.length)}, 100%, 50%, 0.3)`)},m(h,f){I(h,e,f),L(e,l),L(e,i),s||(a=[C(e,"mouseover",c),C(e,"focus",b),C(e,"mouseout",t[29]),C(e,"blur",t[30]),C(e,"click",g)],s=!0)},p(h,f){t=h,f[0]&32768&&n!==(n=t[32].label+"")&&Ce(l,n),f[0]&33280&&Z(e,"background-color",t[9]&&t[32].label in t[9]?t[9][t[32].label]+"88":`hsla(${Math.round(t[34]*360/t[15].annotations.length)}, 100%, 50%, 0.3)`)},d(h){h&&B(e),s=!1,Pe(a)}}}function Ge(t){let e,n;return e=new ne({}),{c(){q(e.$$.fragment)},m(l,i){E(e,l,i),n=!0},i(l){n||(v(e.$$.fragment,l),n=!0)},o(l){p(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function He(t){let e,n,l,i,s,a,c,b;const g=[{autoscroll:t[3].autoscroll},{i18n:t[3].i18n},t[13]];let h={};for(let r=0;r<g.length;r+=1)h=qe(h,g[r]);e=new Me({props:h}),l=new ve({props:{show_label:t[5],Icon:ne,label:t[4]||t[3].i18n("image.image")}});const f=[Ae,We],_=[];function u(r,m){return r[15]==null?0:1}return a=u(t),c=_[a]=f[a](t),{c(){q(e.$$.fragment),n=P(),q(l.$$.fragment),i=P(),s=j("div"),c.c(),k(s,"class","container svelte-303fln")},m(r,m){E(e,r,m),I(r,n,m),E(l,r,m),I(r,i,m),I(r,s,m),_[a].m(s,null),b=!0},p(r,m){const d=m[0]&8200?Fe(g,[m[0]&8&&{autoscroll:r[3].autoscroll},m[0]&8&&{i18n:r[3].i18n},m[0]&8192&&Ee(r[13])]):{};e.$set(d);const M={};m[0]&32&&(M.show_label=r[5]),m[0]&24&&(M.label=r[4]||r[3].i18n("image.image")),l.$set(M);let F=a;a=u(r),a===F?_[a].p(r,m):(oe(),p(_[F],1,1,()=>{_[F]=null}),ie(),c=_[a],c?c.p(r,m):(c=_[a]=f[a](r),c.c()),v(c,1),c.m(s,null))},i(r){b||(v(e.$$.fragment,r),v(l.$$.fragment,r),v(c),b=!0)},o(r){p(e.$$.fragment,r),p(l.$$.fragment,r),p(c),b=!1},d(r){r&&(B(n),B(i),B(s)),z(e,r),z(l,r),_[a].d()}}}function Je(t){let e,n;return e=new ke({props:{visible:t[2],elem_id:t[0],elem_classes:t[1],padding:!1,height:t[7],width:t[8],allow_overflow:!1,container:t[10],scale:t[11],min_width:t[12],$$slots:{default:[He]},$$scope:{ctx:t}}}),{c(){q(e.$$.fragment)},m(l,i){E(e,l,i),n=!0},p(l,i){const s={};i[0]&4&&(s.visible=l[2]),i[0]&1&&(s.elem_id=l[0]),i[0]&2&&(s.elem_classes=l[1]),i[0]&128&&(s.height=l[7]),i[0]&256&&(s.width=l[8]),i[0]&1024&&(s.container=l[10]),i[0]&2048&&(s.scale=l[11]),i[0]&4096&&(s.min_width=l[12]),i[0]&516856|i[1]&32&&(s.$$scope={dirty:i,ctx:l}),e.$set(s)},i(l){n||(v(e.$$.fragment,l),n=!0)},o(l){p(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function Ke(t,e,n){let{elem_id:l=""}=e,{elem_classes:i=[]}=e,{visible:s=!0}=e,{value:a=null}=e,c=null,b=null,{gradio:g}=e,{label:h=g.i18n("annotated_image.annotated_image")}=e,{show_label:f=!0}=e,{show_legend:_=!0}=e,{height:u}=e,{width:r}=e,{color_map:m}=e,{container:d=!0}=e,{scale:M=null}=e,{min_width:F=void 0}=e,G=null,{loading_status:R}=e,{show_fullscreen_button:T=!0}=e,H,U=!1,J=null;function K(o){n(16,G=o)}function O(){n(16,G=null)}function V(o,W){g.dispatch("select",{value:h,index:o})}const re=o=>n(18,U=o.detail);function ue(o){ze[o?"unshift":"push"](()=>{H=o,n(17,H)})}const fe=o=>K(o.label),_e=o=>K(o.label),me=()=>O(),ce=()=>O(),he=(o,W)=>V(o,W.label);return t.$$set=o=>{"elem_id"in o&&n(0,l=o.elem_id),"elem_classes"in o&&n(1,i=o.elem_classes),"visible"in o&&n(2,s=o.visible),"value"in o&&n(22,a=o.value),"gradio"in o&&n(3,g=o.gradio),"label"in o&&n(4,h=o.label),"show_label"in o&&n(5,f=o.show_label),"show_legend"in o&&n(6,_=o.show_legend),"height"in o&&n(7,u=o.height),"width"in o&&n(8,r=o.width),"color_map"in o&&n(9,m=o.color_map),"container"in o&&n(10,d=o.container),"scale"in o&&n(11,M=o.scale),"min_width"in o&&n(12,F=o.min_width),"loading_status"in o&&n(13,R=o.loading_status),"show_fullscreen_button"in o&&n(14,T=o.show_fullscreen_button)},t.$$.update=()=>{if(t.$$.dirty[0]&29360136)if(a!==c&&(n(23,c=a),g.dispatch("change")),a){const o={image:a.image,annotations:a.annotations.map(N=>({image:N.image,label:N.label}))};n(15,b=o);const W=Y(o.image.url),ge=Promise.all(o.annotations.map(N=>Y(N.image.url))),Q=Promise.all([W,ge]);n(24,J=Q),Q.then(([N,be])=>{if(J!==Q)return;const de={image:{...o.image,url:N??void 0},annotations:o.annotations.map((X,we)=>({...X,image:{...X.image,url:be[we]??void 0}}))};n(15,b=de)})}else n(15,b=null)},[l,i,s,g,h,f,_,u,r,m,d,M,F,R,T,b,G,H,U,K,O,V,a,c,J,re,ue,fe,_e,me,ce,he]}class al extends Se{constructor(e){super(),Ne(this,e,Ke,Je,je,{elem_id:0,elem_classes:1,visible:2,value:22,gradio:3,label:4,show_label:5,show_legend:6,height:7,width:8,color_map:9,container:10,scale:11,min_width:12,loading_status:13,show_fullscreen_button:14},null,[-1,-1])}get elem_id(){return this.$$.ctx[0]}set elem_id(e){this.$$set({elem_id:e}),w()}get elem_classes(){return this.$$.ctx[1]}set elem_classes(e){this.$$set({elem_classes:e}),w()}get visible(){return this.$$.ctx[2]}set visible(e){this.$$set({visible:e}),w()}get value(){return this.$$.ctx[22]}set value(e){this.$$set({value:e}),w()}get gradio(){return this.$$.ctx[3]}set gradio(e){this.$$set({gradio:e}),w()}get label(){return this.$$.ctx[4]}set label(e){this.$$set({label:e}),w()}get show_label(){return this.$$.ctx[5]}set show_label(e){this.$$set({show_label:e}),w()}get show_legend(){return this.$$.ctx[6]}set show_legend(e){this.$$set({show_legend:e}),w()}get height(){return this.$$.ctx[7]}set height(e){this.$$set({height:e}),w()}get width(){return this.$$.ctx[8]}set width(e){this.$$set({width:e}),w()}get color_map(){return this.$$.ctx[9]}set color_map(e){this.$$set({color_map:e}),w()}get container(){return this.$$.ctx[10]}set container(e){this.$$set({container:e}),w()}get scale(){return this.$$.ctx[11]}set scale(e){this.$$set({scale:e}),w()}get min_width(){return this.$$.ctx[12]}set min_width(e){this.$$set({min_width:e}),w()}get loading_status(){return this.$$.ctx[13]}set loading_status(e){this.$$set({loading_status:e}),w()}get show_fullscreen_button(){return this.$$.ctx[14]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),w()}}export{al as default};
|
|
//# sourceMappingURL=Index-Ck2XvAlX.js.map
|