1import{S as L,i as Z,s as F,A as q,B as _,f as p,D as y,E as z,p as k,e as ne,q as se,al as J,F as C,H as A,G as j,J as I,N as G,I as V,a2 as ue,O as N,C as D,c as B,m as E,o as H,t as T,l as O,v as _e,a7 as me,g as ge,h as de,k as Y,n as K,x as he}from"./index.a6771086.js";import{g as be}from"./color.9199be03.js";import{a as pe}from"./Empty.svelte_svelte_type_style_lang.d6377f22.js";import{B as ke}from"./BlockLabel.b490a462.js";import{E as ve}from"./Empty.b61eaa47.js";/* empty css */function ye(t){let e,n,l;return{c(){e=q("svg"),n=q("path"),l=q("path"),_(n,"fill","currentColor"),_(n,"d","M12 15H5a3 3 0 0 1-3-3v-2a3 3 0 0 1 3-3h5V5a1 1 0 0 0-1-1H3V2h6a3 3 0 0 1 3 3zM5 9a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h5V9zm15 14v2a1 1 0 0 0 1 1h5v-4h-5a1 1 0 0 0-1 1z"),_(l,"fill","currentColor"),_(l,"d","M2 30h28V2Zm26-2h-7a3 3 0 0 1-3-3v-2a3 3 0 0 1 3-3h5v-2a1 1 0 0 0-1-1h-6v-2h6a3 3 0 0 1 3 3Z"),_(e,"xmlns","http://www.w3.org/2000/svg"),_(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),_(e,"aria-hidden","true"),_(e,"role","img"),_(e,"class","iconify iconify--carbon"),_(e,"width","100%"),_(e,"height","100%"),_(e,"preserveAspectRatio","xMidYMid meet"),_(e,"viewBox","0 0 32 32")},m(a,o){p(a,e,o),y(e,n),y(e,l)},p:z,i:z,o:z,d(a){a&&k(e)}}}class oe extends L{constructor(e){super(),Z(this,e,null,ye,F,{})}}function P(t,e,n){const l=t.slice();return l[18]=e[n][0],l[24]=e[n][1],l}function Q(t,e,n){const l=t.slice();return l[18]=e[n][0],l[19]=e[n][1],l[21]=n,l}function U(t,e,n){const l=t.slice();return l[19]=e[n][0],l[22]=e[n][1],l[21]=n,l}function we(t){let e,n,l=t[1]&&W(),a=t[0],o=[];for(let s=0;s<a.length;s+=1)o[s]=X(P(t,a,s));return{c(){l&&l.c(),e=j(),n=C("div");for(let s=0;s<o.length;s+=1)o[s].c();_(n,"class","textfield svelte-y52025"),_(n,"data-testid","highlighted-text:textfield")},m(s,r){l&&l.m(s,r),p(s,e,r),p(s,n,r);for(let i=0;i<o.length;i+=1)o[i].m(n,null)},p(s,r){if(s[1]?l||(l=W(),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1){a=s[0];let i;for(i=0;i<a.length;i+=1){const c=P(s,a,i);o[i]?o[i].p(c,r):(o[i]=X(c),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=a.length}},d(s){l&&l.d(s),s&&k(e),s&&k(n),G(o,s)}}}function He(t){let e,n,l=t[1]&&$(t),a=t[0],o=[];for(let s=0;s<a.length;s+=1)o[s]=le(Q(t,a,s));return{c(){l&&l.c(),e=j(),n=C("div");for(let s=0;s<o.length;s+=1)o[s].c();_(n,"class","textfield svelte-y52025")},m(s,r){l&&l.m(s,r),p(s,e,r),p(s,n,r);for(let i=0;i<o.length;i+=1)o[i].m(n,null)},p(s,r){if(s[1]?l?l.p(s,r):(l=$(s),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&95){a=s[0];let i;for(i=0;i<a.length;i+=1){const c=Q(s,a,i);o[i]?o[i].p(c,r):(o[i]=le(c),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=a.length}},d(s){l&&l.d(s),s&&k(e),s&&k(n),G(o,s)}}}function W(t){let e;return{c(){e=C("div"),e.innerHTML=`<span>-1</span> 2 <span>0</span> 3 <span>+1</span>`,_(e,"class","color-legend svelte-y52025"),_(e,"data-testid","highlighted-text:color-legend")},m(n,l){p(n,e,l)},d(n){n&&k(e)}}}function X(t){let e,n,l=t[18]+"",a,o,s;return{c(){e=C("span"),n=C("span"),a=A(l),o=j(),_(n,"class","text svelte-y52025"),_(e,"class","textspan score-text svelte-y52025"),_(e,"style",s="background-color: rgba("+(t[24]<0?"128, 90, 213,"+-t[24]:"239, 68, 60,"+t[24])+")")},m(r,i){p(r,e,i),y(e,n),y(n,a),y(e,o)},p(r,i){i&1&&l!==(l=r[18]+"")&&I(a,l),i&1&&s!==(s="background-color: rgba("+(r[24]<0?"128, 90, 213,"+-r[24]:"239, 68, 60,"+r[24])+")")&&_(e,"style",s)},d(r){r&&k(e)}}}function $(t){let e,n=Object.entries(t[3]),l=[];for(let a=0;a<n.length;a+=1)l[a]=x(U(t,n,a));return{c(){e=C("div");for(let a=0;a<l.length;a+=1)l[a].c();_(e,"class","category-legend svelte-y52025"),_(e,"data-testid","highlighted-text:category-legend")},m(a,o){p(a,e,o);for(let s=0;s<l.length;s+=1)l[s].m(e,null)},p(a,o){if(o&392){n=Object.entries(a[3]);let s;for(s=0;s<n.length;s+=1){const r=U(a,n,s);l[s]?l[s].p(r,o):(l[s]=x(r),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=n.length}},d(a){a&&k(e),G(l,a)}}}function x(t){let e,n=t[19]+"",l,a,o,s,r;function i(){return t[10](t[19])}function c(){return t[11](t[19])}return{c(){e=C("div"),l=A(n),a=j(),_(e,"class","category-label svelte-y52025"),_(e,"style",o="background-color:"+t[22].secondary)},m(u,d){p(u,e,d),y(e,l),y(e,a),s||(r=[V(e,"mouseover",i),V(e,"focus",c),V(e,"mouseout",t[12]),V(e,"blur",t[13])],s=!0)},p(u,d){t=u,d&8&&n!==(n=t[19]+"")&&I(l,n),d&8&&o!==(o="background-color:"+t[22].secondary)&&_(e,"style",o)},d(u){u&&k(e),s=!1,ue(r)}}}function ee(t){let e,n,l=t[19]+"",a;return{c(){e=A(`\xA0 4 `),n=C("span"),a=A(l),_(n,"class","label svelte-y52025"),D(n,"background-color",t[19]===null||t[4]&&t[4]!==t[19]?"":t[3][t[19]].primary,!1)},m(o,s){p(o,e,s),p(o,n,s),y(n,a)},p(o,s){s&1&&l!==(l=o[19]+"")&&I(a,l),s&25&&D(n,"background-color",o[19]===null||o[4]&&o[4]!==o[19]?"":o[3][o[19]].primary,!1)},d(o){o&&k(e),o&&k(n)}}}function le(t){let e,n,l=t[18]+"",a,o,s,r,i,c=!t[1]&&t[19]!==null&&ee(t);function u(){return t[14](t[21],t[18],t[19])}return{c(){e=C("span"),n=C("span"),a=A(l),o=j(),c&&c.c(),s=j(),_(n,"class","text svelte-y52025"),N(n,"no-label",!t[3][t[19]]),_(e,"class","textspan svelte-y52025"),N(e,"no-cat",t[19]===null||t[4]&&t[4]!==t[19]),N(e,"hl",t[19]!==null),N(e,"selectable",t[2]),D(e,"background-color",t[19]===null||t[4]&&t[4]!==t[19]?"":t[3][t[19]].secondary,!1)}
4,m(d,g){p(d,e,g),y(e,n),y(n,a),y(e,o),c&&c.m(e,null),y(e,s),r||(i=V(e,"click",u),r=!0)},p(d,g){t=d,g&1&&l!==(l=t[18]+"")&&I(a,l),g&9&&N(n,"no-label",!t[3][t[19]]),!t[1]&&t[19]!==null?c?c.p(t,g):(c=ee(t),c.c(),c.m(e,s)):c&&(c.d(1),c=null),g&17&&N(e,"no-cat",t[19]===null||t[4]&&t[4]!==t[19]),g&1&&N(e,"hl",t[19]!==null),g&4&&N(e,"selectable",t[2]),g&25&&D(e,"background-color",t[19]===null||t[4]&&t[4]!==t[19]?"":t[3][t[19]].secondary,!1)},d(d){d&&k(e),c&&c.d(),r=!1,i()}}}function Te(t){let e;function n(o,s){return o[5]==="categories"?He:we}let l=n(t),a=l(t);return{c(){a.c(),e=ne()},m(o,s){a.m(o,s),p(o,e,s)},p(o,[s]){l===(l=n(o))&&a?a.p(o,s):(a.d(1),a=l(o),a&&(a.c(),a.m(e.parentNode,e)))},i:z,o:z,d(o){a.d(o),o&&k(e)}}}function Ce(t,e,n){const l=typeof document<"u";let{value:a=[]}=e,{show_legend:o=!1}=e,{color_map:s={}}=e,{selectable:r=!1}=e,i,c={},u="";function d(h,v){if(!i){var w=document.createElement("canvas");i=w.getContext("2d")}i.fillStyle=h,i.fillRect(0,0,1,1);const[R,fe,ce]=i.getImageData(0,0,1,1).data;return i.clearRect(0,0,1,1),`rgba(${R}, ${fe}, ${ce}, ${255/v})`}const g=se();let M;function f(h){n(4,u=h)}function b(){n(4,u="")}const m=h=>f(h),S=h=>f(h),ae=()=>b(),ie=()=>b(),re=(h,v,w)=>{g("select",{index:h,value:[v,w]})};return t.$$set=h=>{"value"in h&&n(0,a=h.value),"show_legend"in h&&n(1,o=h.show_legend),"color_map"in h&&n(9,s=h.color_map),"selectable"in h&&n(2,r=h.selectable)},t.$$.update=()=>{if(t.$$.dirty&513){let h=function(){for(const v in s){const w=s[v].trim();w in J?n(3,c[v]=J[w],c):n(3,c[v]={primary:l?d(s[v],1):s[v],secondary:l?d(s[v],.5):s[v]},c)}};if(s||n(9,s={}),a.length>0){for(let[v,w]of a)if(w!==null)if(typeof w=="string"){if(n(5,M="categories"),!(w in s)){let R=be(Object.keys(s).length);n(9,s[w]=R,s)}}else n(5,M="scores")}h()}},[a,o,r,c,u,M,g,f,b,s,m,S,ae,ie,re]}class Me extends L{constructor(e){super(),Z(this,e,Ce,Te,F,{value:0,show_legend:1,color_map:9,selectable:2})}}function te(t){let e,n;return e=new ke({props:{Icon:oe,label:t[6],float:!1,disable:typeof t[0].container=="boolean"&&!t[0].container}}),{c(){B(e.$$.fragment)},m(l,a){E(e,l,a),n=!0},p(l,a){const o={};a&64&&(o.label=l[6]),a&1&&(o.disable=typeof l[0].container=="boolean"&&!l[0].container),e.$set(o)},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){T(e.$$.fragment,l),n=!1},d(l){O(e,l)}}}function Ne(t){let e,n;return e=new ve({props:{$$slots:{default:[Be]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(l,a){E(e,l,a),n=!0},p(l,a){const o={};a&8192&&(o.$$scope={dirty:a,ctx:l}),e.$set(o)},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){T(e.$$.fragment,l),n=!1},d(l){O(e,l)}}}function je(t){let e,n;return e=new Me({props:{selectable:t[7],value:t[4],show_legend:t[5],color_map:t[0].color_map}}),e.$on("select",t[11]),{c(){B(e.$$.fragment)},m(l,a){E(e,l,a),n=!0},p(l,a){const o={};a&128&&(o.selectable=l[7]),a&16&&(o.value=l[4]),a&32&&(o.show_legend=l[5]),a&1&&(o.color_map=l[0].color_map),e.$set(o)},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){T(e.$$.fragment,l),n=!1},d(l){O(e,l)}}}function Be(t){let e,n;return e=new oe({}),{c(){B(e.$$.fragment)},m(l,a){E(e,l,a),n=!0},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){T(e.$$.fragment,l),n=!1},d(l){O(e,l)}}}function Ee(t){let e,n,l,a,o,s,r;const i=[t[8]];let c={};for(let f=0;f<i.length;f+=1)c=_e(c,i[f]);e=new me({props:c});let u=t[6]&&te(t);const d=[je,Ne],g=[];function M(f,b){return f[4]?0:1}return a=M(t),o=g[a]=d[a](t),{c(){B(e.$$.fragment),n=j(),u&&u.c(),l=j(),o.c(),s=ne()},m(f,b){E(e,f,b),p(f,n,b),u&&u.m(f,b),p(f,l,b),g[a].m(f,b),p(f,s,b),r=!0},p(f,b){const m=b&256?ge(i,[de(f[8])]):{};e.$set(m),f[6]?u?(u.p(f,b),b&64&&H(u,1)):(u=te(f),u.c(),H(u,1),u.m(l.parentNode,l)):u&&(Y(),T(u,1,1,()=>{u=null}),K());let S=a;a=M(f),a===S?g[a].p(f,b):(Y(),T(g[S],1,1,()=>{g[S]=null}),K(),o=g[a],o?o.p(f,b):(o=g[a]=d[a](f),o.c()),H(o,1),o.m(s.parentNode,s))},i(f){r||(H(e.$$.fragment,f),H(u),H(o),r=!0)},o(f){T(e.$$.fragment,f),T(u),T(o),r=!1},d(f){O(e,f),f&&k(n),u&&u.d(f),f&&k(l),g[a].d(f),f&&k(s)}}}function Oe(t){let e,n;return e=new pe({props:{test_id:"highlighted-text",visible:t[3],elem_id:t[1],elem_classes:t[2],padding:!1,disable:typeof t[0].container=="boolean"&&!t[0].container,$$slots:{default:[Ee]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(l,a){E(e,l,a),n=!0},p(l,[a]){const o={};
4a&8&&(o.visible=l[3]),a&2&&(o.elem_id=l[1]),a&4&&(o.elem_classes=l[2]),a&1&&(o.disable=typeof l[0].container=="boolean"&&!l[0].container),a&8689&&(o.$$scope={dirty:a,ctx:l}),e.$set(o)},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){T(e.$$.fragment,l),n=!1},d(l){O(e,l)}}}function Se(t,e,n){let{elem_id:l=""}=e,{elem_classes:a=[]}=e,{visible:o=!0}=e,{value:s}=e,r,{show_legend:i}=e,{color_map:c={}}=e,{label:u="Highlighted Text"}=e,{style:d={}}=e,{selectable:g=!1}=e,{loading_status:M}=e;const f=se();function b(m){he.call(this,t,m)}return t.$$set=m=>{"elem_id"in m&&n(1,l=m.elem_id),"elem_classes"in m&&n(2,a=m.elem_classes),"visible"in m&&n(3,o=m.visible),"value"in m&&n(4,s=m.value),"show_legend"in m&&n(5,i=m.show_legend),"color_map"in m&&n(9,c=m.color_map),"label"in m&&n(6,u=m.label),"style"in m&&n(0,d=m.style),"selectable"in m&&n(7,g=m.selectable),"loading_status"in m&&n(8,M=m.loading_status)},t.$$.update=()=>{t.$$.dirty&513&&!d.color_map&&Object.keys(c).length&&n(0,d.color_map=c,d),t.$$.dirty&1040&&s!==r&&(n(10,r=s),f("change"))},[d,l,a,o,s,i,u,g,M,c,r,b]}class Ve extends L{constructor(e){super(),Z(this,e,Se,Oe,F,{elem_id:1,elem_classes:2,visible:3,value:4,show_legend:5,color_map:9,label:6,style:0,selectable:7,loading_status:8})}}var Le=Ve;const Ze=["static"],Fe=t=>({type:{payload:"Array<[string, string | number]>"},description:{payload:"list of text spans and corresponding label / value"}});export{Le as Component,Fe as document,Ze as modes}; 5//# sourceMappingURL=index.9cc5751b.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.