import{t as F,a as u,n as k,s as j}from"./Dp8zidyZ.js";import{p as B,f as p,s as L,a as A,t as z,c as w,r as S,j as h,o as q,q as R,l as W}from"./CaZnWIme.js";import{p as T,i as y,b as X}from"./OONWT0Nj.js";import{g as v}from"./pKKESLv8.js";import"./BzArsHZA.js";import{c as e}from"./rra-okeK.js";import{S as D}from"./DoZT-Mpu.js";import"./CYsOZZcr.js";var G=F("<!> <!>",1);function Z(_,t){B(t,!0);const g=T(t,"showLabel",3,!1),{x:c,y:m,width:r,height:a,annotation_label:{annotation_label_name:i}}=t.annotation,f=v(i,1),l=v(i,.8).color,o=v(i,.2).color;var b=G(),s=p(b);{var x=n=>{K(n,{coordinates:[c,m],colorText:f,label:i})};y(s,n=>{g()&&n(x)})}var d=L(s,2);{var C=n=>{D(n,{get segmentation(){return t.annotation.segmentation__binary_mask__rle_row_wise},get width(){return t.imageWidth},colorFill:o})},E=n=>{I(n,{bbox:[c,m,r,a],label:i,colorStroke:l,colorFill:o})};y(d,n=>{t.annotation.segmentation__binary_mask__rle_row_wise?n(C):n(E,!1)})}u(_,b),A()}var H=k('<rect vector-effect="non-scaling-stroke" stroke-width="2" pointer-events="all"></rect>');function I(_,t){const[g,c,m,r]=t.bbox;var a=H();e(a,"x",g),e(a,"y",c),e(a,"width",m),e(a,"height",r),z(()=>{e(a,"stroke",t.colorStroke),e(a,"fill",t.colorFill),e(a,"aria-label",t.label)}),u(_,a)}var J=k('<g class="unscaled"><rect></rect><text class="annotation-label-text"> </text></g>');function K(_,t){B(t,!0);const g=T(t,"fontSize",3,14),[c,m]=t.coordinates;let r=q(null);const a=W(()=>{if(h(r))return h(r).getBBox()}),i=5;var f=J();e(f,"transform",`translate(${c}, ${m})`);var l=w(f),o=L(l);e(o,"x",i),e(o,"y",-5);var b=w(o,!0);S(o),X(o,s=>R(r,s),()=>h(r)),S(f),z(()=>{var s,x,d;e(l,"y",-((s=h(a))==null?void 0:s.height)),e(l,"width",((x=h(a))==null?void 0:x.width)+i*2),e(l,"height",(d=h(a))==null?void 0:d.height),e(l,"fill",t.colorText.color),e(o,"fill",t.colorText.contrastColor),e(o,"font-size",g()),j(b,t.label)}),u(_,f),A()}export{Z as S};
