UNPKG

modified-dicom-pacs

Version:

A modified version of DICOM PACS implementation

1 lines 407 kB
"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[236],{1904:(e,t,n)=>{n.d(t,{A:()=>i});const i=[[0,0,0,0],[221,84,84,255],[77,228,121,255],[166,70,235,255],[189,180,116,255],[109,182,196,255],[204,101,157,255],[123,211,94,255],[93,87,218,255],[225,128,80,255],[73,232,172,255],[181,119,186,255],[176,193,112,255],[105,153,200,255],[208,97,120,255],[90,215,101,255],[135,83,222,255],[229,178,76,255],[122,183,181,255],[190,115,171,255],[149,197,108,255],[100,118,205,255],[212,108,93,255],[86,219,141,255],[183,79,226,255],[233,233,72,255],[118,167,187,255],[194,111,146,255],[116,201,104,255],[115,96,209,255],[216,147,89,255],[82,223,188,255],[230,75,224,255],[163,184,121,255],[114,143,191,255],[198,107,114,255],[99,206,122,255],[153,92,213,255],[220,192,85,255],[78,215,227,255],[234,71,173,255],[141,188,117,255],[110,113,195,255],[202,128,103,255],[95,210,157,255],[195,88,217,255],[206,224,81,255],[74,166,231,255],[185,120,139,255],[113,192,113,255],[133,106,199,255],[207,162,98,255],[91,214,198,255],[221,84,198,255],[159,228,77,255],[70,111,235,255],[189,119,116,255],[109,196,138,255],[165,101,204,255],[211,201,94,255],[87,191,218,255],[225,80,153,255],[106,232,73,255],[124,119,186,255],[193,142,112,255],[105,200,168,255],[203,97,208,255],[184,215,90,255],[83,147,222,255],[229,76,101,255],[122,183,130,255],[146,115,190,255],[197,171,108,255],[100,205,205,255],[212,93,177,255],[141,219,86,255],[79,97,226,255],[233,99,72,255],[118,187,150,255],[173,111,194,255],[197,201,104,255],[96,171,209,255],[216,89,137,255],[94,223,82,255],[107,75,230,255],[184,153,121,255],[114,191,175,255],[198,107,191,255],[166,206,99,255],[92,132,213,255],[220,85,91,255],[78,227,115,255],[159,71,234,255],[188,176,117,255],[110,185,195,255],[202,103,161,255],[129,210,95,255],[88,88,217,255],[224,123,81,255],[74,231,166,255],[177,120,185,255],[179,192,113,255],[106,156,199,255],[207,98,125,255],[91,214,96,255],[130,84,221,255],[228,171,77,255],[70,235,221,255],[189,116,174,255],[153,196,109,255],[101,123,204,255],[211,104,94,255],[87,218,136,255],[177,80,225,255],[232,225,73,255],[119,169,186,255],[193,112,149,255],[121,200,105,255],[111,97,208,255],[215,142,90,255],[83,222,181,255],[229,76,229,255],[165,183,122,255],[115,146,190,255],[197,108,119,255],[100,205,118,255],[148,93,212,255],[219,186,86,255],[79,220,226,255],[233,72,179,255],[144,187,118,255],[111,118,194,255],[201,124,104,255],[96,209,153,255],[189,89,216,255],[211,223,82,255],[75,172,230,255],[184,121,142,255],[117,191,114,255],[130,107,198,255],[206,157,99,255],[92,213,193,255],[220,85,203,255],[165,227,78,255],[71,118,234,255],[188,117,117,255],[110,195,135,255],[161,103,202,255],[210,195,95,255],[88,195,217,255],[224,81,158,255],[113,231,74,255],[123,120,185,255],[192,139,113,255],[106,199,164,255],[198,98,207,255],[188,214,91,255],[84,153,221,255],[228,77,108,255],[70,235,84,255],[143,116,189,255],[196,167,109,255],[101,204,199,255],[211,94,182,255],[147,218,87,255],[80,104,225,255],[232,93,73,255],[119,186,147,255],[170,112,193,255],[200,200,105,255],[97,175,208,255],[215,90,142,255],[100,222,83,255],[101,76,229,255],[183,150,122,255],[115,190,171,255],[197,108,194,255],[170,205,100,255],[93,138,212,255],[219,86,97,255],[79,226,110,255],[153,72,233,255],[187,173,118,255],[111,187,194,255],[201,104,165,255],[134,209,96,255],[89,95,216,255],[223,117,82,255],[75,230,159,255],[174,121,184,255],[182,191,114,255],[107,160,198,255],[206,99,130,255],[92,213,92,255],[124,85,220,255],[227,165,78,255],[71,234,214,255],[188,117,176,255],[156,195,110,255],[103,128,202,255],[210,100,95,255],[88,217,131,255],[170,81,224,255],[231,218,74,255],[120,172,185,255],[192,113,153,255],[125,199,106,255],[107,98,207,255],[214,137,91,255],[84,221,175,255],[222,77,228,255],[194,235,70,255],[116,149,189,255],[196,109,123,255],[101,204,114,255],[143,94,211,255],[218,180,87,255],[80,225,225,255],[232,73,186,255],[147,186,119,255],[112,122,193,255],[200,121,105,255],[97,208,148,255],[184,90,215,255],[216,222,83,255],[76,178,229,255],[183,122,145,255],[121,190,115,255],[126,108,197,255],[205,153,100,255],[93,212,187,255],[219,86,208,255],[171,226,79,255],[72,126,233,255],[187,118,121,255],[111,194,132,255],[157,104,201,255],[209,190,96,255],[89,200,216,255],[223,82,164,255],[120,230,75,255],[121,121,184,255],[191,136,114,255],[107,198,160,255],[192,99,206,255],[193,213,92,255],[85,158,220,255],[227,78,115,255],[71,234,78,255],[141,117,188,255],[195,163,110,255],[103,202,194,255],[210,95,186,255],[153,217,88,255],[81,111,224,255]]},55965:(e,t,n)=>{n.r(t),n.d(t,{COLOR_LUT:()=>i.A});var i=n(1904)},40233:(e,t,n)=>{n.r(t),n.d(t,{hideElementCursor:()=>l,initElementCursor:()=>a,resetElementCursor:()=>r,setElementCursor:()=>s});var i=n(32916);const o=Symbol("ElementCursorsMap");function a(e,t){d(e)[0]=t,s(e,t)}function s(e,t){const n=d(e);n[1]=n[0],n[0]=t,e.style.cursor=(t instanceof i.MouseCursor?t:i.MouseCursor.getDefinedCursor("auto")).getStyleProperty()}function r(e){s(e,d(e)[1])}function l(e){s(e,i.MouseCursor.getDefinedCursor("none"))}function d(e){let t=d[o];t instanceof WeakMap||(t=new WeakMap,Object.defineProperty(d,o,{value:t}));let n=t.get(e);return n||(n=[null,null],t.set(e,n)),n}},32916:(e,t,n)=>{n.r(t),n.d(t,{CursorNames:()=>M,CursorSVG:()=>f,ImageMouseCursor:()=>d,MouseCursor:()=>a,SVGMouseCursor:()=>D,elementCursor:()=>R,registerCursor:()=>I,setCursorForElement:()=>O});const i=Symbol("DefinedCursors"),o=new Set(["alias","all-scroll","auto","cell","col-resize","context-menu","copy","crosshair","default","e-resize","ew-resize","grab","grabbing","help","move","ne-resize","nesw-resize","no-drop","none","not-allowed","n-resize","ns-resize","nw-resize","nwse-resize","pointer","progress","row-resize","se-resize","s-resize","sw-resize","text","vertical-text","wait","w-resize","zoom-in","zoom-out"]);class a{constructor(e,t){this.name=e+"",this.fallback=t}getName(){return this.name+""}addFallbackStyleProperty(e){const{fallback:t}=this;return t instanceof a?`${e}, ${t.getStyleProperty()}`:e+""}getStyleProperty(){return this.addFallbackStyleProperty(this.name)+""}static getDefinedCursor(e){const t=s(a,i);let n=t.get(e);return n instanceof a?n:o.has(e)?(n=new a(e),t.set(e,n),n):void 0}static setDefinedCursor(e,t){if(t instanceof a){return s(a,i).set(e,t),!0}return!1}}function s(e,t){let n=e[t];return n instanceof Map||(n=new Map,Object.defineProperty(e,t,{value:n})),n}const r=o.values();var l=n(92136);class d extends a{constructor(e,t,n,i,o){super(i||d.getUniqueInstanceName("image-cursor"),o),this.url=e,this.x=Number(t)||0,this.y=Number(n)||0}getStyleProperty(){const{url:e,x:t,y:n}=this;let i=`url('${e}')`;return t>=0&&n>=0&&(t>0||n>0)&&(i+=` ${t} ${n}`),this.addFallbackStyleProperty(i)}static getUniqueInstanceName(e){return`${e}-${l.utilities.getRuntimeId(d)}`}}var c=n(84901);const h={iconContent:"",iconSize:16,viewBox:{x:16,y:16},mousePoint:{x:8,y:8},mousePointerGroupString:'\n <path stroke="{{color}}" d="M8 16L8 0"></path>\n <path stroke="{{color}}" d="M16 8L0 8"></path>\n '},g={x:127,y:60},u='\n<rect fill="{{color}}" x="80.19" y="25.03" width="47.14" height="15.85"/>\n',m='\n<rect fill="{{color}}" x="80.19" y="25.03" width="47.14" height="15.85"/>\n<rect fill="{{color}}" x="95.84" y="9.38" width="15.85" height="47.14"/>\n',v='<path fill="{{color}}" d="M82.89,10a12.09,12.09,0,0,0-16.8-2.5l-27.5,20.4-8.5-6.3a2.93,2.93,0,0,1-1.1-3,14.66,14.66,0,0,0,.1-6.6,14.08,14.08,0,1,0-6.5,15.2,2.87,2.87,0,0,1,3.2.2l8.2,6.1-8.2,6.1a2.87,2.87,0,0,1-3.2.2,14.16,14.16,0,1,0,6.7,14.4,14,14,0,0,0-.3-5.8,2.93,2.93,0,0,1,1.1-3l8.5-6.3,27.5,20.4A11.91,11.91,0,0,0,82.89,57l-31.7-23.5ZM15.29,21a5.9,5.9,0,1,1,5.9-5.9A5.91,5.91,0,0,1,15.29,21Zm0,36.8a5.9,5.9,0,1,1,5.9-5.9A5.91,5.91,0,0,1,15.29,57.77Zm28.3-21.5a2.8,2.8,0,1,1,2.8-2.8A2.8,2.8,0,0,1,43.59,36.27Z" transform="translate(-1.17 -0.96)"/>',p='<path fill="{{color}}" d="M8.86,2.25V66.08H72.69V2.25H8.86ZM65.28,58.67h-49v-49h49v49Z" transform="translate(-8.86 -2.25)"/>',E='<path fill="{{color}}" d="M40.77,2.25A31.92,31.92,0,1,0,72.69,34.16,31.92,31.92,0,0,0,40.77,2.25Zm0,57.63A25.71,25.71,0,1,1,66.48,34.16,25.71,25.71,0,0,1,40.77,59.87Z" transform="translate(-8.86 -2.25)"/>',f={Angle:w(h,{iconContent:'<path fill="{{color}}" d="M1203 544q0 13-10 23l-393 393 393 393q10 10 10 23t-10 23l-50\n 50q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l466-466q10-10 23-10t23\n 10l50 50q10 10 10 23z" />',viewBox:{x:1792,y:1792}}),ArrowAnnotate:w(h,{iconContent:'<g id="arrowAnnotate-group" fill="none" stroke-width="1" stroke="{{color}}" stroke-linecap="round" stroke-linejoin="round">\n <path id="arrowAnnotate-arrow" d="M23,7 l-15,15 M7,17 l0,6 6,0" stroke-width="2" />\n </g>',viewBox:{x:24,y:24}}),Bidirectional:w(h,{iconContent:'<g fill="{{color}}" stroke-width="3" stroke="{{color}}">\n <path d="M27.63 3.21L3.12 28.81"></path>\n <path d="M27.63 15.75L15.27 4.43"></path>\n <path d="M16.5 4.28C16.5 4.96 15.95 5.51 15.27 5.51C14.59 5.51 14.03 4.96 14.03 4.28C14.03 3.59 14.59 3.04 15.27 3.04C15.95 3.04 16.5 3.59 16.5 4.28Z" ></path>\n <path d="M28.87 3.19C28.87 3.87 28.31 4.43 27.63 4.43C26.95 4.43 26.4 3.87 26.4 3.19C26.4 2.51 26.95 1.95 27.63 1.95C28.31 1.95 28.87 2.51 28.87 3.19Z"></path>\n <path d="M28.87 15.75C28.87 16.43 28.31 16.99 27.63 16.99C26.95 16.99 26.4 16.43 26.4 15.75C26.4 15.07 26.95 14.51 27.63 14.51C28.31 14.51 28.87 15.07 28.87 15.75Z"></path>\n <path d="M4.73 28.44C4.73 29.12 4.17 29.68 3.49 29.68C2.81 29.68 2.25 29.12 2.25 28.44C2.25 27.76 2.81 27.2 3.49 27.2C4.17 27.2 4.73 27.76 4.73 28.44Z"></path>\n </g>',viewBox:{x:48,y:48}}),CobbAngle:w(h,{iconContent:'<g stroke="{{color}}" stroke-width="3">\n <path d="M28.59 2.34L3.82 12.32"></path>\n <path d="M28.59 29.66L3.82 19.68"></path>\n <path stroke-dasharray="2" fill-opacity="0" d="M12.37\n 23.06C12.67 22.36 12.85 21.93 12.92 21.76C14.6 17.8 14.68 13.35 13.15\n 9.33C13.11 9.24 13.02 9 12.88 8.63">\n </path>\n </g>',viewBox:{x:32,y:32}}),CircleROI:w(h,{iconContent:'<circle stroke="{{color}}" fill="none" stroke-width="3" cx="16" cy="16" r="14" />',viewBox:{x:32,y:32}}),EllipticalROI:w(h,{iconContent:'<path stroke="{{color}}" fill="none" stroke-width="3" d="M30.74 15.76C30.74 20.99 24.14 25.23 16\n 25.23C7.86 25.23 1.26 20.99 1.26 15.76C1.26 10.54 7.86 6.3 16 6.3C24.14\n 6.3 30.74 10.54 30.74 15.76Z" />',viewBox:{x:32,y:32}}),FreehandROI:w(h,{iconContent:'<g fill="{{color}}" stroke="{{color}}" stroke-width="2">\n <ellipse ry="1" rx="1" id="svg_3" cy="4.240343" cx="14.306499"/>\n <line id="svg_4" y2="3.58462" x2="12.242186" y1="3.997482" x1="13.432202"/>\n <line id="svg_5" y2="3.268901" x2="10.857882" y1="3.608906" x1="12.387902"/>\n <line id="svg_6" y2="3.147471" x2="9.740724" y1="3.293187" x1="10.955026"/>\n <line id="svg_7" y2="3.147471" x2="8.089274" y1="3.196043" x1="9.983585"/>\n <line id="svg_8" y2="3.268901" x2="6.874972" y1="3.123185" x1="8.307848"/>\n <line id="svg_9" y2="3.657478" x2="5.587812" y1="3.220329" x1="7.020688"/>\n <line id="svg_10" y2="4.046054" x2="4.737801" y1="3.560334" x1="5.854959"/>\n <line id="svg_11" y2="4.337487" x2="4.300652" y1="3.997482" x1="4.834945"/>\n <line id="svg_12" y2="4.726063" x2="3.88779" y1="4.191771" x1="4.470655"/>\n <line id="svg_15" y2="5.3575" x2="3.377783" y1="4.604633" x1="3.960648"/>\n <line id="svg_16" y2="6.183226" x2="2.916348" y1="5.138926" x1="3.547785"/>\n <line id="svg_17" y2="6.960379" x2="2.770632" y1="5.867507" x1="3.037779"/>\n <line id="svg_18" y2="7.713246" x2="2.673488" y1="6.741804" x1="2.819204"/>\n <line id="svg_19" y2="8.684687" x2="2.697774" y1="7.616102" x1="2.673488"/>\n <line id="svg_20" y2="9.753273" x2="2.892062" y1="8.611829" x1="2.697774"/>\n <line id="svg_21" y2="10.724714" x2="3.134923" y1="9.534698" x1="2.84349"/>\n <line id="svg_23" y2="11.647583" x2="3.596357" y1="10.578998" x1="3.086351"/>\n <line id="svg_25" y2="12.521881" x2="4.276366" y1="11.501867" x1="3.499213"/>\n <line id="svg_26" y2="13.930471" x2="5.830673" y1="12.376165" x1="4.13065"/>\n <line id="svg_28" y2="14.707624" x2="7.263549" y1="13.881899" x1="5.733528"/>\n <line id="svg_29" y2="15.339061" x2="8.963571" y1="14.61048" x1="7.06926"/>\n <line id="svg_30" y2="15.581921" x2="10.882168" y1="15.314775" x1="8.817855"/>\n <line id="svg_31" y2="15.460491" x2="12.023612" y1="15.581921" x1="10.785024"/>\n <line id="svg_33" y2="15.120487" x2="13.092197" y1="15.484777" x1="11.877895"/>\n <line id="svg_34" y2="14.586194" x2="13.86935" y1="15.217631" x1="12.897909"/>\n <line id="svg_35" y2="13.833327" x2="14.597931" y1="14.756196" x1="13.699348"/>\n <line id="svg_37" y2="12.716169" x2="15.180796" y1="13.881899" x1="14.549359"/>\n <line id="svg_39" y2="11.429009" x2="15.520801" y1="12.813313" x1="15.15651"/>\n <ellipse ry="1" rx="1" id="svg_40" cy="10.967574" cx="15.520801"/>\n </g>',viewBox:{x:18,y:18}}),FreehandROISculptor:w(h,{iconContent:'<g id="icon-freehand-sculpt" fill="none" stroke-width="1.5" stroke="{{color}}" stroke-linecap="round" stroke-linejoin="round">\n <line id="svg_1" y2="2.559367" x2="10.184807" y1="4.467781" x1="8.81711"/>\n <line id="svg_4" y2="1.493836" x2="11.727442" y1="2.766112" x1="10.089386"/>\n <line id="svg_7" y2="1.080346" x2="13.047428" y1="1.748291" x1="11.345759"/>\n <line id="svg_8" y2="1.000829" x2="14.351511" y1="1.112153" x1="12.77707"/>\n <line id="svg_9" y2="1.350705" x2="15.242104" y1="0.905408" x1="13.969828"/>\n <line id="svg_10" y2="2.098167" x2="15.862339" y1="1.14396" x1="14.955842"/>\n <line id="svg_11" y2="3.195505" x2="16.41896" y1="1.939133" x1="15.766918"/>\n <line id="svg_12" y2="4.292843" x2="16.530284" y1="2.925147" x1="16.387153"/>\n <line id="svg_16" y2="5.644637" x2="16.196311" y1="3.831643" x1="16.593898"/>\n <line id="svg_18" y2="7.266789" x2="15.623787" y1="5.19934" x1="16.275829"/>\n <line id="svg_19" y2="10.813258" x2="14.526449" y1="6.726071" x1="15.766918"/>\n <line id="svg_20" y2="5.056209" x2="8.085552" y1="4.181519" x1="8.976145"/>\n <line id="svg_23" y2="5.326568" x2="7.481221" y1="4.78585" x1="8.403621"/>\n <line id="svg_24" y2="5.565119" x2="6.749662" y1="5.294761" x1="7.624352"/>\n <line id="svg_25" y2="5.994512" x2="5.429675" y1="5.533312" x1="6.956407"/>\n <line id="svg_27" y2="6.551133" x2="4.284627" y1="5.962706" x1="5.572807"/>\n <line id="svg_28" y2="7.584858" x2="3.044158" y1="6.392099" x1="4.427758"/>\n <line id="svg_29" y2="8.84123" x2="2.185372" y1="7.489437" x1="3.219096"/>\n <line id="svg_31" y2="10.606513" x2="1.644654" y1="8.602678" x1="2.280792"/>\n <line id="svg_32" y2="13.214679" x2="1.48562" y1="10.352058" x1="1.724171"/>\n <line id="svg_33" y2="14.375631" x2="1.676461" y1="12.992031" x1="1.453813"/>\n <line id="svg_34" y2="15.298031" x2="2.264889" y1="14.152983" x1="1.517427"/>\n <line id="svg_35" y2="16.172721" x2="3.521261" y1="14.948155" x1="1.915013"/>\n <line id="svg_36" y2="16.824762" x2="5.207027" y1="15.997783" x1="3.28271"/>\n <line id="svg_38" y2="17.063314" x2="7.035924" y1="16.745245" x1="4.968475"/>\n <line id="svg_39" y2="16.888376" x2="9.278311" y1="17.047411" x1="6.733758"/>\n <line id="svg_40" y2="16.284045" x2="10.661911" y1="16.983797" x1="8.992048"/>\n <line id="svg_41" y2="15.313934" x2="11.647925" y1="16.395369" x1="10.455166"/>\n <line id="svg_44" y2="13.898527" x2="12.82478" y1="15.425259" x1="11.504794"/>\n <line id="svg_45" y2="12.037824" x2="14.144766" y1="14.312017" x1="12.522614"/>\n <line id="svg_47" y2="10.59061" x2="14.605966" y1="12.228665" x1="13.953925"/>\n <ellipse ry="1" rx="1" id="svg_48" cy="3.982726" cx="13.460918"/>\n </g>',viewBox:{x:18,y:18}}),Length:w(h,{iconContent:'<g id="length-group" fill="none" stroke-width="1" stroke="{{color}}" stroke-linecap="round" stroke-linejoin="round">\n <path id="length-dashes" d="m22.5,6 -16.5,16.5" stroke-width="3" stroke-dasharray="0.6666,5" />\n </g>',viewBox:{x:24,y:24}}),Probe:w(h,{iconContent:'<path fill="{{color}}" d="M1152 896q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75\n 75 181zm-256-544q-148 0-273 73t-198 198-73 273 73 273 198 198 273 73 273-73\n 198-198 73-273-73-273-198-198-273-73zm768 544q0 209-103 385.5t-279.5\n 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5\n 385.5-103 385.5 103 279.5 279.5 103 385.5z" />',viewBox:{x:1792,y:1792}}),RectangleROI:w(h,{iconContent:'<path fill="{{color}}" d="M1312 256h-832q-66 0-113 47t-47 113v832q0 66 47\n 113t113 47h832q66 0 113-47t47-113v-832q0-66-47-113t-113-47zm288 160v832q0\n 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119\n 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z" />',viewBox:{x:1792,y:1792}}),TextMarker:w(h,{iconContent:'<path fill="{{color}}" d="M789 559l-170 450q33 0 136.5 2t160.5 2q19 0\n 57-2-87-253-184-452zm-725 1105l2-79q23-7 56-12.5t57-10.5 49.5-14.5 44.5-29\n 31-50.5l237-616 280-724h128q8 14 11 21l205 480q33 78 106 257.5t114 274.5q15\n 34 58 144.5t72 168.5q20 45 35 57 19 15 88 29.5t84 20.5q6 38 6 57 0 5-.5\n 13.5t-.5 12.5q-63 0-190-8t-191-8q-76 0-215 7t-178 8q0-43 4-78l131-28q1 0\n 12.5-2.5t15.5-3.5 14.5-4.5 15-6.5 11-8 9-11\n 2.5-14q0-16-31-96.5t-72-177.5-42-100l-450-2q-26 58-76.5 195.5t-50.5 162.5q0\n 22 14 37.5t43.5 24.5 48.5 13.5 57 8.5 41 4q1 19 1 58 0 9-2 27-58\n 0-174.5-10t-174.5-10q-8 0-26.5 4t-21.5 4q-80 14-188 14z" />',viewBox:{x:1792,y:1792}}),Crosshairs:w(h,{iconContent:'<path fill="{{color}}" d="M1325 1024h-109q-26 0-45-19t-19-45v-128q0-26\n 19-45t45-19h109q-32-108-112.5-188.5t-188.5-112.5v109q0 26-19 45t-45\n 19h-128q-26 0-45-19t-19-45v-109q-108 32-188.5 112.5t-112.5 188.5h109q26\n 0 45 19t19 45v128q0 26-19 45t-45 19h-109q32 108 112.5 188.5t188.5\n 112.5v-109q0-26 19-45t45-19h128q26 0 45 19t19 45v109q108-32\n 188.5-112.5t112.5-188.5zm339-192v128q0 26-19 45t-45 19h-143q-37 161-154.5\n 278.5t-278.5 154.5v143q0 26-19 45t-45 19h-128q-26\n 0-45-19t-19-45v-143q-161-37-278.5-154.5t-154.5-278.5h-143q-26\n 0-45-19t-19-45v-128q0-26 19-45t45-19h143q37-161\n 154.5-278.5t278.5-154.5v-143q0-26 19-45t45-19h128q26 0 45 19t19 45v143q161\n 37 278.5 154.5t154.5 278.5h143q26 0 45 19t19 45z" />',viewBox:{x:1792,y:1792}}),Eraser:w(h,{iconContent:'<path transform="translate(0,1792) scale(1,-1)" fill="{{color}}" d="M960 1408l336-384h-768l-336 384h768zm1013-1077q15\n 34 9.5 71.5t-30.5 65.5l-896 1024q-38 44-96 44h-768q-38\n 0-69.5-20.5t-47.5-54.5q-15-34-9.5-71.5t30.5-65.5l896-1024q38-44 96-44h768q38\n 0 69.5 20.5t47.5 54.5z" />',viewBox:{x:2048,y:1792}}),Magnify:w(h,{iconContent:'<path fill="{{color}}" d="M508.5 481.6l-129-129c-2.3-2.3-5.3-3.5-8.5-3.5h-10.3C395\n 312 416 262.5 416 208 416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c54.5\n 0 104-21 141.1-55.2V371c0 3.2 1.3 6.2 3.5 8.5l129 129c4.7 4.7 12.3 4.7 17\n 0l9.9-9.9c4.7-4.7 4.7-12.3 0-17zM208 384c-97.3 0-176-78.7-176-176S110.7 32 208\n 32s176 78.7 176 176-78.7 176-176 176z" />',viewBox:{x:512,y:512}}),Pan:w(h,{iconContent:'<path fill="{{color}}" d="M1411 541l-355 355 355 355 144-144q29-31 70-14 39 17\n 39 59v448q0 26-19 45t-45 19h-448q-42 0-59-40-17-39 14-69l144-144-355-355-355\n 355 144 144q31 30 14 69-17 40-59 40h-448q-26 0-45-19t-19-45v-448q0-42 40-59\n 39-17 69 14l144 144 355-355-355-355-144 144q-19 19-45 19-12\n 0-24-5-40-17-40-59v-448q0-26 19-45t45-19h448q42 0 59 40 17 39-14 69l-144\n 144 355 355 355-355-144-144q-31-30-14-69 17-40 59-40h448q26 0 45 19t19\n 45v448q0 42-39 59-13 5-25 5-26 0-45-19z" />',viewBox:{x:1792,y:1792}}),Rotate:w(h,{iconContent:'<path fill="{{color}}" d="M1664 256v448q0 26-19 45t-45 19h-448q-42 0-59-40-17-39\n 14-69l138-138q-148-137-349-137-104 0-198.5 40.5t-163.5 109.5-109.5\n 163.5-40.5 198.5 40.5 198.5 109.5 163.5 163.5 109.5 198.5 40.5q119 0\n 225-52t179-147q7-10 23-12 15 0 25 9l137 138q9 8 9.5 20.5t-7.5 22.5q-109\n 132-264 204.5t-327 72.5q-156 0-298-61t-245-164-164-245-61-298 61-298\n 164-245 245-164 298-61q147 0 284.5 55.5t244.5 156.5l130-129q29-31 70-14\n 39 17 39 59z" />',viewBox:{x:1792,y:1792}}),StackScroll:w(h,{iconContent:'<path fill="{{color}}" d="M24 21v2c0 0.547-0.453 1-1 1h-22c-0.547\n 0-1-0.453-1-1v-2c0-0.547 0.453-1 1-1h22c0.547 0 1 0.453 1 1zM24 13v2c0\n 0.547-0.453 1-1 1h-22c-0.547 0-1-0.453-1-1v-2c0-0.547 0.453-1 1-1h22c0.547\n 0 1 0.453 1 1zM24 5v2c0 0.547-0.453 1-1 1h-22c-0.547\n 0-1-0.453-1-1v-2c0-0.547 0.453-1 1-1h22c0.547 0 1 0.453 1 1z" />',viewBox:{x:24,y:28}}),WindowLevelRegion:w(h,{iconContent:'<path fill="{{color}}" d="M1664 416v960q0 119-84.5 203.5t-203.5 84.5h-960q-119\n 0-203.5-84.5t-84.5-203.5v-960q0-119 84.5-203.5t203.5-84.5h960q119 0 203.5\n 84.5t84.5 203.5z" />',viewBox:{x:1792,y:1792}}),WindowLevel:w(h,{iconContent:'\n <path fill="{{color}}" d="M14.5,3.5 a1 1 0 0 1 -11,11 Z" stroke="none" opacity="0.8" />\n <circle cx="9" cy="9" r="8" fill="none" stroke-width="2" stroke="{{color}}" />',viewBox:{x:18,y:18}}),Zoom:w(h,{iconContent:'\n <path fill="{{color}}" d="M508.5 481.6l-129-129c-2.3-2.3-5.3-3.5-8.5-3.5h-10.3C395\n 312 416 262.5 416 208 416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c54.5\n 0 104-21 141.1-55.2V371c0 3.2 1.3 6.2 3.5 8.5l129 129c4.7 4.7 12.3 4.7 17\n 0l9.9-9.9c4.7-4.7 4.7-12.3 0-17zM208 384c-97.3 0-176-78.7-176-176S110.7 32 208\n 32s176 78.7 176 176-78.7 176-176 176z" />\n <path fill="{{color}}" transform="scale(0.22,0.22) translate(1400,0)" d="M1216\n 320q0 26-19 45t-45 19h-128v1024h128q26 0 45 19t19 45-19 45l-256 256q-19\n 19-45 19t-45-19l-256-256q-19-19-19-45t19-45 45-19h128v-1024h-128q-26\n 0-45-19t-19-45 19-45l256-256q19-19 45-19t45 19l256 256q19 19 19 45z" />',viewBox:{x:640,y:512}}),SegmentationFreeHandEraseInside:w(h,{iconContent:`${v} ${u}`,viewBox:g}),SegmentationFreeHandFillInside:w(h,{iconContent:`${v} ${m}`,viewBox:g}),SegmentationFreeHandEraseOutside:w(h,{iconContent:`${v} ${u}`,viewBox:g}),SegmentationFreeHandFillOutside:w(h,{iconContent:`${v} ${m}`,viewBox:g}),SegmentationRectangleEraseInside:w(h,{iconContent:`${p} ${u}`,viewBox:g}),RectangleScissor:w(h,{iconContent:`${p} ${m}`,viewBox:g}),"RectangleScissor.FILL_INSIDE":w(h,{iconContent:`${p} ${m}`,viewBox:g}),"RectangleScissor.FILL_OUTSIDE":w(h,{iconContent:`${p} ${m}`,viewBox:g}),"RectangleScissor.ERASE_OUTSIDE":w(h,{iconContent:`${p} ${u}`,viewBox:g}),"RectangleScissor.ERASE_INSIDE":w(h,{iconContent:`${p} ${u}`,viewBox:g}),CircleScissor:w(h,{iconContent:`${E} ${m}`,viewBox:g}),"CircleScissor.FILL_INSIDE":w(h,{iconContent:`${E} ${m}`,viewBox:g}),"CircleScissor.ERASE_OUTSIDE":w(h,{iconContent:`${E} ${u}`,viewBox:g}),"CircleScissor.FILL_OUTSIDE":w(h,{iconContent:`${E} ${m}`,viewBox:g})};function w(e,t){return Object.assign(Object.create(e),t)}function I(e,t,n){f[e]=w(h,{iconContent:t,viewBox:n})}const C=Object.keys(f);var T=n(28664);const _=c.AnnotationStyleStates.Highlighted,S=c.ToolModes.Active;class D extends d{constructor(e,t,n,i,o){super(e,t,n,i,o)}static getDefinedCursor(e,t=!1,n){n||(n=(0,T.h)("color",{},_,S));const i=function(e,t,n){const i=t?"pointer":"cursor";return`${i}:${e}/${n}`}(e,t,n);let o=super.getDefinedCursor(i);if(!o){const a=function(e){return f[e]}(e);a&&(o=function(e,t,n,i,o){const{x:a,y:s}=e.mousePoint;return new D(function(e,t,n){return URL.createObjectURL(function(e,t,n){const i=(t?y:b)(e,n);return new Blob([i],{type:"image/svg+xml"})}(e,t,n))}(e,n,{color:i}),a,s,t,o)}(a,i,t,n,super.getDefinedCursor("default")),super.setDefinedCursor(i,o))}return o}}function A(e,t){const n=Object(t),i=Object.prototype.hasOwnProperty.bind(n);return(e+"").replace(/\{\{(\w+)\}\}/g,((e,t)=>i(t)?n[t]+"":""))}function b(e,t){const{iconContent:n,iconSize:i,viewBox:o}=e;return A(`\n <svg data-icon="cursor" role="img" xmlns="http://www.w3.org/2000/svg"\n width="${i}" height="${i}" viewBox="0 0\n ${o.x} ${o.y}">\n ${n}\n </svg>`,t)}function y(e,t){const{iconContent:n,iconSize:i,viewBox:o,mousePointerGroupString:a}=e,s=16+i;return A(`\n <svg data-icon="cursor" role="img" xmlns="http://www.w3.org/2000/svg"\n width="${s}" height="${s}" viewBox="0 0 ${s} ${s}">\n <g>${a}</g>\n <g transform="translate(16, 16) scale(${i/Math.max(o.x,o.y,1)})">${n}</g>\n </svg>`,t)}var R=n(40233);const O=function(e,t){let n=D.getDefinedCursor(t,!0);n||(n=a.getDefinedCursor(t)),n||(console.log(`Cursor ${t} is not defined either as SVG or as a standard cursor.`),n=a.getDefinedCursor(t)),(0,R.setElementCursor)(e,n)},M=[...C,...r]},2746:(e,t,n)=>{n.r(t),n.d(t,{draw:()=>i.A,drawArrow:()=>T,drawCircle:()=>r,drawEllipse:()=>d,drawEllipseByCoordinates:()=>l,drawHandle:()=>c,drawHandles:()=>h,drawLine:()=>g,drawLinkedTextBox:()=>I,drawPath:()=>m,drawPolyline:()=>u,drawRect:()=>C,drawRedactionRect:()=>_,drawTextBox:()=>E,setAttributesIfNecessary:()=>a,setNewAttributesIfValid:()=>s});var i=n(79697);const o=function(e,t,n){return`${e}::${t}::${n}`};const a=function(e,t){Object.keys(e).forEach((n=>{const i=t.getAttribute(n),o=e[n];void 0===o||""===o?t.removeAttribute(n):i!==o&&t.setAttribute(n,o)}))};const s=function(e,t){Object.keys(e).forEach((n=>{const i=e[n];void 0!==i&&""!==i&&t.setAttribute(n,i)}))};const r=function(e,t,n,i,r,l={},d=""){const{color:c,fill:h,width:g,lineWidth:u,lineDash:m,fillOpacity:v,strokeOpacity:p}=Object.assign({color:"rgb(0, 255, 0)",fill:"transparent",width:"2",lineDash:void 0,lineWidth:void 0,strokeOpacity:1,fillOpacity:1},l),E=u||g,f=o(t,"circle",n),w=e.getSvgNode(f),I={cx:`${i[0]}`,cy:`${i[1]}`,r:`${r}`,stroke:c,fill:h,"stroke-width":E,"stroke-dasharray":m,"fill-opacity":v,"stroke-opacity":p};if(w)a(I,w),e.setNodeTouched(f);else{const t=document.createElementNS("http://www.w3.org/2000/svg","circle");""!==d&&t.setAttribute("data-id",d),s(I,t),e.appendNode(t,f)}};const l=function(e,t,n,i,r={},l=""){const{color:d,width:c,lineWidth:h,lineDash:g}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0},r),u=h||c,m=o(t,"ellipse",n),v=e.getSvgNode(m),[p,E,f,w]=i,I=Math.hypot(f[0]-w[0],f[1]-w[1]),C=Math.hypot(E[0]-p[0],E[1]-p[1]),T=180*Math.atan2(f[1]-w[1],f[0]-w[0])/Math.PI,_=[(f[0]+w[0])/2,(E[1]+p[1])/2],S={cx:`${_[0]}`,cy:`${_[1]}`,rx:`${I/2}`,ry:`${C/2}`,stroke:d,fill:"transparent",transform:`rotate(${T} ${_[0]} ${_[1]})`,"stroke-width":u,"stroke-dasharray":g};if(v)a(S,v),e.setNodeTouched(m);else{const t=document.createElementNS("http://www.w3.org/2000/svg","ellipse");""!==l&&t.setAttribute("data-id",l),s(S,t),e.appendNode(t,m)}};const d=function(e,t,n,i,o,a={},s=""){const r=[(i[0]+o[0])/2,i[1]],d=[(i[0]+o[0])/2,o[1]],c=[i[0],(i[1]+o[1])/2],h=[o[0],(i[1]+o[1])/2];l(e,t,n,[d,r,c,h],{},"")};const c=function(e,t,n,i,r={},l){const{color:d,handleRadius:c,width:h,lineWidth:g,fill:u,type:m,opacity:v}=Object.assign({color:"rgb(0, 255, 0)",handleRadius:"6",width:"2",lineWidth:void 0,fill:"transparent",type:"circle",opacity:1},r),p=g||h,E=o(t,"handle",`hg-${n}-index-${l}`);let f;if("circle"===m)f={cx:`${i[0]}`,cy:`${i[1]}`,r:c,stroke:d,fill:u,"stroke-width":p,opacity:v};else{if("rect"!==m)throw new Error(`Unsupported handle type: ${m}`);{const e=1.5*parseFloat(c);f={x:`${i[0]-.5*e}`,y:`${i[1]-.5*e}`,width:`${e}`,height:`${e}`,stroke:d,fill:u,"stroke-width":p,rx:""+.1*e,opacity:v}}}const w=e.getSvgNode(E);if(w)a(f,w),e.setNodeTouched(E);else{const t=document.createElementNS("http://www.w3.org/2000/svg",m);s(f,t),e.appendNode(t,E)}};const h=function(e,t,n,i,o={}){i.forEach(((i,a)=>{c(e,t,n,i,o,a)}))};function g(e,t,n,i,r,l={},d=""){if(isNaN(i[0])||isNaN(i[1])||isNaN(r[0])||isNaN(r[1]))return;const{color:c,width:h,lineWidth:g,lineDash:u,shadow:m}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0,shadow:void 0},l),v=g||h,p=o(t,"line",n),E=e.getSvgNode(p),f=m?`filter:url(#shadow-${e.svgLayerElement.id});`:"",w={x1:`${i[0]}`,y1:`${i[1]}`,x2:`${r[0]}`,y2:`${r[1]}`,stroke:c,style:f,"stroke-width":v,"stroke-dasharray":u};if(E)a(w,E),e.setNodeTouched(p);else{const t=document.createElementNS("http://www.w3.org/2000/svg","line");""!==d&&t.setAttribute("data-id",d),s(w,t),e.appendNode(t,p)}}function u(e,t,n,i,r){if(i.length<2)return;const{color:l="rgb(0, 255, 0)",width:d=10,fillColor:c="none",fillOpacity:h=0,lineWidth:g,lineDash:u,closePath:m=!1}=r,v=g||d,p=o(t,"polyline",n),E=e.getSvgNode(p);let f="";for(const e of i)f+=`${e[0].toFixed(1)}, ${e[1].toFixed(1)} `;if(m){const e=i[0];f+=`${e[0]}, ${e[1]}`}const w={points:f,stroke:l,fill:c,"fill-opacity":h,"stroke-width":v,"stroke-dasharray":u};if(E)a(w,E),e.setNodeTouched(p);else{const t=document.createElementNS("http://www.w3.org/2000/svg","polyline");s(w,t),e.appendNode(t,p)}}function m(e,t,n,i,r){const l=i.length&&i[0].length&&Array.isArray(i[0][0])?i:[i],{color:d="rgb(0, 255, 0)",width:c=10,fillColor:h="none",fillOpacity:g=0,lineWidth:u,lineDash:m,closePath:v=!1}=r,p=u||c,E=o(t,"path",n),f=e.getSvgNode(E);let w="";for(let e=0,t=l.length;e<t;e++){const t=l[e],n=t.length;if(!(n<2)){for(let e=0;e<n;e++){const n=t[e];w+=`${e?"L":"M"} ${n[0].toFixed(1)}, ${n[1].toFixed(1)} `}v&&(w+="Z ")}}if(!w)return;const I={d:w,stroke:d,fill:h,"fill-opacity":g,"stroke-width":p,"stroke-dasharray":m};if(f)a(I,f),e.setNodeTouched(E);else{const t=document.createElementNS("http://www.w3.org/2000/svg","path");s(I,t),e.appendNode(t,E)}}function v(e){const t=document.createElementNS("http://www.w3.org/2000/svg","tspan");return t.setAttribute("x","0"),t.setAttribute("dy","1.2em"),t.textContent=e,t}function p(e,t){let n=e.querySelector("rect.background");if(!t)return n&&e.removeChild(n),e.getBBox();n||(n=document.createElementNS("http://www.w3.org/2000/svg","rect"),n.setAttribute("class","background"),e.insertBefore(n,e.firstChild));const i=e.getBBox(),o={x:`${i.x}`,y:`${i.y}`,width:`${i.width}`,height:`${i.height}`,fill:t};return a(o,n),i}const E=function(e,t,n,i,s,r={}){return function(e,t,n,i=[""],s,r){const{padding:l,color:d,fontFamily:c,fontSize:h,background:g}=r;let u;const[m,E]=[s[0]+l,s[1]+l],f="http://www.w3.org/2000/svg",w=o(t,"text",n),I=e.getSvgNode(w);if(I){const t=I.querySelector("text"),n=Array.from(t.children);for(let e=0;e<n.length;e++){const t=n[e],o=i[e]||"";t.textContent=o}if(i.length>n.length){for(let e=0;e<i.length-n.length;e++){const o=v(i[e+n.length]);t.appendChild(o)}I.appendChild(t),e.appendNode(I,w)}const o={transform:`translate(${m} ${E})`};a({fill:d,"font-size":h,"font-family":c},t),a(o,I),u=p(I,g),e.setNodeTouched(w)}else{const t=document.createElementNS(f,"g");t.setAttribute("transform",`translate(${m} ${E})`);const n=function(e,t){const{color:n,fontFamily:i,fontSize:o}=t,a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"text"),r="user-select: none; pointer-events: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0);",l=`filter:url(#shadow-${e.svgLayerElement.id});`,d=`${r}${l}`;return s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("fill",n),s.setAttribute("font-family",i),s.setAttribute("font-size",o),s.setAttribute("style",d),s}(e,r);for(let e=0;e<i.length;e++){const t=v(i[e]);n.appendChild(t)}t.appendChild(n),e.appendNode(t,w),u=p(t,g)}return Object.assign({},u,{x:m,y:E,height:u.height+l,width:u.width+l})}(e,t,n,i,s,Object.assign({fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",color:"rgb(255, 255, 0)",background:"",padding:25,centerX:!1,centerY:!0},r))};var f=n(87658);const w=function(e,t,n,i,o,a,s={}){const r=i.length>0?(0,f.A)(i,o):o,l=function(e){const{x:t,y:n,height:i,width:o}=e,a=o/2,s=i/2;return[[t+a,n],[t,n+s],[t+a,n+i],[t+o,n+s]]}(a);g(e,t,`link-${n}`,r,(0,f.A)(l,r),Object.assign({color:"rgb(255, 255, 0)",lineWidth:"1",lineDash:"2,3"},s))};const I=function(e,t,n,i,o,a,s,r={}){const l=Object.assign({handleRadius:"6",centering:{x:!1,y:!0}},r),d=E(e,t,n,i,o,l);return w(e,t,n,a,o,d,l),d};function C(e,t,n,i,r,l={},d=""){const{color:c,width:h,lineWidth:g,lineDash:u}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0},l),m=g||h,v=o(t,"rect",n),p=e.getSvgNode(v),E=[Math.min(i[0],r[0]),Math.min(i[1],r[1])],f=Math.abs(i[0]-r[0]),w=Math.abs(i[1]-r[1]),I={x:`${E[0]}`,y:`${E[1]}`,width:`${f}`,height:`${w}`,stroke:c,fill:"transparent","stroke-width":m,"stroke-dasharray":u};if(p)a(I,p),e.setNodeTouched(v);else{const t=document.createElementNS("http://www.w3.org/2000/svg","rect");""!==d&&t.setAttribute("data-id",d),s(I,t),e.appendNode(t,v)}}function T(e,t,n,i,o,a={}){if(isNaN(i[0])||isNaN(i[1])||isNaN(o[0])||isNaN(o[1]))return;const{color:s,width:r,lineWidth:l,lineDash:d}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0},a);g(e,t,n,i,o,{color:s,width:r,lineWidth:l,lineDash:d});const c=Math.atan2(o[1]-i[1],o[0]-i[0]),h={start:[o[0]-10*Math.cos(c-Math.PI/7),o[1]-10*Math.sin(c-Math.PI/7)],end:o},u={start:[o[0]-10*Math.cos(c+Math.PI/7),o[1]-10*Math.sin(c+Math.PI/7)],end:o};g(e,t,"2",h.start,h.end,{color:s,width:r,lineWidth:l}),g(e,t,"3",u.start,u.end,{color:s,width:r,lineWidth:l})}function _(e,t,n,i,r,l={}){const{color:d,width:c,lineWidth:h,lineDash:g}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0},l),u=h||c,m=o(t,"rect",n),v=e.getSvgNode(m),p=[Math.min(i[0],r[0]),Math.min(i[1],r[1])],E=Math.abs(i[0]-r[0]),f=Math.abs(i[1]-r[1]),w={x:`${p[0]}`,y:`${p[1]}`,width:`${E}`,height:`${f}`,stroke:d,fill:"black","stroke-width":u,"stroke-dasharray":g};if(v)a(w,v),e.setNodeTouched(m);else{const t=document.createElementNS("http://www.w3.org/2000/svg","rect");s(w,t),e.appendNode(t,m)}}},42111:(e,t,n)=>{var i;n.d(t,{A:()=>o}),function(e){e.Interaction="Interaction",e.HandlesUpdated="HandlesUpdated",e.StatsUpdated="StatsUpdated",e.InitialSetup="InitialSetup",e.Completed="Completed",e.InterpolationUpdated="InterpolationUpdated"}(i||(i={}));const o=i},28117:(e,t,n)=>{var i;n.d(t,{A:()=>o}),function(e){e.TOOL_ACTIVATED="CORNERSTONE_TOOLS_TOOL_ACTIVATED",e.TOOLGROUP_VIEWPORT_ADDED="CORNERSTONE_TOOLS_TOOLGROUP_VIEWPORT_ADDED",e.TOOLGROUP_VIEWPORT_REMOVED="CORNERSTONE_TOOLS_TOOLGROUP_VIEWPORT_REMOVED",e.TOOL_MODE_CHANGED="CORNERSTONE_TOOLS_TOOL_MODE_CHANGED",e.ANNOTATION_ADDED="CORNERSTONE_TOOLS_ANNOTATION_ADDED",e.ANNOTATION_COMPLETED="CORNERSTONE_TOOLS_ANNOTATION_COMPLETED",e.ANNOTATION_MODIFIED="CORNERSTONE_TOOLS_ANNOTATION_MODIFIED",e.ANNOTATION_REMOVED="CORNERSTONE_TOOLS_ANNOTATION_REMOVED",e.ANNOTATION_SELECTION_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_SELECTION_CHANGE",e.ANNOTATION_LOCK_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_LOCK_CHANGE",e.ANNOTATION_VISIBILITY_CHANGE="CORNERSTONE_TOOLS_ANNOTATION_VISIBILITY_CHANGE",e.ANNOTATION_RENDERED="CORNERSTONE_TOOLS_ANNOTATION_RENDERED",e.ANNOTATION_INTERPOLATION_PROCESS_COMPLETED="CORNERSTONE_TOOLS_ANNOTATION_INTERPOLATION_PROCESS_COMPLETED",e.INTERPOLATED_ANNOTATIONS_REMOVED="CORNERSTONE_TOOLS_INTERPOLATED_ANNOTATIONS_REMOVED",e.SEGMENTATION_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_MODIFIED",e.SEGMENTATION_RENDERED="CORNERSTONE_TOOLS_SEGMENTATION_RENDERED",e.SEGMENTATION_REPRESENTATION_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_MODIFIED",e.SEGMENTATION_REMOVED="CORNERSTONE_TOOLS_SEGMENTATION_REMOVED",e.SEGMENTATION_REPRESENTATION_REMOVED="CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_REMOVED",e.SEGMENTATION_DATA_MODIFIED="CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED",e.KEY_DOWN="CORNERSTONE_TOOLS_KEY_DOWN",e.KEY_UP="CORNERSTONE_TOOLS_KEY_UP",e.MOUSE_DOWN="CORNERSTONE_TOOLS_MOUSE_DOWN",e.MOUSE_UP="CORNERSTONE_TOOLS_MOUSE_UP",e.MOUSE_DOWN_ACTIVATE="CORNERSTONE_TOOLS_MOUSE_DOWN_ACTIVATE",e.MOUSE_DRAG="CORNERSTONE_TOOLS_MOUSE_DRAG",e.MOUSE_MOVE="CORNERSTONE_TOOLS_MOUSE_MOVE",e.MOUSE_CLICK="CORNERSTONE_TOOLS_MOUSE_CLICK",e.MOUSE_DOUBLE_CLICK="CORNERSTONE_TOOLS_MOUSE_DOUBLE_CLICK",e.MOUSE_WHEEL="CORNERSTONE_TOOLS_MOUSE_WHEEL",e.TOUCH_START="CORNERSTONE_TOOLS_TOUCH_START",e.TOUCH_START_ACTIVATE="CORNERSTONE_TOOLS_TOUCH_START_ACTIVATE",e.TOUCH_PRESS="CORNERSTONE_TOOLS_TOUCH_PRESS",e.TOUCH_DRAG="CORNERSTONE_TOOLS_TOUCH_DRAG",e.TOUCH_END="CORNERSTONE_TOOLS_TOUCH_END",e.TOUCH_TAP="CORNERSTONE_TOOLS_TAP",e.TOUCH_SWIPE="CORNERSTONE_TOOLS_SWIPE"}(i||(i={}));const o=i},83946:(e,t,n)=>{var i;n.d(t,{A:()=>o}),function(e){e.Labelmap="LABELMAP",e.Contour="CONTOUR",e.Surface="SURFACE"}(i||(i={}));const o=i},75117:(e,t,n)=>{var i;n.d(t,{A:()=>o}),function(e){e.OnInteractionStart="onInteractionStart",e.OnInteractionEnd="onInteractionEnd",e.Preview="preview",e.RejectPreview="rejectPreview",e.AcceptPreview="acceptPreview",e.Fill="fill",e.StrategyFunction="strategyFunction",e.CreateIsInThreshold="createIsInThreshold",e.Initialize="initialize",e.INTERNAL_setValue="setValue",e.ComputeInnerCircleRadius="computeInnerCircleRadius"}(i||(i={}));const o=i},79825:(e,t,n)=>{var i;n.d(t,{H:()=>i}),function(e){e.UP="UP",e.DOWN="DOWN",e.LEFT="LEFT",e.RIGHT="RIGHT"}(i||(i={}))},84901:(e,t,n)=>{var i,o;n.r(t),n.d(t,{AnnotationStyleStates:()=>r,ChangeTypes:()=>u.A,Events:()=>d.A,KeyboardBindings:()=>o,MouseBindings:()=>i,SegmentationRepresentations:()=>c.A,StrategyCallbacks:()=>g.A,Swipe:()=>h.H,ToolModes:()=>s.A,WorkerTypes:()=>m}),function(e){e[e.Primary=1]="Primary",e[e.Secondary=2]="Secondary",e[e.Primary_And_Secondary=3]="Primary_And_Secondary",e[e.Auxiliary=4]="Auxiliary",e[e.Primary_And_Auxiliary=5]="Primary_And_Auxiliary",e[e.Secondary_And_Auxiliary=6]="Secondary_And_Auxiliary",e[e.Primary_And_Secondary_And_Auxiliary=7]="Primary_And_Secondary_And_Auxiliary",e[e.Fourth_Button=8]="Fourth_Button",e[e.Fifth_Button=16]="Fifth_Button"}(i||(i={})),function(e){e[e.Shift=16]="Shift",e[e.Ctrl=17]="Ctrl",e[e.Alt=18]="Alt",e[e.Meta=91]="Meta",e[e.ShiftCtrl=1617]="ShiftCtrl",e[e.ShiftAlt=1618]="ShiftAlt",e[e.ShiftMeta=1691]="ShiftMeta",e[e.CtrlAlt=1718]="CtrlAlt",e[e.CtrlMeta=1791]="CtrlMeta",e[e.AltMeta=1891]="AltMeta"}(o||(o={}));var a,s=n(12468);!function(e){e.Default="",e.Highlighted="Highlighted",e.Selected="Selected",e.Locked="Locked",e.AutoGenerated="AutoGenerated"}(a||(a={}));const r=a;var l,d=n(28117),c=n(83946),h=n(79825),g=n(75117),u=n(42111);!function(e){e.POLYSEG_CONTOUR_TO_LABELMAP="polySeg/convertContourToVolumeLabelmap",e.POLYSEG_SURFACE_TO_LABELMAP="polySeg/convertSurfacesToVolumeLabelmap",e.POLYSEG_CONTOUR_TO_SURFACE="polySeg/convertContourToSurface",e.POLYSEG_LABELMAP_TO_SURFACE="polySeg/convertLabelmapToSurface",e.SURFACE_CLIPPING="surfaceClipping"}(l||(l={}));const m=l},44926:(e,t,n)=>{n.d(t,{dj:()=>b,aB:()=>f,In:()=>s,z5:()=>_,V$:()=>h,n6:()=>d,$m:()=>D});var i=n(92136),o=n(6805);const a=function(e){(0,o.Ay)(e.detail.element)},s={enable:function(e){e.addEventListener(i.Enums.Events.IMAGE_RENDERED,a)},disable:function(e){e.removeEventListener(i.Enums.Events.IMAGE_RENDERED,a)}};var r=n(28117),l=n(39375);const d={enable:function(e){e.addEventListener(r.A.MOUSE_CLICK,l.q_),e.addEventListener(r.A.MOUSE_DOWN,l.cT),e.addEventListener(r.A.MOUSE_DOWN_ACTIVATE,l.Xd),e.addEventListener(r.A.MOUSE_DOUBLE_CLICK,l.LM),e.addEventListener(r.A.MOUSE_DRAG,l.al),e.addEventListener(r.A.MOUSE_MOVE,l.tG),e.addEventListener(r.A.MOUSE_UP,l.Je),e.addEventListener(r.A.MOUSE_WHEEL,l.rO)},disable:function(e){e.removeEventListener(r.A.MOUSE_CLICK,l.q_),e.removeEventListener(r.A.MOUSE_DOWN,l.cT),e.removeEventListener(r.A.MOUSE_DOWN_ACTIVATE,l.Xd),e.removeEventListener(r.A.MOUSE_DOUBLE_CLICK,l.LM),e.removeEventListener(r.A.MOUSE_DRAG,l.al),e.removeEventListener(r.A.MOUSE_MOVE,l.tG),e.removeEventListener(r.A.MOUSE_UP,l.Je),e.removeEventListener(r.A.MOUSE_WHEEL,l.rO)}};var c=n(93858);const h={enable:function(e){e.addEventListener(r.A.KEY_DOWN,c.u),e.addEventListener(r.A.KEY_UP,c.L)},disable:function(e){e.removeEventListener(r.A.KEY_DOWN,c.u),e.removeEventListener(r.A.KEY_UP,c.L)}};var g=n(84901),u=n(31437);const{Active:m,Passive:v,Enabled:p}=g.ToolModes,E=function(e){(0,u.A)(e,[m,v,p]).forEach((t=>{t.onCameraModified&&t.onCameraModified(e)}))},f={enable:function(e){e.addEventListener(i.Enums.Events.CAMERA_MODIFIED,E)},disable:function(e){e.removeEventListener(i.Enums.Events.CAMERA_MODIFIED,E)}},{Active:w,Passive:I,Enabled:C}=g.ToolModes,T=function(e){(0,u.A)(e,[w,I,C]).forEach((t=>{t.onImageSpacingCalibrated&&t.onImageSpacingCalibrated(e)}))},_={enable:function(e){e.addEventListener(i.Enums.Events.IMAGE_SPACING_CALIBRATED,T)},disable:function(e){e.removeEventListener(i.Enums.Events.IMAGE_SPACING_CALIBRATED,T)}};var S=n(50734);const D={enable:function(e){e.addEventListener(r.A.TOUCH_START,S.gX),e.addEventListener(r.A.TOUCH_START_ACTIVATE,S.$F),e.addEventListener(r.A.TOUCH_DRAG,S.Oz),e.addEventListener(r.A.TOUCH_END,S.ls),e.addEventListener(r.A.TOUCH_TAP,S.lI),e.addEventListener(r.A.TOUCH_PRESS,S.x5)},disable:function(e){e.removeEventListener(r.A.TOUCH_START,S.gX),e.removeEventListener(r.A.TOUCH_START_ACTIVATE,S.$F),e.removeEventListener(r.A.TOUCH_DRAG,S.Oz),e.removeEventListener(r.A.TOUCH_END,S.ls),e.removeEventListener(r.A.TOUCH_PRESS,S.x5)}};var A=n(33836);const b={enable:function(){i.eventTarget.addEventListener(r.A.ANNOTATION_COMPLETED,A.A.handleAnnotationCompleted),i.eventTarget.addEventListener(r.A.ANNOTATION_MODIFIED,A.A.handleAnnotationUpdate),i.eventTarget.addEventListener(r.A.ANNOTATION_REMOVED,A.A.handleAnnotationDelete)},disable:function(){i.eventTarget.removeEventListener(r.A.ANNOTATION_COMPLETED,A.A.handleAnnotationCompleted),i.eventTarget.removeEventListener(r.A.ANNOTATION_MODIFIED,A.A.handleAnnotationUpdate),i.eventTarget.removeEventListener(r.A.ANNOTATION_REMOVED,A.A.handleAnnotationDelete)}}},90202:(e,t,n)=>{n.d(t,{A:()=>v,r:()=>f});var i=n(92136),o=n(65903),a=n(74119),s=n(90252),r=n(38296),l=n(75534),d=n(7259),c=n(61738),h=n(81848),g=n(96950),u=n(54177);const m="PlanarFreehandContourSegmentationTool";async function v(e){const t=e.detail.annotation;if(!d.isContourSegmentationAnnotation(t))return;const n=function(e){const t=(0,o.A)(e),n=t.find((e=>p(e,!0)));return n??t[0]}(t),v=function(e,t){const{annotationUID:n}=t;return(0,r.getAllAnnotations)().filter((i=>i.annotationUID&&i.annotationUID!==n&&d.isContourSegmentationAnnotation(i)&&d.areSameSegment(i,t)&&e.isReferenceViewable(i.metadata)))}(n,t);if(!v.length)return;const w=E(t.data.contour.polyline,n),I=function(e,t,n){const i=a.math.polyline.getAABB(t);for(let o=0;o<n.length;o++){const s=n[o],r=E(s.data.contour.polyline,e),l=a.math.polyline.getAABB(r),d=a.math.aabb.intersectAABB(i,l),c=d&&a.math.polyline.intersectPolyline(t,r),h=d&&!c&&a.math.polyline.containsPoints(r,t);if(c||h)return{targetAnnotation:s,targetPolyline:r,isContourHole:h}}}(n,w,v);if(!I)return;const{targetAnnotation:C,targetPolyline:T,isContourHole:_}=I;if(_){const{contourHoleProcessingEnabled:i=!1}=e.detail;if(!i)return;f(n,C,t)}else!function(e,t,n,o,v){if(!(0,c.J2)(h.PlanarFreehandContourSegmentationTool))return void console.warn(`${h.PlanarFreehandContourSegmentationTool.toolName} is not registered in cornerstone`);if(!p(e))return;const f=v[0],w=a.math.polyline.containsPoint(n,f),I=function(e,t){return(0,r.getChildAnnotations)(t).map((t=>({annotation:t,polyline:E(t.data.contour.polyline,e)})))}(e,t),C=new Set(I),T=new Map,_=(e,t)=>{let n=T.get(e);n||(n=[],T.set(e,n)),n.push(t),C.delete(t)},S=[];if(w){const e=a.math.polyline.mergePolylines(n,v);S.push(e),Array.from(C.keys()).forEach((t=>_(e,t)))}else{a.math.polyline.subtractPolylines(n,v).forEach((e=>{S.push(e),Array.from(C.keys()).forEach((t=>{a.math.polyline.containsPoints(e,t.polyline)&&(_(e,t),C.delete(t))}))}))}Array.from(T.values()).forEach((e=>e.forEach((e=>(0,r.clearParentAnnotation)(e.annotation)))));const{element:D}=e,A=(0,i.getEnabledElement)(D),{metadata:b,data:y}=t,{handles:R,segmentation:O}=y,{textBox:M}=R;(0,r.removeAnnotation)(o.annotationUID),(0,r.removeAnnotation)(t.annotationUID);for(let n=0;n<S.length;n++){const o=S[n],a=e.canvasToWorld(o[0]),s=e.canvasToWorld(o[o.length-1]),c={metadata:{...b,toolName:m,originalToolName:b.originalToolName||b.toolName},data:{cachedStats:{},handles:{points:[a,s],textBox:M?{...M}:void 0},contour:{polyline:[],closed:!0},spline:t.data.spline,segmentation:{...O}},annotationUID:i.utilities.uuidv4(),highlighted:!0,invalidated:!0,isLocked:!1,isVisible:void 0,interpolationUID:t.interpolationUID,interpolationCompleted:t.interpolationCompleted};l.updateContourPolyline(c,{points:o,closed:!0,targetWindingDirection:g.W.Clockwise},e),(0,r.addAnnotation)(c,D),d.addContourSegmentationAnnotation(c),(0,u.XF)(c,e.element),T.get(o)?.forEach((e=>(0,r.addChildAnnotation)(c,e.annotation)))}!function(e,t,n){const{viewport:i}=e,{element:o}=i,{renderingEngine:r}=e,l=new Set([m,t.metadata.toolName,n.metadata.toolName]);for(const e of l.values()){const t=(0,s.getViewportIdsWithToolToRender)(o,e);(0,a.triggerAnnotationRenderForViewportIds)(r,t)}new Promise((e=>window.requestAnimationFrame(e)))}(A,t,o)}(n,C,T,t,w)}function p(e,t=!1){const{toolName:n}=h.PlanarFreehandContourSegmentationTool,i=c.dU.getToolGroupForViewport(e.id,e.renderingEngineId);let o;return i.hasTool(n)?i.getToolOptions(n)||(o=`Tool ${n} must be in active/passive state`):o=`Tool ${n} not added to ${i.id} toolGroup`,o&&!t&&console.warn(o),!o}function E(e,t){const n=e.length,i=new Array(n);for(let o=0;o<n;o++)i[o]=t.worldToCanvas(e[o]);return i}function f(e,t,n){const{windingDirection:o}=t.data.contour,{windingDirection:l}=n.data.contour;o===l&&(n.data.contour.polyline.reverse(),n.data.contour.windingDirection=-1*o),(0,r.addChildAnnotation)(t,n),d.removeContourSegmentationAnnotation(n);const{element:c}=e,h=(0,i.getEnabledElement)(c),{renderingEngine:g}=h,u=new Set([m,t.metadata.toolName,n.metadata.toolName]);for(const e of u.values()){const t=(0,s.getViewportIdsWithToolToRender)(c,e);(0,a.triggerAnnotationRenderForViewportIds)(g,t)}}},60878:(e,t,n)=>{n.d(t,{tQ:()=>N,nm:()=>W,Gg:()=>H,ge:()=>k,_9:()=>x,kt:()=>v.A,bH:()=>r,qI:()=>_,sp:()=>A,Xm:()=>E,u1:()=>S,F_:()=>h,CG:()=>m});var i=n(81387),o=n(37054),a=n(65263);function s(e){e.removeEventListener("dblclick",i.A),e.removeEventListener("mousedown",o.Ay),e.removeEventListener("mousemove",a.A),e.removeEventListener("dblclick",o.DF,{capture:!0})}const r={enable:function(e){s(e),e.addEventListener("dblclick",i.A),e.addEventListener("mousedown",o.Ay),e.addEventListener("mousemove",a.A),e.addEventListener("dblclick",o.DF,{capture:!0})},disable:s};var l=n(38738),d=n(80285);function c(e){l.A.disable(e),e.removeEventListener("touchstart",d.A)}const h={enable:function(e){c(e),l.A.enable(e),e.addEventListener("touchstart",d.A,{passive:!1})},disable:c};var g=n(79445);function u(e){e.removeEventListener("wheel",g.A)}const m={enable:function(e){u(e),e.addEventListener("wheel",g.A,{passive:!1})},disable:u};var v=n(9147),p=n(49521);const E=function(e){const{toolGroupId:t}=e.detail;(0,p.Ay)(t)};var f=n(83946),w=n(30322),I=n(92136),C=n(52610);const T=function(e){const{segmentationId:t,modifiedSlicesToUse:n}=e.detail,{representationData:i,type:o}=w.getSegmentation(t),a=w.getToolGroupIdsWithSegmentation(t),s=i[o];"volumeId"in s&&function({modifiedSlicesToUse:e,representationData:t,type:n}){const i=I.cache.getVolume(t[n].volumeId);if(!i)return void console.warn("segmentation not found in cache");const{imageData:o,vtkOpenGLTexture:a}=i;let s;if(e&&Array.isArray(e))s=e;else{const e=o.getDimensions()[2];s=[...Array(e).keys()]}s.forEach((e=>{a.setUpdatedFrame(e)})),o.modified()}({modifiedSlicesToUse:n,representationData:i,type:o}),"imageIdReferenceMap"in s&&function({toolGroupIds:e,segmentationId:t,representationData:n,type:i}){e.forEach((e=>{const o=w.getSegmentationRepresentations(e),a=(0,C.getToolGroup)(e).getViewportsInfo();o.forEach((e=>{e.segmentationId===t&&a.forEach((({viewportId:t,renderingEngineId:o})=>{const a=(0,I.getEnabledElementByIds)(t,o).viewport;if(a instanceof I.VolumeViewport)return;const s=a.getActor(e.segmentationRepresentationUID);if(!s)return;const r=a.getCurrentImageId(),l=s.actor.getMapper().getInputData(),{imageIdReferenceMap:d}=n[i],c=d.get(r),h=I.cache.getImage(c);l.modified(),I.utilities.updateVTKImageDataWithCornerstoneImage(l,h)}))}))}))}({toolGroupIds:a,segmentationId:t,representationData:i,type:o})},_=function(e){const{segmentationId:t}=e.detail,{type:n}=w.getSegmentation(t),i=w.getToolGroupIdsWithSegmentation(t);n===f.A.Labelmap&&T(e),i.forEach((e=>{(0,p.Ay)(e)}))},S=function(e){const{toolGroupId:t,segmentationRepresentationUID:n}=e.detail;(0,p.Ay)(t)};var D=n(87682);const A=function(e){const{segmentationId:t}=e.detail;(0,w.getToolGroupIdsWithSegmentation)(t).forEach((e=>{(0,w.getSegmentationRepresentations)(e).forEach((n=>{n.segmentationId===t&&(0,D.triggerSegmentationRepresentationModified)(e,n.segmentationRepresentationUID)}))}))};var b=n(45128),y=n(51250),R=n(16124);const O=new Map;function M(e){const t=e.detail,{viewportId:n,renderingEngineId:i}=t,{viewport:o}=(0,I.getEnabledElementByIds)(n,i),a=(0,C.getToolGroupForViewport)(n,i);if(!a)return;let s=w.getSegmentationRepresentations(a.id)||[];if(s=s.filter((e=>e.type===f.A.Labelmap)),!s?.length)return;const r={};s.forEach((e=>{const t=w.getSegmentation(e.segmentationId);if(!t||!t.representationData?.LABELMAP)return;const n=t.representationData.LABELMAP;if((0,R.r)(n,o))return;const{imageIdReferenceMap:i}=n;r[e.segmentationRepresentationUID]={imageIdReferenceMap:i}}));const l=Object.keys(r),d=o.getCurrentImageId(),c=o.getActors();c.find((e=>!!l.includes(e.uid)))?c.forEach((t=>{if(!l.includes(t.uid))return;const n=t.actor,{imageIdReferenceMap:i}=r[t.uid],s=i.get(d),c=n.getMapper().getInputData();if(!s){if(c.setDerivedImage)return void c.setDerivedImage(null);const e=b.Ay.newInstance({name:"Pixels",numberOfComponents:1,values:new Uint8Array(c.getNumberOfPoints())}),t=y.Ay.newInstance();return t.getPointData().setScalars(e),void n.getMapper().setInputData(t)}const h=I.cache.getImage(s),{dimensions:g,spacing:u,direction:m}=o.getImageDataMetadata(h),v=I.cache.getImage(d)||{imageId:d},{origin:E}=o.getImageDataMetadata(v),f=E;if(c.setOrigin(f),c.modified(),c.getDimensions()[0]!==g[0]||c.getDimensions()[1]!==g[1])return o.removeActors([t.uid]),o.addImages([{imageId:s,actorUID:t.uid,callback:({imageActor:e})=>{const t=b.Ay.newInstance({name:"Pixels",numberOfComponen