PageSourceSearch

https://mimigona1-667.hf.space/assets/Index-S5e3TuCs.js

js mimigona1-667.hf.space collected 2026-10-03 17:08:03 UTC 37,628 bytes, 6 lines download raw bytes

vendor: 37,628 bytes, lines 1-6
1import{g as kl}from"./color-BKnbewwC.js";import{n as Ve}from"./i18n-Dub1g69U.js";import{b as pl,B as vl,Q as je,E as wl}from"./FullscreenButton-CY3DenSN.js";import{S as yl}from"./StreamingBar-DwBbQPSd.js";import"./index-6iIxEka4.js";import"./svelte/svelte.js";import"./MarkdownCode-B_oSAavQ.js";import"./prism-python-BTLJbtOb.js";function He(l,e,t){if(!t){var n=document.createElement("canvas");t=n.getContext("2d")}t.fillStyle=l,t.fillRect(0,0,1,1);const[s,i,o]=t.getImageData(0,0,1,1).data;return t.clearRect(0,0,1,1),`rgba(${s}, ${i}, ${o}, ${255/e})`}function jl(l,e,t,n){for(const s in l){const i=l[s].trim();i in Ve?e[s]=Ve[i]:e[s]={primary:t?He(l[s],1,n):l[s],secondary:t?He(l[s],.5,n):l[s]}}}function Sl(l,e){let t=[],n=null,s=null;for(const i of l)s===i.class_or_confidence?n=n?n+i.token:i.token:(n!==null&&t.push({token:n,class_or_confidence:s}),n=i.token,s=i.class_or_confidence);return n!==null&&t.push({token:n,class_or_confidence:s}),t}const{SvelteComponent:at,append:W,attr:V,destroy_each:Se,detach:M,element:F,empty:El,ensure_array_like:Z,flush:fe,init:ft,insert:q,listen:ce,noop:Me,run_all:ct,safe_not_equal:_t,set_data:Oe,set_style:ke,space:ie,text:_e,toggle_class:Y}=window.__gradio__svelte__internal,{createEventDispatcher:ut}=window.__gradio__svelte__internal;function qe(l,e,t){const n=l.slice();n[18]=e[t];const s=typeof n[18].class_or_confidence=="string"?parseInt(n[18].class_or_confidence):n[18].class_or_confidence;return n[27]=s,n}function Re(l,e,t){const n=l.slice();return n[18]=e[t],n[20]=t,n}function De(l,e,t){const n=l.slice();return n[21]=e[t],n[23]=t,n}function Ae(l,e,t){const n=l.slice();return n[24]=e[t][0],n[25]=e[t][1],n[20]=t,n}function dt(l){let e,t,n=l[1]&&Fe(),s=Z(l[0]),i=[];for(let o=0;o<s.length;o+=1)i[o]=Ke(qe(l,s,o));return{c(){n&&n.c(),e=ie(),t=F("div");for(let o=0;o<i.length;o+=1)i[o].c();V(t,"class","textfield svelte-ju12zg"),V(t,"data-testid","highlighted-text:textfield")},m(o,a){n&&n.m(o,a),q(o,e,a),q(o,t,a);for(let r=0;r<i.length;r+=1)i[r]&&i[r].m(t,null)},p(o,a){if(o[1]?n||(n=Fe(),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null),a&1){s=Z(o[0]);let r;for(r=0;r<s.length;r+=1){const c=qe(o,s,r);i[r]?i[r].p(c,a):(i[r]=Ke(c),i[r].c(),i[r].m(t,null))}for(;r<i.length;r+=1)i[r].d(1);i.length=s.length}},d(o){o&&(M(e),M(t)),n&&n.d(o),Se(i,o)}}}function ht(l){let e,t,n=l[1]&&Pe(l),s=Z(l[0]),i=[];for(let o=0;o<s.length;o+=1)i[o]=Xe(Re(l,s,o));return{c(){n&&n.c(),e=ie(),t=F("div");for(let o=0;o<i.length;o+=1)i[o].c();V(t,"class","textfield svelte-ju12zg")},m(o,a){n&&n.m(o,a),q(o,e,a),q(o,t,a);for(let r=0;r<i.length;r+=1)i[r]&&i[r].m(t,null)},p(o,a){if(o[1]?n?n.p(o,a):(n=Pe(o),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null),a&223){s=Z(o[0]);let r;for(r=0;r<s.length;r+=1){const c=Re(o,s,r);i[r]?i[r].p(c,a):(i[r]=Xe(c),i[r].c(),i[r].m(t,null))}for(;r<i.length;r+=1)i[r].d(1);i.length=s.length}},d(o){o&&(M(e),M(t)),n&&n.d(o),Se(i,o)}}}function Fe(l){let e;return{c(){e=F("div"),e.innerHTML="<span>-1</span> <span>0</span> <span>+1</span>",V(e,"class","color-legend svelte-ju12zg"),V(e,"data-testid","highlighted-text:color-legend")},m(t,n){q(t,e,n)},d(t){t&&M(e)}}}function Ke(l){let e,t,n=l[18].token+"",s,i,o;return{c(){e=F("span"),t=F("span"),s=_e(n),i=ie(),V(t,"class","text svelte-ju12zg"),V(e,"class","textspan score-text svelte-ju12zg"),V(e,"style",o="background-color: rgba("+(l[27]&&l[27]<0?"128, 90, 213,"+-l[27]:"239, 68, 60,"+l[27])+")")},m(a,r){q(a,e,r),W(e,t),W(t,s),W(e,i)},p(a,r){r&1&&n!==(n=a[18].token+"")&&Oe(s,n),r&1&&o!==(o="background-color: rgba("+(a[27]&&a[27]<0?"128, 90, 213,"+-a[27]:"239, 68, 60,"+a[27])+")")&&V(e,"style",o)},d(a){a&&M(e)}}}function Pe(l){let e,t=Z(Object.entries(l[6])),n=[];for(let s=0;s<t.length;s+=1)n[s]=Qe(Ae(l,t,s));return{c(){e=F("div");for(let s=0;s<n.length;s+=1)n[s].c();V(e,"class","category-legend svelte-ju12zg"),V(e,"data-testid","highlighted-text:category-legend")},m(s,i){q(s,e,i);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(s,i){if(i&832){t=Z(Object.entries(s[6]));let o;for(o=0;o<t.length;o+=1){const a=Ae(s,t,o);n[o]?n[o].p(a,i):(n[o]=Qe(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(s){s&&M(e),Se(n,s)}}}function Qe(l){let e,t=l[24]+"",n,s,i,o;function a(){return l[11](l[24])}function r(){return l[12](l[24])}return{c(){e=F("div"),n=_e(t),s=ie(),V(e,"class","category-label svelte-ju12zg"),V(e,"style","background-color:"+l[25].secondary)},m(c,f){q(c,e,f),W(e,n),W(e,s),i||(o=[ce(e,"mouseover",a),ce(e,"focus",r),ce(e,"mouseout",l[13]),ce(e,"blur",l[14])],i=!0)},p(c,f){l=c},d(c){c&&M(e),i=!1,ct(o)}}}function Ue(l){let e,t,n=l[21]+"",s,i,o,a,r=!l[1]&&l[2]&&l[18].class_or_confidence!==null&&Ge(l);function c(){return l[15](l[20],l[18])}return{c(){e=F("span"),t=F("span"),s=_e(n),i=ie(),r&&r.c(),V(t,"class","text svelte-ju12zg"),Y(t,"no-label",l[18].class_or_confidence===null||!l[6][l[18].class_or_confidence]),V(e,"class","textspan svelte-ju12zg"),Y(e,"no-cat",l[18].class_or_confidence===null||l[4]&&l[4]!==l[18].class_or_confidence),Y(e,"hl",l[18].class_or_confidence!==null),Y(e,"selectable",l[3]),ke(e,"background-color",l[18].class_or_confidence===null||l[4]&&l[4]!==l[18].class_or_confidence?"":l[6][l[18].class_or_confidence].secondary)},m(f,g){q(f,e,g),W(e,t),W(t,s),W(e,i),r&&r.m(e,null),o||(a=ce(e,"click",c),o=!0)},p(f,g){l=f,g&1&&n!==(n=l[21]+"")&&Oe(s,n),g&65&&Y(t,"no-label",l[18].class_or_confidence===null||!l[6][l[18].class_or_confidence]),!l[1]&&l[2]&&l[18].class_or_confidence!==null?r?r.p(l,g):(r=Ge(l),r.c(),r.m(e,null)):r&&(r.d(1),r=null),g&17&&Y(e,"no-cat",l[18].class_or_confidence===null||l[4]&&l[4]!==l[18].class_or_confidence),g&1&&Y(e,"hl",l[18].class_or_confidence!==null),g&8&&Y(e,"selectable",l[3]),g&17&&ke(e,"background-color",l[18].class_or_confidence===null||l[4]&&l[4]!==l[18].class_or_confidence?"":l[6][l[18].class_or_confidence].secondary)},d(f){f&&M(e),r&&r.d(),o=!1,a()}}}function Ge(l){let e,t,n=l[18].class_or_confidence+"",s;return{c(){e=_e(` 
2								`),t=F("span"),s=_e(n),V(t,"class","label svelte-ju12zg"),ke(t,"background-color",l[18].class_or_confidence===null||l[4]&&l[4]!==l[18].class_or_confidence?"":l[6][l[18].class_or_confidence].primary)},m(i,o){q(i,e,o),q(i,t,o),W(t,s)},p(i,o){o&1&&n!==(n=i[18].class_or_confidence+"")&&Oe(s,n),o&17&&ke(t,"background-color",i[18].class_or_confidence===null||i[4]&&i[4]!==i[18].class_or_confidence?"":i[6][i[18].class_or_confidence].primary)},d(i){i&&(M(e),M(t))}}}function Je(l){let e;return{c(){e=F("br")},m(t,n){q(t,e,n)},d(t){t&&M(e)}}}function We(l){let e=l[21].trim()!=="",t,n=l[23]<pe(l[18].token).length-1,s,i=e&&Ue(l),o=n&&Je();return{c(){i&&i.c(),t=ie(),o&&o.c(),s=El()},m(a,r){i&&i.m(a,r),q(a,t,r),o&&o.m(a,r),q(a,s,r)},p(a,r){r&1&&(e=a[21].trim()!==""),e?i?i.p(a,r):(i=Ue(a),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),r&1&&(n=a[23]<pe(a[18].token).length-1),n?o||(o=Je(),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(a){a&&(M(t),M(s)),i&&i.d(a),o&&o.d(a)}}}function Xe(l){let e,t=Z(pe(l[18].token)),n=[];for(let s=0;s<t.length;s+=1)n[s]=We(De(l,t,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();e=El()},m(s,i){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(s,i);q(s,e,i)},p(s,i){if(i&223){t=Z(pe(s[18].token));let o;for(o=0;o<t.length;o+=1){const a=De(s,t,o);n[o]?n[o].p(a,i):(n[o]=We(a),n[o].c(),n[o].m(e.parentNode,e))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(s){s&&M(e),Se(n,s)}}}function gt(l){let e;function t(i,o){return i[5]==="categories"?ht:dt}let n=t(l),s=n(l);return{c(){e=F("div"),s.c(),V(e,"class","container svelte-ju12zg")},m(i,o){q(i,e,o),s.m(e,null)},p(i,[o]){n===(n=t(i))&&s?s.p(i,o):(s.d(1),s=n(i),s&&(s.c(),s.m(e,null)))},i:Me,o:Me,d(i){i&&M(e),s.d()}}}function pe(l){return l.split(`
3`)}function mt(l,e,t){const n=typeof document<"u";let{value:s=[]}=e,{show_legend:i=!1}=e,{show_inline_category:o=!0}=e,{color_map:a={}}=e,{selectable:r=!1}=e,c,f={},g="";const p=ut();let b;function _(m){t(4,g=m)}function d(){t(4,g="")}const w=m=>_(m),S=m=>_(m),y=()=>d(),h=()=>d(),j=(m,z)=>{p("select",{index:m,value:[z.token,z.class_or_confidence]})};return l.$$set=m=>{"value"in m&&t(0,s=m.value),"show_legend"in m&&t(1,i=m.show_legend),"show_inline_category"in m&&t(2,o=m.show_inline_category),"color_map"in m&&t(10,a=m.color_map),"selectable"in m&&t(3,r=m.selectable)},l.$$.update=()=>{if(l.$$.dirty&1025){if(a||t(10,a={}),s.length>0){for(let m of s)if(m.class_or_confidence!==null)if(typeof m.class_or_confidence=="string"){if(t(5,b="categories"),!(m.class_or_confidence in a)){let z=kl(Object.keys(a).length);t(10,a[m.class_or_confidence]=z,a)}}else t(5,b="scores")}jl(a,f,n,c)}},[s,i,o,r,g,b,f,p,_,d,a,w,S,y,h,j]}class bt extends at{constructor(e){super(),ft(this,e,mt,gt,_t,{value:0,show_legend:1,show_inline_category:2,color_map:10,selectable:3})}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),fe()}get show_legend(){return this.$$.ctx[1]}set show_legend(e){this.$$set({show_legend:e}),fe()}get show_inline_category(){return this.$$.ctx[2]}set show_inline_category(e){this.$$set({show_inline_category:e}),fe()}get color_map(){return this.$$.ctx[10]}set color_map(e){this.$$set({color_map:e}),fe()}get selectable(){return this.$$.ctx[3]}set selectable(e){this.$$set({selectable:e}),fe()}}const{SvelteComponent:kt,attr:U,detach:$e,element:zl,empty:pt,flush:J,init:vt,insert:Le,listen:ee,noop:Ye,run_all:Cl,safe_not_equal:wt,set_style:se}=window.__gradio__svelte__internal;function yt(l){let e,t,n,s;return{c(){e=zl("input"),U(e,"class","label-input svelte-1cag2po"),e.autofocus=!0,U(e,"type","number"),U(e,"step","0.1"),U(e,"style",t="background-color: rgba("+(typeof l[1]=="number"&&l[1]<0?"128, 90, 213,"+-l[1]:"239, 68, 60,"+l[1])+")"),e.value=l[1],se(e,"width","7ch")},m(i,o){Le(i,e,o),e.focus(),n||(s=[ee(e,"input",l[8]),ee(e,"blur",l[14]),ee(e,"keydown",l[15])],n=!0)},p(i,o){o&2&&t!==(t="background-color: rgba("+(typeof i[1]=="number"&&i[1]<0?"128, 90, 213,"+-i[1]:"239, 68, 60,"+i[1])+")")&&U(e,"style",t),o&2&&e.value!==i[1]&&(e.value=i[1]);const a=o&2;(o&2||a)&&se(e,"width","7ch")},d(i){i&&$e(e),n=!1,Cl(s)}}}function jt(l){let e,t,n,s;return{c(){e=zl("input"),U(e,"class","label-input svelte-1cag2po"),e.autofocus=!0,U(e,"id",t=`label-input-${l[3]}`),U(e,"type","text"),U(e,"placeholder","label"),e.value=l[1],se(e,"background-color",l[1]===null||l[2]&&l[2]!==l[1]?"":l[6][l[1]].primary),se(e,"width",l[7]?l[7].toString()?.length+4+"ch":"8ch")},m(i,o){Le(i,e,o),e.focus(),n||(s=[ee(e,"input",l[8]),ee(e,"blur",l[12]),ee(e,"keydown",l[13]),ee(e,"focus",Et)],n=!0)},p(i,o){o&8&&t!==(t=`label-input-${i[3]}`)&&U(e,"id",t),o&2&&e.value!==i[1]&&(e.value=i[1]),o&70&&se(e,"background-color",i[1]===null||i[2]&&i[2]!==i[1]?"":i[6][i[1]].primary),o&128&&se(e,"width",i[7]?i[7].toString()?.length+4+"ch":"8ch")},d(i){i&&$e(e),n=!1,Cl(s)}}}function St(l){let e;function t(i,o){return i[5]?yt:jt}let n=t(l),s=n(l);return{c(){s.c(),e=pt()},m(i,o){s.m(i,o),Le(i,e,o)},p(i,[o]){n===(n=t(i))&&s?s.p(i,o):(s.d(1),s=n(i),s&&(s.c(),s.m(e.parentNode,e)))},i:Ye,o:Ye,d(i){i&&$e(e),s.d(i)}}}function Et(l){let e=l.target;e&&e.placeholder&&(e.placeholder="")}function zt(l,e,t){let{value:n}=e,{category:s}=e,{active:i}=e,{labelToEdit:o}=e,{indexOfLabel:a}=e,{text:r}=e,{handleValueChange:c}=e,{isScoresMode:f=!1}=e,{_color_map:g}=e,p=s;function b(h){let j=h.target;j&&t(7,p=j.value)}function _(h,j,m){let z=h.target;t(10,n=[...n.slice(0,j),{token:m,class_or_confidence:z.value===""?null:f?Number(z.value):z.value},...n.slice(j+1)]),c()}const d=h=>_(h,a,r),w=h=>{h.key==="Enter"&&(_(h,a,r),t(0,o=-1))},S=h=>_(h,a,r),y=h=>{h.key==="Enter"&&(_(h,a,r),t(0,o=-1))};return l.$$set=h=>{"value"in h&&t(10,n=h.value),"category"in h&&t(1,s=h.category),"active"in h&&t(2,i=h.active),"labelToEdit"in h&&t(0,o=h.labelToEdit),"indexOfLabel"in h&&t(3,a=h.indexOfLabel),"text"in h&&t(4,r=h.text),"handleValueChange"in h&&t(11,c=h.handleValueChange),"isScoresMode"in h&&t(5,f=h.isScoresMode),"_color_map"in h&&t(6,g=h._color_map)},[o,s,i,a,r,f,g,p,b,_,n,c,d,w,S,y]}class Nl extends kt{constructor(e){super(),vt(this,e,zt,St,wt,{value:10,category:1,active:2,labelToEdit:0,indexOfLabel:3,text:4,handleValueChange:11,isScoresMode:5,_color_map:6})}get value(){return this.$$.ctx[10]}set value(e){this.$$set({value:e}),J()}get category(){return this.$$.ctx[1]}set category(e){this.$$set({category:e}),J()}get active(){return this.$$.ctx[2]}set active(e){this.$$set({active:e}),J()}get labelToEdit(){return this.$$.ctx[0]}set labelToEdit(e){this.$$set({labelToEdit:e}),J()}get indexOfLabel(){return this.$$.ctx[3]}set indexOfLabel(e){this.$$set({indexOfLabel:e}),J()}get text(){return this.$$.ctx[4]}set text(e){this.$$set({text:e}),J()}get handleValueChange(){return this.$$.ctx[11]}set handleValueChange(e){this.$$set({handleValueChange:e}),J()}get isScoresMode(){return this.$$.ctx[5]}set isScoresMode(e){this.$$set({isScoresMode:e}),J()}get _color_map(){return this.$$.ctx[6]}set _color_map(e){this.$$set({_color_map:e}),J()}}const{SvelteComponent:Ct,add_flush_callback:Tl,append:D,attr:v,bind:Ol,binding_callbacks:$l,check_outros:ne,create_component:Ll,destroy_component:Bl,destroy_each:Ee,detach:$,element:H,empty:Be,ensure_array_like:x,flush:be,group_outros:oe,init:Nt,insert:L,listen:C,mount_component:Il,run_all:re,safe_not_equal:Tt,set_data:ze,set_style:ve,space:G,text:he,toggle_class:A,transition_in:T,transition_out:R}=window.__gradio__svelte__internal,{createEventDispatcher:Ot,onMount:$t}=window.__gradio__svelte__internal;function Ze(l,e,t){const n=l.slice();n[45]=e[t].token,n[46]=e[t].class_or_confidence,n[48]=t;const s=typeof n[46]=="string"?parseInt(n[46]):n[46];return n[54]=s,n}function xe(l,e,t){const n=l.slice();return n[45]=e[t].token,n[46]=e[t].class_or_confidence,n[48]=t,n}function el(l,e,t){const n=l.slice();return n[49]=e[t],n[51]=t,n}function ll(l,e,t){const n=l.slice();return n[46]=e[t][0],n[52]=e[t][1],n[48]=t,n}function Lt(l){let e,t,n,s=l[1]&&tl(),i=x(l[0]),o=[];for(let r=0;r<i.length;r+=1)o[r]=sl(Ze(l,i,r));const a=r=>R(o[r],1,1,()=>{o[r]=null});return{c(){s&&s.c(),e=G(),t=H("div");for(let r=0;r<o.length;r+=1)o[r].c();v(t,"class","textfield svelte-1ozsnjl"),v(t,"data-testid","highlighted-text:textfield")},m(r,c){s&&s.m(r,c),L(r,e,c),L(r,t,c);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(t,null);n=!0},p(r,c){if(r[1]?s||(s=tl(),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),c[0]&889){i=x(r[0]);let f;for(f=0;f<i.length;f+=1){const g=Ze(r,i,f);o[f]?(o[f].p(g,c),T(o[f],1)):(o[f]=sl(g),o[f].c(),T(o[f],1),o[f].m(t,null))}for(oe(),f=i.length;f<o.length;f+=1)a(f);ne()}},i(r){if(!n){for(let c=0;c<i.length;c+=1)T(o[c]);n=!0}},o(r){o=o.filter(Boolean);for(let c=0;c<o.length;c+=1)R(o[c]);n=!1},d(r){r&&($(e),$(t)),s&&s.d(r),Ee(o,r)}}}function Bt(l){let e,t,n,s=l[1]&&il(l),i=x(l[0]),o=[];for(let r=0;r<i.length;r+=1)o[r]=gl(xe(l,i,r));const a=r=>R(o[r],1,1,()=>{o[r]=null});return{c(){s&&s.c(),e=G(),t=H("div");for(let r=0;r<o.length;r+=1)o[r].c();v(t,"class","textfield svelte-1ozsnjl")},m(r,c){s&&s.m(r,c),L(r,e,c),L(r,t,c);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(t,null);n=!0},p(r,c){if(r[1]?s?s.p(r,c):(s=il(r),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),c[0]&13183){i=x(r[0]);let f;for(f=0;f<i.length;f+=1){const g=xe(r,i,f);o[f]?(o[f].p(g,c),T(o[f],1)):(o[f]=gl(g),o[f].c(),T(o[f],1),o[f].m(t,null))}for(oe(),f=i.length;f<o.length;f+=1)a(f);ne()}},i(r){if(!n){for(let c=0;c<i.length;c+=1)T(o[c]);n=!0}},o(r){o=o.filter(Boolean);for(let c=0;c<o.length;c+=1)R(o[c]);n=!1},d(r){r&&($(e),$(t)),s&&s.d(r),Ee(o,r)}}}function tl(l){let e;return{c(){e=H("div"),e.innerHTML="<span>-1</span> <span>0</span> <span>+1</span>",v(e,"class","color-legend svelte-1ozsnjl"),v(e,"data-testid","highlighted-text:color-legend")},m(t,n){L(t,e,n)},d(t){t&&$(e)}}}function nl(l){let e,t,n;function s(o){l[32](o)}let i={labelToEdit:l[6],_color_map:l[3],category:l[46],active:l[5],indexOfLabel:l[48],text:l[45],handleValueChange:l[9],isScoresMode:!0};return l[0]!==void 0&&(i.value=l[0]),e=new Nl({props:i}),$l.push(()=>Ol(e,"value",s)),{c(){Ll(e.$$.fragment)},m(o,a){Il(e,o,a),n=!0},p(o,a){const r={};a[0]&64&&(r.labelToEdit=o[6]),a[0]&8&&(r._color_map=o[3]),a[0]&1&&(r.category=o[46]),a[0]&32&&(r.active=o[5]),a[0]&1&&(r.text=o[45]),!t&&a[0]&1&&(t=!0,r.value=o[0],Tl(()=>t=!1)),e.$set(r)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){Bl(e,o)}}}function ol(l){let e,t,n;function s(){return l[37](l[48])}function i(...o){return l[38](l[48],...o)}return{c(){e=H("span"),e.textContent="×",v(e,"class","label-clear-button svelte-1ozsnjl"),v(e,"role","button"),v(e,"aria-roledescription","Remove label from text"),v(e,"tabindex","0")},m(o,a){L(o,e,a),t||(n=[C(e,"click",s),C(e,"keydown",i)],t=!0)},p(o,a){l=o},d(o){o&&$(e),t=!1,re(n)}}}function sl(l){let e,t,n,s=l[45]+"",i,o,a,r,c,f,g,p,b=l[46]&&l[6]===l[48]&&nl(l);function _(){return l[33](l[48])}function d(){return l[34](l[48])}function w(){return l[35](l[48])}function S(...h){return l[36](l[48],...h)}let y=l[46]&&l[4]===l[48]&&ol(l);return{c(){e=H("span"),t=H("span"),n=H("span"),i=he(s),o=G(),b&&b.c(),r=G(),y&&y.c(),c=G(),v(n,"class","text svelte-1ozsnjl"),v(t,"class","textspan score-text svelte-1ozsnjl"),v(t,"role","button"),v(t,"tabindex","0"),v(t,"style",a="background-color: rgba("+(l[54]&&l[54]<0?"128, 90, 213,"+-l[54]:"239, 68, 60,"+l[54])+")"),A(t,"no-cat",l[46]===null||l[5]&&l[5]!==l[46]),A(t,"hl",l[46]!==null),v(e,"class","score-text-container svelte-1ozsnjl")},m(h,j){L(h,e,j),D(e,t),D(t,n),D(n,i),D(t,o),b&&b.m(t,null),D(e,r),y&&y.m(e,null),D(e,c),f=!0,g||(p=[C(t,"mouseover",_),C(t,"focus",d),C(t,"click",w),C(t,"keydown",S)],g=!0)},p(h,j){l=h,(!f||j[0]&1)&&s!==(s=l[45]+"")&&ze(i,s),l[46]&&l[6]===l[48]?b?(b.p(l,j),j[0]&65&&T(b,1)):(b=nl(l),b.c(),T(b,1),b.m(t,null)):b&&(oe(),R(b,1,1,()=>{b=null}),ne()),(!f||j[0]&1&&a!==(a="background-color: rgba("+(l[54]&&l[54]<0?"128, 90, 213,"+-l[54]:"239, 68, 60,"+l[54])+")"))&&v(t,"style",a),(!f||j[0]&33)&&A(t,"no-cat",l[46]===null||l[5]&&l[5]!==l[46]),(!f||j[0]&1)&&A(t,"hl",l[46]!==null),l[46]&&l[4]===l[48]?y?y.p(l,j):(y=ol(l),y.c(),y.m(e,c)):y&&(y.d(1),y=null)},i(h){f||(T(b),f=!0)},o(h){R(b),f=!1},d(h){h&&$(e),b&&b.d(),y&&y.d(),g=!1,re(p)}}}function il(l){let e,t=l[3]&&rl(l);return{c(){e=H("div"),t&&t.c(),v(e,"class","class_or_confidence-legend svelte-1ozsnjl"),v(e,"data-testid","highlighted-text:class_or_confidence-legend")},m(n,s){L(n,e,s),t&&t.m(e,null)},p(n,s){n[3]?t?t.p(n,s):(t=rl(n),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(n){n&&$(e),t&&t.d()}}}function rl(l){let e,t=x(Object.entries(l[3])),n=[];for(let s=0;s<t.length;s+=1)n[s]=al(ll(l,t,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();e=Be()},m(s,i){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(s,i);L(s,e,i)},p(s,i){if(i[0]&3080){t=x(Object.entries(s[3]));let o;for(o=0;o<t.length;o+=1){const a=ll(s,t,o);n[o]?n[o].p(a,i):(n[o]=al(a),n[o].c(),n[o].m(e.parentNode,e))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(s){s&&$(e),Ee(n,s)}}}function al(l){let e,t=l[46]+"",n,s,i,o,a;function r(){return l[15](l[46])}function c(){return l[16](l[46])}return{c(){e=H("div"),n=he(t),s=G(),v(e,"role","button"),v(e,"aria-roledescription","Categories of highlighted text. Hover to see text with this class_or_confidence highlighted."),v(e,"tabindex","0"),v(e,"class","class_or_confidence-label svelte-1ozsnjl"),v(e,"style",i="background-color:"+l[52].secondary)},m(f,g){L(f,e,g),D(e,n),D(e,s),o||(a=[C(e,"mouseover",r),C(e,"focus",c),C(e,"mouseout",l[17]),C(e,"blur",l[18])],o=!0)},p(f,g){l=f,g[0]&8&&t!==(t=l[46]+"")&&ze(n,t),g[0]&8&&i!==(i="background-color:"+l[52].secondary)&&v(e,"style",i)},d(f){f&&$(e),o=!1,re(a)}}}function fl(l){let e,t,n,s=l[49]+"",i,o,a,r,c,f,g;function p(){return l[20](l[48])}function b(){return l[21](l[48])}function _(){return l[22](l[48])}let d=!l[1]&&l[46]!==null&&l[6]!==l[48]&&cl(l),w=l[6]===l[48]&&l[46]!==null&&_l(l);function S(){return l[26](l[46],l[48],l[45])}function y(...z){return l[27](l[46],l[48],l[45],...z)}function h(){return l[28](l[48])}function j(){return l[29](l[48])}let m=l[46]!==null&&ul(l);return{c(){e=H("span"),t=H("span"),n=H("span"),i=he(s),o=G(),d&&d.c(),a=G(),w&&w.c(),r=G(),m&&m.c(),v(n,"class","text svelte-1ozsnjl"),v(n,"role","button"),v(n,"tabindex","0"),A(n,"no-label",l[46]===null),v(t,"role","button"),v(t,"tabindex","0"),v(t,"class","textspan svelte-1ozsnjl"),A(t,"no-cat",l[46]===null||l[5]&&l[5]!==l[46]),A(t,"hl",l[46]!==null),A(t,"selectable",l[2]),ve(t,"background-color",l[46]===null||l[5]&&l[5]!==l[46]?"":l[46]&&l[3][l[46]]?l[3][l[46]].secondary:""),v(e,"class","text-class_or_confidence-container svelte-1ozsnjl")},m(z,B){L(z,e,B),D(e,t),D(t,n),D(n,i),D(t,o),d&&d.m(t,null),D(t,a),w&&w.m(t,null),D(e,r),m&&m.m(e,null),c=!0,f||(g=[C(n,"keydown",l[19]),C(n,"focus",p),C(n,"mouseover",b),C(n,"click",_),C(t,"click",S),C(t,"keydown",y),C(t,"focus",h),C(t,"mouseover",j)],f=!0)},p(z,B){l=z,(!c||B[0]&1)&&s!==(s=l[49]+"")&&ze(i,s),(!c||B[0]&1)&&A(n,"no-label",l[46]===null),!l[1]&&l[46]!==null&&l[6]!==l[48]?d?d.p(l,B):(d=cl(l),d.c(),d.m(t,a)):d&&(d.d(1),d=null),l[6]===l[48]&&l[46]!==null?w?(w.p(l,B),B[0]&65&&T(w,1)):(w=_l(l),w.c(),T(w,1),w.m(t,null)):w&&(oe(),R(w,1,1,()=>{w=null}),ne()),(!c||B[0]&33)&&A(t,"no-cat",l[46]===null||l[5]&&l[5]!==l[46]),(!c||B[0]&1)&&A(t,"hl",l[46]!==null),(!c||B[0]&4)&&A(t,"selectable",l[2]),B[0]&41&&ve(t,"background-color",l[46]===null||l[5]&&l[5]!==l[46]?"":l[46]&&l[3][l[46]]?l[3][l[46]].secondary:""),l[46]!==null?m?m.p(l,B):(m=ul(l),m.c(),m.m(e,null)):m&&(m.d(1),m=null)},i(z){c||(T(w),c=!0)},o(z){R(w),c=!1},d(z){z&&$(e),d&&d.d(),w&&w.d(),m&&m.d(),f=!1,re(g)}}}function cl(l){let e,t=l[46]+"",n,s,i;function o(){return l[23](l[48])}function a(){return l[24](l[48])}return{c(){e=H("span"),n=he(t),v(e,"id",`label-tag-${l[48]}`),v(e,"class","label svelte-1ozsnjl"),v(e,"role","button"),v(e,"tabindex","0"),ve(e,"background-color",l[46]===null||l[5]&&l[5]!==l[46]?"":l[3][l[46]].primary)},m(r,c){L(r,e,c),D(e,n),s||(i=[C(e,"click",o),C(e,"keydown",a)],s=!0)},p(r,c){l=r,c[0]&1&&t!==(t=l[46]+"")&&ze(n,t),c[0]&41&&ve(e,"background-color",l[46]===null||l[5]&&l[5]!==l[46]?"":l[3][l[46]].primary)},d(r){r&&$(e),s=!1,re(i)}}}function _l(l){let e,t,n,s;function i(a){l[25](a)}let o={labelToEdit:l[6],category:l[46],active:l[5],_color_map:l[3],indexOfLabel:l[48],text:l[45],handleValueChange:l[9]};return l[0]!==void 0&&(o.value=l[0]),t=new Nl({props:o}),$l.push(()=>Ol(t,"value",i)),{c(){e=he(` 
4									`),Ll(t.$$.fragment)},m(a,r){L(a,e,r),Il(t,a,r),s=!0},p(a,r){const c={};r[0]&64&&(c.labelToEdit=a[6]),r[0]&1&&(c.category=a[46]),r[0]&32&&(c.active=a[5]),r[0]&8&&(c._color_map=a[3]),r[0]&1&&(c.text=a[45]),!n&&r[0]&1&&(n=!0,c.value=a[0],Tl(()=>n=!1)),t.$set(c)},i(a){s||(T(t.$$.fragment,a),s=!0)},o(a){R(t.$$.fragment,a),s=!1},d(a){a&&$(e),Bl(t,a)}}}function ul(l){let e,t,n;function s(){return l[30](l[48])}function i(...o){return l[31](l[48],...o)}return{c(){e=H("span"),e.textContent="×",v(e,"class","label-clear-button svelte-1ozsnjl"),v(e,"role","button"),v(e,"aria-roledescription","Remove label from text"),v(e,"tabindex","0")},m(o,a){L(o,e,a),t||(n=[C(e,"click",s),C(e,"keydown",i)],t=!0)},p(o,a){l=o},d(o){o&&$(e),t=!1,re(n)}}}function dl(l){let e;return{c(){e=H("br")},m(t,n){L(t,e,n)},d(t){t&&$(e)}}}function hl(l){let e=l[49].trim()!=="",t,n=l[51]<we(l[45]).length-1,s,i,o=e&&fl(l),a=n&&dl();return{c(){o&&o.c(),t=G(),a&&a.c(),s=Be()},m(r,c){o&&o.m(r,c),L(r,t,c),a&&a.m(r,c),L(r,s,c),i=!0},p(r,c){c[0]&1&&(e=r[49].trim()!==""),e?o?(o.p(r,c),c[0]&1&&T(o,1)):(o=fl(r),o.c(),T(o,1),o.m(t.parentNode,t)):o&&(oe(),R(o,1,1,()=>{o=null}),ne()),c[0]&1&&(n=r[51]<we(r[45]).length-1),n?a||(a=dl(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(r){i||(T(o),i=!0)},o(r){R(o),i=!1},d(r){r&&($(t),$(s)),o&&o.d(r),a&&a.d(r)}}}function gl(l){let e,t,n=x(we(l[45])),s=[];for(let o=0;o<n.length;o+=1)s[o]=hl(el(l,n,o));const i=o=>R(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Be()},m(o,a){for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(o,a);L(o,e,a),t=!0},p(o,a){if(a[0]&13183){n=x(we(o[45]));let r;for(r=0;r<n.length;r+=1){const c=el(o,n,r);s[r]?(s[r].p(c,a),T(s[r],1)):(s[r]=hl(c),s[r].c(),T(s[r],1),s[r].m(e.parentNode,e))}for(oe(),r=n.length;r<s.length;r+=1)i(r);ne()}},i(o){if(!t){for(let a=0;a<n.length;a+=1)T(s[a]);t=!0}},o(o){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)R(s[a]);t=!1},d(o){o&&$(e),Ee(s,o)}}}function It(l){let e,t,n,s;const i=[Bt,Lt],o=[];function a(r,c){return r[7]==="categories"?0:1}return t=a(l),n=o[t]=i[t](l),{c(){e=H("div"),n.c(),v(e,"class","container svelte-1ozsnjl")},m(r,c){L(r,e,c),o[t].m(e,null),s=!0},p(r,c){let f=t;t=a(r),t===f?o[t].p(r,c):(oe(),R(o[f],1,1,()=>{o[f]=null}),ne(),n=o[t],n?n.p(r,c):(n=o[t]=i[t](r),n.c()),T(n,1),n.m(e,null))},i(r){s||(T(n),s=!0)},o(r){R(n),s=!1},d(r){r&&$(e),o[t].d()}}}function we(l){return l.split(`
5`)}function Vt(l,e,t){const n=typeof document<"u";let{value:s=[]}=e,{show_legend:i=!1}=e,{color_map:o={}}=e,{selectable:a=!1}=e,r=-1,c,f={},g="",p,b=-1;$t(()=>{const u=()=>{p=window.getSelection(),z(),window.removeEventListener("mouseup",u)};window.addEventListener("mousedown",()=>{window.addEventListener("mouseup",u)})});async function _(u,O){if(p?.toString()&&r!==-1&&s[r].token.toString().includes(p.toString())){const X=Symbol(),ae=s[r].token,[ot,st,it]=[ae.substring(0,u),ae.substring(u,O),ae.substring(O)];let ge=[...s.slice(0,r),{token:ot,class_or_confidence:null},{token:st,class_or_confidence:y==="scores"?1:"label",flag:X},{token:it,class_or_confidence:null},...s.slice(r+1)];t(6,b=ge.findIndex(({flag:me})=>me===X)),ge=ge.filter(me=>me.token.trim()!==""),t(0,s=ge.map(({flag:me,...rt})=>rt)),S(),document.getElementById(`label-input-${b}`)?.focus()}}const d=Ot();function w(u){!s||u<0||u>=s.length||(t(0,s[u].class_or_confidence=null,s),t(0,s=Sl(s)),S(),window.getSelection()?.empty())}function S(){d("change",s),t(6,b=-1),i&&(t(14,o={}),t(3,f={}))}let y;function h(u){t(5,g=u)}function j(){t(5,g="")}async function m(u){p=window.getSelection(),u.key==="Enter"&&z()}function z(){if(p&&p?.toString().trim()!==""){const u=p.getRangeAt(0).startOffset,O=p.getRangeAt(0).endOffset;_(u,O)}}function B(u,O,X){d("select",{index:u,value:[O,X]})}const Ce=u=>h(u),Ne=u=>h(u),Te=()=>j(),k=()=>j(),ql=u=>m(u),Rl=u=>t(4,r=u),Dl=u=>t(4,r=u),Al=u=>t(6,b=u),Fl=u=>t(6,b=u),Kl=u=>t(6,b=u);function Pl(u){s=u,t(0,s)}const Ql=(u,O,X)=>{u!==null&&B(O,X,u)},Ul=(u,O,X,ae)=>{u!==null?(t(6,b=O),B(O,X,u)):m(ae)},Gl=u=>t(4,r=u),Jl=u=>t(4,r=u),Wl=u=>w(u),Xl=(u,O)=>{O.key==="Enter"&&w(u)};function Yl(u){s=u,t(0,s)}const Zl=u=>t(4,r=u),xl=u=>t(4,r=u),et=u=>t(6,b=u),lt=(u,O)=>{O.key==="Enter"&&t(6,b=u)},tt=u=>w(u),nt=(u,O)=>{O.key==="Enter"&&w(u)};return l.$$set=u=>{"value"in u&&t(0,s=u.value),"show_legend"in u&&t(1,i=u.show_legend),"color_map"in u&&t(14,o=u.color_map),"selectable"in u&&t(2,a=u.selectable)},l.$$.update=()=>{if(l.$$.dirty[0]&16393){if(o||t(14,o={}),s.length>0){for(let u of s)if(u.class_or_confidence!==null)if(typeof u.class_or_confidence=="string"){if(t(7,y="categories"),!(u.class_or_confidence in o)){let O=kl(Object.keys(o).length);t(14,o[u.class_or_confidence]=O,o)}}else t(7,y="scores")}jl(o,f,n,c)}},[s,i,a,f,r,g,b,y,w,S,h,j,m,B,o,Ce,Ne,Te,k,ql,Rl,Dl,Al,Fl,Kl,Pl,Ql,Ul,Gl,Jl,Wl,Xl,Yl,Zl,xl,et,lt,tt,nt]}class Ht extends Ct{constructor(e){super(),Nt(this,e,Vt,It,Tt,{value:0,show_legend:1,color_map:14,selectable:2},null,[-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),be()}get show_legend(){return this.$$.ctx[1]}set show_legend(e){this.$$set({show_legend:e}),be()}get color_map(){return this.$$.ctx[14]}set color_map(e){this.$$set({color_map:e}),be()}get selectable(){return this.$$.ctx[2]}set selectable(e){this.$$set({selectable:e}),be()}}const{SvelteComponent:Mt,add_flush_callback:qt,assign:Vl,bind:Rt,binding_callbacks:Dt,check_outros:ue,create_component:K,destroy_component:P,detach:le,empty:Ie,flush:I,get_spread_object:Hl,get_spread_update:Ml,group_outros:de,init:At,insert:te,mount_component:Q,safe_not_equal:Ft,space:ye,transition_in:E,transition_out:N}=window.__gradio__svelte__internal;function Kt(l){let e,t;return e=new pl({props:{variant:l[13]?"dashed":"solid",test_id:"highlighted-text",visible:l[5],elem_id:l[3],elem_classes:l[4],padding:!1,container:l[9],scale:l[10],min_width:l[11],$$slots:{default:[Jt]},$$scope:{ctx:l}}}),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},p(n,s){const i={};s&8192&&(i.variant=n[13]?"dashed":"solid"),s&32&&(i.visible=n[5]),s&8&&(i.elem_id=n[3]),s&16&&(i.elem_classes=n[4]),s&512&&(i.container=n[9]),s&1024&&(i.scale=n[10]),s&2048&&(i.min_width=n[11]),s&16896839&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Pt(l){let e,t;return e=new pl({props:{variant:"solid",test_id:"highlighted-text",visible:l[5],elem_id:l[3],elem_classes:l[4],padding:!1,container:l[9],scale:l[10],min_width:l[11],rtl:l[15],$$slots:{default:[Zt]},$$scope:{ctx:l}}}),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},p(n,s){const i={};s&32&&(i.visible=n[5]),s&8&&(i.elem_id=n[3]),s&16&&(i.elem_classes=n[4]),s&512&&(i.container=n[9]),s&1024&&(i.scale=n[10]),s&2048&&(i.min_width=n[11]),s&32768&&(i.rtl=n[15]),s&16896967&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function ml(l){let e,t;return e=new vl({props:{Icon:je,label:l[8],float:!1,disable:l[9]===!1,show_label:l[14],rtl:l[15]}}),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},p(n,s){const i={};s&256&&(i.label=n[8]),s&512&&(i.disable=n[9]===!1),s&16384&&(i.show_label=n[14]),s&32768&&(i.rtl=n[15]),e.$set(i)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Qt(l){let e,t;return e=new wl({props:{size:"small",unpadded_box:!0,$$slots:{default:[Gt]},$$scope:{ctx:l}}}),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},p(n,s){const i={};s&16777216&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Ut(l){let e,t,n;function s(o){l[22](o)}let i={selectable:l[12],show_legend:l[6],color_map:l[1]};return l[0]!==void 0&&(i.value=l[0]),e=new Ht({props:i}),Dt.push(()=>Rt(e,"value",s)),e.$on("change",l[23]),{c(){K(e.$$.fragment)},m(o,a){Q(e,o,a),n=!0},p(o,a){const r={};a&4096&&(r.selectable=o[12]),a&64&&(r.show_legend=o[6]),a&2&&(r.color_map=o[1]),!t&&a&1&&(t=!0,r.value=o[0],qt(()=>t=!1)),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){N(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function Gt(l){let e,t;return e=new je({}),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Jt(l){let e,t,n,s,i,o,a;const r=[{autoscroll:l[2].autoscroll},l[16],{i18n:l[2].i18n}];let c={};for(let _=0;_<r.length;_+=1)c=Vl(c,r[_]);e=new yl({props:c}),e.$on("clear_status",l[21]);let f=l[8]&&l[14]&&ml(l);const g=[Ut,Qt],p=[];function b(_,d){return _[0]?0:1}return s=b(l),i=p[s]=g[s](l),{c(){K(e.$$.fragment),t=ye(),f&&f.c(),n=ye(),i.c(),o=Ie()},m(_,d){Q(e,_,d),te(_,t,d),f&&f.m(_,d),te(_,n,d),p[s].m(_,d),te(_,o,d),a=!0},p(_,d){const w=d&65540?Ml(r,[d&4&&{autoscroll:_[2].autoscroll},d&65536&&Hl(_[16]),d&4&&{i18n:_[2].i18n}]):{};e.$set(w),_[8]&&_[14]?f?(f.p(_,d),d&16640&&E(f,1)):(f=ml(_),f.c(),E(f,1),f.m(n.parentNode,n)):f&&(de(),N(f,1,1,()=>{f=null}),ue());let S=s;s=b(_),s===S?p[s].p(_,d):(de(),N(p[S],1,1,()=>{p[S]=null}),ue(),i=p[s],i?i.p(_,d):(i=p[s]=g[s](_),i.c()),E(i,1),i.m(o.parentNode,o))},i(_){a||(E(e.$$.fragment,_),E(f),E(i),a=!0)},o(_){N(e.$$.fragment,_),N(f),N(i),a=!1},d(_){_&&(le(t),le(n),le(o)),P(e,_),f&&f.d(_),p[s].d(_)}}}function bl(l){let e,t;return e=new vl({props:{Icon:je,label:l[8],float:!1,disable:l[9]===!1,show_label:l[14],rtl:l[15]}}),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},p(n,s){const i={};s&256&&(i.label=n[8]),s&512&&(i.disable=n[9]===!1),s&16384&&(i.show_label=n[14]),s&32768&&(i.rtl=n[15]),e.$set(i)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Wt(l){let e,t;return e=new wl({props:{$$slots:{default:[Yt]},$$scope:{ctx:l}}}),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},p(n,s){const i={};s&16777216&&(i.$$scope={dirty:s,ctx:n}),e.$set(i)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Xt(l){let e,t;return e=new bt({props:{selectable:l[12],value:l[0],show_legend:l[6],show_inline_category:l[7],color_map:l[1]}}),e.$on("select",l[20]),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},p(n,s){const i={};s&4096&&(i.selectable=n[12]),s&1&&(i.value=n[0]),s&64&&(i.show_legend=n[6]),s&128&&(i.show_inline_category=n[7]),s&2&&(i.color_map=n[1]),e.$set(i)},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Yt(l){let e,t;return e=new je({}),{c(){K(e.$$.fragment)},m(n,s){Q(e,n,s),t=!0},i(n){t||(E(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Zt(l){let e,t,n,s,i,o,a;const r=[{autoscroll:l[2].autoscroll},{i18n:l[2].i18n},l[16]];let c={};for(let _=0;_<r.length;_+=1)c=Vl(c,r[_]);e=new yl({props:c}),e.$on("clear_status",l[19]);let f=l[8]&&l[14]&&bl(l);const g=[Xt,Wt],p=[];function b(_,d){return _[0]?0:1}return s=b(l),i=p[s]=g[s](l),{c(){K(e.$$.fragment),t=ye(),f&&f.c(),n=ye(),i.c(),o=Ie()},m(_,d){Q(e,_,d),te(_,t,d),f&&f.m(_,d),te(_,n,d),p[s].m(_,d),te(_,o,d),a=!0},p(_,d){const w=d&65540?Ml(r,[d&4&&{autoscroll:_[2].autoscroll},d&4&&{i18n:_[2].i18n},d&65536&&Hl(_[16])]):{};e.$set(w),_[8]&&_[14]?f?(f.p(_,d),d&16640&&E(f,1)):(f=bl(_),f.c(),E(f,1),f.m(n.parentNode,n)):f&&(de(),N(f,1,1,()=>{f=null}),ue());let S=s;s=b(_),s===S?p[s].p(_,d):(de(),N(p[S],1,1,()=>{p[S]=null}),ue(),i=p[s],i?i.p(_,d):(i=p[s]=g[s](_),i.c()),E(i,1),i.m(o.parentNode,o))},i(_){a||(E(e.$$.fragment,_),E(f),E(i),a=!0)},o(_){N(e.$$.fragment,_),N(f),N(i),a=!1},d(_){_&&(le(t),le(n),le(o)),P(e,_),f&&f.d(_),p[s].d(_)}}}function xt(l){let e,t,n,s;const i=[Pt,Kt],o=[];function a(r,c){return r[13]?1:0}return e=a(l),t=o[e]=i[e](l),{c(){t.c(),n=Ie()},m(r,c){o[e].m(r,c),te(r,n,c),s=!0},p(r,[c]){let f=e;e=a(r),e===f?o[e].p(r,c):(de(),N(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(r,c):(t=o[e]=i[e](r),t.c()),E(t,1),t.m(n.parentNode,n))},i(r){s||(E(t),s=!0)},o(r){N(t),s=!1},d(r){r&&le(n),o[e].d(r)}}}function en(l,e,t){let{gradio:n}=e,{elem_id:s=""}=e,{elem_classes:i=[]}=e,{visible:o=!0}=e,{value:a}=e,r,{show_legend:c}=e,{show_inline_category:f}=e,{color_map:g={}}=e,{label:p=n.i18n("highlighted_text.highlighted_text")}=e,{container:b=!0}=e,{scale:_=null}=e,{min_width:d=void 0}=e,{_selectable:w=!1}=e,{combine_adjacent:S=!1}=e,{interactive:y}=e,{show_label:h=!0}=e,{rtl:j=!1}=e,{loading_status:m}=e;const z=()=>n.dispatch("clear_status",m),B=({detail:k})=>n.dispatch("select",k),Ce=()=>n.dispatch("clear_status",m);function Ne(k){a=k,t(0,a),t(17,S)}const Te=()=>n.dispatch("change");return l.$$set=k=>{"gradio"in k&&t(2,n=k.gradio),"elem_id"in k&&t(3,s=k.elem_id),"elem_classes"in k&&t(4,i=k.elem_classes),"visible"in k&&t(5,o=k.visible),"value"in k&&t(0,a=k.value),"show_legend"in k&&t(6,c=k.show_legend),"show_inline_category"in k&&t(7,f=k.show_inline_category),"color_map"in k&&t(1,g=k.color_map),"label"in k&&t(8,p=k.label),"container"in k&&t(9,b=k.container),"scale"in k&&t(10,_=k.scale),"min_width"in k&&t(11,d=k.min_width),"_selectable"in k&&t(12,w=k._selectable),"combine_adjacent"in k&&t(17,S=k.combine_adjacent),"interactive"in k&&t(13,y=k.interactive),"show_label"in k&&t(14,h=k.show_label),"rtl"in k&&t(15,j=k.rtl),"loading_status"in k&&t(16,m=k.loading_status)},l.$$.update=()=>{l.$$.dirty&2&&!g&&Object.keys(g).length&&t(1,g),l.$$.dirty&131073&&a&&S&&t(0,a=Sl(a)),l.$$.dirty&262149&&a!==r&&(t(18,r=a),n.dispatch("change"))},[a,g,n,s,i,o,c,f,p,b,_,d,w,y,h,j,m,S,r,z,B,Ce,Ne,Te]}class cn extends Mt{constructor(e){super(),At(this,e,en,xt,Ft,{gradio:2,elem_id:3,elem_classes:4,visible:5,value:0,show_legend:6,show_inline_category:7,color_map:1,label:8,container:9,scale:10,min_width:11,_selectable:12,combine_adjacent:17,interactive:13,show_label:14,rtl:15,loading_status:16})}get gradio(){return this.$$.ctx[2]}set gradio(e){this.$$set({gradio:e}),I()}get elem_id(){return this.$$.ctx[3]}set elem_id(e){this.$$set({elem_id:e}),I()}get elem_classes(){return this.$$.ctx[4]}set elem_classes(e){this.$$set({elem_classes:e}),I()}get visible(){return this.$$.ctx[5]}set visible(e){this.$$set({visible:e}),I()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),I()}get show_legend(){return this.$$.ctx[6]}set show_legend(e){this.$$set({show_legend:e}),I()}get show_inline_category(){return this.$$.ctx[7]}set show_inline_category(e){this.$$set({show_inline_category:e}),I()}get color_map(){return this.$$.ctx[1]}set color_map(e){this.$$set({color_map:e}),I()}get label(){return this.$$.ctx[8]}set label(e){this.$$set({label:e}),I()}get container(){return this.$$.ctx[9]}set container(e){this.$$set({container:e}),I()}get scale(){return this.$$.ctx[10]}set scale(e){this.$$set({scale:e}),I()}get min_width(){return this.$$.ctx[11]}set min_width(e){this.$$set({min_width:e}),I()}get _selectable(){return this.$$.ctx[12]}set _selectable(e){this.$$set({_selectable:e}),I()}get combine_adjacent(){return this.$$.ctx[17]}set combine_adjacent(e){this.$$set({combine_adjacent:e}),I()}get interactive(){return this.$$.ctx[13]}set interactive(e){this.$$set({interactive:e}),I()}get show_label(){return this.$$.ctx[14]}set show_label(e){this.$$set({show_label:e}),I()}get rtl(){return this.$$.ctx[15]}set rtl(e){this.$$set({rtl:e}),I()}get loading_status(){return this.$$.ctx[16]}set loading_status(e){this.$$set({loading_status:e}),I()}}export{Ht as BaseInteractiveHighlightedText,bt as BaseStaticHighlightedText,cn as default};
6//# sourceMappingURL=Index-S5e3TuCs.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.