(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[69],{2444:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return k}));var r=n(83),a=n.n(r),u=n(88),i=n(85),s=n(90),o=n(93),c=n(95),f=n(2219),l=n.n(f),v=n(126),b=n(144),h=n(86),p=n(190),d=n(82),g={refName:"seq_id"},w={seq_id:"refName"},y=function(){function e(t,n,r){Object(i.a)(this,e),this.ncFeature=void 0,this.parentHandle=void 0,this.uniqueId=void 0,this.ncFeature=t,this.uniqueId=r||t.id(),this.parentHandle=n}return Object(s.a)(e,[{key:"set",value:function(){throw new Error("not implemented")}},{key:"jb2TagToJb1Tag",value:function(e){return(g[e]||e).toLowerCase()}},{key:"jb1TagToJb2Tag",value:function(e){var t=e.toLowerCase();return w[t]||t}},{key:"get",value:function(t){var n=this,r=this.ncFeature.get(this.jb2TagToJb1Tag(t));return r&&"subfeatures"===t?r.map((function(t){return new e(t,n)})):r}},{key:"tags",value:function(){var e=this;return this.ncFeature.tags().map((function(t){return e.jb1TagToJb2Tag(t)}))}},{key:"id",value:function(){return this.uniqueId}},{key:"parent",value:function(){return this.parentHandle}},{key:"children",value:function(){return this.get("subfeatures")}},{key:"toJSON",value:function(){var t=this,n={uniqueId:this.id()};return this.ncFeature.tags().forEach((function(r){var a=t.jb1TagToJb2Tag(r),u=t.ncFeature.get(r);"subfeatures"===a?n.subfeatures=(u||[]).map((function(n){return new e(n,t).toJSON()})):n[a]=u})),n}}]),e}();function m(e){var t,n,r,a=2;for("undefined"!==typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);a--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new j(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function j(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return j=function(e){this.s=e,this.n=e.next},j.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new j(e)}var k=function(e){Object(o.a)(n,e);var t=Object(c.a)(n);function n(e,r,a){var u;Object(i.a)(this,n),(u=t.call(this,e,r,a)).nclist=void 0,u.configRefNames=void 0;var s=Object(d.readConfObject)(e,"refNames"),o=Object(d.readConfObject)(e,"rootUrlTemplate");return u.configRefNames=s,u.nclist=new l.a({baseUrl:"",urlTemplate:o.uri,readFile:function(e){return new p.RemoteFile(String(o.baseUri?new URL(e,o.baseUri).toString():e)).readFile()}}),u}return Object(s.a)(n,[{key:"getFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.ObservableCreate)(function(){var r=Object(u.a)(a.a.mark((function r(u){var i,s,o,c,f,l,v;return a.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=n.signal,s=!1,o=!1,r.prev=3,f=m(t.nclist.getFeatures(e,n));case 5:return r.next=7,f.next();case 7:if(!(s=!(l=r.sent).done)){r.next=14;break}v=l.value,Object(h.checkAbortSignal)(i),u.next(t.wrapFeature(v));case 11:s=!1,r.next=5;break;case 14:r.next=20;break;case 16:r.prev=16,r.t0=r.catch(3),o=!0,c=r.t0;case 20:if(r.prev=20,r.prev=21,!s||null==f.return){r.next=25;break}return r.next=25,f.return();case 25:if(r.prev=25,!o){r.next=28;break}throw c;case 28:return r.finish(25);case 29:return r.finish(20);case 30:u.complete();case 31:case"end":return r.stop()}}),r,null,[[3,16,20,30],[21,,25,29]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"wrapFeature",value:function(e){return new y(e,void 0,"".concat(this.id,"-").concat(e.id()))}},{key:"hasDataForRefName",value:function(){var e=Object(u.a)(a.a.mark((function e(t){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.nclist.getDataRoot(t);case 2:return n=e.sent,e.abrupt("return",!!(n&&n.stats&&n.stats.featureCount));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRefNames",value:function(){return Promise.resolve(this.configRefNames||[])}},{key:"freeResources",value:function(){}}]),n}(v.BaseFeatureDataAdapter)}}]);
//# sourceMappingURL=69.70d0bb25.chunk.js.map