higlass 1.13.3 → 1.13.4
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.
- package/app/scripts/TiledPlot.jsx +8 -0
- package/dist/hglib.js +5 -2
- package/dist/hglib.min.js +3 -3
- package/dist/higlass.mjs +5 -2
- package/package.json +1 -1
package/dist/hglib.min.js
CHANGED
|
@@ -181,7 +181,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
181
181
|
\r]`),r=e.charCodeAt(0);function i(h,f){var d,p,m=n(h,function(g,v){if(d)return d(g,v-1);p=g,d=f?xie(g,f):v5(g)});return m.columns=p||[],m}function n(h,f){var d=[],p=h.length,m=0,g=0,v,_=p<=0,y=!1;h.charCodeAt(p-1)===zd&&--p,h.charCodeAt(p-1)===zS&&--p;function b(){if(_)return US;if(y)return y=!1,g5;var S,k=m,O;if(h.charCodeAt(k)===GS){for(;m++<p&&h.charCodeAt(m)!==GS||h.charCodeAt(++m)===GS;);return(S=m)>=p?_=!0:(O=h.charCodeAt(m++))===zd?y=!0:O===zS&&(y=!0,h.charCodeAt(m)===zd&&++m),h.slice(k+1,S-1).replace(/""/g,'"')}for(;m<p;){if((O=h.charCodeAt(S=m++))===zd)y=!0;else if(O===zS)y=!0,h.charCodeAt(m)===zd&&++m;else if(O!==r)continue;return h.slice(k,S)}return _=!0,h.slice(k,p)}for(;(v=b())!==US;){for(var T=[];v!==g5&&v!==US;)T.push(v),v=b();f&&(T=f(T,g++))==null||d.push(T)}return d}function o(h,f){return h.map(function(d){return f.map(function(p){return l(d[p])}).join(e)})}function a(h,f){return f==null&&(f=y5(h)),[f.map(l).join(e)].concat(o(h,f)).join(`
|
|
182
182
|
`)}function s(h,f){return f==null&&(f=y5(h)),o(h,f).join(`
|
|
183
183
|
`)}function c(h){return h.map(u).join(`
|
|
184
|
-
`)}function u(h){return h.map(l).join(e)}function l(h){return h==null?"":h instanceof Date?Rie(h):t.test(h+="")?'"'+h.replace(/"/g,'""')+'"':h}return{parse:i,parseRows:n,format:a,formatBody:s,formatRows:c,formatRow:u,formatValue:l}}var Wl=VS(","),Mie=Wl.parse,Lie=Wl.parseRows,Bie=Wl.format,Hie=Wl.formatBody,Fie=Wl.formatRows,$ie=Wl.formatRow,jie=Wl.formatValue,Yl=VS(" "),Uie=Yl.parse,WS=Yl.parseRows,Gie=Yl.format,zie=Yl.formatBody,Vie=Yl.formatRows,Wie=Yl.formatRow,Yie=Yl.formatValue;function qie(e){for(var t in e){var r=e[t].trim(),i,n;if(!r)r=null;else if(r==="true")r=!0;else if(r==="false")r=!1;else if(r==="NaN")r=NaN;else if(!isNaN(i=+r))r=i;else if(n=r.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/))Xie&&n[4]&&!n[7]&&(r=r.replace(/-/g,"/").replace(/T/," ")),r=new Date(r);else continue;e[t]=r}return e}const Xie=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),Kie=Object.freeze(Object.defineProperty({__proto__:null,autoType:qie,csvFormat:Bie,csvFormatBody:Hie,csvFormatRow:$ie,csvFormatRows:Fie,csvFormatValue:jie,csvParse:Mie,csvParseRows:Lie,dsvFormat:VS,tsvFormat:Gie,tsvFormatBody:zie,tsvFormatRow:Wie,tsvFormatRows:Vie,tsvFormatValue:Yie,tsvParse:Uie,tsvParseRows:WS},Symbol.toStringTag,{value:"Module"})),fy={},Zie=(e,t)=>fy[e]?Promise.resolve(fy[e]):t(e),Qie=e=>{if(e.length===0)return null;const t=WS(e);return gy(t)},Jie=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.text()).then(t=>Qie(t)).catch(t=>{console.error("Could not retrieve or parse chrom info.",t)}),eoe=(e,t,r)=>t(e,r).then(i=>(fy[e]=i,fy[e])),YS={get:e=>eoe(e,Zie,Jie)};function toe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b5(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,noe(i.key),i)}}function roe(e,t,r){return t&&b5(e.prototype,t),r&&b5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function noe(e){var t=ioe(e,"string");return typeof t=="symbol"?t:String(t)}function ioe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}let ooe=function(){function e(t){toe(this,e),this.customEventHandlers={},this.registeredEls={},this.pubSub=t}return roe(e,[{key:"getEventHandler",value:function(r){return this.customEventHandlers[r]?this.customEventHandlers[r]:i=>this.pubSub.publish(r,i)}},{key:"unregister",value:function(r,i){!this.registeredEls[r]&&this.registeredEls[r]!==i||(this.registeredEls[r].removeEventListener(r,this.registeredEls[r].__handler__),this.registeredEls[r]=void 0,delete this.registeredEls[r])}},{key:"register",value:function(r,i,n=!1){!i||this.registeredEls[r]===i||(this.registeredEls[r]&&this.unregister(this.registeredEls[r]),this.registeredEls[r]=i,this.registeredEls[r].__handler__=this.getEventHandler(r),this.registeredEls[r].addEventListener(r,this.registeredEls[r].__handler__,{capture:n,passive:!1}))}}]),e}();const _5=e=>new ooe(e);let T5=!1;const E5={listen:()=>{if(T5)return;const[e,t]=I5(),r="102117110099116105111110040041123115101108102046099111110115111108101046108111103040039",i="072",n="105",o="071",a="108097115115",s="032118",c="058032104116116112058047047104105103108097115115046105111039041125",u=[String.fromCharCode(...r.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...i.match(/.{1,3}/g).map(k=>+k)),String.fromCharCode(...n.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...o.match(/.{1,3}/g).map(k=>+k)),String.fromCharCode(...a.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...s.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...t.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...c.match(/.{1,3}/g).map(k=>+k)).toLowerCase()].join(""),l="085082076",h="066076079066",f="087111114107101114",d="099114101097116101079098106101099116085082076",p="114101118111107101079098106101099116085082076",m=k=>k.charAt(0).toUpperCase()+k.slice(1),g=k=>k.slice(0,6)+k.charAt(6).toUpperCase()+k.slice(7,12)+k.slice(12).toUpperCase(),v=e[String.fromCharCode(...l.match(/.{1,3}/g).map(k=>+k))],_=e[m(String.fromCharCode(...h.match(/.{1,3}/g).map(k=>+k)).toLowerCase())],y=e[m(String.fromCharCode(...f.match(/.{1,3}/g).map(k=>+k)).toLowerCase())],b=g(String.fromCharCode(...d.match(/.{1,3}/g).map(k=>+k)).toLowerCase()),T=g(String.fromCharCode(...p.match(/.{1,3}/g).map(k=>+k)).toLowerCase()),S=v[b](new _([`(${u})()`],{type:"application/javascript"}));new y(S),v[T](S),T5=!0}};function aoe(e,t,r,i,n,o,a){let s,c;if(n){const m=cw(n);s=m,c=(g,v)=>m(v.map(_=>e[_*t[1]+g]))??0}let u,l,h,f,d,p;for(h=0;h<t[1];h++)for(l=0,f=0;f<i.length;f++){if(p=i[f],s&&a==="server")u=e[f*t[1]+h];else if(Array.isArray(p)){if(!c)throw new Error("row aggregation requires 'aggFromDataFunc'");u=c(h,p)}else u=e[p*t[1]+h];if(o&&Array.isArray(p))for(d=0;d<p.length;d++)r(l*t[1]+h,u),l++;else r(l*t[1]+h,u),l++}}function soe(e,t,r,i,n,o,a=!1,s=!1,c=null,u=null,l=null){let h;r==="log"?h=gs().range([254,0]).domain(i):(r!=="linear"&&console.warn("Unknown value scale type:",r," Defaulting to linear"),h=Tt().range([254,0]).domain(i));const{selectedRows:f,selectedRowsAggregationMode:d="mean",selectedRowsAggregationWithRelativeHeight:p=!1,selectedRowsAggregationMethod:m="client"}=l??{};let g=e;c&&f&&(g=Kd(f,p)*c[1]);let v,_=0;const y=c?c[1]:Math.sqrt(e),b=new Uint8ClampedArray(g*4),T=O=>{const D=h(O);return Number.isNaN(D)?254:Math.max(0,Math.min(254,Math.floor(D)))},S=(O,D)=>{_=255,!(a&&Math.floor(O/y)<O%y)&&!(s&&Math.floor(O/y)>O%y)&&!Number.isNaN(+D)&&(_=T(D+n)),(_<0||_>255)&&console.warn("out of bounds rgbIdx:",_," (should be 0 <= rgbIdx <= 255)"),u&&!Number.isNaN(+D)&&+D==0?v=u:v=o[_],b[O*4]=v[0],b[O*4+1]=v[1],b[O*4+2]=v[2],b[O*4+3]=v[3]};let k;try{if(f&&c)aoe(t,c,S,f,d,p,m);else for(let O=0;O<t.length;O++)k=t[O],S(O,k)}catch(O){return console.warn("Odd datapoint"),console.warn("d:",k),k=k??0,console.warn("valueScale.domain():",h.domain()),console.warn("valueScale.range():",h.range()),console.warn("value:",h(k+n)),console.warn("pseudocount:",n),console.warn("rgbIdx:",_,"d:",k,"ct:",h(k)),console.error("ERROR:",O),b}return b}function loe(e){let t=e&31744,r,i,n;const o=(e&32768)<<16;switch(t){case 0:if(r=e&1023,r===0)return o;for(r<<=1;!(r&1024);)r<<=1,t++;return i=112-t<<23,n=(r&1023)<<13,o+i+n;case 31744:return o+2139095040+((e&1023)<<13);default:return o+((e&32767)+114688<<13)}}function coe(e){const t=atob(e),r=t.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer}function uoe(e){const t=new Uint32Array(e.length);for(let i=0;i<e.length;i++)t[i]=loe(e[i]);return new Float32Array(t.buffer)}function qS(e,t,r){const i=e??{};for(const n of r){n in i||(i[n]={});const o=n,a=o.split(".");i[o].server=t,i[o].tileId=o,i[o].zoomLevel=+a[1];const s=a.slice(2,a.length).map(c=>+c).filter(c=>!Number.isNaN(c));if(i[o].tilePos=s,i[o].tilesetUid=a[0],"dense"in i[o]){const c=i[o].dense,u=coe(c);let l;if(i[o].dtype==="float16"){const f=new Uint16Array(u);l=uoe(f)}else l=new Float32Array(u);const h=s.length===2?new lw(l):new _y(l);i[o].dense=l,i[o].denseDataExtrema=h,i[o].minNonZero=h.minNonZeroInTile,i[o].maxNonZero=h.maxNonZeroInTile}}return i}function foe(e,t,r,i,n,o){const a={"content-type":"application/json"};i&&(a.Authorization=i),fetch(e,{credentials:"same-origin",headers:a,...o&&Object.keys(o).length>0?{method:"POST",body:JSON.stringify(o)}:{}}).then(s=>s.json()).then(s=>{n(qS(s,t,r))}).catch(s=>console.warn("err:",s))}const S5=15,hy=xt.nice();let Vd=0,Mu=null;const hoe=(e,t,r)=>{let i,n=[],o={},a=0;const s=d=>{const p=o[d.id];p&&n[p]?n[p].ids=n[p].ids.concat(d.ids):(o[d.id]=n.length,n.push(d))},c=()=>{i=null,n=[],o={}},u=(d,...p)=>{e({sessionId:hy,requests:n},...p),c()},l=(d,...p)=>{const m=()=>{a>0&&(u(d,...p),a=0)};clearTimeout(i),i=setTimeout(m,r)};l.cancel=()=>{clearTimeout(i),c()},l.immediate=()=>{e({sessionId:hy,requests:n})};let h=!1;return(d,...p)=>{s(d),h?a++:(u(d,...p),l(d,...p),h=!0,a=0,setTimeout(()=>{h=!1},t))}},Wd=e=>{Mu=e},doe=()=>Mu;function poe(e,t){const r=e.requests,i=[],n={},o={};for(const s of r){n[s.server]||(n[s.server]={},o[s.server]=[]);for(const c of s.ids)if(n[s.server][c]=!0,s.options){const u=c.indexOf("."),l=c.substring(0,u),h=c.substring(u+1),f=o[s.server].find(d=>d.tilesetUid===l);f?f.tileIds.push(h):o[s.server].push({tilesetUid:l,tileIds:[h],options:s.options})}}const a=Object.keys(n);for(const s of a){const c=Object.keys(n[s]),u=o[s];for(let l=0;l<c.length;l+=S5){const h=c.slice(l,l+Math.min(c.length-l,S5)),f=h.map(m=>`d=${m}`).join("&"),d=`${s}/tiles/?${f}&s=${hy}`,p=new Promise((m,g)=>{t.publish("requestSent",d);const v={};v.outUrl=d,v.server=s,v.theseTileIds=h,v.authHeader=Mu,foe(v.outUrl,v.server,v.theseTileIds,v.authHeader,m,u),t.publish("requestReceived",d)});i.push(p)}}Promise.all(i).then(s=>{const c={};for(const u of s){const l=Object.keys(u);for(const h of l)c[`${u[h].server}/${h}`]=u[h]}for(const u of r){const l={},{server:h}=u;for(const f of u.ids)l[f]=c[`${h}/${f}`];u.done(l)}})}const moe=hoe(poe,NS,NS),goe=(e,t)=>{const r=e.map(s=>+s).sort((s,c)=>c-s),i=t.range()[1]-t.range()[0],o=r.map(s=>(t.domain()[1]-t.domain()[0])/s).map(s=>s/i),a=o.filter(s=>s<1);return a.length===0?0:o.indexOf(a[a.length-1])},voe=(e,t)=>{if(e.resolutions)return e.resolutions.map(s=>+s).sort((s,c)=>c-s)[t];const r=e.max_width,i=+e.bins_per_dimension;return r/(2**t*i)},yoe=(e,t,r,i)=>{const n=e.range()[1]-e.range()[0],o=Math.max((r-t)/(e.domain()[1]-e.domain()[0]),1),s=Math.max(0,Math.ceil(Math.log(n/384)/Math.LN2));let c=Math.round(Math.log(o)/Math.LN2)+s,u=0;return i&&(u=Math.floor(Math.log(256)/Math.log(2)-Math.log(i)/Math.log(2))),c+=u,c};function boe(e,t,r,i,n){let o=null;const a=e.bins_per_dimension||256;e.resolutions?o=e.resolutions[i]*a:o=t/2**i;const s=Math.floor((n-r)/o),c=Math.floor(a*(n-s*o)/o);return[s,c]}const _oe=(e,t,r,i,n,o)=>{const a=Math.min(e,n),s=o/2**a,c=1e-7;return zn(Math.max(0,Math.floor((t.domain()[0]-r)/s)),Math.min(2**a,Math.ceil((t.domain()[1]-r-c)/s)))},Toe=(e,t,r)=>e.resolutions?e.resolutions.map(n=>+n).sort((n,o)=>o-n)[t]*r:e.max_width/2**t,Eoe=(e,t,r,i,n)=>{const s=e*(n||256),c=20;i||(i=Number.MAX_VALUE);const u=Math.max(0,Math.floor((t.domain()[0]-r)/s)),l=Math.ceil(Math.min(i,t.domain()[1]-r-1e-7)/s);let h=zn(u,l);return h.length>c&&(console.warn(`Too many visible tiles: ${h.length} truncating to ${c}`),h=h.slice(0,c)),h},Soe=(e,t,r,i,n,o,a,s,c,u)=>{const{tileData:l}=e;if(!l.dense){o(null);return}if(e.mirrored&&!e.isMirrored&&e.tileData.tilePos.length>0&&e.tileData.tilePos[0]===e.tileData.tilePos[1]){e.tileData.dense=e.tileData.dense.slice();const f=Math.floor(Math.sqrt(e.tileData.dense.length));for(let d=0;d<f;d++)for(let p=d+1;p<f;p++)e.tileData.dense[d*f+p]=e.tileData.dense[p*f+d];if(s)for(let d=0;d<f;d++)for(let p=0;p<d;p++)e.tileData.dense[d*f+p]=NaN;e.isMirrored=!0}const h=soe(l.dense.length,l.dense,t,r,i,n,a,s,e.tileData.shape,c,u);o({pixData:h})};function w5(e,t,r,i){Vd+=1,i.publish("requestSent",e);let n=null;if(r==="text")n=null;else if(r==="json")n="application/json";else throw new Error(`fetch either "text" or "json", not "${r}"`);const o={};return n&&(o["Content-Type"]=n),Mu&&(o.Authorization=Mu),fetch(e,{credentials:"same-origin",headers:o}).then(a=>{if(!a.ok)throw Error(a.statusText);return a[r]()}).then(a=>(t(void 0,a),a)).catch(a=>(console.error(`Could not fetch ${e}`,a),t(a,void 0),a)).finally(()=>{i.publish("requestReceived",e),Vd-=1})}function woe(e,t,r){return w5(e,t,"text",r)}async function A5(e,t,r){return e.indexOf("hg19")>=0&&await iw(1),w5(e,t,"json",r)}const Ke={calculateResolution:voe,calculateTileAndPosInTile:boe,calculateTiles:_oe,calculateTilesFromResolution:Eoe,calculateTileWidth:Toe,calculateZoomLevel:yoe,calculateZoomLevelFromResolutions:goe,fetchTilesDebounced:moe,json:A5,text:woe,tileDataToPixData:Soe,trackInfo:(e,t,r,i,n)=>{const o=`${vy(e)}/tileset_info/?d=${t}&s=${hy}`;n.publish("requestSent",o),A5(o,(a,s)=>{n.publish("requestReceived",o),a?i?i(`Error retrieving tilesetInfo from: ${e}`):console.warn("Error retrieving: ",o):r(s)},n)}},Aoe=Object.freeze(Object.defineProperty({__proto__:null,ElementResizeListener:E5,get authHeader(){return Mu},chromInfo:YS,createDomEvent:_5,getTileProxyAuthHeader:doe,get requestsInFlight(){return Vd},setTileProxyAuthHeader:Wd,tileProxy:Ke,tileResponseToData:qS},Symbol.toStringTag,{value:"Module"})),O5=e=>(E5.listen(),[e.clientWidth,e.clientHeight]),Ci=(e,t)=>{let r=null;const i=n=>(n.uid===t&&(r=n),n.type.substr(0,8)==="combined"&&n.contents.forEach(i),null);return Object.keys(e).map(n=>e[n]).filter(n=>n.filter).reduce((n,o)=>n.concat(o),[]).forEach(i),r},Ooe=(e,t,r)=>{const n=e.state.views[t];if(!n)return null;let o=null;const a=c=>(c.uid===r&&(o=c),c.type.substr(0,8)==="combined"&&c.contents.forEach(a),null),s=n.tracks;return Object.keys(s).map(c=>s[c]).filter(c=>c.filter).reduce((c,u)=>c.concat(u),[]).forEach(a),o},Yd=(e,t,r)=>{const i=t?e[t]:Object.values(e)[0];if(!i){console.warn(t?`Could't find view with id "${t}"`:"No views available.");return}let n=i.trackRenderer.trackDefObjects[r];return n?n=n.trackObject:Object.values(i.trackRenderer.trackDefObjects).map(o=>o.trackObject).filter(o=>o.childTracks).forEach(o=>{o.createdTracks[r]&&(n=o.createdTracks[r])}),n};function dy(e){return e.type==="combined"}function koe(e){return"deltaY"in e&&"deltaMode"in e}function k5(e){return e!==null&&typeof e=="object"}function Ioe(e){return k5(e)&&"max_width"in e}function Coe(e){return k5(e)&&"resolutions"in e}const XS=(e,t,r=!0,i=null)=>e.forEach(n=>{r&&dy(n)&&XS(n.contents,t,r,i),t(n,i)}),La=(e,t,r=!0)=>{const i=[];for(const[n,o]of Object.entries(e))XS(o,t,r,n),i.push(...o);return i},qd=(e,t)=>{let r=null;return La(e,(i,n)=>{i.uid===t&&(r=n)}),r},KS=e=>t=>Array.prototype.map.call(t,e),I5=()=>[window,KS(e=>e.charCodeAt(0))("1.13.3").map(e=>e<=999?`00${e}`.slice(-3):e).join("")],C5=(e,t=1,r=100,i=0,n=0,o=0,a=100)=>{const s=document.createElement("canvas");s.width=t,s.height=r;const c=s.getContext("2d");if(!c)throw new Error("Could not get canvas context");const u=c.createLinearGradient(i,n,o,a);return e.forEach(l=>{u.addColorStop(l.from,l.color)}),c.fillStyle=u,c.fillRect(0,0,t,r),s},P5=(e,t)=>{let r=e;for(;r&&r!==t&&r.tagName!=="HTML";)r=r.parentNode;return r===t},D5=e=>parseInt(e.replace(/^#/,""),16),x5=()=>{};function Poe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N5(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,xoe(i.key),i)}}function Doe(e,t,r){return t&&N5(e.prototype,t),r&&N5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xoe(e){var t=Noe(e,"string");return typeof t=="symbol"?t:String(t)}function Noe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}let ZS=function(){function e(t){Poe(this,e),this.context=t;const{tracks:r,createTrackObject:i}=t;this.childTracks=r.map(i),this.createdTracks={},this.uid=xt.nice(),this.childTracks.forEach((n,o)=>{this.createdTracks[r[o].uid]=n});for(let n=0;n<this.childTracks.length;n++)this.childTracks[n]||console.error("Empty child track in CombinedTrack:",this)}return Doe(e,[{key:"updateContents",value:function(r,i){const n=[],o=new Set;r.forEach(c=>{if(o.add(c.uid),c.uid in this.createdTracks)n.push(this.createdTracks[c.uid]);else{const u=i(c);u.setPosition(this.position),u.setDimensions(this.dimensions),n.push(u),u.zoomed(this._xScale,this._yScale),this.createdTracks[c.uid]=u}}),this.childTracks=n;const a=new Set(Object.keys(this.createdTracks));return[...new Set([...a].filter(c=>!o.has(c)))].forEach(c=>{this.createdTracks[c].remove(),delete this.createdTracks[c]}),this}},{key:"setPosition",value:function(r){this.position=r;for(let i=0;i<this.childTracks.length;i++)this.childTracks[i].setPosition(r)}},{key:"setDimensions",value:function(r){this.dimensions=r;for(let i=0;i<this.childTracks.length;i++)this.childTracks[i].setDimensions(r)}},{key:"zoomed",value:function(r,i,n,o,a,s,c){this._xScale=r,this._yScale=i;for(let u=0;u<this.childTracks.length;u++)this.childTracks[u].zoomed(r,i,n,o,a,s,c)}},{key:"clickOutside",value:function(){for(let r=0;r<this.childTracks.length;r++)this.childTracks[r].clickOutside()}},{key:"click",value:function(...r){for(let i=0;i<this.childTracks.length;i++)this.childTracks[i].click(...r)}},{key:"draw",value:function(){}},{key:"refScalesChanged",value:function(r,i){for(let n=0;n<this.childTracks.length;n++)this.childTracks[n].refScalesChanged(r,i)}},{key:"remove",value:function(){for(let r=0;r<this.childTracks.length;r++)this.childTracks[r].remove()}},{key:"exportSVG",value:function(){const r=document.createElement("g");for(const i of this.childTracks)i.exportSVG&&r.appendChild(i.exportSVG()[0]);return[r,r]}},{key:"rerender",value:function(r){}},{key:"minValue",value:function(r){if(arguments.length===0){const i=this.childTracks.filter(n=>n.minValue).map(n=>n.minValue()).filter(n=>n);return Math.min(...i)}for(const i of this.childTracks)i.minValue&&i.minValue(r)}},{key:"maxValue",value:function(r){if(arguments.length===0){const i=this.childTracks.filter(n=>n.maxValue).map(n=>n.maxValue()).filter(n=>n);return Math.max(...i)}for(const i of this.childTracks)i.maxValue&&i.maxValue(r)}},{key:"respondsToPosition",value:function(r,i){return r>=this.position[0]&&r<=this.dimensions[0]+this.position[0]&&i>=this.position[1]&&i<=this.dimensions[1]+this.position[1]}},{key:"stopHover",value:function(){for(const r of this.childTracks)r.stopHover&&r.stopHover()}},{key:"getMouseOverHtml",value:function(r,i){let n="";for(const o of this.childTracks)if(o.getMouseOverHtml){const a=o.getMouseOverHtml(r,i);a&&a.length&&(n+=a,n+="<br/>")}return n}}]),e}();const R5=(e,t)=>t===e?!0:t instanceof ZS?Object.keys(t.createdTracks).map(r=>t.createdTracks[r]).some(r=>R5(e,r)):!1,QS=(e,t,r,i,n,o,a=!1)=>a?e>=r&&e<=i||t>=n&&t<=o:e>=r&&e<=i&&t>=n&&t<=o,Roe=e=>Math.log(Math.tan((e+Math.PI/2)/2)),Moe=(e,t)=>{let r=e*Math.PI/180;return r=Roe(r),2**t*(Math.PI-r)/(2*Math.PI)},py=e=>KS(t=>e[t])(Object.keys(e)),Loe=e=>py(e).map(t=>t.chromInfoPath).forEach(t=>YS.get(t)),Boe=(e,t)=>2**t*(e+180)/360,JS=(e,t)=>e>t?e:t,M5=1e-7;function ew(e){let t=Number.MIN_SAFE_INTEGER;for(let r=0;r<e.length;r++){const i=e[r];i<M5&&i>-M5||i>t&&(t=i)}return t}const L5=(e,t)=>e<t?e:t,B5=1e-7;function tw(e){let t=Number.MAX_SAFE_INTEGER;for(let r=0;r<e.length;r++){const i=e[r];i<B5&&i>-B5||i<t&&(t=i)}return t}const Hoe=(e,t)=>(e%t+t)%t,H5=(e,t)=>{const r=+t;if(!Number.isNaN(r))if(e.dimension===1)for(let n=0;n<e.shape[0];++n)e.set(n,r);else for(let n=0;n<e.shape[0];++n)for(let o=0;o<e.shape[1];++o)e.set(n,o,r);else{const n=e.shape[0],o=e.shape[1],a=t.shape[0],s=t.shape[1];if(n!==a||o!==s){console.warn("Cannot assign source to target ndarray as the dimensions do not match",n,a,o,s);return}if(e.dimension===1)for(let c=0;c<e.shape[0];++c)e.set(c,t.get(c));else for(let c=0;c<e.shape[0];++c)for(let u=0;u<e.shape[1];++u)e.set(c,u,t.get(c,u))}};function Foe(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=r;return t}var $oe=Foe;/*!
|
|
184
|
+
`)}function u(h){return h.map(l).join(e)}function l(h){return h==null?"":h instanceof Date?Rie(h):t.test(h+="")?'"'+h.replace(/"/g,'""')+'"':h}return{parse:i,parseRows:n,format:a,formatBody:s,formatRows:c,formatRow:u,formatValue:l}}var Wl=VS(","),Mie=Wl.parse,Lie=Wl.parseRows,Bie=Wl.format,Hie=Wl.formatBody,Fie=Wl.formatRows,$ie=Wl.formatRow,jie=Wl.formatValue,Yl=VS(" "),Uie=Yl.parse,WS=Yl.parseRows,Gie=Yl.format,zie=Yl.formatBody,Vie=Yl.formatRows,Wie=Yl.formatRow,Yie=Yl.formatValue;function qie(e){for(var t in e){var r=e[t].trim(),i,n;if(!r)r=null;else if(r==="true")r=!0;else if(r==="false")r=!1;else if(r==="NaN")r=NaN;else if(!isNaN(i=+r))r=i;else if(n=r.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/))Xie&&n[4]&&!n[7]&&(r=r.replace(/-/g,"/").replace(/T/," ")),r=new Date(r);else continue;e[t]=r}return e}const Xie=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),Kie=Object.freeze(Object.defineProperty({__proto__:null,autoType:qie,csvFormat:Bie,csvFormatBody:Hie,csvFormatRow:$ie,csvFormatRows:Fie,csvFormatValue:jie,csvParse:Mie,csvParseRows:Lie,dsvFormat:VS,tsvFormat:Gie,tsvFormatBody:zie,tsvFormatRow:Wie,tsvFormatRows:Vie,tsvFormatValue:Yie,tsvParse:Uie,tsvParseRows:WS},Symbol.toStringTag,{value:"Module"})),fy={},Zie=(e,t)=>fy[e]?Promise.resolve(fy[e]):t(e),Qie=e=>{if(e.length===0)return null;const t=WS(e);return gy(t)},Jie=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.text()).then(t=>Qie(t)).catch(t=>{console.error("Could not retrieve or parse chrom info.",t)}),eoe=(e,t,r)=>t(e,r).then(i=>(fy[e]=i,fy[e])),YS={get:e=>eoe(e,Zie,Jie)};function toe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b5(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,noe(i.key),i)}}function roe(e,t,r){return t&&b5(e.prototype,t),r&&b5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function noe(e){var t=ioe(e,"string");return typeof t=="symbol"?t:String(t)}function ioe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}let ooe=function(){function e(t){toe(this,e),this.customEventHandlers={},this.registeredEls={},this.pubSub=t}return roe(e,[{key:"getEventHandler",value:function(r){return this.customEventHandlers[r]?this.customEventHandlers[r]:i=>this.pubSub.publish(r,i)}},{key:"unregister",value:function(r,i){!this.registeredEls[r]&&this.registeredEls[r]!==i||(this.registeredEls[r].removeEventListener(r,this.registeredEls[r].__handler__),this.registeredEls[r]=void 0,delete this.registeredEls[r])}},{key:"register",value:function(r,i,n=!1){!i||this.registeredEls[r]===i||(this.registeredEls[r]&&this.unregister(this.registeredEls[r]),this.registeredEls[r]=i,this.registeredEls[r].__handler__=this.getEventHandler(r),this.registeredEls[r].addEventListener(r,this.registeredEls[r].__handler__,{capture:n,passive:!1}))}}]),e}();const _5=e=>new ooe(e);let T5=!1;const E5={listen:()=>{if(T5)return;const[e,t]=I5(),r="102117110099116105111110040041123115101108102046099111110115111108101046108111103040039",i="072",n="105",o="071",a="108097115115",s="032118",c="058032104116116112058047047104105103108097115115046105111039041125",u=[String.fromCharCode(...r.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...i.match(/.{1,3}/g).map(k=>+k)),String.fromCharCode(...n.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...o.match(/.{1,3}/g).map(k=>+k)),String.fromCharCode(...a.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...s.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...t.match(/.{1,3}/g).map(k=>+k)).toLowerCase(),String.fromCharCode(...c.match(/.{1,3}/g).map(k=>+k)).toLowerCase()].join(""),l="085082076",h="066076079066",f="087111114107101114",d="099114101097116101079098106101099116085082076",p="114101118111107101079098106101099116085082076",m=k=>k.charAt(0).toUpperCase()+k.slice(1),g=k=>k.slice(0,6)+k.charAt(6).toUpperCase()+k.slice(7,12)+k.slice(12).toUpperCase(),v=e[String.fromCharCode(...l.match(/.{1,3}/g).map(k=>+k))],_=e[m(String.fromCharCode(...h.match(/.{1,3}/g).map(k=>+k)).toLowerCase())],y=e[m(String.fromCharCode(...f.match(/.{1,3}/g).map(k=>+k)).toLowerCase())],b=g(String.fromCharCode(...d.match(/.{1,3}/g).map(k=>+k)).toLowerCase()),T=g(String.fromCharCode(...p.match(/.{1,3}/g).map(k=>+k)).toLowerCase()),S=v[b](new _([`(${u})()`],{type:"application/javascript"}));new y(S),v[T](S),T5=!0}};function aoe(e,t,r,i,n,o,a){let s,c;if(n){const m=cw(n);s=m,c=(g,v)=>m(v.map(_=>e[_*t[1]+g]))??0}let u,l,h,f,d,p;for(h=0;h<t[1];h++)for(l=0,f=0;f<i.length;f++){if(p=i[f],s&&a==="server")u=e[f*t[1]+h];else if(Array.isArray(p)){if(!c)throw new Error("row aggregation requires 'aggFromDataFunc'");u=c(h,p)}else u=e[p*t[1]+h];if(o&&Array.isArray(p))for(d=0;d<p.length;d++)r(l*t[1]+h,u),l++;else r(l*t[1]+h,u),l++}}function soe(e,t,r,i,n,o,a=!1,s=!1,c=null,u=null,l=null){let h;r==="log"?h=gs().range([254,0]).domain(i):(r!=="linear"&&console.warn("Unknown value scale type:",r," Defaulting to linear"),h=Tt().range([254,0]).domain(i));const{selectedRows:f,selectedRowsAggregationMode:d="mean",selectedRowsAggregationWithRelativeHeight:p=!1,selectedRowsAggregationMethod:m="client"}=l??{};let g=e;c&&f&&(g=Kd(f,p)*c[1]);let v,_=0;const y=c?c[1]:Math.sqrt(e),b=new Uint8ClampedArray(g*4),T=O=>{const D=h(O);return Number.isNaN(D)?254:Math.max(0,Math.min(254,Math.floor(D)))},S=(O,D)=>{_=255,!(a&&Math.floor(O/y)<O%y)&&!(s&&Math.floor(O/y)>O%y)&&!Number.isNaN(+D)&&(_=T(D+n)),(_<0||_>255)&&console.warn("out of bounds rgbIdx:",_," (should be 0 <= rgbIdx <= 255)"),u&&!Number.isNaN(+D)&&+D==0?v=u:v=o[_],b[O*4]=v[0],b[O*4+1]=v[1],b[O*4+2]=v[2],b[O*4+3]=v[3]};let k;try{if(f&&c)aoe(t,c,S,f,d,p,m);else for(let O=0;O<t.length;O++)k=t[O],S(O,k)}catch(O){return console.warn("Odd datapoint"),console.warn("d:",k),k=k??0,console.warn("valueScale.domain():",h.domain()),console.warn("valueScale.range():",h.range()),console.warn("value:",h(k+n)),console.warn("pseudocount:",n),console.warn("rgbIdx:",_,"d:",k,"ct:",h(k)),console.error("ERROR:",O),b}return b}function loe(e){let t=e&31744,r,i,n;const o=(e&32768)<<16;switch(t){case 0:if(r=e&1023,r===0)return o;for(r<<=1;!(r&1024);)r<<=1,t++;return i=112-t<<23,n=(r&1023)<<13,o+i+n;case 31744:return o+2139095040+((e&1023)<<13);default:return o+((e&32767)+114688<<13)}}function coe(e){const t=atob(e),r=t.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer}function uoe(e){const t=new Uint32Array(e.length);for(let i=0;i<e.length;i++)t[i]=loe(e[i]);return new Float32Array(t.buffer)}function qS(e,t,r){const i=e??{};for(const n of r){n in i||(i[n]={});const o=n,a=o.split(".");i[o].server=t,i[o].tileId=o,i[o].zoomLevel=+a[1];const s=a.slice(2,a.length).map(c=>+c).filter(c=>!Number.isNaN(c));if(i[o].tilePos=s,i[o].tilesetUid=a[0],"dense"in i[o]){const c=i[o].dense,u=coe(c);let l;if(i[o].dtype==="float16"){const f=new Uint16Array(u);l=uoe(f)}else l=new Float32Array(u);const h=s.length===2?new lw(l):new _y(l);i[o].dense=l,i[o].denseDataExtrema=h,i[o].minNonZero=h.minNonZeroInTile,i[o].maxNonZero=h.maxNonZeroInTile}}return i}function foe(e,t,r,i,n,o){const a={"content-type":"application/json"};i&&(a.Authorization=i),fetch(e,{credentials:"same-origin",headers:a,...o&&Object.keys(o).length>0?{method:"POST",body:JSON.stringify(o)}:{}}).then(s=>s.json()).then(s=>{n(qS(s,t,r))}).catch(s=>console.warn("err:",s))}const S5=15,hy=xt.nice();let Vd=0,Mu=null;const hoe=(e,t,r)=>{let i,n=[],o={},a=0;const s=d=>{const p=o[d.id];p&&n[p]?n[p].ids=n[p].ids.concat(d.ids):(o[d.id]=n.length,n.push(d))},c=()=>{i=null,n=[],o={}},u=(d,...p)=>{e({sessionId:hy,requests:n},...p),c()},l=(d,...p)=>{const m=()=>{a>0&&(u(d,...p),a=0)};clearTimeout(i),i=setTimeout(m,r)};l.cancel=()=>{clearTimeout(i),c()},l.immediate=()=>{e({sessionId:hy,requests:n})};let h=!1;return(d,...p)=>{s(d),h?a++:(u(d,...p),l(d,...p),h=!0,a=0,setTimeout(()=>{h=!1},t))}},Wd=e=>{Mu=e},doe=()=>Mu;function poe(e,t){const r=e.requests,i=[],n={},o={};for(const s of r){n[s.server]||(n[s.server]={},o[s.server]=[]);for(const c of s.ids)if(n[s.server][c]=!0,s.options){const u=c.indexOf("."),l=c.substring(0,u),h=c.substring(u+1),f=o[s.server].find(d=>d.tilesetUid===l);f?f.tileIds.push(h):o[s.server].push({tilesetUid:l,tileIds:[h],options:s.options})}}const a=Object.keys(n);for(const s of a){const c=Object.keys(n[s]),u=o[s];for(let l=0;l<c.length;l+=S5){const h=c.slice(l,l+Math.min(c.length-l,S5)),f=h.map(m=>`d=${m}`).join("&"),d=`${s}/tiles/?${f}&s=${hy}`,p=new Promise((m,g)=>{t.publish("requestSent",d);const v={};v.outUrl=d,v.server=s,v.theseTileIds=h,v.authHeader=Mu,foe(v.outUrl,v.server,v.theseTileIds,v.authHeader,m,u),t.publish("requestReceived",d)});i.push(p)}}Promise.all(i).then(s=>{const c={};for(const u of s){const l=Object.keys(u);for(const h of l)c[`${u[h].server}/${h}`]=u[h]}for(const u of r){const l={},{server:h}=u;for(const f of u.ids)l[f]=c[`${h}/${f}`];u.done(l)}})}const moe=hoe(poe,NS,NS),goe=(e,t)=>{const r=e.map(s=>+s).sort((s,c)=>c-s),i=t.range()[1]-t.range()[0],o=r.map(s=>(t.domain()[1]-t.domain()[0])/s).map(s=>s/i),a=o.filter(s=>s<1);return a.length===0?0:o.indexOf(a[a.length-1])},voe=(e,t)=>{if(e.resolutions)return e.resolutions.map(s=>+s).sort((s,c)=>c-s)[t];const r=e.max_width,i=+e.bins_per_dimension;return r/(2**t*i)},yoe=(e,t,r,i)=>{const n=e.range()[1]-e.range()[0],o=Math.max((r-t)/(e.domain()[1]-e.domain()[0]),1),s=Math.max(0,Math.ceil(Math.log(n/384)/Math.LN2));let c=Math.round(Math.log(o)/Math.LN2)+s,u=0;return i&&(u=Math.floor(Math.log(256)/Math.log(2)-Math.log(i)/Math.log(2))),c+=u,c};function boe(e,t,r,i,n){let o=null;const a=e.bins_per_dimension||256;e.resolutions?o=e.resolutions[i]*a:o=t/2**i;const s=Math.floor((n-r)/o),c=Math.floor(a*(n-s*o)/o);return[s,c]}const _oe=(e,t,r,i,n,o)=>{const a=Math.min(e,n),s=o/2**a,c=1e-7;return zn(Math.max(0,Math.floor((t.domain()[0]-r)/s)),Math.min(2**a,Math.ceil((t.domain()[1]-r-c)/s)))},Toe=(e,t,r)=>e.resolutions?e.resolutions.map(n=>+n).sort((n,o)=>o-n)[t]*r:e.max_width/2**t,Eoe=(e,t,r,i,n)=>{const s=e*(n||256),c=20;i||(i=Number.MAX_VALUE);const u=Math.max(0,Math.floor((t.domain()[0]-r)/s)),l=Math.ceil(Math.min(i,t.domain()[1]-r-1e-7)/s);let h=zn(u,l);return h.length>c&&(console.warn(`Too many visible tiles: ${h.length} truncating to ${c}`),h=h.slice(0,c)),h},Soe=(e,t,r,i,n,o,a,s,c,u)=>{const{tileData:l}=e;if(!l.dense){o(null);return}if(e.mirrored&&!e.isMirrored&&e.tileData.tilePos.length>0&&e.tileData.tilePos[0]===e.tileData.tilePos[1]){e.tileData.dense=e.tileData.dense.slice();const f=Math.floor(Math.sqrt(e.tileData.dense.length));for(let d=0;d<f;d++)for(let p=d+1;p<f;p++)e.tileData.dense[d*f+p]=e.tileData.dense[p*f+d];if(s)for(let d=0;d<f;d++)for(let p=0;p<d;p++)e.tileData.dense[d*f+p]=NaN;e.isMirrored=!0}const h=soe(l.dense.length,l.dense,t,r,i,n,a,s,e.tileData.shape,c,u);o({pixData:h})};function w5(e,t,r,i){Vd+=1,i.publish("requestSent",e);let n=null;if(r==="text")n=null;else if(r==="json")n="application/json";else throw new Error(`fetch either "text" or "json", not "${r}"`);const o={};return n&&(o["Content-Type"]=n),Mu&&(o.Authorization=Mu),fetch(e,{credentials:"same-origin",headers:o}).then(a=>{if(!a.ok)throw Error(a.statusText);return a[r]()}).then(a=>(t(void 0,a),a)).catch(a=>(console.error(`Could not fetch ${e}`,a),t(a,void 0),a)).finally(()=>{i.publish("requestReceived",e),Vd-=1})}function woe(e,t,r){return w5(e,t,"text",r)}async function A5(e,t,r){return e.indexOf("hg19")>=0&&await iw(1),w5(e,t,"json",r)}const Ke={calculateResolution:voe,calculateTileAndPosInTile:boe,calculateTiles:_oe,calculateTilesFromResolution:Eoe,calculateTileWidth:Toe,calculateZoomLevel:yoe,calculateZoomLevelFromResolutions:goe,fetchTilesDebounced:moe,json:A5,text:woe,tileDataToPixData:Soe,trackInfo:(e,t,r,i,n)=>{const o=`${vy(e)}/tileset_info/?d=${t}&s=${hy}`;n.publish("requestSent",o),A5(o,(a,s)=>{n.publish("requestReceived",o),a?i?i(`Error retrieving tilesetInfo from: ${e}`):console.warn("Error retrieving: ",o):r(s)},n)}},Aoe=Object.freeze(Object.defineProperty({__proto__:null,ElementResizeListener:E5,get authHeader(){return Mu},chromInfo:YS,createDomEvent:_5,getTileProxyAuthHeader:doe,get requestsInFlight(){return Vd},setTileProxyAuthHeader:Wd,tileProxy:Ke,tileResponseToData:qS},Symbol.toStringTag,{value:"Module"})),O5=e=>(E5.listen(),[e.clientWidth,e.clientHeight]),Ci=(e,t)=>{let r=null;const i=n=>(n.uid===t&&(r=n),n.type.substr(0,8)==="combined"&&n.contents.forEach(i),null);return Object.keys(e).map(n=>e[n]).filter(n=>n.filter).reduce((n,o)=>n.concat(o),[]).forEach(i),r},Ooe=(e,t,r)=>{const n=e.state.views[t];if(!n)return null;let o=null;const a=c=>(c.uid===r&&(o=c),c.type.substr(0,8)==="combined"&&c.contents.forEach(a),null),s=n.tracks;return Object.keys(s).map(c=>s[c]).filter(c=>c.filter).reduce((c,u)=>c.concat(u),[]).forEach(a),o},Yd=(e,t,r)=>{const i=t?e[t]:Object.values(e)[0];if(!i){console.warn(t?`Could't find view with id "${t}"`:"No views available.");return}let n=i.trackRenderer.trackDefObjects[r];return n?n=n.trackObject:Object.values(i.trackRenderer.trackDefObjects).map(o=>o.trackObject).filter(o=>o.childTracks).forEach(o=>{o.createdTracks[r]&&(n=o.createdTracks[r])}),n};function dy(e){return e.type==="combined"}function koe(e){return"deltaY"in e&&"deltaMode"in e}function k5(e){return e!==null&&typeof e=="object"}function Ioe(e){return k5(e)&&"max_width"in e}function Coe(e){return k5(e)&&"resolutions"in e}const XS=(e,t,r=!0,i=null)=>e.forEach(n=>{r&&dy(n)&&XS(n.contents,t,r,i),t(n,i)}),La=(e,t,r=!0)=>{const i=[];for(const[n,o]of Object.entries(e))XS(o,t,r,n),i.push(...o);return i},qd=(e,t)=>{let r=null;return La(e,(i,n)=>{i.uid===t&&(r=n)}),r},KS=e=>t=>Array.prototype.map.call(t,e),I5=()=>[window,KS(e=>e.charCodeAt(0))("1.13.4").map(e=>e<=999?`00${e}`.slice(-3):e).join("")],C5=(e,t=1,r=100,i=0,n=0,o=0,a=100)=>{const s=document.createElement("canvas");s.width=t,s.height=r;const c=s.getContext("2d");if(!c)throw new Error("Could not get canvas context");const u=c.createLinearGradient(i,n,o,a);return e.forEach(l=>{u.addColorStop(l.from,l.color)}),c.fillStyle=u,c.fillRect(0,0,t,r),s},P5=(e,t)=>{let r=e;for(;r&&r!==t&&r.tagName!=="HTML";)r=r.parentNode;return r===t},D5=e=>parseInt(e.replace(/^#/,""),16),x5=()=>{};function Poe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N5(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,xoe(i.key),i)}}function Doe(e,t,r){return t&&N5(e.prototype,t),r&&N5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xoe(e){var t=Noe(e,"string");return typeof t=="symbol"?t:String(t)}function Noe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}let ZS=function(){function e(t){Poe(this,e),this.context=t;const{tracks:r,createTrackObject:i}=t;this.childTracks=r.map(i),this.createdTracks={},this.uid=xt.nice(),this.childTracks.forEach((n,o)=>{this.createdTracks[r[o].uid]=n});for(let n=0;n<this.childTracks.length;n++)this.childTracks[n]||console.error("Empty child track in CombinedTrack:",this)}return Doe(e,[{key:"updateContents",value:function(r,i){const n=[],o=new Set;r.forEach(c=>{if(o.add(c.uid),c.uid in this.createdTracks)n.push(this.createdTracks[c.uid]);else{const u=i(c);u.setPosition(this.position),u.setDimensions(this.dimensions),n.push(u),u.zoomed(this._xScale,this._yScale),this.createdTracks[c.uid]=u}}),this.childTracks=n;const a=new Set(Object.keys(this.createdTracks));return[...new Set([...a].filter(c=>!o.has(c)))].forEach(c=>{this.createdTracks[c].remove(),delete this.createdTracks[c]}),this}},{key:"setPosition",value:function(r){this.position=r;for(let i=0;i<this.childTracks.length;i++)this.childTracks[i].setPosition(r)}},{key:"setDimensions",value:function(r){this.dimensions=r;for(let i=0;i<this.childTracks.length;i++)this.childTracks[i].setDimensions(r)}},{key:"zoomed",value:function(r,i,n,o,a,s,c){this._xScale=r,this._yScale=i;for(let u=0;u<this.childTracks.length;u++)this.childTracks[u].zoomed(r,i,n,o,a,s,c)}},{key:"clickOutside",value:function(){for(let r=0;r<this.childTracks.length;r++)this.childTracks[r].clickOutside()}},{key:"click",value:function(...r){for(let i=0;i<this.childTracks.length;i++)this.childTracks[i].click(...r)}},{key:"draw",value:function(){}},{key:"refScalesChanged",value:function(r,i){for(let n=0;n<this.childTracks.length;n++)this.childTracks[n].refScalesChanged(r,i)}},{key:"remove",value:function(){for(let r=0;r<this.childTracks.length;r++)this.childTracks[r].remove()}},{key:"exportSVG",value:function(){const r=document.createElement("g");for(const i of this.childTracks)i.exportSVG&&r.appendChild(i.exportSVG()[0]);return[r,r]}},{key:"rerender",value:function(r){}},{key:"minValue",value:function(r){if(arguments.length===0){const i=this.childTracks.filter(n=>n.minValue).map(n=>n.minValue()).filter(n=>n);return Math.min(...i)}for(const i of this.childTracks)i.minValue&&i.minValue(r)}},{key:"maxValue",value:function(r){if(arguments.length===0){const i=this.childTracks.filter(n=>n.maxValue).map(n=>n.maxValue()).filter(n=>n);return Math.max(...i)}for(const i of this.childTracks)i.maxValue&&i.maxValue(r)}},{key:"respondsToPosition",value:function(r,i){return r>=this.position[0]&&r<=this.dimensions[0]+this.position[0]&&i>=this.position[1]&&i<=this.dimensions[1]+this.position[1]}},{key:"stopHover",value:function(){for(const r of this.childTracks)r.stopHover&&r.stopHover()}},{key:"getMouseOverHtml",value:function(r,i){let n="";for(const o of this.childTracks)if(o.getMouseOverHtml){const a=o.getMouseOverHtml(r,i);a&&a.length&&(n+=a,n+="<br/>")}return n}}]),e}();const R5=(e,t)=>t===e?!0:t instanceof ZS?Object.keys(t.createdTracks).map(r=>t.createdTracks[r]).some(r=>R5(e,r)):!1,QS=(e,t,r,i,n,o,a=!1)=>a?e>=r&&e<=i||t>=n&&t<=o:e>=r&&e<=i&&t>=n&&t<=o,Roe=e=>Math.log(Math.tan((e+Math.PI/2)/2)),Moe=(e,t)=>{let r=e*Math.PI/180;return r=Roe(r),2**t*(Math.PI-r)/(2*Math.PI)},py=e=>KS(t=>e[t])(Object.keys(e)),Loe=e=>py(e).map(t=>t.chromInfoPath).forEach(t=>YS.get(t)),Boe=(e,t)=>2**t*(e+180)/360,JS=(e,t)=>e>t?e:t,M5=1e-7;function ew(e){let t=Number.MIN_SAFE_INTEGER;for(let r=0;r<e.length;r++){const i=e[r];i<M5&&i>-M5||i>t&&(t=i)}return t}const L5=(e,t)=>e<t?e:t,B5=1e-7;function tw(e){let t=Number.MAX_SAFE_INTEGER;for(let r=0;r<e.length;r++){const i=e[r];i<B5&&i>-B5||i<t&&(t=i)}return t}const Hoe=(e,t)=>(e%t+t)%t,H5=(e,t)=>{const r=+t;if(!Number.isNaN(r))if(e.dimension===1)for(let n=0;n<e.shape[0];++n)e.set(n,r);else for(let n=0;n<e.shape[0];++n)for(let o=0;o<e.shape[1];++o)e.set(n,o,r);else{const n=e.shape[0],o=e.shape[1],a=t.shape[0],s=t.shape[1];if(n!==a||o!==s){console.warn("Cannot assign source to target ndarray as the dimensions do not match",n,a,o,s);return}if(e.dimension===1)for(let c=0;c<e.shape[0];++c)e.set(c,t.get(c));else for(let c=0;c<e.shape[0];++c)for(let u=0;u<e.shape[1];++u)e.set(c,u,t.get(c,u))}};function Foe(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=r;return t}var $oe=Foe;/*!
|
|
185
185
|
* Determine if an object is a Buffer
|
|
186
186
|
*
|
|
187
187
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -287,7 +287,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
287
287
|
\r]`),r=e.charCodeAt(0);function i(h,f){var d,p,m=n(h,function(g,v){if(d)return d(g,v-1);p=g,d=f?q5e(g,f):N3(g)});return m.columns=p||[],m}function n(h,f){var d=[],p=h.length,m=0,g=0,v,_=p<=0,y=!1;h.charCodeAt(p-1)===ig&&--p,h.charCodeAt(p-1)===vP&&--p;function b(){if(_)return mP;if(y)return y=!1,x3;var S,k=m,O;if(h.charCodeAt(k)===gP){for(;m++<p&&h.charCodeAt(m)!==gP||h.charCodeAt(++m)===gP;);return(S=m)>=p?_=!0:(O=h.charCodeAt(m++))===ig?y=!0:O===vP&&(y=!0,h.charCodeAt(m)===ig&&++m),h.slice(k+1,S-1).replace(/""/g,'"')}for(;m<p;){if((O=h.charCodeAt(S=m++))===ig)y=!0;else if(O===vP)y=!0,h.charCodeAt(m)===ig&&++m;else if(O!==r)continue;return h.slice(k,S)}return _=!0,h.slice(k,p)}for(;(v=b())!==mP;){for(var T=[];v!==x3&&v!==mP;)T.push(v),v=b();f&&(T=f(T,g++))==null||d.push(T)}return d}function o(h,f){return h.map(function(d){return f.map(function(p){return l(d[p])}).join(e)})}function a(h,f){return f==null&&(f=R3(h)),[f.map(l).join(e)].concat(o(h,f)).join(`
|
|
288
288
|
`)}function s(h,f){return f==null&&(f=R3(h)),o(h,f).join(`
|
|
289
289
|
`)}function c(h){return h.map(u).join(`
|
|
290
|
-
`)}function u(h){return h.map(l).join(e)}function l(h){return h==null?"":h instanceof Date?K5e(h):t.test(h+="")?'"'+h.replace(/"/g,'""')+'"':h}return{parse:i,parseRows:n,format:a,formatBody:s,formatRows:c,formatRow:u,formatValue:l}}var Z5e=M3(","),Q5e=Z5e.parse,J5e=M3(" "),eBe=J5e.parse;function L3(e,t){return function(r,i,n){arguments.length<3&&(n=i,i=null);var o=pP(r).mimeType(e);return o.row=function(a){return arguments.length?o.response(tBe(t,i=a)):i},o.row(i),n?o.get(n):o}}function tBe(e,t){return function(r){return e(r.responseText,t)}}const rBe=L3("text/csv",Q5e),nBe=L3("text/tab-separated-values",eBe),iBe=Object.freeze(Object.defineProperty({__proto__:null,csv:rBe,html:z5e,json:V5e,request:pP,text:W5e,tsv:nBe,xml:Y5e},Symbol.toStringTag,{value:"Module"}));function yP(){return yP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},yP.apply(this,arguments)}function oBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,sBe(i.key),i)}}function aBe(e,t,r){return t&&B3(e.prototype,t),r&&B3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sBe(e){var t=lBe(e,"string");return typeof t=="symbol"?t:String(t)}function lBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bP(e,t)}function bP(e,t){return bP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},bP(e,t)}function uBe(e){var t=dBe();return function(){var i=$0(e),n;if(t){var o=$0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return fBe(this,n)}}function fBe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hBe(e)}function hBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $0(e){return $0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$0(e)}let j0=function(e){cBe(r,e);var t=uBe(r);function r({items:i}){var n;return oBe(this,r),n=t.call(this),n.state={items:i,isSorting:!1},n}return aBe(r,[{key:"UNSAFE_componentWillReceiveProps",value:function(n){this.setState({items:n.items})}},{key:"onSortStart",value:function({node:n,index:o,collection:a},s){s.stopImmediatePropagation();const{onSortStart:c}=this.props;this.setState({isSorting:!0}),c&&c(this.ref),this.sortingIndex=o,this.sortStartTop=s.offsetTop,this.sortStartLeft=s.offsetLeft}},{key:"onSortMove",value:function(){}},{key:"onSortEnd",value:function({oldIndex:n,newIndex:o}){const{onSortEnd:a}=this.props,{items:s}=this.state;this.setState({items:Une(s,n,o),isSorting:!1}),a&&a(this.state.items),this.sortingIndex=null}},{key:"render",value:function(){const n=this.props.component,{items:o,isSorting:a}=this.state,s={isSorting:a,items:o,onSortEnd:this.onSortEnd.bind(this),onSortStart:this.onSortStart.bind(this),onSortMove:this.onSortMove.bind(this)};return E.createElement(n,yP({},this.props,s,{ref:c=>{this.ref=c}}))}}]),r}(E.Component);j0.propTypes={axis:N.string,className:N.string,component:N.func,editable:N.bool,handleConfigTrack:N.func,handleResizeTrack:N.func,height:N.number,helperClass:N.string,itemClass:N.string,itemControlAlignLeft:N.bool,itemReactClass:N.func,items:N.array,onAddSeries:N.func,onCloseTrack:N.func,onCloseTrackMenuOpened:N.func,onConfigTrackMenuOpened:N.func,onSortEnd:N.func,onSortStart:N.func,referenceAncestor:N.string,resizeHandles:N.object,useDragHandle:N.bool,width:N.number},j0.defaultProps={className:"list stylizedList",itemClass:"item stylizedItem",width:400,height:600};const _P={"top-right-handle":"_top-right-handle_cizw2_1","bottom-right-handle":"_bottom-right-handle_cizw2_2","top-left-handle":"_top-left-handle_cizw2_7","bottom-left-handle":"_bottom-left-handle_cizw2_8","top-draggable-handle":"_top-draggable-handle_cizw2_13","bottom-draggable-handle":"_bottom-draggable-handle_cizw2_14","left-draggable-handle":"_left-draggable-handle_cizw2_15","right-draggable-handle":"_right-draggable-handle_cizw2_16","draggable-div":"_draggable-div_cizw2_22","top-draggable-handle-grabber":"_top-draggable-handle-grabber_cizw2_27","bottom-draggable-handle-grabber":"_bottom-draggable-handle-grabber_cizw2_28","left-draggable-handle-grabber":"_left-draggable-handle-grabber_cizw2_43","right-draggable-handle-grabber":"_right-draggable-handle-grabber_cizw2_44"};function pBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,gBe(i.key),i)}}function mBe(e,t,r){return t&&H3(e.prototype,t),r&&H3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function gBe(e){var t=vBe(e,"string");return typeof t=="symbol"?t:String(t)}function vBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TP(e,t)}function TP(e,t){return TP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},TP(e,t)}function bBe(e){var t=TBe();return function(){var i=U0(e),n;if(t){var o=U0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return _Be(this,n)}}function _Be(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sn(e)}function Sn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function U0(e){return U0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},U0(e)}let F3=function(e){yBe(r,e);var t=bBe(r);function r(i){var n;return pBe(this,r),n=t.call(this,i),n.dragTopRight=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragTopRightFunc.bind(Sn(n))),n.dragTopLeft=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragTopLeftFunc.bind(Sn(n))),n.dragBottomRight=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragBottomRightFunc.bind(Sn(n))),n.dragBottomLeft=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragBottomLeftFunc.bind(Sn(n))),n.dragBottom=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragBottomFunc.bind(Sn(n))),n.dragTop=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragTopFunc.bind(Sn(n))),n.dragLeft=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragLeftFunc.bind(Sn(n))),n.dragRight=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragRightFunc.bind(Sn(n))),n.minWidth=10,n.minHeight=10,n.bottomHandleWidth=20,n.state={uid:n.props.uid,width:n.props.width,height:n.props.height,top:n.props.top,left:n.props.left},n.domBody=Bt("body").node(),n}return mBe(r,[{key:"componentDidMount",value:function(){Bt(this.bottomHandle).call(this.dragBottom),Bt(this.topHandle).call(this.dragTop),Bt(this.leftHandle).call(this.dragLeft),Bt(this.rightHandle).call(this.dragRight)}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){"width"in n&&this.setState({width:n.width}),"height"in n&&this.setState({height:n.height})}},{key:"dragBottomFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartHeight+(o[1]-this.dragStartMousePos[1]);a=a>this.minHeight?a:this.minHeight,this.setState({height:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragLeftFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartWidth-(o[0]-this.dragStartMousePos[0]);a=a>this.minWidth?a:this.minWidth;let s=this.dragStartLeft+o[0]-this.dragStartMousePos[0];s=a>this.minWidth?s:this.dragStartLeft+this.dragStartWidth-this.minWidth,this.setState({left:s,width:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragTopFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartHeight-(o[1]-this.dragStartMousePos[1]);a=a>this.minHeight?a:this.minHeight;let s=this.dragStartTop+o[1]-this.dragStartMousePos[1];s=a>this.minHeight?s:this.dragStartTop+this.dragStartHeight-this.minHeight,this.setState({top:s,height:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragRightFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartWidth+(o[0]-this.dragStartMousePos[0]);a=a>this.minWidth?a:this.minWidth,this.setState({width:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragBottomLeftFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartHeight+(o[1]-this.dragStartMousePos[1]);a=a>this.minHeight?a:this.minHeight;let s=this.dragStartWidth-(o[0]-this.dragStartMousePos[0]);s=s>this.minWidth?s:this.minWidth;let c=this.dragStartLeft+o[0]-this.dragStartMousePos[0];c=s>this.minWidth?c:this.dragStartLeft+this.dragStartWidth-this.minWidth,this.setState({left:c,width:s,height:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragBottomRightFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartWidth+(o[0]-this.dragStartMousePos[0]);a=a>this.minWidth?a:this.minWidth;let s=this.dragStartHeight+(o[1]-this.dragStartMousePos[1]);s=s>this.minHeight?s:this.minHeight,this.setState({width:a,height:s}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragTopRightFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartHeight-(o[1]-this.dragStartMousePos[1]);a=a>this.minHeight?a:this.minHeight;let s=this.dragStartTop+o[1]-this.dragStartMousePos[1];s=a>this.minHeight?s:this.dragStartTop+this.dragStartHeight-this.minHeight;let c=this.dragStartWidth+(o[0]-this.dragStartMousePos[0]);c=c>this.minWidth?c:this.minWidth,this.setState({top:s,width:c,height:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragTopLeftFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartWidth-(o[0]-this.dragStartMousePos[0]);a=a>this.minWidth?a:this.minWidth;let s=this.dragStartLeft+o[0]-this.dragStartMousePos[0];s=a>this.minWidth?s:this.dragStartLeft+this.dragStartWidth-this.minWidth;let c=this.dragStartHeight-(o[1]-this.dragStartMousePos[1]);c=c>this.minHeight?c:this.minHeight;let u=this.dragStartTop+o[1]-this.dragStartMousePos[1];u=c>this.minHeight?u:this.dragStartTop+this.dragStartHeight-this.minHeight,this.setState({top:u,left:s,width:a,height:c}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragStart",value:function(n){this.dragStartMousePos=lr(n,this.domBody),this.dragStartWidth=this.state.width,this.dragStartHeight=this.state.height,this.dragStartTop=this.state.top,this.dragStartLeft=this.state.left,n.sourceEvent.stopPropagation()}},{key:"sizeChanged",value:function(){this.props.sizeChanged&&this.props.sizeChanged(this.state)}},{key:"rotateClicked",value:function(){this.props.trackRotated(this.state.uid)}},{key:"closeClicked",value:function(){this.props.trackClosed(this.state.uid)}},{key:"render",value:function(){const n=this.props.theme===mr?"white":"black",o={top:this.state.top,left:this.state.left,width:this.state.width,height:this.state.height,opacity:this.props.opacity},a=24,s=24,c={left:this.state.width/2-a/2,width:a},u={top:this.state.height/2-s/2,height:s},l={bottom:{...c,bottom:1},top:{...c,top:1},left:{...u,left:1},right:{...u,right:1}},h=[...this.props.resizeHandles].map(f=>E.createElement("div",{key:f,ref:d=>{this[`${f}Handle`]=d},className:_P[`${f}-draggable-handle`],style:l[f],title:"Resize track"},E.createElement("div",{className:_P[`${f}-draggable-handle-grabber`],style:{borderColor:n}})));return E.createElement("div",{ref:f=>{this.divContainer=f},className:Zt(this.props.className,_P["draggable-div"]),style:o},h)}}]),r}(E.Component);F3.propTypes={className:N.string,height:N.number,left:N.number,opacity:N.number,resizeHandles:N.object,sizeChanged:N.func,top:N.number,trackClosed:N.func,trackRotated:N.func,uid:N.string,width:N.number,theme:N.symbol};const EBe=hc(F3);function SBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ABe(i.key),i)}}function wBe(e,t,r){return t&&$3(e.prototype,t),r&&$3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ABe(e){var t=OBe(e,"string");return typeof t=="symbol"?t:String(t)}function OBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EP(e,t)}function EP(e,t){return EP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},EP(e,t)}function IBe(e){var t=DBe();return function(){var i=G0(e),n;if(t){var o=G0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return CBe(this,n)}}function CBe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PBe(e)}function PBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function G0(e){return G0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},G0(e)}let j3=function(e){kBe(r,e);var t=IBe(r);function r(i){var n;return SBe(this,r),n=t.call(this,i),n.state={controlsVisible:!1},n}return wBe(r,[{key:"shouldComponentUpdate",value:function(){return!this.resizing}},{key:"handleMouseEnter",value:function(){this.setState({controlsVisible:!0})}},{key:"handleMouseLeave",value:function(){this.setState({controlsVisible:!1})}},{key:"handleMouseMove",value:function(){this.setState({controlsVisible:!0})}},{key:"getControls",value:function(){let n=null;return this.moveable?n=xS(()=>E.createElement("svg",{className:"no-zoom",height:"10px",onClick:()=>{},style:this.getMoveImgStyle(),width:"10px"},E.createElement("use",{xlinkHref:"#move"}))):n=xS(()=>E.createElement("div",null)),E.createElement("div",{style:{position:"absolute",backgroundColor:"rgba(255,255,255,0.7)",right:"3px",top:"3px",pointerEvents:"none",paddingLeft:"5px",paddingRight:"5px",borderRadius:"5px",border:"1px solid #dddddd"}},E.createElement(n,null),E.createElement("svg",{ref:o=>{this.imgConfig=o},className:"no-zoom",height:"10px",onClick:()=>{const a=Lr.findDOMNode(this.imgConfig).getBoundingClientRect();this.props.onConfigTrackMenuOpened(this.props.uid,a)},style:this.getSettingsImgStyle(),width:"10px"},E.createElement("use",{xlinkHref:"#cog"})),E.createElement("svg",{ref:o=>{this.imgAdd=o},className:"no-zoom",height:"10px",onClick:()=>this.props.onAddSeries(this.props.uid),style:this.getAddImgStyle(),width:"10px"},E.createElement("use",{xlinkHref:"#plus"})),E.createElement("svg",{ref:o=>{this.imgClose=o},className:"no-zoom",height:"10px",onClick:()=>{const a=Lr.findDOMNode(this.imgClose).getBoundingClientRect();this.props.onCloseTrackMenuOpened(this.props.uid,a)},style:this.getCloseImgStyle(),width:"10px"},E.createElement("use",{xlinkHref:"#cross"})))}}]),r}(E.Component);j3.propTypes={configMenuOpen:N.bool,onConfigTrackMenuOpened:N.func,onCloseTrackMenuOpened:N.func,onAddSeries:N.func,uid:N.string};function xBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,RBe(i.key),i)}}function NBe(e,t,r){return t&&U3(e.prototype,t),r&&U3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function RBe(e){var t=MBe(e,"string");return typeof t=="symbol"?t:String(t)}function MBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&SP(e,t)}function SP(e,t){return SP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},SP(e,t)}function BBe(e){var t=$Be();return function(){var i=z0(e),n;if(t){var o=z0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return HBe(this,n)}}function HBe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FBe(e)}function FBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $Be(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function z0(e){return z0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},z0(e)}let V0=function(e){LBe(r,e);var t=BBe(r);function r(i){var n;return xBe(this,r),n=t.call(this,i),n.moveable=!0,n}return NBe(r,[{key:"render",value:function(){return E.createElement("div",{ref:n=>{this.el=n},className:this.props.className,onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:()=>{this.handleMouseLeave()},style:{height:this.props.height,width:this.props.width}},E.createElement(EBe,{key:this.props.uid,height:this.props.height,resizeHandles:this.props.editable?this.props.resizeHandles:new Set,sizeChanged:n=>this.props.handleResizeTrack(this.props.uid,n.width,n.height),style:{background:"transparent"},uid:this.props.uid,width:this.props.width}),this.props.editable&&this.getControls(this.state.controlsVisible||this.props.item.configMenuVisible))}}]),r}(j3);V0.propTypes={className:N.string,uid:N.string,item:N.object,height:N.number,width:N.number};function jBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,GBe(i.key),i)}}function UBe(e,t,r){return t&&G3(e.prototype,t),r&&G3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function GBe(e){var t=zBe(e,"string");return typeof t=="symbol"?t:String(t)}function zBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wP(e,t)}function wP(e,t){return wP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},wP(e,t)}function WBe(e){var t=XBe();return function(){var i=W0(e),n;if(t){var o=W0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return YBe(this,n)}}function YBe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qBe(e)}function qBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function W0(e){return W0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},W0(e)}const Y0={pointerEvents:"all"};let z3=function(e){VBe(r,e);var t=WBe(r);function r(){return jBe(this,r),t.apply(this,arguments)}return UBe(r,[{key:"getControls",value:function(n){return E.createElement(Qb,{configMenuVisible:this.props.item.configMenuVisible,imgStyleAdd:Y0,imgStyleClose:Y0,imgStyleMove:Y0,imgStyleSettings:Y0,isMoveable:this.moveable,isVisible:n,onAddSeries:this.props.onAddSeries,onCloseTrackMenuOpened:this.props.onCloseTrackMenuOpened,onConfigTrackMenuOpened:this.props.onConfigTrackMenuOpened,uid:this.props.uid})}}]),r}(V0);const KBe=zL(e=>E.createElement(z3,{className:e.className,editable:e.editable,handleConfigTrack:e.handleConfigTrack,handleResizeTrack:e.handleResizeTrack,height:e.height,item:e.item,onAddSeries:e.onAddSeries,onCloseTrack:e.onCloseTrack,onCloseTrackMenuOpened:e.onCloseTrackMenuOpened,onConfigTrackMenuOpened:e.onConfigTrackMenuOpened,resizeHandles:e.resizeHandles,uid:e.uid,width:e.width}));function AP(){return AP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},AP.apply(this,arguments)}const V3=nie(({className:e,items:t,itemClass:r,itemControlAlignLeft:i,sortingIndex:n,useDragHandle:o,sortableHandlers:a,height:s,width:c,onCloseTrack:u,onCloseTrackMenuOpened:l,onConfigTrackMenuOpened:h,onAddSeries:f,handleConfigTrack:d,editable:p,itemReactClass:m,handleResizeTrack:g,resizeHandles:v})=>{const _=t.map((y,b)=>E.createElement(m,{key:`sci-${y.uid}`,className:r,controlAlignLeft:i,sortingIndex:n,index:b,uid:y.uid,height:y.height,width:y.width,item:y,useDragHandle:o,onCloseTrack:u,onCloseTrackMenuOpened:l,onConfigTrackMenuOpened:h,onAddSeries:f,handleConfigTrack:d,editable:p,handleResizeTrack:g,resizeHandles:v}));return E.createElement("div",AP({className:e,style:{height:s,width:c,background:"transparent"}},a),_)}),ZBe={"horizontal-tiled-plot":"_horizontal-tiled-plot_1bqkg_1"};function QBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,eHe(i.key),i)}}function JBe(e,t,r){return t&&W3(e.prototype,t),r&&W3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function eHe(e){var t=tHe(e,"string");return typeof t=="symbol"?t:String(t)}function tHe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rHe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OP(e,t)}function OP(e,t){return OP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},OP(e,t)}function nHe(e){var t=oHe();return function(){var i=X0(e),n;if(t){var o=X0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return iHe(this,n)}}function iHe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q0(e)}function q0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oHe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function X0(e){return X0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},X0(e)}function Y3(e){return e&&e.sourceEvent}let K0=function(e){rHe(r,e);var t=nHe(r);function r(i){var n;return QBe(this,r),n=t.call(this,i),n.brushBehavior=Jv().on("start",n.brushStarted.bind(q0(n))).on("brush",n.brushed.bind(q0(n))).on("end",n.brushedEnded.bind(q0(n))),n}return JBe(r,[{key:"componentDidMount",value:function(){this.props.isRangeSelectionActive&&this.addBrush()}},{key:"shouldComponentUpdate",value:function(n,o){return this.rangeSelectionTriggered?(this.rangeSelectionTriggered=!1,this.rangeSelectionTriggeredEnd&&this.props.rangeSelection!==n.rangeSelection&&this.moveBrush(n.rangeSelection[0]?n.rangeSelection[0]:null,!0),this.rangeSelectionTriggeredEnd=!1,this.state!==o):this.props.rangeSelection!==n.rangeSelection?(this.moveBrush(n.rangeSelection[0]?n.rangeSelection[0]:null,n.rangeSelectionEnd),this.state!==o):!0}},{key:"componentDidUpdate",value:function(){this.props.isRangeSelectionActive?this.addBrush():this.removeBrush()}},{key:"addBrush",value:function(){!this.brushEl||this.brushElAddedBefore===this.brushEl||(this.brushElAddedBefore&&this.brushElAddedBefore.on(".brush",null),this.brushEl.call(this.brushBehavior),this.brushElAddedBefore=this.brushEl,Bu(this.brushEl,To["track-range-selection-group-brush-selection"]))}},{key:"brushed",value:function(n){const o=this.rangeSelectionMoved;this.rangeSelectionMoved=!1,!(!Y3(n)||!this.props.onRangeSelection||o)&&(this.rangeSelectionTriggered=!0,this.props.onRangeSelection(n.selection))}},{key:"brushStarted",value:function(n){!Y3(n)||!n.selection||this.props.onRangeSelectionStart()}},{key:"brushedEnded",value:function(n){if(!this.props.is1dRangeSelection)return;const o=this.rangeSelectionMovedEnd;this.rangeSelectionMovedEnd=!1,n.selection&&n.sourceEvent&&this.props.onRangeSelection&&!o&&(this.rangeSelectionTriggered=!0,this.rangeSelectionTriggeredEnd=!0,this.props.onRangeSelectionEnd(n.selection)),n.selection||(this.rangeSelectionTriggered=!0,this.props.onRangeSelectionReset())}},{key:"moveBrush",value:function(n,o=!1){if(!this.brushEl)return;const a=n?[this.props.scale(n[0]),this.props.scale(n[1])]:null;this.rangeSelectionMoved=!0,this.rangeSelectionMovedEnd=!0,o?this.brushEl.transition().call(this.brushBehavior.move,a):this.brushEl.call(this.brushBehavior.move,a)}},{key:"removeBrush",value:function(){this.brushElAddedBefore&&(this.brushElAddedBefore.call(this.brushBehavior.move,null),this.brushElAddedBefore.on(".brush",null),this.brushElAddedBefore=void 0,this.props.onRangeSelectionReset())}},{key:"render",value:function(){const n=this.props.tracks.map(s=>s.height).reduce(Es,0),o=this.props.tracks.map(s=>Hu(s)).reduce(Xd,!1),a=this.props.isRangeSelectionActive?To["track-range-selection-active"]:To["track-range-selection"];return E.createElement("div",{className:Zt("horizontal-tiled-plot",ZBe["horizontal-tiled-plot"])},o&&E.createElement("svg",{ref:s=>{this.brushEl=Bt(s)},className:a,style:{height:n,width:this.props.width},xmlns:"http://www.w3.org/2000/svg"}),E.createElement(j0,{className:Zt(Eo.list,Eo.stylizedList),component:V3,editable:this.props.editable,handleConfigTrack:this.props.handleConfigTrack,handleResizeTrack:this.props.handleResizeTrack,height:n,helperClass:Eo.stylizedHelper,itemClass:Eo.stylizedItem,itemReactClass:KBe,items:this.props.tracks.map(s=>({configMenuVisible:s.uid===this.props.configTrackMenuId,uid:s.uid||xt.nice(),width:this.props.width,height:s.height,value:s.value})),onAddSeries:this.props.onAddSeries,onCloseTrack:this.props.onCloseTrack,onCloseTrackMenuOpened:this.props.onCloseTrackMenuOpened,onConfigTrackMenuOpened:this.props.onConfigTrackMenuOpened,onSortEnd:this.props.handleSortEnd,referenceAncestor:this.props.referenceAncestor,resizeHandles:this.props.resizeHandles,useDragHandle:!0,width:this.props.width}))}}]),r}(E.Component);K0.propTypes={configTrackMenuId:N.string,editable:N.bool,handleConfigTrack:N.func,handleResizeTrack:N.func,handleSortEnd:N.func,is1dRangeSelection:N.bool,isRangeSelectionActive:N.bool,onAddSeries:N.func,onCloseTrack:N.func,onCloseTrackMenuOpened:N.func,onConfigTrackMenuOpened:N.func,onRangeSelection:N.func,onRangeSelectionEnd:N.func,onRangeSelectionReset:N.func,onRangeSelectionStart:N.func,rangeSelection:N.array,rangeSelectionEnd:N.bool,referenceAncestor:N.func,resizeHandles:N.object,scale:N.func,tracks:N.array,width:N.number};function aHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,lHe(i.key),i)}}function sHe(e,t,r){return t&&q3(e.prototype,t),r&&q3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lHe(e){var t=cHe(e,"string");return typeof t=="symbol"?t:String(t)}function cHe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uHe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kP(e,t)}function kP(e,t){return kP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},kP(e,t)}function fHe(e){var t=pHe();return function(){var i=Z0(e),n;if(t){var o=Z0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return hHe(this,n)}}function hHe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dHe(e)}function dHe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pHe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Z0(e){return Z0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Z0(e)}const Q0={pointerEvents:"all"};let X3=function(e){uHe(r,e);var t=fHe(r);function r(){return aHe(this,r),t.apply(this,arguments)}return sHe(r,[{key:"getControls",value:function(n){return E.createElement(Qb,{imgStyleAdd:Q0,imgStyleClose:Q0,imgStyleMove:Q0,imgStyleSettings:Q0,isAlignLeft:this.props.controlAlignLeft,isMoveable:this.moveable,isVertical:!0,isVisible:n,onAddSeries:this.props.onAddSeries,onCloseTrackMenuOpened:this.props.onCloseTrackMenuOpened,onConfigTrackMenuOpened:this.props.onConfigTrackMenuOpened,uid:this.props.uid})}}]),r}(V0);function mHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,vHe(i.key),i)}}function gHe(e,t,r){return t&&K3(e.prototype,t),r&&K3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vHe(e){var t=yHe(e,"string");return typeof t=="symbol"?t:String(t)}function yHe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function J0(){return typeof Reflect<"u"&&Reflect.get?J0=Reflect.get.bind():J0=function(t,r,i){var n=bHe(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?t:i):o.value}},J0.apply(this,arguments)}function bHe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ah(e),e!==null););return e}function _He(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IP(e,t)}function IP(e,t){return IP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},IP(e,t)}function THe(e){var t=SHe();return function(){var i=Ah(e),n;if(t){var o=Ah(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return EHe(this,n)}}function EHe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z3(e)}function Z3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SHe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ah(e)}let wHe=function(e){_He(r,e);var t=THe(r);function r(i,n){var o;mHe(this,r),o=t.call(this,i,n);const{registerViewportChanged:a,removeViewportChanged:s}=i,c=xt.nice();return o.uid=c,o.removeViewportChanged=s,o.viewportXDomain=null,o.viewportYDomain=null,a(c,o.viewportChanged.bind(Z3(o))),o}return gHe(r,[{key:"viewportChanged",value:function(n,o){const a=n.domain(),s=o.domain();this.viewportXDomain=a,this.viewportYDomain=s,this.draw()}},{key:"draw",value:function(){const n=this.pMain;if(!this.viewportXDomain||!this.viewportYDomain)return;n.clear(),n.lineStyle(1,255,1),n.beginFill(16740363,1);const o=this._xScale(this.viewportXDomain[0]),a=this._yScale(this.viewportYDomain[0]),s=this._xScale(this.viewportXDomain[1])-this._xScale(this.viewportXDomain[0]),c=this._yScale(this.viewportYDomain[1])-this._yScale(this.viewportYDomain[0]);this.pMain.drawRect(o,a,s,c)}},{key:"zoomed",value:function(n,o){this.xScale(n),this.yScale(o),this.draw()}},{key:"setPosition",value:function(n){J0(Ah(r.prototype),"setPosition",this).call(this,n),this.pMain.position.y=this.position[1],this.pMain.position.x=this.position[0],this.draw()}}]),r}(ei);function Q3(e){this.size=0,this.limit=e,this._keymap={}}function AHe(e,t){const r={key:e,value:t};if(this._keymap[e]=r,this.tail?(this.tail.newer=r,r.older=this.tail):this.head=r,this.tail=r,this.size===this.limit)return this.shift();this.size+=1}function OHe(){const e=this.head;return e&&(this.head.newer?(this.head=this.head.newer,this.head.older=void 0):(this.head=void 0,this.tail=void 0),e.newer=void 0,e.older=void 0,delete this._keymap[e.key],this.size-=1),e}function kHe(e,t){const r=this._keymap[e];if(r!==void 0)return r===this.tail||(r.newer&&(r===this.head&&(this.head=r.newer),r.newer.older=r.older),r.older&&(r.older.newer=r.newer),r.newer=void 0,r.older=this.tail,this.tail&&(this.tail.newer=r),this.tail=r),t?r:r.value}function IHe(e){return this._keymap[e]}function CHe(e,t){const r=this.get(e,!0);let i;return r?(i=r.value,r.value=t):(i=this.put(e,t),i&&(i=i.value)),i}function PHe(e){const t=this._keymap[e];if(t)return delete this._keymap[t.key],t.newer&&t.older?(t.older.newer=t.newer,t.newer.older=t.older):t.newer?(t.newer.older=void 0,this.head=t.newer):t.older?(t.older.newer=void 0,this.tail=t.older):(this.head=void 0,this.tail=void 0),this.size-=1,t.value}function DHe(){this.head=void 0,this.tail=void 0,this.size=0,this._keymap={}}function xHe(){return Object.keys(this._keymap)}function NHe(e,t,r){let i;if(t===!0?(r=!0,t=void 0):typeof t!="object"&&(t=this),r)for(i=this.tail;i;)e.call(t,i.key,i.value,this),i=i.older;else for(i=this.head;i;)e.call(t,i.key,i.value,this),i=i.newer}function RHe(){const e=[];let t=this.head;for(;t;)e.push({key:t.key.toJSON(),value:t.value.toJSON()}),t=t.newer;return e}function MHe(){let e="",t=this.head;for(;t;)e+=`${String(t.key)}:${t.value}`,t=t.newer,t&&(e+=" < ");return e}Object.assign(Q3.prototype,{put:AHe,get:kHe,find:IHe,keys:xHe,set:CHe,shift:OHe,remove:PHe,removeAll:DHe,forEach:NHe,toJSON:RHe,toString:MHe});const CP="1.13.3",PP={button:"_button_1wnjn_1","button-shortcut":"_button-shortcut_1wnjn_35"},cs=E.forwardRef((e,t)=>E.createElement("button",{ref:t,className:PP[e.styleName]??PP.button,disabled:e.disable,onBlur:e.onBlur,onClick:e.onClick,onMouseDown:e.onMouseDown,onMouseOut:e.onMouseOut,onMouseUp:e.onMouseUp,type:"button"},e.children,e.shortcut&&E.createElement("span",{className:PP["button-shortcut"]},e.shortcut)));cs.defaultProps={onClick:()=>{},styleName:"",type:"button"},cs.propTypes={children:N.any,disable:N.bool,onBlur:N.func,onClick:N.func,onMouseDown:N.func,onMouseOut:N.func,onMouseUp:N.func,shortcut:N.string,type:N.string,styleName:N.string};const LHe={cross:"_cross_2ke8w_1"};function J3(){return E.createElement("div",{className:LHe.cross})}function DP(){return DP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},DP.apply(this,arguments)}const{Provider:BHe,Consumer:HHe}=E.createContext({close:po,open:po}),eT=e=>E.forwardRef((t,r)=>E.createElement(HHe,null,i=>E.createElement(e,DP({ref:r},t,{modal:i})))),Oh={"modal-background":"_modal-background_zzhoe_1","fade-in":"_fade-in_zzhoe_1","modal-hide":"_modal-hide_zzhoe_13","modal-wrap":"_modal-wrap_zzhoe_17","modal-window":"_modal-window_zzhoe_25","fade-scale-in":"_fade-scale-in_zzhoe_1","modal-window-max-height":"_modal-window-max-height_zzhoe_38","modal-content":"_modal-content_zzhoe_42"};function xP(e){const t=()=>{e.modal.close(),e.onClose&&e.onClose()};return E.createElement("div",{className:Zt(Oh["modal-background"],{[Oh["modal-hide"]]:e.hide})},E.createElement("div",{className:Oh["modal-wrap"]},E.createElement("div",{className:Zt(Oh["modal-window"],{[Oh["modal-window-max-height"]]:e.maxHeight})},e.closeButton&&E.createElement(cs,{onClick:t},E.createElement(J3,null)),E.createElement("div",{className:Oh["modal-content"]},e.children))))}xP.defaultProps={closeButton:!0,hide:!1,maxHeight:!1},xP.propTypes={children:N.element.isRequired,closeButton:N.bool,hide:N.bool,maxHeight:N.bool,modal:N.object.isRequired,onClose:N.func};const FHe=eT(xP),NP={"dialog-header":"_dialog-header_wp50s_1","dialog-main-max-height":"_dialog-main-max-height_wp50s_20","dialog-footer":"_dialog-footer_wp50s_31","dialog-footer-max-height":"_dialog-footer-max-height_wp50s_31"};function RP(e){const t=()=>{e.modal.close(),e.onCancel&&e.onCancel()},r=()=>{e.modal.close(),e.onOkay&&e.onOkay()};return E.createElement(FHe,{closeButton:!1,hide:e.hide,maxHeight:e.maxHeight},E.createElement(E.Fragment,null,E.createElement("header",{className:NP["dialog-header"]},E.createElement("h3",null,e.title),E.createElement(cs,{onClick:t},E.createElement(J3,null))),e.maxHeight?E.createElement("main",{className:Zt(e.maxHeight&&NP["dialog-main-max-height"])},e.children):E.createElement("main",null,e.children),E.createElement("footer",{className:NP[e.maxHeight?"dialog-footer-max-height":"dialog-footer"]},e.okayOnly?E.createElement("div",null):E.createElement(cs,{onClick:t,shortcut:e.cancelShortcut},e.cancelTitle),E.createElement(cs,{onClick:r,shortcut:e.okayShortcut},e.okayTitle))))}RP.defaultProps={cancelTitle:"Cancel",hide:!1,maxHeight:!1,okayOnly:!1,okayTitle:"Ok"},RP.propTypes={cancelShortcut:N.string,cancelTitle:N.string,children:N.object,hide:N.bool,maxHeight:N.bool,modal:N.object.isRequired,okayShortcut:N.string,okayTitle:N.string,okayOnly:N.bool,onCancel:N.func.isRequired,onOkay:N.func.isRequired,title:N.string.isRequired};const og=eT(RP);var no={},ag={},$He=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;const eV=$He;var jHe=typeof self=="object"&&self&&self.Object===Object&&self,UHe=eV||jHe||Function("return this")();const xo=UHe;var GHe=xo.Symbol;const Ea=GHe;var tV=Object.prototype,zHe=tV.hasOwnProperty,VHe=tV.toString,sg=Ea?Ea.toStringTag:void 0;function WHe(e){var t=zHe.call(e,sg),r=e[sg];try{e[sg]=void 0;var i=!0}catch{}var n=VHe.call(e);return i&&(t?e[sg]=r:delete e[sg]),n}var YHe=Object.prototype,qHe=YHe.toString;function XHe(e){return qHe.call(e)}var KHe="[object Null]",ZHe="[object Undefined]",rV=Ea?Ea.toStringTag:void 0;function ul(e){return e==null?e===void 0?ZHe:KHe:rV&&rV in Object(e)?WHe(e):XHe(e)}var QHe=Array.isArray;const ci=QHe;function No(e){return e!=null&&typeof e=="object"}var JHe="[object String]";function eFe(e){return typeof e=="string"||!ci(e)&&No(e)&&ul(e)==JHe}const tFe=wa(Object.freeze(Object.defineProperty({__proto__:null,default:eFe},Symbol.toStringTag,{value:"Module"})));function rFe(e){return function(t,r,i){for(var n=-1,o=Object(t),a=i(t),s=a.length;s--;){var c=a[e?s:++n];if(r(o[c],c,o)===!1)break}return t}}var nFe=rFe();const nV=nFe;function iFe(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var oFe="[object Arguments]";function iV(e){return No(e)&&ul(e)==oFe}var oV=Object.prototype,aFe=oV.hasOwnProperty,sFe=oV.propertyIsEnumerable,lFe=iV(function(){return arguments}())?iV:function(e){return No(e)&&aFe.call(e,"callee")&&!sFe.call(e,"callee")};const tT=lFe;function cFe(){return!1}var aV=typeof jt=="object"&&jt&&!jt.nodeType&&jt,sV=aV&&typeof module=="object"&&module&&!module.nodeType&&module,uFe=sV&&sV.exports===aV,lV=uFe?xo.Buffer:void 0,fFe=lV?lV.isBuffer:void 0,hFe=fFe||cFe;const lg=hFe;var dFe=9007199254740991,pFe=/^(?:0|[1-9]\d*)$/;function MP(e,t){var r=typeof e;return t=t??dFe,!!t&&(r=="number"||r!="symbol"&&pFe.test(e))&&e>-1&&e%1==0&&e<t}var mFe=9007199254740991;function LP(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=mFe}var gFe="[object Arguments]",vFe="[object Array]",yFe="[object Boolean]",bFe="[object Date]",_Fe="[object Error]",TFe="[object Function]",EFe="[object Map]",SFe="[object Number]",wFe="[object Object]",AFe="[object RegExp]",OFe="[object Set]",kFe="[object String]",IFe="[object WeakMap]",CFe="[object ArrayBuffer]",PFe="[object DataView]",DFe="[object Float32Array]",xFe="[object Float64Array]",NFe="[object Int8Array]",RFe="[object Int16Array]",MFe="[object Int32Array]",LFe="[object Uint8Array]",BFe="[object Uint8ClampedArray]",HFe="[object Uint16Array]",FFe="[object Uint32Array]",wr={};wr[DFe]=wr[xFe]=wr[NFe]=wr[RFe]=wr[MFe]=wr[LFe]=wr[BFe]=wr[HFe]=wr[FFe]=!0,wr[gFe]=wr[vFe]=wr[CFe]=wr[yFe]=wr[PFe]=wr[bFe]=wr[_Fe]=wr[TFe]=wr[EFe]=wr[SFe]=wr[wFe]=wr[AFe]=wr[OFe]=wr[kFe]=wr[IFe]=!1;function $Fe(e){return No(e)&&LP(e.length)&&!!wr[ul(e)]}function BP(e){return function(t){return e(t)}}var cV=typeof jt=="object"&&jt&&!jt.nodeType&&jt,cg=cV&&typeof module=="object"&&module&&!module.nodeType&&module,jFe=cg&&cg.exports===cV,HP=jFe&&eV.process,UFe=function(){try{var e=cg&&cg.require&&cg.require("util").types;return e||HP&&HP.binding&&HP.binding("util")}catch{}}();const kh=UFe;var uV=kh&&kh.isTypedArray,GFe=uV?BP(uV):$Fe;const FP=GFe;var zFe=Object.prototype,VFe=zFe.hasOwnProperty;function fV(e,t){var r=ci(e),i=!r&&tT(e),n=!r&&!i&&lg(e),o=!r&&!i&&!n&&FP(e),a=r||i||n||o,s=a?iFe(e.length,String):[],c=s.length;for(var u in e)(t||VFe.call(e,u))&&!(a&&(u=="length"||n&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||MP(u,c)))&&s.push(u);return s}var WFe=Object.prototype;function $P(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||WFe;return e===r}function hV(e,t){return function(r){return e(t(r))}}var YFe=hV(Object.keys,Object);const qFe=YFe;var XFe=Object.prototype,KFe=XFe.hasOwnProperty;function ZFe(e){if(!$P(e))return qFe(e);var t=[];for(var r in Object(e))KFe.call(e,r)&&r!="constructor"&&t.push(r);return t}function Hi(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var QFe="[object AsyncFunction]",JFe="[object Function]",e$e="[object GeneratorFunction]",t$e="[object Proxy]";function jP(e){if(!Hi(e))return!1;var t=ul(e);return t==JFe||t==e$e||t==QFe||t==t$e}function Ih(e){return e!=null&&LP(e.length)&&!jP(e)}function ug(e){return Ih(e)?fV(e):ZFe(e)}function dV(e,t){return e&&nV(e,t,ug)}function rT(e){return e}function pV(e){return typeof e=="function"?e:rT}function r$e(e,t){return e&&dV(e,pV(t))}const UP=wa(Object.freeze(Object.defineProperty({__proto__:null,default:r$e},Symbol.toStringTag,{value:"Module"})));var n$e=hV(Object.getPrototypeOf,Object);const GP=n$e;var i$e="[object Object]",o$e=Function.prototype,a$e=Object.prototype,mV=o$e.toString,s$e=a$e.hasOwnProperty,l$e=mV.call(Object);function gV(e){if(!No(e)||ul(e)!=i$e)return!1;var t=GP(e);if(t===null)return!0;var r=s$e.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&mV.call(r)==l$e}const c$e=wa(Object.freeze(Object.defineProperty({__proto__:null,default:gV},Symbol.toStringTag,{value:"Module"})));function vV(e,t){for(var r=-1,i=e==null?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}function u$e(){this.__data__=[],this.size=0}function fg(e,t){return e===t||e!==e&&t!==t}function nT(e,t){for(var r=e.length;r--;)if(fg(e[r][0],t))return r;return-1}var f$e=Array.prototype,h$e=f$e.splice;function d$e(e){var t=this.__data__,r=nT(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():h$e.call(t,r,1),--this.size,!0}function p$e(e){var t=this.__data__,r=nT(t,e);return r<0?void 0:t[r][1]}function m$e(e){return nT(this.__data__,e)>-1}function g$e(e,t){var r=this.__data__,i=nT(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function us(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}us.prototype.clear=u$e,us.prototype.delete=d$e,us.prototype.get=p$e,us.prototype.has=m$e,us.prototype.set=g$e;function v$e(){this.__data__=new us,this.size=0}function y$e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function b$e(e){return this.__data__.get(e)}function _$e(e){return this.__data__.has(e)}var T$e=xo["__core-js_shared__"];const zP=T$e;var yV=function(){var e=/[^.]+$/.exec(zP&&zP.keys&&zP.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function E$e(e){return!!yV&&yV in e}var S$e=Function.prototype,w$e=S$e.toString;function Xc(e){if(e!=null){try{return w$e.call(e)}catch{}try{return e+""}catch{}}return""}var A$e=/[\\^$.*+?()[\]{}|]/g,O$e=/^\[object .+?Constructor\]$/,k$e=Function.prototype,I$e=Object.prototype,C$e=k$e.toString,P$e=I$e.hasOwnProperty,D$e=RegExp("^"+C$e.call(P$e).replace(A$e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function x$e(e){if(!Hi(e)||E$e(e))return!1;var t=jP(e)?D$e:O$e;return t.test(Xc(e))}function N$e(e,t){return e?.[t]}function Kc(e,t){var r=N$e(e,t);return x$e(r)?r:void 0}var R$e=Kc(xo,"Map");const hg=R$e;var M$e=Kc(Object,"create");const dg=M$e;function L$e(){this.__data__=dg?dg(null):{},this.size=0}function B$e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var H$e="__lodash_hash_undefined__",F$e=Object.prototype,$$e=F$e.hasOwnProperty;function j$e(e){var t=this.__data__;if(dg){var r=t[e];return r===H$e?void 0:r}return $$e.call(t,e)?t[e]:void 0}var U$e=Object.prototype,G$e=U$e.hasOwnProperty;function z$e(e){var t=this.__data__;return dg?t[e]!==void 0:G$e.call(t,e)}var V$e="__lodash_hash_undefined__";function W$e(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=dg&&t===void 0?V$e:t,this}function Zc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Zc.prototype.clear=L$e,Zc.prototype.delete=B$e,Zc.prototype.get=j$e,Zc.prototype.has=z$e,Zc.prototype.set=W$e;function Y$e(){this.size=0,this.__data__={hash:new Zc,map:new(hg||us),string:new Zc}}function q$e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function iT(e,t){var r=e.__data__;return q$e(t)?r[typeof t=="string"?"string":"hash"]:r.map}function X$e(e){var t=iT(this,e).delete(e);return this.size-=t?1:0,t}function K$e(e){return iT(this,e).get(e)}function Z$e(e){return iT(this,e).has(e)}function Q$e(e,t){var r=iT(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}function fs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}fs.prototype.clear=Y$e,fs.prototype.delete=X$e,fs.prototype.get=K$e,fs.prototype.has=Z$e,fs.prototype.set=Q$e;var J$e=200;function eje(e,t){var r=this.__data__;if(r instanceof us){var i=r.__data__;if(!hg||i.length<J$e-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new fs(i)}return r.set(e,t),this.size=r.size,this}function Ro(e){var t=this.__data__=new us(e);this.size=t.size}Ro.prototype.clear=v$e,Ro.prototype.delete=y$e,Ro.prototype.get=b$e,Ro.prototype.has=_$e,Ro.prototype.set=eje;var tje="__lodash_hash_undefined__";function rje(e){return this.__data__.set(e,tje),this}function nje(e){return this.__data__.has(e)}function oT(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new fs;++t<r;)this.add(e[t])}oT.prototype.add=oT.prototype.push=rje,oT.prototype.has=nje;function ije(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}function oje(e,t){return e.has(t)}var aje=1,sje=2;function bV(e,t,r,i,n,o){var a=r&aje,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var u=o.get(e),l=o.get(t);if(u&&l)return u==t&&l==e;var h=-1,f=!0,d=r&sje?new oT:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],m=t[h];if(i)var g=a?i(m,p,h,t,e,o):i(p,m,h,e,t,o);if(g!==void 0){if(g)continue;f=!1;break}if(d){if(!ije(t,function(v,_){if(!oje(d,_)&&(p===v||n(p,v,r,i,o)))return d.push(_)})){f=!1;break}}else if(!(p===m||n(p,m,r,i,o))){f=!1;break}}return o.delete(e),o.delete(t),f}var lje=xo.Uint8Array;const aT=lje;function cje(e){var t=-1,r=Array(e.size);return e.forEach(function(i,n){r[++t]=[n,i]}),r}function uje(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var fje=1,hje=2,dje="[object Boolean]",pje="[object Date]",mje="[object Error]",gje="[object Map]",vje="[object Number]",yje="[object RegExp]",bje="[object Set]",_je="[object String]",Tje="[object Symbol]",Eje="[object ArrayBuffer]",Sje="[object DataView]",_V=Ea?Ea.prototype:void 0,VP=_V?_V.valueOf:void 0;function wje(e,t,r,i,n,o,a){switch(r){case Sje:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Eje:return!(e.byteLength!=t.byteLength||!o(new aT(e),new aT(t)));case dje:case pje:case vje:return fg(+e,+t);case mje:return e.name==t.name&&e.message==t.message;case yje:case _je:return e==t+"";case gje:var s=cje;case bje:var c=i&fje;if(s||(s=uje),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;i|=hje,a.set(e,t);var l=bV(s(e),s(t),i,n,o,a);return a.delete(e),l;case Tje:if(VP)return VP.call(e)==VP.call(t)}return!1}function TV(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}function EV(e,t,r){var i=t(e);return ci(e)?i:TV(i,r(e))}function Aje(e,t){for(var r=-1,i=e==null?0:e.length,n=0,o=[];++r<i;){var a=e[r];t(a,r,e)&&(o[n++]=a)}return o}function SV(){return[]}var Oje=Object.prototype,kje=Oje.propertyIsEnumerable,wV=Object.getOwnPropertySymbols,Ije=wV?function(e){return e==null?[]:(e=Object(e),Aje(wV(e),function(t){return kje.call(e,t)}))}:SV;const WP=Ije;function YP(e){return EV(e,ug,WP)}var Cje=1,Pje=Object.prototype,Dje=Pje.hasOwnProperty;function xje(e,t,r,i,n,o){var a=r&Cje,s=YP(e),c=s.length,u=YP(t),l=u.length;if(c!=l&&!a)return!1;for(var h=c;h--;){var f=s[h];if(!(a?f in t:Dje.call(t,f)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var g=a;++h<c;){f=s[h];var v=e[f],_=t[f];if(i)var y=a?i(_,v,f,t,e,o):i(v,_,f,e,t,o);if(!(y===void 0?v===_||n(v,_,r,i,o):y)){m=!1;break}g||(g=f=="constructor")}if(m&&!g){var b=e.constructor,T=t.constructor;b!=T&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(m=!1)}return o.delete(e),o.delete(t),m}var Nje=Kc(xo,"DataView");const qP=Nje;var Rje=Kc(xo,"Promise");const XP=Rje;var Mje=Kc(xo,"Set");const KP=Mje;var Lje=Kc(xo,"WeakMap");const ZP=Lje;var AV="[object Map]",Bje="[object Object]",OV="[object Promise]",kV="[object Set]",IV="[object WeakMap]",CV="[object DataView]",Hje=Xc(qP),Fje=Xc(hg),$je=Xc(XP),jje=Xc(KP),Uje=Xc(ZP),Qc=ul;(qP&&Qc(new qP(new ArrayBuffer(1)))!=CV||hg&&Qc(new hg)!=AV||XP&&Qc(XP.resolve())!=OV||KP&&Qc(new KP)!=kV||ZP&&Qc(new ZP)!=IV)&&(Qc=function(e){var t=ul(e),r=t==Bje?e.constructor:void 0,i=r?Xc(r):"";if(i)switch(i){case Hje:return CV;case Fje:return AV;case $je:return OV;case jje:return kV;case Uje:return IV}return t});const pg=Qc;var Gje=1,PV="[object Arguments]",DV="[object Array]",sT="[object Object]",zje=Object.prototype,xV=zje.hasOwnProperty;function Vje(e,t,r,i,n,o){var a=ci(e),s=ci(t),c=a?DV:pg(e),u=s?DV:pg(t);c=c==PV?sT:c,u=u==PV?sT:u;var l=c==sT,h=u==sT,f=c==u;if(f&&lg(e)){if(!lg(t))return!1;a=!0,l=!1}if(f&&!l)return o||(o=new Ro),a||FP(e)?bV(e,t,r,i,n,o):wje(e,t,c,r,i,n,o);if(!(r&Gje)){var d=l&&xV.call(e,"__wrapped__"),p=h&&xV.call(t,"__wrapped__");if(d||p){var m=d?e.value():e,g=p?t.value():t;return o||(o=new Ro),n(m,g,r,i,o)}}return f?(o||(o=new Ro),xje(e,t,r,i,n,o)):!1}function QP(e,t,r,i,n){return e===t?!0:e==null||t==null||!No(e)&&!No(t)?e!==e&&t!==t:Vje(e,t,r,i,QP,n)}var Wje=1,Yje=2;function qje(e,t,r,i){var n=r.length,o=n,a=!i;if(e==null)return!o;for(e=Object(e);n--;){var s=r[n];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){s=r[n];var c=s[0],u=e[c],l=s[1];if(a&&s[2]){if(u===void 0&&!(c in e))return!1}else{var h=new Ro;if(i)var f=i(u,l,c,e,t,h);if(!(f===void 0?QP(l,u,Wje|Yje,i,h):f))return!1}}return!0}function NV(e){return e===e&&!Hi(e)}function Xje(e){for(var t=ug(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,NV(n)]}return t}function RV(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Kje(e){var t=Xje(e);return t.length==1&&t[0][2]?RV(t[0][0],t[0][1]):function(r){return r===e||qje(r,e,t)}}var Zje="[object Symbol]";function lT(e){return typeof e=="symbol"||No(e)&&ul(e)==Zje}var Qje=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jje=/^\w*$/;function JP(e,t){if(ci(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||lT(e)?!0:Jje.test(e)||!Qje.test(e)||t!=null&&e in Object(t)}var e6e="Expected a function";function eD(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(e6e);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var a=e.apply(this,i);return r.cache=o.set(n,a)||o,a};return r.cache=new(eD.Cache||fs),r}eD.Cache=fs;var t6e=500;function r6e(e){var t=eD(e,function(i){return r.size===t6e&&r.clear(),i}),r=t.cache;return t}var n6e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i6e=/\\(\\)?/g,o6e=r6e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(n6e,function(r,i,n,o){t.push(n?o.replace(i6e,"$1"):i||r)}),t});const a6e=o6e;var s6e=1/0,MV=Ea?Ea.prototype:void 0,LV=MV?MV.toString:void 0;function BV(e){if(typeof e=="string")return e;if(ci(e))return vV(e,BV)+"";if(lT(e))return LV?LV.call(e):"";var t=e+"";return t=="0"&&1/e==-s6e?"-0":t}function l6e(e){return e==null?"":BV(e)}function HV(e,t){return ci(e)?e:JP(e,t)?[e]:a6e(l6e(e))}var c6e=1/0;function cT(e){if(typeof e=="string"||lT(e))return e;var t=e+"";return t=="0"&&1/e==-c6e?"-0":t}function FV(e,t){t=HV(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[cT(t[r++])];return r&&r==i?e:void 0}function u6e(e,t,r){var i=e==null?void 0:FV(e,t);return i===void 0?r:i}function f6e(e,t){return e!=null&&t in Object(e)}function h6e(e,t,r){t=HV(t,e);for(var i=-1,n=t.length,o=!1;++i<n;){var a=cT(t[i]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++i!=n?o:(n=e==null?0:e.length,!!n&&LP(n)&&MP(a,n)&&(ci(e)||tT(e)))}function d6e(e,t){return e!=null&&h6e(e,t,f6e)}var p6e=1,m6e=2;function g6e(e,t){return JP(e)&&NV(t)?RV(cT(e),t):function(r){var i=u6e(r,e);return i===void 0&&i===t?d6e(r,e):QP(t,i,p6e|m6e)}}function v6e(e){return function(t){return t?.[e]}}function y6e(e){return function(t){return FV(t,e)}}function b6e(e){return JP(e)?v6e(cT(e)):y6e(e)}function _6e(e){return typeof e=="function"?e:e==null?rT:typeof e=="object"?ci(e)?g6e(e[0],e[1]):Kje(e):b6e(e)}function T6e(e,t){return function(r,i){if(r==null)return r;if(!Ih(r))return e(r,i);for(var n=r.length,o=t?n:-1,a=Object(r);(t?o--:++o<n)&&i(a[o],o,a)!==!1;);return r}}var E6e=T6e(dV);const $V=E6e;function S6e(e,t){var r=-1,i=Ih(e)?Array(e.length):[];return $V(e,function(n,o,a){i[++r]=t(n,o,a)}),i}function fl(e,t){var r=ci(e)?vV:S6e;return r(e,_6e(t))}const w6e=wa(Object.freeze(Object.defineProperty({__proto__:null,default:fl},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(ag,"__esModule",{value:!0}),ag.flattenNames=void 0;var A6e=tFe,O6e=uT(A6e),k6e=UP,I6e=uT(k6e),C6e=c$e,P6e=uT(C6e),D6e=w6e,x6e=uT(D6e);function uT(e){return e&&e.__esModule?e:{default:e}}var N6e=ag.flattenNames=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[];return(0,x6e.default)(t,function(i){Array.isArray(i)?e(i).map(function(n){return r.push(n)}):(0,P6e.default)(i)?(0,I6e.default)(i,function(n,o){n===!0&&r.push(o),r.push(o+"-"+n)}):(0,O6e.default)(i)&&r.push(i)}),r};ag.default=N6e;var mg={};function jV(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}var R6e=function(){try{var e=Kc(Object,"defineProperty");return e({},"",{}),e}catch{}}();const fT=R6e;function tD(e,t,r){t=="__proto__"&&fT?fT(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var M6e=Object.prototype,L6e=M6e.hasOwnProperty;function UV(e,t,r){var i=e[t];(!(L6e.call(e,t)&&fg(i,r))||r===void 0&&!(t in e))&&tD(e,t,r)}function gg(e,t,r,i){var n=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=i?i(r[s],e[s],s,r,e):void 0;c===void 0&&(c=e[s]),n?tD(r,s,c):UV(r,s,c)}return r}function B6e(e,t){return e&&gg(t,ug(t),e)}function H6e(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var F6e=Object.prototype,$6e=F6e.hasOwnProperty;function j6e(e){if(!Hi(e))return H6e(e);var t=$P(e),r=[];for(var i in e)i=="constructor"&&(t||!$6e.call(e,i))||r.push(i);return r}function vg(e){return Ih(e)?fV(e,!0):j6e(e)}function U6e(e,t){return e&&gg(t,vg(t),e)}var GV=typeof jt=="object"&&jt&&!jt.nodeType&&jt,zV=GV&&typeof module=="object"&&module&&!module.nodeType&&module,G6e=zV&&zV.exports===GV,VV=G6e?xo.Buffer:void 0,WV=VV?VV.allocUnsafe:void 0;function YV(e,t){if(t)return e.slice();var r=e.length,i=WV?WV(r):new e.constructor(r);return e.copy(i),i}function qV(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function z6e(e,t){return gg(e,WP(e),t)}var V6e=Object.getOwnPropertySymbols,W6e=V6e?function(e){for(var t=[];e;)TV(t,WP(e)),e=GP(e);return t}:SV;const XV=W6e;function Y6e(e,t){return gg(e,XV(e),t)}function q6e(e){return EV(e,vg,XV)}var X6e=Object.prototype,K6e=X6e.hasOwnProperty;function Z6e(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&K6e.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function rD(e){var t=new e.constructor(e.byteLength);return new aT(t).set(new aT(e)),t}function Q6e(e,t){var r=t?rD(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var J6e=/\w*$/;function eUe(e){var t=new e.constructor(e.source,J6e.exec(e));return t.lastIndex=e.lastIndex,t}var KV=Ea?Ea.prototype:void 0,ZV=KV?KV.valueOf:void 0;function tUe(e){return ZV?Object(ZV.call(e)):{}}function QV(e,t){var r=t?rD(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var rUe="[object Boolean]",nUe="[object Date]",iUe="[object Map]",oUe="[object Number]",aUe="[object RegExp]",sUe="[object Set]",lUe="[object String]",cUe="[object Symbol]",uUe="[object ArrayBuffer]",fUe="[object DataView]",hUe="[object Float32Array]",dUe="[object Float64Array]",pUe="[object Int8Array]",mUe="[object Int16Array]",gUe="[object Int32Array]",vUe="[object Uint8Array]",yUe="[object Uint8ClampedArray]",bUe="[object Uint16Array]",_Ue="[object Uint32Array]";function TUe(e,t,r){var i=e.constructor;switch(t){case uUe:return rD(e);case rUe:case nUe:return new i(+e);case fUe:return Q6e(e,r);case hUe:case dUe:case pUe:case mUe:case gUe:case vUe:case yUe:case bUe:case _Ue:return QV(e,r);case iUe:return new i;case oUe:case lUe:return new i(e);case aUe:return eUe(e);case sUe:return new i;case cUe:return tUe(e)}}var JV=Object.create,EUe=function(){function e(){}return function(t){if(!Hi(t))return{};if(JV)return JV(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const SUe=EUe;function eW(e){return typeof e.constructor=="function"&&!$P(e)?SUe(GP(e)):{}}var wUe="[object Map]";function AUe(e){return No(e)&&pg(e)==wUe}var tW=kh&&kh.isMap,OUe=tW?BP(tW):AUe;const kUe=OUe;var IUe="[object Set]";function CUe(e){return No(e)&&pg(e)==IUe}var rW=kh&&kh.isSet,PUe=rW?BP(rW):CUe;const DUe=PUe;var xUe=1,NUe=2,RUe=4,nW="[object Arguments]",MUe="[object Array]",LUe="[object Boolean]",BUe="[object Date]",HUe="[object Error]",iW="[object Function]",FUe="[object GeneratorFunction]",$Ue="[object Map]",jUe="[object Number]",oW="[object Object]",UUe="[object RegExp]",GUe="[object Set]",zUe="[object String]",VUe="[object Symbol]",WUe="[object WeakMap]",YUe="[object ArrayBuffer]",qUe="[object DataView]",XUe="[object Float32Array]",KUe="[object Float64Array]",ZUe="[object Int8Array]",QUe="[object Int16Array]",JUe="[object Int32Array]",e4e="[object Uint8Array]",t4e="[object Uint8ClampedArray]",r4e="[object Uint16Array]",n4e="[object Uint32Array]",_r={};_r[nW]=_r[MUe]=_r[YUe]=_r[qUe]=_r[LUe]=_r[BUe]=_r[XUe]=_r[KUe]=_r[ZUe]=_r[QUe]=_r[JUe]=_r[$Ue]=_r[jUe]=_r[oW]=_r[UUe]=_r[GUe]=_r[zUe]=_r[VUe]=_r[e4e]=_r[t4e]=_r[r4e]=_r[n4e]=!0,_r[HUe]=_r[iW]=_r[WUe]=!1;function hT(e,t,r,i,n,o){var a,s=t&xUe,c=t&NUe,u=t&RUe;if(r&&(a=n?r(e,i,n,o):r(e)),a!==void 0)return a;if(!Hi(e))return e;var l=ci(e);if(l){if(a=Z6e(e),!s)return qV(e,a)}else{var h=pg(e),f=h==iW||h==FUe;if(lg(e))return YV(e,s);if(h==oW||h==nW||f&&!n){if(a=c||f?{}:eW(e),!s)return c?Y6e(e,U6e(a,e)):z6e(e,B6e(a,e))}else{if(!_r[h])return n?e:{};a=TUe(e,h,s)}}o||(o=new Ro);var d=o.get(e);if(d)return d;o.set(e,a),DUe(e)?e.forEach(function(g){a.add(hT(g,t,r,g,e,o))}):kUe(e)&&e.forEach(function(g,v){a.set(v,hT(g,t,r,v,e,o))});var p=u?c?q6e:YP:c?vg:ug,m=l?void 0:p(e);return jV(m||e,function(g,v){m&&(v=g,g=e[v]),UV(a,v,hT(g,t,r,v,e,o))}),a}var i4e=1,o4e=4;function a4e(e){return hT(e,i4e|o4e)}const s4e=wa(Object.freeze(Object.defineProperty({__proto__:null,default:a4e},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(mg,"__esModule",{value:!0}),mg.mergeClasses=void 0;var l4e=UP,c4e=aW(l4e),u4e=s4e,f4e=aW(u4e),h4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};function aW(e){return e&&e.__esModule?e:{default:e}}var d4e=mg.mergeClasses=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=t.default&&(0,f4e.default)(t.default)||{};return r.map(function(n){var o=t[n];return o&&(0,c4e.default)(o,function(a,s){i[s]||(i[s]={}),i[s]=h4e({},i[s],o[s])}),n}),i};mg.default=d4e;var yg={};Object.defineProperty(yg,"__esModule",{value:!0}),yg.autoprefix=void 0;var p4e=UP,sW=g4e(p4e),m4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};function g4e(e){return e&&e.__esModule?e:{default:e}}var v4e={borderRadius:function(t){return{msBorderRadius:t,MozBorderRadius:t,OBorderRadius:t,WebkitBorderRadius:t,borderRadius:t}},boxShadow:function(t){return{msBoxShadow:t,MozBoxShadow:t,OBoxShadow:t,WebkitBoxShadow:t,boxShadow:t}},userSelect:function(t){return{WebkitTouchCallout:t,KhtmlUserSelect:t,MozUserSelect:t,msUserSelect:t,WebkitUserSelect:t,userSelect:t}},flex:function(t){return{WebkitBoxFlex:t,MozBoxFlex:t,WebkitFlex:t,msFlex:t,flex:t}},flexBasis:function(t){return{WebkitFlexBasis:t,flexBasis:t}},justifyContent:function(t){return{WebkitJustifyContent:t,justifyContent:t}},transition:function(t){return{msTransition:t,MozTransition:t,OTransition:t,WebkitTransition:t,transition:t}},transform:function(t){return{msTransform:t,MozTransform:t,OTransform:t,WebkitTransform:t,transform:t}},absolute:function(t){var r=t&&t.split(" ");return{position:"absolute",top:r&&r[0],right:r&&r[1],bottom:r&&r[2],left:r&&r[3]}},extend:function(t,r){var i=r[t];return i||{extend:t}}},y4e=yg.autoprefix=function(t){var r={};return(0,sW.default)(t,function(i,n){var o={};(0,sW.default)(i,function(a,s){var c=v4e[s];c?o=m4e({},o,c(a)):o[s]=a}),r[n]=o}),r};yg.default=y4e;var bg={};Object.defineProperty(bg,"__esModule",{value:!0}),bg.hover=void 0;var b4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},_4e=E,nD=T4e(_4e);function T4e(e){return e&&e.__esModule?e:{default:e}}function E4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lW(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function S4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var w4e=bg.hover=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(i){S4e(n,i);function n(){var o,a,s,c;E4e(this,n);for(var u=arguments.length,l=Array(u),h=0;h<u;h++)l[h]=arguments[h];return c=(a=(s=lW(this,(o=n.__proto__||Object.getPrototypeOf(n)).call.apply(o,[this].concat(l))),s),s.state={hover:!1},s.handleMouseOver=function(){return s.setState({hover:!0})},s.handleMouseOut=function(){return s.setState({hover:!1})},s.render=function(){return nD.default.createElement(r,{onMouseOver:s.handleMouseOver,onMouseOut:s.handleMouseOut},nD.default.createElement(t,b4e({},s.props,s.state)))},a),lW(s,c)}return n}(nD.default.Component)};bg.default=w4e;var _g={};Object.defineProperty(_g,"__esModule",{value:!0}),_g.active=void 0;var A4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},O4e=E,iD=k4e(O4e);function k4e(e){return e&&e.__esModule?e:{default:e}}function I4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cW(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function C4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var P4e=_g.active=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(i){C4e(n,i);function n(){var o,a,s,c;I4e(this,n);for(var u=arguments.length,l=Array(u),h=0;h<u;h++)l[h]=arguments[h];return c=(a=(s=cW(this,(o=n.__proto__||Object.getPrototypeOf(n)).call.apply(o,[this].concat(l))),s),s.state={active:!1},s.handleMouseDown=function(){return s.setState({active:!0})},s.handleMouseUp=function(){return s.setState({active:!1})},s.render=function(){return iD.default.createElement(r,{onMouseDown:s.handleMouseDown,onMouseUp:s.handleMouseUp},iD.default.createElement(t,A4e({},s.props,s.state)))},a),cW(s,c)}return n}(iD.default.Component)};_g.default=P4e;var oD={};Object.defineProperty(oD,"__esModule",{value:!0});var D4e=function(t,r){var i={},n=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i[a]=s};return t===0&&n("first-child"),t===r-1&&n("last-child"),(t===0||t%2===0)&&n("even"),Math.abs(t%2)===1&&n("odd"),n("nth-child",t),i};oD.default=D4e,Object.defineProperty(no,"__esModule",{value:!0}),no.ReactCSS=no.loop=no.handleActive=aD=no.handleHover=no.hover=void 0;var x4e=ag,N4e=Ch(x4e),R4e=mg,M4e=Ch(R4e),L4e=yg,B4e=Ch(L4e),H4e=bg,uW=Ch(H4e),F4e=_g,$4e=Ch(F4e),j4e=oD,U4e=Ch(j4e);function Ch(e){return e&&e.__esModule?e:{default:e}}no.hover=uW.default;var aD=no.handleHover=uW.default;no.handleActive=$4e.default,no.loop=U4e.default;var G4e=no.ReactCSS=function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];var o=(0,N4e.default)(i),a=(0,M4e.default)(t,o);return(0,B4e.default)(a)},gt=no.default=G4e,z4e=function(t,r,i,n,o){var a=o.clientWidth,s=o.clientHeight,c=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,u=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,l=c-(o.getBoundingClientRect().left+window.pageXOffset),h=u-(o.getBoundingClientRect().top+window.pageYOffset);if(i==="vertical"){var f=void 0;if(h<0?f=0:h>s?f=1:f=Math.round(h*100/s)/100,r.a!==f)return{h:r.h,s:r.s,l:r.l,a:f,source:"rgb"}}else{var d=void 0;if(l<0?d=0:l>a?d=1:d=Math.round(l*100/a)/100,n!==d)return{h:r.h,s:r.s,l:r.l,a:d,source:"rgb"}}return null},sD={},V4e=function(t,r,i,n){if(typeof document>"u"&&!n)return null;var o=n?new n:document.createElement("canvas");o.width=i*2,o.height=i*2;var a=o.getContext("2d");return a?(a.fillStyle=t,a.fillRect(0,0,o.width,o.height),a.fillStyle=r,a.fillRect(0,0,i,i),a.translate(i,i),a.fillRect(0,0,i,i),o.toDataURL()):null},W4e=function(t,r,i,n){var o=t+"-"+r+"-"+i+(n?"-server":"");if(sD[o])return sD[o];var a=V4e(t,r,i,n);return sD[o]=a,a},fW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ph=function(t){var r=t.white,i=t.grey,n=t.size,o=t.renderers,a=t.borderRadius,s=t.boxShadow,c=t.children,u=gt({default:{grid:{borderRadius:a,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+W4e(r,i,n,o.canvas)+") center left"}}});return E.isValidElement(c)?E.cloneElement(c,fW({},c.props,{style:fW({},c.props.style,u.grid)})):E.createElement("div",{style:u.grid})};Ph.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var Y4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},q4e=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}();function X4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hW(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function K4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var lD=function(e){K4e(t,e);function t(){var r,i,n,o;X4e(this,t);for(var a=arguments.length,s=Array(a),c=0;c<a;c++)s[c]=arguments[c];return o=(i=(n=hW(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(s))),n),n.handleChange=function(u){var l=z4e(u,n.props.hsl,n.props.direction,n.props.a,n.container);l&&typeof n.props.onChange=="function"&&n.props.onChange(l,u)},n.handleMouseDown=function(u){n.handleChange(u),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},i),hW(n,o)}return q4e(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var i=this,n=this.props.rgb,o=gt({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
|
|
290
|
+
`)}function u(h){return h.map(l).join(e)}function l(h){return h==null?"":h instanceof Date?K5e(h):t.test(h+="")?'"'+h.replace(/"/g,'""')+'"':h}return{parse:i,parseRows:n,format:a,formatBody:s,formatRows:c,formatRow:u,formatValue:l}}var Z5e=M3(","),Q5e=Z5e.parse,J5e=M3(" "),eBe=J5e.parse;function L3(e,t){return function(r,i,n){arguments.length<3&&(n=i,i=null);var o=pP(r).mimeType(e);return o.row=function(a){return arguments.length?o.response(tBe(t,i=a)):i},o.row(i),n?o.get(n):o}}function tBe(e,t){return function(r){return e(r.responseText,t)}}const rBe=L3("text/csv",Q5e),nBe=L3("text/tab-separated-values",eBe),iBe=Object.freeze(Object.defineProperty({__proto__:null,csv:rBe,html:z5e,json:V5e,request:pP,text:W5e,tsv:nBe,xml:Y5e},Symbol.toStringTag,{value:"Module"}));function yP(){return yP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},yP.apply(this,arguments)}function oBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,sBe(i.key),i)}}function aBe(e,t,r){return t&&B3(e.prototype,t),r&&B3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sBe(e){var t=lBe(e,"string");return typeof t=="symbol"?t:String(t)}function lBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bP(e,t)}function bP(e,t){return bP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},bP(e,t)}function uBe(e){var t=dBe();return function(){var i=$0(e),n;if(t){var o=$0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return fBe(this,n)}}function fBe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hBe(e)}function hBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $0(e){return $0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$0(e)}let j0=function(e){cBe(r,e);var t=uBe(r);function r({items:i}){var n;return oBe(this,r),n=t.call(this),n.state={items:i,isSorting:!1},n}return aBe(r,[{key:"UNSAFE_componentWillReceiveProps",value:function(n){this.setState({items:n.items})}},{key:"onSortStart",value:function({node:n,index:o,collection:a},s){s.stopImmediatePropagation();const{onSortStart:c}=this.props;this.setState({isSorting:!0}),c&&c(this.ref),this.sortingIndex=o,this.sortStartTop=s.offsetTop,this.sortStartLeft=s.offsetLeft}},{key:"onSortMove",value:function(){}},{key:"onSortEnd",value:function({oldIndex:n,newIndex:o}){const{onSortEnd:a}=this.props,{items:s}=this.state;this.setState({items:Une(s,n,o),isSorting:!1}),a&&a(this.state.items),this.sortingIndex=null}},{key:"render",value:function(){const n=this.props.component,{items:o,isSorting:a}=this.state,s={isSorting:a,items:o,onSortEnd:this.onSortEnd.bind(this),onSortStart:this.onSortStart.bind(this),onSortMove:this.onSortMove.bind(this)};return E.createElement(n,yP({},this.props,s,{ref:c=>{this.ref=c}}))}}]),r}(E.Component);j0.propTypes={axis:N.string,className:N.string,component:N.func,editable:N.bool,handleConfigTrack:N.func,handleResizeTrack:N.func,height:N.number,helperClass:N.string,itemClass:N.string,itemControlAlignLeft:N.bool,itemReactClass:N.func,items:N.array,onAddSeries:N.func,onCloseTrack:N.func,onCloseTrackMenuOpened:N.func,onConfigTrackMenuOpened:N.func,onSortEnd:N.func,onSortStart:N.func,referenceAncestor:N.string,resizeHandles:N.object,useDragHandle:N.bool,width:N.number},j0.defaultProps={className:"list stylizedList",itemClass:"item stylizedItem",width:400,height:600};const _P={"top-right-handle":"_top-right-handle_cizw2_1","bottom-right-handle":"_bottom-right-handle_cizw2_2","top-left-handle":"_top-left-handle_cizw2_7","bottom-left-handle":"_bottom-left-handle_cizw2_8","top-draggable-handle":"_top-draggable-handle_cizw2_13","bottom-draggable-handle":"_bottom-draggable-handle_cizw2_14","left-draggable-handle":"_left-draggable-handle_cizw2_15","right-draggable-handle":"_right-draggable-handle_cizw2_16","draggable-div":"_draggable-div_cizw2_22","top-draggable-handle-grabber":"_top-draggable-handle-grabber_cizw2_27","bottom-draggable-handle-grabber":"_bottom-draggable-handle-grabber_cizw2_28","left-draggable-handle-grabber":"_left-draggable-handle-grabber_cizw2_43","right-draggable-handle-grabber":"_right-draggable-handle-grabber_cizw2_44"};function pBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,gBe(i.key),i)}}function mBe(e,t,r){return t&&H3(e.prototype,t),r&&H3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function gBe(e){var t=vBe(e,"string");return typeof t=="symbol"?t:String(t)}function vBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TP(e,t)}function TP(e,t){return TP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},TP(e,t)}function bBe(e){var t=TBe();return function(){var i=U0(e),n;if(t){var o=U0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return _Be(this,n)}}function _Be(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sn(e)}function Sn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function U0(e){return U0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},U0(e)}let F3=function(e){yBe(r,e);var t=bBe(r);function r(i){var n;return pBe(this,r),n=t.call(this,i),n.dragTopRight=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragTopRightFunc.bind(Sn(n))),n.dragTopLeft=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragTopLeftFunc.bind(Sn(n))),n.dragBottomRight=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragBottomRightFunc.bind(Sn(n))),n.dragBottomLeft=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragBottomLeftFunc.bind(Sn(n))),n.dragBottom=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragBottomFunc.bind(Sn(n))),n.dragTop=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragTopFunc.bind(Sn(n))),n.dragLeft=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragLeftFunc.bind(Sn(n))),n.dragRight=Na().on("start",n.dragStart.bind(Sn(n))).on("drag",n.dragRightFunc.bind(Sn(n))),n.minWidth=10,n.minHeight=10,n.bottomHandleWidth=20,n.state={uid:n.props.uid,width:n.props.width,height:n.props.height,top:n.props.top,left:n.props.left},n.domBody=Bt("body").node(),n}return mBe(r,[{key:"componentDidMount",value:function(){Bt(this.bottomHandle).call(this.dragBottom),Bt(this.topHandle).call(this.dragTop),Bt(this.leftHandle).call(this.dragLeft),Bt(this.rightHandle).call(this.dragRight)}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){"width"in n&&this.setState({width:n.width}),"height"in n&&this.setState({height:n.height})}},{key:"dragBottomFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartHeight+(o[1]-this.dragStartMousePos[1]);a=a>this.minHeight?a:this.minHeight,this.setState({height:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragLeftFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartWidth-(o[0]-this.dragStartMousePos[0]);a=a>this.minWidth?a:this.minWidth;let s=this.dragStartLeft+o[0]-this.dragStartMousePos[0];s=a>this.minWidth?s:this.dragStartLeft+this.dragStartWidth-this.minWidth,this.setState({left:s,width:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragTopFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartHeight-(o[1]-this.dragStartMousePos[1]);a=a>this.minHeight?a:this.minHeight;let s=this.dragStartTop+o[1]-this.dragStartMousePos[1];s=a>this.minHeight?s:this.dragStartTop+this.dragStartHeight-this.minHeight,this.setState({top:s,height:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragRightFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartWidth+(o[0]-this.dragStartMousePos[0]);a=a>this.minWidth?a:this.minWidth,this.setState({width:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragBottomLeftFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartHeight+(o[1]-this.dragStartMousePos[1]);a=a>this.minHeight?a:this.minHeight;let s=this.dragStartWidth-(o[0]-this.dragStartMousePos[0]);s=s>this.minWidth?s:this.minWidth;let c=this.dragStartLeft+o[0]-this.dragStartMousePos[0];c=s>this.minWidth?c:this.dragStartLeft+this.dragStartWidth-this.minWidth,this.setState({left:c,width:s,height:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragBottomRightFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartWidth+(o[0]-this.dragStartMousePos[0]);a=a>this.minWidth?a:this.minWidth;let s=this.dragStartHeight+(o[1]-this.dragStartMousePos[1]);s=s>this.minHeight?s:this.minHeight,this.setState({width:a,height:s}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragTopRightFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartHeight-(o[1]-this.dragStartMousePos[1]);a=a>this.minHeight?a:this.minHeight;let s=this.dragStartTop+o[1]-this.dragStartMousePos[1];s=a>this.minHeight?s:this.dragStartTop+this.dragStartHeight-this.minHeight;let c=this.dragStartWidth+(o[0]-this.dragStartMousePos[0]);c=c>this.minWidth?c:this.minWidth,this.setState({top:s,width:c,height:a}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragTopLeftFunc",value:function(n){const o=lr(n,this.domBody);let a=this.dragStartWidth-(o[0]-this.dragStartMousePos[0]);a=a>this.minWidth?a:this.minWidth;let s=this.dragStartLeft+o[0]-this.dragStartMousePos[0];s=a>this.minWidth?s:this.dragStartLeft+this.dragStartWidth-this.minWidth;let c=this.dragStartHeight-(o[1]-this.dragStartMousePos[1]);c=c>this.minHeight?c:this.minHeight;let u=this.dragStartTop+o[1]-this.dragStartMousePos[1];u=c>this.minHeight?u:this.dragStartTop+this.dragStartHeight-this.minHeight,this.setState({top:u,left:s,width:a,height:c}),n.sourceEvent.stopPropagation(),this.sizeChanged()}},{key:"dragStart",value:function(n){this.dragStartMousePos=lr(n,this.domBody),this.dragStartWidth=this.state.width,this.dragStartHeight=this.state.height,this.dragStartTop=this.state.top,this.dragStartLeft=this.state.left,n.sourceEvent.stopPropagation()}},{key:"sizeChanged",value:function(){this.props.sizeChanged&&this.props.sizeChanged(this.state)}},{key:"rotateClicked",value:function(){this.props.trackRotated(this.state.uid)}},{key:"closeClicked",value:function(){this.props.trackClosed(this.state.uid)}},{key:"render",value:function(){const n=this.props.theme===mr?"white":"black",o={top:this.state.top,left:this.state.left,width:this.state.width,height:this.state.height,opacity:this.props.opacity},a=24,s=24,c={left:this.state.width/2-a/2,width:a},u={top:this.state.height/2-s/2,height:s},l={bottom:{...c,bottom:1},top:{...c,top:1},left:{...u,left:1},right:{...u,right:1}},h=[...this.props.resizeHandles].map(f=>E.createElement("div",{key:f,ref:d=>{this[`${f}Handle`]=d},className:_P[`${f}-draggable-handle`],style:l[f],title:"Resize track"},E.createElement("div",{className:_P[`${f}-draggable-handle-grabber`],style:{borderColor:n}})));return E.createElement("div",{ref:f=>{this.divContainer=f},className:Zt(this.props.className,_P["draggable-div"]),style:o},h)}}]),r}(E.Component);F3.propTypes={className:N.string,height:N.number,left:N.number,opacity:N.number,resizeHandles:N.object,sizeChanged:N.func,top:N.number,trackClosed:N.func,trackRotated:N.func,uid:N.string,width:N.number,theme:N.symbol};const EBe=hc(F3);function SBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ABe(i.key),i)}}function wBe(e,t,r){return t&&$3(e.prototype,t),r&&$3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ABe(e){var t=OBe(e,"string");return typeof t=="symbol"?t:String(t)}function OBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EP(e,t)}function EP(e,t){return EP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},EP(e,t)}function IBe(e){var t=DBe();return function(){var i=G0(e),n;if(t){var o=G0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return CBe(this,n)}}function CBe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PBe(e)}function PBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function G0(e){return G0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},G0(e)}let j3=function(e){kBe(r,e);var t=IBe(r);function r(i){var n;return SBe(this,r),n=t.call(this,i),n.state={controlsVisible:!1},n}return wBe(r,[{key:"shouldComponentUpdate",value:function(){return!this.resizing}},{key:"handleMouseEnter",value:function(){this.setState({controlsVisible:!0})}},{key:"handleMouseLeave",value:function(){this.setState({controlsVisible:!1})}},{key:"handleMouseMove",value:function(){this.setState({controlsVisible:!0})}},{key:"getControls",value:function(){let n=null;return this.moveable?n=xS(()=>E.createElement("svg",{className:"no-zoom",height:"10px",onClick:()=>{},style:this.getMoveImgStyle(),width:"10px"},E.createElement("use",{xlinkHref:"#move"}))):n=xS(()=>E.createElement("div",null)),E.createElement("div",{style:{position:"absolute",backgroundColor:"rgba(255,255,255,0.7)",right:"3px",top:"3px",pointerEvents:"none",paddingLeft:"5px",paddingRight:"5px",borderRadius:"5px",border:"1px solid #dddddd"}},E.createElement(n,null),E.createElement("svg",{ref:o=>{this.imgConfig=o},className:"no-zoom",height:"10px",onClick:()=>{const a=Lr.findDOMNode(this.imgConfig).getBoundingClientRect();this.props.onConfigTrackMenuOpened(this.props.uid,a)},style:this.getSettingsImgStyle(),width:"10px"},E.createElement("use",{xlinkHref:"#cog"})),E.createElement("svg",{ref:o=>{this.imgAdd=o},className:"no-zoom",height:"10px",onClick:()=>this.props.onAddSeries(this.props.uid),style:this.getAddImgStyle(),width:"10px"},E.createElement("use",{xlinkHref:"#plus"})),E.createElement("svg",{ref:o=>{this.imgClose=o},className:"no-zoom",height:"10px",onClick:()=>{const a=Lr.findDOMNode(this.imgClose).getBoundingClientRect();this.props.onCloseTrackMenuOpened(this.props.uid,a)},style:this.getCloseImgStyle(),width:"10px"},E.createElement("use",{xlinkHref:"#cross"})))}}]),r}(E.Component);j3.propTypes={configMenuOpen:N.bool,onConfigTrackMenuOpened:N.func,onCloseTrackMenuOpened:N.func,onAddSeries:N.func,uid:N.string};function xBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,RBe(i.key),i)}}function NBe(e,t,r){return t&&U3(e.prototype,t),r&&U3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function RBe(e){var t=MBe(e,"string");return typeof t=="symbol"?t:String(t)}function MBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&SP(e,t)}function SP(e,t){return SP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},SP(e,t)}function BBe(e){var t=$Be();return function(){var i=z0(e),n;if(t){var o=z0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return HBe(this,n)}}function HBe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FBe(e)}function FBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $Be(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function z0(e){return z0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},z0(e)}let V0=function(e){LBe(r,e);var t=BBe(r);function r(i){var n;return xBe(this,r),n=t.call(this,i),n.moveable=!0,n}return NBe(r,[{key:"render",value:function(){return E.createElement("div",{ref:n=>{this.el=n},className:this.props.className,onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:()=>{this.handleMouseLeave()},style:{height:this.props.height,width:this.props.width}},E.createElement(EBe,{key:this.props.uid,height:this.props.height,resizeHandles:this.props.editable?this.props.resizeHandles:new Set,sizeChanged:n=>this.props.handleResizeTrack(this.props.uid,n.width,n.height),style:{background:"transparent"},uid:this.props.uid,width:this.props.width}),this.props.editable&&this.getControls(this.state.controlsVisible||this.props.item.configMenuVisible))}}]),r}(j3);V0.propTypes={className:N.string,uid:N.string,item:N.object,height:N.number,width:N.number};function jBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,GBe(i.key),i)}}function UBe(e,t,r){return t&&G3(e.prototype,t),r&&G3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function GBe(e){var t=zBe(e,"string");return typeof t=="symbol"?t:String(t)}function zBe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wP(e,t)}function wP(e,t){return wP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},wP(e,t)}function WBe(e){var t=XBe();return function(){var i=W0(e),n;if(t){var o=W0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return YBe(this,n)}}function YBe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qBe(e)}function qBe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function W0(e){return W0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},W0(e)}const Y0={pointerEvents:"all"};let z3=function(e){VBe(r,e);var t=WBe(r);function r(){return jBe(this,r),t.apply(this,arguments)}return UBe(r,[{key:"getControls",value:function(n){return E.createElement(Qb,{configMenuVisible:this.props.item.configMenuVisible,imgStyleAdd:Y0,imgStyleClose:Y0,imgStyleMove:Y0,imgStyleSettings:Y0,isMoveable:this.moveable,isVisible:n,onAddSeries:this.props.onAddSeries,onCloseTrackMenuOpened:this.props.onCloseTrackMenuOpened,onConfigTrackMenuOpened:this.props.onConfigTrackMenuOpened,uid:this.props.uid})}}]),r}(V0);const KBe=zL(e=>E.createElement(z3,{className:e.className,editable:e.editable,handleConfigTrack:e.handleConfigTrack,handleResizeTrack:e.handleResizeTrack,height:e.height,item:e.item,onAddSeries:e.onAddSeries,onCloseTrack:e.onCloseTrack,onCloseTrackMenuOpened:e.onCloseTrackMenuOpened,onConfigTrackMenuOpened:e.onConfigTrackMenuOpened,resizeHandles:e.resizeHandles,uid:e.uid,width:e.width}));function AP(){return AP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},AP.apply(this,arguments)}const V3=nie(({className:e,items:t,itemClass:r,itemControlAlignLeft:i,sortingIndex:n,useDragHandle:o,sortableHandlers:a,height:s,width:c,onCloseTrack:u,onCloseTrackMenuOpened:l,onConfigTrackMenuOpened:h,onAddSeries:f,handleConfigTrack:d,editable:p,itemReactClass:m,handleResizeTrack:g,resizeHandles:v})=>{const _=t.map((y,b)=>E.createElement(m,{key:`sci-${y.uid}`,className:r,controlAlignLeft:i,sortingIndex:n,index:b,uid:y.uid,height:y.height,width:y.width,item:y,useDragHandle:o,onCloseTrack:u,onCloseTrackMenuOpened:l,onConfigTrackMenuOpened:h,onAddSeries:f,handleConfigTrack:d,editable:p,handleResizeTrack:g,resizeHandles:v}));return E.createElement("div",AP({className:e,style:{height:s,width:c,background:"transparent"}},a),_)}),ZBe={"horizontal-tiled-plot":"_horizontal-tiled-plot_1bqkg_1"};function QBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,eHe(i.key),i)}}function JBe(e,t,r){return t&&W3(e.prototype,t),r&&W3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function eHe(e){var t=tHe(e,"string");return typeof t=="symbol"?t:String(t)}function tHe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rHe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OP(e,t)}function OP(e,t){return OP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},OP(e,t)}function nHe(e){var t=oHe();return function(){var i=X0(e),n;if(t){var o=X0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return iHe(this,n)}}function iHe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q0(e)}function q0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oHe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function X0(e){return X0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},X0(e)}function Y3(e){return e&&e.sourceEvent}let K0=function(e){rHe(r,e);var t=nHe(r);function r(i){var n;return QBe(this,r),n=t.call(this,i),n.brushBehavior=Jv().on("start",n.brushStarted.bind(q0(n))).on("brush",n.brushed.bind(q0(n))).on("end",n.brushedEnded.bind(q0(n))),n}return JBe(r,[{key:"componentDidMount",value:function(){this.props.isRangeSelectionActive&&this.addBrush()}},{key:"shouldComponentUpdate",value:function(n,o){return this.rangeSelectionTriggered?(this.rangeSelectionTriggered=!1,this.rangeSelectionTriggeredEnd&&this.props.rangeSelection!==n.rangeSelection&&this.moveBrush(n.rangeSelection[0]?n.rangeSelection[0]:null,!0),this.rangeSelectionTriggeredEnd=!1,this.state!==o):this.props.rangeSelection!==n.rangeSelection?(this.moveBrush(n.rangeSelection[0]?n.rangeSelection[0]:null,n.rangeSelectionEnd),this.state!==o):!0}},{key:"componentDidUpdate",value:function(){this.props.isRangeSelectionActive?this.addBrush():this.removeBrush()}},{key:"addBrush",value:function(){!this.brushEl||this.brushElAddedBefore===this.brushEl||(this.brushElAddedBefore&&this.brushElAddedBefore.on(".brush",null),this.brushEl.call(this.brushBehavior),this.brushElAddedBefore=this.brushEl,Bu(this.brushEl,To["track-range-selection-group-brush-selection"]))}},{key:"brushed",value:function(n){const o=this.rangeSelectionMoved;this.rangeSelectionMoved=!1,!(!Y3(n)||!this.props.onRangeSelection||o)&&(this.rangeSelectionTriggered=!0,this.props.onRangeSelection(n.selection))}},{key:"brushStarted",value:function(n){!Y3(n)||!n.selection||this.props.onRangeSelectionStart()}},{key:"brushedEnded",value:function(n){if(!this.props.is1dRangeSelection)return;const o=this.rangeSelectionMovedEnd;this.rangeSelectionMovedEnd=!1,n.selection&&n.sourceEvent&&this.props.onRangeSelection&&!o&&(this.rangeSelectionTriggered=!0,this.rangeSelectionTriggeredEnd=!0,this.props.onRangeSelectionEnd(n.selection)),n.selection||(this.rangeSelectionTriggered=!0,this.props.onRangeSelectionReset())}},{key:"moveBrush",value:function(n,o=!1){if(!this.brushEl)return;const a=n?[this.props.scale(n[0]),this.props.scale(n[1])]:null;this.rangeSelectionMoved=!0,this.rangeSelectionMovedEnd=!0,o?this.brushEl.transition().call(this.brushBehavior.move,a):this.brushEl.call(this.brushBehavior.move,a)}},{key:"removeBrush",value:function(){this.brushElAddedBefore&&(this.brushElAddedBefore.call(this.brushBehavior.move,null),this.brushElAddedBefore.on(".brush",null),this.brushElAddedBefore=void 0,this.props.onRangeSelectionReset())}},{key:"render",value:function(){const n=this.props.tracks.map(s=>s.height).reduce(Es,0),o=this.props.tracks.map(s=>Hu(s)).reduce(Xd,!1),a=this.props.isRangeSelectionActive?To["track-range-selection-active"]:To["track-range-selection"];return E.createElement("div",{className:Zt("horizontal-tiled-plot",ZBe["horizontal-tiled-plot"])},o&&E.createElement("svg",{ref:s=>{this.brushEl=Bt(s)},className:a,style:{height:n,width:this.props.width},xmlns:"http://www.w3.org/2000/svg"}),E.createElement(j0,{className:Zt(Eo.list,Eo.stylizedList),component:V3,editable:this.props.editable,handleConfigTrack:this.props.handleConfigTrack,handleResizeTrack:this.props.handleResizeTrack,height:n,helperClass:Eo.stylizedHelper,itemClass:Eo.stylizedItem,itemReactClass:KBe,items:this.props.tracks.map(s=>({configMenuVisible:s.uid===this.props.configTrackMenuId,uid:s.uid||xt.nice(),width:this.props.width,height:s.height,value:s.value})),onAddSeries:this.props.onAddSeries,onCloseTrack:this.props.onCloseTrack,onCloseTrackMenuOpened:this.props.onCloseTrackMenuOpened,onConfigTrackMenuOpened:this.props.onConfigTrackMenuOpened,onSortEnd:this.props.handleSortEnd,referenceAncestor:this.props.referenceAncestor,resizeHandles:this.props.resizeHandles,useDragHandle:!0,width:this.props.width}))}}]),r}(E.Component);K0.propTypes={configTrackMenuId:N.string,editable:N.bool,handleConfigTrack:N.func,handleResizeTrack:N.func,handleSortEnd:N.func,is1dRangeSelection:N.bool,isRangeSelectionActive:N.bool,onAddSeries:N.func,onCloseTrack:N.func,onCloseTrackMenuOpened:N.func,onConfigTrackMenuOpened:N.func,onRangeSelection:N.func,onRangeSelectionEnd:N.func,onRangeSelectionReset:N.func,onRangeSelectionStart:N.func,rangeSelection:N.array,rangeSelectionEnd:N.bool,referenceAncestor:N.func,resizeHandles:N.object,scale:N.func,tracks:N.array,width:N.number};function aHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,lHe(i.key),i)}}function sHe(e,t,r){return t&&q3(e.prototype,t),r&&q3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lHe(e){var t=cHe(e,"string");return typeof t=="symbol"?t:String(t)}function cHe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uHe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kP(e,t)}function kP(e,t){return kP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},kP(e,t)}function fHe(e){var t=pHe();return function(){var i=Z0(e),n;if(t){var o=Z0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return hHe(this,n)}}function hHe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dHe(e)}function dHe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pHe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Z0(e){return Z0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Z0(e)}const Q0={pointerEvents:"all"};let X3=function(e){uHe(r,e);var t=fHe(r);function r(){return aHe(this,r),t.apply(this,arguments)}return sHe(r,[{key:"getControls",value:function(n){return E.createElement(Qb,{imgStyleAdd:Q0,imgStyleClose:Q0,imgStyleMove:Q0,imgStyleSettings:Q0,isAlignLeft:this.props.controlAlignLeft,isMoveable:this.moveable,isVertical:!0,isVisible:n,onAddSeries:this.props.onAddSeries,onCloseTrackMenuOpened:this.props.onCloseTrackMenuOpened,onConfigTrackMenuOpened:this.props.onConfigTrackMenuOpened,uid:this.props.uid})}}]),r}(V0);function mHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K3(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,vHe(i.key),i)}}function gHe(e,t,r){return t&&K3(e.prototype,t),r&&K3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vHe(e){var t=yHe(e,"string");return typeof t=="symbol"?t:String(t)}function yHe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function J0(){return typeof Reflect<"u"&&Reflect.get?J0=Reflect.get.bind():J0=function(t,r,i){var n=bHe(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?t:i):o.value}},J0.apply(this,arguments)}function bHe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ah(e),e!==null););return e}function _He(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IP(e,t)}function IP(e,t){return IP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},IP(e,t)}function THe(e){var t=SHe();return function(){var i=Ah(e),n;if(t){var o=Ah(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return EHe(this,n)}}function EHe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z3(e)}function Z3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SHe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ah(e)}let wHe=function(e){_He(r,e);var t=THe(r);function r(i,n){var o;mHe(this,r),o=t.call(this,i,n);const{registerViewportChanged:a,removeViewportChanged:s}=i,c=xt.nice();return o.uid=c,o.removeViewportChanged=s,o.viewportXDomain=null,o.viewportYDomain=null,a(c,o.viewportChanged.bind(Z3(o))),o}return gHe(r,[{key:"viewportChanged",value:function(n,o){const a=n.domain(),s=o.domain();this.viewportXDomain=a,this.viewportYDomain=s,this.draw()}},{key:"draw",value:function(){const n=this.pMain;if(!this.viewportXDomain||!this.viewportYDomain)return;n.clear(),n.lineStyle(1,255,1),n.beginFill(16740363,1);const o=this._xScale(this.viewportXDomain[0]),a=this._yScale(this.viewportYDomain[0]),s=this._xScale(this.viewportXDomain[1])-this._xScale(this.viewportXDomain[0]),c=this._yScale(this.viewportYDomain[1])-this._yScale(this.viewportYDomain[0]);this.pMain.drawRect(o,a,s,c)}},{key:"zoomed",value:function(n,o){this.xScale(n),this.yScale(o),this.draw()}},{key:"setPosition",value:function(n){J0(Ah(r.prototype),"setPosition",this).call(this,n),this.pMain.position.y=this.position[1],this.pMain.position.x=this.position[0],this.draw()}}]),r}(ei);function Q3(e){this.size=0,this.limit=e,this._keymap={}}function AHe(e,t){const r={key:e,value:t};if(this._keymap[e]=r,this.tail?(this.tail.newer=r,r.older=this.tail):this.head=r,this.tail=r,this.size===this.limit)return this.shift();this.size+=1}function OHe(){const e=this.head;return e&&(this.head.newer?(this.head=this.head.newer,this.head.older=void 0):(this.head=void 0,this.tail=void 0),e.newer=void 0,e.older=void 0,delete this._keymap[e.key],this.size-=1),e}function kHe(e,t){const r=this._keymap[e];if(r!==void 0)return r===this.tail||(r.newer&&(r===this.head&&(this.head=r.newer),r.newer.older=r.older),r.older&&(r.older.newer=r.newer),r.newer=void 0,r.older=this.tail,this.tail&&(this.tail.newer=r),this.tail=r),t?r:r.value}function IHe(e){return this._keymap[e]}function CHe(e,t){const r=this.get(e,!0);let i;return r?(i=r.value,r.value=t):(i=this.put(e,t),i&&(i=i.value)),i}function PHe(e){const t=this._keymap[e];if(t)return delete this._keymap[t.key],t.newer&&t.older?(t.older.newer=t.newer,t.newer.older=t.older):t.newer?(t.newer.older=void 0,this.head=t.newer):t.older?(t.older.newer=void 0,this.tail=t.older):(this.head=void 0,this.tail=void 0),this.size-=1,t.value}function DHe(){this.head=void 0,this.tail=void 0,this.size=0,this._keymap={}}function xHe(){return Object.keys(this._keymap)}function NHe(e,t,r){let i;if(t===!0?(r=!0,t=void 0):typeof t!="object"&&(t=this),r)for(i=this.tail;i;)e.call(t,i.key,i.value,this),i=i.older;else for(i=this.head;i;)e.call(t,i.key,i.value,this),i=i.newer}function RHe(){const e=[];let t=this.head;for(;t;)e.push({key:t.key.toJSON(),value:t.value.toJSON()}),t=t.newer;return e}function MHe(){let e="",t=this.head;for(;t;)e+=`${String(t.key)}:${t.value}`,t=t.newer,t&&(e+=" < ");return e}Object.assign(Q3.prototype,{put:AHe,get:kHe,find:IHe,keys:xHe,set:CHe,shift:OHe,remove:PHe,removeAll:DHe,forEach:NHe,toJSON:RHe,toString:MHe});const CP="1.13.4",PP={button:"_button_1wnjn_1","button-shortcut":"_button-shortcut_1wnjn_35"},cs=E.forwardRef((e,t)=>E.createElement("button",{ref:t,className:PP[e.styleName]??PP.button,disabled:e.disable,onBlur:e.onBlur,onClick:e.onClick,onMouseDown:e.onMouseDown,onMouseOut:e.onMouseOut,onMouseUp:e.onMouseUp,type:"button"},e.children,e.shortcut&&E.createElement("span",{className:PP["button-shortcut"]},e.shortcut)));cs.defaultProps={onClick:()=>{},styleName:"",type:"button"},cs.propTypes={children:N.any,disable:N.bool,onBlur:N.func,onClick:N.func,onMouseDown:N.func,onMouseOut:N.func,onMouseUp:N.func,shortcut:N.string,type:N.string,styleName:N.string};const LHe={cross:"_cross_2ke8w_1"};function J3(){return E.createElement("div",{className:LHe.cross})}function DP(){return DP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},DP.apply(this,arguments)}const{Provider:BHe,Consumer:HHe}=E.createContext({close:po,open:po}),eT=e=>E.forwardRef((t,r)=>E.createElement(HHe,null,i=>E.createElement(e,DP({ref:r},t,{modal:i})))),Oh={"modal-background":"_modal-background_zzhoe_1","fade-in":"_fade-in_zzhoe_1","modal-hide":"_modal-hide_zzhoe_13","modal-wrap":"_modal-wrap_zzhoe_17","modal-window":"_modal-window_zzhoe_25","fade-scale-in":"_fade-scale-in_zzhoe_1","modal-window-max-height":"_modal-window-max-height_zzhoe_38","modal-content":"_modal-content_zzhoe_42"};function xP(e){const t=()=>{e.modal.close(),e.onClose&&e.onClose()};return E.createElement("div",{className:Zt(Oh["modal-background"],{[Oh["modal-hide"]]:e.hide})},E.createElement("div",{className:Oh["modal-wrap"]},E.createElement("div",{className:Zt(Oh["modal-window"],{[Oh["modal-window-max-height"]]:e.maxHeight})},e.closeButton&&E.createElement(cs,{onClick:t},E.createElement(J3,null)),E.createElement("div",{className:Oh["modal-content"]},e.children))))}xP.defaultProps={closeButton:!0,hide:!1,maxHeight:!1},xP.propTypes={children:N.element.isRequired,closeButton:N.bool,hide:N.bool,maxHeight:N.bool,modal:N.object.isRequired,onClose:N.func};const FHe=eT(xP),NP={"dialog-header":"_dialog-header_wp50s_1","dialog-main-max-height":"_dialog-main-max-height_wp50s_20","dialog-footer":"_dialog-footer_wp50s_31","dialog-footer-max-height":"_dialog-footer-max-height_wp50s_31"};function RP(e){const t=()=>{e.modal.close(),e.onCancel&&e.onCancel()},r=()=>{e.modal.close(),e.onOkay&&e.onOkay()};return E.createElement(FHe,{closeButton:!1,hide:e.hide,maxHeight:e.maxHeight},E.createElement(E.Fragment,null,E.createElement("header",{className:NP["dialog-header"]},E.createElement("h3",null,e.title),E.createElement(cs,{onClick:t},E.createElement(J3,null))),e.maxHeight?E.createElement("main",{className:Zt(e.maxHeight&&NP["dialog-main-max-height"])},e.children):E.createElement("main",null,e.children),E.createElement("footer",{className:NP[e.maxHeight?"dialog-footer-max-height":"dialog-footer"]},e.okayOnly?E.createElement("div",null):E.createElement(cs,{onClick:t,shortcut:e.cancelShortcut},e.cancelTitle),E.createElement(cs,{onClick:r,shortcut:e.okayShortcut},e.okayTitle))))}RP.defaultProps={cancelTitle:"Cancel",hide:!1,maxHeight:!1,okayOnly:!1,okayTitle:"Ok"},RP.propTypes={cancelShortcut:N.string,cancelTitle:N.string,children:N.object,hide:N.bool,maxHeight:N.bool,modal:N.object.isRequired,okayShortcut:N.string,okayTitle:N.string,okayOnly:N.bool,onCancel:N.func.isRequired,onOkay:N.func.isRequired,title:N.string.isRequired};const og=eT(RP);var no={},ag={},$He=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;const eV=$He;var jHe=typeof self=="object"&&self&&self.Object===Object&&self,UHe=eV||jHe||Function("return this")();const xo=UHe;var GHe=xo.Symbol;const Ea=GHe;var tV=Object.prototype,zHe=tV.hasOwnProperty,VHe=tV.toString,sg=Ea?Ea.toStringTag:void 0;function WHe(e){var t=zHe.call(e,sg),r=e[sg];try{e[sg]=void 0;var i=!0}catch{}var n=VHe.call(e);return i&&(t?e[sg]=r:delete e[sg]),n}var YHe=Object.prototype,qHe=YHe.toString;function XHe(e){return qHe.call(e)}var KHe="[object Null]",ZHe="[object Undefined]",rV=Ea?Ea.toStringTag:void 0;function ul(e){return e==null?e===void 0?ZHe:KHe:rV&&rV in Object(e)?WHe(e):XHe(e)}var QHe=Array.isArray;const ci=QHe;function No(e){return e!=null&&typeof e=="object"}var JHe="[object String]";function eFe(e){return typeof e=="string"||!ci(e)&&No(e)&&ul(e)==JHe}const tFe=wa(Object.freeze(Object.defineProperty({__proto__:null,default:eFe},Symbol.toStringTag,{value:"Module"})));function rFe(e){return function(t,r,i){for(var n=-1,o=Object(t),a=i(t),s=a.length;s--;){var c=a[e?s:++n];if(r(o[c],c,o)===!1)break}return t}}var nFe=rFe();const nV=nFe;function iFe(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var oFe="[object Arguments]";function iV(e){return No(e)&&ul(e)==oFe}var oV=Object.prototype,aFe=oV.hasOwnProperty,sFe=oV.propertyIsEnumerable,lFe=iV(function(){return arguments}())?iV:function(e){return No(e)&&aFe.call(e,"callee")&&!sFe.call(e,"callee")};const tT=lFe;function cFe(){return!1}var aV=typeof jt=="object"&&jt&&!jt.nodeType&&jt,sV=aV&&typeof module=="object"&&module&&!module.nodeType&&module,uFe=sV&&sV.exports===aV,lV=uFe?xo.Buffer:void 0,fFe=lV?lV.isBuffer:void 0,hFe=fFe||cFe;const lg=hFe;var dFe=9007199254740991,pFe=/^(?:0|[1-9]\d*)$/;function MP(e,t){var r=typeof e;return t=t??dFe,!!t&&(r=="number"||r!="symbol"&&pFe.test(e))&&e>-1&&e%1==0&&e<t}var mFe=9007199254740991;function LP(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=mFe}var gFe="[object Arguments]",vFe="[object Array]",yFe="[object Boolean]",bFe="[object Date]",_Fe="[object Error]",TFe="[object Function]",EFe="[object Map]",SFe="[object Number]",wFe="[object Object]",AFe="[object RegExp]",OFe="[object Set]",kFe="[object String]",IFe="[object WeakMap]",CFe="[object ArrayBuffer]",PFe="[object DataView]",DFe="[object Float32Array]",xFe="[object Float64Array]",NFe="[object Int8Array]",RFe="[object Int16Array]",MFe="[object Int32Array]",LFe="[object Uint8Array]",BFe="[object Uint8ClampedArray]",HFe="[object Uint16Array]",FFe="[object Uint32Array]",wr={};wr[DFe]=wr[xFe]=wr[NFe]=wr[RFe]=wr[MFe]=wr[LFe]=wr[BFe]=wr[HFe]=wr[FFe]=!0,wr[gFe]=wr[vFe]=wr[CFe]=wr[yFe]=wr[PFe]=wr[bFe]=wr[_Fe]=wr[TFe]=wr[EFe]=wr[SFe]=wr[wFe]=wr[AFe]=wr[OFe]=wr[kFe]=wr[IFe]=!1;function $Fe(e){return No(e)&&LP(e.length)&&!!wr[ul(e)]}function BP(e){return function(t){return e(t)}}var cV=typeof jt=="object"&&jt&&!jt.nodeType&&jt,cg=cV&&typeof module=="object"&&module&&!module.nodeType&&module,jFe=cg&&cg.exports===cV,HP=jFe&&eV.process,UFe=function(){try{var e=cg&&cg.require&&cg.require("util").types;return e||HP&&HP.binding&&HP.binding("util")}catch{}}();const kh=UFe;var uV=kh&&kh.isTypedArray,GFe=uV?BP(uV):$Fe;const FP=GFe;var zFe=Object.prototype,VFe=zFe.hasOwnProperty;function fV(e,t){var r=ci(e),i=!r&&tT(e),n=!r&&!i&&lg(e),o=!r&&!i&&!n&&FP(e),a=r||i||n||o,s=a?iFe(e.length,String):[],c=s.length;for(var u in e)(t||VFe.call(e,u))&&!(a&&(u=="length"||n&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||MP(u,c)))&&s.push(u);return s}var WFe=Object.prototype;function $P(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||WFe;return e===r}function hV(e,t){return function(r){return e(t(r))}}var YFe=hV(Object.keys,Object);const qFe=YFe;var XFe=Object.prototype,KFe=XFe.hasOwnProperty;function ZFe(e){if(!$P(e))return qFe(e);var t=[];for(var r in Object(e))KFe.call(e,r)&&r!="constructor"&&t.push(r);return t}function Hi(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var QFe="[object AsyncFunction]",JFe="[object Function]",e$e="[object GeneratorFunction]",t$e="[object Proxy]";function jP(e){if(!Hi(e))return!1;var t=ul(e);return t==JFe||t==e$e||t==QFe||t==t$e}function Ih(e){return e!=null&&LP(e.length)&&!jP(e)}function ug(e){return Ih(e)?fV(e):ZFe(e)}function dV(e,t){return e&&nV(e,t,ug)}function rT(e){return e}function pV(e){return typeof e=="function"?e:rT}function r$e(e,t){return e&&dV(e,pV(t))}const UP=wa(Object.freeze(Object.defineProperty({__proto__:null,default:r$e},Symbol.toStringTag,{value:"Module"})));var n$e=hV(Object.getPrototypeOf,Object);const GP=n$e;var i$e="[object Object]",o$e=Function.prototype,a$e=Object.prototype,mV=o$e.toString,s$e=a$e.hasOwnProperty,l$e=mV.call(Object);function gV(e){if(!No(e)||ul(e)!=i$e)return!1;var t=GP(e);if(t===null)return!0;var r=s$e.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&mV.call(r)==l$e}const c$e=wa(Object.freeze(Object.defineProperty({__proto__:null,default:gV},Symbol.toStringTag,{value:"Module"})));function vV(e,t){for(var r=-1,i=e==null?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}function u$e(){this.__data__=[],this.size=0}function fg(e,t){return e===t||e!==e&&t!==t}function nT(e,t){for(var r=e.length;r--;)if(fg(e[r][0],t))return r;return-1}var f$e=Array.prototype,h$e=f$e.splice;function d$e(e){var t=this.__data__,r=nT(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():h$e.call(t,r,1),--this.size,!0}function p$e(e){var t=this.__data__,r=nT(t,e);return r<0?void 0:t[r][1]}function m$e(e){return nT(this.__data__,e)>-1}function g$e(e,t){var r=this.__data__,i=nT(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function us(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}us.prototype.clear=u$e,us.prototype.delete=d$e,us.prototype.get=p$e,us.prototype.has=m$e,us.prototype.set=g$e;function v$e(){this.__data__=new us,this.size=0}function y$e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function b$e(e){return this.__data__.get(e)}function _$e(e){return this.__data__.has(e)}var T$e=xo["__core-js_shared__"];const zP=T$e;var yV=function(){var e=/[^.]+$/.exec(zP&&zP.keys&&zP.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function E$e(e){return!!yV&&yV in e}var S$e=Function.prototype,w$e=S$e.toString;function Xc(e){if(e!=null){try{return w$e.call(e)}catch{}try{return e+""}catch{}}return""}var A$e=/[\\^$.*+?()[\]{}|]/g,O$e=/^\[object .+?Constructor\]$/,k$e=Function.prototype,I$e=Object.prototype,C$e=k$e.toString,P$e=I$e.hasOwnProperty,D$e=RegExp("^"+C$e.call(P$e).replace(A$e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function x$e(e){if(!Hi(e)||E$e(e))return!1;var t=jP(e)?D$e:O$e;return t.test(Xc(e))}function N$e(e,t){return e?.[t]}function Kc(e,t){var r=N$e(e,t);return x$e(r)?r:void 0}var R$e=Kc(xo,"Map");const hg=R$e;var M$e=Kc(Object,"create");const dg=M$e;function L$e(){this.__data__=dg?dg(null):{},this.size=0}function B$e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var H$e="__lodash_hash_undefined__",F$e=Object.prototype,$$e=F$e.hasOwnProperty;function j$e(e){var t=this.__data__;if(dg){var r=t[e];return r===H$e?void 0:r}return $$e.call(t,e)?t[e]:void 0}var U$e=Object.prototype,G$e=U$e.hasOwnProperty;function z$e(e){var t=this.__data__;return dg?t[e]!==void 0:G$e.call(t,e)}var V$e="__lodash_hash_undefined__";function W$e(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=dg&&t===void 0?V$e:t,this}function Zc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Zc.prototype.clear=L$e,Zc.prototype.delete=B$e,Zc.prototype.get=j$e,Zc.prototype.has=z$e,Zc.prototype.set=W$e;function Y$e(){this.size=0,this.__data__={hash:new Zc,map:new(hg||us),string:new Zc}}function q$e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function iT(e,t){var r=e.__data__;return q$e(t)?r[typeof t=="string"?"string":"hash"]:r.map}function X$e(e){var t=iT(this,e).delete(e);return this.size-=t?1:0,t}function K$e(e){return iT(this,e).get(e)}function Z$e(e){return iT(this,e).has(e)}function Q$e(e,t){var r=iT(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}function fs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}fs.prototype.clear=Y$e,fs.prototype.delete=X$e,fs.prototype.get=K$e,fs.prototype.has=Z$e,fs.prototype.set=Q$e;var J$e=200;function eje(e,t){var r=this.__data__;if(r instanceof us){var i=r.__data__;if(!hg||i.length<J$e-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new fs(i)}return r.set(e,t),this.size=r.size,this}function Ro(e){var t=this.__data__=new us(e);this.size=t.size}Ro.prototype.clear=v$e,Ro.prototype.delete=y$e,Ro.prototype.get=b$e,Ro.prototype.has=_$e,Ro.prototype.set=eje;var tje="__lodash_hash_undefined__";function rje(e){return this.__data__.set(e,tje),this}function nje(e){return this.__data__.has(e)}function oT(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new fs;++t<r;)this.add(e[t])}oT.prototype.add=oT.prototype.push=rje,oT.prototype.has=nje;function ije(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}function oje(e,t){return e.has(t)}var aje=1,sje=2;function bV(e,t,r,i,n,o){var a=r&aje,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var u=o.get(e),l=o.get(t);if(u&&l)return u==t&&l==e;var h=-1,f=!0,d=r&sje?new oT:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],m=t[h];if(i)var g=a?i(m,p,h,t,e,o):i(p,m,h,e,t,o);if(g!==void 0){if(g)continue;f=!1;break}if(d){if(!ije(t,function(v,_){if(!oje(d,_)&&(p===v||n(p,v,r,i,o)))return d.push(_)})){f=!1;break}}else if(!(p===m||n(p,m,r,i,o))){f=!1;break}}return o.delete(e),o.delete(t),f}var lje=xo.Uint8Array;const aT=lje;function cje(e){var t=-1,r=Array(e.size);return e.forEach(function(i,n){r[++t]=[n,i]}),r}function uje(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var fje=1,hje=2,dje="[object Boolean]",pje="[object Date]",mje="[object Error]",gje="[object Map]",vje="[object Number]",yje="[object RegExp]",bje="[object Set]",_je="[object String]",Tje="[object Symbol]",Eje="[object ArrayBuffer]",Sje="[object DataView]",_V=Ea?Ea.prototype:void 0,VP=_V?_V.valueOf:void 0;function wje(e,t,r,i,n,o,a){switch(r){case Sje:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Eje:return!(e.byteLength!=t.byteLength||!o(new aT(e),new aT(t)));case dje:case pje:case vje:return fg(+e,+t);case mje:return e.name==t.name&&e.message==t.message;case yje:case _je:return e==t+"";case gje:var s=cje;case bje:var c=i&fje;if(s||(s=uje),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;i|=hje,a.set(e,t);var l=bV(s(e),s(t),i,n,o,a);return a.delete(e),l;case Tje:if(VP)return VP.call(e)==VP.call(t)}return!1}function TV(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}function EV(e,t,r){var i=t(e);return ci(e)?i:TV(i,r(e))}function Aje(e,t){for(var r=-1,i=e==null?0:e.length,n=0,o=[];++r<i;){var a=e[r];t(a,r,e)&&(o[n++]=a)}return o}function SV(){return[]}var Oje=Object.prototype,kje=Oje.propertyIsEnumerable,wV=Object.getOwnPropertySymbols,Ije=wV?function(e){return e==null?[]:(e=Object(e),Aje(wV(e),function(t){return kje.call(e,t)}))}:SV;const WP=Ije;function YP(e){return EV(e,ug,WP)}var Cje=1,Pje=Object.prototype,Dje=Pje.hasOwnProperty;function xje(e,t,r,i,n,o){var a=r&Cje,s=YP(e),c=s.length,u=YP(t),l=u.length;if(c!=l&&!a)return!1;for(var h=c;h--;){var f=s[h];if(!(a?f in t:Dje.call(t,f)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var g=a;++h<c;){f=s[h];var v=e[f],_=t[f];if(i)var y=a?i(_,v,f,t,e,o):i(v,_,f,e,t,o);if(!(y===void 0?v===_||n(v,_,r,i,o):y)){m=!1;break}g||(g=f=="constructor")}if(m&&!g){var b=e.constructor,T=t.constructor;b!=T&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(m=!1)}return o.delete(e),o.delete(t),m}var Nje=Kc(xo,"DataView");const qP=Nje;var Rje=Kc(xo,"Promise");const XP=Rje;var Mje=Kc(xo,"Set");const KP=Mje;var Lje=Kc(xo,"WeakMap");const ZP=Lje;var AV="[object Map]",Bje="[object Object]",OV="[object Promise]",kV="[object Set]",IV="[object WeakMap]",CV="[object DataView]",Hje=Xc(qP),Fje=Xc(hg),$je=Xc(XP),jje=Xc(KP),Uje=Xc(ZP),Qc=ul;(qP&&Qc(new qP(new ArrayBuffer(1)))!=CV||hg&&Qc(new hg)!=AV||XP&&Qc(XP.resolve())!=OV||KP&&Qc(new KP)!=kV||ZP&&Qc(new ZP)!=IV)&&(Qc=function(e){var t=ul(e),r=t==Bje?e.constructor:void 0,i=r?Xc(r):"";if(i)switch(i){case Hje:return CV;case Fje:return AV;case $je:return OV;case jje:return kV;case Uje:return IV}return t});const pg=Qc;var Gje=1,PV="[object Arguments]",DV="[object Array]",sT="[object Object]",zje=Object.prototype,xV=zje.hasOwnProperty;function Vje(e,t,r,i,n,o){var a=ci(e),s=ci(t),c=a?DV:pg(e),u=s?DV:pg(t);c=c==PV?sT:c,u=u==PV?sT:u;var l=c==sT,h=u==sT,f=c==u;if(f&&lg(e)){if(!lg(t))return!1;a=!0,l=!1}if(f&&!l)return o||(o=new Ro),a||FP(e)?bV(e,t,r,i,n,o):wje(e,t,c,r,i,n,o);if(!(r&Gje)){var d=l&&xV.call(e,"__wrapped__"),p=h&&xV.call(t,"__wrapped__");if(d||p){var m=d?e.value():e,g=p?t.value():t;return o||(o=new Ro),n(m,g,r,i,o)}}return f?(o||(o=new Ro),xje(e,t,r,i,n,o)):!1}function QP(e,t,r,i,n){return e===t?!0:e==null||t==null||!No(e)&&!No(t)?e!==e&&t!==t:Vje(e,t,r,i,QP,n)}var Wje=1,Yje=2;function qje(e,t,r,i){var n=r.length,o=n,a=!i;if(e==null)return!o;for(e=Object(e);n--;){var s=r[n];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){s=r[n];var c=s[0],u=e[c],l=s[1];if(a&&s[2]){if(u===void 0&&!(c in e))return!1}else{var h=new Ro;if(i)var f=i(u,l,c,e,t,h);if(!(f===void 0?QP(l,u,Wje|Yje,i,h):f))return!1}}return!0}function NV(e){return e===e&&!Hi(e)}function Xje(e){for(var t=ug(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,NV(n)]}return t}function RV(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Kje(e){var t=Xje(e);return t.length==1&&t[0][2]?RV(t[0][0],t[0][1]):function(r){return r===e||qje(r,e,t)}}var Zje="[object Symbol]";function lT(e){return typeof e=="symbol"||No(e)&&ul(e)==Zje}var Qje=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jje=/^\w*$/;function JP(e,t){if(ci(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||lT(e)?!0:Jje.test(e)||!Qje.test(e)||t!=null&&e in Object(t)}var e6e="Expected a function";function eD(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(e6e);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var a=e.apply(this,i);return r.cache=o.set(n,a)||o,a};return r.cache=new(eD.Cache||fs),r}eD.Cache=fs;var t6e=500;function r6e(e){var t=eD(e,function(i){return r.size===t6e&&r.clear(),i}),r=t.cache;return t}var n6e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i6e=/\\(\\)?/g,o6e=r6e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(n6e,function(r,i,n,o){t.push(n?o.replace(i6e,"$1"):i||r)}),t});const a6e=o6e;var s6e=1/0,MV=Ea?Ea.prototype:void 0,LV=MV?MV.toString:void 0;function BV(e){if(typeof e=="string")return e;if(ci(e))return vV(e,BV)+"";if(lT(e))return LV?LV.call(e):"";var t=e+"";return t=="0"&&1/e==-s6e?"-0":t}function l6e(e){return e==null?"":BV(e)}function HV(e,t){return ci(e)?e:JP(e,t)?[e]:a6e(l6e(e))}var c6e=1/0;function cT(e){if(typeof e=="string"||lT(e))return e;var t=e+"";return t=="0"&&1/e==-c6e?"-0":t}function FV(e,t){t=HV(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[cT(t[r++])];return r&&r==i?e:void 0}function u6e(e,t,r){var i=e==null?void 0:FV(e,t);return i===void 0?r:i}function f6e(e,t){return e!=null&&t in Object(e)}function h6e(e,t,r){t=HV(t,e);for(var i=-1,n=t.length,o=!1;++i<n;){var a=cT(t[i]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++i!=n?o:(n=e==null?0:e.length,!!n&&LP(n)&&MP(a,n)&&(ci(e)||tT(e)))}function d6e(e,t){return e!=null&&h6e(e,t,f6e)}var p6e=1,m6e=2;function g6e(e,t){return JP(e)&&NV(t)?RV(cT(e),t):function(r){var i=u6e(r,e);return i===void 0&&i===t?d6e(r,e):QP(t,i,p6e|m6e)}}function v6e(e){return function(t){return t?.[e]}}function y6e(e){return function(t){return FV(t,e)}}function b6e(e){return JP(e)?v6e(cT(e)):y6e(e)}function _6e(e){return typeof e=="function"?e:e==null?rT:typeof e=="object"?ci(e)?g6e(e[0],e[1]):Kje(e):b6e(e)}function T6e(e,t){return function(r,i){if(r==null)return r;if(!Ih(r))return e(r,i);for(var n=r.length,o=t?n:-1,a=Object(r);(t?o--:++o<n)&&i(a[o],o,a)!==!1;);return r}}var E6e=T6e(dV);const $V=E6e;function S6e(e,t){var r=-1,i=Ih(e)?Array(e.length):[];return $V(e,function(n,o,a){i[++r]=t(n,o,a)}),i}function fl(e,t){var r=ci(e)?vV:S6e;return r(e,_6e(t))}const w6e=wa(Object.freeze(Object.defineProperty({__proto__:null,default:fl},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(ag,"__esModule",{value:!0}),ag.flattenNames=void 0;var A6e=tFe,O6e=uT(A6e),k6e=UP,I6e=uT(k6e),C6e=c$e,P6e=uT(C6e),D6e=w6e,x6e=uT(D6e);function uT(e){return e&&e.__esModule?e:{default:e}}var N6e=ag.flattenNames=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[];return(0,x6e.default)(t,function(i){Array.isArray(i)?e(i).map(function(n){return r.push(n)}):(0,P6e.default)(i)?(0,I6e.default)(i,function(n,o){n===!0&&r.push(o),r.push(o+"-"+n)}):(0,O6e.default)(i)&&r.push(i)}),r};ag.default=N6e;var mg={};function jV(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}var R6e=function(){try{var e=Kc(Object,"defineProperty");return e({},"",{}),e}catch{}}();const fT=R6e;function tD(e,t,r){t=="__proto__"&&fT?fT(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var M6e=Object.prototype,L6e=M6e.hasOwnProperty;function UV(e,t,r){var i=e[t];(!(L6e.call(e,t)&&fg(i,r))||r===void 0&&!(t in e))&&tD(e,t,r)}function gg(e,t,r,i){var n=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=i?i(r[s],e[s],s,r,e):void 0;c===void 0&&(c=e[s]),n?tD(r,s,c):UV(r,s,c)}return r}function B6e(e,t){return e&&gg(t,ug(t),e)}function H6e(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var F6e=Object.prototype,$6e=F6e.hasOwnProperty;function j6e(e){if(!Hi(e))return H6e(e);var t=$P(e),r=[];for(var i in e)i=="constructor"&&(t||!$6e.call(e,i))||r.push(i);return r}function vg(e){return Ih(e)?fV(e,!0):j6e(e)}function U6e(e,t){return e&&gg(t,vg(t),e)}var GV=typeof jt=="object"&&jt&&!jt.nodeType&&jt,zV=GV&&typeof module=="object"&&module&&!module.nodeType&&module,G6e=zV&&zV.exports===GV,VV=G6e?xo.Buffer:void 0,WV=VV?VV.allocUnsafe:void 0;function YV(e,t){if(t)return e.slice();var r=e.length,i=WV?WV(r):new e.constructor(r);return e.copy(i),i}function qV(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function z6e(e,t){return gg(e,WP(e),t)}var V6e=Object.getOwnPropertySymbols,W6e=V6e?function(e){for(var t=[];e;)TV(t,WP(e)),e=GP(e);return t}:SV;const XV=W6e;function Y6e(e,t){return gg(e,XV(e),t)}function q6e(e){return EV(e,vg,XV)}var X6e=Object.prototype,K6e=X6e.hasOwnProperty;function Z6e(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&K6e.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function rD(e){var t=new e.constructor(e.byteLength);return new aT(t).set(new aT(e)),t}function Q6e(e,t){var r=t?rD(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var J6e=/\w*$/;function eUe(e){var t=new e.constructor(e.source,J6e.exec(e));return t.lastIndex=e.lastIndex,t}var KV=Ea?Ea.prototype:void 0,ZV=KV?KV.valueOf:void 0;function tUe(e){return ZV?Object(ZV.call(e)):{}}function QV(e,t){var r=t?rD(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var rUe="[object Boolean]",nUe="[object Date]",iUe="[object Map]",oUe="[object Number]",aUe="[object RegExp]",sUe="[object Set]",lUe="[object String]",cUe="[object Symbol]",uUe="[object ArrayBuffer]",fUe="[object DataView]",hUe="[object Float32Array]",dUe="[object Float64Array]",pUe="[object Int8Array]",mUe="[object Int16Array]",gUe="[object Int32Array]",vUe="[object Uint8Array]",yUe="[object Uint8ClampedArray]",bUe="[object Uint16Array]",_Ue="[object Uint32Array]";function TUe(e,t,r){var i=e.constructor;switch(t){case uUe:return rD(e);case rUe:case nUe:return new i(+e);case fUe:return Q6e(e,r);case hUe:case dUe:case pUe:case mUe:case gUe:case vUe:case yUe:case bUe:case _Ue:return QV(e,r);case iUe:return new i;case oUe:case lUe:return new i(e);case aUe:return eUe(e);case sUe:return new i;case cUe:return tUe(e)}}var JV=Object.create,EUe=function(){function e(){}return function(t){if(!Hi(t))return{};if(JV)return JV(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const SUe=EUe;function eW(e){return typeof e.constructor=="function"&&!$P(e)?SUe(GP(e)):{}}var wUe="[object Map]";function AUe(e){return No(e)&&pg(e)==wUe}var tW=kh&&kh.isMap,OUe=tW?BP(tW):AUe;const kUe=OUe;var IUe="[object Set]";function CUe(e){return No(e)&&pg(e)==IUe}var rW=kh&&kh.isSet,PUe=rW?BP(rW):CUe;const DUe=PUe;var xUe=1,NUe=2,RUe=4,nW="[object Arguments]",MUe="[object Array]",LUe="[object Boolean]",BUe="[object Date]",HUe="[object Error]",iW="[object Function]",FUe="[object GeneratorFunction]",$Ue="[object Map]",jUe="[object Number]",oW="[object Object]",UUe="[object RegExp]",GUe="[object Set]",zUe="[object String]",VUe="[object Symbol]",WUe="[object WeakMap]",YUe="[object ArrayBuffer]",qUe="[object DataView]",XUe="[object Float32Array]",KUe="[object Float64Array]",ZUe="[object Int8Array]",QUe="[object Int16Array]",JUe="[object Int32Array]",e4e="[object Uint8Array]",t4e="[object Uint8ClampedArray]",r4e="[object Uint16Array]",n4e="[object Uint32Array]",_r={};_r[nW]=_r[MUe]=_r[YUe]=_r[qUe]=_r[LUe]=_r[BUe]=_r[XUe]=_r[KUe]=_r[ZUe]=_r[QUe]=_r[JUe]=_r[$Ue]=_r[jUe]=_r[oW]=_r[UUe]=_r[GUe]=_r[zUe]=_r[VUe]=_r[e4e]=_r[t4e]=_r[r4e]=_r[n4e]=!0,_r[HUe]=_r[iW]=_r[WUe]=!1;function hT(e,t,r,i,n,o){var a,s=t&xUe,c=t&NUe,u=t&RUe;if(r&&(a=n?r(e,i,n,o):r(e)),a!==void 0)return a;if(!Hi(e))return e;var l=ci(e);if(l){if(a=Z6e(e),!s)return qV(e,a)}else{var h=pg(e),f=h==iW||h==FUe;if(lg(e))return YV(e,s);if(h==oW||h==nW||f&&!n){if(a=c||f?{}:eW(e),!s)return c?Y6e(e,U6e(a,e)):z6e(e,B6e(a,e))}else{if(!_r[h])return n?e:{};a=TUe(e,h,s)}}o||(o=new Ro);var d=o.get(e);if(d)return d;o.set(e,a),DUe(e)?e.forEach(function(g){a.add(hT(g,t,r,g,e,o))}):kUe(e)&&e.forEach(function(g,v){a.set(v,hT(g,t,r,v,e,o))});var p=u?c?q6e:YP:c?vg:ug,m=l?void 0:p(e);return jV(m||e,function(g,v){m&&(v=g,g=e[v]),UV(a,v,hT(g,t,r,v,e,o))}),a}var i4e=1,o4e=4;function a4e(e){return hT(e,i4e|o4e)}const s4e=wa(Object.freeze(Object.defineProperty({__proto__:null,default:a4e},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(mg,"__esModule",{value:!0}),mg.mergeClasses=void 0;var l4e=UP,c4e=aW(l4e),u4e=s4e,f4e=aW(u4e),h4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};function aW(e){return e&&e.__esModule?e:{default:e}}var d4e=mg.mergeClasses=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=t.default&&(0,f4e.default)(t.default)||{};return r.map(function(n){var o=t[n];return o&&(0,c4e.default)(o,function(a,s){i[s]||(i[s]={}),i[s]=h4e({},i[s],o[s])}),n}),i};mg.default=d4e;var yg={};Object.defineProperty(yg,"__esModule",{value:!0}),yg.autoprefix=void 0;var p4e=UP,sW=g4e(p4e),m4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};function g4e(e){return e&&e.__esModule?e:{default:e}}var v4e={borderRadius:function(t){return{msBorderRadius:t,MozBorderRadius:t,OBorderRadius:t,WebkitBorderRadius:t,borderRadius:t}},boxShadow:function(t){return{msBoxShadow:t,MozBoxShadow:t,OBoxShadow:t,WebkitBoxShadow:t,boxShadow:t}},userSelect:function(t){return{WebkitTouchCallout:t,KhtmlUserSelect:t,MozUserSelect:t,msUserSelect:t,WebkitUserSelect:t,userSelect:t}},flex:function(t){return{WebkitBoxFlex:t,MozBoxFlex:t,WebkitFlex:t,msFlex:t,flex:t}},flexBasis:function(t){return{WebkitFlexBasis:t,flexBasis:t}},justifyContent:function(t){return{WebkitJustifyContent:t,justifyContent:t}},transition:function(t){return{msTransition:t,MozTransition:t,OTransition:t,WebkitTransition:t,transition:t}},transform:function(t){return{msTransform:t,MozTransform:t,OTransform:t,WebkitTransform:t,transform:t}},absolute:function(t){var r=t&&t.split(" ");return{position:"absolute",top:r&&r[0],right:r&&r[1],bottom:r&&r[2],left:r&&r[3]}},extend:function(t,r){var i=r[t];return i||{extend:t}}},y4e=yg.autoprefix=function(t){var r={};return(0,sW.default)(t,function(i,n){var o={};(0,sW.default)(i,function(a,s){var c=v4e[s];c?o=m4e({},o,c(a)):o[s]=a}),r[n]=o}),r};yg.default=y4e;var bg={};Object.defineProperty(bg,"__esModule",{value:!0}),bg.hover=void 0;var b4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},_4e=E,nD=T4e(_4e);function T4e(e){return e&&e.__esModule?e:{default:e}}function E4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lW(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function S4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var w4e=bg.hover=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(i){S4e(n,i);function n(){var o,a,s,c;E4e(this,n);for(var u=arguments.length,l=Array(u),h=0;h<u;h++)l[h]=arguments[h];return c=(a=(s=lW(this,(o=n.__proto__||Object.getPrototypeOf(n)).call.apply(o,[this].concat(l))),s),s.state={hover:!1},s.handleMouseOver=function(){return s.setState({hover:!0})},s.handleMouseOut=function(){return s.setState({hover:!1})},s.render=function(){return nD.default.createElement(r,{onMouseOver:s.handleMouseOver,onMouseOut:s.handleMouseOut},nD.default.createElement(t,b4e({},s.props,s.state)))},a),lW(s,c)}return n}(nD.default.Component)};bg.default=w4e;var _g={};Object.defineProperty(_g,"__esModule",{value:!0}),_g.active=void 0;var A4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},O4e=E,iD=k4e(O4e);function k4e(e){return e&&e.__esModule?e:{default:e}}function I4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cW(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function C4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var P4e=_g.active=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(i){C4e(n,i);function n(){var o,a,s,c;I4e(this,n);for(var u=arguments.length,l=Array(u),h=0;h<u;h++)l[h]=arguments[h];return c=(a=(s=cW(this,(o=n.__proto__||Object.getPrototypeOf(n)).call.apply(o,[this].concat(l))),s),s.state={active:!1},s.handleMouseDown=function(){return s.setState({active:!0})},s.handleMouseUp=function(){return s.setState({active:!1})},s.render=function(){return iD.default.createElement(r,{onMouseDown:s.handleMouseDown,onMouseUp:s.handleMouseUp},iD.default.createElement(t,A4e({},s.props,s.state)))},a),cW(s,c)}return n}(iD.default.Component)};_g.default=P4e;var oD={};Object.defineProperty(oD,"__esModule",{value:!0});var D4e=function(t,r){var i={},n=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i[a]=s};return t===0&&n("first-child"),t===r-1&&n("last-child"),(t===0||t%2===0)&&n("even"),Math.abs(t%2)===1&&n("odd"),n("nth-child",t),i};oD.default=D4e,Object.defineProperty(no,"__esModule",{value:!0}),no.ReactCSS=no.loop=no.handleActive=aD=no.handleHover=no.hover=void 0;var x4e=ag,N4e=Ch(x4e),R4e=mg,M4e=Ch(R4e),L4e=yg,B4e=Ch(L4e),H4e=bg,uW=Ch(H4e),F4e=_g,$4e=Ch(F4e),j4e=oD,U4e=Ch(j4e);function Ch(e){return e&&e.__esModule?e:{default:e}}no.hover=uW.default;var aD=no.handleHover=uW.default;no.handleActive=$4e.default,no.loop=U4e.default;var G4e=no.ReactCSS=function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];var o=(0,N4e.default)(i),a=(0,M4e.default)(t,o);return(0,B4e.default)(a)},gt=no.default=G4e,z4e=function(t,r,i,n,o){var a=o.clientWidth,s=o.clientHeight,c=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,u=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,l=c-(o.getBoundingClientRect().left+window.pageXOffset),h=u-(o.getBoundingClientRect().top+window.pageYOffset);if(i==="vertical"){var f=void 0;if(h<0?f=0:h>s?f=1:f=Math.round(h*100/s)/100,r.a!==f)return{h:r.h,s:r.s,l:r.l,a:f,source:"rgb"}}else{var d=void 0;if(l<0?d=0:l>a?d=1:d=Math.round(l*100/a)/100,n!==d)return{h:r.h,s:r.s,l:r.l,a:d,source:"rgb"}}return null},sD={},V4e=function(t,r,i,n){if(typeof document>"u"&&!n)return null;var o=n?new n:document.createElement("canvas");o.width=i*2,o.height=i*2;var a=o.getContext("2d");return a?(a.fillStyle=t,a.fillRect(0,0,o.width,o.height),a.fillStyle=r,a.fillRect(0,0,i,i),a.translate(i,i),a.fillRect(0,0,i,i),o.toDataURL()):null},W4e=function(t,r,i,n){var o=t+"-"+r+"-"+i+(n?"-server":"");if(sD[o])return sD[o];var a=V4e(t,r,i,n);return sD[o]=a,a},fW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ph=function(t){var r=t.white,i=t.grey,n=t.size,o=t.renderers,a=t.borderRadius,s=t.boxShadow,c=t.children,u=gt({default:{grid:{borderRadius:a,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+W4e(r,i,n,o.canvas)+") center left"}}});return E.isValidElement(c)?E.cloneElement(c,fW({},c.props,{style:fW({},c.props.style,u.grid)})):E.createElement("div",{style:u.grid})};Ph.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var Y4e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},q4e=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}();function X4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hW(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function K4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var lD=function(e){K4e(t,e);function t(){var r,i,n,o;X4e(this,t);for(var a=arguments.length,s=Array(a),c=0;c<a;c++)s[c]=arguments[c];return o=(i=(n=hW(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(s))),n),n.handleChange=function(u){var l=z4e(u,n.props.hsl,n.props.direction,n.props.a,n.container);l&&typeof n.props.onChange=="function"&&n.props.onChange(l,u)},n.handleMouseDown=function(u){n.handleChange(u),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},i),hW(n,o)}return q4e(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var i=this,n=this.props.rgb,o=gt({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
|
|
291
291
|
rgba(`+n.r+","+n.g+","+n.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:n.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
|
|
292
292
|
rgba(`+n.r+","+n.g+","+n.b+", 1) 100%)"},pointer:{left:0,top:n.a*100+"%"}},overwrite:Y4e({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return E.createElement("div",{style:o.alpha},E.createElement("div",{style:o.checkboard},E.createElement(Ph,{renderers:this.props.renderers})),E.createElement("div",{style:o.gradient}),E.createElement("div",{style:o.container,ref:function(s){return i.container=s},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},E.createElement("div",{style:o.pointer},this.props.pointer?E.createElement(this.props.pointer,this.props):E.createElement("div",{style:o.slider}))))}}]),t}(E.PureComponent||E.Component),Z4e=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}();function Q4e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eGe(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function tGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var rGe=1,dW=38,nGe=40,iGe=[dW,nGe],oGe=function(t){return iGe.indexOf(t)>-1},aGe=function(t){return Number(String(t).replace(/%/g,""))},sGe=1,Xt=function(e){tGe(t,e);function t(r){J4e(this,t);var i=eGe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.handleBlur=function(){i.state.blurValue&&i.setState({value:i.state.blurValue,blurValue:null})},i.handleChange=function(n){i.setUpdatedValue(n.target.value,n)},i.handleKeyDown=function(n){var o=aGe(n.target.value);if(!isNaN(o)&&oGe(n.keyCode)){var a=i.getArrowOffset(),s=n.keyCode===dW?o+a:o-a;i.setUpdatedValue(s,n)}},i.handleDrag=function(n){if(i.props.dragLabel){var o=Math.round(i.props.value+n.movementX);o>=0&&o<=i.props.dragMax&&i.props.onChange&&i.props.onChange(i.getValueObjectWithLabel(o),n)}},i.handleMouseDown=function(n){i.props.dragLabel&&(n.preventDefault(),i.handleDrag(n),window.addEventListener("mousemove",i.handleDrag),window.addEventListener("mouseup",i.handleMouseUp))},i.handleMouseUp=function(){i.unbindEventListeners()},i.unbindEventListeners=function(){window.removeEventListener("mousemove",i.handleDrag),window.removeEventListener("mouseup",i.handleMouseUp)},i.state={value:String(r.value).toUpperCase(),blurValue:String(r.value).toUpperCase()},i.inputId="rc-editable-input-"+sGe++,i}return Z4e(t,[{key:"componentDidUpdate",value:function(i,n){this.props.value!==this.state.value&&(i.value!==this.props.value||n.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(i){return Q4e({},this.props.label,i)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||rGe}},{key:"setUpdatedValue",value:function(i,n){var o=this.props.label?this.getValueObjectWithLabel(i):i;this.props.onChange&&this.props.onChange(o,n),this.setState({value:i})}},{key:"render",value:function(){var i=this,n=gt({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return E.createElement("div",{style:n.wrap},E.createElement("input",{id:this.inputId,style:n.input,ref:function(a){return i.input=a},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?E.createElement("label",{htmlFor:this.inputId,style:n.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(E.PureComponent||E.Component),lGe=function(t,r,i,n){var o=n.clientWidth,a=n.clientHeight,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,u=s-(n.getBoundingClientRect().left+window.pageXOffset),l=c-(n.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var h=void 0;if(l<0)h=359;else if(l>a)h=0;else{var f=-(l*100/a)+100;h=360*f/100}if(i.h!==h)return{h,s:i.s,l:i.l,a:i.a,source:"hsl"}}else{var d=void 0;if(u<0)d=0;else if(u>o)d=359;else{var p=u*100/o;d=360*p/100}if(i.h!==d)return{h:d,s:i.s,l:i.l,a:i.a,source:"hsl"}}return null},cGe=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}();function uGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pW(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function fGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Dh=function(e){fGe(t,e);function t(){var r,i,n,o;uGe(this,t);for(var a=arguments.length,s=Array(a),c=0;c<a;c++)s[c]=arguments[c];return o=(i=(n=pW(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(s))),n),n.handleChange=function(u){var l=lGe(u,n.props.direction,n.props.hsl,n.container);l&&typeof n.props.onChange=="function"&&n.props.onChange(l,u)},n.handleMouseDown=function(u){n.handleChange(u),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},i),pW(n,o)}return cGe(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var i=this,n=this.props.direction,o=n===void 0?"horizontal":n,a=gt({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:o==="vertical"});return E.createElement("div",{style:a.hue},E.createElement("div",{className:"hue-"+o,style:a.container,ref:function(c){return i.container=c},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},E.createElement("style",null,`
|
|
293
293
|
.hue-horizontal {
|
|
@@ -314,7 +314,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
314
314
|
background: linear-gradient(to top, #000, rgba(0,0,0,0));
|
|
315
315
|
}
|
|
316
316
|
`),E.createElement("div",{style:l.white,className:"saturation-white"},E.createElement("div",{style:l.black,className:"saturation-black"}),E.createElement("div",{style:l.pointer},this.props.pointer?E.createElement(this.props.pointer,this.props):E.createElement("div",{style:l.circle}))))}}]),t}(E.PureComponent||E.Component);function XGe(e,t){var r=ci(e)?jV:$V;return r(e,pV(t))}function pT(e){"@babel/helpers - typeof";return pT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pT(e)}var KGe=/^\s+/,ZGe=/\s+$/;function it(e,t){if(e=e||"",t=t||{},e instanceof it)return e;if(!(this instanceof it))return new it(e,t);var r=QGe(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}it.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,i,n,o,a,s;return r=t.r/255,i=t.g/255,n=t.b/255,r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*s},setAlpha:function(t){return this._a=AW(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=TW(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=TW(this._r,this._g,this._b),r=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+n+"%)":"hsva("+r+", "+i+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=_W(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=_W(this._r,this._g,this._b),r=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+n+"%)":"hsla("+r+", "+i+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return EW(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return rze(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Pr(this._r,255)*100)+"%",g:Math.round(Pr(this._g,255)*100)+"%",b:Math.round(Pr(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Pr(this._r,255)*100)+"%, "+Math.round(Pr(this._g,255)*100)+"%, "+Math.round(Pr(this._b,255)*100)+"%)":"rgba("+Math.round(Pr(this._r,255)*100)+"%, "+Math.round(Pr(this._g,255)*100)+"%, "+Math.round(Pr(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:pze[EW(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+SW(this._r,this._g,this._b,this._a),i=r,n=this._gradientType?"GradientType = 1, ":"";if(t){var o=it(t);i="#"+SW(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+r+",endColorstr="+i+")"},toString:function(t){var r=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!r&&n&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(i=this.toRgbString()),t==="prgb"&&(i=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(i=this.toHexString()),t==="hex3"&&(i=this.toHexString(!0)),t==="hex4"&&(i=this.toHex8String(!0)),t==="hex8"&&(i=this.toHex8String()),t==="name"&&(i=this.toName()),t==="hsl"&&(i=this.toHslString()),t==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return it(this.toString())},_applyModification:function(t,r){var i=t.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(aze,arguments)},brighten:function(){return this._applyModification(sze,arguments)},darken:function(){return this._applyModification(lze,arguments)},desaturate:function(){return this._applyModification(nze,arguments)},saturate:function(){return this._applyModification(ize,arguments)},greyscale:function(){return this._applyModification(oze,arguments)},spin:function(){return this._applyModification(cze,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(hze,arguments)},complement:function(){return this._applyCombination(uze,arguments)},monochromatic:function(){return this._applyCombination(dze,arguments)},splitcomplement:function(){return this._applyCombination(fze,arguments)},triad:function(){return this._applyCombination(wW,[3])},tetrad:function(){return this._applyCombination(wW,[4])}},it.fromRatio=function(e,t){if(pT(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=Eg(e[i]));e=r}return it(e,t)};function QGe(e){var t={r:0,g:0,b:0},r=1,i=null,n=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=yze(e)),pT(e)=="object"&&(hs(e.r)&&hs(e.g)&&hs(e.b)?(t=JGe(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):hs(e.h)&&hs(e.s)&&hs(e.v)?(i=Eg(e.s),n=Eg(e.v),t=tze(e.h,i,n),a=!0,s="hsv"):hs(e.h)&&hs(e.s)&&hs(e.l)&&(i=Eg(e.s),o=Eg(e.l),t=eze(e.h,i,o),a=!0,s="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=AW(r),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function JGe(e,t,r){return{r:Pr(e,255)*255,g:Pr(t,255)*255,b:Pr(r,255)*255}}function _W(e,t,r){e=Pr(e,255),t=Pr(t,255),r=Pr(r,255);var i=Math.max(e,t,r),n=Math.min(e,t,r),o,a,s=(i+n)/2;if(i==n)o=a=0;else{var c=i-n;switch(a=s>.5?c/(2-i-n):c/(i+n),i){case e:o=(t-r)/c+(t<r?6:0);break;case t:o=(r-e)/c+2;break;case r:o=(e-t)/c+4;break}o/=6}return{h:o,s:a,l:s}}function eze(e,t,r){var i,n,o;e=Pr(e,360),t=Pr(t,100),r=Pr(r,100);function a(u,l,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?u+(l-u)*6*h:h<1/2?l:h<2/3?u+(l-u)*(2/3-h)*6:u}if(t===0)i=n=o=r;else{var s=r<.5?r*(1+t):r+t-r*t,c=2*r-s;i=a(c,s,e+1/3),n=a(c,s,e),o=a(c,s,e-1/3)}return{r:i*255,g:n*255,b:o*255}}function TW(e,t,r){e=Pr(e,255),t=Pr(t,255),r=Pr(r,255);var i=Math.max(e,t,r),n=Math.min(e,t,r),o,a,s=i,c=i-n;if(a=i===0?0:c/i,i==n)o=0;else{switch(i){case e:o=(t-r)/c+(t<r?6:0);break;case t:o=(r-e)/c+2;break;case r:o=(e-t)/c+4;break}o/=6}return{h:o,s:a,v:s}}function tze(e,t,r){e=Pr(e,360)*6,t=Pr(t,100),r=Pr(r,100);var i=Math.floor(e),n=e-i,o=r*(1-t),a=r*(1-n*t),s=r*(1-(1-n)*t),c=i%6,u=[r,a,o,o,s,r][c],l=[s,r,r,a,o,o][c],h=[o,o,s,r,r,a][c];return{r:u*255,g:l*255,b:h*255}}function EW(e,t,r,i){var n=[Mo(Math.round(e).toString(16)),Mo(Math.round(t).toString(16)),Mo(Math.round(r).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function rze(e,t,r,i,n){var o=[Mo(Math.round(e).toString(16)),Mo(Math.round(t).toString(16)),Mo(Math.round(r).toString(16)),Mo(OW(i))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function SW(e,t,r,i){var n=[Mo(OW(i)),Mo(Math.round(e).toString(16)),Mo(Math.round(t).toString(16)),Mo(Math.round(r).toString(16))];return n.join("")}it.equals=function(e,t){return!e||!t?!1:it(e).toRgbString()==it(t).toRgbString()},it.random=function(){return it.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function nze(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.s-=t/100,r.s=mT(r.s),it(r)}function ize(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.s+=t/100,r.s=mT(r.s),it(r)}function oze(e){return it(e).desaturate(100)}function aze(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.l+=t/100,r.l=mT(r.l),it(r)}function sze(e,t){t=t===0?0:t||10;var r=it(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),it(r)}function lze(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.l-=t/100,r.l=mT(r.l),it(r)}function cze(e,t){var r=it(e).toHsl(),i=(r.h+t)%360;return r.h=i<0?360+i:i,it(r)}function uze(e){var t=it(e).toHsl();return t.h=(t.h+180)%360,it(t)}function wW(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=it(e).toHsl(),i=[it(e)],n=360/t,o=1;o<t;o++)i.push(it({h:(r.h+o*n)%360,s:r.s,l:r.l}));return i}function fze(e){var t=it(e).toHsl(),r=t.h;return[it(e),it({h:(r+72)%360,s:t.s,l:t.l}),it({h:(r+216)%360,s:t.s,l:t.l})]}function hze(e,t,r){t=t||6,r=r||30;var i=it(e).toHsl(),n=360/r,o=[it(e)];for(i.h=(i.h-(n*t>>1)+720)%360;--t;)i.h=(i.h+n)%360,o.push(it(i));return o}function dze(e,t){t=t||6;for(var r=it(e).toHsv(),i=r.h,n=r.s,o=r.v,a=[],s=1/t;t--;)a.push(it({h:i,s:n,v:o})),o=(o+s)%1;return a}it.mix=function(e,t,r){r=r===0?0:r||50;var i=it(e).toRgb(),n=it(t).toRgb(),o=r/100,a={r:(n.r-i.r)*o+i.r,g:(n.g-i.g)*o+i.g,b:(n.b-i.b)*o+i.b,a:(n.a-i.a)*o+i.a};return it(a)},it.readability=function(e,t){var r=it(e),i=it(t);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},it.isReadable=function(e,t,r){var i=it.readability(e,t),n,o;switch(o=!1,n=bze(r),n.level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7;break}return o},it.mostReadable=function(e,t,r){var i=null,n=0,o,a,s,c;r=r||{},a=r.includeFallbackColors,s=r.level,c=r.size;for(var u=0;u<t.length;u++)o=it.readability(e,t[u]),o>n&&(n=o,i=it(t[u]));return it.isReadable(e,i,{level:s,size:c})||!a?i:(r.includeFallbackColors=!1,it.mostReadable(e,["#fff","#000"],r))};var hD=it.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},pze=it.hexNames=mze(hD);function mze(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function AW(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Pr(e,t){gze(e)&&(e="100%");var r=vze(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function mT(e){return Math.min(1,Math.max(0,e))}function Fi(e){return parseInt(e,16)}function gze(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function vze(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Mo(e){return e.length==1?"0"+e:""+e}function Eg(e){return e<=1&&(e=e*100+"%"),e}function OW(e){return Math.round(parseFloat(e)*255).toString(16)}function kW(e){return Fi(e)/255}var Lo=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function hs(e){return!!Lo.CSS_UNIT.exec(e)}function yze(e){e=e.replace(KGe,"").replace(ZGe,"").toLowerCase();var t=!1;if(hD[e])e=hD[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Lo.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Lo.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Lo.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Lo.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Lo.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Lo.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Lo.hex8.exec(e))?{r:Fi(r[1]),g:Fi(r[2]),b:Fi(r[3]),a:kW(r[4]),format:t?"name":"hex8"}:(r=Lo.hex6.exec(e))?{r:Fi(r[1]),g:Fi(r[2]),b:Fi(r[3]),format:t?"name":"hex"}:(r=Lo.hex4.exec(e))?{r:Fi(r[1]+""+r[1]),g:Fi(r[2]+""+r[2]),b:Fi(r[3]+""+r[3]),a:kW(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=Lo.hex3.exec(e))?{r:Fi(r[1]+""+r[1]),g:Fi(r[2]+""+r[2]),b:Fi(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function bze(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}var IW=function(t){var r=["r","g","b","a","h","s","l","v"],i=0,n=0;return XGe(r,function(o){if(t[o]&&(i+=1,isNaN(t[o])||(n+=1),o==="s"||o==="l")){var a=/^\d+%$/;a.test(t[o])&&(n+=1)}}),i===n?t:!1},Sg=function(t,r){var i=t.hex?it(t.hex):it(t),n=i.toHsl(),o=i.toHsv(),a=i.toRgb(),s=i.toHex();n.s===0&&(n.h=r||0,o.h=r||0);var c=s==="000000"&&a.a===0;return{hsl:n,hex:c?"transparent":"#"+s,rgb:a,hsv:o,oldHue:t.h||r||n.h,source:t.source}},hl=function(t){if(t==="transparent")return!0;var r=String(t).charAt(0)==="#"?1:0;return t.length!==4+r&&t.length<7+r&&it(t).isValid()},dD=function(t){if(!t)return"#fff";var r=Sg(t);if(r.hex==="transparent")return"rgba(0,0,0,0.4)";var i=(r.rgb.r*299+r.rgb.g*587+r.rgb.b*114)/1e3;return i>=128?"#000":"#fff"},pD=function(t,r){var i=t.replace("\xB0","");return it(r+" ("+i+")")._ok},wg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},_ze=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}();function Tze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eze(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Sze(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var wi=function(t){var r=function(i){Sze(n,i);function n(o){Tze(this,n);var a=Eze(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return a.handleChange=function(s,c){var u=IW(s);if(u){var l=Sg(s,s.h||a.state.oldHue);a.setState(l),a.props.onChangeComplete&&a.debounce(a.props.onChangeComplete,l,c),a.props.onChange&&a.props.onChange(l,c)}},a.handleSwatchHover=function(s,c){var u=IW(s);if(u){var l=Sg(s,s.h||a.state.oldHue);a.props.onSwatchHover&&a.props.onSwatchHover(l,c)}},a.state=wg({},Sg(o.color,0)),a.debounce=bW(function(s,c,u){s(c,u)},100),a}return _ze(n,[{key:"render",value:function(){var a={};return this.props.onSwatchHover&&(a.onSwatchHover=this.handleSwatchHover),E.createElement(t,wg({},this.props,this.state,{onChange:this.handleChange},a))}}],[{key:"getDerivedStateFromProps",value:function(a,s){return wg({},Sg(a.color,s.oldHue))}}]),n}(E.PureComponent||E.Component);return r.propTypes=wg({},t.propTypes),r.defaultProps=wg({},t.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),r},wze=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Aze=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}();function Oze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CW(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function kze(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Ize=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(i){kze(n,i);function n(){var o,a,s,c;Oze(this,n);for(var u=arguments.length,l=Array(u),h=0;h<u;h++)l[h]=arguments[h];return c=(a=(s=CW(this,(o=n.__proto__||Object.getPrototypeOf(n)).call.apply(o,[this].concat(l))),s),s.state={focus:!1},s.handleFocus=function(){return s.setState({focus:!0})},s.handleBlur=function(){return s.setState({focus:!1})},a),CW(s,c)}return Aze(n,[{key:"render",value:function(){return E.createElement(r,{onFocus:this.handleFocus,onBlur:this.handleBlur},E.createElement(t,wze({},this.props,this.state)))}}]),n}(E.Component)},PW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Cze=13,Pze=function(t){var r=t.color,i=t.style,n=t.onClick,o=n===void 0?function(){}:n,a=t.onHover,s=t.title,c=s===void 0?r:s,u=t.children,l=t.focus,h=t.focusStyle,f=h===void 0?{}:h,d=r==="transparent",p=gt({default:{swatch:PW({background:r,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},i,l?f:{})}}),m=function(b){return o(r,b)},g=function(b){return b.keyCode===Cze&&o(r,b)},v=function(b){return a(r,b)},_={};return a&&(_.onMouseOver=v),E.createElement("div",PW({style:p.swatch,onClick:m,title:c,tabIndex:0,onKeyDown:g},_),u,d&&E.createElement(Ph,{borderRadius:p.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};const Jc=Ize(Pze);var Dze=function(t){var r=t.direction,i=gt({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:r==="vertical"});return E.createElement("div",{style:i.picker})},xze=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},DW=function(t){var r=t.rgb,i=t.hsl,n=t.width,o=t.height,a=t.onChange,s=t.direction,c=t.style,u=t.renderers,l=t.pointer,h=t.className,f=h===void 0?"":h,d=gt({default:{picker:{position:"relative",width:n,height:o},alpha:{radius:"2px",style:c}}});return E.createElement("div",{style:d.picker,className:"alpha-picker "+f},E.createElement(lD,xze({},d.alpha,{rgb:r,hsl:i,pointer:l,renderers:u,onChange:a,direction:s})))};DW.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:Dze},wi(DW);var Nze=function(t){var r=t.colors,i=t.onClick,n=t.onSwatchHover,o=gt({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return E.createElement("div",{style:o.swatches},fl(r,function(a){return E.createElement(Jc,{key:a,color:a,style:o.swatch,onClick:i,onHover:n,focusStyle:{boxShadow:"0 0 4px "+a}})}),E.createElement("div",{style:o.clear}))},mD=function(t){var r=t.onChange,i=t.onSwatchHover,n=t.hex,o=t.colors,a=t.width,s=t.triangle,c=t.styles,u=c===void 0?{}:c,l=t.className,h=l===void 0?"":l,f=n==="transparent",d=function(g,v){hl(g)&&r({hex:g,source:"hex"},v)},p=gt(Si({default:{card:{width:a,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:n,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:dD(n),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+n+" transparent",position:"absolute",top:"-10px",left:"50%",marginLeft:"-10px"},input:{width:"100%",fontSize:"12px",color:"#666",border:"0px",outline:"none",height:"22px",boxShadow:"inset 0 0 0 1px #ddd",borderRadius:"4px",padding:"0 7px",boxSizing:"border-box"}},"hide-triangle":{triangle:{display:"none"}}},u),{"hide-triangle":s==="hide"});return E.createElement("div",{style:p.card,className:"block-picker "+h},E.createElement("div",{style:p.triangle}),E.createElement("div",{style:p.head},f&&E.createElement(Ph,{borderRadius:"6px 6px 0 0"}),E.createElement("div",{style:p.label},n)),E.createElement("div",{style:p.body},E.createElement(Nze,{colors:o,onClick:d,onSwatchHover:i}),E.createElement(Xt,{style:{input:p.input},value:n,onChange:d})))};mD.propTypes={width:N.oneOfType([N.string,N.number]),colors:N.arrayOf(N.string),triangle:N.oneOf(["top","hide"]),styles:N.object},mD.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}},wi(mD);var xh={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},Nh={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},Rh={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},Mh={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},Lh={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},Bh={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},Hh={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},Fh={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},$h={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},Ag={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},jh={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},Uh={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},Gh={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},zh={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},Vh={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},Wh={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00"},Yh={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},qh={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"},xW=function(t){var r=t.color,i=t.onClick,n=t.onSwatchHover,o=t.hover,a=t.active,s=t.circleSize,c=t.circleSpacing,u=gt({default:{swatch:{width:s,height:s,marginRight:c,marginBottom:c,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+(s/2+1)+"px "+r,transition:"100ms box-shadow ease"}},hover:{swatch:{transform:"scale(1.2)"}},active:{Swatch:{boxShadow:"inset 0 0 0 3px "+r}}},{hover:o,active:a});return E.createElement("div",{style:u.swatch},E.createElement(Jc,{style:u.Swatch,color:r,onClick:i,onHover:n,focusStyle:{boxShadow:u.Swatch.boxShadow+", 0 0 5px "+r}}))};xW.defaultProps={circleSize:28,circleSpacing:14};const Rze=aD(xW);var gD=function(t){var r=t.width,i=t.onChange,n=t.onSwatchHover,o=t.colors,a=t.hex,s=t.circleSize,c=t.styles,u=c===void 0?{}:c,l=t.circleSpacing,h=t.className,f=h===void 0?"":h,d=gt(Si({default:{card:{width:r,display:"flex",flexWrap:"wrap",marginRight:-l,marginBottom:-l}}},u)),p=function(g,v){return i({hex:g,source:"hex"},v)};return E.createElement("div",{style:d.card,className:"circle-picker "+f},fl(o,function(m){return E.createElement(Rze,{key:m,color:m,onClick:p,onSwatchHover:n,active:a===m.toLowerCase(),circleSize:s,circleSpacing:l})}))};gD.propTypes={width:N.oneOfType([N.string,N.number]),circleSize:N.number,circleSpacing:N.number,styles:N.object},gD.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[xh[500],Nh[500],Rh[500],Mh[500],Lh[500],Bh[500],Hh[500],Fh[500],$h[500],Ag[500],jh[500],Uh[500],Gh[500],zh[500],Vh[500],Wh[500],Yh[500],qh[500]],styles:{}},wi(gD);function NW(e){return e===void 0}var RW={};Object.defineProperty(RW,"__esModule",{value:!0});var MW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Mze=E,LW=Lze(Mze);function Lze(e){return e&&e.__esModule?e:{default:e}}function Bze(e,t){var r={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r}var gT=24,Hze=RW.default=function(e){var t=e.fill,r=t===void 0?"currentColor":t,i=e.width,n=i===void 0?gT:i,o=e.height,a=o===void 0?gT:o,s=e.style,c=s===void 0?{}:s,u=Bze(e,["fill","width","height","style"]);return LW.default.createElement("svg",MW({viewBox:"0 0 "+gT+" "+gT,style:MW({fill:r,width:n,height:a},c)},u),LW.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},Fze=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}();function $ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jze(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Uze(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var BW=function(e){Uze(t,e);function t(r){$ze(this,t);var i=jze(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.toggleViews=function(){i.state.view==="hex"?i.setState({view:"rgb"}):i.state.view==="rgb"?i.setState({view:"hsl"}):i.state.view==="hsl"&&(i.props.hsl.a===1?i.setState({view:"hex"}):i.setState({view:"rgb"}))},i.handleChange=function(n,o){n.hex?hl(n.hex)&&i.props.onChange({hex:n.hex,source:"hex"},o):n.r||n.g||n.b?i.props.onChange({r:n.r||i.props.rgb.r,g:n.g||i.props.rgb.g,b:n.b||i.props.rgb.b,source:"rgb"},o):n.a?(n.a<0?n.a=0:n.a>1&&(n.a=1),i.props.onChange({h:i.props.hsl.h,s:i.props.hsl.s,l:i.props.hsl.l,a:Math.round(n.a*100)/100,source:"rgb"},o)):(n.h||n.s||n.l)&&(typeof n.s=="string"&&n.s.includes("%")&&(n.s=n.s.replace("%","")),typeof n.l=="string"&&n.l.includes("%")&&(n.l=n.l.replace("%","")),n.s==1?n.s=.01:n.l==1&&(n.l=.01),i.props.onChange({h:n.h||i.props.hsl.h,s:Number(NW(n.s)?i.props.hsl.s:n.s),l:Number(NW(n.l)?i.props.hsl.l:n.l),source:"hsl"},o))},i.showHighlight=function(n){n.currentTarget.style.background="#eee"},i.hideHighlight=function(n){n.currentTarget.style.background="transparent"},r.hsl.a!==1&&r.view==="hex"?i.state={view:"rgb"}:i.state={view:r.view},i}return Fze(t,[{key:"render",value:function(){var i=this,n=gt({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),o=void 0;return this.state.view==="hex"?o=E.createElement("div",{style:n.fields,className:"flexbox-fix"},E.createElement("div",{style:n.field},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?o=E.createElement("div",{style:n.fields,className:"flexbox-fix"},E.createElement("div",{style:n.field},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),E.createElement("div",{style:n.field},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),E.createElement("div",{style:n.field},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),E.createElement("div",{style:n.alpha},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(o=E.createElement("div",{style:n.fields,className:"flexbox-fix"},E.createElement("div",{style:n.field},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),E.createElement("div",{style:n.field},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),E.createElement("div",{style:n.field},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),E.createElement("div",{style:n.alpha},E.createElement(Xt,{style:{input:n.input,label:n.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),E.createElement("div",{style:n.wrap,className:"flexbox-fix"},o,E.createElement("div",{style:n.toggle},E.createElement("div",{style:n.icon,onClick:this.toggleViews,ref:function(s){return i.icon=s}},E.createElement(Hze,{style:n.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(i,n){return i.hsl.a!==1&&n.view==="hex"?{view:"rgb"}:null}}]),t}(E.Component);BW.defaultProps={view:"hex"};var HW=function(){var t=gt({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return E.createElement("div",{style:t.picker})},Gze=function(){var t=gt({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return E.createElement("div",{style:t.picker})},vD=function(t){var r=t.width,i=t.onChange,n=t.disableAlpha,o=t.rgb,a=t.hsl,s=t.hsv,c=t.hex,u=t.renderers,l=t.styles,h=l===void 0?{}:l,f=t.className,d=f===void 0?"":f,p=t.defaultView,m=gt(Si({default:{picker:{width:r,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},h),{disableAlpha:n});return E.createElement("div",{style:m.picker,className:"chrome-picker "+d},E.createElement("div",{style:m.saturation},E.createElement(dT,{style:m.Saturation,hsl:a,hsv:s,pointer:Gze,onChange:i})),E.createElement("div",{style:m.body},E.createElement("div",{style:m.controls,className:"flexbox-fix"},E.createElement("div",{style:m.color},E.createElement("div",{style:m.swatch},E.createElement("div",{style:m.active}),E.createElement(Ph,{renderers:u}))),E.createElement("div",{style:m.toggles},E.createElement("div",{style:m.hue},E.createElement(Dh,{style:m.Hue,hsl:a,pointer:HW,onChange:i})),E.createElement("div",{style:m.alpha},E.createElement(lD,{style:m.Alpha,rgb:o,hsl:a,pointer:HW,renderers:u,onChange:i})))),E.createElement(BW,{rgb:o,hsl:a,hex:c,view:p,onChange:i,disableAlpha:n})))};vD.propTypes={width:N.oneOfType([N.string,N.number]),disableAlpha:N.bool,styles:N.object,defaultView:N.oneOf(["hex","rgb","hsl"])},vD.defaultProps={width:225,disableAlpha:!1,styles:{}},wi(vD);var zze=function(t){var r=t.color,i=t.onClick,n=i===void 0?function(){}:i,o=t.onSwatchHover,a=t.active,s=gt({default:{color:{background:r,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:dD(r),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:a,"color-#FFFFFF":r==="#FFFFFF",transparent:r==="transparent"});return E.createElement(Jc,{style:s.color,color:r,onClick:n,onHover:o,focusStyle:{boxShadow:"0 0 4px "+r}},E.createElement("div",{style:s.dot}))},Vze=function(t){var r=t.hex,i=t.rgb,n=t.onChange,o=gt({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:r},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),a=function(c,u){c.r||c.g||c.b?n({r:c.r||i.r,g:c.g||i.g,b:c.b||i.b,source:"rgb"},u):n({hex:c.hex,source:"hex"},u)};return E.createElement("div",{style:o.fields,className:"flexbox-fix"},E.createElement("div",{style:o.active}),E.createElement(Xt,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:r,onChange:a}),E.createElement(Xt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:i.r,onChange:a}),E.createElement(Xt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:i.g,onChange:a}),E.createElement(Xt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:i.b,onChange:a}))},yD=function(t){var r=t.onChange,i=t.onSwatchHover,n=t.colors,o=t.hex,a=t.rgb,s=t.styles,c=s===void 0?{}:s,u=t.className,l=u===void 0?"":u,h=gt(Si({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},c)),f=function(p,m){p.hex?hl(p.hex)&&r({hex:p.hex,source:"hex"},m):r(p,m)};return E.createElement(Tg,{style:h.Compact,styles:c},E.createElement("div",{style:h.compact,className:"compact-picker "+l},E.createElement("div",null,fl(n,function(d){return E.createElement(zze,{key:d,color:d,active:d.toLowerCase()===o,onClick:f,onSwatchHover:i})}),E.createElement("div",{style:h.clear})),E.createElement(Vze,{hex:o,rgb:a,onChange:f})))};yD.propTypes={colors:N.arrayOf(N.string),styles:N.object},yD.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}},wi(yD);var Wze=function(t){var r=t.hover,i=t.color,n=t.onClick,o=t.onSwatchHover,a={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=gt({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:a}},{hover:r});return E.createElement("div",{style:s.swatch},E.createElement(Jc,{color:i,onClick:n,onHover:o,focusStyle:a}))};const Yze=aD(Wze);var bD=function(t){var r=t.width,i=t.colors,n=t.onChange,o=t.onSwatchHover,a=t.triangle,s=t.styles,c=s===void 0?{}:s,u=t.className,l=u===void 0?"":u,h=gt(Si({default:{card:{width:r,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},c),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right","bottom-left-triangle":a==="bottom-left","bottom-right-triangle":a==="bottom-right"}),f=function(p,m){return n({hex:p,source:"hex"},m)};return E.createElement("div",{style:h.card,className:"github-picker "+l},E.createElement("div",{style:h.triangleShadow}),E.createElement("div",{style:h.triangle}),fl(i,function(d){return E.createElement(Yze,{color:d,key:d,onClick:f,onSwatchHover:o})}))};bD.propTypes={width:N.oneOfType([N.string,N.number]),colors:N.arrayOf(N.string),triangle:N.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:N.object},bD.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}},wi(bD);var qze=function(t){var r=t.direction,i=gt({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:r==="vertical"});return E.createElement("div",{style:i.picker})},Xze=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},_D=function(t){var r=t.width,i=t.height,n=t.onChange,o=t.hsl,a=t.direction,s=t.pointer,c=t.styles,u=c===void 0?{}:c,l=t.className,h=l===void 0?"":l,f=gt(Si({default:{picker:{position:"relative",width:r,height:i},hue:{radius:"2px"}}},u)),d=function(m){return n({a:1,h:m.h,l:.5,s:1})};return E.createElement("div",{style:f.picker,className:"hue-picker "+h},E.createElement(Dh,Xze({},f.hue,{hsl:o,pointer:s,onChange:d,direction:a})))};_D.propTypes={styles:N.object},_D.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:qze,styles:{}},wi(_D);var Kze=function(t){var r=t.onChange,i=t.hex,n=t.rgb,o=t.styles,a=o===void 0?{}:o,s=t.className,c=s===void 0?"":s,u=gt(Si({default:{material:{width:"98px",height:"98px",padding:"16px",fontFamily:"Roboto"},HEXwrap:{position:"relative"},HEXinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"2px solid "+i,outline:"none",height:"30px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},Hex:{style:{}},RGBwrap:{position:"relative"},RGBinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"1px solid #eee",outline:"none",height:"30px"},RGBlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},split:{display:"flex",marginRight:"-10px",paddingTop:"11px"},third:{flex:"1",paddingRight:"10px"}}},a)),l=function(f,d){f.hex?hl(f.hex)&&r({hex:f.hex,source:"hex"},d):(f.r||f.g||f.b)&&r({r:f.r||n.r,g:f.g||n.g,b:f.b||n.b,source:"rgb"},d)};return E.createElement(Tg,{styles:a},E.createElement("div",{style:u.material,className:"material-picker "+c},E.createElement(Xt,{style:{wrap:u.HEXwrap,input:u.HEXinput,label:u.HEXlabel},label:"hex",value:i,onChange:l}),E.createElement("div",{style:u.split,className:"flexbox-fix"},E.createElement("div",{style:u.third},E.createElement(Xt,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"r",value:n.r,onChange:l})),E.createElement("div",{style:u.third},E.createElement(Xt,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"g",value:n.g,onChange:l})),E.createElement("div",{style:u.third},E.createElement(Xt,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"b",value:n.b,onChange:l})))))};wi(Kze);var Zze=function(t){var r=t.onChange,i=t.rgb,n=t.hsv,o=t.hex,a=gt({default:{fields:{paddingTop:"5px",paddingBottom:"9px",width:"80px",position:"relative"},divider:{height:"5px"},RGBwrap:{position:"relative"},RGBinput:{marginLeft:"40%",width:"40%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"5px",fontSize:"13px",paddingLeft:"3px",marginRight:"10px"},RGBlabel:{left:"0px",top:"0px",width:"34px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px",position:"absolute"},HEXwrap:{position:"relative"},HEXinput:{marginLeft:"20%",width:"80%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"6px",fontSize:"13px",paddingLeft:"3px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",width:"14px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px"},fieldSymbols:{position:"absolute",top:"5px",right:"-7px",fontSize:"13px"},symbol:{height:"20px",lineHeight:"22px",paddingBottom:"7px"}}}),s=function(u,l){u["#"]?hl(u["#"])&&r({hex:u["#"],source:"hex"},l):u.r||u.g||u.b?r({r:u.r||i.r,g:u.g||i.g,b:u.b||i.b,source:"rgb"},l):(u.h||u.s||u.v)&&r({h:u.h||n.h,s:u.s||n.s,v:u.v||n.v,source:"hsv"},l)};return E.createElement("div",{style:a.fields},E.createElement(Xt,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"h",value:Math.round(n.h),onChange:s}),E.createElement(Xt,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"s",value:Math.round(n.s*100),onChange:s}),E.createElement(Xt,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"v",value:Math.round(n.v*100),onChange:s}),E.createElement("div",{style:a.divider}),E.createElement(Xt,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"r",value:i.r,onChange:s}),E.createElement(Xt,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"g",value:i.g,onChange:s}),E.createElement(Xt,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"b",value:i.b,onChange:s}),E.createElement("div",{style:a.divider}),E.createElement(Xt,{style:{wrap:a.HEXwrap,input:a.HEXinput,label:a.HEXlabel},label:"#",value:o.replace("#",""),onChange:s}),E.createElement("div",{style:a.fieldSymbols},E.createElement("div",{style:a.symbol},"\xB0"),E.createElement("div",{style:a.symbol},"%"),E.createElement("div",{style:a.symbol},"%")))},Qze=function(t){var r=t.hsl,i=gt({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}},"black-outline":{picker:{boxShadow:"inset 0 0 0 1px #000"}}},{"black-outline":r.l>.5});return E.createElement("div",{style:i.picker})},Jze=function(){var t=gt({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return E.createElement("div",{style:t.pointer},E.createElement("div",{style:t.left},E.createElement("div",{style:t.leftInside})),E.createElement("div",{style:t.right},E.createElement("div",{style:t.rightInside})))},FW=function(t){var r=t.onClick,i=t.label,n=t.children,o=t.active,a=gt({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:o});return E.createElement("div",{style:a.button,onClick:r},i||n)},e8e=function(t){var r=t.rgb,i=t.currentColor,n=gt({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+r.r+","+r.g+", "+r.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:i,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return E.createElement("div",null,E.createElement("div",{style:n.label},"new"),E.createElement("div",{style:n.swatches},E.createElement("div",{style:n.new}),E.createElement("div",{style:n.current})),E.createElement("div",{style:n.label},"current"))},t8e=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}();function r8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n8e(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function i8e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var TD=function(e){i8e(t,e);function t(r){r8e(this,t);var i=n8e(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.state={currentColor:r.hex},i}return t8e(t,[{key:"render",value:function(){var i=this.props,n=i.styles,o=n===void 0?{}:n,a=i.className,s=a===void 0?"":a,c=gt(Si({default:{picker:{background:"#DCDCDC",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)",boxSizing:"initial",width:"513px"},head:{backgroundImage:"linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)",borderBottom:"1px solid #B1B1B1",boxShadow:"inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)",height:"23px",lineHeight:"24px",borderRadius:"4px 4px 0 0",fontSize:"13px",color:"#4D4D4D",textAlign:"center"},body:{padding:"15px 15px 0",display:"flex"},saturation:{width:"256px",height:"256px",position:"relative",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0",overflow:"hidden"},hue:{position:"relative",height:"256px",width:"19px",marginLeft:"10px",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0"},controls:{width:"180px",marginLeft:"10px"},top:{display:"flex"},previews:{width:"60px"},actions:{flex:"1",marginLeft:"20px"}}},o));return E.createElement("div",{style:c.picker,className:"photoshop-picker "+s},E.createElement("div",{style:c.head},this.props.header),E.createElement("div",{style:c.body,className:"flexbox-fix"},E.createElement("div",{style:c.saturation},E.createElement(dT,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:Qze,onChange:this.props.onChange})),E.createElement("div",{style:c.hue},E.createElement(Dh,{direction:"vertical",hsl:this.props.hsl,pointer:Jze,onChange:this.props.onChange})),E.createElement("div",{style:c.controls},E.createElement("div",{style:c.top,className:"flexbox-fix"},E.createElement("div",{style:c.previews},E.createElement(e8e,{rgb:this.props.rgb,currentColor:this.state.currentColor})),E.createElement("div",{style:c.actions},E.createElement(FW,{label:"OK",onClick:this.props.onAccept,active:!0}),E.createElement(FW,{label:"Cancel",onClick:this.props.onCancel}),E.createElement(Zze,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),t}(E.Component);TD.propTypes={header:N.string,styles:N.object},TD.defaultProps={header:"Color Picker",styles:{}},wi(TD);var o8e=function(t){var r=t.onChange,i=t.rgb,n=t.hsl,o=t.hex,a=t.disableAlpha,s=gt({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:a}),c=function(l,h){l.hex?hl(l.hex)&&r({hex:l.hex,source:"hex"},h):l.r||l.g||l.b?r({r:l.r||i.r,g:l.g||i.g,b:l.b||i.b,a:i.a,source:"rgb"},h):l.a&&(l.a<0?l.a=0:l.a>100&&(l.a=100),l.a/=100,r({h:n.h,s:n.s,l:n.l,a:l.a,source:"rgb"},h))};return E.createElement("div",{style:s.fields,className:"flexbox-fix"},E.createElement("div",{style:s.double},E.createElement(Xt,{style:{input:s.input,label:s.label},label:"hex",value:o.replace("#",""),onChange:c})),E.createElement("div",{style:s.single},E.createElement(Xt,{style:{input:s.input,label:s.label},label:"r",value:i.r,onChange:c,dragLabel:"true",dragMax:"255"})),E.createElement("div",{style:s.single},E.createElement(Xt,{style:{input:s.input,label:s.label},label:"g",value:i.g,onChange:c,dragLabel:"true",dragMax:"255"})),E.createElement("div",{style:s.single},E.createElement(Xt,{style:{input:s.input,label:s.label},label:"b",value:i.b,onChange:c,dragLabel:"true",dragMax:"255"})),E.createElement("div",{style:s.alpha},E.createElement(Xt,{style:{input:s.input,label:s.label},label:"a",value:Math.round(i.a*100),onChange:c,dragLabel:"true",dragMax:"100"})))},a8e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},$W=function(t){var r=t.colors,i=t.onClick,n=i===void 0?function(){}:i,o=t.onSwatchHover,a=gt({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!r||!r.length}),s=function(u,l){n({hex:u,source:"hex"},l)};return E.createElement("div",{style:a.colors,className:"flexbox-fix"},r.map(function(c){var u=typeof c=="string"?{color:c}:c,l=""+u.color+(u.title||"");return E.createElement("div",{key:l,style:a.swatchWrap},E.createElement(Jc,a8e({},u,{style:a.swatch,onClick:s,onHover:o,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+u.color}})))}))};$W.propTypes={colors:N.arrayOf(N.oneOfType([N.string,N.shape({color:N.string,title:N.string})])).isRequired};var s8e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},ED=function(t){var r=t.width,i=t.rgb,n=t.hex,o=t.hsv,a=t.hsl,s=t.onChange,c=t.onSwatchHover,u=t.disableAlpha,l=t.presetColors,h=t.renderers,f=t.styles,d=f===void 0?{}:f,p=t.className,m=p===void 0?"":p,g=gt(Si({default:s8e({picker:{width:r,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:"rgba("+i.r+","+i.g+","+i.b+","+i.a+")",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}},d),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},d),{disableAlpha:u});return E.createElement("div",{style:g.picker,className:"sketch-picker "+m},E.createElement("div",{style:g.saturation},E.createElement(dT,{style:g.Saturation,hsl:a,hsv:o,onChange:s})),E.createElement("div",{style:g.controls,className:"flexbox-fix"},E.createElement("div",{style:g.sliders},E.createElement("div",{style:g.hue},E.createElement(Dh,{style:g.Hue,hsl:a,onChange:s})),E.createElement("div",{style:g.alpha},E.createElement(lD,{style:g.Alpha,rgb:i,hsl:a,renderers:h,onChange:s}))),E.createElement("div",{style:g.color},E.createElement(Ph,null),E.createElement("div",{style:g.activeColor}))),E.createElement(o8e,{rgb:i,hsl:a,hex:n,onChange:s,disableAlpha:u}),E.createElement($W,{colors:l,onClick:s,onSwatchHover:c}))};ED.propTypes={disableAlpha:N.bool,width:N.oneOfType([N.string,N.number]),styles:N.object},ED.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]};const l8e=wi(ED);var Og=function(t){var r=t.hsl,i=t.offset,n=t.onClick,o=n===void 0?function(){}:n,a=t.active,s=t.first,c=t.last,u=gt({default:{swatch:{height:"12px",background:"hsl("+r.h+", 50%, "+i*100+"%)",cursor:"pointer"}},first:{swatch:{borderRadius:"2px 0 0 2px"}},last:{swatch:{borderRadius:"0 2px 2px 0"}},active:{swatch:{transform:"scaleY(1.8)",borderRadius:"3.6px/2px"}}},{active:a,first:s,last:c}),l=function(f){return o({h:r.h,s:.5,l:i,source:"hsl"},f)};return E.createElement("div",{style:u.swatch,onClick:l})},c8e=function(t){var r=t.onClick,i=t.hsl,n=gt({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}}),o=.1;return E.createElement("div",{style:n.swatches},E.createElement("div",{style:n.swatch},E.createElement(Og,{hsl:i,offset:".80",active:Math.abs(i.l-.8)<o&&Math.abs(i.s-.5)<o,onClick:r,first:!0})),E.createElement("div",{style:n.swatch},E.createElement(Og,{hsl:i,offset:".65",active:Math.abs(i.l-.65)<o&&Math.abs(i.s-.5)<o,onClick:r})),E.createElement("div",{style:n.swatch},E.createElement(Og,{hsl:i,offset:".50",active:Math.abs(i.l-.5)<o&&Math.abs(i.s-.5)<o,onClick:r})),E.createElement("div",{style:n.swatch},E.createElement(Og,{hsl:i,offset:".35",active:Math.abs(i.l-.35)<o&&Math.abs(i.s-.5)<o,onClick:r})),E.createElement("div",{style:n.swatch},E.createElement(Og,{hsl:i,offset:".20",active:Math.abs(i.l-.2)<o&&Math.abs(i.s-.5)<o,onClick:r,last:!0})),E.createElement("div",{style:n.clear}))},u8e=function(){var t=gt({default:{picker:{width:"14px",height:"14px",borderRadius:"6px",transform:"translate(-7px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return E.createElement("div",{style:t.picker})},SD=function(t){var r=t.hsl,i=t.onChange,n=t.pointer,o=t.styles,a=o===void 0?{}:o,s=t.className,c=s===void 0?"":s,u=gt(Si({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},a));return E.createElement("div",{style:u.wrap||{},className:"slider-picker "+c},E.createElement("div",{style:u.hue},E.createElement(Dh,{style:u.Hue,hsl:r,pointer:n,onChange:i})),E.createElement("div",{style:u.swatches},E.createElement(c8e,{hsl:r,onClick:i})))};SD.propTypes={styles:N.object},SD.defaultProps={pointer:u8e,styles:{}},wi(SD);var jW={};Object.defineProperty(jW,"__esModule",{value:!0});var UW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},f8e=E,GW=h8e(f8e);function h8e(e){return e&&e.__esModule?e:{default:e}}function d8e(e,t){var r={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r}var vT=24,p8e=jW.default=function(e){var t=e.fill,r=t===void 0?"currentColor":t,i=e.width,n=i===void 0?vT:i,o=e.height,a=o===void 0?vT:o,s=e.style,c=s===void 0?{}:s,u=d8e(e,["fill","width","height","style"]);return GW.default.createElement("svg",UW({viewBox:"0 0 "+vT+" "+vT,style:UW({fill:r,width:n,height:a},c)},u),GW.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},m8e=function(t){var r=t.color,i=t.onClick,n=i===void 0?function(){}:i,o=t.onSwatchHover,a=t.first,s=t.last,c=t.active,u=gt({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:r,marginBottom:"1px"},check:{color:dD(r),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:a,last:s,active:c,"color-#FFFFFF":r==="#FFFFFF",transparent:r==="transparent"});return E.createElement(Jc,{color:r,style:u.color,onClick:n,onHover:o,focusStyle:{boxShadow:"0 0 4px "+r}},E.createElement("div",{style:u.check},E.createElement(p8e,null)))},g8e=function(t){var r=t.onClick,i=t.onSwatchHover,n=t.group,o=t.active,a=gt({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return E.createElement("div",{style:a.group},fl(n,function(s,c){return E.createElement(m8e,{key:s,color:s,active:s.toLowerCase()===o,first:c===0,last:c===n.length-1,onClick:r,onSwatchHover:i})}))},wD=function(t){var r=t.width,i=t.height,n=t.onChange,o=t.onSwatchHover,a=t.colors,s=t.hex,c=t.styles,u=c===void 0?{}:c,l=t.className,h=l===void 0?"":l,f=gt(Si({default:{picker:{width:r,height:i},overflow:{height:i,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},u)),d=function(m,g){return n({hex:m,source:"hex"},g)};return E.createElement("div",{style:f.picker,className:"swatches-picker "+h},E.createElement(Tg,null,E.createElement("div",{style:f.overflow},E.createElement("div",{style:f.body},fl(a,function(p){return E.createElement(g8e,{key:p.toString(),group:p,active:s,onClick:d,onSwatchHover:o})}),E.createElement("div",{style:f.clear})))))};wD.propTypes={width:N.oneOfType([N.string,N.number]),height:N.oneOfType([N.string,N.number]),colors:N.arrayOf(N.arrayOf(N.string)),styles:N.object},wD.defaultProps={width:320,height:240,colors:[[xh[900],xh[700],xh[500],xh[300],xh[100]],[Nh[900],Nh[700],Nh[500],Nh[300],Nh[100]],[Rh[900],Rh[700],Rh[500],Rh[300],Rh[100]],[Mh[900],Mh[700],Mh[500],Mh[300],Mh[100]],[Lh[900],Lh[700],Lh[500],Lh[300],Lh[100]],[Bh[900],Bh[700],Bh[500],Bh[300],Bh[100]],[Hh[900],Hh[700],Hh[500],Hh[300],Hh[100]],[Fh[900],Fh[700],Fh[500],Fh[300],Fh[100]],[$h[900],$h[700],$h[500],$h[300],$h[100]],["#194D33",Ag[700],Ag[500],Ag[300],Ag[100]],[jh[900],jh[700],jh[500],jh[300],jh[100]],[Uh[900],Uh[700],Uh[500],Uh[300],Uh[100]],[Gh[900],Gh[700],Gh[500],Gh[300],Gh[100]],[zh[900],zh[700],zh[500],zh[300],zh[100]],[Vh[900],Vh[700],Vh[500],Vh[300],Vh[100]],[Wh[900],Wh[700],Wh[500],Wh[300],Wh[100]],[Yh[900],Yh[700],Yh[500],Yh[300],Yh[100]],[qh[900],qh[700],qh[500],qh[300],qh[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}},wi(wD);var AD=function(t){var r=t.onChange,i=t.onSwatchHover,n=t.hex,o=t.colors,a=t.width,s=t.triangle,c=t.styles,u=c===void 0?{}:c,l=t.className,h=l===void 0?"":l,f=gt(Si({default:{card:{width:a,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},u),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),d=function(m,g){hl(m)&&r({hex:m,source:"hex"},g)};return E.createElement("div",{style:f.card,className:"twitter-picker "+h},E.createElement("div",{style:f.triangleShadow}),E.createElement("div",{style:f.triangle}),E.createElement("div",{style:f.body},fl(o,function(p,m){return E.createElement(Jc,{key:m,color:p,hex:p,style:f.swatch,onClick:d,onHover:i,focusStyle:{boxShadow:"0 0 4px "+p}})}),E.createElement("div",{style:f.hash},"#"),E.createElement(Xt,{label:null,style:{input:f.input},value:n.replace("#",""),onChange:d}),E.createElement("div",{style:f.clear})))};AD.propTypes={width:N.oneOfType([N.string,N.number]),triangle:N.oneOf(["hide","top-left","top-right"]),colors:N.arrayOf(N.string),styles:N.object},AD.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}},wi(AD);var OD=function(t){var r=gt({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(t.hsl.h)+", "+Math.round(t.hsl.s*100)+"%, "+Math.round(t.hsl.l*100)+"%)"}}});return E.createElement("div",{style:r.picker})};OD.propTypes={hsl:N.shape({h:N.number,s:N.number,l:N.number,a:N.number})},OD.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var kD=function(t){var r=gt({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(t.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return E.createElement("div",{style:r.picker})};kD.propTypes={hsl:N.shape({h:N.number,s:N.number,l:N.number,a:N.number})},kD.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var v8e=function(t){var r=t.onChange,i=t.rgb,n=t.hsl,o=t.hex,a=t.hsv,s=function(d,p){if(d.hex)hl(d.hex)&&r({hex:d.hex,source:"hex"},p);else if(d.rgb){var m=d.rgb.split(",");pD(d.rgb,"rgb")&&r({r:m[0],g:m[1],b:m[2],a:1,source:"rgb"},p)}else if(d.hsv){var g=d.hsv.split(",");pD(d.hsv,"hsv")&&(g[2]=g[2].replace("%",""),g[1]=g[1].replace("%",""),g[0]=g[0].replace("\xB0",""),g[1]==1?g[1]=.01:g[2]==1&&(g[2]=.01),r({h:Number(g[0]),s:Number(g[1]),v:Number(g[2]),source:"hsv"},p))}else if(d.hsl){var v=d.hsl.split(",");pD(d.hsl,"hsl")&&(v[2]=v[2].replace("%",""),v[1]=v[1].replace("%",""),v[0]=v[0].replace("\xB0",""),h[1]==1?h[1]=.01:h[2]==1&&(h[2]=.01),r({h:Number(v[0]),s:Number(v[1]),v:Number(v[2]),source:"hsl"},p))}},c=gt({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),u=i.r+", "+i.g+", "+i.b,l=Math.round(n.h)+"\xB0, "+Math.round(n.s*100)+"%, "+Math.round(n.l*100)+"%",h=Math.round(a.h)+"\xB0, "+Math.round(a.s*100)+"%, "+Math.round(a.v*100)+"%";return E.createElement("div",{style:c.wrap,className:"flexbox-fix"},E.createElement("div",{style:c.fields},E.createElement("div",{style:c.double},E.createElement(Xt,{style:{input:c.input,label:c.label},label:"hex",value:o,onChange:s})),E.createElement("div",{style:c.column},E.createElement("div",{style:c.single},E.createElement(Xt,{style:{input:c.input2,label:c.label2},label:"rgb",value:u,onChange:s})),E.createElement("div",{style:c.single},E.createElement(Xt,{style:{input:c.input2,label:c.label2},label:"hsv",value:h,onChange:s})),E.createElement("div",{style:c.single},E.createElement(Xt,{style:{input:c.input2,label:c.label2},label:"hsl",value:l,onChange:s})))))},ID=function(t){var r=t.width,i=t.onChange,n=t.rgb,o=t.hsl,a=t.hsv,s=t.hex,c=t.header,u=t.styles,l=u===void 0?{}:u,h=t.className,f=h===void 0?"":h,d=gt(Si({default:{picker:{width:r,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+n.r+", "+n.g+", "+n.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},l));return E.createElement("div",{style:d.picker,className:"google-picker "+f},E.createElement("div",{style:d.head},c),E.createElement("div",{style:d.swatch}),E.createElement("div",{style:d.saturation},E.createElement(dT,{hsl:o,hsv:a,pointer:OD,onChange:i})),E.createElement("div",{style:d.body},E.createElement("div",{style:d.controls,className:"flexbox-fix"},E.createElement("div",{style:d.hue},E.createElement(Dh,{style:d.Hue,hsl:o,radius:"4px",pointer:kD,onChange:i}))),E.createElement(v8e,{rgb:n,hsl:o,hex:s,hsv:a,onChange:i})))};ID.propTypes={width:N.oneOfType([N.string,N.number]),styles:N.object,header:N.string},ID.defaultProps={width:652,styles:{},header:"Color picker"},wi(ID);function y8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zW(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_8e(i.key),i)}}function b8e(e,t,r){return t&&zW(e.prototype,t),r&&zW(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _8e(e){var t=T8e(e,"string");return typeof t=="symbol"?t:String(t)}function T8e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function E8e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CD(e,t)}function CD(e,t){return CD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},CD(e,t)}function S8e(e){var t=O8e();return function(){var i=yT(e),n;if(t){var o=yT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return w8e(this,n)}}function w8e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A8e(e)}function A8e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O8e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yT(e){return yT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yT(e)}let VW=function(e){E8e(r,e);var t=S8e(r);function r(i){var n;y8e(this,r),n=t.call(this,i);const o=hu(i.color);return n.state={displayColorPicker:!1,color:{r:o.r,g:o.g,b:o.b,a:o.opacity}},n}return b8e(r,[{key:"handleClick",value:function(){this.setState(n=>({displayColorPicker:!n.displayColorPicker}))}},{key:"handleClose",value:function(){this.setState({displayColorPicker:!1})}},{key:"handleChange",value:function(n){const o=n.rgb,a=`rgba(${o.r},${o.g},${o.b},${o.a})`;this.props.onChange(a),this.setState({color:n.rgb})}},{key:"render",value:function(){const n=gt({default:{color:{width:"32px",height:"14px",borderRadius:"2px",background:`rgba(${this.state.color.r}, ${this.state.color.g}, ${this.state.color.b}, ${this.state.color.a})`},swatch:{padding:"5px",background:"#fff",cursor:"pointer",borderRadius:"1px"},popover:{position:"absolute",zIndex:"2"},cover:{position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}}});return E.createElement("div",null,E.createElement("div",{onClick:this.handleClick.bind(this),style:n.swatch},E.createElement("div",{style:n.color})),this.state.displayColorPicker?E.createElement("div",{style:n.popover},E.createElement("div",{onClick:this.handleClose.bind(this),style:n.cover}),E.createElement(l8e,{color:this.state.color,onChange:this.handleChange.bind(this)})):null)}}]),r}(E.Component);VW.propTypes={color:N.string,onChange:N.func};function k8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WW(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,C8e(i.key),i)}}function I8e(e,t,r){return t&&WW(e.prototype,t),r&&WW(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function C8e(e){var t=P8e(e,"string");return typeof t=="symbol"?t:String(t)}function P8e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function D8e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PD(e,t)}function PD(e,t){return PD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},PD(e,t)}function x8e(e){var t=M8e();return function(){var i=bT(e),n;if(t){var o=bT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return N8e(this,n)}}function N8e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R8e(e)}function R8e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M8e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bT(e){return bT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bT(e)}let DD=function(e){D8e(r,e);var t=x8e(r);function r(i){var n;return k8e(this,r),n=t.call(this,i),n.state={colors:i.track.options.colorRange.slice()},n}return I8e(r,[{key:"handleColorsChanged",value:function(n){this.setState({colors:n})}},{key:"handleSubmit",value:function(){const n=this.props.track.options;n.colorRange=this.state.colors,this.props.onSubmit(this.props.track.options)}},{key:"handleAddColor",value:function(){this.setState(n=>({colors:n.colors.concat(n.colors[n.colors.length-1])}))}},{key:"handleRemoveColor",value:function(n){this.setState(o=>({colors:o.colors.slice(0,n).concat(o.colors.slice(n+1))}))}},{key:"render",value:function(){const n=JSON.parse(JSON.stringify(this.props.track)),o=Object.assign(n,{options:{colorRange:this.state.colors}}),a={editable:!1,zoomFixed:!0,views:[{uid:`hmo-${this.props.track.uid}`,initialXDomain:this.props.xScale?this.props.xScale.domain():[0,1],initialYDomain:this.props.yScale?this.props.yScale.domain():[0,1],tracks:{center:[o]},layout:{x:0,y:0,h:12,w:12,i:`hmo-${this.props.track.id}`}}]},s=this.state.colors.map((u,l)=>{const h=this.state.colors.length>2&&l===this.state.colors.length-1?E.createElement("div",{onClick:()=>this.handleRemoveColor(l),style:{background:"white",position:"absolute",top:0,right:0,opacity:1,width:14,height:14,borderRadius:2,cursor:"pointer"}},E.createElement("svg",{height:"10px",style:{position:"absolute",top:2,right:2,opacity:.5,width:10,height:10}},E.createElement("use",{xlinkHref:"#cross"}))):null;return E.createElement("div",{key:`l${l}`,style:{borderRadius:"1px",boxShadow:"0 0 0 1px #E5E5E5",position:"relative",outline:"none"}},h,E.createElement(VW,{key:l,color:this.state.colors[l],onChange:f=>{this.setState(d=>{const p=d.colors.slice();return p[l]=f,{colors:p}},()=>{this.handleColorsChanged(this.state.colors)})}}))}).reverse(),c=this.state.colors.length<10?E.createElement("div",{onClick:this.handleAddColor.bind(this),style:{position:"relative",outline:"none",height:"25px",padding:"5px",background:"#fff",borderRadius:"1px",boxShadow:"0 0 0 1px #E5E5E5",cursor:"pointer"}},E.createElement("div",{style:{textAlign:"center",width:"32px",height:"14px"}},E.createElement("svg",{height:"100%",style:{opacity:.5,margin:"auto",display:"block"},width:"10px"},E.createElement("use",{xlinkHref:"#plus"})))):null;return E.createElement(og,{okayTitle:"Submit",onCancel:this.props.onCancel,onOkay:this.handleSubmit.bind(this),title:"Custom Color Map"},E.createElement("table",{className:"table-track-options"},E.createElement("thead",null),E.createElement("tbody",{style:{verticalAlign:"top"}},E.createElement("tr",null,E.createElement("td",{className:"td-track-options"},E.createElement("table",null,E.createElement("tbody",null,E.createElement("tr",null,E.createElement("td",{className:"td-track-options"},"Preview")),E.createElement("tr",null,E.createElement("td",{className:"td-track-options"},E.createElement("div",{style:{width:200}},E.createElement(td,{options:{bounded:!1},viewConfig:a}))))))),E.createElement("td",{className:"td-track-options"},E.createElement("table",null,E.createElement("tbody",null,E.createElement("tr",null,E.createElement("td",{className:"td-track-options"},"Colors")),E.createElement("tr",null,E.createElement("td",{className:"td-track-options"},c,E.createElement("div",{style:{position:"relative"}},s))))))))))}}]),r}(E.Component);DD.propTypes={handleCancel:N.func,onCancel:N.func,onSubmit:N.func,track:N.object,xScale:N.object,yScale:N.object};const YW=e=>{if(!e.header)return[];const t=e.header.split(" "),r=[];for(let i=0;i<t.length;i++)r.push({name:t[i],value:i+1});return r},Xh=(e,t="",r=1)=>e.reduce((i,n)=>(i[n]={name:`${n*r}${t}`,value:n},i),{}),$i={yes:{name:"Yes",value:!0},no:{name:"No",value:!1}},Rr={black:{name:"Black",value:"black"},blue:{name:"Blue",value:"blue"},brown:{name:"Brown",value:"brown"},cyan:{name:"Cyan",value:"cyan"},green:{name:"Green",value:"green"},grey:{name:"Grey",value:"grey"},orange:{name:"Orange",value:"orange"},purple:{name:"Purple",value:"purple"},turquoise:{name:"Turquoise",value:"turquoise"},red:{name:"Red",value:"red"},white:{name:"White",value:"white"}},L8e={use_stroke:{name:"Glyph color",value:"[glyph-color]"}},kg=Xh([1,2,3,5,8,13,21]),B8e=Object.assign(kg,{none:{name:"none",value:"none"}}),_T=Xh([0,2,4,8,16,32,64,128,256]),dl=Xh([0,.2,.4,.6,.8,1],"%",100),H8e=Xh([.2,.4,.6,.8,1],"%",100),wn={axisLabelFormatting:{name:"Axis Label Formatting",inlineOptions:{normal:{name:"normal",value:"normal"},scientific:{name:"scientific",value:"scientific"}}},flipDiagonal:{name:"Flip Across Diagonal",inlineOptions:{none:{name:"No",value:"none"},yes:{name:"Yes",value:"yes"},copy:{name:"Copy",value:"copy"}}},heatmapValueScaling:{name:"Value Scaling",inlineOptions:{linear:{name:"Linear",value:"linear"},log:{name:"Log",value:"log"}}},valueScaling:{name:"Value Scaling",inlineOptions:{linear:{name:"Linear",value:"linear"},log:{name:"Log",value:"log"}}},extent:{name:"Extent",inlineOptions:{full:{name:"Full",value:"full"},upperRight:{name:"Upper Right",value:"upper-right"},lowerLeft:{name:"Lower Left",value:"lower-left"}}},labelLeftMargin:{name:"Label Left Margin",inlineOptions:_T},labelRightMargin:{name:"Label Right Margin",inlineOptions:_T},labelTopMargin:{name:"Label Top Margin",inlineOptions:_T},labelBottomMargin:{name:"Label Bottom Margin",inlineOptions:_T},labelShowResolution:{name:"Label Show Resolution",inlineOptions:$i},labelShowAssembly:{name:"Label Show Assembly",inlineOptions:$i},lineStrokeWidth:{name:"Stroke Width",inlineOptions:kg},strokeWidth:{name:"Stroke Width",inlineOptions:kg},trackBorderWidth:{name:"Track Border Width",inlineOptions:kg},separatePlusMinusStrands:{name:"Separate +/- strands",inlineOptions:$i},sortLargestOnTop:{name:"Sort Largest On Top",inlineOptions:$i},showTexts:{name:"Show texts",inlineOptions:$i},staggered:{name:"Staggered",inlineOptions:$i},minSquareSize:{name:"Minimum size",inlineOptions:B8e},pointSize:{name:"Point Size",inlineOptions:kg},pointColor:{name:"Point Color",inlineOptions:Rr},trackBorderColor:{name:"Track Border Color",inlineOptions:Rr},backgroundColor:{name:"Background Color",inlineOptions:{white:{name:"White",value:"white"},lightGrey:{name:"Light Grey",value:"#eeeeee"},grey:{name:"Grey",value:"#cccccc"},black:{name:"Black",value:"black"},transparent:{name:"Transparent",value:"transparent"}}},colorScale:{name:"Color Scale",inlineOptions:{epilogos:{name:"Epilogos",values:["#FF0000","#FF4500","#32CD32","#008000","#006400","#C2E105","#FFFF00","#66CDAA","#8A91D0","#CD5C5C","#E9967A","#BDB76B","#808080","#C0C0C0","#FFFFFF"]},category10:{name:"D3 Category10",values:["#1F77B4","#FF7F0E","#2CA02C","#D62728","#9467BD","#8C564B","#E377C2","#7F7F7F","#BCBD22","#17BECF"]}}},minusStrandColor:{name:"- Strand Color",inlineOptions:Rr},plusStrandColor:{name:"+ Strand Color",inlineOptions:Rr},lineStrokeColor:{name:"Stroke color",inlineOptions:Rr},projectionStrokeColor:{name:"Stroke color",inlineOptions:Rr},projectionFillColor:{name:"Fill color",inlineOptions:Rr},stroke:{name:"Stroke Color",inlineOptions:Rr},strokeColor:{name:"Stroke color",inlineOptions:Rr},fill:{name:"Fill Color",inlineOptions:Rr},color:{name:"Color",inlineOptions:Rr},fontColor:{name:"Font color",inlineOptions:Rr},fillColor:{name:"Fill color",inlineOptions:Rr},barFillColor:{name:"Fill color",inlineOptions:Rr},barFillColorTop:{name:"Top Fill color",inlineOptions:Rr},barFillColorBottom:{name:"Bottom Fill color",inlineOptions:Rr},barOpacity:{name:"Bar opacity",inlineOptions:dl},zeroLineVisible:{name:"Zero line visible",inlineOptions:$i},zeroLineColor:{name:"Zero line color",inlineOptions:Rr},zeroLineOpacity:{name:"Zero line opacity",inlineOptions:H8e},fillOpacity:{name:"Fill Opacity",inlineOptions:dl},strokeOpacity:{name:"Stroke Opacity",inlineOptions:dl},strokePos:{name:"Stroke Position",inlineOptions:{aroundInner:{name:"Around Inner",value:"around"},aroundCenter:{name:"Around Center",value:null},hidden:{name:"Hidden",value:"hidden"},top:{name:"Top",value:"top"},right:{name:"Right",value:"right"},bottom:{name:"Bottom",value:"bottom"},left:{name:"Left",value:"left"}}},barBorder:{name:"Bar border",inlineOptions:$i},scaledHeight:{name:"Scaled height",inlineOptions:$i},rectangleDomainStrokeColor:{name:"Stroke color",inlineOptions:Rr},rectangleDomainFillColor:{name:"Fill color",inlineOptions:Rr},rectangleDomainFillOpacity:{name:"Fill opacity",inlineOptions:dl},rectangleDomainOpacity:{name:"Opacity",inlineOptions:dl},mapboxStyle:{name:"Map style",inlineOptions:{streets:{name:"streets",value:"mapbox.streets"},light:{name:"light",value:"mapbox.light"},dark:{name:"dark",value:"mapbox.dark"},satellite:{name:"satellite",value:"mapbox.satellite"},"streets-satellite":{name:"streets-satellite",value:"mapbox.streets-satellite"},wheatpaste:{name:"wheatpaste",value:"mapbox.wheatpaste"},"streets-basic":{name:"streets-basic",value:"mapbox.streets-basic"},comic:{name:"comic",value:"mapbox.comic"},outdoors:{name:"outdoors",value:"mapbox.outdoors"},"run-bike-hike":{name:"run-bike-hike",value:"mapbox.run-bike-hike"},pencil:{name:"pencil",value:"mapbox.pencil"},pirates:{name:"pirates",value:"mapbox.pirates"},emerald:{name:"emerald",value:"mapbox.emerald"},"high-contrast":{name:"high-contrast",value:"mapbox.high-contrast"}}},oneDHeatmapFlipped:{name:"Flip Heatmap",inlineOptions:{yes:{name:"Yes",value:"yes"},no:{name:"No",value:null}}},showMousePosition:{name:"Show Mouse Position",inlineOptions:$i},showTooltip:{name:"Show Tooltip",inlineOptions:$i},fontSize:{name:"Font Size",inlineOptions:Xh([8,9,10,11,12,14,16,18,24],"px")},tickPositions:{name:"Tick Positions",inlineOptions:{even:{name:"Even",value:"even"},ends:{name:"Ends",value:"ends"}}},tickFormat:{name:"Tick Format",inlineOptions:{plain:{name:"Plain",value:"plain"},si:{name:"SI",value:"si"}}},colorEncoding:{name:"Color Encode Annotations",inlineOptions:{none:{name:"None",value:null},itemRgb:{name:"itemRgb",value:"itemRgb"}},generateOptions:YW},fontIsAligned:{name:"Left-Align Font",inlineOptions:$i},axisPositionHorizontal:{name:"Axis Position",inlineOptions:{left:{name:"Left",value:"left"},outsideLeft:{name:"Outside left",value:"outsideLeft"},right:{name:"Right",value:"right"},outsideRight:{name:"Outside right",value:"outsideRight"},hidden:{name:"Hidden",value:null}}},axisPositionVertical:{name:"Axis Position",inlineOptions:{top:{name:"Top",value:"top"},outsideTop:{name:"Outside top",value:"outsideTop"},bottom:{name:"Bottom",value:"bottom"},outsideBottom:{name:"Outside bottom",value:"outsideBottom"},hidden:{name:"Hidden",value:null}}},axisMargin:{name:"Axis Margin",inlineOptions:Xh([0,10,20,30,40,50,100,200,400],"px")},colorbarPosition:{name:"Colorbar Position",inlineOptions:{topLeft:{name:"Top Left",value:"topLeft"},topRight:{name:"Top Right",value:"topRight"},bottomLeft:{name:"Bottom Left",value:"bottomLeft"},bottomRight:{name:"Bottom Right",value:"bottomRight"},hidden:{name:"Hidden",value:null}}},colorbarBackgroundColor:{name:"Colorbar Background Color",inlineOptions:Rr},colorbarBackgroundOpacity:{name:"Colorbar Background Opacity",inlineOptions:dl},colorbarLabelsPosition:{name:"Colorbar Labels Position",inlineOptions:{inside:{name:"Inside",value:"inside"},outside:{name:"Outside",value:"outside"}}},labelColor:{name:"Label Color",inlineOptions:{...Rr,...L8e}},labelPosition:{name:"Label Position",inlineOptions:{ol:{name:"Outer left",value:"outerLeft"},or:{name:"Outer right",value:"outerRight"},ot:{name:"Outer top",value:"outerTop"},ob:{name:"Outer bottom",value:"outerBottom"},tl:{name:"Top left",value:"topLeft"},tr:{name:"Top right",value:"topRight"},bl:{name:"Bottom left",value:"bottomLeft"},br:{name:"Bottom right",value:"bottomRight"},hidden:{name:"Hidden",value:"hidden"}}},labelTextOpacity:{name:"Label Text Opacity",inlineOptions:dl},geneAnnotationHeight:{name:"Gene Annotation Height",inlineOptions:{8:{name:"8px",value:8},10:{name:"10px",value:10},12:{name:"12px",value:12},16:{name:"16px",value:16}}},annotationHeight:{name:"Annotation Height",inlineOptions:{5:{name:"5px",value:5},8:{name:"8px",value:8},10:{name:"10px",value:10},12:{name:"12px",value:12},16:{name:"16px",value:16},20:{name:"20px",value:20},scaled:{name:"scaled",value:"scaled"}}},maxAnnotationHeight:{name:"Max Annotation Height",inlineOptions:{5:{name:"5px",value:5},8:{name:"8px",value:8},10:{name:"10px",value:10},12:{name:"12px",value:12},16:{name:"16px",value:16},20:{name:"20px",value:20},none:{name:"none",value:null}}},annotationStyle:{name:"Annotation Style",inlineOptions:{box:{name:"Box",value:"box"},segment:{name:"Segment",value:"segment"}}},geneLabelPosition:{name:"Gene Label Position",inlineOptions:{inside:{name:"Inside",value:"inside"},outside:{name:"Outside",value:"outside"}}},geneStrandSpacing:{name:"Gene Strand Spacing",inlineOptions:{2:{name:"2px",value:2},4:{name:"4px",value:4},8:{name:"8px",value:8}}},labelBackgroundColor:{name:"Label Background Color",inlineOptions:Rr},labelBackgroundOpacity:{name:"Label Background Opacity",inlineOptions:dl},viewResolution:{name:"View Resolution",inlineOptions:{high:{name:"High",value:384},medium:{name:"Medium",value:1024},low:{name:"Low",value:2048}}},colorRange:{name:"Color map",inlineOptions:{afmhot:{name:"afmhot",value:["rgba(0,0,0,1.0)","rgba(128,0,0,1.0)","rgba(256,129,1,1.0)","rgba(256,256,129,1.0)","rgba(256,256,256,1.0)"]},fall:{name:"fall",value:["white","rgba(245,166,35,1.0)","rgba(208,2,27,1.0)","black"]},hot:{name:"hot",value:["rgba(10,0,0,1.0)","rgba(179,0,0,1.0)","rgba(256,91,0,1.0)","rgba(256,256,6,1.0)","rgba(256,256,256,1.0)"]},jet:{name:"jet",value:["rgba(0,0,128,1.0)","rgba(0,129,256,1.0)","rgba(125,256,122,1.0)","rgba(256,148,0,1.0)","rgba(128,0,0,1.0)"]},bwr:{name:"bwr",value:["rgba(0,0,256,1.0)","rgba(128,128,256,1.0)","rgba(256,254,254,1.0)","rgba(256,126,126,1.0)","rgba(256,0,0,1.0)"]},cubehelix:{name:"cubehelix",value:["rgba(0,0,0,1.0)","rgba(21,83,76,1.0)","rgba(162,121,74,1.0)","rgba(199,180,238,1.0)","rgba(256,256,256,1.0)"]},rainbow:{name:"rainbow",value:["rgba(128,0,256,1.0)","rgba(0,181,236,1.0)","rgba(129,255,180,1.0)","rgba(256,179,96,1.0)","rgba(256,0,0,1.0)"]},gray:{name:"greys",value:["rgba(255,255,255,1)","rgba(0,0,0,1)"]},red:{name:"White to red",value:["rgba(255,255,255,1)","rgba(255,0,0,1)"]},green:{name:"White to green",value:["rgba(255,255,255,1)","rgba(0,255,0,1)"]},blue:{name:"White to blue",value:["rgba(255,255,255,1)","rgba(0,0,255,1)"]},custard:{name:"custard",value:["#FFFFFF","#F8E71C","rgba(245,166,35,1)","rgba(0,0,0,1)"]},magma:{name:"magma",value:["rgba(0,0,3,1)","rgba(0,0,4,1)","rgba(0,0,6,1)","rgba(1,0,7,1)","rgba(1,1,9,1)","rgba(1,1,11,1)","rgba(2,2,13,1)","rgba(2,2,15,1)","rgba(3,3,17,1)","rgba(4,3,19,1)","rgba(4,4,21,1)","rgba(5,4,23,1)","rgba(6,5,25,1)","rgba(7,5,27,1)","rgba(8,6,29,1)","rgba(9,7,32,1)","rgba(10,7,34,1)","rgba(11,8,36,1)","rgba(12,9,38,1)","rgba(13,10,40,1)","rgba(14,10,42,1)","rgba(15,11,45,1)","rgba(16,12,47,1)","rgba(17,12,49,1)","rgba(19,13,51,1)","rgba(20,13,54,1)","rgba(21,14,56,1)","rgba(22,14,58,1)","rgba(23,15,61,1)","rgba(25,15,63,1)","rgba(26,16,66,1)","rgba(27,16,68,1)","rgba(28,16,70,1)","rgba(30,17,73,1)","rgba(31,17,75,1)","rgba(33,17,78,1)","rgba(34,17,80,1)","rgba(36,17,83,1)","rgba(37,17,85,1)","rgba(39,17,87,1)","rgba(40,17,90,1)","rgba(42,17,92,1)","rgba(43,17,94,1)","rgba(45,17,97,1)","rgba(47,16,99,1)","rgba(49,16,101,1)","rgba(50,16,103,1)","rgba(52,16,105,1)","rgba(54,15,107,1)","rgba(55,15,108,1)","rgba(57,15,110,1)","rgba(59,15,112,1)","rgba(61,15,113,1)","rgba(62,15,114,1)","rgba(64,15,116,1)","rgba(66,15,117,1)","rgba(67,15,118,1)","rgba(69,15,119,1)","rgba(71,15,120,1)","rgba(72,16,120,1)","rgba(74,16,121,1)","rgba(76,16,122,1)","rgba(77,17,123,1)","rgba(79,17,123,1)","rgba(81,18,124,1)","rgba(82,18,124,1)","rgba(84,19,125,1)","rgba(85,20,125,1)","rgba(87,20,126,1)","rgba(88,21,126,1)","rgba(90,21,126,1)","rgba(92,22,127,1)","rgba(93,23,127,1)","rgba(95,23,127,1)","rgba(96,24,128,1)","rgba(98,25,128,1)","rgba(99,25,128,1)","rgba(101,26,128,1)","rgba(103,26,128,1)","rgba(104,27,129,1)","rgba(106,28,129,1)","rgba(107,28,129,1)","rgba(109,29,129,1)","rgba(110,30,129,1)","rgba(112,30,129,1)","rgba(113,31,129,1)","rgba(115,32,129,1)","rgba(117,32,129,1)","rgba(118,33,129,1)","rgba(120,33,129,1)","rgba(121,34,130,1)","rgba(123,35,130,1)","rgba(124,35,130,1)","rgba(126,36,130,1)","rgba(128,36,130,1)","rgba(129,37,129,1)","rgba(131,37,129,1)","rgba(132,38,129,1)","rgba(134,39,129,1)","rgba(136,39,129,1)","rgba(137,40,129,1)","rgba(139,40,129,1)","rgba(140,41,129,1)","rgba(142,41,129,1)","rgba(144,42,129,1)","rgba(145,42,129,1)","rgba(147,43,128,1)","rgba(148,43,128,1)","rgba(150,44,128,1)","rgba(152,44,128,1)","rgba(153,45,128,1)","rgba(155,46,127,1)","rgba(157,46,127,1)","rgba(158,47,127,1)","rgba(160,47,127,1)","rgba(161,48,126,1)","rgba(163,48,126,1)","rgba(165,49,126,1)","rgba(166,49,125,1)","rgba(168,50,125,1)","rgba(170,50,125,1)","rgba(171,51,124,1)","rgba(173,51,124,1)","rgba(175,52,123,1)","rgba(176,52,123,1)","rgba(178,53,123,1)","rgba(180,53,122,1)","rgba(181,54,122,1)","rgba(183,55,121,1)","rgba(185,55,121,1)","rgba(186,56,120,1)","rgba(188,56,120,1)","rgba(189,57,119,1)","rgba(191,57,118,1)","rgba(193,58,118,1)","rgba(194,59,117,1)","rgba(196,59,117,1)","rgba(198,60,116,1)","rgba(199,61,115,1)","rgba(201,61,115,1)","rgba(202,62,114,1)","rgba(204,63,113,1)","rgba(206,63,113,1)","rgba(207,64,112,1)","rgba(209,65,111,1)","rgba(210,66,110,1)","rgba(212,67,110,1)","rgba(213,67,109,1)","rgba(215,68,108,1)","rgba(216,69,107,1)","rgba(218,70,107,1)","rgba(219,71,106,1)","rgba(221,72,105,1)","rgba(222,73,104,1)","rgba(223,74,103,1)","rgba(225,75,103,1)","rgba(226,76,102,1)","rgba(227,78,101,1)","rgba(229,79,100,1)","rgba(230,80,100,1)","rgba(231,81,99,1)","rgba(232,83,98,1)","rgba(233,84,97,1)","rgba(234,85,97,1)","rgba(236,87,96,1)","rgba(237,88,95,1)","rgba(238,90,95,1)","rgba(239,91,94,1)","rgba(239,93,94,1)","rgba(240,95,93,1)","rgba(241,96,93,1)","rgba(242,98,93,1)","rgba(243,100,92,1)","rgba(243,101,92,1)","rgba(244,103,92,1)","rgba(245,105,92,1)","rgba(246,107,92,1)","rgba(246,108,92,1)","rgba(247,110,92,1)","rgba(247,112,92,1)","rgba(248,114,92,1)","rgba(248,116,92,1)","rgba(249,118,92,1)","rgba(249,120,92,1)","rgba(250,121,93,1)","rgba(250,123,93,1)","rgba(250,125,94,1)","rgba(251,127,94,1)","rgba(251,129,95,1)","rgba(251,131,95,1)","rgba(252,133,96,1)","rgba(252,135,97,1)","rgba(252,137,97,1)","rgba(252,139,98,1)","rgba(253,140,99,1)","rgba(253,142,100,1)","rgba(253,144,101,1)","rgba(253,146,102,1)","rgba(253,148,103,1)","rgba(254,150,104,1)","rgba(254,152,105,1)","rgba(254,154,106,1)","rgba(254,156,107,1)","rgba(254,157,108,1)","rgba(254,159,109,1)","rgba(254,161,110,1)","rgba(254,163,111,1)","rgba(254,165,112,1)","rgba(255,167,114,1)","rgba(255,169,115,1)","rgba(255,171,116,1)","rgba(255,172,118,1)","rgba(255,174,119,1)","rgba(255,176,120,1)","rgba(255,178,122,1)","rgba(255,180,123,1)","rgba(255,182,124,1)","rgba(255,184,126,1)","rgba(255,185,127,1)","rgba(255,187,129,1)","rgba(255,189,130,1)","rgba(255,191,132,1)","rgba(255,193,133,1)","rgba(255,195,135,1)","rgba(255,197,136,1)","rgba(255,198,138,1)","rgba(255,200,140,1)","rgba(255,202,141,1)","rgba(255,204,143,1)","rgba(254,206,144,1)","rgba(254,208,146,1)","rgba(254,209,148,1)","rgba(254,211,149,1)","rgba(254,213,151,1)","rgba(254,215,153,1)","rgba(254,217,155,1)","rgba(254,219,156,1)","rgba(254,220,158,1)","rgba(254,222,160,1)","rgba(254,224,162,1)","rgba(254,226,163,1)","rgba(253,228,165,1)","rgba(253,230,167,1)","rgba(253,231,169,1)","rgba(253,233,171,1)","rgba(253,235,172,1)","rgba(253,237,174,1)","rgba(253,239,176,1)","rgba(253,241,178,1)","rgba(253,242,180,1)","rgba(253,244,182,1)","rgba(253,246,184,1)","rgba(252,248,186,1)","rgba(252,250,188,1)","rgba(252,251,189,1)","rgba(252,253,191,1)"]},viridis:{name:"viridis",value:["rgba(68,1,84,1)","rgba(68,2,85,1)","rgba(69,3,87,1)","rgba(69,5,88,1)","rgba(69,6,90,1)","rgba(70,8,91,1)","rgba(70,9,93,1)","rgba(70,11,94,1)","rgba(70,12,96,1)","rgba(71,14,97,1)","rgba(71,15,98,1)","rgba(71,17,100,1)","rgba(71,18,101,1)","rgba(71,20,102,1)","rgba(72,21,104,1)","rgba(72,22,105,1)","rgba(72,24,106,1)","rgba(72,25,108,1)","rgba(72,26,109,1)","rgba(72,28,110,1)","rgba(72,29,111,1)","rgba(72,30,112,1)","rgba(72,32,113,1)","rgba(72,33,115,1)","rgba(72,34,116,1)","rgba(72,36,117,1)","rgba(72,37,118,1)","rgba(72,38,119,1)","rgba(72,39,120,1)","rgba(71,41,121,1)","rgba(71,42,121,1)","rgba(71,43,122,1)","rgba(71,44,123,1)","rgba(71,46,124,1)","rgba(70,47,125,1)","rgba(70,48,126,1)","rgba(70,49,126,1)","rgba(70,51,127,1)","rgba(69,52,128,1)","rgba(69,53,129,1)","rgba(69,54,129,1)","rgba(68,56,130,1)","rgba(68,57,131,1)","rgba(68,58,131,1)","rgba(67,59,132,1)","rgba(67,60,132,1)","rgba(67,62,133,1)","rgba(66,63,133,1)","rgba(66,64,134,1)","rgba(65,65,134,1)","rgba(65,66,135,1)","rgba(65,67,135,1)","rgba(64,69,136,1)","rgba(64,70,136,1)","rgba(63,71,136,1)","rgba(63,72,137,1)","rgba(62,73,137,1)","rgba(62,74,137,1)","rgba(61,75,138,1)","rgba(61,77,138,1)","rgba(60,78,138,1)","rgba(60,79,138,1)","rgba(59,80,139,1)","rgba(59,81,139,1)","rgba(58,82,139,1)","rgba(58,83,139,1)","rgba(57,84,140,1)","rgba(57,85,140,1)","rgba(56,86,140,1)","rgba(56,87,140,1)","rgba(55,88,140,1)","rgba(55,89,140,1)","rgba(54,91,141,1)","rgba(54,92,141,1)","rgba(53,93,141,1)","rgba(53,94,141,1)","rgba(52,95,141,1)","rgba(52,96,141,1)","rgba(51,97,141,1)","rgba(51,98,141,1)","rgba(51,99,141,1)","rgba(50,100,142,1)","rgba(50,101,142,1)","rgba(49,102,142,1)","rgba(49,103,142,1)","rgba(48,104,142,1)","rgba(48,105,142,1)","rgba(47,106,142,1)","rgba(47,107,142,1)","rgba(47,108,142,1)","rgba(46,109,142,1)","rgba(46,110,142,1)","rgba(45,111,142,1)","rgba(45,112,142,1)","rgba(45,112,142,1)","rgba(44,113,142,1)","rgba(44,114,142,1)","rgba(43,115,142,1)","rgba(43,116,142,1)","rgba(43,117,142,1)","rgba(42,118,142,1)","rgba(42,119,142,1)","rgba(41,120,142,1)","rgba(41,121,142,1)","rgba(41,122,142,1)","rgba(40,123,142,1)","rgba(40,124,142,1)","rgba(40,125,142,1)","rgba(39,126,142,1)","rgba(39,127,142,1)","rgba(38,128,142,1)","rgba(38,129,142,1)","rgba(38,130,142,1)","rgba(37,131,142,1)","rgba(37,131,142,1)","rgba(37,132,142,1)","rgba(36,133,142,1)","rgba(36,134,142,1)","rgba(35,135,142,1)","rgba(35,136,142,1)","rgba(35,137,142,1)","rgba(34,138,141,1)","rgba(34,139,141,1)","rgba(34,140,141,1)","rgba(33,141,141,1)","rgba(33,142,141,1)","rgba(33,143,141,1)","rgba(32,144,141,1)","rgba(32,145,140,1)","rgba(32,146,140,1)","rgba(32,147,140,1)","rgba(31,147,140,1)","rgba(31,148,140,1)","rgba(31,149,139,1)","rgba(31,150,139,1)","rgba(31,151,139,1)","rgba(30,152,139,1)","rgba(30,153,138,1)","rgba(30,154,138,1)","rgba(30,155,138,1)","rgba(30,156,137,1)","rgba(30,157,137,1)","rgba(30,158,137,1)","rgba(30,159,136,1)","rgba(30,160,136,1)","rgba(31,161,136,1)","rgba(31,162,135,1)","rgba(31,163,135,1)","rgba(31,163,134,1)","rgba(32,164,134,1)","rgba(32,165,134,1)","rgba(33,166,133,1)","rgba(33,167,133,1)","rgba(34,168,132,1)","rgba(35,169,131,1)","rgba(35,170,131,1)","rgba(36,171,130,1)","rgba(37,172,130,1)","rgba(38,173,129,1)","rgba(39,174,129,1)","rgba(40,175,128,1)","rgba(41,175,127,1)","rgba(42,176,127,1)","rgba(43,177,126,1)","rgba(44,178,125,1)","rgba(46,179,124,1)","rgba(47,180,124,1)","rgba(48,181,123,1)","rgba(50,182,122,1)","rgba(51,183,121,1)","rgba(53,183,121,1)","rgba(54,184,120,1)","rgba(56,185,119,1)","rgba(57,186,118,1)","rgba(59,187,117,1)","rgba(61,188,116,1)","rgba(62,189,115,1)","rgba(64,190,114,1)","rgba(66,190,113,1)","rgba(68,191,112,1)","rgba(70,192,111,1)","rgba(72,193,110,1)","rgba(73,194,109,1)","rgba(75,194,108,1)","rgba(77,195,107,1)","rgba(79,196,106,1)","rgba(81,197,105,1)","rgba(83,198,104,1)","rgba(85,198,102,1)","rgba(88,199,101,1)","rgba(90,200,100,1)","rgba(92,201,99,1)","rgba(94,201,98,1)","rgba(96,202,96,1)","rgba(98,203,95,1)","rgba(101,204,94,1)","rgba(103,204,92,1)","rgba(105,205,91,1)","rgba(108,206,90,1)","rgba(110,206,88,1)","rgba(112,207,87,1)","rgba(115,208,85,1)","rgba(117,208,84,1)","rgba(119,209,82,1)","rgba(122,210,81,1)","rgba(124,210,79,1)","rgba(127,211,78,1)","rgba(129,212,76,1)","rgba(132,212,75,1)","rgba(134,213,73,1)","rgba(137,213,72,1)","rgba(139,214,70,1)","rgba(142,215,68,1)","rgba(144,215,67,1)","rgba(147,216,65,1)","rgba(149,216,63,1)","rgba(152,217,62,1)","rgba(155,217,60,1)","rgba(157,218,58,1)","rgba(160,218,57,1)","rgba(163,219,55,1)","rgba(165,219,53,1)","rgba(168,220,51,1)","rgba(171,220,50,1)","rgba(173,221,48,1)","rgba(176,221,46,1)","rgba(179,221,45,1)","rgba(181,222,43,1)","rgba(184,222,41,1)","rgba(187,223,39,1)","rgba(189,223,38,1)","rgba(192,223,36,1)","rgba(195,224,35,1)","rgba(197,224,33,1)","rgba(200,225,32,1)","rgba(203,225,30,1)","rgba(205,225,29,1)","rgba(208,226,28,1)","rgba(211,226,27,1)","rgba(213,226,26,1)","rgba(216,227,25,1)","rgba(219,227,24,1)","rgba(221,227,24,1)","rgba(224,228,24,1)","rgba(226,228,24,1)","rgba(229,228,24,1)","rgba(232,229,25,1)","rgba(234,229,25,1)","rgba(237,229,26,1)","rgba(239,230,27,1)","rgba(242,230,28,1)","rgba(244,230,30,1)","rgba(247,230,31,1)","rgba(249,231,33,1)","rgba(251,231,35,1)","rgba(254,231,36,1)"]},custom:{name:"Custom...",componentPickers:{heatmap:DD,"horizontal-heatmap":DD}}}},align:{name:"Align",inlineOptions:{white:{name:"Top",value:"top"},lightGrey:{name:"Bottom",value:"bottom"}}},colorRangeGradient:{name:"Color Gradient",inlineOptions:$i},dataTransform:{name:"Transforms",inlineOptions:{default:{name:"Default",value:"default"},None:{name:"None",value:"None"}},generateOptions:e=>{const t=[];if(e.transforms)for(const r of e.transforms)t.push({name:r.name,value:r.value});return t}},aggregationMode:{name:"Aggregation Mode",inlineOptions:{},generateOptions:e=>{const t=[];return e.aggregationModes?Object.values(e.aggregationModes).forEach(({name:r,value:i})=>{t.push({name:r,value:i})}):t.push({name:"Default",value:"default"}),t}},maxZoom:{name:"Zoom limit",inlineOptions:{none:{name:"None",value:null}},generateOptions:e=>{if(e.maxZoom){const t=[];for(let r=0;r<=e.maxZoom;r++){const{maxWidth:i,binsPerDimension:n,maxZoom:o}=e;let a=1,s=1;if(e.resolutions){const h=e.resolutions.map(f=>+f).sort((f,d)=>d-f);[a]=h,s=h[r]}else s=e.maxWidth/(2**r*e.binsPerDimension),a=i/(2**o*n);const c=vu(a,s),l=Dl(`.${c}`,s)(s);t.push({name:l,value:r.toString()})}return t}return[]}},valueColumn:{name:"Value column",inlineOptions:{none:{name:"None",value:null}},generateOptions:YW},zeroValueColor:{name:"Zero Value Color",inlineOptions:Rr}},qW={...kie,IS_TRACK_RANGE_SELECTABLE:Hu,OPTIONS_INFO:wn},F8e={d3Array:LK,d3Axis:sIe,d3Brush:Cne,d3Color:KK,d3Drag:sre,d3Dsv:Kie,d3Format:wZ,d3Geo:N5e,d3Queue:H5e,d3Request:iBe,d3Scale:JQ,d3Selection:M2,d3Transition:$1e,d3Zoom:Y1e,PIXI:qW.GLOBALS.PIXI,mix:mh,slugid:xt},TT={chromosomes:{ChromosomeInfo:ma,SearchField:ch},libraries:F8e,tracks:{Annotations1dTrack:zI,Annotations2dTrack:l9,ArrowheadDomainsTrack:o9,BarTrack:PI,BedLikeTrack:N8,CNVIntervalTrack:q8,Chromosome2DAnnotations:b9,Chromosome2DLabels:g9,ChromosomeGrid:xm,CombinedTrack:ZS,CrossRule:n7,DivergentBarTrack:z8,HeatmapTiledPixiTrack:vm,Horizontal1dHeatmapTrack:W8,Horizontal2DDomainsTrack:f9,HorizontalChromosomeLabels:S9,HorizontalGeneAnnotationsTrack:$I,HorizontalHeatmapTrack:A9,HorizontalLine1DPixiTrack:ah,HorizontalMultivecTrack:j8,HorizontalPoint1DPixiTrack:F8,HorizontalRule:q9,HorizontalTiled1DPixiTrack:Yf,HorizontalTiledPlot:K0,HorizontalTrack:z3,Id2DTiledPixiTrack:Oz,IdHorizontal1DTiledPixiTrack:Dz,IdVertical1DTiledPixiTrack:Mz,LeftAxisTrack:Gz,MapboxTilesTrack:c7,MoveableTrack:V0,OSMTileIdsTrack:s7,OSMTilesTrack:Hm,OverlayTrack:L8,PixiTrack:ei,RasterTilesTrack:f7,SVGTrack:Ks,SquareMarkersTrack:d9,Tiled1DPixiTrack:Zk,TiledPixiTrack:Ws,TopAxisTrack:jz,Track:Mf,ValueIntervalTrack:P9,VerticalRule:t7,VerticalTiled1DPixiTrack:Nz,VerticalTrack:X3,ViewportTracker2D:x9,ViewportTracker2DPixi:wHe,ViewportTrackerHorizontal:R9,ViewportTrackerVertical:L9},dataFetchers:{DataFetcher:a_,GBKDataFetcher:pz,LocalDataFetcher:gz,getDataFetcher:bLe},factories:{ContextMenuItem:St,DataFetcher:a_,LruCache:Q3},services:Aoe,utils:cSe,configs:qW,VERSION:CP},xD={"track-renderer":"_track-renderer_11dwb_1","track-renderer-element":"_track-renderer-element_11dwb_5","track-renderer-events":"_track-renderer-events_11dwb_6"};function $8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XW(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,U8e(i.key),i)}}function j8e(e,t,r){return t&&XW(e.prototype,t),r&&XW(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function U8e(e){var t=G8e(e,"string");return typeof t=="symbol"?t:String(t)}function G8e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z8e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ND(e,t)}function ND(e,t){return ND=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},ND(e,t)}function V8e(e){var t=Y8e();return function(){var i=ET(e),n;if(t){var o=ET(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return W8e(this,n)}}function W8e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bo(e)}function Bo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y8e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ET(e){return ET=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ET(e)}const{getDataFetcher:q8e}=TT.dataFetchers,X8e=100;let RD=function(e){z8e(r,e);var t=V8e(r);function r(i){var n;if($8e(this,r),n=t.call(this,i),n.dragging=!1,n.element=null,n.eventTracker=null,n.eventTrackerOld=null,n.closing=!1,n.yPositionOffset=0,n.xPositionOffset=0,n.scrollTop=0,n.scrollTimeout=null,n.activeTransitions=0,n.zoomTransform=fn,n.windowScrolledBound=n.windowScrolled.bind(Bo(n)),n.zoomStartedBound=n.zoomStarted.bind(Bo(n)),n.zoomedBound=n.zoomed.bind(Bo(n)),n.zoomEndedBound=n.zoomEnded.bind(Bo(n)),n.uid=xt.nice(),n.viewUid=n.props.uid,n.availableForPlugins={...TT,services:{...TT.services,pubSub:n.props.pubSub,pixiRenderer:n.props.pixiRenderer}},n.mounted=!1,n.emptyZoomBehavior=ak(),n.currentProps=i,n.prevPropsStr="",n.zoomBehavior=ak().filter(o=>!(o.target.classList.contains("no-zoom")||o.target.classList.contains("react-resizable-handle"))).on("start",n.zoomStartedBound).on("zoom",n.zoomedBound).on("end",n.zoomEndedBound),n.zoomTransform=fn,n.prevZoomTransform=fn,n.initialXDomain=[0,1],n.initialYDomain=[0,1],n.xDomainLimits=[-Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],n.yDomainLimits=[-Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],n.zoomLimits=[0,Number.MAX_SAFE_INTEGER],n.prevCenterX=n.currentProps.paddingLeft+n.currentProps.leftWidth+n.currentProps.centerWidth/2,n.prevCenterY=n.currentProps.paddingTop+n.currentProps.topHeight+n.currentProps.centerHeight/2,n.cumCenterXOffset=0,n.cumCenterYOffset=0,n.setUpInitialScales(n.currentProps.initialXDomain,n.currentProps.initialYDomain,n.currentProps.xDomainLimits,n.currentProps.yDomainLimits,n.currentProps.zoomLimits),n.setUpScales(),n.trackDefObjects={},n.metaTracks={},n.pubSubs=[],window.higlassTracksByType)for(const o in window.higlassTracksByType)dr[o]=window.higlassTracksByType[o].config;return n.boundForwardEvent=n.forwardEvent.bind(Bo(n)),n.boundScrollEvent=n.scrollEvent.bind(Bo(n)),n.boundForwardContextMenu=n.forwardContextMenu.bind(Bo(n)),n.dispatchEventBound=n.dispatchEvent.bind(Bo(n)),n.zoomToDataPosHandlerBound=n.zoomToDataPosHandler.bind(Bo(n)),n.onScrollHandlerBound=n.onScrollHandler.bind(Bo(n)),n.elementPos={height:0,width:0,left:0,top:0},n.elementSelection=null,n}return j8e(r,[{key:"xScale",get:function(){if(!this._xScale)throw new Error("xScale is not defined");return this._xScale}},{key:"yScale",get:function(){if(!this._yScale)throw new Error("yScale is not defined");return this._yScale}},{key:"UNSAFE_componentWillMount",value:function(){this.pubSubs=[],this.pubSubs.push(this.props.pubSub.subscribe("scroll",this.windowScrolledBound)),this.pubSubs.push(this.props.pubSub.subscribe("app.event",this.dispatchEventBound)),this.pubSubs.push(this.props.pubSub.subscribe("zoomToDataPos",this.zoomToDataPosHandlerBound)),this.pubSubs.push(this.props.pubSub.subscribe("app.scroll",this.onScrollHandlerBound))}},{key:"componentDidMount",value:function(){if(!this.element)throw new Error("Component did not mount, this.element is not defined.");if(this.elementPos=this.element.getBoundingClientRect(),this.elementSelection=Bt(this.element),this.pStage=new He.PIXI.Graphics,this.pMask=new He.PIXI.Graphics,this.pOutline=new He.PIXI.Graphics,this.pBackground=new He.PIXI.Graphics,this.pStage.addChild(this.pMask),this.pStage.addChild(this.pOutline),this.currentProps.pixiStage.addChild(this.pStage),this.pStage.mask=this.pMask,this.props.isRangeSelection||this.addZoom(),!this.currentProps.svgElement||!this.currentProps.canvasElement)return;this.svgElement=this.currentProps.svgElement,this.syncTrackObjects(this.currentProps.positionedTracks),this.syncMetaTracks(this.currentProps.metaTracks),this.currentProps.setCentersFunction(this.setCenter.bind(this)),this.currentProps.registerDraggingChangedListener(this.draggingChanged.bind(this)),this.draggingChanged(!0),this.addEventTracker();const n=[[this.xScale(this.xDomainLimits[0]),this.yScale(this.yDomainLimits[0])],[this.xScale(this.xDomainLimits[1]),this.yScale(this.yDomainLimits[1])]],o=this.svgElement.getBoundingClientRect(),a=[[Math.max(n[0][0],0),Math.max(n[0][1],0)],[Math.min(n[1][0],o.width),Math.min(n[1][1],o.height)]];this.zoomBehavior.extent(a).translateExtent(n).scaleExtent(this.zoomLimits)}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){if(!n.svgElement||!n.canvasElement)return;const o=this.updatablePropsToString(n);if(this.currentProps=n,this.prevPropsStr===o)return;this.setBackground();for(const u in this.trackDefObjects){const l=this.trackDefObjects[u].trackObject;l.delayDrawing=!0}this.prevPropsStr=o,this.setUpInitialScales(n.initialXDomain,n.initialYDomain,n.xDomainLimits,n.yDomainLimits,n.zoomLimits),this.setUpScales(n.width!==this.props.width||n.height!==this.props.height),this.svgElement=n.svgElement;const a=[[this.xScale(this.xDomainLimits[0]),this.yScale(this.yDomainLimits[0])],[this.xScale(this.xDomainLimits[1]),this.yScale(this.yDomainLimits[1])]],s=this.svgElement.getBoundingClientRect(),c=[[Math.max(a[0][0],0),Math.max(a[0][1],0)],[Math.min(a[1][0],s.width),Math.min(a[1][1],s.height)]];this.zoomBehavior.extent(c).translateExtent(a).scaleExtent(this.zoomLimits),this.syncTrackObjects(n.positionedTracks),this.syncMetaTracks(n.metaTracks);for(const u of n.positionedTracks){const l=u.track.options,h=this.trackDefObjects[u.track.uid].trackObject;if(h.rerender(l),dy(u.track)){const f={};for(const d of u.track.contents)f[d.uid]=d;for(const d in h.createdTracks)h.createdTracks[d].rerender(f[d].options)}}this.props.onNewTilesLoaded();for(const u in this.trackDefObjects){const l=this.trackDefObjects[u].trackObject;l.delayDrawing=!1,l.draw()}}},{key:"componentDidUpdate",value:function(n){(this.props.initialXDomain[0]!==n.initialXDomain[0]||this.props.initialXDomain[1]!==n.initialXDomain[1]||this.props.initialYDomain[0]!==n.initialYDomain[0]||this.props.initialYDomain[1]!==n.initialYDomain[1])&&this.element&&(this.element.__zoom=fn),n.isRangeSelection!==this.props.isRangeSelection&&(this.props.isRangeSelection?this.removeZoom():this.addZoom()),n.zoomable!==this.props.zoomable&&(this.props.zoomable?this.addZoom():this.removeZoom()),this.addEventTracker()}},{key:"componentWillUnmount",value:function(){var n,o;this.mounted=!1,this.removeTracks(Object.keys(this.trackDefObjects)),this.removeMetaTracks(Object.keys(this.metaTracks)),this.currentProps.removeDraggingChangedListener(this.draggingChanged),this.pStage&&this.currentProps.pixiStage.removeChild(this.pStage),(n=this.pMask)==null||n.destroy(!0),(o=this.pStage)==null||o.destroy(!0),this.pubSubs.forEach(a=>this.props.pubSub.unsubscribe(a)),this.pubSubs=[],this.removeEventTracker()}},{key:"dispatchEvent",value:function(n){n.sourceUid===this.uid&&n.type!=="contextmenu"&&this.element&&uy(n,this.element)}},{key:"isWithin",value:function(n,o){const a=n>=this.elementPos.left&&n<=this.elementPos.width+this.elementPos.left,s=o>=this.elementPos.top&&o<=this.elementPos.height+this.elementPos.top;return a&&s}},{key:"zoomToDataPosHandler",value:function({pos:n,animateTime:o}){this.zoomToDataPos(...n,o)}},{key:"addZoom",value:function(){!this.elementSelection||!this.currentProps.zoomable||(this.elementSelection.call(this.zoomBehavior),this.zoomBehavior.transform(this.elementSelection,this.zoomTransform))}},{key:"removeZoom",value:function(){this.elementSelection&&(this.zoomEnded(),this.elementSelection.on(".zoom",null))}},{key:"setMask",value:function(){var n,o,a,s;(n=this.pMask)==null||n.clear(),(o=this.pMask)==null||o.beginFill(),(a=this.pMask)==null||a.drawRect(this.xPositionOffset,this.yPositionOffset,this.currentProps.width,this.currentProps.height),(s=this.pMask)==null||s.endFill()}},{key:"setBackground",value:function(){var n,o,a,s,c;const u=this.props.theme===mr?"black":"white",l=ot(((n=this.currentProps.viewOptions)==null?void 0:n.backgroundColor)??u);(o=this.pBackground)==null||o.clear(),(a=this.pBackground)==null||a.beginFill(l),(s=this.pBackground)==null||s.drawRect(this.xPositionOffset,this.yPositionOffset,this.currentProps.width,this.currentProps.height),(c=this.pBackground)==null||c.endFill()}},{key:"windowScrolled",value:function(){this.removeZoom(),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.addZoom()},X8e)}},{key:"setUpInitialScales",value:function(n=[0,1],o=[0,1],a=[-Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],s=[-Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],c=[0,Number.MAX_SAFE_INTEGER]){c[0]=c[0]===null?0:c[0],c[1]=c[1]===null?1/0:c[1];const u=n[1]-n[0],l=(o[0]+o[1])/2;if(o[0]=l-u/2,o[1]=l+u/2,n[0]===this.initialXDomain[0]&&n[1]===this.initialXDomain[1]&&o[0]===this.initialYDomain[0]&&o[1]===this.initialYDomain[1]&&a[0]===this.xDomainLimits[0]&&a[1]===this.xDomainLimits[1]&&s[0]===this.yDomainLimits[0]&&s[1]===this.yDomainLimits[1]&&c[0]===this.zoomLimits[0]&&c[1]===this.zoomLimits[1])return;this.initialXDomain=n,this.initialYDomain=o,this.xDomainLimits=a,this.yDomainLimits=s,this.zoomLimits=c,this.zoomTransform=fn,this.prevZoomTransform=fn,this.cumCenterYOffset=0,this.cumCenterXOffset=0,this.drawableToDomainX=Tt().domain([this.currentProps.paddingLeft+this.currentProps.leftWidth,this.currentProps.paddingLeft+this.currentProps.leftWidth+this.currentProps.centerWidth]).range([n[0],n[1]]);let h,f;this.currentProps.centerWidth===0?(h=this.currentProps.paddingTop+this.currentProps.topHeight,f=this.currentProps.paddingTop+this.currentProps.topHeight+this.currentProps.centerHeight):(h=this.currentProps.paddingTop+this.currentProps.topHeight+this.currentProps.centerHeight/2-this.currentProps.centerWidth/2,f=this.currentProps.paddingTop+this.currentProps.topHeight+this.currentProps.centerHeight/2+this.currentProps.centerWidth/2),this.drawableToDomainY=Tt().domain([h,f]).range([o[0],o[1]]),this.prevCenterX=this.currentProps.paddingLeft+this.currentProps.leftWidth+this.currentProps.centerWidth/2,this.prevCenterY=this.currentProps.paddingTop+this.currentProps.topHeight+this.currentProps.centerHeight/2}},{key:"updatablePropsToString",value:function(n){return JSON.stringify({positionedTracks:n.positionedTracks,initialXDomain:n.initialXDomain,initialYDomain:n.initialYDomain,width:n.width,height:n.height,paddingLeft:n.paddingLeft,paddingTop:n.paddingTop,leftWidth:n.leftWidth,topHeight:n.topHeight,dragging:n.dragging,viewOptions:n.viewOptions})}},{key:"draggingChanged",value:function(n){this.dragging=n,this.timedUpdatePositionAndDimensions()}},{key:"setUpScales",value:function(n=!1){const o=this.currentProps.paddingLeft+this.currentProps.leftWidth+this.currentProps.centerWidth/2,a=this.currentProps.paddingTop+this.currentProps.topHeight+this.currentProps.centerHeight/2;if(!this.drawableToDomainX||!this.drawableToDomainY)return;const s=(this.drawableToDomainX(o)-this.drawableToDomainX(this.prevCenterX))/this.zoomTransform.k,c=(this.drawableToDomainY(a)-this.drawableToDomainY(this.prevCenterY))/this.zoomTransform.k;this.cumCenterYOffset+=c,this.cumCenterXOffset+=s,this.prevCenterY=a,this.prevCenterX=o;const u=[this.drawableToDomainX(0)-this.cumCenterXOffset,this.drawableToDomainX(this.currentProps.width)-this.cumCenterXOffset],l=[this.drawableToDomainY(0)-this.cumCenterYOffset,this.drawableToDomainY(this.currentProps.height)-this.cumCenterYOffset];this._xScale=Tt().domain(u).range([0,this.currentProps.width]),this._yScale=Tt().domain(l).range([0,this.currentProps.height]);for(const h in this.trackDefObjects)this.trackDefObjects[h].trackObject.refScalesChanged(this.xScale,this.yScale);this.applyZoomTransform(n)}},{key:"getTrackDef",value:function(n){const o=qi(this.trackDefObjects);for(const[,{trackDef:a,trackObject:s}]of o){if(s===n)return a.track;if(dy(a.track)){for(const c of a.track.contents)if(s.createdTracks[c.uid]===n)return c}}return null}},{key:"getTrackObject",value:function(n){const o=qi(this.trackDefObjects);for(let a=0;a<o.length;a++){const s=o[a][0],c=o[a][1].trackObject;if(s===n)return c;if(c.createdTracks){const u=qi(c.createdTracks);for(let l=0;l<u.length;l++){const h=u[l][0],f=u[l][1];if(h===n)return f}}}}},{key:"timedUpdatePositionAndDimensions",value:function(){this.closing||!this.element||(this.elementPos=this.element.getBoundingClientRect(),this.dragging&&(this.yPositionOffset=this.element.getBoundingClientRect().top-this.currentProps.canvasElement.getBoundingClientRect().top+this.scrollTop,this.xPositionOffset=this.element.getBoundingClientRect().left-this.currentProps.canvasElement.getBoundingClientRect().left,this.setMask(),this.setBackground(),this.updateTrackPositions()&&this.applyZoomTransform(!0),requestAnimationFrame(this.timedUpdatePositionAndDimensions.bind(this))))}},{key:"syncMetaTracks",value:function(n){const o=Object.keys(this.metaTracks),a=new Set(n.map(s=>s.uid));this.addMetaTracks(n.filter(s=>!this.metaTracks[s.uid])),this.updateMetaTracks(n.filter(s=>this.metaTracks[s.uid])),this.removeMetaTracks(o.filter(s=>!a.has(s)))}},{key:"syncTrackObjects",value:function(n){this.prevTrackDefinitions=JSON.stringify(n);const o={};for(let h=0;h<n.length;h++)o[n[h].track.uid]=n[h];const a=new Set(Object.keys(this.trackDefObjects)),s=new Set(Object.keys(o)),c=new Set([...s].filter(h=>!a.has(h))),u=new Set([...a].filter(h=>!s.has(h))),l=new Set([...s].filter(h=>a.has(h)));this.updateExistingTrackDefs([...l].map(h=>o[h])),this.addNewTracks([...c].map(h=>o[h])),this.updateExistingTrackDefs([...c].map(h=>o[h])),this.removeTracks([...u])}},{key:"addMetaTracks",value:function(n){n.filter(o=>!this.metaTracks[o.uid]).forEach(o=>{this.metaTracks[o.uid]={trackDef:o,trackObject:this.createMetaTrack(o)}})}},{key:"addNewTracks",value:function(n){if(this.currentProps.pixiStage){for(let o=0;o<n.length;o++){const a=n[o],s=this.createTrackObject(a.track);s.refScalesChanged(this.xScale,this.yScale),this.trackDefObjects[a.track.uid]={trackDef:a,trackObject:s};const c=this.zoomTransform.rescaleX(this.xScale),u=this.zoomTransform.rescaleY(this.yScale);s.setDimensions([a.width,a.height]),s.zoomed(c,u)}this.applyZoomTransform(!1)}}},{key:"updateMetaTracks",value:function(n){}},{key:"updateExistingTrackDefs",value:function(n){for(const a of n){const s=this.trackDefObjects[a.track.uid];s.trackDef=a,dy(a.track)&&s.trackObject.updateContents(a.track.contents,this.createTrackObject.bind(this)).refScalesChanged(this.xScale,this.yScale)}this.updateTrackPositions()&&this.applyZoomTransform(!1)}},{key:"updateTrackPositions",value:function(){let n=!1;for(const o in this.trackDefObjects){const a=this.trackDefObjects[o].trackDef,s=this.trackDefObjects[o].trackObject,c=s.position,u=s.dimensions,l=[this.xPositionOffset+a.left,this.yPositionOffset+a.top],h=[a.width,a.height];(!c||l[0]!==c[0]||l[1]!==c[1])&&(s.setPosition(l),n=!0),(!u||h[0]!==u[0]||h[1]!==u[1])&&(s.setDimensions(h),n=!0)}return n}},{key:"removeMetaTracks",value:function(n){n.forEach(o=>{this.metaTracks[o].trackObject.remove(),this.metaTracks[o]=void 0,delete this.metaTracks[o]})}},{key:"removeTracks",value:function(n){for(let o=0;o<n.length;o++)this.trackDefObjects[n[o]].trackObject.remove(),delete this.trackDefObjects[n[o]]}},{key:"setCenter",value:function(n,o,a,s=!1,c=0,u=this.xScale,l=this.yScale){const f=(this.xScale.invert(1)-this.xScale.invert(0))/a,d=this.currentProps.paddingLeft+this.currentProps.leftWidth+this.currentProps.centerWidth/2,p=this.currentProps.paddingTop+this.currentProps.topHeight+this.currentProps.centerHeight/2,m=d-u(n)*f,g=p-l(o)*f;let v;const _=()=>{const y=fn.translate(m,g).scale(f);this.zoomTransform=y,this.elementSelection&&this.emptyZoomBehavior.transform(this.elementSelection,y),v=this.applyZoomTransform(s)};if(c&&this.elementSelection){let y=this.elementSelection;this.activeTransitions+=1,document.hidden||(y=y.transition().duration(c)),y.call(this.zoomBehavior.transform,fn.translate(m,g).scale(f)).on("end",()=>{_(),this.activeTransitions-=1})}else _();return v}},{key:"valueScaleMove",value:function(n){if(this.zoomStartPos){for(const o of this.getTracksAtPosition(...this.zoomStartPos))o.movedY(n);this.zoomStartTransform&&(this.zoomTransform=this.zoomStartTransform)}}},{key:"valueScaleZoom",value:function(n,o){if(!koe(n.sourceEvent))return;const a=n.sourceEvent.deltaY,s=n.sourceEvent.deltaMode,u=((h,f)=>h*(f?120:1)/500)(a,s),l=lr(n.sourceEvent,this.props.canvasElement);for(const h of this.getTracksAtPosition(...l)){const f=o==="1d-horizontal"?l[1]-h.position[1]:l[0]-h.position[0];h.zoomedY(f,2**u)}this.zoomStartTransform&&(this.zoomTransform=this.zoomStartTransform)}},{key:"zoomed",value:function(n){var o;let a=null;if(this.zoomStartPos){const c=this.getTracksAtPosition(...this.zoomStartPos);if(c.length){const u=c[0],l=this.getTrackDef(u);if(!l)return;(o=dr[l.type])!=null&&o.orientation&&(a=dr[l.type].orientation),u instanceof K8&&(a="1d-vertical")}}if(a&&n.sourceEvent){if(n.shiftKey||this.valueScaleZooming){if(n.sourceEvent.deltaY!==void 0){this.valueScaleZoom(n,a);return}a==="1d-horizontal"?this.valueScaleMove(n.sourceEvent.movementY):a==="1d-vertical"&&this.valueScaleMove(n.sourceEvent.movementX)}a==="1d-horizontal"&&n.sourceEvent.movementY?this.valueScaleMove(n.sourceEvent.movementY):a==="1d-vertical"&&n.sourceEvent.movementX&&this.valueScaleMove(n.sourceEvent.movementX)}this.zoomTransform=this.currentProps.zoomable?n.transform:fn,this.prevZoomTransform.k!==this.zoomTransform.k||(a==="1d-horizontal"?this.zoomTransform=fn.translate(this.zoomTransform.x,this.prevZoomTransform.y).scale(this.zoomTransform.k):a==="1d-vertical"&&(this.zoomTransform=fn.translate(this.prevZoomTransform.x,this.zoomTransform.y).scale(this.zoomTransform.k)),this.element&&(this.element.__zoom=this.zoomTransform)),this.applyZoomTransform(!0),this.prevZoomTransform=this.zoomTransform,this.props.pubSub.publish("app.zoom",n),n.sourceEvent&&(n.sourceEvent.stopPropagation(),n.sourceEvent.preventDefault())}},{key:"getTracksAtPosition",value:function(n,o){const a=[];let s=[];for(const c in this.trackDefObjects){const u=this.trackDefObjects[c].trackObject;u.childTracks?s=s.concat(u.childTracks):s.push(u)}for(const c of s){const u=c.position[0]<=n&&n<=c.position[0]+c.dimensions[0],l=c.position[1]<=o&&o<=c.position[1]+c.dimensions[1];u&&l&&a.push(c)}return a}},{key:"zoomStarted",value:function(n){this.zooming=!0,n&&n.sourceEvent&&(this.zoomStartPos=lr(n.sourceEvent,this.props.canvasElement),n.sourceEvent.shiftKey&&(this.valueScaleZooming=!0)),this.zoomStartTransform=this.zoomTransform,this.props.pubSub.publish("app.zoomStart")}},{key:"zoomEnded",value:function(){this.zooming=!1,this.zoomStartPos=null,this.valueScaleZooming&&(this.valueScaleZooming=!1,this.element&&(this.element.__zoom=this.zoomStartTransform)),this.props.pubSub.publish("app.zoomEnd")}},{key:"applyZoomTransform",value:function(n=!0){const o=this.currentProps,a=o.paddingLeft+o.leftWidth,s=o.paddingTop+o.topHeight;if(!this.xScale||!this.yScale)return;this.zoomedXScale=this.zoomTransform.rescaleX(this.xScale),this.zoomedYScale=this.zoomTransform.rescaleY(this.yScale);const c=Tt().domain([a,a+o.centerWidth].map(this.zoomedXScale.invert)).range([0,o.centerWidth]),u=Tt().domain([s,s+o.centerHeight].map(this.zoomedYScale.invert)).range([0,o.centerHeight]);for(const l in this.trackDefObjects){const h=this.trackDefObjects[l].trackObject,f=this.trackDefObjects[l].trackDef;let d="unknown";if(dr[f.track.type]&&(d=dr[f.track.type].orientation),d==="whole"){const p=Tt().domain([o.paddingLeft,o.width-o.paddingLeft].map(this.zoomedXScale.invert)).range([0,o.width-2*o.paddingLeft]),m=Tt().domain([o.paddingTop,o.height-o.paddingTop].map(this.zoomedYScale.invert)).range([0,o.height-2*o.paddingTop]);h.zoomed(p,m);continue}if(this.trackDefObjects[l].trackDef.track.position==="gallery"){const p=Tt().domain([o.paddingLeft+o.leftWidthNoGallery,o.paddingLeft+o.leftWidth+o.centerWidth+o.galleryDim].map(this.zoomedXScale.invert)).range([0,o.centerWidth+2*o.galleryDim]),m=Tt().domain([o.paddingTop+o.topHeightNoGallery,o.paddingTop+o.topHeight+o.centerHeight+o.galleryDim].map(this.zoomedYScale.invert)).range([0,o.centerHeight-2*o.galleryDim]);h.zoomed(p.copy(),m.copy(),this.zoomTransform.k);continue}h.zoomed(c.copy(),u.copy(),this.zoomTransform.k,this.zoomTransform.x+this.xPositionOffset,this.zoomTransform.y+this.yPositionOffset,o.paddingLeft+o.leftWidth,o.paddingTop+o.topHeight)}return this.currentXScale=c,this.currentYScale=u,n&&this.currentProps.onScalesChanged(c,u),[c,u]}},{key:"createMetaTrack",value:function(n){switch(n.type){default:{const o=this.props.pluginTracks[n.type];if(o?.isMetaTrack){const a={getTrackObject:this.getTrackObject.bind(this),onNewTilesLoaded:()=>{this.currentProps.onNewTilesLoaded(n.uid)},definition:n};try{return new o.track(this.availableForPlugins,a,n.options)}catch(s){console.error("Plugin meta track",n.type,"failed to instantiate.",s)}}return console.warn(`Unknown meta track of type: ${n.type}`),new k9(this.pStage,{name:"Unknown Track Type",type:n.type})}}}},{key:"createTrackObject",value:function(n){const o=this.createLocationAgnosticTrackObject(n);return(n.position==="left"||n.position==="right")&&dr[n.type].orientation==="1d-horizontal"?new K8(o):o}},{key:"createLocationAgnosticTrackObject",value:function(n){let o=n.data;o||(o={server:vy(n.server),tilesetUid:n.tilesetUid}),n.coordSystem&&(o.coordSystem=n.coordSystem);const a=q8e(o,this.props.pubSub,this.props.pluginDataFetchers,this.availableForPlugins);if(!this.pStage||!this.svgElement)throw new Error("No PIXI stage or svg element");const s={id:n.uid,trackUid:n.uid,trackType:n.type,viewUid:this.viewUid,pubSub:this.props.pubSub,scene:this.pStage,dataConfig:o,dataFetcher:a,getLockGroupExtrema:()=>this.currentProps.getLockGroupExtrema(n.uid),handleTilesetInfoReceived:c=>{this.currentProps.onTilesetInfoReceived(n.uid,c)},animate:()=>{this.currentProps.onNewTilesLoaded(n.uid)},svgElement:this.svgElement,isValueScaleLocked:()=>this.currentProps.isValueScaleLocked(n.uid),onValueScaleChanged:()=>{this.currentProps.onValueScaleChanged(n.uid)},onTrackOptionsChanged:c=>{this.currentProps.onTrackOptionsChanged(n.uid,c)},onMouseMoveZoom:this.props.onMouseMoveZoom,chromInfoPath:n.chromInfoPath,isShowGlobalMousePosition:()=>this.props.isShowGlobalMousePosition,getTheme:()=>this.props.theme};switch(n.y&&(s.yPosition=n.y),n.x&&(s.xPosition=n.x),n.projectionXDomain&&(s.projectionXDomain=n.projectionXDomain),n.projectionYDomain&&(s.projectionYDomain=n.projectionYDomain),n.type){case"left-axis":return new Gz(s,n.options);case"top-axis":return new jz(s,n.options);case"heatmap":return new vm(s,n.options);case"multivec":case"vector-heatmap":case"horizontal-multivec":case"horizontal-vector-heatmap":case"vertical-multivec":case"vertical-vector-heatmap":return new j8(s,n.options);case"1d-heatmap":case"horizontal-1d-heatmap":case"vertical-1d-heatmap":return new W8(s,n.options);case"line":case"horizontal-line":case"vertical-line":return new ah(s,n.options);case"point":case"horizontal-point":case"vertical-point":return new F8(s,n.options);case"bar":case"horizontal-bar":case"vertical-bar":return new PI(s,n.options);case"divergent-bar":case"horizontal-divergent-bar":case"vertical-divergent-bar":return new z8(s,n.options);case"horizontal-1d-tiles":return new Dz(s,n.options);case"vertical-1d-tiles":return new Mz(s,n.options);case"2d-tiles":return new Oz(s,n.options);case"stacked-interval":case"top-stacked-interval":case"left-stacked-interval":return new q8(s,n.options);case"viewport-projection-center":return n.registerViewportChanged&&n.removeViewportChanged&&n.setDomainsCallback?(s.registerViewportChanged=n.registerViewportChanged,s.removeViewportChanged=n.removeViewportChanged,s.setDomainsCallback=n.setDomainsCallback,new x9(s,n.options)):new Mf(s,{});case"viewport-projection-horizontal":return n.registerViewportChanged&&n.removeViewportChanged&&n.setDomainsCallback?(s.registerViewportChanged=n.registerViewportChanged,s.removeViewportChanged=n.removeViewportChanged,s.setDomainsCallback=n.setDomainsCallback,new R9(s,n.options)):new Mf(s,{});case"viewport-projection-vertical":return n.registerViewportChanged&&n.removeViewportChanged&&n.setDomainsCallback?(s.registerViewportChanged=n.registerViewportChanged,s.removeViewportChanged=n.removeViewportChanged,s.setDomainsCallback=n.setDomainsCallback,new L9(s,n.options)):new Mf(s,{});case"gene-annotations":case"horizontal-gene-annotations":case"vertical-gene-annotations":return new $I(s,n.options);case"2d-rectangle-domains":case"arrowhead-domains":return new o9(s,n.options);case"horizontal-1d-annotations":return new zI(s,n.options);case"vertical-1d-annotations":return new zI(s,n.options,!0);case"2d-annotations":return new l9(s,n.options);case"linear-2d-rectangle-domains":case"horizontal-2d-rectangle-domains":case"vertical-2d-rectangle-domains":return new f9(s,n.options);case"square-markers":return new d9(s,n.options);case"combined":return s.tracks=n.contents,s.createTrackObject=this.createTrackObject.bind(this),new ZS(s);case"2d-chromosome-labels":return new g9(s,n.options);case"horizontal-chromosome-grid":return s.orientation="1d-horizontal",new xm(s,n.options);case"vertical-chromosome-grid":return s.orientation="1d-vertical",new xm(s,n.options);case"2d-chromosome-grid":return new xm(s,n.options);case"chromosome-labels":case"horizontal-chromosome-labels":case"vertical-chromosome-labels":return new S9(s,n.options);case"linear-heatmap":case"horizontal-heatmap":case"vertical-heatmap":return new A9(s,n.options);case"2d-chromosome-annotations":return new b9(s,n.options);case"1d-value-interval":case"horizontal-1d-value-interval":case"vertical-1d-value-interval":return new P9(s,n.options);case"osm":case"osm-tiles":return new Hm(s,n.options);case"osm-2d-tile-ids":return new s7(s,n.options);case"mapbox":case"mapbox-tiles":return new c7(s,n.options);case"raster-tiles":return new f7(s,n.options);case"bedlike":case"vertical-bedlike":return new N8(s,n.options);case"overlay-track":return new L8(s,n.options);case"overlay-chromosome-grid-track":return s.isOverlay=!0,new xm(s,n.options);case"horizontal-rule":return new q9(s,n.options);case"vertical-rule":return new t7(s,n.options);case"cross-rule":return s.x=n.x,s.y=n.y,new n7(s,n.options);case"simple-svg":return new Ks(s,n.options);case"empty":{const c=n.options;return new ei(s,c)}default:{const c=this.props.pluginTracks[n.type];if(c&&!c.isMetaTrack){s.AVAILABLE_FOR_PLUGINS=this.availableForPlugins,s.baseEl=this.baseEl,s.definition=n,n.registerViewportChanged&&n.removeViewportChanged&&n.setDomainsCallback&&(s.registerViewportChanged=n.registerViewportChanged,s.removeViewportChanged=n.removeViewportChanged,s.setDomainsCallback=n.setDomainsCallback);try{return new c.track(this.availableForPlugins,s,n.options)}catch(u){console.error("Plugin track",n.type,"failed to instantiate.",u)}}return console.warn("Unknown track type:",n.type),new k9(s,{name:"Unknown Track Type",type:n.type})}}}},{key:"zoomToDataPos",value:function(n,o,a,s,c=3e3,u=null){const[l,h,f]=tn(this.xScale.copy().domain([n,o]),this.yScale.copy().domain([a,s])),d=u?u(this.xScale,this.yScale):[this.xScale,this.yScale];this.setCenter(l,h,f,!1,c,d[0],d[1])}},{key:"forwardContextMenu",value:function(n){this.props.disableTrackMenu||n.altKey||(n.preventDefault(),setTimeout(()=>{this.props.pubSub.publish("contextmenu",n)},0))}},{key:"addEventTracker",value:function(){!this.eventTracker||this.eventTracker===this.eventTrackerOld||(this.eventTrackerOld||(this.eventTrackerOld=this.eventTracker),this.eventTracker=this.eventTrackerOld,this.eventTracker.addEventListener("click",this.boundForwardEvent),this.eventTracker.addEventListener("contextmenu",this.boundForwardContextMenu),this.eventTracker.addEventListener("dblclick",this.boundForwardEvent),this.eventTracker.addEventListener("wheel",this.boundForwardEvent),this.eventTracker.addEventListener("dragstart",this.boundForwardEvent),this.eventTracker.addEventListener("selectstart",this.boundForwardEvent),this.eventTracker.addEventListener("mouseover",this.boundForwardEvent),this.eventTracker.addEventListener("mouseenter",this.boundForwardEvent),this.eventTracker.addEventListener("mousedown",this.boundForwardEvent),this.eventTracker.addEventListener("mouseup",this.boundForwardEvent),this.eventTracker.addEventListener("mouseout",this.boundForwardEvent),this.eventTracker.addEventListener("mouseleave",this.boundForwardEvent),this.eventTracker.addEventListener("touchstart",this.boundForwardEvent),this.eventTracker.addEventListener("touchend",this.boundForwardEvent),this.eventTracker.addEventListener("touchmove",this.boundForwardEvent),this.eventTracker.addEventListener("touchcancel",this.boundForwardEvent),this.eventTracker.addEventListener("pointerover",this.boundForwardEvent),this.eventTracker.addEventListener("pointerenter",this.boundForwardEvent),this.eventTracker.addEventListener("pointerdown",this.boundForwardEvent),this.eventTracker.addEventListener("pointerup",this.boundForwardEvent),this.eventTracker.addEventListener("pointercancel",this.boundForwardEvent),this.eventTracker.addEventListener("pointerout",this.boundForwardEvent),this.eventTracker.addEventListener("pointerleave",this.boundForwardEvent),window.addEventListener("scroll",this.boundScrollEvent))}},{key:"removeEventTracker",value:function(){this.eventTracker&&(this.eventTracker.removeEventListener("click",this.boundForwardEvent),this.eventTracker.removeEventListener("contextmenu",this.boundForwardContextMenu),this.eventTracker.removeEventListener("dblclick",this.boundForwardEvent),this.eventTracker.removeEventListener("wheel",this.boundForwardEvent),this.eventTracker.removeEventListener("dragstart",this.boundForwardEvent),this.eventTracker.removeEventListener("selectstart",this.boundForwardEvent),this.eventTracker.removeEventListener("mouseover",this.boundForwardEvent),this.eventTracker.removeEventListener("mouseenter",this.boundForwardEvent),this.eventTracker.removeEventListener("mousedown",this.boundForwardEvent),this.eventTracker.removeEventListener("mouseup",this.boundForwardEvent),this.eventTracker.removeEventListener("mouseout",this.boundForwardEvent),this.eventTracker.removeEventListener("mouseleave",this.boundForwardEvent),this.eventTracker.removeEventListener("touchstart",this.boundForwardEvent),this.eventTracker.removeEventListener("touchend",this.boundForwardEvent),this.eventTracker.removeEventListener("touchcancel",this.boundForwardEvent),this.eventTracker.removeEventListener("pointerover",this.boundForwardEvent),this.eventTracker.removeEventListener("pointerenter",this.boundForwardEvent),this.eventTracker.removeEventListener("pointerdown",this.boundForwardEvent),this.eventTracker.removeEventListener("pointerup",this.boundForwardEvent),this.eventTracker.removeEventListener("pointercancel",this.boundForwardEvent),this.eventTracker.removeEventListener("pointerout",this.boundForwardEvent),this.eventTracker.removeEventListener("pointerleave",this.boundForwardEvent),window.removeEventListener("scroll",this.boundScrollEvent))}},{key:"scrollEvent",value:function(){this.element&&(this.elementPos=this.element.getBoundingClientRect())}},{key:"forwardEvent",value:function(n){n.sourceUid=this.uid,n.forwarded=!0,this.props.pubSub.publish("app.event",n)}},{key:"onScrollHandler",value:function(n){this.scrollTop=n}},{key:"render",value:function(){return E.createElement("div",{ref:n=>{this.baseEl=n},className:Zt("track-renderer-div",xD["track-renderer"]),style:{height:this.currentProps.height,width:this.currentProps.width}},E.createElement("div",{ref:n=>{this.element=n},className:Zt("track-renderer-element",xD["track-renderer-element"])}),E.createElement("div",{ref:n=>{this.eventTracker=n},className:Zt("track-renderer-events",xD["track-renderer-events"])},this.currentProps.children))}}]),r}(E.Component);RD.defaultProps={pluginDataFetchers:{},pluginTracks:{},canvasElement:null,centerHeight:0,centerWidth:0,children:[],galleryDim:0,height:0,initialXDomain:[],initialYDomain:[],isShowGlobalMousePosition:!1,isRangeSelection:!1,leftWidth:0,leftWidthNoGallery:0,paddingLeft:0,paddingTop:0,positionedTracks:[],topHeight:0,topHeightNoGallery:0,width:0,metaTracks:[]},RD.propTypes={canvasElement:N.object,centerHeight:N.number,centerWidth:N.number,children:N.array,disableTrackMenu:N.bool,galleryDim:N.number,height:N.number,initialXDomain:N.array,initialYDomain:N.array,isShowGlobalMousePosition:N.bool,isRangeSelection:N.bool,leftWidth:N.number,leftWidthNoGallery:N.number,paddingLeft:N.number,paddingTop:N.number,metaTracks:N.array,onMouseMoveZoom:N.func,onNewTilesLoaded:N.func.isRequired,onScalesChanged:N.func.isRequired,pixiRenderer:N.object.isRequired,pixiStage:N.object.isRequired,pluginDataFetchers:N.object,pluginTracks:N.object,positionedTracks:N.array,pubSub:N.object.isRequired,setCentersFunction:N.func,svgElement:N.object.isRequired,theme:N.symbol.isRequired,topHeight:N.number,topHeightNoGallery:N.number,viewOptions:N.object,width:N.number,xDomainLimits:N.array,yDomainLimits:N.array,valueScaleZoom:N.bool,zoomable:N.bool.isRequired,zoomDomain:N.array,uid:N.string,zoomLimits:N.array};const K8e=Rf(hc(RD));var KW={exports:{}};/*! react-checkbox-tree - v1.8.0 | 2022 */(function(e,t){/*! For license information please see index.browser.js.LICENSE.txt */(function(r,i){e.exports=i(E)})(self,r=>(()=>{var i={4184:(s,c)=>{var u;(function(){var l={}.hasOwnProperty;function h(){for(var f=[],d=0;d<arguments.length;d++){var p=arguments[d];if(p){var m=typeof p;if(m==="string"||m==="number")f.push(p);else if(Array.isArray(p)){if(p.length){var g=h.apply(null,p);g&&f.push(g)}}else if(m==="object")if(p.toString===Object.prototype.toString)for(var v in p)l.call(p,v)&&p[v]&&f.push(v);else f.push(p.toString())}}return f.join(" ")}s.exports?(h.default=h,s.exports=h):(u=function(){return h}.apply(c,[]))===void 0||(s.exports=u)})()},8552:(s,c,u)=>{var l=u(852)(u(5639),"DataView");s.exports=l},1989:(s,c,u)=>{var l=u(1789),h=u(401),f=u(7667),d=u(1327),p=u(1866);function m(g){var v=-1,_=g==null?0:g.length;for(this.clear();++v<_;){var y=g[v];this.set(y[0],y[1])}}m.prototype.clear=l,m.prototype.delete=h,m.prototype.get=f,m.prototype.has=d,m.prototype.set=p,s.exports=m},8407:(s,c,u)=>{var l=u(7040),h=u(4125),f=u(2117),d=u(7518),p=u(4705);function m(g){var v=-1,_=g==null?0:g.length;for(this.clear();++v<_;){var y=g[v];this.set(y[0],y[1])}}m.prototype.clear=l,m.prototype.delete=h,m.prototype.get=f,m.prototype.has=d,m.prototype.set=p,s.exports=m},7071:(s,c,u)=>{var l=u(852)(u(5639),"Map");s.exports=l},3369:(s,c,u)=>{var l=u(4785),h=u(1285),f=u(6e3),d=u(9916),p=u(5265);function m(g){var v=-1,_=g==null?0:g.length;for(this.clear();++v<_;){var y=g[v];this.set(y[0],y[1])}}m.prototype.clear=l,m.prototype.delete=h,m.prototype.get=f,m.prototype.has=d,m.prototype.set=p,s.exports=m},3818:(s,c,u)=>{var l=u(852)(u(5639),"Promise");s.exports=l},8525:(s,c,u)=>{var l=u(852)(u(5639),"Set");s.exports=l},8668:(s,c,u)=>{var l=u(3369),h=u(619),f=u(2385);function d(p){var m=-1,g=p==null?0:p.length;for(this.__data__=new l;++m<g;)this.add(p[m])}d.prototype.add=d.prototype.push=h,d.prototype.has=f,s.exports=d},6384:(s,c,u)=>{var l=u(8407),h=u(7465),f=u(3779),d=u(7599),p=u(4758),m=u(4309);function g(v){var _=this.__data__=new l(v);this.size=_.size}g.prototype.clear=h,g.prototype.delete=f,g.prototype.get=d,g.prototype.has=p,g.prototype.set=m,s.exports=g},2705:(s,c,u)=>{var l=u(5639).Symbol;s.exports=l},1149:(s,c,u)=>{var l=u(5639).Uint8Array;s.exports=l},577:(s,c,u)=>{var l=u(852)(u(5639),"WeakMap");s.exports=l},4963:s=>{s.exports=function(c,u){for(var l=-1,h=c==null?0:c.length,f=0,d=[];++l<h;){var p=c[l];u(p,l,c)&&(d[f++]=p)}return d}},4636:(s,c,u)=>{var l=u(2545),h=u(5694),f=u(1469),d=u(4144),p=u(5776),m=u(6719),g=Object.prototype.hasOwnProperty;s.exports=function(v,_){var y=f(v),b=!y&&h(v),T=!y&&!b&&d(v),S=!y&&!b&&!T&&m(v),k=y||b||T||S,O=k?l(v.length,String):[],D=O.length;for(var M in v)!_&&!g.call(v,M)||k&&(M=="length"||T&&(M=="offset"||M=="parent")||S&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||p(M,D))||O.push(M);return O}},2488:s=>{s.exports=function(c,u){for(var l=-1,h=u.length,f=c.length;++l<h;)c[f+l]=u[l];return c}},2908:s=>{s.exports=function(c,u){for(var l=-1,h=c==null?0:c.length;++l<h;)if(u(c[l],l,c))return!0;return!1}},8470:(s,c,u)=>{var l=u(7813);s.exports=function(h,f){for(var d=h.length;d--;)if(l(h[d][0],f))return d;return-1}},8866:(s,c,u)=>{var l=u(2488),h=u(1469);s.exports=function(f,d,p){var m=d(f);return h(f)?m:l(m,p(f))}},4239:(s,c,u)=>{var l=u(2705),h=u(9607),f=u(2333),d=l?l.toStringTag:void 0;s.exports=function(p){return p==null?p===void 0?"[object Undefined]":"[object Null]":d&&d in Object(p)?h(p):f(p)}},9454:(s,c,u)=>{var l=u(4239),h=u(7005);s.exports=function(f){return h(f)&&l(f)=="[object Arguments]"}},939:(s,c,u)=>{var l=u(2492),h=u(7005);s.exports=function f(d,p,m,g,v){return d===p||(d==null||p==null||!h(d)&&!h(p)?d!=d&&p!=p:l(d,p,m,g,f,v))}},2492:(s,c,u)=>{var l=u(6384),h=u(7114),f=u(8351),d=u(6096),p=u(4160),m=u(1469),g=u(4144),v=u(6719),_="[object Arguments]",y="[object Array]",b="[object Object]",T=Object.prototype.hasOwnProperty;s.exports=function(S,k,O,D,M,w){var L=m(S),B=m(k),A=L?y:p(S),R=B?y:p(k),j=(A=A==_?b:A)==b,W=(R=R==_?b:R)==b,K=A==R;if(K&&g(S)){if(!g(k))return!1;L=!0,j=!1}if(K&&!j)return w||(w=new l),L||v(S)?h(S,k,O,D,M,w):f(S,k,A,O,D,M,w);if(!(1&O)){var oe=j&&T.call(S,"__wrapped__"),fe=W&&T.call(k,"__wrapped__");if(oe||fe){var Ae=oe?S.value():S,de=fe?k.value():k;return w||(w=new l),M(Ae,de,O,D,w)}}return!!K&&(w||(w=new l),d(S,k,O,D,M,w))}},8458:(s,c,u)=>{var l=u(3560),h=u(5346),f=u(3218),d=u(346),p=/^\[object .+?Constructor\]$/,m=Function.prototype,g=Object.prototype,v=m.toString,_=g.hasOwnProperty,y=RegExp("^"+v.call(_).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");s.exports=function(b){return!(!f(b)||h(b))&&(l(b)?y:p).test(d(b))}},8749:(s,c,u)=>{var l=u(4239),h=u(1780),f=u(7005),d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d["[object Arguments]"]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d["[object Map]"]=d["[object Number]"]=d["[object Object]"]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1,s.exports=function(p){return f(p)&&h(p.length)&&!!d[l(p)]}},280:(s,c,u)=>{var l=u(5726),h=u(6916),f=Object.prototype.hasOwnProperty;s.exports=function(d){if(!l(d))return h(d);var p=[];for(var m in Object(d))f.call(d,m)&&m!="constructor"&&p.push(m);return p}},2545:s=>{s.exports=function(c,u){for(var l=-1,h=Array(c);++l<c;)h[l]=u(l);return h}},1717:s=>{s.exports=function(c){return function(u){return c(u)}}},4757:s=>{s.exports=function(c,u){return c.has(u)}},4429:(s,c,u)=>{var l=u(5639)["__core-js_shared__"];s.exports=l},7114:(s,c,u)=>{var l=u(8668),h=u(2908),f=u(4757);s.exports=function(d,p,m,g,v,_){var y=1&m,b=d.length,T=p.length;if(b!=T&&!(y&&T>b))return!1;var S=_.get(d),k=_.get(p);if(S&&k)return S==p&&k==d;var O=-1,D=!0,M=2&m?new l:void 0;for(_.set(d,p),_.set(p,d);++O<b;){var w=d[O],L=p[O];if(g)var B=y?g(L,w,O,p,d,_):g(w,L,O,d,p,_);if(B!==void 0){if(B)continue;D=!1;break}if(M){if(!h(p,function(A,R){if(!f(M,R)&&(w===A||v(w,A,m,g,_)))return M.push(R)})){D=!1;break}}else if(w!==L&&!v(w,L,m,g,_)){D=!1;break}}return _.delete(d),_.delete(p),D}},8351:(s,c,u)=>{var l=u(2705),h=u(1149),f=u(7813),d=u(7114),p=u(8776),m=u(1814),g=l?l.prototype:void 0,v=g?g.valueOf:void 0;s.exports=function(_,y,b,T,S,k,O){switch(b){case"[object DataView]":if(_.byteLength!=y.byteLength||_.byteOffset!=y.byteOffset)return!1;_=_.buffer,y=y.buffer;case"[object ArrayBuffer]":return!(_.byteLength!=y.byteLength||!k(new h(_),new h(y)));case"[object Boolean]":case"[object Date]":case"[object Number]":return f(+_,+y);case"[object Error]":return _.name==y.name&&_.message==y.message;case"[object RegExp]":case"[object String]":return _==y+"";case"[object Map]":var D=p;case"[object Set]":var M=1&T;if(D||(D=m),_.size!=y.size&&!M)return!1;var w=O.get(_);if(w)return w==y;T|=2,O.set(_,y);var L=d(D(_),D(y),T,S,k,O);return O.delete(_),L;case"[object Symbol]":if(v)return v.call(_)==v.call(y)}return!1}},6096:(s,c,u)=>{var l=u(8234),h=Object.prototype.hasOwnProperty;s.exports=function(f,d,p,m,g,v){var _=1&p,y=l(f),b=y.length;if(b!=l(d).length&&!_)return!1;for(var T=b;T--;){var S=y[T];if(!(_?S in d:h.call(d,S)))return!1}var k=v.get(f),O=v.get(d);if(k&&O)return k==d&&O==f;var D=!0;v.set(f,d),v.set(d,f);for(var M=_;++T<b;){var w=f[S=y[T]],L=d[S];if(m)var B=_?m(L,w,S,d,f,v):m(w,L,S,f,d,v);if(!(B===void 0?w===L||g(w,L,p,m,v):B)){D=!1;break}M||(M=S=="constructor")}if(D&&!M){var A=f.constructor,R=d.constructor;A==R||!("constructor"in f)||!("constructor"in d)||typeof A=="function"&&A instanceof A&&typeof R=="function"&&R instanceof R||(D=!1)}return v.delete(f),v.delete(d),D}},1957:(s,c,u)=>{var l=typeof u.g=="object"&&u.g&&u.g.Object===Object&&u.g;s.exports=l},8234:(s,c,u)=>{var l=u(8866),h=u(9551),f=u(3674);s.exports=function(d){return l(d,f,h)}},5050:(s,c,u)=>{var l=u(7019);s.exports=function(h,f){var d=h.__data__;return l(f)?d[typeof f=="string"?"string":"hash"]:d.map}},852:(s,c,u)=>{var l=u(8458),h=u(7801);s.exports=function(f,d){var p=h(f,d);return l(p)?p:void 0}},9607:(s,c,u)=>{var l=u(2705),h=Object.prototype,f=h.hasOwnProperty,d=h.toString,p=l?l.toStringTag:void 0;s.exports=function(m){var g=f.call(m,p),v=m[p];try{m[p]=void 0;var _=!0}catch{}var y=d.call(m);return _&&(g?m[p]=v:delete m[p]),y}},9551:(s,c,u)=>{var l=u(4963),h=u(479),f=Object.prototype.propertyIsEnumerable,d=Object.getOwnPropertySymbols,p=d?function(m){return m==null?[]:(m=Object(m),l(d(m),function(g){return f.call(m,g)}))}:h;s.exports=p},4160:(s,c,u)=>{var l=u(8552),h=u(7071),f=u(3818),d=u(8525),p=u(577),m=u(4239),g=u(346),v="[object Map]",_="[object Promise]",y="[object Set]",b="[object WeakMap]",T="[object DataView]",S=g(l),k=g(h),O=g(f),D=g(d),M=g(p),w=m;(l&&w(new l(new ArrayBuffer(1)))!=T||h&&w(new h)!=v||f&&w(f.resolve())!=_||d&&w(new d)!=y||p&&w(new p)!=b)&&(w=function(L){var B=m(L),A=B=="[object Object]"?L.constructor:void 0,R=A?g(A):"";if(R)switch(R){case S:return T;case k:return v;case O:return _;case D:return y;case M:return b}return B}),s.exports=w},7801:s=>{s.exports=function(c,u){return c?.[u]}},1789:(s,c,u)=>{var l=u(4536);s.exports=function(){this.__data__=l?l(null):{},this.size=0}},401:s=>{s.exports=function(c){var u=this.has(c)&&delete this.__data__[c];return this.size-=u?1:0,u}},7667:(s,c,u)=>{var l=u(4536),h=Object.prototype.hasOwnProperty;s.exports=function(f){var d=this.__data__;if(l){var p=d[f];return p==="__lodash_hash_undefined__"?void 0:p}return h.call(d,f)?d[f]:void 0}},1327:(s,c,u)=>{var l=u(4536),h=Object.prototype.hasOwnProperty;s.exports=function(f){var d=this.__data__;return l?d[f]!==void 0:h.call(d,f)}},1866:(s,c,u)=>{var l=u(4536);s.exports=function(h,f){var d=this.__data__;return this.size+=this.has(h)?0:1,d[h]=l&&f===void 0?"__lodash_hash_undefined__":f,this}},5776:s=>{var c=/^(?:0|[1-9]\d*)$/;s.exports=function(u,l){var h=typeof u;return!!(l=l??9007199254740991)&&(h=="number"||h!="symbol"&&c.test(u))&&u>-1&&u%1==0&&u<l}},7019:s=>{s.exports=function(c){var u=typeof c;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?c!=="__proto__":c===null}},5346:(s,c,u)=>{var l,h=u(4429),f=(l=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"";s.exports=function(d){return!!f&&f in d}},5726:s=>{var c=Object.prototype;s.exports=function(u){var l=u&&u.constructor;return u===(typeof l=="function"&&l.prototype||c)}},7040:s=>{s.exports=function(){this.__data__=[],this.size=0}},4125:(s,c,u)=>{var l=u(8470),h=Array.prototype.splice;s.exports=function(f){var d=this.__data__,p=l(d,f);return!(p<0||(p==d.length-1?d.pop():h.call(d,p,1),--this.size,0))}},2117:(s,c,u)=>{var l=u(8470);s.exports=function(h){var f=this.__data__,d=l(f,h);return d<0?void 0:f[d][1]}},7518:(s,c,u)=>{var l=u(8470);s.exports=function(h){return l(this.__data__,h)>-1}},4705:(s,c,u)=>{var l=u(8470);s.exports=function(h,f){var d=this.__data__,p=l(d,h);return p<0?(++this.size,d.push([h,f])):d[p][1]=f,this}},4785:(s,c,u)=>{var l=u(1989),h=u(8407),f=u(7071);s.exports=function(){this.size=0,this.__data__={hash:new l,map:new(f||h),string:new l}}},1285:(s,c,u)=>{var l=u(5050);s.exports=function(h){var f=l(this,h).delete(h);return this.size-=f?1:0,f}},6e3:(s,c,u)=>{var l=u(5050);s.exports=function(h){return l(this,h).get(h)}},9916:(s,c,u)=>{var l=u(5050);s.exports=function(h){return l(this,h).has(h)}},5265:(s,c,u)=>{var l=u(5050);s.exports=function(h,f){var d=l(this,h),p=d.size;return d.set(h,f),this.size+=d.size==p?0:1,this}},8776:s=>{s.exports=function(c){var u=-1,l=Array(c.size);return c.forEach(function(h,f){l[++u]=[f,h]}),l}},4536:(s,c,u)=>{var l=u(852)(Object,"create");s.exports=l},6916:(s,c,u)=>{var l=u(5569)(Object.keys,Object);s.exports=l},1167:(s,c,u)=>{s=u.nmd(s);var l=u(1957),h=c&&!c.nodeType&&c,f=h&&s&&!s.nodeType&&s,d=f&&f.exports===h&&l.process,p=function(){try{return f&&f.require&&f.require("util").types||d&&d.binding&&d.binding("util")}catch{}}();s.exports=p},2333:s=>{var c=Object.prototype.toString;s.exports=function(u){return c.call(u)}},5569:s=>{s.exports=function(c,u){return function(l){return c(u(l))}}},5639:(s,c,u)=>{var l=u(1957),h=typeof self=="object"&&self&&self.Object===Object&&self,f=l||h||Function("return this")();s.exports=f},619:s=>{s.exports=function(c){return this.__data__.set(c,"__lodash_hash_undefined__"),this}},2385:s=>{s.exports=function(c){return this.__data__.has(c)}},1814:s=>{s.exports=function(c){var u=-1,l=Array(c.size);return c.forEach(function(h){l[++u]=h}),l}},7465:(s,c,u)=>{var l=u(8407);s.exports=function(){this.__data__=new l,this.size=0}},3779:s=>{s.exports=function(c){var u=this.__data__,l=u.delete(c);return this.size=u.size,l}},7599:s=>{s.exports=function(c){return this.__data__.get(c)}},4758:s=>{s.exports=function(c){return this.__data__.has(c)}},4309:(s,c,u)=>{var l=u(8407),h=u(7071),f=u(3369);s.exports=function(d,p){var m=this.__data__;if(m instanceof l){var g=m.__data__;if(!h||g.length<199)return g.push([d,p]),this.size=++m.size,this;m=this.__data__=new f(g)}return m.set(d,p),this.size=m.size,this}},346:s=>{var c=Function.prototype.toString;s.exports=function(u){if(u!=null){try{return c.call(u)}catch{}try{return u+""}catch{}}return""}},7813:s=>{s.exports=function(c,u){return c===u||c!=c&&u!=u}},5694:(s,c,u)=>{var l=u(9454),h=u(7005),f=Object.prototype,d=f.hasOwnProperty,p=f.propertyIsEnumerable,m=l(function(){return arguments}())?l:function(g){return h(g)&&d.call(g,"callee")&&!p.call(g,"callee")};s.exports=m},1469:s=>{var c=Array.isArray;s.exports=c},8612:(s,c,u)=>{var l=u(3560),h=u(1780);s.exports=function(f){return f!=null&&h(f.length)&&!l(f)}},4144:(s,c,u)=>{s=u.nmd(s);var l=u(5639),h=u(5062),f=c&&!c.nodeType&&c,d=f&&s&&!s.nodeType&&s,p=d&&d.exports===f?l.Buffer:void 0,m=(p?p.isBuffer:void 0)||h;s.exports=m},8446:(s,c,u)=>{var l=u(939);s.exports=function(h,f){return l(h,f)}},3560:(s,c,u)=>{var l=u(4239),h=u(3218);s.exports=function(f){if(!h(f))return!1;var d=l(f);return d=="[object Function]"||d=="[object GeneratorFunction]"||d=="[object AsyncFunction]"||d=="[object Proxy]"}},1780:s=>{s.exports=function(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991}},3218:s=>{s.exports=function(c){var u=typeof c;return c!=null&&(u=="object"||u=="function")}},7005:s=>{s.exports=function(c){return c!=null&&typeof c=="object"}},6719:(s,c,u)=>{var l=u(8749),h=u(1717),f=u(1167),d=f&&f.isTypedArray,p=d?h(d):l;s.exports=p},3674:(s,c,u)=>{var l=u(4636),h=u(280),f=u(8612);s.exports=function(d){return f(d)?l(d):h(d)}},8306:(s,c,u)=>{var l=u(3369);function h(f,d){if(typeof f!="function"||d!=null&&typeof d!="function")throw new TypeError("Expected a function");var p=function(){var m=arguments,g=d?d.apply(this,m):m[0],v=p.cache;if(v.has(g))return v.get(g);var _=f.apply(this,m);return p.cache=v.set(g,_)||v,_};return p.cache=new(h.Cache||l),p}h.Cache=l,s.exports=h},479:s=>{s.exports=function(){return[]}},5062:s=>{s.exports=function(){return!1}},2703:(s,c,u)=>{var l=u(414);function h(){}function f(){}f.resetWarningCache=h,s.exports=function(){function d(g,v,_,y,b,T){if(T!==l){var S=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw S.name="Invariant Violation",S}}function p(){return d}d.isRequired=d;var m={array:d,bigint:d,bool:d,func:d,number:d,object:d,string:d,symbol:d,any:d,arrayOf:p,element:d,elementType:d,instanceOf:p,node:d,objectOf:p,oneOf:p,oneOfType:p,shape:p,exact:p,checkPropTypes:f,resetWarningCache:h};return m.PropTypes=m,m}},5697:(s,c,u)=>{s.exports=u(2703)()},414:s=>{s.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9787:s=>{s.exports=r}},n={};function o(s){var c=n[s];if(c!==void 0)return c.exports;var u=n[s]={id:s,loaded:!1,exports:{}};return i[s](u,u.exports,o),u.loaded=!0,u.exports}o.n=s=>{var c=s&&s.__esModule?()=>s.default:()=>s;return o.d(c,{a:c}),c},o.d=(s,c)=>{for(var u in c)o.o(c,u)&&!o.o(s,u)&&Object.defineProperty(s,u,{enumerable:!0,get:c[u]})},o.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),o.o=(s,c)=>Object.prototype.hasOwnProperty.call(s,c),o.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.nmd=s=>(s.paths=[],s.children||(s.children=[]),s);var a={};return(()=>{o.r(a),o.d(a,{default:()=>me,expandNodesToLevel:()=>X});var s=o(4184),c=o.n(s),u=o(8446),l=o.n(u),h=o(8306),f=o.n(h);let d=(q=21)=>crypto.getRandomValues(new Uint8Array(q)).reduce((Y,$)=>Y+(($&=63)<36?$.toString(36):$<62?($-26).toString(36).toUpperCase():$>62?"-":"_"),"");var p=o(5697),m=o.n(p),g=o(9787),v=o.n(g);function _(q){return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},_(q)}var y=["children","title"];function b(){return b=Object.assign?Object.assign.bind():function(q){for(var Y=1;Y<arguments.length;Y++){var $=arguments[Y];for(var U in $)Object.prototype.hasOwnProperty.call($,U)&&(q[U]=$[U])}return q},b.apply(this,arguments)}function T(q,Y){if(!(q instanceof Y))throw new TypeError("Cannot call a class as a function")}function S(q,Y){for(var $=0;$<Y.length;$++){var U=Y[$];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(q,U.key,U)}}function k(q,Y){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function($,U){return $.__proto__=U,$},k(q,Y)}function O(q,Y){if(Y&&(_(Y)==="object"||typeof Y=="function"))return Y;if(Y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function($){if($===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $}(q)}function D(q){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},D(q)}function M(q,Y,$){return Y in q?Object.defineProperty(q,Y,{value:$,enumerable:!0,configurable:!0,writable:!0}):q[Y]=$,q}var w=function(q){(function(_e,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");_e.prototype=Object.create(pe&&pe.prototype,{constructor:{value:_e,writable:!0,configurable:!0}}),Object.defineProperty(_e,"prototype",{writable:!1}),pe&&k(_e,pe)})(ge,q);var Y,$,U,se,ve=(U=ge,se=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var _e,pe=D(U);if(se){var be=D(this).constructor;_e=Reflect.construct(pe,arguments,be)}else _e=pe.apply(this,arguments);return O(this,_e)});function ge(){return T(this,ge),ve.apply(this,arguments)}return Y=ge,($=[{key:"render",value:function(){var _e=this.props,pe=_e.children,be=_e.title,G=function(F,re){if(F==null)return{};var Te,Se,ze=function(ct,yt){if(ct==null)return{};var Ut,pt,Lt={},tr=Object.keys(ct);for(pt=0;pt<tr.length;pt++)Ut=tr[pt],yt.indexOf(Ut)>=0||(Lt[Ut]=ct[Ut]);return Lt}(F,re);if(Object.getOwnPropertySymbols){var Ve=Object.getOwnPropertySymbols(F);for(Se=0;Se<Ve.length;Se++)Te=Ve[Se],re.indexOf(Te)>=0||Object.prototype.propertyIsEnumerable.call(F,Te)&&(ze[Te]=F[Te])}return ze}(_e,y);return v().createElement("button",b({"aria-label":be,title:be,type:"button"},G),pe)}}])&&S(Y.prototype,$),Object.defineProperty(Y,"prototype",{writable:!1}),ge}(v().PureComponent);M(w,"propTypes",{children:m().node.isRequired,title:m().string}),M(w,"defaultProps",{title:null});const L=w,B={ALL:"all",PARENT:"parent",LEAF:"leaf"};function A(q){this.message=q,this.stack=Error().stack}A.prototype=Object.create(Error.prototype),A.prototype.name="CheckboxTreeError";const R=A;function j(q,Y){var $=Object.keys(q);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(q);Y&&(U=U.filter(function(se){return Object.getOwnPropertyDescriptor(q,se).enumerable})),$.push.apply($,U)}return $}function W(q,Y,$){return Y in q?Object.defineProperty(q,Y,{value:$,enumerable:!0,configurable:!0,writable:!0}):q[Y]=$,q}function K(q,Y){if(!(q instanceof Y))throw new TypeError("Cannot call a class as a function")}function oe(q,Y){for(var $=0;$<Y.length;$++){var U=Y[$];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(q,U.key,U)}}var fe=B;const Ae=function(){function q(U){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};K(this,q),this.props=U,this.flatNodes=se}var Y,$;return Y=q,$=[{key:"setProps",value:function(U){this.props=U}},{key:"clone",value:function(){var U=this,se={};return Object.keys(this.flatNodes).forEach(function(ve){var ge=U.flatNodes[ve];se[ve]=function(_e){for(var pe=1;pe<arguments.length;pe++){var be=arguments[pe]!=null?arguments[pe]:{};pe%2?j(Object(be),!0).forEach(function(G){W(_e,G,be[G])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_e,Object.getOwnPropertyDescriptors(be)):j(Object(be)).forEach(function(G){Object.defineProperty(_e,G,Object.getOwnPropertyDescriptor(be,G))})}return _e}({},ge)}),new q(this.props,se)}},{key:"getNode",value:function(U){return this.flatNodes[U]}},{key:"reset",value:function(){this.flatNodes={}}},{key:"flattenNodes",value:function(U){var se=this,ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(Array.isArray(U)&&U.length!==0){var _e=this.props,pe=_e.disabled,be=_e.noCascade;U.forEach(function(G,F){var re=se.nodeHasChildren(G);if(se.flatNodes[G.value]!==void 0)throw new R("Duplicate value '".concat(G.value,"' detected. All node values must be unique."));se.flatNodes[G.value]={label:G.label,value:G.value,children:G.children,parent:ve,isChild:ve.value!==void 0,isParent:re,isLeaf:!re,showCheckbox:G.showCheckbox===void 0||G.showCheckbox,disabled:se.getDisabledState(G,ve,pe,be),treeDepth:ge,index:F},se.flattenNodes(G.children,G,ge+1)})}}},{key:"nodeHasChildren",value:function(U){return Array.isArray(U.children)}},{key:"getDisabledState",value:function(U,se,ve,ge){return!!ve||!(ge||!se.disabled)||!!U.disabled}},{key:"deserializeLists",value:function(U){var se=this,ve=["checked","expanded"];Object.keys(this.flatNodes).forEach(function(ge){ve.forEach(function(_e){se.flatNodes[ge][_e]=!1})}),ve.forEach(function(ge){U[ge].forEach(function(_e){se.flatNodes[_e]!==void 0&&(se.flatNodes[_e][ge]=!0)})})}},{key:"serializeList",value:function(U){var se=this,ve=[];return Object.keys(this.flatNodes).forEach(function(ge){se.flatNodes[ge][U]&&ve.push(ge)}),ve}},{key:"expandAllNodes",value:function(U){var se=this;return Object.keys(this.flatNodes).forEach(function(ve){se.flatNodes[ve].isParent&&(se.flatNodes[ve].expanded=U)}),this}},{key:"toggleChecked",value:function(U,se,ve,ge){var _e=this,pe=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],be=this.flatNodes[U.value],G=[fe.PARENT,fe.ALL].indexOf(ve)>-1,F=[fe.LEAF,fe.ALL].indexOf(ve)>-1;if(be.isLeaf||ge){if(U.disabled)return this;this.toggleNode(U.value,"checked",se)}else(G||be.children.length===0)&&this.toggleNode(U.value,"checked",se),F&&be.children.forEach(function(re){_e.toggleChecked(re,se,ve,ge,!1)});return pe&&!ge&&be.isChild&&G&&this.toggleParentStatus(be.parent,ve),this}},{key:"toggleParentStatus",value:function(U,se){var ve=this.flatNodes[U.value];ve.isChild?(se===fe.ALL&&this.toggleNode(U.value,"checked",this.isEveryChildChecked(ve)),this.toggleParentStatus(ve.parent,se)):this.toggleNode(U.value,"checked",this.isEveryChildChecked(ve))}},{key:"isEveryChildChecked",value:function(U){var se=this;return U.children.every(function(ve){return se.getNode(ve.value).checked})}},{key:"toggleNode",value:function(U,se,ve){return this.flatNodes[U][se]=ve,this}}],$&&oe(Y.prototype,$),Object.defineProperty(Y,"prototype",{writable:!1}),q}();function de(q){return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},de(q)}function Z(){return Z=Object.assign?Object.assign.bind():function(q){for(var Y=1;Y<arguments.length;Y++){var $=arguments[Y];for(var U in $)Object.prototype.hasOwnProperty.call($,U)&&(q[U]=$[U])}return q},Z.apply(this,arguments)}function ne(q,Y){var $=Object.keys(q);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(q);Y&&(U=U.filter(function(se){return Object.getOwnPropertyDescriptor(q,se).enumerable})),$.push.apply($,U)}return $}function ue(q,Y){if(!(q instanceof Y))throw new TypeError("Cannot call a class as a function")}function Oe(q,Y){for(var $=0;$<Y.length;$++){var U=Y[$];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(q,U.key,U)}}function Ce(q,Y){return Ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function($,U){return $.__proto__=U,$},Ce(q,Y)}function je(q,Y){if(Y&&(de(Y)==="object"||typeof Y=="function"))return Y;if(Y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function($){if($===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $}(q)}function Pe(q){return Pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},Pe(q)}function Ue(q,Y,$){return Y in q?Object.defineProperty(q,Y,{value:$,enumerable:!0,configurable:!0,writable:!0}):q[Y]=$,q}var Ye=function(q){(function(_e,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");_e.prototype=Object.create(pe&&pe.prototype,{constructor:{value:_e,writable:!0,configurable:!0}}),Object.defineProperty(_e,"prototype",{writable:!1}),pe&&Ce(_e,pe)})(ge,q);var Y,$,U,se,ve=(U=ge,se=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var _e,pe=Pe(U);if(se){var be=Pe(this).constructor;_e=Reflect.construct(pe,arguments,be)}else _e=pe.apply(this,arguments);return je(this,_e)});function ge(){return ue(this,ge),ve.apply(this,arguments)}return Y=ge,$=[{key:"componentDidMount",value:function(){this.updateDeterminateProperty()}},{key:"componentDidUpdate",value:function(){this.updateDeterminateProperty()}},{key:"updateDeterminateProperty",value:function(){var _e=this.props.indeterminate;this.checkbox.indeterminate=_e}},{key:"render",value:function(){var _e=this,pe=function(be){for(var G=1;G<arguments.length;G++){var F=arguments[G]!=null?arguments[G]:{};G%2?ne(Object(F),!0).forEach(function(re){Ue(be,re,F[re])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(F)):ne(Object(F)).forEach(function(re){Object.defineProperty(be,re,Object.getOwnPropertyDescriptor(F,re))})}return be}({},this.props);return delete pe.indeterminate,v().createElement("input",Z({},pe,{ref:function(be){_e.checkbox=be},type:"checkbox"}))}}],$&&Oe(Y.prototype,$),Object.defineProperty(Y,"prototype",{writable:!1}),ge}(v().PureComponent);Ue(Ye,"propTypes",{indeterminate:m().bool}),Ue(Ye,"defaultProps",{indeterminate:!1});const xe=Ye,qe=m().shape({check:m().node,uncheck:m().node,halfCheck:m().node,expandClose:m().node,expandOpen:m().node,expandAll:m().node,collapseAll:m().node,parentClose:m().node,parentOpen:m().node,leaf:m().node}),We=m().shape({collapseAll:m().string.isRequired,expandAll:m().string.isRequired,toggle:m().string.isRequired});function vt(q){return vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},vt(q)}function dt(q,Y){for(var $=0;$<Y.length;$++){var U=Y[$];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(q,U.key,U)}}function Qe(q,Y){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function($,U){return $.__proto__=U,$},Qe(q,Y)}function Et(q,Y){if(Y&&(vt(Y)==="object"||typeof Y=="function"))return Y;if(Y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bt(q)}function bt(q){if(q===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q}function Rt(q){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},Rt(q)}function Xr(q,Y,$){return Y in q?Object.defineProperty(q,Y,{value:$,enumerable:!0,configurable:!0,writable:!0}):q[Y]=$,q}var Mt=function(q){(function(_e,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");_e.prototype=Object.create(pe&&pe.prototype,{constructor:{value:_e,writable:!0,configurable:!0}}),Object.defineProperty(_e,"prototype",{writable:!1}),pe&&Qe(_e,pe)})(ge,q);var Y,$,U,se,ve=(U=ge,se=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var _e,pe=Rt(U);if(se){var be=Rt(this).constructor;_e=Reflect.construct(pe,arguments,be)}else _e=pe.apply(this,arguments);return Et(this,_e)});function ge(_e){var pe;return function(be,G){if(!(be instanceof G))throw new TypeError("Cannot call a class as a function")}(this,ge),(pe=ve.call(this,_e)).onCheck=pe.onCheck.bind(bt(pe)),pe.onCheckboxKeyPress=pe.onCheckboxKeyPress.bind(bt(pe)),pe.onCheckboxKeyUp=pe.onCheckboxKeyUp.bind(bt(pe)),pe.onClick=pe.onClick.bind(bt(pe)),pe.onExpand=pe.onExpand.bind(bt(pe)),pe}return Y=ge,($=[{key:"onCheck",value:function(){var _e=this.props,pe=_e.value;(0,_e.onCheck)({value:pe,checked:this.getCheckState({toggle:!0})})}},{key:"onCheckboxKeyPress",value:function(_e){_e.which===32&&_e.preventDefault()}},{key:"onCheckboxKeyUp",value:function(_e){var pe=_e.keyCode;[13,32].includes(pe)&&this.onCheck()}},{key:"onClick",value:function(){var _e=this.props,pe=_e.expandOnClick,be=_e.isParent,G=_e.value,F=_e.onClick;be&&pe&&this.onExpand(),F({value:G,checked:this.getCheckState({toggle:!1})})}},{key:"onExpand",value:function(){var _e=this.props,pe=_e.expanded,be=_e.value;(0,_e.onExpand)({value:be,expanded:!pe})}},{key:"getCheckState",value:function(_e){var pe=_e.toggle,be=this.props,G=be.checked,F=be.optimisticToggle;return!(G!==0||!pe)||G===1&&!pe||G===2&&F}},{key:"renderCollapseButton",value:function(){var _e=this.props,pe=_e.expandDisabled,be=_e.isLeaf,G=_e.lang;return be?v().createElement("span",{className:"rct-collapse"},v().createElement("span",{className:"rct-icon"})):v().createElement(L,{className:"rct-collapse rct-collapse-btn",disabled:pe,title:G.toggle,onClick:this.onExpand},this.renderCollapseIcon())}},{key:"renderCollapseIcon",value:function(){var _e=this.props,pe=_e.expanded,be=_e.icons,G=be.expandClose,F=be.expandOpen;return pe?F:G}},{key:"renderCheckboxIcon",value:function(){var _e=this.props,pe=_e.checked,be=_e.icons,G=be.uncheck,F=be.check,re=be.halfCheck;return pe===0?G:pe===1?F:re}},{key:"renderNodeIcon",value:function(){var _e=this.props,pe=_e.expanded,be=_e.icon,G=_e.icons,F=G.leaf,re=G.parentClose,Te=G.parentOpen,Se=_e.isLeaf;return be!==null?be:Se?F:pe?Te:re}},{key:"renderBareLabel",value:function(_e){var pe=this.props,be=pe.onClick,G=pe.title,F=be!==null;return v().createElement("span",{className:"rct-bare-label",title:G},F?v().createElement("span",{className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"button",tabIndex:0},_e):_e)}},{key:"renderCheckboxLabel",value:function(_e){var pe=this.props,be=pe.checked,G=pe.disabled,F=pe.title,re=pe.treeId,Te=pe.value,Se=pe.onClick!==null,ze="".concat(re,"-").concat(String(Te).split(" ").join("_")),Ve=[v().createElement("label",{key:0,htmlFor:ze,title:F},v().createElement(xe,{checked:be===1,disabled:G,id:ze,indeterminate:be===2,onClick:this.onCheck,onChange:function(){}}),v().createElement("span",{"aria-checked":be===1,"aria-disabled":G,className:"rct-checkbox",role:"checkbox",tabIndex:0,onKeyPress:this.onCheckboxKeyPress,onKeyUp:this.onCheckboxKeyUp},this.renderCheckboxIcon()),Se?null:_e)];return Se&&Ve.push(v().createElement("span",{key:1,className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"link",tabIndex:0},_e)),Ve}},{key:"renderLabel",value:function(){var _e=this.props,pe=_e.label,be=_e.showCheckbox,G=[_e.showNodeIcon?v().createElement("span",{key:0,className:"rct-node-icon"},this.renderNodeIcon()):null,v().createElement("span",{key:1,className:"rct-title"},pe)];return be?this.renderCheckboxLabel(G):this.renderBareLabel(G)}},{key:"renderChildren",value:function(){return this.props.expanded?this.props.children:null}},{key:"render",value:function(){var _e=this.props,pe=_e.className,be=_e.disabled,G=_e.expanded,F=_e.isLeaf,re=c()({"rct-node":!0,"rct-node-leaf":F,"rct-node-parent":!F,"rct-node-expanded":!F&&G,"rct-node-collapsed":!F&&!G,"rct-disabled":be},pe);return v().createElement("li",{className:re},v().createElement("span",{className:"rct-text"},this.renderCollapseButton(),this.renderLabel()),this.renderChildren())}}])&&dt(Y.prototype,$),Object.defineProperty(Y,"prototype",{writable:!1}),ge}(v().PureComponent);Xr(Mt,"propTypes",{checked:m().number.isRequired,disabled:m().bool.isRequired,expandDisabled:m().bool.isRequired,expanded:m().bool.isRequired,icons:qe.isRequired,isLeaf:m().bool.isRequired,isParent:m().bool.isRequired,label:m().node.isRequired,lang:We.isRequired,optimisticToggle:m().bool.isRequired,showNodeIcon:m().bool.isRequired,treeId:m().string.isRequired,value:m().oneOfType([m().string,m().number]).isRequired,onCheck:m().func.isRequired,onExpand:m().func.isRequired,children:m().node,className:m().string,expandOnClick:m().bool,icon:m().node,showCheckbox:m().bool,title:m().string,onClick:m().func}),Xr(Mt,"defaultProps",{children:null,className:null,expandOnClick:!1,icon:null,showCheckbox:!0,title:null,onClick:function(){}});const ke=Mt,te=m().oneOfType([m().arrayOf(m().string),m().arrayOf(m().number)]);function ae(q,Y){var $=Object.keys(q);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(q);Y&&(U=U.filter(function(se){return Object.getOwnPropertyDescriptor(q,se).enumerable})),$.push.apply($,U)}return $}function ye(q){for(var Y=1;Y<arguments.length;Y++){var $=arguments[Y]!=null?arguments[Y]:{};Y%2?ae(Object($),!0).forEach(function(U){Q(q,U,$[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(q,Object.getOwnPropertyDescriptors($)):ae(Object($)).forEach(function(U){Object.defineProperty(q,U,Object.getOwnPropertyDescriptor($,U))})}return q}function Q(q,Y,$){return Y in q?Object.defineProperty(q,Y,{value:$,enumerable:!0,configurable:!0,writable:!0}):q[Y]=$,q}var he={label:m().node.isRequired,value:m().oneOfType([m().string,m().number]).isRequired,disabled:m().bool,icon:m().node,showCheckbox:m().bool,title:m().string};const we=m().oneOfType([m().shape(he),m().shape(ye(ye({},he),{},{children:m().arrayOf(he).isRequired}))]);function Ie(q){return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},Ie(q)}function Fe(q,Y){var $=Object.keys(q);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(q);Y&&(U=U.filter(function(se){return Object.getOwnPropertyDescriptor(q,se).enumerable})),$.push.apply($,U)}return $}function Ge(q){for(var Y=1;Y<arguments.length;Y++){var $=arguments[Y]!=null?arguments[Y]:{};Y%2?Fe(Object($),!0).forEach(function(U){sr(q,U,$[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(q,Object.getOwnPropertyDescriptors($)):Fe(Object($)).forEach(function(U){Object.defineProperty(q,U,Object.getOwnPropertyDescriptor($,U))})}return q}function Xe(q,Y){for(var $=0;$<Y.length;$++){var U=Y[$];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(q,U.key,U)}}function Je(q,Y){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function($,U){return $.__proto__=U,$},Je(q,Y)}function at(q,Y){if(Y&&(Ie(Y)==="object"||typeof Y=="function"))return Y;if(Y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ot(q)}function Ot(q){if(q===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q}function ft(q){return ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},ft(q)}function sr(q,Y,$){return Y in q?Object.defineProperty(q,Y,{value:$,enumerable:!0,configurable:!0,writable:!0}):q[Y]=$,q}var H=function(q){(function(pe,be){if(typeof be!="function"&&be!==null)throw new TypeError("Super expression must either be null or a function");pe.prototype=Object.create(be&&be.prototype,{constructor:{value:pe,writable:!0,configurable:!0}}),Object.defineProperty(pe,"prototype",{writable:!1}),be&&Je(pe,be)})(_e,q);var Y,$,U,se,ve,ge=(se=_e,ve=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var pe,be=ft(se);if(ve){var G=ft(this).constructor;pe=Reflect.construct(be,arguments,G)}else pe=be.apply(this,arguments);return at(this,pe)});function _e(pe){var be;(function(F,re){if(!(F instanceof re))throw new TypeError("Cannot call a class as a function")})(this,_e),be=ge.call(this,pe);var G=new Ae(pe);return G.flattenNodes(pe.nodes),G.deserializeLists({checked:pe.checked,expanded:pe.expanded}),be.state={id:pe.id||"rct-".concat(d()),model:G,prevProps:pe},be.onCheck=be.onCheck.bind(Ot(be)),be.onExpand=be.onExpand.bind(Ot(be)),be.onNodeClick=be.onNodeClick.bind(Ot(be)),be.onExpandAll=be.onExpandAll.bind(Ot(be)),be.onCollapseAll=be.onCollapseAll.bind(Ot(be)),be.combineMemorized=f()(function(F,re){return Ge(Ge({},F),re)}).bind(Ot(be)),be}return Y=_e,$=[{key:"onCheck",value:function(pe){var be=this.props,G=be.checkModel,F=be.noCascade,re=be.onCheck,Te=this.state.model.clone(),Se=Te.getNode(pe.value);Te.toggleChecked(pe,pe.checked,G,F),re(Te.serializeList("checked"),Ge(Ge({},Se),pe))}},{key:"onExpand",value:function(pe){var be=this.props.onExpand,G=this.state.model.clone(),F=G.getNode(pe.value);G.toggleNode(pe.value,"expanded",pe.expanded),be(G.serializeList("expanded"),Ge(Ge({},F),pe))}},{key:"onNodeClick",value:function(pe){(0,this.props.onClick)(Ge(Ge({},this.state.model.getNode(pe.value)),pe))}},{key:"onExpandAll",value:function(){this.expandAllNodes()}},{key:"onCollapseAll",value:function(){this.expandAllNodes(!1)}},{key:"expandAllNodes",value:function(){var pe=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],be=this.props.onExpand;be(this.state.model.clone().expandAllNodes(pe).serializeList("expanded"))}},{key:"determineShallowCheckState",value:function(pe,be){var G=this.state.model.getNode(pe.value);return G.isLeaf||be||pe.children.length===0?G.checked?1:0:this.isEveryChildChecked(pe)?1:this.isSomeChildChecked(pe)?2:0}},{key:"isEveryChildChecked",value:function(pe){var be=this;return pe.children.every(function(G){return be.state.model.getNode(G.value).checkState===1})}},{key:"isSomeChildChecked",value:function(pe){var be=this;return pe.children.some(function(G){return be.state.model.getNode(G.value).checkState>0})}},{key:"renderTreeNodes",value:function(pe){var be=this,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=this.props,re=F.expandDisabled,Te=F.expandOnClick,Se=F.icons,ze=F.lang,Ve=F.noCascade,ct=F.onClick,yt=F.onlyLeafCheckboxes,Ut=F.optimisticToggle,pt=F.showNodeTitle,Lt=F.showNodeIcon,tr=this.state,ut=tr.id,$t=tr.model,rr=_e.defaultProps.icons,ir=pe.map(function(Ar){var Un=Ar.value,$e=$t.getNode(Ar.value),tt=$e.isParent?be.renderTreeNodes(Ar.children,Ar):null;$e.checkState=be.determineShallowCheckState(Ar,Ve);var kt=yt?$e.isLeaf:$e.showCheckbox;return!G.value||$t.getNode(G.value).expanded?v().createElement(ke,{key:Un,checked:$e.checkState,className:Ar.className,disabled:$e.disabled,expandDisabled:re,expandOnClick:Te,expanded:$e.expanded,icon:Ar.icon,icons:be.combineMemorized(rr,Se),label:Ar.label,lang:ze,optimisticToggle:Ut,isLeaf:$e.isLeaf,isParent:$e.isParent,showCheckbox:kt,showNodeIcon:Lt,title:pt?Ar.title||Ar.label:Ar.title,treeId:ut,value:Ar.value,onCheck:be.onCheck,onClick:ct&&be.onNodeClick,onExpand:be.onExpand},tt):null});return v().createElement("ol",null,ir)}},{key:"renderExpandAll",value:function(){var pe=this.props,be=pe.icons,G=be.expandAll,F=be.collapseAll,re=pe.lang;return pe.showExpandAll?v().createElement("div",{className:"rct-options"},v().createElement(L,{className:"rct-option rct-option-expand-all",title:re.expandAll,onClick:this.onExpandAll},G),v().createElement(L,{className:"rct-option rct-option-collapse-all",title:re.collapseAll,onClick:this.onCollapseAll},F)):null}},{key:"renderHiddenInput",value:function(){var pe=this.props,be=pe.name,G=pe.nameAsArray;return be===void 0?null:G?this.renderArrayHiddenInput():this.renderJoinedHiddenInput()}},{key:"renderArrayHiddenInput",value:function(){var pe=this.props,be=pe.checked,G=pe.name;return be.map(function(F){var re="".concat(G,"[]");return v().createElement("input",{key:F,name:re,type:"hidden",value:F})})}},{key:"renderJoinedHiddenInput",value:function(){var pe=this.props,be=pe.checked,G=pe.name,F=be.join(",");return v().createElement("input",{name:G,type:"hidden",value:F})}},{key:"render",value:function(){var pe,be=this.props,G=be.direction,F=be.disabled,re=be.iconsClass,Te=be.nodes,Se=be.nativeCheckboxes,ze=this.state.id,Ve=this.renderTreeNodes(Te),ct=c()((sr(pe={"react-checkbox-tree":!0,"rct-disabled":F},"rct-icons-".concat(re),!0),sr(pe,"rct-native-display",Se),sr(pe,"rct-direction-rtl",G==="rtl"),pe));return v().createElement("div",{className:ct,id:ze},this.renderExpandAll(),this.renderHiddenInput(),Ve)}}],U=[{key:"getDerivedStateFromProps",value:function(pe,be){var G=be.model,F=be.prevProps,re=pe.disabled,Te=pe.id,Se=pe.nodes,ze=Ge(Ge({},be),{},{prevProps:pe});return G.setProps(pe),l()(F.nodes,Se)&&F.disabled===re||(G.reset(),G.flattenNodes(Se)),Te!==null&&(ze=Ge(Ge({},ze),{},{id:Te})),G.deserializeLists({checked:pe.checked,expanded:pe.expanded}),ze}}],$&&Xe(Y.prototype,$),U&&Xe(Y,U),Object.defineProperty(Y,"prototype",{writable:!1}),_e}(v().Component);function I(q){return function(Y){if(Array.isArray(Y))return x(Y)}(q)||function(Y){if(typeof Symbol<"u"&&Y[Symbol.iterator]!=null||Y["@@iterator"]!=null)return Array.from(Y)}(q)||function(Y,$){if(Y){if(typeof Y=="string")return x(Y,$);var U=Object.prototype.toString.call(Y).slice(8,-1);return U==="Object"&&Y.constructor&&(U=Y.constructor.name),U==="Map"||U==="Set"?Array.from(Y):U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U)?x(Y,$):void 0}}(q)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
317
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function x(q,Y){(Y==null||Y>q.length)&&(Y=q.length);for(var $=0,U=new Array(Y);$<Y;$++)U[$]=q[$];return U}function X(q,Y){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if($>Y)return[];var U=[];return q.forEach(function(se){se.children&&(U=[].concat(I(U),[se.value],I(X(se.children,Y,$+1))))}),U}sr(H,"propTypes",{nodes:m().arrayOf(we).isRequired,checkModel:m().oneOf([B.LEAF,B.ALL]),checked:te,direction:m().string,disabled:m().bool,expandDisabled:m().bool,expandOnClick:m().bool,expanded:te,icons:qe,iconsClass:m().string,id:m().string,lang:We,name:m().string,nameAsArray:m().bool,nativeCheckboxes:m().bool,noCascade:m().bool,onlyLeafCheckboxes:m().bool,optimisticToggle:m().bool,showExpandAll:m().bool,showNodeIcon:m().bool,showNodeTitle:m().bool,onCheck:m().func,onClick:m().func,onExpand:m().func}),sr(H,"defaultProps",{checkModel:B.LEAF,checked:[],direction:"ltr",disabled:!1,expandDisabled:!1,expandOnClick:!1,expanded:[],icons:{check:v().createElement("span",{className:"rct-icon rct-icon-check"}),uncheck:v().createElement("span",{className:"rct-icon rct-icon-uncheck"}),halfCheck:v().createElement("span",{className:"rct-icon rct-icon-half-check"}),expandClose:v().createElement("span",{className:"rct-icon rct-icon-expand-close"}),expandOpen:v().createElement("span",{className:"rct-icon rct-icon-expand-open"}),expandAll:v().createElement("span",{className:"rct-icon rct-icon-expand-all"}),collapseAll:v().createElement("span",{className:"rct-icon rct-icon-collapse-all"}),parentClose:v().createElement("span",{className:"rct-icon rct-icon-parent-close"}),parentOpen:v().createElement("span",{className:"rct-icon rct-icon-parent-open"}),leaf:v().createElement("span",{className:"rct-icon rct-icon-leaf"})},iconsClass:"fa4",id:null,lang:{collapseAll:"Collapse all",expandAll:"Expand all",toggle:"Toggle"},name:void 0,nameAsArray:!1,nativeCheckboxes:!1,noCascade:!1,onlyLeafCheckboxes:!1,optimisticToggle:!0,showExpandAll:!1,showNodeIcon:!0,showNodeTitle:!1,onCheck:function(){},onClick:null,onExpand:function(){}});const me=H})(),a})())})(KW);var Z8e=KW.exports;const Q8e=ui(Z8e);function J8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZW(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t9e(i.key),i)}}function e9e(e,t,r){return t&&ZW(e.prototype,t),r&&ZW(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function t9e(e){var t=r9e(e,"string");return typeof t=="symbol"?t:String(t)}function r9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&MD(e,t)}function MD(e,t){return MD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},MD(e,t)}function i9e(e){var t=s9e();return function(){var i=ST(e),n;if(t){var o=ST(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return o9e(this,n)}}function o9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a9e(e)}function a9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ST(e){return ST=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ST(e)}let QW=function(e){n9e(r,e);var t=i9e(r);function r(i){var n;J8e(this,r),n=t.call(this,i),n.localTracks=Vl.filter(c=>c.local&&!c.hidden).map(c=>{const u={...c};return u.datatype=c.datatype[0],u}),n.augmentedTracksInfo=Vl,window.higlassTracksByType&&Object.keys(window.higlassTracksByType).forEach(c=>{n.augmentedTracksInfo.push(window.higlassTracksByType[c].config)}),i.datatype?n.localTracks=n.localTracks.filter(c=>c.datatype[0]===i.datatype):n.localTracks=n.localTracks.filter(c=>c.orientation===n.props.orientation),n.localTracks.forEach(c=>{c.uuid=xt.nice()});const o=n.prepareNewEntries("",n.localTracks,{}),a=Object.keys(o),s=a.length?[a[0]]:null;return n.mounted=!1,n.state={selectedUuid:s,options:o,filter:"",checked:[],expanded:[]},n.requestTilesetLists(),n}return e9e(r,[{key:"componentDidMount",value:function(){this.mounted=!0,this.requestTilesetLists(),this.searchBox.focus()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"prepareNewEntries",value:function(n,o,a){const s=a;return o.map(u=>({...u,server:n,tilesetUid:u.uuid,serverUidKey:this.serverUidKey(n,u.uuid),datatype:u.datatype,name:u.name,uid:xt.nice()})).forEach(u=>{s[u.serverUidKey]=u}),s}},{key:"serverUidKey",value:function(n,o){return`${n}/${o}`}},{key:"requestTilesetLists",value:function(){let n=null;if(this.props.datatype?n=`dt=${this.props.datatype}`:n=[...new Set([].concat(...this.augmentedTracksInfo.filter(a=>a.datatype).filter(a=>a.orientation===this.props.orientation||this.props.orientation==="1d-vertical"&&a.orientation==="1d-horizontal").map(a=>a.datatype)))].map(a=>`dt=${a}`).join("&"),!this.props.trackSourceServers){console.warn("No track source servers specified in the viewconf");return}this.props.trackSourceServers.forEach(o=>{Ke.json(`${o}/tilesets/?limit=10000&${n}`,(a,s)=>{if(a)console.error("ERROR:",a);else{const c=this.prepareNewEntries(o,s.results,this.state.options),u=Object.keys(c);let{selectedUuid:l}=this.state;if(!l){l=u.length?[u[0]]:null;const h=this.state.options[l[0]];this.props.selectedTilesetChanged([h])}this.mounted&&this.setState({selectedUuid:l,options:c})}},this.props.pubSub)})}},{key:"handleOptionDoubleClick",value:function(n){const o=this.state.options[n.target.value];this.props.onDoubleClick(o)}},{key:"handleSelectedOptions",value:function(n){const o=[],a=[];for(let s=0;s<n.length;s++)o.push(n[s]),a.push(this.state.options[n[s]]);this.props.selectedTilesetChanged(a),this.setState({selectedUuid:o})}},{key:"handleSelect",value:function(){const{selectedOptions:n}=this.multiSelect,o=[];for(let a=0;a<n.length;a++){const s=n[a];o.push(s.value)}this.handleSelectedOptions(o)}},{key:"handleSearchChange",value:function(){const n=this.searchBox;this.setState({filter:n.value})}},{key:"partitionByGroup",value:function(n,o){const a={"":{name:"",value:"",children:[]}};for(const c of Object.keys(n)){const u=n[c];if(u.name.toLowerCase().includes(o))if("project_name"in u){const l=u.project_name;l in a||(a[l]={value:l,label:l,children:[]}),a[l].children.push({label:u.name,value:c})}else a[""].children.push({label:u.name,value:c})}const s=a[""].children;for(const c of Object.keys(a))c!==""&&(a[c].children.sort((u,l)=>u.label.toLowerCase().localeCompare(l.label.toLowerCase(),"en")),s.push(a[c]));return s.sort((c,u)=>c.label.toLowerCase().localeCompare(u.label.toLowerCase(),"en")),s}},{key:"handleChecked",value:function(n){this.handleSelectedOptions(n),this.setState({checked:n})}},{key:"handleExpanded",value:function(n){this.setState({expanded:n})}},{key:"render",value:function(){const n=[];for(const u in this.state.options)n.push(this.state.options[u]);const o=this.partitionByGroup(this.state.options,this.state.filter),a={width:15,height:15,top:2,right:2,position:"relative"},s=JSON.parse(JSON.stringify(a));s.opacity=.5;const c=E.createElement("form",{onSubmit:u=>{u.preventDefault()}},E.createElement("div",{className:"tileset-finder-search-bar"},E.createElement("span",{className:"tileset-finder-label"},"Select tileset:"),E.createElement("input",{ref:u=>{this.searchBox=u},className:"tileset-finder-search-box",onChange:this.handleSearchChange.bind(this),placeholder:"Search Term",type:"text"})),E.createElement("div",{className:"tileset-finder-checkbox-tree"},E.createElement(Q8e,{checked:this.state.checked,expanded:this.state.expanded,icons:{uncheck:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#square_o"})),check:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#check_square_o"})),halfCheck:E.createElement("svg",{style:s},E.createElement("use",{xlinkHref:"#check_square_o"})),leaf:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#file_o"})),expandClose:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#chevron_right"})),expandOpen:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#chevron_down"})),parentClose:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#folder_o"})),parentOpen:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#folder_open_o"}))},nodes:o,onCheck:this.handleChecked.bind(this),onExpand:this.handleExpanded.bind(this)})));return E.createElement("div",null,c)}}]),r}(E.Component);QW.propTypes={datatype:N.string,orientation:N.string,onDoubleClick:N.func,pubSub:N.object.isRequired,selectedTilesetChanged:N.func,trackSourceServers:N.array};const l9e=Rf(QW);function c9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JW(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f9e(i.key),i)}}function u9e(e,t,r){return t&&JW(e.prototype,t),r&&JW(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f9e(e){var t=h9e(e,"string");return typeof t=="symbol"?t:String(t)}function h9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&LD(e,t)}function LD(e,t){return LD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},LD(e,t)}function p9e(e){var t=v9e();return function(){var i=wT(e),n;if(t){var o=wT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return m9e(this,n)}}function m9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return g9e(e)}function g9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wT(e){return wT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wT(e)}let eY=function(e){d9e(r,e);var t=p9e(r);function r(i){var n;return c9e(this,r),n=t.call(this,i),n.DATATYPE_TO_TRACK_TYPE=BS(n.props.orientation),n.AVAILABLE_TRACK_TYPES=ly(n.props.datatypes,n.props.orientation),n.state={selectedPlotType:n.AVAILABLE_TRACK_TYPES[0]},n}return u9e(r,[{key:"UNSAFE_componentWillReceiveProps",value:function(n){if(this.AVAILABLE_TRACK_TYPES=ly(n.datatypes,this.props.orientation),!!this.AVAILABLE_TRACK_TYPES&&n.allTracksSameDatatype&&this.AVAILABLE_TRACK_TYPES.length>0&&!this.AVAILABLE_TRACK_TYPES.includes(this.state.selectedPlotType)){const o=jS(n.datatypes[0][0],this.props.position,this.AVAILABLE_TRACK_TYPES);this.handlePlotTypeSelected(o)}}},{key:"handlePlotTypeSelected",value:function(n){this.setState({selectedPlotType:n}),this.props.onPlotTypeSelected(n.type)}},{key:"render",value:function(){let n="No plot types available for track";const o={};return Vl.forEach(a=>{o[a.type]=a}),this.AVAILABLE_TRACK_TYPES&&(n=this.AVAILABLE_TRACK_TYPES.sort((a,s)=>a.type<s.type).map(a=>{const s=o[a.type].thumbnail,c=this.state.selectedPlotType.type===a.type?"plot-type-item plot-type-selected":"plot-type-item",u=o[a.type].thumbnail?E.createElement("div",{className:"track-thumbnail",dangerouslySetInnerHTML:{__html:s.outerHTML}}):E.createElement("div",{className:"track-thumbnail"},E.createElement("svg",{height:20,width:30}));return E.createElement("li",{key:a.type,className:c,onClick:l=>{this.setState({selectedPlotType:a}),this.props.onPlotTypeSelected(a.type)},style:{listStyle:"none",paddingLeft:5,paddingBottom:0}},u,E.createElement("span",{style:{verticalAlign:"middle"}},a.type))})),E.createElement("div",null,n.length>0&&this.props.allTracksSameDatatype&&E.createElement("div",{className:"plot-type-container"},n),!this.props.allTracksSameDatatype&&E.createElement("div",{className:"plot-type-container-empty"},"Datasets with multiple datatypes chosen. They will be added with their default track types."))}}]),r}(E.Component);eY.propTypes={allTracksSameDatatype:N.bool,datatypes:N.array,orientation:N.string,onPlotTypeSelected:N.func,position:N.string};const GXe={"collapse-toggle-icon":"_collapse-toggle-icon_ub7s6_1",collapsed:"_collapsed_ub7s6_9","modal-title":"_modal-title_ub7s6_14","modal-container":"_modal-container_ub7s6_19",modal:"_modal_ub7s6_14","modal-backdrop":"_modal-backdrop_ub7s6_23","modal-dialog":"_modal-dialog_ub7s6_27"};function y9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_9e(i.key),i)}}function b9e(e,t,r){return t&&tY(e.prototype,t),r&&tY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _9e(e){var t=T9e(e,"string");return typeof t=="symbol"?t:String(t)}function T9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function E9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BD(e,t)}function BD(e,t){return BD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},BD(e,t)}function S9e(e){var t=A9e();return function(){var i=OT(e),n;if(t){var o=OT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return w9e(this,n)}}function w9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AT(e)}function AT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function OT(e){return OT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},OT(e)}let kT=function(e){E9e(r,e);var t=S9e(r);function r(i){var n;return y9e(this,r),n=t.call(this,i),n.options={},n.state={selectedTilesets:[{datatype:"none"}],allTracksSameDatatype:!0},n.handleSubmitBound=n.handleSubmit.bind(AT(n)),n.handleTilesetPickerDoubleClickBound=n.handleTilesetPickerDoubleClick.bind(AT(n)),n.selectedTilesetsChangedBound=n.selectedTilesetsChanged.bind(AT(n)),n}return b9e(r,[{key:"getOrientation",value:function(n){let o=null;return n==="top"||n==="bottom"?o="1d-horizontal":n==="left"||n==="right"?o="1d-vertical":o="2d",o}},{key:"handleSubmit",value:function(n){n&&n.preventDefault(),this.props.onTracksChosen(this.state.selectedTilesets,this.props.position,this.props.host)}},{key:"handleTilesetPickerDoubleClick",value:function(n){this.selectedTilesetsChanged([n]),this.props.onTracksChosen(this.state.selectedTilesets,this.props.position,this.props.host)}},{key:"handleOptionsChanged",value:function(n){this.options=n}},{key:"handlePlotTypeSelected",value:function(n){const{selectedTilesets:o}=this.state;for(const a of o)a.type=n;this.selectedPlotType=n,this.setState({selectedTilesets:o})}},{key:"selectedTilesetsChanged",value:function(n){let o=null;n.length===0?o=[{datatype:"none"}]:o=n;let a=!0;const s=o[0].datatype;for(const c of o)c.datatype!==s&&(a=!1);if(a)for(const c of o)c.type=this.selectedPlotType;else for(const c of o){let u=[c.datatype];const l=this.getOrientation(this.props.position);c.filetype==="cooler"&&(u=[c.datatype,"chromsizes"]);const h=ly([u],l),f=jS(u[0],this.props.position,h);c.type=f.type}this.setState({selectedTilesets:o,allTracksSameDatatype:a})}},{key:"render",value:function(){const n=this.getOrientation(this.props.position),o=E.createElement("div",null,E.createElement(l9e,{ref:a=>{this.tilesetFinder=a},datatype:this.props.datatype,onDoubleClick:this.handleTilesetPickerDoubleClick.bind(this),onTracksChosen:a=>this.props.onTracksChosen(a,this.props.position),orientation:n,selectedTilesetChanged:this.selectedTilesetsChanged.bind(this),trackSourceServers:this.props.trackSourceServers}));return E.createElement(og,{maxHeight:!0,okayTitle:"Submit",onCancel:this.props.onCancel,onOkay:this.handleSubmitBound,title:"Add Track"},E.createElement(E.Fragment,null,o,E.createElement(eY,{ref:a=>{this.plotTypeChooser=a},allTracksSameDatatype:this.state.allTracksSameDatatype,datatypes:this.state.selectedTilesets.map(a=>a.filetype==="cooler"?[a.datatype,"chromsizes"]:[a.datatype]),onPlotTypeSelected:this.handlePlotTypeSelected.bind(this),orientation:n,position:this.props.position})))}}]),r}(E.Component);kT.defaultProps={position:"top"},kT.propTypes={datatype:N.string,host:N.string,onCancel:N.func.isRequired,onTracksChosen:N.func.isRequired,position:N.string,trackSourceServers:N.array.isRequired};function HD(){return HD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},HD.apply(this,arguments)}function O9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,I9e(i.key),i)}}function k9e(e,t,r){return t&&rY(e.prototype,t),r&&rY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function I9e(e){var t=C9e(e,"string");return typeof t=="symbol"?t:String(t)}function C9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function P9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&FD(e,t)}function FD(e,t){return FD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},FD(e,t)}function D9e(e){var t=R9e();return function(){var i=IT(e),n;if(t){var o=IT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return x9e(this,n)}}function x9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N9e(e)}function N9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function IT(e){return IT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},IT(e)}let $D=function(e){P9e(r,e);var t=D9e(r);function r(){return O9e(this,r),t.apply(this,arguments)}return k9e(r,[{key:"render",value:function(){const n=[];return this.props.children.forEach((o,a)=>{const s=`customTrackDialog_${a}`;n.push(E.createElement(o,HD({key:s},this.props.bodyProps[a])))}),E.createElement(og,{maxHeight:!0,okayOnly:!0,okayTitle:"Close",onCancel:this.props.onCancel,onOkay:this.props.onCancel,title:this.props.title},n)}}]),r}(E.PureComponent);$D.defaultProps={},$D.propTypes={onCancel:N.func.isRequired,title:N.string,bodyProps:N.array,children:N.array};function M9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,B9e(i.key),i)}}function L9e(e,t,r){return t&&nY(e.prototype,t),r&&nY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function B9e(e){var t=H9e(e,"string");return typeof t=="symbol"?t:String(t)}function H9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jD(e,t)}function jD(e,t){return jD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},jD(e,t)}function $9e(e){var t=G9e();return function(){var i=CT(e),n;if(t){var o=CT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return j9e(this,n)}}function j9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U9e(e)}function U9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function CT(e){return CT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},CT(e)}const iY=20;let pl=function(e){F9e(r,e);var t=$9e(r);function r(i){var n;return M9e(this,r),n=t.call(this,i),n.adjusted=!1,n.state={orientation:n.props.orientation?n.props.orientation:"right",left:n.props.position.left,top:n.props.position.top,submenuShown:null},n}return L9e(r,[{key:"componentDidMount",value:function(){this.updateOrientation()}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){this.adjusted=!1,this.setState({left:n.position.left,top:n.position.top})}},{key:"componentDidUpdate",value:function(){this.updateOrientation()}},{key:"handleItemMouseEnterWithRect",value:function(n,o){this.setState({submenuShown:o,submenuSourceBbox:n})}},{key:"handleItemMouseEnter",value:function(n,o){this.handleItemMouseEnterWithRect(n.currentTarget.getBoundingClientRect(),o)}},{key:"handleMouseLeave",value:function(){}},{key:"handleOtherMouseEnter",value:function(){this.setState({submenuShown:null})}},{key:"updateOrientation",value:function(){if(this.adjusted)return;this.adjusted=!0,this.divDom=Lr.findDOMNode(this.div);const n=this.divDom.getBoundingClientRect(),o=this.props.parentBbox?this.props.parentBbox:{top:this.props.position.top,left:this.props.position.left,width:0,height:0};let a=this.state.orientation,s=o.top;if(o.top+n.height>window.innerHeight&&(o.top-n.height>0?s=o.top-n.height+iY:(s=o.top-n.height+iY,s-=s+n.height-window.innerHeight)),this.state.orientation==="left"){let c=o.left-n.width;c<0&&(o.left+o.width+n.width>window.innerWidth?c=0:(c=o.left+o.width,a="right")),this.setState({left:c,top:s,orientation:a})}else{let c=o.left+o.width;o.left+o.width+n.width>window.innerWidth&&(o.left-n.width<0?(c=0,a="right"):(c=o.left-n.width,a="left")),this.setState({left:c,top:s,orientation:a})}}},{key:"render",value:function(){const n=this.state.left?{left:this.state.left}:{right:this.state.right},o={top:this.state.top},a=Object.assign(n,o);return E.createElement("div",{ref:s=>{this.div=s},className:Zt("context-menu-item",mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),style:a},this.props.children)}}]),r}(E.Component);pl.propTypes={children:N.node,orientation:N.string,parentBbox:N.object,position:N.object,theme:N.symbol.isRequired};function z9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,W9e(i.key),i)}}function V9e(e,t,r){return t&&oY(e.prototype,t),r&&oY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function W9e(e){var t=Y9e(e,"string");return typeof t=="symbol"?t:String(t)}function Y9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function q9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&UD(e,t)}function UD(e,t){return UD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},UD(e,t)}function X9e(e){var t=Q9e();return function(){var i=PT(e),n;if(t){var o=PT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return K9e(this,n)}}function K9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z9e(e)}function Z9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function PT(e){return PT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},PT(e)}let GD=function(e){q9e(r,e);var t=X9e(r);function r(){return z9e(this,r),t.apply(this,arguments)}return V9e(r,[{key:"getSubmenu",value:function(){if(this.state.submenuShown){const n=this.state.submenuSourceBbox,o=this.state.orientation==="left"?{left:this.state.left,top:n.top}:{left:this.state.left+n.width+7,top:n.top},a=this.state.submenuShown;return E.createElement(r,{menuItems:a.children,orientation:this.state.orientation,parentBbox:n,position:o,theme:this.props.theme})}return E.createElement("div",null)}},{key:"componentWillUnmount",value:function(){}},{key:"render",value:function(){const n=[];for(const o in this.props.menuItems){const a=this.props.menuItems[o];n.push(E.createElement(St,{key:o,onClick:a.handler?a.handler:()=>null,onMouseEnter:a.children?s=>this.handleItemMouseEnter(s,a):this.handleOtherMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave},a.name,a.children&&E.createElement("svg",{className:mt["play-icon"]},E.createElement("use",{xlinkHref:"#play"}))))}return E.createElement("div",{ref:o=>{this.div=o},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),style:{left:this.state.left,top:this.state.top}},n,this.getSubmenu())}}]),r}(pl);function J9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t7e(i.key),i)}}function e7e(e,t,r){return t&&aY(e.prototype,t),r&&aY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function t7e(e){var t=r7e(e,"string");return typeof t=="symbol"?t:String(t)}function r7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zD(e,t)}function zD(e,t){return zD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},zD(e,t)}function i7e(e){var t=s7e();return function(){var i=DT(e),n;if(t){var o=DT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return o7e(this,n)}}function o7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a7e(e)}function a7e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function DT(e){return DT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},DT(e)}let l7e=function(e){n7e(r,e);var t=i7e(r);function r(){return J9e(this,r),t.apply(this,arguments)}return e7e(r,[{key:"getConfigureSeriesMenu",value:function(n,o,a){const s={},c=window.higlassTracksByType&&window.higlassTracksByType[a.type]&&window.higlassTracksByType[a.type].config&&window.higlassTracksByType[a.type].config.optionsInfo;if(c)for(const u of Object.keys(c))wn[u]=c[u];if(!dr[a.type]||!dr[a.type].availableOptions)return null;for(const u of dr[a.type].availableOptions)if(u in wn){if(s[u]={name:wn[u].name},wn[u].generateOptions){const l=wn[u].generateOptions(a);s[u].children||(s[u].children={});for(const h of l){const f={name:h.name,value:h.value,handler:()=>{a.options[u]=h.value,this.props.onTrackOptionsChanged(a.uid,a.options),this.props.closeMenu()}};s[u].children[h.value]=f}}if(wn[u].inlineOptions)for(const l in wn[u].inlineOptions){const h=wn[u].inlineOptions[l];s[u].children||(s[u].children={});const f={name:h.name,value:h.value};h.componentPickers&&h.componentPickers[a.type]?f.handler=()=>{this.props.onConfigureTrack(a,h.componentPickers[a.type]),this.props.closeMenu()}:f.handler=()=>{a.options[u]=h.value,this.props.onTrackOptionsChanged(a.uid,a.options),this.props.closeMenu()},s[u].children[l]=f}else wn[u].componentPickers&&wn[u].componentPickers[a.type]&&(s[u].handler=()=>{this.props.onConfigureTrack(a,wn[u].componentPickers[a.type]),this.props.closeMenu()})}return E.createElement(GD,{key:"config-series-menu",closeMenu:this.props.closeMenu,menuItems:s,orientation:this.state.orientation,parentBbox:o,position:n,theme:this.props.theme})}},{key:"getTrackTypeItems",value:function(n,o,a){window.higlassTracksByType&&Object.keys(window.higlassTracksByType).forEach(h=>{dr[h]=window.higlassTracksByType[h].config});let{datatype:s}=a,c=null;a.type in dr&&(s||(s=dr[a.type].datatype[0]),{orientation:c}=dr[a.type]);const u=Object.values(dr).filter(h=>h.datatype).filter(h=>h.orientation).filter(h=>h.datatype.includes(s)).filter(h=>h.orientation===c).map(h=>h.type),l={};for(let h=0;h<u.length;h++)l[u[h]]={value:u[h],name:u[h],handler:()=>{this.props.onChangeTrackType(a.uid,u[h])}};return E.createElement(GD,{key:"track-type-items",closeMenu:this.props.closeMenu,menuItems:l,orientation:this.state.orientation,parentBbox:o,position:n,theme:this.props.theme})}},{key:"getSubmenu",value:function(){if(this.state.submenuShown){const n=this.state.submenuSourceBbox,o=this.state.orientation==="left"?{left:this.state.left,top:n.top}:{left:this.state.left+n.width+7,top:n.top},a=this.state.submenuShown,s=a.value;return a.option==="track-type"?this.getTrackTypeItems(o,n,s):this.getConfigureSeriesMenu(o,n,s)}return E.createElement("div",null)}},{key:"getDivideByMenuItem",value:function(){if(this.props.series.data&&this.props.series.data.type==="divided"){const n={tilesetUid:this.props.series.data.children[0].tilesetUid,server:this.props.series.data.children[0].server};return E.createElement(St,{className:mt["context-menu-item"],onClick:()=>this.props.onChangeTrackData(this.props.series.uid,n),onMouseEnter:o=>this.handleOtherMouseEnter(o)},E.createElement("span",{className:mt["context-menu-span"]},"Remove divisor"))}return E.createElement(St,{className:mt["context-menu-item"],onClick:()=>this.props.onAddDivisor(this.props.series),onMouseEnter:n=>this.handleOtherMouseEnter(n)},E.createElement("span",{className:mt["context-menu-span"]},"Divide by"))}},{key:"componentWillUnmount",value:function(){}},{key:"render",value:function(){let n=null;dr[this.props.series.type]&&dr[this.props.series.type].exportable&&(n=E.createElement(St,{className:mt["context-menu-item"],onClick:()=>this.props.onExportData(this.props.hostTrack.uid,this.props.track.uid),onMouseEnter:a=>this.handleOtherMouseEnter(a)},E.createElement("span",{className:mt["context-menu-span"]},"Export Data")));const o=this.props.onAddSeries?E.createElement(St,{className:mt["context-menu-item"],onClick:()=>{this.props.onCloseTrack(this.props.series.uid),this.props.onAddSeries(this.props.hostTrack.uid)},onMouseEnter:a=>this.handleOtherMouseEnter(a)},E.createElement("span",{className:mt["context-menu-span"]},"Replace Series")):null;return E.createElement("div",{ref:a=>{this.div=a},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),"data-menu-type":"SeriesListMenu",onMouseLeave:this.props.handleMouseLeave,style:{left:this.state.left,top:this.state.top}},E.createElement(St,{onClick:()=>{},onMouseEnter:a=>this.handleItemMouseEnter(a,{option:"configure-series",value:this.props.track}),onMouseLeave:a=>this.handleMouseLeave(a)},"Configure Series",E.createElement("svg",{className:mt["play-icon"]},E.createElement("use",{xlinkHref:"#play"}))),E.createElement(St,{className:mt["context-menu-item"],onClick:()=>{},onMouseEnter:a=>this.handleItemMouseEnter(a,{option:"track-type",value:this.props.track}),onMouseLeave:a=>this.handleMouseLeave(a)},E.createElement("span",{className:mt["context-menu-span"]},"Track Type",E.createElement("svg",{className:mt["play-icon"]},E.createElement("use",{xlinkHref:"#play"})))),n,this.getDivideByMenuItem(),E.createElement(St,{className:mt["context-menu-item"],onClick:this.props.onCloseTrack,onMouseEnter:a=>this.handleOtherMouseEnter(a)},E.createElement("span",{className:mt["context-menu-span"]},"Close Series")),o,this.getSubmenu())}}]),r}(pl);const sY=e=>{let t=[];for(const r of e)r.contents?t=t.concat(r.contents):t.push(r);return t},VD=(e,t,r,i)=>e?(window.higlassTracksByType&&Object.keys(window.higlassTracksByType).forEach(n=>{dr[n]=window.higlassTracksByType[n].config}),sY(e).map(n=>{const o=dr[n.type]?dr[n.type].thumbnail:null,a=o?E.createElement("div",{className:mt["context-menu-icon"],dangerouslySetInnerHTML:{__html:o.outerHTML}}):E.createElement("div",{className:mt["context-menu-icon"]},E.createElement("svg",null));return E.createElement(St,{key:n.uid,className:mt["context-menu-item"],onClick:()=>{i&&i(n.uid)},onMouseEnter:s=>{t&&t(s,n)},onMouseLeave:s=>{r&&r(s)}},a,E.createElement("span",{className:mt["context-menu-span"]},n.options&&n.options.name&&n.options.name.length?n.options.name:n.type,t&&r?E.createElement("svg",{className:mt["play-icon"]},E.createElement("use",{xlinkHref:"#play"})):null))})):null;function c7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f7e(i.key),i)}}function u7e(e,t,r){return t&&lY(e.prototype,t),r&&lY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f7e(e){var t=h7e(e,"string");return typeof t=="symbol"?t:String(t)}function h7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WD(e,t)}function WD(e,t){return WD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},WD(e,t)}function p7e(e){var t=v7e();return function(){var i=xT(e),n;if(t){var o=xT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return m7e(this,n)}}function m7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return g7e(e)}function g7e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xT(e){return xT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xT(e)}const cY=Z_(e=>function(t){d7e(i,t);var r=p7e(i);function i(){return c7e(this,i),r.apply(this,arguments)}return u7e(i,[{key:"getSubmenu",value:function(){if(this.state.submenuShown){const o=this.state.submenuSourceBbox;let a=null;this.state.orientation==="left"?a={left:this.state.left,top:o.top}:a={left:this.state.left+o.width+7,top:o.top};const c=sY(this.props.tracks).filter(l=>l.uid===this.state.submenuShown.uid)[0],u=c&&c.position!=="whole";return E.createElement(l7e,{key:`series-list-menu-${c.uid}`,ref:l=>{this.seriesListMenu=l},closeMenu:this.props.closeMenu,hostTrack:this.props.tracks[0],onAddDivisor:this.props.onAddDivisor,onAddSeries:u?this.props.onAddSeries:null,onChangeTrackData:this.props.onChangeTrackData,onChangeTrackType:this.props.onChangeTrackType,onCloseTrack:()=>this.props.onCloseTrack(this.state.submenuShown.uid),onConfigureTrack:this.props.onConfigureTrack,onDivideSeries:this.props.onDivideSeries,onExportData:this.props.onExportData,onLockScales:this.props.onLockScales,onTrackOptionsChanged:this.props.onTrackOptionsChanged,orientation:this.state.orientation,parentBbox:o,position:a,series:this.state.submenuShown,theme:this.props.theme,track:c,trackOrientation:this.props.trackOrientation,trackSourceServers:this.props.trackSourceServers})}return E.createElement("div",null)}}]),i}(e));function y7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_7e(i.key),i)}}function b7e(e,t,r){return t&&uY(e.prototype,t),r&&uY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _7e(e){var t=T7e(e,"string");return typeof t=="symbol"?t:String(t)}function T7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NT(){return typeof Reflect<"u"&&Reflect.get?NT=Reflect.get.bind():NT=function(t,r,i){var n=E7e(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?t:i):o.value}},NT.apply(this,arguments)}function E7e(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Kh(e),e!==null););return e}function S7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YD(e,t)}function YD(e,t){return YD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},YD(e,t)}function w7e(e){var t=k7e();return function(){var i=Kh(e),n;if(t){var o=Kh(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return A7e(this,n)}}function A7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O7e(e)}function O7e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Kh(e){return Kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kh(e)}let I7e=function(e){S7e(r,e);var t=w7e(r);function r(i){var n;return y7e(this,r),n=t.call(this,i),n.seriesRefs={},n.seriesListMenu=null,n}return b7e(r,[{key:"componentDidMount",value:function(){NT(Kh(r.prototype),"componentDidMount",this).call(this)}},{key:"render",value:function(){return E.createElement("div",{ref:n=>{this.div=n},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),"data-menu-type":"ConfigTrackMenu",style:{left:this.state.left,top:this.state.top}},VD(this.props.tracks,this.handleItemMouseEnter.bind(this),this.handleMouseLeave.bind(this),null),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{contextMenu:this,onClick:()=>this.props.onLockValueScale(this.props.tracks[0].uid),onMouseEnter:n=>this.handleOtherMouseEnter(n)},"Lock Value Scale With"),E.createElement(St,{contextMenu:this,onClick:()=>this.props.onUnlockValueScale(this.props.tracks[0].uid),onMouseEnter:n=>this.handleOtherMouseEnter(n)},"Unlock Value Scale"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{contextMenu:this,onClick:()=>this.props.onAddSeries(this.props.tracks[0].uid),onMouseEnter:n=>this.handleOtherMouseEnter(n)},"Add Series"),E.createElement(St,{onClick:()=>this.props.onCloseTrack(this.props.tracks[0].uid)},"Close Track"),E.createElement(St,{onClick:()=>{this.props.onReplaceTrack(this.props.tracks[0].uid,this.props.trackOrientation)}},"Replace Track"),this.getSubmenu())}}]),r}(mh(pl).with(cY));function fY(e){return E.createElement("div",null,VD(e.tracks,null,null,e.onCloseTrack),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:()=>e.onCloseTrack(e.tracks[0].uid)},"Close all series"))}fY.propTypes={onCloseTrack:N.func.isRequired,tracks:N.array.isRequired};function C7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,D7e(i.key),i)}}function P7e(e,t,r){return t&&hY(e.prototype,t),r&&hY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function D7e(e){var t=x7e(e,"string");return typeof t=="symbol"?t:String(t)}function x7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function N7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qD(e,t)}function qD(e,t){return qD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},qD(e,t)}function R7e(e){var t=L7e();return function(){var i=MT(e),n;if(t){var o=MT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return M7e(this,n)}}function M7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RT(e)}function RT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function MT(e){return MT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},MT(e)}let ml=function(e){N7e(r,e);var t=R7e(r);function r(i){var n;return C7e(this,r),n=t.call(this,i),n.clickHandlerBound=n.clickHandler.bind(RT(n)),n.contextMenuHandlerBound=n.contextMenuHandler.bind(RT(n)),n.resizeHandlerBound=n.resizeHandler.bind(RT(n)),n}return P7e(r,[{key:"componentDidMount",value:function(){this.popup=document.createElement("div"),document.body.appendChild(this.popup),this.popup.style.zIndex=99,this.popup.style.position="absolute",this.popup.className="hg-popup",document.addEventListener("click",this.clickHandlerBound,!0),document.addEventListener("contextmenu",this.contextMenuHandlerBound,!0),window.addEventListener("resize",this.resizeHandlerBound,!0),this._renderLayer()}},{key:"componentDidUpdate",value:function(){this._renderLayer()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.clickHandlerBound,!0),document.removeEventListener("contextmenu",this.contextMenuHandlerBound,!0),window.removeEventListener("resize",this.resizeHandlerBound,!0),Lr.unmountComponentAtNode(this.popup),document.body.removeChild(this.popup)}},{key:"_renderLayer",value:function(){Lr.render(this.props.children,this.popup)}},{key:"clickHandler",value:function(n){this.popup.contains(n.target)||this.props.onMenuClosed&&this.props.onMenuClosed(n)}},{key:"contextMenuHandler",value:function(n){n.altKey||(n.preventDefault(),this.clickHandler(n))}},{key:"resizeHandler",value:function(){this.props.onMenuClosed(null)}},{key:"render",value:function(){return E.createElement("div",null)}}]),r}(E.Component);ml.defaultProps={onMenuClosed:x5},ml.propTypes={children:N.node.isRequired,onMenuClosed:N.func};const B7e=zL(e=>E.createElement(X3,{className:e.className,controlAlignLeft:e.controlAlignLeft,editable:e.editable,handleConfigTrack:e.handleConfigTrack,handleResizeTrack:e.handleResizeTrack,height:e.height,item:e.item,onAddSeries:e.onAddSeries,onCloseTrack:e.onCloseTrack,onCloseTrackMenuOpened:e.onCloseTrackMenuOpened,onConfigTrackMenuOpened:e.onConfigTrackMenuOpened,resizeHandles:e.resizeHandles,uid:e.uid,width:e.width})),H7e={"vertical-tiled-plot":"_vertical-tiled-plot_f3ho8_1"};function F7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,j7e(i.key),i)}}function $7e(e,t,r){return t&&dY(e.prototype,t),r&&dY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function j7e(e){var t=U7e(e,"string");return typeof t=="symbol"?t:String(t)}function U7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function G7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XD(e,t)}function XD(e,t){return XD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},XD(e,t)}function z7e(e){var t=W7e();return function(){var i=BT(e),n;if(t){var o=BT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return V7e(this,n)}}function V7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LT(e)}function LT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function BT(e){return BT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},BT(e)}function pY(e){return e&&e.sourceEvent}let KD=function(e){G7e(r,e);var t=z7e(r);function r(i){var n;return F7e(this,r),n=t.call(this,i),n.brushBehavior=Pd().on("start",n.brushStarted.bind(LT(n))).on("brush",n.brushed.bind(LT(n))).on("end",n.brushedEnded.bind(LT(n))),n}return $7e(r,[{key:"componentDidMount",value:function(){this.props.isRangeSelectionActive&&this.addBrush()}},{key:"shouldComponentUpdate",value:function(n,o){if(this.rangeSelectionTriggered)return this.rangeSelectionTriggered=!1,this.rangeSelectionTriggeredEnd&&this.props.rangeSelection!==n.rangeSelection&&this.moveBrush(n.rangeSelection[0]?n.rangeSelection[0]:null,!0),this.rangeSelectionTriggeredEnd=!1,this.state!==o;if(this.props.rangeSelection!==n.rangeSelection){const a=this.props.is1dRangeSelection?0:1;return this.moveBrush(n.rangeSelection[a]?n.rangeSelection[a]:null,n.rangeSelectionEnd),this.state!==o}return!0}},{key:"componentDidUpdate",value:function(){this.props.isRangeSelectionActive?this.addBrush():this.removeBrush()}},{key:"addBrush",value:function(){!this.brushEl||this.brushElAddedBefore===this.brushEl||(this.brushElAddedBefore&&this.brushElAddedBefore.on(".brush",null),this.brushEl.call(this.brushBehavior),this.brushElAddedBefore=this.brushEl,Bu(this.brushEl,To["track-range-selection-group-brush-selection"]))}},{key:"brushed",value:function(n){const o=this.rangeSelectionMoved;this.rangeSelectionMoved=!1,!(!pY(n)||!this.props.onRangeSelection||o)&&(this.rangeSelectionTriggered=!0,this.props.onRangeSelection(n.selection))}},{key:"brushStarted",value:function(n){!pY(n)||!n.selection||this.props.onRangeSelectionStart()}},{key:"brushedEnded",value:function(n){if(!this.props.is1dRangeSelection)return;const o=this.rangeSelectionMovedEnd;this.rangeSelectionMovedEnd=!1,n.selection&&n.sourceEvent&&this.props.onRangeSelection&&!o&&(this.rangeSelectionTriggered=!0,this.rangeSelectionTriggeredEnd=!0,this.props.onRangeSelectionEnd(n.selection)),n.selection||(this.rangeSelectionTriggered=!0,this.props.onRangeSelectionReset())}},{key:"moveBrush",value:function(n,o=!1){if(!this.brushEl)return;const a=n?[this.props.scale(n[0]),this.props.scale(n[1])]:null;this.rangeSelectionMoved=!0,this.rangeSelectionMovedEnd=!0,o?this.brushEl.transition().call(this.brushBehavior.move,a):this.brushEl.call(this.brushBehavior.move,a)}},{key:"removeBrush",value:function(){this.brushElAddedBefore&&(this.brushElAddedBefore.call(this.brushBehavior.move,null),this.brushElAddedBefore.on(".brush",null),this.brushElAddedBefore=void 0,this.props.onRangeSelectionReset())}},{key:"render",value:function(){const n=this.props.tracks.map(s=>s.width).reduce(Es,0),o=this.props.tracks.map(s=>Hu(s)).reduce(Xd,!1),a=To[this.props.isRangeSelectionActive?"track-range-selection-active":"track-range-selection"];return E.createElement("div",{className:H7e["vertical-tiled-plot"]},o&&E.createElement("svg",{ref:s=>{this.brushEl=Bt(s)},className:a,style:{height:this.props.height,width:n},xmlns:"http://www.w3.org/2000/svg"}),E.createElement(j0,{axis:"x",className:Zt(Eo.list,Eo.stylizedList,Eo.horizontalList),component:V3,editable:this.props.editable,handleConfigTrack:this.props.handleConfigTrack,handleResizeTrack:this.props.handleResizeTrack,height:this.props.height,helperClass:Eo.stylizedHelper,itemClass:Zt(Eo.stylizedItem,Eo.horizontalItem),itemControlAlignLeft:this.props.tracksControlAlignLeft,itemReactClass:B7e,items:this.props.tracks.map(s=>({configMenuVisible:s.uid===this.props.configTrackMenuId,uid:s.uid||xt.nice(),height:this.props.height,width:s.width,value:s.value})),onAddSeries:this.props.onAddSeries,onCloseTrack:this.props.onCloseTrack,onCloseTrackMenuOpened:this.props.onCloseTrackMenuOpened,onConfigTrackMenuOpened:this.props.onConfigTrackMenuOpened,onSortEnd:this.props.handleSortEnd,referenceAncestor:this.props.referenceAncestor,resizeHandles:this.props.resizeHandles,useDragHandle:!0,width:n}))}}]),r}(E.Component);KD.propTypes={configTrackMenuId:N.string,editable:N.bool,handleConfigTrack:N.func,handleResizeTrack:N.func,handleSortEnd:N.func,is1dRangeSelection:N.bool,isRangeSelectionActive:N.bool,height:N.number,onAddSeries:N.func,onCloseTrack:N.func,onCloseTrackMenuOpened:N.func,onConfigTrackMenuOpened:N.func,onRangeSelection:N.func,onRangeSelectionEnd:N.func,onRangeSelectionReset:N.func,onRangeSelectionStart:N.func,rangeSelection:N.array,rangeSelectionEnd:N.bool,referenceAncestor:N.func,resizeHandles:N.object,scale:N.func,tracks:N.array,tracksControlAlignLeft:N.bool};function Y7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,X7e(i.key),i)}}function q7e(e,t,r){return t&&mY(e.prototype,t),r&&mY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function X7e(e){var t=K7e(e,"string");return typeof t=="symbol"?t:String(t)}function K7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZD(e,t)}function ZD(e,t){return ZD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},ZD(e,t)}function Q7e(e){var t=t3e();return function(){var i=HT(e),n;if(t){var o=HT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return J7e(this,n)}}function J7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return e3e(e)}function e3e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function HT(e){return HT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},HT(e)}let gY=function(e){Z7e(r,e);var t=Q7e(r);function r(){return Y7e(this,r),t.apply(this,arguments)}return q7e(r,[{key:"render",value:function(){const n=VD(this.props.tracks,this.handleItemMouseEnter.bind(this),this.handleMouseLeave.bind(this)),o=this.props.customItems?E.Children.map(this.props.customItems,a=>E.cloneElement(a,{onMouseEnter:s=>{this.handleOtherMouseEnter(s)}})):null;return E.createElement("div",{ref:a=>{this.div=a},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),"data-menu-type":"ViewContextMenu",style:{left:this.state.left,top:this.state.top}},o,o&&E.createElement("hr",{className:mt["context-menu-hr"]}),n,n&&E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:()=>this.props.onAddTrack({type:"horizontal-rule",y:this.props.coords[1],position:"whole"}),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Horizontal Rule"),E.createElement(St,{onClick:()=>this.props.onAddTrack({type:"vertical-rule",x:this.props.coords[0],position:"whole"}),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Vertical Rule"),E.createElement(St,{onClick:()=>this.props.onAddTrack({type:"cross-rule",x:this.props.coords[0],y:this.props.coords[1],position:"whole"}),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Cross Rule"),E.createElement("hr",{className:mt["context-menu-hr"]}),this.hasMatrixTrack(this.props.tracks)&&E.createElement(St,{onClick:this.handleAddHorizontalSection.bind(this),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Horizontal Cross Section"),this.hasMatrixTrack(this.props.tracks)&&E.createElement(St,{onClick:this.handleAddVerticalSection.bind(this),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Vertical Cross Section"),this.getSubmenu())}},{key:"hasMatrixTrack",value:function(n){return yy(this.props.tracks).filter(a=>a.type==="heatmap").length>0}},{key:"handleAddHorizontalSection",value:function(){const o=yy(this.props.tracks).filter(a=>a.type==="heatmap")[0];this.props.onAddTrack({type:"horizontal-rule",y:this.props.coords[1],position:"whole"}),this.props.onAddTrack({data:{type:"horizontal-section",server:o.server,tilesetUid:o.tilesetUid,slicePos:this.props.coords[1]},options:{valueScaling:"log"},type:"horizontal-bar",height:30,position:"top"})}},{key:"handleAddVerticalSection",value:function(){const o=yy(this.props.tracks).filter(a=>a.type==="heatmap")[0];this.props.onAddTrack({type:"vertical-rule",x:this.props.coords[0],position:"whole"}),this.props.onAddTrack({data:{type:"vertical-section",server:o.server,tilesetUid:o.tilesetUid,slicePos:this.props.coords[0]},options:{valueScaling:"log"},type:"vertical-bar",height:30,position:"left"})}}]),r}(mh(pl).with(cY));gY.propTypes={coords:N.array,customItems:N.array};function r3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i3e(i.key),i)}}function n3e(e,t,r){return t&&vY(e.prototype,t),r&&vY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i3e(e){var t=o3e(e,"string");return typeof t=="symbol"?t:String(t)}function o3e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QD(e,t)}function QD(e,t){return QD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},QD(e,t)}function s3e(e){var t=c3e();return function(){var i=FT(e),n;if(t){var o=FT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return l3e(this,n)}}function l3e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return An(e)}function An(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function FT(e){return FT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},FT(e)}let JD=function(e){a3e(r,e);var t=s3e(r);function r(i){var n;r3e(this,r),n=t.call(this,i),n.closing=!1;const{tracks:o}=n.props;return n.canvasElement=null,n.tracksByUidInit={},[...n.props.tracks.top||[],...n.props.tracks.right||[],...n.props.tracks.bottom||[],...n.props.tracks.left||[],...n.props.tracks.gallery||[],...n.props.tracks.center||[]].forEach(a=>{a.type==="combined"?a.contents.forEach(s=>{n.tracksByUidInit[s.uid]=!1}):n.tracksByUidInit[a.uid]=!1}),n.xScale=null,n.yScale=null,n.addUidsToTracks(o),n.trackToReplace=null,n.trackRenderer=null,n.configTrackMenu=null,n.state={sizeMeasured:!1,height:10,width:10,tracks:o,init:!1,addTrackPosition:null,customDialog:null,mouseOverOverlayUid:null,forceUpdate:0,rangeSelection:[null,null],rangeSelectionEnd:!1,chromInfo:null,defaultChromSizes:null,contextMenuCustomItems:null,contextMenuPosition:null,addDivisorDialog:null},n.reset=!0,window.higlassTracksByType&&Object.keys(window.higlassTracksByType).forEach(a=>{dr[a]=window.higlassTracksByType[a].config}),n.topHeight=0,n.bottomHeight=0,n.leftWidth=0,n.rightWidth=0,n.centerHeight=0,n.centerWidth=0,n.dragTimeout=null,n.previousPropsStr="",n.contextMenuHandlerBound=n.contextMenuHandler.bind(An(n)),n.handleNoTrackAddedBound=n.handleNoTrackAdded.bind(An(n)),n.handleTracksAddedBound=n.handleTracksAdded.bind(An(n)),n.closeMenusBound=n.closeMenus.bind(An(n)),n.handleAddDivisorBound=n.handleAddDivisor.bind(An(n)),n.handleAddSeriesBound=n.handleAddSeries.bind(An(n)),n.handleChangeTrackDataBound=n.handleChangeTrackData.bind(An(n)),n.handleChangeTrackTypeBound=n.handleChangeTrackType.bind(An(n)),n.handleCloseTrackBound=n.handleCloseTrack.bind(An(n)),n.handleConfigureTrackBound=n.handleConfigureTrack.bind(An(n)),n.handleExportTrackDataBound=n.handleExportTrackData.bind(An(n)),n.handleLockValueScaleBound=n.handleLockValueScale.bind(An(n)),n.handleReplaceTrackBound=n.handleReplaceTrack.bind(An(n)),n.handleTrackOptionsChangedBound=n.handleTrackOptionsChanged.bind(An(n)),n.handleUnlockValueScaleBound=n.handleUnlockValueScale.bind(An(n)),n.onAddTrack=n.handleAddTrack.bind(An(n)),n}return n3e(r,[{key:"waitForDOMAttachment",value:function(n){if(!this.mounted)return;const o=Lr.findDOMNode(this);document.body.contains(o)?n():requestAnimationFrame(()=>this.waitForDOMAttachment(n))}},{key:"componentDidMount",value:function(){this.mounted=!0,this.element=Lr.findDOMNode(this),this.canvasElement=Lr.findDOMNode(this.props.canvasElement),this.waitForDOMAttachment(()=>{Lv.ElementQueries.listen(),this.resizeSensor=new Lv.ResizeSensor(this.element.parentNode,this.measureSize.bind(this)),this.measureSize()}),this.addEventListeners(),this.pubSubs=[],this.pubSubs.push(this.props.pubSub.subscribe("contextmenu",this.contextMenuHandlerBound))}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){this.addUidsToTracks(n.tracks),this.setState({tracks:n.tracks})}},{key:"shouldComponentUpdate",value:function(n,o){const a=this.previousPropsStr,s=this.updatablePropsToString(n),c=JSON.stringify(this.state),u=JSON.stringify(o),l=a!==s||c!==u||this.props.chooseTrackHandler!==n.chooseTrackHandler||this.props.customDialog!==n.customDialog;l&&(this.previousPropsStr=s);const h=this.numTracks;return this.numTracks=0,La(this.props.tracks,()=>this.numTracks++),this.reset=this.reset||h===0&&this.numTracks>0,this.numTracks||(this.tracksByUidInit={}),l}},{key:"UNSAFE_componentWillUpdate",value:function(){}},{key:"componentDidUpdate",value:function(n,o){if(o.rangeSelection!==this.state.rangeSelection){let a=[null,null];this.state.defaultChromSizes&&this.state.rangeSelection.every(s=>s&&s.length)&&(a=this.state.rangeSelection.map(s=>cy(...s,this.state.defaultChromSizes))),this.props.onRangeSelection({dataRange:this.state.rangeSelection,genomicRange:a})}if(this.state.customDialog||this.props.customDialog){const a=this.state.customDialog||this.props.customDialog;if(a.length>0){const s=[],c=[];a.forEach(u=>{s.push(u.bodyComponent),c.push(u.bodyProps)}),this.props.modal.open(E.createElement($D,{children:s,bodyProps:c,onCancel:this.props.closeCustomDialog,title:a[0].title}))}}if(n.tracks.center,this.props.tracks.center,(this.state.addTrackPosition||this.props.addTrackPosition)&&this.props.modal.open(E.createElement(kT,{host:this.state.addTrackHost,onCancel:this.handleNoTrackAddedBound,onTracksChosen:this.handleTracksAddedBound,position:this.state.addTrackPosition||this.props.addTrackPosition,trackSourceServers:this.props.trackSourceServers})),this.state.addDivisorDialog){const a=this.state.addDivisorDialog;this.props.modal.open(E.createElement(kT,{datatype:dr[a.type].datatype[0],host:this.state.addTrackHost,onCancel:()=>{this.setState({addDivisorDialog:null})},onTracksChosen:s=>{this.handleDivisorChosen(a,s)},trackSourceServers:this.props.trackSourceServers}))}}},{key:"componentWillUnmount",value:function(){this.closing=!0,this.removeEventListeners(),this.pubSubs.forEach(n=>this.props.pubSub.unsubscribe(n))}},{key:"addUidsToTracks",value:function(n){Object.keys(n).forEach(o=>{n[o].forEach(a=>{a.uid=a.uid||xt.nice()})})}},{key:"contextMenuHandler",value:function(n){if(!this.divTiledPlot)return;const o=this.divTiledPlot.getBoundingClientRect();if(!QS(n.clientX,n.clientY,o.left,o.left+o.width,o.top,o.top+o.height))return;const s=[n.clientX,n.clientY],c=lr(n,this.divTiledPlot),u=this.trackRenderer.zoomedXScale.invert(c[0]),l=this.trackRenderer.zoomedYScale.invert(c[1]);let h=null;n.hgCustomItems&&(h=n.hgCustomItems.map(f=>E.createElement(St,{key:f.key,onClick:f.onClick},f.text))),this.setState({contextMenuCustomItems:h,contextMenuPosition:{left:s[0],top:s[1],canvasLeft:c[0]+this.trackRenderer.xPositionOffset,canvasTop:c[1]+this.trackRenderer.yPositionOffset},contextMenuDataX:u,contextMenuDataY:l})}},{key:"measureSize",value:function(){this.element.clientWidth>0&&this.element.clientHeight>0&&this.setState({sizeMeasured:!0,width:this.element.clientWidth,height:this.element.clientHeight})}},{key:"handleTrackOptionsChanged",value:function(n,o){return this.props.onTrackOptionsChanged(n,o)}},{key:"handleScalesChanged",value:function(n,o){this.xScale=n,this.yScale=o,this.props.onScalesChanged(n,o)}},{key:"handleTilesetInfoReceived",value:function(n,o){const a=Ci(this.props.tracks,n);if(!a){console.warn("Strange, track not found:",n);return}this.tracksByUidInit[a.uid]=!0,this.checkAllTilesetInfoReceived(),a.options||(a.options={}),a.name=o.name,a.maxWidth=o.max_width,a.transforms=o.transforms,a.aggregationModes=o.aggregation_modes,a.header=o.header,a.binsPerDimension=o.bins_per_dimension,o.resolutions?(a.maxZoom=o.resolutions.length-1,a.resolutions=o.resolutions):a.maxZoom=o.max_zoom,a.coordSystem=o.coordSystem,a.datatype=o.datatype}},{key:"checkAllTilesetInfoReceived",value:function(){if(this.state.init&&!this.reset||!this.trackRenderer||!this.props.zoomToDataExtentOnInit())return;const n=Object.keys(this.trackRenderer.trackDefObjects).map(a=>{const s=this.trackRenderer.trackDefObjects[a].trackObject;return s.childTracks?s.childTracks:s}).reduce((a,s)=>a.concat(s),[]).filter(({tilesetInfo:a})=>typeof a<"u"&&a!==!0),o=Object.values(this.tracksByUidInit).filter(a=>a).length;n.length===o&&(this.setState({init:!0}),this.reset=!1,this.handleZoomToData())}},{key:"handleOverlayMouseEnter",value:function(n){this.setState({mouseOverOverlayUid:n})}},{key:"handleOverlayMouseLeave",value:function(n){n===this.state.mouseOverOverlayUid&&this.setState({mouseOverOverlayUid:null})}},{key:"handleTrackPositionChosen",value:function(n){this.setState({mouseOverOverlayUid:null}),this.props.chooseTrackHandler(n.track.uid)}},{key:"handleNoTrackAdded",value:function(){this.trackToReplace=null,this.props.onNoTrackAdded(),this.setState({addTrackPosition:null,addTrackHost:null})}},{key:"handleAddDivisor",value:function(n){this.setState({addDivisorDialog:n})}},{key:"handleDivisorChosen",value:function(n,o){this.setState({addDivisorDialog:null});const a=n.data?{server:n.data.server,tilesetUid:n.data.tilesetUid}:{server:n.server,tilesetUid:n.tilesetUid},s={server:o[0].server,tilesetUid:o[0].uuid};this.handleChangeTrackData(n.uid,{type:"divided",children:[a,s]})}},{key:"handleDivideSeries",value:function(n){}},{key:"handleAddSeries",value:function(n){const o=qd(this.props.tracks,n),a=Ci(this.props.tracks,n);this.setState({addTrackPosition:o,addTrackHost:a})}},{key:"handleReplaceTrack",value:function(n,o){this.trackToReplace=n,this.handleAddTrack(o)}},{key:"handleAddTrack",value:function(n){this.setState({addTrackPosition:n,addTrackHost:null})}},{key:"handleResizeTrack",value:function(n,o,a){const{tracks:s}=this.state;for(const c in s){const l=s[c].filter(h=>h.uid===n);l.length>0&&(l[0].width=o,l[0].height=a)}this.setState({tracks:s,forceUpdate:Math.random()}),this.props.onResizeTrack()}},{key:"closeMenus",value:function(){this.setState({closeTrackMenuId:null,configTrackMenuId:null,contextMenuPosition:null,contextMenuCustomItems:null})}},{key:"handleLockValueScale",value:function(n){this.closeMenus(),this.props.onLockValueScale(n)}},{key:"handleUnlockValueScale",value:function(n){this.closeMenus(),this.props.onUnlockValueScale(n)}},{key:"handleCloseTrack",value:function(n){this.closeMenus(),this.props.onCloseTrack(n)}},{key:"handleChangeTrackType",value:function(n,o){this.closeMenus(),this.props.onChangeTrackType(n,o)}},{key:"handleChangeTrackData",value:function(n,o){this.closeMenus(),this.props.onChangeTrackData(n,o)}},{key:"handleTracksAdded",value:function(n,o,a){return this.trackToReplace&&(this.handleCloseTrack(this.trackToReplace),this.trackToReplace=null),this.props.onTracksAdded(n,o,a),this.setState({addTrackPosition:null,addTrackHost:null}),n}},{key:"handleCloseTrackMenuOpened",value:function(n,o){this.setState({closeTrackMenuId:n,closeTrackMenuLocation:o})}},{key:"handleCloseContextMenu",value:function(){this.setState({contextMenuCustomItems:null,contextMenuPosition:null,contextMenuDataX:null,contextMenuDataY:null})}},{key:"handleCloseTrackMenuClosed",value:function(){this.setState({closeTrackMenuId:null})}},{key:"handleConfigTrackMenuOpened",value:function(n,o){this.closeMenus(),this.setState({configTrackMenuId:n,configTrackMenuLocation:o})}},{key:"handleConfigureTrack",value:function(n,o){this.setState({configTrackMenuId:null,trackOptions:{track:n,configComponent:o}}),this.closeMenus()}},{key:"handleSortEnd",value:function(n){this.setState(o=>{const a=o.tracks,s={};for(let c=0;c<n.length;c++)s[n[c].uid]=c;for(const c in a){const u=a[c];if(u.length&&u[0].uid in s){const l=new Array(u.length);for(let h=0;h<u.length;h++)l[s[u[h].uid]]=u[h];a[c]=l}}return{tracks:a,forceUpdate:Math.random()}})}},{key:"createTracksAndLocations",value:function(){const n=[],{tracks:o}=this.state;return MS.forEach(a=>{o[a]&&o[a].forEach(s=>{s.contents&&s.contents.forEach(c=>{c.position=a}),s.position=a,n.push({track:s,location:a})})}),n}},{key:"calculateTrackPosition",value:function(n,o){let a=this.props.paddingTop,s=this.props.paddingBottom,c=this.props.paddingLeft,u=this.props.paddingRight,l=this.centerWidth,h=n.height,f=0,d=0;switch(o){case"top":c+=this.leftWidth;for(let p=0;p<this.state.tracks.top.length&&this.state.tracks.top[p].uid!==n.uid;p++)a+=this.state.tracks.top[p].height;break;case"bottom":c+=this.leftWidth,a+=this.topHeight+this.centerHeight+this.galleryDim;for(let p=0;p<this.state.tracks.bottom.length&&this.state.tracks.bottom[p].uid!==n.uid;p++)a+=this.state.tracks.bottom[p].height;break;case"left":a+=this.topHeight,l=n.width,h=this.centerHeight;for(let p=0;p<this.state.tracks.left.length&&this.state.tracks.left[p].uid!==n.uid;p++)c+=this.state.tracks.left[p].width;break;case"right":c+=this.leftWidth+this.centerWidth+this.galleryDim,a+=this.topHeight,l=n.width,h=this.centerHeight;for(let p=0;p<this.state.tracks.right.length&&this.state.tracks.right[p].uid!==n.uid;p++)c+=this.state.tracks.right[p].width;break;case"center":c+=this.leftWidth,a+=this.topHeight,h=this.centerHeight;break;case"gallery":c+=this.leftWidthNoGallery,a+=this.topHeightNoGallery,l=this.state.width-this.leftWidthNoGallery-this.rightWidthNoGallery-this.props.paddingLeft,h=this.state.height-this.topHeightNoGallery-this.bottomHeightNoGallery-this.props.paddingTop,f=this.galleryDim,d=this.galleryDim;for(let p=0;p<this.state.tracks.gallery.length&&this.state.tracks.gallery[p].uid!==n.uid;p++)l-=2*this.state.tracks.gallery[p].height,h-=2*this.state.tracks.gallery[p].height,c+=this.state.tracks.gallery[p].height,a+=this.state.tracks.gallery[p].height,f-=this.state.tracks.gallery[p].height,d-=this.state.tracks.gallery[p].height;for(let p=0;p<this.state.tracks.right.length;p++)u+=this.state.tracks.right[p].width;for(let p=0;p<this.state.tracks.bottom.length;p++)s+=this.state.tracks.bottom[p].height;n.offsetX=f,n.offsetY=d,n.offsetTop=a,n.offsetRight=u,n.offsetBottom=s,n.offsetLeft=c;break;case"whole":default:l=this.leftWidth+this.centerWidth+this.rightWidth,h=this.topHeight+this.centerHeight+this.bottomHeight}return MS.indexOf(o)===-1&&console.warn("Track with unknown position present:",o,n),{left:c,top:a,width:l,height:h,track:n}}},{key:"findCentralHeatmapTrack",value:function(n){for(let o=0;o<n.length;o++){if(n[o].type==="combined")return this.findCentralHeatmapTrack(n[o].contents);if(n[o].type==="heatmap")return n[o]}}},{key:"trackUuidToOrientation",value:function(n){}},{key:"overlayTracks",value:function(n){return this.props.overlays?this.props.overlays.filter(a=>a.includes&&a.includes.length).map(a=>{const s=a.type?`overlay-${a.type}-track`:"overlay-track",c={...a,uid:a.uid||xt.nice(),includes:a.includes,type:s,options:Object.assign(a.options,{orientationsAndPositions:a.includes.map(u=>{const l=Ci(this.props.tracks,u);if(!l)return console.warn(`OverlayTrack included uid (${u}) not found in the track list`),null;const h=qd(this.props.tracks,l.uid);let f;if((h==="top"||h==="bottom")&&(f="1d-horizontal"),(h==="left"||h==="right")&&(f="1d-vertical"),h==="center"&&(f="2d"),!f)return console.warn("Only top, bottom, left, right, or center tracks can be overlaid at the moment"),null;const d=n.filter(m=>m.track.uid===u);if(!d.length)return null;const p={left:d[0].left-this.props.paddingLeft,top:d[0].top-this.props.paddingTop,width:d[0].width,height:d[0].height};return{orientation:f,position:p}}).filter(u=>u)})};return{top:this.props.paddingTop,left:this.props.paddingLeft,width:this.leftWidth+this.centerWidth+this.rightWidth,height:this.topHeight+this.centerHeight+this.bottomHeight+this.props.marginTop+this.props.marginBottom,track:c}}):[]}},{key:"positionedTracks",value:function(){return this.createTracksAndLocations().map(({track:o,location:a})=>this.calculateTrackPosition(o,a))}},{key:"createTrackPositionTexts",value:function(){const n=this.positionedTracks();return this.createTracksAndLocations(),n.map(a=>{const{track:s}=a;return E.createElement("div",{key:s.uid,style:{left:a.left,top:a.top,width:a.width,height:a.height,position:"absolute"}},s.uid.slice(0,2))})}},{key:"handleExportTrackData",value:function(n,o){const a=Ci(this.props.tracks,o);let s=null;n!==o?s=this.trackRenderer.trackDefObjects[n].trackObject.createdTracks[a.uid]:{trackObject:s}=this.trackRenderer.trackDefObjects[n],s.exportData(),this.closeMenus()}},{key:"listTracksAtPosition",value:function(n,o,a=!1){const s=[];if(!this.trackRenderer)return[];for(const c in this.trackRenderer.trackDefObjects){const u=this.trackRenderer.trackDefObjects[c].trackObject;if(u.respondsToPosition(n,o))if(a){if(this.props.tracks.center)if(this.props.tracks.center.contents)for(let l=0;l<this.props.tracks.center.contents.length;l++)this.props.tracks.center.contents[l].uid===c&&(u.is2d=!0);else this.props.tracks.center&&this.props.tracks.center.length&&this.props.tracks.center[0].uid===c&&(u.is2d=!0);s.push(u)}else s.push(this.trackRenderer.trackDefObjects[c].trackDef.track)}return s}},{key:"listAllTrackObjects",value:function(){const n=[];for(const o in this.trackRenderer.trackDefObjects){const a=this.trackRenderer.trackDefObjects[o];if(a.trackObject.createdTracks)for(const s in a.trackObject.createdTracks){const c=a.trackObject.createdTracks[s];n.push(c)}else n.push(a.trackObject)}return n}},{key:"handleZoomToData",value:function(){const n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=[n,n],s=[o,o],c=this.listAllTrackObjects();for(const d of c)if(d.tilesetInfo&&d.tilesetInfo.min_pos)for(let p=0;p<d.tilesetInfo.min_pos.length;p++)d.tilesetInfo.min_pos[p]<a[p]&&(a[p]=d.tilesetInfo.min_pos[p]),d.tilesetInfo.max_pos[p]>s[p]&&(s[p]=d.tilesetInfo.max_pos[p]);const u=this.trackRenderer.currentProps.paddingLeft+this.trackRenderer.currentProps.leftWidth;let l=[u,u+this.trackRenderer.currentProps.centerWidth].map(this.trackRenderer.zoomTransform.rescaleX(this.trackRenderer.xScale).invert);const h=this.trackRenderer.currentProps.paddingTop+this.trackRenderer.currentProps.topHeight;let f=[h,h+this.trackRenderer.currentProps.centerHeight].map(this.trackRenderer.zoomTransform.rescaleY(this.trackRenderer.yScale).invert);this.trackRenderer.zoomTransform.k=1,this.trackRenderer.zoomTransform.x=0,this.trackRenderer.zoomTransform.y=0,this.trackRenderer.applyZoomTransform(),a[0]<Number.MAX_SAFE_INTEGER&&s[0]>Number.MIN_SAFE_INTEGER&&(l=[a[0],s[0]]),a[1]<Number.MAX_SAFE_INTEGER&&s[1]>Number.MIN_SAFE_INTEGER&&(f=[a[1],s[1]]),this.props.onDataDomainChanged(l,f)}},{key:"resetViewport",value:function(){this.trackRenderer.zoomTransform.k=1,this.trackRenderer.zoomTransform.x=0,this.trackRenderer.zoomTransform.y=0,this.trackRenderer.applyZoomTransform(),this.props.onDataDomainChanged(this.props.initialXDomain,this.props.initialYDomain)}},{key:"updatablePropsToString",value:function(n){return JSON.stringify({tracks:n.tracks,overlays:n.overlays,viewOptions:n.viewOptions,uid:n.uid,addTrackPosition:n.addTrackPosition,editable:n.editable,marginTop:n.marginTop,marginBottom:n.marginBottom,marginLeft:n.marginLeft,marginRight:n.marginRight,paddingTop:n.paddingTop,paddingBottom:n.paddingBottom,paddingLeft:n.paddingLeft,paddingRight:n.paddingRight,mouseTool:n.mouseTool,initialXDomain:n.initialXDomain,initialYDomain:n.initialYDomain,trackSourceServers:n.trackSourceServers,zoomable:n.zoomable,draggingHappening:n.draggingHappening})}},{key:"getXYScales",value:function(){this.trackRenderer&&(this.xScale=this.trackRenderer.currentXScale,this.yScale=this.trackRenderer.currentYScale)}},{key:"rangeViewToDataLoci",value:function(n,o){return o?[parseInt(o.invert(n[0]),10),parseInt(o.invert(n[1]),10)]:[null,null]}},{key:"rangeSelectionResetHandler",value:function(){this.state.rangeSelectionMaster&&this.setState({is1dRangeSelection:null,rangeSelection:[null,null],rangeSelectionMaster:null,rangeSelectionEnd:!1})}},{key:"rangeSelection1dEndHandler",value:function(n){(!this.xScale||!this.yScale)&&this.getXYScales();const o=n==="x"?this.xScale:this.yScale;return a=>{this.setState(s=>{const c=s.is1dRangeSelection?[null,null]:s.rangeSelection.slice(),u=!this.state.is1dRangeSelection&&n==="y"?1:0;let l=this.rangeViewToDataLoci(a,o);const h=l[1]-l[0];if(this.props.rangeSelection1dSize[0]>h){const f=l[0]+h/2;l=[f-this.props.rangeSelection1dSize[0]/2,f+this.props.rangeSelection1dSize[0]/2]}else if(this.props.rangeSelection1dSize[1]<h){const f=l[0]+h/2;l=[f-this.props.rangeSelection1dSize[1]/2,f+this.props.rangeSelection1dSize[1]/2]}return c[u]=l,this.props.rangeSelectionToInt&&(c[u]=c[u].map(f=>Math.round(f))),{rangeSelection:c,rangeSelectionEnd:!0}})}}},{key:"rangeSelection1dHandler",value:function(n){(!this.xScale||!this.yScale)&&this.getXYScales();const o=n==="x"?this.xScale:this.yScale;return a=>{this.setState(s=>{const c=s.is1dRangeSelection?[null,null]:s.rangeSelection.slice(),u=!s.is1dRangeSelection&&n==="y"?1:0;return c[u]=this.rangeViewToDataLoci(a,o),{rangeSelection:c,rangeSelectionEnd:!1}})}}},{key:"rangeSelection1dStartHandler",value:function(){this.state.rangeSelectionMaster||this.setState({is1dRangeSelection:!0,rangeSelectionMaster:!0,rangeSelectionEnd:!1})}},{key:"rangeSelection2dHandler",value:function(n){(!this.xScale||!this.yScale)&&this.getXYScales(),this.setState({rangeSelection:[this.rangeViewToDataLoci(n[0],this.xScale),this.rangeViewToDataLoci(n[1],this.yScale)],rangeSelectionEnd:!1})}},{key:"rangeSelection2dStartHandler",value:function(){this.state.rangeSelectionMaster||this.setState({is1dRangeSelection:!1,rangeSelectionMaster:!0,rangeSelectionEnd:!1})}},{key:"rangeSelection2dEndHandler",value:function(n){(!this.xScale||!this.yScale)&&this.getXYScales();const o=this.rangeViewToDataLoci(n[0],this.xScale),a=this.rangeViewToDataLoci(n[1],this.yScale);let s=[o,a];const c=o[1]-o[0],u=a[1]-a[0],l=[c,u];s.forEach((h,f)=>{if(this.props.rangeSelection1dSize[0]>l[f]){const d=h[0]+Math.round(l[f]/2);h[0]=d-this.props.rangeSelection1dSize[0]/2,h[1]=d+this.props.rangeSelection1dSize[0]/2}else if(this.props.rangeSelection1dSize[1]<l[f]){const d=h[0]+Math.round(l[f]/2);h[0]=d-this.props.rangeSelection1dSize[1]/2,h[1]=d+this.props.rangeSelection1dSize[1]/2}}),this.props.rangeSelectionToInt&&(s=s.map(h=>h.map(f=>Math.round(f)))),this.setState({rangeSelection:s,rangeSelectionEnd:!0})}},{key:"getContextMenu",value:function(){if(this.state.contextMenuPosition){const n=this.listTracksAtPosition(this.state.contextMenuPosition.canvasLeft,this.state.contextMenuPosition.canvasTop);return E.createElement(ml,{onMenuClosed:this.closeMenusBound},E.createElement(gY,{closeMenu:this.closeMenusBound,coords:[this.state.contextMenuDataX,this.state.contextMenuDataY],customItems:this.state.contextMenuCustomItems,onAddDivisor:this.handleAddDivisorBound,onAddSeries:this.handleAddSeriesBound,onAddTrack:o=>{this.props.onTracksAdded([o],o.position,null),this.handleCloseContextMenu()},onChangeTrackData:this.handleChangeTrackDataBound,onChangeTrackType:this.handleChangeTrackTypeBound,onCloseTrack:this.handleCloseTrackBound,onConfigureTrack:this.handleConfigureTrackBound,onExportData:this.handleExportTrackDataBound,onLockValueScale:this.handleLockValueScaleBound,onReplaceTrack:this.handleReplaceTrackBound,onTrackOptionsChanged:this.handleTrackOptionsChangedBound,onUnlockValueScale:this.handleUnlockValueScaleBound,orientation:"right",position:this.state.contextMenuPosition,theme:this.props.theme,tracks:n,trackSourceServers:this.props.trackSourceServers}))}return null}},{key:"getIdealizedTrackPositionsOverlay",value:function(){const n=this.props.draggingHappening,o=n.datatype;if(!(o in Ud)&&!n.defaultTracks){console.warn("unknown data type:",n.higlassTrack);return}const a={"1d-horizontal":["top","bottom","left","right"],"2d":["center"],"1d-vertical":["left","right"]},s=Ud[o]||{};if(n.defaultTracks)for(const w of n.defaultTracks)if(!dr[w])console.warn("unknown track type",w);else for(const L of a[dr[w].orientation])s[L]=w;const c=new Set(["top","left","right","center","bottom"].filter(w=>w in this.state.tracks&&this.state.tracks[w].length)),u="top"in s,l="left"in s,h="right"in s,f="bottom"in s,d="center"in s,p="center"in s||c.has("left")||c.has("right")||c.has("center"),m="top"in s,g="bottom"in s&&p,v="left"in s&&p,_="right"in s&&p,y=Object.keys(s).length&&("center"in s||p),b=E.createElement("div",{style:{flexGrow:1}}),T=E.cloneElement(b),S=E.createElement("div",{style:{display:"flex",flexGrow:1}},m&&(y||v)?b:null,E.createElement(r_,{defaultTrackType:s.top,draggingHappening:this.props.draggingHappening,enabled:u,onTrackDropped:w=>this.handleTracksAdded([w],"top"),style:{border:"1px solid black",flexGrow:1}}),m&&(y||v)?T:null),k=E.createElement("div",{style:{display:"flex",flexGrow:1}},m&&(y||v)?b:null,E.createElement(r_,{defaultTrackType:s.bottom,draggingHappening:this.props.draggingHappening,enabled:f,onTrackDropped:w=>this.handleTracksAdded([w],"bottom"),style:{border:"1px solid black",flexGrow:1}}),m&&(y||v)?T:null),O=E.createElement(r_,{defaultTrackType:s.left,draggingHappening:this.props.draggingHappening,enabled:l,onTrackDropped:w=>this.handleTracksAdded([w],"left"),style:{border:"1px solid black",flexGrow:1}}),D=E.createElement(r_,{defaultTrackType:s.center,draggingHappening:this.props.draggingHappening,enabled:d,onTrackDropped:w=>this.handleTracksAdded([w],"center"),position:"center",style:{border:"1px solid black",flexGrow:1}}),M=E.cloneElement(O,{defaultTrackType:s.right,enabled:h,onTrackDropped:w=>this.handleTracksAdded([w],"right")});return E.createElement("div",{style:{position:"absolute",left:"0px",top:"0px",width:this.state.width,height:this.state.height}},E.createElement("div",{style:{position:"absolute",width:this.state.width,height:this.state.height,background:"white",opacity:.4}}),E.createElement("div",{style:{width:this.state.width,height:this.state.height,position:"absolute",display:"flex",flexDirection:"column"}},m?S:null,p&&E.createElement("div",{style:{display:"flex",height:m||g?"40%":"100%",width:"100%"}},v?O:null,y?D:null,_?M:null),g?k:null))}},{key:"render",value:function(){this.galleryDim=this.props.tracks.gallery?this.props.tracks.gallery.map(y=>y.height).reduce(Es,0):0,this.topHeightNoGallery=this.props.tracks.top.map(y=>y.height).reduce(Es,0),this.topHeight=this.topHeightNoGallery+this.galleryDim,this.bottomHeightNoGallery=this.props.tracks.bottom.map(y=>y.height).reduce(Es,0),this.bottomHeight=this.bottomHeightNoGallery+this.galleryDim,this.leftWidthNoGallery=this.props.tracks.left.map(y=>y.width).reduce(Es,0),this.leftWidth=this.leftWidthNoGallery+this.galleryDim,this.rightWidthNoGallery=this.props.tracks.right.map(y=>y.width).reduce(Es,0),this.rightWidth=this.rightWidthNoGallery+this.galleryDim;const n=this.props.paddingTop+this.props.paddingBottom,o=this.props.paddingLeft+this.props.paddingRight;this.centerHeight=Math.max(0,this.state.height-this.topHeight-this.bottomHeight-n),this.centerWidth=Math.max(0,this.state.width-this.leftWidth-this.rightWidth-o);const a="none",s=E.createElement("div",{className:"top-track-container",style:{left:this.leftWidth+this.props.paddingLeft,top:this.props.paddingTop,width:this.centerWidth,height:this.topHeightNoGallery,outline:a,position:"absolute"}},E.createElement(K0,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,handleConfigTrack:this.handleConfigTrackMenuOpened.bind(this),handleResizeTrack:this.handleResizeTrack.bind(this),handleSortEnd:this.handleSortEnd.bind(this),is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelection:this.rangeSelection1dHandler("x").bind(this),onRangeSelectionEnd:this.rangeSelection1dEndHandler("x").bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection1dStartHandler.bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,resizeHandles:new Set(["bottom"]),scale:this.xScale,tracks:this.props.tracks.top,width:this.centerWidth})),c=E.createElement("div",{className:"left-track-container",style:{left:this.props.paddingLeft,top:this.topHeight+this.props.paddingTop,width:this.leftWidthNoGallery,height:this.centerHeight,outline:a,position:"absolute"}},E.createElement(KD,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,handleConfigTrack:this.handleConfigTrackMenuOpened.bind(this),handleResizeTrack:this.handleResizeTrack.bind(this),handleSortEnd:this.handleSortEnd.bind(this),height:this.centerHeight,is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelection:this.rangeSelection1dHandler("y").bind(this),onRangeSelectionEnd:this.rangeSelection1dEndHandler("y").bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection1dStartHandler.bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,resizeHandles:new Set(["right"]),scale:this.yScale,tracks:this.props.tracks.left})),u=E.createElement("div",{className:"right-track-container",style:{right:this.props.paddingRight,top:this.topHeight+this.props.paddingTop,width:this.rightWidthNoGallery,height:this.centerHeight,outline:a,position:"absolute"}},E.createElement(KD,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,handleConfigTrack:this.handleConfigTrackMenuOpened.bind(this),handleResizeTrack:this.handleResizeTrack.bind(this),handleSortEnd:this.handleSortEnd.bind(this),height:this.centerHeight,is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelection:this.rangeSelection1dHandler("y").bind(this),onRangeSelectionEnd:this.rangeSelection1dEndHandler("y").bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection1dStartHandler.bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,resizeHandles:new Set(["left"]),scale:this.yScale,tracks:this.props.tracks.right,tracksControlAlignLeft:!0})),l=E.createElement("div",{className:"bottom-track-container",style:{left:this.leftWidth+this.props.paddingLeft,bottom:this.props.paddingBottom,width:this.centerWidth,height:this.bottomHeightNoGallery,outline:a,position:"absolute"}},E.createElement(K0,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,handleConfigTrack:this.handleConfigTrackMenuOpened.bind(this),handleResizeTrack:this.handleResizeTrack.bind(this),handleSortEnd:this.handleSortEnd.bind(this),is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelection:this.rangeSelection1dHandler("x").bind(this),onRangeSelectionEnd:this.rangeSelection1dEndHandler("x").bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection1dStartHandler.bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,resizeHandles:new Set(["top"]),scale:this.xScale,tracks:this.props.tracks.bottom,width:this.centerWidth})),h=E.createElement("div",{key:"galleryTracksDiv",className:"gallery-track-container",style:{left:this.leftWidthNoGallery+this.props.paddingLeft,top:this.topHeightNoGallery+this.props.paddingTop,width:this.centerWidth+2*this.galleryDim,height:this.centerHeight+2*this.galleryDim,outline:a,position:"absolute"}},E.createElement(x4,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,height:this.centerHeight+2*this.galleryDim,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),tracks:this.props.tracks.gallery,width:this.centerWidth+2*this.galleryDim}));let f=E.createElement("div",{className:["center-track-container",ck["center-track-container"]].join(" "),style:{left:this.leftWidth+this.props.paddingLeft,top:this.topHeight+this.props.paddingTop,width:this.centerWidth,height:this.bottomHeight,outline:a}});this.props.tracks.center.length&&(f=E.createElement("div",{className:["center-track-container",ck["center-track-container"]].join(" "),style:{left:this.leftWidth+this.props.paddingLeft,top:this.topHeight+this.props.paddingTop,width:this.centerWidth,height:this.centerHeight,outline:a}},E.createElement(fk,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,height:this.centerHeight,is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection2dStartHandler.bind(this),onRangeSelectionX:this.rangeSelection1dHandler("x").bind(this),onRangeSelectionXEnd:this.rangeSelection1dEndHandler("x").bind(this),onRangeSelectionXY:this.rangeSelection2dHandler.bind(this),onRangeSelectionXYEnd:this.rangeSelection2dEndHandler.bind(this),onRangeSelectionY:this.rangeSelection1dHandler("y").bind(this),onRangeSelectionYEnd:this.rangeSelection1dEndHandler("y").bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,scaleX:this.xScale,scaleY:this.yScale,tracks:this.props.tracks.center,uid:this.props.tracks.center[0].uid,width:this.centerWidth}))),this.createTrackPositionTexts();let d=this.positionedTracks();d=d.concat(this.overlayTracks(d));let p=null;this.state.sizeMeasured&&(p=E.createElement(K8e,{ref:y=>{this.trackRenderer=y,this.checkAllTilesetInfoReceived()},canvasElement:this.canvasElement,centerHeight:this.centerHeight,centerWidth:this.centerWidth,disableTrackMenu:this.props.disableTrackMenu,dragging:this.props.dragging,galleryDim:this.galleryDim,getLockGroupExtrema:this.props.getLockGroupExtrema,height:this.state.height,initialXDomain:this.props.initialXDomain,initialYDomain:this.props.initialYDomain,isRangeSelection:this.props.mouseTool===Wi,isShowGlobalMousePosition:this.props.isShowGlobalMousePosition,isValueScaleLocked:this.props.isValueScaleLocked,leftWidth:this.leftWidth,leftWidthNoGallery:this.leftWidthNoGallery,metaTracks:this.props.metaTracks,onMouseMoveZoom:this.props.onMouseMoveZoom,onNewTilesLoaded:this.props.onNewTilesLoaded,onScalesChanged:this.handleScalesChanged.bind(this),onTilesetInfoReceived:this.handleTilesetInfoReceived.bind(this),onTrackOptionsChanged:this.handleTrackOptionsChanged.bind(this),onValueScaleChanged:this.props.onValueScaleChanged,paddingLeft:this.props.paddingLeft,paddingTop:this.props.paddingTop,pixiRenderer:this.props.pixiRenderer,pixiStage:this.props.pixiStage,pluginDataFetchers:this.props.pluginDataFetchers,pluginTracks:this.props.pluginTracks,positionedTracks:d,registerDraggingChangedListener:this.props.registerDraggingChangedListener,removeDraggingChangedListener:this.props.removeDraggingChangedListener,setCentersFunction:this.props.setCentersFunction,svgElement:this.props.svgElement,topHeight:this.topHeight,topHeightNoGallery:this.topHeightNoGallery,uid:this.props.uid,viewOptions:this.props.viewOptions,width:this.state.width,xDomainLimits:this.props.xDomainLimits,yDomainLimits:this.props.yDomainLimits,zoomable:this.props.zoomable,zoomLimits:this.props.zoomLimits},s,c,u,l,h,f));let m=null,g=null;this.state.configTrackMenuId&&(m=E.createElement(ml,{onMenuClosed:this.closeMenusBound},E.createElement(I7e,{ref:y=>{this.configTrackMenu=y},closeMenu:this.closeMenusBound,onAddDivisor:this.handleAddDivisorBound,onAddSeries:this.handleAddSeriesBound,onAddTrack:this.handleAddTrackBound,onChangeTrackType:this.handleChangeTrackTypeBound,onCloseTrack:this.handleCloseTrackBound,onConfigureTrack:this.handleConfigureTrackBound,onExportData:this.handleExportTrackDataBound,onLockValueScale:this.handleLockValueScaleBound,onReplaceTrack:this.handleReplaceTrackBound,onTrackOptionsChanged:this.handleTrackOptionsChangedBound,onUnlockValueScale:this.handleUnlockValueScaleBound,position:this.state.configTrackMenuLocation,theme:this.props.theme,trackOrientation:qd(this.props.tracks,this.state.configTrackMenuId),tracks:[Ci(this.props.tracks,this.state.configTrackMenuId)]}))),this.state.closeTrackMenuId&&(g=E.createElement(ml,{onMenuClosed:this.handleCloseTrackMenuClosed.bind(this)},E.createElement(pl,{position:this.state.closeTrackMenuLocation,theme:this.props.theme},E.createElement(fY,{onCloseTrack:this.handleCloseTrack.bind(this),tracks:[Ci(this.props.tracks,this.state.closeTrackMenuId)]}))));let v=null;this.props.chooseTrackHandler&&(v=d.filter(y=>y.track.position!=="whole").map(y=>{let b="transparent",T="none";return this.state.mouseOverOverlayUid===y.track.uid&&(b="yellow",T="1px solid black"),E.createElement("div",{key:y.track.uid,className:"tiled-plot-track-overlay",onClick:()=>this.handleTrackPositionChosen(y),onDragEnter:S=>{this.handleOverlayMouseEnter(y.track.uid),S.preventDefault()},onDragLeave:()=>this.handleOverlayMouseLeave(y.track.uid),onDragOver:S=>S.preventDefault(),onDrop:()=>this.handleTrackPositionChosen(y),onMouseEnter:()=>this.handleOverlayMouseEnter(y.track.uid),onMouseLeave:()=>this.handleOverlayMouseLeave(y.track.uid),style:{position:"absolute",left:y.left,top:y.top,width:y.width,height:y.height,background:b,opacity:.4,border:T,zIndex:1}})}));let _=null;if(this.xScale&&this.yScale&&this.props.editable&&this.state.trackOptions){const y=this.state.trackOptions.configComponent,b=this.state.trackOptions.track;_=E.createElement(y,{track:b,xScale:this.xScale,yScale:this.yScale,onCancel:()=>{this.setState({trackOptions:null})},onTrackOptionsChanged:T=>T,onSubmit:T=>{this.handleTrackOptionsChanged(this.state.trackOptions.track.uid,T),this.setState({trackOptions:null})}})}return E.createElement("div",{ref:y=>{this.divTiledPlot=y},className:["tiled-plot-div",Eo["tiled-plot"]].join(" "),style:{marginBottom:this.props.marginBottom,marginLeft:this.props.marginLeft,marginRight:this.props.marginRight,marginTop:this.props.marginTop}},p,v,m,g,_,this.getContextMenu(),this.props.draggingHappening&&this.getIdealizedTrackPositionsOverlay())}},{key:"addEventListeners",value:function(){this.eventListeners=[],this.eventListeners.forEach(n=>document.addEventListener(n.name,n.callback,!1))}},{key:"removeEventListeners",value:function(){this.eventListeners.forEach(n=>document.removeEventListener(n.name,n.callback))}}]),r}(E.Component);JD.defaultProps={isShowGlobalMousePosition:!1,pluginDataFetchers:{},pluginTracks:{},metaTracks:[],zoomable:!0},JD.propTypes={addTrackPosition:N.string,canvasElement:N.object,chooseTrackHandler:N.func,chromInfoPath:N.string,customDialog:N.array,closeCustomDialog:N.func,disableTrackMenu:N.bool,dragging:N.bool,draggingHappening:N.bool,editable:N.bool,getLockGroupExtrema:N.func,initialXDomain:N.array,initialYDomain:N.array,isShowGlobalMousePosition:N.bool,isValueScaleLocked:N.func,marginBottom:N.number.isRequired,marginLeft:N.number.isRequired,marginRight:N.number.isRequired,marginTop:N.number.isRequired,paddingBottom:N.number.isRequired,paddingLeft:N.number.isRequired,paddingRight:N.number.isRequired,paddingTop:N.number.isRequired,metaTracks:N.array,modal:N.object,mouseTool:N.string,onCloseTrack:N.func,onChangeTrackData:N.func,onChangeTrackType:N.func,onDataDomainChanged:N.func,onLockValueScale:N.func,onMouseMoveZoom:N.func,onNewTilesLoaded:N.func,onNoTrackAdded:N.func,onRangeSelection:N.func.isRequired,onScalesChanged:N.func,onTrackOptionsChanged:N.func,onTrackPositionChosen:N.func,onTracksAdded:N.func,onUnlockValueScale:N.func,onValueScaleChanged:N.func,onResizeTrack:N.func,overlays:N.array,openModal:N.func,pixiRenderer:N.object,pixiStage:N.object,pluginDataFetchers:N.object,pluginTracks:N.object,pubSub:N.object.isRequired,rangeSelection1dSize:N.array,rangeSelectionToInt:N.bool,registerDraggingChangedListener:N.func,removeDraggingChangedListener:N.func,setCentersFunction:N.func,svgElement:N.object,theme:N.symbol.isRequired,tracks:N.object,trackSourceServers:N.array,uid:N.string,viewOptions:N.object,xDomainLimits:N.array,yDomainLimits:N.array,zoomable:N.bool,zoomLimits:N.array,zoomToDataExtentOnInit:N.func};const u3e=Rf(eT(hc(JD)));var f3e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},h3e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol?"symbol":typeof e},d3e=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;function p3e(e){var t=void 0,r=void 0,i=void 0,n=e.ownerDocument,o=n.body,a=n&&n.documentElement;return t=e.getBoundingClientRect(),r=t.left,i=t.top,r-=a.clientLeft||o.clientLeft||0,i-=a.clientTop||o.clientTop||0,{left:r,top:i}}function yY(e,t){var r=e["page"+(t?"Y":"X")+"Offset"],i="scroll"+(t?"Top":"Left");if(typeof r!="number"){var n=e.document;r=n.documentElement[i],typeof r!="number"&&(r=n.body[i])}return r}function ex(e){return yY(e)}function tx(e){return yY(e,!0)}function bY(e){var t=p3e(e),r=e.ownerDocument,i=r.defaultView||r.parentWindow;return t.left+=ex(i),t.top+=tx(i),t}function m3e(e,t,r){var i="",n=e.ownerDocument,o=r||n.defaultView.getComputedStyle(e,null);return o&&(i=o.getPropertyValue(t)||o[t]),i}var g3e=new RegExp("^("+d3e+")(?!px)[a-z%]+$","i"),v3e=/^(top|right|bottom|left)$/,rx="currentStyle",nx="runtimeStyle",eu="left",y3e="px";function b3e(e,t){var r=e[rx]&&e[rx][t];if(g3e.test(r)&&!v3e.test(t)){var i=e.style,n=i[eu],o=e[nx][eu];e[nx][eu]=e[rx][eu],i[eu]=t==="fontSize"?"1em":r||0,r=i.pixelLeft+y3e,i[eu]=n,e[nx][eu]=o}return r===""?"auto":r}var tu=void 0;typeof window<"u"&&(tu=window.getComputedStyle?m3e:b3e);function ix(e,t){for(var r=0;r<e.length;r++)t(e[r])}function _Y(e){return tu(e,"boxSizing")==="border-box"}var _3e=["margin","border","padding"],ox=-1,T3e=2,ax=1,E3e=0;function S3e(e,t,r){var i={},n=e.style,o=void 0;for(o in t)t.hasOwnProperty(o)&&(i[o]=n[o],n[o]=t[o]);r.call(e);for(o in t)t.hasOwnProperty(o)&&(n[o]=i[o])}function Ig(e,t,r){var i=0,n=void 0,o=void 0,a=void 0;for(o=0;o<t.length;o++)if(n=t[o],n)for(a=0;a<r.length;a++){var s=void 0;n==="border"?s=n+r[a]+"Width":s=n+r[a],i+=parseFloat(tu(e,s))||0}return i}function $T(e){return e!=null&&e==e.window}var Sa={};ix(["Width","Height"],function(e){Sa["doc"+e]=function(t){var r=t.document;return Math.max(r.documentElement["scroll"+e],r.body["scroll"+e],Sa["viewport"+e](r))},Sa["viewport"+e]=function(t){var r="client"+e,i=t.document,n=i.body,o=i.documentElement,a=o[r];return i.compatMode==="CSS1Compat"&&a||n&&n[r]||a}});function TY(e,t,r){if($T(e))return t==="width"?Sa.viewportWidth(e):Sa.viewportHeight(e);if(e.nodeType===9)return t==="width"?Sa.docWidth(e):Sa.docHeight(e);var i=t==="width"?["Left","Right"]:["Top","Bottom"],n=t==="width"?e.offsetWidth:e.offsetHeight;tu(e);var o=_Y(e),a=0;(n==null||n<=0)&&(n=void 0,a=tu(e,t),(a==null||Number(a)<0)&&(a=e.style[t]||0),a=parseFloat(a)||0),r===void 0&&(r=o?ax:ox);var s=n!==void 0||o,c=n||a;if(r===ox)return s?c-Ig(e,["border","padding"],i):a;if(s){var u=r===T3e?-Ig(e,["border"],i):Ig(e,["margin"],i);return c+(r===ax?0:u)}return a+Ig(e,_3e.slice(r),i)}var w3e={position:"absolute",visibility:"hidden",display:"block"};function EY(e){var t=void 0,r=arguments;return e.offsetWidth!==0?t=TY.apply(void 0,r):S3e(e,w3e,function(){t=TY.apply(void 0,r)}),t}function Zh(e,t,r){var i=r;if((typeof t>"u"?"undefined":h3e(t))==="object"){for(var n in t)t.hasOwnProperty(n)&&Zh(e,n,t[n]);return}if(typeof i<"u"){typeof i=="number"&&(i+="px"),e.style[t]=i;return}return tu(e,t)}ix(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Sa["outer"+t]=function(i,n){return i&&EY(i,e,n?E3e:ax)};var r=e==="width"?["Left","Right"]:["Top","Bottom"];Sa[e]=function(i,n){if(n!==void 0){if(i){tu(i);var o=_Y(i);return o&&(n+=Ig(i,["padding","border"],r)),Zh(i,e,n)}return}return i&&EY(i,e,ox)}});function A3e(e,t){Zh(e,"position")==="static"&&(e.style.position="relative");var r=bY(e),i={},n=void 0,o=void 0;for(o in t)t.hasOwnProperty(o)&&(n=parseFloat(Zh(e,o))||0,i[o]=n+t[o]-r[o]);Zh(e,i)}var O3e=f3e({getWindow:function(t){var r=t.ownerDocument||t;return r.defaultView||r.parentWindow},offset:function(t,r){if(typeof r<"u")A3e(t,r);else return bY(t)},isWindow:$T,each:ix,css:Zh,clone:function(t){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=t[i]);var n=t.overflow;if(n)for(var i in t)t.hasOwnProperty(i)&&(r.overflow[i]=t.overflow[i]);return r},scrollLeft:function(t,r){if($T(t)){if(r===void 0)return ex(t);window.scrollTo(r,tx(t))}else{if(r===void 0)return t.scrollLeft;t.scrollLeft=r}},scrollTop:function(t,r){if($T(t)){if(r===void 0)return tx(t);window.scrollTo(ex(t),r)}else{if(r===void 0)return t.scrollTop;t.scrollTop=r}},viewportWidth:0,viewportHeight:0},Sa),Tr=O3e;function k3e(e,t,r){r=r||{},t.nodeType===9&&(t=Tr.getWindow(t));var i=r.allowHorizontalScroll,n=r.onlyScrollIfNeeded,o=r.alignWithTop,a=r.alignWithLeft,s=r.offsetTop||0,c=r.offsetLeft||0,u=r.offsetBottom||0,l=r.offsetRight||0;i=i===void 0?!0:i;var h=Tr.isWindow(t),f=Tr.offset(e),d=Tr.outerHeight(e),p=Tr.outerWidth(e),m=void 0,g=void 0,v=void 0,_=void 0,y=void 0,b=void 0,T=void 0,S=void 0,k=void 0,O=void 0;h?(T=t,O=Tr.height(T),k=Tr.width(T),S={left:Tr.scrollLeft(T),top:Tr.scrollTop(T)},y={left:f.left-S.left-c,top:f.top-S.top-s},b={left:f.left+p-(S.left+k)+l,top:f.top+d-(S.top+O)+u},_=S):(m=Tr.offset(t),g=t.clientHeight,v=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(m.left+(parseFloat(Tr.css(t,"borderLeftWidth"))||0))-c,top:f.top-(m.top+(parseFloat(Tr.css(t,"borderTopWidth"))||0))-s},b={left:f.left+p-(m.left+v+(parseFloat(Tr.css(t,"borderRightWidth"))||0))+l,top:f.top+d-(m.top+g+(parseFloat(Tr.css(t,"borderBottomWidth"))||0))+u}),y.top<0||b.top>0?o===!0?Tr.scrollTop(t,_.top+y.top):o===!1?Tr.scrollTop(t,_.top+b.top):y.top<0?Tr.scrollTop(t,_.top+y.top):Tr.scrollTop(t,_.top+b.top):n||(o=o===void 0?!0:!!o,o?Tr.scrollTop(t,_.top+y.top):Tr.scrollTop(t,_.top+b.top)),i&&(y.left<0||b.left>0?a===!0?Tr.scrollLeft(t,_.left+y.left):a===!1?Tr.scrollLeft(t,_.left+b.left):y.left<0?Tr.scrollLeft(t,_.left+y.left):Tr.scrollLeft(t,_.left+b.left):n||(a=a===void 0?!0:!!a,a?Tr.scrollLeft(t,_.left+y.left):Tr.scrollLeft(t,_.left+b.left)))}var I3e=k3e,C3e=I3e;const P3e=ui(C3e);function jT(){return jT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},jT.apply(this,arguments)}function D3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,N3e(i.key),i)}}function x3e(e,t,r){return t&&SY(e.prototype,t),r&&SY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function N3e(e){var t=R3e(e,"string");return typeof t=="symbol"?t:String(t)}function R3e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function M3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sx(e,t)}function sx(e,t){return sx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},sx(e,t)}function L3e(e){var t=F3e();return function(){var i=UT(e),n;if(t){var o=UT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return B3e(this,n)}}function B3e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H3e(e)}function H3e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function UT(e){return UT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},UT(e)}const Cg=[];let lx=function(e){M3e(r,e);var t=L3e(r);function r(i){var n;return D3e(this,r),n=t.call(this,i),n.state={highlightedIndex:null,menuTop:0,menuLeft:0,menuWidth:0,isOpen:!1},n.keyDownHandlers={ArrowDown(o){o.preventDefault();const a=this.getFilteredItems().length;if(!a)return;const{highlightedIndex:s}=this.state,c=s===null||s===a-1?0:s+1;this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:c,isOpen:!0})},ArrowUp(o){o.preventDefault();const a=this.getFilteredItems().length;if(!a)return;const{highlightedIndex:s}=this.state,c=s===0||s===null?a-1:s-1;this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:c,isOpen:!0})},Enter(o){if(this.state.isOpen!==!1)if(this.state.highlightedIndex===null)this.setState({isOpen:!1},()=>{this.inputEl.select()});else{o.preventDefault();const a=this.getFilteredItems()[this.state.highlightedIndex],s=this.props.getItemValue(a);this.setState({isOpen:!1,highlightedIndex:null},()=>{this.inputEl.setSelectionRange(s.length,s.length),this.props.onSelect(s,a)})}},Escape(){this.setState({highlightedIndex:null,isOpen:!1})}},n}return x3e(r,[{key:"getInitialState",value:function(){return{isOpen:!1,highlightedIndex:null}}},{key:"UNSAFE_componentWillMount",value:function(){this._ignoreBlur=!1,this._performAutoCompleteOnUpdate=!1,this._performAutoCompleteOnKeyUp=!1}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){this._performAutoCompleteOnUpdate=!0,(this.props.items!==n.items||this.state.highlightedIndex>=n.items.length)&&this.setState({highlightedIndex:null})}},{key:"componentDidUpdate",value:function(n,o){this.state.isOpen===!0&&o.isOpen===!1&&this.setMenuPositions(),this.state.isOpen&&this._performAutoCompleteOnUpdate&&(this._performAutoCompleteOnUpdate=!1,this.maybeAutoCompleteText()),this.maybeScrollItemIntoView(),o.isOpen!==this.state.isOpen&&this.props.onMenuVisibilityChange(this.state.isOpen,this.inputEl)}},{key:"maybeScrollItemIntoView",value:function(){if(this.state.isOpen===!0&&this.state.highlightedIndex!==null){const n=this.refs[`item-${this.state.highlightedIndex}`],o=this.refs.menu;n&&P3e(Lr.findDOMNode(n),Lr.findDOMNode(o),{onlyScrollIfNeeded:!0})}}},{key:"handleKeyDown",value:function(n){this.keyDownHandlers[n.key]?this.keyDownHandlers[n.key].call(this,n):this.setState({highlightedIndex:null,isOpen:!0})}},{key:"handleChange",value:function(n){this._performAutoCompleteOnKeyUp=!0,this.props.onChange(n,n.target.value)}},{key:"handleKeyUp",value:function(){this._performAutoCompleteOnKeyUp&&(this._performAutoCompleteOnKeyUp=!1,this.maybeAutoCompleteText())}},{key:"getFilteredItems",value:function(){let n=this.props.items;return this.props.shouldItemRender&&(n=n.filter(o=>this.props.shouldItemRender(o,this.props.value))),this.props.sortItems&&n.sort((o,a)=>this.props.sortItems(o,a,this.props.value)),n}},{key:"maybeAutoCompleteText",value:function(){if(!this.props.autoHighlight||this.props.value==="")return;const{highlightedIndex:n}=this.state,o=this.getFilteredItems();if(o.length===0)return;const a=n!==null?o[n]:o[0];this.props.getItemValue(a).toLowerCase().indexOf(this.props.value.toLowerCase())===0&&n===null&&this.setState({highlightedIndex:0})}},{key:"setMenuPositions",value:function(){const n=this.inputEl,o=n.getBoundingClientRect(),a=globalThis.window.getComputedStyle(n),s=parseInt(a.marginBottom,10)||0,c=parseInt(a.marginLeft,10)||0,u=parseInt(a.marginRight,10)||0;this.setState({menuTop:o.bottom+s,menuLeft:o.left+c,menuWidth:o.width+c+u})}},{key:"highlightItemFromMouse",value:function(n){this.setState({highlightedIndex:n})}},{key:"selectItemFromMouse",value:function(n){const o=this.props.getItemValue(n);this.setState({isOpen:!1,highlightedIndex:null},()=>{this.props.onSelect(o,n),this.inputEl.focus()})}},{key:"setIgnoreBlur",value:function(n){this._ignoreBlur=n}},{key:"renderMenu",value:function(){const n=this.getFilteredItems().map((s,c)=>{const u=this.props.renderItem(s,this.state.highlightedIndex===c,{cursor:"default"});return E.cloneElement(u,{onMouseDown:()=>this.setIgnoreBlur(!0),onMouseEnter:()=>this.highlightItemFromMouse(c),onClick:()=>this.selectItemFromMouse(s),ref:`item-${c}`})}),o={left:this.state.menuLeft,top:this.state.menuTop,minWidth:this.state.menuWidth};if(!n.length)return null;const a=this.props.renderMenu(n,this.props.value,o);return E.cloneElement(a,{ref:"menu"})}},{key:"handleInputBlur",value:function(){this.props.onFocus&&this.props.onFocus(),!this._ignoreBlur&&this.setState({isOpen:!1,highlightedIndex:null})}},{key:"handleInputFocus",value:function(){if(this.props.onFocus&&this.props.onFocus(!0),this._ignoreBlur){this.setIgnoreBlur(!1);return}this._ignoreClick=!0,this.setState({isOpen:!0})}},{key:"isInputFocused",value:function(){return this.inputEl.ownerDocument&&this.inputEl===this.inputEl.ownerDocument.activeElement}},{key:"handleInputClick",value:function(){this.isInputFocused()&&this.state.isOpen===!1?this.setState({isOpen:!0}):this.state.highlightedIndex!==null&&!this._ignoreClick&&this.selectItemFromMouse(this.getFilteredItems()[this.state.highlightedIndex]),this._ignoreClick=!1}},{key:"composeEventHandlers",value:function(n,o){return o?a=>{n(a),o(a)}:n}},{key:"render",value:function(){this.props.debug&&Cg.push({id:Cg.length,state:this.state});const{inputProps:n}=this.props;return E.createElement("div",jT({style:{...this.props.wrapperStyle}},this.props.wrapperProps),E.createElement("input",jT({},n,{ref:o=>{this.inputEl=o},"aria-autocomplete":"list",autoComplete:"off",onBlur:this.composeEventHandlers(this.handleInputBlur.bind(this),n.onBlur&&n.onBlur.bind(this)),onChange:this.handleChange.bind(this),onClick:this.composeEventHandlers(this.handleInputClick.bind(this),n.onClick&&n.onClick.bind(this)),onFocus:this.composeEventHandlers(this.handleInputFocus.bind(this),n.onFocus&&n.onFocus.bind(this)),onKeyDown:this.composeEventHandlers(this.handleKeyDown.bind(this),n.onKeyDown&&n.onKeyDown.bind(this)),onKeyUp:this.composeEventHandlers(this.handleKeyUp.bind(this),n.onKeyUp&&n.onKeyUp.bind(this)),role:"combobox",value:this.props.value})),("open"in this.props?this.props.open:this.state.isOpen)&&this.renderMenu(),this.props.debug&&E.createElement("pre",{style:{marginLeft:300}},JSON.stringify(Cg.slice(Cg.length-5,Cg.length),null,2)))}}]),r}(E.Component);lx.defaultProps={value:"",wrapperProps:{},wrapperStyle:{display:"inline-block"},inputProps:{},onChange(){},onSelect(){},renderMenu(e,t,r){return E.createElement("div",{style:{...r,...this.menuStyle}},e)},shouldItemRender(){return!0},menuStyle:{borderRadius:"3px",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.1)",background:"rgba(255, 255, 255, 0.9)",padding:"2px 0",fontSize:"90%",position:"fixed",overflow:"auto",maxHeight:"50%"},autoHighlight:!0,onMenuVisibilityChange(){}},lx.propTypes={autoHighlight:N.bool,debug:N.bool,getItemValue:N.func.isRequired,inputProps:N.object,items:N.array,menuStyle:N.object,onChange:N.func,onFocus:N.func,onMenuVisibilityChange:N.func,onSelect:N.func,open:N.bool,renderItem:N.func.isRequired,renderMenu:N.func,shouldItemRender:N.func,sortItems:N.func,value:N.any,wrapperProps:N.object,wrapperStyle:N.object};const Qh={"genome-position-search":"_genome-position-search_1l2sx_1","genome-position-search-focus":"_genome-position-search-focus_1l2sx_2","genome-position-search-bar":"_genome-position-search-bar_1l2sx_16","genome-position-search-dark":"_genome-position-search-dark_1l2sx_34","genome-position-search-bar-button":"_genome-position-search-bar-button_1l2sx_38","genome-position-search-bar-button-focus":"_genome-position-search-bar-button-focus_1l2sx_39","genome-position-search-bar-icon":"_genome-position-search-bar-icon_1l2sx_62","genome-position-search-bar-icon-focus":"_genome-position-search-bar-icon-focus_1l2sx_63","genome-position-search-bar-suggestions":"_genome-position-search-bar-suggestions_1l2sx_83",btn:"_btn_1l2sx_95","btn-sm":"_btn-sm_1l2sx_116","btn-default":"_btn-default_1l2sx_122"};function $3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,U3e(i.key),i)}}function j3e(e,t,r){return t&&wY(e.prototype,t),r&&wY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function U3e(e){var t=G3e(e,"string");return typeof t=="symbol"?t:String(t)}function G3e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cx(e,t)}function cx(e,t){return cx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},cx(e,t)}function V3e(e){var t=Y3e();return function(){var i=GT(e),n;if(t){var o=GT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return W3e(this,n)}}function W3e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AY(e)}function AY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function GT(e){return GT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},GT(e)}let OY=function(e){z3e(r,e);var t=V3e(r);function r(i){var n;return $3e(this,r),n=t.call(this,i),n.mounted=!1,n.uid=xt.nice(),n.chromInfo=null,n.searchField=null,n.autocompleteMenu=null,n.xScale=null,n.yScale=null,n.prevParts=[],n.props.registerViewportChangedListener(n.scalesChanged.bind(AY(n))),n.menuPosition={left:0,top:0},n.positionText="chr4:190,998,876-191,000,255",n.state={genes:[],isFocused:!1,autocompleteServer:n.props.autocompleteServer,autocompleteId:n.props.autocompleteId,availableAssemblies:[],selectedAssembly:null},n.styles={item:{padding:"2px 6px",cursor:"default"},highlightedItem:{color:"white",background:"hsl(200, 50%, 50%)",padding:"2px 6px",cursor:"default"},menu:{border:"solid 1px #ccc"}},n.availableAutocompletes={},n.props.autocompleteId&&(n.availableAutocompletes[n.props.chromInfoId]=new Set([{server:n.props.autocompleteServer,acId:n.props.autocompleteId}])),n.availableChromSizes={},n}return j3e(r,[{key:"componentDidMount",value:function(){this.mounted=!0,Bt(this.autocompleteMenu.inputEl).on("keypress",this.autocompleteKeyPress.bind(this)),this.findAvailableAutocompleteSources(),this.findAvailableChromSizes(),this.props.chromInfoPath&&(this.searchPosition=!0,ma(this.props.chromInfoPath,n=>{if(!n){this.searchPosition=null;return}this.chromInfo=n,this.searchField=new ch(this.chromInfo),this.setPositionText()})),this.setPositionText()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,this.props.removeViewportChangedListener()}},{key:"onAutocompleteChange",value:function(n,o){this.positionText=o,this.setState({value:o,loading:!0}),this.changedPart=null;const a=o.split(/ /);let s=0;const c=[];let u=!1;for(let l=0;l<a.length;l++){const h=a[l].split(/-/);for(let f=0;f<h.length;f++){if(s+=1,c.push(h[f]),f===0?u=!0:u=!1,f===this.prevParts.length){this.changedPart=s-1;break}if(h[f]!==this.prevParts[f]){this.changedPart=s-1;break}}}if(this.prevParts=c,!!(this.state.autocompleteServer&&this.state.autocompleteId)&&this.changedPart!==null){this.setState({loading:!0});let l=`${this.state.autocompleteServer}/suggest/`;l+=`?d=${this.state.autocompleteId}&ac=${c[this.changedPart].toLowerCase()}`,Ke.json(l,(h,f)=>{if(h)this.setState({loading:!1,genes:[]});else if(this.changedPart>0&&!u){const d=`${this.state.autocompleteServer}/suggest/?d=${this.state.autocompleteId}&ac=${c[this.changedPart-1].toLowerCase()}-${c[this.changedPart].toLowerCase()}`;Ke.json(d,(p,m)=>{p?this.setState({loading:!1,genes:f}):this.setState({loading:!1,genes:m.concat(f)})},this.props.pubSub)}else this.setState({loading:!1,genes:f})},this.props.pubSub)}}},{key:"setAvailableAssemblies",value:function(){const n=new Set(Xi(this.availableChromSizes)),o=new Set([...n]);this.gpsbForm&&this.setState({availableAssemblies:[...o]})}},{key:"setSelectedAssembly",value:function(n){if(!this.mounted||!this.availableChromSizes[n])return;const o=[...this.availableChromSizes[n]][0];this.setState({autocompleteServer:o.server});const{server:a}=o;if(this.availableAutocompletes[n]){const s=[...this.availableAutocompletes[n]][0].acId;this.props.onSelectedAssemblyChanged(n,s,a),this.gpsbForm&&this.setState({autocompleteId:s})}else this.props.onSelectedAssemblyChanged(n,null,a),this.gpsbForm&&this.setState({autocompleteId:null});this.fetchChromInfo(o.uuid,o.server)}},{key:"setPositionText",value:function(){if(!this.mounted||!this.searchField)return;const n=this.searchField.scalesToPositionText(this.xScale,this.yScale,this.props.twoD);this.prevParts=n.split(/[ -]/),this.gpsbForm&&(this.positionText=n,this.origPositionText=n,this.autocompleteMenu.inputEl.value=n)}},{key:"scalesChanged",value:function(n,o){this.xScale=n,this.yScale=o,this.setPositionText()}},{key:"findAvailableChromSizes",value:function(){this.props.trackSourceServers&&this.props.trackSourceServers.forEach(n=>{Ke.json(`${n}/available-chrom-sizes/`,(o,a)=>{o?console.error(o):(a.results.forEach(s=>{s.coordSystem in this.availableChromSizes||(this.availableChromSizes[s.coordSystem]=new Set),this.availableChromSizes[s.coordSystem].add({server:n,uuid:s.uuid}),this.setAvailableAssemblies()}),this.searchField||this.fetchChromInfo(this.props.chromInfoId in this.availableChromSizes?[...this.availableChromSizes[this.props.chromInfoId]][0].uuid:this.props.chromInfoId,this.props.chromInfoId in this.availableChromSizes?[...this.availableChromSizes[this.props.chromInfoId]][0].server:this.props.chromInfoServer))},this.props.pubSub)})}},{key:"findAvailableAutocompleteSources",value:function(){this.props.trackSourceServers&&this.props.trackSourceServers.forEach(n=>{Ke.json(`${n}/tilesets/?limit=100&dt=gene-annotation`,(o,a)=>{o?console.error(o):(a.results.forEach(s=>{s.coordSystem in this.availableAutocompletes||(this.availableAutocompletes[s.coordSystem]=new Set),this.availableAutocompletes[s.coordSystem].add({server:n,acId:s.uuid}),this.setAvailableAssemblies()}),this.state.autocompleteId||this.gpsbForm&&this.availableAutocompletes[this.props.chromInfoId]&&this.setState({autocompleteId:[...this.availableAutocompletes[this.props.chromInfoId]][0].acId}))},this.props.pubSub)})}},{key:"fetchChromInfo",value:function(n,o){ma(`${o}/chrom-sizes/?id=${n}`,a=>{a&&(Ke.json(`${o}/tileset_info/?d=${n}`,(s,c)=>{s||this.gpsbForm&&this.setState({selectedAssembly:c[n].coordSystem})},this.props.pubSub),this.chromInfo=a,this.searchField=new ch(this.chromInfo),this.setPositionText())},this.props.pubSub)}},{key:"autocompleteKeyPress",value:function(n){n.keyCode===13&&this.buttonClick()}},{key:"genePositionToSearchBarText",value:function(n){}},{key:"replaceGenesWithLoadedPositions",value:function(n){const o=this.positionText,a=o.split(" ");let s=!1;for(let u=0;u<a.length;u++){const l=a[u].split("-");let h=0,f=0,d="";for(;h<l.length;){for(f=l.length;f>h;){const p=l.slice(h,f).join("-");if(n[p.toLowerCase()]){const m=n[p.toLowerCase()],g=Math.floor((m.txEnd-m.txStart)/4);h===0&&f<l.length?d=`${m.chr}:${m.txStart-g}`:h===0&&f===l.length?d=`${m.chr}:${m.txStart-g}-${m.txEnd+g}`:d+=`- ${m.chr}:${m.txEnd+g}`,s=!0;break}else f===h+1&&(d.length&&(d+="-"),d+=p);f-=1}h=f+1}a[u]=d}const c=a.join(" ");return this.prevParts=c.split(/[ -]/),this.positionText=c,this.setState({value:c}),s?o:null}},{key:"replaceGenesWithPositions",value:function(n){const o=this.positionText.split(/[ -]/),a=[];for(let s=0;s<o.length;s++){if(o[s].length===0)continue;const c=this.searchField.parsePosition(o[s])[2];if(c===null||Number.isNaN(+c)){const u=`${this.state.autocompleteServer}/suggest/?d=${this.state.autocompleteId}&ac=${o[s].toLowerCase()}`;a.push(Ke.json(u,po,this.props.pubSub))}}Promise.all(a).then(s=>{if(s){const c={};for(let l=0;l<s.length;l++)if(s[l][0])for(let h=0;h<s[l].length;h++)c[s[l][h].geneName.toLowerCase()]=s[l][h];const u=this.replaceGenesWithLoadedPositions(c);n(u)}}).catch(s=>console.error(s))}},{key:"buttonClick",value:function(){this.setState({genes:[]}),this.replaceGenesWithPositions(n=>{const o=this.positionText;if(this.searchField!==null){const a=this.searchField.searchPosition(o),s=a[0];let c=a[1];if(!s){this.setPositionText();return}if(s&&(Number.isNaN(+s[0])||Number.isNaN(+s[1]))||c&&(Number.isNaN(+c[0])||Number.isNaN(+c[1])))return;c||(c=s);const u=this.xScale.copy().domain(s),l=this.yScale.copy().domain(c),[h,f,d]=tn(u,l);n&&this.props.onGeneSearch({geneSymbol:n,range:s,centerX:h,centerY:f}),this.props.setCenters(h,f,d,JL)}})}},{key:"searchFieldSubmit",value:function(){this.buttonClick()}},{key:"pathJoin",value:function(n,o){const a=o||"/",s=new RegExp(`${a}{1,}`,"g");return n.join(a).replace(s,a)}},{key:"geneSelected",value:function(n,o){const a=this.positionText.split(" ");let s=this.changedPart;for(let c=0;c<a.length;c++){const u=a[c].split("-"),l=o.geneName.split("-");if(s>u.length-1)s-=u.length;else{if(u[s]=o.geneName,l.length===2&&s>0&&u[s-1].toLowerCase()===l[0].toLowerCase()){const h=u.slice(0,s-1);h.push(l.join("-")),s<u.length-1&&h.push(u.slice(s+1)),a[c]=h.join("-")}else a[c]=u.join("-");break}}this.prevParts=a.join(" ").split(/[ -]/),this.positionText=a.join(" "),this.setState({value:a.join(" "),genes:[]})}},{key:"handleMenuVisibilityChange",value:function(n,o){const a=o.getBoundingClientRect();this.menuPosition={left:a.left,top:a.top+a.height},this.setState({menuOpened:n})}},{key:"handleRenderMenu",value:function(n){return E.createElement(ml,null,E.createElement("div",{className:Qh["genome-position-search-bar-suggestions"],style:{left:this.menuPosition.left,top:this.menuPosition.top}},n))}},{key:"handleAssemblySelectEvt",value:function(n){this.handleAssemblySelect(n.target.value)}},{key:"handleAssemblySelect",value:function(n){this.setSelectedAssembly(n),this.setState({selectedAssembly:n})}},{key:"focusHandler",value:function(n){this.setState({isFocused:n})}},{key:"render",value:function(){const n=this.state.availableAssemblies.map(o=>E.createElement("option",{key:o,value:o},o));return E.createElement("div",{ref:o=>{this.gpsbForm=o},className:Zt({[Qh["genome-position-search-focus"]]:this.state.isFocused,[Qh["genome-position-search"]]:!this.state.isFocused,[Qh["genome-position-search-dark"]]:this.props.theme===mr})},!this.props.hideAvailableAssemblies&&E.createElement("select",{ref:o=>{this.assemblyPickButton=o},className:Qh["genome-position-search-bar-button"],id:this.uid,onChange:this.handleAssemblySelectEvt.bind(this),value:this.state.selectedAssembly||void 0},n),E.createElement(lx,{ref:o=>{this.autocompleteMenu=o},getItemValue:o=>o.geneName,inputProps:{className:Qh["genome-position-search-bar"],title:"Current location: enter a symbol or location to change the position of the current view"},items:this.state.genes,menuStyle:{position:"absolute",left:this.menuPosition.left,top:this.menuPosition.top,border:"1px solid black"},onChange:this.onAutocompleteChange.bind(this),onFocus:this.focusHandler.bind(this),onMenuVisibilityChange:this.handleMenuVisibilityChange.bind(this),onSelect:(o,a)=>this.geneSelected(o,a),onSubmit:this.searchFieldSubmit.bind(this),renderItem:(o,a)=>E.createElement("div",{key:o.refseqid,id:o.refseqid,style:a?this.styles.highlightedItem:this.styles.item},o.geneName),renderMenu:this.handleRenderMenu.bind(this),value:this.state.selectedAssembly?this.positionText:"No valid assembly selected",wrapperStyle:{width:"100%"}}),E.createElement(l5,{onClick:this.buttonClick.bind(this),theStyle:"multitrack-header-icon"}))}}]),r}(E.Component);OY.propTypes={autocompleteId:N.string,autocompleteServer:N.string,chromInfoId:N.string,chromInfoServer:N.string,chromInfoPath:N.string,hideAvailableAssemblies:N.bool,isFocused:N.bool,pubSub:N.object,onFocus:N.func,onGeneSearch:N.func,onSelectedAssemblyChanged:N.func,registerViewportChangedListener:N.func,removeViewportChangedListener:N.func,setCenters:N.func,theme:N.symbol.isRequired,trackSourceServers:N.array,twoD:N.bool};const q3e=Rf(hc(OY)),X3e={"export-link-dialog-wrapper":"_export-link-dialog-wrapper_p9gxw_1"};function K3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Q3e(i.key),i)}}function Z3e(e,t,r){return t&&kY(e.prototype,t),r&&kY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q3e(e){var t=J3e(e,"string");return typeof t=="symbol"?t:String(t)}function J3e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ux(e,t)}function ux(e,t){return ux=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},ux(e,t)}function tVe(e){var t=iVe();return function(){var i=zT(e),n;if(t){var o=zT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return rVe(this,n)}}function rVe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nVe(e)}function nVe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iVe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zT(e){return zT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zT(e)}let fx=function(e){eVe(r,e);var t=tVe(r);function r(){return K3e(this,r),t.apply(this,arguments)}return Z3e(r,[{key:"render",value:function(){return E.createElement(og,{okayOnly:!0,okayTitle:"Done",onOkay:this.props.onDone,title:"Share view link"},E.createElement("div",{className:X3e["export-link-dialog-wrapper"]},E.createElement("input",{ref:n=>{n&&(this.input=n,n.focus(),n.select())},onClick:n=>{n.target.select()},placeholder:"Generating the link...",readOnly:!0,value:this.props.url}),E.createElement(cs,{onClick:n=>{this.input.select(),document.execCommand("copy")}},"Copy")))}}]),r}(E.Component);fx.defaultProps={onDone:()=>{},url:""},fx.propTypes={onDone:N.func,url:N.string};function oVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,sVe(i.key),i)}}function aVe(e,t,r){return t&&IY(e.prototype,t),r&&IY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sVe(e){var t=lVe(e,"string");return typeof t=="symbol"?t:String(t)}function lVe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hx(e,t)}function hx(e,t){return hx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},hx(e,t)}function uVe(e){var t=dVe();return function(){var i=VT(e),n;if(t){var o=VT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return fVe(this,n)}}function fVe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hVe(e)}function hVe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dVe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function VT(e){return VT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},VT(e)}let CY=function(e){cVe(r,e);var t=uVe(r);function r(i){var n;return oVe(this,r),n=t.call(this,i),n.state={submenuShown:!1},n}return aVe(r,[{key:"getConfigureViewMenu",value:function(n,o){const a=["backgroundColor"],s={},c={};for(const u of a)if(u in Object.keys(wn)&&(s[u]={name:wn[u].name},wn[u].inlineOptions))for(const l in wn[u].inlineOptions){const h=wn[u].inlineOptions[l];s[u].children||(s[u].children={});const f={name:h.name,value:h.value};f.handler=()=>{c[u]=h.value,this.props.onOptionsChanged(c)},s[u].children[l]=f}return E.createElement(GD,{key:"config-series-menu",closeMenu:this.props.closeMenu,menuItems:s,orientation:this.state.orientation,parentBbox:o,position:n,theme:this.props.theme})}},{key:"getSubmenu",value:function(){if(this.state.submenuShown){const n=this.state.submenuSourceBbox,o=this.state.orientation==="left"?{left:this.state.left,top:n.top}:{left:this.state.left+n.width+7,top:n.top};return this.state.submenuShown.option==="options"?this.getConfigureViewMenu(o,n):E.createElement("div",null)}return E.createElement("div",null)}},{key:"render",value:function(){return E.createElement("div",{ref:n=>{this.div=n},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),"data-menu-type":"ConfigViewMenu",style:{left:this.state.left,top:this.state.top}},E.createElement(St,{onClick:n=>this.props.onTogglePositionSearchBox(n)},"Toggle position search box"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onZoomToData(n)},"Zoom to data extent"),E.createElement(St,{onClick:n=>this.props.onClearView(n)},"Clear View"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onYankZoom(n)},"Take zoom from"),E.createElement(St,{onClick:n=>this.props.onYankLocation(n)},"Take location from"),E.createElement(St,{onClick:n=>this.props.onYankZoomAndLocation(n)},"Take zoom and location from"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:this.props.onLockZoom},"Lock zoom with"),E.createElement(St,{onClick:this.props.onLockLocation},"Lock location with"),E.createElement(St,{onClick:this.props.onLockZoomAndLocation},"Lock zoom and location with"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:this.props.onTakeAndLockZoomAndLocation},"Take and lock zoom and location with"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onUnlockZoom(n)},"Unlock zoom"),E.createElement(St,{onClick:n=>this.props.onUnlockLocation(n)},"Unlock location"),E.createElement(St,{onClick:n=>this.props.onUnlockZoomAndLocation(n)},"Unlock zoom and location"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onProjectViewport(n)},"Show this viewport on"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onEditViewConfig(n)},"Edit view config"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:()=>this.props.onExportSVG()},"Export views as SVG"),E.createElement(St,{onClick:()=>this.props.onExportPNG()},"Export views as PNG"),E.createElement(St,{onClick:()=>this.props.onExportViewAsJSON()},"Export views as JSON"),E.createElement(St,{onClick:()=>this.props.onExportViewAsLink()},"Export views as Link"),this.getSubmenu())}}]),r}(pl);CY.propTypes={onEditViewConfig:N.func.isRequired,onExportSVG:N.func,onExportPNG:N.func,onExportViewAsJSON:N.func,onExportViewAsLink:N.func,onLockLocation:N.func,onLockZoom:N.func,onLockZoomAndLocation:N.func,onProjectViewport:N.func,onTakeAndLockZoomAndLocation:N.func,onTogglePositionSearchBox:N.func,onUnlockLocation:N.func,onUnlockZoom:N.func,onUnlockZoomAndLocation:N.func,onYankLocation:N.func,onYankZoom:N.func,onYankZoomAndLocation:N.func,onZoomToData:N.func,theme:N.symbol};const io={"add-track-position-table":"_add-track-position-table_wdy5w_1","add-track-position-table-dark":"_add-track-position-table-dark_wdy5w_7","add-track-position-other":"_add-track-position-other_wdy5w_11","add-track-position-top-center":"_add-track-position-top-center_wdy5w_15","add-track-position-middle-left":"_add-track-position-middle-left_wdy5w_30","add-track-position-middle-right":"_add-track-position-middle-right_wdy5w_45","add-track-position-middle-middle":"_add-track-position-middle-middle_wdy5w_60","add-track-position-bottom-middle":"_add-track-position-bottom-middle_wdy5w_71","add-track-position-span":"_add-track-position-span_wdy5w_86"};function PY(e){return E.createElement("div",null,E.createElement("div",{className:io["add-track-position-span"]},"Add Track..."),E.createElement("table",{className:Zt(io["add-track-position-table"],{[io["add-track-position-table-dark"]]:e.theme===mr})},E.createElement("tbody",null,E.createElement("tr",{style:{height:"30px"}},E.createElement("td",{"aria-hidden":"true",className:io["add-track-position-other"]}),E.createElement("td",{className:io["add-track-position-top-center"],onClick:()=>e.onTrackPositionChosen("top")},"top"),E.createElement("td",{"aria-hidden":"true",className:io["add-track-position-other"]})),E.createElement("tr",{style:{height:"80px"}},E.createElement("td",{className:io["add-track-position-middle-left"],onClick:()=>e.onTrackPositionChosen("left")},"left"),E.createElement("td",{className:io["add-track-position-middle-middle"],onClick:()=>e.onTrackPositionChosen("center")},"center"),E.createElement("td",{className:io["add-track-position-middle-right"],onClick:()=>e.onTrackPositionChosen("right")},"right")),E.createElement("tr",{style:{height:"30px"}},E.createElement("td",{"aria-hidden":"true",className:io["add-track-position-other"]}),E.createElement("td",{className:io["add-track-position-bottom-middle"],onClick:()=>e.onTrackPositionChosen("bottom")},"bottom"),E.createElement("td",{"aria-hidden":"true",className:io["add-track-position-other"]})))))}PY.propTypes={onTrackPositionChosen:N.func.isRequired,theme:N.symbol.isRequired};const pVe=hc(PY);function mVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,vVe(i.key),i)}}function gVe(e,t,r){return t&&DY(e.prototype,t),r&&DY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vVe(e){var t=yVe(e,"string");return typeof t=="symbol"?t:String(t)}function yVe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dx(e,t)}function dx(e,t){return dx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},dx(e,t)}function _Ve(e){var t=EVe();return function(){var i=WT(e),n;if(t){var o=WT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return TVe(this,n)}}function TVe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xY(e)}function xY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EVe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function WT(e){return WT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},WT(e)}let px=function(e){bVe(r,e);var t=_Ve(r);function r(i){var n;return mVe(this,r),n=t.call(this,i),n.configImg=null,n.plusImg=null,n.state={addTrackPositionMenuUid:null,addTrackPositionMenuPosition:null,configMenuUid:null,configMenuPosition:null,isFocused:!1,width:-1},n.handleTrackPositionChosenBound=n.handleTrackPositionChosen.bind(xY(n)),n}return gVe(r,[{key:"componentDidMount",value:function(){this.setState({width:this.el.clientWidth})}},{key:"checkWidth",value:function(){const n=this.el.clientWidth;n!==this.state.width&&this.setState({width:n})}},{key:"handleConfigMenuOpened",value:function(n){this.setState({configMenuUid:n,configMenuPosition:this.configImg.getBoundingClientRect()})}},{key:"handleAddTrackPositionMenuOpened",value:function(n){this.setState({addTrackPositionMenuUid:n,addTrackPositionMenuPosition:this.plusImg.getBoundingClientRect()})}},{key:"handleTrackPositionChosen",value:function(n){this.props.onTrackPositionChosen(n),this.setState({addTrackPositionMenuUid:null,addTrackPositionMenuPosition:null})}},{key:"render",value:function(){let n=null,o=null;this.state.addTrackPositionMenuPosition&&(o=E.createElement(ml,{onMenuClosed:()=>{this.setState({addTrackPositionMenuUid:null,addTrackPositionMenuPosition:null})}},E.createElement(pl,{orientation:"left",position:this.state.addTrackPositionMenuPosition,theme:this.props.theme},E.createElement(pVe,{onTrackPositionChosen:this.handleTrackPositionChosenBound})))),this.state.configMenuUid&&(n=E.createElement(ml,{onMenuClosed:()=>this.setState({configMenuUid:null})},E.createElement(CY,{onClearView:()=>{this.setState({configMenuUid:null}),this.props.onClearView()},onEditViewConfig:()=>{this.setState({configMenuUid:null}),this.props.onEditViewConfig(this.state.configMenuUid)},onExportPNG:()=>{this.setState({configMenuUid:null}),this.props.onExportPNG()},onExportSVG:()=>{this.setState({configMenuUid:null}),this.props.onExportSVG()},onExportViewAsJSON:()=>{this.setState({configMenuUid:null}),this.props.onExportViewsAsJSON()},onExportViewAsLink:()=>{this.setState({configMenuUid:null}),this.props.onExportViewsAsLink()},onLockLocation:()=>{this.setState({configMenuUid:null}),this.props.onLockLocation(this.state.configMenuUid)},onLockZoom:()=>{this.setState({configMenuUid:null}),this.props.onLockZoom(this.state.configMenuUid)},onLockZoomAndLocation:()=>{this.setState({configMenuUid:null}),this.props.onLockZoomAndLocation(this.state.configMenuUid)},onOptionsChanged:u=>{this.props.onViewOptionsChanged(u),this.setState({configMenuUid:null})},onProjectViewport:()=>{this.setState({configMenuUid:null}),this.props.onProjectViewport(this.state.configMenuUid)},onTakeAndLockZoomAndLocation:()=>{this.setState({configMenuUid:null}),this.props.onTakeAndLockZoomAndLocation(this.state.configMenuUid)},onTogglePositionSearchBox:()=>{this.setState({configMenuUid:null}),this.props.onTogglePositionSearchBox(this.state.configMenuUid)},onUnlockLocation:()=>{this.setState({configMenuUid:null}),this.props.onUnlockLocation(this.state.configMenuUid)},onUnlockZoom:()=>{this.setState({configMenuUid:null}),this.props.onUnlockZoom(this.state.configMenuUid)},onUnlockZoomAndLocation:()=>{this.setState({configMenuUid:null}),this.props.onUnlockZoomAndLocation(this.state.configMenuUid)},onYankLocation:()=>{this.setState({configMenuUid:null}),this.props.onYankLocation(this.state.configMenuUid)},onYankZoom:()=>{this.setState({configMenuUid:null}),this.props.onYankZoom(this.state.configMenuUid)},onYankZoomAndLocation:()=>{this.setState({configMenuUid:null}),this.props.onYankZoomAndLocation(this.state.configMenuUid)},onZoomToData:()=>{this.setState({configMenuUid:null}),this.props.onZoomToData(this.state.configMenuUid)},orientation:"left",position:this.state.configMenuPosition,theme:this.props.theme})));const a=this.props.getGenomePositionSearchBox(this.state.isFocused,u=>{this.setState({isFocused:u})}),s=Zt(this.state.isFocused?Yi["multitrack-header-focus"]:Yi["multitrack-header"],{[Yi["multitrack-header-dark"]]:this.props.theme===mr}),c=this.state.width<=e5?Yi["multitrack-header-icon-squeazed"]:Yi["multitrack-header-icon"];return E.createElement("div",{ref:u=>{this.el=u},className:s},E.createElement("div",{className:Yi["multitrack-header-left"]},this.props.mouseTool===Wi&&E.createElement("svg",{className:Zt(Yi["mouse-tool-selection"],c),title:"Selection tool active"},E.createElement("use",{xlinkHref:"#select"})),E.createElement("div",{className:Yi["multitrack-header-grabber"],title:"Drag to move the view"},E.createElement("div",null),E.createElement("div",null),E.createElement("div",null)),this.state.width>t5&&E.createElement("div",{className:Yi["multitrack-header-search"]},this.props.isGenomePositionSearchBoxVisible&&a)),E.createElement("nav",{className:Yi["multitrack-header-nav-list"]},E.createElement("svg",{className:c,onClick:this.props.onAddView},E.createElement("title",null,"Add new view (clone this view)"),E.createElement("use",{xlinkHref:"#copy"})),E.createElement("svg",{ref:u=>{this.configImg=u},className:c,onClick:()=>this.handleConfigMenuOpened(this.props.viewUid)},E.createElement("title",null,"Configure this view"),E.createElement("use",{xlinkHref:"#cog"})),E.createElement("svg",{ref:u=>{this.plusImg=u},className:c,onClick:()=>this.handleAddTrackPositionMenuOpened(this.props.viewUid)},E.createElement("title",null,"Add Track"),E.createElement("use",{xlinkHref:"#plus"})),E.createElement("svg",{className:c,onClick:this.props.onCloseView},E.createElement("title",null,"Close View"),E.createElement("use",{xlinkHref:"#cross"}))),n,o)}}]),r}(E.Component);px.defaultProps={isGenomePositionSearchBoxVisible:!1},px.propTypes={getGenomePositionSearchBox:N.func.isRequired,isGenomePositionSearchBoxVisible:N.bool,mouseTool:N.string.isRequired,onAddView:N.func.isRequired,onClearView:N.func.isRequired,onCloseView:N.func.isRequired,onEditViewConfig:N.func.isRequired,onExportSVG:N.func.isRequired,onExportPNG:N.func.isRequired,onExportViewsAsJSON:N.func.isRequired,onExportViewsAsLink:N.func.isRequired,onLockLocation:N.func.isRequired,onLockZoom:N.func.isRequired,onLockZoomAndLocation:N.func.isRequired,onProjectViewport:N.func.isRequired,onTakeAndLockZoomAndLocation:N.func.isRequired,onTogglePositionSearchBox:N.func.isRequired,onTrackPositionChosen:N.func.isRequired,onUnlockLocation:N.func.isRequired,onUnlockZoom:N.func.isRequired,onUnlockZoomAndLocation:N.func.isRequired,onViewOptionsChanged:N.func.isRequired,onYankLocation:N.func.isRequired,onYankZoom:N.func.isRequired,onYankZoomAndLocation:N.func.isRequired,onZoomToData:N.func.isRequired,theme:N.symbol.isRequired,viewUid:N.string.isRequired};const SVe=hc(px);var NY={};Object.defineProperty(NY,"__esModule",{value:!0});var gl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},wVe=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),AVe=E,Pg=OVe(AVe);function OVe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function kVe(e,t){var r={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r}function IVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RY(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function CVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var PVe=13,DVe=9,xVe=8,NVe=89,YT=90,RVe=77,MY=57,LY=219,BY=222,HY=192,MVe=27,FY=100,LVe=3e3,BVe="navigator"in globalThis&&/Win/i.test(navigator.platform),mx="navigator"in globalThis&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),qT="npm__react-simple-code-editor__textarea",HVe=`
|
|
317
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function x(q,Y){(Y==null||Y>q.length)&&(Y=q.length);for(var $=0,U=new Array(Y);$<Y;$++)U[$]=q[$];return U}function X(q,Y){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if($>Y)return[];var U=[];return q.forEach(function(se){se.children&&(U=[].concat(I(U),[se.value],I(X(se.children,Y,$+1))))}),U}sr(H,"propTypes",{nodes:m().arrayOf(we).isRequired,checkModel:m().oneOf([B.LEAF,B.ALL]),checked:te,direction:m().string,disabled:m().bool,expandDisabled:m().bool,expandOnClick:m().bool,expanded:te,icons:qe,iconsClass:m().string,id:m().string,lang:We,name:m().string,nameAsArray:m().bool,nativeCheckboxes:m().bool,noCascade:m().bool,onlyLeafCheckboxes:m().bool,optimisticToggle:m().bool,showExpandAll:m().bool,showNodeIcon:m().bool,showNodeTitle:m().bool,onCheck:m().func,onClick:m().func,onExpand:m().func}),sr(H,"defaultProps",{checkModel:B.LEAF,checked:[],direction:"ltr",disabled:!1,expandDisabled:!1,expandOnClick:!1,expanded:[],icons:{check:v().createElement("span",{className:"rct-icon rct-icon-check"}),uncheck:v().createElement("span",{className:"rct-icon rct-icon-uncheck"}),halfCheck:v().createElement("span",{className:"rct-icon rct-icon-half-check"}),expandClose:v().createElement("span",{className:"rct-icon rct-icon-expand-close"}),expandOpen:v().createElement("span",{className:"rct-icon rct-icon-expand-open"}),expandAll:v().createElement("span",{className:"rct-icon rct-icon-expand-all"}),collapseAll:v().createElement("span",{className:"rct-icon rct-icon-collapse-all"}),parentClose:v().createElement("span",{className:"rct-icon rct-icon-parent-close"}),parentOpen:v().createElement("span",{className:"rct-icon rct-icon-parent-open"}),leaf:v().createElement("span",{className:"rct-icon rct-icon-leaf"})},iconsClass:"fa4",id:null,lang:{collapseAll:"Collapse all",expandAll:"Expand all",toggle:"Toggle"},name:void 0,nameAsArray:!1,nativeCheckboxes:!1,noCascade:!1,onlyLeafCheckboxes:!1,optimisticToggle:!0,showExpandAll:!1,showNodeIcon:!0,showNodeTitle:!1,onCheck:function(){},onClick:null,onExpand:function(){}});const me=H})(),a})())})(KW);var Z8e=KW.exports;const Q8e=ui(Z8e);function J8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZW(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t9e(i.key),i)}}function e9e(e,t,r){return t&&ZW(e.prototype,t),r&&ZW(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function t9e(e){var t=r9e(e,"string");return typeof t=="symbol"?t:String(t)}function r9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&MD(e,t)}function MD(e,t){return MD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},MD(e,t)}function i9e(e){var t=s9e();return function(){var i=ST(e),n;if(t){var o=ST(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return o9e(this,n)}}function o9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a9e(e)}function a9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ST(e){return ST=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ST(e)}let QW=function(e){n9e(r,e);var t=i9e(r);function r(i){var n;J8e(this,r),n=t.call(this,i),n.localTracks=Vl.filter(c=>c.local&&!c.hidden).map(c=>{const u={...c};return u.datatype=c.datatype[0],u}),n.augmentedTracksInfo=Vl,window.higlassTracksByType&&Object.keys(window.higlassTracksByType).forEach(c=>{n.augmentedTracksInfo.push(window.higlassTracksByType[c].config)}),i.datatype?n.localTracks=n.localTracks.filter(c=>c.datatype[0]===i.datatype):n.localTracks=n.localTracks.filter(c=>c.orientation===n.props.orientation),n.localTracks.forEach(c=>{c.uuid=xt.nice()});const o=n.prepareNewEntries("",n.localTracks,{}),a=Object.keys(o),s=a.length?[a[0]]:null;return n.mounted=!1,n.state={selectedUuid:s,options:o,filter:"",checked:[],expanded:[]},n.requestTilesetLists(),n}return e9e(r,[{key:"componentDidMount",value:function(){this.mounted=!0,this.requestTilesetLists(),this.searchBox.focus()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"prepareNewEntries",value:function(n,o,a){const s=a;return o.map(u=>({...u,server:n,tilesetUid:u.uuid,serverUidKey:this.serverUidKey(n,u.uuid),datatype:u.datatype,name:u.name,uid:xt.nice()})).forEach(u=>{s[u.serverUidKey]=u}),s}},{key:"serverUidKey",value:function(n,o){return`${n}/${o}`}},{key:"requestTilesetLists",value:function(){let n=null;if(this.props.datatype?n=`dt=${this.props.datatype}`:n=[...new Set([].concat(...this.augmentedTracksInfo.filter(a=>a.datatype).filter(a=>a.orientation===this.props.orientation||this.props.orientation==="1d-vertical"&&a.orientation==="1d-horizontal").map(a=>a.datatype)))].map(a=>`dt=${a}`).join("&"),!this.props.trackSourceServers){console.warn("No track source servers specified in the viewconf");return}this.props.trackSourceServers.forEach(o=>{Ke.json(`${o}/tilesets/?limit=10000&${n}`,(a,s)=>{if(a)console.error("ERROR:",a);else{const c=this.prepareNewEntries(o,s.results,this.state.options),u=Object.keys(c);let{selectedUuid:l}=this.state;if(!l){l=u.length?[u[0]]:null;const h=this.state.options[l[0]];this.props.selectedTilesetChanged([h])}this.mounted&&this.setState({selectedUuid:l,options:c})}},this.props.pubSub)})}},{key:"handleOptionDoubleClick",value:function(n){const o=this.state.options[n.target.value];this.props.onDoubleClick(o)}},{key:"handleSelectedOptions",value:function(n){const o=[],a=[];for(let s=0;s<n.length;s++)o.push(n[s]),a.push(this.state.options[n[s]]);this.props.selectedTilesetChanged(a),this.setState({selectedUuid:o})}},{key:"handleSelect",value:function(){const{selectedOptions:n}=this.multiSelect,o=[];for(let a=0;a<n.length;a++){const s=n[a];o.push(s.value)}this.handleSelectedOptions(o)}},{key:"handleSearchChange",value:function(){const n=this.searchBox;this.setState({filter:n.value})}},{key:"partitionByGroup",value:function(n,o){const a={"":{name:"",value:"",children:[]}};for(const c of Object.keys(n)){const u=n[c];if(u.name.toLowerCase().includes(o))if("project_name"in u){const l=u.project_name;l in a||(a[l]={value:l,label:l,children:[]}),a[l].children.push({label:u.name,value:c})}else a[""].children.push({label:u.name,value:c})}const s=a[""].children;for(const c of Object.keys(a))c!==""&&(a[c].children.sort((u,l)=>u.label.toLowerCase().localeCompare(l.label.toLowerCase(),"en")),s.push(a[c]));return s.sort((c,u)=>c.label.toLowerCase().localeCompare(u.label.toLowerCase(),"en")),s}},{key:"handleChecked",value:function(n){this.handleSelectedOptions(n),this.setState({checked:n})}},{key:"handleExpanded",value:function(n){this.setState({expanded:n})}},{key:"render",value:function(){const n=[];for(const u in this.state.options)n.push(this.state.options[u]);const o=this.partitionByGroup(this.state.options,this.state.filter),a={width:15,height:15,top:2,right:2,position:"relative"},s=JSON.parse(JSON.stringify(a));s.opacity=.5;const c=E.createElement("form",{onSubmit:u=>{u.preventDefault()}},E.createElement("div",{className:"tileset-finder-search-bar"},E.createElement("span",{className:"tileset-finder-label"},"Select tileset:"),E.createElement("input",{ref:u=>{this.searchBox=u},className:"tileset-finder-search-box",onChange:this.handleSearchChange.bind(this),placeholder:"Search Term",type:"text"})),E.createElement("div",{className:"tileset-finder-checkbox-tree"},E.createElement(Q8e,{checked:this.state.checked,expanded:this.state.expanded,icons:{uncheck:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#square_o"})),check:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#check_square_o"})),halfCheck:E.createElement("svg",{style:s},E.createElement("use",{xlinkHref:"#check_square_o"})),leaf:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#file_o"})),expandClose:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#chevron_right"})),expandOpen:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#chevron_down"})),parentClose:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#folder_o"})),parentOpen:E.createElement("svg",{style:a},E.createElement("use",{xlinkHref:"#folder_open_o"}))},nodes:o,onCheck:this.handleChecked.bind(this),onExpand:this.handleExpanded.bind(this)})));return E.createElement("div",null,c)}}]),r}(E.Component);QW.propTypes={datatype:N.string,orientation:N.string,onDoubleClick:N.func,pubSub:N.object.isRequired,selectedTilesetChanged:N.func,trackSourceServers:N.array};const l9e=Rf(QW);function c9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JW(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f9e(i.key),i)}}function u9e(e,t,r){return t&&JW(e.prototype,t),r&&JW(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f9e(e){var t=h9e(e,"string");return typeof t=="symbol"?t:String(t)}function h9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&LD(e,t)}function LD(e,t){return LD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},LD(e,t)}function p9e(e){var t=v9e();return function(){var i=wT(e),n;if(t){var o=wT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return m9e(this,n)}}function m9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return g9e(e)}function g9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wT(e){return wT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wT(e)}let eY=function(e){d9e(r,e);var t=p9e(r);function r(i){var n;return c9e(this,r),n=t.call(this,i),n.DATATYPE_TO_TRACK_TYPE=BS(n.props.orientation),n.AVAILABLE_TRACK_TYPES=ly(n.props.datatypes,n.props.orientation),n.state={selectedPlotType:n.AVAILABLE_TRACK_TYPES[0]},n}return u9e(r,[{key:"UNSAFE_componentWillReceiveProps",value:function(n){if(this.AVAILABLE_TRACK_TYPES=ly(n.datatypes,this.props.orientation),!!this.AVAILABLE_TRACK_TYPES&&n.allTracksSameDatatype&&this.AVAILABLE_TRACK_TYPES.length>0&&!this.AVAILABLE_TRACK_TYPES.includes(this.state.selectedPlotType)){const o=jS(n.datatypes[0][0],this.props.position,this.AVAILABLE_TRACK_TYPES);this.handlePlotTypeSelected(o)}}},{key:"handlePlotTypeSelected",value:function(n){this.setState({selectedPlotType:n}),this.props.onPlotTypeSelected(n.type)}},{key:"render",value:function(){let n="No plot types available for track";const o={};return Vl.forEach(a=>{o[a.type]=a}),this.AVAILABLE_TRACK_TYPES&&(n=this.AVAILABLE_TRACK_TYPES.sort((a,s)=>a.type<s.type).map(a=>{const s=o[a.type].thumbnail,c=this.state.selectedPlotType.type===a.type?"plot-type-item plot-type-selected":"plot-type-item",u=o[a.type].thumbnail?E.createElement("div",{className:"track-thumbnail",dangerouslySetInnerHTML:{__html:s.outerHTML}}):E.createElement("div",{className:"track-thumbnail"},E.createElement("svg",{height:20,width:30}));return E.createElement("li",{key:a.type,className:c,onClick:l=>{this.setState({selectedPlotType:a}),this.props.onPlotTypeSelected(a.type)},style:{listStyle:"none",paddingLeft:5,paddingBottom:0}},u,E.createElement("span",{style:{verticalAlign:"middle"}},a.type))})),E.createElement("div",null,n.length>0&&this.props.allTracksSameDatatype&&E.createElement("div",{className:"plot-type-container"},n),!this.props.allTracksSameDatatype&&E.createElement("div",{className:"plot-type-container-empty"},"Datasets with multiple datatypes chosen. They will be added with their default track types."))}}]),r}(E.Component);eY.propTypes={allTracksSameDatatype:N.bool,datatypes:N.array,orientation:N.string,onPlotTypeSelected:N.func,position:N.string};const GXe={"collapse-toggle-icon":"_collapse-toggle-icon_ub7s6_1",collapsed:"_collapsed_ub7s6_9","modal-title":"_modal-title_ub7s6_14","modal-container":"_modal-container_ub7s6_19",modal:"_modal_ub7s6_14","modal-backdrop":"_modal-backdrop_ub7s6_23","modal-dialog":"_modal-dialog_ub7s6_27"};function y9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_9e(i.key),i)}}function b9e(e,t,r){return t&&tY(e.prototype,t),r&&tY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _9e(e){var t=T9e(e,"string");return typeof t=="symbol"?t:String(t)}function T9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function E9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BD(e,t)}function BD(e,t){return BD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},BD(e,t)}function S9e(e){var t=A9e();return function(){var i=OT(e),n;if(t){var o=OT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return w9e(this,n)}}function w9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AT(e)}function AT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function OT(e){return OT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},OT(e)}let kT=function(e){E9e(r,e);var t=S9e(r);function r(i){var n;return y9e(this,r),n=t.call(this,i),n.options={},n.state={selectedTilesets:[{datatype:"none"}],allTracksSameDatatype:!0},n.handleSubmitBound=n.handleSubmit.bind(AT(n)),n.handleTilesetPickerDoubleClickBound=n.handleTilesetPickerDoubleClick.bind(AT(n)),n.selectedTilesetsChangedBound=n.selectedTilesetsChanged.bind(AT(n)),n}return b9e(r,[{key:"getOrientation",value:function(n){let o=null;return n==="top"||n==="bottom"?o="1d-horizontal":n==="left"||n==="right"?o="1d-vertical":o="2d",o}},{key:"handleSubmit",value:function(n){n&&n.preventDefault(),this.props.onTracksChosen(this.state.selectedTilesets,this.props.position,this.props.host)}},{key:"handleTilesetPickerDoubleClick",value:function(n){this.selectedTilesetsChanged([n]),this.props.onTracksChosen(this.state.selectedTilesets,this.props.position,this.props.host)}},{key:"handleOptionsChanged",value:function(n){this.options=n}},{key:"handlePlotTypeSelected",value:function(n){const{selectedTilesets:o}=this.state;for(const a of o)a.type=n;this.selectedPlotType=n,this.setState({selectedTilesets:o})}},{key:"selectedTilesetsChanged",value:function(n){let o=null;n.length===0?o=[{datatype:"none"}]:o=n;let a=!0;const s=o[0].datatype;for(const c of o)c.datatype!==s&&(a=!1);if(a)for(const c of o)c.type=this.selectedPlotType;else for(const c of o){let u=[c.datatype];const l=this.getOrientation(this.props.position);c.filetype==="cooler"&&(u=[c.datatype,"chromsizes"]);const h=ly([u],l),f=jS(u[0],this.props.position,h);c.type=f.type}this.setState({selectedTilesets:o,allTracksSameDatatype:a})}},{key:"render",value:function(){const n=this.getOrientation(this.props.position),o=E.createElement("div",null,E.createElement(l9e,{ref:a=>{this.tilesetFinder=a},datatype:this.props.datatype,onDoubleClick:this.handleTilesetPickerDoubleClick.bind(this),onTracksChosen:a=>this.props.onTracksChosen(a,this.props.position),orientation:n,selectedTilesetChanged:this.selectedTilesetsChanged.bind(this),trackSourceServers:this.props.trackSourceServers}));return E.createElement(og,{maxHeight:!0,okayTitle:"Submit",onCancel:this.props.onCancel,onOkay:this.handleSubmitBound,title:"Add Track"},E.createElement(E.Fragment,null,o,E.createElement(eY,{ref:a=>{this.plotTypeChooser=a},allTracksSameDatatype:this.state.allTracksSameDatatype,datatypes:this.state.selectedTilesets.map(a=>a.filetype==="cooler"?[a.datatype,"chromsizes"]:[a.datatype]),onPlotTypeSelected:this.handlePlotTypeSelected.bind(this),orientation:n,position:this.props.position})))}}]),r}(E.Component);kT.defaultProps={position:"top"},kT.propTypes={datatype:N.string,host:N.string,onCancel:N.func.isRequired,onTracksChosen:N.func.isRequired,position:N.string,trackSourceServers:N.array.isRequired};function HD(){return HD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},HD.apply(this,arguments)}function O9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,I9e(i.key),i)}}function k9e(e,t,r){return t&&rY(e.prototype,t),r&&rY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function I9e(e){var t=C9e(e,"string");return typeof t=="symbol"?t:String(t)}function C9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function P9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&FD(e,t)}function FD(e,t){return FD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},FD(e,t)}function D9e(e){var t=R9e();return function(){var i=IT(e),n;if(t){var o=IT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return x9e(this,n)}}function x9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N9e(e)}function N9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function IT(e){return IT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},IT(e)}let $D=function(e){P9e(r,e);var t=D9e(r);function r(){return O9e(this,r),t.apply(this,arguments)}return k9e(r,[{key:"render",value:function(){const n=[];return this.props.children.forEach((o,a)=>{const s=`customTrackDialog_${a}`;n.push(E.createElement(o,HD({key:s},this.props.bodyProps[a])))}),E.createElement(og,{maxHeight:!0,okayOnly:!0,okayTitle:"Close",onCancel:this.props.onCancel,onOkay:this.props.onCancel,title:this.props.title},n)}}]),r}(E.PureComponent);$D.defaultProps={},$D.propTypes={onCancel:N.func.isRequired,title:N.string,bodyProps:N.array,children:N.array};function M9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,B9e(i.key),i)}}function L9e(e,t,r){return t&&nY(e.prototype,t),r&&nY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function B9e(e){var t=H9e(e,"string");return typeof t=="symbol"?t:String(t)}function H9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jD(e,t)}function jD(e,t){return jD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},jD(e,t)}function $9e(e){var t=G9e();return function(){var i=CT(e),n;if(t){var o=CT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return j9e(this,n)}}function j9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U9e(e)}function U9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function CT(e){return CT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},CT(e)}const iY=20;let pl=function(e){F9e(r,e);var t=$9e(r);function r(i){var n;return M9e(this,r),n=t.call(this,i),n.adjusted=!1,n.state={orientation:n.props.orientation?n.props.orientation:"right",left:n.props.position.left,top:n.props.position.top,submenuShown:null},n}return L9e(r,[{key:"componentDidMount",value:function(){this.updateOrientation()}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){this.adjusted=!1,this.setState({left:n.position.left,top:n.position.top})}},{key:"componentDidUpdate",value:function(){this.updateOrientation()}},{key:"handleItemMouseEnterWithRect",value:function(n,o){this.setState({submenuShown:o,submenuSourceBbox:n})}},{key:"handleItemMouseEnter",value:function(n,o){this.handleItemMouseEnterWithRect(n.currentTarget.getBoundingClientRect(),o)}},{key:"handleMouseLeave",value:function(){}},{key:"handleOtherMouseEnter",value:function(){this.setState({submenuShown:null})}},{key:"updateOrientation",value:function(){if(this.adjusted)return;this.adjusted=!0,this.divDom=Lr.findDOMNode(this.div);const n=this.divDom.getBoundingClientRect(),o=this.props.parentBbox?this.props.parentBbox:{top:this.props.position.top,left:this.props.position.left,width:0,height:0};let a=this.state.orientation,s=o.top;if(o.top+n.height>window.innerHeight&&(o.top-n.height>0?s=o.top-n.height+iY:(s=o.top-n.height+iY,s-=s+n.height-window.innerHeight)),this.state.orientation==="left"){let c=o.left-n.width;c<0&&(o.left+o.width+n.width>window.innerWidth?c=0:(c=o.left+o.width,a="right")),this.setState({left:c,top:s,orientation:a})}else{let c=o.left+o.width;o.left+o.width+n.width>window.innerWidth&&(o.left-n.width<0?(c=0,a="right"):(c=o.left-n.width,a="left")),this.setState({left:c,top:s,orientation:a})}}},{key:"render",value:function(){const n=this.state.left?{left:this.state.left}:{right:this.state.right},o={top:this.state.top},a=Object.assign(n,o);return E.createElement("div",{ref:s=>{this.div=s},className:Zt("context-menu-item",mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),style:a},this.props.children)}}]),r}(E.Component);pl.propTypes={children:N.node,orientation:N.string,parentBbox:N.object,position:N.object,theme:N.symbol.isRequired};function z9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,W9e(i.key),i)}}function V9e(e,t,r){return t&&oY(e.prototype,t),r&&oY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function W9e(e){var t=Y9e(e,"string");return typeof t=="symbol"?t:String(t)}function Y9e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function q9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&UD(e,t)}function UD(e,t){return UD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},UD(e,t)}function X9e(e){var t=Q9e();return function(){var i=PT(e),n;if(t){var o=PT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return K9e(this,n)}}function K9e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z9e(e)}function Z9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q9e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function PT(e){return PT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},PT(e)}let GD=function(e){q9e(r,e);var t=X9e(r);function r(){return z9e(this,r),t.apply(this,arguments)}return V9e(r,[{key:"getSubmenu",value:function(){if(this.state.submenuShown){const n=this.state.submenuSourceBbox,o=this.state.orientation==="left"?{left:this.state.left,top:n.top}:{left:this.state.left+n.width+7,top:n.top},a=this.state.submenuShown;return E.createElement(r,{menuItems:a.children,orientation:this.state.orientation,parentBbox:n,position:o,theme:this.props.theme})}return E.createElement("div",null)}},{key:"componentWillUnmount",value:function(){}},{key:"render",value:function(){const n=[];for(const o in this.props.menuItems){const a=this.props.menuItems[o];n.push(E.createElement(St,{key:o,onClick:a.handler?a.handler:()=>null,onMouseEnter:a.children?s=>this.handleItemMouseEnter(s,a):this.handleOtherMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave},a.name,a.children&&E.createElement("svg",{className:mt["play-icon"]},E.createElement("use",{xlinkHref:"#play"}))))}return E.createElement("div",{ref:o=>{this.div=o},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),style:{left:this.state.left,top:this.state.top}},n,this.getSubmenu())}}]),r}(pl);function J9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t7e(i.key),i)}}function e7e(e,t,r){return t&&aY(e.prototype,t),r&&aY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function t7e(e){var t=r7e(e,"string");return typeof t=="symbol"?t:String(t)}function r7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zD(e,t)}function zD(e,t){return zD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},zD(e,t)}function i7e(e){var t=s7e();return function(){var i=DT(e),n;if(t){var o=DT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return o7e(this,n)}}function o7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a7e(e)}function a7e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function DT(e){return DT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},DT(e)}let l7e=function(e){n7e(r,e);var t=i7e(r);function r(){return J9e(this,r),t.apply(this,arguments)}return e7e(r,[{key:"getConfigureSeriesMenu",value:function(n,o,a){const s={},c=window.higlassTracksByType&&window.higlassTracksByType[a.type]&&window.higlassTracksByType[a.type].config&&window.higlassTracksByType[a.type].config.optionsInfo;if(c)for(const u of Object.keys(c))wn[u]=c[u];if(!dr[a.type]||!dr[a.type].availableOptions)return null;for(const u of dr[a.type].availableOptions)if(u in wn){if(s[u]={name:wn[u].name},wn[u].generateOptions){const l=wn[u].generateOptions(a);s[u].children||(s[u].children={});for(const h of l){const f={name:h.name,value:h.value,handler:()=>{a.options[u]=h.value,this.props.onTrackOptionsChanged(a.uid,a.options),this.props.closeMenu()}};s[u].children[h.value]=f}}if(wn[u].inlineOptions)for(const l in wn[u].inlineOptions){const h=wn[u].inlineOptions[l];s[u].children||(s[u].children={});const f={name:h.name,value:h.value};h.componentPickers&&h.componentPickers[a.type]?f.handler=()=>{this.props.onConfigureTrack(a,h.componentPickers[a.type]),this.props.closeMenu()}:f.handler=()=>{a.options[u]=h.value,this.props.onTrackOptionsChanged(a.uid,a.options),this.props.closeMenu()},s[u].children[l]=f}else wn[u].componentPickers&&wn[u].componentPickers[a.type]&&(s[u].handler=()=>{this.props.onConfigureTrack(a,wn[u].componentPickers[a.type]),this.props.closeMenu()})}return E.createElement(GD,{key:"config-series-menu",closeMenu:this.props.closeMenu,menuItems:s,orientation:this.state.orientation,parentBbox:o,position:n,theme:this.props.theme})}},{key:"getTrackTypeItems",value:function(n,o,a){window.higlassTracksByType&&Object.keys(window.higlassTracksByType).forEach(h=>{dr[h]=window.higlassTracksByType[h].config});let{datatype:s}=a,c=null;a.type in dr&&(s||(s=dr[a.type].datatype[0]),{orientation:c}=dr[a.type]);const u=Object.values(dr).filter(h=>h.datatype).filter(h=>h.orientation).filter(h=>h.datatype.includes(s)).filter(h=>h.orientation===c).map(h=>h.type),l={};for(let h=0;h<u.length;h++)l[u[h]]={value:u[h],name:u[h],handler:()=>{this.props.onChangeTrackType(a.uid,u[h])}};return E.createElement(GD,{key:"track-type-items",closeMenu:this.props.closeMenu,menuItems:l,orientation:this.state.orientation,parentBbox:o,position:n,theme:this.props.theme})}},{key:"getSubmenu",value:function(){if(this.state.submenuShown){const n=this.state.submenuSourceBbox,o=this.state.orientation==="left"?{left:this.state.left,top:n.top}:{left:this.state.left+n.width+7,top:n.top},a=this.state.submenuShown,s=a.value;return a.option==="track-type"?this.getTrackTypeItems(o,n,s):this.getConfigureSeriesMenu(o,n,s)}return E.createElement("div",null)}},{key:"getDivideByMenuItem",value:function(){if(this.props.series.data&&this.props.series.data.type==="divided"){const n={tilesetUid:this.props.series.data.children[0].tilesetUid,server:this.props.series.data.children[0].server};return E.createElement(St,{className:mt["context-menu-item"],onClick:()=>this.props.onChangeTrackData(this.props.series.uid,n),onMouseEnter:o=>this.handleOtherMouseEnter(o)},E.createElement("span",{className:mt["context-menu-span"]},"Remove divisor"))}return E.createElement(St,{className:mt["context-menu-item"],onClick:()=>this.props.onAddDivisor(this.props.series),onMouseEnter:n=>this.handleOtherMouseEnter(n)},E.createElement("span",{className:mt["context-menu-span"]},"Divide by"))}},{key:"componentWillUnmount",value:function(){}},{key:"render",value:function(){let n=null;dr[this.props.series.type]&&dr[this.props.series.type].exportable&&(n=E.createElement(St,{className:mt["context-menu-item"],onClick:()=>this.props.onExportData(this.props.hostTrack.uid,this.props.track.uid),onMouseEnter:a=>this.handleOtherMouseEnter(a)},E.createElement("span",{className:mt["context-menu-span"]},"Export Data")));const o=this.props.onAddSeries?E.createElement(St,{className:mt["context-menu-item"],onClick:()=>{this.props.onCloseTrack(this.props.series.uid),this.props.onAddSeries(this.props.hostTrack.uid)},onMouseEnter:a=>this.handleOtherMouseEnter(a)},E.createElement("span",{className:mt["context-menu-span"]},"Replace Series")):null;return E.createElement("div",{ref:a=>{this.div=a},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),"data-menu-type":"SeriesListMenu",onMouseLeave:this.props.handleMouseLeave,style:{left:this.state.left,top:this.state.top}},E.createElement(St,{onClick:()=>{},onMouseEnter:a=>this.handleItemMouseEnter(a,{option:"configure-series",value:this.props.track}),onMouseLeave:a=>this.handleMouseLeave(a)},"Configure Series",E.createElement("svg",{className:mt["play-icon"]},E.createElement("use",{xlinkHref:"#play"}))),E.createElement(St,{className:mt["context-menu-item"],onClick:()=>{},onMouseEnter:a=>this.handleItemMouseEnter(a,{option:"track-type",value:this.props.track}),onMouseLeave:a=>this.handleMouseLeave(a)},E.createElement("span",{className:mt["context-menu-span"]},"Track Type",E.createElement("svg",{className:mt["play-icon"]},E.createElement("use",{xlinkHref:"#play"})))),n,this.getDivideByMenuItem(),E.createElement(St,{className:mt["context-menu-item"],onClick:this.props.onCloseTrack,onMouseEnter:a=>this.handleOtherMouseEnter(a)},E.createElement("span",{className:mt["context-menu-span"]},"Close Series")),o,this.getSubmenu())}}]),r}(pl);const sY=e=>{let t=[];for(const r of e)r.contents?t=t.concat(r.contents):t.push(r);return t},VD=(e,t,r,i)=>e?(window.higlassTracksByType&&Object.keys(window.higlassTracksByType).forEach(n=>{dr[n]=window.higlassTracksByType[n].config}),sY(e).map(n=>{const o=dr[n.type]?dr[n.type].thumbnail:null,a=o?E.createElement("div",{className:mt["context-menu-icon"],dangerouslySetInnerHTML:{__html:o.outerHTML}}):E.createElement("div",{className:mt["context-menu-icon"]},E.createElement("svg",null));return E.createElement(St,{key:n.uid,className:mt["context-menu-item"],onClick:()=>{i&&i(n.uid)},onMouseEnter:s=>{t&&t(s,n)},onMouseLeave:s=>{r&&r(s)}},a,E.createElement("span",{className:mt["context-menu-span"]},n.options&&n.options.name&&n.options.name.length?n.options.name:n.type,t&&r?E.createElement("svg",{className:mt["play-icon"]},E.createElement("use",{xlinkHref:"#play"})):null))})):null;function c7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f7e(i.key),i)}}function u7e(e,t,r){return t&&lY(e.prototype,t),r&&lY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f7e(e){var t=h7e(e,"string");return typeof t=="symbol"?t:String(t)}function h7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WD(e,t)}function WD(e,t){return WD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},WD(e,t)}function p7e(e){var t=v7e();return function(){var i=xT(e),n;if(t){var o=xT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return m7e(this,n)}}function m7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return g7e(e)}function g7e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xT(e){return xT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xT(e)}const cY=Z_(e=>function(t){d7e(i,t);var r=p7e(i);function i(){return c7e(this,i),r.apply(this,arguments)}return u7e(i,[{key:"getSubmenu",value:function(){if(this.state.submenuShown){const o=this.state.submenuSourceBbox;let a=null;this.state.orientation==="left"?a={left:this.state.left,top:o.top}:a={left:this.state.left+o.width+7,top:o.top};const c=sY(this.props.tracks).filter(l=>l.uid===this.state.submenuShown.uid)[0],u=c&&c.position!=="whole";return E.createElement(l7e,{key:`series-list-menu-${c.uid}`,ref:l=>{this.seriesListMenu=l},closeMenu:this.props.closeMenu,hostTrack:this.props.tracks[0],onAddDivisor:this.props.onAddDivisor,onAddSeries:u?this.props.onAddSeries:null,onChangeTrackData:this.props.onChangeTrackData,onChangeTrackType:this.props.onChangeTrackType,onCloseTrack:()=>this.props.onCloseTrack(this.state.submenuShown.uid),onConfigureTrack:this.props.onConfigureTrack,onDivideSeries:this.props.onDivideSeries,onExportData:this.props.onExportData,onLockScales:this.props.onLockScales,onTrackOptionsChanged:this.props.onTrackOptionsChanged,orientation:this.state.orientation,parentBbox:o,position:a,series:this.state.submenuShown,theme:this.props.theme,track:c,trackOrientation:this.props.trackOrientation,trackSourceServers:this.props.trackSourceServers})}return E.createElement("div",null)}}]),i}(e));function y7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_7e(i.key),i)}}function b7e(e,t,r){return t&&uY(e.prototype,t),r&&uY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _7e(e){var t=T7e(e,"string");return typeof t=="symbol"?t:String(t)}function T7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NT(){return typeof Reflect<"u"&&Reflect.get?NT=Reflect.get.bind():NT=function(t,r,i){var n=E7e(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?t:i):o.value}},NT.apply(this,arguments)}function E7e(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Kh(e),e!==null););return e}function S7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YD(e,t)}function YD(e,t){return YD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},YD(e,t)}function w7e(e){var t=k7e();return function(){var i=Kh(e),n;if(t){var o=Kh(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return A7e(this,n)}}function A7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O7e(e)}function O7e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Kh(e){return Kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kh(e)}let I7e=function(e){S7e(r,e);var t=w7e(r);function r(i){var n;return y7e(this,r),n=t.call(this,i),n.seriesRefs={},n.seriesListMenu=null,n}return b7e(r,[{key:"componentDidMount",value:function(){NT(Kh(r.prototype),"componentDidMount",this).call(this)}},{key:"render",value:function(){return E.createElement("div",{ref:n=>{this.div=n},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),"data-menu-type":"ConfigTrackMenu",style:{left:this.state.left,top:this.state.top}},VD(this.props.tracks,this.handleItemMouseEnter.bind(this),this.handleMouseLeave.bind(this),null),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{contextMenu:this,onClick:()=>this.props.onLockValueScale(this.props.tracks[0].uid),onMouseEnter:n=>this.handleOtherMouseEnter(n)},"Lock Value Scale With"),E.createElement(St,{contextMenu:this,onClick:()=>this.props.onUnlockValueScale(this.props.tracks[0].uid),onMouseEnter:n=>this.handleOtherMouseEnter(n)},"Unlock Value Scale"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{contextMenu:this,onClick:()=>this.props.onAddSeries(this.props.tracks[0].uid),onMouseEnter:n=>this.handleOtherMouseEnter(n)},"Add Series"),E.createElement(St,{onClick:()=>this.props.onCloseTrack(this.props.tracks[0].uid)},"Close Track"),E.createElement(St,{onClick:()=>{this.props.onReplaceTrack(this.props.tracks[0].uid,this.props.trackOrientation)}},"Replace Track"),this.getSubmenu())}}]),r}(mh(pl).with(cY));function fY(e){return E.createElement("div",null,VD(e.tracks,null,null,e.onCloseTrack),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:()=>e.onCloseTrack(e.tracks[0].uid)},"Close all series"))}fY.propTypes={onCloseTrack:N.func.isRequired,tracks:N.array.isRequired};function C7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,D7e(i.key),i)}}function P7e(e,t,r){return t&&hY(e.prototype,t),r&&hY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function D7e(e){var t=x7e(e,"string");return typeof t=="symbol"?t:String(t)}function x7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function N7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qD(e,t)}function qD(e,t){return qD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},qD(e,t)}function R7e(e){var t=L7e();return function(){var i=MT(e),n;if(t){var o=MT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return M7e(this,n)}}function M7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RT(e)}function RT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function MT(e){return MT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},MT(e)}let ml=function(e){N7e(r,e);var t=R7e(r);function r(i){var n;return C7e(this,r),n=t.call(this,i),n.clickHandlerBound=n.clickHandler.bind(RT(n)),n.contextMenuHandlerBound=n.contextMenuHandler.bind(RT(n)),n.resizeHandlerBound=n.resizeHandler.bind(RT(n)),n}return P7e(r,[{key:"componentDidMount",value:function(){this.popup=document.createElement("div"),document.body.appendChild(this.popup),this.popup.style.zIndex=99,this.popup.style.position="absolute",this.popup.className="hg-popup",document.addEventListener("click",this.clickHandlerBound,!0),document.addEventListener("contextmenu",this.contextMenuHandlerBound,!0),window.addEventListener("resize",this.resizeHandlerBound,!0),this._renderLayer()}},{key:"componentDidUpdate",value:function(){this._renderLayer()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.clickHandlerBound,!0),document.removeEventListener("contextmenu",this.contextMenuHandlerBound,!0),window.removeEventListener("resize",this.resizeHandlerBound,!0),Lr.unmountComponentAtNode(this.popup),document.body.removeChild(this.popup)}},{key:"_renderLayer",value:function(){Lr.render(this.props.children,this.popup)}},{key:"clickHandler",value:function(n){this.popup.contains(n.target)||this.props.onMenuClosed&&this.props.onMenuClosed(n)}},{key:"contextMenuHandler",value:function(n){n.altKey||(n.preventDefault(),this.clickHandler(n))}},{key:"resizeHandler",value:function(){this.props.onMenuClosed(null)}},{key:"render",value:function(){return E.createElement("div",null)}}]),r}(E.Component);ml.defaultProps={onMenuClosed:x5},ml.propTypes={children:N.node.isRequired,onMenuClosed:N.func};const B7e=zL(e=>E.createElement(X3,{className:e.className,controlAlignLeft:e.controlAlignLeft,editable:e.editable,handleConfigTrack:e.handleConfigTrack,handleResizeTrack:e.handleResizeTrack,height:e.height,item:e.item,onAddSeries:e.onAddSeries,onCloseTrack:e.onCloseTrack,onCloseTrackMenuOpened:e.onCloseTrackMenuOpened,onConfigTrackMenuOpened:e.onConfigTrackMenuOpened,resizeHandles:e.resizeHandles,uid:e.uid,width:e.width})),H7e={"vertical-tiled-plot":"_vertical-tiled-plot_f3ho8_1"};function F7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,j7e(i.key),i)}}function $7e(e,t,r){return t&&dY(e.prototype,t),r&&dY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function j7e(e){var t=U7e(e,"string");return typeof t=="symbol"?t:String(t)}function U7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function G7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XD(e,t)}function XD(e,t){return XD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},XD(e,t)}function z7e(e){var t=W7e();return function(){var i=BT(e),n;if(t){var o=BT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return V7e(this,n)}}function V7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LT(e)}function LT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W7e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function BT(e){return BT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},BT(e)}function pY(e){return e&&e.sourceEvent}let KD=function(e){G7e(r,e);var t=z7e(r);function r(i){var n;return F7e(this,r),n=t.call(this,i),n.brushBehavior=Pd().on("start",n.brushStarted.bind(LT(n))).on("brush",n.brushed.bind(LT(n))).on("end",n.brushedEnded.bind(LT(n))),n}return $7e(r,[{key:"componentDidMount",value:function(){this.props.isRangeSelectionActive&&this.addBrush()}},{key:"shouldComponentUpdate",value:function(n,o){if(this.rangeSelectionTriggered)return this.rangeSelectionTriggered=!1,this.rangeSelectionTriggeredEnd&&this.props.rangeSelection!==n.rangeSelection&&this.moveBrush(n.rangeSelection[0]?n.rangeSelection[0]:null,!0),this.rangeSelectionTriggeredEnd=!1,this.state!==o;if(this.props.rangeSelection!==n.rangeSelection){const a=this.props.is1dRangeSelection?0:1;return this.moveBrush(n.rangeSelection[a]?n.rangeSelection[a]:null,n.rangeSelectionEnd),this.state!==o}return!0}},{key:"componentDidUpdate",value:function(){this.props.isRangeSelectionActive?this.addBrush():this.removeBrush()}},{key:"addBrush",value:function(){!this.brushEl||this.brushElAddedBefore===this.brushEl||(this.brushElAddedBefore&&this.brushElAddedBefore.on(".brush",null),this.brushEl.call(this.brushBehavior),this.brushElAddedBefore=this.brushEl,Bu(this.brushEl,To["track-range-selection-group-brush-selection"]))}},{key:"brushed",value:function(n){const o=this.rangeSelectionMoved;this.rangeSelectionMoved=!1,!(!pY(n)||!this.props.onRangeSelection||o)&&(this.rangeSelectionTriggered=!0,this.props.onRangeSelection(n.selection))}},{key:"brushStarted",value:function(n){!pY(n)||!n.selection||this.props.onRangeSelectionStart()}},{key:"brushedEnded",value:function(n){if(!this.props.is1dRangeSelection)return;const o=this.rangeSelectionMovedEnd;this.rangeSelectionMovedEnd=!1,n.selection&&n.sourceEvent&&this.props.onRangeSelection&&!o&&(this.rangeSelectionTriggered=!0,this.rangeSelectionTriggeredEnd=!0,this.props.onRangeSelectionEnd(n.selection)),n.selection||(this.rangeSelectionTriggered=!0,this.props.onRangeSelectionReset())}},{key:"moveBrush",value:function(n,o=!1){if(!this.brushEl)return;const a=n?[this.props.scale(n[0]),this.props.scale(n[1])]:null;this.rangeSelectionMoved=!0,this.rangeSelectionMovedEnd=!0,o?this.brushEl.transition().call(this.brushBehavior.move,a):this.brushEl.call(this.brushBehavior.move,a)}},{key:"removeBrush",value:function(){this.brushElAddedBefore&&(this.brushElAddedBefore.call(this.brushBehavior.move,null),this.brushElAddedBefore.on(".brush",null),this.brushElAddedBefore=void 0,this.props.onRangeSelectionReset())}},{key:"render",value:function(){const n=this.props.tracks.map(s=>s.width).reduce(Es,0),o=this.props.tracks.map(s=>Hu(s)).reduce(Xd,!1),a=To[this.props.isRangeSelectionActive?"track-range-selection-active":"track-range-selection"];return E.createElement("div",{className:H7e["vertical-tiled-plot"]},o&&E.createElement("svg",{ref:s=>{this.brushEl=Bt(s)},className:a,style:{height:this.props.height,width:n},xmlns:"http://www.w3.org/2000/svg"}),E.createElement(j0,{axis:"x",className:Zt(Eo.list,Eo.stylizedList,Eo.horizontalList),component:V3,editable:this.props.editable,handleConfigTrack:this.props.handleConfigTrack,handleResizeTrack:this.props.handleResizeTrack,height:this.props.height,helperClass:Eo.stylizedHelper,itemClass:Zt(Eo.stylizedItem,Eo.horizontalItem),itemControlAlignLeft:this.props.tracksControlAlignLeft,itemReactClass:B7e,items:this.props.tracks.map(s=>({configMenuVisible:s.uid===this.props.configTrackMenuId,uid:s.uid||xt.nice(),height:this.props.height,width:s.width,value:s.value})),onAddSeries:this.props.onAddSeries,onCloseTrack:this.props.onCloseTrack,onCloseTrackMenuOpened:this.props.onCloseTrackMenuOpened,onConfigTrackMenuOpened:this.props.onConfigTrackMenuOpened,onSortEnd:this.props.handleSortEnd,referenceAncestor:this.props.referenceAncestor,resizeHandles:this.props.resizeHandles,useDragHandle:!0,width:n}))}}]),r}(E.Component);KD.propTypes={configTrackMenuId:N.string,editable:N.bool,handleConfigTrack:N.func,handleResizeTrack:N.func,handleSortEnd:N.func,is1dRangeSelection:N.bool,isRangeSelectionActive:N.bool,height:N.number,onAddSeries:N.func,onCloseTrack:N.func,onCloseTrackMenuOpened:N.func,onConfigTrackMenuOpened:N.func,onRangeSelection:N.func,onRangeSelectionEnd:N.func,onRangeSelectionReset:N.func,onRangeSelectionStart:N.func,rangeSelection:N.array,rangeSelectionEnd:N.bool,referenceAncestor:N.func,resizeHandles:N.object,scale:N.func,tracks:N.array,tracksControlAlignLeft:N.bool};function Y7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,X7e(i.key),i)}}function q7e(e,t,r){return t&&mY(e.prototype,t),r&&mY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function X7e(e){var t=K7e(e,"string");return typeof t=="symbol"?t:String(t)}function K7e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZD(e,t)}function ZD(e,t){return ZD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},ZD(e,t)}function Q7e(e){var t=t3e();return function(){var i=HT(e),n;if(t){var o=HT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return J7e(this,n)}}function J7e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return e3e(e)}function e3e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function HT(e){return HT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},HT(e)}let gY=function(e){Z7e(r,e);var t=Q7e(r);function r(){return Y7e(this,r),t.apply(this,arguments)}return q7e(r,[{key:"render",value:function(){const n=VD(this.props.tracks,this.handleItemMouseEnter.bind(this),this.handleMouseLeave.bind(this)),o=this.props.customItems?E.Children.map(this.props.customItems,a=>E.cloneElement(a,{onMouseEnter:s=>{this.handleOtherMouseEnter(s)}})):null;return E.createElement("div",{ref:a=>{this.div=a},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),"data-menu-type":"ViewContextMenu",style:{left:this.state.left,top:this.state.top}},o,o&&E.createElement("hr",{className:mt["context-menu-hr"]}),n,n&&E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:()=>this.props.onAddTrack({type:"horizontal-rule",y:this.props.coords[1],position:"whole"}),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Horizontal Rule"),E.createElement(St,{onClick:()=>this.props.onAddTrack({type:"vertical-rule",x:this.props.coords[0],position:"whole"}),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Vertical Rule"),E.createElement(St,{onClick:()=>this.props.onAddTrack({type:"cross-rule",x:this.props.coords[0],y:this.props.coords[1],position:"whole"}),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Cross Rule"),E.createElement("hr",{className:mt["context-menu-hr"]}),this.hasMatrixTrack(this.props.tracks)&&E.createElement(St,{onClick:this.handleAddHorizontalSection.bind(this),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Horizontal Cross Section"),this.hasMatrixTrack(this.props.tracks)&&E.createElement(St,{onClick:this.handleAddVerticalSection.bind(this),onMouseEnter:a=>this.handleOtherMouseEnter(a)},"Add Vertical Cross Section"),this.getSubmenu())}},{key:"hasMatrixTrack",value:function(n){return yy(this.props.tracks).filter(a=>a.type==="heatmap").length>0}},{key:"handleAddHorizontalSection",value:function(){const o=yy(this.props.tracks).filter(a=>a.type==="heatmap")[0];this.props.onAddTrack({type:"horizontal-rule",y:this.props.coords[1],position:"whole"}),this.props.onAddTrack({data:{type:"horizontal-section",server:o.server,tilesetUid:o.tilesetUid,slicePos:this.props.coords[1]},options:{valueScaling:"log"},type:"horizontal-bar",height:30,position:"top"})}},{key:"handleAddVerticalSection",value:function(){const o=yy(this.props.tracks).filter(a=>a.type==="heatmap")[0];this.props.onAddTrack({type:"vertical-rule",x:this.props.coords[0],position:"whole"}),this.props.onAddTrack({data:{type:"vertical-section",server:o.server,tilesetUid:o.tilesetUid,slicePos:this.props.coords[0]},options:{valueScaling:"log"},type:"vertical-bar",height:30,position:"left"})}}]),r}(mh(pl).with(cY));gY.propTypes={coords:N.array,customItems:N.array};function r3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i3e(i.key),i)}}function n3e(e,t,r){return t&&vY(e.prototype,t),r&&vY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i3e(e){var t=o3e(e,"string");return typeof t=="symbol"?t:String(t)}function o3e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QD(e,t)}function QD(e,t){return QD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},QD(e,t)}function s3e(e){var t=c3e();return function(){var i=FT(e),n;if(t){var o=FT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return l3e(this,n)}}function l3e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return An(e)}function An(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function FT(e){return FT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},FT(e)}let JD=function(e){a3e(r,e);var t=s3e(r);function r(i){var n;r3e(this,r),n=t.call(this,i),n.closing=!1;const{tracks:o}=n.props;return n.canvasElement=null,n.tracksByUidInit={},[...n.props.tracks.top||[],...n.props.tracks.right||[],...n.props.tracks.bottom||[],...n.props.tracks.left||[],...n.props.tracks.gallery||[],...n.props.tracks.center||[]].forEach(a=>{a.type==="combined"?a.contents.forEach(s=>{n.tracksByUidInit[s.uid]=!1}):n.tracksByUidInit[a.uid]=!1}),n.xScale=null,n.yScale=null,n.addUidsToTracks(o),n.trackToReplace=null,n.trackRenderer=null,n.configTrackMenu=null,n.state={sizeMeasured:!1,height:10,width:10,tracks:o,init:!1,addTrackPosition:null,customDialog:null,mouseOverOverlayUid:null,forceUpdate:0,rangeSelection:[null,null],rangeSelectionEnd:!1,chromInfo:null,defaultChromSizes:null,contextMenuCustomItems:null,contextMenuPosition:null,addDivisorDialog:null},n.reset=!0,window.higlassTracksByType&&Object.keys(window.higlassTracksByType).forEach(a=>{dr[a]=window.higlassTracksByType[a].config}),n.topHeight=0,n.bottomHeight=0,n.leftWidth=0,n.rightWidth=0,n.centerHeight=0,n.centerWidth=0,n.dragTimeout=null,n.previousPropsStr="",n.contextMenuHandlerBound=n.contextMenuHandler.bind(An(n)),n.handleNoTrackAddedBound=n.handleNoTrackAdded.bind(An(n)),n.handleTracksAddedBound=n.handleTracksAdded.bind(An(n)),n.closeMenusBound=n.closeMenus.bind(An(n)),n.handleAddDivisorBound=n.handleAddDivisor.bind(An(n)),n.handleAddSeriesBound=n.handleAddSeries.bind(An(n)),n.handleChangeTrackDataBound=n.handleChangeTrackData.bind(An(n)),n.handleChangeTrackTypeBound=n.handleChangeTrackType.bind(An(n)),n.handleCloseTrackBound=n.handleCloseTrack.bind(An(n)),n.handleConfigureTrackBound=n.handleConfigureTrack.bind(An(n)),n.handleExportTrackDataBound=n.handleExportTrackData.bind(An(n)),n.handleLockValueScaleBound=n.handleLockValueScale.bind(An(n)),n.handleReplaceTrackBound=n.handleReplaceTrack.bind(An(n)),n.handleTrackOptionsChangedBound=n.handleTrackOptionsChanged.bind(An(n)),n.handleUnlockValueScaleBound=n.handleUnlockValueScale.bind(An(n)),n.onAddTrack=n.handleAddTrack.bind(An(n)),n}return n3e(r,[{key:"waitForDOMAttachment",value:function(n){if(!this.mounted)return;const o=Lr.findDOMNode(this);document.body.contains(o)?n():requestAnimationFrame(()=>this.waitForDOMAttachment(n))}},{key:"componentDidMount",value:function(){this.mounted=!0,this.element=Lr.findDOMNode(this),this.canvasElement=Lr.findDOMNode(this.props.canvasElement),this.waitForDOMAttachment(()=>{Lv.ElementQueries.listen(),this.resizeSensor=new Lv.ResizeSensor(this.element.parentNode,this.measureSize.bind(this)),this.measureSize()}),this.addEventListeners(),this.pubSubs=[],this.pubSubs.push(this.props.pubSub.subscribe("contextmenu",this.contextMenuHandlerBound))}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){this.addUidsToTracks(n.tracks),this.setState({tracks:n.tracks})}},{key:"shouldComponentUpdate",value:function(n,o){const a=this.previousPropsStr,s=this.updatablePropsToString(n),c=JSON.stringify(this.state),u=JSON.stringify(o),l=a!==s||c!==u||this.props.chooseTrackHandler!==n.chooseTrackHandler||this.props.customDialog!==n.customDialog;l&&(this.previousPropsStr=s);const h=this.numTracks;return this.numTracks=0,La(this.props.tracks,()=>this.numTracks++),this.reset=this.reset||h===0&&this.numTracks>0,this.numTracks||(this.tracksByUidInit={}),l}},{key:"UNSAFE_componentWillUpdate",value:function(){}},{key:"componentDidUpdate",value:function(n,o){if(o.rangeSelection!==this.state.rangeSelection){let a=[null,null];this.state.defaultChromSizes&&this.state.rangeSelection.every(s=>s&&s.length)&&(a=this.state.rangeSelection.map(s=>cy(...s,this.state.defaultChromSizes))),this.props.onRangeSelection({dataRange:this.state.rangeSelection,genomicRange:a})}if(this.state.customDialog||this.props.customDialog){const a=this.state.customDialog||this.props.customDialog;if(a.length>0){const s=[],c=[];a.forEach(u=>{s.push(u.bodyComponent),c.push(u.bodyProps)}),this.props.modal.open(E.createElement($D,{children:s,bodyProps:c,onCancel:this.props.closeCustomDialog,title:a[0].title}))}}if(n.tracks.center,this.props.tracks.center,(this.state.addTrackPosition||this.props.addTrackPosition)&&this.props.modal.open(E.createElement(kT,{host:this.state.addTrackHost,onCancel:this.handleNoTrackAddedBound,onTracksChosen:this.handleTracksAddedBound,position:this.state.addTrackPosition||this.props.addTrackPosition,trackSourceServers:this.props.trackSourceServers})),this.state.addDivisorDialog){const a=this.state.addDivisorDialog;this.props.modal.open(E.createElement(kT,{datatype:dr[a.type].datatype[0],host:this.state.addTrackHost,onCancel:()=>{this.setState({addDivisorDialog:null})},onTracksChosen:s=>{this.handleDivisorChosen(a,s)},trackSourceServers:this.props.trackSourceServers}))}}},{key:"componentWillUnmount",value:function(){this.closing=!0,this.removeEventListeners(),this.pubSubs.forEach(n=>this.props.pubSub.unsubscribe(n))}},{key:"addUidsToTracks",value:function(n){Object.keys(n).forEach(o=>{n[o].forEach(a=>{a.uid=a.uid||xt.nice()})})}},{key:"contextMenuHandler",value:function(n){if(!this.divTiledPlot)return;const o=this.divTiledPlot.getBoundingClientRect();if(!QS(n.clientX,n.clientY,o.left,o.left+o.width,o.top,o.top+o.height))return;const s=[n.clientX,n.clientY],c=lr(n,this.divTiledPlot),u=this.trackRenderer.zoomedXScale.invert(c[0]),l=this.trackRenderer.zoomedYScale.invert(c[1]);let h=null;n.hgCustomItems&&(h=n.hgCustomItems.map(f=>E.createElement(St,{key:f.key,onClick:f.onClick},f.text))),this.setState({contextMenuCustomItems:h,contextMenuPosition:{left:s[0],top:s[1],canvasLeft:c[0]+this.trackRenderer.xPositionOffset,canvasTop:c[1]+this.trackRenderer.yPositionOffset},contextMenuDataX:u,contextMenuDataY:l})}},{key:"measureSize",value:function(){this.element.clientWidth>0&&this.element.clientHeight>0&&this.setState({sizeMeasured:!0,width:this.element.clientWidth,height:this.element.clientHeight})}},{key:"handleTrackOptionsChanged",value:function(n,o){return this.props.onTrackOptionsChanged(n,o)}},{key:"handleScalesChanged",value:function(n,o){this.xScale=n,this.yScale=o,this.props.onScalesChanged(n,o)}},{key:"handleTilesetInfoReceived",value:function(n,o){const a=Ci(this.props.tracks,n);if(!a){console.warn("Strange, track not found:",n);return}this.tracksByUidInit[a.uid]=!0,this.checkAllTilesetInfoReceived(),a.options||(a.options={}),a.name=o.name,a.maxWidth=o.max_width,a.transforms=o.transforms,a.aggregationModes=o.aggregation_modes,a.header=o.header,a.binsPerDimension=o.bins_per_dimension,o.resolutions?(a.maxZoom=o.resolutions.length-1,a.resolutions=o.resolutions):a.maxZoom=o.max_zoom,a.coordSystem=o.coordSystem,a.datatype=o.datatype}},{key:"checkAllTilesetInfoReceived",value:function(){if(this.state.init&&!this.reset||!this.trackRenderer||!this.props.zoomToDataExtentOnInit())return;const n=Object.keys(this.trackRenderer.trackDefObjects).map(a=>{const s=this.trackRenderer.trackDefObjects[a].trackObject;return s.childTracks?s.childTracks:s}).reduce((a,s)=>a.concat(s),[]).filter(({tilesetInfo:a})=>typeof a<"u"&&a!==!0),o=Object.values(this.tracksByUidInit).filter(a=>a).length;n.length===o&&(this.setState({init:!0}),this.reset=!1,this.handleZoomToData())}},{key:"handleOverlayMouseEnter",value:function(n){this.setState({mouseOverOverlayUid:n})}},{key:"handleOverlayMouseLeave",value:function(n){n===this.state.mouseOverOverlayUid&&this.setState({mouseOverOverlayUid:null})}},{key:"handleTrackPositionChosen",value:function(n){this.setState({mouseOverOverlayUid:null}),this.props.chooseTrackHandler(n.track.uid)}},{key:"handleNoTrackAdded",value:function(){this.trackToReplace=null,this.props.onNoTrackAdded(),this.setState({addTrackPosition:null,addTrackHost:null})}},{key:"handleAddDivisor",value:function(n){this.setState({addDivisorDialog:n})}},{key:"handleDivisorChosen",value:function(n,o){this.setState({addDivisorDialog:null});const a=n.data?{server:n.data.server,tilesetUid:n.data.tilesetUid}:{server:n.server,tilesetUid:n.tilesetUid},s={server:o[0].server,tilesetUid:o[0].uuid};this.handleChangeTrackData(n.uid,{type:"divided",children:[a,s]})}},{key:"handleDivideSeries",value:function(n){}},{key:"handleAddSeries",value:function(n){const o=qd(this.props.tracks,n),a=Ci(this.props.tracks,n);this.setState({addTrackPosition:o,addTrackHost:a})}},{key:"handleReplaceTrack",value:function(n,o){this.trackToReplace=n,this.handleAddTrack(o)}},{key:"handleAddTrack",value:function(n){this.setState({addTrackPosition:n,addTrackHost:null})}},{key:"handleResizeTrack",value:function(n,o,a){const{tracks:s}=this.state;for(const c in s){const l=s[c].filter(h=>h.uid===n);l.length>0&&(l[0].width=o,l[0].height=a)}this.setState({tracks:s,forceUpdate:Math.random()}),this.props.onResizeTrack()}},{key:"closeMenus",value:function(){this.setState({closeTrackMenuId:null,configTrackMenuId:null,contextMenuPosition:null,contextMenuCustomItems:null})}},{key:"handleLockValueScale",value:function(n){this.closeMenus(),this.props.onLockValueScale(n)}},{key:"handleUnlockValueScale",value:function(n){this.closeMenus(),this.props.onUnlockValueScale(n)}},{key:"handleCloseTrack",value:function(n){this.closeMenus(),this.props.onCloseTrack(n)}},{key:"handleChangeTrackType",value:function(n,o){this.closeMenus(),this.props.onChangeTrackType(n,o)}},{key:"handleChangeTrackData",value:function(n,o){this.closeMenus(),this.props.onChangeTrackData(n,o)}},{key:"handleTracksAdded",value:function(n,o,a){return this.trackToReplace&&(this.handleCloseTrack(this.trackToReplace),this.trackToReplace=null),this.props.onTracksAdded(n,o,a),this.setState({addTrackPosition:null,addTrackHost:null}),n}},{key:"handleCloseTrackMenuOpened",value:function(n,o){this.setState({closeTrackMenuId:n,closeTrackMenuLocation:o})}},{key:"handleCloseContextMenu",value:function(){this.setState({contextMenuCustomItems:null,contextMenuPosition:null,contextMenuDataX:null,contextMenuDataY:null})}},{key:"handleCloseTrackMenuClosed",value:function(){this.setState({closeTrackMenuId:null})}},{key:"handleConfigTrackMenuOpened",value:function(n,o){this.closeMenus(),this.setState({configTrackMenuId:n,configTrackMenuLocation:o})}},{key:"handleConfigureTrack",value:function(n,o){this.setState({configTrackMenuId:null,trackOptions:{track:n,configComponent:o}}),this.closeMenus()}},{key:"handleSortEnd",value:function(n){this.setState(o=>{const a=o.tracks,s={};for(let c=0;c<n.length;c++)s[n[c].uid]=c;for(const c in a){const u=a[c];if(u.length&&u[0].uid in s){const l=new Array(u.length);for(let h=0;h<u.length;h++)l[s[u[h].uid]]=u[h];a[c]=l}}return{tracks:a,forceUpdate:Math.random()}})}},{key:"createTracksAndLocations",value:function(){const n=[],{tracks:o}=this.state;return MS.forEach(a=>{o[a]&&o[a].forEach(s=>{s.contents&&s.contents.forEach(c=>{c.position=a}),s.position=a,n.push({track:s,location:a})})}),n}},{key:"calculateTrackPosition",value:function(n,o){let a=this.props.paddingTop,s=this.props.paddingBottom,c=this.props.paddingLeft,u=this.props.paddingRight,l=this.centerWidth,h=n.height,f=0,d=0;switch(o){case"top":c+=this.leftWidth;for(let p=0;p<this.state.tracks.top.length&&this.state.tracks.top[p].uid!==n.uid;p++)a+=this.state.tracks.top[p].height;break;case"bottom":c+=this.leftWidth,a+=this.topHeight+this.centerHeight+this.galleryDim;for(let p=0;p<this.state.tracks.bottom.length&&this.state.tracks.bottom[p].uid!==n.uid;p++)a+=this.state.tracks.bottom[p].height;break;case"left":a+=this.topHeight,l=n.width,h=this.centerHeight;for(let p=0;p<this.state.tracks.left.length&&this.state.tracks.left[p].uid!==n.uid;p++)c+=this.state.tracks.left[p].width;break;case"right":c+=this.leftWidth+this.centerWidth+this.galleryDim,a+=this.topHeight,l=n.width,h=this.centerHeight;for(let p=0;p<this.state.tracks.right.length&&this.state.tracks.right[p].uid!==n.uid;p++)c+=this.state.tracks.right[p].width;break;case"center":c+=this.leftWidth,a+=this.topHeight,h=this.centerHeight;break;case"gallery":c+=this.leftWidthNoGallery,a+=this.topHeightNoGallery,l=this.state.width-this.leftWidthNoGallery-this.rightWidthNoGallery-this.props.paddingLeft,h=this.state.height-this.topHeightNoGallery-this.bottomHeightNoGallery-this.props.paddingTop,f=this.galleryDim,d=this.galleryDim;for(let p=0;p<this.state.tracks.gallery.length&&this.state.tracks.gallery[p].uid!==n.uid;p++)l-=2*this.state.tracks.gallery[p].height,h-=2*this.state.tracks.gallery[p].height,c+=this.state.tracks.gallery[p].height,a+=this.state.tracks.gallery[p].height,f-=this.state.tracks.gallery[p].height,d-=this.state.tracks.gallery[p].height;for(let p=0;p<this.state.tracks.right.length;p++)u+=this.state.tracks.right[p].width;for(let p=0;p<this.state.tracks.bottom.length;p++)s+=this.state.tracks.bottom[p].height;n.offsetX=f,n.offsetY=d,n.offsetTop=a,n.offsetRight=u,n.offsetBottom=s,n.offsetLeft=c;break;case"whole":default:l=this.leftWidth+this.centerWidth+this.rightWidth,h=this.topHeight+this.centerHeight+this.bottomHeight}return MS.indexOf(o)===-1&&console.warn("Track with unknown position present:",o,n),{left:c,top:a,width:l,height:h,track:n}}},{key:"findCentralHeatmapTrack",value:function(n){for(let o=0;o<n.length;o++){if(n[o].type==="combined")return this.findCentralHeatmapTrack(n[o].contents);if(n[o].type==="heatmap")return n[o]}}},{key:"trackUuidToOrientation",value:function(n){}},{key:"overlayTracks",value:function(n){return this.props.overlays?this.props.overlays.filter(a=>a.includes&&a.includes.length).map(a=>{const s=a.type?`overlay-${a.type}-track`:"overlay-track",c={...a,uid:a.uid||xt.nice(),includes:a.includes,type:s,options:Object.assign(a.options,{orientationsAndPositions:a.includes.map(u=>{const l=Ci(this.props.tracks,u);if(!l)return console.warn(`OverlayTrack included uid (${u}) not found in the track list`),null;const h=qd(this.props.tracks,l.uid);let f;if((h==="top"||h==="bottom")&&(f="1d-horizontal"),(h==="left"||h==="right")&&(f="1d-vertical"),h==="center"&&(f="2d"),!f)return console.warn("Only top, bottom, left, right, or center tracks can be overlaid at the moment"),null;const d=n.filter(m=>m.track.uid===u);if(!d.length)return null;const p={left:d[0].left-this.props.paddingLeft,top:d[0].top-this.props.paddingTop,width:d[0].width,height:d[0].height};return{orientation:f,position:p}}).filter(u=>u)})};return{top:this.props.paddingTop,left:this.props.paddingLeft,width:this.leftWidth+this.centerWidth+this.rightWidth,height:this.topHeight+this.centerHeight+this.bottomHeight+this.props.marginTop+this.props.marginBottom,track:c}}):[]}},{key:"positionedTracks",value:function(){return this.createTracksAndLocations().map(({track:o,location:a})=>this.calculateTrackPosition(o,a))}},{key:"createTrackPositionTexts",value:function(){const n=this.positionedTracks();return this.createTracksAndLocations(),n.map(a=>{const{track:s}=a;return E.createElement("div",{key:s.uid,style:{left:a.left,top:a.top,width:a.width,height:a.height,position:"absolute"}},s.uid.slice(0,2))})}},{key:"handleExportTrackData",value:function(n,o){const a=Ci(this.props.tracks,o);let s=null;n!==o?s=this.trackRenderer.trackDefObjects[n].trackObject.createdTracks[a.uid]:{trackObject:s}=this.trackRenderer.trackDefObjects[n],s.exportData(),this.closeMenus()}},{key:"listTracksAtPosition",value:function(n,o,a=!1){const s=[];if(!this.trackRenderer)return[];for(const c in this.trackRenderer.trackDefObjects){const u=this.trackRenderer.trackDefObjects[c].trackObject;if(u.respondsToPosition(n,o))if(a){if(this.props.tracks.center)if(this.props.tracks.center.contents)for(let l=0;l<this.props.tracks.center.contents.length;l++)this.props.tracks.center.contents[l].uid===c&&(u.is2d=!0);else this.props.tracks.center&&this.props.tracks.center.length&&this.props.tracks.center[0].uid===c&&(u.is2d=!0);s.push(u)}else s.push(this.trackRenderer.trackDefObjects[c].trackDef.track)}return s}},{key:"listAllTrackObjects",value:function(){const n=[];for(const o in this.trackRenderer.trackDefObjects){const a=this.trackRenderer.trackDefObjects[o];if(a.trackObject.createdTracks)for(const s in a.trackObject.createdTracks){const c=a.trackObject.createdTracks[s];n.push(c)}else n.push(a.trackObject)}return n}},{key:"handleZoomToData",value:function(){const n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=[n,n],s=[o,o],c=this.listAllTrackObjects();for(const d of c)if(d.tilesetInfo&&d.tilesetInfo.min_pos)for(let p=0;p<d.tilesetInfo.min_pos.length;p++)d.tilesetInfo.min_pos[p]<a[p]&&(a[p]=d.tilesetInfo.min_pos[p]),d.tilesetInfo.max_pos[p]>s[p]&&(s[p]=d.tilesetInfo.max_pos[p]);const u=this.trackRenderer.currentProps.paddingLeft+this.trackRenderer.currentProps.leftWidth;let l=[u,u+this.trackRenderer.currentProps.centerWidth].map(this.trackRenderer.zoomTransform.rescaleX(this.trackRenderer.xScale).invert);const h=this.trackRenderer.currentProps.paddingTop+this.trackRenderer.currentProps.topHeight;let f=[h,h+this.trackRenderer.currentProps.centerHeight].map(this.trackRenderer.zoomTransform.rescaleY(this.trackRenderer.yScale).invert);this.trackRenderer.zoomTransform.k=1,this.trackRenderer.zoomTransform.x=0,this.trackRenderer.zoomTransform.y=0,this.trackRenderer.applyZoomTransform(),a[0]<Number.MAX_SAFE_INTEGER&&s[0]>Number.MIN_SAFE_INTEGER&&(l=[a[0],s[0]]),a[1]<Number.MAX_SAFE_INTEGER&&s[1]>Number.MIN_SAFE_INTEGER&&(f=[a[1],s[1]]),this.props.onDataDomainChanged(l,f)}},{key:"resetViewport",value:function(){this.trackRenderer.zoomTransform.k=1,this.trackRenderer.zoomTransform.x=0,this.trackRenderer.zoomTransform.y=0,this.trackRenderer.applyZoomTransform(),this.props.onDataDomainChanged(this.props.initialXDomain,this.props.initialYDomain)}},{key:"updatablePropsToString",value:function(n){return JSON.stringify({tracks:n.tracks,overlays:n.overlays,viewOptions:n.viewOptions,uid:n.uid,addTrackPosition:n.addTrackPosition,editable:n.editable,marginTop:n.marginTop,marginBottom:n.marginBottom,marginLeft:n.marginLeft,marginRight:n.marginRight,paddingTop:n.paddingTop,paddingBottom:n.paddingBottom,paddingLeft:n.paddingLeft,paddingRight:n.paddingRight,mouseTool:n.mouseTool,initialXDomain:n.initialXDomain,initialYDomain:n.initialYDomain,trackSourceServers:n.trackSourceServers,zoomable:n.zoomable,draggingHappening:n.draggingHappening})}},{key:"getXYScales",value:function(){this.trackRenderer&&(this.xScale=this.trackRenderer.currentXScale,this.yScale=this.trackRenderer.currentYScale)}},{key:"rangeViewToDataLoci",value:function(n,o){return o?[parseInt(o.invert(n[0]),10),parseInt(o.invert(n[1]),10)]:[null,null]}},{key:"rangeSelectionResetHandler",value:function(){this.state.rangeSelectionMaster&&this.setState({is1dRangeSelection:null,rangeSelection:[null,null],rangeSelectionMaster:null,rangeSelectionEnd:!1})}},{key:"rangeSelection1dEndHandler",value:function(n){(!this.xScale||!this.yScale)&&this.getXYScales();const o=n==="x"?this.xScale:this.yScale;return a=>{this.setState(s=>{const c=s.is1dRangeSelection?[null,null]:s.rangeSelection.slice(),u=!this.state.is1dRangeSelection&&n==="y"?1:0;let l=this.rangeViewToDataLoci(a,o);const h=l[1]-l[0];if(this.props.rangeSelection1dSize[0]>h){const f=l[0]+h/2;l=[f-this.props.rangeSelection1dSize[0]/2,f+this.props.rangeSelection1dSize[0]/2]}else if(this.props.rangeSelection1dSize[1]<h){const f=l[0]+h/2;l=[f-this.props.rangeSelection1dSize[1]/2,f+this.props.rangeSelection1dSize[1]/2]}return c[u]=l,this.props.rangeSelectionToInt&&(c[u]=c[u].map(f=>Math.round(f))),{rangeSelection:c,rangeSelectionEnd:!0}})}}},{key:"rangeSelection1dHandler",value:function(n){(!this.xScale||!this.yScale)&&this.getXYScales();const o=n==="x"?this.xScale:this.yScale;return a=>{this.setState(s=>{const c=s.is1dRangeSelection?[null,null]:s.rangeSelection.slice(),u=!s.is1dRangeSelection&&n==="y"?1:0;return c[u]=this.rangeViewToDataLoci(a,o),{rangeSelection:c,rangeSelectionEnd:!1}})}}},{key:"rangeSelection1dStartHandler",value:function(){this.state.rangeSelectionMaster||this.setState({is1dRangeSelection:!0,rangeSelectionMaster:!0,rangeSelectionEnd:!1})}},{key:"rangeSelection2dHandler",value:function(n){(!this.xScale||!this.yScale)&&this.getXYScales(),this.setState({rangeSelection:[this.rangeViewToDataLoci(n[0],this.xScale),this.rangeViewToDataLoci(n[1],this.yScale)],rangeSelectionEnd:!1})}},{key:"rangeSelection2dStartHandler",value:function(){this.state.rangeSelectionMaster||this.setState({is1dRangeSelection:!1,rangeSelectionMaster:!0,rangeSelectionEnd:!1})}},{key:"rangeSelection2dEndHandler",value:function(n){(!this.xScale||!this.yScale)&&this.getXYScales();const o=this.rangeViewToDataLoci(n[0],this.xScale),a=this.rangeViewToDataLoci(n[1],this.yScale);let s=[o,a];const c=o[1]-o[0],u=a[1]-a[0],l=[c,u];s.forEach((h,f)=>{if(this.props.rangeSelection1dSize[0]>l[f]){const d=h[0]+Math.round(l[f]/2);h[0]=d-this.props.rangeSelection1dSize[0]/2,h[1]=d+this.props.rangeSelection1dSize[0]/2}else if(this.props.rangeSelection1dSize[1]<l[f]){const d=h[0]+Math.round(l[f]/2);h[0]=d-this.props.rangeSelection1dSize[1]/2,h[1]=d+this.props.rangeSelection1dSize[1]/2}}),this.props.rangeSelectionToInt&&(s=s.map(h=>h.map(f=>Math.round(f)))),this.setState({rangeSelection:s,rangeSelectionEnd:!0})}},{key:"getContextMenu",value:function(){if(this.state.contextMenuPosition){const n=this.listTracksAtPosition(this.state.contextMenuPosition.canvasLeft,this.state.contextMenuPosition.canvasTop);return E.createElement(ml,{onMenuClosed:this.closeMenusBound},E.createElement(gY,{closeMenu:this.closeMenusBound,coords:[this.state.contextMenuDataX,this.state.contextMenuDataY],customItems:this.state.contextMenuCustomItems,onAddDivisor:this.handleAddDivisorBound,onAddSeries:this.handleAddSeriesBound,onAddTrack:o=>{this.props.onTracksAdded([o],o.position,null),this.handleCloseContextMenu()},onChangeTrackData:this.handleChangeTrackDataBound,onChangeTrackType:this.handleChangeTrackTypeBound,onCloseTrack:this.handleCloseTrackBound,onConfigureTrack:this.handleConfigureTrackBound,onExportData:this.handleExportTrackDataBound,onLockValueScale:this.handleLockValueScaleBound,onReplaceTrack:this.handleReplaceTrackBound,onTrackOptionsChanged:this.handleTrackOptionsChangedBound,onUnlockValueScale:this.handleUnlockValueScaleBound,orientation:"right",position:this.state.contextMenuPosition,theme:this.props.theme,tracks:n,trackSourceServers:this.props.trackSourceServers}))}return null}},{key:"getIdealizedTrackPositionsOverlay",value:function(){const n=this.props.draggingHappening;if(typeof n=="boolean")return;const o=n.datatype;if(!(o in Ud)&&!n.defaultTracks){console.warn("unknown data type:",n.higlassTrack);return}const a={"1d-horizontal":["top","bottom","left","right"],"2d":["center"],"1d-vertical":["left","right"]},s=Ud[o]||{};if(n.defaultTracks)for(const w of n.defaultTracks)if(!dr[w])console.warn("unknown track type",w);else for(const L of a[dr[w].orientation])s[L]=w;const c=new Set(["top","left","right","center","bottom"].filter(w=>w in this.state.tracks&&this.state.tracks[w].length)),u="top"in s,l="left"in s,h="right"in s,f="bottom"in s,d="center"in s,p="center"in s||c.has("left")||c.has("right")||c.has("center"),m="top"in s,g="bottom"in s&&p,v="left"in s&&p,_="right"in s&&p,y=Object.keys(s).length&&("center"in s||p),b=E.createElement("div",{style:{flexGrow:1}}),T=E.cloneElement(b),S=E.createElement("div",{style:{display:"flex",flexGrow:1}},m&&(y||v)?b:null,E.createElement(r_,{defaultTrackType:s.top,draggingHappening:this.props.draggingHappening,enabled:u,onTrackDropped:w=>this.handleTracksAdded([w],"top"),style:{border:"1px solid black",flexGrow:1}}),m&&(y||v)?T:null),k=E.createElement("div",{style:{display:"flex",flexGrow:1}},m&&(y||v)?b:null,E.createElement(r_,{defaultTrackType:s.bottom,draggingHappening:this.props.draggingHappening,enabled:f,onTrackDropped:w=>this.handleTracksAdded([w],"bottom"),style:{border:"1px solid black",flexGrow:1}}),m&&(y||v)?T:null),O=E.createElement(r_,{defaultTrackType:s.left,draggingHappening:this.props.draggingHappening,enabled:l,onTrackDropped:w=>this.handleTracksAdded([w],"left"),style:{border:"1px solid black",flexGrow:1}}),D=E.createElement(r_,{defaultTrackType:s.center,draggingHappening:this.props.draggingHappening,enabled:d,onTrackDropped:w=>this.handleTracksAdded([w],"center"),position:"center",style:{border:"1px solid black",flexGrow:1}}),M=E.cloneElement(O,{defaultTrackType:s.right,enabled:h,onTrackDropped:w=>this.handleTracksAdded([w],"right")});return E.createElement("div",{style:{position:"absolute",left:"0px",top:"0px",width:this.state.width,height:this.state.height}},E.createElement("div",{style:{position:"absolute",width:this.state.width,height:this.state.height,background:"white",opacity:.4}}),E.createElement("div",{style:{width:this.state.width,height:this.state.height,position:"absolute",display:"flex",flexDirection:"column"}},m?S:null,p&&E.createElement("div",{style:{display:"flex",height:m||g?"40%":"100%",width:"100%"}},v?O:null,y?D:null,_?M:null),g?k:null))}},{key:"render",value:function(){this.galleryDim=this.props.tracks.gallery?this.props.tracks.gallery.map(y=>y.height).reduce(Es,0):0,this.topHeightNoGallery=this.props.tracks.top.map(y=>y.height).reduce(Es,0),this.topHeight=this.topHeightNoGallery+this.galleryDim,this.bottomHeightNoGallery=this.props.tracks.bottom.map(y=>y.height).reduce(Es,0),this.bottomHeight=this.bottomHeightNoGallery+this.galleryDim,this.leftWidthNoGallery=this.props.tracks.left.map(y=>y.width).reduce(Es,0),this.leftWidth=this.leftWidthNoGallery+this.galleryDim,this.rightWidthNoGallery=this.props.tracks.right.map(y=>y.width).reduce(Es,0),this.rightWidth=this.rightWidthNoGallery+this.galleryDim;const n=this.props.paddingTop+this.props.paddingBottom,o=this.props.paddingLeft+this.props.paddingRight;this.centerHeight=Math.max(0,this.state.height-this.topHeight-this.bottomHeight-n),this.centerWidth=Math.max(0,this.state.width-this.leftWidth-this.rightWidth-o);const a="none",s=E.createElement("div",{className:"top-track-container",style:{left:this.leftWidth+this.props.paddingLeft,top:this.props.paddingTop,width:this.centerWidth,height:this.topHeightNoGallery,outline:a,position:"absolute"}},E.createElement(K0,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,handleConfigTrack:this.handleConfigTrackMenuOpened.bind(this),handleResizeTrack:this.handleResizeTrack.bind(this),handleSortEnd:this.handleSortEnd.bind(this),is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelection:this.rangeSelection1dHandler("x").bind(this),onRangeSelectionEnd:this.rangeSelection1dEndHandler("x").bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection1dStartHandler.bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,resizeHandles:new Set(["bottom"]),scale:this.xScale,tracks:this.props.tracks.top,width:this.centerWidth})),c=E.createElement("div",{className:"left-track-container",style:{left:this.props.paddingLeft,top:this.topHeight+this.props.paddingTop,width:this.leftWidthNoGallery,height:this.centerHeight,outline:a,position:"absolute"}},E.createElement(KD,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,handleConfigTrack:this.handleConfigTrackMenuOpened.bind(this),handleResizeTrack:this.handleResizeTrack.bind(this),handleSortEnd:this.handleSortEnd.bind(this),height:this.centerHeight,is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelection:this.rangeSelection1dHandler("y").bind(this),onRangeSelectionEnd:this.rangeSelection1dEndHandler("y").bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection1dStartHandler.bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,resizeHandles:new Set(["right"]),scale:this.yScale,tracks:this.props.tracks.left})),u=E.createElement("div",{className:"right-track-container",style:{right:this.props.paddingRight,top:this.topHeight+this.props.paddingTop,width:this.rightWidthNoGallery,height:this.centerHeight,outline:a,position:"absolute"}},E.createElement(KD,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,handleConfigTrack:this.handleConfigTrackMenuOpened.bind(this),handleResizeTrack:this.handleResizeTrack.bind(this),handleSortEnd:this.handleSortEnd.bind(this),height:this.centerHeight,is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelection:this.rangeSelection1dHandler("y").bind(this),onRangeSelectionEnd:this.rangeSelection1dEndHandler("y").bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection1dStartHandler.bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,resizeHandles:new Set(["left"]),scale:this.yScale,tracks:this.props.tracks.right,tracksControlAlignLeft:!0})),l=E.createElement("div",{className:"bottom-track-container",style:{left:this.leftWidth+this.props.paddingLeft,bottom:this.props.paddingBottom,width:this.centerWidth,height:this.bottomHeightNoGallery,outline:a,position:"absolute"}},E.createElement(K0,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,handleConfigTrack:this.handleConfigTrackMenuOpened.bind(this),handleResizeTrack:this.handleResizeTrack.bind(this),handleSortEnd:this.handleSortEnd.bind(this),is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelection:this.rangeSelection1dHandler("x").bind(this),onRangeSelectionEnd:this.rangeSelection1dEndHandler("x").bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection1dStartHandler.bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,resizeHandles:new Set(["top"]),scale:this.xScale,tracks:this.props.tracks.bottom,width:this.centerWidth})),h=E.createElement("div",{key:"galleryTracksDiv",className:"gallery-track-container",style:{left:this.leftWidthNoGallery+this.props.paddingLeft,top:this.topHeightNoGallery+this.props.paddingTop,width:this.centerWidth+2*this.galleryDim,height:this.centerHeight+2*this.galleryDim,outline:a,position:"absolute"}},E.createElement(x4,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,height:this.centerHeight+2*this.galleryDim,onAddSeries:this.handleAddSeries.bind(this),onCloseTrack:this.handleCloseTrack.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),tracks:this.props.tracks.gallery,width:this.centerWidth+2*this.galleryDim}));let f=E.createElement("div",{className:["center-track-container",ck["center-track-container"]].join(" "),style:{left:this.leftWidth+this.props.paddingLeft,top:this.topHeight+this.props.paddingTop,width:this.centerWidth,height:this.bottomHeight,outline:a}});this.props.tracks.center.length&&(f=E.createElement("div",{className:["center-track-container",ck["center-track-container"]].join(" "),style:{left:this.leftWidth+this.props.paddingLeft,top:this.topHeight+this.props.paddingTop,width:this.centerWidth,height:this.centerHeight,outline:a}},E.createElement(fk,{configTrackMenuId:this.state.configTrackMenuId,editable:this.props.editable,height:this.centerHeight,is1dRangeSelection:this.state.is1dRangeSelection,isRangeSelectionActive:this.props.mouseTool===Wi,onAddSeries:this.handleAddSeries.bind(this),onCloseTrackMenuOpened:this.handleCloseTrackMenuOpened.bind(this),onConfigTrackMenuOpened:this.handleConfigTrackMenuOpened.bind(this),onRangeSelectionReset:this.rangeSelectionResetHandler.bind(this),onRangeSelectionStart:this.rangeSelection2dStartHandler.bind(this),onRangeSelectionX:this.rangeSelection1dHandler("x").bind(this),onRangeSelectionXEnd:this.rangeSelection1dEndHandler("x").bind(this),onRangeSelectionXY:this.rangeSelection2dHandler.bind(this),onRangeSelectionXYEnd:this.rangeSelection2dEndHandler.bind(this),onRangeSelectionY:this.rangeSelection1dHandler("y").bind(this),onRangeSelectionYEnd:this.rangeSelection1dEndHandler("y").bind(this),rangeSelection:this.state.rangeSelection,rangeSelectionEnd:this.state.rangeSelectionEnd,scaleX:this.xScale,scaleY:this.yScale,tracks:this.props.tracks.center,uid:this.props.tracks.center[0].uid,width:this.centerWidth}))),this.createTrackPositionTexts();let d=this.positionedTracks();d=d.concat(this.overlayTracks(d));let p=null;this.state.sizeMeasured&&(p=E.createElement(K8e,{ref:y=>{this.trackRenderer=y,this.checkAllTilesetInfoReceived()},canvasElement:this.canvasElement,centerHeight:this.centerHeight,centerWidth:this.centerWidth,disableTrackMenu:this.props.disableTrackMenu,dragging:this.props.dragging,galleryDim:this.galleryDim,getLockGroupExtrema:this.props.getLockGroupExtrema,height:this.state.height,initialXDomain:this.props.initialXDomain,initialYDomain:this.props.initialYDomain,isRangeSelection:this.props.mouseTool===Wi,isShowGlobalMousePosition:this.props.isShowGlobalMousePosition,isValueScaleLocked:this.props.isValueScaleLocked,leftWidth:this.leftWidth,leftWidthNoGallery:this.leftWidthNoGallery,metaTracks:this.props.metaTracks,onMouseMoveZoom:this.props.onMouseMoveZoom,onNewTilesLoaded:this.props.onNewTilesLoaded,onScalesChanged:this.handleScalesChanged.bind(this),onTilesetInfoReceived:this.handleTilesetInfoReceived.bind(this),onTrackOptionsChanged:this.handleTrackOptionsChanged.bind(this),onValueScaleChanged:this.props.onValueScaleChanged,paddingLeft:this.props.paddingLeft,paddingTop:this.props.paddingTop,pixiRenderer:this.props.pixiRenderer,pixiStage:this.props.pixiStage,pluginDataFetchers:this.props.pluginDataFetchers,pluginTracks:this.props.pluginTracks,positionedTracks:d,registerDraggingChangedListener:this.props.registerDraggingChangedListener,removeDraggingChangedListener:this.props.removeDraggingChangedListener,setCentersFunction:this.props.setCentersFunction,svgElement:this.props.svgElement,topHeight:this.topHeight,topHeightNoGallery:this.topHeightNoGallery,uid:this.props.uid,viewOptions:this.props.viewOptions,width:this.state.width,xDomainLimits:this.props.xDomainLimits,yDomainLimits:this.props.yDomainLimits,zoomable:this.props.zoomable,zoomLimits:this.props.zoomLimits},s,c,u,l,h,f));let m=null,g=null;this.state.configTrackMenuId&&(m=E.createElement(ml,{onMenuClosed:this.closeMenusBound},E.createElement(I7e,{ref:y=>{this.configTrackMenu=y},closeMenu:this.closeMenusBound,onAddDivisor:this.handleAddDivisorBound,onAddSeries:this.handleAddSeriesBound,onAddTrack:this.handleAddTrackBound,onChangeTrackType:this.handleChangeTrackTypeBound,onCloseTrack:this.handleCloseTrackBound,onConfigureTrack:this.handleConfigureTrackBound,onExportData:this.handleExportTrackDataBound,onLockValueScale:this.handleLockValueScaleBound,onReplaceTrack:this.handleReplaceTrackBound,onTrackOptionsChanged:this.handleTrackOptionsChangedBound,onUnlockValueScale:this.handleUnlockValueScaleBound,position:this.state.configTrackMenuLocation,theme:this.props.theme,trackOrientation:qd(this.props.tracks,this.state.configTrackMenuId),tracks:[Ci(this.props.tracks,this.state.configTrackMenuId)]}))),this.state.closeTrackMenuId&&(g=E.createElement(ml,{onMenuClosed:this.handleCloseTrackMenuClosed.bind(this)},E.createElement(pl,{position:this.state.closeTrackMenuLocation,theme:this.props.theme},E.createElement(fY,{onCloseTrack:this.handleCloseTrack.bind(this),tracks:[Ci(this.props.tracks,this.state.closeTrackMenuId)]}))));let v=null;this.props.chooseTrackHandler&&(v=d.filter(y=>y.track.position!=="whole").map(y=>{let b="transparent",T="none";return this.state.mouseOverOverlayUid===y.track.uid&&(b="yellow",T="1px solid black"),E.createElement("div",{key:y.track.uid,className:"tiled-plot-track-overlay",onClick:()=>this.handleTrackPositionChosen(y),onDragEnter:S=>{this.handleOverlayMouseEnter(y.track.uid),S.preventDefault()},onDragLeave:()=>this.handleOverlayMouseLeave(y.track.uid),onDragOver:S=>S.preventDefault(),onDrop:()=>this.handleTrackPositionChosen(y),onMouseEnter:()=>this.handleOverlayMouseEnter(y.track.uid),onMouseLeave:()=>this.handleOverlayMouseLeave(y.track.uid),style:{position:"absolute",left:y.left,top:y.top,width:y.width,height:y.height,background:b,opacity:.4,border:T,zIndex:1}})}));let _=null;if(this.xScale&&this.yScale&&this.props.editable&&this.state.trackOptions){const y=this.state.trackOptions.configComponent,b=this.state.trackOptions.track;_=E.createElement(y,{track:b,xScale:this.xScale,yScale:this.yScale,onCancel:()=>{this.setState({trackOptions:null})},onTrackOptionsChanged:T=>T,onSubmit:T=>{this.handleTrackOptionsChanged(this.state.trackOptions.track.uid,T),this.setState({trackOptions:null})}})}return E.createElement("div",{ref:y=>{this.divTiledPlot=y},className:["tiled-plot-div",Eo["tiled-plot"]].join(" "),style:{marginBottom:this.props.marginBottom,marginLeft:this.props.marginLeft,marginRight:this.props.marginRight,marginTop:this.props.marginTop}},p,v,m,g,_,this.getContextMenu(),this.props.draggingHappening&&this.getIdealizedTrackPositionsOverlay())}},{key:"addEventListeners",value:function(){this.eventListeners=[],this.eventListeners.forEach(n=>document.addEventListener(n.name,n.callback,!1))}},{key:"removeEventListeners",value:function(){this.eventListeners.forEach(n=>document.removeEventListener(n.name,n.callback))}}]),r}(E.Component);JD.defaultProps={isShowGlobalMousePosition:!1,pluginDataFetchers:{},pluginTracks:{},metaTracks:[],zoomable:!0},JD.propTypes={addTrackPosition:N.string,canvasElement:N.object,chooseTrackHandler:N.func,chromInfoPath:N.string,customDialog:N.array,closeCustomDialog:N.func,disableTrackMenu:N.bool,dragging:N.bool,draggingHappening:N.bool,editable:N.bool,getLockGroupExtrema:N.func,initialXDomain:N.array,initialYDomain:N.array,isShowGlobalMousePosition:N.bool,isValueScaleLocked:N.func,marginBottom:N.number.isRequired,marginLeft:N.number.isRequired,marginRight:N.number.isRequired,marginTop:N.number.isRequired,paddingBottom:N.number.isRequired,paddingLeft:N.number.isRequired,paddingRight:N.number.isRequired,paddingTop:N.number.isRequired,metaTracks:N.array,modal:N.object,mouseTool:N.string,onCloseTrack:N.func,onChangeTrackData:N.func,onChangeTrackType:N.func,onDataDomainChanged:N.func,onLockValueScale:N.func,onMouseMoveZoom:N.func,onNewTilesLoaded:N.func,onNoTrackAdded:N.func,onRangeSelection:N.func.isRequired,onScalesChanged:N.func,onTrackOptionsChanged:N.func,onTrackPositionChosen:N.func,onTracksAdded:N.func,onUnlockValueScale:N.func,onValueScaleChanged:N.func,onResizeTrack:N.func,overlays:N.array,openModal:N.func,pixiRenderer:N.object,pixiStage:N.object,pluginDataFetchers:N.object,pluginTracks:N.object,pubSub:N.object.isRequired,rangeSelection1dSize:N.array,rangeSelectionToInt:N.bool,registerDraggingChangedListener:N.func,removeDraggingChangedListener:N.func,setCentersFunction:N.func,svgElement:N.object,theme:N.symbol.isRequired,tracks:N.object,trackSourceServers:N.array,uid:N.string,viewOptions:N.object,xDomainLimits:N.array,yDomainLimits:N.array,zoomable:N.bool,zoomLimits:N.array,zoomToDataExtentOnInit:N.func};const u3e=Rf(eT(hc(JD)));var f3e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},h3e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol?"symbol":typeof e},d3e=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;function p3e(e){var t=void 0,r=void 0,i=void 0,n=e.ownerDocument,o=n.body,a=n&&n.documentElement;return t=e.getBoundingClientRect(),r=t.left,i=t.top,r-=a.clientLeft||o.clientLeft||0,i-=a.clientTop||o.clientTop||0,{left:r,top:i}}function yY(e,t){var r=e["page"+(t?"Y":"X")+"Offset"],i="scroll"+(t?"Top":"Left");if(typeof r!="number"){var n=e.document;r=n.documentElement[i],typeof r!="number"&&(r=n.body[i])}return r}function ex(e){return yY(e)}function tx(e){return yY(e,!0)}function bY(e){var t=p3e(e),r=e.ownerDocument,i=r.defaultView||r.parentWindow;return t.left+=ex(i),t.top+=tx(i),t}function m3e(e,t,r){var i="",n=e.ownerDocument,o=r||n.defaultView.getComputedStyle(e,null);return o&&(i=o.getPropertyValue(t)||o[t]),i}var g3e=new RegExp("^("+d3e+")(?!px)[a-z%]+$","i"),v3e=/^(top|right|bottom|left)$/,rx="currentStyle",nx="runtimeStyle",eu="left",y3e="px";function b3e(e,t){var r=e[rx]&&e[rx][t];if(g3e.test(r)&&!v3e.test(t)){var i=e.style,n=i[eu],o=e[nx][eu];e[nx][eu]=e[rx][eu],i[eu]=t==="fontSize"?"1em":r||0,r=i.pixelLeft+y3e,i[eu]=n,e[nx][eu]=o}return r===""?"auto":r}var tu=void 0;typeof window<"u"&&(tu=window.getComputedStyle?m3e:b3e);function ix(e,t){for(var r=0;r<e.length;r++)t(e[r])}function _Y(e){return tu(e,"boxSizing")==="border-box"}var _3e=["margin","border","padding"],ox=-1,T3e=2,ax=1,E3e=0;function S3e(e,t,r){var i={},n=e.style,o=void 0;for(o in t)t.hasOwnProperty(o)&&(i[o]=n[o],n[o]=t[o]);r.call(e);for(o in t)t.hasOwnProperty(o)&&(n[o]=i[o])}function Ig(e,t,r){var i=0,n=void 0,o=void 0,a=void 0;for(o=0;o<t.length;o++)if(n=t[o],n)for(a=0;a<r.length;a++){var s=void 0;n==="border"?s=n+r[a]+"Width":s=n+r[a],i+=parseFloat(tu(e,s))||0}return i}function $T(e){return e!=null&&e==e.window}var Sa={};ix(["Width","Height"],function(e){Sa["doc"+e]=function(t){var r=t.document;return Math.max(r.documentElement["scroll"+e],r.body["scroll"+e],Sa["viewport"+e](r))},Sa["viewport"+e]=function(t){var r="client"+e,i=t.document,n=i.body,o=i.documentElement,a=o[r];return i.compatMode==="CSS1Compat"&&a||n&&n[r]||a}});function TY(e,t,r){if($T(e))return t==="width"?Sa.viewportWidth(e):Sa.viewportHeight(e);if(e.nodeType===9)return t==="width"?Sa.docWidth(e):Sa.docHeight(e);var i=t==="width"?["Left","Right"]:["Top","Bottom"],n=t==="width"?e.offsetWidth:e.offsetHeight;tu(e);var o=_Y(e),a=0;(n==null||n<=0)&&(n=void 0,a=tu(e,t),(a==null||Number(a)<0)&&(a=e.style[t]||0),a=parseFloat(a)||0),r===void 0&&(r=o?ax:ox);var s=n!==void 0||o,c=n||a;if(r===ox)return s?c-Ig(e,["border","padding"],i):a;if(s){var u=r===T3e?-Ig(e,["border"],i):Ig(e,["margin"],i);return c+(r===ax?0:u)}return a+Ig(e,_3e.slice(r),i)}var w3e={position:"absolute",visibility:"hidden",display:"block"};function EY(e){var t=void 0,r=arguments;return e.offsetWidth!==0?t=TY.apply(void 0,r):S3e(e,w3e,function(){t=TY.apply(void 0,r)}),t}function Zh(e,t,r){var i=r;if((typeof t>"u"?"undefined":h3e(t))==="object"){for(var n in t)t.hasOwnProperty(n)&&Zh(e,n,t[n]);return}if(typeof i<"u"){typeof i=="number"&&(i+="px"),e.style[t]=i;return}return tu(e,t)}ix(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Sa["outer"+t]=function(i,n){return i&&EY(i,e,n?E3e:ax)};var r=e==="width"?["Left","Right"]:["Top","Bottom"];Sa[e]=function(i,n){if(n!==void 0){if(i){tu(i);var o=_Y(i);return o&&(n+=Ig(i,["padding","border"],r)),Zh(i,e,n)}return}return i&&EY(i,e,ox)}});function A3e(e,t){Zh(e,"position")==="static"&&(e.style.position="relative");var r=bY(e),i={},n=void 0,o=void 0;for(o in t)t.hasOwnProperty(o)&&(n=parseFloat(Zh(e,o))||0,i[o]=n+t[o]-r[o]);Zh(e,i)}var O3e=f3e({getWindow:function(t){var r=t.ownerDocument||t;return r.defaultView||r.parentWindow},offset:function(t,r){if(typeof r<"u")A3e(t,r);else return bY(t)},isWindow:$T,each:ix,css:Zh,clone:function(t){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=t[i]);var n=t.overflow;if(n)for(var i in t)t.hasOwnProperty(i)&&(r.overflow[i]=t.overflow[i]);return r},scrollLeft:function(t,r){if($T(t)){if(r===void 0)return ex(t);window.scrollTo(r,tx(t))}else{if(r===void 0)return t.scrollLeft;t.scrollLeft=r}},scrollTop:function(t,r){if($T(t)){if(r===void 0)return tx(t);window.scrollTo(ex(t),r)}else{if(r===void 0)return t.scrollTop;t.scrollTop=r}},viewportWidth:0,viewportHeight:0},Sa),Tr=O3e;function k3e(e,t,r){r=r||{},t.nodeType===9&&(t=Tr.getWindow(t));var i=r.allowHorizontalScroll,n=r.onlyScrollIfNeeded,o=r.alignWithTop,a=r.alignWithLeft,s=r.offsetTop||0,c=r.offsetLeft||0,u=r.offsetBottom||0,l=r.offsetRight||0;i=i===void 0?!0:i;var h=Tr.isWindow(t),f=Tr.offset(e),d=Tr.outerHeight(e),p=Tr.outerWidth(e),m=void 0,g=void 0,v=void 0,_=void 0,y=void 0,b=void 0,T=void 0,S=void 0,k=void 0,O=void 0;h?(T=t,O=Tr.height(T),k=Tr.width(T),S={left:Tr.scrollLeft(T),top:Tr.scrollTop(T)},y={left:f.left-S.left-c,top:f.top-S.top-s},b={left:f.left+p-(S.left+k)+l,top:f.top+d-(S.top+O)+u},_=S):(m=Tr.offset(t),g=t.clientHeight,v=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(m.left+(parseFloat(Tr.css(t,"borderLeftWidth"))||0))-c,top:f.top-(m.top+(parseFloat(Tr.css(t,"borderTopWidth"))||0))-s},b={left:f.left+p-(m.left+v+(parseFloat(Tr.css(t,"borderRightWidth"))||0))+l,top:f.top+d-(m.top+g+(parseFloat(Tr.css(t,"borderBottomWidth"))||0))+u}),y.top<0||b.top>0?o===!0?Tr.scrollTop(t,_.top+y.top):o===!1?Tr.scrollTop(t,_.top+b.top):y.top<0?Tr.scrollTop(t,_.top+y.top):Tr.scrollTop(t,_.top+b.top):n||(o=o===void 0?!0:!!o,o?Tr.scrollTop(t,_.top+y.top):Tr.scrollTop(t,_.top+b.top)),i&&(y.left<0||b.left>0?a===!0?Tr.scrollLeft(t,_.left+y.left):a===!1?Tr.scrollLeft(t,_.left+b.left):y.left<0?Tr.scrollLeft(t,_.left+y.left):Tr.scrollLeft(t,_.left+b.left):n||(a=a===void 0?!0:!!a,a?Tr.scrollLeft(t,_.left+y.left):Tr.scrollLeft(t,_.left+b.left)))}var I3e=k3e,C3e=I3e;const P3e=ui(C3e);function jT(){return jT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},jT.apply(this,arguments)}function D3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,N3e(i.key),i)}}function x3e(e,t,r){return t&&SY(e.prototype,t),r&&SY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function N3e(e){var t=R3e(e,"string");return typeof t=="symbol"?t:String(t)}function R3e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function M3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sx(e,t)}function sx(e,t){return sx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},sx(e,t)}function L3e(e){var t=F3e();return function(){var i=UT(e),n;if(t){var o=UT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return B3e(this,n)}}function B3e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H3e(e)}function H3e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function UT(e){return UT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},UT(e)}const Cg=[];let lx=function(e){M3e(r,e);var t=L3e(r);function r(i){var n;return D3e(this,r),n=t.call(this,i),n.state={highlightedIndex:null,menuTop:0,menuLeft:0,menuWidth:0,isOpen:!1},n.keyDownHandlers={ArrowDown(o){o.preventDefault();const a=this.getFilteredItems().length;if(!a)return;const{highlightedIndex:s}=this.state,c=s===null||s===a-1?0:s+1;this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:c,isOpen:!0})},ArrowUp(o){o.preventDefault();const a=this.getFilteredItems().length;if(!a)return;const{highlightedIndex:s}=this.state,c=s===0||s===null?a-1:s-1;this._performAutoCompleteOnKeyUp=!0,this.setState({highlightedIndex:c,isOpen:!0})},Enter(o){if(this.state.isOpen!==!1)if(this.state.highlightedIndex===null)this.setState({isOpen:!1},()=>{this.inputEl.select()});else{o.preventDefault();const a=this.getFilteredItems()[this.state.highlightedIndex],s=this.props.getItemValue(a);this.setState({isOpen:!1,highlightedIndex:null},()=>{this.inputEl.setSelectionRange(s.length,s.length),this.props.onSelect(s,a)})}},Escape(){this.setState({highlightedIndex:null,isOpen:!1})}},n}return x3e(r,[{key:"getInitialState",value:function(){return{isOpen:!1,highlightedIndex:null}}},{key:"UNSAFE_componentWillMount",value:function(){this._ignoreBlur=!1,this._performAutoCompleteOnUpdate=!1,this._performAutoCompleteOnKeyUp=!1}},{key:"UNSAFE_componentWillReceiveProps",value:function(n){this._performAutoCompleteOnUpdate=!0,(this.props.items!==n.items||this.state.highlightedIndex>=n.items.length)&&this.setState({highlightedIndex:null})}},{key:"componentDidUpdate",value:function(n,o){this.state.isOpen===!0&&o.isOpen===!1&&this.setMenuPositions(),this.state.isOpen&&this._performAutoCompleteOnUpdate&&(this._performAutoCompleteOnUpdate=!1,this.maybeAutoCompleteText()),this.maybeScrollItemIntoView(),o.isOpen!==this.state.isOpen&&this.props.onMenuVisibilityChange(this.state.isOpen,this.inputEl)}},{key:"maybeScrollItemIntoView",value:function(){if(this.state.isOpen===!0&&this.state.highlightedIndex!==null){const n=this.refs[`item-${this.state.highlightedIndex}`],o=this.refs.menu;n&&P3e(Lr.findDOMNode(n),Lr.findDOMNode(o),{onlyScrollIfNeeded:!0})}}},{key:"handleKeyDown",value:function(n){this.keyDownHandlers[n.key]?this.keyDownHandlers[n.key].call(this,n):this.setState({highlightedIndex:null,isOpen:!0})}},{key:"handleChange",value:function(n){this._performAutoCompleteOnKeyUp=!0,this.props.onChange(n,n.target.value)}},{key:"handleKeyUp",value:function(){this._performAutoCompleteOnKeyUp&&(this._performAutoCompleteOnKeyUp=!1,this.maybeAutoCompleteText())}},{key:"getFilteredItems",value:function(){let n=this.props.items;return this.props.shouldItemRender&&(n=n.filter(o=>this.props.shouldItemRender(o,this.props.value))),this.props.sortItems&&n.sort((o,a)=>this.props.sortItems(o,a,this.props.value)),n}},{key:"maybeAutoCompleteText",value:function(){if(!this.props.autoHighlight||this.props.value==="")return;const{highlightedIndex:n}=this.state,o=this.getFilteredItems();if(o.length===0)return;const a=n!==null?o[n]:o[0];this.props.getItemValue(a).toLowerCase().indexOf(this.props.value.toLowerCase())===0&&n===null&&this.setState({highlightedIndex:0})}},{key:"setMenuPositions",value:function(){const n=this.inputEl,o=n.getBoundingClientRect(),a=globalThis.window.getComputedStyle(n),s=parseInt(a.marginBottom,10)||0,c=parseInt(a.marginLeft,10)||0,u=parseInt(a.marginRight,10)||0;this.setState({menuTop:o.bottom+s,menuLeft:o.left+c,menuWidth:o.width+c+u})}},{key:"highlightItemFromMouse",value:function(n){this.setState({highlightedIndex:n})}},{key:"selectItemFromMouse",value:function(n){const o=this.props.getItemValue(n);this.setState({isOpen:!1,highlightedIndex:null},()=>{this.props.onSelect(o,n),this.inputEl.focus()})}},{key:"setIgnoreBlur",value:function(n){this._ignoreBlur=n}},{key:"renderMenu",value:function(){const n=this.getFilteredItems().map((s,c)=>{const u=this.props.renderItem(s,this.state.highlightedIndex===c,{cursor:"default"});return E.cloneElement(u,{onMouseDown:()=>this.setIgnoreBlur(!0),onMouseEnter:()=>this.highlightItemFromMouse(c),onClick:()=>this.selectItemFromMouse(s),ref:`item-${c}`})}),o={left:this.state.menuLeft,top:this.state.menuTop,minWidth:this.state.menuWidth};if(!n.length)return null;const a=this.props.renderMenu(n,this.props.value,o);return E.cloneElement(a,{ref:"menu"})}},{key:"handleInputBlur",value:function(){this.props.onFocus&&this.props.onFocus(),!this._ignoreBlur&&this.setState({isOpen:!1,highlightedIndex:null})}},{key:"handleInputFocus",value:function(){if(this.props.onFocus&&this.props.onFocus(!0),this._ignoreBlur){this.setIgnoreBlur(!1);return}this._ignoreClick=!0,this.setState({isOpen:!0})}},{key:"isInputFocused",value:function(){return this.inputEl.ownerDocument&&this.inputEl===this.inputEl.ownerDocument.activeElement}},{key:"handleInputClick",value:function(){this.isInputFocused()&&this.state.isOpen===!1?this.setState({isOpen:!0}):this.state.highlightedIndex!==null&&!this._ignoreClick&&this.selectItemFromMouse(this.getFilteredItems()[this.state.highlightedIndex]),this._ignoreClick=!1}},{key:"composeEventHandlers",value:function(n,o){return o?a=>{n(a),o(a)}:n}},{key:"render",value:function(){this.props.debug&&Cg.push({id:Cg.length,state:this.state});const{inputProps:n}=this.props;return E.createElement("div",jT({style:{...this.props.wrapperStyle}},this.props.wrapperProps),E.createElement("input",jT({},n,{ref:o=>{this.inputEl=o},"aria-autocomplete":"list",autoComplete:"off",onBlur:this.composeEventHandlers(this.handleInputBlur.bind(this),n.onBlur&&n.onBlur.bind(this)),onChange:this.handleChange.bind(this),onClick:this.composeEventHandlers(this.handleInputClick.bind(this),n.onClick&&n.onClick.bind(this)),onFocus:this.composeEventHandlers(this.handleInputFocus.bind(this),n.onFocus&&n.onFocus.bind(this)),onKeyDown:this.composeEventHandlers(this.handleKeyDown.bind(this),n.onKeyDown&&n.onKeyDown.bind(this)),onKeyUp:this.composeEventHandlers(this.handleKeyUp.bind(this),n.onKeyUp&&n.onKeyUp.bind(this)),role:"combobox",value:this.props.value})),("open"in this.props?this.props.open:this.state.isOpen)&&this.renderMenu(),this.props.debug&&E.createElement("pre",{style:{marginLeft:300}},JSON.stringify(Cg.slice(Cg.length-5,Cg.length),null,2)))}}]),r}(E.Component);lx.defaultProps={value:"",wrapperProps:{},wrapperStyle:{display:"inline-block"},inputProps:{},onChange(){},onSelect(){},renderMenu(e,t,r){return E.createElement("div",{style:{...r,...this.menuStyle}},e)},shouldItemRender(){return!0},menuStyle:{borderRadius:"3px",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.1)",background:"rgba(255, 255, 255, 0.9)",padding:"2px 0",fontSize:"90%",position:"fixed",overflow:"auto",maxHeight:"50%"},autoHighlight:!0,onMenuVisibilityChange(){}},lx.propTypes={autoHighlight:N.bool,debug:N.bool,getItemValue:N.func.isRequired,inputProps:N.object,items:N.array,menuStyle:N.object,onChange:N.func,onFocus:N.func,onMenuVisibilityChange:N.func,onSelect:N.func,open:N.bool,renderItem:N.func.isRequired,renderMenu:N.func,shouldItemRender:N.func,sortItems:N.func,value:N.any,wrapperProps:N.object,wrapperStyle:N.object};const Qh={"genome-position-search":"_genome-position-search_1l2sx_1","genome-position-search-focus":"_genome-position-search-focus_1l2sx_2","genome-position-search-bar":"_genome-position-search-bar_1l2sx_16","genome-position-search-dark":"_genome-position-search-dark_1l2sx_34","genome-position-search-bar-button":"_genome-position-search-bar-button_1l2sx_38","genome-position-search-bar-button-focus":"_genome-position-search-bar-button-focus_1l2sx_39","genome-position-search-bar-icon":"_genome-position-search-bar-icon_1l2sx_62","genome-position-search-bar-icon-focus":"_genome-position-search-bar-icon-focus_1l2sx_63","genome-position-search-bar-suggestions":"_genome-position-search-bar-suggestions_1l2sx_83",btn:"_btn_1l2sx_95","btn-sm":"_btn-sm_1l2sx_116","btn-default":"_btn-default_1l2sx_122"};function $3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,U3e(i.key),i)}}function j3e(e,t,r){return t&&wY(e.prototype,t),r&&wY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function U3e(e){var t=G3e(e,"string");return typeof t=="symbol"?t:String(t)}function G3e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cx(e,t)}function cx(e,t){return cx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},cx(e,t)}function V3e(e){var t=Y3e();return function(){var i=GT(e),n;if(t){var o=GT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return W3e(this,n)}}function W3e(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AY(e)}function AY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function GT(e){return GT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},GT(e)}let OY=function(e){z3e(r,e);var t=V3e(r);function r(i){var n;return $3e(this,r),n=t.call(this,i),n.mounted=!1,n.uid=xt.nice(),n.chromInfo=null,n.searchField=null,n.autocompleteMenu=null,n.xScale=null,n.yScale=null,n.prevParts=[],n.props.registerViewportChangedListener(n.scalesChanged.bind(AY(n))),n.menuPosition={left:0,top:0},n.positionText="chr4:190,998,876-191,000,255",n.state={genes:[],isFocused:!1,autocompleteServer:n.props.autocompleteServer,autocompleteId:n.props.autocompleteId,availableAssemblies:[],selectedAssembly:null},n.styles={item:{padding:"2px 6px",cursor:"default"},highlightedItem:{color:"white",background:"hsl(200, 50%, 50%)",padding:"2px 6px",cursor:"default"},menu:{border:"solid 1px #ccc"}},n.availableAutocompletes={},n.props.autocompleteId&&(n.availableAutocompletes[n.props.chromInfoId]=new Set([{server:n.props.autocompleteServer,acId:n.props.autocompleteId}])),n.availableChromSizes={},n}return j3e(r,[{key:"componentDidMount",value:function(){this.mounted=!0,Bt(this.autocompleteMenu.inputEl).on("keypress",this.autocompleteKeyPress.bind(this)),this.findAvailableAutocompleteSources(),this.findAvailableChromSizes(),this.props.chromInfoPath&&(this.searchPosition=!0,ma(this.props.chromInfoPath,n=>{if(!n){this.searchPosition=null;return}this.chromInfo=n,this.searchField=new ch(this.chromInfo),this.setPositionText()})),this.setPositionText()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,this.props.removeViewportChangedListener()}},{key:"onAutocompleteChange",value:function(n,o){this.positionText=o,this.setState({value:o,loading:!0}),this.changedPart=null;const a=o.split(/ /);let s=0;const c=[];let u=!1;for(let l=0;l<a.length;l++){const h=a[l].split(/-/);for(let f=0;f<h.length;f++){if(s+=1,c.push(h[f]),f===0?u=!0:u=!1,f===this.prevParts.length){this.changedPart=s-1;break}if(h[f]!==this.prevParts[f]){this.changedPart=s-1;break}}}if(this.prevParts=c,!!(this.state.autocompleteServer&&this.state.autocompleteId)&&this.changedPart!==null){this.setState({loading:!0});let l=`${this.state.autocompleteServer}/suggest/`;l+=`?d=${this.state.autocompleteId}&ac=${c[this.changedPart].toLowerCase()}`,Ke.json(l,(h,f)=>{if(h)this.setState({loading:!1,genes:[]});else if(this.changedPart>0&&!u){const d=`${this.state.autocompleteServer}/suggest/?d=${this.state.autocompleteId}&ac=${c[this.changedPart-1].toLowerCase()}-${c[this.changedPart].toLowerCase()}`;Ke.json(d,(p,m)=>{p?this.setState({loading:!1,genes:f}):this.setState({loading:!1,genes:m.concat(f)})},this.props.pubSub)}else this.setState({loading:!1,genes:f})},this.props.pubSub)}}},{key:"setAvailableAssemblies",value:function(){const n=new Set(Xi(this.availableChromSizes)),o=new Set([...n]);this.gpsbForm&&this.setState({availableAssemblies:[...o]})}},{key:"setSelectedAssembly",value:function(n){if(!this.mounted||!this.availableChromSizes[n])return;const o=[...this.availableChromSizes[n]][0];this.setState({autocompleteServer:o.server});const{server:a}=o;if(this.availableAutocompletes[n]){const s=[...this.availableAutocompletes[n]][0].acId;this.props.onSelectedAssemblyChanged(n,s,a),this.gpsbForm&&this.setState({autocompleteId:s})}else this.props.onSelectedAssemblyChanged(n,null,a),this.gpsbForm&&this.setState({autocompleteId:null});this.fetchChromInfo(o.uuid,o.server)}},{key:"setPositionText",value:function(){if(!this.mounted||!this.searchField)return;const n=this.searchField.scalesToPositionText(this.xScale,this.yScale,this.props.twoD);this.prevParts=n.split(/[ -]/),this.gpsbForm&&(this.positionText=n,this.origPositionText=n,this.autocompleteMenu.inputEl.value=n)}},{key:"scalesChanged",value:function(n,o){this.xScale=n,this.yScale=o,this.setPositionText()}},{key:"findAvailableChromSizes",value:function(){this.props.trackSourceServers&&this.props.trackSourceServers.forEach(n=>{Ke.json(`${n}/available-chrom-sizes/`,(o,a)=>{o?console.error(o):(a.results.forEach(s=>{s.coordSystem in this.availableChromSizes||(this.availableChromSizes[s.coordSystem]=new Set),this.availableChromSizes[s.coordSystem].add({server:n,uuid:s.uuid}),this.setAvailableAssemblies()}),this.searchField||this.fetchChromInfo(this.props.chromInfoId in this.availableChromSizes?[...this.availableChromSizes[this.props.chromInfoId]][0].uuid:this.props.chromInfoId,this.props.chromInfoId in this.availableChromSizes?[...this.availableChromSizes[this.props.chromInfoId]][0].server:this.props.chromInfoServer))},this.props.pubSub)})}},{key:"findAvailableAutocompleteSources",value:function(){this.props.trackSourceServers&&this.props.trackSourceServers.forEach(n=>{Ke.json(`${n}/tilesets/?limit=100&dt=gene-annotation`,(o,a)=>{o?console.error(o):(a.results.forEach(s=>{s.coordSystem in this.availableAutocompletes||(this.availableAutocompletes[s.coordSystem]=new Set),this.availableAutocompletes[s.coordSystem].add({server:n,acId:s.uuid}),this.setAvailableAssemblies()}),this.state.autocompleteId||this.gpsbForm&&this.availableAutocompletes[this.props.chromInfoId]&&this.setState({autocompleteId:[...this.availableAutocompletes[this.props.chromInfoId]][0].acId}))},this.props.pubSub)})}},{key:"fetchChromInfo",value:function(n,o){ma(`${o}/chrom-sizes/?id=${n}`,a=>{a&&(Ke.json(`${o}/tileset_info/?d=${n}`,(s,c)=>{s||this.gpsbForm&&this.setState({selectedAssembly:c[n].coordSystem})},this.props.pubSub),this.chromInfo=a,this.searchField=new ch(this.chromInfo),this.setPositionText())},this.props.pubSub)}},{key:"autocompleteKeyPress",value:function(n){n.keyCode===13&&this.buttonClick()}},{key:"genePositionToSearchBarText",value:function(n){}},{key:"replaceGenesWithLoadedPositions",value:function(n){const o=this.positionText,a=o.split(" ");let s=!1;for(let u=0;u<a.length;u++){const l=a[u].split("-");let h=0,f=0,d="";for(;h<l.length;){for(f=l.length;f>h;){const p=l.slice(h,f).join("-");if(n[p.toLowerCase()]){const m=n[p.toLowerCase()],g=Math.floor((m.txEnd-m.txStart)/4);h===0&&f<l.length?d=`${m.chr}:${m.txStart-g}`:h===0&&f===l.length?d=`${m.chr}:${m.txStart-g}-${m.txEnd+g}`:d+=`- ${m.chr}:${m.txEnd+g}`,s=!0;break}else f===h+1&&(d.length&&(d+="-"),d+=p);f-=1}h=f+1}a[u]=d}const c=a.join(" ");return this.prevParts=c.split(/[ -]/),this.positionText=c,this.setState({value:c}),s?o:null}},{key:"replaceGenesWithPositions",value:function(n){const o=this.positionText.split(/[ -]/),a=[];for(let s=0;s<o.length;s++){if(o[s].length===0)continue;const c=this.searchField.parsePosition(o[s])[2];if(c===null||Number.isNaN(+c)){const u=`${this.state.autocompleteServer}/suggest/?d=${this.state.autocompleteId}&ac=${o[s].toLowerCase()}`;a.push(Ke.json(u,po,this.props.pubSub))}}Promise.all(a).then(s=>{if(s){const c={};for(let l=0;l<s.length;l++)if(s[l][0])for(let h=0;h<s[l].length;h++)c[s[l][h].geneName.toLowerCase()]=s[l][h];const u=this.replaceGenesWithLoadedPositions(c);n(u)}}).catch(s=>console.error(s))}},{key:"buttonClick",value:function(){this.setState({genes:[]}),this.replaceGenesWithPositions(n=>{const o=this.positionText;if(this.searchField!==null){const a=this.searchField.searchPosition(o),s=a[0];let c=a[1];if(!s){this.setPositionText();return}if(s&&(Number.isNaN(+s[0])||Number.isNaN(+s[1]))||c&&(Number.isNaN(+c[0])||Number.isNaN(+c[1])))return;c||(c=s);const u=this.xScale.copy().domain(s),l=this.yScale.copy().domain(c),[h,f,d]=tn(u,l);n&&this.props.onGeneSearch({geneSymbol:n,range:s,centerX:h,centerY:f}),this.props.setCenters(h,f,d,JL)}})}},{key:"searchFieldSubmit",value:function(){this.buttonClick()}},{key:"pathJoin",value:function(n,o){const a=o||"/",s=new RegExp(`${a}{1,}`,"g");return n.join(a).replace(s,a)}},{key:"geneSelected",value:function(n,o){const a=this.positionText.split(" ");let s=this.changedPart;for(let c=0;c<a.length;c++){const u=a[c].split("-"),l=o.geneName.split("-");if(s>u.length-1)s-=u.length;else{if(u[s]=o.geneName,l.length===2&&s>0&&u[s-1].toLowerCase()===l[0].toLowerCase()){const h=u.slice(0,s-1);h.push(l.join("-")),s<u.length-1&&h.push(u.slice(s+1)),a[c]=h.join("-")}else a[c]=u.join("-");break}}this.prevParts=a.join(" ").split(/[ -]/),this.positionText=a.join(" "),this.setState({value:a.join(" "),genes:[]})}},{key:"handleMenuVisibilityChange",value:function(n,o){const a=o.getBoundingClientRect();this.menuPosition={left:a.left,top:a.top+a.height},this.setState({menuOpened:n})}},{key:"handleRenderMenu",value:function(n){return E.createElement(ml,null,E.createElement("div",{className:Qh["genome-position-search-bar-suggestions"],style:{left:this.menuPosition.left,top:this.menuPosition.top}},n))}},{key:"handleAssemblySelectEvt",value:function(n){this.handleAssemblySelect(n.target.value)}},{key:"handleAssemblySelect",value:function(n){this.setSelectedAssembly(n),this.setState({selectedAssembly:n})}},{key:"focusHandler",value:function(n){this.setState({isFocused:n})}},{key:"render",value:function(){const n=this.state.availableAssemblies.map(o=>E.createElement("option",{key:o,value:o},o));return E.createElement("div",{ref:o=>{this.gpsbForm=o},className:Zt({[Qh["genome-position-search-focus"]]:this.state.isFocused,[Qh["genome-position-search"]]:!this.state.isFocused,[Qh["genome-position-search-dark"]]:this.props.theme===mr})},!this.props.hideAvailableAssemblies&&E.createElement("select",{ref:o=>{this.assemblyPickButton=o},className:Qh["genome-position-search-bar-button"],id:this.uid,onChange:this.handleAssemblySelectEvt.bind(this),value:this.state.selectedAssembly||void 0},n),E.createElement(lx,{ref:o=>{this.autocompleteMenu=o},getItemValue:o=>o.geneName,inputProps:{className:Qh["genome-position-search-bar"],title:"Current location: enter a symbol or location to change the position of the current view"},items:this.state.genes,menuStyle:{position:"absolute",left:this.menuPosition.left,top:this.menuPosition.top,border:"1px solid black"},onChange:this.onAutocompleteChange.bind(this),onFocus:this.focusHandler.bind(this),onMenuVisibilityChange:this.handleMenuVisibilityChange.bind(this),onSelect:(o,a)=>this.geneSelected(o,a),onSubmit:this.searchFieldSubmit.bind(this),renderItem:(o,a)=>E.createElement("div",{key:o.refseqid,id:o.refseqid,style:a?this.styles.highlightedItem:this.styles.item},o.geneName),renderMenu:this.handleRenderMenu.bind(this),value:this.state.selectedAssembly?this.positionText:"No valid assembly selected",wrapperStyle:{width:"100%"}}),E.createElement(l5,{onClick:this.buttonClick.bind(this),theStyle:"multitrack-header-icon"}))}}]),r}(E.Component);OY.propTypes={autocompleteId:N.string,autocompleteServer:N.string,chromInfoId:N.string,chromInfoServer:N.string,chromInfoPath:N.string,hideAvailableAssemblies:N.bool,isFocused:N.bool,pubSub:N.object,onFocus:N.func,onGeneSearch:N.func,onSelectedAssemblyChanged:N.func,registerViewportChangedListener:N.func,removeViewportChangedListener:N.func,setCenters:N.func,theme:N.symbol.isRequired,trackSourceServers:N.array,twoD:N.bool};const q3e=Rf(hc(OY)),X3e={"export-link-dialog-wrapper":"_export-link-dialog-wrapper_p9gxw_1"};function K3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Q3e(i.key),i)}}function Z3e(e,t,r){return t&&kY(e.prototype,t),r&&kY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q3e(e){var t=J3e(e,"string");return typeof t=="symbol"?t:String(t)}function J3e(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ux(e,t)}function ux(e,t){return ux=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},ux(e,t)}function tVe(e){var t=iVe();return function(){var i=zT(e),n;if(t){var o=zT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return rVe(this,n)}}function rVe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nVe(e)}function nVe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iVe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zT(e){return zT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zT(e)}let fx=function(e){eVe(r,e);var t=tVe(r);function r(){return K3e(this,r),t.apply(this,arguments)}return Z3e(r,[{key:"render",value:function(){return E.createElement(og,{okayOnly:!0,okayTitle:"Done",onOkay:this.props.onDone,title:"Share view link"},E.createElement("div",{className:X3e["export-link-dialog-wrapper"]},E.createElement("input",{ref:n=>{n&&(this.input=n,n.focus(),n.select())},onClick:n=>{n.target.select()},placeholder:"Generating the link...",readOnly:!0,value:this.props.url}),E.createElement(cs,{onClick:n=>{this.input.select(),document.execCommand("copy")}},"Copy")))}}]),r}(E.Component);fx.defaultProps={onDone:()=>{},url:""},fx.propTypes={onDone:N.func,url:N.string};function oVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,sVe(i.key),i)}}function aVe(e,t,r){return t&&IY(e.prototype,t),r&&IY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sVe(e){var t=lVe(e,"string");return typeof t=="symbol"?t:String(t)}function lVe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hx(e,t)}function hx(e,t){return hx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},hx(e,t)}function uVe(e){var t=dVe();return function(){var i=VT(e),n;if(t){var o=VT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return fVe(this,n)}}function fVe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hVe(e)}function hVe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dVe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function VT(e){return VT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},VT(e)}let CY=function(e){cVe(r,e);var t=uVe(r);function r(i){var n;return oVe(this,r),n=t.call(this,i),n.state={submenuShown:!1},n}return aVe(r,[{key:"getConfigureViewMenu",value:function(n,o){const a=["backgroundColor"],s={},c={};for(const u of a)if(u in Object.keys(wn)&&(s[u]={name:wn[u].name},wn[u].inlineOptions))for(const l in wn[u].inlineOptions){const h=wn[u].inlineOptions[l];s[u].children||(s[u].children={});const f={name:h.name,value:h.value};f.handler=()=>{c[u]=h.value,this.props.onOptionsChanged(c)},s[u].children[l]=f}return E.createElement(GD,{key:"config-series-menu",closeMenu:this.props.closeMenu,menuItems:s,orientation:this.state.orientation,parentBbox:o,position:n,theme:this.props.theme})}},{key:"getSubmenu",value:function(){if(this.state.submenuShown){const n=this.state.submenuSourceBbox,o=this.state.orientation==="left"?{left:this.state.left,top:n.top}:{left:this.state.left+n.width+7,top:n.top};return this.state.submenuShown.option==="options"?this.getConfigureViewMenu(o,n):E.createElement("div",null)}return E.createElement("div",null)}},{key:"render",value:function(){return E.createElement("div",{ref:n=>{this.div=n},className:Zt(mt["context-menu"],{[mt["context-menu-dark"]]:this.props.theme===mr}),"data-menu-type":"ConfigViewMenu",style:{left:this.state.left,top:this.state.top}},E.createElement(St,{onClick:n=>this.props.onTogglePositionSearchBox(n)},"Toggle position search box"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onZoomToData(n)},"Zoom to data extent"),E.createElement(St,{onClick:n=>this.props.onClearView(n)},"Clear View"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onYankZoom(n)},"Take zoom from"),E.createElement(St,{onClick:n=>this.props.onYankLocation(n)},"Take location from"),E.createElement(St,{onClick:n=>this.props.onYankZoomAndLocation(n)},"Take zoom and location from"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:this.props.onLockZoom},"Lock zoom with"),E.createElement(St,{onClick:this.props.onLockLocation},"Lock location with"),E.createElement(St,{onClick:this.props.onLockZoomAndLocation},"Lock zoom and location with"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:this.props.onTakeAndLockZoomAndLocation},"Take and lock zoom and location with"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onUnlockZoom(n)},"Unlock zoom"),E.createElement(St,{onClick:n=>this.props.onUnlockLocation(n)},"Unlock location"),E.createElement(St,{onClick:n=>this.props.onUnlockZoomAndLocation(n)},"Unlock zoom and location"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onProjectViewport(n)},"Show this viewport on"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:n=>this.props.onEditViewConfig(n)},"Edit view config"),E.createElement("hr",{className:mt["context-menu-hr"]}),E.createElement(St,{onClick:()=>this.props.onExportSVG()},"Export views as SVG"),E.createElement(St,{onClick:()=>this.props.onExportPNG()},"Export views as PNG"),E.createElement(St,{onClick:()=>this.props.onExportViewAsJSON()},"Export views as JSON"),E.createElement(St,{onClick:()=>this.props.onExportViewAsLink()},"Export views as Link"),this.getSubmenu())}}]),r}(pl);CY.propTypes={onEditViewConfig:N.func.isRequired,onExportSVG:N.func,onExportPNG:N.func,onExportViewAsJSON:N.func,onExportViewAsLink:N.func,onLockLocation:N.func,onLockZoom:N.func,onLockZoomAndLocation:N.func,onProjectViewport:N.func,onTakeAndLockZoomAndLocation:N.func,onTogglePositionSearchBox:N.func,onUnlockLocation:N.func,onUnlockZoom:N.func,onUnlockZoomAndLocation:N.func,onYankLocation:N.func,onYankZoom:N.func,onYankZoomAndLocation:N.func,onZoomToData:N.func,theme:N.symbol};const io={"add-track-position-table":"_add-track-position-table_wdy5w_1","add-track-position-table-dark":"_add-track-position-table-dark_wdy5w_7","add-track-position-other":"_add-track-position-other_wdy5w_11","add-track-position-top-center":"_add-track-position-top-center_wdy5w_15","add-track-position-middle-left":"_add-track-position-middle-left_wdy5w_30","add-track-position-middle-right":"_add-track-position-middle-right_wdy5w_45","add-track-position-middle-middle":"_add-track-position-middle-middle_wdy5w_60","add-track-position-bottom-middle":"_add-track-position-bottom-middle_wdy5w_71","add-track-position-span":"_add-track-position-span_wdy5w_86"};function PY(e){return E.createElement("div",null,E.createElement("div",{className:io["add-track-position-span"]},"Add Track..."),E.createElement("table",{className:Zt(io["add-track-position-table"],{[io["add-track-position-table-dark"]]:e.theme===mr})},E.createElement("tbody",null,E.createElement("tr",{style:{height:"30px"}},E.createElement("td",{"aria-hidden":"true",className:io["add-track-position-other"]}),E.createElement("td",{className:io["add-track-position-top-center"],onClick:()=>e.onTrackPositionChosen("top")},"top"),E.createElement("td",{"aria-hidden":"true",className:io["add-track-position-other"]})),E.createElement("tr",{style:{height:"80px"}},E.createElement("td",{className:io["add-track-position-middle-left"],onClick:()=>e.onTrackPositionChosen("left")},"left"),E.createElement("td",{className:io["add-track-position-middle-middle"],onClick:()=>e.onTrackPositionChosen("center")},"center"),E.createElement("td",{className:io["add-track-position-middle-right"],onClick:()=>e.onTrackPositionChosen("right")},"right")),E.createElement("tr",{style:{height:"30px"}},E.createElement("td",{"aria-hidden":"true",className:io["add-track-position-other"]}),E.createElement("td",{className:io["add-track-position-bottom-middle"],onClick:()=>e.onTrackPositionChosen("bottom")},"bottom"),E.createElement("td",{"aria-hidden":"true",className:io["add-track-position-other"]})))))}PY.propTypes={onTrackPositionChosen:N.func.isRequired,theme:N.symbol.isRequired};const pVe=hc(PY);function mVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DY(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,vVe(i.key),i)}}function gVe(e,t,r){return t&&DY(e.prototype,t),r&&DY(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vVe(e){var t=yVe(e,"string");return typeof t=="symbol"?t:String(t)}function yVe(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dx(e,t)}function dx(e,t){return dx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},dx(e,t)}function _Ve(e){var t=EVe();return function(){var i=WT(e),n;if(t){var o=WT(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return TVe(this,n)}}function TVe(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xY(e)}function xY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EVe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function WT(e){return WT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},WT(e)}let px=function(e){bVe(r,e);var t=_Ve(r);function r(i){var n;return mVe(this,r),n=t.call(this,i),n.configImg=null,n.plusImg=null,n.state={addTrackPositionMenuUid:null,addTrackPositionMenuPosition:null,configMenuUid:null,configMenuPosition:null,isFocused:!1,width:-1},n.handleTrackPositionChosenBound=n.handleTrackPositionChosen.bind(xY(n)),n}return gVe(r,[{key:"componentDidMount",value:function(){this.setState({width:this.el.clientWidth})}},{key:"checkWidth",value:function(){const n=this.el.clientWidth;n!==this.state.width&&this.setState({width:n})}},{key:"handleConfigMenuOpened",value:function(n){this.setState({configMenuUid:n,configMenuPosition:this.configImg.getBoundingClientRect()})}},{key:"handleAddTrackPositionMenuOpened",value:function(n){this.setState({addTrackPositionMenuUid:n,addTrackPositionMenuPosition:this.plusImg.getBoundingClientRect()})}},{key:"handleTrackPositionChosen",value:function(n){this.props.onTrackPositionChosen(n),this.setState({addTrackPositionMenuUid:null,addTrackPositionMenuPosition:null})}},{key:"render",value:function(){let n=null,o=null;this.state.addTrackPositionMenuPosition&&(o=E.createElement(ml,{onMenuClosed:()=>{this.setState({addTrackPositionMenuUid:null,addTrackPositionMenuPosition:null})}},E.createElement(pl,{orientation:"left",position:this.state.addTrackPositionMenuPosition,theme:this.props.theme},E.createElement(pVe,{onTrackPositionChosen:this.handleTrackPositionChosenBound})))),this.state.configMenuUid&&(n=E.createElement(ml,{onMenuClosed:()=>this.setState({configMenuUid:null})},E.createElement(CY,{onClearView:()=>{this.setState({configMenuUid:null}),this.props.onClearView()},onEditViewConfig:()=>{this.setState({configMenuUid:null}),this.props.onEditViewConfig(this.state.configMenuUid)},onExportPNG:()=>{this.setState({configMenuUid:null}),this.props.onExportPNG()},onExportSVG:()=>{this.setState({configMenuUid:null}),this.props.onExportSVG()},onExportViewAsJSON:()=>{this.setState({configMenuUid:null}),this.props.onExportViewsAsJSON()},onExportViewAsLink:()=>{this.setState({configMenuUid:null}),this.props.onExportViewsAsLink()},onLockLocation:()=>{this.setState({configMenuUid:null}),this.props.onLockLocation(this.state.configMenuUid)},onLockZoom:()=>{this.setState({configMenuUid:null}),this.props.onLockZoom(this.state.configMenuUid)},onLockZoomAndLocation:()=>{this.setState({configMenuUid:null}),this.props.onLockZoomAndLocation(this.state.configMenuUid)},onOptionsChanged:u=>{this.props.onViewOptionsChanged(u),this.setState({configMenuUid:null})},onProjectViewport:()=>{this.setState({configMenuUid:null}),this.props.onProjectViewport(this.state.configMenuUid)},onTakeAndLockZoomAndLocation:()=>{this.setState({configMenuUid:null}),this.props.onTakeAndLockZoomAndLocation(this.state.configMenuUid)},onTogglePositionSearchBox:()=>{this.setState({configMenuUid:null}),this.props.onTogglePositionSearchBox(this.state.configMenuUid)},onUnlockLocation:()=>{this.setState({configMenuUid:null}),this.props.onUnlockLocation(this.state.configMenuUid)},onUnlockZoom:()=>{this.setState({configMenuUid:null}),this.props.onUnlockZoom(this.state.configMenuUid)},onUnlockZoomAndLocation:()=>{this.setState({configMenuUid:null}),this.props.onUnlockZoomAndLocation(this.state.configMenuUid)},onYankLocation:()=>{this.setState({configMenuUid:null}),this.props.onYankLocation(this.state.configMenuUid)},onYankZoom:()=>{this.setState({configMenuUid:null}),this.props.onYankZoom(this.state.configMenuUid)},onYankZoomAndLocation:()=>{this.setState({configMenuUid:null}),this.props.onYankZoomAndLocation(this.state.configMenuUid)},onZoomToData:()=>{this.setState({configMenuUid:null}),this.props.onZoomToData(this.state.configMenuUid)},orientation:"left",position:this.state.configMenuPosition,theme:this.props.theme})));const a=this.props.getGenomePositionSearchBox(this.state.isFocused,u=>{this.setState({isFocused:u})}),s=Zt(this.state.isFocused?Yi["multitrack-header-focus"]:Yi["multitrack-header"],{[Yi["multitrack-header-dark"]]:this.props.theme===mr}),c=this.state.width<=e5?Yi["multitrack-header-icon-squeazed"]:Yi["multitrack-header-icon"];return E.createElement("div",{ref:u=>{this.el=u},className:s},E.createElement("div",{className:Yi["multitrack-header-left"]},this.props.mouseTool===Wi&&E.createElement("svg",{className:Zt(Yi["mouse-tool-selection"],c),title:"Selection tool active"},E.createElement("use",{xlinkHref:"#select"})),E.createElement("div",{className:Yi["multitrack-header-grabber"],title:"Drag to move the view"},E.createElement("div",null),E.createElement("div",null),E.createElement("div",null)),this.state.width>t5&&E.createElement("div",{className:Yi["multitrack-header-search"]},this.props.isGenomePositionSearchBoxVisible&&a)),E.createElement("nav",{className:Yi["multitrack-header-nav-list"]},E.createElement("svg",{className:c,onClick:this.props.onAddView},E.createElement("title",null,"Add new view (clone this view)"),E.createElement("use",{xlinkHref:"#copy"})),E.createElement("svg",{ref:u=>{this.configImg=u},className:c,onClick:()=>this.handleConfigMenuOpened(this.props.viewUid)},E.createElement("title",null,"Configure this view"),E.createElement("use",{xlinkHref:"#cog"})),E.createElement("svg",{ref:u=>{this.plusImg=u},className:c,onClick:()=>this.handleAddTrackPositionMenuOpened(this.props.viewUid)},E.createElement("title",null,"Add Track"),E.createElement("use",{xlinkHref:"#plus"})),E.createElement("svg",{className:c,onClick:this.props.onCloseView},E.createElement("title",null,"Close View"),E.createElement("use",{xlinkHref:"#cross"}))),n,o)}}]),r}(E.Component);px.defaultProps={isGenomePositionSearchBoxVisible:!1},px.propTypes={getGenomePositionSearchBox:N.func.isRequired,isGenomePositionSearchBoxVisible:N.bool,mouseTool:N.string.isRequired,onAddView:N.func.isRequired,onClearView:N.func.isRequired,onCloseView:N.func.isRequired,onEditViewConfig:N.func.isRequired,onExportSVG:N.func.isRequired,onExportPNG:N.func.isRequired,onExportViewsAsJSON:N.func.isRequired,onExportViewsAsLink:N.func.isRequired,onLockLocation:N.func.isRequired,onLockZoom:N.func.isRequired,onLockZoomAndLocation:N.func.isRequired,onProjectViewport:N.func.isRequired,onTakeAndLockZoomAndLocation:N.func.isRequired,onTogglePositionSearchBox:N.func.isRequired,onTrackPositionChosen:N.func.isRequired,onUnlockLocation:N.func.isRequired,onUnlockZoom:N.func.isRequired,onUnlockZoomAndLocation:N.func.isRequired,onViewOptionsChanged:N.func.isRequired,onYankLocation:N.func.isRequired,onYankZoom:N.func.isRequired,onYankZoomAndLocation:N.func.isRequired,onZoomToData:N.func.isRequired,theme:N.symbol.isRequired,viewUid:N.string.isRequired};const SVe=hc(px);var NY={};Object.defineProperty(NY,"__esModule",{value:!0});var gl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},wVe=function(){function e(t,r){for(var i=0;i<r.length;i++){var n=r[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),AVe=E,Pg=OVe(AVe);function OVe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function kVe(e,t){var r={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r}function IVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RY(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function CVe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var PVe=13,DVe=9,xVe=8,NVe=89,YT=90,RVe=77,MY=57,LY=219,BY=222,HY=192,MVe=27,FY=100,LVe=3e3,BVe="navigator"in globalThis&&/Win/i.test(navigator.platform),mx="navigator"in globalThis&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),qT="npm__react-simple-code-editor__textarea",HVe=`
|
|
318
318
|
/**
|
|
319
319
|
* Reset the text fill color so that placeholder is visible
|
|
320
320
|
*/
|