cubevis 0.5.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. cubevis/LICENSE.rst +500 -0
  2. cubevis/__icons__/20px/fast-backward.svg +13 -0
  3. cubevis/__icons__/20px/fast-forward.svg +13 -0
  4. cubevis/__icons__/20px/step-backward.svg +12 -0
  5. cubevis/__icons__/20px/step-forward.svg +12 -0
  6. cubevis/__icons__/add-chan.png +0 -0
  7. cubevis/__icons__/add-chan.svg +84 -0
  8. cubevis/__icons__/add-cube.png +0 -0
  9. cubevis/__icons__/add-cube.svg +186 -0
  10. cubevis/__icons__/drag.png +0 -0
  11. cubevis/__icons__/drag.svg +109 -0
  12. cubevis/__icons__/mask-selected.png +0 -0
  13. cubevis/__icons__/mask.png +0 -0
  14. cubevis/__icons__/mask.svg +1 -0
  15. cubevis/__icons__/new-layer-sm-selected.png +0 -0
  16. cubevis/__icons__/new-layer-sm-selected.svg +88 -0
  17. cubevis/__icons__/new-layer-sm.png +0 -0
  18. cubevis/__icons__/new-layer-sm.svg +15 -0
  19. cubevis/__icons__/reset.png +0 -0
  20. cubevis/__icons__/reset.svg +11 -0
  21. cubevis/__icons__/sub-chan.png +0 -0
  22. cubevis/__icons__/sub-chan.svg +71 -0
  23. cubevis/__icons__/sub-cube.png +0 -0
  24. cubevis/__icons__/sub-cube.svg +95 -0
  25. cubevis/__icons__/zoom-to-fit.png +0 -0
  26. cubevis/__icons__/zoom-to-fit.svg +21 -0
  27. cubevis/__init__.py +58 -0
  28. cubevis/__js__/bokeh-3.6.1.min.js +728 -0
  29. cubevis/__js__/bokeh-tables-3.6.1.min.js +119 -0
  30. cubevis/__js__/bokeh-widgets-3.6.1.min.js +141 -0
  31. cubevis/__js__/casalib.min.js +1 -0
  32. cubevis/__js__/cubevisjs.min.js +62 -0
  33. cubevis/__version__.py +1 -0
  34. cubevis/apps/__init__.py +44 -0
  35. cubevis/apps/_createmask.py +461 -0
  36. cubevis/apps/_createregion.py +513 -0
  37. cubevis/apps/_interactiveclean.py +3260 -0
  38. cubevis/apps/_interactiveclean_wrappers.py +130 -0
  39. cubevis/apps/_ms_raster.py +815 -0
  40. cubevis/apps/_plotants.py +286 -0
  41. cubevis/apps/_plotbandpass.py +7 -0
  42. cubevis/bokeh/__init__.py +29 -0
  43. cubevis/bokeh/annotations/__init__.py +1 -0
  44. cubevis/bokeh/annotations/_ev_poly_annotation.py +6 -0
  45. cubevis/bokeh/components/__init__.py +28 -0
  46. cubevis/bokeh/format/__init__.py +31 -0
  47. cubevis/bokeh/format/_time_ticks.py +44 -0
  48. cubevis/bokeh/format/_wcs_ticks.py +45 -0
  49. cubevis/bokeh/models/__init__.py +4 -0
  50. cubevis/bokeh/models/_edit_span.py +7 -0
  51. cubevis/bokeh/models/_ev_text_input.py +6 -0
  52. cubevis/bokeh/models/_tip.py +37 -0
  53. cubevis/bokeh/models/_tip_button.py +50 -0
  54. cubevis/bokeh/sources/__init__.py +35 -0
  55. cubevis/bokeh/sources/_data_pipe.py +258 -0
  56. cubevis/bokeh/sources/_image_data_source.py +83 -0
  57. cubevis/bokeh/sources/_image_pipe.py +581 -0
  58. cubevis/bokeh/sources/_spectra_data_source.py +55 -0
  59. cubevis/bokeh/sources/_updatable_data_source.py +189 -0
  60. cubevis/bokeh/state/__init__.py +34 -0
  61. cubevis/bokeh/state/_initialize.py +164 -0
  62. cubevis/bokeh/state/_javascript.py +53 -0
  63. cubevis/bokeh/state/_palette.py +58 -0
  64. cubevis/bokeh/state/_session.py +44 -0
  65. cubevis/bokeh/state/js/bokeh-2.4.1.min.js +596 -0
  66. cubevis/bokeh/state/js/bokeh-gl-2.4.1.min.js +74 -0
  67. cubevis/bokeh/state/js/bokeh-tables-2.4.1.min.js +132 -0
  68. cubevis/bokeh/state/js/bokeh-widgets-2.4.1.min.js +118 -0
  69. cubevis/bokeh/state/js/casaguijs-v0.0.4.0-b2.4.min.js +49 -0
  70. cubevis/bokeh/state/js/casaguijs-v0.0.5.0-b2.4.min.js +49 -0
  71. cubevis/bokeh/state/js/casaguijs-v0.0.6.0-b2.4.min.js +49 -0
  72. cubevis/bokeh/state/js/casalib-v0.0.1.min.js +1 -0
  73. cubevis/bokeh/tools/__init__.py +31 -0
  74. cubevis/bokeh/tools/_cbreset_tool.py +52 -0
  75. cubevis/bokeh/tools/_drag_tool.py +61 -0
  76. cubevis/bokeh/utils/__init__.py +35 -0
  77. cubevis/bokeh/utils/_axes_labels.py +94 -0
  78. cubevis/bokeh/utils/_svg_icon.py +136 -0
  79. cubevis/data/__init__.py +1 -0
  80. cubevis/data/casaimage/__init__.py +114 -0
  81. cubevis/data/measurement_set/__init__.py +7 -0
  82. cubevis/data/measurement_set/_ms_data.py +178 -0
  83. cubevis/data/measurement_set/processing_set/__init__.py +30 -0
  84. cubevis/data/measurement_set/processing_set/_ps_concat.py +98 -0
  85. cubevis/data/measurement_set/processing_set/_ps_coords.py +78 -0
  86. cubevis/data/measurement_set/processing_set/_ps_data.py +213 -0
  87. cubevis/data/measurement_set/processing_set/_ps_io.py +55 -0
  88. cubevis/data/measurement_set/processing_set/_ps_raster_data.py +154 -0
  89. cubevis/data/measurement_set/processing_set/_ps_select.py +91 -0
  90. cubevis/data/measurement_set/processing_set/_ps_stats.py +218 -0
  91. cubevis/data/measurement_set/processing_set/_xds_data.py +149 -0
  92. cubevis/plot/__init__.py +1 -0
  93. cubevis/plot/ms_plot/__init__.py +29 -0
  94. cubevis/plot/ms_plot/_ms_plot.py +242 -0
  95. cubevis/plot/ms_plot/_ms_plot_constants.py +22 -0
  96. cubevis/plot/ms_plot/_ms_plot_selectors.py +348 -0
  97. cubevis/plot/ms_plot/_raster_plot.py +292 -0
  98. cubevis/plot/ms_plot/_raster_plot_inputs.py +116 -0
  99. cubevis/plot/ms_plot/_xds_plot_axes.py +110 -0
  100. cubevis/private/__java__/xml-casa-assembly-1.86.jar +0 -0
  101. cubevis/private/_gclean.py +798 -0
  102. cubevis/private/casashell/createmask.py +332 -0
  103. cubevis/private/casashell/iclean.py +4432 -0
  104. cubevis/private/casatasks/__init__.py +140 -0
  105. cubevis/private/casatasks/createmask.py +86 -0
  106. cubevis/private/casatasks/createregion.py +83 -0
  107. cubevis/private/casatasks/iclean.py +1831 -0
  108. cubevis/readme.rst +16 -0
  109. cubevis/remote/__init__.py +10 -0
  110. cubevis/remote/_gclean.py +61 -0
  111. cubevis/remote/_local.py +287 -0
  112. cubevis/remote/_remote_kernel.py +80 -0
  113. cubevis/toolbox/__init__.py +32 -0
  114. cubevis/toolbox/_app_context.py +74 -0
  115. cubevis/toolbox/_cube.py +3457 -0
  116. cubevis/toolbox/_region_list.py +197 -0
  117. cubevis/utils/_ResourceManager.py +86 -0
  118. cubevis/utils/__init__.py +620 -0
  119. cubevis/utils/_contextmgrchain.py +84 -0
  120. cubevis/utils/_conversion.py +93 -0
  121. cubevis/utils/_copydoc.py +55 -0
  122. cubevis/utils/_docenum.py +25 -0
  123. cubevis/utils/_import_protected_module.py +35 -0
  124. cubevis/utils/_logging.py +85 -0
  125. cubevis/utils/_pkgs.py +77 -0
  126. cubevis/utils/_regions.py +40 -0
  127. cubevis/utils/_static.py +66 -0
  128. cubevis/utils/_tiles.py +167 -0
  129. cubevis-0.5.2.dist-info/METADATA +151 -0
  130. cubevis-0.5.2.dist-info/RECORD +132 -0
  131. cubevis-0.5.2.dist-info/WHEEL +4 -0
  132. cubevis-0.5.2.dist-info/licenses/LICENSE +504 -0
