oncoprintjs 5.0.4 → 6.0.0

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 (100) hide show
  1. package/README.md +34 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.es.js +14731 -0
  4. package/dist/index.es.js.map +1 -0
  5. package/dist/index.js +14745 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/js/CachedProperty.d.ts +10 -10
  8. package/dist/js/binarysearch.d.ts +1 -1
  9. package/dist/js/bucketsort.d.ts +16 -16
  10. package/dist/js/clustering.d.ts +14 -14
  11. package/dist/js/extractrgba.d.ts +4 -4
  12. package/dist/js/haselementsininterval.d.ts +1 -1
  13. package/dist/js/heatmapcolors.d.ts +5 -4
  14. package/dist/js/makesvgelement.d.ts +1 -1
  15. package/dist/js/modelutils.d.ts +7 -7
  16. package/dist/js/oncoprint.d.ts +168 -170
  17. package/dist/js/oncoprintheaderview.d.ts +23 -22
  18. package/dist/js/oncoprintlabelview.d.ts +79 -78
  19. package/dist/js/oncoprintlegendrenderer.d.ts +32 -31
  20. package/dist/js/oncoprintminimapview.d.ts +69 -68
  21. package/dist/js/oncoprintmodel.d.ts +400 -398
  22. package/dist/js/oncoprintruleset.d.ts +176 -177
  23. package/dist/js/oncoprintshape.d.ts +67 -67
  24. package/dist/js/oncoprintshapetosvg.d.ts +2 -2
  25. package/dist/js/oncoprintshapetovertexes.d.ts +5 -5
  26. package/dist/js/oncoprinttooltip.d.ts +23 -22
  27. package/dist/js/oncoprinttrackinfoview.d.ts +40 -39
  28. package/dist/js/oncoprinttrackoptionsview.d.ts +58 -57
  29. package/dist/js/oncoprintwebglcellview.d.ts +168 -167
  30. package/dist/js/oncoprintzoomslider.d.ts +28 -27
  31. package/dist/js/polyfill.d.ts +4 -4
  32. package/dist/js/precomputedcomparator.d.ts +13 -13
  33. package/dist/js/shaders.d.ts +2 -2
  34. package/dist/js/svgfactory.d.ts +24 -23
  35. package/dist/js/utils.d.ts +16 -16
  36. package/dist/js/workers/clustering-worker.d.ts +19 -20
  37. package/dist/test/gradientCategoricalRuleset.spec.d.ts +1 -1
  38. package/dist/test/monolith.spec.d.ts +1 -1
  39. package/jest.config.ts +2 -0
  40. package/package.json +20 -26
  41. package/rollup.config.ts +14 -0
  42. package/rules/geneticrules.ts +344 -305
  43. package/server.js +11 -0
  44. package/src/img/menudots.svg +9 -9
  45. package/src/img/zoomtofit.svg +12 -12
  46. package/src/index.tsx +13 -0
  47. package/src/js/CachedProperty.ts +6 -7
  48. package/src/js/binarysearch.ts +8 -3
  49. package/src/js/bucketsort.ts +89 -47
  50. package/src/js/clustering.ts +22 -10
  51. package/src/js/extractrgba.ts +16 -12
  52. package/src/js/haselementsininterval.ts +8 -4
  53. package/src/js/heatmapcolors.ts +515 -515
  54. package/src/js/main.js +1 -1
  55. package/src/js/makesvgelement.ts +2 -2
  56. package/src/js/modelutils.ts +11 -8
  57. package/src/js/oncoprint.ts +706 -385
  58. package/src/js/oncoprintheaderview.ts +165 -125
  59. package/src/js/oncoprintlabelview.ts +388 -170
  60. package/src/js/oncoprintlegendrenderer.ts +203 -72
  61. package/src/js/oncoprintminimapview.ts +965 -423
  62. package/src/js/oncoprintmodel.ts +892 -530
  63. package/src/js/oncoprintruleset.ts +694 -379
  64. package/src/js/oncoprintshape.ts +240 -97
  65. package/src/js/oncoprintshapetosvg.ts +77 -26
  66. package/src/js/oncoprintshapetovertexes.ts +153 -48
  67. package/src/js/oncoprinttooltip.ts +58 -27
  68. package/src/js/oncoprinttrackinfoview.ts +115 -59
  69. package/src/js/oncoprinttrackoptionsview.ts +353 -187
  70. package/src/js/oncoprintwebglcellview.ts +951 -415
  71. package/src/js/oncoprintzoomslider.ts +172 -107
  72. package/src/js/polyfill.ts +7 -3
  73. package/src/js/precomputedcomparator.ts +133 -50
  74. package/src/js/shaders.ts +2 -4
  75. package/src/js/svgfactory.ts +128 -73
  76. package/src/js/utils.ts +51 -31
  77. package/src/js/workers/clustering-worker.ts +50 -42
  78. package/src/test/gradientCategoricalRuleset.spec.ts +55 -38
  79. package/src/test/monolith.spec.ts +718 -285
  80. package/test/generate_data.py +108 -0
  81. package/test/glyphmap-data.js +1041 -0
  82. package/test/heatmap-data.js +1027 -0
  83. package/test/index.html +21 -0
  84. package/test/oncoprint-glyphmap.js +79 -0
  85. package/test/oncoprint-heatmap.js +123 -0
  86. package/tsconfig.json +4 -10
  87. package/tsconfig.test.json +11 -0
  88. package/.idea/misc.xml +0 -6
  89. package/.idea/modules.xml +0 -8
  90. package/.idea/oncoprintjs.iml +0 -12
  91. package/.idea/vcs.xml +0 -6
  92. package/.idea/workspace.xml +0 -105
  93. package/dist/.gitkeep +0 -0
  94. package/dist/js/minimaputils.d.ts +0 -0
  95. package/dist/oncoprint.bundle.js +0 -33
  96. package/jest.config.js +0 -12
  97. package/src/js/minimaputils.ts +0 -0
  98. package/typings/custom.d.ts +0 -7
  99. package/typings/missing.d.ts +0 -7
  100. package/webpack.config.js +0 -43
@@ -1,33 +0,0 @@
1
- module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=18)}([function(t,e,n){var r;
2
- /*!
3
- * jQuery JavaScript Library v3.5.0
4
- * https://jquery.com/
5
- *
6
- * Includes Sizzle.js
7
- * https://sizzlejs.com/
8
- *
9
- * Copyright JS Foundation and other contributors
10
- * Released under the MIT license
11
- * https://jquery.org/license
12
- *
13
- * Date: 2020-04-10T15:07Z
14
- */!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],s=Object.getPrototypeOf,a=o.slice,l=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},u=o.push,c=o.indexOf,h={},f=h.toString,d=h.hasOwnProperty,p=d.toString,g=p.call(Object),m={},_=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},v=function(t){return null!=t&&t===t.window},b=n.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function y(t,e,n){var r,i,o=(n=n||b).createElement("script");if(o.text=t,e)for(r in x)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[f.call(t)]||"object":typeof t}var k=function(t,e){return new k.fn.init(t,e)};function S(t){var e=!!t&&"length"in t&&t.length,n=w(t);return!_(t)&&!v(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}k.fn=k.prototype={jquery:"3.5.0",constructor:k,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=k.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return k.each(this,t)},map:function(t){return this.pushStack(k.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(k.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:o.sort,splice:o.splice},k.extend=k.fn.extend=function(){var t,e,n,r,i,o,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||_(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)r=t[e],"__proto__"!==e&&s!==r&&(u&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[e],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,s[e]=k.extend(u,o,r)):void 0!==r&&(s[e]=r));return s},k.extend({expando:"jQuery"+("3.5.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==f.call(t))&&(!(e=s(t))||"function"==typeof(n=d.call(e,"constructor")&&e.constructor)&&p.call(n)===g)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){y(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(S(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(S(Object(t))?k.merge(n,"string"==typeof t?[t]:t):u.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:c.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;r<n;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r=[],i=0,o=t.length,s=!n;i<o;i++)!e(t[i],i)!==s&&r.push(t[i]);return r},map:function(t,e,n){var r,i,o=0,s=[];if(S(t))for(r=t.length;o<r;o++)null!=(i=e(t[o],o,n))&&s.push(i);else for(o in t)null!=(i=e(t[o],o,n))&&s.push(i);return l(s)},guid:1,support:m}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=o[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){h["[object "+e+"]"]=e.toLowerCase()}));var M=
15
- /*!
16
- * Sizzle CSS Selector Engine v2.3.5
17
- * https://sizzlejs.com/
18
- *
19
- * Copyright JS Foundation and other contributors
20
- * Released under the MIT license
21
- * https://js.foundation/
22
- *
23
- * Date: 2020-03-14
24
- */
25
- function(t){var e,n,r,i,o,s,a,l,u,c,h,f,d,p,g,m,_,v,b,x="sizzle"+1*new Date,y=t.document,w=0,k=0,S=lt(),M=lt(),T=lt(),I=lt(),A=function(t,e){return t===e&&(h=!0),0},C={}.hasOwnProperty,D=[],z=D.pop,R=D.push,L=D.push,E=D.slice,O=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",N="[\\x20\\t\\r\\n\\f]",P="(?:\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",H="\\["+N+"*("+P+")(?:"+N+"*([*^$|!~]?=)"+N+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+N+"*\\]",j=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",V=new RegExp(N+"+","g"),$=new RegExp("^"+N+"+|((?:^|[^\\\\])(?:\\\\.)*)"+N+"+$","g"),B=new RegExp("^"+N+"*,"+N+"*"),G=new RegExp("^"+N+"*([>+~]|"+N+")"+N+"*"),q=new RegExp(N+"|>"),W=new RegExp(j),U=new RegExp("^"+P+"$"),Z={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){f()},st=xt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(D=E.call(y.childNodes),y.childNodes),D[y.childNodes.length].nodeType}catch(t){L={apply:D.length?function(t,e){R.apply(t,E.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function at(t,e,r,i){var o,a,u,c,h,p,_,v=e&&e.ownerDocument,y=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==y&&9!==y&&11!==y)return r;if(!i&&(f(e),e=e||d,g)){if(11!==y&&(h=K.exec(t)))if(o=h[1]){if(9===y){if(!(u=e.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(v&&(u=v.getElementById(o))&&b(e,u)&&u.id===o)return r.push(u),r}else{if(h[2])return L.apply(r,e.getElementsByTagName(t)),r;if((o=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return L.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!I[t+" "]&&(!m||!m.test(t))&&(1!==y||"object"!==e.nodeName.toLowerCase())){if(_=t,v=e,1===y&&(q.test(t)||G.test(t))){for((v=tt.test(t)&&_t(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(rt,it):e.setAttribute("id",c=x)),a=(p=s(t)).length;a--;)p[a]=(c?"#"+c:":scope")+" "+bt(p[a]);_=p.join(",")}try{return L.apply(r,v.querySelectorAll(_)),r}catch(e){I(t,!0)}finally{c===x&&e.removeAttribute("id")}}}return l(t.replace($,"$1"),e,r,i)}function lt(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ut(t){return t[x]=!0,t}function ct(t){var e=d.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function ft(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function dt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function gt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&st(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ut((function(e){return e=+e,ut((function(n,r){for(var i,o=t([],n.length,e),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function _t(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},o=at.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!Y.test(e||n&&n.nodeName||"HTML")},f=at.setDocument=function(t){var e,i,s=t?t.ownerDocument||t:y;return s!=d&&9===s.nodeType&&s.documentElement?(p=(d=s).documentElement,g=!o(d),y!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=ct((function(t){return p.appendChild(t).appendChild(d.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ct((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ct((function(t){return t.appendChild(d.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ct((function(t){return p.appendChild(t).id=x,!d.getElementsByName||!d.getElementsByName(x).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&g)return e.getElementsByClassName(t)},_=[],m=[],(n.qsa=Q.test(d.querySelectorAll))&&(ct((function(t){var e;p.appendChild(t).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+N+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+N+"*(?:value|"+F+")"),t.querySelectorAll("[id~="+x+"-]").length||m.push("~="),(e=d.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+N+"*name"+N+"*="+N+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+x+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")})),ct((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=d.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+N+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=Q.test(v=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ct((function(t){n.disconnectedMatch=v.call(t,"*"),v.call(t,"[s!='']:x"),_.push("!=",j)})),m=m.length&&new RegExp(m.join("|")),_=_.length&&new RegExp(_.join("|")),e=Q.test(p.compareDocumentPosition),b=e||Q.test(p.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},A=e?function(t,e){if(t===e)return h=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==d||t.ownerDocument==y&&b(y,t)?-1:e==d||e.ownerDocument==y&&b(y,e)?1:c?O(c,t)-O(c,e):0:4&r?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,s=[t],a=[e];if(!i||!o)return t==d?-1:e==d?1:i?-1:o?1:c?O(c,t)-O(c,e):0;if(i===o)return ft(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[r]===a[r];)r++;return r?ft(s[r],a[r]):s[r]==y?-1:a[r]==y?1:0},d):d},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(f(t),n.matchesSelector&&g&&!I[e+" "]&&(!_||!_.test(e))&&(!m||!m.test(e)))try{var r=v.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){I(e,!0)}return at(e,d,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=d&&f(t),b(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=d&&f(t);var i=r.attrHandle[e.toLowerCase()],o=i&&C.call(r.attrHandle,e.toLowerCase())?i(t,e,!g):void 0;return void 0!==o?o:n.attributes||!g?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},at.escape=function(t){return(t+"").replace(rt,it)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,r=[],i=0,o=0;if(h=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(A),h){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return c=null,t},i=at.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=at.selectors={cacheLength:50,createPseudo:ut,match:Z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Z.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&W.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|"+N+")"+t+"("+N+"|$)"))&&S(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=at.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var u,c,h,f,d,p,g=o!==s?"nextSibling":"previousSibling",m=e.parentNode,_=a&&e.nodeName.toLowerCase(),v=!l&&!a,b=!1;if(m){if(o){for(;g;){for(f=e;f=f[g];)if(a?f.nodeName.toLowerCase()===_:1===f.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?m.firstChild:m.lastChild],s&&v){for(b=(d=(u=(c=(h=(f=m)[x]||(f[x]={}))[f.uniqueID]||(h[f.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(b=d=0)||p.pop();)if(1===f.nodeType&&++b&&f===e){c[t]=[w,d,b];break}}else if(v&&(b=d=(u=(c=(h=(f=e)[x]||(f[x]={}))[f.uniqueID]||(h[f.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===b)for(;(f=++d&&f&&f[g]||(b=d=0)||p.pop())&&((a?f.nodeName.toLowerCase()!==_:1!==f.nodeType)||!++b||(v&&((c=(h=f[x]||(f[x]={}))[f.uniqueID]||(h[f.uniqueID]={}))[t]=[w,b]),f!==e)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return i[x]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ut((function(t,n){for(var r,o=i(t,e),s=o.length;s--;)t[r=O(t,o[s])]=!(n[r]=o[s])})):function(t){return i(t,0,n)}):i}},pseudos:{not:ut((function(t){var e=[],n=[],r=a(t.replace($,"$1"));return r[x]?ut((function(t,e,n,i){for(var o,s=r(t,null,i,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:ut((function(t){return function(e){return at(t,e).length>0}})),contains:ut((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:ut((function(t){return U.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=g?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:gt(!1),disabled:gt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:mt((function(){return[0]})),last:mt((function(t,e){return[e-1]})),eq:mt((function(t,e,n){return[n<0?n+e:n]})),even:mt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:mt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:mt((function(t,e,n){for(var r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t})),gt:mt((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[e]=dt(e);for(e in{submit:!0,reset:!0})r.pseudos[e]=pt(e);function vt(){}function bt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function xt(t,e,n){var r=e.dir,i=e.next,o=i||r,s=n&&"parentNode"===o,a=k++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||s)return t(e,n,i);return!1}:function(e,n,l){var u,c,h,f=[w,a];if(l){for(;e=e[r];)if((1===e.nodeType||s)&&t(e,n,l))return!0}else for(;e=e[r];)if(1===e.nodeType||s)if(c=(h=e[x]||(e[x]={}))[e.uniqueID]||(h[e.uniqueID]={}),i&&i===e.nodeName.toLowerCase())e=e[r]||e;else{if((u=c[o])&&u[0]===w&&u[1]===a)return f[2]=u[2];if(c[o]=f,f[2]=t(e,n,l))return!0}return!1}}function yt(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function wt(t,e,n,r,i){for(var o,s=[],a=0,l=t.length,u=null!=e;a<l;a++)(o=t[a])&&(n&&!n(o,r,i)||(s.push(o),u&&e.push(a)));return s}function kt(t,e,n,r,i,o){return r&&!r[x]&&(r=kt(r)),i&&!i[x]&&(i=kt(i,o)),ut((function(o,s,a,l){var u,c,h,f=[],d=[],p=s.length,g=o||function(t,e,n){for(var r=0,i=e.length;r<i;r++)at(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),m=!t||!o&&e?g:wt(g,f,t,a,l),_=n?i||(o?t:p||r)?[]:s:m;if(n&&n(m,_,a,l),r)for(u=wt(_,d),r(u,[],a,l),c=u.length;c--;)(h=u[c])&&(_[d[c]]=!(m[d[c]]=h));if(o){if(i||t){if(i){for(u=[],c=_.length;c--;)(h=_[c])&&u.push(m[c]=h);i(null,_=[],u,l)}for(c=_.length;c--;)(h=_[c])&&(u=i?O(o,h):f[c])>-1&&(o[u]=!(s[u]=h))}}else _=wt(_===s?_.splice(p,_.length):_),i?i(null,s,_,l):L.apply(s,_)}))}function St(t){for(var e,n,i,o=t.length,s=r.relative[t[0].type],a=s||r.relative[" "],l=s?1:0,c=xt((function(t){return t===e}),a,!0),h=xt((function(t){return O(e,t)>-1}),a,!0),f=[function(t,n,r){var i=!s&&(r||n!==u)||((e=n).nodeType?c(t,n,r):h(t,n,r));return e=null,i}];l<o;l++)if(n=r.relative[t[l].type])f=[xt(yt(f),n)];else{if((n=r.filter[t[l].type].apply(null,t[l].matches))[x]){for(i=++l;i<o&&!r.relative[t[i].type];i++);return kt(l>1&&yt(f),l>1&&bt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace($,"$1"),n,l<i&&St(t.slice(l,i)),i<o&&St(t=t.slice(i)),i<o&&bt(t))}f.push(n)}return yt(f)}return vt.prototype=r.filters=r.pseudos,r.setFilters=new vt,s=at.tokenize=function(t,e){var n,i,o,s,a,l,u,c=M[t+" "];if(c)return e?0:c.slice(0);for(a=t,l=[],u=r.preFilter;a;){for(s in n&&!(i=B.exec(a))||(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),n=!1,(i=G.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace($," ")}),a=a.slice(n.length)),r.filter)!(i=Z[s].exec(a))||u[s]&&!(i=u[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):M(t,l).slice(0)},a=at.compile=function(t,e){var n,i=[],o=[],a=T[t+" "];if(!a){for(e||(e=s(t)),n=e.length;n--;)(a=St(e[n]))[x]?i.push(a):o.push(a);(a=T(t,function(t,e){var n=e.length>0,i=t.length>0,o=function(o,s,a,l,c){var h,p,m,_=0,v="0",b=o&&[],x=[],y=u,k=o||i&&r.find.TAG("*",c),S=w+=null==y?1:Math.random()||.1,M=k.length;for(c&&(u=s==d||s||c);v!==M&&null!=(h=k[v]);v++){if(i&&h){for(p=0,s||h.ownerDocument==d||(f(h),a=!g);m=t[p++];)if(m(h,s||d,a)){l.push(h);break}c&&(w=S)}n&&((h=!m&&h)&&_--,o&&b.push(h))}if(_+=v,n&&v!==_){for(p=0;m=e[p++];)m(b,x,s,a);if(o){if(_>0)for(;v--;)b[v]||x[v]||(x[v]=z.call(l));x=wt(x)}L.apply(l,x),c&&!o&&x.length>0&&_+e.length>1&&at.uniqueSort(l)}return c&&(w=S,u=y),b};return n?ut(o):o}(o,i))).selector=t}return a},l=at.select=function(t,e,n,i){var o,l,u,c,h,f="function"==typeof t&&t,d=!i&&s(t=f.selector||t);if(n=n||[],1===d.length){if((l=d[0]=d[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===e.nodeType&&g&&r.relative[l[1].type]){if(!(e=(r.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;f&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=Z.needsContext.test(t)?0:l.length;o--&&(u=l[o],!r.relative[c=u.type]);)if((h=r.find[c])&&(i=h(u.matches[0].replace(et,nt),tt.test(l[0].type)&&_t(e.parentNode)||e))){if(l.splice(o,1),!(t=i.length&&bt(l)))return L.apply(n,i),n;break}}return(f||a(t,d))(i,e,!g,n,!e||tt.test(t)&&_t(e.parentNode)||e),n},n.sortStable=x.split("").sort(A).join("")===x,n.detectDuplicates=!!h,f(),n.sortDetached=ct((function(t){return 1&t.compareDocumentPosition(d.createElement("fieldset"))})),ct((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ht("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ct((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ht("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ct((function(t){return null==t.getAttribute("disabled")}))||ht(F,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),at}(n);k.find=M,k.expr=M.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=M.uniqueSort,k.text=M.getText,k.isXMLDoc=M.isXML,k.contains=M.contains,k.escapeSelector=M.escape;var T=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&k(t).is(n))break;r.push(t)}return r},I=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},A=k.expr.match.needsContext;function C(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function z(t,e,n){return _(e)?k.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?k.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?k.grep(t,(function(t){return c.call(e,t)>-1!==n})):k.filter(e,t,n)}k.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?k.find.matchesSelector(r,t)?[r]:[]:k.find.matches(t,k.grep(e,(function(t){return 1===t.nodeType})))},k.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(k(t).filter((function(){for(e=0;e<r;e++)if(k.contains(i[e],this))return!0})));for(n=this.pushStack([]),e=0;e<r;e++)k.find(t,i[e],n);return r>1?k.uniqueSort(n):n},filter:function(t){return this.pushStack(z(this,t||[],!1))},not:function(t){return this.pushStack(z(this,t||[],!0))},is:function(t){return!!z(this,"string"==typeof t&&A.test(t)?k(t):t||[],!1).length}});var R,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||R,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:L.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof k?e[0]:e,k.merge(this,k.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),D.test(r[1])&&k.isPlainObject(e))for(r in e)_(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):_(t)?void 0!==n.ready?n.ready(t):t(k):k.makeArray(t,this)}).prototype=k.fn,R=k(b);var E=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function F(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}k.fn.extend({has:function(t){var e=k(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(k.contains(this,e[t]))return!0}))},closest:function(t,e){var n,r=0,i=this.length,o=[],s="string"!=typeof t&&k(t);if(!A.test(t))for(;r<i;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&k.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?k.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?c.call(k(t),this[0]):c.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),k.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return T(t,"parentNode")},parentsUntil:function(t,e,n){return T(t,"parentNode",n)},next:function(t){return F(t,"nextSibling")},prev:function(t){return F(t,"previousSibling")},nextAll:function(t){return T(t,"nextSibling")},prevAll:function(t){return T(t,"previousSibling")},nextUntil:function(t,e,n){return T(t,"nextSibling",n)},prevUntil:function(t,e,n){return T(t,"previousSibling",n)},siblings:function(t){return I((t.parentNode||{}).firstChild,t)},children:function(t){return I(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(C(t,"template")&&(t=t.content||t),k.merge([],t.childNodes))}},(function(t,e){k.fn[t]=function(n,r){var i=k.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=k.filter(r,i)),this.length>1&&(O[t]||k.uniqueSort(i),E.test(t)&&i.reverse()),this.pushStack(i)}}));var N=/[^\x20\t\r\n\f]+/g;function P(t){return t}function H(t){throw t}function j(t,e,n,r){var i;try{t&&_(i=t.promise)?i.call(t).done(e).fail(n):t&&_(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}k.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return k.each(t.match(N)||[],(function(t,n){e[n]=!0})),e}(t):k.extend({},t);var e,n,r,i,o=[],s=[],a=-1,l=function(){for(i=i||t.once,r=e=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=o.length,n=!1);t.memory||(n=!1),e=!1,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!e&&(a=o.length-1,s.push(n)),function e(n){k.each(n,(function(n,r){_(r)?t.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==w(r)&&e(r)}))}(arguments),n&&!e&&l()),this},remove:function(){return k.each(arguments,(function(t,e){for(var n;(n=k.inArray(e,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(t){return t?k.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},k.extend({Deferred:function(t){var e=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return k.Deferred((function(n){k.each(e,(function(e,r){var i=_(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&_(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,i){var o=0;function s(t,e,r,i){return function(){var a=this,l=arguments,u=function(){var n,u;if(!(t<o)){if((n=r.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");u=n&&("object"==typeof n||"function"==typeof n)&&n.then,_(u)?i?u.call(n,s(o,e,P,i),s(o,e,H,i)):(o++,u.call(n,s(o,e,P,i),s(o,e,H,i),s(o,e,P,e.notifyWith))):(r!==P&&(a=void 0,l=[n]),(i||e.resolveWith)(a,l))}},c=i?u:function(){try{u()}catch(n){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(n,c.stackTrace),t+1>=o&&(r!==H&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?c():(k.Deferred.getStackHook&&(c.stackTrace=k.Deferred.getStackHook()),n.setTimeout(c))}}return k.Deferred((function(n){e[0][3].add(s(0,n,_(i)?i:P,n.notifyWith)),e[1][3].add(s(0,n,_(t)?t:P)),e[2][3].add(s(0,n,_(r)?r:H))})).promise()},promise:function(t){return null!=t?k.extend(t,i):i}},o={};return k.each(e,(function(t,n){var s=n[2],a=n[5];i[n[1]]=s.add,a&&s.add((function(){r=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=a.call(arguments),o=k.Deferred(),s=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?a.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(j(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||_(i[n]&&i[n].then)))return o.then();for(;n--;)j(i[n],s(n),o.reject);return o.promise()}});var V=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&V.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},k.readyException=function(t){n.setTimeout((function(){throw t}))};var $=k.Deferred();function B(){b.removeEventListener("DOMContentLoaded",B),n.removeEventListener("load",B),k.ready()}k.fn.ready=function(t){return $.then(t).catch((function(t){k.readyException(t)})),this},k.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==t&&--k.readyWait>0||$.resolveWith(b,[k]))}}),k.ready.then=$.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?n.setTimeout(k.ready):(b.addEventListener("DOMContentLoaded",B),n.addEventListener("load",B));var G=function(t,e,n,r,i,o,s){var a=0,l=t.length,u=null==n;if("object"===w(n))for(a in i=!0,n)G(t,e,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,_(r)||(s=!0),u&&(s?(e.call(t,r),e=null):(u=e,e=function(t,e,n){return u.call(k(t),n)})),e))for(;a<l;a++)e(t[a],n,s?r:r.call(t[a],a,e(t[a],n)));return i?t:u?e.call(t):l?e(t[0],n):o},q=/^-ms-/,W=/-([a-z])/g;function U(t,e){return e.toUpperCase()}function Z(t){return t.replace(q,"ms-").replace(W,U)}var Y=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function X(){this.expando=k.expando+X.uid++}X.uid=1,X.prototype={cache:function(t){var e=t[this.expando];return e||(e=Object.create(null),Y(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,i=this.cache(t);if("string"==typeof e)i[Z(e)]=n;else for(r in e)i[Z(r)]=e[r];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][Z(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(Z):(e=Z(e))in r?[e]:e.match(N)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||k.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!k.isEmptyObject(e)}};var J=new X,Q=new X,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,tt=/[A-Z]/g;function et(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(tt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:K.test(t)?JSON.parse(t):t)}(n)}catch(t){}Q.set(t,e,n)}else n=void 0;return n}k.extend({hasData:function(t){return Q.hasData(t)||J.hasData(t)},data:function(t,e,n){return Q.access(t,e,n)},removeData:function(t,e){Q.remove(t,e)},_data:function(t,e,n){return J.access(t,e,n)},_removeData:function(t,e){J.remove(t,e)}}),k.fn.extend({data:function(t,e){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(i=Q.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=Z(r.slice(5)),et(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof t?this.each((function(){Q.set(this,t)})):G(this,(function(e){var n;if(o&&void 0===e)return void 0!==(n=Q.get(o,t))?n:void 0!==(n=et(o,t))?n:void 0;this.each((function(){Q.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){Q.remove(this,t)}))}}),k.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=J.get(t,e),n&&(!r||Array.isArray(n)?r=J.access(t,e,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=k.queue(t,e),r=n.length,i=n.shift(),o=k._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){k.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J.get(t,n)||J.access(t,n,{empty:k.Callbacks("once memory").add((function(){J.remove(t,[e+"queue",n])}))})}}),k.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?k.queue(this[0],t):void 0===e?this:this.each((function(){var n=k.queue(this,t,e);k._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&k.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){k.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=k.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=J.get(o[s],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(e)}});var nt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rt=new RegExp("^(?:([+-])=|)("+nt+")([a-z%]*)$","i"),it=["Top","Right","Bottom","Left"],ot=b.documentElement,st=function(t){return k.contains(t.ownerDocument,t)},at={composed:!0};ot.getRootNode&&(st=function(t){return k.contains(t.ownerDocument,t)||t.getRootNode(at)===t.ownerDocument});var lt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&st(t)&&"none"===k.css(t,"display")};function ut(t,e,n,r){var i,o,s=20,a=r?function(){return r.cur()}:function(){return k.css(t,e,"")},l=a(),u=n&&n[3]||(k.cssNumber[e]?"":"px"),c=t.nodeType&&(k.cssNumber[e]||"px"!==u&&+l)&&rt.exec(k.css(t,e));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;s--;)k.style(t,e,c+u),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),c/=o;c*=2,k.style(t,e,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var ct={};function ht(t){var e,n=t.ownerDocument,r=t.nodeName,i=ct[r];return i||(e=n.body.appendChild(n.createElement(r)),i=k.css(e,"display"),e.parentNode.removeChild(e),"none"===i&&(i="block"),ct[r]=i,i)}function ft(t,e){for(var n,r,i=[],o=0,s=t.length;o<s;o++)(r=t[o]).style&&(n=r.style.display,e?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&lt(r)&&(i[o]=ht(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<s;o++)null!=i[o]&&(t[o].style.display=i[o]);return t}k.fn.extend({show:function(){return ft(this,!0)},hide:function(){return ft(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){lt(this)?k(this).show():k(this).hide()}))}});var dt,pt,gt=/^(?:checkbox|radio)$/i,mt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,_t=/^$|^module$|\/(?:java|ecma)script/i;dt=b.createDocumentFragment().appendChild(b.createElement("div")),(pt=b.createElement("input")).setAttribute("type","radio"),pt.setAttribute("checked","checked"),pt.setAttribute("name","t"),dt.appendChild(pt),m.checkClone=dt.cloneNode(!0).cloneNode(!0).lastChild.checked,dt.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!dt.cloneNode(!0).lastChild.defaultValue,dt.innerHTML="<option></option>",m.option=!!dt.lastChild;var vt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function bt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&C(t,e)?k.merge([t],n):n}function xt(t,e){for(var n=0,r=t.length;n<r;n++)J.set(t[n],"globalEval",!e||J.get(e[n],"globalEval"))}vt.tbody=vt.tfoot=vt.colgroup=vt.caption=vt.thead,vt.th=vt.td,m.option||(vt.optgroup=vt.option=[1,"<select multiple='multiple'>","</select>"]);var yt=/<|&#?\w+;/;function wt(t,e,n,r,i){for(var o,s,a,l,u,c,h=e.createDocumentFragment(),f=[],d=0,p=t.length;d<p;d++)if((o=t[d])||0===o)if("object"===w(o))k.merge(f,o.nodeType?[o]:o);else if(yt.test(o)){for(s=s||h.appendChild(e.createElement("div")),a=(mt.exec(o)||["",""])[1].toLowerCase(),l=vt[a]||vt._default,s.innerHTML=l[1]+k.htmlPrefilter(o)+l[2],c=l[0];c--;)s=s.lastChild;k.merge(f,s.childNodes),(s=h.firstChild).textContent=""}else f.push(e.createTextNode(o));for(h.textContent="",d=0;o=f[d++];)if(r&&k.inArray(o,r)>-1)i&&i.push(o);else if(u=st(o),s=bt(h.appendChild(o),"script"),u&&xt(s),n)for(c=0;o=s[c++];)_t.test(o.type||"")&&n.push(o);return h}var kt=/^key/,St=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Mt=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function It(){return!1}function At(t,e){return t===function(){try{return b.activeElement}catch(t){}}()==("focus"===e)}function Ct(t,e,n,r,i,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(r=r||n,n=void 0),e)Ct(t,a,n,r,e[a],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=It;else if(!i)return t;return 1===o&&(s=i,(i=function(t){return k().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=k.guid++)),t.each((function(){k.event.add(this,e,i,r,n)}))}function Dt(t,e,n){n?(J.set(t,e,!1),k.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=J.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(k.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=a.call(arguments),J.set(this,e,o),r=n(this,e),this[e](),o!==(i=J.get(this,e))||r?J.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i.value}else o.length&&(J.set(this,e,{value:k.event.trigger(k.extend(o[0],k.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===J.get(t,e)&&k.event.add(t,e,Tt)}k.event={global:{},add:function(t,e,n,r,i){var o,s,a,l,u,c,h,f,d,p,g,m=J.get(t);if(Y(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ot,i),n.guid||(n.guid=k.guid++),(l=m.events)||(l=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(e){return void 0!==k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(N)||[""]).length;u--;)d=g=(a=Mt.exec(e[u])||[])[1],p=(a[2]||"").split(".").sort(),d&&(h=k.event.special[d]||{},d=(i?h.delegateType:h.bindType)||d,h=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:p.join(".")},o),(f=l[d])||((f=l[d]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,r,p,s)||t.addEventListener&&t.addEventListener(d,s)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),k.event.global[d]=!0)},remove:function(t,e,n,r,i){var o,s,a,l,u,c,h,f,d,p,g,m=J.hasData(t)&&J.get(t);if(m&&(l=m.events)){for(u=(e=(e||"").match(N)||[""]).length;u--;)if(d=g=(a=Mt.exec(e[u])||[])[1],p=(a[2]||"").split(".").sort(),d){for(h=k.event.special[d]||{},f=l[d=(r?h.delegateType:h.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;o--;)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,h.remove&&h.remove.call(t,c));s&&!f.length&&(h.teardown&&!1!==h.teardown.call(t,p,m.handle)||k.removeEvent(t,d,m.handle),delete l[d])}else for(d in l)k.event.remove(t,d+e[u],n,r,!0);k.isEmptyObject(l)&&J.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,s,a=new Array(arguments.length),l=k.event.fix(t),u=(J.get(this,"events")||Object.create(null))[l.type]||[],c=k.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(s=k.event.handlers.call(this,l,u),e=0;(i=s[e++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,r,i,o,s,a=[],l=e.delegateCount,u=t.target;if(l&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[i=(r=e[n]).selector+" "]&&(s[i]=r.needsContext?k(i,this).index(u)>-1:k.find(i,this,null,[u]).length),s[i]&&o.push(r);o.length&&a.push({elem:u,handlers:o})}return u=this,l<e.length&&a.push({elem:u,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:_(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[k.expando]?t:new k.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return gt.test(e.type)&&e.click&&C(e,"input")&&Dt(e,"click",Tt),!1},trigger:function(t){var e=this||t;return gt.test(e.type)&&e.click&&C(e,"input")&&Dt(e,"click"),!0},_default:function(t){var e=t.target;return gt.test(e.type)&&e.click&&C(e,"input")&&J.get(e,"click")||C(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},k.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},k.Event=function(t,e){if(!(this instanceof k.Event))return new k.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Tt:It,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&k.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:It,isPropagationStopped:It,isImmediatePropagationStopped:It,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Tt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Tt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Tt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&kt.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&St.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},(function(t,e){k.event.special[t]={setup:function(){return Dt(this,t,At),!1},trigger:function(){return Dt(this,t),!0},delegateType:e}})),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){k.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;return i&&(i===r||k.contains(r,i))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),k.fn.extend({on:function(t,e,n,r){return Ct(this,t,e,n,r)},one:function(t,e,n,r){return Ct(this,t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,k(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=It),this.each((function(){k.event.remove(this,t,n,e)}))}});var zt=/<script|<style|<link/i,Rt=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Et(t,e){return C(t,"table")&&C(11!==e.nodeType?e:e.firstChild,"tr")&&k(t).children("tbody")[0]||t}function Ot(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ft(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Nt(t,e){var n,r,i,o,s,a;if(1===e.nodeType){if(J.hasData(t)&&(a=J.get(t).events))for(i in J.remove(e,"handle events"),a)for(n=0,r=a[i].length;n<r;n++)k.event.add(e,i,a[i][n]);Q.hasData(t)&&(o=Q.access(t),s=k.extend({},o),Q.set(e,s))}}function Pt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&gt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Ht(t,e,n,r){e=l(e);var i,o,s,a,u,c,h=0,f=t.length,d=f-1,p=e[0],g=_(p);if(g||f>1&&"string"==typeof p&&!m.checkClone&&Rt.test(p))return t.each((function(i){var o=t.eq(i);g&&(e[0]=p.call(this,i,o.html())),Ht(o,e,n,r)}));if(f&&(o=(i=wt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=(s=k.map(bt(i,"script"),Ot)).length;h<f;h++)u=i,h!==d&&(u=k.clone(u,!0,!0),a&&k.merge(s,bt(u,"script"))),n.call(t[h],u,h);if(a)for(c=s[s.length-1].ownerDocument,k.map(s,Ft),h=0;h<a;h++)u=s[h],_t.test(u.type||"")&&!J.access(u,"globalEval")&&k.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?k._evalUrl&&!u.noModule&&k._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):y(u.textContent.replace(Lt,""),u,c))}return t}function jt(t,e,n){for(var r,i=e?k.filter(e,t):t,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(bt(r)),r.parentNode&&(n&&st(r)&&xt(bt(r,"script")),r.parentNode.removeChild(r));return t}k.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,i,o,s,a=t.cloneNode(!0),l=st(t);if(!(m.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||k.isXMLDoc(t)))for(s=bt(a),r=0,i=(o=bt(t)).length;r<i;r++)Pt(o[r],s[r]);if(e)if(n)for(o=o||bt(t),s=s||bt(a),r=0,i=o.length;r<i;r++)Nt(o[r],s[r]);else Nt(t,a);return(s=bt(a,"script")).length>0&&xt(s,!l&&bt(t,"script")),a},cleanData:function(t){for(var e,n,r,i=k.event.special,o=0;void 0!==(n=t[o]);o++)if(Y(n)){if(e=n[J.expando]){if(e.events)for(r in e.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,e.handle);n[J.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),k.fn.extend({detach:function(t){return jt(this,t,!0)},remove:function(t){return jt(this,t)},text:function(t){return G(this,(function(t){return void 0===t?k.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Ht(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Et(this,t).appendChild(t)}))},prepend:function(){return Ht(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Et(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Ht(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Ht(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(k.cleanData(bt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return k.clone(this,t,e)}))},html:function(t){return G(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!zt.test(t)&&!vt[(mt.exec(t)||["",""])[1].toLowerCase()]){t=k.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(k.cleanData(bt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Ht(this,arguments,(function(e){var n=this.parentNode;k.inArray(this,t)<0&&(k.cleanData(bt(this)),n&&n.replaceChild(e,this))}),t)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){k.fn[t]=function(t){for(var n,r=[],i=k(t),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),k(i[s])[e](n),u.apply(r,n.get());return this.pushStack(r)}}));var Vt=new RegExp("^("+nt+")(?!px)[a-z%]+$","i"),$t=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Bt=function(t,e,n){var r,i,o={};for(i in e)o[i]=t.style[i],t.style[i]=e[i];for(i in r=n.call(t),e)t.style[i]=o[i];return r},Gt=new RegExp(it.join("|"),"i");function qt(t,e,n){var r,i,o,s,a=t.style;return(n=n||$t(t))&&(""!==(s=n.getPropertyValue(e)||n[e])||st(t)||(s=k.style(t,e)),!m.pixelBoxStyles()&&Vt.test(s)&&Gt.test(e)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o)),void 0!==s?s+"":s}function Wt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ot.appendChild(u).appendChild(c);var t=n.getComputedStyle(c);r="1%"!==t.top,l=12===e(t.marginLeft),c.style.right="60%",s=36===e(t.right),i=36===e(t.width),c.style.position="absolute",o=12===e(c.offsetWidth/3),ot.removeChild(u),c=null}}function e(t){return Math.round(parseFloat(t))}var r,i,o,s,a,l,u=b.createElement("div"),c=b.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===c.style.backgroundClip,k.extend(m,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,r,i;return null==a&&(t=b.createElement("table"),e=b.createElement("tr"),r=b.createElement("div"),t.style.cssText="position:absolute;left:-11111px",e.style.height="1px",r.style.height="9px",ot.appendChild(t).appendChild(e).appendChild(r),i=n.getComputedStyle(e),a=parseInt(i.height)>3,ot.removeChild(t)),a}}))}();var Ut=["Webkit","Moz","ms"],Zt=b.createElement("div").style,Yt={};function Xt(t){var e=k.cssProps[t]||Yt[t];return e||(t in Zt?t:Yt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Ut.length;n--;)if((t=Ut[n]+e)in Zt)return t}(t)||t)}var Jt=/^(none|table(?!-c[ea]).+)/,Qt=/^--/,Kt={position:"absolute",visibility:"hidden",display:"block"},te={letterSpacing:"0",fontWeight:"400"};function ee(t,e,n){var r=rt.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function ne(t,e,n,r,i,o){var s="width"===e?1:0,a=0,l=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=k.css(t,n+it[s],!0,i)),r?("content"===n&&(l-=k.css(t,"padding"+it[s],!0,i)),"margin"!==n&&(l-=k.css(t,"border"+it[s]+"Width",!0,i))):(l+=k.css(t,"padding"+it[s],!0,i),"padding"!==n?l+=k.css(t,"border"+it[s]+"Width",!0,i):a+=k.css(t,"border"+it[s]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))||0),l}function re(t,e,n){var r=$t(t),i=(!m.boxSizingReliable()||n)&&"border-box"===k.css(t,"boxSizing",!1,r),o=i,s=qt(t,e,r),a="offset"+e[0].toUpperCase()+e.slice(1);if(Vt.test(s)){if(!n)return s;s="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&C(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===k.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===k.css(t,"boxSizing",!1,r),(o=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+ne(t,e,n||(i?"border":"content"),o,r,s)+"px"}function ie(t,e,n,r,i){return new ie.prototype.init(t,e,n,r,i)}k.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,s,a=Z(e),l=Qt.test(e),u=t.style;if(l||(e=Xt(a)),s=k.cssHooks[e]||k.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(t,!1,r))?i:u[e];"string"===(o=typeof n)&&(i=rt.exec(n))&&i[1]&&(n=ut(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(k.cssNumber[a]?"":"px")),m.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,r))||(l?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,r){var i,o,s,a=Z(e);return Qt.test(e)||(e=Xt(a)),(s=k.cssHooks[e]||k.cssHooks[a])&&"get"in s&&(i=s.get(t,!0,n)),void 0===i&&(i=qt(t,e,r)),"normal"===i&&e in te&&(i=te[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],(function(t,e){k.cssHooks[e]={get:function(t,n,r){if(n)return!Jt.test(k.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?re(t,e,r):Bt(t,Kt,(function(){return re(t,e,r)}))},set:function(t,n,r){var i,o=$t(t),s=!m.scrollboxSize()&&"absolute"===o.position,a=(s||r)&&"border-box"===k.css(t,"boxSizing",!1,o),l=r?ne(t,e,r,a,o):0;return a&&s&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-ne(t,e,"border",!1,o)-.5)),l&&(i=rt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=k.css(t,e)),ee(0,n,l)}}})),k.cssHooks.marginLeft=Wt(m.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(qt(t,"marginLeft"))||t.getBoundingClientRect().left-Bt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),k.each({margin:"",padding:"",border:"Width"},(function(t,e){k.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+it[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(k.cssHooks[t+e].set=ee)})),k.fn.extend({css:function(t,e){return G(this,(function(t,e,n){var r,i,o={},s=0;if(Array.isArray(e)){for(r=$t(t),i=e.length;s<i;s++)o[e[s]]=k.css(t,e[s],!1,r);return o}return void 0!==n?k.style(t,e,n):k.css(t,e)}),t,e,arguments.length>1)}}),k.Tween=ie,ie.prototype={constructor:ie,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||k.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var t=ie.propHooks[this.prop];return t&&t.get?t.get(this):ie.propHooks._default.get(this)},run:function(t){var e,n=ie.propHooks[this.prop];return this.options.duration?this.pos=e=k.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ie.propHooks._default.set(this),this}},ie.prototype.init.prototype=ie.prototype,ie.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=k.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){k.fx.step[t.prop]?k.fx.step[t.prop](t):1!==t.elem.nodeType||!k.cssHooks[t.prop]&&null==t.elem.style[Xt(t.prop)]?t.elem[t.prop]=t.now:k.style(t.elem,t.prop,t.now+t.unit)}}},ie.propHooks.scrollTop=ie.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},k.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},k.fx=ie.prototype.init,k.fx.step={};var oe,se,ae=/^(?:toggle|show|hide)$/,le=/queueHooks$/;function ue(){se&&(!1===b.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ue):n.setTimeout(ue,k.fx.interval),k.fx.tick())}function ce(){return n.setTimeout((function(){oe=void 0})),oe=Date.now()}function he(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=it[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function fe(t,e,n){for(var r,i=(de.tweeners[e]||[]).concat(de.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,e,t))return r}function de(t,e,n){var r,i,o=0,s=de.prefilters.length,a=k.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var e=oe||ce(),n=Math.max(0,u.startTime+u.duration-e),r=1-(n/u.duration||0),o=0,s=u.tweens.length;o<s;o++)u.tweens[o].run(r);return a.notifyWith(t,[u,r,n]),r<1&&s?n:(s||a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u]),!1)},u=a.promise({elem:t,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},n),originalProperties:e,originalOptions:n,startTime:oe||ce(),duration:n.duration,tweens:[],createTween:function(e,n){var r=k.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(r),r},stop:function(e){var n=0,r=e?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return e?(a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u,e])):a.rejectWith(t,[u,e]),this}}),c=u.props;for(!function(t,e){var n,r,i,o,s;for(n in t)if(i=e[r=Z(n)],o=t[n],Array.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),(s=k.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete t[r],o)n in t||(t[n]=o[n],e[n]=i);else e[r]=i}(c,u.opts.specialEasing);o<s;o++)if(r=de.prefilters[o].call(u,t,c,u.opts))return _(r.stop)&&(k._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return k.map(c,fe,u),_(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),k.fx.timer(k.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u}k.Animation=k.extend(de,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return ut(n.elem,t,rt.exec(e),n),n}]},tweener:function(t,e){_(t)?(e=t,t=["*"]):t=t.match(N);for(var n,r=0,i=t.length;r<i;r++)n=t[r],de.tweeners[n]=de.tweeners[n]||[],de.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,i,o,s,a,l,u,c,h="width"in e||"height"in e,f=this,d={},p=t.style,g=t.nodeType&&lt(t),m=J.get(t,"fxshow");for(r in n.queue||(null==(s=k._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,f.always((function(){f.always((function(){s.unqueued--,k.queue(t,"fx").length||s.empty.fire()}))}))),e)if(i=e[r],ae.test(i)){if(delete e[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}d[r]=m&&m[r]||k.style(t,r)}if((l=!k.isEmptyObject(e))||!k.isEmptyObject(d))for(r in h&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=m&&m.display)&&(u=J.get(t,"display")),"none"===(c=k.css(t,"display"))&&(u?c=u:(ft([t],!0),u=t.style.display||u,c=k.css(t,"display"),ft([t]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===k.css(t,"float")&&(l||(f.done((function(){p.display=u})),null==u&&(c=p.display,u="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",f.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,d)l||(m?"hidden"in m&&(g=m.hidden):m=J.access(t,"fxshow",{display:u}),o&&(m.hidden=!g),g&&ft([t],!0),f.done((function(){for(r in g||ft([t]),J.remove(t,"fxshow"),d)k.style(t,r,d[r])}))),l=fe(g?m[r]:0,r,f),r in m||(m[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?de.prefilters.unshift(t):de.prefilters.push(t)}}),k.speed=function(t,e,n){var r=t&&"object"==typeof t?k.extend({},t):{complete:n||!n&&e||_(t)&&t,duration:t,easing:n&&e||e&&!_(e)&&e};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){_(r.old)&&r.old.call(this),r.queue&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(t,e,n,r){return this.filter(lt).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=k.isEmptyObject(t),o=k.speed(e,n,r),s=function(){var e=de(this,k.extend({},t),o);(i||J.get(this,"finish"))&&e.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,i=null!=t&&t+"queueHooks",o=k.timers,s=J.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&le.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(o[i].anim.stop(n),e=!1,o.splice(i,1));!e&&n||k.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=J.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=k.timers,s=r?r.length:0;for(n.finish=!0,k.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<s;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish}))}}),k.each(["toggle","show","hide"],(function(t,e){var n=k.fn[e];k.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(he(e,!0),t,r,i)}})),k.each({slideDown:he("show"),slideUp:he("hide"),slideToggle:he("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){k.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}})),k.timers=[],k.fx.tick=function(){var t,e=0,n=k.timers;for(oe=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||k.fx.stop(),oe=void 0},k.fx.timer=function(t){k.timers.push(t),k.fx.start()},k.fx.interval=13,k.fx.start=function(){se||(se=!0,ue())},k.fx.stop=function(){se=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(t,e){return t=k.fx&&k.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,r){var i=n.setTimeout(e,t);r.stop=function(){n.clearTimeout(i)}}))},function(){var t=b.createElement("input"),e=b.createElement("select").appendChild(b.createElement("option"));t.type="checkbox",m.checkOn=""!==t.value,m.optSelected=e.selected,(t=b.createElement("input")).value="t",t.type="radio",m.radioValue="t"===t.value}();var pe,ge=k.expr.attrHandle;k.fn.extend({attr:function(t,e){return G(this,k.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){k.removeAttr(this,t)}))}}),k.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?k.prop(t,e,n):(1===o&&k.isXMLDoc(t)||(i=k.attrHooks[e.toLowerCase()]||(k.expr.match.bool.test(e)?pe:void 0)),void 0!==n?null===n?void k.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=k.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!m.radioValue&&"radio"===e&&C(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(N);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),pe={set:function(t,e,n){return!1===e?k.removeAttr(t,n):t.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=ge[e]||k.find.attr;ge[e]=function(t,e,r){var i,o,s=e.toLowerCase();return r||(o=ge[s],ge[s]=i,i=null!=n(t,e,r)?s:null,ge[s]=o),i}}));var me=/^(?:input|select|textarea|button)$/i,_e=/^(?:a|area)$/i;function ve(t){return(t.match(N)||[]).join(" ")}function be(t){return t.getAttribute&&t.getAttribute("class")||""}function xe(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(N)||[]}k.fn.extend({prop:function(t,e){return G(this,k.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[k.propFix[t]||t]}))}}),k.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(t)||(e=k.propFix[e]||e,i=k.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=k.find.attr(t,"tabindex");return e?parseInt(e,10):me.test(t.nodeName)||_e.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(k.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){k.propFix[this.toLowerCase()]=this})),k.fn.extend({addClass:function(t){var e,n,r,i,o,s,a,l=0;if(_(t))return this.each((function(e){k(this).addClass(t.call(this,e,be(this)))}));if((e=xe(t)).length)for(;n=this[l++];)if(i=be(n),r=1===n.nodeType&&" "+ve(i)+" "){for(s=0;o=e[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(a=ve(r))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,r,i,o,s,a,l=0;if(_(t))return this.each((function(e){k(this).removeClass(t.call(this,e,be(this)))}));if(!arguments.length)return this.attr("class","");if((e=xe(t)).length)for(;n=this[l++];)if(i=be(n),r=1===n.nodeType&&" "+ve(i)+" "){for(s=0;o=e[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(a=ve(r))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):_(t)?this.each((function(n){k(this).toggleClass(t.call(this,n,be(this),e),e)})):this.each((function(){var e,i,o,s;if(r)for(i=0,o=k(this),s=xe(t);e=s[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=be(this))&&J.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":J.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+ve(be(n))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;k.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=_(t),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,k(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=k.map(i,(function(t){return null==t?"":t+""}))),(e=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=k.valHooks[i.type]||k.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ye,""):null==n?"":n:void 0}}),k.extend({valHooks:{option:{get:function(t){var e=k.find.attr(t,"value");return null!=e?e:ve(k.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?o+1:i.length;for(r=o<0?l:s?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(e=k(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,r,i=t.options,o=k.makeArray(e),s=i.length;s--;)((r=i[s]).selected=k.inArray(k.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],(function(){k.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=k.inArray(k(t).val(),e)>-1}},m.checkOn||(k.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),m.focusin="onfocusin"in n;var we=/^(?:focusinfocus|focusoutblur)$/,ke=function(t){t.stopPropagation()};k.extend(k.event,{trigger:function(t,e,r,i){var o,s,a,l,u,c,h,f,p=[r||b],g=d.call(t,"type")?t.type:t,m=d.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=r=r||b,3!==r.nodeType&&8!==r.nodeType&&!we.test(g+k.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),u=g.indexOf(":")<0&&"on"+g,(t=t[k.expando]?t:new k.Event(g,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:k.makeArray(e,[t]),h=k.event.special[g]||{},i||!h.trigger||!1!==h.trigger.apply(r,e))){if(!i&&!h.noBubble&&!v(r)){for(l=h.delegateType||g,we.test(l+g)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(r.ownerDocument||b)&&p.push(a.defaultView||a.parentWindow||n)}for(o=0;(s=p[o++])&&!t.isPropagationStopped();)f=s,t.type=o>1?l:h.bindType||g,(c=(J.get(s,"events")||Object.create(null))[t.type]&&J.get(s,"handle"))&&c.apply(s,e),(c=u&&s[u])&&c.apply&&Y(s)&&(t.result=c.apply(s,e),!1===t.result&&t.preventDefault());return t.type=g,i||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(p.pop(),e)||!Y(r)||u&&_(r[g])&&!v(r)&&((a=r[u])&&(r[u]=null),k.event.triggered=g,t.isPropagationStopped()&&f.addEventListener(g,ke),r[g](),t.isPropagationStopped()&&f.removeEventListener(g,ke),k.event.triggered=void 0,a&&(r[u]=a)),t.result}},simulate:function(t,e,n){var r=k.extend(new k.Event,n,{type:t,isSimulated:!0});k.event.trigger(r,null,e)}}),k.fn.extend({trigger:function(t,e){return this.each((function(){k.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return k.event.trigger(t,e,n,!0)}}),m.focusin||k.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){k.event.simulate(e,t.target,k.event.fix(t))};k.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,e);i||r.addEventListener(t,n,!0),J.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,e)-1;i?J.access(r,e,i):(r.removeEventListener(t,n,!0),J.remove(r,e))}}}));var Se=n.location,Me={guid:Date.now()},Te=/\?/;k.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+t),e};var Ie=/\[\]$/,Ae=/\r?\n/g,Ce=/^(?:submit|button|image|reset|file)$/i,De=/^(?:input|select|textarea|keygen)/i;function ze(t,e,n,r){var i;if(Array.isArray(e))k.each(e,(function(e,i){n||Ie.test(t)?r(t,i):ze(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==w(e))r(t,e);else for(i in e)ze(t+"["+i+"]",e[i],n,r)}k.param=function(t,e){var n,r=[],i=function(t,e){var n=_(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!k.isPlainObject(t))k.each(t,(function(){i(this.name,this.value)}));else for(n in t)ze(n,t[n],e,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=k.prop(this,"elements");return t?k.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!k(this).is(":disabled")&&De.test(this.nodeName)&&!Ce.test(t)&&(this.checked||!gt.test(t))})).map((function(t,e){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,(function(t){return{name:e.name,value:t.replace(Ae,"\r\n")}})):{name:e.name,value:n.replace(Ae,"\r\n")}})).get()}});var Re=/%20/g,Le=/#.*$/,Ee=/([?&])_=[^&]*/,Oe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fe=/^(?:GET|HEAD)$/,Ne=/^\/\//,Pe={},He={},je="*/".concat("*"),Ve=b.createElement("a");function $e(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(N)||[];if(_(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Be(t,e,n,r){var i={},o=t===He;function s(a){var l;return i[a]=!0,k.each(t[a]||[],(function(t,a){var u=a(e,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),s(u),!1)})),l}return s(e.dataTypes[0])||!i["*"]&&s("*")}function Ge(t,e){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&k.extend(!0,t,r),t}Ve.href=Se.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Se.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Se.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":je,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ge(Ge(t,k.ajaxSettings),e):Ge(k.ajaxSettings,t)},ajaxPrefilter:$e(Pe),ajaxTransport:$e(He),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,s,a,l,u,c,h,f,d=k.ajaxSetup({},e),p=d.context||d,g=d.context&&(p.nodeType||p.jquery)?k(p):k.event,m=k.Deferred(),_=k.Callbacks("once memory"),v=d.statusCode||{},x={},y={},w="canceled",S={readyState:0,getResponseHeader:function(t){var e;if(u){if(!s)for(s={};e=Oe.exec(o);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=y[t.toLowerCase()]=y[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==u&&(d.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)S.always(t[S.status]);else for(e in t)v[e]=[v[e],t[e]];return this},abort:function(t){var e=t||w;return r&&r.abort(e),M(0,e),this}};if(m.promise(S),d.url=((t||d.url||Se.href)+"").replace(Ne,Se.protocol+"//"),d.type=e.method||e.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(N)||[""],null==d.crossDomain){l=b.createElement("a");try{l.href=d.url,l.href=l.href,d.crossDomain=Ve.protocol+"//"+Ve.host!=l.protocol+"//"+l.host}catch(t){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=k.param(d.data,d.traditional)),Be(Pe,d,e,S),u)return S;for(h in(c=k.event&&d.global)&&0==k.active++&&k.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Fe.test(d.type),i=d.url.replace(Le,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Re,"+")):(f=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(Te.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(Ee,"$1"),f=(Te.test(i)?"&":"?")+"_="+Me.guid+++f),d.url=i+f),d.ifModified&&(k.lastModified[i]&&S.setRequestHeader("If-Modified-Since",k.lastModified[i]),k.etag[i]&&S.setRequestHeader("If-None-Match",k.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||e.contentType)&&S.setRequestHeader("Content-Type",d.contentType),S.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+je+"; q=0.01":""):d.accepts["*"]),d.headers)S.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(p,S,d)||u))return S.abort();if(w="abort",_.add(d.complete),S.done(d.success),S.fail(d.error),r=Be(He,d,e,S)){if(S.readyState=1,c&&g.trigger("ajaxSend",[S,d]),u)return S;d.async&&d.timeout>0&&(a=n.setTimeout((function(){S.abort("timeout")}),d.timeout));try{u=!1,r.send(x,M)}catch(t){if(u)throw t;M(-1,t)}}else M(-1,"No Transport");function M(t,e,s,l){var h,f,b,x,y,w=e;u||(u=!0,a&&n.clearTimeout(a),r=void 0,o=l||"",S.readyState=t>0?4:0,h=t>=200&&t<300||304===t,s&&(x=function(t,e,n){for(var r,i,o,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||t.converters[i+" "+l[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(d,S,s)),!h&&k.inArray("script",d.dataTypes)>-1&&(d.converters["text script"]=function(){}),x=function(t,e,n,r){var i,o,s,a,l,u={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=u[l+" "+o]||u["* "+o]))for(i in u)if((a=i.split(" "))[1]===o&&(s=u[l+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[i]:!0!==u[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(d,x,S,h),h?(d.ifModified&&((y=S.getResponseHeader("Last-Modified"))&&(k.lastModified[i]=y),(y=S.getResponseHeader("etag"))&&(k.etag[i]=y)),204===t||"HEAD"===d.type?w="nocontent":304===t?w="notmodified":(w=x.state,f=x.data,h=!(b=x.error))):(b=w,!t&&w||(w="error",t<0&&(t=0))),S.status=t,S.statusText=(e||w)+"",h?m.resolveWith(p,[f,w,S]):m.rejectWith(p,[S,w,b]),S.statusCode(v),v=void 0,c&&g.trigger(h?"ajaxSuccess":"ajaxError",[S,d,h?f:b]),_.fireWith(p,[S,w]),c&&(g.trigger("ajaxComplete",[S,d]),--k.active||k.event.trigger("ajaxStop")))}return S},getJSON:function(t,e,n){return k.get(t,e,n,"json")},getScript:function(t,e){return k.get(t,void 0,e,"script")}}),k.each(["get","post"],(function(t,e){k[e]=function(t,n,r,i){return _(n)&&(i=i||r,r=n,n=void 0),k.ajax(k.extend({url:t,type:e,dataType:i,data:n,success:r},k.isPlainObject(t)&&t))}})),k.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),k._evalUrl=function(t,e,n){return k.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){k.globalEval(t,e,n)}})},k.fn.extend({wrapAll:function(t){var e;return this[0]&&(_(t)&&(t=t.call(this[0])),e=k(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return _(t)?this.each((function(e){k(this).wrapInner(t.call(this,e))})):this.each((function(){var e=k(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=_(t);return this.each((function(n){k(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){k(this).replaceWith(this.childNodes)})),this}}),k.expr.pseudos.hidden=function(t){return!k.expr.pseudos.visible(t)},k.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var qe={0:200,1223:204},We=k.ajaxSettings.xhr();m.cors=!!We&&"withCredentials"in We,m.ajax=We=!!We,k.ajaxTransport((function(t){var e,r;if(m.cors||We&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);e=function(t){return function(){e&&(e=r=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(qe[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),r=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout((function(){e&&r()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),k.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return k.globalEval(t),t}}}),k.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),k.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=k("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),b.head.appendChild(e[0])},abort:function(){n&&n()}}}));var Ue,Ze=[],Ye=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ze.pop()||k.expando+"_"+Me.guid++;return this[t]=!0,t}}),k.ajaxPrefilter("json jsonp",(function(t,e,r){var i,o,s,a=!1!==t.jsonp&&(Ye.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ye.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=_(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Ye,"$1"+i):!1!==t.jsonp&&(t.url+=(Te.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||k.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=n[i],n[i]=function(){s=arguments},r.always((function(){void 0===o?k(n).removeProp(i):n[i]=o,t[i]&&(t.jsonpCallback=e.jsonpCallback,Ze.push(i)),s&&_(o)&&o(s[0]),s=o=void 0})),"script"})),m.createHTMLDocument=((Ue=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ue.childNodes.length),k.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(m.createHTMLDocument?((r=(e=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,e.head.appendChild(r)):e=b),o=!n&&[],(i=D.exec(t))?[e.createElement(i[1])]:(i=wt([t],e,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(t,e,n){var r,i,o,s=this,a=t.indexOf(" ");return a>-1&&(r=ve(t.slice(a)),t=t.slice(0,a)),_(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),s.length>0&&k.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done((function(t){o=arguments,s.html(r?k("<div>").append(k.parseHTML(t)).find(r):t)})).always(n&&function(t,e){s.each((function(){n.apply(this,o||[t.responseText,e,t])}))}),this},k.expr.pseudos.animated=function(t){return k.grep(k.timers,(function(e){return t===e.elem})).length},k.offset={setOffset:function(t,e,n){var r,i,o,s,a,l,u=k.css(t,"position"),c=k(t),h={};"static"===u&&(t.style.position="relative"),a=c.offset(),o=k.css(t,"top"),l=k.css(t,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(l)||0),_(e)&&(e=e.call(t,n,k.extend({},a))),null!=e.top&&(h.top=e.top-a.top+s),null!=e.left&&(h.left=e.left-a.left+i),"using"in e?e.using.call(t,h):("number"==typeof h.top&&(h.top+="px"),"number"==typeof h.left&&(h.left+="px"),c.css(h))}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){k.offset.setOffset(this,t,e)}));var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===k.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((i=k(t).offset()).top+=k.css(t,"borderTopWidth",!0),i.left+=k.css(t,"borderLeftWidth",!0))}return{top:e.top-i.top-k.css(r,"marginTop",!0),left:e.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===k.css(t,"position");)t=t.offsetParent;return t||ot}))}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;k.fn[t]=function(r){return G(this,(function(t,r,i){var o;if(v(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===i)return o?o[e]:t[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):t[r]=i}),t,r,arguments.length)}})),k.each(["top","left"],(function(t,e){k.cssHooks[e]=Wt(m.pixelPosition,(function(t,n){if(n)return n=qt(t,e),Vt.test(n)?k(t).position()[e]+"px":n}))})),k.each({Height:"height",Width:"width"},(function(t,e){k.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,r){k.fn[r]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return G(this,(function(e,n,i){var o;return v(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===i?k.css(e,n,a):k.style(e,n,i,a)}),e,s?i:void 0,s)}}))})),k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){k.fn[e]=function(t){return this.on(e,t)}})),k.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){k.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var Xe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;k.proxy=function(t,e){var n,r,i;if("string"==typeof e&&(n=t[e],e=t,t=n),_(t))return r=a.call(arguments,2),(i=function(){return t.apply(e||this,r.concat(a.call(arguments)))}).guid=t.guid=t.guid||k.guid++,i},k.holdReady=function(t){t?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=C,k.isFunction=_,k.isWindow=v,k.camelCase=Z,k.type=w,k.now=Date.now,k.isNumeric=function(t){var e=k.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},k.trim=function(t){return null==t?"":(t+"").replace(Xe,"")},void 0===(r=function(){return k}.apply(e,[]))||(t.exports=r);var Je=n.jQuery,Qe=n.$;return k.noConflict=function(t){return n.$===k&&(n.$=Qe),t&&n.jQuery===k&&(n.jQuery=Je),k},void 0===i&&(n.jQuery=n.$=k),k}))},function(t,e,n){(function(t,r){var i;
26
- /**
27
- * @license
28
- * Lodash <https://lodash.com/>
29
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
30
- * Released under MIT license <https://lodash.com/license>
31
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
32
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
33
- */(function(){var o,s=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",h=500,f="__lodash_placeholder__",d=1,p=2,g=4,m=1,_=2,v=1,b=2,x=4,y=8,w=16,k=32,S=64,M=128,T=256,I=512,A=30,C="...",D=800,z=16,R=1,L=2,E=1/0,O=9007199254740991,F=17976931348623157e292,N=NaN,P=4294967295,H=P-1,j=P>>>1,V=[["ary",M],["bind",v],["bindKey",b],["curry",y],["curryRight",w],["flip",I],["partial",k],["partialRight",S],["rearg",T]],$="[object Arguments]",B="[object Array]",G="[object AsyncFunction]",q="[object Boolean]",W="[object Date]",U="[object DOMException]",Z="[object Error]",Y="[object Function]",X="[object GeneratorFunction]",J="[object Map]",Q="[object Number]",K="[object Null]",tt="[object Object]",et="[object Proxy]",nt="[object RegExp]",rt="[object Set]",it="[object String]",ot="[object Symbol]",st="[object Undefined]",at="[object WeakMap]",lt="[object WeakSet]",ut="[object ArrayBuffer]",ct="[object DataView]",ht="[object Float32Array]",ft="[object Float64Array]",dt="[object Int8Array]",pt="[object Int16Array]",gt="[object Int32Array]",mt="[object Uint8Array]",_t="[object Uint8ClampedArray]",vt="[object Uint16Array]",bt="[object Uint32Array]",xt=/\b__p \+= '';/g,yt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,kt=/&(?:amp|lt|gt|quot|#39);/g,St=/[&<>"']/g,Mt=RegExp(kt.source),Tt=RegExp(St.source),It=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Ct=/<%=([\s\S]+?)%>/g,Dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zt=/^\w*$/,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lt=/[\\^$.*+?()[\]{}|]/g,Et=RegExp(Lt.source),Ot=/^\s+/,Ft=/\s/,Nt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ht=/,? & /,jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vt=/[()=,{}\[\]\/\s]/,$t=/\\(\\)?/g,Bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gt=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Wt=/^0b[01]+$/i,Ut=/^\[object .+?Constructor\]$/,Zt=/^0o[0-7]+$/i,Yt=/^(?:0|[1-9]\d*)$/,Xt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jt=/($^)/,Qt=/['\n\r\u2028\u2029\\]/g,Kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ee="[\\ud800-\\udfff]",ne="["+te+"]",re="["+Kt+"]",ie="\\d+",oe="[\\u2700-\\u27bf]",se="[a-z\\xdf-\\xf6\\xf8-\\xff]",ae="[^\\ud800-\\udfff"+te+ie+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",le="\\ud83c[\\udffb-\\udfff]",ue="[^\\ud800-\\udfff]",ce="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",de="(?:"+se+"|"+ae+")",pe="(?:"+fe+"|"+ae+")",ge="(?:"+re+"|"+le+")"+"?",me="[\\ufe0e\\ufe0f]?"+ge+("(?:\\u200d(?:"+[ue,ce,he].join("|")+")[\\ufe0e\\ufe0f]?"+ge+")*"),_e="(?:"+[oe,ce,he].join("|")+")"+me,ve="(?:"+[ue+re+"?",re,ce,he,ee].join("|")+")",be=RegExp("['’]","g"),xe=RegExp(re,"g"),ye=RegExp(le+"(?="+le+")|"+ve+me,"g"),we=RegExp([fe+"?"+se+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ne,fe,"$"].join("|")+")",pe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ne,fe+de,"$"].join("|")+")",fe+"?"+de+"+(?:['’](?:d|ll|m|re|s|t|ve))?",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ie,_e].join("|"),"g"),ke=RegExp("[\\u200d\\ud800-\\udfff"+Kt+"\\ufe0e\\ufe0f]"),Se=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Me=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Te=-1,Ie={};Ie[ht]=Ie[ft]=Ie[dt]=Ie[pt]=Ie[gt]=Ie[mt]=Ie[_t]=Ie[vt]=Ie[bt]=!0,Ie[$]=Ie[B]=Ie[ut]=Ie[q]=Ie[ct]=Ie[W]=Ie[Z]=Ie[Y]=Ie[J]=Ie[Q]=Ie[tt]=Ie[nt]=Ie[rt]=Ie[it]=Ie[at]=!1;var Ae={};Ae[$]=Ae[B]=Ae[ut]=Ae[ct]=Ae[q]=Ae[W]=Ae[ht]=Ae[ft]=Ae[dt]=Ae[pt]=Ae[gt]=Ae[J]=Ae[Q]=Ae[tt]=Ae[nt]=Ae[rt]=Ae[it]=Ae[ot]=Ae[mt]=Ae[_t]=Ae[vt]=Ae[bt]=!0,Ae[Z]=Ae[Y]=Ae[at]=!1;var Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},De=parseFloat,ze=parseInt,Re="object"==typeof t&&t&&t.Object===Object&&t,Le="object"==typeof self&&self&&self.Object===Object&&self,Ee=Re||Le||Function("return this")(),Oe=e&&!e.nodeType&&e,Fe=Oe&&"object"==typeof r&&r&&!r.nodeType&&r,Ne=Fe&&Fe.exports===Oe,Pe=Ne&&Re.process,He=function(){try{var t=Fe&&Fe.require&&Fe.require("util").types;return t||Pe&&Pe.binding&&Pe.binding("util")}catch(t){}}(),je=He&&He.isArrayBuffer,Ve=He&&He.isDate,$e=He&&He.isMap,Be=He&&He.isRegExp,Ge=He&&He.isSet,qe=He&&He.isTypedArray;function We(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ue(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}function Ze(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ye(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Je(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function Qe(t,e){return!!(null==t?0:t.length)&&un(t,e,0)>-1}function Ke(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function tn(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function en(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function nn(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function rn(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function on(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var sn=dn("length");function an(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function ln(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function un(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):ln(t,hn,n)}function cn(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function hn(t){return t!=t}function fn(t,e){var n=null==t?0:t.length;return n?mn(t,e)/n:N}function dn(t){return function(e){return null==e?o:e[t]}}function pn(t){return function(e){return null==t?o:t[e]}}function gn(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function mn(t,e){for(var n,r=-1,i=t.length;++r<i;){var s=e(t[r]);s!==o&&(n=n===o?s:n+s)}return n}function _n(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function vn(t){return t?t.slice(0,On(t)+1).replace(Ot,""):t}function bn(t){return function(e){return t(e)}}function xn(t,e){return tn(e,(function(e){return t[e]}))}function yn(t,e){return t.has(e)}function wn(t,e){for(var n=-1,r=t.length;++n<r&&un(e,t[n],0)>-1;);return n}function kn(t,e){for(var n=t.length;n--&&un(e,t[n],0)>-1;);return n}var Sn=pn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mn=pn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Tn(t){return"\\"+Ce[t]}function In(t){return ke.test(t)}function An(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Cn(t,e){return function(n){return t(e(n))}}function Dn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n];s!==e&&s!==f||(t[n]=f,o[i++]=n)}return o}function zn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function Rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function Ln(t){return In(t)?function(t){var e=ye.lastIndex=0;for(;ye.test(t);)++e;return e}(t):sn(t)}function En(t){return In(t)?function(t){return t.match(ye)||[]}(t):function(t){return t.split("")}(t)}function On(t){for(var e=t.length;e--&&Ft.test(t.charAt(e)););return e}var Fn=pn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Nn=function t(e){var n,r=(e=null==e?Ee:Nn.defaults(Ee.Object(),e,Nn.pick(Ee,Me))).Array,i=e.Date,Ft=e.Error,Kt=e.Function,te=e.Math,ee=e.Object,ne=e.RegExp,re=e.String,ie=e.TypeError,oe=r.prototype,se=Kt.prototype,ae=ee.prototype,le=e["__core-js_shared__"],ue=se.toString,ce=ae.hasOwnProperty,he=0,fe=(n=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",de=ae.toString,pe=ue.call(ee),ge=Ee._,me=ne("^"+ue.call(ce).replace(Lt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_e=Ne?e.Buffer:o,ve=e.Symbol,ye=e.Uint8Array,ke=_e?_e.allocUnsafe:o,Ce=Cn(ee.getPrototypeOf,ee),Re=ee.create,Le=ae.propertyIsEnumerable,Oe=oe.splice,Fe=ve?ve.isConcatSpreadable:o,Pe=ve?ve.iterator:o,He=ve?ve.toStringTag:o,sn=function(){try{var t=Vo(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),pn=e.clearTimeout!==Ee.clearTimeout&&e.clearTimeout,Pn=i&&i.now!==Ee.Date.now&&i.now,Hn=e.setTimeout!==Ee.setTimeout&&e.setTimeout,jn=te.ceil,Vn=te.floor,$n=ee.getOwnPropertySymbols,Bn=_e?_e.isBuffer:o,Gn=e.isFinite,qn=oe.join,Wn=Cn(ee.keys,ee),Un=te.max,Zn=te.min,Yn=i.now,Xn=e.parseInt,Jn=te.random,Qn=oe.reverse,Kn=Vo(e,"DataView"),tr=Vo(e,"Map"),er=Vo(e,"Promise"),nr=Vo(e,"Set"),rr=Vo(e,"WeakMap"),ir=Vo(ee,"create"),or=rr&&new rr,sr={},ar=ds(Kn),lr=ds(tr),ur=ds(er),cr=ds(nr),hr=ds(rr),fr=ve?ve.prototype:o,dr=fr?fr.valueOf:o,pr=fr?fr.toString:o;function gr(t){if(Da(t)&&!ba(t)&&!(t instanceof br)){if(t instanceof vr)return t;if(ce.call(t,"__wrapped__"))return ps(t)}return new vr(t)}var mr=function(){function t(){}return function(e){if(!Ca(e))return{};if(Re)return Re(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function _r(){}function vr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function br(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=P,this.__views__=[]}function xr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function yr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function wr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function kr(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new wr;++e<n;)this.add(t[e])}function Sr(t){var e=this.__data__=new yr(t);this.size=e.size}function Mr(t,e){var n=ba(t),r=!n&&va(t),i=!n&&!r&&ka(t),o=!n&&!r&&!i&&Pa(t),s=n||r||i||o,a=s?_n(t.length,re):[],l=a.length;for(var u in t)!e&&!ce.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Zo(u,l))||a.push(u);return a}function Tr(t){var e=t.length;return e?t[ki(0,e-1)]:o}function Ir(t,e){return cs(io(t),Fr(e,0,t.length))}function Ar(t){return cs(io(t))}function Cr(t,e,n){(n===o||ga(t[e],n))&&(n!==o||e in t)||Er(t,e,n)}function Dr(t,e,n){var r=t[e];ce.call(t,e)&&ga(r,n)&&(n!==o||e in t)||Er(t,e,n)}function zr(t,e){for(var n=t.length;n--;)if(ga(t[n][0],e))return n;return-1}function Rr(t,e,n,r){return Vr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function Lr(t,e){return t&&oo(e,sl(e),t)}function Er(t,e,n){"__proto__"==e&&sn?sn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Or(t,e){for(var n=-1,i=e.length,s=r(i),a=null==t;++n<i;)s[n]=a?o:el(t,e[n]);return s}function Fr(t,e,n){return t==t&&(n!==o&&(t=t<=n?t:n),e!==o&&(t=t>=e?t:e)),t}function Nr(t,e,n,r,i,s){var a,l=e&d,u=e&p,c=e&g;if(n&&(a=i?n(t,r,i,s):n(t)),a!==o)return a;if(!Ca(t))return t;var h=ba(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&ce.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!l)return io(t,a)}else{var f=Go(t),m=f==Y||f==X;if(ka(t))return Qi(t,l);if(f==tt||f==$||m&&!i){if(a=u||m?{}:Wo(t),!l)return u?function(t,e){return oo(t,Bo(t),e)}(t,function(t,e){return t&&oo(e,al(e),t)}(a,t)):function(t,e){return oo(t,$o(t),e)}(t,Lr(a,t))}else{if(!Ae[f])return i?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case ut:return Ki(t);case q:case W:return new r(+t);case ct:return function(t,e){var n=e?Ki(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case ht:case ft:case dt:case pt:case gt:case mt:case _t:case vt:case bt:return to(t,n);case J:return new r;case Q:case it:return new r(t);case nt:return function(t){var e=new t.constructor(t.source,Gt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case rt:return new r;case ot:return i=t,dr?ee(dr.call(i)):{}}var i}(t,f,l)}}s||(s=new Sr);var _=s.get(t);if(_)return _;s.set(t,a),Oa(t)?t.forEach((function(r){a.add(Nr(r,e,n,r,t,s))})):za(t)&&t.forEach((function(r,i){a.set(i,Nr(r,e,n,i,t,s))}));var v=h?o:(c?u?Eo:Lo:u?al:sl)(t);return Ze(v||t,(function(r,i){v&&(r=t[i=r]),Dr(a,i,Nr(r,e,n,i,t,s))})),a}function Pr(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var i=n[r],s=e[i],a=t[i];if(a===o&&!(i in t)||!s(a))return!1}return!0}function Hr(t,e,n){if("function"!=typeof t)throw new ie(l);return ss((function(){t.apply(o,n)}),e)}function jr(t,e,n,r){var i=-1,o=Qe,a=!0,l=t.length,u=[],c=e.length;if(!l)return u;n&&(e=tn(e,bn(n))),r?(o=Ke,a=!1):e.length>=s&&(o=yn,a=!1,e=new kr(e));t:for(;++i<l;){var h=t[i],f=null==n?h:n(h);if(h=r||0!==h?h:0,a&&f==f){for(var d=c;d--;)if(e[d]===f)continue t;u.push(h)}else o(e,f,r)||u.push(h)}return u}gr.templateSettings={escape:It,evaluate:At,interpolate:Ct,variable:"",imports:{_:gr}},gr.prototype=_r.prototype,gr.prototype.constructor=gr,vr.prototype=mr(_r.prototype),vr.prototype.constructor=vr,br.prototype=mr(_r.prototype),br.prototype.constructor=br,xr.prototype.clear=function(){this.__data__=ir?ir(null):{},this.size=0},xr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},xr.prototype.get=function(t){var e=this.__data__;if(ir){var n=e[t];return n===c?o:n}return ce.call(e,t)?e[t]:o},xr.prototype.has=function(t){var e=this.__data__;return ir?e[t]!==o:ce.call(e,t)},xr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ir&&e===o?c:e,this},yr.prototype.clear=function(){this.__data__=[],this.size=0},yr.prototype.delete=function(t){var e=this.__data__,n=zr(e,t);return!(n<0)&&(n==e.length-1?e.pop():Oe.call(e,n,1),--this.size,!0)},yr.prototype.get=function(t){var e=this.__data__,n=zr(e,t);return n<0?o:e[n][1]},yr.prototype.has=function(t){return zr(this.__data__,t)>-1},yr.prototype.set=function(t,e){var n=this.__data__,r=zr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},wr.prototype.clear=function(){this.size=0,this.__data__={hash:new xr,map:new(tr||yr),string:new xr}},wr.prototype.delete=function(t){var e=Ho(this,t).delete(t);return this.size-=e?1:0,e},wr.prototype.get=function(t){return Ho(this,t).get(t)},wr.prototype.has=function(t){return Ho(this,t).has(t)},wr.prototype.set=function(t,e){var n=Ho(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},kr.prototype.add=kr.prototype.push=function(t){return this.__data__.set(t,c),this},kr.prototype.has=function(t){return this.__data__.has(t)},Sr.prototype.clear=function(){this.__data__=new yr,this.size=0},Sr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Sr.prototype.get=function(t){return this.__data__.get(t)},Sr.prototype.has=function(t){return this.__data__.has(t)},Sr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof yr){var r=n.__data__;if(!tr||r.length<s-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new wr(r)}return n.set(t,e),this.size=n.size,this};var Vr=lo(Yr),$r=lo(Xr,!0);function Br(t,e){var n=!0;return Vr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function Gr(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],a=e(s);if(null!=a&&(l===o?a==a&&!Na(a):n(a,l)))var l=a,u=s}return u}function qr(t,e){var n=[];return Vr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function Wr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=Uo),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?Wr(a,e-1,n,r,i):en(i,a):r||(i[i.length]=a)}return i}var Ur=uo(),Zr=uo(!0);function Yr(t,e){return t&&Ur(t,e,sl)}function Xr(t,e){return t&&Zr(t,e,sl)}function Jr(t,e){return Je(e,(function(e){return Ta(t[e])}))}function Qr(t,e){for(var n=0,r=(e=Zi(e,t)).length;null!=t&&n<r;)t=t[fs(e[n++])];return n&&n==r?t:o}function Kr(t,e,n){var r=e(t);return ba(t)?r:en(r,n(t))}function ti(t){return null==t?t===o?st:K:He&&He in ee(t)?function(t){var e=ce.call(t,He),n=t[He];try{t[He]=o;var r=!0}catch(t){}var i=de.call(t);r&&(e?t[He]=n:delete t[He]);return i}(t):function(t){return de.call(t)}(t)}function ei(t,e){return t>e}function ni(t,e){return null!=t&&ce.call(t,e)}function ri(t,e){return null!=t&&e in ee(t)}function ii(t,e,n){for(var i=n?Ke:Qe,s=t[0].length,a=t.length,l=a,u=r(a),c=1/0,h=[];l--;){var f=t[l];l&&e&&(f=tn(f,bn(e))),c=Zn(f.length,c),u[l]=!n&&(e||s>=120&&f.length>=120)?new kr(l&&f):o}f=t[0];var d=-1,p=u[0];t:for(;++d<s&&h.length<c;){var g=f[d],m=e?e(g):g;if(g=n||0!==g?g:0,!(p?yn(p,m):i(h,m,n))){for(l=a;--l;){var _=u[l];if(!(_?yn(_,m):i(t[l],m,n)))continue t}p&&p.push(m),h.push(g)}}return h}function oi(t,e,n){var r=null==(t=rs(t,e=Zi(e,t)))?t:t[fs(Ms(e))];return null==r?o:We(r,t,n)}function si(t){return Da(t)&&ti(t)==$}function ai(t,e,n,r,i){return t===e||(null==t||null==e||!Da(t)&&!Da(e)?t!=t&&e!=e:function(t,e,n,r,i,s){var a=ba(t),l=ba(e),u=a?B:Go(t),c=l?B:Go(e),h=(u=u==$?tt:u)==tt,f=(c=c==$?tt:c)==tt,d=u==c;if(d&&ka(t)){if(!ka(e))return!1;a=!0,h=!1}if(d&&!h)return s||(s=new Sr),a||Pa(t)?zo(t,e,n,r,i,s):function(t,e,n,r,i,o,s){switch(n){case ct:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ut:return!(t.byteLength!=e.byteLength||!o(new ye(t),new ye(e)));case q:case W:case Q:return ga(+t,+e);case Z:return t.name==e.name&&t.message==e.message;case nt:case it:return t==e+"";case J:var a=An;case rt:var l=r&m;if(a||(a=zn),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;r|=_,s.set(t,e);var c=zo(a(t),a(e),r,i,o,s);return s.delete(t),c;case ot:if(dr)return dr.call(t)==dr.call(e)}return!1}(t,e,u,n,r,i,s);if(!(n&m)){var p=h&&ce.call(t,"__wrapped__"),g=f&&ce.call(e,"__wrapped__");if(p||g){var v=p?t.value():t,b=g?e.value():e;return s||(s=new Sr),i(v,b,n,r,s)}}if(!d)return!1;return s||(s=new Sr),function(t,e,n,r,i,s){var a=n&m,l=Lo(t),u=l.length,c=Lo(e).length;if(u!=c&&!a)return!1;var h=u;for(;h--;){var f=l[h];if(!(a?f in e:ce.call(e,f)))return!1}var d=s.get(t),p=s.get(e);if(d&&p)return d==e&&p==t;var g=!0;s.set(t,e),s.set(e,t);var _=a;for(;++h<u;){f=l[h];var v=t[f],b=e[f];if(r)var x=a?r(b,v,f,e,t,s):r(v,b,f,t,e,s);if(!(x===o?v===b||i(v,b,n,r,s):x)){g=!1;break}_||(_="constructor"==f)}if(g&&!_){var y=t.constructor,w=e.constructor;y!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w)&&(g=!1)}return s.delete(t),s.delete(e),g}(t,e,n,r,i,s)}(t,e,n,r,ai,i))}function li(t,e,n,r){var i=n.length,s=i,a=!r;if(null==t)return!s;for(t=ee(t);i--;){var l=n[i];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++i<s;){var u=(l=n[i])[0],c=t[u],h=l[1];if(a&&l[2]){if(c===o&&!(u in t))return!1}else{var f=new Sr;if(r)var d=r(c,h,u,t,e,f);if(!(d===o?ai(h,c,m|_,r,f):d))return!1}}return!0}function ui(t){return!(!Ca(t)||(e=t,fe&&fe in e))&&(Ta(t)?me:Ut).test(ds(t));var e}function ci(t){return"function"==typeof t?t:null==t?Rl:"object"==typeof t?ba(t)?mi(t[0],t[1]):gi(t):Vl(t)}function hi(t){if(!Ko(t))return Wn(t);var e=[];for(var n in ee(t))ce.call(t,n)&&"constructor"!=n&&e.push(n);return e}function fi(t){if(!Ca(t))return function(t){var e=[];if(null!=t)for(var n in ee(t))e.push(n);return e}(t);var e=Ko(t),n=[];for(var r in t)("constructor"!=r||!e&&ce.call(t,r))&&n.push(r);return n}function di(t,e){return t<e}function pi(t,e){var n=-1,i=ya(t)?r(t.length):[];return Vr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function gi(t){var e=jo(t);return 1==e.length&&e[0][2]?es(e[0][0],e[0][1]):function(n){return n===t||li(n,t,e)}}function mi(t,e){return Xo(t)&&ts(e)?es(fs(t),e):function(n){var r=el(n,t);return r===o&&r===e?nl(n,t):ai(e,r,m|_)}}function _i(t,e,n,r,i){t!==e&&Ur(e,(function(s,a){if(i||(i=new Sr),Ca(s))!function(t,e,n,r,i,s,a){var l=is(t,n),u=is(e,n),c=a.get(u);if(c)return void Cr(t,n,c);var h=s?s(l,u,n+"",t,e,a):o,f=h===o;if(f){var d=ba(u),p=!d&&ka(u),g=!d&&!p&&Pa(u);h=u,d||p||g?ba(l)?h=l:wa(l)?h=io(l):p?(f=!1,h=Qi(u,!0)):g?(f=!1,h=to(u,!0)):h=[]:La(u)||va(u)?(h=l,va(l)?h=Wa(l):Ca(l)&&!Ta(l)||(h=Wo(u))):f=!1}f&&(a.set(u,h),i(h,u,r,s,a),a.delete(u));Cr(t,n,h)}(t,e,a,n,_i,r,i);else{var l=r?r(is(t,a),s,a+"",t,e,i):o;l===o&&(l=s),Cr(t,a,l)}}),al)}function vi(t,e){var n=t.length;if(n)return Zo(e+=e<0?n:0,n)?t[e]:o}function bi(t,e,n){e=e.length?tn(e,(function(t){return ba(t)?function(e){return Qr(e,1===t.length?t[0]:t)}:t})):[Rl];var r=-1;return e=tn(e,bn(Po())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(pi(t,(function(t,n,i){return{criteria:tn(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,o=e.criteria,s=i.length,a=n.length;for(;++r<s;){var l=eo(i[r],o[r]);if(l){if(r>=a)return l;var u=n[r];return l*("desc"==u?-1:1)}}return t.index-e.index}(t,e,n)}))}function xi(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=Qr(t,s);n(a,s)&&Ai(o,Zi(s,t),a)}return o}function yi(t,e,n,r){var i=r?cn:un,o=-1,s=e.length,a=t;for(t===e&&(e=io(e)),n&&(a=tn(t,bn(n)));++o<s;)for(var l=0,u=e[o],c=n?n(u):u;(l=i(a,c,l,r))>-1;)a!==t&&Oe.call(a,l,1),Oe.call(t,l,1);return t}function wi(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Zo(i)?Oe.call(t,i,1):ji(t,i)}}return t}function ki(t,e){return t+Vn(Jn()*(e-t+1))}function Si(t,e){var n="";if(!t||e<1||e>O)return n;do{e%2&&(n+=t),(e=Vn(e/2))&&(t+=t)}while(e);return n}function Mi(t,e){return as(ns(t,e,Rl),t+"")}function Ti(t){return Tr(gl(t))}function Ii(t,e){var n=gl(t);return cs(n,Fr(e,0,n.length))}function Ai(t,e,n,r){if(!Ca(t))return t;for(var i=-1,s=(e=Zi(e,t)).length,a=s-1,l=t;null!=l&&++i<s;){var u=fs(e[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=a){var h=l[u];(c=r?r(h,u,l):o)===o&&(c=Ca(h)?h:Zo(e[i+1])?[]:{})}Dr(l,u,c),l=l[u]}return t}var Ci=or?function(t,e){return or.set(t,e),t}:Rl,Di=sn?function(t,e){return sn(t,"toString",{configurable:!0,enumerable:!1,value:Cl(e),writable:!0})}:Rl;function zi(t){return cs(gl(t))}function Ri(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var s=r(o);++i<o;)s[i]=t[i+e];return s}function Li(t,e){var n;return Vr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function Ei(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=j){for(;r<i;){var o=r+i>>>1,s=t[o];null!==s&&!Na(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return Oi(t,e,Rl,n)}function Oi(t,e,n,r){var i=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=n(e))!=e,l=null===e,u=Na(e),c=e===o;i<s;){var h=Vn((i+s)/2),f=n(t[h]),d=f!==o,p=null===f,g=f==f,m=Na(f);if(a)var _=r||g;else _=c?g&&(r||d):l?g&&d&&(r||!p):u?g&&d&&!p&&(r||!m):!p&&!m&&(r?f<=e:f<e);_?i=h+1:s=h}return Zn(s,H)}function Fi(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!ga(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function Ni(t){return"number"==typeof t?t:Na(t)?N:+t}function Pi(t){if("string"==typeof t)return t;if(ba(t))return tn(t,Pi)+"";if(Na(t))return pr?pr.call(t):"";var e=t+"";return"0"==e&&1/t==-E?"-0":e}function Hi(t,e,n){var r=-1,i=Qe,o=t.length,a=!0,l=[],u=l;if(n)a=!1,i=Ke;else if(o>=s){var c=e?null:Mo(t);if(c)return zn(c);a=!1,i=yn,u=new kr}else u=e?[]:l;t:for(;++r<o;){var h=t[r],f=e?e(h):h;if(h=n||0!==h?h:0,a&&f==f){for(var d=u.length;d--;)if(u[d]===f)continue t;e&&u.push(f),l.push(h)}else i(u,f,n)||(u!==l&&u.push(f),l.push(h))}return l}function ji(t,e){return null==(t=rs(t,e=Zi(e,t)))||delete t[fs(Ms(e))]}function Vi(t,e,n,r){return Ai(t,e,n(Qr(t,e)),r)}function $i(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Ri(t,r?0:o,r?o+1:i):Ri(t,r?o+1:0,r?i:o)}function Bi(t,e){var n=t;return n instanceof br&&(n=n.value()),nn(e,(function(t,e){return e.func.apply(e.thisArg,en([t],e.args))}),n)}function Gi(t,e,n){var i=t.length;if(i<2)return i?Hi(t[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=t[o],l=-1;++l<i;)l!=o&&(s[o]=jr(s[o]||a,t[l],e,n));return Hi(Wr(s,1),e,n)}function qi(t,e,n){for(var r=-1,i=t.length,s=e.length,a={};++r<i;){var l=r<s?e[r]:o;n(a,t[r],l)}return a}function Wi(t){return wa(t)?t:[]}function Ui(t){return"function"==typeof t?t:Rl}function Zi(t,e){return ba(t)?t:Xo(t,e)?[t]:hs(Ua(t))}var Yi=Mi;function Xi(t,e,n){var r=t.length;return n=n===o?r:n,!e&&n>=r?t:Ri(t,e,n)}var Ji=pn||function(t){return Ee.clearTimeout(t)};function Qi(t,e){if(e)return t.slice();var n=t.length,r=ke?ke(n):new t.constructor(n);return t.copy(r),r}function Ki(t){var e=new t.constructor(t.byteLength);return new ye(e).set(new ye(t)),e}function to(t,e){var n=e?Ki(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function eo(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,s=Na(t),a=e!==o,l=null===e,u=e==e,c=Na(e);if(!l&&!c&&!s&&t>e||s&&a&&u&&!l&&!c||r&&a&&u||!n&&u||!i)return 1;if(!r&&!s&&!c&&t<e||c&&n&&i&&!r&&!s||l&&n&&i||!a&&i||!u)return-1}return 0}function no(t,e,n,i){for(var o=-1,s=t.length,a=n.length,l=-1,u=e.length,c=Un(s-a,0),h=r(u+c),f=!i;++l<u;)h[l]=e[l];for(;++o<a;)(f||o<s)&&(h[n[o]]=t[o]);for(;c--;)h[l++]=t[o++];return h}function ro(t,e,n,i){for(var o=-1,s=t.length,a=-1,l=n.length,u=-1,c=e.length,h=Un(s-l,0),f=r(h+c),d=!i;++o<h;)f[o]=t[o];for(var p=o;++u<c;)f[p+u]=e[u];for(;++a<l;)(d||o<s)&&(f[p+n[a]]=t[o++]);return f}function io(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function oo(t,e,n,r){var i=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var l=e[s],u=r?r(n[l],t[l],l,n,t):o;u===o&&(u=t[l]),i?Er(n,l,u):Dr(n,l,u)}return n}function so(t,e){return function(n,r){var i=ba(n)?Ue:Rr,o=e?e():{};return i(n,t,Po(r,2),o)}}function ao(t){return Mi((function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:o,a=i>2?n[2]:o;for(s=t.length>3&&"function"==typeof s?(i--,s):o,a&&Yo(n[0],n[1],a)&&(s=i<3?o:s,i=1),e=ee(e);++r<i;){var l=n[r];l&&t(e,l,r,s)}return e}))}function lo(t,e){return function(n,r){if(null==n)return n;if(!ya(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=ee(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function uo(t){return function(e,n,r){for(var i=-1,o=ee(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}function co(t){return function(e){var n=In(e=Ua(e))?En(e):o,r=n?n[0]:e.charAt(0),i=n?Xi(n,1).join(""):e.slice(1);return r[t]()+i}}function ho(t){return function(e){return nn(Tl(vl(e).replace(be,"")),t,"")}}function fo(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=mr(t.prototype),r=t.apply(n,e);return Ca(r)?r:n}}function po(t){return function(e,n,r){var i=ee(e);if(!ya(e)){var s=Po(n,3);e=sl(e),n=function(t){return s(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[s?e[a]:a]:o}}function go(t){return Ro((function(e){var n=e.length,r=n,i=vr.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new ie(l);if(i&&!a&&"wrapper"==Fo(s))var a=new vr([],!0)}for(r=a?r:n;++r<n;){var u=Fo(s=e[r]),c="wrapper"==u?Oo(s):o;a=c&&Jo(c[0])&&c[1]==(M|y|k|T)&&!c[4].length&&1==c[9]?a[Fo(c[0])].apply(a,c[3]):1==s.length&&Jo(s)?a[u]():a.thru(s)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&ba(r))return a.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function mo(t,e,n,i,s,a,l,u,c,h){var f=e&M,d=e&v,p=e&b,g=e&(y|w),m=e&I,_=p?o:fo(t);return function v(){for(var b=arguments.length,x=r(b),y=b;y--;)x[y]=arguments[y];if(g)var w=No(v),k=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(x,w);if(i&&(x=no(x,i,s,g)),a&&(x=ro(x,a,l,g)),b-=k,g&&b<h){var S=Dn(x,w);return ko(t,e,mo,v.placeholder,n,x,S,u,c,h-b)}var M=d?n:this,T=p?M[t]:t;return b=x.length,u?x=function(t,e){var n=t.length,r=Zn(e.length,n),i=io(t);for(;r--;){var s=e[r];t[r]=Zo(s,n)?i[s]:o}return t}(x,u):m&&b>1&&x.reverse(),f&&c<b&&(x.length=c),this&&this!==Ee&&this instanceof v&&(T=_||fo(T)),T.apply(M,x)}}function _o(t,e){return function(n,r){return function(t,e,n,r){return Yr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function vo(t,e){return function(n,r){var i;if(n===o&&r===o)return e;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=Pi(n),r=Pi(r)):(n=Ni(n),r=Ni(r)),i=t(n,r)}return i}}function bo(t){return Ro((function(e){return e=tn(e,bn(Po())),Mi((function(n){var r=this;return t(e,(function(t){return We(t,r,n)}))}))}))}function xo(t,e){var n=(e=e===o?" ":Pi(e)).length;if(n<2)return n?Si(e,t):e;var r=Si(e,jn(t/Ln(e)));return In(e)?Xi(En(r),0,t).join(""):r.slice(0,t)}function yo(t){return function(e,n,i){return i&&"number"!=typeof i&&Yo(e,n,i)&&(n=i=o),e=$a(e),n===o?(n=e,e=0):n=$a(n),function(t,e,n,i){for(var o=-1,s=Un(jn((e-t)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=t,t+=n;return a}(e,n,i=i===o?e<n?1:-1:$a(i),t)}}function wo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=qa(e),n=qa(n)),t(e,n)}}function ko(t,e,n,r,i,s,a,l,u,c){var h=e&y;e|=h?k:S,(e&=~(h?S:k))&x||(e&=~(v|b));var f=[t,e,i,h?s:o,h?a:o,h?o:s,h?o:a,l,u,c],d=n.apply(o,f);return Jo(t)&&os(d,f),d.placeholder=r,ls(d,t,e)}function So(t){var e=te[t];return function(t,n){if(t=qa(t),(n=null==n?0:Zn(Ba(n),292))&&Gn(t)){var r=(Ua(t)+"e").split("e");return+((r=(Ua(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Mo=nr&&1/zn(new nr([,-0]))[1]==E?function(t){return new nr(t)}:Nl;function To(t){return function(e){var n=Go(e);return n==J?An(e):n==rt?Rn(e):function(t,e){return tn(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Io(t,e,n,i,s,a,u,c){var h=e&b;if(!h&&"function"!=typeof t)throw new ie(l);var d=i?i.length:0;if(d||(e&=~(k|S),i=s=o),u=u===o?u:Un(Ba(u),0),c=c===o?c:Ba(c),d-=s?s.length:0,e&S){var p=i,g=s;i=s=o}var m=h?o:Oo(t),_=[t,e,n,i,s,p,g,a,u,c];if(m&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<(v|b|M),s=r==M&&n==y||r==M&&n==T&&t[7].length<=e[8]||r==(M|T)&&e[7].length<=e[8]&&n==y;if(!o&&!s)return t;r&v&&(t[2]=e[2],i|=n&v?0:x);var a=e[3];if(a){var l=t[3];t[3]=l?no(l,a,e[4]):a,t[4]=l?Dn(t[3],f):e[4]}(a=e[5])&&(l=t[5],t[5]=l?ro(l,a,e[6]):a,t[6]=l?Dn(t[5],f):e[6]);(a=e[7])&&(t[7]=a);r&M&&(t[8]=null==t[8]?e[8]:Zn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(_,m),t=_[0],e=_[1],n=_[2],i=_[3],s=_[4],!(c=_[9]=_[9]===o?h?0:t.length:Un(_[9]-d,0))&&e&(y|w)&&(e&=~(y|w)),e&&e!=v)I=e==y||e==w?function(t,e,n){var i=fo(t);return function s(){for(var a=arguments.length,l=r(a),u=a,c=No(s);u--;)l[u]=arguments[u];var h=a<3&&l[0]!==c&&l[a-1]!==c?[]:Dn(l,c);return(a-=h.length)<n?ko(t,e,mo,s.placeholder,o,l,h,o,o,n-a):We(this&&this!==Ee&&this instanceof s?i:t,this,l)}}(t,e,c):e!=k&&e!=(v|k)||s.length?mo.apply(o,_):function(t,e,n,i){var o=e&v,s=fo(t);return function e(){for(var a=-1,l=arguments.length,u=-1,c=i.length,h=r(c+l),f=this&&this!==Ee&&this instanceof e?s:t;++u<c;)h[u]=i[u];for(;l--;)h[u++]=arguments[++a];return We(f,o?n:this,h)}}(t,e,n,i);else var I=function(t,e,n){var r=e&v,i=fo(t);return function e(){return(this&&this!==Ee&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return ls((m?Ci:os)(I,_),t,e)}function Ao(t,e,n,r){return t===o||ga(t,ae[n])&&!ce.call(r,n)?e:t}function Co(t,e,n,r,i,s){return Ca(t)&&Ca(e)&&(s.set(e,t),_i(t,e,o,Co,s),s.delete(e)),t}function Do(t){return La(t)?o:t}function zo(t,e,n,r,i,s){var a=n&m,l=t.length,u=e.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var f=-1,d=!0,p=n&_?new kr:o;for(s.set(t,e),s.set(e,t);++f<l;){var g=t[f],v=e[f];if(r)var b=a?r(v,g,f,e,t,s):r(g,v,f,t,e,s);if(b!==o){if(b)continue;d=!1;break}if(p){if(!on(e,(function(t,e){if(!yn(p,e)&&(g===t||i(g,t,n,r,s)))return p.push(e)}))){d=!1;break}}else if(g!==v&&!i(g,v,n,r,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function Ro(t){return as(ns(t,o,xs),t+"")}function Lo(t){return Kr(t,sl,$o)}function Eo(t){return Kr(t,al,Bo)}var Oo=or?function(t){return or.get(t)}:Nl;function Fo(t){for(var e=t.name+"",n=sr[e],r=ce.call(sr,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function No(t){return(ce.call(gr,"placeholder")?gr:t).placeholder}function Po(){var t=gr.iteratee||Ll;return t=t===Ll?ci:t,arguments.length?t(arguments[0],arguments[1]):t}function Ho(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function jo(t){for(var e=sl(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,ts(i)]}return e}function Vo(t,e){var n=function(t,e){return null==t?o:t[e]}(t,e);return ui(n)?n:o}var $o=$n?function(t){return null==t?[]:(t=ee(t),Je($n(t),(function(e){return Le.call(t,e)})))}:Gl,Bo=$n?function(t){for(var e=[];t;)en(e,$o(t)),t=Ce(t);return e}:Gl,Go=ti;function qo(t,e,n){for(var r=-1,i=(e=Zi(e,t)).length,o=!1;++r<i;){var s=fs(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Aa(i)&&Zo(s,i)&&(ba(t)||va(t))}function Wo(t){return"function"!=typeof t.constructor||Ko(t)?{}:mr(Ce(t))}function Uo(t){return ba(t)||va(t)||!!(Fe&&t&&t[Fe])}function Zo(t,e){var n=typeof t;return!!(e=null==e?O:e)&&("number"==n||"symbol"!=n&&Yt.test(t))&&t>-1&&t%1==0&&t<e}function Yo(t,e,n){if(!Ca(n))return!1;var r=typeof e;return!!("number"==r?ya(n)&&Zo(e,n.length):"string"==r&&e in n)&&ga(n[e],t)}function Xo(t,e){if(ba(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Na(t))||(zt.test(t)||!Dt.test(t)||null!=e&&t in ee(e))}function Jo(t){var e=Fo(t),n=gr[e];if("function"!=typeof n||!(e in br.prototype))return!1;if(t===n)return!0;var r=Oo(n);return!!r&&t===r[0]}(Kn&&Go(new Kn(new ArrayBuffer(1)))!=ct||tr&&Go(new tr)!=J||er&&"[object Promise]"!=Go(er.resolve())||nr&&Go(new nr)!=rt||rr&&Go(new rr)!=at)&&(Go=function(t){var e=ti(t),n=e==tt?t.constructor:o,r=n?ds(n):"";if(r)switch(r){case ar:return ct;case lr:return J;case ur:return"[object Promise]";case cr:return rt;case hr:return at}return e});var Qo=le?Ta:ql;function Ko(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ae)}function ts(t){return t==t&&!Ca(t)}function es(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==o||t in ee(n)))}}function ns(t,e,n){return e=Un(e===o?t.length-1:e,0),function(){for(var i=arguments,o=-1,s=Un(i.length-e,0),a=r(s);++o<s;)a[o]=i[e+o];o=-1;for(var l=r(e+1);++o<e;)l[o]=i[o];return l[e]=n(a),We(t,this,l)}}function rs(t,e){return e.length<2?t:Qr(t,Ri(e,0,-1))}function is(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var os=us(Ci),ss=Hn||function(t,e){return Ee.setTimeout(t,e)},as=us(Di);function ls(t,e,n){var r=e+"";return as(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Nt,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ze(V,(function(n){var r="_."+n[0];e&n[1]&&!Qe(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Pt);return e?e[1].split(Ht):[]}(r),n)))}function us(t){var e=0,n=0;return function(){var r=Yn(),i=z-(r-n);if(n=r,i>0){if(++e>=D)return arguments[0]}else e=0;return t.apply(o,arguments)}}function cs(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n<e;){var s=ki(n,i),a=t[s];t[s]=t[n],t[n]=a}return t.length=e,t}var hs=function(t){var e=ua(t,(function(t){return n.size===h&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Rt,(function(t,n,r,i){e.push(r?i.replace($t,"$1"):n||t)})),e}));function fs(t){if("string"==typeof t||Na(t))return t;var e=t+"";return"0"==e&&1/t==-E?"-0":e}function ds(t){if(null!=t){try{return ue.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function ps(t){if(t instanceof br)return t.clone();var e=new vr(t.__wrapped__,t.__chain__);return e.__actions__=io(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var gs=Mi((function(t,e){return wa(t)?jr(t,Wr(e,1,wa,!0)):[]})),ms=Mi((function(t,e){var n=Ms(e);return wa(n)&&(n=o),wa(t)?jr(t,Wr(e,1,wa,!0),Po(n,2)):[]})),_s=Mi((function(t,e){var n=Ms(e);return wa(n)&&(n=o),wa(t)?jr(t,Wr(e,1,wa,!0),o,n):[]}));function vs(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Ba(n);return i<0&&(i=Un(r+i,0)),ln(t,Po(e,3),i)}function bs(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==o&&(i=Ba(n),i=n<0?Un(r+i,0):Zn(i,r-1)),ln(t,Po(e,3),i,!0)}function xs(t){return(null==t?0:t.length)?Wr(t,1):[]}function ys(t){return t&&t.length?t[0]:o}var ws=Mi((function(t){var e=tn(t,Wi);return e.length&&e[0]===t[0]?ii(e):[]})),ks=Mi((function(t){var e=Ms(t),n=tn(t,Wi);return e===Ms(n)?e=o:n.pop(),n.length&&n[0]===t[0]?ii(n,Po(e,2)):[]})),Ss=Mi((function(t){var e=Ms(t),n=tn(t,Wi);return(e="function"==typeof e?e:o)&&n.pop(),n.length&&n[0]===t[0]?ii(n,o,e):[]}));function Ms(t){var e=null==t?0:t.length;return e?t[e-1]:o}var Ts=Mi(Is);function Is(t,e){return t&&t.length&&e&&e.length?yi(t,e):t}var As=Ro((function(t,e){var n=null==t?0:t.length,r=Or(t,e);return wi(t,tn(e,(function(t){return Zo(t,n)?+t:t})).sort(eo)),r}));function Cs(t){return null==t?t:Qn.call(t)}var Ds=Mi((function(t){return Hi(Wr(t,1,wa,!0))})),zs=Mi((function(t){var e=Ms(t);return wa(e)&&(e=o),Hi(Wr(t,1,wa,!0),Po(e,2))})),Rs=Mi((function(t){var e=Ms(t);return e="function"==typeof e?e:o,Hi(Wr(t,1,wa,!0),o,e)}));function Ls(t){if(!t||!t.length)return[];var e=0;return t=Je(t,(function(t){if(wa(t))return e=Un(t.length,e),!0})),_n(e,(function(e){return tn(t,dn(e))}))}function Es(t,e){if(!t||!t.length)return[];var n=Ls(t);return null==e?n:tn(n,(function(t){return We(e,o,t)}))}var Os=Mi((function(t,e){return wa(t)?jr(t,e):[]})),Fs=Mi((function(t){return Gi(Je(t,wa))})),Ns=Mi((function(t){var e=Ms(t);return wa(e)&&(e=o),Gi(Je(t,wa),Po(e,2))})),Ps=Mi((function(t){var e=Ms(t);return e="function"==typeof e?e:o,Gi(Je(t,wa),o,e)})),Hs=Mi(Ls);var js=Mi((function(t){var e=t.length,n=e>1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,Es(t,n)}));function Vs(t){var e=gr(t);return e.__chain__=!0,e}function $s(t,e){return e(t)}var Bs=Ro((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof br&&Zo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:$s,args:[i],thisArg:o}),new vr(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(o),t}))):this.thru(i)}));var Gs=so((function(t,e,n){ce.call(t,n)?++t[n]:Er(t,n,1)}));var qs=po(vs),Ws=po(bs);function Us(t,e){return(ba(t)?Ze:Vr)(t,Po(e,3))}function Zs(t,e){return(ba(t)?Ye:$r)(t,Po(e,3))}var Ys=so((function(t,e,n){ce.call(t,n)?t[n].push(e):Er(t,n,[e])}));var Xs=Mi((function(t,e,n){var i=-1,o="function"==typeof e,s=ya(t)?r(t.length):[];return Vr(t,(function(t){s[++i]=o?We(e,t,n):oi(t,e,n)})),s})),Js=so((function(t,e,n){Er(t,n,e)}));function Qs(t,e){return(ba(t)?tn:pi)(t,Po(e,3))}var Ks=so((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var ta=Mi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Yo(t,e[0],e[1])?e=[]:n>2&&Yo(e[0],e[1],e[2])&&(e=[e[0]]),bi(t,Wr(e,1),[])})),ea=Pn||function(){return Ee.Date.now()};function na(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,Io(t,M,o,o,o,o,e)}function ra(t,e){var n;if("function"!=typeof e)throw new ie(l);return t=Ba(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var ia=Mi((function(t,e,n){var r=v;if(n.length){var i=Dn(n,No(ia));r|=k}return Io(t,r,e,n,i)})),oa=Mi((function(t,e,n){var r=v|b;if(n.length){var i=Dn(n,No(oa));r|=k}return Io(e,r,t,n,i)}));function sa(t,e,n){var r,i,s,a,u,c,h=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new ie(l);function g(e){var n=r,s=i;return r=i=o,h=e,a=t.apply(s,n)}function m(t){var n=t-c;return c===o||n>=e||n<0||d&&t-h>=s}function _(){var t=ea();if(m(t))return v(t);u=ss(_,function(t){var n=e-(t-c);return d?Zn(n,s-(t-h)):n}(t))}function v(t){return u=o,p&&r?g(t):(r=i=o,a)}function b(){var t=ea(),n=m(t);if(r=arguments,i=this,c=t,n){if(u===o)return function(t){return h=t,u=ss(_,e),f?g(t):a}(c);if(d)return Ji(u),u=ss(_,e),g(c)}return u===o&&(u=ss(_,e)),a}return e=qa(e)||0,Ca(n)&&(f=!!n.leading,s=(d="maxWait"in n)?Un(qa(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),b.cancel=function(){u!==o&&Ji(u),h=0,r=c=i=u=o},b.flush=function(){return u===o?a:v(ea())},b}var aa=Mi((function(t,e){return Hr(t,1,e)})),la=Mi((function(t,e,n){return Hr(t,qa(e)||0,n)}));function ua(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(l);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(ua.Cache||wr),n}function ca(t){if("function"!=typeof t)throw new ie(l);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ua.Cache=wr;var ha=Yi((function(t,e){var n=(e=1==e.length&&ba(e[0])?tn(e[0],bn(Po())):tn(Wr(e,1),bn(Po()))).length;return Mi((function(r){for(var i=-1,o=Zn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return We(t,this,r)}))})),fa=Mi((function(t,e){var n=Dn(e,No(fa));return Io(t,k,o,e,n)})),da=Mi((function(t,e){var n=Dn(e,No(da));return Io(t,S,o,e,n)})),pa=Ro((function(t,e){return Io(t,T,o,o,o,e)}));function ga(t,e){return t===e||t!=t&&e!=e}var ma=wo(ei),_a=wo((function(t,e){return t>=e})),va=si(function(){return arguments}())?si:function(t){return Da(t)&&ce.call(t,"callee")&&!Le.call(t,"callee")},ba=r.isArray,xa=je?bn(je):function(t){return Da(t)&&ti(t)==ut};function ya(t){return null!=t&&Aa(t.length)&&!Ta(t)}function wa(t){return Da(t)&&ya(t)}var ka=Bn||ql,Sa=Ve?bn(Ve):function(t){return Da(t)&&ti(t)==W};function Ma(t){if(!Da(t))return!1;var e=ti(t);return e==Z||e==U||"string"==typeof t.message&&"string"==typeof t.name&&!La(t)}function Ta(t){if(!Ca(t))return!1;var e=ti(t);return e==Y||e==X||e==G||e==et}function Ia(t){return"number"==typeof t&&t==Ba(t)}function Aa(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=O}function Ca(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Da(t){return null!=t&&"object"==typeof t}var za=$e?bn($e):function(t){return Da(t)&&Go(t)==J};function Ra(t){return"number"==typeof t||Da(t)&&ti(t)==Q}function La(t){if(!Da(t)||ti(t)!=tt)return!1;var e=Ce(t);if(null===e)return!0;var n=ce.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ue.call(n)==pe}var Ea=Be?bn(Be):function(t){return Da(t)&&ti(t)==nt};var Oa=Ge?bn(Ge):function(t){return Da(t)&&Go(t)==rt};function Fa(t){return"string"==typeof t||!ba(t)&&Da(t)&&ti(t)==it}function Na(t){return"symbol"==typeof t||Da(t)&&ti(t)==ot}var Pa=qe?bn(qe):function(t){return Da(t)&&Aa(t.length)&&!!Ie[ti(t)]};var Ha=wo(di),ja=wo((function(t,e){return t<=e}));function Va(t){if(!t)return[];if(ya(t))return Fa(t)?En(t):io(t);if(Pe&&t[Pe])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Pe]());var e=Go(t);return(e==J?An:e==rt?zn:gl)(t)}function $a(t){return t?(t=qa(t))===E||t===-E?(t<0?-1:1)*F:t==t?t:0:0===t?t:0}function Ba(t){var e=$a(t),n=e%1;return e==e?n?e-n:e:0}function Ga(t){return t?Fr(Ba(t),0,P):0}function qa(t){if("number"==typeof t)return t;if(Na(t))return N;if(Ca(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ca(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=vn(t);var n=Wt.test(t);return n||Zt.test(t)?ze(t.slice(2),n?2:8):qt.test(t)?N:+t}function Wa(t){return oo(t,al(t))}function Ua(t){return null==t?"":Pi(t)}var Za=ao((function(t,e){if(Ko(e)||ya(e))oo(e,sl(e),t);else for(var n in e)ce.call(e,n)&&Dr(t,n,e[n])})),Ya=ao((function(t,e){oo(e,al(e),t)})),Xa=ao((function(t,e,n,r){oo(e,al(e),t,r)})),Ja=ao((function(t,e,n,r){oo(e,sl(e),t,r)})),Qa=Ro(Or);var Ka=Mi((function(t,e){t=ee(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&Yo(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],a=al(s),l=-1,u=a.length;++l<u;){var c=a[l],h=t[c];(h===o||ga(h,ae[c])&&!ce.call(t,c))&&(t[c]=s[c])}return t})),tl=Mi((function(t){return t.push(o,Co),We(ul,o,t)}));function el(t,e,n){var r=null==t?o:Qr(t,e);return r===o?n:r}function nl(t,e){return null!=t&&qo(t,e,ri)}var rl=_o((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=de.call(e)),t[e]=n}),Cl(Rl)),il=_o((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=de.call(e)),ce.call(t,e)?t[e].push(n):t[e]=[n]}),Po),ol=Mi(oi);function sl(t){return ya(t)?Mr(t):hi(t)}function al(t){return ya(t)?Mr(t,!0):fi(t)}var ll=ao((function(t,e,n){_i(t,e,n)})),ul=ao((function(t,e,n,r){_i(t,e,n,r)})),cl=Ro((function(t,e){var n={};if(null==t)return n;var r=!1;e=tn(e,(function(e){return e=Zi(e,t),r||(r=e.length>1),e})),oo(t,Eo(t),n),r&&(n=Nr(n,d|p|g,Do));for(var i=e.length;i--;)ji(n,e[i]);return n}));var hl=Ro((function(t,e){return null==t?{}:function(t,e){return xi(t,e,(function(e,n){return nl(t,n)}))}(t,e)}));function fl(t,e){if(null==t)return{};var n=tn(Eo(t),(function(t){return[t]}));return e=Po(e),xi(t,n,(function(t,n){return e(t,n[0])}))}var dl=To(sl),pl=To(al);function gl(t){return null==t?[]:xn(t,sl(t))}var ml=ho((function(t,e,n){return e=e.toLowerCase(),t+(n?_l(e):e)}));function _l(t){return Ml(Ua(t).toLowerCase())}function vl(t){return(t=Ua(t))&&t.replace(Xt,Sn).replace(xe,"")}var bl=ho((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),xl=ho((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),yl=co("toLowerCase");var wl=ho((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var kl=ho((function(t,e,n){return t+(n?" ":"")+Ml(e)}));var Sl=ho((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ml=co("toUpperCase");function Tl(t,e,n){return t=Ua(t),(e=n?o:e)===o?function(t){return Se.test(t)}(t)?function(t){return t.match(we)||[]}(t):function(t){return t.match(jt)||[]}(t):t.match(e)||[]}var Il=Mi((function(t,e){try{return We(t,o,e)}catch(t){return Ma(t)?t:new Ft(t)}})),Al=Ro((function(t,e){return Ze(e,(function(e){e=fs(e),Er(t,e,ia(t[e],t))})),t}));function Cl(t){return function(){return t}}var Dl=go(),zl=go(!0);function Rl(t){return t}function Ll(t){return ci("function"==typeof t?t:Nr(t,d))}var El=Mi((function(t,e){return function(n){return oi(n,t,e)}})),Ol=Mi((function(t,e){return function(n){return oi(t,n,e)}}));function Fl(t,e,n){var r=sl(e),i=Jr(e,r);null!=n||Ca(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Jr(e,sl(e)));var o=!(Ca(n)&&"chain"in n&&!n.chain),s=Ta(t);return Ze(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=io(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,en([this.value()],arguments))})})),t}function Nl(){}var Pl=bo(tn),Hl=bo(Xe),jl=bo(on);function Vl(t){return Xo(t)?dn(fs(t)):function(t){return function(e){return Qr(e,t)}}(t)}var $l=yo(),Bl=yo(!0);function Gl(){return[]}function ql(){return!1}var Wl=vo((function(t,e){return t+e}),0),Ul=So("ceil"),Zl=vo((function(t,e){return t/e}),1),Yl=So("floor");var Xl,Jl=vo((function(t,e){return t*e}),1),Ql=So("round"),Kl=vo((function(t,e){return t-e}),0);return gr.after=function(t,e){if("function"!=typeof e)throw new ie(l);return t=Ba(t),function(){if(--t<1)return e.apply(this,arguments)}},gr.ary=na,gr.assign=Za,gr.assignIn=Ya,gr.assignInWith=Xa,gr.assignWith=Ja,gr.at=Qa,gr.before=ra,gr.bind=ia,gr.bindAll=Al,gr.bindKey=oa,gr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ba(t)?t:[t]},gr.chain=Vs,gr.chunk=function(t,e,n){e=(n?Yo(t,e,n):e===o)?1:Un(Ba(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var s=0,a=0,l=r(jn(i/e));s<i;)l[a++]=Ri(t,s,s+=e);return l},gr.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},gr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return en(ba(n)?io(n):[n],Wr(e,1))},gr.cond=function(t){var e=null==t?0:t.length,n=Po();return t=e?tn(t,(function(t){if("function"!=typeof t[1])throw new ie(l);return[n(t[0]),t[1]]})):[],Mi((function(n){for(var r=-1;++r<e;){var i=t[r];if(We(i[0],this,n))return We(i[1],this,n)}}))},gr.conforms=function(t){return function(t){var e=sl(t);return function(n){return Pr(n,t,e)}}(Nr(t,d))},gr.constant=Cl,gr.countBy=Gs,gr.create=function(t,e){var n=mr(t);return null==e?n:Lr(n,e)},gr.curry=function t(e,n,r){var i=Io(e,y,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},gr.curryRight=function t(e,n,r){var i=Io(e,w,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},gr.debounce=sa,gr.defaults=Ka,gr.defaultsDeep=tl,gr.defer=aa,gr.delay=la,gr.difference=gs,gr.differenceBy=ms,gr.differenceWith=_s,gr.drop=function(t,e,n){var r=null==t?0:t.length;return r?Ri(t,(e=n||e===o?1:Ba(e))<0?0:e,r):[]},gr.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Ri(t,0,(e=r-(e=n||e===o?1:Ba(e)))<0?0:e):[]},gr.dropRightWhile=function(t,e){return t&&t.length?$i(t,Po(e,3),!0,!0):[]},gr.dropWhile=function(t,e){return t&&t.length?$i(t,Po(e,3),!0):[]},gr.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Yo(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=Ba(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:Ba(r))<0&&(r+=i),r=n>r?0:Ga(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},gr.filter=function(t,e){return(ba(t)?Je:qr)(t,Po(e,3))},gr.flatMap=function(t,e){return Wr(Qs(t,e),1)},gr.flatMapDeep=function(t,e){return Wr(Qs(t,e),E)},gr.flatMapDepth=function(t,e,n){return n=n===o?1:Ba(n),Wr(Qs(t,e),n)},gr.flatten=xs,gr.flattenDeep=function(t){return(null==t?0:t.length)?Wr(t,E):[]},gr.flattenDepth=function(t,e){return(null==t?0:t.length)?Wr(t,e=e===o?1:Ba(e)):[]},gr.flip=function(t){return Io(t,I)},gr.flow=Dl,gr.flowRight=zl,gr.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},gr.functions=function(t){return null==t?[]:Jr(t,sl(t))},gr.functionsIn=function(t){return null==t?[]:Jr(t,al(t))},gr.groupBy=Ys,gr.initial=function(t){return(null==t?0:t.length)?Ri(t,0,-1):[]},gr.intersection=ws,gr.intersectionBy=ks,gr.intersectionWith=Ss,gr.invert=rl,gr.invertBy=il,gr.invokeMap=Xs,gr.iteratee=Ll,gr.keyBy=Js,gr.keys=sl,gr.keysIn=al,gr.map=Qs,gr.mapKeys=function(t,e){var n={};return e=Po(e,3),Yr(t,(function(t,r,i){Er(n,e(t,r,i),t)})),n},gr.mapValues=function(t,e){var n={};return e=Po(e,3),Yr(t,(function(t,r,i){Er(n,r,e(t,r,i))})),n},gr.matches=function(t){return gi(Nr(t,d))},gr.matchesProperty=function(t,e){return mi(t,Nr(e,d))},gr.memoize=ua,gr.merge=ll,gr.mergeWith=ul,gr.method=El,gr.methodOf=Ol,gr.mixin=Fl,gr.negate=ca,gr.nthArg=function(t){return t=Ba(t),Mi((function(e){return vi(e,t)}))},gr.omit=cl,gr.omitBy=function(t,e){return fl(t,ca(Po(e)))},gr.once=function(t){return ra(2,t)},gr.orderBy=function(t,e,n,r){return null==t?[]:(ba(e)||(e=null==e?[]:[e]),ba(n=r?o:n)||(n=null==n?[]:[n]),bi(t,e,n))},gr.over=Pl,gr.overArgs=ha,gr.overEvery=Hl,gr.overSome=jl,gr.partial=fa,gr.partialRight=da,gr.partition=Ks,gr.pick=hl,gr.pickBy=fl,gr.property=Vl,gr.propertyOf=function(t){return function(e){return null==t?o:Qr(t,e)}},gr.pull=Ts,gr.pullAll=Is,gr.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?yi(t,e,Po(n,2)):t},gr.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?yi(t,e,o,n):t},gr.pullAt=As,gr.range=$l,gr.rangeRight=Bl,gr.rearg=pa,gr.reject=function(t,e){return(ba(t)?Je:qr)(t,ca(Po(e,3)))},gr.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=Po(e,3);++r<o;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return wi(t,i),n},gr.rest=function(t,e){if("function"!=typeof t)throw new ie(l);return Mi(t,e=e===o?e:Ba(e))},gr.reverse=Cs,gr.sampleSize=function(t,e,n){return e=(n?Yo(t,e,n):e===o)?1:Ba(e),(ba(t)?Ir:Ii)(t,e)},gr.set=function(t,e,n){return null==t?t:Ai(t,e,n)},gr.setWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Ai(t,e,n,r)},gr.shuffle=function(t){return(ba(t)?Ar:zi)(t)},gr.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&Yo(t,e,n)?(e=0,n=r):(e=null==e?0:Ba(e),n=n===o?r:Ba(n)),Ri(t,e,n)):[]},gr.sortBy=ta,gr.sortedUniq=function(t){return t&&t.length?Fi(t):[]},gr.sortedUniqBy=function(t,e){return t&&t.length?Fi(t,Po(e,2)):[]},gr.split=function(t,e,n){return n&&"number"!=typeof n&&Yo(t,e,n)&&(e=n=o),(n=n===o?P:n>>>0)?(t=Ua(t))&&("string"==typeof e||null!=e&&!Ea(e))&&!(e=Pi(e))&&In(t)?Xi(En(t),0,n):t.split(e,n):[]},gr.spread=function(t,e){if("function"!=typeof t)throw new ie(l);return e=null==e?0:Un(Ba(e),0),Mi((function(n){var r=n[e],i=Xi(n,0,e);return r&&en(i,r),We(t,this,i)}))},gr.tail=function(t){var e=null==t?0:t.length;return e?Ri(t,1,e):[]},gr.take=function(t,e,n){return t&&t.length?Ri(t,0,(e=n||e===o?1:Ba(e))<0?0:e):[]},gr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Ri(t,(e=r-(e=n||e===o?1:Ba(e)))<0?0:e,r):[]},gr.takeRightWhile=function(t,e){return t&&t.length?$i(t,Po(e,3),!1,!0):[]},gr.takeWhile=function(t,e){return t&&t.length?$i(t,Po(e,3)):[]},gr.tap=function(t,e){return e(t),t},gr.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new ie(l);return Ca(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),sa(t,e,{leading:r,maxWait:e,trailing:i})},gr.thru=$s,gr.toArray=Va,gr.toPairs=dl,gr.toPairsIn=pl,gr.toPath=function(t){return ba(t)?tn(t,fs):Na(t)?[t]:io(hs(Ua(t)))},gr.toPlainObject=Wa,gr.transform=function(t,e,n){var r=ba(t),i=r||ka(t)||Pa(t);if(e=Po(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Ca(t)&&Ta(o)?mr(Ce(t)):{}}return(i?Ze:Yr)(t,(function(t,r,i){return e(n,t,r,i)})),n},gr.unary=function(t){return na(t,1)},gr.union=Ds,gr.unionBy=zs,gr.unionWith=Rs,gr.uniq=function(t){return t&&t.length?Hi(t):[]},gr.uniqBy=function(t,e){return t&&t.length?Hi(t,Po(e,2)):[]},gr.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?Hi(t,o,e):[]},gr.unset=function(t,e){return null==t||ji(t,e)},gr.unzip=Ls,gr.unzipWith=Es,gr.update=function(t,e,n){return null==t?t:Vi(t,e,Ui(n))},gr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Vi(t,e,Ui(n),r)},gr.values=gl,gr.valuesIn=function(t){return null==t?[]:xn(t,al(t))},gr.without=Os,gr.words=Tl,gr.wrap=function(t,e){return fa(Ui(e),t)},gr.xor=Fs,gr.xorBy=Ns,gr.xorWith=Ps,gr.zip=Hs,gr.zipObject=function(t,e){return qi(t||[],e||[],Dr)},gr.zipObjectDeep=function(t,e){return qi(t||[],e||[],Ai)},gr.zipWith=js,gr.entries=dl,gr.entriesIn=pl,gr.extend=Ya,gr.extendWith=Xa,Fl(gr,gr),gr.add=Wl,gr.attempt=Il,gr.camelCase=ml,gr.capitalize=_l,gr.ceil=Ul,gr.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=qa(n))==n?n:0),e!==o&&(e=(e=qa(e))==e?e:0),Fr(qa(t),e,n)},gr.clone=function(t){return Nr(t,g)},gr.cloneDeep=function(t){return Nr(t,d|g)},gr.cloneDeepWith=function(t,e){return Nr(t,d|g,e="function"==typeof e?e:o)},gr.cloneWith=function(t,e){return Nr(t,g,e="function"==typeof e?e:o)},gr.conformsTo=function(t,e){return null==e||Pr(t,e,sl(e))},gr.deburr=vl,gr.defaultTo=function(t,e){return null==t||t!=t?e:t},gr.divide=Zl,gr.endsWith=function(t,e,n){t=Ua(t),e=Pi(e);var r=t.length,i=n=n===o?r:Fr(Ba(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},gr.eq=ga,gr.escape=function(t){return(t=Ua(t))&&Tt.test(t)?t.replace(St,Mn):t},gr.escapeRegExp=function(t){return(t=Ua(t))&&Et.test(t)?t.replace(Lt,"\\$&"):t},gr.every=function(t,e,n){var r=ba(t)?Xe:Br;return n&&Yo(t,e,n)&&(e=o),r(t,Po(e,3))},gr.find=qs,gr.findIndex=vs,gr.findKey=function(t,e){return an(t,Po(e,3),Yr)},gr.findLast=Ws,gr.findLastIndex=bs,gr.findLastKey=function(t,e){return an(t,Po(e,3),Xr)},gr.floor=Yl,gr.forEach=Us,gr.forEachRight=Zs,gr.forIn=function(t,e){return null==t?t:Ur(t,Po(e,3),al)},gr.forInRight=function(t,e){return null==t?t:Zr(t,Po(e,3),al)},gr.forOwn=function(t,e){return t&&Yr(t,Po(e,3))},gr.forOwnRight=function(t,e){return t&&Xr(t,Po(e,3))},gr.get=el,gr.gt=ma,gr.gte=_a,gr.has=function(t,e){return null!=t&&qo(t,e,ni)},gr.hasIn=nl,gr.head=ys,gr.identity=Rl,gr.includes=function(t,e,n,r){t=ya(t)?t:gl(t),n=n&&!r?Ba(n):0;var i=t.length;return n<0&&(n=Un(i+n,0)),Fa(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&un(t,e,n)>-1},gr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Ba(n);return i<0&&(i=Un(r+i,0)),un(t,e,i)},gr.inRange=function(t,e,n){return e=$a(e),n===o?(n=e,e=0):n=$a(n),function(t,e,n){return t>=Zn(e,n)&&t<Un(e,n)}(t=qa(t),e,n)},gr.invoke=ol,gr.isArguments=va,gr.isArray=ba,gr.isArrayBuffer=xa,gr.isArrayLike=ya,gr.isArrayLikeObject=wa,gr.isBoolean=function(t){return!0===t||!1===t||Da(t)&&ti(t)==q},gr.isBuffer=ka,gr.isDate=Sa,gr.isElement=function(t){return Da(t)&&1===t.nodeType&&!La(t)},gr.isEmpty=function(t){if(null==t)return!0;if(ya(t)&&(ba(t)||"string"==typeof t||"function"==typeof t.splice||ka(t)||Pa(t)||va(t)))return!t.length;var e=Go(t);if(e==J||e==rt)return!t.size;if(Ko(t))return!hi(t).length;for(var n in t)if(ce.call(t,n))return!1;return!0},gr.isEqual=function(t,e){return ai(t,e)},gr.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:o)?n(t,e):o;return r===o?ai(t,e,o,n):!!r},gr.isError=Ma,gr.isFinite=function(t){return"number"==typeof t&&Gn(t)},gr.isFunction=Ta,gr.isInteger=Ia,gr.isLength=Aa,gr.isMap=za,gr.isMatch=function(t,e){return t===e||li(t,e,jo(e))},gr.isMatchWith=function(t,e,n){return n="function"==typeof n?n:o,li(t,e,jo(e),n)},gr.isNaN=function(t){return Ra(t)&&t!=+t},gr.isNative=function(t){if(Qo(t))throw new Ft(a);return ui(t)},gr.isNil=function(t){return null==t},gr.isNull=function(t){return null===t},gr.isNumber=Ra,gr.isObject=Ca,gr.isObjectLike=Da,gr.isPlainObject=La,gr.isRegExp=Ea,gr.isSafeInteger=function(t){return Ia(t)&&t>=-O&&t<=O},gr.isSet=Oa,gr.isString=Fa,gr.isSymbol=Na,gr.isTypedArray=Pa,gr.isUndefined=function(t){return t===o},gr.isWeakMap=function(t){return Da(t)&&Go(t)==at},gr.isWeakSet=function(t){return Da(t)&&ti(t)==lt},gr.join=function(t,e){return null==t?"":qn.call(t,e)},gr.kebabCase=bl,gr.last=Ms,gr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Ba(n))<0?Un(r+i,0):Zn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):ln(t,hn,i,!0)},gr.lowerCase=xl,gr.lowerFirst=yl,gr.lt=Ha,gr.lte=ja,gr.max=function(t){return t&&t.length?Gr(t,Rl,ei):o},gr.maxBy=function(t,e){return t&&t.length?Gr(t,Po(e,2),ei):o},gr.mean=function(t){return fn(t,Rl)},gr.meanBy=function(t,e){return fn(t,Po(e,2))},gr.min=function(t){return t&&t.length?Gr(t,Rl,di):o},gr.minBy=function(t,e){return t&&t.length?Gr(t,Po(e,2),di):o},gr.stubArray=Gl,gr.stubFalse=ql,gr.stubObject=function(){return{}},gr.stubString=function(){return""},gr.stubTrue=function(){return!0},gr.multiply=Jl,gr.nth=function(t,e){return t&&t.length?vi(t,Ba(e)):o},gr.noConflict=function(){return Ee._===this&&(Ee._=ge),this},gr.noop=Nl,gr.now=ea,gr.pad=function(t,e,n){t=Ua(t);var r=(e=Ba(e))?Ln(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return xo(Vn(i),n)+t+xo(jn(i),n)},gr.padEnd=function(t,e,n){t=Ua(t);var r=(e=Ba(e))?Ln(t):0;return e&&r<e?t+xo(e-r,n):t},gr.padStart=function(t,e,n){t=Ua(t);var r=(e=Ba(e))?Ln(t):0;return e&&r<e?xo(e-r,n)+t:t},gr.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),Xn(Ua(t).replace(Ot,""),e||0)},gr.random=function(t,e,n){if(n&&"boolean"!=typeof n&&Yo(t,e,n)&&(e=n=o),n===o&&("boolean"==typeof e?(n=e,e=o):"boolean"==typeof t&&(n=t,t=o)),t===o&&e===o?(t=0,e=1):(t=$a(t),e===o?(e=t,t=0):e=$a(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Jn();return Zn(t+i*(e-t+De("1e-"+((i+"").length-1))),e)}return ki(t,e)},gr.reduce=function(t,e,n){var r=ba(t)?nn:gn,i=arguments.length<3;return r(t,Po(e,4),n,i,Vr)},gr.reduceRight=function(t,e,n){var r=ba(t)?rn:gn,i=arguments.length<3;return r(t,Po(e,4),n,i,$r)},gr.repeat=function(t,e,n){return e=(n?Yo(t,e,n):e===o)?1:Ba(e),Si(Ua(t),e)},gr.replace=function(){var t=arguments,e=Ua(t[0]);return t.length<3?e:e.replace(t[1],t[2])},gr.result=function(t,e,n){var r=-1,i=(e=Zi(e,t)).length;for(i||(i=1,t=o);++r<i;){var s=null==t?o:t[fs(e[r])];s===o&&(r=i,s=n),t=Ta(s)?s.call(t):s}return t},gr.round=Ql,gr.runInContext=t,gr.sample=function(t){return(ba(t)?Tr:Ti)(t)},gr.size=function(t){if(null==t)return 0;if(ya(t))return Fa(t)?Ln(t):t.length;var e=Go(t);return e==J||e==rt?t.size:hi(t).length},gr.snakeCase=wl,gr.some=function(t,e,n){var r=ba(t)?on:Li;return n&&Yo(t,e,n)&&(e=o),r(t,Po(e,3))},gr.sortedIndex=function(t,e){return Ei(t,e)},gr.sortedIndexBy=function(t,e,n){return Oi(t,e,Po(n,2))},gr.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Ei(t,e);if(r<n&&ga(t[r],e))return r}return-1},gr.sortedLastIndex=function(t,e){return Ei(t,e,!0)},gr.sortedLastIndexBy=function(t,e,n){return Oi(t,e,Po(n,2),!0)},gr.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=Ei(t,e,!0)-1;if(ga(t[n],e))return n}return-1},gr.startCase=kl,gr.startsWith=function(t,e,n){return t=Ua(t),n=null==n?0:Fr(Ba(n),0,t.length),e=Pi(e),t.slice(n,n+e.length)==e},gr.subtract=Kl,gr.sum=function(t){return t&&t.length?mn(t,Rl):0},gr.sumBy=function(t,e){return t&&t.length?mn(t,Po(e,2)):0},gr.template=function(t,e,n){var r=gr.templateSettings;n&&Yo(t,e,n)&&(e=o),t=Ua(t),e=Xa({},e,r,Ao);var i,s,a=Xa({},e.imports,r.imports,Ao),l=sl(a),c=xn(a,l),h=0,f=e.interpolate||Jt,d="__p += '",p=ne((e.escape||Jt).source+"|"+f.source+"|"+(f===Ct?Bt:Jt).source+"|"+(e.evaluate||Jt).source+"|$","g"),g="//# sourceURL="+(ce.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Te+"]")+"\n";t.replace(p,(function(e,n,r,o,a,l){return r||(r=o),d+=t.slice(h,l).replace(Qt,Tn),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=l+e.length,e})),d+="';\n";var m=ce.call(e,"variable")&&e.variable;if(m){if(Vt.test(m))throw new Ft(u)}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(xt,""):d).replace(yt,"$1").replace(wt,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var _=Il((function(){return Kt(l,g+"return "+d).apply(o,c)}));if(_.source=d,Ma(_))throw _;return _},gr.times=function(t,e){if((t=Ba(t))<1||t>O)return[];var n=P,r=Zn(t,P);e=Po(e),t-=P;for(var i=_n(r,e);++n<t;)e(n);return i},gr.toFinite=$a,gr.toInteger=Ba,gr.toLength=Ga,gr.toLower=function(t){return Ua(t).toLowerCase()},gr.toNumber=qa,gr.toSafeInteger=function(t){return t?Fr(Ba(t),-O,O):0===t?t:0},gr.toString=Ua,gr.toUpper=function(t){return Ua(t).toUpperCase()},gr.trim=function(t,e,n){if((t=Ua(t))&&(n||e===o))return vn(t);if(!t||!(e=Pi(e)))return t;var r=En(t),i=En(e);return Xi(r,wn(r,i),kn(r,i)+1).join("")},gr.trimEnd=function(t,e,n){if((t=Ua(t))&&(n||e===o))return t.slice(0,On(t)+1);if(!t||!(e=Pi(e)))return t;var r=En(t);return Xi(r,0,kn(r,En(e))+1).join("")},gr.trimStart=function(t,e,n){if((t=Ua(t))&&(n||e===o))return t.replace(Ot,"");if(!t||!(e=Pi(e)))return t;var r=En(t);return Xi(r,wn(r,En(e))).join("")},gr.truncate=function(t,e){var n=A,r=C;if(Ca(e)){var i="separator"in e?e.separator:i;n="length"in e?Ba(e.length):n,r="omission"in e?Pi(e.omission):r}var s=(t=Ua(t)).length;if(In(t)){var a=En(t);s=a.length}if(n>=s)return t;var l=n-Ln(r);if(l<1)return r;var u=a?Xi(a,0,l).join(""):t.slice(0,l);if(i===o)return u+r;if(a&&(l+=u.length-l),Ea(i)){if(t.slice(l).search(i)){var c,h=u;for(i.global||(i=ne(i.source,Ua(Gt.exec(i))+"g")),i.lastIndex=0;c=i.exec(h);)var f=c.index;u=u.slice(0,f===o?l:f)}}else if(t.indexOf(Pi(i),l)!=l){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},gr.unescape=function(t){return(t=Ua(t))&&Mt.test(t)?t.replace(kt,Fn):t},gr.uniqueId=function(t){var e=++he;return Ua(t)+e},gr.upperCase=Sl,gr.upperFirst=Ml,gr.each=Us,gr.eachRight=Zs,gr.first=ys,Fl(gr,(Xl={},Yr(gr,(function(t,e){ce.call(gr.prototype,e)||(Xl[e]=t)})),Xl),{chain:!1}),gr.VERSION="4.17.21",Ze(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){gr[t].placeholder=gr})),Ze(["drop","take"],(function(t,e){br.prototype[t]=function(n){n=n===o?1:Un(Ba(n),0);var r=this.__filtered__&&!e?new br(this):this.clone();return r.__filtered__?r.__takeCount__=Zn(n,r.__takeCount__):r.__views__.push({size:Zn(n,P),type:t+(r.__dir__<0?"Right":"")}),r},br.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ze(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=n==R||3==n;br.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Po(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ze(["head","last"],(function(t,e){var n="take"+(e?"Right":"");br.prototype[t]=function(){return this[n](1).value()[0]}})),Ze(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");br.prototype[t]=function(){return this.__filtered__?new br(this):this[n](1)}})),br.prototype.compact=function(){return this.filter(Rl)},br.prototype.find=function(t){return this.filter(t).head()},br.prototype.findLast=function(t){return this.reverse().find(t)},br.prototype.invokeMap=Mi((function(t,e){return"function"==typeof t?new br(this):this.map((function(n){return oi(n,t,e)}))})),br.prototype.reject=function(t){return this.filter(ca(Po(t)))},br.prototype.slice=function(t,e){t=Ba(t);var n=this;return n.__filtered__&&(t>0||e<0)?new br(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=Ba(e))<0?n.dropRight(-e):n.take(e-t)),n)},br.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},br.prototype.toArray=function(){return this.take(P)},Yr(br.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=gr[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);i&&(gr.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof br,u=a[0],c=l||ba(e),h=function(t){var e=i.apply(gr,en([t],a));return r&&f?e[0]:e};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=s&&!f,g=l&&!d;if(!s&&c){e=g?e:new br(this);var m=t.apply(e,a);return m.__actions__.push({func:$s,args:[h],thisArg:o}),new vr(m,f)}return p&&g?t.apply(this,a):(m=this.thru(h),p?r?m.value()[0]:m.value():m)})})),Ze(["pop","push","shift","sort","splice","unshift"],(function(t){var e=oe[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);gr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(ba(i)?i:[],t)}return this[n]((function(n){return e.apply(ba(n)?n:[],t)}))}})),Yr(br.prototype,(function(t,e){var n=gr[e];if(n){var r=n.name+"";ce.call(sr,r)||(sr[r]=[]),sr[r].push({name:e,func:n})}})),sr[mo(o,b).name]=[{name:"wrapper",func:o}],br.prototype.clone=function(){var t=new br(this.__wrapped__);return t.__actions__=io(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=io(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=io(this.__views__),t},br.prototype.reverse=function(){if(this.__filtered__){var t=new br(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},br.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ba(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=Zn(e,t+s);break;case"takeRight":t=Un(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,u=r?a:s-1,c=this.__iteratees__,h=c.length,f=0,d=Zn(l,this.__takeCount__);if(!n||!r&&i==l&&d==l)return Bi(t,this.__actions__);var p=[];t:for(;l--&&f<d;){for(var g=-1,m=t[u+=e];++g<h;){var _=c[g],v=_.iteratee,b=_.type,x=v(m);if(b==L)m=x;else if(!x){if(b==R)continue t;break t}}p[f++]=m}return p},gr.prototype.at=Bs,gr.prototype.chain=function(){return Vs(this)},gr.prototype.commit=function(){return new vr(this.value(),this.__chain__)},gr.prototype.next=function(){this.__values__===o&&(this.__values__=Va(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},gr.prototype.plant=function(t){for(var e,n=this;n instanceof _r;){var r=ps(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},gr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof br){var e=t;return this.__actions__.length&&(e=new br(this)),(e=e.reverse()).__actions__.push({func:$s,args:[Cs],thisArg:o}),new vr(e,this.__chain__)}return this.thru(Cs)},gr.prototype.toJSON=gr.prototype.valueOf=gr.prototype.value=function(){return Bi(this.__wrapped__,this.__actions__)},gr.prototype.first=gr.prototype.head,Pe&&(gr.prototype[Pe]=function(){return this}),gr}();Ee._=Nn,(i=function(){return Nn}.call(e,n,e,r))===o||(r.exports=i)}).call(this)}).call(this,n(11),n(12)(t))},function(t,e,n){e.glMatrix=n(3),e.mat2=n(13),e.mat2d=n(14),e.mat3=n(5),e.mat4=n(15),e.quat=n(16),e.vec2=n(17),e.vec3=n(6),e.vec4=n(7)},function(t,e){var n={EPSILON:1e-6};n.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,n.RANDOM=Math.random,n.ENABLE_SIMD=!1,n.SIMD_AVAILABLE=n.ARRAY_TYPE===Float32Array&&"SIMD"in this,n.USE_SIMD=n.ENABLE_SIMD&&n.SIMD_AVAILABLE,n.setMatrixArrayType=function(t){n.ARRAY_TYPE=t};var r=Math.PI/180;n.toRadian=function(t){return t*r},n.equals=function(t,e){return Math.abs(t-e)<=n.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))},t.exports=n},function(t,e){t.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iNHB4IiBoZWlnaHQ9IjE2cHgiIHZpZXdCb3g9Ii0wLjAzMSAwIDQgMTYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgLTAuMDMxIDAgNCAxNiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Y2lyY2xlIGZpbGw9IiNCMkIzQjMiIGN4PSIxLjk2OSIgY3k9IjQiIHI9IjEuNSIvPg0KPGNpcmNsZSBmaWxsPSIjQjJCM0IzIiBjeD0iMS45NjkiIGN5PSI4IiByPSIxLjUiLz4NCjxjaXJjbGUgZmlsbD0iI0IyQjNCMyIgY3g9IjEuOTY5IiBjeT0iMTIiIHI9IjEuNSIvPg0KPC9zdmc+DQo="},function(t,e,n){var r=n(3),i={create:function(){var t=new r.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat4:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},clone:function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},fromValues:function(t,e,n,i,o,s,a,l,u){var c=new r.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=i,c[4]=o,c[5]=s,c[6]=a,c[7]=l,c[8]=u,c},set:function(t,e,n,r,i,o,s,a,l,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=c*s-a*u,f=-c*o+a*l,d=u*o-s*l,p=n*h+r*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*r+i*u)*p,t[2]=(a*r-i*s)*p,t[3]=f*p,t[4]=(c*n-i*l)*p,t[5]=(-a*n+i*o)*p,t[6]=d*p,t[7]=(-u*n+r*l)*p,t[8]=(s*n-r*o)*p,t):null},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return t[0]=s*c-a*u,t[1]=i*u-r*c,t[2]=r*a-i*s,t[3]=a*l-o*c,t[4]=n*c-i*l,t[5]=i*o-n*a,t[6]=o*u-s*l,t[7]=r*l-n*u,t[8]=n*s-r*o,t},determinant:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],l=t[7],u=t[8];return e*(u*o-s*l)+n*(-u*i+s*a)+r*(l*i-o*a)},multiply:function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=n[0],d=n[1],p=n[2],g=n[3],m=n[4],_=n[5],v=n[6],b=n[7],x=n[8];return t[0]=f*r+d*s+p*u,t[1]=f*i+d*a+p*c,t[2]=f*o+d*l+p*h,t[3]=g*r+m*s+_*u,t[4]=g*i+m*a+_*c,t[5]=g*o+m*l+_*h,t[6]=v*r+b*s+x*u,t[7]=v*i+b*a+x*c,t[8]=v*o+b*l+x*h,t}};i.mul=i.multiply,i.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=f*r+d*s+u,t[7]=f*i+d*a+c,t[8]=f*o+d*l+h,t},i.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*s,t[1]=d*i+f*a,t[2]=d*o+f*l,t[3]=d*s-f*r,t[4]=d*a-f*i,t[5]=d*l-f*o,t[6]=u,t[7]=c,t[8]=h,t},i.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},i.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},i.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n+n,a=r+r,l=i+i,u=n*s,c=r*s,h=r*a,f=i*s,d=i*a,p=i*l,g=o*s,m=o*a,_=o*l;return t[0]=1-h-p,t[3]=c-_,t[6]=f+m,t[1]=c+_,t[4]=1-u-p,t[7]=d-g,t[2]=f-m,t[5]=d+g,t[8]=1-u-h,t},i.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],_=e[15],v=n*a-r*s,b=n*l-i*s,x=n*u-o*s,y=r*l-i*a,w=r*u-o*a,k=i*u-o*l,S=c*g-h*p,M=c*m-f*p,T=c*_-d*p,I=h*m-f*g,A=h*_-d*g,C=f*_-d*m,D=v*C-b*A+x*I+y*T-w*M+k*S;return D?(D=1/D,t[0]=(a*C-l*A+u*I)*D,t[1]=(l*T-s*C-u*M)*D,t[2]=(s*A-a*T+u*S)*D,t[3]=(i*A-r*C-o*I)*D,t[4]=(n*C-i*T+o*M)*D,t[5]=(r*T-n*A-o*S)*D,t[6]=(g*k-m*w+_*y)*D,t[7]=(m*x-p*k-_*b)*D,t[8]=(p*w-g*x+_*v)*D,t):null},i.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},i.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},i.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},i.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},i.equals=function(t,e){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=e[0],d=e[1],p=e[2],g=e[3],m=e[4],_=e[5],v=t[6],b=e[7],x=e[8];return Math.abs(n-f)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(a-m)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(l-_)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(u-v)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-b)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(h-x)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))},t.exports=i},function(t,e,n){var r,i=n(3),o={};o.create=function(){var t=new i.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},o.clone=function(t){var e=new i.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},o.fromValues=function(t,e,n){var r=new i.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=n,r},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},o.set=function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},o.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},o.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},o.sub=o.subtract,o.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t},o.mul=o.multiply,o.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t},o.div=o.divide,o.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},o.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},o.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},o.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},o.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},o.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},o.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},o.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)},o.dist=o.distance,o.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i},o.sqrDist=o.squaredDistance,o.length=function(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)},o.len=o.length,o.squaredLength=function(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r},o.sqrLen=o.squaredLength,o.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},o.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},o.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},o.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},o.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=i*l-o*a,t[1]=o*s-r*l,t[2]=r*a-i*s,t},o.lerp=function(t,e,n,r){var i=e[0],o=e[1],s=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=s+r*(n[2]-s),t},o.hermite=function(t,e,n,r,i,o){var s=o*o,a=s*(2*o-3)+1,l=s*(o-2)+o,u=s*(o-1),c=s*(3-2*o);return t[0]=e[0]*a+n[0]*l+r[0]*u+i[0]*c,t[1]=e[1]*a+n[1]*l+r[1]*u+i[1]*c,t[2]=e[2]*a+n[2]*l+r[2]*u+i[2]*c,t},o.bezier=function(t,e,n,r,i,o){var s=1-o,a=s*s,l=o*o,u=a*s,c=3*o*a,h=3*l*s,f=l*o;return t[0]=e[0]*u+n[0]*c+r[0]*h+i[0]*f,t[1]=e[1]*u+n[1]*c+r[1]*h+i[1]*f,t[2]=e[2]*u+n[2]*c+r[2]*h+i[2]*f,t},o.random=function(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI,r=2*i.RANDOM()-1,o=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=r*e,t},o.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[3]*r+n[7]*i+n[11]*o+n[15];return s=s||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/s,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/s,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/s,t},o.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},o.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],l=n[2],u=n[3],c=u*r+a*o-l*i,h=u*i+l*r-s*o,f=u*o+s*i-a*r,d=-s*r-a*i-l*o;return t[0]=c*u+d*-s+h*-l-f*-a,t[1]=h*u+d*-a+f*-s-c*-l,t[2]=f*u+d*-l+c*-a-h*-s,t},o.rotateX=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},o.rotateY=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},o.rotateZ=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},o.forEach=(r=o.create(),function(t,e,n,i,o,s){var a,l;for(e||(e=3),n||(n=0),l=i?Math.min(i*e+n,t.length):t.length,a=n;a<l;a+=e)r[0]=t[a],r[1]=t[a+1],r[2]=t[a+2],o(r,r,s),t[a]=r[0],t[a+1]=r[1],t[a+2]=r[2];return t}),o.angle=function(t,e){var n=o.fromValues(t[0],t[1],t[2]),r=o.fromValues(e[0],e[1],e[2]);o.normalize(n,n),o.normalize(r,r);var i=o.dot(n,r);return i>1?0:Math.acos(i)},o.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},o.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},o.equals=function(t,e){var n=t[0],r=t[1],o=t[2],s=e[0],a=e[1],l=e[2];return Math.abs(n-s)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(o-l)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))},t.exports=o},function(t,e,n){var r,i=n(3),o={};o.create=function(){var t=new i.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},o.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},o.fromValues=function(t,e,n,r){var o=new i.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},o.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},o.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},o.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t},o.sub=o.subtract,o.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},o.mul=o.multiply,o.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},o.div=o.divide,o.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},o.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},o.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},o.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},o.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},o.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},o.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},o.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+o*o)},o.dist=o.distance,o.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o},o.sqrDist=o.squaredDistance,o.length=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)},o.len=o.length,o.squaredLength=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i},o.sqrLen=o.squaredLength,o.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},o.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=o*s),t},o.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},o.lerp=function(t,e,n,r){var i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=s+r*(n[2]-s),t[3]=a+r*(n[3]-a),t},o.random=function(t,e){return e=e||1,t[0]=i.RANDOM(),t[1]=i.RANDOM(),t[2]=i.RANDOM(),t[3]=i.RANDOM(),o.normalize(t,t),o.scale(t,t,e),t},o.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*s,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*s,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*s,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*s,t},o.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],l=n[2],u=n[3],c=u*r+a*o-l*i,h=u*i+l*r-s*o,f=u*o+s*i-a*r,d=-s*r-a*i-l*o;return t[0]=c*u+d*-s+h*-l-f*-a,t[1]=h*u+d*-a+f*-s-c*-l,t[2]=f*u+d*-l+c*-a-h*-s,t[3]=e[3],t},o.forEach=(r=o.create(),function(t,e,n,i,o,s){var a,l;for(e||(e=4),n||(n=0),l=i?Math.min(i*e+n,t.length):t.length,a=n;a<l;a+=e)r[0]=t[a],r[1]=t[a+1],r[2]=t[a+2],r[3]=t[a+3],o(r,r,s),t[a]=r[0],t[a+1]=r[1],t[a+2]=r[2],t[a+3]=r[3];return t}),o.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},o.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},o.equals=function(t,e){var n=t[0],r=t[1],o=t[2],s=t[3],a=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-l)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-u)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))},t.exports=o},function(t,e,n){t.exports=function(){return n(10)('!function(n){var r={};function t(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=r,t.d=function(n,r,e){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:e})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(1&r&&(n=t(n)),8&r)return n;if(4&r&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(t.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&r&&"string"!=typeof n)for(var o in n)t.d(e,o,function(r){return n[r]}.bind(null,o));return e},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=4)}([function(n,r,t){n.exports={hcluster:t(5),Kmeans:t(3),kmeans:t(3).kmeans}},function(n,r,t){var e;n.exports=(function(n,r){var t=n.utils.isFunction;function e(n,r){return n-r}function o(n,t,e){return r.max(t,r.min(n,e))}n.sum=function(n){for(var r=0,t=n.length;--t>=0;)r+=n[t];return r},n.sumsqrd=function(n){for(var r=0,t=n.length;--t>=0;)r+=n[t]*n[t];return r},n.sumsqerr=function(r){for(var t,e=n.mean(r),o=0,i=r.length;--i>=0;)o+=(t=r[i]-e)*t;return o},n.sumrow=function(n){for(var r=0,t=n.length;--t>=0;)r+=n[t];return r},n.product=function(n){for(var r=1,t=n.length;--t>=0;)r*=n[t];return r},n.min=function(n){for(var r=n[0],t=0;++t<n.length;)n[t]<r&&(r=n[t]);return r},n.max=function(n){for(var r=n[0],t=0;++t<n.length;)n[t]>r&&(r=n[t]);return r},n.unique=function(n){for(var r={},t=[],e=0;e<n.length;e++)r[n[e]]||(r[n[e]]=!0,t.push(n[e]));return t},n.mean=function(r){return n.sum(r)/r.length},n.meansqerr=function(r){return n.sumsqerr(r)/r.length},n.geomean=function(t){return r.pow(n.product(t),1/t.length)},n.median=function(n){var r=n.length,t=n.slice().sort(e);return 1&r?t[r/2|0]:(t[r/2-1]+t[r/2])/2},n.cumsum=function(r){return n.cumreduce(r,(function(n,r){return n+r}))},n.cumprod=function(r){return n.cumreduce(r,(function(n,r){return n*r}))},n.diff=function(n){var r,t=[],e=n.length;for(r=1;r<e;r++)t.push(n[r]-n[r-1]);return t},n.rank=function(n){for(var r,t=n.length,o=n.slice().sort(e),i=new Array(t),a=0;a<t;a++){var u=o.indexOf(n[a]),f=o.lastIndexOf(n[a]);r=u===f?u:(u+f)/2,i[a]=r+1}return i},n.mode=function(n){var r,t=n.length,o=n.slice().sort(e),i=1,a=0,u=0,f=[];for(r=0;r<t;r++)o[r]===o[r+1]?i++:(i>a?(f=[o[r]],a=i,u=0):i===a&&(f.push(o[r]),u++),i=1);return 0===u?f[0]:f},n.range=function(r){return n.max(r)-n.min(r)},n.variance=function(r,t){return n.sumsqerr(r)/(r.length-(t?1:0))},n.pooledvariance=function(r){return r.reduce((function(r,t){return r+n.sumsqerr(t)}),0)/(r.reduce((function(n,r){return n+r.length}),0)-r.length)},n.deviation=function(r){for(var t=n.mean(r),e=r.length,o=new Array(e),i=0;i<e;i++)o[i]=r[i]-t;return o},n.stdev=function(t,e){return r.sqrt(n.variance(t,e))},n.pooledstdev=function(t){return r.sqrt(n.pooledvariance(t))},n.meandev=function(t){for(var e=n.mean(t),o=[],i=t.length-1;i>=0;i--)o.push(r.abs(t[i]-e));return n.mean(o)},n.meddev=function(t){for(var e=n.median(t),o=[],i=t.length-1;i>=0;i--)o.push(r.abs(t[i]-e));return n.median(o)},n.coeffvar=function(r){return n.stdev(r)/n.mean(r)},n.quartiles=function(n){var t=n.length,o=n.slice().sort(e);return[o[r.round(t/4)-1],o[r.round(t/2)-1],o[r.round(3*t/4)-1]]},n.quantiles=function(n,t,i,a){var u,f,s,c,l,m=n.slice().sort(e),d=[t.length],h=n.length;for(void 0===i&&(i=3/8),void 0===a&&(a=3/8),u=0;u<t.length;u++)s=h*(f=t[u])+(i+f*(1-i-a)),c=r.floor(o(s,1,h-1)),l=o(s-c,0,1),d[u]=(1-l)*m[c-1]+l*m[c];return d},n.percentile=function(n,r,t){var o=n.slice().sort(e),i=r*(o.length+(t?1:-1))+(t?0:1),a=parseInt(i),u=i-a;return a+1<o.length?o[a-1]+u*(o[a]-o[a-1]):o[a-1]},n.percentileOfScore=function(n,r,t){var e,o,i=0,a=n.length,u=!1;for("strict"===t&&(u=!0),o=0;o<a;o++)e=n[o],(u&&e<r||!u&&e<=r)&&i++;return i/a},n.histogram=function(t,e){e=e||4;var o,i=n.min(t),a=(n.max(t)-i)/e,u=t.length,f=[];for(o=0;o<e;o++)f[o]=0;for(o=0;o<u;o++)f[r.min(r.floor((t[o]-i)/a),e-1)]+=1;return f},n.covariance=function(r,t){var e,o=n.mean(r),i=n.mean(t),a=r.length,u=new Array(a);for(e=0;e<a;e++)u[e]=(r[e]-o)*(t[e]-i);return n.sum(u)/(a-1)},n.corrcoeff=function(r,t){return n.covariance(r,t)/n.stdev(r,1)/n.stdev(t,1)},n.spearmancoeff=function(r,t){return r=n.rank(r),t=n.rank(t),n.corrcoeff(r,t)},n.stanMoment=function(t,e){for(var o=n.mean(t),i=n.stdev(t),a=t.length,u=0,f=0;f<a;f++)u+=r.pow((t[f]-o)/i,e);return u/t.length},n.skewness=function(r){return n.stanMoment(r,3)},n.kurtosis=function(r){return n.stanMoment(r,4)-3};var i=n.prototype;!function(r){for(var e=0;e<r.length;e++)!function(r){i[r]=function(e,o){var a=[],u=0,f=this;if(t(e)&&(o=e,e=!1),o)return setTimeout((function(){o.call(f,i[r].call(f,e))})),this;if(this.length>1){for(f=!0===e?this:this.transpose();u<f.length;u++)a[u]=n[r](f[u]);return a}return n[r](this[0],e)}}(r[e])}("cumsum cumprod".split(" ")),function(r){for(var e=0;e<r.length;e++)!function(r){i[r]=function(e,o){var a=[],u=0,f=this;if(t(e)&&(o=e,e=!1),o)return setTimeout((function(){o.call(f,i[r].call(f,e))})),this;if(this.length>1){for("sumrow"!==r&&(f=!0===e?this:this.transpose());u<f.length;u++)a[u]=n[r](f[u]);return!0===e?n[r](n.utils.toVector(a)):a}return n[r](this[0],e)}}(r[e])}("sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis".split(" ")),function(r){for(var e=0;e<r.length;e++)!function(r){i[r]=function(){var e,o=[],a=0,u=this,f=Array.prototype.slice.call(arguments);if(t(f[f.length-1])){e=f[f.length-1];var s=f.slice(0,f.length-1);return setTimeout((function(){e.call(u,i[r].apply(u,s))})),this}e=void 0;var c=function(t){return n[r].apply(u,[t].concat(f))};if(this.length>1){for(u=u.transpose();a<u.length;a++)o[a]=c(u[a]);return o}return c(this[0])}}(r[e])}("quantiles percentileOfScore".split(" "))}(e=function(n,r){var t=Array.prototype.concat,e=Array.prototype.slice,o=Object.prototype.toString;function i(r,t){var e=r>t?r:t;return n.pow(10,17-~~(n.log(e>0?e:-e)*n.LOG10E))}var a=Array.isArray||function(n){return"[object Array]"===o.call(n)};function u(n){return"[object Function]"===o.call(n)}function f(n){return"number"==typeof n&&n==n}function s(){return new s._init(arguments)}function c(){return 0}function l(){return 1}function m(n,r){return n===r?1:0}s.fn=s.prototype,s._init=function(n){if(a(n[0]))if(a(n[0][0])){u(n[1])&&(n[0]=s.map(n[0],n[1]));for(var r=0;r<n[0].length;r++)this[r]=n[0][r];this.length=n[0].length}else this[0]=u(n[1])?s.map(n[0],n[1]):n[0],this.length=1;else if(f(n[0]))this[0]=s.seq.apply(null,n),this.length=1;else{if(n[0]instanceof s)return s(n[0].toArray());this[0]=[],this.length=1}return this},s._init.prototype=s.prototype,s._init.constructor=s,s.utils={calcRdx:i,isArray:a,isFunction:u,isNumber:f,toVector:function(n){return t.apply([],n)}},s._random_fn=n.random,s.setRandom=function(n){if("function"!=typeof n)throw new TypeError("fn is not a function");s._random_fn=n},s.extend=function(n){var r,t;if(1===arguments.length){for(t in n)s[t]=n[t];return this}for(r=1;r<arguments.length;r++)for(t in arguments[r])n[t]=arguments[r][t];return n},s.rows=function(n){return n.length||1},s.cols=function(n){return n[0].length||1},s.dimensions=function(n){return{rows:s.rows(n),cols:s.cols(n)}},s.row=function(n,r){return a(r)?r.map((function(r){return s.row(n,r)})):n[r]},s.rowa=function(n,r){return s.row(n,r)},s.col=function(n,r){if(a(r)){var t=s.arange(n.length).map((function(){return new Array(r.length)}));return r.forEach((function(r,e){s.arange(n.length).forEach((function(o){t[o][e]=n[o][r]}))})),t}for(var e=new Array(n.length),o=0;o<n.length;o++)e[o]=[n[o][r]];return e},s.cola=function(n,r){return s.col(n,r).map((function(n){return n[0]}))},s.diag=function(n){for(var r=s.rows(n),t=new Array(r),e=0;e<r;e++)t[e]=[n[e][e]];return t},s.antidiag=function(n){for(var r=s.rows(n)-1,t=new Array(r),e=0;r>=0;r--,e++)t[e]=[n[e][r]];return t},s.transpose=function(n){var r,t,e,o,i,u=[];for(a(n[0])||(n=[n]),t=n.length,e=n[0].length,i=0;i<e;i++){for(r=new Array(t),o=0;o<t;o++)r[o]=n[o][i];u.push(r)}return 1===u.length?u[0]:u},s.map=function(n,r,t){var e,o,i,u,f;for(a(n[0])||(n=[n]),o=n.length,i=n[0].length,u=t?n:new Array(o),e=0;e<o;e++)for(u[e]||(u[e]=new Array(i)),f=0;f<i;f++)u[e][f]=r(n[e][f],e,f);return 1===u.length?u[0]:u},s.cumreduce=function(n,r,t){var e,o,i,u,f;for(a(n[0])||(n=[n]),o=n.length,i=n[0].length,u=t?n:new Array(o),e=0;e<o;e++)for(u[e]||(u[e]=new Array(i)),i>0&&(u[e][0]=n[e][0]),f=1;f<i;f++)u[e][f]=r(u[e][f-1],n[e][f]);return 1===u.length?u[0]:u},s.alter=function(n,r){return s.map(n,r,!0)},s.create=function(n,r,t){var e,o,i=new Array(n);for(u(r)&&(t=r,r=n),e=0;e<n;e++)for(i[e]=new Array(r),o=0;o<r;o++)i[e][o]=t(e,o);return i},s.zeros=function(n,r){return f(r)||(r=n),s.create(n,r,c)},s.ones=function(n,r){return f(r)||(r=n),s.create(n,r,l)},s.rand=function(n,r){return f(r)||(r=n),s.create(n,r,s._random_fn)},s.identity=function(n,r){return f(r)||(r=n),s.create(n,r,m)},s.symmetric=function(n){var r,t,e=n.length;if(n.length!==n[0].length)return!1;for(r=0;r<e;r++)for(t=0;t<e;t++)if(n[t][r]!==n[r][t])return!1;return!0},s.clear=function(n){return s.alter(n,c)},s.seq=function(n,r,t,e){u(e)||(e=!1);var o,a=[],f=i(n,r),s=(r*f-n*f)/((t-1)*f),c=n;for(o=0;c<=r&&o<t;c=(n*f+s*f*++o)/f)a.push(e?e(c,o):c);return a},s.arange=function(n,t,e){var o,i=[];if(e=e||1,t===r&&(t=n,n=0),n===t||0===e)return[];if(n<t&&e<0)return[];if(n>t&&e>0)return[];if(e>0)for(o=n;o<t;o+=e)i.push(o);else for(o=n;o>t;o+=e)i.push(o);return i},s.slice=function(){function n(n,t,e,o){var i,a=[],u=n.length;if(t===r&&e===r&&o===r)return s.copy(n);if(o=o||1,(t=(t=t||0)>=0?t:u+t)===(e=(e=e||n.length)>=0?e:u+e)||0===o)return[];if(t<e&&o<0)return[];if(t>e&&o>0)return[];if(o>0)for(i=t;i<e;i+=o)a.push(n[i]);else for(i=t;i>e;i+=o)a.push(n[i]);return a}return function(r,t){var e,o;return f((t=t||{}).row)?f(t.col)?r[t.row][t.col]:n(s.rowa(r,t.row),(e=t.col||{}).start,e.end,e.step):f(t.col)?n(s.cola(r,t.col),(o=t.row||{}).start,o.end,o.step):(o=t.row||{},e=t.col||{},n(r,o.start,o.end,o.step).map((function(r){return n(r,e.start,e.end,e.step)})))}}(),s.sliceAssign=function(t,e,o){var i,a;if(f(e.row)){if(f(e.col))return t[e.row][e.col]=o;e.col=e.col||{},e.col.start=e.col.start||0,e.col.end=e.col.end||t[0].length,e.col.step=e.col.step||1,i=s.arange(e.col.start,n.min(t.length,e.col.end),e.col.step);var u=e.row;return i.forEach((function(n,r){t[u][n]=o[r]})),t}if(f(e.col)){e.row=e.row||{},e.row.start=e.row.start||0,e.row.end=e.row.end||t.length,e.row.step=e.row.step||1,a=s.arange(e.row.start,n.min(t[0].length,e.row.end),e.row.step);var c=e.col;return a.forEach((function(n,r){t[n][c]=o[r]})),t}return o[0].length===r&&(o=[o]),e.row.start=e.row.start||0,e.row.end=e.row.end||t.length,e.row.step=e.row.step||1,e.col.start=e.col.start||0,e.col.end=e.col.end||t[0].length,e.col.step=e.col.step||1,a=s.arange(e.row.start,n.min(t.length,e.row.end),e.row.step),i=s.arange(e.col.start,n.min(t[0].length,e.col.end),e.col.step),a.forEach((function(n,r){i.forEach((function(e,i){t[n][e]=o[r][i]}))})),t},s.diagonal=function(n){var r=s.zeros(n.length,n.length);return n.forEach((function(n,t){r[t][t]=n})),r},s.copy=function(n){return n.map((function(n){return f(n)?n:n.map((function(n){return n}))}))};var d=s.prototype;return d.length=0,d.push=Array.prototype.push,d.sort=Array.prototype.sort,d.splice=Array.prototype.splice,d.slice=Array.prototype.slice,d.toArray=function(){return this.length>1?e.call(this):e.call(this)[0]},d.map=function(n,r){return s(s.map(this,n,r))},d.cumreduce=function(n,r){return s(s.cumreduce(this,n,r))},d.alter=function(n){return s.alter(this,n),this},function(n){for(var r=0;r<n.length;r++)!function(n){d[n]=function(r){var t,e=this;return r?(setTimeout((function(){r.call(e,d[n].call(e))})),this):(t=s[n](this),a(t)?s(t):t)}}(n[r])}("transpose clear symmetric rows cols dimensions diag antidiag".split(" ")),function(n){for(var r=0;r<n.length;r++)!function(n){d[n]=function(r,t){var e=this;return t?(setTimeout((function(){t.call(e,d[n].call(e,r))})),this):s(s[n](this,r))}}(n[r])}("row col".split(" ")),function(n){for(var r=0;r<n.length;r++)!function(n){d[n]=function(){return s(s[n].apply(null,arguments))}}(n[r])}("create zeros ones rand identity".split(" ")),s}(Math),Math),function(n,r){n.gammaln=function(n){var t,e,o,i=0,a=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],u=1.000000000190015;for(o=(e=t=n)+5.5,o-=(t+.5)*r.log(o);i<6;i++)u+=a[i]/++e;return r.log(2.5066282746310007*u/t)-o},n.loggam=function(n){var t,e,o,i,a,u,f,s=[.08333333333333333,-.002777777777777778,.0007936507936507937,-.0005952380952380952,.0008417508417508418,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059];if(t=n,f=0,1==n||2==n)return 0;for(n<=7&&(t=n+(f=r.floor(7-n))),e=1/(t*t),o=2*r.PI,a=s[9],u=8;u>=0;u--)a*=e,a+=s[u];if(i=a/t+.5*r.log(o)+(t-.5)*r.log(t)-t,n<=7)for(u=1;u<=f;u++)i-=r.log(t-1),t-=1;return i},n.gammafn=function(n){var t,e,o,i,a=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],u=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],f=!1,s=0,c=0,l=0,m=n;if(m<=0){if(!(i=m%1+36e-17))return 1/0;f=(1&m?-1:1)*r.PI/r.sin(r.PI*i),m=1-m}for(o=m,e=m<1?m++:(m-=s=(0|m)-1)-1,t=0;t<8;++t)l=(l+a[t])*e,c=c*e+u[t];if(i=l/c+1,o<m)i/=o;else if(o>m)for(t=0;t<s;++t)i*=m,m++;return f&&(i=f/i),i},n.gammap=function(r,t){return n.lowRegGamma(r,t)*n.gammafn(r)},n.lowRegGamma=function(t,e){var o,i=n.gammaln(t),a=t,u=1/t,f=u,s=e+1-t,c=1/1e-30,l=1/s,m=l,d=1,h=-~(8.5*r.log(t>=1?t:1/t)+.4*t+17);if(e<0||t<=0)return NaN;if(e<t+1){for(;d<=h;d++)u+=f*=e/++a;return u*r.exp(-e+t*r.log(e)-i)}for(;d<=h;d++)m*=(l=1/(l=(o=-d*(d-t))*l+(s+=2)))*(c=s+o/c);return 1-m*r.exp(-e+t*r.log(e)-i)},n.factorialln=function(r){return r<0?NaN:n.gammaln(r+1)},n.factorial=function(r){return r<0?NaN:n.gammafn(r+1)},n.combination=function(t,e){return t>170||e>170?r.exp(n.combinationln(t,e)):n.factorial(t)/n.factorial(e)/n.factorial(t-e)},n.combinationln=function(r,t){return n.factorialln(r)-n.factorialln(t)-n.factorialln(r-t)},n.permutation=function(r,t){return n.factorial(r)/n.factorial(r-t)},n.betafn=function(t,e){if(!(t<=0||e<=0))return t+e>170?r.exp(n.betaln(t,e)):n.gammafn(t)*n.gammafn(e)/n.gammafn(t+e)},n.betaln=function(r,t){return n.gammaln(r)+n.gammaln(t)-n.gammaln(r+t)},n.betacf=function(n,t,e){var o,i,a,u,f=1,s=t+e,c=t+1,l=t-1,m=1,d=1-s*n/c;for(r.abs(d)<1e-30&&(d=1e-30),u=d=1/d;f<=100&&(d=1+(i=f*(e-f)*n/((l+(o=2*f))*(t+o)))*d,r.abs(d)<1e-30&&(d=1e-30),m=1+i/m,r.abs(m)<1e-30&&(m=1e-30),u*=(d=1/d)*m,d=1+(i=-(t+f)*(s+f)*n/((t+o)*(c+o)))*d,r.abs(d)<1e-30&&(d=1e-30),m=1+i/m,r.abs(m)<1e-30&&(m=1e-30),u*=a=(d=1/d)*m,!(r.abs(a-1)<3e-7));f++);return u},n.gammapinv=function(t,e){var o,i,a,u,f,s,c=0,l=e-1,m=n.gammaln(e);if(t>=1)return r.max(100,e+100*r.sqrt(e));if(t<=0)return 0;for(e>1?(f=r.log(l),s=r.exp(l*(f-1)-m),u=t<.5?t:1-t,o=(2.30753+.27061*(i=r.sqrt(-2*r.log(u))))/(1+i*(.99229+.04481*i))-i,t<.5&&(o=-o),o=r.max(.001,e*r.pow(1-1/(9*e)-o/(3*r.sqrt(e)),3))):o=t<(i=1-e*(.253+.12*e))?r.pow(t/i,1/e):1-r.log(1-(t-i)/(1-i));c<12;c++){if(o<=0)return 0;if((o-=i=(a=(n.lowRegGamma(e,o)-t)/(i=e>1?s*r.exp(-(o-l)+l*(r.log(o)-f)):r.exp(-o+l*r.log(o)-m)))/(1-.5*r.min(1,a*((e-1)/o-1))))<=0&&(o=.5*(o+i)),r.abs(i)<1e-8*o)break}return o},n.erf=function(n){var t,e,o,i,a=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18],u=a.length-1,f=!1,s=0,c=0;for(n<0&&(n=-n,f=!0),e=4*(t=2/(2+n))-2;u>0;u--)o=s,s=e*s-c+a[u],c=o;return i=t*r.exp(-n*n+.5*(a[0]+e*s)-c),f?i-1:1-i},n.erfc=function(r){return 1-n.erf(r)},n.erfcinv=function(t){var e,o,i,a,u=0;if(t>=2)return-100;if(t<=0)return 100;for(a=t<1?t:2-t,e=-.70711*((2.30753+.27061*(i=r.sqrt(-2*r.log(a/2))))/(1+i*(.99229+.04481*i))-i);u<2;u++)e+=(o=n.erfc(e)-a)/(1.1283791670955126*r.exp(-e*e)-e*o);return t<1?e:-e},n.ibetainv=function(t,e,o){var i,a,u,f,s,c,l,m,d,h,g=e-1,p=o-1,v=0;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&o>=1?(u=t<.5?t:1-t,c=(2.30753+.27061*(f=r.sqrt(-2*r.log(u))))/(1+f*(.99229+.04481*f))-f,t<.5&&(c=-c),l=(c*c-3)/6,m=2/(1/(2*e-1)+1/(2*o-1)),d=c*r.sqrt(l+m)/m-(1/(2*o-1)-1/(2*e-1))*(l+5/6-2/(3*m)),c=e/(e+o*r.exp(2*d))):(i=r.log(e/(e+o)),a=r.log(o/(e+o)),c=t<(f=r.exp(e*i)/e)/(d=f+(s=r.exp(o*a)/o))?r.pow(e*d*t,1/e):1-r.pow(o*d*(1-t),1/o)),h=-n.gammaln(e)-n.gammaln(o)+n.gammaln(e+o);v<10;v++){if(0===c||1===c)return c;if((c-=f=(s=(n.ibeta(c,e,o)-t)/(f=r.exp(g*r.log(c)+p*r.log(1-c)+h)))/(1-.5*r.min(1,s*(g/c-p/(1-c)))))<=0&&(c=.5*(c+f)),c>=1&&(c=.5*(c+f+1)),r.abs(f)<1e-8*c&&v>0)break}return c},n.ibeta=function(t,e,o){var i=0===t||1===t?0:r.exp(n.gammaln(e+o)-n.gammaln(e)-n.gammaln(o)+e*r.log(t)+o*r.log(1-t));return!(t<0||t>1)&&(t<(e+1)/(e+o+2)?i*n.betacf(t,e,o)/e:1-i*n.betacf(1-t,o,e)/o)},n.randn=function(t,e){var o,i,a,u,f;if(e||(e=t),t)return n.create(t,e,(function(){return n.randn()}));do{o=n._random_fn(),i=1.7156*(n._random_fn()-.5),f=(a=o-.449871)*a+(u=r.abs(i)+.386595)*(.196*u-.25472*a)}while(f>.27597&&(f>.27846||i*i>-4*r.log(o)*o*o));return i/o},n.randg=function(t,e,o){var i,a,u,f,s,c,l=t;if(o||(o=e),t||(t=1),e)return(c=n.zeros(e,o)).alter((function(){return n.randg(t)})),c;t<1&&(t+=1),i=t-1/3,a=1/r.sqrt(9*i);do{do{f=1+a*(s=n.randn())}while(f<=0);f*=f*f,u=n._random_fn()}while(u>1-.331*r.pow(s,4)&&r.log(u)>.5*s*s+i*(1-f+r.log(f)));if(t==l)return i*f;do{u=n._random_fn()}while(0===u);return r.pow(u,1/l)*i*f},function(r){for(var t=0;t<r.length;t++)!function(r){n.fn[r]=function(){return n(n.map(this,(function(t){return n[r](t)})))}}(r[t])}("gammaln gammafn factorial factorialln".split(" ")),function(r){for(var t=0;t<r.length;t++)!function(r){n.fn[r]=function(){return n(n[r].apply(null,arguments))}}(r[t])}("randn".split(" "))}(e,Math),function(n,r){function t(n,t,e,o){for(var i,a=0,u=1,f=1,s=1,c=0,l=0;r.abs((f-l)/f)>o;)l=f,u=s+(i=-(t+c)*(t+e+c)*n/(t+2*c)/(t+2*c+1))*u,f=(a=f+i*a)+(i=(c+=1)*(e-c)*n/(t+2*c-1)/(t+2*c))*f,a/=s=u+i*s,u/=s,f/=s,s=1;return f/t}function e(t,e,o){var i=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],a=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],u=.5*t;if(u>=8)return 1;var f,s=2*n.normal.cdf(u,0,1,1,0)-1;s=s>=r.exp(-50/o)?r.pow(s,o):0;for(var c=u,l=(8-u)/(f=t>3?2:3),m=c+l,d=0,h=o-1,g=1;g<=f;g++){for(var p=0,v=.5*(m+c),y=.5*(m-c),w=1;w<=12;w++){var x,b=v+y*(6<w?i[(x=12-w+1)-1]:-i[(x=w)-1]),q=b*b;if(q>60)break;var k=2*n.normal.cdf(b,0,1,1,0)*.5-2*n.normal.cdf(b,t,1,1,0)*.5;k>=r.exp(-30/h)&&(p+=k=a[x-1]*r.exp(-.5*q)*r.pow(k,h))}d+=p*=2*y*o/r.sqrt(2*r.PI),c=m,m+=l}return(s+=d)<=r.exp(-30/e)?0:(s=r.pow(s,e))>=1?1:s}!function(r){for(var t=0;t<r.length;t++)!function(r){n[r]=function(n,r,t){return this instanceof arguments.callee?(this._a=n,this._b=r,this._c=t,this):new arguments.callee(n,r,t)},n.fn[r]=function(t,e,o){var i=n[r](t,e,o);return i.data=this,i},n[r].prototype.sample=function(t){var e=this._a,o=this._b,i=this._c;return t?n.alter(t,(function(){return n[r].sample(e,o,i)})):n[r].sample(e,o,i)},function(t){for(var e=0;e<t.length;e++)!function(t){n[r].prototype[t]=function(e){var o=this._a,i=this._b,a=this._c;return e||0===e||(e=this.data),"number"!=typeof e?n.fn.map.call(e,(function(e){return n[r][t](e,o,i,a)})):n[r][t](e,o,i,a)}}(t[e])}("pdf cdf inv".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){n[r].prototype[t]=function(){return n[r][t](this._a,this._b,this._c)}}(t[e])}("mean median mode variance".split(" "))}(r[t])}("beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine".split(" ")),n.extend(n.beta,{pdf:function(t,e,o){return t>1||t<0?0:1==e&&1==o?1:e<512&&o<512?r.pow(t,e-1)*r.pow(1-t,o-1)/n.betafn(e,o):r.exp((e-1)*r.log(t)+(o-1)*r.log(1-t)-n.betaln(e,o))},cdf:function(r,t,e){return r>1||r<0?1*(r>1):n.ibeta(r,t,e)},inv:function(r,t,e){return n.ibetainv(r,t,e)},mean:function(n,r){return n/(n+r)},median:function(r,t){return n.ibetainv(.5,r,t)},mode:function(n,r){return(n-1)/(n+r-2)},sample:function(r,t){var e=n.randg(r);return e/(e+n.randg(t))},variance:function(n,t){return n*t/(r.pow(n+t,2)*(n+t+1))}}),n.extend(n.centralF,{pdf:function(t,e,o){var i;return t<0?0:e<=2?0===t&&e<2?1/0:0===t&&2===e?1:1/n.betafn(e/2,o/2)*r.pow(e/o,e/2)*r.pow(t,e/2-1)*r.pow(1+e/o*t,-(e+o)/2):(i=e*t/(o+t*e),e*(o/(o+t*e))/2*n.binomial.pdf((e-2)/2,(e+o-2)/2,i))},cdf:function(r,t,e){return r<0?0:n.ibeta(t*r/(t*r+e),t/2,e/2)},inv:function(r,t,e){return e/(t*(1/n.ibetainv(r,t/2,e/2)-1))},mean:function(n,r){return r>2?r/(r-2):void 0},mode:function(n,r){return n>2?r*(n-2)/(n*(r+2)):void 0},sample:function(r,t){return 2*n.randg(r/2)/r/(2*n.randg(t/2)/t)},variance:function(n,r){if(!(r<=4))return 2*r*r*(n+r-2)/(n*(r-2)*(r-2)*(r-4))}}),n.extend(n.cauchy,{pdf:function(n,t,e){return e<0?0:e/(r.pow(n-t,2)+r.pow(e,2))/r.PI},cdf:function(n,t,e){return r.atan((n-t)/e)/r.PI+.5},inv:function(n,t,e){return t+e*r.tan(r.PI*(n-.5))},median:function(n){return n},mode:function(n){return n},sample:function(t,e){return n.randn()*r.sqrt(1/(2*n.randg(.5)))*e+t}}),n.extend(n.chisquare,{pdf:function(t,e){return t<0?0:0===t&&2===e?.5:r.exp((e/2-1)*r.log(t)-t/2-e/2*r.log(2)-n.gammaln(e/2))},cdf:function(r,t){return r<0?0:n.lowRegGamma(t/2,r/2)},inv:function(r,t){return 2*n.gammapinv(r,.5*t)},mean:function(n){return n},median:function(n){return n*r.pow(1-2/(9*n),3)},mode:function(n){return n-2>0?n-2:0},sample:function(r){return 2*n.randg(r/2)},variance:function(n){return 2*n}}),n.extend(n.exponential,{pdf:function(n,t){return n<0?0:t*r.exp(-t*n)},cdf:function(n,t){return n<0?0:1-r.exp(-t*n)},inv:function(n,t){return-r.log(1-n)/t},mean:function(n){return 1/n},median:function(n){return 1/n*r.log(2)},mode:function(){return 0},sample:function(t){return-1/t*r.log(n._random_fn())},variance:function(n){return r.pow(n,-2)}}),n.extend(n.gamma,{pdf:function(t,e,o){return t<0?0:0===t&&1===e?1/o:r.exp((e-1)*r.log(t)-t/o-n.gammaln(e)-e*r.log(o))},cdf:function(r,t,e){return r<0?0:n.lowRegGamma(t,r/e)},inv:function(r,t,e){return n.gammapinv(r,t)*e},mean:function(n,r){return n*r},mode:function(n,r){if(n>1)return(n-1)*r},sample:function(r,t){return n.randg(r)*t},variance:function(n,r){return n*r*r}}),n.extend(n.invgamma,{pdf:function(t,e,o){return t<=0?0:r.exp(-(e+1)*r.log(t)-o/t-n.gammaln(e)+e*r.log(o))},cdf:function(r,t,e){return r<=0?0:1-n.lowRegGamma(t,e/r)},inv:function(r,t,e){return e/n.gammapinv(1-r,t)},mean:function(n,r){return n>1?r/(n-1):void 0},mode:function(n,r){return r/(n+1)},sample:function(r,t){return t/n.randg(r)},variance:function(n,r){if(!(n<=2))return r*r/((n-1)*(n-1)*(n-2))}}),n.extend(n.kumaraswamy,{pdf:function(n,t,e){return 0===n&&1===t?e:1===n&&1===e?t:r.exp(r.log(t)+r.log(e)+(t-1)*r.log(n)+(e-1)*r.log(1-r.pow(n,t)))},cdf:function(n,t,e){return n<0?0:n>1?1:1-r.pow(1-r.pow(n,t),e)},inv:function(n,t,e){return r.pow(1-r.pow(1-n,1/e),1/t)},mean:function(r,t){return t*n.gammafn(1+1/r)*n.gammafn(t)/n.gammafn(1+1/r+t)},median:function(n,t){return r.pow(1-r.pow(2,-1/t),1/n)},mode:function(n,t){if(n>=1&&t>=1&&1!==n&&1!==t)return r.pow((n-1)/(n*t-1),1/n)},variance:function(){throw new Error("variance not yet implemented")}}),n.extend(n.lognormal,{pdf:function(n,t,e){return n<=0?0:r.exp(-r.log(n)-.5*r.log(2*r.PI)-r.log(e)-r.pow(r.log(n)-t,2)/(2*e*e))},cdf:function(t,e,o){return t<0?0:.5+.5*n.erf((r.log(t)-e)/r.sqrt(2*o*o))},inv:function(t,e,o){return r.exp(-1.4142135623730951*o*n.erfcinv(2*t)+e)},mean:function(n,t){return r.exp(n+t*t/2)},median:function(n){return r.exp(n)},mode:function(n,t){return r.exp(n-t*t)},sample:function(t,e){return r.exp(n.randn()*e+t)},variance:function(n,t){return(r.exp(t*t)-1)*r.exp(2*n+t*t)}}),n.extend(n.noncentralt,{pdf:function(t,e,o){return r.abs(o)<1e-14?n.studentt.pdf(t,e):r.abs(t)<1e-14?r.exp(n.gammaln((e+1)/2)-o*o/2-.5*r.log(r.PI*e)-n.gammaln(e/2)):e/t*(n.noncentralt.cdf(t*r.sqrt(1+2/e),e+2,o)-n.noncentralt.cdf(t,e,o))},cdf:function(t,e,o){if(r.abs(o)<1e-14)return n.studentt.cdf(t,e);var i=!1;t<0&&(i=!0,o=-o);for(var a=n.normal.cdf(-o,0,1),u=1e-14+1,f=u,s=t*t/(t*t+e),c=0,l=r.exp(-o*o/2),m=r.exp(-o*o/2-.5*r.log(2)-n.gammaln(1.5))*o;c<200||f>1e-14||u>1e-14;)f=u,c>0&&(l*=o*o/(2*c),m*=o*o/(2*(c+.5))),a+=.5*(u=l*n.beta.cdf(s,c+.5,e/2)+m*n.beta.cdf(s,c+1,e/2)),c++;return i?1-a:a}}),n.extend(n.normal,{pdf:function(n,t,e){return r.exp(-.5*r.log(2*r.PI)-r.log(e)-r.pow(n-t,2)/(2*e*e))},cdf:function(t,e,o){return.5*(1+n.erf((t-e)/r.sqrt(2*o*o)))},inv:function(r,t,e){return-1.4142135623730951*e*n.erfcinv(2*r)+t},mean:function(n){return n},median:function(n){return n},mode:function(n){return n},sample:function(r,t){return n.randn()*t+r},variance:function(n,r){return r*r}}),n.extend(n.pareto,{pdf:function(n,t,e){return n<t?0:e*r.pow(t,e)/r.pow(n,e+1)},cdf:function(n,t,e){return n<t?0:1-r.pow(t/n,e)},inv:function(n,t,e){return t/r.pow(1-n,1/e)},mean:function(n,t){if(!(t<=1))return t*r.pow(n,t)/(t-1)},median:function(n,t){return n*(t*r.SQRT2)},mode:function(n){return n},variance:function(n,t){if(!(t<=2))return n*n*t/(r.pow(t-1,2)*(t-2))}}),n.extend(n.studentt,{pdf:function(t,e){return e=e>1e100?1e100:e,1/(r.sqrt(e)*n.betafn(.5,e/2))*r.pow(1+t*t/e,-(e+1)/2)},cdf:function(t,e){var o=e/2;return n.ibeta((t+r.sqrt(t*t+e))/(2*r.sqrt(t*t+e)),o,o)},inv:function(t,e){var o=n.ibetainv(2*r.min(t,1-t),.5*e,.5);return o=r.sqrt(e*(1-o)/o),t>.5?o:-o},mean:function(n){return n>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(t){return n.randn()*r.sqrt(t/(2*n.randg(t/2)))},variance:function(n){return n>2?n/(n-2):n>1?1/0:void 0}}),n.extend(n.weibull,{pdf:function(n,t,e){return n<0||t<0||e<0?0:e/t*r.pow(n/t,e-1)*r.exp(-r.pow(n/t,e))},cdf:function(n,t,e){return n<0?0:1-r.exp(-r.pow(n/t,e))},inv:function(n,t,e){return t*r.pow(-r.log(1-n),1/e)},mean:function(r,t){return r*n.gammafn(1+1/t)},median:function(n,t){return n*r.pow(r.log(2),1/t)},mode:function(n,t){return t<=1?0:n*r.pow((t-1)/t,1/t)},sample:function(t,e){return t*r.pow(-r.log(n._random_fn()),1/e)},variance:function(t,e){return t*t*n.gammafn(1+2/e)-r.pow(n.weibull.mean(t,e),2)}}),n.extend(n.uniform,{pdf:function(n,r,t){return n<r||n>t?0:1/(t-r)},cdf:function(n,r,t){return n<r?0:n<t?(n-r)/(t-r):1},inv:function(n,r,t){return r+n*(t-r)},mean:function(n,r){return.5*(n+r)},median:function(r,t){return n.mean(r,t)},mode:function(){throw new Error("mode is not yet implemented")},sample:function(r,t){return r/2+t/2+(t/2-r/2)*(2*n._random_fn()-1)},variance:function(n,t){return r.pow(t-n,2)/12}}),n.extend(n.binomial,{pdf:function(t,e,o){return 0===o||1===o?e*o===t?1:0:n.combination(e,t)*r.pow(o,t)*r.pow(1-o,e-t)},cdf:function(e,o,i){var a;if(e<0)return 0;if(e>=o)return 1;if(i<0||i>1||o<=0)return NaN;var u=i,f=(e=r.floor(e))+1,s=o-e,c=f+s,l=r.exp(n.gammaln(c)-n.gammaln(s)-n.gammaln(f)+f*r.log(u)+s*r.log(1-u));return a=u<(f+1)/(c+2)?l*t(u,f,s,1e-10):1-l*t(1-u,s,f,1e-10),r.round(1e10*(1-a))/1e10}}),n.extend(n.negbin,{pdf:function(t,e,o){return t===t>>>0&&(t<0?0:n.combination(t+e-1,e-1)*r.pow(1-o,t)*r.pow(o,e))},cdf:function(r,t,e){var o=0,i=0;if(r<0)return 0;for(;i<=r;i++)o+=n.negbin.pdf(i,t,e);return o}}),n.extend(n.hypgeom,{pdf:function(t,e,o,i){if(t!=t|0)return!1;if(t<0||t<o-(e-i))return 0;if(t>i||t>o)return 0;if(2*o>e)return 2*i>e?n.hypgeom.pdf(e-o-i+t,e,e-o,e-i):n.hypgeom.pdf(i-t,e,e-o,i);if(2*i>e)return n.hypgeom.pdf(o-t,e,o,e-i);if(o<i)return n.hypgeom.pdf(t,e,i,o);for(var a=1,u=0,f=0;f<t;f++){for(;a>1&&u<i;)a*=1-o/(e-u),u++;a*=(i-f)*(o-f)/((f+1)*(e-o-i+f+1))}for(;u<i;u++)a*=1-o/(e-u);return r.min(1,r.max(0,a))},cdf:function(t,e,o,i){if(t<0||t<o-(e-i))return 0;if(t>=i||t>=o)return 1;if(2*o>e)return 2*i>e?n.hypgeom.cdf(e-o-i+t,e,e-o,e-i):1-n.hypgeom.cdf(i-t-1,e,e-o,i);if(2*i>e)return 1-n.hypgeom.cdf(o-t-1,e,o,e-i);if(o<i)return n.hypgeom.cdf(t,e,i,o);for(var a=1,u=1,f=0,s=0;s<t;s++){for(;a>1&&f<i;){var c=1-o/(e-f);u*=c,a*=c,f++}a+=u*=(i-s)*(o-s)/((s+1)*(e-o-i+s+1))}for(;f<i;f++)a*=1-o/(e-f);return r.min(1,r.max(0,a))}}),n.extend(n.poisson,{pdf:function(t,e){return e<0||t%1!=0||t<0?0:r.pow(e,t)*r.exp(-e)/n.factorial(t)},cdf:function(r,t){var e=[],o=0;if(r<0)return 0;for(;o<=r;o++)e.push(n.poisson.pdf(o,t));return n.sum(e)},mean:function(n){return n},variance:function(n){return n},sampleSmall:function(t){var e=1,o=0,i=r.exp(-t);do{o++,e*=n._random_fn()}while(e>i);return o-1},sampleLarge:function(t){var e,o,i,a,u,f,s,c,l,m,d=t;for(a=r.sqrt(d),u=r.log(d),f=.02483*(s=.931+2.53*a)-.059,c=1.1239+1.1328/(s-3.4),l=.9277-3.6224/(s-2);;){if(o=r.random()-.5,i=r.random(),m=.5-r.abs(o),e=r.floor((2*f/m+s)*o+d+.43),m>=.07&&i<=l)return e;if(!(e<0||m<.013&&i>m)&&r.log(i)+r.log(c)-r.log(f/(m*m)+s)<=e*u-d-n.loggam(e+1))return e}},sample:function(n){return n<10?this.sampleSmall(n):this.sampleLarge(n)}}),n.extend(n.triangular,{pdf:function(n,r,t,e){return t<=r||e<r||e>t?NaN:n<r||n>t?0:n<e?2*(n-r)/((t-r)*(e-r)):n===e?2/(t-r):2*(t-n)/((t-r)*(t-e))},cdf:function(n,t,e,o){return e<=t||o<t||o>e?NaN:n<=t?0:n>=e?1:n<=o?r.pow(n-t,2)/((e-t)*(o-t)):1-r.pow(e-n,2)/((e-t)*(e-o))},inv:function(n,t,e,o){return e<=t||o<t||o>e?NaN:n<=(o-t)/(e-t)?t+(e-t)*r.sqrt(n*((o-t)/(e-t))):t+(e-t)*(1-r.sqrt((1-n)*(1-(o-t)/(e-t))))},mean:function(n,r,t){return(n+r+t)/3},median:function(n,t,e){return e<=(n+t)/2?t-r.sqrt((t-n)*(t-e))/r.sqrt(2):e>(n+t)/2?n+r.sqrt((t-n)*(e-n))/r.sqrt(2):void 0},mode:function(n,r,t){return t},sample:function(t,e,o){var i=n._random_fn();return i<(o-t)/(e-t)?t+r.sqrt(i*(e-t)*(o-t)):e-r.sqrt((1-i)*(e-t)*(e-o))},variance:function(n,r,t){return(n*n+r*r+t*t-n*r-n*t-r*t)/18}}),n.extend(n.arcsine,{pdf:function(n,t,e){return e<=t?NaN:n<=t||n>=e?0:2/r.PI*r.pow(r.pow(e-t,2)-r.pow(2*n-t-e,2),-.5)},cdf:function(n,t,e){return n<t?0:n<e?2/r.PI*r.asin(r.sqrt((n-t)/(e-t))):1},inv:function(n,t,e){return t+(.5-.5*r.cos(r.PI*n))*(e-t)},mean:function(n,r){return r<=n?NaN:(n+r)/2},median:function(n,r){return r<=n?NaN:(n+r)/2},mode:function(){throw new Error("mode is not yet implemented")},sample:function(t,e){return(t+e)/2+(e-t)/2*r.sin(2*r.PI*n.uniform.sample(0,1))},variance:function(n,t){return t<=n?NaN:r.pow(t-n,2)/8}}),n.extend(n.laplace,{pdf:function(n,t,e){return e<=0?0:r.exp(-r.abs(n-t)/e)/(2*e)},cdf:function(n,t,e){return e<=0?0:n<t?.5*r.exp((n-t)/e):1-.5*r.exp(-(n-t)/e)},mean:function(n){return n},median:function(n){return n},mode:function(n){return n},variance:function(n,r){return 2*r*r},sample:function(t,e){var o,i=n._random_fn()-.5;return t-e*((o=i)/r.abs(o))*r.log(1-2*r.abs(i))}}),n.extend(n.tukey,{cdf:function(t,o,i){var a=o,u=[.9894009349916499,.9445750230732326,.8656312023878318,.755404408355003,.6178762444026438,.45801677765722737,.2816035507792589,.09501250983763744],f=[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685];if(t<=0)return 0;if(i<2||a<2)return NaN;if(!Number.isFinite(t))return 1;if(i>25e3)return e(t,1,a);var s,c=.5*i,l=c*r.log(i)-i*r.log(2)-n.gammaln(c),m=c-1,d=.25*i;s=i<=100?1:i<=800?.5:i<=5e3?.25:.125,l+=r.log(s);for(var h=0,g=1;g<=50;g++){for(var p=0,v=(2*g-1)*s,y=1;y<=16;y++){var w,x;8<y?(w=y-8-1,x=l+m*r.log(v+u[w]*s)-(u[w]*s+v)*d):(w=y-1,x=l+m*r.log(v-u[w]*s)+(u[w]*s-v)*d),x>=-30&&(p+=e(8<y?t*r.sqrt(.5*(u[w]*s+v)):t*r.sqrt(.5*(-u[w]*s+v)),1,a)*f[w]*r.exp(x))}if(g*s>=1&&p<=1e-14)break;h+=p}if(p>1e-14)throw new Error("tukey.cdf failed to converge");return h>1&&(h=1),h},inv:function(t,e,o){if(o<2||e<2)return NaN;if(t<0||t>1)return NaN;if(0===t)return 0;if(1===t)return 1/0;var i,a=function(n,t,e){var o=.5-.5*n,i=r.sqrt(r.log(1/(o*o))),a=i+((((-453642210148e-16*i-.204231210125)*i-.342242088547)*i-1)*i+.322232421088)/((((.0038560700634*i+.10353775285)*i+.531103462366)*i+.588581570495)*i+.099348462606);e<120&&(a+=(a*a*a+a)/e/4);var u=.8832-.2368*a;return e<120&&(u+=-1.214/e+1.208*a/e),a*(u*r.log(t-1)+1.4142)}(t,e,o),u=n.tukey.cdf(a,e,o)-t;i=u>0?r.max(0,a-1):a+1;for(var f,s=n.tukey.cdf(i,e,o)-t,c=1;c<50;c++)if(f=i-s*(i-a)/(s-u),u=s,a=i,f<0&&(f=0,s=-t),s=n.tukey.cdf(f,e,o)-t,i=f,r.abs(i-a)<1e-4)return f;throw new Error("tukey.inv failed to converge")}})}(e,Math),function(n,r){var t,e,o=Array.prototype.push,i=n.utils.isArray;function a(r){return i(r)||r instanceof n}n.extend({add:function(r,t){return a(t)?(a(t[0])||(t=[t]),n.map(r,(function(n,r,e){return n+t[r][e]}))):n.map(r,(function(n){return n+t}))},subtract:function(r,t){return a(t)?(a(t[0])||(t=[t]),n.map(r,(function(n,r,e){return n-t[r][e]||0}))):n.map(r,(function(n){return n-t}))},divide:function(r,t){return a(t)?(a(t[0])||(t=[t]),n.multiply(r,n.inv(t))):n.map(r,(function(n){return n/t}))},multiply:function(r,t){var e,o,i,u,f,s,c,l;if(void 0===r.length&&void 0===t.length)return r*t;if(f=r.length,s=r[0].length,c=n.zeros(f,i=a(t)?t[0].length:s),l=0,a(t)){for(;l<i;l++)for(e=0;e<f;e++){for(u=0,o=0;o<s;o++)u+=r[e][o]*t[o][l];c[e][l]=u}return 1===f&&1===l?c[0][0]:c}return n.map(r,(function(n){return n*t}))},outer:function(r,t){return n.multiply(r.map((function(n){return[n]})),[t])},dot:function(r,t){a(r[0])||(r=[r]),a(t[0])||(t=[t]);for(var e,o,i=1===r[0].length&&1!==r.length?n.transpose(r):r,u=1===t[0].length&&1!==t.length?n.transpose(t):t,f=[],s=0,c=i.length,l=i[0].length;s<c;s++){for(f[s]=[],e=0,o=0;o<l;o++)e+=i[s][o]*u[s][o];f[s]=e}return 1===f.length?f[0]:f},pow:function(t,e){return n.map(t,(function(n){return r.pow(n,e)}))},exp:function(t){return n.map(t,(function(n){return r.exp(n)}))},log:function(t){return n.map(t,(function(n){return r.log(n)}))},abs:function(t){return n.map(t,(function(n){return r.abs(n)}))},norm:function(n,t){var e=0,o=0;for(isNaN(t)&&(t=2),a(n[0])&&(n=n[0]);o<n.length;o++)e+=r.pow(r.abs(n[o]),t);return r.pow(e,1/t)},angle:function(t,e){return r.acos(n.dot(t,e)/(n.norm(t)*n.norm(e)))},aug:function(n,r){var t,e=[];for(t=0;t<n.length;t++)e.push(n[t].slice());for(t=0;t<e.length;t++)o.apply(e[t],r[t]);return e},inv:function(r){for(var t,e=r.length,o=r[0].length,i=n.identity(e,o),a=n.gauss_jordan(r,i),u=[],f=0;f<e;f++)for(u[f]=[],t=o;t<a[0].length;t++)u[f][t-o]=a[f][t];return u},det:function(n){var r,t=n.length,e=2*t,o=new Array(e),i=t-1,a=e-1,u=i-t+1,f=a,s=0,c=0;if(2===t)return n[0][0]*n[1][1]-n[0][1]*n[1][0];for(;s<e;s++)o[s]=1;for(s=0;s<t;s++){for(r=0;r<t;r++)o[u<0?u+t:u]*=n[s][r],o[f<t?f+t:f]*=n[s][r],u++,f--;u=--i-t+1,f=--a}for(s=0;s<t;s++)c+=o[s];for(;s<e;s++)c-=o[s];return c},gauss_elimination:function(t,e){var o,i,a,u,f=0,s=0,c=t.length,l=t[0].length,m=1,d=0,h=[];for(o=(t=n.aug(t,e))[0].length,f=0;f<c;f++){for(i=t[f][f],s=f,u=f+1;u<l;u++)i<r.abs(t[u][f])&&(i=t[u][f],s=u);if(s!=f)for(u=0;u<o;u++)a=t[f][u],t[f][u]=t[s][u],t[s][u]=a;for(s=f+1;s<c;s++)for(m=t[s][f]/t[f][f],u=f;u<o;u++)t[s][u]=t[s][u]-m*t[f][u]}for(f=c-1;f>=0;f--){for(d=0,s=f+1;s<=c-1;s++)d+=h[s]*t[f][s];h[f]=(t[f][o-1]-d)/t[f][f]}return h},gauss_jordan:function(t,e){var o,i,a,u=n.aug(t,e),f=u.length,s=u[0].length,c=0;for(i=0;i<f;i++){var l=i;for(a=i+1;a<f;a++)r.abs(u[a][i])>r.abs(u[l][i])&&(l=a);var m=u[i];for(u[i]=u[l],u[l]=m,a=i+1;a<f;a++)for(c=u[a][i]/u[i][i],o=i;o<s;o++)u[a][o]-=u[i][o]*c}for(i=f-1;i>=0;i--){for(c=u[i][i],a=0;a<i;a++)for(o=s-1;o>i-1;o--)u[a][o]-=u[i][o]*u[a][i]/c;for(u[i][i]/=c,o=f;o<s;o++)u[i][o]/=c}return u},triaUpSolve:function(r,t){var e,o=r[0].length,i=n.zeros(1,o)[0],a=!1;return null!=t[0].length&&(t=t.map((function(n){return n[0]})),a=!0),n.arange(o-1,-1,-1).forEach((function(a){e=n.arange(a+1,o).map((function(n){return i[n]*r[a][n]})),i[a]=(t[a]-n.sum(e))/r[a][a]})),a?i.map((function(n){return[n]})):i},triaLowSolve:function(r,t){var e,o=r[0].length,i=n.zeros(1,o)[0],a=!1;return null!=t[0].length&&(t=t.map((function(n){return n[0]})),a=!0),n.arange(o).forEach((function(o){e=n.arange(o).map((function(n){return r[o][n]*i[n]})),i[o]=(t[o]-n.sum(e))/r[o][o]})),a?i.map((function(n){return[n]})):i},lu:function(r){var t,e=r.length,o=n.identity(e),i=n.zeros(r.length,r[0].length);return n.arange(e).forEach((function(n){i[0][n]=r[0][n]})),n.arange(1,e).forEach((function(a){n.arange(a).forEach((function(e){t=n.arange(e).map((function(n){return o[a][n]*i[n][e]})),o[a][e]=(r[a][e]-n.sum(t))/i[e][e]})),n.arange(a,e).forEach((function(e){t=n.arange(a).map((function(n){return o[a][n]*i[n][e]})),i[a][e]=r[t.length][e]-n.sum(t)}))})),[o,i]},cholesky:function(t){var e,o=t.length,i=n.zeros(t.length,t[0].length);return n.arange(o).forEach((function(a){e=n.arange(a).map((function(n){return r.pow(i[a][n],2)})),i[a][a]=r.sqrt(t[a][a]-n.sum(e)),n.arange(a+1,o).forEach((function(r){e=n.arange(a).map((function(n){return i[a][n]*i[r][n]})),i[r][a]=(t[a][r]-n.sum(e))/i[a][a]}))})),i},gauss_jacobi:function(t,e,o,i){for(var a,u,f,s,c=0,l=0,m=t.length,d=[],h=[],g=[];c<m;c++)for(d[c]=[],h[c]=[],g[c]=[],l=0;l<m;l++)c>l?(d[c][l]=t[c][l],h[c][l]=g[c][l]=0):c<l?(h[c][l]=t[c][l],d[c][l]=g[c][l]=0):(g[c][l]=t[c][l],d[c][l]=h[c][l]=0);for(f=n.multiply(n.multiply(n.inv(g),n.add(d,h)),-1),u=n.multiply(n.inv(g),e),a=o,s=n.add(n.multiply(f,o),u),c=2;r.abs(n.norm(n.subtract(s,a)))>i;)a=s,s=n.add(n.multiply(f,a),u),c++;return s},gauss_seidel:function(t,e,o,i){for(var a,u,f,s,c,l=0,m=t.length,d=[],h=[],g=[];l<m;l++)for(d[l]=[],h[l]=[],g[l]=[],a=0;a<m;a++)l>a?(d[l][a]=t[l][a],h[l][a]=g[l][a]=0):l<a?(h[l][a]=t[l][a],d[l][a]=g[l][a]=0):(g[l][a]=t[l][a],d[l][a]=h[l][a]=0);for(s=n.multiply(n.multiply(n.inv(n.add(g,d)),h),-1),f=n.multiply(n.inv(n.add(g,d)),e),u=o,c=n.add(n.multiply(s,o),f),l=2;r.abs(n.norm(n.subtract(c,u)))>i;)u=c,c=n.add(n.multiply(s,u),f),l+=1;return c},SOR:function(t,e,o,i,a){for(var u,f,s,c,l,m=0,d=t.length,h=[],g=[],p=[];m<d;m++)for(h[m]=[],g[m]=[],p[m]=[],u=0;u<d;u++)m>u?(h[m][u]=t[m][u],g[m][u]=p[m][u]=0):m<u?(g[m][u]=t[m][u],h[m][u]=p[m][u]=0):(p[m][u]=t[m][u],h[m][u]=g[m][u]=0);for(c=n.multiply(n.inv(n.add(p,n.multiply(h,a))),n.subtract(n.multiply(p,1-a),n.multiply(g,a))),s=n.multiply(n.multiply(n.inv(n.add(p,n.multiply(h,a))),e),a),f=o,l=n.add(n.multiply(c,o),s),m=2;r.abs(n.norm(n.subtract(l,f)))>i;)f=l,l=n.add(n.multiply(c,f),s),m++;return l},householder:function(t){for(var e,o,i,a,u=t.length,f=t[0].length,s=0,c=[],l=[];s<u-1;s++){for(e=0,a=s+1;a<f;a++)e+=t[a][s]*t[a][s];for(e=(t[s+1][s]>0?-1:1)*r.sqrt(e),o=r.sqrt((e*e-t[s+1][s]*e)/2),(c=n.zeros(u,1))[s+1][0]=(t[s+1][s]-e)/(2*o),i=s+2;i<u;i++)c[i][0]=t[i][s]/(2*o);l=n.subtract(n.identity(u,f),n.multiply(n.multiply(c,n.transpose(c)),2)),t=n.multiply(l,n.multiply(t,l))}return t},QR:(t=n.sum,e=n.arange,function(o){var i,a,u,f=o.length,s=o[0].length,c=n.zeros(s,s);for(o=n.copy(o),a=0;a<s;a++){for(c[a][a]=r.sqrt(t(e(f).map((function(n){return o[n][a]*o[n][a]})))),i=0;i<f;i++)o[i][a]=o[i][a]/c[a][a];for(u=a+1;u<s;u++)for(c[a][u]=t(e(f).map((function(n){return o[n][a]*o[n][u]}))),i=0;i<f;i++)o[i][u]=o[i][u]-o[i][a]*c[a][u]}return[o,c]}),lstsq:function(r,t){var e=!1;void 0===t[0].length&&(t=t.map((function(n){return[n]})),e=!0);var o=n.QR(r),i=o[0],a=o[1],u=r[0].length,f=n.slice(i,{col:{end:u}}),s=function(r){var t=(r=n.copy(r)).length,e=n.identity(t);return n.arange(t-1,-1,-1).forEach((function(t){n.sliceAssign(e,{row:t},n.divide(n.slice(e,{row:t}),r[t][t])),n.sliceAssign(r,{row:t},n.divide(n.slice(r,{row:t}),r[t][t])),n.arange(t).forEach((function(o){var i=n.multiply(r[o][t],-1),a=n.slice(r,{row:o}),u=n.multiply(n.slice(r,{row:t}),i);n.sliceAssign(r,{row:o},n.add(a,u));var f=n.slice(e,{row:o}),s=n.multiply(n.slice(e,{row:t}),i);n.sliceAssign(e,{row:o},n.add(f,s))}))})),e}(n.slice(a,{row:{end:u}})),c=n.transpose(f);void 0===c[0].length&&(c=[c]);var l=n.multiply(n.multiply(s,c),t);return void 0===l.length&&(l=[[l]]),e?l.map((function(n){return n[0]})):l},jacobi:function(t){for(var e,o,i,a,u,f,s,c=1,l=t.length,m=n.identity(l,l),d=[];1===c;){for(u=t[0][1],i=0,a=1,e=0;e<l;e++)for(o=0;o<l;o++)e!=o&&u<r.abs(t[e][o])&&(u=r.abs(t[e][o]),i=e,a=o);for(f=t[i][i]===t[a][a]?t[i][a]>0?r.PI/4:-r.PI/4:r.atan(2*t[i][a]/(t[i][i]-t[a][a]))/2,(s=n.identity(l,l))[i][i]=r.cos(f),s[i][a]=-r.sin(f),s[a][i]=r.sin(f),s[a][a]=r.cos(f),m=n.multiply(m,s),t=n.multiply(n.multiply(n.inv(s),t),s),c=0,e=1;e<l;e++)for(o=1;o<l;o++)e!=o&&r.abs(t[e][o])>.001&&(c=1)}for(e=0;e<l;e++)d.push(t[e][e]);return[m,d]},rungekutta:function(n,r,t,e,o,i){var a,u,f;if(2===i)for(;e<=t;)o+=((a=r*n(e,o))+(u=r*n(e+r,o+a)))/2,e+=r;if(4===i)for(;e<=t;)o+=((a=r*n(e,o))+2*(u=r*n(e+r/2,o+a/2))+2*(f=r*n(e+r/2,o+u/2))+r*n(e+r,o+f))/6,e+=r;return o},romberg:function(n,t,e,o){for(var i,a,u,f,s,c=0,l=(e-t)/2,m=[],d=[],h=[];c<o/2;){for(s=n(t),u=t,f=0;u<=e;u+=l,f++)m[f]=u;for(i=m.length,u=1;u<i-1;u++)s+=(u%2!=0?4:2)*n(m[u]);s=l/3*(s+n(e)),h[c]=s,l/=2,c++}for(a=h.length,i=1;1!==a;){for(u=0;u<a-1;u++)d[u]=(r.pow(4,i)*h[u+1]-h[u])/(r.pow(4,i)-1);a=d.length,h=d,d=[],i++}return h},richardson:function(n,t,e,o){function i(n,r){for(var t,e=0,o=n.length;e<o;e++)n[e]===r&&(t=e);return t}for(var a,u,f,s,c,l=r.abs(e-n[i(n,e)+1]),m=0,d=[],h=[];o>=l;)a=i(n,e+o),u=i(n,e),d[m]=(t[a]-2*t[u]+t[2*u-a])/(o*o),o/=2,m++;for(s=d.length,f=1;1!=s;){for(c=0;c<s-1;c++)h[c]=(r.pow(4,f)*d[c+1]-d[c])/(r.pow(4,f)-1);s=h.length,d=h,h=[],f++}return d},simpson:function(n,r,t,e){for(var o,i=(t-r)/e,a=n(r),u=[],f=r,s=0,c=1;f<=t;f+=i,s++)u[s]=f;for(o=u.length;c<o-1;c++)a+=(c%2!=0?4:2)*n(u[c]);return i/3*(a+n(t))},hermite:function(n,r,t,e){for(var o,i=n.length,a=0,u=0,f=[],s=[],c=[],l=[];u<i;u++){for(f[u]=1,o=0;o<i;o++)u!=o&&(f[u]*=(e-n[o])/(n[u]-n[o]));for(s[u]=0,o=0;o<i;o++)u!=o&&(s[u]+=1/(n[u]-n[o]));c[u]=(1-2*(e-n[u])*s[u])*(f[u]*f[u]),l[u]=(e-n[u])*(f[u]*f[u]),a+=c[u]*r[u]+l[u]*t[u]}return a},lagrange:function(n,r,t){for(var e,o,i=0,a=0,u=n.length;a<u;a++){for(o=r[a],e=0;e<u;e++)a!=e&&(o*=(t-n[e])/(n[a]-n[e]));i+=o}return i},cubic_spline:function(r,t,e){for(var o,i,a=r.length,u=0,f=[],s=[],c=[],l=[],m=[],d=[];u<a-1;u++)l[u]=r[u+1]-r[u];for(c[0]=0,u=1;u<a-1;u++)c[u]=3/l[u]*(t[u+1]-t[u])-3/l[u-1]*(t[u]-t[u-1]);for(u=1;u<a-1;u++)f[u]=[],s[u]=[],f[u][u-1]=l[u-1],f[u][u]=2*(l[u-1]+l[u]),f[u][u+1]=l[u],s[u][0]=c[u];for(i=n.multiply(n.inv(f),s),o=0;o<a-1;o++)m[o]=(t[o+1]-t[o])/l[o]-l[o]*(i[o+1][0]+2*i[o][0])/3,d[o]=(i[o+1][0]-i[o][0])/(3*l[o]);for(o=0;o<a&&!(r[o]>e);o++);return t[o-=1]+(e-r[o])*m[o]+n.sq(e-r[o])*i[o]+(e-r[o])*n.sq(e-r[o])*d[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(r){var t,e,o,i,a,u=r.length,f=r[0].length,s=0,c=[],l=[],m=[],d=[],h=[],g=[],p=[];for(s=0;s<u;s++)c[s]=n.sum(r[s])/f;for(s=0;s<f;s++)for(h[s]=[],t=0;t<u;t++)h[s][t]=r[t][s]-c[t];for(h=n.transpose(h),s=0;s<u;s++)for(g[s]=[],t=0;t<u;t++)g[s][t]=n.dot([h[s]],[h[t]])/(f-1);for(a=(o=n.jacobi(g))[0],l=o[1],p=n.transpose(a),s=0;s<l.length;s++)for(t=s;t<l.length;t++)l[s]<l[t]&&(e=l[s],l[s]=l[t],l[t]=e,m=p[s],p[s]=p[t],p[t]=m);for(i=n.transpose(h),s=0;s<u;s++)for(d[s]=[],t=0;t<i.length;t++)d[s][t]=n.dot([p[s]],[i[t]]);return[r,l,p,d]}}),function(r){for(var t=0;t<r.length;t++)!function(r){n.fn[r]=function(t,e){var o=this;return e?(setTimeout((function(){e.call(o,n.fn[r].call(o,t))}),15),this):"number"==typeof n[r](this,t)?n[r](this,t):n(n[r](this,t))}}(r[t])}("add divide multiply subtract dot pow exp log abs norm angle".split(" "))}(e,Math),function(n,r){var t=[].slice,e=n.utils.isNumber,o=n.utils.isArray;function i(n,t,e,o){if(n>1||e>1||n<=0||e<=0)throw new Error("Proportions should be greater than 0 and less than 1");var i=(n*t+e*o)/(t+o);return(n-e)/r.sqrt(i*(1-i)*(1/t+1/o))}n.extend({zscore:function(){var r=t.call(arguments);return e(r[1])?(r[0]-r[1])/r[2]:(r[0]-n.mean(r[1]))/n.stdev(r[1],r[2])},ztest:function(){var e,i=t.call(arguments);return o(i[1])?(e=n.zscore(i[0],i[1],i[3]),1===i[2]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1)):i.length>2?(e=n.zscore(i[0],i[1],i[2]),1===i[3]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1)):(e=i[0],1===i[1]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1))}}),n.extend(n.fn,{zscore:function(n,r){return(n-this.mean())/this.stdev(r)},ztest:function(t,e,o){var i=r.abs(this.zscore(t,o));return 1===e?n.normal.cdf(-i,0,1):2*n.normal.cdf(-i,0,1)}}),n.extend({tscore:function(){var e=t.call(arguments);return 4===e.length?(e[0]-e[1])/(e[2]/r.sqrt(e[3])):(e[0]-n.mean(e[1]))/(n.stdev(e[1],!0)/r.sqrt(e[1].length))},ttest:function(){var o,i=t.call(arguments);return 5===i.length?(o=r.abs(n.tscore(i[0],i[1],i[2],i[3])),1===i[4]?n.studentt.cdf(-o,i[3]-1):2*n.studentt.cdf(-o,i[3]-1)):e(i[1])?(o=r.abs(i[0]),1==i[2]?n.studentt.cdf(-o,i[1]-1):2*n.studentt.cdf(-o,i[1]-1)):(o=r.abs(n.tscore(i[0],i[1])),1==i[2]?n.studentt.cdf(-o,i[1].length-1):2*n.studentt.cdf(-o,i[1].length-1))}}),n.extend(n.fn,{tscore:function(n){return(n-this.mean())/(this.stdev(!0)/r.sqrt(this.cols()))},ttest:function(t,e){return 1===e?1-n.studentt.cdf(r.abs(this.tscore(t)),this.cols()-1):2*n.studentt.cdf(-r.abs(this.tscore(t)),this.cols()-1)}}),n.extend({anovafscore:function(){var e,o,i,a,u,f,s,c,l=t.call(arguments);if(1===l.length){for(u=new Array(l[0].length),s=0;s<l[0].length;s++)u[s]=l[0][s];l=u}for(o=new Array,s=0;s<l.length;s++)o=o.concat(l[s]);for(i=n.mean(o),e=0,s=0;s<l.length;s++)e+=l[s].length*r.pow(n.mean(l[s])-i,2);for(e/=l.length-1,f=0,s=0;s<l.length;s++)for(a=n.mean(l[s]),c=0;c<l[s].length;c++)f+=r.pow(l[s][c]-a,2);return e/(f/=o.length-l.length)},anovaftest:function(){var r,o,i,a,u=t.call(arguments);if(e(u[0]))return 1-n.centralF.cdf(u[0],u[1],u[2]);var f=n.anovafscore(u);for(r=u.length-1,i=0,a=0;a<u.length;a++)i+=u[a].length;return o=i-r-1,1-n.centralF.cdf(f,r,o)},ftest:function(r,t,e){return 1-n.centralF.cdf(r,t,e)}}),n.extend(n.fn,{anovafscore:function(){return n.anovafscore(this.toArray())},anovaftes:function(){var r,t=0;for(r=0;r<this.length;r++)t+=this[r].length;return n.ftest(this.anovafscore(),this.length-1,t-this.length)}}),n.extend({qscore:function(){var o,i,a,u,f,s=t.call(arguments);return e(s[0])?(o=s[0],i=s[1],a=s[2],u=s[3],f=s[4]):(o=n.mean(s[0]),i=n.mean(s[1]),a=s[0].length,u=s[1].length,f=s[2]),r.abs(o-i)/(f*r.sqrt((1/a+1/u)/2))},qtest:function(){var r,e=t.call(arguments);3===e.length?(r=e[0],e=e.slice(1)):7===e.length?(r=n.qscore(e[0],e[1],e[2],e[3],e[4]),e=e.slice(5)):(r=n.qscore(e[0],e[1],e[2]),e=e.slice(3));var o=e[0],i=e[1];return 1-n.tukey.cdf(r,i,o-i)},tukeyhsd:function(r){for(var t=n.pooledstdev(r),e=r.map((function(r){return n.mean(r)})),o=r.reduce((function(n,r){return n+r.length}),0),i=[],a=0;a<r.length;++a)for(var u=a+1;u<r.length;++u){var f=n.qtest(e[a],e[u],r[a].length,r[u].length,t,o,r.length);i.push([[a,u],f])}return i}}),n.extend({normalci:function(){var e,o=t.call(arguments),i=new Array(2);return e=4===o.length?r.abs(n.normal.inv(o[1]/2,0,1)*o[2]/r.sqrt(o[3])):r.abs(n.normal.inv(o[1]/2,0,1)*n.stdev(o[2])/r.sqrt(o[2].length)),i[0]=o[0]-e,i[1]=o[0]+e,i},tci:function(){var e,o=t.call(arguments),i=new Array(2);return e=4===o.length?r.abs(n.studentt.inv(o[1]/2,o[3]-1)*o[2]/r.sqrt(o[3])):r.abs(n.studentt.inv(o[1]/2,o[2].length-1)*n.stdev(o[2],!0)/r.sqrt(o[2].length)),i[0]=o[0]-e,i[1]=o[0]+e,i},significant:function(n,r){return n<r}}),n.extend(n.fn,{normalci:function(r,t){return n.normalci(r,t,this.toArray())},tci:function(r,t){return n.tci(r,t,this.toArray())}}),n.extend(n.fn,{oneSidedDifferenceOfProportions:function(r,t,e,o){var a=i(r,t,e,o);return n.ztest(a,1)},twoSidedDifferenceOfProportions:function(r,t,e,o){var a=i(r,t,e,o);return n.ztest(a,2)}})}(e,Math),e.models=function(){function n(n,r){var t=n.length,o=r[0].length-1,i=t-o-1,a=e.lstsq(r,n),u=e.multiply(r,a.map((function(n){return[n]}))).map((function(n){return n[0]})),f=e.subtract(n,u),s=e.mean(n),c=e.sum(u.map((function(n){return Math.pow(n-s,2)}))),l=e.sum(n.map((function(n,r){return Math.pow(n-u[r],2)}))),m=c+l;return{exog:r,endog:n,nobs:t,df_model:o,df_resid:i,coef:a,predict:u,resid:f,ybar:s,SST:m,SSE:c,SSR:l,R2:c/m}}function r(r){var t,o,i=(t=r.exog,o=t[0].length,e.arange(o).map((function(r){var i=e.arange(o).filter((function(n){return n!==r}));return n(e.col(t,r).map((function(n){return n[0]})),e.col(t,i))}))),a=Math.sqrt(r.SSR/r.df_resid),u=i.map((function(n){var r=n.SST,t=n.R2;return a/Math.sqrt(r*(1-t))})),f=r.coef.map((function(n,r){return(n-0)/u[r]})),s=f.map((function(n){var t=e.studentt.cdf(n,r.df_resid);return 2*(t>.5?1-t:t)})),c=e.studentt.inv(.975,r.df_resid),l=r.coef.map((function(n,r){var t=c*u[r];return[n-t,n+t]}));return{se:u,t:f,p:s,sigmaHat:a,interval95:l}}return{ols:function(t,o){var i=n(t,o),a=r(i),u=function(n){var r,t,o,i=n.R2/n.df_model/((1-n.R2)/n.df_resid);return{F_statistic:i,pvalue:1-(r=i,t=n.df_model,o=n.df_resid,e.beta.cdf(r/(o/t+r),t/2,o/2))}}(i),f=1-(1-i.R2)*((i.nobs-1)/i.df_resid);return i.t=a,i.f=u,i.adjust_R2=f,i}}}(),e.extend({buildxmatrix:function(){for(var n=new Array(arguments.length),r=0;r<arguments.length;r++){var t=[1];n[r]=t.concat(arguments[r])}return e(n)},builddxmatrix:function(){for(var n=new Array(arguments[0].length),r=0;r<arguments[0].length;r++){var t=[1];n[r]=t.concat(arguments[0][r])}return e(n)},buildjxmatrix:function(n){for(var r=new Array(n.length),t=0;t<n.length;t++)r[t]=n[t];return e.builddxmatrix(r)},buildymatrix:function(n){return e(n).transpose()},buildjymatrix:function(n){return n.transpose()},matrixmult:function(n,r){var t,o,i,a,u;if(n.cols()==r.rows()){if(r.rows()>1){for(a=[],t=0;t<n.rows();t++)for(a[t]=[],o=0;o<r.cols();o++){for(u=0,i=0;i<n.cols();i++)u+=n.toArray()[t][i]*r.toArray()[i][o];a[t][o]=u}return e(a)}for(a=[],t=0;t<n.rows();t++)for(a[t]=[],o=0;o<r.cols();o++){for(u=0,i=0;i<n.cols();i++)u+=n.toArray()[t][i]*r.toArray()[o];a[t][o]=u}return e(a)}},regress:function(n,r){var t=e.xtranspxinv(n),o=n.transpose(),i=e.matrixmult(e(t),o);return e.matrixmult(i,r)},regresst:function(n,r,t){var o=e.regress(n,r),i={anova:{}},a=e.jMatYBar(n,o);i.yBar=a;var u=r.mean();i.anova.residuals=e.residuals(r,a),i.anova.ssr=e.ssr(a,u),i.anova.msr=i.anova.ssr/(n[0].length-1),i.anova.sse=e.sse(r,a),i.anova.mse=i.anova.sse/(r.length-(n[0].length-1)-1),i.anova.sst=e.sst(r,u),i.anova.mst=i.anova.sst/(r.length-1),i.anova.r2=1-i.anova.sse/i.anova.sst,i.anova.r2<0&&(i.anova.r2=0),i.anova.fratio=i.anova.msr/i.anova.mse,i.anova.pvalue=e.anovaftest(i.anova.fratio,n[0].length-1,r.length-(n[0].length-1)-1),i.anova.rmse=Math.sqrt(i.anova.mse),i.anova.r2adj=1-i.anova.mse/i.anova.mst,i.anova.r2adj<0&&(i.anova.r2adj=0),i.stats=new Array(n[0].length);for(var f,s,c,l=e.xtranspxinv(n),m=0;m<o.length;m++)f=Math.sqrt(i.anova.mse*Math.abs(l[m][m])),s=Math.abs(o[m]/f),c=e.ttest(s,r.length-n[0].length-1,t),i.stats[m]=[o[m],f,s,c];return i.regress=o,i},xtranspx:function(n){return e.matrixmult(n.transpose(),n)},xtranspxinv:function(n){var r=e.matrixmult(n.transpose(),n);return e.inv(r)},jMatYBar:function(n,r){var t=e.matrixmult(n,r);return new e(t)},residuals:function(n,r){return e.matrixsubtract(n,r)},ssr:function(n,r){for(var t=0,e=0;e<n.length;e++)t+=Math.pow(n[e]-r,2);return t},sse:function(n,r){for(var t=0,e=0;e<n.length;e++)t+=Math.pow(n[e]-r[e],2);return t},sst:function(n,r){for(var t=0,e=0;e<n.length;e++)t+=Math.pow(n[e]-r,2);return t},matrixsubtract:function(n,r){for(var t=new Array(n.length),o=0;o<n.length;o++){t[o]=new Array(n[o].length);for(var i=0;i<n[o].length;i++)t[o][i]=n[o][i]-r[o][i]}return e(t)}}),e.jStat=e,e)},function(n,r){n.exports={euclidean:function(n,r){for(var t=0,e=0;e<n.length;e++)t+=Math.pow(r[e]-n[e],2);return Math.sqrt(t)},manhattan:function(n,r){for(var t=0,e=0;e<n.length;e++)t+=Math.abs(r[e]-n[e]);return t},max:function(n,r){for(var t=0,e=0;e<n.length;e++)t=Math.max(t,Math.abs(r[e]-n[e]));return t}}},function(n,r,t){var e=t(2);function o(n){this.centroids=n||[]}o.prototype.randomCentroids=function(n,r){var t=n.slice(0);return t.sort((function(){return Math.round(Math.random())-.5})),t.slice(0,r)},o.prototype.classify=function(n,r){var t=1/0,o=0;"string"==typeof(r=r||"euclidean")&&(r=e[r]);for(var i=0;i<this.centroids.length;i++){var a=r(n,this.centroids[i]);a<t&&(t=a,o=i)}return o},o.prototype.cluster=function(n,r,t,o,i){r=r||Math.max(2,Math.ceil(Math.sqrt(n.length/2))),"string"==typeof(t=t||"euclidean")&&(t=e[t]),this.centroids=this.randomCentroids(n,r);for(var a=new Array(n.length),u=new Array(r),f=0,s=!0;s;){for(var c=0;c<n.length;c++)a[c]=this.classify(n[c],t);s=!1;for(var l=0;l<r;l++){var m=[];for(c=0;c<a.length;c++)a[c]==l&&m.push(n[c]);if(m.length){for(var d=this.centroids[l],h=new Array(d.length),g=0;g<d.length;g++){var p=0;for(c=0;c<m.length;c++)p+=m[c][g];h[g]=p/m.length,h[g]!=d[g]&&(s=!0)}this.centroids[l]=h,u[l]=m}}i&&f++%o==0&&i(u)}return u},o.prototype.toJSON=function(){return JSON.stringify(this.centroids)},o.prototype.fromJSON=function(n){return this.centroids=JSON.parse(n),this},n.exports=o,n.exports.kmeans=function(n,r){return(new o).cluster(n,r)}},function(n,r,t){"use strict";t.r(r);var e=t(0),o=t.n(e),i=t(1),a=t.n(i);const u=self;function f(n){for(let r=0;r<n.length;r++){const t=n[r];if(!isNaN(t)&&null!=t&&0!=t)return!1}return!0}function s(n,r){if(n.isAllNaNs&&r.isAllNaNs)return 0;if(n.isAllNaNs||r.isAllNaNs)return 3;var t=n.preProcessedValueList,e=r.preProcessedValueList,o=a.a.corrcoeff(t,e);return isNaN(o)&&(console.log("NaN in correlation calculation"),o=-2),1-o}function c(n){for(var r=[],t=[],e=0;e<n.length;e++){var o=n[e];if(o.isAllNaNs=f(o.orderedValueList),o.isAllNaNs)r.push(o);else{t.push(o);var i=a.a.rank(o.orderedValueList);o.preProcessedValueList=i}}return{notAllNaN:t,allNaN:r}}function l(n){var r=[];for(var t in n)r.push(t);return r}u.onmessage=function(n){console.log("Clustering worker received message");var r=null;if("CASES"===n.data.dimension)r=function(n){var r=null,t=[];for(var e in n){var i=n[e],a=new Object;a.caseId=e,a.orderedValueList=[],null==r&&(r=l(i));for(var u=0;u<r.length;u++){var f=r[u],m=i[f];a.orderedValueList.push(m)}t.push(a)}if(1==r.length)return t.sort((function(n,r){var t=n.orderedValueList[0],e=r.orderedValueList[0];return(t=null==t||isNaN(t)?Number.MAX_VALUE:t)>(e=null==e||isNaN(e)?Number.MAX_VALUE:e)?1:t<e?-1:0})),t;var d=c(t);return o.a.hcluster(d.notAllNaN,s).clusters(1)[0].concat(d.allNaN)}(n.data.casesAndEntities);else{if("ENTITIES"!==n.data.dimension)throw new Error("Illegal argument given to clustering-worker.js for m.data.dimension: "+n.data.dimension);r=function(n){var r=null,t=[],e=[];for(var i in n){var a=n[i];null==r&&(r=l(a)),e.push(i)}for(var u=0;u<r.length;u++){var f=r[u],m=new Object;m.entityId=f,m.orderedValueList=[];for(var d=0;d<e.length;d++){i=e[d];var h=(a=n[i])[f];m.orderedValueList.push(h)}t.push(m)}var g=c(t);return o.a.hcluster(g.notAllNaN,s).clusters(1)[0].concat(g.allNaN)}(n.data.casesAndEntities)}console.log("Posting clustering result back to main script"),u.postMessage(r)},r.default=null},function(n,r,t){var e=t(2),o=function(n,r,t){this.distance=n,this.linkage=r,this.threshold=null==t?1/0:t};o.prototype={tree:function(n,r,t){this.tree=[],this.dists=[],this.mins=[],this.index=[];for(var e=0;e<n.length;e++){var o={value:n[e],key:e,index:e,size:1};this.tree[e]=o,this.index[e]=o,this.dists[e]=[],this.mins[e]=0}for(e=0;e<this.tree.length;e++)for(var i=0;i<=e;i++){var a=e==i?1/0:this.distance(this.tree[e].value,this.tree[i].value);this.dists[e][i]=a,this.dists[i][e]=a,a<this.dists[e][this.mins[e]]&&(this.mins[e]=i)}var u=this.mergeClosest();for(e=0;u;)t&&e++%r==0&&t(this.tree),u=this.mergeClosest();return this.tree.forEach((function(n){delete n.key,delete n.index})),this.tree},mergeClosest:function(){for(var n=0,r=1/0,t=0;t<this.tree.length;t++){var e=this.tree[t].key;(u=this.dists[e][this.mins[e]])<r&&(n=e,r=u)}if(r>=this.threshold)return!1;var o=this.index[n],i=this.index[this.mins[n]],a={dist:r,left:o,right:i,key:o.key,size:o.size+i.size};this.tree[o.index]=a,this.tree.splice(i.index,1),this.index[o.key]=a;for(t=0;t<this.tree.length;t++){var u,f=this.tree[t];o.key==f.key?u=1/0:"single"==this.linkage?(u=this.dists[o.key][f.key],this.dists[o.key][f.key]>this.dists[i.key][f.key]&&(u=this.dists[i.key][f.key])):"complete"==this.linkage?(u=this.dists[o.key][f.key],this.dists[o.key][f.key]<this.dists[i.key][f.key]&&(u=this.dists[i.key][f.key])):u="average"==this.linkage?(this.dists[o.key][f.key]*o.size+this.dists[i.key][f.key]*i.size)/(o.size+i.size):this.distance(f.value,o.value),this.dists[o.key][f.key]=this.dists[f.key][o.key]=u}for(t=0;t<this.tree.length;t++){var s=this.tree[t].key;if(this.mins[s]==o.key||this.mins[s]==i.key){r=s;for(var c=0;c<this.tree.length;c++){var l=this.tree[c].key;this.dists[s][l]<this.dists[s][r]&&(r=l)}this.mins[s]=r}this.tree[t].index=t}return delete o.key,delete i.key,delete o.index,delete i.index,!0},clusters:function(n){(n>this.tree.size||n<1)&&(n=this.tree.size);for(var r=[],t=[this.tree];n>1;){var e=o(t);t.splice(t.indexOf(e),1),t.push(e.left,e.right),n--}function o(n){var r,t=-1;return n.forEach((function(n){n.dist>t&&(t=n.dist,r=n)})),r}return t.forEach((function(n){r.push(function n(r){if(1===r.size)return[r.value];return n(r.left).concat(n(r.right))}(n))})),r}};n.exports=function(n,r,t,i,a,u){t=t||"average","string"==typeof(r=r||"euclidean")&&(r=e[r]);var f=new o(r,t,i),s=f.tree(n,a,u);return{tree:void 0===i?s[0]:s,clusters:f.clusters}}}]);',null)}},function(t,e){t.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDIwIDIwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxsaW5lIGZpbGw9Im5vbmUiIHgxPSI2Ljc5MiIgeTE9IjUuNjY3IiB4Mj0iNi43OTIiIHkyPSIxMi4xMjUiLz4NCjxwb2x5Z29uIGZpbGw9IiMwMDAwMDAiIHBvaW50cz0iMCw1IDAsMCA1LDAgIi8+DQo8cG9seWdvbiBmaWxsPSIjMDAwMDAwIiBwb2ludHM9IjE0Ljk5OSwwIDIwLDAgMjAsNSAiLz4NCjxwb2x5Z29uIGZpbGw9IiMwMDAwMDAiIHBvaW50cz0iMjAsMTUgMjAsMjAgMTUsMjAgIi8+DQo8cG9seWdvbiBmaWxsPSIjMDAwMDAwIiBwb2ludHM9IjUsMjAgMCwyMCAwLDE1ICIvPg0KPHJlY3QgeD0iMy43NSIgeT0iNC43MDgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHdpZHRoPSIxMi41IiBoZWlnaHQ9IjEwLjU4MyIvPg0KPC9zdmc+DQo="},function(t,e,n){"use strict";var r=window.URL||window.webkitURL;t.exports=function(t,e){try{try{var n;try{(n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(t),n=n.getBlob()}catch(e){n=new Blob([t])}return new Worker(r.createObjectURL(n))}catch(e){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(t){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(3),i={create:function(){var t=new r.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},clone:function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},fromValues:function(t,e,n,i){var o=new r.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o},set:function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},transpose:function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*o-i*r;return s?(s=1/s,t[0]=o*s,t[1]=-r*s,t[2]=-i*s,t[3]=n*s,t):null},adjoint:function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},determinant:function(t){return t[0]*t[3]-t[2]*t[1]},multiply:function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=n[0],l=n[1],u=n[2],c=n[3];return t[0]=r*a+o*l,t[1]=i*a+s*l,t[2]=r*u+o*c,t[3]=i*u+s*c,t}};i.mul=i.multiply,i.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);return t[0]=r*l+o*a,t[1]=i*l+s*a,t[2]=r*-a+o*l,t[3]=i*-a+s*l,t},i.scale=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=n[0],l=n[1];return t[0]=r*a,t[1]=i*a,t[2]=o*l,t[3]=s*l,t},i.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},i.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},i.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},i.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},i.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t},i.sub=i.subtract,i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var n=t[0],i=t[1],o=t[2],s=t[3],a=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-l)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-u)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(s-c)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))},i.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},i.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},t.exports=i},function(t,e,n){var r=n(3),i={create:function(){var t=new r.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},clone:function(t){var e=new r.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},fromValues:function(t,e,n,i,o,s){var a=new r.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a[4]=o,a[5]=s,a},set:function(t,e,n,r,i,o,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=n*o-r*i;return l?(l=1/l,t[0]=o*l,t[1]=-r*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*a-o*s)*l,t[5]=(r*s-n*a)*l,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=n[0],c=n[1],h=n[2],f=n[3],d=n[4],p=n[5];return t[0]=r*u+o*c,t[1]=i*u+s*c,t[2]=r*h+o*f,t[3]=i*h+s*f,t[4]=r*d+o*p+a,t[5]=i*d+s*p+l,t}};i.mul=i.multiply,i.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=Math.sin(n),c=Math.cos(n);return t[0]=r*c+o*u,t[1]=i*c+s*u,t[2]=r*-u+o*c,t[3]=i*-u+s*c,t[4]=a,t[5]=l,t},i.scale=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=n[0],c=n[1];return t[0]=r*u,t[1]=i*u,t[2]=o*c,t[3]=s*c,t[4]=a,t[5]=l,t},i.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=n[0],c=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=r*u+o*c+a,t[5]=i*u+s*c+l,t},i.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},i.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},i.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},i.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},i.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},i.equals=function(t,e){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],u=e[0],c=e[1],h=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(n-u)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(i-c)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-h)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-f)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-d)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(l-p)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(p))},t.exports=i},function(t,e,n){var r=n(3),i={scalar:{},SIMD:{},create:function(){var t=new r.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},clone:function(t){var e=new r.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},fromValues:function(t,e,n,i,o,s,a,l,u,c,h,f,d,p,g,m){var _=new r.ARRAY_TYPE(16);return _[0]=t,_[1]=e,_[2]=n,_[3]=i,_[4]=o,_[5]=s,_[6]=a,_[7]=l,_[8]=u,_[9]=c,_[10]=h,_[11]=f,_[12]=d,_[13]=p,_[14]=g,_[15]=m,_},set:function(t,e,n,r,i,o,s,a,l,u,c,h,f,d,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}};i.scalar.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},i.SIMD.transpose=function(t,e){var n,r,i,o,s,a,l,u,c,h;return n=SIMD.Float32x4.load(e,0),r=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.shuffle(n,r,0,1,4,5),a=SIMD.Float32x4.shuffle(i,o,0,1,4,5),l=SIMD.Float32x4.shuffle(s,a,0,2,4,6),u=SIMD.Float32x4.shuffle(s,a,1,3,5,7),SIMD.Float32x4.store(t,0,l),SIMD.Float32x4.store(t,4,u),s=SIMD.Float32x4.shuffle(n,r,2,3,6,7),a=SIMD.Float32x4.shuffle(i,o,2,3,6,7),c=SIMD.Float32x4.shuffle(s,a,0,2,4,6),h=SIMD.Float32x4.shuffle(s,a,1,3,5,7),SIMD.Float32x4.store(t,8,c),SIMD.Float32x4.store(t,12,h),t},i.transpose=r.USE_SIMD?i.SIMD.transpose:i.scalar.transpose,i.scalar.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],_=e[15],v=n*a-r*s,b=n*l-i*s,x=n*u-o*s,y=r*l-i*a,w=r*u-o*a,k=i*u-o*l,S=c*g-h*p,M=c*m-f*p,T=c*_-d*p,I=h*m-f*g,A=h*_-d*g,C=f*_-d*m,D=v*C-b*A+x*I+y*T-w*M+k*S;return D?(D=1/D,t[0]=(a*C-l*A+u*I)*D,t[1]=(i*A-r*C-o*I)*D,t[2]=(g*k-m*w+_*y)*D,t[3]=(f*w-h*k-d*y)*D,t[4]=(l*T-s*C-u*M)*D,t[5]=(n*C-i*T+o*M)*D,t[6]=(m*x-p*k-_*b)*D,t[7]=(c*k-f*x+d*b)*D,t[8]=(s*A-a*T+u*S)*D,t[9]=(r*T-n*A-o*S)*D,t[10]=(p*w-g*x+_*v)*D,t[11]=(h*x-c*w-d*v)*D,t[12]=(a*M-s*I-l*S)*D,t[13]=(n*I-r*M+i*S)*D,t[14]=(g*b-p*y-m*v)*D,t[15]=(c*y-h*b+f*v)*D,t):null},i.SIMD.invert=function(t,e){var n,r,i,o,s,a,l,u,c,h,f=SIMD.Float32x4.load(e,0),d=SIMD.Float32x4.load(e,4),p=SIMD.Float32x4.load(e,8),g=SIMD.Float32x4.load(e,12);return s=SIMD.Float32x4.shuffle(f,d,0,1,4,5),r=SIMD.Float32x4.shuffle(p,g,0,1,4,5),n=SIMD.Float32x4.shuffle(s,r,0,2,4,6),r=SIMD.Float32x4.shuffle(r,s,1,3,5,7),s=SIMD.Float32x4.shuffle(f,d,2,3,6,7),o=SIMD.Float32x4.shuffle(p,g,2,3,6,7),i=SIMD.Float32x4.shuffle(s,o,0,2,4,6),o=SIMD.Float32x4.shuffle(o,s,1,3,5,7),s=SIMD.Float32x4.mul(i,o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),a=SIMD.Float32x4.mul(r,s),l=SIMD.Float32x4.mul(n,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,s),a),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,s),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),s=SIMD.Float32x4.mul(r,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),a=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),a),c=SIMD.Float32x4.mul(n,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(a,SIMD.Float32x4.mul(o,s)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,s),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),s=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(r,2,3,0,1),o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),i=SIMD.Float32x4.swizzle(i,2,3,0,1),a=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),a),u=SIMD.Float32x4.mul(n,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(a,SIMD.Float32x4.mul(i,s)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,s),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),s=SIMD.Float32x4.mul(n,r),s=SIMD.Float32x4.swizzle(s,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,s),c),s=SIMD.Float32x4.swizzle(s,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,s),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(i,s)),s=SIMD.Float32x4.mul(n,o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,s)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,s),u),s=SIMD.Float32x4.swizzle(s,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(r,s)),s=SIMD.Float32x4.mul(n,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(r,s)),s=SIMD.Float32x4.swizzle(s,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(o,s)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,s),c),h=SIMD.Float32x4.mul(n,a),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,2,3,0,1),h),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,1,0,3,2),h),s=SIMD.Float32x4.reciprocalApproximation(h),h=SIMD.Float32x4.sub(SIMD.Float32x4.add(s,s),SIMD.Float32x4.mul(h,SIMD.Float32x4.mul(s,s))),(h=SIMD.Float32x4.swizzle(h,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(h,a)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(h,l)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(h,u)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(h,c)),t):null},i.invert=r.USE_SIMD?i.SIMD.invert:i.scalar.invert,i.scalar.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],_=e[15];return t[0]=a*(f*_-d*m)-h*(l*_-u*m)+g*(l*d-u*f),t[1]=-(r*(f*_-d*m)-h*(i*_-o*m)+g*(i*d-o*f)),t[2]=r*(l*_-u*m)-a*(i*_-o*m)+g*(i*u-o*l),t[3]=-(r*(l*d-u*f)-a*(i*d-o*f)+h*(i*u-o*l)),t[4]=-(s*(f*_-d*m)-c*(l*_-u*m)+p*(l*d-u*f)),t[5]=n*(f*_-d*m)-c*(i*_-o*m)+p*(i*d-o*f),t[6]=-(n*(l*_-u*m)-s*(i*_-o*m)+p*(i*u-o*l)),t[7]=n*(l*d-u*f)-s*(i*d-o*f)+c*(i*u-o*l),t[8]=s*(h*_-d*g)-c*(a*_-u*g)+p*(a*d-u*h),t[9]=-(n*(h*_-d*g)-c*(r*_-o*g)+p*(r*d-o*h)),t[10]=n*(a*_-u*g)-s*(r*_-o*g)+p*(r*u-o*a),t[11]=-(n*(a*d-u*h)-s*(r*d-o*h)+c*(r*u-o*a)),t[12]=-(s*(h*m-f*g)-c*(a*m-l*g)+p*(a*f-l*h)),t[13]=n*(h*m-f*g)-c*(r*m-i*g)+p*(r*f-i*h),t[14]=-(n*(a*m-l*g)-s*(r*m-i*g)+p*(r*l-i*a)),t[15]=n*(a*f-l*h)-s*(r*f-i*h)+c*(r*l-i*a),t},i.SIMD.adjoint=function(t,e){var n,r,i,o,s,a,l,u,c,h=SIMD.Float32x4.load(e,0),f=SIMD.Float32x4.load(e,4),d=SIMD.Float32x4.load(e,8),p=SIMD.Float32x4.load(e,12);return s=SIMD.Float32x4.shuffle(h,f,0,1,4,5),r=SIMD.Float32x4.shuffle(d,p,0,1,4,5),n=SIMD.Float32x4.shuffle(s,r,0,2,4,6),r=SIMD.Float32x4.shuffle(r,s,1,3,5,7),s=SIMD.Float32x4.shuffle(h,f,2,3,6,7),o=SIMD.Float32x4.shuffle(d,p,2,3,6,7),i=SIMD.Float32x4.shuffle(s,o,0,2,4,6),o=SIMD.Float32x4.shuffle(o,s,1,3,5,7),s=SIMD.Float32x4.mul(i,o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),a=SIMD.Float32x4.mul(r,s),l=SIMD.Float32x4.mul(n,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,s),a),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,s),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),s=SIMD.Float32x4.mul(r,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),a=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),a),c=SIMD.Float32x4.mul(n,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(a,SIMD.Float32x4.mul(o,s)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,s),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),s=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(r,2,3,0,1),o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),i=SIMD.Float32x4.swizzle(i,2,3,0,1),a=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),a),u=SIMD.Float32x4.mul(n,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(a,SIMD.Float32x4.mul(i,s)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,s),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),s=SIMD.Float32x4.mul(n,r),s=SIMD.Float32x4.swizzle(s,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,s),c),s=SIMD.Float32x4.swizzle(s,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,s),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(i,s)),s=SIMD.Float32x4.mul(n,o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,s)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,s),u),s=SIMD.Float32x4.swizzle(s,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(r,s)),s=SIMD.Float32x4.mul(n,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(r,s)),s=SIMD.Float32x4.swizzle(s,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(o,s)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,s),c),SIMD.Float32x4.store(t,0,a),SIMD.Float32x4.store(t,4,l),SIMD.Float32x4.store(t,8,u),SIMD.Float32x4.store(t,12,c),t},i.adjoint=r.USE_SIMD?i.SIMD.adjoint:i.scalar.adjoint,i.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*s-n*o)*(h*m-f*g)-(e*a-r*o)*(c*m-f*p)+(e*l-i*o)*(c*g-h*p)+(n*a-r*s)*(u*m-f*d)-(n*l-i*s)*(u*g-h*d)+(r*l-i*a)*(u*p-c*d)},i.SIMD.multiply=function(t,e,n){var r=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8),s=SIMD.Float32x4.load(e,12),a=SIMD.Float32x4.load(n,0),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,3,3,3,3),s))));SIMD.Float32x4.store(t,0,l);var u=SIMD.Float32x4.load(n,4),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),s))));SIMD.Float32x4.store(t,4,c);var h=SIMD.Float32x4.load(n,8),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,3,3,3,3),s))));SIMD.Float32x4.store(t,8,f);var d=SIMD.Float32x4.load(n,12),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,3,3,3,3),s))));return SIMD.Float32x4.store(t,12,p),t},i.scalar.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],m=e[13],_=e[14],v=e[15],b=n[0],x=n[1],y=n[2],w=n[3];return t[0]=b*r+x*a+y*h+w*g,t[1]=b*i+x*l+y*f+w*m,t[2]=b*o+x*u+y*d+w*_,t[3]=b*s+x*c+y*p+w*v,b=n[4],x=n[5],y=n[6],w=n[7],t[4]=b*r+x*a+y*h+w*g,t[5]=b*i+x*l+y*f+w*m,t[6]=b*o+x*u+y*d+w*_,t[7]=b*s+x*c+y*p+w*v,b=n[8],x=n[9],y=n[10],w=n[11],t[8]=b*r+x*a+y*h+w*g,t[9]=b*i+x*l+y*f+w*m,t[10]=b*o+x*u+y*d+w*_,t[11]=b*s+x*c+y*p+w*v,b=n[12],x=n[13],y=n[14],w=n[15],t[12]=b*r+x*a+y*h+w*g,t[13]=b*i+x*l+y*f+w*m,t[14]=b*o+x*u+y*d+w*_,t[15]=b*s+x*c+y*p+w*v,t},i.multiply=r.USE_SIMD?i.SIMD.multiply:i.scalar.multiply,i.mul=i.multiply,i.scalar.translate=function(t,e,n){var r,i,o,s,a,l,u,c,h,f,d,p,g=n[0],m=n[1],_=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*_+e[12],t[13]=e[1]*g+e[5]*m+e[9]*_+e[13],t[14]=e[2]*g+e[6]*m+e[10]*_+e[14],t[15]=e[3]*g+e[7]*m+e[11]*_+e[15]):(r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+a*m+h*_+e[12],t[13]=i*g+l*m+f*_+e[13],t[14]=o*g+u*m+d*_+e[14],t[15]=s*g+c*m+p*_+e[15]),t},i.SIMD.translate=function(t,e,n){var r=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8),s=SIMD.Float32x4.load(e,12),a=SIMD.Float32x4(n[0],n[1],n[2],0);e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11]),r=SIMD.Float32x4.mul(r,SIMD.Float32x4.swizzle(a,0,0,0,0)),i=SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(a,1,1,1,1)),o=SIMD.Float32x4.mul(o,SIMD.Float32x4.swizzle(a,2,2,2,2));var l=SIMD.Float32x4.add(r,SIMD.Float32x4.add(i,SIMD.Float32x4.add(o,s)));return SIMD.Float32x4.store(t,12,l),t},i.translate=r.USE_SIMD?i.SIMD.translate:i.scalar.translate,i.scalar.scale=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.SIMD.scale=function(t,e,n){var r,i,o,s=SIMD.Float32x4(n[0],n[1],n[2],0);return r=SIMD.Float32x4.load(e,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(r,SIMD.Float32x4.swizzle(s,0,0,0,0))),i=SIMD.Float32x4.load(e,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(s,1,1,1,1))),o=SIMD.Float32x4.load(e,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(o,SIMD.Float32x4.swizzle(s,2,2,2,2))),t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.scale=r.USE_SIMD?i.SIMD.scale:i.scalar.scale,i.rotate=function(t,e,n,i){var o,s,a,l,u,c,h,f,d,p,g,m,_,v,b,x,y,w,k,S,M,T,I,A,C=i[0],D=i[1],z=i[2],R=Math.sqrt(C*C+D*D+z*z);return Math.abs(R)<r.EPSILON?null:(C*=R=1/R,D*=R,z*=R,o=Math.sin(n),a=1-(s=Math.cos(n)),l=e[0],u=e[1],c=e[2],h=e[3],f=e[4],d=e[5],p=e[6],g=e[7],m=e[8],_=e[9],v=e[10],b=e[11],x=C*C*a+s,y=D*C*a+z*o,w=z*C*a-D*o,k=C*D*a-z*o,S=D*D*a+s,M=z*D*a+C*o,T=C*z*a+D*o,I=D*z*a-C*o,A=z*z*a+s,t[0]=l*x+f*y+m*w,t[1]=u*x+d*y+_*w,t[2]=c*x+p*y+v*w,t[3]=h*x+g*y+b*w,t[4]=l*k+f*S+m*M,t[5]=u*k+d*S+_*M,t[6]=c*k+p*S+v*M,t[7]=h*k+g*S+b*M,t[8]=l*T+f*I+m*A,t[9]=u*T+d*I+_*A,t[10]=c*T+p*I+v*A,t[11]=h*T+g*I+b*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},i.scalar.rotateX=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],s=e[5],a=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*r,t[5]=s*i+c*r,t[6]=a*i+h*r,t[7]=l*i+f*r,t[8]=u*i-o*r,t[9]=c*i-s*r,t[10]=h*i-a*r,t[11]=f*i-l*r,t},i.SIMD.rotateX=function(t,e,n){var r=SIMD.Float32x4.splat(Math.sin(n)),i=SIMD.Float32x4.splat(Math.cos(n));e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,4),s=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(s,r))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,i),SIMD.Float32x4.mul(o,r))),t},i.rotateX=r.USE_SIMD?i.SIMD.rotateX:i.scalar.rotateX,i.scalar.rotateY=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-u*r,t[1]=s*i-c*r,t[2]=a*i-h*r,t[3]=l*i-f*r,t[8]=o*r+u*i,t[9]=s*r+c*i,t[10]=a*r+h*i,t[11]=l*r+f*i,t},i.SIMD.rotateY=function(t,e,n){var r=SIMD.Float32x4.splat(Math.sin(n)),i=SIMD.Float32x4.splat(Math.cos(n));e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,0),s=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(s,r))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,r),SIMD.Float32x4.mul(s,i))),t},i.rotateY=r.USE_SIMD?i.SIMD.rotateY:i.scalar.rotateY,i.scalar.rotateZ=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*r,t[1]=s*i+c*r,t[2]=a*i+h*r,t[3]=l*i+f*r,t[4]=u*i-o*r,t[5]=c*i-s*r,t[6]=h*i-a*r,t[7]=f*i-l*r,t},i.SIMD.rotateZ=function(t,e,n){var r=SIMD.Float32x4.splat(Math.sin(n)),i=SIMD.Float32x4.splat(Math.cos(n));e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,0),s=SIMD.Float32x4.load(e,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(s,r))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,i),SIMD.Float32x4.mul(o,r))),t},i.rotateZ=r.USE_SIMD?i.SIMD.rotateZ:i.scalar.rotateZ,i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotation=function(t,e,n){var i,o,s,a=n[0],l=n[1],u=n[2],c=Math.sqrt(a*a+l*l+u*u);return Math.abs(c)<r.EPSILON?null:(a*=c=1/c,l*=c,u*=c,i=Math.sin(e),s=1-(o=Math.cos(e)),t[0]=a*a*s+o,t[1]=l*a*s+u*i,t[2]=u*a*s-l*i,t[3]=0,t[4]=a*l*s-u*i,t[5]=l*l*s+o,t[6]=u*l*s+a*i,t[7]=0,t[8]=a*u*s+l*i,t[9]=l*u*s-a*i,t[10]=u*u*s+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},i.fromXRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromYRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromZRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotationTranslation=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=r+r,l=i+i,u=o+o,c=r*a,h=r*l,f=r*u,d=i*l,p=i*u,g=o*u,m=s*a,_=s*l,v=s*u;return t[0]=1-(d+g),t[1]=h+v,t[2]=f-_,t[3]=0,t[4]=h-v,t[5]=1-(c+g),t[6]=p+m,t[7]=0,t[8]=f+_,t[9]=p-m,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},i.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},i.getRotation=function(t,e){var n=e[0]+e[5]+e[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},i.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],o=e[1],s=e[2],a=e[3],l=i+i,u=o+o,c=s+s,h=i*l,f=i*u,d=i*c,p=o*u,g=o*c,m=s*c,_=a*l,v=a*u,b=a*c,x=r[0],y=r[1],w=r[2];return t[0]=(1-(p+m))*x,t[1]=(f+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(f-b)*y,t[5]=(1-(h+m))*y,t[6]=(g+_)*y,t[7]=0,t[8]=(d+v)*w,t[9]=(g-_)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var o=e[0],s=e[1],a=e[2],l=e[3],u=o+o,c=s+s,h=a+a,f=o*u,d=o*c,p=o*h,g=s*c,m=s*h,_=a*h,v=l*u,b=l*c,x=l*h,y=r[0],w=r[1],k=r[2],S=i[0],M=i[1],T=i[2];return t[0]=(1-(g+_))*y,t[1]=(d+x)*y,t[2]=(p-b)*y,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+_))*w,t[6]=(m+v)*w,t[7]=0,t[8]=(p+b)*k,t[9]=(m-v)*k,t[10]=(1-(f+g))*k,t[11]=0,t[12]=n[0]+S-(t[0]*S+t[4]*M+t[8]*T),t[13]=n[1]+M-(t[1]*S+t[5]*M+t[9]*T),t[14]=n[2]+T-(t[2]*S+t[6]*M+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n+n,a=r+r,l=i+i,u=n*s,c=r*s,h=r*a,f=i*s,d=i*a,p=i*l,g=o*s,m=o*a,_=o*l;return t[0]=1-h-p,t[1]=c+_,t[2]=f-m,t[3]=0,t[4]=c-_,t[5]=1-u-p,t[6]=d+g,t[7]=0,t[8]=f+m,t[9]=d-g,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,n,r,i,o,s){var a=1/(n-e),l=1/(i-r),u=1/(o-s);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(n+e)*a,t[9]=(i+r)*l,t[10]=(s+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*u,t[15]=0,t},i.perspective=function(t,e,n,r,i){var o=1/Math.tan(e/2),s=1/(r-i);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+r)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*r*s,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),l=2/(s+a),u=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(s-a)*l*.5,t[9]=(i-o)*u*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},i.ortho=function(t,e,n,r,i,o,s){var a=1/(e-n),l=1/(r-i),u=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*a,t[13]=(i+r)*l,t[14]=(s+o)*u,t[15]=1,t},i.lookAt=function(t,e,n,o){var s,a,l,u,c,h,f,d,p,g,m=e[0],_=e[1],v=e[2],b=o[0],x=o[1],y=o[2],w=n[0],k=n[1],S=n[2];return Math.abs(m-w)<r.EPSILON&&Math.abs(_-k)<r.EPSILON&&Math.abs(v-S)<r.EPSILON?i.identity(t):(f=m-w,d=_-k,p=v-S,s=x*(p*=g=1/Math.sqrt(f*f+d*d+p*p))-y*(d*=g),a=y*(f*=g)-b*p,l=b*d-x*f,(g=Math.sqrt(s*s+a*a+l*l))?(s*=g=1/g,a*=g,l*=g):(s=0,a=0,l=0),u=d*l-p*a,c=p*s-f*l,h=f*a-d*s,(g=Math.sqrt(u*u+c*c+h*h))?(u*=g=1/g,c*=g,h*=g):(u=0,c=0,h=0),t[0]=s,t[1]=u,t[2]=f,t[3]=0,t[4]=a,t[5]=c,t[6]=d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=-(s*m+a*_+l*v),t[13]=-(u*m+c*_+h*v),t[14]=-(f*m+d*_+p*v),t[15]=1,t)},i.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},i.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},i.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},i.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},i.equals=function(t,e){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],d=t[10],p=t[11],g=t[12],m=t[13],_=t[14],v=t[15],b=e[0],x=e[1],y=e[2],w=e[3],k=e[4],S=e[5],M=e[6],T=e[7],I=e[8],A=e[9],C=e[10],D=e[11],z=e[12],R=e[13],L=e[14],E=e[15];return Math.abs(n-b)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-y)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(s-w)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(a-k)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(l-S)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-M)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(c-T)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(h-I)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(f-A)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-C)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(p-D)<=r.EPSILON*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(g-z)<=r.EPSILON*Math.max(1,Math.abs(g),Math.abs(z))&&Math.abs(m-R)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(R))&&Math.abs(_-L)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(L))&&Math.abs(v-E)<=r.EPSILON*Math.max(1,Math.abs(v),Math.abs(E))},t.exports=i},function(t,e,n){var r,i,o,s,a,l,u=n(3),c=n(5),h=n(6),f=n(7),d={};d.create=function(){var t=new u.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},d.rotationTo=(r=h.create(),i=h.fromValues(1,0,0),o=h.fromValues(0,1,0),function(t,e,n){var s=h.dot(e,n);return s<-.999999?(h.cross(r,i,e),h.length(r)<1e-6&&h.cross(r,o,e),h.normalize(r,r),d.setAxisAngle(t,r,Math.PI),t):s>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(h.cross(r,e,n),t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=1+s,d.normalize(t,t))}),d.setAxes=(s=c.create(),function(t,e,n,r){return s[0]=n[0],s[3]=n[1],s[6]=n[2],s[1]=r[0],s[4]=r[1],s[7]=r[2],s[2]=-e[0],s[5]=-e[1],s[8]=-e[2],d.normalize(t,d.fromMat3(t,s))}),d.clone=f.clone,d.fromValues=f.fromValues,d.copy=f.copy,d.set=f.set,d.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},d.setAxisAngle=function(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t},d.getAxisAngle=function(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return 0!=r?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},d.add=f.add,d.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=n[0],l=n[1],u=n[2],c=n[3];return t[0]=r*c+s*a+i*u-o*l,t[1]=i*c+s*l+o*a-r*u,t[2]=o*c+s*u+r*l-i*a,t[3]=s*c-r*a-i*l-o*u,t},d.mul=d.multiply,d.scale=f.scale,d.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);return t[0]=r*l+s*a,t[1]=i*l+o*a,t[2]=o*l-i*a,t[3]=s*l-r*a,t},d.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);return t[0]=r*l-o*a,t[1]=i*l+s*a,t[2]=o*l+r*a,t[3]=s*l-i*a,t},d.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);return t[0]=r*l+i*a,t[1]=i*l-r*a,t[2]=o*l+s*a,t[3]=s*l-o*a,t},d.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},d.dot=f.dot,d.lerp=f.lerp,d.slerp=function(t,e,n,r){var i,o,s,a,l,u=e[0],c=e[1],h=e[2],f=e[3],d=n[0],p=n[1],g=n[2],m=n[3];return(o=u*d+c*p+h*g+f*m)<0&&(o=-o,d=-d,p=-p,g=-g,m=-m),1-o>1e-6?(i=Math.acos(o),s=Math.sin(i),a=Math.sin((1-r)*i)/s,l=Math.sin(r*i)/s):(a=1-r,l=r),t[0]=a*u+l*d,t[1]=a*c+l*p,t[2]=a*h+l*g,t[3]=a*f+l*m,t},d.sqlerp=(a=d.create(),l=d.create(),function(t,e,n,r,i,o){return d.slerp(a,e,i,o),d.slerp(l,n,r,o),d.slerp(t,a,l,2*o*(1-o)),t}),d.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o,a=s?1/s:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=o*a,t},d.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},d.length=f.length,d.len=d.length,d.squaredLength=f.squaredLength,d.sqrLen=d.squaredLength,d.normalize=f.normalize,d.fromMat3=function(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*s+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+s]-e[3*s+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[s]=(e[3*s+i]+e[3*i+s])*n}return t},d.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},d.exactEquals=f.exactEquals,d.equals=f.equals,t.exports=d},function(t,e,n){var r,i=n(3),o={};o.create=function(){var t=new i.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},o.clone=function(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},o.fromValues=function(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},o.set=function(t,e,n){return t[0]=e,t[1]=n,t},o.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},o.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},o.sub=o.subtract,o.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},o.mul=o.multiply,o.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},o.div=o.divide,o.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},o.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},o.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},o.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},o.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},o.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},o.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},o.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)},o.dist=o.distance,o.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r},o.sqrDist=o.squaredDistance,o.length=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},o.len=o.length,o.squaredLength=function(t){var e=t[0],n=t[1];return e*e+n*n},o.sqrLen=o.squaredLength,o.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},o.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},o.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},o.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},o.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},o.lerp=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},o.random=function(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},o.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},o.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},o.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},o.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},o.forEach=(r=o.create(),function(t,e,n,i,o,s){var a,l;for(e||(e=2),n||(n=0),l=i?Math.min(i*e+n,t.length):t.length,a=n;a<l;a+=e)r[0]=t[a],r[1]=t[a+1],o(r,r,s),t[a]=r[0],t[a+1]=r[1];return t}),o.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},o.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},o.equals=function(t,e){var n=t[0],r=t[1],o=e[0],s=e[1];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-s)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))},t.exports=o},function(t,e,n){"use strict";n.r(e);const r=Math;function i(t,e,n,r){if(!t.length)return-1;for(var i,o=t.length,s=0;s<o;){var a=n(t[i=Math.floor((o+s)/2)]);if(a===e)return i;if(e>a)s=i+1;else{if(!(e<a))return-1;o=i}}return r?Math.max(0,s-1):-1}r.log2=r.log2||function(t){return Math.log(t)/Math.LN2};class o{constructor(t,e){this.value=t,this.updateFn=e,this.bound_properties=[]}update(...t){this.value=this.updateFn.apply(null,t);for(let e=0;e<this.bound_properties.length;e++)this.bound_properties[e].update(...t)}get(){return this.value}updateAndGet(){return this.update(),this.get()}addBoundProperty(t){this.bound_properties.push(t)}}var s=n(8),a=n.n(s);function l(t,e){var n=new a.a,r=new Object,i=new $.Deferred;return r.casesAndEntities=t,r.dimension=e,n.postMessage(r),n.onmessage=function(t){i.resolve(t.data)},i.promise()}var u=n(0),c=n.n(u);function h(t){const e={};for(const n of Object.keys(t))e[n]=t[n];return e}function f(t,e){for(let n=0;n<e.length;n++)t.push(e[n])}function d(t,e){const n=t[0];return!(t[1]<e)&&n<e+1}function p(t,e){return void 0===t?e:t}function g(t,e){const n={};for(const e of Object.keys(t))n[e]=t[e];for(const t of Object.keys(e))n[t]=e[t];return n}function m(t,e){return t<e?-1:t>e?1:0}function _(t,e,n){return Math.max(e,Math.min(n,t))}function v(t,e){const n=t.z,r=e.z;return n<r?-1:n>r?1:0}function b(t,e,n){e=e||0,n=n||t.length;let r=0;for(let i=e;i<n;i++)r*=10,r+=t.charCodeAt(i)-48;return r}function x(t){let e,n=0;for(let r=0;r<t.length;r++)n*=16,n+=(e=t.charCodeAt(r))>96?e-87:e>64?e-55:e-48;return n}function y(t){return`rgb(${t[0]},${t[1]},${t[2]})`}const w="string";function k(t,e,n){e=e||function(t){return t};for(var r,i,o,s,a,l=t,u=[{lower_index_incl:0,upper_index_excl:t.length}],c=[],h=0;h<t.length;h++)(a=e(t[h])).length>c.length&&(c=a);for(var d=c.length,p=0;p<d;p++){r=[],i=[];for(var g=0;g<u.length;g++)f(r,(s=I(l,e,(o=u[g]).lower_index_incl,o.upper_index_excl,p,typeof c[p]===w)).sorted_array),f(i,s.bucket_ranges);l=r,u=i}if(n){var m;r=[];for(g=0;g<u.length;g++)o=u[g],(m=l.slice(o.lower_index_incl,o.upper_index_excl)).sort(n),f(r,m);l=r}return l}function S(t){for(var e,n=[],r=t.length,i=-1,o=0;o<r;o++)(e=t.charCodeAt(o))>=48&&e<=57?-1===i&&(i=o):(i>-1&&(n.push(b(t,i,o)),i=-1),n.push(e));return i>-1&&n.push(b(t,i)),n}function M(t,e,n,r){var i=T(n(t),n(e));return 0===i&&r&&(i=r(t,e)),i}function T(t,e){for(var n,r,i,o=0,s=0;s<t.length;s++){if(s>=e.length){o=1;break}if(r=t[s],i=e[s],0!==(n=typeof r===w?T(S(r),S(i)):m(r,i))){o=n;break}}return 0===o&&t.length<e.length&&(o=-1),o}function I(t,e,n,r,i,o){if(!t.length||n>=r)return{sorted_array:[],bucket_ranges:[]};for(var s,a,l={},u=[],c=[],h=n;h<r;h++)(s=e(t[h])).length>i?((a=s[i])in l||(u.push(a),l[a]=[]),l[a].push(t[h])):c.push(t[h]);o?u=function(t,e){return e=e||function(t){return t},k(t.map((function(t){return{d:t,vector:S(e(t))}})),(function(t){return t.vector})).map((function(t){return t.d}))}(u):u.sort(m);var d,p,g=[],_=[];c.length&&(d=n+g.length,_.push({lower_index_incl:d,upper_index_excl:d+c.length}),f(g,c));for(h=0;h<u.length;h++){var v=l[u[h]];p=(d=n+g.length)+v.length,_.push({lower_index_incl:d,upper_index_excl:p}),f(g,v)}return{sorted_array:g,bucket_ranges:_}}var A=n(1),C=n.n(A);class D{constructor(t,e,n,r){e.isVector?this.initializeVector(t,e,n,r):this.initializeComparator(t,e,n,r)}initializeComparator(t,e,n,r){let i,o;function s(t){return function(e,r){if(0===n)return 0;const i=t(e,r);return 2===i?1:-2===i?-1:i*n}}"function"==typeof e?(i=e,o=e):(i=e.preferred,o=e.mandatory);const a=s(i),l=s(o),u=t.sort(a);this.preferred_change_points=[0],this.mandatory_change_points=[0];for(let t=1;t<u.length;t++)0!==l(u[t-1],u[t])?this.mandatory_change_points.push(t):0!==a(u[t-1],u[t])&&this.preferred_change_points.push(t);this.id_to_index={};for(let t=0;t<u.length;t++)this.id_to_index[u[t][r]]=t}initializeVector(t,e,n,r){function i(t){return 0===n?function(t){return 0}:function(e){return t(e).map((function(t){return"number"==typeof t?t*n:t}))}}const o=i(e.preferred),s=i(e.mandatory),a=t.map((function(t){return{d:t,preferred_vector:o(t),mandatory_vector:s(t)}})),l=e.compareEquals,u=l?function(t,e){return l(t.d,e.d)}:void 0,c=k(a,(function(t){return t.preferred_vector}),u);this.preferred_change_points=[0],this.mandatory_change_points=[0];const h=function(t){return t.mandatory_vector},f=function(t){return t.preferred_vector};for(let t=1;t<c.length;t++)0!==M(c[t-1],c[t],h)?this.mandatory_change_points.push(t):0!==M(c[t-1],c[t],f,u)&&this.preferred_change_points.push(t);this.id_to_index={};for(let t=0;t<c.length;t++)this.id_to_index[c[t].d[r]]=t}getSortValue(t){const e=this.id_to_index[t];let n=0,r=0;return this.mandatory_change_points.length&&(n=this.mandatory_change_points[i(this.mandatory_change_points,e,(function(t){return t}),!0)]),this.preferred_change_points.length&&(r=this.preferred_change_points[i(this.preferred_change_points,e,(function(t){return t}),!0)]),{mandatory:n,preferred:r}}}function z(t,e){return R(t,e).trackTops}function R(t,e){const n={},r={},i=t.getTrackGroups();let o=0;for(let s=0;s<i.length;s++){const a=i[s];a.header&&(r[s]=o),a.tracks.length>0&&(o+=t.getTrackGroupHeaderHeight(a));for(let r=0;r<a.tracks.length;r++){const i=a.tracks[r];n[i]=o,o+=t.getTrackHeight(i,!e)}a.tracks.length>0&&(o+=t.getTrackGroupPadding(!e))}return{trackTops:n,headerTops:r}}var L=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};class E{constructor(){this.union_count={},this.sets={}}setOfKeys(t){const e={};for(const n of Object.keys(t))void 0!==t[n]&&(e[n]=!0);return e}putSet(t,e){this.removeSet(t),this.sets[t]=e;for(const t of Object.keys(e))e[t]&&(this.union_count[t]=this.union_count[t]||0,this.union_count[t]+=1)}removeSet(t){const e=this.union_count,n=this.sets[t]||{};for(const t of Object.keys(n))n[t]&&(e[t]-=1,0===e[t]&&delete e[t]);delete this.sets[t]}getUnion(){return this.setOfKeys(this.union_count)}}function O(t){const e={};for(const n of Object.keys(t))e[n]=t[n];return e}function F(t,e,n){return Math.min(n,Math.max(e,t))}const N=100;class P{constructor(t){this.keep_sorted=!1;const e=this;this.sort_config={},this.rendering_suppressed_depth=0,this.max_height=p(t.max_height,500),this.cell_width=p(t.init_cell_width,6),this.horz_zoom=p(t.init_horz_zoom,1),this.vert_zoom=p(t.init_vert_zoom,1),this.horz_scroll=0,this.vert_scroll=0,this.bottom_padding=0,this.track_group_padding=p(t.init_track_group_padding,10),this.cell_padding=p(t.init_cell_padding,3),this.cell_padding_on=p(t.init_cell_padding_on,!0),this.cell_padding_off_cell_width_threshold=p(t.cell_padding_off_cell_width_threshold,2),this.cell_padding_off_because_of_zoom=this.getCellWidth()<this.cell_padding_off_cell_width_threshold,this.id_order=[],this.hidden_ids={},this.highlighted_ids=[],this.highlighted_tracks=[],this.track_group_legend_order=[],this.show_track_sublabels=!1,this.show_track_labels=!0,this.column_labels={},this.track_important_ids={},this.track_label={},this.track_label_color={},this.track_label_circle_color={},this.track_label_font_weight={},this.track_label_left_padding={},this.track_sublabel={},this.track_html_label={},this.track_link_url={},this.track_description={},this.cell_height={},this.track_padding={},this.track_data_id_key={},this.track_tooltip_fn={},this.track_movable={},this.track_removable={},this.track_remove_callback={},this.track_remove_option_callback={},this.track_sort_cmp_fn={},this.track_sort_direction_changeable={},this.track_sort_direction={},this.track_sort_direction_change_callback={},this.track_data={},this.track_rule_set_id={},this.track_active_rules={},this.track_info={},this.$track_info_tooltip_elt={},this.track_has_column_spacing={},this.track_expansion_enabled={},this.track_expand_callback={},this.track_expand_button_getter={},this.track_expansion_tracks={},this.track_expansion_parent={},this.track_custom_options={},this.track_can_show_gaps={},this.track_show_gaps={},this.rule_sets={},this.rule_set_active_rules={},this.visible_id_order=new o([],(function(t){const e=t.hidden_ids;return t.id_order.filter((function(t){return!e[t]}))})),this.track_id_to_datum=new o({},(function(t,e){const n=t.track_id_to_datum.get();if(null!==t.getContainingTrackGroup(e)){const r={},i=t.getTrackData(e)||[],o=t.getTrackDataIdKey(e)||"";for(let t=0;t<i.length;t++)r[i[t][o]]=i[t];n[e]=r}else delete n[e];return n})),this.track_present_ids=new o(new E,(function(t,e){const n=t.track_present_ids.get();if(null!==t.getContainingTrackGroup(e)){const r={},i=t.getTrackData(e)||[],o=t.getTrackDataIdKey(e)||"";for(let t=0;t<i.length;t++)r[i[t][o]]=!0;n.putSet(e,r)}else n.removeSet(e);return n})),this.present_ids=new o({},(function(){return e.track_present_ids.get().getUnion()})),this.track_present_ids.addBoundProperty(this.present_ids),this.id_to_index=new o({},(function(){const t={},n=e.getIdOrder(!0);for(let e=0;e<n.length;e++)t[n[e]]=e;return t})),this.visible_id_to_index=new o({},(function(){const t={},n=e.getIdOrder();for(let e=0;e<n.length;e++)t[n[e]]=e;return t})),this.visible_id_order.addBoundProperty(this.visible_id_to_index),this.track_groups=[],this.track_group_sort_priority=[],this.track_tops=new o({},(function(){return z(e,!1)})),this.cell_tops=new o({},(function(){const t=e.getTracks(),n=e.track_tops.get(),r={};for(const i of t)i in n&&(r[i]=n[i]+e.getTrackPadding(i,!0));return r})),this.label_tops=new o({},(function(){return e.cell_tops.get()})),this.track_tops.addBoundProperty(this.cell_tops),this.cell_tops.addBoundProperty(this.label_tops),this.track_tops_zoomed=new o({},(function(){return z(e,!0)})),this.header_tops_zoomed=new o({},(function(){return function(t,e){return R(t,e).headerTops}(e,!0)})),this.cell_tops_zoomed=new o({},(function(){const t=e.getTracks(),n=e.track_tops_zoomed.get(),r={};for(const i of t)i in n&&(r[i]=n[i]+e.getTrackPadding(i));return r})),this.label_tops_zoomed=new o({},(function(){return e.cell_tops_zoomed.get()})),this.track_tops.addBoundProperty(this.track_tops_zoomed),this.track_tops_zoomed.addBoundProperty(this.cell_tops_zoomed),this.track_tops_zoomed.addBoundProperty(this.header_tops_zoomed),this.cell_tops_zoomed.addBoundProperty(this.label_tops_zoomed),this.precomputed_comparator=new o({},(function(t,e){const n=t.precomputed_comparator.get();return n[e]=new D(t.getTrackData(e),t.getTrackSortComparator(e),t.getTrackSortDirection(e),t.getTrackDataIdKey(e)),n})),this.ids_after_a_gap=new o({},(function(t){const e={},n=t.precomputed_comparator.get(),r=t.getTracks().filter(e=>t.getTrackShowGaps(e)),i=t.visible_id_order.get();for(let t=1;t<i.length;t++)for(const o of r){const r=n[o];r.getSortValue(i[t-1]).mandatory!==r.getSortValue(i[t]).mandatory&&(e[i[t]]=!0)}return e})),this.visible_id_order.addBoundProperty(this.ids_after_a_gap),this.precomputed_comparator.addBoundProperty(this.ids_after_a_gap),this.column_indexes_after_a_gap=new o([],(function(t){const e=t.ids_after_a_gap.get(),n=t.getVisibleIdToIndexMap();return Object.keys(e).map(t=>n[t])})),this.ids_after_a_gap.addBoundProperty(this.column_indexes_after_a_gap),this.column_left=new o({},(function(){const t=e.getCellWidth(!0),n=e.getGapSize(),r=e.ids_after_a_gap.get(),i=e.getCellPadding(!0),o={},s=e.getIdOrder();let a=0;for(let e=0;e<s.length;e++)r[s[e]]&&(a+=n),o[s[e]]=a,a+=t+i;return o})),this.ids_after_a_gap.addBoundProperty(this.column_left),this.column_left_always_with_padding=new o({},(function(){const t=e.getCellWidth(!0),n=e.getGapSize(),r=e.ids_after_a_gap.get(),i=e.getCellPadding(!0,!0),o={},s=e.getIdOrder();let a=0;for(let e=0;e<s.length;e++)r[s[e]]&&(a+=n),o[s[e]]=a,a+=t+i;return o})),this.column_left.addBoundProperty(this.column_left_always_with_padding),this.zoomed_column_left=new o({},(function(){const t=e.getCellWidth(),n=e.getGapSize(),r=e.ids_after_a_gap.get(),i=e.getCellPadding(),o={},s=e.getIdOrder();let a=0;for(let e=0;e<s.length;e++)r[s[e]]&&(a+=n),o[s[e]]=a,a+=t+i;return o})),this.ids_after_a_gap.addBoundProperty(this.zoomed_column_left),this.column_left.addBoundProperty(this.zoomed_column_left),this.column_left_no_padding=new o({},(function(){const t=e.getCellWidth(!0),n=e.getGapSize(),r=e.ids_after_a_gap.get(),i={},o=e.getIdOrder();let s=0;for(let e=0;e<o.length;e++)r[o[e]]&&(s+=n),i[o[e]]=s,s+=t;return i})),this.ids_after_a_gap.addBoundProperty(this.column_left_no_padding),this.column_left.addBoundProperty(this.column_left_no_padding)}setTrackShowGaps(t,e){this.track_show_gaps[t]=e,this.ids_after_a_gap.update(this)}getTrackShowGaps(t){return this.track_show_gaps[t]}getTrackCanShowGaps(t){return this.track_can_show_gaps[t]}getColumnIndexesAfterAGap(){return this.column_indexes_after_a_gap.get()}setTrackGroupHeader(t,e){this.ensureTrackGroupExists(t),this.getTrackGroups()[t].header=e,this.track_tops.update()}getTrackGroupHeaderHeight(t){return t.header?32:0}toggleCellPadding(){return this.cell_padding_on=!this.cell_padding_on,this.column_left.update(),this.cell_padding_on}getCellPadding(t,e){return this.cell_padding*(t?1:this.horz_zoom)*+this.cell_padding_on*(e?1:+!this.cell_padding_off_because_of_zoom)}getHorzZoom(){return this.horz_zoom}getIdsInZoomedLeftInterval(t,e){const n=this.getClosestColumnIndexToLeft(t,!0),r=this.getClosestColumnIndexToLeft(e,!0,!0);return this.getIdOrder().slice(n,r)}getHorzZoomToFitCols(t,e,n){const r=t-this.getColumnIndexesAfterAGap().filter(t=>t>=e&&t<n).length*this.getGapSize(),i=this.getCellWidth(!0)+this.getCellPadding(!0,!0),o=this.getCellWidth(!0),s=(n-e)*o,a=F(r/((n-e)*i),0,1),l=F(r/s,0,1);let u;if(this.cell_padding_on){const t=this.getCellWidth(!0);u=t*a<this.cell_padding_off_cell_width_threshold?t*l>=this.cell_padding_off_cell_width_threshold?a:l:a}else u=l;return u}getHorzZoomToFit(t,e){if(0===(e=e||[]).length)return 1;const n=this.getVisibleIdToIndexMap(),r=e.map((function(t){return n[t]}));let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;for(let t=0;t<r.length;t++)i=Math.max(r[t],i),o=Math.min(r[t],o);return this.getHorzZoomToFitCols(t,o,i+1)}getMinHorzZoom(){return Math.min(N/this.getOncoprintWidth(!0),1)}getMinVertZoom(){return this.max_height<Number.POSITIVE_INFINITY?this.max_height/this.getOncoprintHeight(!0):1}setHorzScroll(t){return this.horz_scroll=Math.max(0,t),this.horz_scroll}setVertScroll(t){return this.vert_scroll=Math.max(0,t),this.vert_scroll}setScroll(t,e){this.setHorzScroll(t),this.setVertScroll(e)}getHorzScroll(){return this.horz_scroll}getVertScroll(){return this.vert_scroll}setZoom(t,e){this.setHorzZoom(t),this.setVertZoom(e)}setCellPaddingOffBecauseOfZoom(t){this.cell_padding_off_because_of_zoom=t,this.column_left.update()}setHorzZoom(t){const e=this.getMinHorzZoom();return this.horz_zoom=F(t,e,1),this.column_left.update(),this.getCellWidth()<this.cell_padding_off_cell_width_threshold&&!this.cell_padding_off_because_of_zoom?this.setCellPaddingOffBecauseOfZoom(!0):this.getCellWidth()>=this.cell_padding_off_cell_width_threshold&&this.cell_padding_off_because_of_zoom&&this.setCellPaddingOffBecauseOfZoom(!1),this.horz_zoom}getVertZoom(){return this.vert_zoom}setVertZoom(t){const e=this.getMinVertZoom();return this.vert_zoom=F(t,e,1),this.track_tops.update(),this.vert_zoom}setShowTrackLabels(t){this.show_track_labels=t}getShowTrackLabels(){return this.show_track_labels}hideTrackLegends(t){t=[].concat(t);for(let e=0;e<t.length;e++)this.getRuleSet(t[e]).exclude_from_legend=!0}showTrackLegends(t){t=[].concat(t);for(let e=0;e<t.length;e++)this.getRuleSet(t[e]).exclude_from_legend=!1}clearTrackActiveRules(t){const e=this.track_rule_set_id[t],n=this.track_active_rules[t],r=this.rule_set_active_rules[e],i=Object.keys(n).map(t=>parseInt(t,10));for(let t=0;t<i.length;t++){const e=i[t];r.hasOwnProperty(e)&&(r[e]-=1,r[e]<=0&&delete r[e])}this.track_active_rules[t]={}}setTrackActiveRules(t,e){this.clearTrackActiveRules(t),this.track_active_rules[t]=e;const n=this.track_rule_set_id[t],r=this.rule_set_active_rules[n],i=Object.keys(e).map(t=>parseInt(t,0));for(let t=0;t<i.length;t++){const e=i[t];r[e]=r[e]||0,r[e]+=1}}getTrackUniversalShapes(t,e){const n=this.getRuleSet(t),r=this.getTrackHasColumnSpacing(t),i=this.getCellWidth(e)+(r?0:this.getCellPadding(e,!0)),o=this.getCellHeight(t,e);return n.getUniversalShapes(i,o)}getSpecificShapesForData(t,e){const n={},r=this.getTrackData(t),i=this.getTrackDataIdKey(t),o=this.getTrackHasColumnSpacing(t),s=this.getCellWidth(e)+(o?0:this.getCellPadding(e,!0)),a=this.getRuleSet(t).getSpecificShapesForDatum(r,s,this.getCellHeight(t,e),n,i,this.getTrackImportantIds(t));return this.setTrackActiveRules(t,n),a.map((function(t,e){return{id:r[e][i],shape_list:t}}))}getActiveRules(t){const e=this.rule_set_active_rules[t];return e?this.rule_sets[t].getSpecificRulesForDatum().filter((function(t){return!!e[t.id]})):[]}setTrackImportantIds(t,e){this.track_important_ids[t]=e?e.reduce((function(t,e){return t[e]=!0,t}),{}):void 0}getTrackImportantIds(t){return this.track_important_ids[t]}getRuleSets(){const t=this,e=this.getTrackGroupLegendOrder(),n={},r=this.getTrackGroups(),i=[];for(let t=0;t<e.length;t++)n[e[t]]=!0,r[e[t]]&&i.push(r[e[t]]);for(let t=0;t<r.length;t++)!n[t]&&r[t]&&i.push(r[t]);return function(t){const e={},n=[];for(let r=0;r<t.length;r++)void 0===e[t[r]]&&(e[t[r]]=!0,n.push(t[r]));return n}(i.reduce((function(t,e){return t.concat(e.tracks)}),[]).map((function(e){return t.track_rule_set_id[e]})).map(t=>t.toString())).map((function(e){return t.rule_sets[parseInt(e,10)]}))}getTrackHasColumnSpacing(t){return!!this.track_has_column_spacing[t]}getGapSize(){return this.getCellWidth(!0)}getCellWidth(t){return this.cell_width*(t?1:this.horz_zoom)}getCellHeight(t,e){return this.cell_height[t]*(e?1:this.vert_zoom)}getTrackInfo(t){return this.track_info[t]}setTrackInfo(t,e){this.track_info[t]=e}getTrackHeight(t,e){return this.getCellHeight(t,e)+2*this.getTrackPadding(t,e)}getTrackPadding(t,e){return this.track_padding[t]*(e?1:this.vert_zoom)}getBottomPadding(){return this.bottom_padding}getTrackSortDirection(t){return this.track_sort_direction[t]}setTrackSortDirection(t,e,n){this.track_sort_direction[t]=e,n||this.track_sort_direction_change_callback[t](t,e),this.precomputed_comparator.update(this,t)}resetSortableTracksSortDirection(t){const e=this.getTracks();for(const n of e)this.isTrackSortDirectionChangeable(n)&&this.setTrackSortDirection(n,0,t)}setCellPaddingOn(t){this.cell_padding_on=t,this.column_left.update()}getIdOrder(t){return t?this.id_order:this.visible_id_order.get()}getClosestColumnIndexToLeft(t,e,n){const r=e?this.getZoomedColumnLeft():this.getColumnLeft(),o=this.getIdOrder(),s=o[o.length-1];if(t>r[s]+this.getCellWidth())return o.length;if(t<r[o[0]])return 0;{const e=i(o,t,t=>r[t],!0),s=o[e],a=r[s];return n&&t!==a?e+1:e}}getIdToIndexMap(){return this.id_to_index.get()}getVisibleIdToIndexMap(){return this.visible_id_to_index.get()}getHiddenIds(){const t=this.hidden_ids;return this.id_order.filter((function(e){return!!t[e]}))}isSortAffected(t,e){let n;t=[].concat(t);const r=this;return n="track"===e?t.map((function(t){return r.getContainingTrackGroupIndex(t)})):t,"cluster"!==this.sort_config.type||n.indexOf(this.sort_config.track_group_index)>-1}setIdOrder(t){this.id_order=t.slice(),Object.freeze(this.id_order),this.id_to_index.update(),this.visible_id_order.update(this),this.column_left.update()}hideIds(t,e){e&&(this.hidden_ids={});for(let e=0,n=t.length;e<n;e++)this.hidden_ids[t[e]]=!0;this.visible_id_order.update(this),this.column_left.update()}setHighlightedTracks(t){this.highlighted_tracks=t}getHighlightedTracks(){const t=C.a.keyBy(this.getTracks());return this.highlighted_tracks.filter(e=>e in t)}setHighlightedIds(t){this.highlighted_ids=t}getVisibleHighlightedIds(){const t=this.getVisibleIdToIndexMap();return this.highlighted_ids.filter(e=>e in t)}restoreClusteredTrackGroupOrder(){if("cluster"===this.sort_config.type&&this.unclustered_track_group_order){const t=this.sort_config.track_group_index;this.setTrackGroupOrder(t,this.unclustered_track_group_order)}this.unclustered_track_group_order=void 0}setTrackGroupOrder(t,e){this.track_groups[t].tracks=e,this.track_tops.update()}moveTrackGroup(t,e){const n=[],r=this.track_groups[t];for(let i=0;i<this.track_groups.length;i++)i!==t&&i!==e&&n.push(this.track_groups[i]),i===e&&n.push(r);return this.track_groups=n,this.track_tops.update(),this.track_groups}addTracks(t){return L(this,void 0,void 0,(function*(){for(let e=0;e<t.length;e++){const n=t[e];this.addTrack(n)}0===this.rendering_suppressed_depth&&this.keep_sorted&&(yield this.sort()),this.track_tops.update()}))}addTrack(t){const e=t.track_id;this.$track_info_tooltip_elt[e]=t.$track_info_tooltip_elt,this.track_custom_options[e]=p(t.custom_track_options,[]),this.track_label[e]=p(t.label,"Label"),this.track_sublabel[e]=p(t.sublabel,""),this.track_label_color[e]=p(t.track_label_color,"black"),this.track_label_circle_color[e]=t.track_label_circle_color,this.track_label_font_weight[e]=t.track_label_font_weight,this.track_label_left_padding[e]=p(t.track_label_left_padding,0),this.track_link_url[e]=p(t.link_url,null),this.track_description[e]=p(t.description,""),this.cell_height[e]=p(t.cell_height,23),this.track_padding[e]=p(t.track_padding,5),this.track_has_column_spacing[e]=p(t.has_column_spacing,!0),this.track_tooltip_fn[e]=p(t.tooltipFn,(function(t){return t+""})),this.track_movable[e]=p(t.movable,!0),this.track_removable[e]=p(t.removable,!1),this.track_remove_callback[e]=p(t.removeCallback,(function(){})),this.track_remove_option_callback[e]=p(t.onClickRemoveInTrackMenu,(function(){})),void 0!==t.expandCallback&&(this.track_expand_callback[e]=t.expandCallback,this.track_expansion_enabled[e]=!0),void 0!==t.expandButtonTextGetter&&(this.track_expand_button_getter[e]=t.expandButtonTextGetter),this.track_can_show_gaps[e]=p(t.track_can_show_gaps,!1),this.track_show_gaps[e]=!1,this.track_sort_cmp_fn[e]=t.sortCmpFn,this.track_sort_direction_changeable[e]=p(t.sort_direction_changeable,!1),this.track_sort_direction_change_callback[e]=p(t.onSortDirectionChange,(function(){})),this.track_data[e]=p(t.data,[]),this.track_data_id_key[e]=p(t.data_id_key,"id"),this.track_info[e]=p(t.track_info,""),void 0!==t.html_label&&(this.track_html_label[e]=t.html_label),void 0!==t.rule_set&&(this.rule_sets[t.rule_set.rule_set_id]=t.rule_set,this.rule_set_active_rules[t.rule_set.rule_set_id]={},this.track_rule_set_id[e]=t.rule_set.rule_set_id),this.track_active_rules[e]={},t.important_ids&&this.setTrackImportantIds(e,t.important_ids),this.track_sort_direction[e]=p(t.init_sort_direction,1),t.target_group=p(t.target_group,0),this.ensureTrackGroupExists(t.target_group);const n=[this.track_groups[t.target_group].tracks];"cluster"===this.sort_config.type&&this.sort_config.track_group_index===t.target_group&&n.push(this.unclustered_track_group_order);for(const r of n){const n=void 0!==t.expansion_of?r.indexOf(this.getLastExpansion(t.expansion_of))+1:r.length;r.splice(n,0,e)}if(void 0!==t.expansion_of){if(this.track_expansion_tracks.hasOwnProperty(t.expansion_of)||(this.track_expansion_tracks[t.expansion_of]=[]),-1!==this.track_expansion_tracks[t.expansion_of].indexOf(e))throw new Error("Illegal state: duplicate expansion track ID");this.track_expansion_parent[e]=t.expansion_of,this.track_expansion_tracks[t.expansion_of].push(e)}this.track_id_to_datum.update(this,e),this.track_present_ids.update(this,e),this.precomputed_comparator.update(this,e)}getAllIds(){return Object.keys(this.present_ids.get())}releaseRendering(){return L(this,void 0,void 0,(function*(){this.keep_sorted?yield this.sort():this.setIdOrder(Object.keys(this.present_ids.get())),this.track_tops.update()}))}ensureTrackGroupExists(t){for(;t>=this.track_groups.length;)this.track_groups.push({tracks:[]})}_getMajorTrackGroup(t,e){let n,r;for(r=0;r<this.track_groups.length;r++)if(this.track_groups[r].tracks.indexOf(t)>-1){n=this.track_groups[r];break}return n?e?r:n:null}_getEffectiveTrackGroupTracks(t){const e=this;let n,r=this.track_expansion_parent[t];var i;return(n=void 0===r?null===(i=this._getMajorTrackGroup(t))?null:i.tracks.filter((function(t){return void 0===e.track_expansion_parent[t]})):this.track_expansion_tracks[r])?n.slice():null}isRuleSetUsed(t){let e=!1;const n=this.getTracks();for(let r=0;r<n.length;r++)if(this.track_rule_set_id[n[r]]===t){e=!0;break}return e}removeRuleSet(t){delete this.rule_sets[t],delete this.rule_set_active_rules[t]}removeTrack(t){const e=this.track_rule_set_id[t];this.clearTrackActiveRules(t),this.track_remove_callback[t](t),delete this.track_data[t],delete this.track_rule_set_id[t],delete this.track_label[t],delete this.track_link_url[t],delete this.cell_height[t],delete this.track_padding[t],delete this.track_data_id_key[t],delete this.track_tooltip_fn[t],delete this.track_movable[t],delete this.track_removable[t],delete this.track_remove_callback[t],delete this.track_sort_cmp_fn[t],delete this.track_sort_direction_changeable[t],delete this.track_sort_direction[t],delete this.track_info[t],delete this.track_has_column_spacing[t],delete this.track_expansion_enabled[t],delete this.track_expand_callback[t],delete this.track_expand_button_getter[t],delete this.track_expansion_tracks[t],delete this.track_label_circle_color[t],delete this.track_label_font_weight[t],delete this.track_label_left_padding[t];const n=this._getMajorTrackGroup(t);null!==n&&n.tracks.splice(n.tracks.indexOf(t),1);const r=this.track_expansion_tracks[this.track_expansion_parent[t]];r&&r.splice(r.indexOf(t),1),this.unclustered_track_group_order&&this.unclustered_track_group_order.indexOf(t)>-1&&this.unclustered_track_group_order.splice(this.unclustered_track_group_order.indexOf(t),1),delete this.track_expansion_parent[t],this.track_tops.update(),this.track_present_ids.update(this,t),this.track_id_to_datum.update(this,t),this.ids_after_a_gap.update(this),this.setIdOrder(Object.keys(this.present_ids.get())),this.isRuleSetUsed(e)||this.removeRuleSet(e)}getOverlappingCells(t,e){const n=this.getIdOrder(),r=this.getZoomedColumnLeft(),o=i(n,t,(function(t){return r[t]}),!0);if(-1===o)return null;const s=this.getTracks(),a=this.getCellTops(),l=i(s,e,(function(t){return a[t]}),!0);if(-1===l)return null;const u=s[l];if(e>=a[u]+this.getCellHeight(u))return null;const c=[];let h=this.getCellWidth();this.getTrackHasColumnSpacing(u)||(h+=this.getCellPadding());for(let e=o;e<n.length;e++)if(d([r[n[e]],r[n[e]]+h],t))c.push(n[e]);else if(r[n[e]]>t+1)break;return c.length>0?{ids:c,track:u,top:a[u],left:r[c[0]]}:null}getTrackDatum(t,e){const n=this.track_id_to_datum.get()[t];return n&&n[e]||null}getTrackTops(t){return void 0===t?O(this.track_tops.get()):this.track_tops.get()[t]}getZoomedTrackTops(t){return void 0===t?O(this.track_tops_zoomed.get()):this.track_tops_zoomed.get()[t]}getZoomedHeaderTops(t){return void 0===t?O(this.header_tops_zoomed.get()):this.header_tops_zoomed.get()[t]}getCellTops(t,e){return void 0===t?O((e?this.cell_tops:this.cell_tops_zoomed).get()):(e?this.cell_tops:this.cell_tops_zoomed).get()[t]}getLabelTops(t,e){return void 0===t?O((e?this.label_tops:this.label_tops_zoomed).get()):(e?this.label_tops:this.label_tops_zoomed).get()[t]}getContainingTrackGroup(t){return this._getEffectiveTrackGroupTracks(t)}getContainingTrackGroupIndex(t){return this._getMajorTrackGroup(t,!0)}getTrackGroups(){return this.track_groups}getTracks(){const t=[];for(let e=0;e<this.track_groups.length;e++)t.push(...this.track_groups[e].tracks);return t}getColumnLeft(t){return void 0===t?this.column_left.get():this.column_left.get()[t]}getColumnLeftNoPadding(t){return void 0===t?this.column_left_no_padding.get():this.column_left_no_padding.get()[t]}getZoomedColumnLeft(t){return void 0===t?this.zoomed_column_left.get():this.zoomed_column_left.get()[t]}getOncoprintHeight(t){const e=this.getTracks(),n=e[e.length-1];return(t?this.getTrackTops(n):this.getZoomedTrackTops(n))+this.getTrackHeight(n,t)+this.getBottomPadding()}getOncoprintWidth(t){const e=this.getIdOrder(),n=e[e.length-1];return(t?this.getColumnLeft(n):this.getZoomedColumnLeft(n))+this.getCellWidth(t)+1}getOncoprintWidthNoColumnPaddingNoGaps(){return this.getIdOrder().length*this.getCellWidth(!0)}getColumnLabels(){return this.column_labels}setColumnLabels(t){this.column_labels=t}moveTrack(t,e){function n(t,e,n,r){const i=t.indexOf(e),o=t.indexOf(n),s=t.slice(i,o+1);t.splice(i,s.length);const a=null===r?0:t.indexOf(r)+1;t.splice.bind(t,a,0).apply(null,s)}const r=this._getMajorTrackGroup(t),i=this.track_expansion_parent[t];let o;null!==r&&(o=void 0!==i&&null===e?i:this.getLastExpansion(e),n(r.tracks,t,this.getLastExpansion(t),o)),void 0!==this.track_expansion_parent[t]&&n(this.track_expansion_tracks[i],t,t,e),this.track_tops.update()}getTrackLabel(t){return this.track_label[t]}getTrackSublabel(t){return this.track_sublabel[t]}getShowTrackSublabels(){return this.show_track_sublabels}setShowTrackSublabels(t){return this.show_track_sublabels=t}getTrackLabelColor(t){return this.track_label_color[t]}getTrackLabelCircleColor(t){return this.track_label_circle_color[t]}getTrackLabelFontWeight(t){return this.track_label_font_weight[t]}getTrackLabelLeftPadding(t){return this.track_label_left_padding[t]}getOptionalHtmlTrackLabel(t){return this.track_html_label[t]}getTrackLinkUrl(t){return this.track_link_url[t]}getTrackDescription(t){return this.track_description[t]}getTrackTooltipFn(t){return this.track_tooltip_fn[t]}setTrackTooltipFn(t,e){this.track_tooltip_fn[t]=e}getTrackDataIdKey(t){return this.track_data_id_key[t]}getTrackGroupPadding(t){return this.track_group_padding*(t?1:this.vert_zoom)}isTrackRemovable(t){return this.track_removable[t]}getTrackRemoveOptionCallback(t){return this.track_remove_option_callback[t]}isTrackSortDirectionChangeable(t){return this.track_sort_direction_changeable[t]}isTrackExpandable(t){return Boolean(this.track_expansion_enabled[t])}expandTrack(t){return this.track_expand_callback[t](t)}disableTrackExpansion(t){this.track_expansion_enabled[t]=!1}enableTrackExpansion(t){if(!this.track_expand_callback.hasOwnProperty(t))throw new Error("Track '"+t+"' has no expandCallback");this.track_expansion_enabled[t]=!0}isTrackExpanded(t){return this.track_expansion_tracks.hasOwnProperty(t)&&this.track_expansion_tracks[t].length>0}getExpandButtonText(t){const e=this;return function(t){return e.track_expand_button_getter[t]||function(t){return t?"Expand more":"Expand"}}(t)(this.isTrackExpanded(t))}isExpansionOf(t,e){return this.track_expansion_tracks.hasOwnProperty(e)&&-1!==this.track_expansion_tracks[e].indexOf(t)}getLastExpansion(t){let e=this.track_expansion_tracks[t];for(;e&&e.length;)t=e[e.length-1],e=this.track_expansion_tracks[t];return t}getTrackCustomOptions(t){return this.track_custom_options[t]}setTrackCustomOptions(t,e){this.track_custom_options[t]=e}setTrackInfoTooltip(t,e){this.$track_info_tooltip_elt[t]=e}$getTrackInfoTooltip(t){return this.$track_info_tooltip_elt[t]}getRuleSet(t){return this.rule_sets[this.track_rule_set_id[t]]}shareRuleSet(t,e){this.setTrackActiveRules(e,{});const n=this.track_rule_set_id[e];this.track_rule_set_id[e]=this.track_rule_set_id[t],this.isRuleSetUsed(n)||this.removeRuleSet(n)}setRuleSet(t,e){this.setTrackActiveRules(t,{});const n=this.track_rule_set_id[t];this.rule_sets[e.rule_set_id]=e,this.rule_set_active_rules[e.rule_set_id]={},this.track_rule_set_id[t]=e.rule_set_id,this.isRuleSetUsed(n)||this.removeRuleSet(n)}getTrackSortComparator(t){return this.track_sort_cmp_fn[t]}setTrackSortComparator(t,e){this.track_sort_cmp_fn[t]=e,this.precomputed_comparator.update(this,t)}getTrackData(t){return this.track_data[t]}clusterTrackGroup(t,e){const n=h(this.sort_config),r=this,i=new c.a.Deferred,o={},s=this.getTrackGroups()[t];let a=[];void 0!==s&&(a=this._getEffectiveTrackGroupTracks(s.tracks[0])||[]);for(let t=0;t<a.length;t++){const n=a[t],r=this.getTrackDataIdKey(n),i=this.getTrackData(n);for(let t=0;t<i.length;t++){const s=i[t][r],a=e(i[t]);o[s]=o[s]||{},o[s][n]=a}}return Object.keys(o).length?(c.a.when((u=o,l(u,"CASES")),function(t){return l(t,"ENTITIES")}(o)).then((function(e,o){if(!C.a.isEqual(r.sort_config,n))return;r.setIdOrder(e.map((function(t){return t.caseId})));const s=o.map((function(t){return parseInt(t.entityId,10)})),l=[];s.forEach((function(t){l.push(t),Array.prototype.push.apply(l,r.track_expansion_tracks[t]||[])})),r.unclustered_track_group_order||(r.unclustered_track_group_order=a),i.resolve({track_group_index:t,track_id_order:l})})).fail((function(){i.reject()})),i.promise()):i.resolve().promise();var u}setTrackData(t,e,n){this.track_data[t]=e,this.track_data_id_key[t]=n,this.track_id_to_datum.update(this,t),this.track_present_ids.update(this,t),this.setIdOrder(Object.keys(this.present_ids.get())),this.precomputed_comparator.update(this,t)}setTrackGroupLegendOrder(t){this.track_group_legend_order=t.slice()}getTrackGroupLegendOrder(){return this.track_group_legend_order}setTrackGroupSortPriority(t){this.track_group_sort_priority=t,this.sort()}sortAlphabetical(){const t=this.getIdOrder(!0).slice();t.sort((function(t,e){return t.localeCompare(e)})),this.setIdOrder(t)}sortByTracks(){const t=this.track_group_sort_priority,e=this.getTrackGroups();let n;const r=(n=t.length<e.length?e:t.map((function(t){return e[t]}))).reduce((function(t,e){return t.concat(e.tracks)}),[]),i=this.precomputed_comparator.get();function o(t){const e=[],n=[];for(let o=0;o<r.length;o++){const s=i[r[o]].getSortValue(t);e.push(s.mandatory),n.push(s.preferred)}return e.concat(n)}const s=k(this.getAllIds().map((function(t){return{id:t,vector:o(t)}})),(function(t){return t.vector}));this.setIdOrder(s.map((function(t){return t.id})))}sort(){const t=new c.a.Deferred;return this.sort_config=this.sort_config||{},"alphabetical"===this.sort_config.type?(this.sortAlphabetical(),t.resolve()):"order"===this.sort_config.type?(this.setIdOrder(this.sort_config.order),t.resolve()):"cluster"===this.sort_config.type?this.clusterTrackGroup(this.sort_config.track_group_index,this.sort_config.clusterValueFn).then((function(e){t.resolve(e)})):(this.sortByTracks(),t.resolve()),t.promise()}setSortConfig(t){"cluster"!==this.sort_config.type||"cluster"===t.type&&t.track_group_index===this.sort_config.track_group_index||this.restoreClusteredTrackGroupOrder(),this.sort_config=t}getTrackMovable(t){return this.track_movable[t]}setTrackMovable(t,e){this.track_movable[t]=e}isTrackInClusteredGroup(t){return"cluster"===this.sort_config.type&&this.sort_config.track_group_index===this.getContainingTrackGroupIndex(t)}}var H=n(2),j=n.n(H);function V(t,e){const n=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e)t in e&&n.setAttribute(t,e[t]);return n}function B(t){return[x(t[1]+t[2]),x(t[3]+t[4]),x(t[5]+t[6]),1]}function G(t){let e=t[0].toString(16),n=t[1].toString(16),r=t[2].toString(16);return 1===e.length&&(e="0"+e),1===n.length&&(n="0"+n),1===r.length&&(r="0"+r),`#${e}${n}${r}`}function q(t,e,n){var r=t.type;return"rectangle"===r?function(t,e,n){return V("rect",{width:t.width,height:t.height,x:t.x+e,y:t.y+n,stroke:y(t.stroke),"stroke-opacity":t.stroke[3],"stroke-width":t["stroke-width"],fill:y(t.fill),"fill-opacity":t.fill[3]})}(t,e,n):"triangle"===r?function(t,e,n){return V("polygon",{points:[[t.x1+e,t.y1+n],[t.x2+e,t.y2+n],[t.x3+e,t.y3+n]].map((function(t){return t[0]+","+t[1]})).join(" "),stroke:y(t.stroke),"stroke-opacity":t.stroke[3],"stroke-width":t["stroke-width"],fill:y(t.fill),"fill-opacity":t.fill[3]})}(t,e,n):"ellipse"===r?function(t,e,n){return V("ellipse",{rx:t.width/2,height:t.height/2,cx:t.x+e,cy:t.y+n,stroke:y(t.stroke),"stroke-opacity":t.stroke[3],"stroke-width":t["stroke-width"],fill:y(t.fill),"fill-opacity":t.fill[3]})}(t,e,n):"line"===r?function(t,e,n){return V("line",{x1:t.x1+e,y1:t.y1+n,x2:t.x2+e,y2:t.y2+n,stroke:y(t.stroke),"stroke-opacity":t.stroke[3],"stroke-width":t["stroke-width"]})}(t,e,n):void 0}const W=function(){let t=0;return function(){return t+=1}}();var U={text:function(t,e,n,r,i,o,s,a,l){var u=r=r||12;"middle"===s?u=r/2:"bottom"===s&&(u=0);var c=V("text",{x:e||0,y:(n||0)+u,"font-size":r,"font-family":i||"serif","font-weight":o||"normal","text-anchor":"start",fill:a,"text-decoration":l});return c.textContent=t+"",c},group:function(t,e){return V("g",{transform:"translate("+(t=t||0)+","+(e=e||0)+")"})},svg:function(t,e){return V("svg",{width:t||0,height:e||0})},wrapText:function(t,e){const n=t.textContent;t.textContent="";const r=n.split(" ");let i=0,o=V("tspan",{x:"0",dy:i});t.appendChild(o);let s=[];for(var a=0;a<r.length;a++)s.push(r[a]),o.textContent=s.join(" "),o.getComputedTextLength()>e&&(o.textContent=s.slice(0,s.length-1).join(" "),i=t.getBBox().height,s=[r[a]],o=V("tspan",{x:"0",dy:i}),t.appendChild(o),o.textContent=r[a])},fromShape:function(t,e,n){return q(t,e,n)},polygon:function(t,e){return V("polygon",{points:t,fill:y(e),"fill-opacity":e[3]})},rect:function(t,e,n,r,i){let o,s=1;return"rgba"===i.type?(o=y(i.value),s=i.value[3]):o=`url(#${i.value})`,V("rect",{x:t,y:e,width:n,height:r,fill:o,"fill-opacity":s})},bgrect:function(t,e,n){return V("rect",{width:t,height:e,fill:y(n),"fill-opacity":n[3]})},path:function(t,e,n,r){let i=t.map((function(t){return t.join(",")}));i[0]="M"+t[0];for(var o=1;o<t.length;o++)i[o]="L"+t[o];return V("path",{d:i.join(" "),stroke:r?"url(#"+r.getAttribute("id")+")":y(e),"stroke-opacity":r?0:e[3],fill:r?"url(#"+r.getAttribute("id")+")":y(n),"fill-opacity":r?1:n[3]})},stop:function(t,e){return V("stop",{offset:t+"%","stop-color":y(e),"stop-opacity":e[3]})},linearGradient:function(){return V("linearGradient",{id:"linearGradient"+W()})},defs:function(){return V("defs",{})},gradient:function(t){const e=V("linearGradient",{id:"gradient"+W(),x1:0,y1:0,x2:1,y2:0});for(let n=0;n<=100;n++)e.appendChild(this.stop(n,t(n/100)));return e}};const Z=Math.sqrt(2)/2;function Y(t){return[t[0],t[1],t[2],255*t[3]]}var X=function(t,e,n){const r=t.type;return"rectangle"===r?function(t,e,n){const r=t.x,i=t.y,o=t.height,s=t.width,a=Y(t.fill);n([r,i,e],a),n([r+s,i,e],a),n([r+s,i+o,e],a),n([r,i,e],a),n([r+s,i+o,e],a),n([r,i+o,e],a);const l=t["stroke-width"];if(l>0){const a=Y(t.stroke);n([r,i,e],a),n([r+l,i,e],a),n([r+l,i+o,e],a),n([r,i,e],a),n([r+l,i+o,e],a),n([r,i+o,e],a),n([r+s,i,e],a),n([r+s-l,i,e],a),n([r+s-l,i+o,e],a),n([r+s,i,e],a),n([r+s-l,i+o,e],a),n([r+s,i+o,e],a),n([r,i,e],a),n([r+s,i,e],a),n([r+s,i+l,e],a),n([r,i,e],a),n([r+s,i+l,e],a),n([r,i+l,e],a),n([r,i+o,e],a),n([r+s,i+o,e],a),n([r+s,i+o-l,e],a),n([r,i+o,e],a),n([r+s,i+o-l,e],a),n([r,i+o-l,e],a)}}(t,e,n):"triangle"===r?function(t,e,n){const r=Y(t.fill);n([t.x1,t.y1,e],r),n([t.x2,t.y2,e],r),n([t.x3,t.y3,e],r)}(t,e,n):"ellipse"===r?function(t,e,n){const r={x:t.x+t.width/2,y:t.y+t.height/2},i=t.width/2,o=t.height/2,s=Y(t.fill);n([r.x,r.y,e],s),n([r.x+i,r.y,e],s),n([r.x+Z*i,r.y+Z*o,e],s),n([r.x,r.y,e],s),n([r.x+Z*i,r.y+Z*o,e],s),n([r.x,r.y+o,e],s),n([r.x,r.y,e],s),n([r.x,r.y+o,e],s),n([r.x-Z*i,r.y+Z*o,e],s),n([r.x,r.y,e],s),n([r.x-Z*i,r.y+Z*o,e],s),n([r.x-i,r.y,e],s),n([r.x,r.y,e],s),n([r.x-i,r.y,e],s),n([r.x-Z*i,r.y-Z*o,e],s),n([r.x,r.y,e],s),n([r.x-Z*i,r.y-Z*o,e],s),n([r.x,r.y-o,e],s),n([r.x,r.y,e],s),n([r.x,r.y-o,e],s),n([r.x+Z*i,r.y-Z*o,e],s),n([r.x,r.y,e],s),n([r.x+Z*i,r.y-Z*o,e],s),n([r.x+i,r.y,e],s)}(t,e,n):"line"===r?function(t,e,n){let r=t.x1,i=t.x2,o=t.y1,s=t.y2;if(r!==i&&Math.min(r,i)===i){const t=r,e=o;r=i,o=s,i=t,s=e}const a=[s-o,r-i],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]),u=[a[0]/l,a[1]/l],c=t["stroke-width"]/2,h=[u[0]*c,u[1]*c],f=[-1*h[0],-1*h[1]],d=[r+h[0],o+h[1]],p=[r+f[0],o+f[1]],g=[i+h[0],s+h[1]],m=[i+f[0],s+f[1]],_=Y(t.stroke);n([d[0],d[1],e],_),n([p[0],p[1],e],_),n([g[0],g[1],e],_),n([g[0],g[1],e],_),n([m[0],m[1],e],_),n([p[0],p[1],e],_)}(t,e,n):void 0};function J(t){let e;switch(t.type){case"rectangle":e=t["stroke-width"]>0?30:6;break;case"triangle":e=3;break;case"ellipse":e=24;break;case"line":e=6}return e}const Q={width:100,height:100,x:0,y:0,z:0,x1:0,x2:0,x3:0,y1:0,y2:0,y3:0,stroke:[0,0,0,0],fill:[23,23,23,1],"stroke-width":0,"stroke-opacity":0},K={width:0,x:0,x1:0,x2:0,x3:0,height:1,y:1,y1:1,y2:1,y3:1},tt=["width","height","x","y","z","x1","x2","x3","y1","y2","y3","stroke","fill","stroke-width","stroke-opacity","type"];function et(t){return t in K}class nt{constructor(t){this.params=t,this.params_with_type={},this.instanceCache={lastComputedParams:null,lastWidth:-1,lastHeight:-1},this.completeWithDefaults(),this.markParameterTypes()}static hashComputedShape(t,e){return tt.reduce((function(e,n){return e+","+t[n]}),"")+","+e}static getCachedShape(t){const e=nt.hashComputedShape(t);return nt.cache[e]=nt.cache[e]||Object.freeze(t),nt.cache[e]}getRequiredParameters(){throw"Not defined for base class"}completeWithDefaults(){const t=this.getRequiredParameters();for(let e=0;e<t.length;e++){const n=t[e];this.params[n]=void 0===this.params[n]?Q[n]:this.params[n]}}markParameterTypes(){const t=Object.keys(this.params);let e=!0;for(let n=0;n<t.length;n++){const r=t[n],i=this.params[r];"function"==typeof i?(this.params_with_type[r]={type:"function",value:i},e=!1):this.params_with_type[r]={type:"value",value:i}}this.onlyDependsOnWidthAndHeight=e}getComputedParams(t,e,n){if(this.onlyDependsOnWidthAndHeight&&this.instanceCache.lastWidth===e&&this.instanceCache.lastHeight===n)return this.instanceCache.lastComputedParams;const r={},i=Object.keys(this.params_with_type),o=[e,n];for(let e=0;e<i.length;e++){const n=i[e],s=this.params_with_type[n];let a=s.value;"type"!==n&&("function"===s.type&&(a=a(t)),et(n)&&(a=a/100*o[K[n]])),r[n]=a}return this.onlyDependsOnWidthAndHeight&&(this.instanceCache.lastHeight=n,this.instanceCache.lastWidth=e,this.instanceCache.lastComputedParams=nt.getCachedShape(r)),nt.getCachedShape(r)}}nt.cache={};class rt extends nt{getRequiredParameters(){return["width","height","x","y","z","stroke","fill","stroke-width"]}}class it extends nt{getRequiredParameters(){return["x1","x2","x3","y1","y2","y3","z","stroke","fill","stroke-width"]}}class ot extends nt{getRequiredParameters(){return["width","height","x","y","z","stroke","fill","stroke-width"]}}class st extends nt{getRequiredParameters(){return["x1","x2","y1","y2","z","stroke","stroke-width"]}}const at=65,lt=30,ut="rgba(0,0,0,0.5)";class ct{constructor(t,e,n,r,i,s,a,l,u,h){this.$container=t,this.$canvas=e,this.$overlay_canvas=n,this.$column_label_canvas=r,this.$dummy_scroll_div_contents=i,this.tooltip=a,this.highlight_area_callback=l,this.position_bit_pack_base=128,this.supersampling_ratio=2,this.antialias_on_cell_width_thresh=5,this.antialias=!0,this.scroll_x=0,this.scroll_y=0,this.maximum_column_label_width=0,this.maximum_column_label_height=0,this.rendering_suppressed=!1,this.specific_shapes={},this.universal_shapes={},this.vertex_data={},this.vertex_column_array={},this.vertex_position_buffer={},this.vertex_color_buffer={},this.vertex_column_buffer={},this.simple_count_buffer=null,this.is_buffer_empty={},this.color_texture={},this.id_to_first_vertex_index={},this.getWebGLContextAndSetUpMatrices(),this.setUpShaders(s),this.getOverlayContextAndClear(),this.visible_area_width=e[0].width;const f=this;this.tooltip.center=!0,this.scroll_x=0,this.scroll_y=0,this.dummy_scroll_div_client_size=new o({width:i.parent()[0].clientWidth,height:i.parent()[0].clientHeight},(function(){return{width:i.parent()[0].clientWidth,height:i.parent()[0].clientHeight}})),this.highlight_area_callback=void 0===l?function(){}:l,function(t){let e,n,r=!1,i=10,o=null;function l(t,e){return Math.abs(t-e)>=i}function f(i){if(!r)return;if(r=!1,!l(e,n)){if(i){const e=t.$overlay_canvas.offset(),n=i.pageX-e.left,r=i.pageY-e.top,o=s.getOverlappingCells(n+t.scroll_x,r+t.scroll_y);null===o?h(null):h(o.ids[0],o.track)}return}const o=Math.min(e,n),a=Math.max(e,n);t.highlight_area_callback(o+t.scroll_x,a+t.scroll_x)}function d(e,n){const r=t.$overlay_canvas.offset(),i=t.$overlay_canvas.width(),o=t.$overlay_canvas.height();return e>=r.left&&e<i+r.left&&n>=r.top&&n<o+r.top}t.mouseMoveHandler=function(e){d(e.pageX,e.pageY)||(t.clearOverlay(),t.highlightHighlightedIds(s),t.highlightHighlightedTracks(s),a.hide(),null!==o&&(o=null,u(null)))},c()(document).on("mousemove",t.mouseMoveHandler),t.$overlay_canvas.on("mousemove",(function(i){if(t.rendering_suppressed)return;t.clearOverlay();const c=t.$overlay_canvas.offset(),h=i.pageX-c.left,f=i.pageY-c.top;let d=s.getOverlappingCells(h+t.scroll_x,f+t.scroll_y);if(r){d=null,n=h;const r=Math.min(h,e),i=Math.max(h,e),o=l(e,n)?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.2)";t.overlayFillRect(r,0,i-r,t.getVisibleAreaHeight(s),o)}else{const e=null===d?null:d.ids.map((function(t){return s.getTrackDatum(d.track,t)}));if(null!==e){o=d,u(d.ids[0],d.track),t.highlightCell(s,d.track,d.ids[0]),t.highlightColumn(s,d.ids[0]);const n=t.$overlay_canvas[0].getBoundingClientRect();a.show(250,s.getZoomedColumnLeft(d.ids[0])+s.getCellWidth()/2+n.left-t.scroll_x,s.getCellTops(d.track)+n.top-t.scroll_y,s.getTrackTooltipFn(d.track)(e))}else a.hideIfNotAlreadyGoingTo(150),d=null}null===d&&(o=null,u(null)),t.highlightHighlightedIds(s,d?d.ids:[]),t.highlightHighlightedTracks(s)})),t.$overlay_canvas.on("mousedown",(function(i){d(i.pageX,i.pageY)&&(r=!0,e=i.pageX-t.$overlay_canvas.offset().left,n=e,a.hide())})),t.$overlay_canvas.on("mouseup",(function(t){d(t.pageX,t.pageY)&&f(t)})),t.$overlay_canvas.on("mouseleave",(function(t){f()}))}(this),i.parent().scroll((function(){f.clearOverlay(),f.highlightHighlightedIds(s),f.highlightHighlightedTracks(s)}))}getNewCanvas(){const t=this.$canvas[0],e=t.cloneNode(),n=t.parentNode;n.removeChild(t),n.insertBefore(e,n.childNodes[0]),this.$canvas=c()(e),this.ctx=null,this.ext=null}getWebGLCanvasContext(){try{const t=this.$canvas[0],e=this.ctx||t.getContext("experimental-webgl",{alpha:!1,antialias:this.antialias});return e.clearColor(1,1,1,1),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.viewportWidth=t.width,e.viewportHeight=t.height,e.viewport(0,0,e.viewportWidth,e.viewportHeight),e.enable(e.DEPTH_TEST),e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.depthMask(!1),e}catch(t){return null}}createShaderProgram(t,e){const n=this.ctx.createProgram();if(this.ctx.attachShader(n,t),this.ctx.attachShader(n,e),this.ctx.linkProgram(n),!this.ctx.getProgramParameter(n,this.ctx.LINK_STATUS)){const t=this.ctx.getProgramInfoLog(n);throw this.ctx.deleteProgram(n),"Unable to link shader program: "+t}return n}createShader(t,e){const n=this.ctx.createShader(this.ctx[e]);if(this.ctx.shaderSource(n,t),this.ctx.compileShader(n),!this.ctx.getShaderParameter(n,this.ctx.COMPILE_STATUS)){const t=this.ctx.getShaderInfoLog(n);throw this.ctx.deleteShader(n),"Unable to compile shader: "+t}return n}overlayStrokeRect(t,e,n,r,i){const o=this.overlay_ctx;o.strokeStyle=i,o.strokeWidth=10,o.strokeRect(this.supersampling_ratio*t,this.supersampling_ratio*e,this.supersampling_ratio*n,this.supersampling_ratio*r)}overlayFillRect(t,e,n,r,i){const o=this.overlay_ctx;o.fillStyle=i,o.fillRect(this.supersampling_ratio*t,this.supersampling_ratio*e,this.supersampling_ratio*n,this.supersampling_ratio*r)}clearOverlay(){this.overlay_ctx.fillStyle="rgba(0,0,0,0)",this.overlay_ctx.clearRect(0,0,this.$overlay_canvas[0].width,this.$overlay_canvas[0].height)}getOverlayContextAndClear(){this.overlay_ctx=this.$overlay_canvas[0].getContext("2d"),this.clearOverlay()}getColumnLabelsContext(){this.column_label_ctx=this.$column_label_canvas[0].getContext("2d")}getColumnLabelY(t){return(t.getOncoprintHeight()+10-this.scroll_y)*this.supersampling_ratio}overlayColumnLabelHighlight(t,e){const n=t.getColumnLabels()[e];if(n){this.prepareContextForColumnLabelText(t,this.overlay_ctx);const r=t.getCellWidth(),i=(n.left_padding_percent||0)*r/100;let o=r*this.supersampling_ratio,s=this.overlay_ctx.measureText(n.text).width+i*this.supersampling_ratio+20,a=i*this.supersampling_ratio;if(n.circle_color){const e=2*this.getColumnLabelCircleSpec(t).radius*this.supersampling_ratio;o=Math.max(o,e),s=Math.max(s,e),a=Math.min(a,-e/2)}const l=(t.getZoomedColumnLeft(e)+r/2-this.scroll_x)*this.supersampling_ratio,u=this.getColumnLabelY(t);this.overlay_ctx.save(),this.overlay_ctx.translate(l,u);const c=this.getColumnLabelAngleRadians(n);this.overlay_ctx.rotate(c),this.overlay_ctx.fillStyle="rgba(255,255,0,0.4)",this.overlay_ctx.fillRect(a,-o/2,s,o),this.overlay_ctx.restore()}}getWebGLContextAndSetUpMatrices(){this.ctx=this.getWebGLCanvasContext(),this.ctx&&(this.ext=this.ctx.getExtension("ANGLE_instanced_arrays")),function(t){const e=j.a.mat4.create();j.a.mat4.lookAt(e,[0,0,1],[0,0,0],[0,1,0]),t.mvMatrix=e;const n=j.a.mat4.create();j.a.mat4.ortho(n,0,t.ctx.viewportWidth,t.ctx.viewportHeight,0,-5,1e3),t.pMatrix=n}(this)}getColumnIndexesAfterAGap(t){return t.getColumnIndexesAfterAGap().concat([Number.POSITIVE_INFINITY])}setUpShaders(t){const e=this.getColumnIndexesAfterAGap(t).length,n=this.createShader(function(t){return`precision highp float;\n attribute float aPosVertex;\n attribute float aColVertex;\n attribute float aVertexOncoprintColumn;\n\n uniform float gapSize;\n\n uniform float columnsRightAfterGaps[${t}]; // sorted in ascending order\n\n uniform float columnWidth;\n uniform float scrollX;\n uniform float zoomX;\n uniform float scrollY;\n uniform float zoomY;\n uniform mat4 uMVMatrix;\n uniform mat4 uPMatrix;\n uniform float offsetY;\n uniform float supersamplingRatio;\n uniform float positionBitPackBase;\n uniform float texSize;\n varying float texCoord;\n \n \n\n vec3 getUnpackedPositionVec3() {\n \tfloat pos0 = floor(aPosVertex / (positionBitPackBase * positionBitPackBase));\n \tfloat pos0Contr = pos0 * positionBitPackBase * positionBitPackBase;\n \tfloat pos1 = floor((aPosVertex - pos0Contr)/positionBitPackBase);\n \tfloat pos1Contr = pos1 * positionBitPackBase;\n \tfloat pos2 = aPosVertex - pos0Contr - pos1Contr;\n \treturn vec3(pos0, pos1, pos2);\n }\n\n float getGapOffset() {\n // first do binary search to compute the number of gaps before this column, G(c)\n // G(c) = the index in columnsRightAfterGaps of the first entry thats greater than c\n \n int lower_incl = 0;\n int upper_excl = ${t};\n int numGaps = 0;\n \n for (int loopDummyVar = 0; loopDummyVar == 0; loopDummyVar += 0) {\n if (lower_incl >= upper_excl) {\n break;\n }\n \n int middle = (lower_incl + upper_excl)/2;\n if (columnsRightAfterGaps[middle] < aVertexOncoprintColumn) {\n // G(c) > middle\n lower_incl = middle + 1;\n } else if (columnsRightAfterGaps[middle] == aVertexOncoprintColumn) {\n // G(c) = middle + 1\n numGaps = middle + 1;\n break;\n } else {\n // columnsRightAfterGaps[middle] > column, so G(c) <= middle\n if (middle == 0) {\n // 0 <= G(c) <= 0 -> G(c) = 0\n numGaps = 0;\n break;\n } else if (columnsRightAfterGaps[middle-1] < aVertexOncoprintColumn) {\n // G(c) = middle\n numGaps = middle;\n break;\n } else {\n // columnsRightAfterGaps[middle-1] >= column, so G(c) <= middle-1\n upper_excl = middle;\n }\n }\n }\n \n // multiply it by the gap size to get the total offset\n return float(numGaps)*gapSize;\n }\n\n void main(void) {\n \tgl_Position = vec4(getUnpackedPositionVec3(), 1.0);\n \tgl_Position[0] += aVertexOncoprintColumn*columnWidth;\n \tgl_Position *= vec4(zoomX, zoomY, 1.0, 1.0);\n\n // gaps should not be affected by zoom:\n gl_Position[0] += getGapOffset();\n\n // offsetY is given zoomed:\n \tgl_Position[1] += offsetY;\n\n \tgl_Position -= vec4(scrollX, scrollY, 0.0, 0.0);\n \tgl_Position[0] *= supersamplingRatio;\n \tgl_Position[1] *= supersamplingRatio;\n \tgl_Position = uPMatrix * uMVMatrix * gl_Position;\n\n \ttexCoord = (aColVertex + 0.5) / texSize;\n }`}(e),"VERTEX_SHADER"),r=this.createShader("precision mediump float;\n varying float texCoord;\n uniform sampler2D uSampler;\n void main(void) {\n gl_FragColor = texture2D(uSampler, vec2(texCoord, 0.5));\n }","FRAGMENT_SHADER"),i=this.createShaderProgram(n,r);i.vertexPositionAttribute=this.ctx.getAttribLocation(i,"aPosVertex"),this.ctx.enableVertexAttribArray(i.vertexPositionAttribute),i.vertexColorAttribute=this.ctx.getAttribLocation(i,"aColVertex"),this.ctx.enableVertexAttribArray(i.vertexColorAttribute),i.vertexOncoprintColumnAttribute=this.ctx.getAttribLocation(i,"aVertexOncoprintColumn"),this.ctx.enableVertexAttribArray(i.vertexOncoprintColumnAttribute),i.gapSizeUniform=this.ctx.getUniformLocation(i,"gapSize"),i.columnsRightAfterGapsUniform=this.ctx.getUniformLocation(i,"columnsRightAfterGaps"),i.samplerUniform=this.ctx.getUniformLocation(i,"uSampler"),i.pMatrixUniform=this.ctx.getUniformLocation(i,"uPMatrix"),i.mvMatrixUniform=this.ctx.getUniformLocation(i,"uMVMatrix"),i.columnWidthUniform=this.ctx.getUniformLocation(i,"columnWidth"),i.scrollXUniform=this.ctx.getUniformLocation(i,"scrollX"),i.scrollYUniform=this.ctx.getUniformLocation(i,"scrollY"),i.zoomXUniform=this.ctx.getUniformLocation(i,"zoomX"),i.zoomYUniform=this.ctx.getUniformLocation(i,"zoomY"),i.offsetYUniform=this.ctx.getUniformLocation(i,"offsetY"),i.supersamplingRatioUniform=this.ctx.getUniformLocation(i,"supersamplingRatio"),i.positionBitPackBaseUniform=this.ctx.getUniformLocation(i,"positionBitPackBase"),i.texSizeUniform=this.ctx.getUniformLocation(i,"texSize"),this.shader_program=i}resizeAndClear(t){const e=this.getVisibleAreaHeight(t),n=this.getTotalWidth(t),r=this.visible_area_width;this.$dummy_scroll_div_contents.css({"min-width":n,"min-height":t.getOncoprintHeight()}),this.$dummy_scroll_div_contents.parent().css({height:e+20,width:r+20}),this.dummy_scroll_div_client_size.update(),this.$canvas[0].height=this.supersampling_ratio*e,this.$canvas[0].style.height=e+"px",this.$overlay_canvas[0].height=this.supersampling_ratio*e,this.$overlay_canvas[0].style.height=e+"px",this.$column_label_canvas[0].height=this.supersampling_ratio*e,this.$column_label_canvas[0].style.height=e+"px",this.$canvas[0].width=this.supersampling_ratio*r,this.$canvas[0].style.width=r+"px",this.$overlay_canvas[0].width=this.supersampling_ratio*r,this.$overlay_canvas[0].style.width=r+"px",this.$column_label_canvas[0].width=this.supersampling_ratio*r,this.$column_label_canvas[0].style.width=r+"px",this.$container.css("height",e),this.$container.css("width",r),this.getWebGLContextAndSetUpMatrices(),this.setUpShaders(t),this.getOverlayContextAndClear(),this.getColumnLabelsContext()}renderAllTracks(t,e){if(this.rendering_suppressed)return;const n=this.scroll_x,r=this.scroll_y,i=t.getHorzZoom(),o=t.getVertZoom(),s=this.getViewportOncoprintSpace(t),a=s.left,l=s.right,u=s.top,c=s.bottom,h=t.getIdOrder();let f=t.getClosestColumnIndexToLeft(a);const d=t.getClosestColumnIndexToLeft(l,!1,!0),p=h[f=f<1?0:f-1],g=-1===d||d===h.length?null:h[d];e||this.resizeAndClear(t),this.ctx.clearColor(1,1,1,1),this.ctx.clear(this.ctx.COLOR_BUFFER_BIT|this.ctx.DEPTH_BUFFER_BIT);const m=t.getTracks();for(let e=0;e<m.length;e++){const s=m[e],a=t.getCellTops(s),l=t.getCellHeight(s);if(a/o>=c||(a+l)/o<u)continue;const h=this.getTrackBuffers(s);if(0!==h.position.numItems)for(const e of[!1,!0]){const l=this.shader_program;if(this.ctx.useProgram(l),e)this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,h.position),this.ctx.vertexAttribPointer(l.vertexPositionAttribute,h.position.itemSize,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,h.color),this.ctx.vertexAttribPointer(l.vertexColorAttribute,h.color.itemSize,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,h.column),this.ctx.vertexAttribPointer(l.vertexOncoprintColumnAttribute,h.column.itemSize,this.ctx.FLOAT,!1,0,0),this.ext.vertexAttribDivisorANGLE(l.vertexOncoprintColumnAttribute,0);else{const t=h.position.specificShapesNumItems*h.position.itemSize;this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,h.position),this.ctx.vertexAttribPointer(l.vertexPositionAttribute,h.position.itemSize,this.ctx.FLOAT,!1,0,4*t),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,h.color),this.ctx.vertexAttribPointer(l.vertexColorAttribute,h.color.itemSize,this.ctx.FLOAT,!1,0,4*t),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,this.simple_count_buffer),this.ctx.vertexAttribPointer(l.vertexOncoprintColumnAttribute,1,this.ctx.FLOAT,!1,0,4*f),this.ext.vertexAttribDivisorANGLE(l.vertexOncoprintColumnAttribute,1)}if(this.ctx.activeTexture(this.ctx.TEXTURE0),this.ctx.bindTexture(this.ctx.TEXTURE_2D,h.color_tex.texture),this.ctx.uniform1i(l.samplerUniform,0),this.ctx.uniform1f(l.texSizeUniform,h.color_tex.size),this.ctx.uniform1fv(l.columnsRightAfterGapsUniform,this.getColumnIndexesAfterAGap(t)),this.ctx.uniform1f(l.gapSizeUniform,t.getGapSize()),this.ctx.uniformMatrix4fv(l.pMatrixUniform,!1,this.pMatrix),this.ctx.uniformMatrix4fv(l.mvMatrixUniform,!1,this.mvMatrix),this.ctx.uniform1f(l.columnWidthUniform,t.getCellWidth(!0)+t.getCellPadding(!0)),this.ctx.uniform1f(l.scrollXUniform,n),this.ctx.uniform1f(l.scrollYUniform,r),this.ctx.uniform1f(l.zoomXUniform,i),this.ctx.uniform1f(l.zoomYUniform,o),this.ctx.uniform1f(l.offsetYUniform,a),this.ctx.uniform1f(l.supersamplingRatioUniform,this.supersampling_ratio),this.ctx.uniform1f(l.positionBitPackBaseUniform,this.position_bit_pack_base),e){const t=this.id_to_first_vertex_index[s][p],e=null===g?h.position.specificShapesNumItems:this.id_to_first_vertex_index[s][g];this.ctx.drawArrays(this.ctx.TRIANGLES,t,e-t)}else this.ext.drawArraysInstancedANGLE(this.ctx.TRIANGLES,0,h.position.itemSize*h.position.universalShapesNumItems,d-f)}}this.ctx.flush(),this.renderColumnLabels(t,h.slice(f,-1===d?void 0:d)),this.clearOverlay(),this.highlightHighlightedIds(t),this.highlightHighlightedTracks(t)}static getColumnLabelsFontSize(t){return t.getCellWidth()/2+2}prepareContextForColumnLabelText(t,e){const n=ct.getColumnLabelsFontSize(t);e.font=this.supersampling_ratio*n+"px Arial",e.textAlign="left",e.textBaseline="middle"}renderColumnLabels(t,e){this.column_label_ctx.fillStyle="rgba(0,0,0,0)",this.column_label_ctx.clearRect(0,0,this.$column_label_canvas[0].width,this.$column_label_canvas[0].height),this.maximum_column_label_width=0,this.maximum_column_label_height=0;const n=t.getColumnLabels();if(0===Object.keys(n).length)return;const r=this.getColumnLabelY(t),i=t.getZoomedColumnLeft(),o=this.scroll_x,s=t.getCellWidth();this.prepareContextForColumnLabelText(t,this.column_label_ctx);for(let a=0;a<e.length;a++){const l=n[e[a]];let u=this.column_label_ctx.measureText("m").width/this.supersampling_ratio;if(l){const n=(i[e[a]]+s/2-o)*this.supersampling_ratio;if(l.circle_color){this.column_label_ctx.save();const e=this.getColumnLabelCircleSpec(t);u=Math.max(2*e.radius,u),this.column_label_ctx.translate(n,r),this.column_label_ctx.fillStyle=l.circle_color,this.column_label_ctx.beginPath(),this.column_label_ctx.arc(0,0,this.supersampling_ratio*e.radius,0,2*Math.PI),this.column_label_ctx.fill(),this.column_label_ctx.restore()}this.column_label_ctx.save();const c=this.getColumnLabelAngleRadians(l),h=(l.left_padding_percent||0)*s/100;this.column_label_ctx.translate(n,r),this.column_label_ctx.rotate(c),this.column_label_ctx.fillStyle=l.text_color||"rgba(0,0,0,1)",this.column_label_ctx.fillText(l.text,h*this.supersampling_ratio,0);const f=this.column_label_ctx.measureText(l.text).width/this.supersampling_ratio;this.maximum_column_label_width=Math.max(this.maximum_column_label_width,Math.cos(c)*f),this.maximum_column_label_height=Math.max(this.maximum_column_label_height,Math.sin(c)*f,u),this.column_label_ctx.restore()}}}getColumnLabelAngleRadians(t){return p(t.angle_in_degrees,at)*Math.PI/180}getColumnLabelCircleSpec(t){return{radius:t.getCellWidth()/2*.9}}ensureSimpleCountBuffer(t){const e=t.getIdOrder().length;if(!this.simple_count_buffer||this.simple_count_buffer.numItems!==e){const t=this.ctx.createBuffer();this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,t),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,new Float32Array(C.a.range(0,e)),this.ctx.STATIC_DRAW),t.itemSize=1,t.numItems=e,this.simple_count_buffer=t}}clearTrackPositionAndColorBuffers(t,e){let n;n=void 0===e?t.getTracks():[e];for(let t=0;t<n.length;t++)this.is_buffer_empty[n[t]]&&(this.is_buffer_empty[n[t]].position=!0,this.is_buffer_empty[n[t]].color=!0,this.is_buffer_empty[n[t]].color_texture=!0)}clearTrackColumnBuffers(t,e){let n;n=void 0===e?t.getTracks():[e];for(let t=0;t<n.length;t++)this.is_buffer_empty[n[t]]&&(this.is_buffer_empty[n[t]].column=!0)}deleteBuffers(t,e){let n;n=void 0===e?t.getTracks():[e];for(let t=0;t<n.length;t++){const e=n[t];this.vertex_position_buffer[e]&&(this.ctx.deleteBuffer(this.vertex_position_buffer[e]),delete this.vertex_position_buffer[e]),this.vertex_color_buffer[e]&&(this.ctx.deleteBuffer(this.vertex_color_buffer[e]),delete this.vertex_color_buffer[e]),this.vertex_column_buffer[e]&&(this.ctx.deleteBuffer(this.vertex_column_buffer[e]),delete this.vertex_column_buffer[e]),this.color_texture[e]&&(this.ctx.deleteTexture(this.color_texture[e].texture),delete this.color_texture[e]),this.is_buffer_empty[e]={position:!0,color:!0,color_texture:!0,column:!0}}}deleteSimpleCountBuffer(t){this.simple_count_buffer&&(this.ctx.deleteBuffer(this.simple_count_buffer),this.simple_count_buffer=null)}getTrackBuffers(t){if(this.is_buffer_empty[t]=this.is_buffer_empty[t]||{position:!0,color:!0,color_texture:!0,column:!0},this.is_buffer_empty[t].position){const e=this.vertex_position_buffer[t]||this.ctx.createBuffer(),n=this.vertex_data[t].pos_array,r=this.vertex_data[t].universal_shapes_start_index;this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,e),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,n,this.ctx.STATIC_DRAW),e.itemSize=1,e.specificShapesNumItems=r/e.itemSize,e.universalShapesNumItems=(n.length-r)/e.itemSize,this.vertex_position_buffer[t]=e}if(this.is_buffer_empty[t].color){const e=this.vertex_color_buffer[t]||this.ctx.createBuffer(),n=this.vertex_data[t].col_array,r=this.vertex_data[t].universal_shapes_start_index;this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,e),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,n,this.ctx.STATIC_DRAW),e.itemSize=1,e.specificShapesNumItems=r/e.itemSize,e.universalShapesNumItems=(n.length-r)/e.itemSize,this.vertex_color_buffer[t]=e}if(this.is_buffer_empty[t].color_texture){const e=this.color_texture[t]?this.color_texture[t].texture:this.ctx.createTexture();this.ctx.bindTexture(this.ctx.TEXTURE_2D,e);const n=this.vertex_data[t].col_bank,r=Math.pow(2,Math.ceil(Math.log2(n.length/4)));for(;n.length<4*r;)n.push(0);const i=1;this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,r,i,0,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,new Uint8Array(n)),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.NEAREST),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.NEAREST),this.color_texture[t]={texture:e,size:r}}if(this.is_buffer_empty[t].column){const e=this.vertex_column_buffer[t]||this.ctx.createBuffer(),n=this.vertex_column_array[t];this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,e),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,n,this.ctx.STATIC_DRAW),e.itemSize=1,e.numItems=n.length/e.itemSize,this.vertex_column_buffer[t]=e}return this.is_buffer_empty[t]={position:!1,color:!1,column:!1,color_texture:!1},{position:this.vertex_position_buffer[t],color:this.vertex_color_buffer[t],color_tex:this.color_texture[t],column:this.vertex_column_buffer[t]}}computeVertexColumns(t,e){if(this.rendering_suppressed)return;const n=this.vertex_data[e].pos_array.length,r=this.id_to_first_vertex_index[e],i=t.getVisibleIdToIndexMap(),o=Object.keys(r).map((function(t){return[t,r[t]]})).sort((function(t,e){return m(t[1],e[1])})),s=new Float32Array(n);let a=0;for(let t=0;t<o.length;t++){const e=(t===o.length-1?n:o[t+1][1])-o[t][1],r=i[o[t][0]];for(let t=0;t<e;t++)s[a]=r,a+=1}this.vertex_column_array[e]=s,this.clearTrackColumnBuffers(t,e)}computeVertexPositionsAndVertexColors(t,e){if(this.rendering_suppressed)return;this.ensureSimpleCountBuffer(t);const n=this.universal_shapes[e],r=t.getIdToIndexMap(),i=C.a.sortBy(this.specific_shapes[e],t=>r[t.id]),o=C.a.sumBy(i,t=>C.a.sumBy(t.shape_list,J))+(n?C.a.sumBy(n,J):0),s=new Float32Array(o),a=new Float32Array(o),l=C.a.clone(r),u=[],c={},h=this.position_bit_pack_base;const f={};let d=0;function p(t,e){const n=nt.hashComputedShape(t,e);if(!(n in f)){f[n]={position:[],color:[]};const r=f[n].position,i=f[n].color;X(t,e,(function(t,e){var n;t=t.map(Math.round),r.push(h*h*(n=t)[0]+h*n[1]+n[2]);const o=`${e[0]},${e[1]},${e[2]},${e[3]}`;let s=c[o];void 0===s&&(s=u.length,u.push(e),c[o]=s),i.push(s)}))}const r=f[n].position,i=f[n].color;for(let t=0;t<r.length;t++)s[d]=r[t],a[d]=i[t],d+=1}for(let t=0;t<i.length;t++){const e=i[t].shape_list;l[i[t].id]=d;for(let t=0;t<e.length;t++){p(e[t],t)}}const g=d;if(n)for(let t=0;t<n.length;t++){p(n[t],t)}const m=u.reduce((function(t,e){return t.concat(e)}),[]);0===m.length&&m.push(0,0,0,0),this.vertex_data[e]={pos_array:s,col_array:a,col_bank:m,universal_shapes_start_index:g},this.id_to_first_vertex_index[e]=l,this.clearTrackPositionAndColorBuffers(t,e)}getShapes(t,e){this.rendering_suppressed||(this.specific_shapes[e]=t.getSpecificShapesForData(e,!0),this.universal_shapes[e]=t.getTrackUniversalShapes(e,!0))}refreshCanvas(t){this.deleteBuffers(t),this.deleteSimpleCountBuffer(t),this.getNewCanvas(),this.getWebGLContextAndSetUpMatrices(),this.setUpShaders(t),this.ensureSimpleCountBuffer(t)}highlightCell(t,e,n){this.overlayStrokeRect(t.getZoomedColumnLeft(n)-this.scroll_x,t.getCellTops(e)-this.scroll_y,t.getCellWidth()+(t.getTrackHasColumnSpacing(e)?0:t.getCellPadding()),t.getCellHeight(e),"rgba(0,0,0,1)")}highlightTrack(t,e){const n=t.getCellWidth()+(t.getTrackHasColumnSpacing(e)?0:t.getCellPadding()),r=t.getCellHeight(e),i=t.getIdOrder(),o=t.getZoomedColumnLeft(),s=t.getCellTops(e)-this.scroll_y;for(const a of i)null!==t.getTrackDatum(e,a)&&a in o&&this.overlayStrokeRect(o[a]-this.scroll_x,s,n,r,ut)}highlightColumn(t,e){const n=t.getZoomedColumnLeft(e)-this.scroll_x,r=t.getCellPadding(),i=t.getCellWidth(),o=t.getTracks();for(let s=0;s<o.length;s++)null!==t.getTrackDatum(o[s],e)&&this.overlayStrokeRect(n,t.getCellTops(o[s])-this.scroll_y,i+(t.getTrackHasColumnSpacing(o[s])?0:r),t.getCellHeight(o[s]),ut);this.overlayColumnLabelHighlight(t,e)}getViewportOncoprintSpace(t){const e=this.scroll_y,n=t.getVertZoom(),r=t.getIdOrder(),i=t.getClosestColumnIndexToLeft(this.scroll_x,!0),o=r[i],s=t.getClosestColumnIndexToLeft(this.scroll_x+this.visible_area_width,!0,!0);let a;return a=s<r.length?t.getColumnLeft(r[s]):t.getColumnLeft(r[r.length-1])+t.getCellWidth(!0),{top:Math.round(e/n),bottom:Math.round((e+this.getVisibleAreaHeight(t))/n),left:t.getColumnLeft(o),right:a,center_col_index:Math.floor((s+i)/2)}}isUsable(){return null!==this.ctx}removeTrack(t,e){this.deleteBuffers(t,e),delete this.specific_shapes[e],delete this.vertex_data[e],delete this.vertex_column_array[e],delete this.id_to_first_vertex_index[e],delete this.is_buffer_empty[e],delete this.universal_shapes[e],this.rendering_suppressed||this.renderAllTracks(t)}moveTrack(t){this.rendering_suppressed||this.renderAllTracks(t)}setTrackGroupOrder(t){this.rendering_suppressed||this.renderAllTracks(t)}setTrackShowGaps(t){this.rendering_suppressed||(this.setUpShaders(t),this.renderAllTracks(t))}setColumnLabels(t){this.rendering_suppressed||this.renderAllTracks(t)}addTracks(t,e){if(!this.rendering_suppressed){for(let n=0;n<e.length;n++)this.getShapes(t,e[n]),this.computeVertexPositionsAndVertexColors(t,e[n]),this.computeVertexColumns(t,e[n]);this.renderAllTracks(t)}}setIdOrder(t,e){if(this.rendering_suppressed)return;const n=t.getTracks();for(let e=0;e<n.length;e++)this.computeVertexColumns(t,n[e]);this.renderAllTracks(t)}setTrackGroupSortPriority(t){this.rendering_suppressed||this.renderAllTracks(t)}sort(t){if(this.rendering_suppressed)return;const e=t.getTracks();for(let n=0;n<e.length;n++)this.computeVertexPositionsAndVertexColors(t,e[n]),this.computeVertexColumns(t,e[n]);this.renderAllTracks(t)}suppressRendering(){this.rendering_suppressed=!0}releaseRendering(t){this.rendering_suppressed=!1,this.updateAntialiasSetting(t);const e=t.getTracks();for(let n=0;n<e.length;n++)this.getShapes(t,e[n]),this.computeVertexPositionsAndVertexColors(t,e[n]),this.computeVertexColumns(t,e[n]);this.setUpShaders(t),this.renderAllTracks(t)}hideIds(t){if(this.rendering_suppressed)return;const e=t.getTracks();for(let n=0;n<e.length;n++)this.computeVertexColumns(t,e[n]);this.renderAllTracks(t)}setTrackImportantIds(t,e){this.rendering_suppressed||(this.getShapes(t,e),this.computeVertexPositionsAndVertexColors(t,e),this.computeVertexColumns(t,e),this.renderAllTracks(t))}setTrackData(t,e){this.rendering_suppressed||(this.getShapes(t,e),this.computeVertexPositionsAndVertexColors(t,e),this.computeVertexColumns(t,e),this.renderAllTracks(t))}setRuleSet(t,e){this.rendering_suppressed||(this.getShapes(t,e),this.computeVertexPositionsAndVertexColors(t,e),this.renderAllTracks(t))}shareRuleSet(t,e){this.rendering_suppressed||(this.getShapes(t,e),this.computeVertexPositionsAndVertexColors(t,e),this.renderAllTracks(t))}setSortConfig(t){this.rendering_suppressed||this.sort(t)}setHorzScroll(t){this.setScroll(t)}setVertScroll(t){this.setScroll(t)}setScroll(t){this.scroll_x=t.getHorzScroll(),this.scroll_y=t.getVertScroll(),this.rendering_suppressed||this.renderAllTracks(t,!0)}updateAntialiasSetting(t){t.getCellWidth()<this.antialias_on_cell_width_thresh?this.antialias||(this.antialias=!0,this.refreshCanvas(t)):this.antialias&&(this.antialias=!1,this.refreshCanvas(t))}setZoom(t){this.rendering_suppressed||(this.updateAntialiasSetting(t),this.renderAllTracks(t))}setHorzZoom(t){this.rendering_suppressed||(this.updateAntialiasSetting(t),this.renderAllTracks(t))}setVertZoom(t){this.rendering_suppressed||this.renderAllTracks(t)}setTrackGroupHeader(t){this.rendering_suppressed||this.renderAllTracks(t)}setViewport(t){this.scroll_x=t.getHorzScroll(),this.scroll_y=t.getVertScroll(),this.rendering_suppressed||(this.updateAntialiasSetting(t),this.renderAllTracks(t))}getTotalWidth(t,e){let n=t.getOncoprintWidth(e);return this.maximum_column_label_width>0&&(n+=this.maximum_column_label_width),n}getVisibleAreaWidth(){return this.visible_area_width}setWidth(t,e){this.visible_area_width=t,this.rendering_suppressed||this.renderAllTracks(e)}getColumnLabelsHeight(){let t=0;return this.maximum_column_label_height>0&&(t+=lt,t+=this.maximum_column_label_height),t}getTotalHeight(t){return t.getOncoprintHeight()+this.getColumnLabelsHeight()}getVisibleAreaHeight(t){return Math.min(t.getOncoprintHeight(),t.max_height)+this.getColumnLabelsHeight()}setCellPaddingOn(t){if(this.rendering_suppressed)return;const e=t.getTracks();for(let n=0;n<e.length;n++)t.getTrackHasColumnSpacing(e[n])||(this.getShapes(t,e[n]),this.computeVertexPositionsAndVertexColors(t,e[n])),this.computeVertexColumns(t,e[n]);this.renderAllTracks(t)}setHighlightedIds(t){this.clearOverlay(),this.highlightHighlightedIds(t),this.highlightHighlightedTracks(t)}setHighlightedTracks(t){this.clearOverlay(),this.highlightHighlightedIds(t),this.highlightHighlightedTracks(t)}highlightHighlightedIds(t,e){const n=t.getVisibleHighlightedIds();for(let r=0;r<n.length;r++)e&&-1!==e.indexOf(n[r])||this.highlightColumn(t,n[r])}highlightHighlightedTracks(t){const e=t.getHighlightedTracks();for(let n=0;n<e.length;n++)this.highlightTrack(t,e[n])}getDummyScrollDivClientSize(){return this.dummy_scroll_div_client_size.get()}toSVGGroup(t,e,n){const r=U.group(e||0,n||0),i=t.getCellTops(),o=t.getTracks(),s=t.getZoomedColumnLeft();for(let e=0;e<o.length;e++){const n=o[e],a=i[n],l=t.getTrackUniversalShapes(n,!1),u=t.getSpecificShapesForData(n,!1);for(let t=0;t<u.length;t++){const e=u[t],n=e.id,i=e.shape_list,o=s[n];if(void 0!==o){for(let t=0;t<l.length;t++)r.appendChild(U.fromShape(l[t],o,a));for(let t=0;t<i.length;t++)r.appendChild(U.fromShape(i[t],o,a))}}}const a=t.getColumnLabels(),l=t.getZoomedColumnLeft(),u=Object.keys(a),c=t.getOncoprintHeight()+10,h=ct.getColumnLabelsFontSize(t),f=t.getCellWidth();for(let e=0;e<u.length;e++){const n=u[e];if(!(n in l))continue;const i=a[n],o=l[n]+f/2;if(i.circle_color){const e=this.getColumnLabelCircleSpec(t);r.appendChild(V("ellipse",{cx:o,cy:c,rx:e.radius,ry:e.radius,stroke:"rgba(0,0,0,0)",fill:i.circle_color}))}const s=o+(i.left_padding_percent||0)/100*f,d=p(i.angle_in_degrees,at),g=V("text",{x:s,y:c,fill:i.text_color||"#000000","font-size":h,"font-family":"Arial","font-weight":"normal","text-anchor":"start",transform:"rotate("+d+","+s+","+c+")","alignment-baseline":"middle"});g.textContent=i.text,r.appendChild(g)}return r}destroy(){this.$overlay_canvas.off(),c()(document).off("mousemove",this.mouseMoveHandler)}}const ht=25;class ft{constructor(t,e,n){this.$canvas=t,this.model=e,this.tooltip=n,this.supersampling_ratio=2,this.base_font_size=14,this.track_tops={},this.cell_tops={},this.cell_tops_view_space={},this.cell_tops_this_space={},this.cell_heights={},this.cell_heights_view_space={},this.cell_heights_this_space={},this.label_middles_view_space={},this.label_middles_this_space={},this.label_left_padding={},this.labels={},this.sublabels={},this.label_colors={},this.label_circle_colors={},this.label_font_weight={},this.html_labels={},this.track_link_urls={},this.track_descriptions={},this.minimum_track_height=Number.POSITIVE_INFINITY,this.maximum_label_width=Number.NEGATIVE_INFINITY,this.tracks=[],this.rendering_suppressed=!1,this.highlighted_track_label_only=null,this.scroll_y=0;this.show_sublabels=e.getShowTrackSublabels(),this.setUpContext(),function(t){t.drag_callback=function(t,e){},t.dragged_label_track_id=null,t.drag_mouse_y=null,t.$canvas.on("mousedown",(function(n){t.tooltip.hide();const r=t.isMouseOnLabel(n.offsetY);null!==r&&e.getContainingTrackGroup(r).length>1&&!e.isTrackInClusteredGroup(r)&&e.getTrackMovable(r)&&t.startDragging(e,r,n.offsetY)})),t.$canvas.on("mousemove",(function(n){if(null!==t.dragged_label_track_id){const r=e.getContainingTrackGroup(t.dragged_label_track_id),i=e.getLastExpansion(r[r.length-1]),o=t.track_tops[i]+e.getTrackHeight(i)-t.scroll_y,s=t.track_tops[r[0]]-5-t.scroll_y;t.drag_mouse_y=Math.min(n.pageY-t.$canvas.offset().top,o),t.drag_mouse_y=Math.max(t.drag_mouse_y,s),t.renderAllLabels(e)}else{const r=t.isMouseOnLabel(n.pageY-t.$canvas.offset().top);if(null!==r){const n=c()("<div>"),i=t.$canvas[0].getBoundingClientRect();(t.isNecessaryToShortenLabel(t.labels[r])||t.track_link_urls[r])&&n.append(ft.formatTooltipHeader(t.labels[r],t.html_labels[r],t.track_link_urls[r]));const o=t.track_descriptions[r];o.length>0&&n.append(c()("<div>").text(o)),e.getTrackMovable(r)&&(e.isTrackInClusteredGroup(r)?(t.$canvas.css("cursor","not-allowed"),n.append("<b>dragging disabled for clustered tracks</b>")):e.getContainingTrackGroup(r).length>1&&(t.$canvas.css("cursor","move"),n.append("<b>hold to drag</b>"))),n.contents().length>0&&t.tooltip.fadeIn(200,t.renderedLabelWidth(t.labels[r])+i.left,t.cell_tops[r]+i.top-t.scroll_y,n)}else t.$canvas.css("cursor","auto"),t.tooltip.hide()}})),t.$canvas.on("mouseup mouseleave",(function(n){if(null!==t.dragged_label_track_id){const r=e.getContainingTrackGroup(t.dragged_label_track_id),i=t.getLabelAboveMouseSpace(r,n.offsetY,t.dragged_label_track_id);t.stopDragging(e,i)}t.tooltip.hideIfNotAlreadyGoingTo(150)}))}(this)}circleRadius(){return.8*this.minimum_track_height/2}renderedLabelWidth(t){return this.ctx.measureText(this.shortenLabelIfNecessary(t)).width/this.supersampling_ratio}updateFromModel(t){if(!this.rendering_suppressed){this.show_sublabels=t.getShowTrackSublabels(),this.scroll_y=t.getVertScroll(),this.track_tops=t.getZoomedTrackTops(),this.cell_tops=t.getCellTops(),this.cell_tops_this_space={},this.cell_heights={},this.tracks=t.getTracks(),this.track_descriptions={},this.ctx.font="bold "+this.getFontSize()+"px Arial",this.minimum_track_height=Number.POSITIVE_INFINITY,this.maximum_label_width=0;for(let e=0;e<this.tracks.length;e++){this.minimum_track_height=Math.min(this.minimum_track_height,t.getTrackHeight(this.tracks[e]));const n=this.shortenLabelIfNecessary(this.labels[this.tracks[e]]),r=this.shortenLabelIfNecessary(this.sublabels[this.tracks[e]]),i=this.ctx.measureText(n).width+(this.show_sublabels?this.ctx.measureText(r).width:0);this.maximum_label_width=Math.max(this.maximum_label_width,i),this.cell_tops_this_space[this.tracks[e]]=this.cell_tops[this.tracks[e]]*this.supersampling_ratio-this.scroll_y*this.supersampling_ratio,this.track_descriptions[this.tracks[e]]=t.getTrackDescription(this.tracks[e]),this.cell_heights[this.tracks[e]]=t.getCellHeight(this.tracks[e]),this.cell_heights_this_space[this.tracks[e]]=this.cell_heights[this.tracks[e]]*this.supersampling_ratio,this.label_middles_this_space[this.tracks[e]]=this.cell_tops_this_space[this.tracks[e]]+this.cell_heights_this_space[this.tracks[e]]/2}}}setUpContext(){this.ctx=this.$canvas[0].getContext("2d"),this.ctx.textAlign="start",this.ctx.textBaseline="middle"}resizeAndClear(t,e){if(this.rendering_suppressed)return;const n=e(),r=this.getWidth();this.$canvas[0].height=this.supersampling_ratio*n,this.$canvas[0].width=this.supersampling_ratio*r,this.$canvas[0].style.height=n+"px",this.$canvas[0].style.width=r+"px",this.setUpContext()}isNecessaryToShortenLabel(t){return t.length>this.getMaximumLabelLength()}shortenLabelIfNecessary(t){return this.isNecessaryToShortenLabel(t)?t.substring(0,this.getMaximumLabelLength()-3)+"...":t}static formatTooltipHeader(t,e,n){let r;return(r=n?c()('<a target="_blank" rel="noopener noreferrer">').attr("href",n):c()("<span>")).append(e||document.createTextNode(t)),c()('<b style="display: block;">').append(r)}renderAllLabels(t){if(this.rendering_suppressed)return;this.ctx.clearRect(0,0,this.$canvas[0].width,this.$canvas[0].height);const e=[];e.push(...t.getHighlightedTracks()),null!==this.highlighted_track_label_only&&e.push(this.highlighted_track_label_only);for(const t of e)this.cell_tops_this_space.hasOwnProperty(t)&&(this.ctx.fillStyle="rgba(255,255,0,0.4)",this.ctx.fillRect(0,this.cell_tops_this_space[t],this.getWidth()*this.supersampling_ratio,this.cell_heights_this_space[t]));const n=this.getFontSize(),r=this.tracks,i={};for(let t=0;t<r.length;t++){this.label_circle_colors[r[t]]&&(this.ctx.fillStyle=this.label_circle_colors[r[t]],this.ctx.beginPath(),this.ctx.arc(ht*this.supersampling_ratio,this.label_middles_this_space[r[t]],this.supersampling_ratio*this.circleRadius(),0,2*Math.PI),this.ctx.fill()),this.ctx.font=(this.label_font_weight[r[t]]||"bold")+" "+n+"px Arial",this.ctx.fillStyle="black",this.label_colors&&this.label_colors[r[t]]&&(this.ctx.fillStyle=this.label_colors[r[t]]);const e=this.shortenLabelIfNecessary(this.labels[r[t]]);this.ctx.fillText(e,this.label_left_padding[r[t]]*this.supersampling_ratio,this.label_middles_this_space[r[t]]),i[r[t]]=this.ctx.measureText(e).width}if(this.show_sublabels){this.ctx.font=n+"px Arial",this.ctx.fillStyle="rgb(166,166,166)";for(let t=0;t<r.length;t++)this.sublabels[r[t]]&&this.ctx.fillText(this.shortenLabelIfNecessary(this.sublabels[r[t]]),i[r[t]],this.label_middles_this_space[r[t]])}if(null!==this.dragged_label_track_id){this.ctx.font="bold "+n+"px Arial",this.ctx.fillStyle="rgba(255,0,0,0.95)",this.ctx.fillText(this.shortenLabelIfNecessary(this.labels[this.dragged_label_track_id]),0,this.supersampling_ratio*this.drag_mouse_y),this.ctx.fillStyle="rgba(0,0,0,0.15)";const t=this.model.getContainingTrackGroup(this.dragged_label_track_id),e=this.model.getLastExpansion(this.getLabelAboveMouseSpace(t,this.drag_mouse_y,null)),i=this.getLabelBelowMouseSpace(t,this.drag_mouse_y,null);let o,s;if(e===this.dragged_label_track_id||i===this.dragged_label_track_id)return;null!==e&&null!==i?(o=this.cell_tops_this_space[e]+this.cell_heights_this_space[e],s=this.cell_tops_this_space[i]-o):null===e?(o=this.cell_tops_this_space[t[0]]-this.ctx.measureText("m").width,s=this.ctx.measureText("m").width):null===i&&(o=this.cell_tops_this_space[e]+this.cell_heights_this_space[e],s=this.ctx.measureText("m").width);const a=4;s=Math.max(s,a),this.ctx.fillRect(this.label_left_padding[r[r.length-1]]*this.supersampling_ratio,o,this.getWidth()*this.supersampling_ratio,s)}}isMouseOnLabel(t){const e=this.getLabelAboveMouseSpace(this.tracks,t,null);return null===e?null:t<=this.cell_tops[e]-this.scroll_y+this.cell_heights[e]?e:null}getLabelAboveMouseSpace(t,e,n){if(e<this.cell_tops[t[0]]-this.scroll_y)return null;{let r=null;for(let i=0;i<t.length;i++)if(null===n||n!==t[i]){if(this.cell_tops[t[i]]-this.scroll_y>e)break;r=t[i]}return r}}getLabelBelowMouseSpace(t,e,n){if(e>this.cell_tops[t[t.length-1]]-this.scroll_y)return null;{let r=null;for(let i=t.length-1;i>=0;i--)if(null===n||n!==t[i]){if(this.cell_tops[t[i]]-this.scroll_y<e)break;r=t[i]}return r}}startDragging(t,e,n){this.dragged_label_track_id=e,this.drag_mouse_y=n,this.renderAllLabels(t)}stopDragging(t,e){this.drag_callback(this.dragged_label_track_id,e),this.dragged_label_track_id=null,this.renderAllLabels(t)}getMaximumLabelLength(){return 18}getWidth(){return this.model.getShowTrackLabels()?Math.max(this.maximum_label_width/this.supersampling_ratio+10,70):0}getFontSize(t){return(t?1:this.supersampling_ratio)*Math.max(Math.min(this.base_font_size,this.minimum_track_height),7)}setDragCallback(t){this.drag_callback=t}removeTrack(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}moveTrack(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}setTrackGroupOrder(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}setShowTrackLabels(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}addTracks(t,e,n){for(let n=0;n<e.length;n++)this.labels[e[n]]=t.getTrackLabel(e[n]),this.sublabels[e[n]]=t.getTrackSublabel(e[n]),this.label_colors[e[n]]=t.getTrackLabelColor(e[n]),this.label_circle_colors[e[n]]=t.getTrackLabelCircleColor(e[n]),this.label_left_padding[e[n]]=t.getTrackLabelLeftPadding(e[n]),this.label_font_weight[e[n]]=t.getTrackLabelFontWeight(e[n]),this.html_labels[e[n]]=t.getOptionalHtmlTrackLabel(e[n]),this.track_link_urls[e[n]]=t.getTrackLinkUrl(e[n]);this.updateFromModel(t),this.resizeAndClear(t,n),this.renderAllLabels(t)}setShowTrackSublabels(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}setScroll(t,e){this.setVertScroll(t,e)}setHorzScroll(t){}setViewport(t,e){this.setVertScroll(t,e)}setVertScroll(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}setVertZoom(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}setZoom(t,e){this.setVertZoom(t,e)}highlightTrackLabelOnly(t,e){this.highlighted_track_label_only=t,this.renderAllLabels(e)}setHighlightedTracks(t){this.renderAllLabels(t)}setTrackMovable(t){this.renderAllLabels(t)}setTrackGroupHeader(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}sort(t,e){this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}suppressRendering(){this.rendering_suppressed=!0}releaseRendering(t,e){this.rendering_suppressed=!1,this.updateFromModel(t),this.resizeAndClear(t,e),this.renderAllLabels(t)}toSVGGroup(t,e,n,r){const i=U.group(n||0,r||0);if(!t.getShowTrackLabels())return i;const o=t.getCellTops(),s=t.getTracks();for(let n=0;n<s.length;n++){const r=s[n],a=o[r]+t.getCellHeight(r)/2,l=t.getTrackLabel(r),u=t.getTrackLabelCircleColor(r);u&&i.appendChild(V("ellipse",{cx:ht.toString(),cy:a.toString(),rx:this.circleRadius().toString(),ry:this.circleRadius().toString(),stroke:"rgba(0,0,0,0)",fill:u}));const c=U.text(e?l:this.shortenLabelIfNecessary(l),t.getTrackLabelLeftPadding(r),a,this.getFontSize(!0),"Arial",t.getTrackLabelFontWeight(r)||"bold","bottom",u?"white":"black");c.setAttribute("dy","0.35em"),i.appendChild(c)}return i}}var dt,pt={viridis:[[68.08602,1.24287,84.000825,1],[68.47005,2.449275,85.533885,1],[68.83572,3.729375,87.051645,1],[69.182775,5.08521,88.553595,1],[69.51147,6.518565,90.038715,1],[69.821295,8.031735,91.507515,1],[70.11276,9.62676,92.958465,1],[70.38561,11.262585,94.39182,1],[70.63959,12.83772,95.807325,1],[70.874955,14.36262,97.203705,1],[71.091705,15.846975,98.58096,1],[71.28933,17.29818,99.938835,1],[71.468085,18.721335,101.276565,1],[71.62797,20.121285,102.593895,1],[71.76873,21.5016,103.89057,1],[71.89062,22.86483,105.165825,1],[71.993385,24.213525,106.419405,1],[72.07728,25.54998,107.6508,1],[72.14205,26.875215,108.86001,1],[72.188205,28.191015,110.04627,1],[72.215235,29.4984,111.209325,1],[72.223395,30.798135,112.34892,1],[72.212685,32.09124,113.4648,1],[72.18336,33.378225,114.556455,1],[72.13542,34.6596,115.623885,1],[72.068865,35.93613,116.666835,1],[71.98395,37.20756,117.68505,1],[71.881185,38.474655,118.678275,1],[71.76006,39.73767,119.646255,1],[71.62134,40.996605,120.589245,1],[71.465025,42.251715,121.50699,1],[71.29137,43.502745,122.399235,1],[71.10063,44.74995,123.266235,1],[70.89306,45.993585,124.107735,1],[70.66917,47.23314,124.92399,1],[70.42947,48.46887,125.715255,1],[70.173705,49.700775,126.481275,1],[69.90264,50.928855,127.222305,1],[69.61653,52.1526,127.938855,1],[69.31614,53.372265,128.63067,1],[69.001725,54.587595,129.29826,1],[68.67354,55.79859,129.942135,1],[68.33184,57.004995,130.56204,1],[67.9779,58.20681,131.158995,1],[67.611975,59.40378,131.732745,1],[67.234065,60.595905,132.28431,1],[66.84519,61.78293,132.813435,1],[66.445605,62.96511,133.32114,1],[66.036075,64.141935,133.80768,1],[65.61711,65.31315,134.273565,1],[65.189475,66.479265,134.71956,1],[64.753425,67.63977,135.145665,1],[64.30947,68.794665,135.552645,1],[63.858375,69.94395,135.941265,1],[63.400395,71.087625,136.31178,1],[62.936805,72.225435,136.664955,1],[62.46786,73.357125,137.0013,1],[61.993815,74.48346,137.32158,1],[61.515435,75.603675,137.625795,1],[61.03323,76.718025,137.91522,1],[60.547455,77.82651,138.189855,1],[60.05913,78.929385,138.45072,1],[59.568765,80.02614,138.69807,1],[59.07687,81.11703,138.93267,1],[58.583445,82.202055,139.15503,1],[58.08951,83.28147,139.36566,1],[57.595065,84.355275,139.56507,1],[57.100875,85.42347,139.753515,1],[56.607195,86.486055,139.93176,1],[56.114535,87.543285,140.100315,1],[55.62315,88.59516,140.25969,1],[55.13355,89.641425,140.409885,1],[54.64599,90.682845,140.55192,1],[54.160725,91.719165,140.68605,1],[53.678265,92.750385,140.81253,1],[53.198865,93.77676,140.932125,1],[52.72278,94.79829,141.044835,1],[52.250265,95.81523,141.150915,1],[51.781065,96.82758,141.250875,1],[51.315945,97.83585,141.34497,1],[50.85465,98.839785,141.43371,1],[50.39718,99.83964,141.517095,1],[49.9443,100.835415,141.59538,1],[49.4955,101.827365,141.669075,1],[49.051035,102.815745,141.73818,1],[48.610905,103.800555,141.802695,1],[48.175365,104.78205,141.86313,1],[47.743905,105.76023,141.919485,1],[47.31678,106.73535,141.972015,1],[46.89399,107.707665,142.02072,1],[46.47528,108.67692,142.0656,1],[46.060395,109.643625,142.10691,1],[45.649845,110.60778,142.14465,1],[45.242865,111.569385,142.179075,1],[44.839455,112.52895,142.209675,1],[44.43987,113.48622,142.23696,1],[44.043345,114.441705,142.260675,1],[43.64988,115.39515,142.281075,1],[43.25973,116.34681,142.29765,1],[42.87213,117.29694,142.31091,1],[42.487335,118.24554,142.320345,1],[42.104835,119.192865,142.325955,1],[41.724375,120.138915,142.32774,1],[41.34621,121.08369,142.3257,1],[40.969575,122.0277,142.319325,1],[40.59447,122.970435,142.308615,1],[40.220895,123.91266,142.293315,1],[39.84885,124.85412,142.27368,1],[39.477825,125.794815,142.2492,1],[39.10782,126.735,142.21962,1],[38.73909,127.674675,142.184685,1],[38.37138,128.614095,142.14465,1],[38.004945,129.553005,142.09875,1],[37.639785,130.491915,142.047495,1],[37.2759,131.430315,141.989865,1],[36.913545,132.368715,141.92586,1],[36.552465,133.307115,141.855225,1],[36.193425,134.245515,141.777705,1],[35.83668,135.18366,141.693045,1],[35.482485,136.12206,141.60099,1],[35.13135,137.06046,141.50103,1],[34.78404,137.999115,141.393165,1],[34.44183,138.937515,141.277395,1],[34.104465,139.876425,141.152955,1],[33.77322,140.81508,141.01959,1],[33.44886,141.754245,140.877045,1],[33.132915,142.69341,140.72532,1],[32.825895,143.632575,140.563395,1],[32.52984,144.571995,140.39178,1],[32.245515,145.511415,140.209455,1],[31.97547,146.45109,140.01693,1],[31.720725,147.39051,139.813185,1],[31.483065,148.330185,139.598475,1],[31.26453,149.269605,139.372035,1],[31.066905,150.209025,139.133865,1],[30.89274,151.148445,138.883455,1],[30.744075,152.08761,138.620805,1],[30.62346,153.02652,138.34515,1],[30.53319,153.965175,138.057,1],[30.47556,154.90332,137.75559,1],[30.452865,155.840955,137.44041,1],[30.468165,156.778335,137.11146,1],[30.523245,157.71495,136.768485,1],[30.620655,158.651055,136.41123,1],[30.76269,159.58614,136.03944,1],[30.9519,160.52046,135.653115,1],[31.18956,161.454015,135.25149,1],[31.47822,162.386295,134.834565,1],[31.8189,163.317555,134.40234,1],[32.21313,164.247285,133.954305,1],[32.662185,165.175995,133.490205,1],[33.167085,166.10292,133.01004,1],[33.72834,167.02857,132.513555,1],[34.34646,167.95218,132.000495,1],[35.021445,168.87426,131.470605,1],[35.75355,169.794045,130.923885,1],[36.542265,170.712045,130.359825,1],[37.38708,171.62775,129.77868,1],[38.28774,172.540905,129.180195,1],[39.24297,173.451765,128.56386,1],[40.252005,174.360075,127.92993,1],[41.31408,175.26558,127.277895,1],[42.427665,176.16828,126.60801,1],[43.59174,177.06792,125.919765,1],[44.805285,177.9645,125.213415,1],[46.066515,178.85751,124.488195,1],[47.374665,179.747205,123.744615,1],[48.72795,180.63333,122.98242,1],[50.125605,181.515885,122.201355,1],[51.565845,182.39436,121.40142,1],[53.04765,183.268755,120.582615,1],[54.57,184.13907,119.74494,1],[56.13162,185.004795,118.88763,1],[57.731235,185.86644,118.011195,1],[59.367825,186.722985,117.115635,1],[61.04037,187.57494,116.20044,1],[62.74785,188.42205,115.26612,1],[64.489245,189.263805,114.31242,1],[66.263535,190.10046,113.339085,1],[68.069955,190.931505,112.346115,1],[69.907995,191.75694,111.333255,1],[71.776635,192.576765,110.30076,1],[73.674855,193.39047,109.24863,1],[75.602145,194.198055,108.176865,1],[77.55774,194.99952,107.085465,1],[79.540875,195.79461,105.97443,1],[81.551295,196.58307,104.84376,1],[83.58798,197.3649,103.6932,1],[85.650675,198.13959,102.522495,1],[87.73887,198.907395,101.332155,1],[89.8518,199.667805,100.12218,1],[91.988955,200.42082,98.89257,1],[94.14957,201.16644,97.64307,1],[96.333645,201.904155,96.374445,1],[98.540415,202.63422,95.08593,1],[100.76937,203.356125,93.778035,1],[103.020255,204.070125,92.45076,1],[105.292815,204.775455,91.103595,1],[107.58654,205.47237,89.73705,1],[109.900665,206.160615,88.35138,1],[112.234935,206.84019,86.946585,1],[114.58884,207.51084,85.52292,1],[116.96187,208.172565,84.080385,1],[119.353515,208.824855,82.61949,1],[121.76352,209.46822,81.139725,1],[124.19163,210.101895,79.641855,1],[126.636825,210.72588,78.126135,1],[129.099105,211.34043,76.59231,1],[131.57796,211.94529,75.041145,1],[134.07288,212.540205,73.472385,1],[136.583355,213.125175,71.88654,1],[139.10862,213.699945,70.28463,1],[141.64842,214.26477,68.666655,1],[144.20199,214.81965,67.033635,1],[146.768565,215.36433,65.385825,1],[149.34789,215.898555,63.723735,1],[151.938945,216.422835,62.048895,1],[154.541475,216.936915,60.36156,1],[157.154715,217.440795,58.66326,1],[159.777645,217.934475,56.955015,1],[162.41001,218.41821,55.2381,1],[165.050535,218.892,53.514555,1],[167.69871,219.355845,51.78591,1],[170.35377,219.809745,50.054715,1],[173.014695,220.25421,48.323265,1],[175.68072,220.68924,46.594875,1],[178.350825,221.114835,44.872605,1],[181.02399,221.531505,43.160535,1],[183.699705,221.93925,41.463765,1],[186.376695,222.33858,39.787395,1],[189.05394,222.729495,38.138055,1],[191.73042,223.112505,36.52314,1],[194.405115,223.48812,34.95132,1],[197.07726,223.85634,33.432795,1],[199.745325,224.217675,31.978275,1],[202.4088,224.57289,30.601275,1],[205.06641,224.92173,29.316075,1],[207.71688,225.265215,28.138485,1],[210.3597,225.6036,27.085335,1],[212.99385,225.937395,26.17473,1],[215.618055,226.26711,25.42401,1],[218.23155,226.593255,24.85026,1],[220.833315,226.91634,24.468015,1],[223.42284,227.236875,24.28875,1],[225.999105,227.55537,24.32037,1],[228.5616,227.87208,24.565425,1],[231.109305,228.188025,25.021875,1],[233.64171,228.503205,25.682835,1],[236.15703,228.81915,26.538105,1],[238.65552,229.13535,27.573405,1],[241.13718,229.452825,28.77369,1],[243.6015,229.771575,30.12264,1],[246.04797,230.092365,31.604955,1],[248.476335,230.41545,33.204825,1],[250.88634,230.741085,34.908735,1],[253.27824,231.070035,36.70368,1]],inferno:[[.37281,.11883,3.53583,1],[.578085,.32385,4.73535,1],[.841245,.573495,6.180945,1],[1.159485,.86496,7.881795,1],[1.53153,1.19646,9.83229,1],[1.95738,1.56468,11.94318,1],[2.438055,1.966815,14.061465,1],[2.974065,2.401335,16.1823,1],[3.568725,2.862375,18.32481,1],[4.223055,3.34968,20.47191,1],[4.940115,3.858915,22.635585,1],[5.723985,4.385745,24.818385,1],[6.577215,4.929405,27.01215,1],[7.50516,5.483265,29.228355,1],[8.513175,6.04401,31.466235,1],[9.60534,6.609855,33.71916,1],[10.774515,7.175445,35.990955,1],[11.963325,7.73262,38.29182,1],[13.16922,8.28087,40.60977,1],[14.394495,8.815095,42.94557,1],[15.6417,9.33045,45.29871,1],[16.914405,9.81852,47.67531,1],[18.214395,10.27497,50.07027,1],[19.542435,10.685775,52.478745,1],[20.90031,11.04864,54.898695,1],[22.289805,11.36178,57.327315,1],[23.71245,11.623665,59.76129,1],[25.16901,11.83251,62.19552,1],[26.660505,11.98704,64.62465,1],[28.18668,12.086745,67.04256,1],[29.74728,12.13137,69.441855,1],[31.34154,12.12168,71.81412,1],[32.967675,12.059715,74.15094,1],[34.62339,11.94828,76.44288,1],[36.30639,11.79171,78.681015,1],[38.013615,11.59434,80.856675,1],[39.74175,11.362545,82.96119,1],[41.485695,11.10627,84.985635,1],[43.241625,10.834695,86.92287,1],[45.005715,10.55751,88.768305,1],[46.774395,10.283895,90.517605,1],[48.543585,10.023795,92.168985,1],[50.310735,9.792,93.721425,1],[52.073295,9.59616,95.17569,1],[53.829225,9.44265,96.533565,1],[55.576995,9.336825,97.79811,1],[57.314565,9.283275,98.972895,1],[59.04219,9.283275,100.062,1],[60.759615,9.338355,101.070015,1],[62.466585,9.449025,102.001785,1],[64.1631,9.614775,102.86139,1],[65.84967,9.835605,103.653675,1],[67.52655,10.109985,104.382975,1],[69.193485,10.43511,105.05388,1],[70.85175,10.800015,105.66996,1],[72.501855,11.202915,106.23504,1],[74.144565,11.63922,106.752435,1],[75.78039,12.10485,107.225205,1],[77.40984,12.59598,107.65641,1],[79.033425,13.108785,108.048855,1],[80.65191,13.63995,108.40458,1],[82.26555,14.18667,108.726135,1],[83.874855,14.745885,109.015305,1],[85.480335,15.3153,109.27362,1],[87.0825,15.892875,109.503375,1],[88.681605,16.47708,109.705335,1],[90.27816,17.065875,109.88103,1],[91.87242,17.657985,110.031735,1],[93.464895,18.252645,110.15847,1],[95.05584,18.848325,110.262,1],[96.645255,19.444515,110.343345,1],[98.23314,20.040705,110.403525,1],[99.820515,20.636385,110.442795,1],[101.40687,21.230535,110.461665,1],[102.99297,21.8229,110.460645,1],[104.578815,22.41348,110.43999,1],[106.164405,23.001765,110.400465,1],[107.749995,23.587755,110.34207,1],[109.33584,24.17145,110.26506,1],[110.921685,24.752595,110.169945,1],[112.507785,25.33119,110.05647,1],[114.09414,25.907235,109.9254,1],[115.681005,26.48124,109.77699,1],[117.268125,27.052695,109.61073,1],[118.8555,27.62211,109.426875,1],[120.44364,28.189485,109.22517,1],[122.03229,28.75482,109.006125,1],[123.621195,29.31837,108.76974,1],[125.21061,29.880645,108.51576,1],[126.800535,30.441645,108.24444,1],[128.390715,31.001625,107.95578,1],[129.98115,31.561095,107.64978,1],[131.571585,32.1198,107.326185,1],[133.16253,32.67825,106.984995,1],[134.75322,33.236955,106.62621,1],[136.344165,33.79617,106.250085,1],[137.9346,34.355895,105.856365,1],[139.525035,34.916895,105.445305,1],[141.11496,35.47917,105.016395,1],[142.70412,36.04323,104.56989,1],[144.29277,36.609585,104.10579,1],[145.880655,37.178235,103.624095,1],[147.46752,37.749945,103.124805,1],[149.052855,38.32497,102.608175,1],[150.63717,38.903565,102.07395,1],[152.2197,39.48624,101.521875,1],[153.800445,40.073505,100.952205,1],[155.37915,40.66587,100.365195,1],[156.955815,41.263335,99.760845,1],[158.529675,41.86692,99.139155,1],[160.100985,42.476625,98.50038,1],[161.66949,43.09296,97.84452,1],[163.234425,43.71669,97.171575,1],[164.7963,44.34807,96.481545,1],[166.354095,44.987355,95.77443,1],[167.908065,45.63531,95.05074,1],[169.4577,46.292445,94.31073,1],[171.002745,46.959015,93.554145,1],[172.54269,47.635785,92.781495,1],[174.07728,48.322755,91.993035,1],[175.606515,49.020945,91.188765,1],[177.129885,49.730355,90.36894,1],[178.64688,50.452005,89.533815,1],[180.1575,51.18564,88.683135,1],[181.66098,51.93228,87.817665,1],[183.15732,52.69218,86.937405,1],[184.646265,53.46585,86.04312,1],[186.126795,54.253545,85.134555,1],[187.599165,55.05603,84.212475,1],[189.062865,55.87356,83.27688,1],[190.517385,56.70639,82.32828,1],[191.96247,57.55503,81.366675,1],[193.39761,58.419735,80.39283,1],[194.82255,59.30127,79.406745,1],[196.23678,60.199635,78.408675,1],[197.640045,61.115085,77.39913,1],[199.031835,62.048385,76.378365,1],[200.411895,62.99928,75.346635,1],[201.779715,63.96828,74.30445,1],[203.134785,64.95564,73.25232,1],[204.477105,65.96187,72.190245,1],[205.80591,66.98646,71.11899,1],[207.120945,68.03043,70.038555,1],[208.421955,69.09327,68.94945,1],[209.70843,70.175235,67.851675,1],[210.97986,71.276835,66.74625,1],[212.236245,72.397815,65.632665,1],[213.477075,73.538175,64.51194,1],[214.702095,74.697915,63.38382,1],[215.910795,75.877545,62.248815,1],[217.10292,77.0763,61.10718,1],[218.27796,78.29469,59.958915,1],[219.435915,79.53246,58.80453,1],[220.57653,80.78961,57.644025,1],[221.699295,82.065885,56.47791,1],[222.803955,83.36103,55.30593,1],[223.890255,84.6753,54.12834,1],[224.95794,86.008185,52.94514,1],[226.00701,87.35943,51.75684,1],[227.036955,88.729035,50.56293,1],[228.047775,90.116745,49.36392,1],[229.03896,91.522305,48.1593,1],[230.010765,92.94546,46.94958,1],[230.962425,94.3857,45.73425,1],[231.89445,95.84328,44.513565,1],[232.80633,97.31718,43.287525,1],[233.69781,98.807655,42.05562,1],[234.569145,100.314195,40.81785,1],[235.419825,101.836545,39.574215,1],[236.24985,103.374195,38.32446,1],[237.05922,104.927145,37.068585,1],[237.847935,106.494885,35.806335,1],[238.615485,108.076905,34.5372,1],[239.362125,109.673205,33.26169,1],[240.087855,111.283275,31.979295,1],[240.792675,112.90686,30.69027,1],[241.476075,114.543705,29.39436,1],[242.13831,116.1933,28.09182,1],[242.779125,117.85539,26.782905,1],[243.39903,119.52972,25.46787,1],[243.99726,121.21578,24.147225,1],[244.57407,122.91357,22.822245,1],[245.129715,124.62258,21.493695,1],[245.663685,126.34281,20.163615,1],[246.176235,128.073495,18.834045,1],[246.66711,129.81489,17.508045,1],[247.136565,131.56623,16.18944,1],[247.584345,133.327515,14.883585,1],[248.01045,135.09849,13.59762,1],[248.41488,136.8789,12.33996,1],[248.797635,138.66849,11.12259,1],[249.15846,140.46675,9.95775,1],[249.49761,142.273935,8.907405,1],[249.81483,144.089535,8.009295,1],[250.11012,145.913295,7.26954,1],[250.383225,147.74496,6.69375,1],[250.634655,149.58453,6.288555,1],[250.863645,151.431495,6.06135,1],[251.070705,153.28611,6.01953,1],[251.255325,155.14761,6.17151,1],[251.41776,157.01625,6.52596,1],[251.55801,158.891775,7.09257,1],[251.67582,160.773675,7.88154,1],[251.770935,162.66195,8.90358,1],[251.84361,164.5566,10.17093,1],[251.893845,166.457115,11.623155,1],[251.92113,168.36375,13.19625,1],[251.925975,170.27574,14.873895,1],[251.90787,172.193085,16.640535,1],[251.86707,174.115785,18.484695,1],[251.80332,176.04333,20.39745,1],[251.71662,177.97572,22.371405,1],[251.60697,179.9127,24.40197,1],[251.474625,181.854015,26.485065,1],[251.31933,183.79941,28.618395,1],[251.140575,185.748885,30.800175,1],[250.939125,187.702185,33.029385,1],[250.71498,189.65829,35.305515,1],[250.46814,191.61771,37.629075,1],[250.199115,193.579425,40.000065,1],[249.90816,195.543435,42.420015,1],[249.59553,197.508975,44.889435,1],[249.261735,199.47579,47.410365,1],[248.90754,201.44337,49.98459,1],[248.53269,203.41146,52.61466,1],[248.13744,205.379295,55.303635,1],[247.72434,207.34611,58.05279,1],[247.294665,209.310375,60.86493,1],[246.850455,211.271325,63.74286,1],[246.391965,213.228705,66.69117,1],[245.92047,215.18124,69.714705,1],[245.441835,217.12638,72.81423,1],[244.95963,219.062595,75.99255,1],[244.4736,220.98912,79.2591,1],[243.99267,222.902895,82.61337,1],[243.524235,224.800095,86.056125,1],[243.069825,226.68021,89.599095,1],[242.64423,228.53763,93.234885,1],[242.25459,230.369295,96.969105,1],[241.914165,232.170615,100.798695,1],[241.63647,233.936745,104.719575,1],[241.436295,235.66284,108.725115,1],[241.32996,237.344055,112.803585,1],[241.332765,238.975545,116.94096,1],[241.460265,240.55374,121.11735,1],[241.723935,242.07609,125.31363,1],[242.133975,243.541065,129.5043,1],[242.6937,244.949685,133.671765,1],[243.404895,246.30348,137.792055,1],[244.26348,247.605765,141.850125,1],[245.26206,248.86062,145.840875,1],[246.393495,250.07289,149.73753,1],[247.64631,251.24691,153.54927,1],[249.010305,252.387015,157.2738,1],[250.475535,253.497795,160.909335,1],[252.03231,254.58282,164.45562,1]]};function gt(){let t=0;return function(){return t+=1}}function mt(t){t=t||[];const e=["#3366cc","#dc3912","#ff9900","#109618","#990099","#0099c6","#dd4477","#66aa00","#b82e2e","#316395","#994499","#22aa99","#aaaa11","#6633cc","#e67300","#8b0707","#651067","#329262","#5574a6","#3b3eac","#b77322","#16d620","#b91383","#f4359e","#9c5935","#a9c413","#2a778d","#668d1c","#bea413","#0c5922","#743411"];let n=0;const r={};for(let e=0;e<t.length;e++)r[t[e]]=!0;return function(t){if(!t){let t=e[n%e.length];for(;r[t];){const e=yt(t);if(e===t)break;t=e}return r[t]=!0,n+=1,B(t)}r[t]=!0}}function _t(t){return[{type:"rectangle",fill:[255,255,255,1],z:t},{type:"line",stroke:[190,190,190,1],"stroke-width":1,x1:0,x2:100,y1:50,y2:50,z:t}]}!function(t){t.CATEGORICAL="categorical",t.GRADIENT="gradient",t.GRADIENT_AND_CATEGORICAL="gradient+categorical",t.BAR="bar",t.STACKED_BAR="stacked_bar",t.GENE="gene"}(dt||(dt={}));const vt="na",bt="No data";function xt(t){let e=parseInt(t,16);return e*=.95,1===(t=(e=Math.round(e)).toString(16)).length&&(t="0"+t),t}function yt(t){let e=t[1]+t[2],n=t[3]+t[4],r=t[5]+t[6];return"#"+(e=xt(e))+(n=xt(n))+(r=xt(r))}class wt{constructor(t){this.rule_set_id=wt.getRuleSetId(),this.legend_label=t.legend_label,this.legend_base_color=t.legend_base_color,this.exclude_from_legend=t.exclude_from_legend,this.active_rule_ids={},this.rules_with_id=[]}getLegendLabel(){return this.legend_label}getRuleSetId(){return this.rule_set_id}addRules(t){const e=this;return t.map((function(t){return e._addRule(t)}))}_addRule(t,e){return void 0===e&&(e=wt.getRuleId()),this.rules_with_id.push({id:e,rule:new Rt(t)}),e}setUniversalRule(t){this.universal_rule=t}removeRule(t){var e=-1;for(let n=0;n<this.rules_with_id.length;n++)if(this.rules_with_id[n].id===t){e=n;break}e>-1&&this.rules_with_id.splice(e,1),delete this.active_rule_ids[t]}getRuleWithId(t){let e=null;for(let n=0;n<this.rules_with_id.length;n++)if(this.rules_with_id[n].id===t){e=this.rules_with_id[n];break}return e}isExcludedFromLegend(){return this.exclude_from_legend}getRule(t){return this.getRuleWithId(t).rule}getRecentlyUsedRules(){const t=this;return Object.keys(this.active_rule_ids).map((function(e){return t.getRule(parseInt(e,10))}))}applyRulesToDatum(t,e,n,r){let i=[];const o=t.length;for(let s=0;s<o;s++)i=i.concat(t[s].rule.apply(e,n,r));return i}getSpecificRulesForDatum(t){throw"Not implemented on base class"}getUniversalRule(){return this.universal_rule}getUniversalShapes(t,e){if(this.getUniversalRule()){const n=this.getUniversalRule().rule.apply({},t,e);return n.sort(v),n}return[]}getSpecificShapesForDatum(t,e,n,r,i,o){const s=[];for(var a=0;a<t.length;a++){const l=t[a],u=!o||!!o[l[i]],c=this.getSpecificRulesForDatum(l);if(void 0!==r&&u)for(let t=0;t<c.length;t++)r[c[t].id]=!0;const h=this.applyRulesToDatum(c,t[a],e,n);h.sort(v),s.push(h)}return this.getUniversalRule()&&void 0!==r&&(r[this.getUniversalRule().id]=!0),s}}wt.getRuleSetId=gt(),wt.getRuleId=gt();class kt extends wt{constructor(){super(...arguments),this.lookup_map_by_key_and_value={},this.lookup_map_by_key={},this.rule_id_to_conditions={}}getSpecificRulesForDatum(t){if(void 0===t)return this.rules_with_id;let e=[];for(var n in t)if(n in t&&void 0!==t[n]){var r=this.lookup_map_by_key[n];void 0!==r&&e.push(r);var i=this.lookup_map_by_key_and_value[n]&&this.lookup_map_by_key_and_value[n][t[n]]||void 0;void 0!==i&&e.push(i)}return e}indexRuleForLookup(t,e,n){null===t?this.setUniversalRule(n):null===e?this.lookup_map_by_key[t]=n:(this.lookup_map_by_key_and_value[t]=this.lookup_map_by_key_and_value[t]||{},this.lookup_map_by_key_and_value[t][e]=n),this.rule_id_to_conditions[n.id]=this.rule_id_to_conditions[n.id]||[],this.rule_id_to_conditions[n.id].push({key:t,value:e})}addRule(t,e,n){const r=this._addRule(n);return this.indexRuleForLookup(t,e,this.getRuleWithId(r)),r}linkExistingRule(t,e,n){this.indexRuleForLookup(t,e,this.getRuleWithId(n))}removeRule(t){for(super.removeRule(t);this.rule_id_to_conditions[t].length>0;){var e=this.rule_id_to_conditions[t].pop();null===e.key?this.universal_rule=void 0:null===e.value?delete this.lookup_map_by_key[e.key]:delete this.lookup_map_by_key_and_value[e.key][e.value]}delete this.rule_id_to_conditions[t]}}class St extends wt{constructor(t,e){super(t),this.rule_id_to_condition={},e||this.addRule((function(t){return!0===t[vt]}),{shapes:t.na_shapes||_t(t.na_z||1e3),legend_label:t.na_legend_label||bt,exclude_from_legend:!1,legend_config:{type:"rule",target:{na:!0}},legend_order:Number.POSITIVE_INFINITY})}getSpecificRulesForDatum(t){if(void 0===t)return this.rules_with_id;const e=[];for(let n=0;n<this.rules_with_id.length;n++)this.rule_id_to_condition[this.rules_with_id[n].id](t)&&e.push(this.rules_with_id[n]);return e}addRule(t,e,n){return n=this._addRule(e,n),this.rule_id_to_condition[n]=t,n}removeRule(t){super.removeRule(t),delete this.rule_id_to_condition[t]}}class Mt extends kt{constructor(t,e){var n;super(t),e||this.addRule(vt,!0,{shapes:t.na_shapes||_t(t.na_z||1e3),legend_label:t.na_legend_label||bt,exclude_from_legend:!1,legend_config:{type:"rule",target:{na:!0}},legend_order:Number.POSITIVE_INFINITY}),this.category_key=t.category_key,this.universal_rule_categories=t.universal_rule_categories,this.category_to_color=h(p(t.category_to_color,{})),this.getUnusedColor=mt((n=this.category_to_color,Object.keys(n).map((function(t){return n[t]}))).map(G));for(const t of Object.keys(this.category_to_color)){const e=this.category_to_color[t];this.addCategoryRule(t,e),this.getUnusedColor(G(e))}}addCategoryRule(t,e){const n={};n[this.category_key]=t;const r={shapes:[{type:"rectangle",fill:e}],legend_label:t,exclude_from_legend:!1,legend_config:{type:"rule",target:n}};this.universal_rule_categories&&this.universal_rule_categories.hasOwnProperty(t)?this.addRule(null,t,r):this.addRule(this.category_key,t,r)}getSpecificShapesForDatum(t,e,n,r,i,o){for(let e=0,n=t.length;e<n;e++){if(t[e][vt])continue;const n=t[e][this.category_key];if(!(n in this.category_to_color)){const t=this.getUnusedColor();this.category_to_color[n]=t,this.addCategoryRule(n,t)}}return super.getSpecificShapesForDatum(t,e,n,r,i,o)}}var Tt;!function(t){t.ALL="ALL",t.NON_NEGATIVE="NON_NEGATIVE",t.NON_POSITIVE="NON_POSITIVE"}(Tt||(Tt={}));class It extends St{constructor(t){super(t),this.value_key=t.value_key,this.value_range=t.value_range,this.log_scale=t.log_scale,this.type=t.type,this.makeInterpFn=function(){const t=this.getEffectiveValueRange(),e=this.getValueRangeType(),n=this.type;if(this.log_scale){var r=Math.abs(t[0])+1,i=Math.log(t[1]+r)-Math.log(t[0]+r),o=Math.log(t[0]+r);return function(t){return(Math.log(t+r)-o)/i}}return function(r){var i=t[1]-t[0],o=t[0],s=t[1];return"bar"!==n?(r-o)/i:e===Tt.NON_POSITIVE?(r-s)/i:e===Tt.NON_NEGATIVE?(r-o)/i:e===Tt.ALL?r/(i=Math.abs(t[0])>t[1]?Math.abs(t[0]):t[1]):void 0}}}getEffectiveValueRange(){const t=this.value_range&&this.value_range.slice()||[void 0,void 0];return void 0===t[0]&&(t[0]=this.inferred_value_range[0]),void 0===t[1]&&(t[1]=this.inferred_value_range[1]),t[0]===t[1]&&(t[0]-=t[0]/2,t[1]+=t[1]/2),t}getValueRangeType(){var t=this.getEffectiveValueRange();return t[0]<0&&t[1]<=0?Tt.NON_POSITIVE:t[0]>=0&&t[1]>0?Tt.NON_NEGATIVE:Tt.ALL}getSpecificShapesForDatum(t,e,n,r,i,o){let s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(var l=0,u=t.length;l<u;l++){const e=t[l];isNaN(e[this.value_key])||(s=Math.min(s,e[this.value_key]),a=Math.max(a,e[this.value_key]))}return s===Number.POSITIVE_INFINITY&&(s=0),a===Number.NEGATIVE_INFINITY&&(a=0),this.inferred_value_range=[s,a],this.updateLinearRules(),super.getSpecificShapesForDatum(t,e,n,r,i,o)}updateLinearRules(){throw"Not implemented in abstract class"}}class At extends It{constructor(t){super(t),this.colors=[],t.colors?this.colors=t.colors||[]:t.colormap_name&&(this.colors=pt[t.colormap_name]||[]),0===this.colors.length&&this.colors.push([0,0,0,1],[255,0,0,1]),this.value_stop_points=t.value_stop_points,this.null_color=t.null_color||[211,211,211,1];var e=this.value_key;this.addRule((function(t){return!0!==t[vt]&&null===t[e]}),{shapes:[{type:"rectangle",fill:this.null_color}],legend_label:t.null_legend_label||"Not a number",exclude_from_legend:!1,legend_config:{type:"rule",target:{[e]:null}}})}static linInterpColors(t,e,n){return[Math.round(e[0]*(1-t)+n[0]*t),Math.round(e[1]*(1-t)+n[1]*t),Math.round(e[2]*(1-t)+n[2]*t),e[3]*(1-t)+n[3]*t]}makeColorFn(t,e){const n=this.value_stop_points;let r;return r=n?n.map(e):function(t){const e=[];for(let n=0;n<t;n++)e.push(n);return e}(t.length).map((function(e){return e/(t.length-1)})),function(e){var n=i(r,e,(function(t){return t}),!0);if(-1===n)return[0,0,0,1];var o=Math.min(t.length-1,n+1),s=r[o]-r[n];if(0===s)return t[o];var a=(e-r[n])/s,l=t[n],u=t[o];return At.linInterpColors(a,l,u)}}updateLinearRules(){let t;void 0!==this.gradient_rule&&(t=this.gradient_rule,this.removeRule(this.gradient_rule));const e=this.makeInterpFn(),n=this.makeColorFn(this.colors,e),r=this.value_key;this.null_color;this.gradient_rule=this.addRule((function(t){return!0!==t[vt]&&null!==t[r]}),{shapes:[{type:"rectangle",fill:function(t){var i=e(t[r]);return n(i)}}],exclude_from_legend:!1,legend_config:{type:"gradient",range:this.getEffectiveValueRange(),colorFn:n}},t)}}class Ct extends It{constructor(t){super(t),this.fill=t.fill||[0,128,0,1],this.negative_fill=t.negative_fill||[255,0,0,1]}updateLinearRules(){let t;void 0!==this.bar_rule&&(t=this.bar_rule,this.removeRule(this.bar_rule));const e=this.makeInterpFn(),n=this.value_key,r=this.fill,i=this.negative_fill,o=this.getYPosPercentagesFn(),s=this.getCellHeightPercentagesFn();this.bar_rule=this.addRule((function(t){return!0!==t[vt]}),{shapes:[{type:"rectangle",y:function(t){var r=e(t[n]);return o(r)},height:function(t){var r=e(t[n]);return s(r)},fill:function(t){return t[n]<0?i:r}}],exclude_from_legend:!1,legend_config:{type:"number",range:this.getEffectiveValueRange(),range_type:this.getValueRangeType(),positive_color:r,negative_color:i,interpFn:e}},t)}getYPosPercentagesFn(){let t;switch(this.getValueRangeType()){case Tt.NON_POSITIVE:t=function(t){return 0};break;case Tt.NON_NEGATIVE:t=function(t){return 100*(1-t)};break;case Tt.ALL:t=function(t){return 50*Math.min(1-t,1)}}return t}getCellHeightPercentagesFn(){let t;switch(this.getValueRangeType()){case Tt.NON_POSITIVE:t=function(t){return 100*-t};break;case Tt.NON_NEGATIVE:t=function(t){return 100*t};break;case Tt.ALL:t=function(t){return 50*Math.abs(t)}}return t}}class Dt extends St{constructor(t){super(t);const e=t.value_key,n=t.fills||[],r=t.categories||[],i=mt(n.map(G));for(;n.length<r.length;)n.push(i());const o=this;for(let t=0;t<r.length;t++)!function(t){const i={};i[e]={};for(let t=0;t<r.length;t++)i[e][r[t]]=0;i[e][r[t]]=1,o.addRule((function(t){return!0!==t[vt]}),{shapes:[{type:"rectangle",fill:n[t],width:100,height:function(n){for(var i=0,o=0;o<r.length;o++)i+=parseFloat(n[e][r[o]]);return 100*parseFloat(n[e][r[t]])/i},y:function(n){for(var i=0,o=0,s=0;s<r.length;s++){var a=parseFloat(n[e][r[s]]);s<t&&(o+=a),i+=a}return 100*o/i}}],exclude_from_legend:!1,legend_config:{type:"rule",target:i},legend_label:r[t]})}(t)}}class zt extends kt{constructor(t){super(t),this.addRulesFromParams(t),this.addRule(vt,!0,{shapes:t.na_shapes||_t(t.na_z||1),legend_label:t.na_legend_label||bt,exclude_from_legend:!1,legend_config:{type:"rule",target:{na:!0}},legend_order:Number.POSITIVE_INFINITY})}addRulesFromParams(t){const e=t.rule_params;C.a.forEach(e.conditional,(t,e)=>{C.a.forEach(t,(t,n)=>{const r=n.split(","),i={};i[r[0]]=n;const o=this.addRule(e,"*"===r[0]?null:r[0],g(t,{shapes:t.shapes,legend_config:{type:"rule",target:i},legend_base_color:p(this.legend_base_color,[255,255,255,1])}));for(let t=1;t<r.length;t++)this.linkExistingRule(e,"*"===r[t]?null:r[t],o)})}),e.always&&this.addRule(null,null,g(e.always,{shapes:e.always.shapes,legend_config:{type:"rule",target:{}}}))}}class Rt{constructor(t){this.shapes=t.shapes.map((function(t){return"rectangle"===t.type?new rt(t):"triangle"===t.type?new it(t):"ellipse"===t.type?new ot(t):"line"===t.type?new st(t):void 0})),this.legend_label=void 0===t.legend_label?"":t.legend_label,this.legend_base_color=t.legend_base_color,this.exclude_from_legend=t.exclude_from_legend,this.legend_config=t.legend_config,this.legend_order=t.legend_order}getLegendConfig(){return this.legend_config}apply(t,e,n){const r=[];for(let i=0,o=this.shapes.length;i<o;i++)r.push(this.shapes[i].getComputedParams(t,e,n));return r}isExcludedFromLegend(){return this.exclude_from_legend}}class Lt extends wt{constructor(t){super(t),this.gradientRuleSet=new At(t),this.categoricalRuleSet=new Mt(t,!0)}getSpecificShapesForDatum(t,e,n,r,i,o){const s=[];for(let a=0;a<t.length;a++){const l=t[a];this.isCategorical(l)?s.push(this.categoricalRuleSet.getSpecificShapesForDatum([l],e,n,r,i,o)[0]):s.push(this.gradientRuleSet.getSpecificShapesForDatum([l],e,n,r,i,o)[0])}return s}getSpecificRulesForDatum(t){const e=this.categoricalRuleSet.getSpecificRulesForDatum(t),n=this.gradientRuleSet.getSpecificRulesForDatum(t);return e.concat(n)}isCategorical(t){return void 0!==t[this.categoricalRuleSet.category_key]}}var Et=function(t){let e;switch(t.type){case dt.CATEGORICAL:e=new Mt(t);break;case dt.GRADIENT:e=new At(t);break;case dt.GRADIENT_AND_CATEGORICAL:e=new Lt(t);break;case dt.BAR:e=new Ct(t);break;case dt.STACKED_BAR:e=new Dt(t);break;case dt.GENE:default:e=new zt(t)}return e},Ot=n(4),Ft=n.n(Ot);const Nt=20,Pt="oncoprintjs__header__label",Ht="oncoprintjs__header__toggle_btn_img",jt="oncoprintjs__header__open",Vt="oncoprintjs__header__dropdown",$t="oncoprintjs__header__separator",Bt="track-group-",Gt=100,qt=16,Wt="oncoprint-header-view.do-close-menus";class Ut{constructor(t){this.rendering_suppressed=!1,this.$dropdowns=[],t.css({position:"relative","pointer-events":"none"});const e=c()("<div/>").appendTo(t).css({position:"relative","overflow-y":"hidden","overflow-x":"hidden",width:"100%",height:"100%"});this.$occluded_ctr=c()("<div/>").appendTo(e).css({position:"absolute",width:"100%",height:"100%"}),this.$dropdowns_ctr=c()("<div/>").appendTo(t).css({position:"absolute",width:"100%",height:"100%"}),this.clickHandler=()=>{c()(document).trigger(Wt)},c()(document).on("click",this.clickHandler),c()(document).on(Wt,()=>{this.closeAllDropdowns()})}destroy(){c()(document).off("click",this.clickHandler),c()(document).off(Wt)}closeAllDropdowns(){for(const t of this.$dropdowns)t.fadeOut(Gt)}closeDropdownsExcept(t){for(const e of this.$dropdowns)e!==t&&e.fadeOut(Gt);c()(document).trigger(Kt)}static $makeDropdownOption(t,e,n,r){const i=c()("<li>").text(t).css({"font-weight":e,"font-size":12,"border-bottom":"1px solid rgba(0,0,0,0.3)"});return n&&n()?(i.addClass("disabled"),i.css({color:"rgb(200, 200, 200)",cursor:"default"})):r?(i.addClass("clickable"),i.css({cursor:"pointer"}),i.click(r).hover((function(){c()(this).css({"background-color":"rgb(200,200,200)"})}),(function(){c()(this).css({"background-color":"rgba(255,255,255,0)"})}))):i.click((function(t){t.stopPropagation()})),i}static $makeDropdownSeparator(){return c()("<li>").css({"border-top":"1px solid black"}).addClass($t)}render(t){this.$occluded_ctr.empty(),this.$occluded_ctr.css({top:-t.getVertScroll()}),this.$dropdowns_ctr.empty(),this.$dropdowns_ctr.css({top:-t.getVertScroll()}),this.$dropdowns=[];const e=t.getTrackGroups(),n=t.getZoomedHeaderTops();e.forEach((t,e)=>{if(t.header){const r=c()("<div/>").css({"pointer-events":"auto"});if(c()(`<span>${t.header.label.text}</span>`).appendTo(r).css({"margin-right":10,"font-weight":"bold","text-decoration":"underline","font-size":qt,"font-family":"Arial"}).addClass(Pt),t.header.options.length>0){const i=c()("<ul>").appendTo(this.$dropdowns_ctr).css({position:"absolute",width:120,display:"none","list-style-type":"none","padding-left":"6","padding-right":"6",float:"right","background-color":"rgb(255,255,255)",left:"0px",top:n[e]+Nt,"pointer-events":"auto"}).addClass(Vt).addClass(Bt+e);this.$dropdowns.push(i);const o=()=>{i.empty(),t.header.options.forEach(t=>{t.separator?i.append(Ut.$makeDropdownSeparator()):i.append(Ut.$makeDropdownOption(t.label||"",t.weight?t.weight():"normal",t.disabled,(function(n){n.stopPropagation(),t.onClick&&t.onClick(e),o()})))})},s=c()("<img/>").appendTo(r).attr({src:Ft.a,width:Nt,height:Nt}).css({cursor:"pointer",border:"1px solid rgba(125,125,125,0)",display:"inline-block"}).addClass(Ht).addClass(Bt+e).on("click",t=>{t.stopPropagation(),i.is(":visible")?(s.removeClass(jt),i.fadeOut(Gt)):(o(),i.css("left",s.offset().left),s.addClass(jt),i.fadeIn(Gt),this.closeDropdownsExcept(i))})}r.css({position:"absolute",top:n[e],left:0,width:"100%"}),this.$occluded_ctr.append(r)}})}setScroll(t){this.$occluded_ctr.css({top:-t.getVertScroll()}),this.$dropdowns_ctr.css({top:-t.getVertScroll()}),this.closeAllDropdowns()}setVertScroll(t){this.setScroll(t)}suppressRendering(){this.rendering_suppressed=!0}releaseRendering(t){this.rendering_suppressed=!1,this.render(t)}toSVGGroup(t,e,n){const r=U.group(e||0,n||0),i=t.getTrackGroups(),o=t.getZoomedHeaderTops();return i.forEach((t,e)=>{const n=t.header;if(n){const t=o[e];r.appendChild(U.text(n.label.text,0,t,qt,"Arial","bold",void 0,void 0,"underline"))}}),r}}const Zt="oncoprintjs__track_options__toggle_btn_img",Yt="oncoprintjs__track_options__open",Xt="oncoprintjs__track_options__dropdown",Jt="oncoprintjs__track_options__separator",Qt="nth-",Kt="oncoprint-track-options-view.do-close-menus";class te{constructor(t,e,n,r,i,o,s){this.$div=t,this.moveUpCallback=e,this.moveDownCallback=n,this.removeCallback=r,this.sortChangeCallback=i,this.unexpandCallback=o,this.showGapsCallback=s,this.rendering_suppressed=!1,this.track_options_$elts={},this.menu_shown={},this.interaction_disabled=!1;const a=t.css("position");"absolute"!==a&&"relative"!==a&&console.log("WARNING: div passed to OncoprintTrackOptionsView must be absolute or relative positioned - layout problems will occur"),this.$ctr=c()("<div></div>").css({position:"absolute","overflow-y":"hidden","overflow-x":"hidden"}).appendTo(this.$div),this.$buttons_ctr=c()("<div></div>").css({position:"absolute"}).appendTo(this.$ctr),this.$dropdown_ctr=c()("<div></div>").css({position:"absolute"}).appendTo(this.$div);this.clickHandler=function(){c()(document).trigger(Kt)},c()(document).on("click",this.clickHandler)}renderAllOptions(t){if(this.rendering_suppressed)return;const e=this;c()(document).off(Kt),c()(document).on(Kt,(function(){e.hideAllMenus()})),this.$buttons_ctr.empty(),this.$dropdown_ctr.empty(),this.scroll(t.getVertScroll());var n=t.getTracks(),r=Number.POSITIVE_INFINITY;for(let e=0;e<n.length;e++)r=Math.min(r,t.getTrackHeight(n[e]));this.img_size=Math.floor(.75*r);for(let e=0;e<n.length;e++)this.renderTrackOptions(t,n[e],e)}scroll(t){this.rendering_suppressed||(this.$buttons_ctr.css({top:-t}),this.$dropdown_ctr.css({top:-t}),this.hideAllMenus())}resize(t,e){this.rendering_suppressed||(this.$div.css({width:this.getWidth(),height:e()}),this.$ctr.css({width:this.getWidth(),height:e()}))}hideTrackMenu(t){this.menu_shown[t]=!1;const e=this.track_options_$elts[t];e.$dropdown.css({"z-index":1}),e.$dropdown.css({border:"1px solid rgba(125,125,125,0)"}),e.$img.css({border:"1px solid rgba(125,125,125,0)"}),e.$dropdown.fadeOut(100)}showTrackMenu(t){this.menu_shown[t]=!0;const e=this.track_options_$elts[t];e.$dropdown.css({"z-index":10}),e.$dropdown.css({border:"1px solid rgba(125,125,125,1)"}),e.$img.css({border:"1px solid rgba(125,125,125,1)"}),e.$dropdown.fadeIn(100)}hideAllMenus(){for(const t in this.track_options_$elts)this.track_options_$elts.hasOwnProperty(t)&&this.hideTrackMenu(parseInt(t,10))}hideMenusExcept(t){for(const e in this.track_options_$elts)if(this.track_options_$elts.hasOwnProperty(e)){const n=parseInt(e,10);if(n===t)continue;this.hideTrackMenu(n)}c()(document).trigger(Wt)}static $makeDropdownOption(t,e,n,r){const i=c()("<li>").text(t).css({"font-weight":e,"font-size":12,"border-bottom":"1px solid rgba(0,0,0,0.3)"});return n?(i.addClass("disabled"),i.css({color:"rgb(200, 200, 200)",cursor:"default"})):r?(i.addClass("clickable"),i.css({cursor:"pointer"}),i.click(r).hover((function(){c()(this).css({"background-color":"rgb(200,200,200)"})}),(function(){c()(this).css({"background-color":"rgba(255,255,255,0)"})}))):i.click((function(t){t.stopPropagation()})),i}static $makeDropdownSeparator(){return c()("<li>").css({"border-top":"1px solid black"}).addClass(Jt)}static renderSortArrow(t,e,n){let r="";e.isTrackSortDirectionChangeable(n)&&(r={1:'<i class="fa fa-signal" aria-hidden="true" title="Sorted ascending"></i>',"-1":'<i class="fa fa-signal" style="transform: scaleX(-1);" aria-hidden="true" title="Sorted descending"></i>',0:""}[e.getTrackSortDirection(n)]),t.html(r)}renderTrackOptions(t,e,n){let r,i,o,s;const a=t.getZoomedTrackTops(e);r=c()("<div>").appendTo(this.$buttons_ctr).css({position:"absolute",left:"0px",top:a+"px","white-space":"nowrap"}),i=c()("<img/>").appendTo(r).attr({src:Ft.a,width:this.img_size,height:this.img_size}).css({float:"left",cursor:"pointer",border:"1px solid rgba(125,125,125,0)"}).addClass(Zt).addClass(Qt+(n+1)),o=c()("<span>").appendTo(r).css({position:"absolute",top:Math.floor(this.img_size/4)+"px"}),s=c()("<ul>").appendTo(this.$dropdown_ctr).css({position:"absolute",width:120,display:"none","list-style-type":"none","padding-left":"6","padding-right":"6",float:"right","background-color":"rgb(255,255,255)",left:"0px",top:a+this.img_size+"px"}).addClass(Xt).addClass(Qt+(n+1)),this.track_options_$elts[e]={$div:r,$img:i,$dropdown:s},te.renderSortArrow(o,t,e);const l=this;i.hover((function(t){l.menu_shown[e]||c()(this).css({border:"1px solid rgba(125,125,125,0.3)"})}),(function(t){l.menu_shown[e]||c()(this).css({border:"1px solid rgba(125,125,125,0)"})})),i.click((function(t){t.stopPropagation(),s.is(":visible")?(i.addClass(Yt),l.hideTrackMenu(e)):(i.removeClass(Yt),l.showTrackMenu(e)),l.hideMenusExcept(e)}));const u=t.getTrackMovable(e)&&t.isTrackInClusteredGroup(e);if(t.getTrackMovable(e)&&(s.append(te.$makeDropdownOption("Move up","normal",u,(function(t){t.stopPropagation(),l.moveUpCallback(e)}))),s.append(te.$makeDropdownOption("Move down","normal",u,(function(t){t.stopPropagation(),l.moveDownCallback(e)})))),t.isTrackRemovable(e)&&s.append(te.$makeDropdownOption("Remove track","normal",!1,(function(t){t.stopPropagation(),l.removeCallback(e)}))),t.isTrackSortDirectionChangeable(e)){let n,r,i;s.append(te.$makeDropdownSeparator()),n=te.$makeDropdownOption("Sort a-Z",1===t.getTrackSortDirection(e)?"bold":"normal",!1,(function(s){s.stopPropagation(),n.css("font-weight","bold"),r.css("font-weight","normal"),i.css("font-weight","normal"),l.sortChangeCallback(e,1),te.renderSortArrow(o,t,e)})),r=te.$makeDropdownOption("Sort Z-a",-1===t.getTrackSortDirection(e)?"bold":"normal",!1,(function(s){s.stopPropagation(),n.css("font-weight","normal"),r.css("font-weight","bold"),i.css("font-weight","normal"),l.sortChangeCallback(e,-1),te.renderSortArrow(o,t,e)})),i=te.$makeDropdownOption("Don't sort track",0===t.getTrackSortDirection(e)?"bold":"normal",!1,(function(s){s.stopPropagation(),n.css("font-weight","normal"),r.css("font-weight","normal"),i.css("font-weight","bold"),l.sortChangeCallback(e,0),te.renderSortArrow(o,t,e)})),s.append(n),s.append(r),s.append(i)}if(t.isTrackExpandable(e)&&s.append(te.$makeDropdownOption(t.getExpandButtonText(e),"normal",!1,(function(n){n.stopPropagation(),l.renderAllOptions(t),t.expandTrack(e)}))),t.isTrackExpanded(e)&&s.append(te.$makeDropdownOption("Remove expansion","normal",!1,(function(t){t.stopPropagation(),l.unexpandCallback(e)}))),t.getTrackCanShowGaps(e)){s.append(te.$makeDropdownSeparator());const n=te.$makeDropdownOption("Show gaps",t.getTrackShowGaps(e)?"bold":"normal",!1,(function(t){t.stopPropagation(),n.css("font-weight","bold"),r.css("font-weight","normal"),l.showGapsCallback(e,!0)})),r=te.$makeDropdownOption("Don't show gaps",t.getTrackShowGaps(e)?"normal":"bold",!1,(function(t){t.stopPropagation(),n.css("font-weight","normal"),r.css("font-weight","bold"),l.showGapsCallback(e,!1)}));s.append(n),s.append(r)}const h=t.getTrackCustomOptions(e);if(h&&h.length>0)for(var f=0;f<h.length;f++)!function(){var t=h[f];t.separator?s.append(te.$makeDropdownSeparator()):s.append(te.$makeDropdownOption(t.label||"",t.weight||"normal",t.disabled,t.onClick&&function(n){n.stopPropagation(),t.onClick(e)}))}();s.is(":empty")&&(r.remove(),s.remove())}enableInteraction(){this.interaction_disabled=!1}disableInteraction(){this.interaction_disabled=!0}suppressRendering(){this.rendering_suppressed=!0}releaseRendering(t,e){this.rendering_suppressed=!1,this.renderAllOptions(t),this.resize(t,e),this.scroll(t.getVertScroll())}setScroll(t){this.setVertScroll(t)}setHorzScroll(t){}setVertScroll(t){this.scroll(t.getVertScroll())}setZoom(t,e){this.setVertZoom(t,e)}setVertZoom(t,e){this.renderAllOptions(t),this.resize(t,e)}setTrackGroupHeader(t,e){this.renderAllOptions(t),this.resize(t,e)}sort(t,e){this.renderAllOptions(t),this.resize(t,e)}setViewport(t,e){this.renderAllOptions(t),this.resize(t,e),this.scroll(t.getVertScroll())}getWidth(){return this.$buttons_ctr.is(":empty")?0:18+this.img_size}setTrackShowGaps(t,e){this.renderAllOptions(t),this.resize(t,e)}addTracks(t,e){this.renderAllOptions(t),this.resize(t,e)}moveTrack(t,e){this.renderAllOptions(t),this.resize(t,e)}setTrackGroupOrder(t){this.renderAllOptions(t)}setSortConfig(t){this.renderAllOptions(t)}removeTrack(t,e,n){delete this.track_options_$elts[e],this.renderAllOptions(t),this.resize(t,n)}destroy(){c()(document).off("click",this.clickHandler),c()(document).off(Kt)}setTrackCustomOptions(t){this.renderAllOptions(t)}setTrackMovable(t){this.renderAllOptions(t)}}class ee{constructor(t,e,n){this.$div=t,this.base_width=e,this.base_height=n,this.rendering_suppressed=!1,this.rule_set_label_config={weight:"bold",size:12,font:"Arial"},this.rule_label_config={weight:"normal",size:12,font:"Arial"},this.padding_after_rule_set_label=10,this.padding_between_rules=20,this.padding_between_rule_set_rows=10,this.$svg=c()(U.svg(200,200)).appendTo(this.$div),this.width=t.width()}renderLegend(t,e,n){if(this.rendering_suppressed)return;if(void 0===e&&(e=this.$svg[0]),!function(t){let e=!0;for(;t&&"html"!==t.tagName.toLowerCase();){if("none"===c()(t).css("display")){e=!1;break}t=t.parentNode}return e}(e))return;c()(e).empty();const r=U.defs();e.appendChild(r);const i=U.group(0,0);e.appendChild(i);const o=t.getRuleSets();let s=0;for(let a=0;a<o.length;a++){if(o[a].exclude_from_legend&&!n)continue;const l=t.getActiveRules(o[a].rule_set_id);if(0===l.length)continue;const u=U.group(0,s);i.appendChild(u),function(){if(void 0!==o[a].legend_label&&o[a].legend_label.length>0){const t=U.text(o[a].legend_label,0,0,12,"Arial","bold");u.appendChild(t),U.wrapText(t,200)}}();let c=200+this.padding_after_rule_set_label,h=0;const f=function(t,e){const n=t.rule.legend_label,r=e.rule.legend_label;return n&&r?n.localeCompare(r):n||r?n?r?void 0:1:-1:0};l.sort((function(t,e){const n=t.rule.legend_order,r=e.rule.legend_order;return void 0===n&&void 0===r?f(t,e):void 0!==n&&void 0!==r?n<r?-1:n>r?1:f(t,e):void 0===n?r===Number.POSITIVE_INFINITY?-1:1:void 0===r?n===Number.POSITIVE_INFINITY?1:-1:void 0}));for(let n=0;n<l.length;n++){const i=l[n].rule;if(i.exclude_from_legend)continue;const o=this.ruleToSVGGroup(i,t,e,r);o.setAttribute("transform","translate("+c+","+h+")"),u.appendChild(o),c+o.getBBox().width>this.width&&(c=200+this.padding_after_rule_set_label,h=u.getBBox().height+this.padding_between_rule_set_rows,o.setAttribute("transform","translate("+c+","+h+")")),c+=o.getBBox().width,c+=this.padding_between_rules}s+=u.getBBox().height,s+=3*this.padding_between_rule_set_rows}const a=i.getBBox();this.$svg[0].setAttribute("width",a.width.toString()),this.$svg[0].setAttribute("height",(a.height+10).toString())}ruleToSVGGroup(t,e,n,r){const i=U.group(0,0),o=t.getLegendConfig();if("rule"===o.type){const r=t.apply(o.target,e.getCellWidth(!0),this.base_height);if(t.legend_base_color){const n=U.rect(0,0,e.getCellWidth(!0),this.base_height,{type:"rgba",value:t.legend_base_color});i.appendChild(n)}for(let t=0;t<r.length;t++)i.appendChild(U.fromShape(r[t],0,0));if(void 0!==t.legend_label){const r=12,o=U.text(t.legend_label,e.getCellWidth(!0)+5,this.base_height/2,r,"Arial","normal");n.appendChild(o);const s=o.getBBox().height;o.setAttribute("y",(parseFloat(o.getAttribute("y"))-s/2).toString()),n.removeChild(o),i.appendChild(o)}}else if("number"===o.type){const t=2,e=o.range.map((function(e){const n=Math.pow(10,t);return Math.round(e*n)/n}));i.appendChild(U.text(e[0].toString(),0,0,12,"Arial","normal")),i.appendChild(U.text(e[1].toString(),50,0,12,"Arial","normal"));const n=100,s=[];let a=null,l=null;if("NON_POSITIVE"===o.range_type)a=o.negative_color;else if("NON_NEGATIVE"===o.range_type)a=o.positive_color;else if("ALL"===o.range_type){l=U.linearGradient();const t=Math.abs(e[0])/(Math.abs(e[0])+e[1])*100;l.appendChild(U.stop(t,o.negative_color)),l.appendChild(U.stop(t,o.positive_color)),r.appendChild(l)}s.push([5,20]);for(let t=0;t<n;t++){const e=t/n,r=20*o.interpFn((1-e)*o.range[0]+e*o.range[1]);s.push([5+40*t/n,20-r])}s.push([45,20]),i.appendChild(U.path(s,a,a,l))}else if("gradient"===o.type){const t=2,e=o.range.map((function(e){const n=Math.pow(10,t);return Math.round(e*n)/n})),n=U.gradient(o.colorFn),s=n.getAttribute("id");r.appendChild(n),i.appendChild(U.text(e[0].toString(),0,0,12,"Arial","normal")),i.appendChild(U.text(e[1].toString(),120,0,12,"Arial","normal")),i.appendChild(U.rect(30,0,60,20,{type:"gradientId",value:s}))}return i}setWidth(t,e){this.width=t,this.renderLegend(e)}removeTrack(t){this.renderLegend(t)}addTracks(t){this.renderLegend(t)}setTrackData(t){this.renderLegend(t)}setTrackImportantIds(t){this.renderLegend(t)}shareRuleSet(t){this.renderLegend(t)}setRuleSet(t){this.renderLegend(t)}setTrackGroupLegendOrder(t){this.renderLegend(t)}hideTrackLegends(t){this.renderLegend(t)}showTrackLegends(t){this.renderLegend(t)}suppressRendering(){this.rendering_suppressed=!0}releaseRendering(t){this.rendering_suppressed=!1,this.renderLegend(t)}toSVGGroup(t,e,n){const r=U.group(e||0,n||0);return this.$svg.append(r),this.renderLegend(t,r,!0),r.parentNode.removeChild(r),r}}const ne="oncoprintjs__tooltip";class re{constructor(t,e){this.$container=t,e=e||{},this.$div=c()("<div></div>").addClass(ne).appendTo(t).css({"background-color":"rgba(255,255,255,1)",position:"absolute",display:"none",border:"1px solid black","max-width":300,"min-width":150}),e.noselect&&this.$div.addClass("noselect"),this.hide_timeout_id=void 0,this.show_timeout_id=void 0,this.center=!1,this.shown=!1;const n=this;this.$div.on("mousemove",(function(t){t.stopPropagation(),n.cancelScheduledHide()})),this.$div.on("mouseleave",(function(t){t.stopPropagation(),n.hide()}))}show(t,e,n,r,i){if(this.cancelScheduledHide(),void 0===t||this.shown)this.doShow(e,n,r,i);else{const o=this;this.cancelScheduledShow(),this.show_timeout_id=setTimeout((function(){o.doShow(e,n,r,i)}),t)}}doShow(t,e,n,r){this.cancelScheduledShow(),this.show_timeout_id=void 0,this.$div.empty(),this.$div.css({top:0,left:0,"z-index":9999}),this.$div.append(n),r?this.$div.stop().fadeIn("fast"):this.$div.show();let i=t-(this.center?this.$div.width()/2:0),o=e-this.$div.height();o=Math.max(o,20),o=Math.min(o,c()(window).height()-this.$div.height()),i=Math.max(i,20),i=Math.min(i,c()(window).width()-this.$div.width()-20),this.$div.css({top:o,left:i,"z-index":9999}),this.shown=!0}doHide(t){this.cancelScheduledHide(),this.hide_timeout_id=void 0,t?this.$div.fadeOut():this.$div.hide(),this.shown=!1}cancelScheduledShow(){clearTimeout(this.show_timeout_id),this.show_timeout_id=void 0}cancelScheduledHide(){clearTimeout(this.hide_timeout_id),this.hide_timeout_id=void 0}showIfNotAlreadyGoingTo(t,e,n,r){void 0===this.show_timeout_id&&this.show(t,e,n,r)}hideIfNotAlreadyGoingTo(t){void 0===this.hide_timeout_id&&this.hide(t)}hide(t){if(this.cancelScheduledShow(),this.shown)if(void 0!==t){const e=this;this.cancelScheduledHide(),this.hide_timeout_id=setTimeout((function(){e.doHide()}),t)}else this.doHide()}fadeIn(t,e,n,r){this.show(t,e,n,r,!0)}}class ie{constructor(t,e){this.$div=t,this.tooltip=e,this.base_font_size=12,this.font_family="Arial",this.font_weight="bold",this.width=0,this.$label_elts=[],this.rendering_suppressed=!1,this.tooltip.center=!1,this.$ctr=c()("<div></div>").css({position:"absolute","overflow-y":"hidden","overflow-x":"hidden"}).appendTo(this.$div),this.$text_ctr=c()("<div></div>").css({position:"absolute"}).appendTo(this.$ctr)}destroyLabelElts(){for(let t=0;t<this.$label_elts.length;t++)this.$label_elts[t].off("mousemove mouseleave");this.$label_elts=[]}renderAllInfo(t){if(this.rendering_suppressed)return;this.$text_ctr.empty(),this.destroyLabelElts();const e=t.getTracks();this.minimum_track_height=Number.POSITIVE_INFINITY;for(let n=0;n<e.length;n++)this.minimum_track_height=Math.min(this.minimum_track_height,t.getTrackHeight(e[n]));this.width=0;const n=t.getLabelTops();this.scroll(t.getVertScroll());const r=this.getFontSize(),i=this;for(let o=0;o<e.length;o++)!function(){const s=o,a=c()("<span>").css({position:"absolute","font-family":i.font_family,"font-weight":i.font_weight,"font-size":r}).addClass("noselect"),l=t.getTrackInfo(e[s]);if(!l)return;a.text(l),a.appendTo(i.$text_ctr),i.$label_elts.push(a),setTimeout((function(){a.on("mousemove",(function(){const n=t.$getTrackInfoTooltip(e[s]);if(n){const t=a[0].getBoundingClientRect();i.tooltip.fadeIn(200,t.left,t.top,n)}})).on("mouseleave",(function(){i.tooltip.hideIfNotAlreadyGoingTo(150)}))}),0);const u=n[e[s]]+(t.getCellHeight(e[s])-a.outerHeight())/2;a.css({top:u+"px"}),i.width=Math.max(32,i.width,a[0].clientWidth)}();this.width>0&&(this.width+=10)}scroll(t){this.rendering_suppressed||this.$text_ctr.css({top:-t})}resize(t,e){this.rendering_suppressed||(this.$div.css({width:this.getWidth(),height:e()}),this.$ctr.css({width:this.getWidth(),height:e()}))}getFontSize(){return Math.max(Math.min(this.base_font_size,this.minimum_track_height),7)}getWidth(){return this.width}addTracks(t,e){this.renderAllInfo(t),this.resize(t,e)}moveTrack(t,e){this.renderAllInfo(t),this.resize(t,e)}setTrackGroupOrder(t,e){this.renderAllInfo(t),this.resize(t,e)}removeTrack(t,e){this.renderAllInfo(t),this.resize(t,e)}setTrackInfo(t,e){this.renderAllInfo(t),this.resize(t,e)}setTrackGroupHeader(t,e){this.renderAllInfo(t),this.resize(t,e)}setScroll(t){this.setVertScroll(t)}setHorzScroll(t){}setVertScroll(t){this.scroll(t.getVertScroll())}setZoom(t,e){this.setVertZoom(t,e)}setViewport(t,e){this.renderAllInfo(t),this.resize(t,e),this.scroll(t.getVertScroll())}setVertZoom(t,e){this.renderAllInfo(t),this.resize(t,e)}suppressRendering(){this.rendering_suppressed=!0}releaseRendering(t,e){this.rendering_suppressed=!1,this.renderAllInfo(t),this.resize(t,e),this.scroll(t.getVertScroll())}destroy(){this.destroyLabelElts()}toSVGGroup(t,e,n){const r=U.group(e||0,n||0),i=t.getCellTops(),o=t.getTracks(),s=this.getFontSize();for(let e=0;e<o.length;e++){const n=o[e],a=i[n]+t.getCellHeight(n)/2,l=t.getTrackInfo(n),u=U.text(l,0,a,s,this.font_family,this.font_weight,"bottom");u.setAttribute("dy","0.35em"),r.appendChild(u)}return r}}const oe="v",se="h";class ae{constructor(t,e){this.$div=c()("<div>").css({position:"absolute",top:e.top||0,left:e.left||0}).appendTo(t),(e=e||{}).btn_size=e.btn_size||13,this.onChange=e.onChange||function(){},this.initialize(e),this.value=void 0===e.init_val?.5:e.init_val,this.slider_bar_size=(this.orientation===oe?e.height:e.width)-2*e.btn_size,this.updateSliderPos()}initialize(t){var e=this.$div,n=Math.round(.7*t.btn_size),r=Math.round((t.btn_size-n)/2),i=c()("<div>").css({position:"absolute","background-color":"#ffffff",outline:"solid 1px black"}).appendTo(e),o=c()("<div>").css({position:"absolute","background-color":"#ffffff",border:"solid 1px black","border-radius":"3px",cursor:"pointer"}).appendTo(e),s=c()("<div>").css({position:"absolute","min-height":t.btn_size,"min-width":t.btn_size,"background-color":"#ffffff",border:"solid 1px black","border-radius":"3px",cursor:"pointer"}).appendTo(e);c()("<span>").addClass("icon fa fa-plus").css({position:"absolute",top:r,left:r,"min-width":n,"min-height":n}).appendTo(s);var a=c()("<div>").css({position:"absolute","min-height":t.btn_size,"min-width":t.btn_size,"background-color":"#ffffff",border:"solid 1px black","border-radius":"3px",cursor:"pointer"}).appendTo(e);c()("<span>").addClass("icon fa fa-minus").css({position:"absolute",top:r,left:r,"min-width":n,"min-height":n}).appendTo(a),t.vertical?(i.css({"min-height":t.height-2*t.btn_size,"min-width":Math.round(t.btn_size/5)}),o.css({"min-height":Math.round(t.btn_size/2),"min-width":t.btn_size}),s.css({top:0,left:0}),a.css({top:t.height-t.btn_size,left:0}),i.css({top:t.btn_size,left:.4*t.btn_size}),o.css({left:0}),this.orientation=oe):(i.css({"min-height":Math.round(t.btn_size/5),"min-width":t.width-2*t.btn_size}),o.css({"min-height":t.btn_size,"min-width":Math.round(t.btn_size/2)}),s.css({top:0,left:t.width-t.btn_size}),a.css({top:0,left:0}),i.css({top:.4*t.btn_size,left:t.btn_size}),o.css({top:0}),this.orientation=se);const l=this;s.click((function(){l.value/=.7,t.onChange(l.value)})),a.click((function(){l.value*=.7,t.onChange(l.value)})),[o,s,a].map((function(t){t.hover((function(){c()(this).css({"background-color":"#cccccc"})}),(function(){c()(this).css({"background-color":"#ffffff"})}))})),this.$slider=o,this.$plus_btn=s,this.$minus_btn=a,function(){let t,e,n;function r(n){let r;n.stopPropagation(),n.preventDefault();const i=(r=l.orientation===oe?t-n.pageY:n.pageX-t)/l.slider_bar_size;l.setSliderValue(e+i)}l.$slider.on("mousedown",(function(i){t=l.orientation===oe?i.pageY:i.pageX,e=l.value,n=!0,c()(document).on("mousemove",r)})),c()(document).on("mouseup click",(function(){c()(document).off("mousemove",r),n&&e!==l.value&&l.onChange(l.value),n=!1}))}()}updateSliderPos(){const t=this.value;var e=this.$slider,n=this.getSliderBounds();this.orientation===oe?e.css("top",n.bottom*(1-t)+n.top*t):this.orientation===se&&e.css("left",n.left*(1-t)+n.right*t)}getSliderBounds(){return this.orientation===oe?{bottom:parseInt(this.$minus_btn.css("top"),10)-parseInt(this.$slider.css("min-height"),10),top:parseInt(this.$plus_btn.css("top"),10)+parseInt(this.$plus_btn.css("min-height"),10)}:{left:parseInt(this.$minus_btn.css("left"),10)+parseInt(this.$minus_btn.css("min-width"),10),right:parseInt(this.$plus_btn.css("left"),10)-parseInt(this.$slider.css("min-width"),10)}}setSliderValue(t){var e;this.value=(e=t,Math.max(Math.min(e,1),0)),this.updateSliderPos()}}var le=n(9),ue=n.n(le);class ce{constructor(t,e){this.params=t,this.getCellWidth=e}setParams(t){this.params=t}clone(){return new ce(h(this.params),this.getCellWidth)}get left_col(){return this.params.left_col}get right_col(){return this.params.right_col}get top(){return this.params.top}get height(){return this.params.height}get num_cols(){return this.right_col-this.left_col}get left(){return this.left_col*this.getCellWidth()}get right(){return this.right_col*this.getCellWidth()}get width(){return this.right-this.left}}class he{constructor(t,e,n,r,i,o,s,a,l,u,h,f,d){this.$div=t,this.$canvas=e,this.$overlay_canvas=n,this.layout_numbers={window_width:-1,window_height:-1,vertical_zoom_area_width:-1,horizontal_zoom_area_height:-1,padding:-1,window_bar_height:-1,canvas_left:-1,canvas_top:-1},this.resize_hover=!1,this.rendering_suppressed=!1,this.visible=!1,this.$div=t,this.$canvas=e,this.$overlay_canvas=n,this.current_rect=new ce({top:0,left_col:0,right_col:0,height:0},()=>r.getCellWidth(!0)*this.getZoom(r).x);const p=this;this.handleContextLost=function(){p.drawOncoprintAndOverlayRect(r,i)}.bind(this),this.$canvas[0].addEventListener("webglcontextlost",this.handleContextLost),this.layout_numbers={window_width:4+o+4+20,window_height:24+s+4+20,vertical_zoom_area_width:20,horizontal_zoom_area_height:20,padding:4,window_bar_height:20,canvas_left:4,canvas_top:24},this.$div.css({"min-width":this.layout_numbers.window_width,"min-height":this.layout_numbers.window_height,outline:"solid 1px black","background-color":"#ffffff"}),this.$window_bar=c()("<div>").css({position:"absolute","min-width":this.layout_numbers.window_width,"min-height":this.layout_numbers.window_bar_height,"background-color":"#cccccc"}).appendTo(this.$div),this.$close_btn=c()("<div>").css({position:"absolute",top:3,left:3,"min-width":this.layout_numbers.window_bar_height-6,"min-height":this.layout_numbers.window_bar_height-6,cursor:"pointer"}).appendTo(this.$div),c()("<span>").addClass("icon fa fa-times-circle").css("font-size",this.layout_numbers.window_bar_height-6+"px").appendTo(this.$close_btn),this.$close_btn.click(d||function(){}),this.$canvas[0].width=o,this.$canvas[0].height=s,this.$canvas.css({top:this.layout_numbers.canvas_top,left:this.layout_numbers.canvas_left}),this.$overlay_canvas[0].width=o,this.$overlay_canvas[0].height=o,this.$overlay_canvas.css({top:this.layout_numbers.canvas_top,left:this.layout_numbers.canvas_left,outline:"solid 1px #444444"}),this.horizontal_zoom=new ae(this.$div,{btn_size:this.layout_numbers.horizontal_zoom_area_height-4,horizontal:!0,width:o,init_val:r.getHorzZoom(),left:4,top:this.layout_numbers.canvas_top+s+4,onChange:function(t){u(t)}}),this.vertical_zoom=new ae(this.$div,{btn_size:this.layout_numbers.vertical_zoom_area_width-4,vertical:!0,height:s,init_val:r.getVertZoom(),left:this.layout_numbers.canvas_left+o+4,top:this.layout_numbers.window_bar_height+4,onChange:function(t){h(t)}}),function(){const e=p.layout_numbers.horizontal_zoom_area_height-4,n=p.layout_numbers.vertical_zoom_area_width-4,r=c()("<div>").css({position:"absolute","min-height":e,"min-width":n,outline:"solid 1px black",left:p.layout_numbers.canvas_left+o+4,top:p.layout_numbers.canvas_top+s+4,"background-size":n-4+"px "+(e-4)+"px","background-position":"2px 2px","background-image":"url("+ue.a+")","background-repeat":"no-repeat",cursor:"pointer"}).addClass("oncoprint-zoomtofit-btn").appendTo(t);r.hover((function(){c()(this).css({"background-color":"#cccccc"})}),(function(){c()(this).css({"background-color":"#ffffff"})})),f=f||function(){},r.click(f)}(),this.getWebGLContextAndSetUpMatrices(),this.setUpShaders(),this.overlay_ctx=n[0].getContext("2d");const g=5;function m(t,e){return t>=p.current_rect.left+g&&t<=p.current_rect.left+p.current_rect.width-g&&e>=p.current_rect.top+g&&e<=p.current_rect.top+p.current_rect.height-g}function v(t,e){return t>=p.current_rect.left-g&&t<=p.current_rect.left+p.current_rect.width+g&&e>=p.current_rect.top-g&&e<=p.current_rect.top+p.current_rect.height+g}function b(t,e){return!k(t,e)&&!M(t,e)&&!S(t,e)&&!T(t,e)&&v(t,e)&&Math.abs(t-(p.current_rect.left+p.current_rect.width))<g}function x(t,e){return!k(t,e)&&!M(t,e)&&!S(t,e)&&!T(t,e)&&v(t,e)&&Math.abs(t-p.current_rect.left)<g}function y(t,e){return!k(t,e)&&!M(t,e)&&!S(t,e)&&!T(t,e)&&v(t,e)&&Math.abs(e-p.current_rect.top)<g}function w(t,e){return!k(t,e)&&!M(t,e)&&!S(t,e)&&!T(t,e)&&v(t,e)&&Math.abs(e-(p.current_rect.top+p.current_rect.height))<g}function k(t,e){return Math.abs(e-p.current_rect.top)<g&&Math.abs(t-p.current_rect.left)<g}function S(t,e){return Math.abs(e-(p.current_rect.top+p.current_rect.height))<g&&Math.abs(t-p.current_rect.left)<g}function M(t,e){return Math.abs(e-p.current_rect.top)<g&&Math.abs(t-(p.current_rect.left+p.current_rect.width))<g}function T(t,e){return Math.abs(e-(p.current_rect.top+p.current_rect.height))<g&&Math.abs(t-(p.current_rect.left+p.current_rect.width))<g}function I(t,e){void 0===t?p.resize_hover=!1:b(t,e)?p.resize_hover="r":x(t,e)?p.resize_hover="l":y(t,e)?p.resize_hover="t":w(t,e)?p.resize_hover="b":k(t,e)?p.resize_hover="tl":T(t,e)?p.resize_hover="br":S(t,e)?p.resize_hover="bl":M(t,e)?p.resize_hover="tr":p.resize_hover=!1}function A(e,n){let r;r=void 0===e?"auto":m(e,n)?"move":b(e,n)||x(e,n)?"ew-resize":y(e,n)||w(e,n)?"ns-resize":k(e,n)||T(e,n)?"nwse-resize":S(e,n)||M(e,n)?"nesw-resize":"auto",t.css("cursor",r)}function C(t,e,n){const r=parseInt(t.$canvas[0].style.top,10),i=parseInt(t.$canvas[0].style.left,10),o=parseInt(t.$canvas[0].width,10),s=parseInt(t.$canvas[0].height,10),a=e-i,l=n-r;return{mouse_x:a,mouse_y:l,outside:a<0||a>=o||l<0||l>=s}}let D,z=!1,R=!1,L=-1,E=-1,O=-1,F=-1,N=-1,P=-1;c()(document).on("mousedown",(function(t){const e=p.$div.offset(),n=t.pageX-e.left,i=t.pageY-e.top,o=C(p,n,i);if(!o.outside){const t=o.mouse_x,e=o.mouse_y;z=!1,R=!1,P=r.getOncoprintHeight()/parseInt(p.$canvas[0].height,10),m(t,e)?R="move":b(t,e)?R="resize_r":x(t,e)?R="resize_l":y(t,e)?R="resize_t":w(t,e)?R="resize_b":M(t,e)?R="resize_tr":T(t,e)?R="resize_br":k(t,e)?R="resize_tl":S(t,e)&&(R="resize_bl"),!1!==R&&(z=!0,O=t,F=e,L=r.getClosestColumnIndexToLeft(r.getHorzScroll(),!0),E=r.getVertScroll(),N=r.getVertZoom(),D=p.current_rect.clone())}})),c()(document).on("mousemove",(function(t){const e=p.$div.offset(),n=t.pageX-e.left,o=t.pageY-e.top,s=C(p,n,o),l=s.mouse_x,u=s.mouse_y;let c=p.getZoom(r),h=r.getCellWidth(!0)*c.x;if(z){t.preventDefault();let e=Math.floor(l/h)-Math.floor(O/h),n=u-F;if("move"===R){const t=n*P;a(p.colToLeft(r,_(L+e,0,r.getIdOrder().length-1)),E+t)}else{let t;c=p.getZoom(r);const o=r.getIdOrder().length,s=Math.ceil(i.getVisibleAreaWidth()/(r.getCellWidth(!0)+r.getCellPadding(!0,!0))),a=r.getOncoprintHeight(!0)*c.y,l=i.getVisibleAreaHeight(r)*c.y,u=D.right_col,h=D.top+D.height;"resize_r"===R?(e=_(e,s-D.num_cols,o-D.num_cols),e=Math.min(e,o-u),t={top:D.top,left_col:D.left_col,right_col:D.right_col+e,height:D.height}):"resize_l"===R?(e=_(e,D.num_cols-o,D.num_cols-s),e=Math.max(e,-D.left_col),t={top:D.top,left_col:D.left_col+e,right_col:D.right_col,height:D.height}):"resize_t"===R?(n=_(n,D.height-a,D.height-l),n=Math.max(n,-D.top),t={top:D.top+n,left_col:D.left_col,right_col:D.right_col,height:D.height-n}):"resize_b"===R?(n=_(n,l-D.height,a-D.height),n=Math.min(n,a-h),t={top:D.top,left_col:D.left_col,right_col:D.right_col,height:D.height+n}):"resize_tr"===R?(e=_(e,s-D.num_cols,o-D.num_cols),e=Math.min(e,o-u),n=_(n,D.height-a,D.height-l),n=Math.max(n,-D.top),t={top:D.top+n,left_col:D.left_col,right_col:D.right_col+e,height:D.height-n}):"resize_tl"===R?(e=_(e,D.num_cols-o,D.num_cols-s),e=Math.max(e,-D.left_col),n=_(n,D.height-a,D.height-l),n=Math.max(n,-D.top),t={top:D.top+n,left_col:D.left_col+e,right_col:D.right_col,height:D.height-n}):"resize_br"===R?(n=_(n,l-D.height,a-D.height),n=Math.min(n,a-h),e=_(e,s-D.num_cols,o-D.num_cols),e=Math.min(e,o-u),t={top:D.top,left_col:D.left_col,right_col:D.right_col+e,height:D.height+n}):"resize_bl"===R&&(n=_(n,l-D.height,a-D.height),n=Math.min(n,a-h),e=_(e,D.num_cols-o,D.num_cols-s),e=Math.max(e,-D.left_col),t={top:D.top,left_col:D.left_col+e,right_col:D.right_col,height:D.height+n}),p.current_rect.setParams(t),p.drawOverlayRect(null,null,p.current_rect)}}else s.outside?(A(),I()):(A(l,u),I(l,u)),p.drawOverlayRect(r,i)})),c()(document).on("mouseup",(function(t){const e=p.$div.offset(),n=t.pageX-e.left,o=t.pageY-e.top;z&&(["resize_t","resize_b","resize_l","resize_r","resize_tl","resize_tr","resize_bl","resize_br"].indexOf(R)>-1&&l({left_col:p.current_rect.left_col,scroll_y_proportion:p.current_rect.top/parseInt(p.$canvas[0].height,10),right_col:p.current_rect.right_col,zoom_y:D.height/p.current_rect.height*N}),z=!1,R=!1);const s=C(p,n,o);if(s.outside)A(),I();else{let t=s.mouse_x,e=s.mouse_y;A(t,e),I(t,e)}p.drawOverlayRect(r,i)})),function(){let t=0,e=0,n=0,r=0;function i(i){i.preventDefault();const o=i.pageX-t,s=i.pageY-e;p.setWindowPosition(n+o,r+s)}p.$window_bar.hover((function(){c()(this).css({cursor:"move"})}),(function(){c()(this).css({cursor:"auto"})})),p.$window_bar.on("mousedown",(function(o){t=o.pageX,e=o.pageY,n=parseInt(p.$div.css("left"),10),r=parseInt(p.$div.css("top"),10),c()(document).on("mousemove",i)})),c()(document).on("mouseup click",(function(){c()(document).off("mousemove",i)}))}()}colToLeft(t,e){return t.getZoomedColumnLeft(t.getIdOrder()[e])}get shouldRender(){return this.visible&&!this.rendering_suppressed}getNewCanvas(){const t=this.$canvas[0];t.removeEventListener("webglcontextlost",this.handleContextLost);const e=t.cloneNode();e.addEventListener("webglcontextlost",this.handleContextLost);const n=t.parentNode;n.removeChild(t),n.insertBefore(e,this.$overlay_canvas[0]),this.$canvas=c()(e),this.ctx=null,this.ext=null}getWebGLCanvasContext(){try{const t=this.$canvas[0],e=this.ctx||t.getContext("experimental-webgl",{alpha:!1,antialias:!0});return e.clearColor(1,1,1,1),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.viewportWidth=t.width,e.viewportHeight=t.height,e.viewport(0,0,e.viewportWidth,e.viewportHeight),e.enable(e.DEPTH_TEST),e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.depthMask(!1),e}catch(t){return null}}ensureWebGLContext(){for(let t=0;t<5&&(!this.ctx||this.ctx.isContextLost());t++)this.getNewCanvas(),this.ctx=this.getWebGLCanvasContext(),this.setUpShaders();if(!this.ctx||this.ctx.isContextLost())throw new Error("Unable to get WebGL context for Oncoprint Minimap")}createShaderProgram(t,e){const n=this.ctx.createProgram();if(this.ctx.attachShader(n,t),this.ctx.attachShader(n,e),this.ctx.linkProgram(n),!this.ctx.getProgramParameter(n,this.ctx.LINK_STATUS)){const t=this.ctx.getProgramInfoLog(n);throw this.ctx.deleteProgram(n),"Unable to link shader program: "+t}return n}createShader(t,e){const n=this.ctx.createShader(this.ctx[e]);if(this.ctx.shaderSource(n,t),this.ctx.compileShader(n),!this.ctx.getShaderParameter(n,this.ctx.COMPILE_STATUS)){const t=this.ctx.getShaderInfoLog(n);throw this.ctx.deleteShader(n),"Unable to compile shader: "+t}return n}getWebGLContextAndSetUpMatrices(){this.ctx=this.getWebGLCanvasContext(),this.ctx&&(this.ext=this.ctx.getExtension("ANGLE_instanced_arrays")),function(t){const e=j.a.mat4.create();j.a.mat4.lookAt(e,[0,0,1],[0,0,0],[0,1,0]),t.mvMatrix=e;const n=j.a.mat4.create();j.a.mat4.ortho(n,0,t.ctx.viewportWidth,t.ctx.viewportHeight,0,-5,1e3),t.pMatrix=n}(this)}setUpShaders(){const t=["precision highp float;","attribute float aPosVertex;","attribute float aColVertex;","attribute float aVertexOncoprintColumn;","uniform float columnWidth;","uniform float zoomX;","uniform float zoomY;","uniform mat4 uMVMatrix;","uniform mat4 uPMatrix;","uniform float offsetY;","uniform float positionBitPackBase;","uniform float texSize;","varying float texCoord;","vec3 unpackVec3(float packedVec3, float base) {","\tfloat pos0 = floor(packedVec3 / (base*base));","\tfloat pos0Contr = pos0*base*base;","\tfloat pos1 = floor((packedVec3 - pos0Contr)/base);","\tfloat pos1Contr = pos1*base;","\tfloat pos2 = packedVec3 - pos0Contr - pos1Contr;","\treturn vec3(pos0, pos1, pos2);","}","void main(void) {","\tgl_Position = vec4(unpackVec3(aPosVertex, positionBitPackBase), 1.0);","\tgl_Position[0] += aVertexOncoprintColumn*columnWidth;","\tgl_Position[1] += offsetY;","\tgl_Position *= vec4(zoomX, zoomY, 1.0, 1.0);","\tgl_Position = uPMatrix * uMVMatrix * gl_Position;","\ttexCoord = (aColVertex + 0.5) / texSize;","}"].join("\n"),e=["precision mediump float;","varying float texCoord;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(texCoord, 0.5));","}"].join("\n"),n=this.createShader(t,"VERTEX_SHADER"),r=this.createShader(e,"FRAGMENT_SHADER"),i=this.createShaderProgram(n,r);i.vertexPositionAttribute=this.ctx.getAttribLocation(i,"aPosVertex"),this.ctx.enableVertexAttribArray(i.vertexPositionAttribute),i.vertexColorAttribute=this.ctx.getAttribLocation(i,"aColVertex"),this.ctx.enableVertexAttribArray(i.vertexColorAttribute),i.vertexOncoprintColumnAttribute=this.ctx.getAttribLocation(i,"aVertexOncoprintColumn"),this.ctx.enableVertexAttribArray(i.vertexOncoprintColumnAttribute),i.samplerUniform=this.ctx.getUniformLocation(i,"uSampler"),i.pMatrixUniform=this.ctx.getUniformLocation(i,"uPMatrix"),i.mvMatrixUniform=this.ctx.getUniformLocation(i,"uMVMatrix"),i.columnWidthUniform=this.ctx.getUniformLocation(i,"columnWidth"),i.zoomXUniform=this.ctx.getUniformLocation(i,"zoomX"),i.zoomYUniform=this.ctx.getUniformLocation(i,"zoomY"),i.offsetYUniform=this.ctx.getUniformLocation(i,"offsetY"),i.positionBitPackBaseUniform=this.ctx.getUniformLocation(i,"positionBitPackBase"),i.texSizeUniform=this.ctx.getUniformLocation(i,"texSize"),this.shader_program=i}getTrackBuffers(t,e){const n=this.ctx.createBuffer(),r=t.vertex_data[e].pos_array,i=t.vertex_data[e].universal_shapes_start_index;this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,n),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,r,this.ctx.STATIC_DRAW),n.itemSize=1,n.specificShapesNumItems=i/n.itemSize,n.universalShapesNumItems=(r.length-i)/n.itemSize;const o=this.ctx.createBuffer(),s=t.vertex_data[e].col_array;this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,o),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,s,this.ctx.STATIC_DRAW),o.itemSize=1,o.specificShapesNumItems=i/o.itemSize,o.universalShapesNumItems=(s.length-i)/o.itemSize;const a=this.ctx.createTexture();this.ctx.bindTexture(this.ctx.TEXTURE_2D,a);const l=t.vertex_data[e].col_bank,u=Math.pow(2,Math.ceil(Math.log2(l.length/4)));for(;l.length<4*u;)l.push(0);this.ctx.texImage2D(this.ctx.TEXTURE_2D,0,this.ctx.RGBA,u,1,0,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,new Uint8Array(l)),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MIN_FILTER,this.ctx.NEAREST),this.ctx.texParameteri(this.ctx.TEXTURE_2D,this.ctx.TEXTURE_MAG_FILTER,this.ctx.NEAREST);const c={texture:a,size:u},h=this.ctx.createBuffer(),f=t.vertex_column_array[e];return this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,h),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,new Float32Array(f),this.ctx.STATIC_DRAW),h.itemSize=1,h.numItems=f.length/h.itemSize,{position:n,color:o,color_tex:c,column:h}}getSimpleCountBuffer(t){const e=t.getIdOrder().length,n=this.ctx.createBuffer();return this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,n),this.ctx.bufferData(this.ctx.ARRAY_BUFFER,new Float32Array(C.a.range(0,e)),this.ctx.STATIC_DRAW),n.itemSize=1,n.numItems=e,n}drawOncoprint(t,e){if(!this.shouldRender)return;this.ensureWebGLContext();const n=this.getZoom(t);this.ctx.clearColor(1,1,1,1),this.ctx.clear(this.ctx.COLOR_BUFFER_BIT|this.ctx.DEPTH_BUFFER_BIT);const r=t.getTracks(),i=this.getSimpleCountBuffer(t);for(let o=0;o<r.length;o++){const s=r[o],a=t.getCellTops(s,!0),l=this.getTrackBuffers(e,s);if(0!==l.position.numItems){for(const r of[!1,!0]){const o=this.shader_program;if(this.ctx.useProgram(o),r)this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,l.position),this.ctx.vertexAttribPointer(o.vertexPositionAttribute,l.position.itemSize,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,l.color),this.ctx.vertexAttribPointer(o.vertexColorAttribute,l.color.itemSize,this.ctx.FLOAT,!1,0,0),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,l.column),this.ctx.vertexAttribPointer(o.vertexOncoprintColumnAttribute,l.column.itemSize,this.ctx.FLOAT,!1,0,0),this.ext.vertexAttribDivisorANGLE(o.vertexOncoprintColumnAttribute,0);else{const t=l.position.specificShapesNumItems*l.position.itemSize;this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,l.position),this.ctx.vertexAttribPointer(o.vertexPositionAttribute,l.position.itemSize,this.ctx.FLOAT,!1,0,4*t),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,l.color),this.ctx.vertexAttribPointer(o.vertexColorAttribute,l.color.itemSize,this.ctx.FLOAT,!1,0,4*t),this.ctx.bindBuffer(this.ctx.ARRAY_BUFFER,i),this.ctx.vertexAttribPointer(o.vertexOncoprintColumnAttribute,1,this.ctx.FLOAT,!1,0,0),this.ext.vertexAttribDivisorANGLE(o.vertexOncoprintColumnAttribute,1)}this.ctx.activeTexture(this.ctx.TEXTURE0),this.ctx.bindTexture(this.ctx.TEXTURE_2D,l.color_tex.texture),this.ctx.uniform1i(this.shader_program.samplerUniform,0),this.ctx.uniform1f(this.shader_program.texSizeUniform,l.color_tex.size),this.ctx.uniformMatrix4fv(this.shader_program.pMatrixUniform,!1,this.pMatrix),this.ctx.uniformMatrix4fv(this.shader_program.mvMatrixUniform,!1,this.mvMatrix),this.ctx.uniform1f(this.shader_program.columnWidthUniform,t.getCellWidth(!0)),this.ctx.uniform1f(this.shader_program.zoomXUniform,n.x),this.ctx.uniform1f(this.shader_program.zoomYUniform,n.y),this.ctx.uniform1f(this.shader_program.offsetYUniform,a),this.ctx.uniform1f(this.shader_program.positionBitPackBaseUniform,e.position_bit_pack_base),r?this.ctx.drawArrays(this.ctx.TRIANGLES,0,l.position.specificShapesNumItems):this.ext.drawArraysInstancedANGLE(this.ctx.TRIANGLES,0,l.position.itemSize*l.position.universalShapesNumItems,i.numItems)}this.ctx.flush()}}}getZoom(t){let e=parseInt(this.$canvas[0].width,10)/t.getOncoprintWidthNoColumnPaddingNoGaps(),n=parseInt(this.$canvas[0].height,10)/t.getOncoprintHeight(!0);return{x:e=Math.max(0,Math.min(1,e)),y:n=Math.max(0,Math.min(1,n))}}drawOverlayRect(t,e,n){if(!this.shouldRender)return;let r,i,o,s,a,l;if(n)r=n.left,i=n.width,o=n.top,s=n.height,a=n.left_col,l=n.right_col;else{const n=t.getCellWidth(!0),u=(t.getCellPadding(!0),e.getViewportOncoprintSpace(t)),c=this.getZoom(t);a=t.getClosestColumnIndexToLeft(u.left,!1),l=t.getClosestColumnIndexToLeft(u.right,!1,!0),r=a*n*c.x,i=(l-a)*n*c.x,o=u.top*c.y,s=(u.bottom-u.top)*c.y}const u=this.overlay_ctx,c=this.$overlay_canvas[0],h=parseInt(c.width,10),f=parseInt(c.height,10);u.fillStyle="rgba(0,0,0,0)",u.clearRect(0,0,h,f),u.fillStyle="rgba(255,255,255,0.4)",u.fillRect(r,o,i,s);const d="t"===this.resize_hover||"tr"===this.resize_hover||"tl"===this.resize_hover,p="r"===this.resize_hover||"tr"===this.resize_hover||"br"===this.resize_hover,g="b"===this.resize_hover||"br"===this.resize_hover||"bl"===this.resize_hover,m="l"===this.resize_hover||"tl"===this.resize_hover||"bl"===this.resize_hover;u.beginPath(),u.moveTo(r,o),u.strokeStyle=d?"rgba(255,0,0,1)":"rgba(0,0,0,0.75)",u.lineWidth=d?2:1,u.lineTo(r+i,o),u.stroke(),u.beginPath(),u.moveTo(r+i,o),u.strokeStyle=p?"rgba(255,0,0,1)":"rgba(0,0,0,0.75)",u.lineWidth=p?2:1,u.lineTo(r+i,o+s),u.stroke(),u.beginPath(),u.moveTo(r+i,o+s),u.strokeStyle=g?"rgba(255,0,0,1)":"rgba(0,0,0,0.75)",u.lineWidth=g?2:1,u.lineTo(r,o+s),u.stroke(),u.beginPath(),u.moveTo(r,o+s),u.strokeStyle=m?"rgba(255,0,0,1)":"rgba(0,0,0,0.75)",u.lineWidth=m?2:1,u.lineTo(r,o),u.stroke(),this.current_rect.setParams({top:o,left_col:a,right_col:l,height:s})}drawOncoprintAndOverlayRect(t,e){this.shouldRender&&(this.drawOncoprint(t,e),this.drawOverlayRect(t,e))}moveTrack(t,e){this.drawOncoprintAndOverlayRect(t,e)}addTracks(t,e){this.drawOncoprintAndOverlayRect(t,e)}removeTrack(t,e){this.drawOncoprintAndOverlayRect(t,e)}setHorzZoom(t,e){this.drawOverlayRect(t,e),this.horizontal_zoom.setSliderValue(t.getHorzZoom())}setVertZoom(t,e){this.drawOverlayRect(t,e),this.vertical_zoom.setSliderValue(t.getVertZoom())}setZoom(t,e){this.drawOverlayRect(t,e),this.horizontal_zoom.setSliderValue(t.getHorzZoom()),this.vertical_zoom.setSliderValue(t.getVertZoom())}setScroll(t,e){this.drawOverlayRect(t,e)}setHorzScroll(t,e){this.drawOverlayRect(t,e)}setVertScroll(t,e){this.drawOverlayRect(t,e)}setViewport(t,e){this.drawOverlayRect(t,e),this.horizontal_zoom.setSliderValue(t.getHorzZoom()),this.vertical_zoom.setSliderValue(t.getVertZoom())}sort(t,e){this.drawOncoprintAndOverlayRect(t,e)}setTrackData(t,e){this.drawOncoprintAndOverlayRect(t,e)}shareRuleSet(t,e){this.drawOncoprintAndOverlayRect(t,e)}setRuleSet(t,e){this.drawOncoprintAndOverlayRect(t,e)}setIdOrder(t,e){this.drawOncoprintAndOverlayRect(t,e)}setTrackGroupHeader(t,e){this.drawOncoprintAndOverlayRect(t,e)}suppressRendering(){this.rendering_suppressed=!0}releaseRendering(t,e){this.rendering_suppressed=!1,this.drawOncoprintAndOverlayRect(t,e)}hideIds(t,e){this.drawOncoprintAndOverlayRect(t,e)}setMinimapVisible(t,e,n){this.visible=t,this.visible&&e&&n&&this.drawOncoprintAndOverlayRect(e,n)}setWindowPosition(t,e){this.$div.css({top:e,left:t})}setWidth(t,e,n){this.$canvas[0].width=t,this.$overlay_canvas[0].width=t,this.getWebGLContextAndSetUpMatrices(),this.setUpShaders(),this.overlay_ctx=this.$overlay_canvas[0].getContext("2d"),this.drawOncoprintAndOverlayRect(e,n)}}n.d(e,"default",(function(){return de})),n.d(e,"RuleSetType",(function(){return dt})),n.d(e,"RuleSet",(function(){return wt})),n.d(e,"LinearInterpRangeType",(function(){return Tt})),n.d(e,"GeneticAlterationRuleSet",(function(){return zt})),n.d(e,"Rule",(function(){return Rt})),n.d(e,"shapeToSvg",(function(){return q}));const fe=function(){let t=0;return function(){return t+=1}}();class de{constructor(t,e,n){this.ctr_selector=t,this.width=e,this.lastSortId=0,this.getCellViewHeight=()=>this.cell_view.getVisibleAreaHeight(this.model),n=n||{};const r=this;if(this.destroyed=!1,this.webgl_unavailable=null===document.createElement("canvas").getContext("experimental-webgl"),this.webgl_unavailable)return void c()(t).append("<p class='oncoprintjs__webgl_unavailable_message'>WebGL context cannot be retrieved, so oncoprint cannot be used. Please visit <a href='http://webglreport.com'>WebGL Report</a> to explore your browsers WebGL capabilities.</p>");const i=c()("<span></span>").css({position:"relative",display:"inline-block"}).appendTo(t),o=c()("<div></div>").css({position:"absolute",display:"inline-block"}).appendTo(i),s=c()("<span></span>").css({position:"fixed",top:0,left:0,"z-index":99999}).appendTo(t),a=c()("<div></div>").css({position:"absolute",display:"inline-block",top:0,left:0,"min-height":1}).appendTo(i),l=c()("<canvas></canvas>").css({display:"inline-block",position:"absolute",left:"0px",top:"0px"}).addClass("noselect").attr({width:"150",height:"250"}),u=c()("<div></div>").css({position:"absolute"}).addClass("oncoprintjs__header_div"),h=c()("<div></div>").css({position:"absolute",left:"150px",top:"0px"}).addClass("noselect").attr({width:"50",height:"250"}),f=c()("<div></div>").css({position:"absolute",top:"250px","min-height":1}).addClass("noselect oncoprint-legend-div"),d=c()("<div>").css({width:e,display:"inline-block",position:"absolute",left:"200px",top:"0px"}).addClass("noselect"),p=c()("<canvas></canvas>").attr({width:"0px",height:"0px"}).css({position:"absolute",top:"0px",left:"0px"}).addClass("noselect"),g=c()("<div>").css({position:"absolute","overflow-x":"scroll","overflow-y":"scroll",top:"0",left:"0px",height:"1px"}).addClass("oncoprintjs__scroll_div"),m=c()("<div>").appendTo(g),v=c()("<canvas></canvas>").attr({width:"0px",height:"0px"}).css({position:"absolute",top:"0px",left:"0px"}).addClass("noselect").addClass("oncoprintjs__cell_overlay_div"),b=c()("<canvas></canvas>").attr({width:"0px",height:"0px"}).css({position:"absolute",top:"0px",left:"0px","pointer-events":"none"}).addClass("noselect").addClass("oncoprintjs__column_label_canvas"),x=c()("<div>").css({position:"absolute"}),y=c()("<div>").css({position:"absolute",outline:"solid 1px black",display:"none"}).addClass("noselect"),w=c()("<canvas></canvas>").attr("width",300).attr("height",300).css({position:"absolute",top:"0px",left:"0px","z-index":0}).addClass("noselect"),k=c()("<canvas></canvas>").attr("width",300).attr("height",300).css({position:"absolute",top:"0px",left:"0px","z-index":1}).addClass("noselect");var S;l.appendTo(o),d.appendTo(o),h.appendTo(o),x.appendTo(o),u.appendTo(o),f.appendTo(a),y.appendTo(i),p.appendTo(d),v.appendTo(d),b.appendTo(d),g.appendTo(d),g.on("mousemove mousedown mouseup",(function(t){v.trigger(t)})),w.appendTo(y),k.appendTo(y),this.$ctr=i,this.$oncoprint_ctr=o,this.$header_div=u,this.$cell_div=d,this.$legend_div=f,this.$track_options_div=h,this.$track_info_div=x,this.$dummy_scroll_div=g,this.$minimap_div=y,this.$cell_canvas=p,this.$cell_overlay_canvas=v,this.model=new P(n),this.header_view=new Ut(this.$header_div),this.cell_view=new ct(d,p,v,b,m,this.model,new re(s),(function(t,e){const n=r.model.getIdsInZoomedLeftInterval(t,e);r.setHorzZoom(r.model.getHorzZoomToFit(r.cell_view.getVisibleAreaWidth(),n)),r.$dummy_scroll_div.scrollLeft(r.model.getZoomedColumnLeft(n[0]))}),(function(t,e){r.doCellMouseOver(t,e)}),(function(t,e){r.doCellClick(t,e)})),this.minimap_view=new he(y,w,k,this.model,this.cell_view,150,150,(function(t,e){r.setScroll(t,e)}),(function(t){r.setViewport(t)}),(function(t){r.setHorzZoomCentered(t)}),(function(t){const e=r.cell_view.getViewportOncoprintSpace(r.model),n=(e.top+e.bottom)/2;r.setVertZoom(t);const i=r.cell_view.getViewportOncoprintSpace(r.model),o=r.model.getVertZoom()*(i.bottom-i.top)/2;r.setVertScroll(n*r.model.getVertZoom()-o)}),(function(){r.updateHorzZoomToFit();const t=r.model.getZoomedColumnLeft();r.setHorzScroll(Math.min.apply(null,r.keep_horz_zoomed_to_fit_ids.map((function(e){return t[e]}))))}),(function(){r.setMinimapVisible(!1)})),this.track_options_view=new te(h,(function(t){const e=r.model.getContainingTrackGroup(t),n=e.indexOf(t);if(n>0){let i=null;n>=2&&(i=e[n-2]),r.moveTrack(t,i)}}),(function(t){const e=r.model.getContainingTrackGroup(t),n=e.indexOf(t);n<e.length-1&&r.moveTrack(t,e[n+1])}),(function(t){const e=r.model.getTrackRemoveOptionCallback(t);e?e(t):r.removeTrack(t)}),(function(t,e){r.setTrackSortDirection(t,e)}),(function(t){r.removeExpansionTracksFor(t)}),r.setTrackShowGaps.bind(r)),this.track_info_view=new ie(x,new re(s)),this.label_view=new ft(l,this.model,new re(s,{noselect:!0})),this.label_view.setDragCallback((function(t,e){r.moveTrack(t,e)})),this.legend_view=new ee(f,10,20),this.keep_horz_zoomed_to_fit=!1,this.keep_horz_zoomed_to_fit_ids=[],this.target_dummy_scroll_left=0,this.target_dummy_scroll_top=0,S=r,g.scroll((function(t){const e=g.scrollLeft(),n=g.scrollTop();if(e!==r.target_dummy_scroll_left||n!==r.target_dummy_scroll_top){r.target_dummy_scroll_left=e,r.target_dummy_scroll_top=n;const t=S.maxDummyScrollDivScroll(),i=t.left,o=t.top;let s=i>0?e/i:0,a=o>0?n/o:0;s=_(s,0,1),a=_(a,0,1);const l=S.maxOncoprintScrollLeft(),u=S.maxOncoprintScrollTop(),c=Math.round(l*s),h=Math.round(u*a);r.keep_horz_zoomed_to_fit=!1,S.doSetScroll(c,h)}})),this.horz_zoom_callbacks=[],this.minimap_close_callbacks=[],this.cell_mouse_over_callbacks=[],this.cell_click_callbacks=[],this.id_clipboard=[],this.clipboard_change_callbacks=[],this.pending_resize_and_organize=!1}incrementLastSortId(){this.lastSortId=(this.lastSortId+1)%1e6}_SetLegendTop(){this.model.rendering_suppressed_depth>0||this.$legend_div.css({top:this.cell_view.getVisibleAreaHeight(this.model)+30})}setLegendTopAfterTimeout(){if(this.model.rendering_suppressed_depth>0)return;const t=this;setTimeout((function(){t.setHeight(),t._SetLegendTop()}),0)}setHeight(){this.$ctr.css({"min-height":this.cell_view.getVisibleAreaHeight(this.model)+Math.max(this.$legend_div.outerHeight(),this.$minimap_div.is(":visible")?this.$minimap_div.outerHeight():0)+30})}resizeAndOrganize(t){if(this.model.rendering_suppressed_depth>0)return;if(0===c()(this.ctr_selector).width())return void(this.pending_resize_and_organize=!0);this.$track_options_div.css({left:this.label_view.getWidth()}),this.$header_div.css({left:0,top:0,width:this.width,height:this.cell_view.getVisibleAreaHeight(this.model)}),this.$track_info_div.css({left:this.label_view.getWidth()+this.track_options_view.getWidth()});const e=this.label_view.getWidth()+this.track_options_view.getWidth()+this.track_info_view.getWidth();this.$cell_div.css("left",e),this.cell_view.setWidth(this.width-e-20,this.model),this._SetLegendTop(),this.legend_view.setWidth(this.width-this.$minimap_div.outerWidth()-20,this.model),this.setHeight(),this.$ctr.css({"min-width":this.width});const n=this;setTimeout((function(){n.keep_horz_zoomed_to_fit&&n.updateHorzZoomToFit(),t&&t()}),0)}resizeAndOrganizeAfterTimeout(t){if(this.model.rendering_suppressed_depth>0)return;const e=this;setTimeout((function(){e.resizeAndOrganize(t)}),0)}maxOncoprintScrollLeft(){return Math.max(0,this.cell_view.getTotalWidth(this.model)-this.cell_view.getVisibleAreaWidth())}maxOncoprintScrollTop(){return Math.max(0,this.cell_view.getTotalHeight(this.model)-this.cell_view.getVisibleAreaHeight(this.model))}maxDummyScrollDivScroll(){const t=this.cell_view.getDummyScrollDivClientSize();return{left:Math.max(0,this.$dummy_scroll_div[0].scrollWidth-t.width),top:Math.max(0,this.$dummy_scroll_div[0].scrollHeight-t.height)}}setMinimapVisible(t){this.webgl_unavailable||this.destroyed||(t?(this.$minimap_div.css({display:"block",top:0,left:c()(this.ctr_selector).width()-this.$minimap_div.outerWidth()-10}),this.minimap_view.setMinimapVisible(!0,this.model,this.cell_view)):(this.$minimap_div.css("display","none"),this.minimap_view.setMinimapVisible(!1),this.executeMinimapCloseCallbacks()),this.resizeAndOrganizeAfterTimeout())}scrollTo(t){this.webgl_unavailable||this.destroyed||this.$dummy_scroll_div.scrollLeft(t)}onHorzZoom(t){this.webgl_unavailable||this.destroyed||this.horz_zoom_callbacks.push(t)}onMinimapClose(t){this.webgl_unavailable||this.destroyed||this.minimap_close_callbacks.push(t)}moveTrack(t,e){this.webgl_unavailable||this.destroyed||(this.model.moveTrack(t,e),this.cell_view.moveTrack(this.model),this.header_view.render(this.model),this.label_view.moveTrack(this.model,this.getCellViewHeight),this.track_options_view.moveTrack(this.model,this.getCellViewHeight),this.track_info_view.moveTrack(this.model,this.getCellViewHeight),this.minimap_view.moveTrack(this.model,this.cell_view),this.model.keep_sorted&&this.model.isSortAffected([t,e],"track")&&this.sort(),this.resizeAndOrganizeAfterTimeout())}setTrackGroupOrder(t,e,n){this.webgl_unavailable||this.destroyed||(this.model.setTrackGroupOrder(t,e),this.cell_view.setTrackGroupOrder(this.model),this.header_view.render(this.model),this.label_view.setTrackGroupOrder(this.model,this.getCellViewHeight),this.track_options_view.setTrackGroupOrder(this.model),this.track_info_view.setTrackGroupOrder(this.model,this.getCellViewHeight),!n&&this.model.keep_sorted&&this.model.isSortAffected(t,"group")&&this.sort(),this.resizeAndOrganizeAfterTimeout())}setTrackGroupLegendOrder(t){this.webgl_unavailable||this.destroyed||(this.model.setTrackGroupLegendOrder(t),this.legend_view.setTrackGroupLegendOrder(this.model),this.resizeAndOrganizeAfterTimeout())}keepSorted(t){if(this.webgl_unavailable||this.destroyed)return;const e=this.model.keep_sorted;this.model.keep_sorted=void 0===t||t,this.model.keep_sorted&&this.model.keep_sorted!==e&&this.sort()}addTracks(t){if(this.webgl_unavailable||this.destroyed)return;const e=[],n=t.map((function(t){return t.track_id=fe(),t.rule_set=Et(t.rule_set_params),e.push(t.track_id),t}));return this.model.addTracks(n),this.cell_view.addTracks(this.model,e),this.label_view.addTracks(this.model,e,this.getCellViewHeight),this.header_view.render(this.model),this.track_options_view.addTracks(this.model,this.getCellViewHeight),this.track_info_view.addTracks(this.model,this.getCellViewHeight),this.legend_view.addTracks(this.model),this.minimap_view.addTracks(this.model,this.cell_view),this.model.keep_sorted&&this.model.isSortAffected(e,"track")&&this.sort(),this.resizeAndOrganizeAfterTimeout(),e}removeTrack(t){this.webgl_unavailable||this.destroyed||(this.model.removeTrack(t),this.cell_view.removeTrack(this.model,t),this.header_view.render(this.model),this.label_view.removeTrack(this.model,this.getCellViewHeight),this.track_options_view.removeTrack(this.model,t,this.getCellViewHeight),this.track_info_view.removeTrack(this.model,this.getCellViewHeight),this.legend_view.removeTrack(this.model),this.minimap_view.removeTrack(this.model,this.cell_view),this.model.keep_sorted&&this.model.isSortAffected(t,"track")&&this.sort(),this.resizeAndOrganizeAfterTimeout())}removeTracks(t){if(!this.webgl_unavailable&&!this.destroyed)for(let e=0;e<t.length;e++)this.removeTrack(t[e])}getTracks(){if(!this.webgl_unavailable&&!this.destroyed)return this.model.getTracks().slice()}removeAllTracks(){if(this.webgl_unavailable||this.destroyed)return;const t=this.model.getTracks();this.removeTracks(t)}removeExpansionTracksFor(t){this.removeTracks(this.model.track_expansion_tracks[t].slice())}disableTrackExpansion(t){this.model.disableTrackExpansion(t)}enableTrackExpansion(t){this.model.enableTrackExpansion(t)}removeAllExpansionTracksInGroup(t){const e=this.model.getTrackGroups()[t].tracks,n=[];let r;for(r=0;r<e.length;r++)this.model.isTrackExpanded(e[r])&&n.push(e[r]);for(this.suppressRendering(),r=0;r<n.length;r++)this.removeExpansionTracksFor(n[r]);this.releaseRendering()}setHorzZoomToFit(t){this.webgl_unavailable||this.destroyed||(this.keep_horz_zoomed_to_fit=!0,this.updateHorzZoomToFitIds(t),this.updateHorzZoomToFit())}updateHorzZoomToFitIds(t){this.webgl_unavailable||this.destroyed||(this.keep_horz_zoomed_to_fit_ids=t.slice(),this.keep_horz_zoomed_to_fit&&this.updateHorzZoomToFit())}updateHorzZoomToFit(){this.setHorzZoom(this.getHorzZoomToFit(this.keep_horz_zoomed_to_fit_ids),!0)}getHorzZoomToFit(t){return t=t||[],this.model.getHorzZoomToFit(this.cell_view.getVisibleAreaWidth(),t)}executeHorzZoomCallbacks(){for(let t=0;t<this.horz_zoom_callbacks.length;t++)this.horz_zoom_callbacks[t](this.model.getHorzZoom())}executeMinimapCloseCallbacks(){for(let t=0;t<this.minimap_close_callbacks.length;t++)this.minimap_close_callbacks[t]()}doCellMouseOver(t,e){null!==t?this.highlightTrackLabelOnly(e):this.highlightTrackLabelOnly(null);for(let n=0;n<this.cell_mouse_over_callbacks.length;n++)this.cell_mouse_over_callbacks[n](t,e)}doCellClick(t,e){for(let n=0;n<this.cell_click_callbacks.length;n++)this.cell_click_callbacks[n](t,e)}getHorzZoom(){if(!this.webgl_unavailable&&!this.destroyed)return this.model.getHorzZoom()}setHorzZoomCentered(t){const e=this.cell_view.getViewportOncoprintSpace(this.model).center_col_index,n=this.model.getIdOrder()[e];this.setHorzZoom(t),this.setHorzScroll(this.model.getZoomedColumnLeft(n)-this.cell_view.visible_area_width/2)}setHorzZoom(t,e){if(!this.webgl_unavailable&&!this.destroyed)return this.keep_horz_zoomed_to_fit=this.keep_horz_zoomed_to_fit&&e,this.model.getHorzZoom()!==t&&(this.model.setHorzZoom(t),this.cell_view.setHorzZoom(this.model),this.minimap_view.setHorzZoom(this.model,this.cell_view),this.executeHorzZoomCallbacks(),this.resizeAndOrganizeAfterTimeout()),this.model.getHorzZoom()}getVertZoom(){if(!this.webgl_unavailable&&!this.destroyed)return this.model.getVertZoom()}setVertZoom(t){if(!this.webgl_unavailable&&!this.destroyed)return this.model.setVertZoom(t),this.cell_view.setVertZoom(this.model),this.header_view.render(this.model),this.label_view.setVertZoom(this.model,this.getCellViewHeight),this.track_info_view.setVertZoom(this.model,this.getCellViewHeight),this.track_options_view.setVertZoom(this.model,this.getCellViewHeight),this.minimap_view.setVertZoom(this.model,this.cell_view),this.resizeAndOrganizeAfterTimeout(),this.model.getVertZoom()}doSetScroll(t,e){t=Math.min(t,this.maxOncoprintScrollLeft()),e=Math.min(e,this.maxOncoprintScrollTop()),this.model.setScroll(t,e),this.cell_view.setScroll(this.model),this.header_view.setScroll(this.model),this.label_view.setScroll(this.model,this.getCellViewHeight),this.track_info_view.setScroll(this.model),this.track_options_view.setScroll(this.model),this.minimap_view.setScroll(this.model,this.cell_view)}setDummyScrollDivScroll(){const t=this.model.getHorzScroll(),e=this.model.getVertScroll(),n=this.maxOncoprintScrollLeft(),r=this.maxOncoprintScrollTop();let i=n>0?t/n:0,o=r>0?e/r:0;i=_(i,0,1),o=_(o,0,1);const s=this.maxDummyScrollDivScroll(),a=s.left,l=s.top;this.target_dummy_scroll_left=Math.round(i*a),this.target_dummy_scroll_top=Math.round(o*l),this.$dummy_scroll_div.scrollLeft(this.target_dummy_scroll_left),this.$dummy_scroll_div.scrollTop(this.target_dummy_scroll_top)}setScroll(t,e){this.webgl_unavailable||this.destroyed||(this.doSetScroll(t,e),this.setDummyScrollDivScroll())}setZoom(t,e){this.webgl_unavailable||this.destroyed||(this.model.setZoom(t,e),this.cell_view.setZoom(this.model),this.header_view.render(this.model),this.label_view.setZoom(this.model,this.getCellViewHeight),this.track_info_view.setZoom(this.model,this.getCellViewHeight),this.track_options_view.setZoom(this.model,this.getCellViewHeight),this.minimap_view.setZoom(this.model,this.cell_view))}setHorzScroll(t){if(!this.webgl_unavailable&&!this.destroyed)return this.model.setHorzScroll(Math.min(t,this.maxOncoprintScrollLeft())),this.cell_view.setHorzScroll(this.model),this.label_view.setHorzScroll(this.model),this.track_info_view.setHorzScroll(this.model),this.track_options_view.setHorzScroll(this.model),this.minimap_view.setHorzScroll(this.model,this.cell_view),this.setDummyScrollDivScroll(),this.model.getHorzScroll()}setVertScroll(t){if(!this.webgl_unavailable&&!this.destroyed)return this.model.setVertScroll(Math.min(t,this.maxOncoprintScrollTop())),this.cell_view.setVertScroll(this.model),this.header_view.setVertScroll(this.model),this.label_view.setVertScroll(this.model,this.getCellViewHeight),this.track_info_view.setVertScroll(this.model),this.track_options_view.setVertScroll(this.model),this.minimap_view.setVertScroll(this.model,this.cell_view),this.setDummyScrollDivScroll(),this.model.getVertScroll()}setViewport(t){if(this.webgl_unavailable||this.destroyed)return;const e=this.model.getHorzZoomToFitCols(this.cell_view.getVisibleAreaWidth(),t.left_col,t.right_col);this.setZoom(e,t.zoom_y);const n=Math.min(this.model.getZoomedColumnLeft(this.model.getIdOrder()[t.left_col]),this.maxOncoprintScrollLeft()),r=Math.min(t.scroll_y_proportion*this.model.getOncoprintHeight(),this.maxOncoprintScrollTop());this.setScroll(n,r),this.executeHorzZoomCallbacks()}getTrackData(t){if(!this.webgl_unavailable&&!this.destroyed)return this.model.getTrackData(t)}getTrackDataIdKey(t){if(!this.webgl_unavailable&&!this.destroyed)return this.model.getTrackDataIdKey(t)}setTrackData(t,e,n){this.webgl_unavailable||this.destroyed||(this.model.setTrackData(t,e,n),this.cell_view.setTrackData(this.model,t),this.header_view.render(this.model),this.legend_view.setTrackData(this.model),this.minimap_view.setTrackData(this.model,this.cell_view),this.model.keep_sorted&&this.model.isSortAffected(t,"track")&&this.sort(),this.resizeAndOrganizeAfterTimeout())}setTrackImportantIds(t,e){this.webgl_unavailable||this.destroyed||(this.model.setTrackImportantIds(t,e),this.cell_view.setTrackImportantIds(this.model,t),this.legend_view.setTrackImportantIds(this.model),this.resizeAndOrganizeAfterTimeout())}setTrackGroupSortPriority(t){this.webgl_unavailable||this.destroyed||(this.model.setTrackGroupSortPriority(t),this.cell_view.setTrackGroupSortPriority(this.model),this.model.keep_sorted&&this.sort(),this.resizeAndOrganizeAfterTimeout())}resetSortableTracksSortDirection(){this.webgl_unavailable||this.destroyed||(this.model.resetSortableTracksSortDirection(!0),this.model.keep_sorted&&this.sort())}setTrackSortDirection(t,e){if(!this.webgl_unavailable&&!this.destroyed)return this.model.isTrackSortDirectionChangeable(t)&&(this.model.setTrackSortDirection(t,e),this.model.keep_sorted&&this.model.isSortAffected(t,"track")&&this.sort(),0===this.model.getTrackSortDirection(t)&&this.model.getTrackShowGaps(t)&&this.setTrackShowGaps(t,!1)),this.model.getTrackSortDirection(t)}setTrackSortComparator(t,e){this.webgl_unavailable||this.destroyed||(this.model.setTrackSortComparator(t,e),this.model.keep_sorted&&this.model.isSortAffected(t,"track")&&this.sort())}getTrackSortDirection(t){if(!this.webgl_unavailable&&!this.destroyed)return this.model.getTrackSortDirection(t)}setTrackInfo(t,e){this.webgl_unavailable||this.destroyed||(this.model.setTrackInfo(t,e),this.track_info_view.setTrackInfo(this.model,this.getCellViewHeight))}setTrackTooltipFn(t,e){this.webgl_unavailable||this.destroyed||this.model.setTrackTooltipFn(t,e)}setShowTrackSublabels(t){this.model.setShowTrackSublabels(t),this.label_view.setShowTrackSublabels(this.model,this.getCellViewHeight),this.resizeAndOrganizeAfterTimeout()}setTrackShowGaps(t,e){this.model.setTrackShowGaps(t,e),0===this.model.getTrackSortDirection(t)&&e&&this.setTrackSortDirection(t,1),this.track_options_view.setTrackShowGaps(this.model,this.getCellViewHeight),this.cell_view.setTrackShowGaps(this.model)}sort(){if(this.webgl_unavailable||this.destroyed)return;const t=this;this.incrementLastSortId();const e=this.lastSortId;this.model.sort().then((function(n){t.lastSortId===e&&(t.label_view.sort(t.model,t.getCellViewHeight),t.track_options_view.sort(t.model,t.getCellViewHeight),t.cell_view.sort(t.model),t.minimap_view.sort(t.model,t.cell_view),n&&t.setTrackGroupOrder(n.track_group_index,n.track_id_order,!0))}))}shareRuleSet(t,e){this.webgl_unavailable||this.destroyed||(this.model.shareRuleSet(t,e),this.cell_view.shareRuleSet(this.model,e),this.legend_view.shareRuleSet(this.model),this.minimap_view.shareRuleSet(this.model,this.cell_view))}setRuleSet(t,e){this.webgl_unavailable||this.destroyed||(this.model.setRuleSet(t,Et(e)),this.cell_view.setRuleSet(this.model,t),this.legend_view.setRuleSet(this.model),this.minimap_view.setRuleSet(this.model,this.cell_view),this.resizeAndOrganizeAfterTimeout())}setSortConfig(t){this.webgl_unavailable||this.destroyed||(this.model.setSortConfig(t),this.cell_view.setSortConfig(this.model),this.track_options_view.setSortConfig(this.model),this.model.keep_sorted&&this.sort())}setIdOrder(t){this.webgl_unavailable||this.destroyed||(this.model.setIdOrder(t),this.cell_view.setIdOrder(this.model,t),this.minimap_view.setIdOrder(this.model,this.cell_view),this.model.keep_sorted&&this.sort())}setTrackGroupHeader(t,e){this.webgl_unavailable||this.destroyed||(this.model.setTrackGroupHeader(t,e),this.label_view.setTrackGroupHeader(this.model,this.getCellViewHeight),this.header_view.render(this.model),this.track_info_view.setTrackGroupHeader(this.model,this.getCellViewHeight),this.track_options_view.setTrackGroupHeader(this.model,this.getCellViewHeight),this.minimap_view.setTrackGroupHeader(this.model,this.cell_view),this.cell_view.setTrackGroupHeader(this.model),this.resizeAndOrganizeAfterTimeout())}disableInteraction(){this.webgl_unavailable||this.destroyed||this.track_options_view.disableInteraction()}enableInteraction(){this.webgl_unavailable||this.destroyed||this.track_options_view.enableInteraction()}suppressRendering(){this.webgl_unavailable||this.destroyed||(this.model.rendering_suppressed_depth+=1,this.label_view.suppressRendering(),this.header_view.suppressRendering(),this.cell_view.suppressRendering(),this.track_options_view.suppressRendering(),this.track_info_view.suppressRendering(),this.legend_view.suppressRendering(),this.minimap_view.suppressRendering())}releaseRendering(t){this.webgl_unavailable||this.destroyed||this.model.rendering_suppressed_depth>0&&(this.model.rendering_suppressed_depth-=1,this.model.rendering_suppressed_depth=Math.max(0,this.model.rendering_suppressed_depth),0===this.model.rendering_suppressed_depth&&(this.model.releaseRendering(),this.label_view.releaseRendering(this.model,this.getCellViewHeight),this.header_view.releaseRendering(this.model),this.cell_view.releaseRendering(this.model),this.track_options_view.releaseRendering(this.model,this.getCellViewHeight),this.track_info_view.releaseRendering(this.model,this.getCellViewHeight),this.legend_view.releaseRendering(this.model),this.minimap_view.releaseRendering(this.model,this.cell_view),this.resizeAndOrganizeAfterTimeout(t)))}triggerPendingResizeAndOrganize(t){this.webgl_unavailable||this.destroyed||this.pending_resize_and_organize&&(this.pending_resize_and_organize=!1,this.resizeAndOrganizeAfterTimeout(t))}hideIds(t,e){this.webgl_unavailable||this.destroyed||(this.model.hideIds(t,e),this.cell_view.hideIds(this.model),this.minimap_view.hideIds(this.model,this.cell_view))}hideTrackLegends(t){this.webgl_unavailable||this.destroyed||(t=[].concat(t),this.model.hideTrackLegends(t),this.legend_view.hideTrackLegends(this.model),this.setLegendTopAfterTimeout())}showTrackLegends(t){this.webgl_unavailable||this.destroyed||(t=[].concat(t),this.model.showTrackLegends(t),this.legend_view.showTrackLegends(this.model),this.setLegendTopAfterTimeout())}setCellPaddingOn(t){this.webgl_unavailable||this.destroyed||(this.model.setCellPaddingOn(t),this.cell_view.setCellPaddingOn(this.model))}setTrackCustomOptions(t,e){this.model.setTrackCustomOptions(t,e),this.track_options_view.setTrackCustomOptions(this.model)}setTrackInfoTooltip(t,e){this.model.setTrackInfoTooltip(t,e)}setTrackMovable(t,e){this.model.setTrackMovable(t,e),this.track_options_view.setTrackMovable(this.model),this.label_view.setTrackMovable(this.model)}setWidth(t){this.width=t,this.resizeAndOrganize()}setColumnLabels(t){this.model.setColumnLabels(t),this.cell_view.setColumnLabels(this.model),this.resizeAndOrganizeAfterTimeout()}setShowTrackLabels(t){this.model.setShowTrackLabels(t),this.label_view.setShowTrackLabels(this.model,this.getCellViewHeight),this.resizeAndOrganizeAfterTimeout()}onCellMouseOver(t){this.cell_mouse_over_callbacks.push(t)}onCellClick(t){this.cell_click_callbacks.push(t)}toSVG(t){if(this.webgl_unavailable||this.destroyed)return;const e=U.svg(10,10);this.$ctr.append(e);const n=U.group(0,0);e.appendChild(n);const r=U.bgrect(10,10,[255,255,255,1]);t&&n.appendChild(r);const i=this.label_view.toSVGGroup(this.model,!0,0,0);n.appendChild(i);const o=this.header_view.toSVGGroup(this.model,0,0);n.appendChild(o);const s=i.getBBox().width,a=s+(s>0?30:0),l=this.track_info_view.toSVGGroup(this.model,a,0);n.appendChild(l);const u=a+l.getBBox().width+10,c=this.cell_view.toSVGGroup(this.model,u,0);n.appendChild(c),n.appendChild(this.legend_view.toSVGGroup(this.model,0,c.getBBox().y+c.getBBox().height+20));const h=n.getBBox(),f=h.x+h.width,d=h.y+h.height;return e.setAttribute("width",f),e.setAttribute("height",d),t&&(r.setAttribute("width",f),r.setAttribute("height",d)),e.parentNode.removeChild(e),e}toCanvas(t,e){if(this.webgl_unavailable||this.destroyed)return;const n=this.toSVG(!0);n.setAttribute("xmlns","http://www.w3.org/2000/svg");const r=parseInt(n.getAttribute("width"),10),i=parseInt(n.getAttribute("height"),10),o=document.createElement("canvas"),s=r*(e=e||1)>8192||i*e>8192;o.setAttribute("width",Math.min(8192,r*e).toString()),o.setAttribute("height",Math.min(8192,i*e).toString());const a=document.createElement("div");a.appendChild(n);const l=a.innerHTML,u="data:image/svg+xml;base64,"+window.btoa(l),c=o.getContext("2d");c.setTransform(e,0,0,e,0,0);const h=new Image;return h.onload=function(){c.drawImage(h,0,0),t(o,s)},h.onerror=function(){console.log("IMAGE LOAD ERROR")},h.src=u,h}toDataUrl(t){this.webgl_unavailable||this.destroyed||this.toCanvas((function(e){t(e.toDataURL())}))}highlightTrackLabelOnly(t){this.webgl_unavailable||this.destroyed||this.label_view.highlightTrackLabelOnly(t,this.model)}setHighlightedTracks(t){this.webgl_unavailable||this.destroyed||(this.model.setHighlightedTracks(t),this.label_view.setHighlightedTracks(this.model),this.cell_view.setHighlightedTracks(this.model))}setHighlightedIds(t){this.webgl_unavailable||this.destroyed||(this.model.setHighlightedIds(t),this.cell_view.setHighlightedIds(this.model))}getIdOrder(t){if(!this.webgl_unavailable&&!this.destroyed)return this.model.getIdOrder(t)}setIdClipboardContents(t){if(!this.webgl_unavailable&&!this.destroyed){this.id_clipboard=t.slice();for(let e=0;e<this.clipboard_change_callbacks.length;e++)this.clipboard_change_callbacks[e](t)}}getIdClipboardContents(){if(!this.webgl_unavailable&&!this.destroyed)return this.id_clipboard.slice()}onClipboardChange(t){this.webgl_unavailable||this.destroyed||this.clipboard_change_callbacks.push(t)}destroy(){this.webgl_unavailable||this.destroyed||(this.cell_view.destroy(),this.header_view.destroy(),this.track_options_view.destroy(),this.track_info_view.destroy(),this.destroyed=!0)}clearMouseOverEffects(){this.webgl_unavailable||this.destroyed||(this.cell_view.clearOverlay(),this.label_view.highlightTrackLabelOnly(null,this.model))}}}]);