UNPKG

dicomweb-proxy

Version:

A proxy to translate between dicomweb and dimse

2 lines 813 kB
/*! For license information please see 6029.bundle.6035b3ad42ac94c36050.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([[6029],{48405:(e,t,n)=>{"use strict";n.d(t,{C:()=>c});class o{constructor(e){this.fullDate=e}getTimeInSec(){const e=this.fullDate.substring(0,10),t=this.fullDate.substring(11,28),n=parseInt(e.substring(0,4),10),o=e.length>=7?parseInt(e.substring(5,7),10):void 0,i=e.length>=10?parseInt(e.substring(8,10),10):void 0;if(isNaN(n)||void 0!==o&&isNaN(o)||void 0!==i&&isNaN(i)||n>3e3||o&&(o<1||o>12)||i&&(i<1||i>31))throw new Error(`invalid date '${e}'`);const a=new Date(`${e}T00:00:00.000000Z`),r=parseInt(t.substring(0,2),10),s=t.length>=5?parseInt(t.substring(3,5),10):void 0,l=t.length>=8?parseInt(t.substring(6,8),10):void 0,d=t.substring(9,15),c=d?parseInt(d,10)*Math.pow(10,-d.length):void 0;if(isNaN(r)||void 0!==s&&isNaN(s)||void 0!==l&&isNaN(l)||void 0!==c&&isNaN(c)||r<0||r>23||s&&(s<0||s>59)||l&&(l<0||l>59)||c&&(c<0||c>999999))throw new Error(`invalid time '${t}'`);let u=a.getTime()/1e3;return u+=3600*r,void 0!==s&&(u+=60*s),void 0!==l&&(u+=l),void 0!==c&&(u+=c),u}getTimeInMicroSec(){return 1e6*this.getTimeInSec()}}function i(e,t){const n=`${t.hours||"00"}`.padStart(2,"0"),i=`${t.minutes||"00"}`.padStart(2,"0"),a=`${t.seconds||"00"}`.padStart(2,"0"),r=`${e.month}`.padStart(2,"0"),s=`${e.day}`.padStart(2,"0"),l=`${t.fractionalSeconds||"000000"}`.padEnd(6,"0"),d=`${e.year}-${r}-${s}`;return new o(`${d}${`T${n}:${i}:${a}.${l}Z`}`)}function a(e){if(null==e||8!==e.length||"string"!=typeof e)throw new Error(`invalid DA '${e}'`);const t=parseInt(e.substring(0,4),10),n=parseInt(e.substring(4,6),10),o=parseInt(e.substring(6,8),10);if(!0!=(i=o,a=n,r=t,!isNaN(r)&&a>0&&a<=12&&i>0&&i<=function(e,t){switch(e){case 2:return t%4==0&&t%100||t%400==0?29:28;case 9:case 4:case 6:case 11:return 30;default:return 31}}(a,r)))throw new Error(`invalid DA '${e}'`);var i,a,r;return{year:t,month:n,day:o}}function r(e){if(null==e||e.length<2||"string"!=typeof e)throw new Error(`invalid TM '${e}'`);const t=parseInt(e.substring(0,2),10),n=e.length>=4?parseInt(e.substring(2,4),10):void 0,o=e.length>=6?parseInt(e.substring(4,6),10):void 0,i=e.length>=8?e.substring(7,13):void 0,a=i?parseInt(i,10)*Math.pow(10,6-i.length):void 0;if(isNaN(t)||void 0!==n&&isNaN(n)||void 0!==o&&isNaN(o)||void 0!==a&&isNaN(a)||t<0||t>23||n&&(n<0||n>59)||o&&(o<0||o>59)||a&&(a<0||a>999999))throw new Error(`invalid TM '${e}'`);return{hours:t,minutes:n,seconds:o,fractionalSeconds:a}}function s(e){if(null==e)throw new Error("dateTimeToFullDateInterface : dateTime not defined.");return i(a(e.substring(0,8)),r(e.substring(8)))}function l(e){const{RadionuclideTotalDose:t,RadionuclideHalfLife:n,RadiopharmaceuticalStartDateTime:l,RadiopharmaceuticalStartTime:d,SeriesDate:c}=e[0];if(null==t)throw new Error("calculateDecayCorrection : RadionuclideTotalDose value not found.");if(null==n)throw new Error("calculateDecayCorrection : RadionuclideHalfLife value not found.");const u=function(e){const{SeriesDate:t,SeriesTime:n,GEPrivatePostInjectionDateTime:l}=e[0],d=new Array(e.length),c=i(a(t),r(n));let u=new o("3000-01-01T00:00:00.000000Z"),h=u.getTimeInSec();if(e.forEach((e=>{const{AcquisitionDate:t,AcquisitionTime:n}=e,o=i(a(t),r(n));u=u.getTimeInSec()>=h||o.getTimeInSec()<u.getTimeInSec()?o:u})),u.getTimeInSec()>=h)throw new Error("Earliest acquisition time or date could not be parsed.");return c.getTimeInSec()<=u.getTimeInSec()?d.fill(c):l?d.fill(s(l)):d.fill(u)}(e),h=function(e){const{RadiopharmaceuticalStartDateTime:t,RadiopharmaceuticalStartTime:n,SeriesDate:o}=e;let l,d;if(t)return s(t);if(n&&o)return l=r(n),d=a(o),i(d,l);throw new Error(`Invalid input: ${e}`)}({RadiopharmaceuticalStartDateTime:l,RadiopharmaceuticalStartTime:d,SeriesDate:c});return e.map(((e,o)=>{const i=u[o].getTimeInSec()-h.getTimeInSec();if(i<0)throw new Error("Decay time cannot be less than zero");return 1/(t*Math.pow(2,-i/n))}))}const d=(e,t)=>e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,n)=>e===t[n]));function c(e){const{CorrectedImage:t,Units:n,PhilipsPETPrivateGroup:o,PatientWeight:i,PatientSex:a,PatientSize:r}=e[0];if(!t.includes("ATTN")||!t.includes("DECY"))throw new Error(`CorrectedImage must contain "ATTN" and "DECY": ${t}`);if(!e.every((o=>o.Units===n&&d(o.CorrectedImage,t)&&o.PatientWeight===i&&o.PatientSex===a&&o.PatientSize===r&&o.RadionuclideHalfLife===e[0].RadionuclideHalfLife&&o.RadionuclideTotalDose===e[0].RadionuclideTotalDose&&o.DecayCorrection===e[0].DecayCorrection&&o.SeriesDate===e[0].SeriesDate&&o.SeriesTime===e[0].SeriesTime)))throw new Error("The set of instances does not appear to come from one Series. Every instance must have identical values for series-level metadata properties");if(!i)throw new Error("PatientWeight value is missing. It is not possible to calculate the SUV factors");let s=new Array(e.length);s=l(e);let c=new Array(e.length);const u=1e3*i;if("BQML"===n)c=s.map((function(e){return e*u}));else if("CNTS"===n){const t=e.every((e=>{var t,n,o;return e.PhilipsPETPrivateGroup&&null!==(null===(t=e.PhilipsPETPrivateGroup)||void 0===t?void 0:t.SUVScaleFactor)&&void 0!==(null===(n=e.PhilipsPETPrivateGroup)||void 0===n?void 0:n.SUVScaleFactor)&&0!==(null===(o=e.PhilipsPETPrivateGroup)||void 0===o?void 0:o.SUVScaleFactor)})),n=e.every((e=>{var t,n,o;return e.PhilipsPETPrivateGroup&&!(null!==(t=e.PhilipsPETPrivateGroup)&&void 0!==t&&t.SUVScaleFactor)&&void 0!==(null===(n=e.PhilipsPETPrivateGroup)||void 0===n?void 0:n.ActivityConcentrationScaleFactor)&&0!==(null===(o=e.PhilipsPETPrivateGroup)||void 0===o?void 0:o.ActivityConcentrationScaleFactor)}));if(t)c=e.map((e=>e.PhilipsPETPrivateGroup.SUVScaleFactor));else{if(!n)throw new Error(`Units are in CNTS, but PhilipsPETPrivateGroup has invalid values: ${JSON.stringify(o)}`);c=e.map(((e,t)=>e.PhilipsPETPrivateGroup.ActivityConcentrationScaleFactor*s[t]*u))}}else{if("GML"!==n)throw new Error(`Units has an invalid value: ${n}`);c.fill(1)}let h,g,p;if(null==r)console.warn("PatientSize value is missing. It is not possible to calculate the SUV bsa factors");else{h=function(e){const{PatientWeight:t,PatientSize:n}=e;return Math.pow(t,.425)*Math.pow(100*n,.725)*71.84}({PatientWeight:i,PatientSize:r})}if(null==r)console.warn("PatientSize value is missing. It is not possible to calculate the SUV lbm factors");else if(null==a)console.warn("PatientSex value is missing. It is not possible to calculate the SUV lbm factors");else{const e={PatientWeight:i,PatientSex:a,PatientSize:r};g=function(e){const{PatientSex:t,PatientWeight:n,PatientSize:o}=e;let i;const a=Math.pow(n/(100*o),2);if("F"===t)i=1.07*n-148*a;else{if("M"!==t)throw new Error(`PatientSex is an invalid value: ${t}`);i=1.1*n-120*a}return 1e3*i}(e),p=function(e){const{PatientSex:t,PatientWeight:n,PatientSize:o}=e;let i;const a=n/Math.pow(o,2);if("F"===t)i=9270*n/(8780+244*a);else{if("M"!==t)throw new Error(`PatientSex is an invalid value: ${t}`);i=9270*n/(6680+216*a)}return 1e3*i}(e)}return c.map((function(e,t){const n={suvbw:e};return h&&(n.suvbsa=s[t]*h),g&&(n.suvlbm=s[t]*g),p&&(n.suvlbmJanma=s[t]*p),n}))}},36625:(e,t,n)=>{"use strict";n.d(t,{Nk:()=>a,Qy:()=>s,zj:()=>i});let o={};function i(){return o}function a(e){o=e}let r=!1;function s(){if(!o.addons?.polySeg)return console.warn("PolySeg add-on not configured. This will prevent automatic conversion between segmentation representations (labelmap, contour, surface). To enable these features, install @cornerstonejs/polymorphic-segmentation and register it during initialization: cornerstoneTools.init({ addons: { polySeg } })."),null;const e=o.addons.polySeg;return r||(e.init(),r=!0),e}},93952:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const o=[[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]]},47085:(e,t,n)=>{"use strict";n.r(t),n.d(t,{COLOR_LUT:()=>o.A});var o=n(93952)},94430:(e,t,n)=>{"use strict";n.d(t,{A:()=>a,i:()=>s});const o=Symbol("DefinedCursors"),i=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=r(a,o);let n=t.get(e);return n instanceof a?n:i.has(e)?(n=new a(e),t.set(e,n),n):void 0}static setDefinedCursor(e,t){if(t instanceof a){return r(a,o).set(e,t),!0}return!1}}function r(e,t){let n=e[t];return n instanceof Map||(n=new Map,Object.defineProperty(e,t,{value:n})),n}const s=i.values()},7001:(e,t,n)=>{"use strict";n.r(t),n.d(t,{hideElementCursor:()=>l,initElementCursor:()=>a,resetElementCursor:()=>s,setElementCursor:()=>r});var o=n(94430);const i=Symbol("ElementCursorsMap");function a(e,t){d(e)[0]=t,r(e,t)}function r(e,t){const n=d(e);n[1]=n[0],n[0]=t,e.style.cursor=(t instanceof o.A?t:o.A.getDefinedCursor("auto")).getStyleProperty()}function s(e){r(e,d(e)[1])}function l(e){r(e,o.A.getDefinedCursor("none"))}function d(e){let t=d[i];t instanceof WeakMap||(t=new WeakMap,Object.defineProperty(d,i,{value:t}));let n=t.get(e);return n||(n=[null,null],t.set(e,n)),n}},79475:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CursorNames:()=>T,CursorSVG:()=>p,ImageMouseCursor:()=>a,MouseCursor:()=>o.A,SVGMouseCursor:()=>I,elementCursor:()=>x,registerCursor:()=>m,setCursorForElement:()=>S});var o=n(94430),i=n(15327);class a extends o.A{constructor(e,t,n,o,i){super(o||a.getUniqueInstanceName("image-cursor"),i),this.url=e,this.x=Number(t)||0,this.y=Number(n)||0}getStyleProperty(){const{url:e,x:t,y:n}=this;let o=`url('${e}')`;return t>=0&&n>=0&&(t>0||n>0)&&(o+=` ${t} ${n}`),this.addFallbackStyleProperty(o)}static getUniqueInstanceName(e){return`${e}-${i.utilities.getRuntimeId(a)}`}}var r=n(99737);const s={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 '},l={x:127,y:60},d='\n<rect fill="{{color}}" x="80.19" y="25.03" width="47.14" height="15.85"/>\n',c='\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',u='<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)"/>',h='<path fill="{{color}}" d="M8.86,2.25V66.08H72.69V2.25H8.86ZM65.28,58.67h-49v-49h49v49Z" transform="translate(-8.86 -2.25)"/>',g='<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)"/>',p={Angle:f(s,{name:"Angle",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:f(s,{name:"ArrowAnnotate",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:f(s,{name:"Bidirectional",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:f(s,{name:"CobbAngle",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:f(s,{name:"CircleROI",iconContent:'<circle stroke="{{color}}" fill="none" stroke-width="3" cx="16" cy="16" r="14" />',viewBox:{x:32,y:32}}),EllipticalROI:f(s,{name:"EllipticalROI",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:f(s,{name:"FreehandROI",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:f(s,{name:"FreehandROISculptor",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:f(s,{name:"Length",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}}),Height:f(s,{name:"Height",iconContent:'<path d="m 6 22 l 8.5 0 v -16 h 8" stroke-width="3" fill="none" stroke="{{color}}" />',viewBox:{x:24,y:24}}),Probe:f(s,{name:"Probe",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:f(s,{name:"RectangleROI",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}}),Label:f(s,{name:"Label",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:f(s,{name:"Crosshairs",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:f(s,{name:"Eraser",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:f(s,{name:"Magnify",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:f(s,{name:"Pan",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:f(s,{name:"Rotate",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:f(s,{name:"StackScroll",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:f(s,{name:"WindowLevelRegion",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:f(s,{name:"WindowLevel",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:f(s,{name:"Zoom",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:f(s,{name:"SegmentationFreeHandEraseInside",iconContent:`${u} ${d}`,viewBox:l}),SegmentationFreeHandFillInside:f(s,{name:"SegmentationFreeHandFillInside",iconContent:`${u} ${c}`,viewBox:l}),SegmentationFreeHandEraseOutside:f(s,{name:"SegmentationFreeHandEraseOutside",iconContent:`${u} ${d}`,viewBox:l}),SegmentationFreeHandFillOutside:f(s,{name:"SegmentationFreeHandFillOutside",iconContent:`${u} ${c}`,viewBox:l}),SegmentationRectangleEraseInside:f(s,{name:"SegmentationRectangleEraseInside",iconContent:`${h} ${d}`,viewBox:l}),RectangleScissor:f(s,{name:"RectangleScissor",iconContent:`${h} ${c}`,viewBox:l}),"RectangleScissor.FILL_INSIDE":f(s,{name:"RectangleScissor.FILL_INSIDE",iconContent:`${h} ${c}`,viewBox:l}),"RectangleScissor.FILL_OUTSIDE":f(s,{name:"RectangleScissor.FILL_OUTSIDE",iconContent:`${h} ${c}`,viewBox:l}),"RectangleScissor.ERASE_OUTSIDE":f(s,{name:"RectangleScissor.ERASE_OUTSIDE",iconContent:`${h} ${d}`,viewBox:l}),"RectangleScissor.ERASE_INSIDE":f(s,{name:"RectangleScissor.ERASE_INSIDE",iconContent:`${h} ${d}`,viewBox:l}),CircleScissor:f(s,{name:"CircleScissor",iconContent:`${g} ${c}`,viewBox:l}),"CircleScissor.FILL_INSIDE":f(s,{name:"CircleScissor.FILL_INSIDE",iconContent:`${g} ${c}`,viewBox:l}),"CircleScissor.ERASE_OUTSIDE":f(s,{name:"CircleScissor.ERASE_OUTSIDE",iconContent:`${g} ${d}`,viewBox:l}),"CircleScissor.FILL_OUTSIDE":f(s,{name:"CircleScissor.FILL_OUTSIDE",iconContent:`${g} ${c}`,viewBox:l})};function f(e,t){return Object.assign(Object.create(e),{...t,name:t.name||e.name})}function m(e,t,n){p[e]=f(s,{iconContent:t,viewBox:n})}const v=Object.keys(p);var w=n(76712);const b=r.AnnotationStyleStates.Highlighted,E=r.ToolModes.Active;class I extends a{constructor(e,t,n,o,i){super(e,t,n,o,i)}static getDefinedCursor(e,t=!1,n){n||(n=(0,w.h)("color",{},b,E));const o=function(e,t,n){const o=t?"pointer":"cursor";return`${o}:${e}/${n}`}(e,t,n);let i=super.getDefinedCursor(o);if(!i){const a=function(e){return p[e]}(e);a&&(i=function(e,t,n,o,i){const{x:a,y:r}=e.mousePoint;return new I(function(e,t,n){const o=function(e,t,n){const o=(t?C:_)(e,n);return new Blob([o],{type:"image/svg+xml"})}(e,t,n),i=`${URL.createObjectURL(o)}#${e.name||"unknown"}-${t?"pointer":"cursor"}`;return i}(e,n,{color:o}),a,r,t,i)}(a,o,t,n,super.getDefinedCursor("default")),super.setDefinedCursor(o,i))}return i}}function y(e,t){const n=Object(t),o=Object.prototype.hasOwnProperty.bind(n);return(e+"").replace(/\{\{(\w+)\}\}/g,((e,t)=>o(t)?n[t]+"":""))}function _(e,t){const{iconContent:n,iconSize:o,viewBox:i}=e;return y(`\n <svg data-icon="cursor" role="img" xmlns="http://www.w3.org/2000/svg"\n width="${o}" height="${o}" viewBox="0 0\n ${i.x} ${i.y}">\n ${n}\n </svg>`,t)}function C(e,t){const{iconContent:n,iconSize:o,viewBox:i,mousePointerGroupString:a}=e,r=16+o;return y(`\n <svg data-icon="cursor" role="img" xmlns="http://www.w3.org/2000/svg"\n width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">\n <g>${a}</g>\n <g transform="translate(16, 16) scale(${o/Math.max(i.x,i.y,1)})">${n}</g>\n </svg>`,t)}var x=n(7001);const S=function(e,t){let n=I.getDefinedCursor(t,!0);n||(n=o.A.getDefinedCursor(t)),n||(console.log(`Cursor ${t} is not defined either as SVG or as a standard cursor.`),n=o.A.getDefinedCursor(t)),(0,x.setElementCursor)(e,n)},T=[...v,...o.i]},85856:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});n(97181);var o=n(95074);const i=function(e,t,n,i,a,r={},s=""){const l=[(i[0]+a[0])/2,i[1]],d=[(i[0]+a[0])/2,a[1]],c=[i[0],(i[1]+a[1])/2],u=[a[0],(i[1]+a[1])/2];(0,o.A)(e,t,n,[d,l,c,u],{},"")}},95074:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(97181),i=n(85899),a=n(56442);const r=function(e,t,n,r,s={},l=""){const{color:d,width:c,lineWidth:u,lineDash:h}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0},s),g=u||c,p=(0,o.A)(t,"ellipse",n),f=e.getSvgNode(p),[m,v,w,b]=r,E=Math.hypot(w[0]-b[0],w[1]-b[1]),I=Math.hypot(v[0]-m[0],v[1]-m[1]),y=180*Math.atan2(w[1]-b[1],w[0]-b[0])/Math.PI,_=[(w[0]+b[0])/2,(v[1]+m[1])/2],C={cx:`${_[0]}`,cy:`${_[1]}`,rx:`${E/2}`,ry:`${I/2}`,stroke:d,fill:"transparent",transform:`rotate(${y} ${_[0]} ${_[1]})`,"stroke-width":g,"stroke-dasharray":h};if(f)(0,i.A)(C,f),e.setNodeTouched(p);else{const t=document.createElementNS("http://www.w3.org/2000/svg","ellipse");""!==l&&t.setAttribute("data-id",l),(0,a.A)(C,t),e.appendNode(t,p)}}},94042:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(97181),i=n(56442),a=n(85899);const r=function(e,t,n,r,s={},l){const{color:d,handleRadius:c,width:u,lineWidth:h,fill:g,type:p,opacity:f}=Object.assign({color:"rgb(0, 255, 0)",handleRadius:"6",width:"2",lineWidth:void 0,fill:"transparent",type:"circle",opacity:1},s),m=h||u,v=(0,o.A)(t,"handle",`hg-${n}-index-${l}`);let w;if("circle"===p)w={cx:`${r[0]}`,cy:`${r[1]}`,r:c,stroke:d,fill:g,"stroke-width":m,opacity:f};else{if("rect"!==p)throw new Error(`Unsupported handle type: ${p}`);{const e=1.5*parseFloat(c);w={x:`${r[0]-.5*e}`,y:`${r[1]-.5*e}`,width:`${e}`,height:`${e}`,stroke:d,fill:g,"stroke-width":m,rx:""+.1*e,opacity:f}}}const b=e.getSvgNode(v);if(b)(0,a.A)(w,b),e.setNodeTouched(v);else{const t=document.createElementNS("http://www.w3.org/2000/svg",p);(0,i.A)(w,t),e.appendNode(t,v)}}},92118:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(97181),i=n(56442),a=n(85899);function r(e,t,n,r,s,l={},d=""){if(isNaN(r[0])||isNaN(r[1])||isNaN(s[0])||isNaN(s[1]))return;const{color:c="rgb(0, 255, 0)",width:u=10,lineWidth:h,lineDash:g,markerStartId:p=null,markerEndId:f=null,shadow:m=!1}=l,v=h||u,w=(0,o.A)(t,"line",n),b=e.getSvgNode(w),E=e.svgLayerElement.id,I=m?`filter:url(#shadow-${E});`:"",y={x1:`${r[0]}`,y1:`${r[1]}`,x2:`${s[0]}`,y2:`${s[1]}`,stroke:c,style:I,"stroke-width":v,"stroke-dasharray":g,"marker-start":p?`url(#${p})`:"","marker-end":f?`url(#${f})`:""};if(b)(0,a.A)(y,b),e.setNodeTouched(w);else{const t=document.createElementNS("http://www.w3.org/2000/svg","line");""!==d&&t.setAttribute("data-id",d),(0,i.A)(y,t),e.appendNode(t,w)}}},17311:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(97181),i=n(56442),a=n(85899);function r(e,t,n,r,s){const l=r.length&&r[0].length&&Array.isArray(r[0][0])?r:[r],{color:d="rgb(0, 255, 0)",width:c=10,fillColor:u="none",fillOpacity:h=0,lineWidth:g,lineDash:p,closePath:f=!1}=s,m=g||c,v=(0,o.A)(t,"path",n),w=e.getSvgNode(v);let b="";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];b+=`${e?"L":"M"} ${n[0].toFixed(1)}, ${n[1].toFixed(1)} `}f&&(b+="Z ")}}if(!b)return;const E={d:b,stroke:d,fill:u,"fill-opacity":h,"stroke-width":m,"stroke-dasharray":p};if(w)(0,a.A)(E,w),e.setNodeTouched(v);else{const t=document.createElementNS("http://www.w3.org/2000/svg","path");(0,i.A)(E,t),e.appendNode(t,v)}}},98812:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(97181),i=n(56442),a=n(85899);function r(e,t,n,r,s){if(r.length<2)return;const{color:l="rgb(0, 255, 0)",width:d=10,fillColor:c="none",fillOpacity:u=0,lineWidth:h,lineDash:g,closePath:p=!1,markerStartId:f=null,markerEndId:m=null}=s,v=h||d,w=(0,o.A)(t,"polyline",n),b=e.getSvgNode(w);let E="";for(const e of r)E+=`${e[0].toFixed(1)}, ${e[1].toFixed(1)} `;if(p){const e=r[0];E+=`${e[0]}, ${e[1]}`}const I={points:E,stroke:l,fill:c,"fill-opacity":u,"stroke-width":v,"stroke-dasharray":g,"marker-start":f?`url(#${f})`:"","marker-end":m?`url(#${m})`:""};if(b)(0,a.A)(I,b),e.setNodeTouched(w);else{const t=document.createElementNS("http://www.w3.org/2000/svg","polyline");(0,i.A)(I,t),e.appendNode(t,w)}}},75076:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(97181),i=n(85899),a=n(56442);function r(e,t,n,r,s={},l=""){const{color:d,width:c,lineWidth:u,lineDash:h}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0},s),g=u||c,p=(0,o.A)(t,"rect",n),f=e.getSvgNode(p),[m,v,w,b]=r,E=Math.hypot(m[0]-v[0],m[1]-v[1]),I=Math.hypot(m[0]-w[0],m[1]-w[1]),y=[(b[0]+m[0])/2,(b[1]+m[1])/2],_=[(w[0]+m[0])/2,(w[1]+m[1])/2],C=180*Math.atan2(y[1]-_[1],y[0]-_[0])/Math.PI,x={x:""+(y[0]-E/2),y:""+(y[1]-I/2),width:`${E}`,height:`${I}`,stroke:d,fill:"transparent",transform:`rotate(${C} ${y[0]} ${y[1]})`,"stroke-width":g,"stroke-dasharray":h};if(f)(0,i.A)(x,f),e.setNodeTouched(p);else{const t=document.createElementNS("http://www.w3.org/2000/svg","rect");""!==l&&t.setAttribute("data-id",l),(0,a.A)(x,t),e.appendNode(t,p)}}},26290:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var o=n(97181),i=n(85899);function a(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 r(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 o=e.getBBox(),a={x:`${o.x}`,y:`${o.y}`,width:`${o.width}`,height:`${o.height}`,fill:t};return(0,i.A)(a,n),o}const s=function(e,t,n,s,l,d={}){return function(e,t,n,s=[""],l,d){const{padding:c,color:u,fontFamily:h,fontSize:g,background:p}=d;let f;const[m,v]=[l[0]+c,l[1]+c],w="http://www.w3.org/2000/svg",b=(0,o.A)(t,"text",n),E=e.getSvgNode(b);if(E){const n=E.querySelector("text"),o=Array.from(n.children);for(let e=0;e<o.length;e++){const t=o[e],n=s[e]||"";t.textContent=n}if(s.length>o.length){for(let e=0;e<s.length-o.length;e++){const t=a(s[e+o.length]);n.appendChild(t)}E.appendChild(n),e.appendNode(E,b)}const l={fill:u,"font-size":g,"font-family":h},d={transform:`translate(${m} ${v})`};(0,i.A)(l,n),(0,i.A)(d,E),E.setAttribute("data-annotation-uid",t),f=r(E,p),e.setNodeTouched(b)}else{const n=document.createElementNS(w,"g");n.setAttribute("data-annotation-uid",t),n.setAttribute("transform",`translate(${m} ${v})`);const o=function(e,t){const{color:n,fontFamily:o,fontSize:i}=t,a="http://www.w3.org/2000/svg",r=document.createElementNS(a,"text"),s="user-select: none; pointer-events: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0);",l=`filter:url(#shadow-${e.svgLayerElement.id});`,d=`${s}${l}`;return r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("fill",n),r.setAttribute("font-family",o),r.setAttribute("font-size",i),r.setAttribute("style",d),r.setAttribute("pointer-events","visible"),r}(e,d);for(let e=0;e<s.length;e++){const t=a(s[e]);o.appendChild(t)}n.appendChild(o),e.appendNode(n,b),f=r(n,p)}return Object.assign({},f,{x:m,y:v,height:f.height+c,width:f.width+c})}(e,t,n,s,l,Object.assign({fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",color:"rgb(255, 255, 0)",background:"",padding:25,centerX:!1,centerY:!0},d))}},17328:(e,t,n)=>{"use strict";n.r(t),n.d(t,{draw:()=>o.A,drawArrow:()=>w,drawCircle:()=>i.A,drawEllipse:()=>a.A,drawEllipseByCoordinates:()=>r.A,drawHandle:()=>l.A,drawHandles:()=>s.A,drawHeight:()=>c,drawLine:()=>d.A,drawLinkedTextBox:()=>g.A,drawPath:()=>h.A,drawPolyline:()=>u.A,drawRect:()=>p.A,drawRectByCoordinates:()=>f.A,drawRedactionRect:()=>y,drawTextBox:()=>m.A,setAttributesIfNecessary:()=>E.A,setNewAttributesIfValid:()=>I.A});var o=n(18262),i=n(12004),a=n(85856),r=n(95074),s=n(56745),l=n(94042),d=n(92118);function c(e,t,n,o,i,a={}){if(isNaN(o[0])||isNaN(o[1])||isNaN(i[0])||isNaN(i[1]))return;const{color:r,width:s,lineWidth:l,lineDash:c}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0},a),u=i[0]+(o[0]-i[0])/2,h=[u,o[1]],g=[u,i[1]],p={start:o,end:h},f={start:h,end:g},m={start:g,end:i};(0,d.A)(e,t,"1",p.start,p.end,{color:r,width:s,lineWidth:l,lineDash:c}),(0,d.A)(e,t,"2",f.start,f.end,{color:r,width:s,lineWidth:l,lineDash:c}),(0,d.A)(e,t,"3",m.start,m.end,{color:r,width:s,lineWidth:l,lineDash:c})}var u=n(98812),h=n(17311),g=n(1595),p=n(97530),f=n(75076),m=n(26290);const v="http://www.w3.org/2000/svg";function w(e,t,n,o,i,a={}){if(isNaN(o[0])||isNaN(o[1])||isNaN(i[0])||isNaN(i[1]))return;const{viaMarker:r=!1,color:s="rgb(0, 255, 0)",markerSize:l=10}=a;if(!r)return void function(e,t,n,o,i,a={}){const{color:r="rgb(0, 255, 0)",width:s=2,lineWidth:l,lineDash:c}=a,u=10,h=Math.atan2(i[1]-o[1],i[0]-o[0]),g={start:[i[0]-u*Math.cos(h-Math.PI/7),i[1]-u*Math.sin(h-Math.PI/7)],end:i},p={start:[i[0]-u*Math.cos(h+Math.PI/7),i[1]-u*Math.sin(h+Math.PI/7)],end:i};(0,d.A)(e,t,n,o,i,{color:r,width:s,lineWidth:l,lineDash:c}),(0,d.A)(e,t,"2",g.start,g.end,{color:r,width:s,lineWidth:l,lineDash:c}),(0,d.A)(e,t,"3",p.start,p.end,{color:r,width:s,lineWidth:l,lineDash:c})}(e,t,n,o,i,a);const c=`${`arrow-${t}`}-${e.svgLayerElement.id}`,u=e.svgLayerElement.querySelector("defs");let h=u.querySelector(`#${c}`);if(h){h.setAttribute("markerWidth",`${l}`),h.setAttribute("markerHeight",`${l}`);const e=h.querySelector("path");e&&e.setAttribute("fill",s)}else{h=document.createElementNS(v,"marker"),h.setAttribute("id",c),h.setAttribute("viewBox","0 0 10 10"),h.setAttribute("refX","8"),h.setAttribute("refY","5"),h.setAttribute("markerWidth",`${l}`),h.setAttribute("markerHeight",`${l}`),h.setAttribute("orient","auto");const e=document.createElementNS(v,"path");e.setAttribute("d","M 0 0 L 10 5 L 0 10 z"),e.setAttribute("fill",s),h.appendChild(e),u.appendChild(h)}a.markerEndId=c,(0,d.A)(e,t,n,o,i,a)}var b=n(97181),E=n(85899),I=n(56442);function y(e,t,n,o,i,a={}){const{color:r,width:s,lineWidth:l,lineDash:d}=Object.assign({color:"rgb(0, 255, 0)",width:"2",lineWidth:void 0,lineDash:void 0},a),c=l||s,u=(0,b.A)(t,"rect",n),h=e.getSvgNode(u),g=[Math.min(o[0],i[0]),Math.min(o[1],i[1])],p=Math.abs(o[0]-i[0]),f=Math.abs(o[1]-i[1]),m={x:`${g[0]}`,y:`${g[1]}`,width:`${p}`,height:`${f}`,stroke:r,fill:"black","stroke-width":c,"stroke-dasharray":d};if(h)(0,E.A)(m,h),e.setNodeTouched(u);else{const t=document.createElementNS("http://www.w3.org/2000/svg","rect");(0,I.A)(m,t),e.appendNode(t,u)}}},85899:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const o=function(e,t){Object.keys(e).forEach((n=>{const o=t.getAttribute(n),i=e[n];void 0===i||""===i?t.removeAttribute(n):o!==i&&t.setAttribute(n,i)}))}},56442:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const o=function(e,t){Object.keys(e).forEach((n=>{const o=e[n];void 0!==o&&""!==o&&t.setAttribute(n,o)}))}},93098:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(15327),i=n(94021),a=n(27740);const r={enable:function(){o.eventTarget.addEventListener(i.A.ANNOTATION_COMPLETED,a.A.handleAnnotationCompleted),o.eventTarget.addEventListener(i.A.ANNOTATION_MODIFIED,a.A.handleAnnotationUpdate),o.eventTarget.addEventListener(i.A.ANNOTATION_REMOVED,a.A.handleAnnotationDelete)},disable:function(){o.eventTarget.removeEventListener(i.A.ANNOTATION_COMPLETED,a.A.handleAnnotationCompleted),o.eventTarget.removeEventListener(i.A.ANNOTATION_MODIFIED,a.A.handleAnnotationUpdate),o.eventTarget.removeEventListener(i.A.ANNOTATION_REMOVED,a.A.handleAnnotationDelete)}}},24271:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var o=n(15327),i=n(99737),a=n(70333);const{Active:r,Passive:s,Enabled:l}=i.ToolModes,d=function(e){(0,a.A)(e,[r,s,l]).forEach((t=>{t.onCameraModified&&t.onCameraModified(e)}))},c={enable:function(e){e.addEventListener(o.Enums.Events.CAMERA_MODIFIED,d)},disable:function(e){e.removeEventListener(o.Enums.Events.CAMERA_MODIFIED,d)}}},93151:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var o=n(15327),i=n(99737),a=n(70333);const{Active:r,Passive:s,Enabled:l}=i.ToolModes,d=function(e){(0,a.A)(e,[r,s,l]).forEach((t=>{t.onResetCamera&&t.onResetCamera(e)}))},c={enable:function(e){e.addEventListener(o.Enums.Events.CAMERA_RESET,d)},disable:function(e){e.removeEventListener(o.Enums.Events.CAMERA_RESET,d)}}},75681:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(15327),i=n(56069);const a=function(e){(0,i.A)(e.detail.element)},r={enable:function(e){e.addEventListener(o.Enums.Events.IMAGE_RENDERED,a)},disable:function(e){e.removeEventListener(o.Enums.Events.IMAGE_RENDERED,a)}}},40396:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var o=n(15327),i=n(99737),a=n(70333);const{Active:r,Passive:s,Enabled:l}=i.ToolModes,d=function(e){(0,a.A)(e,[r,s,l]).forEach((t=>{t.onImageSpacingCalibrated&&t.onImageSpacingCalibrated(e)}))},c={enable:function(e){e.addEventListener(o.Enums.Events.IMAGE_SPACING_CALIBRATED,d)},disable:function(e){e.removeEventListener(o.Enums.Events.IMAGE_SPACING_CALIBRATED,d)}}},3406:(e,t,n)=>{"use strict";n.d(t,{$m:()=>l.A,In:()=>o.A,V$:()=>a.A,aB:()=>r.A,dj:()=>d.A,n6:()=>i.A,we:()=>c.A,z5:()=>s.A});var o=n(75681),i=n(66106),a=n(83438),r=n(24271),s=n(40396),l=n(45470),d=n(93098),c=n(93151)},83438:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(94021),i=n(74690);const a={enable:function(e){e.addEventListener(o.A.KEY_DOWN,i.u),e.addEventListener(o.A.KEY_UP,i.L)},disable:function(e){e.removeEventListener(o.A.KEY_DOWN,i.u),e.removeEventListener(o.A.KEY_UP,i.L)}}},66106:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(94021),i=n(40100);const a={enable:function(e){e.addEventListener(o.A.MOUSE_CLICK,i.q_),e.addEventListener(o.A.MOUSE_DOWN,i.cT),e.addEventListener(o.A.MOUSE_DOWN_ACTIVATE,i.Xd),e.addEventListener(o.A.MOUSE_DOUBLE_CLICK,i.LM),e.addEventListener(o.A.MOUSE_DRAG,i.al),e.addEventListener(o.A.MOUSE_MOVE,i.tG),e.addEventListener(o.A.MOUSE_UP,i.Je),e.addEventListener(o.A.MOUSE_WHEEL,i.rO)},disable:function(e){e.removeEventListener(o.A.MOUSE_CLICK,i.q_),e.removeEventListener(o.A.MOUSE_DOWN,i.cT),e.removeEventListener(o.A.MOUSE_DOWN_ACTIVATE,i.Xd),e.removeEventListener(o.A.MOUSE_DOUBLE_CLICK,i.LM),e.removeEventListener(o.A.MOUSE_DRAG,i.al),e.removeEventListener(o.A.MOUSE_MOVE,i.tG),e.removeEventListener(o.A.MOUSE_UP,i.Je),e.removeEventListener(o.A.MOUSE_WHEEL,i.rO)}}},45470:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(94021),i=n(84971);const a={enable:function(e){e.addEventListener(o.A.TOUCH_START,i.gX),e.addEventListener(o.A.TOUCH_START_ACTIVATE,i.$F),e.addEventListener(o.A.TOUCH_DRAG,i.Oz),e.addEventListener(o.A.TOUCH_END,i.ls),e.addEventListener(o.A.TOUCH_TAP,i.lI),e.addEventListener(o.A.TOUCH_PRESS,i.x5)},disable:function(e){e.removeEventListener(o.A.TOUCH_START,i.gX),e.removeEventListener(o.A.TOUCH_START_ACTIVATE,i.$F),e.removeEventListener(o.A.TOUCH_DRAG,i.Oz),e.removeEventListener(o.A.TOUCH_END,i.ls),e.removeEventListener(o.A.TOUCH_PRESS,i.x5)}}},50986:(e,t,n)=>{"use strict";n.d(t,{A:()=>m,r:()=>b});var o=n(15327),i=n(15295),a=n(95527),r=n(58640),s=n(60810),l=n(82056),d=n(93126),c=n(44049),u=n(72967),h=n(64843),g=n(77609),p=n(68040);const f="PlanarFreehandContourSegmentationTool";async function m(e){const t=e.detail.annotation;if(!(0,h.isContourSegmentationAnnotation)(t))return;const n=function(e){const t=(0,i.A)(e),n=t.find((e=>v(e,!0)));return n??t[0]}(t),g=function(e,t){const{annotationUID:n}=t;return(0,l.getAllAnnotations)().filter((o=>o.annotationUID&&o.annotationUID!==n&&(0,h.isContourSegmentationAnnotation)(o)&&(0,h.areSameSegment)(o,t)&&e.isReferenceViewable(o.metadata)))}(n,t);if(!g.length)return;const m=w(t.data.contour.polyline,n),E=function(e,t,n){const o=a.polyline.getAABB(t);for(let i=0;i<n.length;i++){const r=n[i],s=w(r.data.contour.polyline,e),l=a.polyline.getAABB(s),d=a.aabb.intersectAABB(o,l),c=d&&a.polyline.intersectPolyline(t,s),u=d&&!c&&a.polyline.containsPoints(s,t);if(c||u)return{targetAnnotation:r,targetPolyline:s,isContourHole:u}}}(n,m,g);if(!E)return;const{targetAnnotation:I,targetPolyline:y,isContourHole:_}=E;if(_){const{contourHoleProcessingEnabled:o=!1}=e.detail;if(!o)return;b(n,I,t)}else!function(e,t,n,i,g){if(!(0,p.l$)(f))return void console.warn(`${f} is not registered in cornerstone`);if(!v(e))return;const m=g[0],b=a.polyline.containsPoint(n,m),E=function(e,t){return(0,l.getChildAnnotations)(t).map((t=>({annotation:t,polyline:w(t.data.contour.polyline,e)})))}(e,t),I=new Set(E),y=new Map,_=(e,t)=>{let n=y.get(e);n||(n=[],y.set(e,n)),n.push(t),I.delete(t)},C=[];if(b){const e=a.polyline.mergePolylines(n,g);C.push(e),Array.from(I.keys()).forEach((t=>_(e,t)))}else{a.polyline.subtractPolylines(n,g).forEach((e=>{C.push(e),Array.from(I.keys()).forEach((t=>{a.polyline.containsPoints(e,t.polyline)&&(_(e,t),I.delete(t))}))}))}Array.from(y.values()).forEach((e=>e.forEach((e=>(0,l.clearParentAnnotation)(e.anno