@@ -0,0 +1 @@
1
+ "use strict";(()=>{var si=Object.create;var gt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var oi=Object.getPrototypeOf,fi=Object.prototype.hasOwnProperty;var pt=Math.pow;var Z=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var di=(l,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of li(e))!fi.call(l,n)&&n!==t&&gt(l,n,{get:()=>e[n],enumerable:!(i=ai(e,n))||i.enumerable});return l};var ui=(l,e,t)=>(t=l!=null?si(oi(l)):{},di(e||!l||!l.__esModule?gt(t,"default",{value:l,enumerable:!0}):t,l));var ue=Z(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.Point2D=void 0;var $e=class{getX(){return this.x}setX(e){this.x=e}getY(){return this.y}setY(e){this.y=e}setLocation(e,t){this.x=e,this.y=t}constructor(e,t){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)){let i=arguments;this.x===void 0&&(this.x=0),this.y===void 0&&(this.y=0),this.x=e,this.y=t}else if(e===void 0&&t===void 0){let i=arguments;this.x===void 0&&(this.x=0),this.y===void 0&&(this.y=0),this.x=0,this.y=0}else throw new Error("invalid overload")}};Pe.Point2D=$e;$e.__class="coordtxl.geom.Point2D"});var At=Z(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.MapKeywordProvider=void 0;var xe=class{constructor(e){this.wcsMap===void 0&&(this.wcsMap=null),this.wcsMap={};{let t=Object.keys(e);for(let i=0;i<t.length;i++){let n=t[i];if(((r,s)=>r[s]===void 0?null:r[s])(e,n)!=null&&((r,s)=>r[s]===void 0?null:r[s])(e,n)instanceof Array){let r=((a,f)=>a[f]===void 0?null:a[f])(e,n);this.wcsMap[n]=(a=>{if(a.clone!=null)return a.clone();{let f=Object.create(a);for(let o in a)a.hasOwnProperty(o)&&(f[o]=a[o]);return f}})(r);let s=1;for(let a=0;a<r.length;a++){let f=r[a];this.wcsMap[n+s]=f,s+=1}}else this.wcsMap[n]=((r,s)=>r[s]===void 0?null:r[s])(e,n)}}}findKey(e){return this.wcsMap.hasOwnProperty(e)}getStringValue$java_lang_String(e){return this.getStringValue$java_lang_String$java_lang_String(e,null)}getStringValue$java_lang_String$java_lang_String(e,t){return this.wcsMap.hasOwnProperty(e)?((i,n)=>i[n]===void 0?null:i[n])(this.wcsMap,e).toString():t}getStringValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null))return this.getStringValue$java_lang_String$java_lang_String(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getStringValue$java_lang_String(e);throw new Error("invalid overload")}getDoubleValue$java_lang_String(e){return this.getDoubleValue$java_lang_String$double(e,0)}getDoubleValue$java_lang_String$double(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i:t}getDoubleValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getDoubleValue$java_lang_String$double(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getDoubleValue$java_lang_String(e);throw new Error("invalid overload")}getFloatValue$java_lang_String(e){return this.getFloatValue$java_lang_String$float(e,Math.fround(0))}getFloatValue$java_lang_String$float(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i:t}getFloatValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getFloatValue$java_lang_String$float(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getFloatValue$java_lang_String(e);throw new Error("invalid overload")}getIntValue$java_lang_String(e){return this.getIntValue$java_lang_String$int(e,0)}getIntValue$java_lang_String$int(e,t){if(!this.wcsMap.hasOwnProperty(e))return t;let i=((n,r)=>n[r]===void 0?null:n[r])(this.wcsMap,e);return typeof i=="number"?i|0:t}getIntValue(e,t){if((typeof e=="string"||e===null)&&(typeof t=="number"||t===null))return this.getIntValue$java_lang_String$int(e,t);if((typeof e=="string"||e===null)&&t===void 0)return this.getIntValue$java_lang_String(e);throw new Error("invalid overload")}toString(){let e=!1,t={str:"{ ",toString:function(){return this.str}};{let i=Object.keys(this.wcsMap);for(let n=0;n<i.length;n++){let r=i[n];{e?(a=>(a.str+=", ",a))(t):e=!0,(a=>(a.str+=r,a))(t),(a=>(a.str+="=",a))(t);let s=((a,f)=>a[f]===void 0?null:a[f])(this.wcsMap,r);if(typeof s=="string")(a=>(a.str+='"',a))(t),(a=>(a.str+=s,a))(t),(a=>(a.str+='"',a))(t);else if(s!=null&&s instanceof Array){let a=s,f="[";for(let o=0;o<a.length;++o){o!==0&&(f+=", ");let u=a[o];typeof u=="string"?f+='"'+u+'"':f+=u}f+="]",(o=>(o.str+=f,o))(t)}else(a=>(a.str+=s,a))(t)}}}return(i=>(i.str+=" }",i))(t),t.str}};Te.MapKeywordProvider=xe;xe.__class="coordtxl.coords.MapKeywordProvider";xe.__interfaces=["coordtxl.coords.WCSKeywordProvider"]});var Et=Z(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.slasubs=void 0;var hi=ue(),te=class{static slaDcs2c(e,t){let i=Math.cos(t),n=[0,0,0];return n[0]=Math.cos(e)*i,n[1]=Math.sin(e)*i,n[2]=Math.sin(t),n}static slaDmxv(e,t){let i,n,r,s=[0,0,0],a=[0,0,0];for(n=0;n<3;n++){for(r=0,i=0;i<3;i++)r+=e[n][i]*t[i];s[n]=r}for(n=0;n<3;n++)a[n]=s[n];return a}static slaDcc2s(e){let t,i,n,r;t=e[0],i=e[1],n=e[2],r=Math.sqrt(t*t+i*i);let s=new hi.Point2D;return s.x=r!==0?Math.atan2(i,t):0,s.y=n!==0?Math.atan2(n,r):0,s}static slaDranrm(e){let t;return t=((i,n)=>{let r=Math.abs(i%n);return isNaN(r)||r==n||r<=Math.abs(n)/2?r:(i>0?1:-1)*(r-n)})(e,te.D2PI),t>=0?t:t+te.D2PI}static slaDeuler(e,t,i,n){let r,s,a,f,o,u=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),c=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),h,g,d,p,x=function(m){let C=function(v){if(v.length===0)return 0;{let D=[];for(let T=0;T<v[0];T++)D.push(C(v.slice(1)));return D}};return C(m)}([3,3]),y;for(r=0;r<3;r++)for(s=0;s<3;s++)u[s][r]=s===r?1:0;for(a=e.length,f=0;f<3;f++)if(f<=a){for(r=0;r<3;r++)for(s=0;s<3;s++)c[s][r]=s===r?1:0;switch(f){case 0:default:h=t;break;case 1:h=i;break;case 2:h=n;break}for(g=Math.sin(h),d=Math.cos(h),y=e.charAt(f),(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="X".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="x".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="1".charCodeAt(0)?(c[1][1]=d,c[1][2]=g,c[2][1]=-g,c[2][2]=d):(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="Y".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="y".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="2".charCodeAt(0)?(c[0][0]=d,c[0][2]=-g,c[2][0]=g,c[2][2]=d):(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="Z".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="z".charCodeAt(0)||(m=>m.charCodeAt==null?m:m.charCodeAt(0))(y)=="3".charCodeAt(0)?(c[0][0]=d,c[0][1]=g,c[1][0]=-g,c[1][1]=d):a=0,s=0;s<3;s++)for(r=0;r<3;r++){for(p=0,o=0;o<3;o++)p+=c[s][o]*u[o][r];x[s][r]=p}for(r=0;r<3;r++)for(s=0;s<3;s++)u[s][r]=x[s][r]}return u}static slDE2H(e,t,i){let n=[0,0],r=Math.sin(e),s=Math.cos(e),a=Math.sin(t),f=Math.cos(t),o=Math.sin(i),u=Math.cos(i),c=-s*f*o+a*u,h=-r*f,g=s*f*u+a*o,d=Math.sqrt(c*c+h*h),p;return d===0?p=0:p=Math.atan2(h,c),p<0&&(p=p+2*Math.PI),n[0]=p,n[1]=Math.atan2(g,d),n}static slDVTP(e,t){let i,n=e[0],r=e[1],s=e[2],a=t[0],f=t[1],o=t[2],u=a*a+f*f,c=Math.sqrt(u);c===0&&(c=1e-20,a=c);let h=n*a+r*f,g=h+s*o;g>te.TINY?i=0:g>=0?(i=1,g=te.TINY):g>-te.TINY?(i=2,g=-te.TINY):i=3,g=g*c;let d=(r*a-n*f)/g,p=(s*u-o*h)/g;return i!==0&&console.info("ERROR: From slDVTP, J = "+i),[d,p]}};Ie.slasubs=te;te.TINY=1e-6;te.D2PI=6.283185307179586;te.__class="coordtxl.coords.slasubs"});var jt=Z(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.wcscon=void 0;var X=ue(),b=class{static a_$LI$(){return b.a==null&&(b.a=[-162557e-11,-31919e-11,-13843e-11]),b.a}static ad_$LI$(){return b.ad==null&&(b.ad=[.001245,-.00158,-659e-6]),b.ad}static emi_$LI$(){return b.emi==null&&(b.emi=[[.99992567949991,-.011181482788805,-.004859004008828,-.000541640798032,-.237963047085011,.436218238658637],[.011181482840782,.999937484898031,-27155744957e-15,.237912530551179,-.00266070648897,-.008537588719453],[.004859003889183,-27177143501e-15,.999988194601879,-.436101961325347,.012258830424865,.002119065556992],[-2423898405e-15,27105439e-15,11777422e-15,.999904322043106,-.011181451601069,-.004858519608686],[-27105439e-15,-2423927017e-15,65851e-15,.011181451608968,.999916125340107,-27162614355e-15],[-11777422e-15,65846e-15,-2424049954e-15,.004858519590501,-27165866691e-15,.999966838131419]]),b.emi}static fk524(e){let t=new X.Point2D(0,0);return b.fk524m(e,t)}static fk524e(e,t){let i=new X.Point2D(0,0),n=b.fk524m(e,i);return n.x=n.x+i.x*(t-1950),n.y=n.y+i.y*(t-1950),n}static fk524m(e,t){let i,n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D=[0,0,0,0,0,0],T=[0,0,0,0,0,0],$,K,V,S,E,w,P,_,M=6.283185307179586,A,q=1e-30,j=0;for(A=100*60*60*360/M,i=I.WCSTransform.degrad(e.x),n=I.WCSTransform.degrad(e.y),r=I.WCSTransform.degrad(t.x),s=I.WCSTransform.degrad(t.y),c=r*A,h=s*A,g=Math.sin(i),d=Math.cos(i),p=Math.sin(n),x=Math.cos(n),y=d*x,m=g*x,C=p,D[0]=y,D[1]=m,D[2]=C,c!==j||h!==j?(D[3]=-(c*m)-d*p*h,D[4]=c*y-g*p*h,D[5]=x*h):(D[3]=j,D[4]=j,D[5]=j),P=0;P<6;P++){for(v=j,_=0;_<6;_++)v=v+b.emi_$LI$()[_][P]*D[_];T[P]=v}return y=T[0],m=T[1],C=T[2],$=T[3],K=T[4],V=T[5],S=Math.sqrt(y*y+m*m+C*C),y=y+b.a_$LI$()[0]*S,m=m+b.a_$LI$()[1]*S,C=C+b.a_$LI$()[2]*S,$=$+b.ad_$LI$()[0]*S,K=K+b.ad_$LI$()[1]*S,V=V+b.ad_$LI$()[2]*S,E=y*y+m*m,w=Math.sqrt(E),y===j&&m===j?a=j:(a=Math.atan2(m,y),a<j&&(a=a+M)),f=Math.atan2(C,w),w>q&&(c=(y*K-m*$)/E,h=(V*E-C*(y*$+m*K))/((E+C*C)*w)),o=c/A,u=h/A,e.x=I.WCSTransform.raddeg(a),e.y=I.WCSTransform.raddeg(f),t.x=I.WCSTransform.raddeg(o),t.y=I.WCSTransform.raddeg(u),e}static em_$LI$(){return b.em==null&&(b.em=[[.999925678186902,.011182059571766,.004857946721186,-.000541652366951,.237917612131583,-.43611127603927],[-.011182059642247,.999937478448132,-27147426498e-15,-.237968129744288,-.002660763319071,.012259092261564],[-.00485794655896,-27176441185e-15,.99998819973877,.436227555856097,-.008537771074048,.002119110818172],[2423950176e-15,27106627e-15,11776559e-15,.999947035154614,.011182506007242,.00485766994865],[-27106627e-15,2423978783e-15,-65816e-15,-.011182506121805,.999958833818833,-27137309539e-15],[-11776558e-15,-65874e-15,2424101735e-15,-.004857669684959,-27184471371e-15,1.000009560363559]]),b.em}static fk425(e){let t=new X.Point2D(0,0);return b.fk425m(e,t)}static fk425e(e,t){let i=new X.Point2D(0,0),n=b.fk425m(e,i);return n.x=n.x+i.x*(t-2e3),n.y=n.y+i.y*(t-2e3),n}static fk425m(e,t){let i,n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P,_,M=[0,0,0],A=[0,0,0],q=[0,0,0,0,0,0],j=[0,0,0,0,0,0],L=6.283185307179586,R,ie=1e-30,ee=0;for(R=100*60*60*360/L,i=I.WCSTransform.degrad(e.x),n=I.WCSTransform.degrad(e.y),r=I.WCSTransform.degrad(t.x),s=I.WCSTransform.degrad(t.y),c=r*R,h=s*R,g=Math.sin(i),d=Math.cos(i),p=Math.sin(n),x=Math.cos(n),M[0]=d*x,M[1]=g*x,M[2]=p,A[0]=-g*x*c-d*p*h,A[1]=d*x*c-g*p*h,A[2]=x*h,y=M[0]*b.a_$LI$()[0]+M[1]*b.a_$LI$()[1]+M[2]*b.a_$LI$()[2],m=M[0]*b.ad_$LI$()[0]+M[1]*b.ad_$LI$()[1]+M[2]*b.ad_$LI$()[2],P=0;P<3;P++)q[P]=M[P]-b.a_$LI$()[P]+y*M[P],q[P+3]=A[P]-b.ad_$LI$()[P]+m*M[P];for(P=0;P<6;P++){for(y=ee,_=0;_<6;_++)y=y+b.em_$LI$()[_][P]*q[_];j[P]=y}return C=j[0],v=j[1],D=j[2],T=j[3],$=j[4],K=j[5],V=C*C+v*v,S=V+D*D,E=Math.sqrt(V),w=C*T+v*$,C===ee&&v===ee?a=ee:(a=Math.atan2(v,C),a<ee&&(a=a+L)),f=Math.atan2(D,E),E>ie&&(c=(C*$-v*T)/V,h=(K*V-D*w)/(S*E)),o=c/R,u=h/R,e.x=I.WCSTransform.raddeg(a),e.y=I.WCSTransform.raddeg(f),t.x=I.WCSTransform.raddeg(o),t.y=I.WCSTransform.raddeg(u),e}static bgal_$LI$(){return b.bgal==null&&(b.bgal=[[-.066988739415,-.872755765852,-.483538914632],[.492728466075,-.45034695802,.744584633283],[-.867600811151,-.188374601723,.460199784784]]),b.bgal}static fk42gal(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;f=e.x,o=e.y,s=I.WCSTransform.degrad(f),a=I.WCSTransform.degrad(o);let c=new X.Point2D,h=new X.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.bgal_$LI$()[u][0]+t[1]*b.bgal_$LI$()[u][1]+t[2]*b.bgal_$LI$()[u][2];let g=new X.Point2D,d=new X.Point2D;return b.jpcon(i,g,d),n=I.WCSTransform.raddeg(g.x),r=I.WCSTransform.raddeg(g.y),e.x=n,e.y=r,b.idg>0,e}static gal2fk4(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;n=e.x,r=e.y,s=I.WCSTransform.degrad(n),a=I.WCSTransform.degrad(r);let c=new X.Point2D,h=new X.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.bgal_$LI$()[0][u]+t[1]*b.bgal_$LI$()[1][u]+t[2]*b.bgal_$LI$()[2][u];let g=new X.Point2D,d=new X.Point2D;return b.jpcon(i,g,d),f=I.WCSTransform.raddeg(g.x),o=I.WCSTransform.raddeg(g.y),e.x=f,e.y=o,b.idg>0,e}static jgal_$LI$(){return b.jgal==null&&(b.jgal=[[-.054875539726,-.87343710801,-.483834985808],[.494109453312,-.444829589425,.74698225181],[-.867666135858,-.198076386122,.455983795705]]),b.jgal}static fk52gal(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;f=e.x,o=e.y,s=I.WCSTransform.degrad(f),a=I.WCSTransform.degrad(o);let c=new X.Point2D,h=new X.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.jgal_$LI$()[u][0]+t[1]*b.jgal_$LI$()[u][1]+t[2]*b.jgal_$LI$()[u][2];let g=new X.Point2D,d=new X.Point2D;return b.jpcon(i,g,d),n=I.WCSTransform.raddeg(g.x),r=I.WCSTransform.raddeg(g.y),e.x=n,e.y=r,b.idg>0,e}static gal2fk5(e){let t=[0,0,0],i=[0,0,0],n,r,s,a,f,o,u;n=e.x,r=e.y,s=I.WCSTransform.degrad(n),a=I.WCSTransform.degrad(r);let c=new X.Point2D,h=new X.Point2D;for(b.jpcop(s,a,1,c,h),t[0]=c.x,t[1]=c.y,t[2]=h.x,u=0;u<3;u++)i[u]=t[0]*b.jgal_$LI$()[0][u]+t[1]*b.jgal_$LI$()[1][u]+t[2]*b.jgal_$LI$()[2][u];let g=new X.Point2D,d=new X.Point2D;return b.jpcon(i,g,d),f=I.WCSTransform.raddeg(g.x),o=I.WCSTransform.raddeg(g.y),e.x=f,e.y=o,b.idg>0,e}static jpcon(e,t,i){let n,r,s,a,f,o;n=e[0],r=e[1],s=e[2],t.x=Math.atan2(r,n),t.x<0&&(t.x=t.x+6.283185307179586),f=n*n+r*r,a=Math.sqrt(f),t.y=Math.atan2(s,a),o=s*s,i.x=Math.sqrt(f+o)}static jpcop(e,t,i,n,r){n.x=i*Math.cos(e)*Math.cos(t),n.y=i*Math.sin(e)*Math.cos(t),r.x=i*Math.sin(t)}static fk4prec(e,t,i){let n=I.WCSTransform.degrad(i.x),r=I.WCSTransform.degrad(i.y),s=b.mprecfk4(e,t),a=re.slasubs.slaDcs2c(n,r),f=re.slasubs.slaDmxv(s,a),o=re.slasubs.slaDcc2s(f);return n=o.x,r=o.y,n=re.slasubs.slaDranrm(n),i.x=I.WCSTransform.raddeg(n),i.y=I.WCSTransform.raddeg(r),i}static fk5prec(e,t,i){let n=I.WCSTransform.degrad(i.x),r=I.WCSTransform.degrad(i.y),s=b.mprecfk5(e,t),a=re.slasubs.slaDcs2c(n,r),f=re.slasubs.slaDmxv(s,a),o=re.slasubs.slaDcc2s(f);return n=o.x,r=o.y,n=re.slasubs.slaDranrm(n),i.x=I.WCSTransform.raddeg(n),i.y=I.WCSTransform.raddeg(r),i}static mprecfk4(e,t){let i,n,r,s,a,f,o;return i=(e-1850)/100,n=(t-e)/100,r=n*b.DAS2R,s=2303.5548+(1.3972+59e-6*i)*i,a=(s+(.30242-269e-6*i+.017996*n)*n)*r,f=(s+(1.09478+387e-6*i+.018324*n)*n)*r,o=(2005.1125+(-.85294-365e-6*i)*i+(-.42647-365e-6*i-.041802*n)*n)*r,re.slasubs.slaDeuler("ZYZ",-a,o,-f)}static mprecfk5(e,t){let i,n,r,s,a,f,o;return i=(e-2e3)/100,n=(t-e)/100,r=n*b.DAS2R,s=2306.2181+(1.39656-139e-6*i)*i,a=(s+(.30188-344e-6*i+.017998*n)*n)*r,f=(s+(1.09468+66e-6*i+.018203*n)*n)*r,o=(2004.3109+(-.8533-217e-6*i)*i+(-.42665-217e-6*i-.041833*n)*n)*r,re.slasubs.slaDeuler("ZYZ",-a,o,-f)}};Ve.wcscon=b;b.idg=0;b.DAS2R=484813681109536e-20;b.__class="coordtxl.coords.wcscon";var re=Et(),I=we()});var $t=Z(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.worldpos=void 0;var tt=ue(),Oe=class{static getPosition(e,t,i){let n,r,s,a,f,o,u,c,h=0,g=0,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P=.01745329252,_=6.28318530717959,M=1e-5,A,q,j,L,R,ie,ee,De=i.pcode,pe,Ae;if(A=i.xref,q=i.yref,j=i.xrefpix,L=i.yrefpix,R=i.xinc,ie=i.yinc,ee=O.WCSTransform.degrad(i.rot),n=Math.cos(ee),r=Math.sin(ee),s=e-j,a=t-L,i.rotmat>0)o=s*i.cd11+a*i.cd12,a=s*i.cd21+a*i.cd22,s=o;else{if(R===0||ie===0)return null;s=s*R,a=a*ie,ee!==0&&(o=s*n-a*r,a=s*r+a*n,s=o)}if(pe=A+s,Ae=q+a,De<0)return new tt.Point2D(pe,Ae);switch(i.coorflip>0?(T=O.WCSTransform.degrad(A),$=O.WCSTransform.degrad(q),o=s,s=a,a=o):($=O.WCSTransform.degrad(A),T=O.WCSTransform.degrad(q)),p=O.WCSTransform.degrad(s),x=O.WCSTransform.degrad(a),u=p*p+x*x,v=Math.cos(T),D=Math.sin(T),De){case-1:case 0:g=$+p,h=T+x;break;case 1:if(c=Math.sqrt(1-u),d=D*c+v*x,d>1||d<-1||(h=Math.asin(d),g=v*c-D*x,g===0&&p===0))return null;g=Math.atan2(p,g)+$;break;case 2:if(h=v-x*D,h===0)return null;g=$+Math.atan2(p,h),h=Math.atan(Math.cos(g-$)*(x*v+D)/h);break;case 3:if(u>=_*_/4||(u=Math.sqrt(u),c=Math.cos(u),u!==0?u=Math.sin(u)/u:u=1,d=x*v*u+D*c,d>1||d<-1)||(h=Math.asin(d),m=c-d*D,d=p*u*v,m===0&&d===0))return null;g=$+Math.atan2(d,m);break;case 4:if(h=v-x*D,h===0||(g=$+Math.atan2(p,h),d=Math.cos(g-$),d===0)||(h=h/d,h>1||h<-1))return null;h=Math.acos(h),T<0&&(h=-h);break;case 5:if(h=T+x,Math.abs(h)>_/4||(c=Math.cos(h),Math.abs(p)>_*c/2))return null;g=$,c>M&&(g=g+p/c);break;case 6:if(d=ie*n+R*r,d===0&&(d=1),a=O.WCSTransform.degrad(q/2+45),s=a+d/2*P,a=Math.log(Math.tan(a)),s=Math.log(Math.tan(s)),E=O.WCSTransform.degrad(d)/(s-a),w=E*a,S=Math.cos(O.WCSTransform.degrad(q)),S<=0&&(S=1),g=p/S+$,Math.abs(g-$)>_)return null;d=0,E!==0&&(d=(x+w)/E),d=Math.exp(d),h=2*Math.atan(d)-_/4;break;case 7:if(d=ie*n+R*r,d===0&&(d=1),d=O.WCSTransform.degrad(d),a=O.WCSTransform.degrad(q),s=Math.sin(a+d)/Math.sqrt((1+Math.cos(a+d))/2)-Math.sin(a)/Math.sqrt((1+Math.cos(a))/2),s===0&&(s=1),E=d/s,d=R*n-ie*r,d===0&&(d=1),d=O.WCSTransform.degrad(d),s=2*Math.cos(a)*Math.sin(d/2),s===0&&(s=1),S=d*Math.sqrt((1+Math.cos(a)*Math.cos(d/2))/2)/s,w=E*Math.sin(a)/Math.sqrt((1+Math.cos(a))/2),g=$,h=T,p===0&&x===0)break;if(f=4-p*p/(4*S*S)-(x+w)/E*((x+w)/E),f>4||f<2||(f=.5*Math.sqrt(f),C=(x+w)*f/E,Math.abs(C)>1)||(C=Math.asin(C),Math.abs(Math.cos(C))<M)||(m=p*f/(2*S*Math.cos(C)),Math.abs(m)>1))return null;m=Math.asin(m),g=$+2*m,h=C;break;case 8:if(f=(4-u)/(4+u),Math.abs(f)>1||(h=f*D+x*v*(1+f)/2,Math.abs(h)>1)||(h=Math.asin(h),g=Math.cos(h),Math.abs(g)<M)||(g=p*(1+f)/(2*g),Math.abs(g)>1)||(g=Math.asin(g),y=1+Math.sin(h)*D+Math.cos(h)*v*Math.cos(g),Math.abs(y)<M))return null;y=2*(Math.sin(h)*v-Math.cos(h)*D*Math.cos(g))/y,Math.abs(y-x)>M&&(g=_/2-g),g=$+g;break}return V=g,K=h,V-$>_/2&&(V=V-_),V-$<-_/2&&(V=V+_),V<0&&(V+=_),pe=O.WCSTransform.raddeg(V),Ae=O.WCSTransform.raddeg(K),new tt.Point2D(pe,Ae)}static getPixels(e,t,i){let n,r,s=0,a=0,f=0,o=0,u=0,c=0,h,g,d,p=0,x=0,y=0,m,C,v,D,T,$,K=.01745329252,V=1e-5,S=6.28318530717959,E,w,P,_,M,A,q,j;switch(E=i.xref,w=i.yref,P=i.xrefpix,_=i.yrefpix,M=i.xinc,A=i.yinc,q=O.WCSTransform.degrad(i.rot),T=Math.cos(q),D=Math.sin(q),j=i.pcode,j>0&&j<9&&(i.coorflip>0?(a=O.WCSTransform.degrad(E),s=O.WCSTransform.degrad(w),h=e-w):(s=O.WCSTransform.degrad(E),a=O.WCSTransform.degrad(w),h=e-E),j>=0&&(h>180&&(e-=360),h<-180&&(e+=360)),f=O.WCSTransform.degrad(e),o=O.WCSTransform.degrad(t),u=Math.cos(o),c=Math.sin(o),x=Math.sin(f-s)*u,p=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s)),j){case 1:if(p<0)return null;y=c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s);break;case 2:if(p<=0)return null;y=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s),x=x/y,y=(c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s))/y;break;case 3:y=c*Math.sin(a)+u*Math.cos(a)*Math.cos(f-s),y<-1&&(y=-1),y>1&&(y=1),y=Math.acos(y),y!==0?y=y/Math.sin(y):y=1,x=x*y,y=(c*Math.cos(a)-u*Math.sin(a)*Math.cos(f-s))*y;break;case 4:if(a===0)return null;y=(Math.cos(a)-u*Math.cos(f-s))/Math.sin(a);break;case 5:if(h=f-s,Math.abs(o)>S/4||Math.abs(a)>S/4)return null;y=o-a,x=h*u;break;case 6:if(h=A*T+M*D,h===0&&(h=1),r=O.WCSTransform.degrad(w/2+45),n=r+h/2*K,r=Math.log(Math.tan(r)),n=Math.log(Math.tan(n)),C=O.WCSTransform.degrad(h)/(n-r),v=C*r,m=Math.cos(O.WCSTransform.degrad(w)),m<=0&&(m=1),h=f-s,x=m*h,h=o/2+S/8,h=Math.tan(h),h<V)return null;y=C*Math.log(h)-v;break;case 7:if(g=(f-s)/2,Math.abs(g)>S/4||(h=A*T+M*D,h===0&&(h=1),h=O.WCSTransform.degrad(h),r=O.WCSTransform.degrad(w),n=Math.sin(r+h)/Math.sqrt((1+Math.cos(r+h))/2)-Math.sin(r)/Math.sqrt((1+Math.cos(r))/2),n===0&&(n=1),C=h/n,h=M*T-A*D,h===0&&(h=1),h=O.WCSTransform.degrad(h),n=2*Math.cos(r)*Math.sin(h/2),n===0&&(n=1),m=h*Math.sqrt((1+Math.cos(r)*Math.cos(h/2))/2)/n,v=C*Math.sin(r)/Math.sqrt((1+Math.cos(r))/2),h=Math.sqrt((1+Math.cos(o)*Math.cos(g))/2),Math.abs(h)<V))return null;x=2*m*Math.cos(o)*Math.sin(g)/h,y=C*Math.sin(o)/h-v;break;case 8:if(g=f-s,Math.abs(o)>S/4||(d=1+c*Math.sin(a)+u*Math.cos(a)*Math.cos(g),Math.abs(d)<V))return null;d=2/d,x=x*d,y=d*(c*Math.cos(a)-u*Math.sin(a)*Math.cos(g));break}j>0&&j<9?(n=O.WCSTransform.raddeg(x),r=O.WCSTransform.raddeg(y)):(n=e-E,r=t-w),i.coorflip>0&&($=n,n=r,r=$),i.rotmat>0?($=n*i.dc11+r*i.dc12,r=n*i.dc21+r*i.dc22,n=$):(q!==0&&($=n*T+r*D,r=r*T-n*D,n=$),M!==0&&(n=n/M),A!==0&&(r=r/A));let L=n+P,R=r+_;return new tt.Point2D(L,R)}};Le.worldpos=Oe;Oe.__class="coordtxl.coords.worldpos";var O=we()});var Tt=Z(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.platepos=void 0;var Pt=ue(),k=class{static getPosition(e,t,i){let n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D;return n=e+i.x_pixel_offset-1+.5,r=t+i.y_pixel_offset-1+.5,s=(i.ppo_coeff[2]-n*i.x_pixel_size)/1e3,a=(r*i.y_pixel_size-i.ppo_coeff[5])/1e3,f=s*s,o=a*a,u=s*f,c=a*o,h=f+o,g=i.amd_x_coeff[0]*s+i.amd_x_coeff[1]*a+i.amd_x_coeff[2]+i.amd_x_coeff[3]*f+i.amd_x_coeff[4]*s*a+i.amd_x_coeff[5]*o+i.amd_x_coeff[6]*h+i.amd_x_coeff[7]*u+i.amd_x_coeff[8]*f*a+i.amd_x_coeff[9]*s*o+i.amd_x_coeff[10]*c+i.amd_x_coeff[11]*s*h+i.amd_x_coeff[12]*s*h*h,p=i.amd_y_coeff[0]*a+i.amd_y_coeff[1]*s+i.amd_y_coeff[2]+i.amd_y_coeff[3]*o+i.amd_y_coeff[4]*s*a+i.amd_y_coeff[5]*f+i.amd_y_coeff[6]*h+i.amd_y_coeff[7]*c+i.amd_y_coeff[8]*o*s+i.amd_y_coeff[9]*a*f+i.amd_y_coeff[10]*u+i.amd_y_coeff[11]*a*h+i.amd_y_coeff[12]*a*h*h,d=g/k.CONS2R,x=p/k.CONS2R,v=Math.tan(i.plate_dec),D=Math.cos(i.plate_dec),y=Math.atan2(d/D,1-x*v),m=y+i.plate_ra,m<0&&(m=m+k.TWOPI),C=Math.atan(Math.cos(y)/((1-x*v)/(x+v))),new Pt.Point2D(m/k.COND2R,C/k.COND2R)}static getPixels(e,t,i){let n,r,s,a,f,o,u,c,h,g,d,p,x,y,m,C,v,D,T,$,K,V,S,E,w,P,_,M,A,q,j,L,R,ie,ee;for(ie=e*k.COND2R,ee=t*k.COND2R,T=Math.sin(ee),$=Math.cos(ee),K=Math.sin(i.plate_dec),V=Math.cos(i.plate_dec),S=Math.sin(ie-i.plate_ra),E=Math.cos(ie-i.plate_ra),n=T*K+$*V*E,r=$*S*k.CONR2S/n,s=(T*V-$*K*E)*k.CONR2S/n,j=r/i.plate_scale,L=s/i.plate_scale,R=0;R<k.MAX_ITERATIONS&&(o=j*L,u=j*j,c=L*L,h=u*L,g=c*j,m=u+c,C=m*m,d=u*j,p=c*L,x=u*u,y=c*c,w=i.amd_x_coeff[0]*j+i.amd_x_coeff[1]*L+i.amd_x_coeff[2]+i.amd_x_coeff[3]*u+i.amd_x_coeff[4]*o+i.amd_x_coeff[5]*c+i.amd_x_coeff[6]*m+i.amd_x_coeff[7]*d+i.amd_x_coeff[8]*h+i.amd_x_coeff[9]*g+i.amd_x_coeff[10]*p+i.amd_x_coeff[11]*j*m+i.amd_x_coeff[12]*j*C,P=i.amd_x_coeff[0]+i.amd_x_coeff[3]*2*j+i.amd_x_coeff[4]*L+i.amd_x_coeff[6]*2*j+i.amd_x_coeff[7]*3*u+i.amd_x_coeff[8]*2*o+i.amd_x_coeff[9]*c+i.amd_x_coeff[11]*(3*u+c)+i.amd_x_coeff[12]*(5*x+6*u*c+y),_=i.amd_x_coeff[1]+i.amd_x_coeff[4]*j+i.amd_x_coeff[5]*2*L+i.amd_x_coeff[6]*2*L+i.amd_x_coeff[8]*u+i.amd_x_coeff[9]*2*o+i.amd_x_coeff[10]*3*c+i.amd_x_coeff[11]*2*o+i.amd_x_coeff[12]*4*o*m,M=i.amd_y_coeff[0]*L+i.amd_y_coeff[1]*j+i.amd_y_coeff[2]+i.amd_y_coeff[3]*c+i.amd_y_coeff[4]*o+i.amd_y_coeff[5]*u+i.amd_y_coeff[6]*m+i.amd_y_coeff[7]*p+i.amd_y_coeff[8]*g+i.amd_y_coeff[9]*h+i.amd_y_coeff[10]*d+i.amd_y_coeff[11]*L*m+i.amd_y_coeff[12]*L*C,A=i.amd_y_coeff[1]+i.amd_y_coeff[4]*L+i.amd_y_coeff[5]*2*j+i.amd_y_coeff[6]*2*j+i.amd_y_coeff[8]*c+i.amd_y_coeff[9]*2*o+i.amd_y_coeff[10]*3*u+i.amd_y_coeff[11]*2*o+i.amd_y_coeff[12]*4*o*m,q=i.amd_y_coeff[0]+i.amd_y_coeff[3]*2*L+i.amd_y_coeff[4]*j+i.amd_y_coeff[6]*2*L+i.amd_y_coeff[7]*3*c+i.amd_y_coeff[8]*2*o+i.amd_y_coeff[9]*u+i.amd_y_coeff[11]*(u+3*c)+i.amd_y_coeff[12]*(5*y+6*u*c+x),w=w-r,M=M-s,v=(-w*q+M*_)/(P*q-_*A),D=(-M*P+w*A)/(P*q-_*A),j=j+v,L=L+D,!(Math.abs(v)<k.TOLERANCE&&Math.abs(D)<k.TOLERANCE));R++);a=(i.ppo_coeff[2]-j*1e3)/i.x_pixel_size,f=(i.ppo_coeff[5]+L*1e3)/i.y_pixel_size;let De=a-i.x_pixel_offset+1-.5,pe=f-i.y_pixel_offset+1-.5;return new Pt.Point2D(De,pe)}};Ke.platepos=k;k.COND2R=.01745329252;k.CONS2R=206264.8062470964;k.TWOPI=6.28318530717959;k.MAX_ITERATIONS=50;k.TOLERANCE=5e-7;k.CONR2S=206264.8062470964;k.__class="coordtxl.coords.platepos"});var we=Z(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.WCSTransform=void 0;var We=ue(),W=class{static degrad(e){return e*Math.PI/180}static raddeg(e){return e*180/Math.PI}static hrdeg(e){return e*15}static deghr(e){return e/15}static hrrad(e){return W.degrad(W.hrdeg(e))}static radhr(e){return W.deghr(W.raddeg(e))}constructor(e,t,i,n,r,s,a,f,o,u,c,h){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&(typeof a=="number"||a===null)&&(typeof f=="number"||f===null)&&(typeof o=="number"||o===null)&&(typeof u=="number"||u===null)&&(typeof c=="number"||c===null)&&(typeof h=="string"||h===null)){let g=arguments;this.xref===void 0&&(this.xref=0),this.yref===void 0&&(this.yref=0),this.xrefpix===void 0&&(this.xrefpix=0),this.yrefpix===void 0&&(this.yrefpix=0),this.xinc===void 0&&(this.xinc=0),this.yinc===void 0&&(this.yinc=0),this.rot===void 0&&(this.rot=0),this.crot===void 0&&(this.crot=0),this.srot===void 0&&(this.srot=0),this.cd11===void 0&&(this.cd11=0),this.cd12===void 0&&(this.cd12=0),this.cd21===void 0&&(this.cd21=0),this.cd22===void 0&&(this.cd22=0),this.dc11===void 0&&(this.dc11=0),this.dc12===void 0&&(this.dc12=0),this.dc21===void 0&&(this.dc21=0),this.dc22===void 0&&(this.dc22=0),this.mrot===void 0&&(this.mrot=0),this.cmrot===void 0&&(this.cmrot=0),this.smrot===void 0&&(this.smrot=0),this.xmpix===void 0&&(this.xmpix=0),this.ympix===void 0&&(this.ympix=0),this.equinox===void 0&&(this.equinox=0),this.epoch===void 0&&(this.epoch=0),this.nxpix===void 0&&(this.nxpix=0),this.nypix===void 0&&(this.nypix=0),this.plate_ra===void 0&&(this.plate_ra=0),this.plate_dec===void 0&&(this.plate_dec=0),this.plate_scale===void 0&&(this.plate_scale=0),this.x_pixel_offset===void 0&&(this.x_pixel_offset=0),this.y_pixel_offset===void 0&&(this.y_pixel_offset=0),this.x_pixel_size===void 0&&(this.x_pixel_size=0),this.y_pixel_size===void 0&&(this.y_pixel_size=0),this.xpix===void 0&&(this.xpix=0),this.ypix===void 0&&(this.ypix=0),this.xpos===void 0&&(this.xpos=0),this.ypos===void 0&&(this.ypos=0),this.pcode===void 0&&(this.pcode=0),this.changesys===void 0&&(this.changesys=0),this.printsys===void 0&&(this.printsys=0),this.ndec===void 0&&(this.ndec=0),this.degout===void 0&&(this.degout=0),this.tabsys===void 0&&(this.tabsys=0),this.rotmat===void 0&&(this.rotmat=0),this.coorflip===void 0&&(this.coorflip=0),this.offscl===void 0&&(this.offscl=0),this.plate_fit===void 0&&(this.plate_fit=0),this.wcson===void 0&&(this.wcson=0),this.detector===void 0&&(this.detector=0),this.fCenterRa===void 0&&(this.fCenterRa=0),this.fCenterDec===void 0&&(this.fCenterDec=0),this.fHalfWidthRa===void 0&&(this.fHalfWidthRa=0),this.fHalfWidthDec===void 0&&(this.fHalfWidthDec=0),this.fWidthDeg===void 0&&(this.fWidthDeg=0),this.fHeightDeg===void 0&&(this.fHeightDeg=0),this.degPerPixel===void 0&&(this.degPerPixel=null),this.ppo_coeff=[0,0,0,0,0,0],this.amd_x_coeff=(d=>{let p=[];for(;d-- >0;)p.push(0);return p})(20),this.amd_y_coeff=(d=>{let p=[];for(;d-- >0;)p.push(0);return p})(20),this.instrument="",this.c1type="",this.c2type="",this.ctypes=["-SIN","-TAN","-ARC","-NCP","-GLS","-MER","-AIT","-STG"],this.ptype="",this.radecsys="",this.sysout="",this.center="",this.plate_fit=0,this.nxpix=a,this.nypix=f,this.xinc=i/3600,this.yinc=n/3600,this.xrefpix=r,this.yrefpix=s,this.xref=e,this.yref=t,this.c1type="RA-",this.c2type="DEC",this.ptype=h,this.pcode=1,this.coorflip=0,this.rot=o,this.rotmat=0,this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.dc11=0,this.dc21=0,this.dc12=0,this.dc22=0,this.equinox=u,u>1980?this.radecsys="FK5":this.radecsys="FK4",c>0?this.epoch=c:this.epoch=0,this.wcson=1,this.sysout=this.radecsys,this.changesys=0,this.printsys=1,this.tabsys=0,this.pcode=0;for(let d=0;d<8;d++)((p,x,y=0)=>p.substr(y,x.length)===x)(this.ptype,this.ctypes[d])&&(this.pcode=d+1);this.wcsfull()}else if((e!=null&&e.constructor!=null&&e.constructor.__interfaces!=null&&e.constructor.__interfaces.indexOf("coordtxl.coords.WCSKeywordProvider")>=0||e===null)&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0&&f===void 0&&o===void 0&&u===void 0&&c===void 0&&h===void 0){let d=arguments[0];this.xref===void 0&&(this.xref=0),this.yref===void 0&&(this.yref=0),this.xrefpix===void 0&&(this.xrefpix=0),this.yrefpix===void 0&&(this.yrefpix=0),this.xinc===void 0&&(this.xinc=0),this.yinc===void 0&&(this.yinc=0),this.rot===void 0&&(this.rot=0),this.crot===void 0&&(this.crot=0),this.srot===void 0&&(this.srot=0),this.cd11===void 0&&(this.cd11=0),this.cd12===void 0&&(this.cd12=0),this.cd21===void 0&&(this.cd21=0),this.cd22===void 0&&(this.cd22=0),this.dc11===void 0&&(this.dc11=0),this.dc12===void 0&&(this.dc12=0),this.dc21===void 0&&(this.dc21=0),this.dc22===void 0&&(this.dc22=0),this.mrot===void 0&&(this.mrot=0),this.cmrot===void 0&&(this.cmrot=0),this.smrot===void 0&&(this.smrot=0),this.xmpix===void 0&&(this.xmpix=0),this.ympix===void 0&&(this.ympix=0),this.equinox===void 0&&(this.equinox=0),this.epoch===void 0&&(this.epoch=0),this.nxpix===void 0&&(this.nxpix=0),this.nypix===void 0&&(this.nypix=0),this.plate_ra===void 0&&(this.plate_ra=0),this.plate_dec===void 0&&(this.plate_dec=0),this.plate_scale===void 0&&(this.plate_scale=0),this.x_pixel_offset===void 0&&(this.x_pixel_offset=0),this.y_pixel_offset===void 0&&(this.y_pixel_offset=0),this.x_pixel_size===void 0&&(this.x_pixel_size=0),this.y_pixel_size===void 0&&(this.y_pixel_size=0),this.xpix===void 0&&(this.xpix=0),this.ypix===void 0&&(this.ypix=0),this.xpos===void 0&&(this.xpos=0),this.ypos===void 0&&(this.ypos=0),this.pcode===void 0&&(this.pcode=0),this.changesys===void 0&&(this.changesys=0),this.printsys===void 0&&(this.printsys=0),this.ndec===void 0&&(this.ndec=0),this.degout===void 0&&(this.degout=0),this.tabsys===void 0&&(this.tabsys=0),this.rotmat===void 0&&(this.rotmat=0),this.coorflip===void 0&&(this.coorflip=0),this.offscl===void 0&&(this.offscl=0),this.plate_fit===void 0&&(this.plate_fit=0),this.wcson===void 0&&(this.wcson=0),this.detector===void 0&&(this.detector=0),this.fCenterRa===void 0&&(this.fCenterRa=0),this.fCenterDec===void 0&&(this.fCenterDec=0),this.fHalfWidthRa===void 0&&(this.fHalfWidthRa=0),this.fHalfWidthDec===void 0&&(this.fHalfWidthDec=0),this.fWidthDeg===void 0&&(this.fWidthDeg=0),this.fHeightDeg===void 0&&(this.fHeightDeg=0),this.degPerPixel===void 0&&(this.degPerPixel=null),this.ppo_coeff=[0,0,0,0,0,0],this.amd_x_coeff=(P=>{let _=[];for(;P-- >0;)_.push(0);return _})(20),this.amd_y_coeff=(P=>{let _=[];for(;P-- >0;)_.push(0);return _})(20),this.instrument="",this.c1type="",this.c2type="",this.ctypes=["-SIN","-TAN","-ARC","-NCP","-GLS","-MER","-AIT","-STG"],this.ptype="",this.radecsys="",this.sysout="",this.center="";let p,x,y,m,C,v,D,T,$,K,V,S,E,w;if(this.plate_fit=0,this.nxpix=d.getDoubleValue$java_lang_String("NAXIS1"),this.nypix=d.getDoubleValue$java_lang_String("NAXIS2"),this.xmpix=.5*this.nxpix,this.ympix=.5*this.nypix,this.mrot=0,this.equinox=d.getDoubleValue$java_lang_String("EQUINOX"),d.findKey("PLTRAH")){this.plate_fit=1,y=d.getDoubleValue$java_lang_String("PLTRAH"),m=d.getDoubleValue$java_lang_String("PLTRAM"),C=d.getDoubleValue$java_lang_String("PLTRAS"),V=y+m/60+C/3600,this.plate_ra=W.hrrad(V),x="+";let P=d.getStringValue$java_lang_String("PLTDECSN");P!=null&&(x=P.charAt(0)),(_=>_.charCodeAt==null?_:_.charCodeAt(0))(x)=="-".charCodeAt(0)?v=-1:v=1,D=d.getDoubleValue$java_lang_String("PLTDECD"),T=d.getDoubleValue$java_lang_String("PLTDECM"),$=d.getDoubleValue$java_lang_String("PLTDECS"),K=v*(D+T/60+$/3600),this.plate_dec=W.degrad(K),w=this.equinox|0,w===1950?this.radecsys="FK4":this.radecsys="FK5",this.epoch=this.equinox,d.findKey("EPOCH")&&(this.epoch=d.getDoubleValue$java_lang_String("EPOCH")),this.plate_scale=d.getDoubleValue$java_lang_String("PLTSCALE"),this.x_pixel_size=d.getDoubleValue$java_lang_String("XPIXELSZ"),this.y_pixel_size=d.getDoubleValue$java_lang_String("YPIXELSZ"),this.x_pixel_offset=d.getDoubleValue$java_lang_String("CNPIX1"),this.y_pixel_offset=d.getDoubleValue$java_lang_String("CNPIX2"),this.ppo_coeff[0]=d.getDoubleValue$java_lang_String("PPO1"),this.ppo_coeff[1]=d.getDoubleValue$java_lang_String("PPO2"),this.ppo_coeff[2]=d.getDoubleValue$java_lang_String("PPO3"),this.ppo_coeff[3]=d.getDoubleValue$java_lang_String("PPO4"),this.ppo_coeff[4]=d.getDoubleValue$java_lang_String("PPO5"),this.ppo_coeff[5]=d.getDoubleValue$java_lang_String("PPO6"),this.amd_x_coeff[0]=d.getDoubleValue$java_lang_String("AMDX1"),this.amd_x_coeff[1]=d.getDoubleValue$java_lang_String("AMDX2"),this.amd_x_coeff[2]=d.getDoubleValue$java_lang_String("AMDX3"),this.amd_x_coeff[3]=d.getDoubleValue$java_lang_String("AMDX4"),this.amd_x_coeff[4]=d.getDoubleValue$java_lang_String("AMDX5"),this.amd_x_coeff[5]=d.getDoubleValue$java_lang_String("AMDX6"),this.amd_x_coeff[6]=d.getDoubleValue$java_lang_String("AMDX7"),this.amd_x_coeff[7]=d.getDoubleValue$java_lang_String("AMDX8"),this.amd_x_coeff[8]=d.getDoubleValue$java_lang_String("AMDX9"),this.amd_x_coeff[9]=d.getDoubleValue$java_lang_String("AMDX10"),this.amd_x_coeff[10]=d.getDoubleValue$java_lang_String("AMDX11"),this.amd_x_coeff[11]=d.getDoubleValue$java_lang_String("AMDX12"),this.amd_x_coeff[12]=d.getDoubleValue$java_lang_String("AMDX13"),this.amd_x_coeff[13]=d.getDoubleValue$java_lang_String("AMDX14"),this.amd_x_coeff[14]=d.getDoubleValue$java_lang_String("AMDX15"),this.amd_x_coeff[15]=d.getDoubleValue$java_lang_String("AMDX16"),this.amd_x_coeff[16]=d.getDoubleValue$java_lang_String("AMDX17"),this.amd_x_coeff[17]=d.getDoubleValue$java_lang_String("AMDX18"),this.amd_x_coeff[18]=d.getDoubleValue$java_lang_String("AMDX19"),this.amd_x_coeff[19]=d.getDoubleValue$java_lang_String("AMDX20"),this.amd_y_coeff[0]=d.getDoubleValue$java_lang_String("AMDY1"),this.amd_y_coeff[1]=d.getDoubleValue$java_lang_String("AMDY2"),this.amd_y_coeff[2]=d.getDoubleValue$java_lang_String("AMDY3"),this.amd_y_coeff[3]=d.getDoubleValue$java_lang_String("AMDY4"),this.amd_y_coeff[4]=d.getDoubleValue$java_lang_String("AMDY5"),this.amd_y_coeff[5]=d.getDoubleValue$java_lang_String("AMDY6"),this.amd_y_coeff[6]=d.getDoubleValue$java_lang_String("AMDY7"),this.amd_y_coeff[7]=d.getDoubleValue$java_lang_String("AMDY8"),this.amd_y_coeff[8]=d.getDoubleValue$java_lang_String("AMDY9"),this.amd_y_coeff[9]=d.getDoubleValue$java_lang_String("AMDY10"),this.amd_y_coeff[10]=d.getDoubleValue$java_lang_String("AMDY11"),this.amd_y_coeff[11]=d.getDoubleValue$java_lang_String("AMDY12"),this.amd_y_coeff[12]=d.getDoubleValue$java_lang_String("AMDY13"),this.amd_y_coeff[13]=d.getDoubleValue$java_lang_String("AMDY14"),this.amd_y_coeff[14]=d.getDoubleValue$java_lang_String("AMDY15"),this.amd_y_coeff[15]=d.getDoubleValue$java_lang_String("AMDY16"),this.amd_y_coeff[16]=d.getDoubleValue$java_lang_String("AMDY17"),this.amd_y_coeff[17]=d.getDoubleValue$java_lang_String("AMDY18"),this.amd_y_coeff[18]=d.getDoubleValue$java_lang_String("AMDY19"),this.amd_y_coeff[19]=d.getDoubleValue$java_lang_String("AMDY20"),this.wcson=1,this.c1type="RA-",this.c2type="DEC",this.ptype="PLATE",this.degout=0,this.ndec=3}else if((p=d.getStringValue$java_lang_String("CTYPE1"))!=null){let P=p.length;if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"LINEAR"))this.pcode=0,this.c1type=p,this.ptype=p;else if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"PIXEL"))this.pcode=-1,this.c1type=p,this.ptype=p;else if(P>1&&((_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="R".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="D".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0))){this.c1type=p.substring(0,2),P>2&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(2))!="-".charCodeAt(0)&&(this.c1type+=p.charAt(2)),P>3&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(3))!="-".charCodeAt(0)&&(this.c1type+=p.charAt(3)),P>4&&(this.ptype=p.substring(3,7)),this.pcode=0;for(let _=0;_<8;_++)if(((M,A,q=0)=>M.substr(q,A.length)===A)(this.ptype,this.ctypes[_])){this.pcode=_+1;break}}else throw console.error("WCSINIT: CTYPE1 not sky coordinates or LINEAR -> no WCS"),Object.defineProperty(new Error,"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if((p=d.getStringValue$java_lang_String("CTYPE2"))==null)throw console.error("WCSINIT: No CTYPE2 -> no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if(P=p.length,((_,M,A=0)=>_.substr(A,M.length)===M)(p,"LINEAR"))this.pcode=0,this.c2type=p;else if(((_,M,A=0)=>_.substr(A,M.length)===M)(p,"PIXEL"))this.pcode=-1,this.c2type=p;else if(P>1&&((_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="R".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="D".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0)))this.c2type=p.substring(0,2),P>2&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(2))!="-".charCodeAt(0)&&(this.c2type+=p.charAt(2)),P>3&&(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(3))!="-".charCodeAt(0)&&(this.c2type+=p.charAt(3)),((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"DEC")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"GLAT")?this.coorflip=1:this.coorflip=0,(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(1))=="L".charCodeAt(0)||(_=>_.charCodeAt==null?_:_.charCodeAt(0))(p.charAt(0))=="A".charCodeAt(0)?(this.degout=1,this.ndec=5):(this.degout=0,this.ndec=3);else throw console.error("WCSINIT: CTYPE2 not sky coordinates or LINEAR -> no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.xrefpix=d.getDoubleValue$java_lang_String$double("CRPIX1",1),this.yrefpix=d.getDoubleValue$java_lang_String$double("CRPIX2",1),this.xref=d.getDoubleValue$java_lang_String$double("CRVAL1",1),this.yref=d.getDoubleValue$java_lang_String$double("CRVAL2",1),(this.xinc=d.getDoubleValue$java_lang_String("CDELT1"))!==0?(this.yinc=d.getDoubleValue$java_lang_String$double("CDELT2",this.xinc),this.rot=d.getDoubleValue$java_lang_String$double("CROTA1",0),this.rot===0&&(this.rot=d.getDoubleValue$java_lang_String("CROTA2")),this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.rotmat=0):(this.cd11=d.getDoubleValue$java_lang_String("CD1_1"))!==0?(this.rotmat=1,this.cd12=d.getDoubleValue$java_lang_String$double("CD1_2",0),this.cd21=d.getDoubleValue$java_lang_String$double("CD2_1",0),this.cd22=d.getDoubleValue$java_lang_String$double("CD2_2",this.cd11),E=this.cd11*this.cd22-this.cd12*this.cd21,E!==0&&(this.dc11=this.cd22/E,this.dc12=-this.cd12/E,this.dc21=-this.cd21/E,this.dc22=this.cd11/E),this.xinc=Math.sqrt(this.cd11*this.cd11+this.cd21*this.cd21),this.yinc=Math.sqrt(this.cd12*this.cd12+this.cd22*this.cd22),this.cd11*this.cd11-this.cd12*this.cd12<0?((((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"RA")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c1type,"GLON"))&&(this.xinc=-this.xinc),(((_,M,A=0)=>_.substr(A,M.length)===M)(this.c2type,"RA")||((_,M,A=0)=>_.substr(A,M.length)===M)(this.c2type,"GLON"))&&(this.yinc=-this.yinc),this.rot=W.raddeg(Math.atan2(-this.cd12,this.cd22))):this.rot=W.raddeg(Math.atan2(this.cd12,this.cd22))):(this.xinc=1,this.yinc=1,console.error("WCSINIT: setting CDELT to 1")),this.xmpix=d.getDoubleValue$java_lang_String("CCPIX1"),this.ympix=d.getDoubleValue$java_lang_String("CCPIX2"),this.mrot=d.getDoubleValue$java_lang_String("CCROT1"),((_,M,A=0)=>_.substr(A,M.length)===M)(this.ptype,"LINEAR")&&((_,M,A=0)=>_.substr(A,M.length)===M)(this.ptype,"PIXEL")?this.degout=-1:this.wcseq(d),this.wcson=1}else if(d.findKey("SECPIX")||d.findKey("PIXSCAL1")||d.findKey("SECPIX1")){if(S=d.getDoubleValue$java_lang_String$double("SECPIX",0),S===0?(S=d.getDoubleValue$java_lang_String$double("SECPIX1",0),S!==0?(this.xinc=-S/3600,S=d.getDoubleValue$java_lang_String$double("SECPIX2",0),this.yinc=S/3600):(S=d.getDoubleValue$java_lang_String$double("PIXSCAL1",0),this.xinc=-S/3600,S=d.getDoubleValue$java_lang_String$double("PIXSCAL2",0),this.yinc=S/3600)):(this.yinc=S/3600,this.xinc=-this.yinc),this.xrefpix=d.getDoubleValue$java_lang_String$double("CRPIX1",this.nxpix*.5),this.yrefpix=d.getDoubleValue$java_lang_String$double("CRPIX2",this.nypix*.5),this.xref=0,(this.xref=d.getDoubleValue$java_lang_String$double("RA",0))===0)throw console.error("WCSINIT: No RA with SECPIX, no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});if(this.yref=0,(this.yref=d.getDoubleValue$java_lang_String$double("DEC",0))===0)throw console.error("WCSINIT: No DEC with SECPIX, no WCS"),Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.c1type="RA--TAN",this.c2type="DEC-TAN",this.ptype="-TAN",this.pcode=1,this.coorflip=0,this.degout=0,this.ndec=3,this.rot=d.getDoubleValue$java_lang_String$double("CROTA1",0),this.rot===0&&(this.rot=d.getDoubleValue$java_lang_String$double("CROTA2",0)),this.cd11=0,this.cd21=0,this.cd12=0,this.cd22=0,this.dc11=0,this.dc21=0,this.dc12=0,this.dc22=0,this.rotmat=0,this.xmpix=d.getDoubleValue$java_lang_String("CCPIX1"),this.ympix=d.getDoubleValue$java_lang_String("CCPIX2"),this.mrot=d.getDoubleValue$java_lang_String("CCROT1"),this.wcseq(d),(this.epoch=d.getDoubleValue$java_lang_String$double("DATE-OBS",0))===0&&(this.epoch=d.getDoubleValue$java_lang_String$double("EPOCH",0))===0&&(this.epoch=this.equinox),this.wcson=1}else throw Object.defineProperty(new Error(W.NO_WCS_IN_HEADER_MESSAGE),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.IllegalArgumentException","java.lang.Exception"]});this.sysout=this.radecsys,this.changesys=0,this.printsys=1,this.tabsys=0,this.wcsfull()}else throw new Error("invalid overload")}getEquinox(){return this.equinox}getWCSCenter(){if(this.isValid())return new We.Point2D(this.fCenterRa,this.fCenterDec);throw Object.defineProperty(new Error("No WCS information."),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}getImageCenter(){return new We.Point2D(.5*this.nxpix,.5*this.nypix)}isWCS(){return this.isValid()}imageToWorldCoords(e,t){if(!!this.isValid())if(t)e.x=Math.abs(e.x*this.degPerPixel.x),e.y=Math.abs(e.y*this.degPerPixel.y);else{let i=this.pix2wcs(e.x,e.y);if(i!=null)e.setLocation(i.x,i.y);else throw Object.defineProperty(new Error("Image coordinates out of WCS range: "+e),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}}worldToImageCoords(e,t){if(!!this.isValid())if(t)e.x=Math.abs(e.x/this.degPerPixel.x),e.y=Math.abs(e.y/this.degPerPixel.y);else{let i=this.wcs2pix(e.x,e.y);if(i!=null)e.setLocation(i.x,i.y);else throw Object.defineProperty(new Error("World coordinates out of range: "+e),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}}getWidthInDeg(){return this.fWidthDeg}getHeightInDeg(){return this.fHeightDeg}getWidth(){return this.nxpix}getHeight(){return this.nypix}wcseq(e){let t=0,i;e.findKey("EQUINOX")?(this.equinox=e.getDoubleValue$java_lang_String("EQUINOX"),t=2e3):e.findKey("EPOCH")?(t=e.getDoubleValue$java_lang_String$double("EPOCH",0)|0,t===0?(t=1950,this.equinox=1950):this.equinox=e.getDoubleValue$java_lang_String("EPOCH")):e.findKey("RADECSYS")&&(i=e.getStringValue$java_lang_String("RADECSYS"),((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK4")?(this.equinox=1950,t=1950):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK5")?(this.equinox=2e3,t=2e3):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"GAL")?(this.equinox=2e3,t=2e3):((n,r,s=0)=>n.substr(s,r.length)===r)(i,"ECL")&&(this.equinox=2e3,t=2e3)),t===0&&(this.equinox=2e3,t=2e3),(this.epoch=e.getDoubleValue$java_lang_String$double("DATE-OBS",0))===0&&(this.epoch=e.getDoubleValue$java_lang_String$double("EPOCH",0))===0&&(this.epoch=this.equinox),this.epoch===0&&(this.epoch=this.equinox),e.findKey("RADECSYS")?((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK4")?this.equinox=1950:((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK5")?this.equinox=2e3:((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"GAL")&&t===0&&(this.equinox=2e3):(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="G".charCodeAt(0)?this.radecsys="GALACTIC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="E".charCodeAt(0)?this.radecsys="ECLIPTIC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="S".charCodeAt(0)?this.radecsys="SGALACTC":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="H".charCodeAt(0)?this.radecsys="HELIOECL":(n=>n.charCodeAt==null?n:n.charCodeAt(0))(this.c1type.charAt(0))=="A".charCodeAt(0)?this.radecsys="ALTAZ":t>1980?this.radecsys="FK5":this.radecsys="FK4"}isValid(){return this.wcson>0}wcsshift(e,t,i){!this.isValid()||(this.fCenterRa=this.xref=e,this.fCenterDec=this.yref=t,this.radecsys=i,((n,r,s=0)=>n.substr(s,r.length)===r)(i,"FK4")?this.equinox=1950:this.equinox=2e3)}wcssize(){let e,t,i,n;if(this.isValid()){e=.5*this.nxpix,t=.5*this.nypix;let r=this.pix2wcs(e,t);if(r==null)return;this.fCenterRa=r.x,this.fCenterDec=r.y;let s=this.pix2wcs(1,t),a=this.pix2wcs(this.nxpix,t);if(s==null||a==null||(!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"LINEAR")&&!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"PIXEL")?(i=this.wcsdist(s.x,s.y,a.x,a.y),this.fHalfWidthRa=i*.5/Math.cos(W.degrad(this.fCenterDec))):this.fHalfWidthRa=Math.sqrt((a.y-s.y)*(a.y-s.y)+(a.x-s.x)*(a.x-s.x)),s=this.pix2wcs(e,1),a=this.pix2wcs(e,this.nypix),s==null||a==null))return;!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"LINEAR")&&!((f,o,u=0)=>f.substr(u,o.length)===o)(this.ptype,"PIXEL")?(n=this.wcsdist(s.x,s.y,a.x,a.y),this.fHalfWidthDec=n*.5):this.fHalfWidthDec=Math.sqrt((a.y-s.y)*(a.y-s.y)+(a.x-s.x)*(a.x-s.x))}}wcsfull(){let e,t;if(this.isValid()){e=.5*this.nxpix,t=.5*this.nypix;let i=this.pix2wcs(e,t);if(i==null)return;this.fCenterRa=i.x,this.fCenterDec=i.y;let n=this.pix2wcs(0,t),r=this.pix2wcs(this.nxpix,t);if(n==null||r==null||(!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"LINEAR")&&!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"PIXEL")?this.fWidthDeg=this.wcsdist(n.x,n.y,r.x,r.y):this.fWidthDeg=Math.sqrt((r.y-n.y)*(r.y-n.y)+(r.x-n.x)*(r.x-n.x)),n=this.pix2wcs(e,0),r=this.pix2wcs(e,this.nypix),n==null||r==null))return;!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"LINEAR")&&!((s,a,f=0)=>s.substr(f,a.length)===a)(this.ptype,"PIXEL")?this.fHeightDeg=this.wcsdist(n.x,n.y,r.x,r.y):this.fHeightDeg=Math.sqrt((r.y-n.y)*(r.y-n.y)+(r.x-n.x)*(r.x-n.x)),this.degPerPixel=new We.Point2D(this.fWidthDeg/this.nxpix,this.fHeightDeg/this.nypix)}}wcsdist(e,t,i,n){let r,s,a,f,o=[0,0,0],u=[0,0,0],c,h,g,d;for(r=W.degrad(e),a=W.degrad(t),g=Math.cos(a),o[0]=Math.cos(r)*g,o[1]=Math.sin(r)*g,o[2]=Math.sin(a),s=W.degrad(i),f=W.degrad(n),g=Math.cos(f),u[0]=Math.cos(s)*g,u[1]=Math.sin(s)*g,u[2]=Math.sin(f),c=0,d=0;d<3;d++)c=c+(o[d]-u[d])*(o[d]-u[d]);return c=c/4,c>1&&(c=1),h=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),h=W.raddeg(h),h}pix2wcs(e,t){let i;return this.isValid()?(this.xpix=e,this.ypix=t,this.offscl=0,this.plate_fit>0?(i=Vt.platepos.getPosition(e,t,this))==null&&(this.offscl=1):(i=It.worldpos.getPosition(e,t,this))==null&&(this.offscl=1),this.pcode>0&&(((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK4")?this.equinox!==1950&&(i=se.wcscon.fk4prec(this.equinox,1950,i)):((n,r,s=0)=>n.substr(s,r.length)===r)(this.radecsys,"FK5")&&this.equinox!==2e3&&(i=se.wcscon.fk5prec(this.equinox,2e3,i)),this.changesys===1?i=se.wcscon.fk425e(i,this.epoch):this.changesys===2?i=se.wcscon.fk524e(i,this.epoch):this.changesys===3?i=se.wcscon.fk42gal(i):this.changesys===4&&(i=se.wcscon.fk52gal(i))),this.offscl===0&&i!=null&&(this.xpos=i.x,this.ypos=i.y),i):null}wcs2pix(e,t){let i;if(!this.isValid())return null;this.xpos=e,this.ypos=t;let n=new We.Point2D(e,t);return this.changesys===1?n=se.wcscon.fk524e(n,this.epoch):this.changesys===2&&(n=se.wcscon.fk425e(n,this.epoch)),((r,s,a=0)=>r.substr(a,s.length)===s)(this.radecsys,"FK4")?this.equinox!==1950&&(n=se.wcscon.fk4prec(1950,this.equinox,n)):((r,s,a=0)=>r.substr(a,s.length)===s)(this.radecsys,"FK5")&&this.equinox!==2e3&&(n=se.wcscon.fk5prec(2e3,this.equinox,n)),this.plate_fit>0?(i=Vt.platepos.getPixels(n.x,n.y,this))==null&&(this.offscl=1):(i=It.worldpos.getPixels(n.x,n.y,this))==null&&(this.offscl=1),i!=null&&(this.xpix=i.x,this.ypix=i.y),i}};Ne.WCSTransform=W;W.NO_WCS_IN_HEADER_MESSAGE="The header does not contain a valid world coordinate system.";W.__class="coordtxl.coords.WCSTransform";W.__interfaces=["coordtxl.coords.WorldCoordinateConverter"];var se=jt(),It=$t(),Vt=Tt()});var wt=Z(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.Trigod=void 0;var H=class{static DEG_$LI$(){return H.DEG==null&&(H.DEG=180/Math.PI),H.DEG}static fractionalPart(e){return Math.abs(e-(e|0))}static cosd(e){let t=0,i=H.fractionalPart(e/360);return i>.5&&(i=1-i),i>.25&&(i=.5-i,t=1),i>.125?i=Math.sin(Math.PI*2*(.25-i)):i=Math.cos(Math.PI*2*i),t!==0&&(i=-i),i}static sind(e){let t=H.fractionalPart(e/360),i=e>=0?0:1;return t>.5&&(t=1-t,i^=1),t>.25&&(t=.5-t),t>.125?t=Math.cos(Math.PI*2*(.25-t)):t=Math.sin(Math.PI*2*t),i!==0&&(t=-t),t}static tand(e){let t=H.fractionalPart(e/180);return t===.5?t=H.DOUBLE_MAX:t=Math.tan(Math.PI*t),e>0?t:-t}static atand(e){return H.DEG_$LI$()*Math.atan(e)}static atan2d(e,t){return H.DEG_$LI$()*Math.atan2(e,t)}static acosd(e){return H.DEG_$LI$()*Math.acos(e)}asind(e){return H.DEG_$LI$()*Math.asin(e)}};qe.Trigod=H;H.DOUBLE_MAX=17e37;H.__class="coordtxl.coords.Trigod"});var Ot=Z(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.Cotr=void 0;var ne=class{static tr_Euler(e,t){let s;t[0][2]=U.Trigod.cosd(e[0]),t[1][2]=U.Trigod.sind(e[0]),t[2][0]=U.Trigod.cosd(e[2]),t[2][1]=U.Trigod.sind(e[2]),t[2][2]=U.Trigod.cosd(e[1]),s=U.Trigod.sind(e[1]),t[0][0]=t[2][0]*t[2][2]*t[0][2]-t[2][1]*t[1][2],t[1][0]=t[2][0]*t[2][2]*t[1][2]+t[2][1]*t[0][2],t[0][1]=-t[2][1]*t[2][2]*t[0][2]-t[2][0]*t[1][2],t[1][1]=-t[2][1]*t[2][2]*t[1][2]+t[2][0]*t[0][2],t[2][0]=t[2][0]*s,t[2][1]=-t[2][1]*s,t[0][2]=-s*t[0][2],t[1][2]=-s*t[1][2]}static tr_oo(e,t,i){let n=[0,0,0];ne.tr_ou(e,n),ne.tr_uu(n,n,i),ne.tr_uo(n,t)}static tr_oo1(e,t,i){let n=[0,0,0];ne.tr_ou(e,n),ne.tr_uu1(n,n,i),ne.tr_uo(n,t)}static tr_oR(e,t){let i=e[0],n=e[1];t[2][2]=U.Trigod.cosd(n),t[0][2]=U.Trigod.sind(n),t[1][1]=U.Trigod.cosd(i),t[1][0]=-U.Trigod.sind(i),t[1][2]=0,t[0][0]=t[2][2]*t[1][1],t[0][1]=-t[2][2]*t[1][0],t[2][0]=-t[0][2]*t[1][1],t[2][1]=t[0][2]*t[1][0]}static tr_ou(e,t){let i=e[0],n=e[1],r=U.Trigod.cosd(n);t[0]=r*U.Trigod.cosd(i),t[1]=r*U.Trigod.sind(i),t[2]=U.Trigod.sind(n)}static tr_uo(e,t){let i=e[0],n=e[1],r=e[2],s=i*i+n*n;if(t[0]=0,s===0){if(r===0)return;t[1]=r>0?90:-90;return}t[1]=U.Trigod.atand(r/Math.sqrt(s)),t[0]=U.Trigod.atan2d(n,i),t[0]<0&&(t[0]+=360)}static tr_uR(e,t){let i=e[0],n=e[1],r=e[2];t[0][0]=i,t[0][1]=n,t[0][2]=r,t[2][2]=Math.sqrt(i*i+n*n),t[1][0]=0,t[1][1]=1,t[1][2]=0,t[2][2]!==0&&(t[1][1]=i/t[2][2],t[1][0]=-n/t[2][2]),t[2][0]=-t[0][2]*t[1][1],t[2][1]=t[0][2]*t[1][0]}static tr_uu(e,t,i){let n,r,s,a=[0,0,0];for(n=0;n<3;n++){for(s=0,r=0;r<3;r++)s+=i[n][r]*e[r];a[n]=s}for(n=0;n<3;n++)t[n]=a[n]}static tr_uu1(e,t,i){let n,r,s,a=[0,0,0];for(n=0;n<3;n++){for(r=0,s=0;r<3;r++)s+=i[r][n]*e[r];a[n]=s}for(n=0;n<3;n++)t[n]=a[n]}static tr_RR(e,t,i){let n,r,s,a,f=function(o){let u=function(c){if(c.length===0)return 0;{let h=[];for(let g=0;g<c[0];g++)h.push(u(c.slice(1)));return h}};return u(o)}([3,3]);for(n=0;n<3;n++)for(r=0;r<3;r++){for(s=0,a=0;s<3;s++)a+=i[n][s]*e[s][r];f[n][r]=a}for(n=0;n<3;n++)for(r=0;r<3;r++)t[n][r]=f[n][r]}static tr_RR1(e,t,i){let n,r,s,a,f=function(o){let u=function(c){if(c.length===0)return 0;{let h=[];for(let g=0;g<c[0];g++)h.push(u(c.slice(1)));return h}};return u(o)}([3,3]);for(n=0;n<3;n++)for(r=0;r<3;r++){for(s=0,a=0;s<3;s++)a+=i[s][n]*e[s][r];f[n][r]=a}for(n=0;n<3;n++)for(r=0;r<3;r++)t[n][r]=f[n][r]}};ke.Cotr=ne;ne.__class="coordtxl.coords.Cotr";var U=wt()});var Lt=Z(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.JPrec=void 0;var ce=class{static prej_R(e,t,i){let n,r,s,a=[0,0,0],f=0,o=1,u=2;n=(t-2e3)/100,r=(i-t)/100,s=2306.2181+(1.39656-139e-6*n)*n,a[u]=(s+(.30188-344e-6*n+.017998*r)*r)*r/3600,a[f]=(s+(1.09468+66e-6*n+.018203*r)*r)*r/3600,a[o]=(2004.3109+(-.8533-217e-6*n)*n+(-.42665-217e-6*n-.041833*r)*r)*r/3600,ze.Cotr.tr_Euler(a,e)}static prej_q(e,t,i,n){let r=[0,0,0];if(i===n){t[0]=e[0],t[1]=e[1];return}ze.Cotr.tr_ou(e,r),ce.prej_u(r,r,i,n),ze.Cotr.tr_uo(r,t)}static prej_u(e,t,i,n){let r=[[1,0,0],[0,1,0],[0,0,1]];if(i===n){t[0]=e[0],t[1]=e[1],t[2]=e[2];return}ce.prej_R(r,i,n),ze.Cotr.tr_uu(e,t,r)}};Xe.JPrec=ce;ce.__class="coordtxl.coords.JPrec";var ze=Ot()});var it=Z(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.StringUtil=void 0;var me=class{static replace(e,t,i){return e.split(t).join(i)}static split(e,t){let i=e.indexOf(String.fromCharCode(t));if(i>0){let n;return n=[null,null],n[0]=e.substring(0,i),n[1]=e.substring(i+1),n}return null}static combine(e,t){if(e==null)return"";let i={str:"",toString:function(){return this.str}};for(let n=0;n<e.length;n++)(r=>(r.str+=e[n],r))(i),n+1<e.length&&(r=>(r.str+=t,r))(i);return i.str}static equals(e,t){return e==null&&t==null||!(e==null||t==null)&&e===t}static match(e,t){let i=t.length,n=e.length;for(let r=0;;r++){for(let s=0;;r++,s++){let a=s>=i,f=r>=n||(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="|".charCodeAt(0);if(a&&!f&&(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="*".charCodeAt(0)&&(r===n-1||r<n-1&&(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r+1))=="|".charCodeAt(0))||a&&f)return!0;if(a||f)break;if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="?".charCodeAt(0))continue;if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="*".charCodeAt(0)||(o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r))=="%".charCodeAt(0)){r++;for(let o=i;o>=s;--o)if(me.match(e.substring(r),t.substring(o)))return!0;break}if((o=>o.charCodeAt==null?o:o.charCodeAt(0))(e.charAt(r).toUpperCase())!=(o=>o.charCodeAt==null?o:o.charCodeAt(0))(t.charAt(s).toUpperCase()))break}if(r=e.indexOf("|",r),r===-1)return!1}}static pad(e,t,i){let n={str:"",toString:function(){return this.str}};if(i){(s=>(s.str+=e,s))(n);let r=e.length;for(;r++<t;)(s=>(s.str+=" ",s))(n)}else{let r=e.length;for(;r++<t;)(s=>(s.str+=" ",s))(n);(s=>(s.str+=e,s))(n)}return n.str}static arrayContains(e,t){for(let i=0;i<e.length;i++){let n=e[i];if(t===n)return!0}return!1}static capitalize(e){if(e==null||e.length===0)return e;let t={str:"",toString:function(){return this.str}},i=e.split("[\\s]+");for(let n=0;n<i.length;n++){let r=i[n];{let s=r.trim();s.length!==0&&((a=>(a.str+=s.substring(1).toLowerCase(),a))((a=>(a.str+=s.substring(0,1).toUpperCase(),a))(t)),(a=>(a.str+=" ",a))(t))}}return t.str.trim()}};Re.StringUtil=me;me.__class="coordtxl.util.StringUtil"});var Kt=Z(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.DMS=void 0;var ci=it(),J=class{static fmt_deg_min(e){let t=Math.round(e),i=(""+t).split(".").join("@").split("@");if(i.length<1)return"00";let n="";for(let r=i[0].length;r<2;++r)n+="0";for(let r=i[0].length>2?i[0].length-2:0;r<i[0].length;++r)n+=i[0].charAt(r);return n}static fmt_sec(e){let t=Math.round(e*100)/100,i=(""+t).split(".").join("@").split("@");if(i.length===0)return"00.00";if(i.length<2)return i[0]+".00";let n="";for(let s=i[0].length;s<2;++s)n+="0";for(let s=i[0].length>2?i[0].length-2:0;s<i[0].length;++s)n+=i[0].charAt(s);n+=".";let r=0;for(;r<2&&r<i[1].length;++r)n+=i[1].charAt(r);for(;r<2;++r)n+="0";return n}constructor(e,t,i){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)){let n=arguments;this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.set(e,t,i)}else if((e!=null&&e instanceof J||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r.val)}else if((typeof e=="string"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=ci.StringUtil.replace(r,",",".");let s=[0,0,0],a=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),f=0;for(;f<3&&f<a.length;)s[f]=parseFloat(a[f]),f+=1;if(f>=2)this.set(s[0],s[1]|0,s[2]);else if(f===1)this.setVal(s[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}else if((typeof e=="number"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r)}else if(e===void 0&&t===void 0&&i===void 0){let n=arguments;this.degrees===void 0&&(this.degrees=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else throw new Error("invalid overload")}set(e,t,i){this.degrees=e|0,this.min=t,this.sec=i,this.val=(i/60+t)/60,e<0||e===J.MINUS_ZERO?(this.val=e-this.val,this.degrees=-this.degrees,this.sign=-1):(this.val=this.degrees+this.val,this.sign=1),this.initialized=!0}setVal(e){this.val=e;let t=e;t<0||t===J.MINUS_ZERO?(this.sign=-1,t=-t):this.sign=1;let i=t+1e-10;this.degrees=i|0;let n=(i-this.degrees)*60;this.min=n|0,this.sec=(n-this.min)*60,this.initialized=!0}toString$(){let e=J.fmt_sec(this.sec),t;return this.sign===-1?t="-":t="+",t+J.fmt_deg_min(this.degrees)+":"+J.fmt_deg_min(this.min)+":"+e}toString$boolean(e){if(e)return this.toString$();let t;return this.sign===-1?t="-":t="+",t+J.fmt_deg_min(this.degrees)+":"+J.fmt_deg_min(this.min)}toString(e){if(typeof e=="boolean"||e===null)return this.toString$boolean(e);if(e===void 0)return this.toString$();throw new Error("invalid overload")}isInitialized(){return this.initialized}getDegrees(){return this.degrees}getMin(){return this.min}getSec(){return this.sec}getVal(){return this.val}getSign(){return this.sign}equals(e){return e!=null&&e instanceof J&&this.val===e.val}};He.DMS=J;J.MINUS_ZERO=-0;J.__class="coordtxl.coords.DMS"});var Nt=Z(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.HMS=void 0;var Wt=it(),Q=class{static fmt_hr_min(e){let t=Math.round(e),i=(""+t).split(".").join("@").split("@");if(i.length<1)return"00";let n="";for(let r=i[0].length;r<2;++r)n+="0";for(let r=i[0].length>2?i[0].length-2:0;r<i[0].length;++r)n+=i[0].charAt(r);return n}static fmt_sec(e){let t=Math.round(e*1e3)/1e3,i=(""+t).split(".").join("@").split("@");if(i.length===0)return"00.000";if(i.length<2)return i[0]+".000";let n="";for(let s=i[0].length;s<2;++s)n+="0";for(let s=i[0].length>2?i[0].length-2:0;s<i[0].length;++s)n+=i[0].charAt(s);n+=".";let r=0;for(;r<3&&r<i[1].length;++r)n+=i[1].charAt(r);for(;r<3;++r)n+="0";return n}constructor(e,t,i){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)){let n=arguments;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.set(e,t,i)}else if((typeof e=="string"||e===null)&&(typeof t=="boolean"||t===null)&&i===void 0){let n=arguments,r=n[0],s=n[1];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=Wt.StringUtil.replace(r,",",".");let a=[0,0,0],f=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),o=0;for(;o<3&&o<f.length;)a[o]=parseFloat(f[o]),o+=1;if(o>=2)this.set(a[0],a[1]|0,a[2]);else if(o===1)!s&&r.indexOf(".")!==-1?this.setVal(a[0]/15):this.setVal(a[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}else if((e!=null&&e instanceof Q||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r.val)}else if((typeof e=="string"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];{let s=arguments,a=!1;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,r=Wt.StringUtil.replace(r,",",".");let f=[0,0,0],o=r.split(":").join("@").split(" ").join("@").split("@@").join("@").split("@"),u=0;for(;u<3&&u<o.length;)f[u]=parseFloat(o[u]),u+=1;if(u>=2)this.set(f[0],f[1]|0,f[2]);else if(u===1)!a&&r.indexOf(".")!==-1?this.setVal(f[0]/15):this.setVal(f[0]);else throw Object.defineProperty(new Error("Expected a string of the form hh:mm:ss.sss, but got: '"+r+"'"),"__classes",{configurable:!0,value:["java.lang.Throwable","java.lang.Object","java.lang.RuntimeException","java.lang.Exception"]})}this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else if((typeof e=="number"||e===null)&&t===void 0&&i===void 0){let r=arguments[0];this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1,this.setVal(r)}else if(e===void 0&&t===void 0&&i===void 0){let n=arguments;this.hours===void 0&&(this.hours=0),this.min===void 0&&(this.min=0),this.sec===void 0&&(this.sec=0),this.val===void 0&&(this.val=0),this.sign=1,this.initialized=!1}else throw new Error("invalid overload")}set(e,t,i){this.hours=e|0,this.min=t,this.sec=i,this.val=(i/60+t)/60,e<0||e===Q.MINUS_ZERO?(this.val=e-this.val,this.hours=-this.hours,this.sign=-1):(this.val=this.hours+this.val,this.sign=1),this.initialized=!0}setVal(e){this.val=e;let t=e;t<0||t===Q.MINUS_ZERO?(this.sign=-1,t=-t):this.sign=1;let i=t+1e-10;this.hours=i|0;let n=(i-this.hours)*60;this.min=n|0,this.sec=(n-this.min)*60,this.initialized=!0}toString$(){let e=Q.fmt_sec(this.sec),t;return this.sign===-1?t="-":t="",t+Q.fmt_hr_min(this.hours)+":"+Q.fmt_hr_min(this.min)+":"+e}toString$boolean(e){if(e)return this.toString$();let t;return this.sign===-1?t="-":t=" ",t+Q.fmt_hr_min(this.hours)+":"+Q.fmt_hr_min(this.min)}toString(e){if(typeof e=="boolean"||e===null)return this.toString$boolean(e);if(e===void 0)return this.toString$();throw new Error("invalid overload")}isInitialized(){return this.initialized}getHours(){return this.hours}getMin(){return this.min}getSec(){return this.sec}getVal(){return this.val}getSign(){return this.sign}equals(e){return e!=null&&e instanceof Q&&this.val===e.val}};Ye.HMS=Q;Q.MINUS_ZERO=-0;Q.__class="coordtxl.coords.HMS"});var kt=Z(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.WorldCoords=void 0;var qt=ue(),Y=class{constructor(e,t,i,n,r,s,a){if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&(typeof a=="number"||a===null)){let f=arguments;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(e,t,i),this.dec=new G.DMS(n,r,s),this.init(a)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="number"||n===null)&&(typeof r=="number"||r===null)&&(typeof s=="number"||s===null)&&a===void 0){let f=arguments;{let o=arguments,u=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(e,t,i),this.dec=new G.DMS(n,r,s),this.init(u)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="number"||i===null)&&(typeof n=="boolean"||n===null)&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2],h=f[3];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o,h),this.dec=new G.DMS(u),this.init(c)}else if((e!=null&&e instanceof B.HMS||e===null)&&(t!=null&&t instanceof G.DMS||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=o,this.dec=u,this.init(c)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(c)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o),this.dec=new G.DMS(u),this.init(c)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&(typeof i=="boolean"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];{let h=arguments,g=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o,c),this.dec=new G.DMS(u),this.init(g)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&(typeof i=="number"||i===null)&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1],c=f[2];this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(c)}else if((e!=null&&e instanceof B.HMS||e===null)&&(t!=null&&t instanceof G.DMS||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=o,this.dec=u,this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=c[0],g=c[1],d=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(h/15),this.dec=new G.DMS(g),this.init(d)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="string"||e===null)&&(typeof t=="string"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o),this.dec=new G.DMS(u),this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((e!=null&&e instanceof qt.Point2D||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=o.getX(),g=o.getY();this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(h/15),this.dec=new G.DMS(g),this.init(u)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((typeof e=="number"||e===null)&&(typeof t=="number"||t===null)&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments,o=f[0],u=f[1];{let c=arguments,h=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(o/15),this.dec=new G.DMS(u),this.init(h)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if((e!=null&&e instanceof qt.Point2D||e===null)&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let o=arguments[0];{let u=arguments,c=o.getX(),h=o.getY(),g=2e3;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS(c/15),this.dec=new G.DMS(h),this.init(g)}this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null)}else if(e===void 0&&t===void 0&&i===void 0&&n===void 0&&r===void 0&&s===void 0&&a===void 0){let f=arguments;this.ra===void 0&&(this.ra=null),this.dec===void 0&&(this.dec=null),this.ra=new B.HMS,this.dec=new G.DMS}else throw new Error("invalid overload")}getRA(){return this.ra}getDec(){return this.dec}getRaDeg(){return this.ra.getVal()*15}getDecDeg(){return this.dec.getVal()}getX(){return this.ra.getVal()*15}getY(){return this.dec.getVal()}toString(){return this.ra.toString$()+", "+this.dec.toString$()+" J2000"}format$double(e){let t=[null,null];if(e===2e3)t[0]=this.ra.toString$(),t[1]=this.dec.toString$();else{let i=new Y(this.ra,this.dec);i.convertEquinox(2e3,e),t[0]=i.ra.toString$(),t[1]=i.dec.toString$()}return t}format(e){if(typeof e=="number"||e===null)return this.format$double(e);if(e===void 0)return this.format$();throw new Error("invalid overload")}format$(){return this.format$double(2e3)}getRaDec(e){let t=[0,0];if(e===2e3)t[0]=this.getRaDeg(),t[1]=this.getDecDeg();else{let i=new Y(this.ra,this.dec);i.convertEquinox(2e3,e),t[0]=i.getRaDeg(),t[1]=i.getDecDeg()}return t}static dispos(e,t,i,n){let r=[0,0],s,a,f,o,u,c,h,g,d,p,x,y,m,C,v=180/Math.PI;s=i/v,a=e/v,f=n/v,o=t/v,h=Math.sin(o),c=Math.sin(f),d=Math.cos(o),g=Math.cos(f),p=Math.cos(s-a),x=h*c+d*g*p;let D=Math.acos(x);return u=0,D>4e-7&&(y=Math.sin(D),C=(c*d-g*h*p)/y,Math.abs(C)>1&&(C=C/Math.abs(C)),m=g*Math.sin(s-a)/y,u=Math.acos(C)*v,m<0&&(u=360-u)),D*=v,D*=60,t===90&&(u=180),t===-90&&(u=0),r[0]=D,r[1]=u,r}dispos(e){return Y.dispos(this.getRaDeg(),this.getDecDeg(),e.getRaDeg(),e.getDecDeg())}static wcsdist(e,t,i,n){let r,s,a,f,o,u,c,h=[0,0,0],g=[0,0,0],d,p=Math.PI/180;for(r=e*p,a=t*p,c=Math.cos(a),h[0]=Math.cos(r)*c,h[1]=Math.sin(r)*c,h[2]=Math.sin(a),s=i*p,f=n*p,c=Math.cos(f),g[0]=Math.cos(s)*c,g[1]=Math.sin(s)*c,g[2]=Math.sin(f),o=0,d=0;d<3;d++)o=o+(h[d]-g[d])*(h[d]-g[d]);return o=o/4,o>1&&(o=1),u=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)),u*180/Math.PI}dist$coordtxl_coords_WorldCoords(e){return Y.dispos(this.getRaDeg(),this.getDecDeg(),e.getRaDeg(),e.getDecDeg())[0]}dist(e){if(e!=null&&e instanceof Y||e===null)return this.dist$coordtxl_coords_WorldCoords(e);if(e!=null&&e.constructor!=null&&e.constructor.__interfaces!=null&&e.constructor.__interfaces.indexOf("coordtxl.coords.Coordinates")>=0||e===null)return this.dist$coordtxl_coords_Coordinates(e);throw new Error("invalid overload")}dist$coordtxl_coords_Coordinates(e){return this.dist$coordtxl_coords_WorldCoords(e)}static dist(e,t,i,n){return Y.dispos(e,t,i,n)[0]}box(e){let t=[null,null],i=this.ra.getVal(),n=this.dec.getVal();e/=60;let r=Math.sqrt(2*e*e),s,a,f,o,u;return f=n-r/2,f<=-90?(f=-90,o=n+r/2,s=0,a=24):(o=n+r/2,o>=90?(f=n-r/2,o=90,s=0,a=24):(n>0?u=Math.abs(Math.cos(f*Math.PI/180)):u=Math.abs(Math.cos(o*Math.PI/180)),s=i-r/15/2/u,a=i+r/15/2/u,s<0&&(s+=24),a>24&&(a-=24))),t[0]=new Y(s*15,f),t[1]=new Y(a*15,o),t}center(e,t){let i=[0,0,0,0,0],n=e.getRaDeg(),r=e.getDecDeg(),s=t.getRaDeg(),a=t.getDecDeg();return i[0]=(n+s)/2,i[1]=(r+a)/2,i[2]=Y.wcsdist(n,r,s,r)*60,i[3]=Y.wcsdist(n,r,n,a)*60,i[4]=Y.wcsdist(n,r,s,a)*60/2,i}getCoordinateSystemName(){return"wcs"}init(e){this.checkRange(),this.convertEquinox(e,2e3)}convertEquinox(e,t){if(e===t)return;let i=[0,0],n=[0,0];i[0]=this.ra.getVal()*15,i[1]=this.dec.getVal(),gi.JPrec.prej_q(i,n,e,t),this.ra=new B.HMS(n[0]/15),this.dec=new G.DMS(n[1])}checkRange(){let e=this.ra.getVal(),t=this.dec.getVal();e<-.001||e>=25,t<-90||t>90}};Fe.WorldCoords=Y;Y.__class="coordtxl.coords.WorldCoords";Y.__interfaces=["coordtxl.coords.WorldCoordinates","coordtxl.coords.Coordinates"];var gi=Lt(),G=Kt(),B=Nt()});var zt=Z(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.WorldCoords=ae.WCSTransform=ae.MapKeywordProvider=ae.Point2D=void 0;var pi=ue();Object.defineProperty(ae,"Point2D",{enumerable:!0,get:function(){return pi.Point2D}});var _i=At();Object.defineProperty(ae,"MapKeywordProvider",{enumerable:!0,get:function(){return _i.MapKeywordProvider}});var mi=we();Object.defineProperty(ae,"WCSTransform",{enumerable:!0,get:function(){return mi.WCSTransform}});var yi=kt();Object.defineProperty(ae,"WorldCoords",{enumerable:!0,get:function(){return yi.WorldCoords}})});function _t(l){if(typeof l._casagui_id_=="undefined"){let e=null;if(typeof window=="undefined"){if(typeof crypto!="undefined"){let n=crypto.randomBytes(8);e=new Uint32Array(n.buffer.slice(-4))}}else e=new Uint32Array(1),window.crypto.getRandomValues(e);let t=new Date,i=Math.floor(t.getTime()/1e3);l._casagui_id_=`${e?e[0]:i}-${i}`}return l._casagui_id_}function mt(l,e){if(Array.isArray(e))e.map(l);else if(typeof e=="object"&&e!==null)Object.entries(e).map(t=>l(t[0],t[1]));else throw new Error(`casalib.map applied to ${typeof e}`)}function yt(l,e,t){if(Array.isArray(e))return e.reduce(l,t);if(e instanceof Set)return[...e].reduce(l,t);if(typeof e=="object"&&e!==null)return Object.entries(e).reduce((i,n,r)=>l(i,n[0],n[1],r),t);throw new Error(`casalib.reduce applied to ${typeof e}`)}function xt(l,e){let t=null,i=function(){t!==null&&clearTimeout(t),t=window.setTimeout(()=>{l(),t=null},e)};return i.cancel=function(){t!==null&&(clearTimeout(t),t=null)},i}function et(l){return Array.isArray(l)&&(l.length==0||l.every(et))}function bt(l){if(l.length<1)return[NaN,NaN];let e,t;e=t=l[0];for(let i=l.length-1;i>0;--i)l[i]<e&&(e=l[i]),l[i]>t&&(t=l[i]);return[e,t]}function Ee(l){if(l instanceof Set)return Array.from(l).sort((e,t)=>e-t);if(Array.isArray(l))return l.slice().sort((e,t)=>e-t);throw new Error(`unexpected parameter type (${typeof l})`)}function Mt(l,e=!1){let t=[],i=l.split(",");for(let n of i){let[r,s]=n.trim().split(":"),a=parseInt(r,10),f=s?parseInt(s,10):a;if(isNaN(a)||isNaN(f))throw new Error(`Invalid range: ${n}`);if(a>f)if(e)t.push([f,a]);else throw new Error(`Invalid range: ${n}`);else t.push([a,f])}return t}function vt(l){return Ee(l).reduce((t,i)=>t[0][0]==null?[[i,i]]:i>t[0][1]+1?[[i,i],...t]:[[t[0][0],i],...t.slice(1)],[[null,-1]]).reverse().map(t=>t[0]==t[1]?`${t[0]}`:`${t[0]}:${t[1]}`).join(", ")}function St(l,e,t,i){let n=i;for(let r=l;r<=e;r++)n=t(n,r,r-l);return n}function Ct(){this.timeout=1e3,this.retries=20,this.connected=!0,this.backoff=()=>{this.connected=!1,this.timeout+=Math.floor(pt(1.8,22-this.retries)),this.retries-=1}}function je(...l){let e=Math.max(...l.map(i=>i.length)),t=[];for(let i=0;i<e;i++){let n=l.map(r=>r[i]);t.push(n)}return t}function Dt(l){return l.length<=0?l:l.reduce((e,t)=>e.map((i,n)=>[...i,t[n]]),l[0].map(e=>[]))}var he=class{constructor(){this.forwardMap=new Map,this.inverseMap=new Map}set(e,t){this.forwardMap.set(e,t),this.inverseMap.set(t,e)}get(e){return this.forwardMap.get(e)}getKey(e){return this.inverseMap.get(e)}delete(e){let t=this.forwardMap.get(e);if(t!==void 0)return this.forwardMap.delete(e),this.inverseMap.delete(t),t}deleteValue(e){let t=this.inverseMap.get(e);if(t!==void 0)return this.inverseMap.delete(e),this.forwardMap.delete(t),t}has(e){return this.forwardMap.has(e)}hasValue(e){return this.inverseMap.has(e)}clear(){this.forwardMap.clear(),this.inverseMap.clear()}get size(){return this.forwardMap.size}*entries(){return this.forwardMap.entries()}map(e){let t=[];for(let[i,n]of this.entries())t.push(e(n,i,this));return t}};var ye=class extends he{constructor(t){super();this.keyset=t;this.usedKeys=new Set,this.availKeys=new Set(t)}clear(){super.clear(),this.usedKeys=new Set,this.availKeys=new Set(this.keyset)}add(t){if(this.availKeys.size!==0)for(let i of this.availKeys)return this.availKeys.delete(i),this.usedKeys.add(i),super.set(i,t),i}get bound(){return new Set(this.keyset)}set(t,i){if(!this.keyset.has(t))throw new Error(`${t} is not a valid key`);this.availKeys.has(t)&&this.availKeys.delete(t),this.usedKeys.has(t)||this.usedKeys.add(t),super.set(t,i)}delete(t){return t&&(this.usedKeys.delete(t),this.availKeys.add(t)),super.delete(t)}deleteValue(t){let i=super.getKey(t);return i&&(this.usedKeys.delete(i),this.availKeys.add(i)),super.deleteValue(t)}};function _e(l,e){if(l===e)return!0;if(typeof l!=typeof e)return!1;if(Array.isArray(l)&&Array.isArray(e)){if(l.length!==e.length)return!1;for(let t=0;t<l.length;t++)if(!_e(l[t],e[t]))return!1;return!0}if(typeof l=="object"&&typeof e=="object"){let t=Object.keys(l),i=Object.keys(e);if(t.length!==i.length)return!1;for(let n of t)if(!i.includes(n)||!_e(l[n],e[n]))return!1;return!0}return!1}var de=class extends Set{constructor(t,i=_e){super(t);this.comparator=i}add(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return this}return super.add(t)}has(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return!0;return!1}return super.has(t)}delete(t){if(this.comparator){for(let i of this)if(this.comparator(t,i))return super.delete(i),!0;return!1}return super.delete(t)}difference(t){let i=new de(void 0,this.comparator);for(let n of this)t.has(n)||i.add(n);return i}intersection(t){let i=new de(void 0,this.comparator);for(let n of this)t.has(n)&&i.add(n);return i}};var ki=ui(zt());var nt=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function rt(l,e,t,i){l.addEventListener?l.addEventListener(e,t,i):l.attachEvent&&l.attachEvent("on".concat(e),function(){t(window.event)})}function Ft(l,e){for(var t=e.slice(0,e.length-1),i=0;i<t.length;i++)t[i]=l[t[i].toLowerCase()];return t}function Ut(l){typeof l!="string"&&(l=""),l=l.replace(/\s/g,"");for(var e=l.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function xi(l,e){for(var t=l.length>=e.length?l:e,i=l.length>=e.length?e:l,n=!0,r=0;r<t.length;r++)i.indexOf(t[r])===-1&&(n=!1);return n}var Me={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":nt?173:189,"=":nt?61:187,";":nt?59:186,"'":222,"[":219,"]":221,"\\":220},oe={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},lt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},F={16:!1,18:!1,17:!1,91:!1},z={};for(be=1;be<20;be++)Me["f".concat(be)]=111+be;var be,N=[],Xt=!1,Gt="all",Bt=[],Se=function(e){return Me[e.toLowerCase()]||oe[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)},bi=function(e){return Object.keys(Me).find(function(t){return Me[t]===e})},Mi=function(e){return Object.keys(oe).find(function(t){return oe[t]===e})};function Zt(l){Gt=l||"all"}function ve(){return Gt||"all"}function vi(){return N.slice(0)}function Si(){return N.map(function(l){return bi(l)||Mi(l)||String.fromCharCode(l)})}function Ci(){var l=[];return Object.keys(z).forEach(function(e){z[e].forEach(function(t){var i=t.key,n=t.scope,r=t.mods,s=t.shortcut;l.push({scope:n,shortcut:s,mods:r,keys:i.split("+").map(function(a){return Se(a)})})})}),l}function Di(l){var e=l.target||l.srcElement,t=e.tagName,i=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(i=!1),i}function Ai(l){return typeof l=="string"&&(l=Se(l)),N.indexOf(l)!==-1}function Ei(l,e){var t,i;l||(l=ve());for(var n in z)if(Object.prototype.hasOwnProperty.call(z,n))for(t=z[n],i=0;i<t.length;)t[i].scope===l?t.splice(i,1):i++;ve()===l&&Zt(e||"all")}function ji(l){var e=l.keyCode||l.which||l.charCode,t=N.indexOf(e);if(t>=0&&N.splice(t,1),l.key&&l.key.toLowerCase()==="meta"&&N.splice(0,N.length),(e===93||e===224)&&(e=91),e in F){F[e]=!1;for(var i in oe)oe[i]===e&&(le[i]=!1)}}function $i(l){if(typeof l>"u")Object.keys(z).forEach(function(s){return delete z[s]});else if(Array.isArray(l))l.forEach(function(s){s.key&&st(s)});else if(typeof l=="object")l.key&&st(l);else if(typeof l=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var n=t[0],r=t[1];typeof n=="function"&&(r=n,n=""),st({key:l,scope:n,method:r,splitKey:"+"})}}var st=function(e){var t=e.key,i=e.scope,n=e.method,r=e.splitKey,s=r===void 0?"+":r,a=Ut(t);a.forEach(function(f){var o=f.split(s),u=o.length,c=o[u-1],h=c==="*"?"*":Se(c);if(!!z[h]){i||(i=ve());var g=u>1?Ft(oe,o):[];z[h]=z[h].filter(function(d){var p=n?d.method===n:!0;return!(p&&d.scope===i&&xi(d.mods,g))})}})};function Rt(l,e,t,i){if(e.element===i){var n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(var r in F)Object.prototype.hasOwnProperty.call(F,r)&&(!F[r]&&e.mods.indexOf(+r)>-1||F[r]&&e.mods.indexOf(+r)===-1)&&(n=!1);(e.mods.length===0&&!F[16]&&!F[18]&&!F[17]&&!F[91]||n||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(N),e.method(l,e)===!1&&(l.preventDefault?l.preventDefault():l.returnValue=!1,l.stopPropagation&&l.stopPropagation(),l.cancelBubble&&(l.cancelBubble=!0)))}}}function Ht(l,e){var t=z["*"],i=l.keyCode||l.which||l.charCode;if(!!le.filter.call(this,l)){if((i===93||i===224)&&(i=91),N.indexOf(i)===-1&&i!==229&&N.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(d){var p=lt[d];l[d]&&N.indexOf(p)===-1?N.push(p):!l[d]&&N.indexOf(p)>-1?N.splice(N.indexOf(p),1):d==="metaKey"&&l[d]&&N.length===3&&(l.ctrlKey||l.shiftKey||l.altKey||(N=N.slice(N.indexOf(p))))}),i in F){F[i]=!0;for(var n in oe)oe[n]===i&&(le[n]=!0);if(!t)return}for(var r in F)Object.prototype.hasOwnProperty.call(F,r)&&(F[r]=l[lt[r]]);l.getModifierState&&!(l.altKey&&!l.ctrlKey)&&l.getModifierState("AltGraph")&&(N.indexOf(17)===-1&&N.push(17),N.indexOf(18)===-1&&N.push(18),F[17]=!0,F[18]=!0);var s=ve();if(t)for(var a=0;a<t.length;a++)t[a].scope===s&&(l.type==="keydown"&&t[a].keydown||l.type==="keyup"&&t[a].keyup)&&Rt(l,t[a],s,e);if(i in z){for(var f=0;f<z[i].length;f++)if((l.type==="keydown"&&z[i][f].keydown||l.type==="keyup"&&z[i][f].keyup)&&z[i][f].key){for(var o=z[i][f],u=o.splitKey,c=o.key.split(u),h=[],g=0;g<c.length;g++)h.push(Se(c[g]));h.sort().join("")===N.sort().join("")&&Rt(l,o,s,e)}}}}function Pi(l){return Bt.indexOf(l)>-1}function le(l,e,t){N=[];var i=Ut(l),n=[],r="all",s=document,a=0,f=!1,o=!0,u="+",c=!1;for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(r=e.scope),e.element&&(s=e.element),e.keyup&&(f=e.keyup),e.keydown!==void 0&&(o=e.keydown),e.capture!==void 0&&(c=e.capture),typeof e.splitKey=="string"&&(u=e.splitKey)),typeof e=="string"&&(r=e);a<i.length;a++)l=i[a].split(u),n=[],l.length>1&&(n=Ft(oe,l)),l=l[l.length-1],l=l==="*"?"*":Se(l),l in z||(z[l]=[]),z[l].push({keyup:f,keydown:o,scope:r,mods:n,shortcut:i[a],method:t,key:i[a],splitKey:u,element:s});typeof s<"u"&&!Pi(s)&&window&&(Bt.push(s),rt(s,"keydown",function(h){Ht(h,s)},c),Xt||(Xt=!0,rt(window,"focus",function(){N=[]},c)),rt(s,"keyup",function(h){Ht(h,s),ji(h)},c))}function Ti(l){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(z).forEach(function(t){var i=z[t].filter(function(n){return n.scope===e&&n.shortcut===l});i.forEach(function(n){n&&n.method&&n.method()})})}var at={getPressedKeyString:Si,setScope:Zt,getScope:ve,deleteScope:Ei,getPressedKeyCodes:vi,getAllKeyCodes:Ci,isPressed:Ai,filter:Di,trigger:Ti,unbind:$i,keyMap:Me,modifier:oe,modifierMap:lt};for(Ue in at)Object.prototype.hasOwnProperty.call(at,Ue)&&(le[Ue]=at[Ue]);var Ue;typeof window<"u"&&(Yt=window.hotkeys,le.noConflict=function(l){return l&&window.hotkeys===le&&(window.hotkeys=Yt),le},window.hotkeys=le);var Yt;function ot(l,e){let t=0;if(e===void 0)for(let i of l)i!=null&&(i=+i)>=i&&++t;else{let i=-1;for(let n of l)(n=e(n,++i,l))!=null&&(n=+n)>=n&&++t}return t}function Ge(l,e){let t,i;if(e===void 0)for(let n of l)n!=null&&(t===void 0?n>=n&&(t=i=n):(t>n&&(t=n),i<n&&(i=n)));else{let n=-1;for(let r of l)(r=e(r,++n,l))!=null&&(t===void 0?r>=r&&(t=i=r):(t>r&&(t=r),i<r&&(i=r)))}return[t,i]}var Ii=Math.sqrt(50),Vi=Math.sqrt(10),wi=Math.sqrt(2);function Be(l,e,t){let i=(e-l)/Math.max(0,t),n=Math.floor(Math.log10(i)),r=i/Math.pow(10,n),s=r>=Ii?10:r>=Vi?5:r>=wi?2:1,a,f,o;return n<0?(o=Math.pow(10,-n)/s,a=Math.round(l*o),f=Math.round(e*o),a/o<l&&++a,f/o>e&&--f,o=-o):(o=Math.pow(10,n)*s,a=Math.round(l/o),f=Math.round(e/o),a*o<l&&++a,f*o>e&&--f),f<a&&.5<=t&&t<2?Be(l,e,t*2):[a,f,o]}function Ze(l,e,t){if(e=+e,l=+l,t=+t,!(t>0))return[];if(l===e)return[l];let i=e<l,[n,r,s]=i?Be(e,l,t):Be(l,e,t);if(!(r>=n))return[];let a=r-n+1,f=new Array(a);if(i)if(s<0)for(let o=0;o<a;++o)f[o]=(r-o)/-s;else for(let o=0;o<a;++o)f[o]=(r-o)*s;else if(s<0)for(let o=0;o<a;++o)f[o]=(n+o)/-s;else for(let o=0;o<a;++o)f[o]=(n+o)*s;return f}function ft(l,e,t){return e=+e,l=+l,t=+t,Be(l,e,t)[2]}function Je(l,e,t){let i;for(;;){let n=ft(l,e,t);if(n===i||n===0||!isFinite(n))return[l,e];n>0?(l=Math.floor(l/n)*n,e=Math.ceil(e/n)*n):n<0&&(l=Math.ceil(l*n)/n,e=Math.floor(e*n)/n),i=n}}function Qe(l){return Math.max(1,Math.ceil(Math.log(ot(l))/Math.LN2)+1)}var Oi=Array.prototype,Jt=Oi.slice;function Qt(l,e){return l-e}function ei(l){for(var e=0,t=l.length,i=l[t-1][1]*l[0][0]-l[t-1][0]*l[0][1];++e<t;)i+=l[e-1][1]*l[e][0]-l[e-1][0]*l[e][1];return i}var dt=l=>()=>l;function ti(l,e){for(var t=-1,i=e.length,n;++t<i;)if(n=Li(l,e[t]))return n;return 0}function Li(l,e){for(var t=e[0],i=e[1],n=-1,r=0,s=l.length,a=s-1;r<s;a=r++){var f=l[r],o=f[0],u=f[1],c=l[a],h=c[0],g=c[1];if(Ki(f,c,e))return 0;u>i!=g>i&&t<(h-o)*(i-u)/(g-u)+o&&(n=-n)}return n}function Ki(l,e,t){var i;return Wi(l,e,t)&&Ni(l[i=+(l[0]===e[0])],t[i],e[i])}function Wi(l,e,t){return(e[0]-l[0])*(t[1]-l[1])===(t[0]-l[0])*(e[1]-l[1])}function Ni(l,e,t){return l<=e&&e<=t||t<=e&&e<=l}function ii(){}var fe=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function ht(){var l=1,e=1,t=Qe,i=f;function n(o){var u=t(o);if(Array.isArray(u))u=u.slice().sort(Qt);else{let c=Ge(o,qi);for(u=Ze(...Je(c[0],c[1],u),u);u[u.length-1]>=c[1];)u.pop();for(;u[1]<c[0];)u.shift()}return u.map(c=>r(o,c))}function r(o,u){let c=u==null?NaN:+u;if(isNaN(c))throw new Error(`invalid value: ${u}`);var h=[],g=[];return s(o,c,function(d){i(d,o,c),ei(d)>0?h.push([d]):g.push(d)}),g.forEach(function(d){for(var p=0,x=h.length,y;p<x;++p)if(ti((y=h[p])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:u,coordinates:h}}function s(o,u,c){var h=new Array,g=new Array,d,p,x,y,m,C;for(d=p=-1,y=ge(o[0],u),fe[y<<1].forEach(v);++d<l-1;)x=y,y=ge(o[d+1],u),fe[x|y<<1].forEach(v);for(fe[y<<0].forEach(v);++p<e-1;){for(d=-1,y=ge(o[p*l+l],u),m=ge(o[p*l],u),fe[y<<1|m<<2].forEach(v);++d<l-1;)x=y,y=ge(o[p*l+l+d+1],u),C=m,m=ge(o[p*l+d+1],u),fe[x|y<<1|m<<2|C<<3].forEach(v);fe[y|m<<3].forEach(v)}for(d=-1,m=o[p*l]>=u,fe[m<<2].forEach(v);++d<l-1;)C=m,m=ge(o[p*l+d+1],u),fe[m<<2|C<<3].forEach(v);fe[m<<3].forEach(v);function v(D){var T=[D[0][0]+d,D[0][1]+p],$=[D[1][0]+d,D[1][1]+p],K=a(T),V=a($),S,E;(S=g[K])?(E=h[V])?(delete g[S.end],delete h[E.start],S===E?(S.ring.push($),c(S.ring)):h[S.start]=g[E.end]={start:S.start,end:E.end,ring:S.ring.concat(E.ring)}):(delete g[S.end],S.ring.push($),g[S.end=V]=S):(S=h[V])?(E=g[K])?(delete h[S.start],delete g[E.end],S===E?(S.ring.push($),c(S.ring)):h[E.start]=g[S.end]={start:E.start,end:S.end,ring:E.ring.concat(S.ring)}):(delete h[S.start],S.ring.unshift(T),h[S.start=K]=S):h[K]=g[V]={start:K,end:V,ring:[T,$]}}}function a(o){return o[0]*2+o[1]*(l+1)*4}function f(o,u,c){o.forEach(function(h){var g=h[0],d=h[1],p=g|0,x=d|0,y=ut(u[x*l+p]);g>0&&g<l&&p===g&&(h[0]=ni(g,ut(u[x*l+p-1]),y,c)),d>0&&d<e&&x===d&&(h[1]=ni(d,ut(u[(x-1)*l+p]),y,c))})}return n.contour=r,n.size=function(o){if(!arguments.length)return[l,e];var u=Math.floor(o[0]),c=Math.floor(o[1]);if(!(u>=0&&c>=0))throw new Error("invalid size");return l=u,e=c,n},n.thresholds=function(o){return arguments.length?(t=typeof o=="function"?o:Array.isArray(o)?dt(Jt.call(o)):dt(o),n):t},n.smooth=function(o){return arguments.length?(i=o?f:ii,n):i===f},n}function qi(l){return isFinite(l)?l:NaN}function ge(l,e){return l==null?!1:+l>=e}function ut(l){return l==null||isNaN(l=+l)?-1/0:l}function ni(l,e,t,i){let n=i-e,r=t-e,s=isFinite(n)||isFinite(r)?n/r:Math.sign(n)/Math.sign(r);return isNaN(s)?l:l+s-.5}function Ce(l){for(var e=-1,t=l.length,i,n=l[t-1],r=0;++e<t;)i=n,n=l[e],r+=i[1]*n[0]-i[0]*n[1];return r/2}function ct(l,e){for(var t=l.length,i=l[t-1],n=e[0],r=e[1],s=i[0],a=i[1],f,o,u=!1,c=0;c<t;++c)i=l[c],f=i[0],o=i[1],o>r!=a>r&&n<(s-f)*(r-o)/(a-o)+f&&(u=!u),s=f,a=o;return u}function zi(l,e){return typeof l=="object"&&l&&e in l}function Xi(l){if(!Array.isArray(l))return!1;for(let e of l)if(!Array.isArray(e)||e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")return!1;return!0}function Ri(l,e){return l.length<=0?0:(Xi(l)&&Ce(l),Ce(je(l,e)))}var ri={is_empty:et,minmax:bt,sorted:Ee,strparse_intranges:Mt,intlist_to_rangestr:vt,map:mt,reduce:yt,debounce:xt,zip:je,unzip:Dt,forexpr:St,object_id:_t,coordtxl:ki,hotkeys:le,ReconnectState:Ct,polyArea:Ri,BiMap:he,BoundedBiMap:ye,EqSet:de,eq:_e,d3:{contours:ht,polygonContains:ct,polygonArea:Ce},_dummy:void 0};typeof Bokeh!="undefined"&&typeof Bokeh._dummy!="undefined"&&(ri._dummy=Bokeh._dummy);window.casalib=ri;window.hasprop=zi;window.zip=je;window.EqSet=de;window.BiMap=he;window.BoundedBiMap=ye;})();
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+ /*!
3
+ * Copyright (c) Anaconda, Inc., and Bokeh Contributors
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without modification,
7
+ * are permitted provided that the following conditions are met:
8
+ *
9
+ * Redistributions of source code must retain the above copyright notice,
10
+ * this list of conditions and the following disclaimer.
11
+ *
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ * this list of conditions and the following disclaimer in the documentation
14
+ * and/or other materials provided with the distribution.
15
+ *
16
+ * Neither the name of Anaconda nor the names of any contributors
17
+ * may be used to endorse or promote products derived from this software
18
+ * without specific prior written permission.
19
+ *
20
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30
+ * THE POSSIBILITY OF SUCH DAMAGE.
31
+ */
32
+ (function(root, factory) {
33
+ factory(root["Bokeh"], undefined);
34
+ })(this, function(Bokeh, version) {
35
+ let define;
36
+ return (function(modules, entry, aliases, externals) {
37
+ const bokeh = typeof Bokeh !== "undefined" ? (version != null ? Bokeh[version] : Bokeh) : null;
38
+ if (bokeh != null) {
39
+ return bokeh.register_plugin(modules, entry, aliases);
40
+ } else {
41
+ throw new Error("Cannot find Bokeh" + (version != null ? " " + version : "") + ". You have to load it prior to loading plugins.");
42
+ }
43
+ })
44
+ ({
45
+ "de17b915c5": function _(a,t,e,o,c){o();const n=a("tslib"),i=a("b33e822163");c("DataPipe",i.DataPipe);const s=a("2889e0dd45");c("ImagePipe",s.ImagePipe);const p=a("de65005924");c("ImageDataSource",p.ImageDataSource);const r=a("02e3c3e46c");c("SpectraDataSource",r.SpectraDataSource);const T=a("64b16deff9");c("UpdatableDataSource",T.UpdatableDataSource);const l=a("b6ae454f0d");c("WcsTicks",l.WcsTicks);const u=a("cb7d28d6b3");c("DragTool",u.DragTool);const S=a("01959f25a3");c("CBResetTool",S.CBResetTool);const D=a("e3901fa9f2");c("serialize",D.serialize),c("deserialize",D.deserialize);const d=a("9f961622ce");c("TipButton",d.TipButton);const b=a("ca4c845905");c("Tip",b.Tip);const g=a("b55081402e");c("EditSpan",g.EditSpan);const E=a("9144bfc7a5");c("EvTextInput",E.EvTextInput);const I=a("74e0abef8a");c("EvPolyAnnotation",I.EvPolyAnnotation);const P=n.__importStar(a("15b954190c"));e.find=P;(0,a("@bokehjs/base").register_models)({DataPipe:i.DataPipe,ImagePipe:s.ImagePipe,ImageDataSource:p.ImageDataSource,SpectraDataSource:r.SpectraDataSource,UpdatableDataSource:T.UpdatableDataSource,WcsTicks:l.WcsTicks,DragTool:u.DragTool,CBResetTool:S.CBResetTool,Tip:b.Tip,TipButton:d.TipButton,EditSpan:g.EditSpan,EvTextInput:E.EvTextInput,EvPolyAnnotation:I.EvPolyAnnotation})},
46
+ "b33e822163": function _(e,s,t,i,n){var o;i();const c=e("@bokehjs/models/sources/data_source"),a=e("e3901fa9f2"),d=e("@bokehjs/core/util/callbacks");class l extends c.DataSource{constructor(e){super(e),this.send_queue={},this.connection_queue=[],this.pending={},this.incoming_callbacks={}}initialize(){super.initialize();let e=`ws://${this.address[0]}:${this.address[1]}`;console.log("datapipe url:",e);var s=void 0;document.shutdown_in_progress_=!1;var t=()=>{void 0!==this.websocket&&this.websocket.close(),this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.websocket.addEventListener("error",(e=>{console.log("error encountered:",e)})),this.websocket.onmessage=e=>{if("string"==typeof e.data||e.data instanceof String){let s=(0,a.deserialize)(e.data);if("id"in s&&"direction"in s&&"message"in s){let{id:e,message:t,direction:i}=s;if(void 0===t&&console.log("Error, event failure",s),"j2p"==i)if(e in this.pending){let{cb:i}=this.pending[e];if(delete this.pending[e],e in this.send_queue&&this.send_queue[e].length>0){let{cb:s,msg:t}=this.send_queue[e].shift();this.pending[e]={cb:s},this.websocket.send((0,a.serialize)(t))}void 0===t?console.log("DROPPING ERROR FOR NOW (maybe need error callbacks)",s):i(t)}else console.log("message received but could not find id");else if(e in this.incoming_callbacks){let s=this.incoming_callbacks[e](t);this.websocket.send((0,a.serialize)({id:e,direction:i,message:s,session:casalib.object_id(this)}))}}else console.log(`datapipe received message without one of 'id', 'message' or 'direction': ${s}`)}else console.log("datapipe received binary data",e.data.byteLength,"bytes")},this.websocket.onopen=()=>{for(s?0==s.connected&&console.log(`connection reestablished at ${new Date}`):this.websocket.send((0,a.serialize)({id:"initialize",direction:"j2p",session:casalib.object_id(this)})),s=new casalib.ReconnectState;this.connection_queue.length>0;){let e=this.connection_queue.shift();this.send.apply(e[0],e[1])}},this.websocket.onclose=()=>{if(s&&1==s.connected&&(console.log(`connection lost at ${new Date}`),s.connected=!1,!document.shutdown_in_progress_)){console.log(`connection lost at ${new Date}`);var e=s;function i(n){0==s.connected&&(console.log(`${n+1}\treconnection attempt ${new Date}`),t(),e.backoff(),e.retries>0?setTimeout(i,e.timeout,n+1):0==s.connected&&console.log(`aborting reconnection after ${n} attempts ${new Date}`))}i(0)}}};t();(()=>{null!=this.init_script&&(0,d.execute)(this.init_script,this)})()}register(e,s){this.incoming_callbacks[e]=s}send(e,s,t,i=!1){let n={id:e,message:s,direction:"j2p",session:casalib.object_id(this)};if(!this.websocket||e in this.pending)if(e in this.send_queue)if("boolean"==typeof i&&i&&this.send_queue[e].length>0)this.send_queue[e][0].msg=n,this.send_queue[e][0].cb=t;else if("function"==typeof i&&this.send_queue[e].length>0){let o=!1;for(const c of this.send_queue[e])i(c.msg.message)&&(c.msg=n,c.cb=t,o=!0);o||this.send_queue[e].push({cb:t,msg:n})}else this.send_queue[e].push({cb:t,msg:n});else this.send_queue[e]=[{cb:t,msg:n}];else if(this.websocket.readyState===WebSocket.CONNECTING)this.connection_queue.push([this,[e,s,t]]);else if(e in this.send_queue&&this.send_queue[e].length>0){this.send_queue[e].push({cb:t,msg:n});{let{cb:d,msg:l}=this.send_queue[e].shift();if(this.pending[e]={cb:d},this.websocket.readyState===WebSocket.OPEN)this.websocket.send((0,a.serialize)(l));else{let u=20,h=this;function r(){h.websocket.readyState===WebSocket.OPEN?h.websocket.send((0,a.serialize)(l)):(u-=1,u>0&&setTimeout(r,3e3))}setTimeout(r,3e3)}}}else if(this.websocket.readyState===WebSocket.OPEN)this.pending[e]={cb:t},this.websocket.send((0,a.serialize)(n));else{let b=20,g=this;function _(){g.websocket.readyState===WebSocket.OPEN?(g.pending[e]={cb:t},g.websocket.send((0,a.serialize)(n))):(b-=1,b>0&&setTimeout(_,3e3))}setTimeout(_,3e3)}}}t.DataPipe=l,o=l,l.__name__="DataPipe",l.__module__="cubevis.bokeh.sources._data_pipe",o.define((({Any:e,Tuple:s,String:t,Number:i})=>({init_script:[e,null],address:[s(t,i)]})))},
47
+ "e3901fa9f2": function _(e,r,s,i,o){i();const l=e("@bokehjs/base"),a=e("@bokehjs/core/resolvers"),t=e("@bokehjs/core/serialization/deserializer"),n=e("@bokehjs/core/serialization/serializer"),{deserialize:c}=new class{constructor(){this.resolver=new a.ModelResolver(l.default_resolver),this.deserializer=new t.Deserializer(this.resolver),this.deserialize=e=>{try{return this.deserializer.decode(JSON.parse(e))}catch(r){return console.group("deserialize error"),console.log(e),console.log(r),console.groupEnd(),{}}}}};s.deserialize=c;const{serialize:z}=new class{constructor(){this.serializer=new n.Serializer,this.serialize=e=>JSON.stringify(this.serializer.encode(e))}};s.serialize=z},
48
+ "2889e0dd45": function _(i,e,s,t,n){var a;t();const o=i("@bokehjs/models/sources/column_data_source"),d=i("b33e822163");class r extends d.DataPipe{constructor(i){super(i),this.position={},this._wcs=null}initialize(){super.initialize(),this.fits_header_json&&(this._wcs=new casalib.coordtxl.WCSTransform(new casalib.coordtxl.MapKeywordProvider(JSON.parse(this.fits_header_json))))}channel(i,e,s){this.position[s]={index:i};let t={action:"channel",index:i,id:s};super.send(this.dataid,t,(i=>{null!=this._histogram_source&&"hist"in i&&"top"in i.hist&&"bottom"in i.hist&&"left"in i.hist&&"right"in i.hist&&(this._histogram_source.data=i.hist),e(i)}))}spectrum(i,e,s,t=!1){let n={action:"spectrum",index:i,id:s};super.send(this.dataid,n,e,t)}adjust_colormap(i,e,s,t,n=!1){const a={action:"adjust-colormap",bounds:i,transfer:e,id:t};super.send(this.dataid,a,s,n)}refresh(i,e,s=[0,0]){let{index:t}=e in this.position?this.position[e]:{index:s};if(2===t.length){let s={action:"channel",index:t,id:e};super.send(this.dataid,s,i)}else if(3===t.length){let s={action:"spectrum",index:t,id:e};super.send(this.dataid,s,i)}}wcs(){return this._wcs}}s.ImagePipe=r,a=r,r.__name__="ImagePipe",r.__module__="cubevis.bokeh.sources._image_pipe",a.define((({Number:i,Nullable:e,String:s,Tuple:t,Ref:n})=>({dataid:[s],shape:[t(i,i,i,i)],fits_header_json:[e(s),null],_histogram_source:[e(n(o.ColumnDataSource)),null]})))},
49
+ "de65005924": function _(s,a,t,c,i){var o;c();const e=s("@bokehjs/models/sources/column_data_source"),n=s("@bokehjs/core/util/string"),u=s("2889e0dd45"),h=s("@bokehjs/core/util/callbacks");class r extends e.ColumnDataSource{constructor(s){super(s),this.imid=(0,n.uuid4)()}_mask_contour(s){const a=casalib.d3.contours().size(this.image_source.shape.slice(0,2)).thresholds([1])(s[0])[0].coordinates.map((s=>s.map((s=>s.reduce(((s,a)=>(s[0].push(a[0]),s[1].push(a[1]),s)),[[],[]])))));return{xs:[a.map((s=>s.map((s=>s[0]))))],ys:[a.map((s=>s.map((s=>s[1]))))]}}initialize(){if(super.initialize(),null!=this._mask_contour_source&&"msk"in this.data&&this.data.msk.length>0&&this.data.msk[0].length>0){const s=this.data.msk;this._mask_contour_source.data=this._mask_contour(s)}void 0===this.last_chan&&(this.last_chan=[this.cur_chan[0].valueOf(),this.cur_chan[1].valueOf()]);(()=>{null!=this.init_script&&(0,h.execute)(this.init_script,this)})()}channel(s,a=0,t){this.image_source.channel([a,s],(c=>{void 0!==c&&void 0!==c.chan||console.log("ImageDataSource ERROR ENCOUNTERED <1>",c),this.last_chan=[this.cur_chan[0].valueOf(),this.cur_chan[1].valueOf()],this.cur_chan=[a,s],null!=this._mask_contour_source&&"chan"in c&&"msk"in c.chan&&(c.msk_contour=this._mask_contour(c.chan.msk),this._mask_contour_source.data=c.msk_contour),t&&t(c),this.data=c.chan}),this.imid)}adjust_colormap(s,a,t){this.image_source.adjust_colormap(s,a,t,this.imid,!0)}signal_change(){this.change.emit()}refresh(s){this.image_source.refresh((a=>{void 0!==a&&void 0!==a.chan||console.log("ImageDataSource ERROR ENCOUNTERED <2>",a),null!=this._mask_contour_source&&"chan"in a&&"msk"in a.chan&&(a.msk_contour=this._mask_contour(a.chan.msk),this._mask_contour_source.data=a.msk_contour),s&&s(a),this.data=a.chan}),this.imid,[0,0])}wcs(){return this.image_source.wcs()}}t.ImageDataSource=r,o=r,r.__name__="ImageDataSource",r.__module__="cubevis.bokeh.sources._image_data_source",o.define((({Tuple:s,Number:a,Ref:t,Nullable:c,Any:i})=>({init_script:[i,null],image_source:[t(u.ImagePipe)],_mask_contour_source:[c(t(e.ColumnDataSource)),null],num_chans:[s(a,a)],cur_chan:[s(a,a)]})))},
50
+ "02e3c3e46c": function _(e,s,i,t,r){var a;t();const c=e("@bokehjs/models/sources/column_data_source"),u=e("@bokehjs/core/util/string"),o=e("2889e0dd45");class _ extends c.ColumnDataSource{constructor(e){super(e),this.imid=(0,u.uuid4)()}initialize(){super.initialize()}spectra(e,s,i=0,t=!1){this.image_source.spectrum([e,s,i],(e=>this.data=e.spectrum),this.imid,t)}refresh(){this.image_source.refresh((e=>this.data=e.spectrum),this.imid,[0,0,0])}}i.SpectraDataSource=_,a=_,_.__name__="SpectraDataSource",_.__module__="cubevis.bokeh.sources._spectra_data_source",a.define((({Ref:e})=>({image_source:[e(o.ImagePipe)]})))},
51
+ "64b16deff9": function _(e,s,i,t,a){var n;t();const u=e("@bokehjs/models/sources/column_data_source"),l=e("b33e822163"),o=e("@bokehjs/core/util/callbacks");class c extends u.ColumnDataSource{constructor(e){super(e)}send(e,s){this.pipe.send(this.session_id.valueOf(),{action:"callback",message:e},(e=>{s("result"in e?e.result:{error:`expected to find a "result" in "${e}"`,msg:e})}))}initialize(){super.initialize();(()=>{null!=this.js_init&&(0,o.execute)(this.js_init,this)})()}}i.UpdatableDataSource=c,n=c,c.__name__="UpdatableDataSource",c.__module__="cubevis.bokeh.sources._updatable_data_source",n.define((({Ref:e,Any:s,String:i})=>({js_init:[s,null],js_update:[s,null],pipe:[e(l.DataPipe)],session_id:[i]})))},
52
+ "b6ae454f0d": function _(s,i,o,t,e){var r;t();const a=s("@bokehjs/models/formatters/tick_formatter"),c=s("de65005924");class l extends a.TickFormatter{constructor(s){super(s),this._axis=null,this._coord="world"}initialize(){super.initialize(),"x"==this.axis||"X"==this.axis||"y"==this.axis||"Y"==this.axis?this._axis="x"==this.axis||"X"==this.axis?"x":"y":console.log("ERROR: WcsTicks formatter created with invalid axis:",this.axis)}doFormat(s){const i=[];if(this._axis&&this.image_source.wcs()&&"world"==this._coord)for(let o=0,t=s.length;o<t;o++)if("x"==this._axis){const t=new casalib.coordtxl.Point2D(Number(s[o]),0);this.image_source.wcs().imageToWorldCoords(t,!1),i.push(new casalib.coordtxl.WorldCoords(t.getX(),t.getY()).format(2e3)[0])}else{const t=new casalib.coordtxl.Point2D(0,Number(s[o]));this.image_source.wcs().imageToWorldCoords(t,!1),i.push(new casalib.coordtxl.WorldCoords(t.getX(),t.getY()).format(2e3)[1])}else for(let o=0,t=s.length;o<t;o++)i.push(""+s[o]);return i}coordinates(s){return s!=this._coord&&("world"!=s&&"pixel"!=s||(this._coord=s)),this._coord}}o.WcsTicks=l,r=l,l.__name__="WcsTicks",l.__module__="cubevis.bokeh.format._wcs_ticks",r.define((({Ref:s,String:i})=>({axis:[i],image_source:[s(c.ImageDataSource)]})))},
53
+ "cb7d28d6b3": function _(i,e,t,o,s){var d;o();const l=i("@bokehjs/models/tools/gestures/gesture_tool"),r=i("949501ff1c"),_=i("15b954190c"),m=i("@bokehjs/core/util/callbacks");class n extends l.GestureToolView{_pan_start(i){var e;null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_view.model);const t=(0,_.px_from_sx)(this.plot_view,i.sx),o=(0,_.py_from_sy)(this.plot_view,i.sy),s=(0,_.dx_from_px)(this.plot_view,t),d=(0,_.dy_from_py)(this.plot_view,o),{start:l}=this.model;l?(0,m.execute)(l,this.model,{sx:t,sy:o,x:s,y:d,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.DragStart(t,o,s,d,i.dx,-i.dy,i.modifiers))}_pan(i){var e;null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_view.model);const t=(0,_.px_from_sx)(this.plot_view,i.sx),o=(0,_.py_from_sy)(this.plot_view,i.sy),s=(0,_.dx_from_px)(this.plot_view,t),d=(0,_.dy_from_py)(this.plot_view,o),{move:l}=this.model;l?(0,m.execute)(l,this.model,{sx:t,sy:o,x:s,y:d,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.Drag(t,o,s,d,i.dx,-i.dy,i.modifiers))}_pan_end(i){const e=(0,_.px_from_sx)(this.plot_view,i.sx),t=(0,_.py_from_sy)(this.plot_view,i.sy),o=(0,_.dx_from_px)(this.plot_view,e),s=(0,_.dy_from_py)(this.plot_view,t),{end:d}=this.model;d?(0,m.execute)(d,this.model,{sx:e,sy:t,x:o,y:s,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.DragEnd(e,t,o,s,i.dx,-i.dy,i.modifiers))}}t.DragToolView=n,n.__name__="DragToolView";class a extends l.GestureTool{constructor(i){super(i),this.tool_name="Drag",this.event_type="pan",this.default_order=10}}t.DragTool=a,d=a,a.__name__="DragTool",a.__module__="cubevis.bokeh.tools._drag_tool",d.prototype.default_view=n,d.define((({Any:i,Nullable:e})=>({start:[e(i),null],move:[e(i),null],end:[e(i),null]})))},
54
+ "949501ff1c": function _(e,t,a,s,n){s();const _=e("@bokehjs/core/bokeh_events");class r extends _.Pan{}a.Drag=r,r.__name__="Drag";class l extends _.PanStart{constructor(e,t,a,s,n,_,r){super(e,t,a,s,r),this.delta_x=n,this.delta_y=_}get event_values(){const{delta_x:e,delta_y:t}=this;return Object.assign(Object.assign({},super.event_values),{delta_x:e,delta_y:t})}}a.DragStart=l,l.__name__="DragStart";class d extends _.PanEnd{constructor(e,t,a,s,n,_,r){super(e,t,a,s,r),this.delta_x=n,this.delta_y=_}get event_values(){const{delta_x:e,delta_y:t}=this;return Object.assign(Object.assign({},super.event_values),{delta_x:e,delta_y:t})}}a.DragEnd=d,d.__name__="DragEnd"},
55
+ "15b954190c": function _(e,n,o,t,r){t(),o.view=function(e){return function n(o,t){for(const r of o.children()){if(r.model.id===e.id)return r;if(r.children()){const e=n(r,t);if(e)return e}}return null}(Bokeh.index[Object.keys(Bokeh.index)[0]],e.id)},o.span_coords=function(e){function n(e,n,o,t,r){if(null!=e)switch(n){case"canvas":return r.compute(e);case"screen":return t.compute(e);case"data":return o.compute(e)}return NaN}const{frame:o,canvas:t}=e.plot_view,{x_scale:r,y_scale:i}=e.coordinates;let _,c,f,u,m=e.model.dimension;"width"==e.model.dimension?(f=n(e.model.location,e.model.location_units,i,o.bbox.yview,t.bbox.y_screen),c=o.bbox.left,u=o.bbox.width,_=e.model.line_width):(f=o.bbox.top,c=n(e.model.location,e.model.location_units,r,o.bbox.xview,t.bbox.y_screen),u=e.model.line_width,_=o.bbox.height);return{stop:f,sleft:c,width:u,height:_,orientation:m}},o.px_from_sx=function(e,n){return e.frame.bbox.x_view.invert(n)},o.py_from_sy=function(e,n){return e.frame.bbox.y_view.invert(n)},o.dx_from_px=function(e,n){const o=e.frame.bbox.x_view.compute(n);return e.frame.x_scale.invert(o)},o.dy_from_py=function(e,n){const o=e.frame.bbox.y_view.compute(n);return e.frame.y_scale.invert(o)},o.sx_from_dx=function(e,n){return e.frame.x_scale.compute(n)},o.sy_from_dy=function(e,n){return e.frame.y_scale.compute(n)},o.v_px_from_sx=function(e,n){return e.frame.bbox.x_view.v_invert(n)},o.v_py_from_sy=function(e,n){return e.frame.bbox.y_view.v_invert(n)},o.v_dx_from_px=function(e,n){const o=e.frame.bbox.x_view.v_compute(n);return e.frame.x_scale.v_invert(o)},o.v_dy_from_py=function(e,n){const o=e.frame.bbox.y_view.v_compute(n);return e.frame.y_scale.v_invert(o)},o.v_sx_from_dx=function(e,n){return e.frame.x_scale.v_compute(n)},o.v_sy_from_dy=function(e,n){return e.frame.y_scale.v_compute(n)}},
56
+ "01959f25a3": function _(e,o,l,s,t){var c;s();const _=e("@bokehjs/models/tools/actions/reset_tool"),i=e("@bokehjs/styles/icons.css"),a=e("@bokehjs/core/util/callbacks");class n extends _.ResetToolView{doit(){const{precallback:e,postcallback:o}=this.model;null!=e&&(0,a.execute)(e,this.model),this.plot_view.reset(),null!=o&&(0,a.execute)(o,this.model)}}l.CBResetToolView=n,n.__name__="CBResetToolView";class r extends _.ResetTool{constructor(e){super(e),this.tool_name="CBReset",this.tool_icon=i.tool_icon_reset}}l.CBResetTool=r,c=r,r.__name__="CBResetTool",r.__module__="cubevis.bokeh.tools._cbreset_tool",c.prototype.default_view=n,c.define((({Any:e,Nullable:o})=>({precallback:[o(e),null],postcallback:[o(e),null]}))),c.register_alias("cbreset",(()=>new c))},
57
+ "9f961622ce": function _(e,t,i,o,s){var n;o();const l=e("@bokehjs/models/widgets/abstract_button"),c=e("@bokehjs/models/ui/tooltip"),d=e("@bokehjs/models/ui/icons/builtin_icon"),u=e("@bokehjs/core/build_views"),h=e("@bokehjs/core/bokeh_events"),r=e("@bokehjs/core/util/object");class a extends l.AbstractButtonView{constructor(){super(...arguments),this.isMouseInside=!1}click(){this.model.trigger_event(new h.ButtonClick),super.click()}*children(){yield*super.children(),yield this.tooltip}Show(){this.tooltip.model.setv({visible:!0,closable:!1})}unShow(){this.tooltip.model.setv({visible:!1,closable:!1})}async lazy_initialize(){const{hover_wait:e}=this.model;this.debouncedShow=casalib.debounce((()=>{this.isMouseInside&&this.Show()}),1e3*e),await super.lazy_initialize();const{tooltip:t}=this.model;this.tooltip=await(0,u.build_view)(t,{parent:this})}remove(){this.tooltip.remove(),super.remove()}render(){super.render(),this.el.addEventListener("mouseenter",(()=>{this.isMouseInside=!0,this.debouncedShow()})),this.el.addEventListener("mouseleave",(()=>{this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),document.addEventListener("mousedown",(e=>{if(void 0===(0,r.dict)(this.model.js_event_callbacks).get(h.ButtonClick.prototype.event_name)){if(e.composedPath().includes(this.tooltip.el))return;this.debouncedShow.cancel(),this.unShow()}else this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),window.addEventListener("blur",(()=>{this.debouncedShow.cancel(),this.unShow()}))}}i.TipButtonView=a,a.__name__="TipButtonView";class b extends l.AbstractButton{constructor(e){super(e)}on_click(e){this.on_event(h.ButtonClick,e)}}i.TipButton=b,n=b,b.__name__="TipButton",b.__module__="cubevis.bokeh.models._tip_button",n.prototype.default_view=a,n.define((({Ref:e,Number:t})=>({tooltip:[e(c.Tooltip)],hover_wait:[t,1.5]}))),n.override({label:"",icon:new d.BuiltinIcon({icon_name:"help",size:18}),button_type:"default"})},
58
+ "ca4c845905": function _(e,i,s,t,o){var l;t();const d=e("@bokehjs/models/layouts/layout_dom"),n=e("@bokehjs/models/ui/ui_element"),h=e("@bokehjs/models/ui/tooltip"),r=e("@bokehjs/core/dom"),a=e("@bokehjs/core/build_views");class c extends d.LayoutDOMView{constructor(){super(...arguments),this.isMouseInside=!1}stylesheets(){return[...super.stylesheets(),"*, *:before, *:after { box-sizing: border-box; } fieldset { border: 0px; margin: 0px; padding: 0px; }"]}Show(){this.tooltip.model.setv({visible:!0,closable:!1})}unShow(){this.tooltip.model.setv({visible:!1,closable:!1})}async lazy_initialize(){const{hover_wait:e}=this.model;this.debouncedShow=casalib.debounce((()=>{this.isMouseInside&&this.Show()}),1e3*e),await super.lazy_initialize(),await this.build_child_views();const{tooltip:i}=this.model;this.tooltip=await(0,a.build_view)(i,{parent:this})}remove(){this.tooltip.remove(),super.remove()}connect_signals(){super.connect_signals();const{child:e}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.el.addEventListener("mouseenter",(e=>{this.mouseenter.emit(e)})),this.el.addEventListener("mouseleave",(e=>{this.mouseleave.emit(e)}))}*children(){yield*super.children(),yield this.tooltip}get child_models(){return[this.model.child]}render(){super.render(),this.el.addEventListener("mouseenter",(()=>{this.isMouseInside=!0,this.debouncedShow()})),this.el.addEventListener("mouseleave",(()=>{this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),window.addEventListener("blur",(()=>{this.debouncedShow.cancel(),this.unShow()})),this.el.addEventListener("click",(()=>{this.debouncedShow.cancel(),this.unShow()}));const e=this.child_views.map((e=>e.el));this.fieldset_el=(0,r.fieldset)({},...e),this.shadow_el.appendChild(this.fieldset_el)}_update_children(){const e=this.child_views.map((e=>e.el));this.fieldset_el.append(...e)}}s.TipView=c,c.__name__="TipView";class u extends d.LayoutDOM{constructor(e){super(e)}}s.Tip=u,l=u,u.__name__="Tip",u.__module__="cubevis.bokeh.models._tip",l.prototype.default_view=c,l.define((({Ref:e,Number:i})=>({child:[e(n.UIElement)],tooltip:[e(h.Tooltip)],hover_wait:[i,1.5]})))},
59
+ "b55081402e": function _(e,n,t,_,s){var a;_();const o=e("@bokehjs/models/annotations/span"),p=e("@bokehjs/core/bokeh_events");class r extends o.SpanView{on_pan_start(e){const n=super.on_pan_start(e);return this.model.trigger_event(new p.LODStart),n}on_pan(e){super.on_pan(e)}on_pan_end(e){super.on_pan_end(e),this.model.trigger_event(new p.LODEnd)}}t.EditSpanView=r,r.__name__="EditSpanView";class d extends o.Span{constructor(e){super(e)}}t.EditSpan=d,a=d,d.__name__="EditSpan",d.__module__="cubevis.bokeh.models._edit_span",a.prototype.default_view=r},
60
+ "9144bfc7a5": function _(e,t,s,n,r){var i;n();const l=e("@bokehjs/models/widgets/text_input"),o=e("@bokehjs/core/dom"),u=e("@bokehjs/core/bokeh_events");class _ extends l.TextInputView{stylesheets(){return[...super.stylesheets(),new o.InlineStyleSheet(".bk-input-prefix { padding: 0 var(--padding-vertical); }")]}connect_signals(){super.connect_signals(),this.el.addEventListener("mouseenter",(e=>{this.model.trigger_event(new u.MouseEnter(e.screenX,e.screenY,e.x,e.y,{shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey}))})),this.el.addEventListener("mouseleave",(e=>{this.model.trigger_event(new u.MouseLeave(e.screenX,e.screenY,e.x,e.y,{shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey}))}))}render(){super.render()}}s.EvTextInputView=_,_.__name__="EvTextInputView";class c extends l.TextInput{constructor(e){super(e)}}s.EvTextInput=c,i=c,c.__name__="EvTextInput",c.__module__="cubevis.bokeh.models._ev_text_input",i.prototype.default_view=_},
61
+ "74e0abef8a": function _(e,t,n,s,o){var i;s();const r=e("@bokehjs/models/annotations/poly_annotation"),a=e("@bokehjs/core/bokeh_events");class _ extends r.PolyAnnotationView{on_enter(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.MouseEnter(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt}),o=super.on_enter(e);return this.model.trigger_event(s),o}on_leave(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.MouseLeave(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt});super.on_leave(e),this.model.trigger_event(s)}on_pan_start(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.PanStart(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt}),o=super.on_pan_start(e);return this.model.trigger_event(s),o}on_pan_end(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.PanEnd(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt});super.on_pan_end(e),this.model.trigger_event(s)}on_pan(e){super.on_pan(e);const t=new a.RangesUpdate(e.sx,e.sx+e.dx,e.sy,e.sy+e.dy);this.model.trigger_event(t)}}n.EvPolyAnnotationView=_,_.__name__="EvPolyAnnotationView";class l extends r.PolyAnnotation{constructor(e){super(e)}}n.EvPolyAnnotation=l,i=l,l.__name__="EvPolyAnnotation",l.__module__="cubevis.bokeh.annotations._ev_poly_annotation",i.prototype.default_view=_},
62
+ }, "de17b915c5", {"index":"de17b915c5","src/bokeh/sources/data_pipe":"b33e822163","src/bokeh/util/conversions":"e3901fa9f2","src/bokeh/sources/image_pipe":"2889e0dd45","src/bokeh/sources/image_data_source":"de65005924","src/bokeh/sources/spectra_data_source":"02e3c3e46c","src/bokeh/sources/updatable_data_source":"64b16deff9","src/bokeh/format/wcs_ticks":"b6ae454f0d","src/bokeh/tools/drag_tool":"cb7d28d6b3","src/bokeh/events":"949501ff1c","src/bokeh/util/find":"15b954190c","src/bokeh/tools/cbreset_tool":"01959f25a3","src/bokeh/models/tip_button":"9f961622ce","src/bokeh/models/tip":"ca4c845905","src/bokeh/models/edit_span":"b55081402e","src/bokeh/models/ev_text_input":"9144bfc7a5","src/bokeh/annotations/ev_poly_annotation":"74e0abef8a"}, {});});
cubevis/__version__.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = '0.5.2'
@@ -0,0 +1,44 @@
1
+ ########################################################################
2
+ #
3
+ # Copyright (C) 2022,2024
4
+ # Associated Universities, Inc. Washington DC, USA.
5
+ #
6
+ # This script is free software; you can redistribute it and/or modify it
7
+ # under the terms of the GNU Library General Public License as published by
8
+ # the Free Software Foundation; either version 2 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This library is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14
+ # License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Library General Public License
17
+ # along with this library; if not, write to the Free Software Foundation,
18
+ # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19
+ #
20
+ # Correspondence concerning AIPS++ should be adressed as follows:
21
+ # Internet email: casa-feedback@nrao.edu.
22
+ # Postal address: AIPS++ Project Office
23
+ # National Radio Astronomy Observatory
24
+ # 520 Edgemont Road
25
+ # Charlottesville, VA 22903-2475 USA
26
+ #
27
+ ########################################################################
28
+ # pylint: disable=wrong-import-position
29
+ '''End user applications supplied by ``cubevis``.'''
30
+ import sys
31
+ from ..utils import copydoc, ImportProtectedModule
32
+ from ..bokeh.state import initialize_session
33
+ initialize_session()
34
+
35
+ sys.modules[__name__].__class__ = ImportProtectedModule( __name__, { 'plotants': '._plotants',
36
+ 'plotbandpass': '._plotbandpass',
37
+ 'CreateMask': '._createmask',
38
+ 'CreateRegion': '._createregion',
39
+ 'InteractiveClean': '._interactiveclean',
40
+ 'iclean': '..private.casatasks.iclean',
41
+ 'createmask': '..private.casatasks.createmask',
42
+ 'createregion': '..private.casatasks.createregion',
43
+ 'MsRaster': '._ms_raster',
44
+ } )