diff --git a/.vscodeignore b/.vscodeignore index 5ff3c19..9f95642 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,9 +1,7 @@ -.vscode/** -.vscode-test/** -out/test/** -test/** -src/** -**/*.map +.vscode .gitignore +node_modules +out/ +src/ tsconfig.json -vsc-extension-quickstart.md +webpack.config.js \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bb1613..2618182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 0.2.2 + +* Change of link to official mermaid site. + * Thank you for PR, https://github.com/silenti0 + * https://github.com/arichika/previewseqdiag-vscode/pull/16 +* Update dependencies to latest. + * `mermaid 8.4.4`, `mscgenjs 4.0.2`, `mscgenjs-inpage 2.0.12` . + ## 0.2.1 * Update document. only... diff --git a/README.md b/README.md index 4ed9222..be8f26f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Preview Sequence Diagrams (previewseqdiag-vscode) is an extension for vscode specialized for the preview function of mscgen and mermaid. -![eye-catch](assets/eye-catch.png) +eye-catch ## Features @@ -25,6 +25,14 @@ This is usefull to avoid multipicate the same code on many files. [CHANGELOG.md](CHANGELOG.md) +### 0.2.2 + +* Change of link to official mermaid site. + * Thank you for PR, https://github.com/silenti0 + * https://github.com/arichika/previewseqdiag-vscode/pull/16 +* Update dependencies to latest. + * `mermaid 8.4.4`, `mscgenjs 4.0.2`, `mscgenjs-inpage 2.0.12` . + ### 0.2.1 * Update document. only... @@ -91,9 +99,9 @@ e.g. add to User Settings, result is. -![mermaid-forest-white](assets/mermaid-dark-f6f6ff.png) +mermaid-forest-white -![mscgen-fountainpen.png](assets/mscgen-fountainpen-fixed.png) +mscgen-fountainpen.png ---- @@ -104,6 +112,8 @@ result is. * [searKing/preview-vscode](https://github.com/searKing/preview-vscode) * [@XavierBoubert](https://github.com/XavierBoubert) * Thanks [PR](https://github.com/arichika/previewseqdiag-vscode/pull/8) for Great Special feature +* [@silenti0](https://github.com/silenti0) + * Thanks [PR](https://github.com/arichika/previewseqdiag-vscode/pull/16) for Updates ### mermaid @@ -118,11 +128,11 @@ result is. ### samples -MscGen, msc, cygne, with dark theme. -![graph](assets/mscgen-cygne.png) +MscGen, msc, cygne, with dark theme. +graph -Mermaid, graph. -![mermaid-graph](assets/mermaid-graph.png) +Mermaid, graph. +mermaid-graph -Mermaid, gantt. -![mermaid-gantt](assets/mermaid-gantt.png) +Mermaid, gantt. +mermaid-gantt diff --git a/dist/extension.js b/dist/extension.js new file mode 100644 index 0000000..b77d015 --- /dev/null +++ b/dist/extension.js @@ -0,0 +1,2 @@ +module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){(function(t){var r;(function(i){var o={function:!0,object:!0};function s(t){return t&&t.Object===Object?t:null}var u,c=o[typeof e]&&e&&!e.nodeType?e:null,h=o[typeof t]&&t&&!t.nodeType?t:null,a=s(c&&h&&"object"==typeof global&&global),l=s(o[typeof self]&&self),p=s(o[typeof window]&&window),f=h&&h.exports===c?c:null,d=s(o[typeof this]&&this),b=a||p!==(d&&d.window)&&p||l||d||Function("return this")(),v={internals:{},config:{Promise:b.Promise},helpers:{}},_=v.helpers.noop=function(){},y=v.helpers.identity=function(t){return t},w=v.helpers.defaultNow=Date.now,m=v.helpers.defaultComparer=function(t,e){return mt(t,e)},g=v.helpers.defaultSubComparer=function(t,e){return t>e?1:t=q&&r<=Ar}function M(){if(A)try{throw new Error}catch(n){var t=n.stack.split("\n"),e=P(t[0].indexOf("@")>0?t[1]:t[2]);if(!e)return;return k=e[0],e[1]}}function P(t){var e=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);if(e)return[e[1],Number(e[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(t);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(t);return r?[r[1],Number(r[2])]:void 0}var L=v.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};L.prototype=Object.create(Error.prototype),L.prototype.name="EmptyError";var z=v.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};z.prototype=Object.create(Error.prototype),z.prototype.name="ObjectDisposedError";var V=v.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};V.prototype=Object.create(Error.prototype),V.prototype.name="ArgumentOutOfRangeError";var W=v.NotSupportedError=function(t){this.message=t||"This operation is not supported",Error.call(this)};W.prototype=Object.create(Error.prototype),W.prototype.name="NotSupportedError";var B=v.NotImplementedError=function(t){this.message=t||"This operation is not implemented",Error.call(this)};B.prototype=Object.create(Error.prototype),B.prototype.name="NotImplementedError";var I=v.helpers.notImplemented=function(){throw new B},U=(v.helpers.notSupported=function(){throw new W},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");b.Set&&"function"==typeof(new b.Set)["@@iterator"]&&(U="@@iterator");var $=v.doneEnumerator={done:!0,value:i},H=v.helpers.isIterable=function(t){return t&&t[U]!==i},K=v.helpers.isArrayLike=function(t){return t&&t.length!==i};v.helpers.iterator=U;var Q=v.internals.bindCallback=function(t,e,n){if(void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}},J="[object Arguments]",G="[object Array]",X="[object Boolean]",Y="[object Date]",Z="[object Error]",tt="[object Number]",et="[object Object]",nt="[object RegExp]",rt="[object String]",it={};it["[object Float32Array]"]=it["[object Float64Array]"]=it["[object Int8Array]"]=it["[object Int16Array]"]=it["[object Int32Array]"]=it["[object Uint8Array]"]=it["[object Uint8ClampedArray]"]=it["[object Uint16Array]"]=it["[object Uint32Array]"]=!0,it[J]=it[G]=it["[object ArrayBuffer]"]=it[X]=it[Y]=it[Z]=it["[object Function]"]=it["[object Map]"]=it[tt]=it[et]=it[nt]=it["[object Set]"]=it[rt]=it["[object WeakMap]"]=!1;var ot=Object.prototype,st=ot.hasOwnProperty,ut=ot.toString,ct=Math.pow(2,53)-1,ht=Object.keys||function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length;return function(i){if("object"!=typeof i&&("function"!=typeof i||null===i))throw new TypeError("Object.keys called on non-object");var o,s,u=[];for(o in i)t.call(i,o)&&u.push(o);if(e)for(s=0;s-1&&t%1==0&&t<=ct}var dt=function(){try{Object({toString:0}+"")}catch(t){return function(){return!1}}return function(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}}();var bt=Array.isArray||function(t){return pt(t)&&ft(t.length)&&ut.call(t)===G};function vt(t,e){for(var n=-1,r=t.length;++nc))return!1;for(;++u0;){var t=e.dequeue();!t.isCancelled()&&t.invoke()}}function r(){t.call(this)}return gt(r,t),r.prototype.schedule=function(t,r){var i=new Vt(this,t,r,this.now());if(e)e.enqueue(i);else{(e=new re(4)).enqueue(i);var o=N(n)();e=null,o===S&&O(o.e)}return i.disposable},r.prototype.scheduleRequired=function(){return!e},r}(Wt),Jt=Wt.currentThread=new Qt,Gt=function(){var t,e=_;if(b.setTimeout)t=b.setTimeout,e=b.clearTimeout;else{if(!b.WScript)throw new W;t=function(t,e){b.WScript.Sleep(e),t()}}return{setTimeout:t,clearTimeout:e}}(),Xt=Gt.setTimeout,Yt=Gt.clearTimeout;!function(){var t=1,e={},n=!1;function r(t){if(n)Xt((function(){r(t)}),0);else{var i=e[t];if(i){n=!0;var o=N(i)();$t(t),n=!1,o===S&&O(o.e)}}}$t=function(t){delete e[t]};var i=new RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),o="function"==typeof(o=a&&f&&a.setImmediate)&&!i.test(o)&&o;if(E(o))Ut=function(n){var i=t++;return e[i]=n,o((function(){r(i)})),i};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Ut=function(n){var i=t++;return e[i]=n,process.nextTick((function(){r(i)})),i};else if(function(){if(!b.postMessage||b.importScripts)return!1;var t=!1,e=b.onmessage;return b.onmessage=function(){t=!0},b.postMessage("","*"),b.onmessage=e,t}()){var s="ms.rx.schedule"+Math.random();b.addEventListener("message",(function(t){"string"==typeof t.data&&t.data.substring(0,s.length)===s&&r(t.data.substring(s.length))}),!1),Ut=function(n){var r=t++;return e[r]=n,b.postMessage(s+r,"*"),r}}else if(b.MessageChannel){var u=new b.MessageChannel;u.port1.onmessage=function(t){r(t.data)},Ut=function(n){var r=t++;return e[r]=n,u.port2.postMessage(r),r}}else Ut="document"in b&&"onreadystatechange"in b.document.createElement("script")?function(n){var i=b.document.createElement("script"),o=t++;return e[o]=n,i.onreadystatechange=function(){r(o),i.onreadystatechange=null,i.parentNode.removeChild(i),i=null},b.document.documentElement.appendChild(i),o}:function(n){var i=t++;return e[i]=n,Xt((function(){r(i)}),0),i}}();var Zt=function(t){function e(){t.call(this)}function n(t,e,n,r){return function(){t.setDisposable(Nt._fixup(e(n,r)))}}function r(t){this._id=t,this.isDisposed=!1}function i(t){this._id=t,this.isDisposed=!1}return gt(e,t),r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,$t(this._id))},i.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,Yt(this._id))},e.prototype.schedule=function(t,e){var i=new Ft,o=Ut(n(i,e,this,t));return new Rt(i,new r(o))},e.prototype._scheduleFuture=function(t,e,r){if(0===e)return this.schedule(t,r);var o=new Ft,s=Xt(n(o,r,this,t),e);return new Rt(o,new i(s))},e.prototype.scheduleLongRunning=function(t,e){var n=Ot(_);return Ut(function(t,e,n){return function(){e(t,n)}}(t,e,n)),n},e}(Wt),te=Wt.default=Wt.async=new Zt,ee=function(t){function e(e,n){this._scheduler=e,this._handler=n,this._recursiveOriginal=null,this._recursiveWrapper=null,t.call(this)}return gt(e,t),e.prototype.schedule=function(t,e){return this._scheduler.schedule(t,this._wrap(e))},e.prototype._scheduleFuture=function(t,e,n){return this._scheduler.schedule(t,e,this._wrap(n))},e.prototype.now=function(){return this._scheduler.now()},e.prototype._clone=function(t){return new e(t,this._handler)},e.prototype._wrap=function(t){var e=this;return function(n,r){var i=N(t)(e._getRecursiveWrapper(n),r);return i===S?(e._handler(i.e)||O(i.e),At):qt(i)}},e.prototype._getRecursiveWrapper=function(t){if(this._recursiveOriginal!==t){this._recursiveOriginal=t;var e=this._clone(t);e._recursiveOriginal=t,e._recursiveWrapper=e,this._recursiveWrapper=e}return this._recursiveWrapper},e.prototype.schedulePeriodic=function(t,e,n){var r=this,i=!1,o=new Ft;return o.setDisposable(this._scheduler.schedulePeriodic(t,e,(function(t){if(i)return null;var e=N(n)(t);return e===S?(i=!0,r._handler(e.e)||O(e.e),o.dispose(),null):e}))),o},e}(Wt);function ne(t,e){this.id=t,this.value=e}ne.prototype.compareTo=function(t){var e=this.value.compareTo(t.value);return 0===e&&(e=this.id-t.id),e};var re=v.internals.PriorityQueue=function(t){this.items=new Array(t),this.length=0},ie=re.prototype;ie.isHigherPriority=function(t,e){return this.items[t].compareTo(this.items[e])<0},ie.percolate=function(t){if(!(t>=this.length||t<0)){var e=t-1>>1;if(!(e<0||e===t)&&this.isHigherPriority(t,e)){var n=this.items[t];this.items[t]=this.items[e],this.items[e]=n,this.percolate(e)}}},ie.heapify=function(t){if(+t||(t=0),!(t>=this.length||t<0)){var e=2*t+1,n=2*t+2,r=t;if(e0){n=t.queue.shift();var r=N(n)();if(r===S)return t.queue=[],t.hasFaulted=!0,O(r.e);e(t)}else t.isAcquired=!1}return gt(e,t),e.prototype.next=function(t){this.queue.push(function(t,e){return function(){t.onNext(e)}}(this.observer,t))},e.prototype.error=function(t){this.queue.push(function(t,e){return function(){t.onError(e)}}(this.observer,t))},e.prototype.completed=function(){var t;this.queue.push((t=this.observer,function(){t.onCompleted()}))},e.prototype.ensureActive=function(){var t=!1;!this.hasFaulted&&this.queue.length>0&&(t=!this.isAcquired,this.isAcquired=!0),t&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,n))},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.disposable.dispose()},e}(be)),we=v.Observable=function(){function t(){if(v.config.longStackSupport&&A){var t=this._subscribe,e=N(O)(new Error).e;this.stack=e.stack.substring(e.stack.indexOf("\n")+1),this._subscribe=function(t,e){return function(n){var r=n.onError;return n.onError=function(e){T(e,t),r.call(n,e)},e.call(t,n)}}(this,t)}}return de=t.prototype,t.isObservable=function(t){return t&&E(t.subscribe)},de.subscribe=de.forEach=function(t,e,n){return this._subscribe("object"==typeof t?t:fe(t,e,n))},de.subscribeOnNext=function(t,e){return this._subscribe(fe(void 0!==e?function(n){t.call(e,n)}:t))},de.subscribeOnError=function(t,e){return this._subscribe(fe(null,void 0!==e?function(n){t.call(e,n)}:t))},de.subscribeOnCompleted=function(t,e){return this._subscribe(fe(null,null,void 0!==e?function(){t.call(e)}:t))},t}(),me=v.ObservableBase=function(t){function e(t,e){var n,r=e[0],i=e[1],o=N(i.subscribeCore).call(i,r);o!==S||r.fail(S.e)||O(S.e),r.setDisposable((n=o)&&E(n.dispose)?n:E(n)?Ot(n):At)}function n(){t.call(this)}return gt(n,t),n.prototype._subscribe=function(t){var n=new Dr(t),r=[n,this];return Jt.scheduleRequired()?Jt.schedule(r,e):e(0,r),n},n.prototype.subscribeCore=I,n}(we),ge=v.FlatMapObservable=function(t){function e(e,n,r,i){this.resultSelector=E(r)?r:null,this.selector=Q(E(n)?n:function(){return n},i,3),this.source=e,t.call(this)}function n(t,e,n,r){this.i=0,this.selector=e,this.resultSelector=n,this.source=r,this.o=t,be.call(this)}return gt(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this.selector,this.resultSelector,this))},gt(n,be),n.prototype._wrapResult=function(t,e,n){return this.resultSelector?t.map((function(t,r){return this.resultSelector(e,t,n,r)}),this):t},n.prototype.next=function(t){var e=this.i++,n=N(this.selector)(t,e,this.source);if(n===S)return this.o.onError(n.e);C(n)&&(n=Fe(n)),(K(n)||H(n))&&(n=we.from(n)),this.o.onNext(this._wrapResult(n,t,e))},n.prototype.error=function(t){this.o.onError(t)},n.prototype.completed=function(){this.o.onCompleted()},e}(me),xe=v.internals.Enumerable=function(){};function Ce(t){this._s=t,this.isDisposed=!1}Ce.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var Ee=function(t){function e(e){this.sources=e,t.call(this)}function n(t,e){if(!t.isDisposed){var n=N(t.e.next).call(t.e);if(n===S)return t.o.onError(n.e);if(n.done)return t.o.onCompleted();var i=n.value;C(i)&&(i=Fe(i));var o=new Ft;t.subscription.setDisposable(o),o.setDisposable(i.subscribe(new r(t,e)))}}function r(t,e){this._state=t,this._recurse=e,be.call(this)}return gt(e,t),e.prototype.subscribeCore=function(t){var e=new Tt,r={isDisposed:!1,o:t,subscription:e,e:this.sources[U]()},i=Jt.scheduleRecursive(r,n);return new Mt([e,i,new Ce(r)])},gt(r,be),r.prototype.next=function(t){this._state.o.onNext(t)},r.prototype.error=function(t){this._state.o.onError(t)},r.prototype.completed=function(){this._recurse(this._state)},e}(me);xe.prototype.concat=function(){return new Ee(this)};var De=function(t){function e(e){this.sources=e,t.call(this)}function n(t,e){if(!t.isDisposed){var n=N(t.e.next).call(t.e);if(n===S)return t.o.onError(n.e);if(n.done)return null!==t.lastError?t.o.onError(t.lastError):t.o.onCompleted();var i=n.value;C(i)&&(i=Fe(i));var o=new Ft;t.subscription.setDisposable(o),o.setDisposable(i.subscribe(new r(t,e)))}}function r(t,e){this._state=t,this._recurse=e,be.call(this)}return gt(e,t),e.prototype.subscribeCore=function(t){var e=new Tt,r={isDisposed:!1,e:this.sources[U](),subscription:e,lastError:null,o:t},i=Jt.scheduleRecursive(r,n);return new Mt([e,i,new Ce(r)])},gt(r,be),r.prototype.next=function(t){this._state.o.onNext(t)},r.prototype.error=function(t){this._state.lastError=t,this._recurse(this._state)},r.prototype.completed=function(){this._state.o.onCompleted()},e}(me);xe.prototype.catchError=function(){return new De(this)};var Se=function(t){function e(t,e){this.v=t,this.c=null==e?-1:e}function n(t){this.v=t.v,this.l=t.c}return gt(e,t),e.prototype[U]=function(){return new n(this)},n.prototype.next=function(){return 0===this.l?$:(this.l>0&&this.l--,{done:!1,value:this.v})},e}(xe),Ne=xe.repeat=function(t,e){return new Se(t,e)},Oe=function(t){function e(t,e,n){this.s=t,this.fn=e?Q(e,n,3):null}function n(t){this.i=-1,this.s=t.s,this.l=this.s.length,this.fn=t.fn}return gt(e,t),e.prototype[U]=function(){return new n(this)},n.prototype.next=function(){return++this.iVe)return Ve;return e}(t),this._i=0}We.prototype[U]=function(){return new Be(this._s)},Be.prototype[U]=function(){return this},Be.prototype.next=function(){return this._i0)&&(t.onNext(e),n>0&&n--),0===n)return t.onCompleted();r(n)}))},we.repeat=function(t,e,n){return It(n)||(n=Jt),new tn(t,e,n)};var nn=function(t){function e(e,n){this._value=e,this._scheduler=n,t.call(this)}function n(t,e){var n=e[0],r=e[1];return r.onNext(n),r.onCompleted(),At}return gt(e,t),e.prototype.subscribeCore=function(t){var e=[this._value,t];return this._scheduler===Kt?n(null,e):this._scheduler.schedule(e,n)},e}(me),rn=(we.return=we.just=function(t,e){return It(e)||(e=Kt),new nn(t,e)},function(t){function e(e,n){this._error=e,this._scheduler=n,t.call(this)}function n(t,e){var n=e[0];return e[1].onError(n),At}return gt(e,t),e.prototype.subscribeCore=function(t){var e=[this._error,t];return this._scheduler===Kt?n(null,e):this._scheduler.schedule(e,n)},e}(me)),on=we.throw=function(t,e){return It(e)||(e=Kt),new rn(t,e)},sn=function(t){function e(e,n){this._resFn=e,this._obsFn=n,t.call(this)}return gt(e,t),e.prototype.subscribeCore=function(t){var e=At,n=N(this._resFn)();if(n===S)return new Rt(on(n.e).subscribe(t),e);n&&(e=n);var r=N(this._obsFn)(n);return new Rt(r===S?on(r.e).subscribe(t):r.subscribe(t),e)},e}(me);function un(t,e){return t.amb(e)}we.using=function(t,e){return new sn(t,e)},de.amb=function(t){var e=this;return new Er((function(n){var r,i="L",o="R",s=new Ft,u=new Ft;function c(){r||(r=i,u.dispose())}function h(){r||(r=o,s.dispose())}C(t)&&(t=Fe(t));var a=fe((function(t){c(),r===i&&n.onNext(t)}),(function(t){c(),r===i&&n.onError(t)}),(function(){c(),r===i&&n.onCompleted()})),l=fe((function(t){h(),r===o&&n.onNext(t)}),(function(t){h(),r===o&&n.onError(t)}),(function(){h(),r===o&&n.onCompleted()}));return s.setDisposable(e.subscribe(a)),u.setDisposable(t.subscribe(l)),new Rt(s,u)}))},we.amb=function(){var t,e=Ge();if(Array.isArray(arguments[0]))t=arguments[0];else{var n=arguments.length;t=new Array(t);for(var r=0;r0?this.parent.handleSubscribe(this.parent.q.shift()):(this.parent.activeCount--,this.parent.done&&0===this.parent.activeCount&&this.parent.o.onCompleted())},e}(be);de.merge=function(t){return"number"!=typeof t?gn(this,t):new wn(this,t)};var gn=we.merge=function(){var t,e,n=[],r=arguments.length;if(arguments[0])if(It(arguments[0]))for(t=arguments[0],e=1;e0}function r(t){return t.shift()}return gt(e,t),e.prototype.next=function(t){if(this._q[this._i].push(t),this._q.every(n)){var e=this._q.map(r),i=N(this._p._cb).apply(null,e);if(i===S)return this._o.onError(i.e);this._o.onNext(i)}else this._d.filter((o=this._i,function(t,e){return e!==o})).every(y)&&this._o.onCompleted();var o},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._d[this._i]=!0,this._d.every(y)&&this._o.onCompleted()},e}(be);function ln(){return!1}function zn(){return[]}function pn(){for(var t=arguments.length,e=new Array(t),n=0;n0}function r(t){return t.shift()}return gt(e,t),e.prototype.next=function(t){if(this._s.q[this._i].push(t),this._s.q.every(n)){var e=this._s.q.map(r),i=N(this._s.cb).apply(null,e);if(i===S)return this._s.o.onError(i.e);this._s.o.onNext(i)}else this._s.done.filter((o=this._i,function(t,e){return e!==o})).every(y)&&this._s.o.onCompleted();var o},e.prototype.error=function(t){this._s.o.onError(t)},e.prototype.completed=function(){this._s.done[this._i]=!0,this._s.done.every(y)&&this._s.o.onCompleted()},e}(be);function Un(t){return t.toArray()}function $n(t){return t.length>0}de.zipIterable=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var t=arguments.length,e=new Array(t),n=0;nthis._c&&this._o.onNext(this._q.shift())},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(be);de.skipLast=function(t){if(t<0)throw new V;return new sr(this,t)},de.startWith=function(){var t,e=0;arguments.length&&It(arguments[0])?(t=arguments[0],e=1):t=Kt;for(var n=[],r=e,i=arguments.length;rthis._c&&this._q.shift()},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){for(;this._q.length>0;)this._o.onNext(this._q.shift());this._o.onCompleted()},e}(be);de.takeLast=function(t){if(t<0)throw new V;var e=this;return new Er((function(n){return e.subscribe(new cr(n,t))}),e)};var hr=function(t){function e(e,n){this._o=e,this._c=n,this._q=[],t.call(this)}return gt(e,t),e.prototype.next=function(t){this._q.push(t),this._q.length>this._c&&this._q.shift()},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},e}(be);de.takeLastBuffer=function(t){if(t<0)throw new V;var e=this;return new Er((function(n){return e.subscribe(new hr(n,t))}),e)},de.windowWithCount=de.windowCount=function(t,e){var n=this;if(+t||(t=0),Math.abs(t)===1/0&&(t=0),t<=0)throw new V;if(null==e&&(e=t),+e||(e=0),Math.abs(e)===1/0&&(e=0),e<=0)throw new V;return new Er((function(r){var i=new Ft,o=new Pt(i),s=0,u=[];function c(){var t=new Nr;u.push(t),r.onNext(Ct(t,o))}return c(),i.setDisposable(n.subscribe((function(n){for(var r=0,i=u.length;r=0&&o%e==0&&u.shift().onCompleted(),++s%e==0&&c()}),(function(t){for(;u.length>0;)u.shift().onError(t);r.onError(t)}),(function(){for(;u.length>0;)u.shift().onCompleted();r.onCompleted()}))),o}),n)},de.flatMapConcat=de.concatMap=function(t,e,n){return new ge(this,t,e,n).merge(1)},de.concatMapObserver=de.selectConcatObserver=function(t,e,n,r){var i=this,o=Q(t,r,2),s=Q(e,r,1),u=Q(n,r,0);return new Er((function(t){var e=0;return i.subscribe((function(n){var r;try{r=o(n,e++)}catch(e){return void t.onError(e)}C(r)&&(r=Fe(r)),t.onNext(r)}),(function(e){var n;try{n=s(e)}catch(e){return void t.onError(e)}C(n)&&(n=Fe(n)),t.onNext(n),t.onCompleted()}),(function(){var e;try{e=u()}catch(e){return void t.onError(e)}C(e)&&(e=Fe(e)),t.onNext(e),t.onCompleted()}))}),this).concatAll()};var ar=function(t){function e(e,n){this._o=e,this._d=n,this._f=!1,t.call(this)}return gt(e,t),e.prototype.next=function(t){this._f=!0,this._o.onNext(t)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){!this._f&&this._o.onNext(this._d),this._o.onCompleted()},e}(be);function lr(t){this.comparer=t,this.set=[]}de.defaultIfEmpty=function(t){var e=this;return t===i&&(t=null),new Er((function(n){return e.subscribe(new ar(n,t))}),e)},lr.prototype.push=function(t){var e=-1===function(t,e,n){for(var r=0,i=t.length;r0&&(this._o.onNext(t),this._r<=0&&this._o.onCompleted())},n.prototype.error=function(t){this._o.onError(t)},n.prototype.completed=function(){this._o.onCompleted()},e}(me);de.take=function(t,e){if(t<0)throw new V;return 0===t?Le(e):new wr(this,t)};var mr=function(t){function e(e,n){this.source=e,this._fn=n,t.call(this)}return gt(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new gr(t,this))},e}(me),gr=function(t){function e(e,n){this._o=e,this._p=n,this._i=0,this._r=!0,t.call(this)}return gt(e,t),e.prototype.next=function(t){if(this._r&&(this._r=N(this._p._fn)(t,this._i++,this._p),this._r===S))return this._o.onError(this._r.e);this._r?this._o.onNext(t):this._o.onCompleted()},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(be);de.takeWhile=function(t,e){var n=Q(t,e,3);return new mr(this,n)};var xr=function(t){function e(e,n,r){this.source=e,this.predicate=Q(n,r,3),t.call(this)}function n(t,e,n){this.o=t,this.predicate=e,this.source=n,this.i=0,be.call(this)}return gt(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this.predicate,this))},e.prototype.internalFilter=function(t,n){return new e(this.source,function(t,e){return function(n,r,i){return e.predicate(n,r,i)&&t.call(this,n,r,i)}}(t,this),n)},gt(n,be),n.prototype.next=function(t){var e=N(this.predicate)(t,this.i++,this.source);if(e===S)return this.o.onError(e.e);e&&this.o.onNext(t)},n.prototype.error=function(t){this.o.onError(t)},n.prototype.completed=function(){this.o.onCompleted()},e}(me);de.filter=de.where=function(t,e){return this instanceof xr?this.internalFilter(t,e):new xr(this,t,e)};var Cr=function(t){function e(e,n){this._o=e,this._xform=n,t.call(this)}return gt(e,t),e.prototype.next=function(t){var e=N(this._xform["@@transducer/step"]).call(this._xform,this._o,t);e===S&&this._o.onError(e.e)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._xform["@@transducer/result"](this._o)},e}(be);de.transduce=function(t){var e=this;return new Er((function(n){var r=t(function(t){return{"@@transducer/init":function(){return t},"@@transducer/step":function(t,e){return t.onNext(e)},"@@transducer/result":function(t){return t.onCompleted()}}}(n));return e.subscribe(new Cr(n,r))}),e)};var Er=v.AnonymousObservable=function(t){function e(t,e){var n,r=e[0],i=e[1],o=N(i.__subscribe).call(i,r);o!==S||r.fail(S.e)||O(S.e),r.setDisposable((n=o)&&E(n.dispose)?n:E(n)?Ot(n):At)}function n(e,n){this.source=n,this.__subscribe=e,t.call(this)}return gt(n,t),n.prototype._subscribe=function(t){var n=new Dr(t),r=[n,this];return Jt.scheduleRequired()?Jt.schedule(r,e):e(0,r),n},n}(we),Dr=function(t){function e(e){t.call(this),this.observer=e,this.m=new Ft}gt(e,t);var n=e.prototype;return n.next=function(t){var e=N(this.observer.onNext).call(this.observer,t);e===S&&(this.dispose(),O(e.e))},n.error=function(t){var e=N(this.observer.onError).call(this.observer,t);this.dispose(),e===S&&O(e.e)},n.completed=function(){var t=N(this.observer.onCompleted).call(this.observer);this.dispose(),t===S&&O(t.e)},n.setDisposable=function(t){this.m.setDisposable(t)},n.getDisposable=function(){return this.m.getDisposable()},n.dispose=function(){t.prototype.dispose.call(this),this.m.dispose()},e}(be),Sr=function(t,e){this._s=t,this._o=e};Sr.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var t=this._s.observers.indexOf(this._o);this._s.observers.splice(t,1),this._o=null}};var Nr=v.Subject=function(t){function e(){t.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return gt(e,t),xt(e.prototype,pe.prototype,{_subscribe:function(t){return kt(this),this.isStopped?this.hasError?(t.onError(this.error),At):(t.onCompleted(),At):(this.observers.push(t),new Sr(this,t))},hasObservers:function(){return kt(this),this.observers.length>0},onCompleted:function(){if(kt(this),!this.isStopped){this.isStopped=!0;for(var t=0,e=D(this.observers),n=e.length;t0},onCompleted:function(){var t;if(kt(this),!this.isStopped){this.isStopped=!0;var e=D(this.observers),n=e.length;if(this.hasValue)for(t=0;t"+t+""+e+""}}i.previewUri=r.Uri.parse("previewSeqDiag://authority/previewSeqDiag"),e.Misc=i},function(t,e){t.exports=require("path")},function(t,e,n){(function(t){var r,i;(function(o){var s={function:!0,object:!0};function u(t){return t&&t.Object===Object?t:null}var c=s[typeof e]&&e&&!e.nodeType?e:null,h=s[typeof t]&&t&&!t.nodeType?t:null,a=u(c&&h&&"object"==typeof global&&global),l=u(s[typeof self]&&self),p=u(s[typeof window]&&window),f=(h&&h.exports,u(s[typeof this]&&this)),d=a||p!==(f&&f.window)&&p||l||f||Function("return this")();r=[n(1)],void 0===(i=function(t,e){return o(d,e,t)}.apply(e,r))||(t.exports=i)}).call(this,(function(t,e,n,r){var i=n.Observable,o=i.prototype,s=n.AnonymousObservable,u=n.ObservableBase,c=n.Subject,h=n.AsyncSubject,a=n.Observer,l=n.internals.ScheduledObserver,p=n.Disposable.create,f=n.Disposable.empty,d=n.BinaryDisposable,b=n.Scheduler.currentThread,v=n.helpers.isFunction,_=n.internals.inherits,y=n.internals.addProperties,w=n.Disposable.checkDisposed;function m(t){for(var e=t.length,n=new Array(e),r=0;r0},onCompleted:function(){if(w(this),!this.isStopped){this.isStopped=!0;for(var t=0,e=m(this.observers),n=e.length;t0},_trim:function(t){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&t-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(t){if(w(this),!this.isStopped){var e=this.scheduler.now();this.q.push({interval:e,value:t}),this._trim(e);for(var n=0,r=m(this.observers),i=r.length;n0&&(this.clock=t.dueTime),t.invoke()):this.isEnabled=!1}while(this.isEnabled)}},n.stop=function(){this.isEnabled=!1},n.advanceTo=function(t){var e=this.comparer(this.clock,t);if(this.comparer(this.clock,t)>0)throw new ArgumentOutOfRangeError;if(0!==e&&!this.isEnabled){this.isEnabled=!0;do{var n=this.getNext();null!==n&&this.comparer(n.dueTime,t)<=0?(this.comparer(n.dueTime,this.clock)>0&&(this.clock=n.dueTime),n.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=t}},n.advanceBy=function(t){var e=this.add(this.clock,t),n=this.comparer(this.clock,e);if(n>0)throw new ArgumentOutOfRangeError;0!==n&&this.advanceTo(e)},n.sleep=function(t){var e=this.add(this.clock,t);if(this.comparer(this.clock,e)>=0)throw new ArgumentOutOfRangeError;this.clock=e},n.getNext=function(){for(;this.queue.length>0;){var t=this.queue.peek();if(!t.isCancelled())return t;this.queue.dequeue()}return null},n.scheduleAbsolute=function(t,e,n){var r=this;var i=new o(this,t,(function(t,e){return r.queue.remove(i),n(t,e)}),e,this.comparer);return this.queue.enqueue(i),i.disposable},e}(i);return n.HistoricalScheduler=function(t){function e(e,n){var r=null==e?0:e,i=n||h;t.call(this,r,i)}c(e,t);var n=e.prototype;return n.add=function(t,e){return t+e},n.toAbsoluteTime=function(t){return new Date(t).getTime()},n.toRelativeTime=function(t){return t},e}(n.VirtualTimeScheduler),n}))}).call(this,n(0)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(2),i=n(2),o=n(4),s=n(8),u=n(18),c=n(3),h=n(19);e.activate=function(t){const e=new h.PreviewSeqDiagDocumentContentProvider,n=new u.EventEmitter;s.Observable.fromEvent(n,"update").debounce(500).subscribe(t=>{e.update(c.Misc.previewUri)}),i.window.onDidChangeActiveTextEditor(t=>{t&&t.document&&t===i.window.activeTextEditor&&e.update(c.Misc.previewUri)}),i.workspace.onDidChangeTextDocument(t=>{t.document===r.window.activeTextEditor.document&&n.emit("update",t)}),t.subscriptions.push(r.workspace.registerTextDocumentContentProvider(c.Misc.previewUri.scheme,e)),r.commands.registerCommand("previewSeqDiag.showPreview",()=>{const n=r.window.createWebviewPanel("previewSeqDiag","Preview Sequence Diagrams",r.ViewColumn.Two,{enableScripts:!0,localResourceRoots:[r.Uri.file(o.join(t.extensionPath,"node_modules/mermaid/dist")),r.Uri.file(o.join(t.extensionPath,"node_modules/mscgenjs-inpage/dist"))]});e.getExtensionPath(t.extensionPath),e.setCurrentWebViewPanel(n),e.update(c.Misc.previewUri)})},e.deactivate=function(){}},function(t,e,n){var r=n(1);n(9),n(10),n(11),n(5),n(12),n(13),n(14),n(15),n(6),n(16),n(17),t.exports=r},function(t,e,n){(function(t){var r,i;(function(o){var s={function:!0,object:!0};function u(t){return t&&t.Object===Object?t:null}var c=s[typeof e]&&e&&!e.nodeType?e:null,h=s[typeof t]&&t&&!t.nodeType?t:null,a=u(c&&h&&"object"==typeof global&&global),l=u(s[typeof self]&&self),p=u(s[typeof window]&&window),f=(h&&h.exports,u(s[typeof this]&&this)),d=a||p!==(f&&f.window)&&p||l||f||Function("return this")();r=[n(1)],void 0===(i=function(t,e){return o(d,e,t)}.apply(e,r))||(t.exports=i)}).call(this,(function(t,e,n,r){var i=n.Observable,o=i.prototype,s=n.BinaryDisposable,u=n.AnonymousObservable,c=n.internals.AbstractObserver,h=n.Disposable.empty,a=n.helpers,l=a.defaultComparer,p=a.identity,f=a.defaultSubComparer,d=a.isFunction,b=a.isPromise,v=a.isArrayLike,_=a.isIterable,y=n.internals.inherits,w=i.fromPromise,m=i.from,g=n.internals.bindCallback,x=n.EmptyError,C=n.ObservableBase,E=n.ArgumentOutOfRangeError,D={e:{}};var S=n.internals.tryCatch=function(t){if(!d(t))throw new TypeError("fn must be a function");return e=t,function(){try{return e.apply(this,arguments)}catch(t){return D.e=t,D}};var e};var N=function(t){function e(e,n,r){this.source=e,this._k=n,this._c=r,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new O(t,this._k,this._c))},e}(C),O=function(t){function e(e,n,r){this._o=e,this._k=n,this._c=r,this._v=null,this._hv=!1,this._l=[],t.call(this)}return y(e,t),e.prototype.next=function(t){var e=S(this._k)(t);if(e===D)return this._o.onError(e.e);var n=0;if(this._hv){if((n=S(this._c)(e,this._v))===D)return this._o.onError(n.e)}else this._hv=!0,this._v=e;n>0&&(this._v=e,this._l=[]),n>=0&&this._l.push(t)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(this._l),this._o.onCompleted()},e}(c);function A(t){if(0===t.length)throw new x;return t[0]}var j=function(t){function e(e,n,r,i){this.source=e,this.accumulator=n,this.hasSeed=r,this.seed=i,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new k(t,this))},e}(C),k=function(t){function e(e,n){this._o=e,this._p=n,this._fn=n.accumulator,this._hs=n.hasSeed,this._s=n.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,t.call(this)}return y(e,t),e.prototype.next=function(t){if(!this._hv&&(this._hv=!0),this._ha?this._a=S(this._fn)(this._a,t,this._i,this._p):(this._a=this._hs?S(this._fn)(this._s,t,this._i,this._p):t,this._ha=!0),this._a===D)return this._o.onError(this._a.e);this._i++},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._hv&&this._o.onNext(this._a),!this._hv&&this._hs&&this._o.onNext(this._s),!this._hv&&!this._hs&&this._o.onError(new x),this._o.onCompleted()},e}(c);o.reduce=function(){var t,e=!1,n=arguments[0];return 2===arguments.length&&(e=!0,t=arguments[1]),new j(this,n,e,t)};var q=function(t){function e(e,n){this.source=e,this._fn=n,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new F(t,this._fn,this.source))},e}(C),F=function(t){function e(e,n,r){this._o=e,this._fn=n,this._s=r,this._i=0,t.call(this)}return y(e,t),e.prototype.next=function(t){var e=S(this._fn)(t,this._i++,this._s);if(e===D)return this._o.onError(e.e);Boolean(e)&&(this._o.onNext(!0),this._o.onCompleted())},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},e}(c);o.some=function(t,e){var n=g(t,e,3);return new q(this,n)};var T=function(t){function e(e){this.source=e,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new R(t))},e}(C),R=function(t){function e(e){this._o=e,t.call(this)}return y(e,t),e.prototype.next=function(){this._o.onNext(!1),this._o.onCompleted()},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},e}(c);o.isEmpty=function(){return new T(this)};var M=function(t){function e(e,n){this.source=e,this._fn=n,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new P(t,this._fn,this.source))},e}(C),P=function(t){function e(e,n,r){this._o=e,this._fn=n,this._s=r,this._i=0,t.call(this)}return y(e,t),e.prototype.next=function(t){var e=S(this._fn)(t,this._i++,this._s);if(e===D)return this._o.onError(e.e);Boolean(e)||(this._o.onNext(!1),this._o.onCompleted())},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},e}(c);o.every=function(t,e){var n=g(t,e,3);return new M(this,n)};var L=function(t){function e(e,n,r){var i=+r||0;Math.abs(i)===1/0&&(i=0),this.source=e,this._elem=n,this._n=i,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this._n<0?(t.onNext(!1),t.onCompleted(),h):this.source.subscribe(new z(t,this._elem,this._n))},e}(C),z=function(t){function e(e,n,r){this._o=e,this._elem=n,this._n=r,this._i=0,t.call(this)}return y(e,t),e.prototype.next=function(t){var e,n;this._i++>=this._n&&(e=t,n=this._elem,0===e&&0===n||e===n||isNaN(e)&&isNaN(n))&&(this._o.onNext(!0),this._o.onCompleted())},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},e}(c);o.includes=function(t,e){return new L(this,t,e)};var V=function(t){function e(e,n){this.source=e,this._fn=n,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new W(t,this._fn,this.source))},e}(C),W=function(t){function e(e,n,r){this._o=e,this._fn=n,this._s=r,this._i=0,this._c=0,t.call(this)}return y(e,t),e.prototype.next=function(t){if(this._fn){var e=S(this._fn)(t,this._i++,this._s);if(e===D)return this._o.onError(e.e);Boolean(e)&&this._c++}else this._c++},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},e}(c);o.count=function(t,e){var n=g(t,e,3);return new V(this,n)};var B=function(t){function e(e,n,r){this.source=e,this._e=n,this._n=r,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this._n<0?(t.onNext(-1),t.onCompleted(),h):this.source.subscribe(new I(t,this._e,this._n))},e}(C),I=function(t){function e(e,n,r){this._o=e,this._e=n,this._n=r,this._i=0,t.call(this)}return y(e,t),e.prototype.next=function(t){this._i>=this._n&&t===this._e&&(this._o.onNext(this._i),this._o.onCompleted()),this._i++},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(-1),this._o.onCompleted()},e}(c);o.indexOf=function(t,e){var n=+e||0;return Math.abs(n)===1/0&&(n=0),new B(this,t,n)};var U=function(t){function e(e,n){this.source=e,this._fn=n,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new $(t,this._fn,this.source))},e}(C),$=function(t){function e(e,n,r){this._o=e,this._fn=n,this._s=r,this._i=0,this._c=0,t.call(this)}return y(e,t),e.prototype.next=function(t){if(this._fn){var e=S(this._fn)(t,this._i++,this._s);if(e===D)return this._o.onError(e.e);this._c+=e}else this._c+=t},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},e}(c);o.sum=function(t,e){var n=g(t,e,3);return new U(this,n)},o.minBy=function(t,e){return e||(e=f),new N(this,t,(function(t,n){return-1*e(t,n)}))},o.min=function(t){return this.minBy(p,t).map(A)},o.maxBy=function(t,e){return e||(e=f),new N(this,t,e)},o.max=function(t){return this.maxBy(p,t).map(A)};var H=function(t){function e(e,n){this.source=e,this._fn=n,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new K(t,this._fn,this.source))},e}(C),K=function(t){function e(e,n,r){this._o=e,this._fn=n,this._s=r,this._c=0,this._t=0,t.call(this)}return y(e,t),e.prototype.next=function(t){if(this._fn){var e=S(this._fn)(t,this._c++,this._s);if(e===D)return this._o.onError(e.e);this._t+=e}else this._c++,this._t+=t},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){if(0===this._c)return this._o.onError(new x);this._o.onNext(this._t/this._c),this._o.onCompleted()},e}(c);o.average=function(t,e){var n;return d(t)&&(n=g(t,e,3)),new H(this,n)},o.sequenceEqual=function(t,e){var n=this;return e||(e=l),new u((function(r){var i=!1,o=!1,u=[],c=[],h=n.subscribe((function(t){if(c.length>0){var n=c.shift(),i=S(e)(n,t);if(i===D)return r.onError(i.e);i||(r.onNext(!1),r.onCompleted())}else o?(r.onNext(!1),r.onCompleted()):u.push(t)}),(function(t){r.onError(t)}),(function(){i=!0,0===u.length&&(c.length>0?(r.onNext(!1),r.onCompleted()):o&&(r.onNext(!0),r.onCompleted()))}));(v(t)||_(t))&&(t=m(t)),b(t)&&(t=w(t));var a=t.subscribe((function(t){if(u.length>0){var n=u.shift(),o=S(e)(n,t);if(o===D)return r.onError(o.e);o||(r.onNext(!1),r.onCompleted())}else i?(r.onNext(!1),r.onCompleted()):c.push(t)}),(function(t){r.onError(t)}),(function(){o=!0,0===c.length&&(u.length>0?(r.onNext(!1),r.onCompleted()):i&&(r.onNext(!0),r.onCompleted()))}));return new s(h,a)}),n)};var Q=function(t){function e(e,n,r){this.source=e,this._i=n,this._d=r,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new J(t,this._i,this._d))},e}(C),J=function(t){function e(e,n,r){this._o=e,this._i=n,this._d=r,t.call(this)}return y(e,t),e.prototype.next=function(t){0==this._i--&&(this._o.onNext(t),this._o.onCompleted())},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._d===r?this._o.onError(new E):(this._o.onNext(this._d),this._o.onCompleted())},e}(c);o.elementAt=function(t,e){if(t<0)throw new E;return new Q(this,t,e)};var G=function(t){function e(e,n,r){this._o=e,this._obj=n,this._s=r,this._i=0,this._hv=!1,this._v=null,t.call(this)}return y(e,t),e.prototype.next=function(t){var e=!1;if(this._obj.predicate){var n=S(this._obj.predicate)(t,this._i++,this._s);if(n===D)return this._o.onError(n.e);Boolean(n)&&(e=!0)}else this._obj.predicate||(e=!0);if(e){if(this._hv)return this._o.onError(new Error("Sequence contains more than one matching element"));this._hv=!0,this._v=t}},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===r?this._o.onError(new x):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},e}(c);o.single=function(t,e){var n={},r=this;if(n="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},d(n.predicate)){var i=n.predicate;n.predicate=g(i,n.thisArg,3)}return new u((function(t){return r.subscribe(new G(t,n,r))}),r)};var X=function(t){function e(e,n){this.source=e,this._obj=n,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new Y(t,this._obj,this.source))},e}(C),Y=function(t){function e(e,n,r){this._o=e,this._obj=n,this._s=r,this._i=0,t.call(this)}return y(e,t),e.prototype.next=function(t){if(this._obj.predicate){var e=S(this._obj.predicate)(t,this._i++,this._s);if(e===D)return this._o.onError(e.e);Boolean(e)&&(this._o.onNext(t),this._o.onCompleted())}else this._obj.predicate||(this._o.onNext(t),this._o.onCompleted())},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._obj.defaultValue===r?this._o.onError(new x):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},e}(c);o.first=function(){var t={};if(t="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},d(t.predicate)){var e=t.predicate;t.predicate=g(e,t.thisArg,3)}return new X(this,t)};var Z=function(t){function e(e,n){this.source=e,this._obj=n,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new tt(t,this._obj,this.source))},e}(C),tt=function(t){function e(e,n,r){this._o=e,this._obj=n,this._s=r,this._i=0,this._hv=!1,this._v=null,t.call(this)}return y(e,t),e.prototype.next=function(t){var e=!1;if(this._obj.predicate){var n=S(this._obj.predicate)(t,this._i++,this._s);if(n===D)return this._o.onError(n.e);Boolean(n)&&(e=!0)}else this._obj.predicate||(e=!0);e&&(this._hv=!0,this._v=t)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===r?this._o.onError(new x):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},e}(c);o.last=function(){var t={};if(t="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},d(t.predicate)){var e=t.predicate;t.predicate=g(e,t.thisArg,3)}return new Z(this,t)};var et=function(t){function e(e,n,r,i){this._o=e,this._s=n,this._cb=r,this._y=i,this._i=0,t.call(this)}return y(e,t),e.prototype.next=function(t){var e=S(this._cb)(t,this._i,this._s);if(e===D)return this._o.onError(e.e);e?(this._o.onNext(this._y?this._i:t),this._o.onCompleted()):this._i++},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._y&&this._o.onNext(-1),this._o.onCompleted()},e}(c);function nt(t,e,n,r){var i=g(e,n,3);return new u((function(e){return t.subscribe(new et(e,t,i,r))}),t)}o.find=function(t,e){return nt(this,t,e,!1)},o.findIndex=function(t,e){return nt(this,t,e,!0)};var rt=function(t){function e(e){this.source=e,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new it(t))},e}(C),it=function(e){function n(n){this._o=n,this._s=new t.Set,e.call(this)}return y(n,e),n.prototype.next=function(t){this._s.add(t)},n.prototype.error=function(t){this._o.onError(t)},n.prototype.completed=function(){this._o.onNext(this._s),this._o.onCompleted()},n}(c);o.toSet=function(){if(void 0===t.Set)throw new TypeError;return new rt(this)};var ot=function(t){function e(e,n,r){this.source=e,this._k=n,this._e=r,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new st(t,this._k,this._e))},e}(C),st=function(e){function n(n,r,i){this._o=n,this._k=r,this._e=i,this._m=new t.Map,e.call(this)}return y(n,e),n.prototype.next=function(t){var e=S(this._k)(t);if(e===D)return this._o.onError(e.e);var n=t;if(this._e&&(n=S(this._e)(t))===D)return this._o.onError(n.e);this._m.set(e,n)},n.prototype.error=function(t){this._o.onError(t)},n.prototype.completed=function(){this._o.onNext(this._m),this._o.onCompleted()},n}(c);o.toMap=function(e,n){if(void 0===t.Map)throw new TypeError;return new ot(this,e,n)};var ut=function(t){function e(e,n,r){this.source=e,this._b=n,this._e=r,t.call(this)}return y(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new ct(t,this._b,this._e))},e}(C),ct=function(t){function e(e,n,r){this._o=e,this._b=n,this._e=r,this._i=0,t.call(this)}return y(e,t),e.prototype.next=function(t){this._i>=this._b&&(this._e===this._i?this._o.onCompleted():this._o.onNext(t)),this._i++},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(c);o.slice=function(t,e){var r=t||0;if(r<0)throw new n.ArgumentOutOfRangeError;if("number"==typeof e&&e=this._n&&t===this._e&&(this._hv=!0,this._v=this._i),this._i++},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._hv?this._o.onNext(this._v):this._o.onNext(-1),this._o.onCompleted()},e}(c);return o.lastIndexOf=function(t,e){var n=+e||0;return Math.abs(n)===1/0&&(n=0),new ht(this,t,n)},n}))}).call(this,n(0)(t))},function(t,e,n){(function(t){var r,i;(function(o){var s={function:!0,object:!0};function u(t){return t&&t.Object===Object?t:null}var c=s[typeof e]&&e&&!e.nodeType?e:null,h=s[typeof t]&&t&&!t.nodeType?t:null,a=u(c&&h&&"object"==typeof global&&global),l=u(s[typeof self]&&self),p=u(s[typeof window]&&window),f=(h&&h.exports,u(s[typeof this]&&this)),d=a||p!==(f&&f.window)&&p||l||f||Function("return this")();r=[n(5),e],void 0===(i=function(t,e){return d.Rx=o(d,e,t),d.Rx}.apply(e,r))||(t.exports=i)}).call(this,(function(t,e,n,r){var i=n.Observable,o=i.fromPromise,s=i.throwError,u=n.AnonymousObservable,c=n.ObservableBase,h=n.AsyncSubject,a=(n.Disposable.create,n.CompositeDisposable),l=(n.Scheduler.immediate,n.Scheduler.default),p=n.internals.inherits,f=n.Scheduler.isScheduler,d=n.helpers.isPromise,b=n.helpers.isFunction,v=n.helpers.isIterable,_=n.helpers.isArrayLike,y={e:{}};var w=n.internals.tryCatch=function(t){if(!b(t))throw new TypeError("fn must be a function");return e=t,function(){try{return e.apply(this,arguments)}catch(t){return y.e=t,y}};var e};i.wrap=function(t){function e(){return i.spawn.call(this,t.apply(this,arguments))}return e.__generatorFunction__=t,e};var m=i.spawn=function(){for(var t=arguments[0],e=this,n=[],r=1,o=arguments.length;r2){for(var r=[],i=1,o=arguments.length;i0;)t.onNext(u.shift())}return(n=this.source,i=this.pauser.startWith(!this.paused).distinctUntilChanged(),o=function(t,e){return{data:t,shouldFire:e}},new s((function(t){var e,r=[!1,!1],s=!1,u=!1,h=new Array(2);function a(n,i){if(h[i]=n,r[i]=!0,s||(s=r.every(w))){if(e)return t.onError(e);var c=C(o).apply(null,h);if(c===x)return t.onError(c.e);t.onNext(c)}u&&h[1]&&t.onCompleted()}return new c(n.subscribe((function(t){a(t,0)}),(function(n){h[1]?t.onError(n):e=n}),(function(){u=!0,h[1]&&t.onCompleted()})),i.subscribe((function(t){a(t,1)}),(function(e){t.onError(e)}),(function(){u=!0,a(!0,1)})))}),n)).subscribe((function(n){e!==r&&n.shouldFire!==e?(e=n.shouldFire,n.shouldFire&&h()):(e=n.shouldFire,n.shouldFire?t.onNext(n.data):u.push(n.data))}),(function(e){h(),t.onError(e)}),(function(){h(),t.onCompleted()}))},e.prototype.pause=function(){this.paused=!0,this.controller.onNext(!1)},e.prototype.resume=function(){this.paused=!1,this.controller.onNext(!0)},e}(i);o.pausableBuffered=function(t){return new D(this,t)};var S=function(t){function e(e,n,r){t.call(this),this.subject=new N(n,r),this.source=e.multicast(this.subject).refCount()}return b(e,t),e.prototype._subscribe=function(t){return this.source.subscribe(t)},e.prototype.request=function(t){return this.subject.request(null==t?-1:t)},e}(i),N=function(t){function e(e,n){null==e&&(e=!0),t.call(this),this.subject=new l,this.enableQueue=e,this.queue=e?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=n||y}return b(e,t),v(e.prototype,p,{_subscribe:function(t){return this.subject.subscribe(t)},onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(a.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(t){this.hasFailed=!0,this.error=t,this.enableQueue&&0!==this.queue.length?this.queue.push(a.createOnError(t)):(this.subject.onError(t),this.disposeCurrentRequest())},onNext:function(t){this.requestedCount<=0?this.enableQueue&&this.queue.push(a.createOnNext(t)):(0==this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(t))},_processRequest:function(t){if(this.enableQueue)for(;this.queue.length>0&&(t>0||"N"!==this.queue[0].kind);){var e=this.queue.shift();e.accept(this.subject),"N"===e.kind?t--:(this.disposeCurrentRequest(),this.queue=[])}return t},request:function(t){this.disposeCurrentRequest();var e=this;return this.requestedDisposable=this.scheduler.schedule(t,(function(t,n){var r=e._processRequest(n);if(!(e.hasCompleted||e.hasFailed)&&r>0)return e.requestedCount=r,d((function(){e.requestedCount=0}))})),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),e}(i);o.controlled=function(t,e){return t&&m(t)&&(e=t,t=!0),null==t&&(t=!0),new S(this,t,e)};var O=function(t){function e(e){t.call(this),this.source=e}function n(t,e){return e.source.request(1)}b(e,t),e.prototype._subscribe=function(t){return this.subscription=this.source.subscribe(new r(t,this,this.subscription)),new c(this.subscription,_.schedule(this,n))};var r=function(t){function e(e,n,r){t.call(this),this.observer=e,this.observable=n,this.cancel=r,this.scheduleDisposable=null}function n(t,e){return e.observable.source.request(1)}return b(e,t),e.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},e.prototype.error=function(t){this.observer.onError(t),this.dispose()},e.prototype.next=function(t){this.observer.onNext(t),this.scheduleDisposable=_.schedule(this,n)},e.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),t.prototype.dispose.call(this)},e}(u);return e}(i);S.prototype.stopAndWait=function(){return new O(this)};var A=function(t){function e(e,n){t.call(this),this.source=e,this.windowSize=n}function n(t,e){return e.source.request(e.windowSize)}b(e,t),e.prototype._subscribe=function(t){return this.subscription=this.source.subscribe(new r(t,this,this.subscription)),new c(this.subscription,_.schedule(this,n))};var r=function(t){function e(e,n,r){this.observer=e,this.observable=n,this.cancel=r,this.received=0,this.scheduleDisposable=null,t.call(this)}function n(t,e){return e.observable.source.request(e.observable.windowSize)}return b(e,t),e.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},e.prototype.error=function(t){this.observer.onError(t),this.dispose()},e.prototype.next=function(t){this.observer.onNext(t),this.received=++this.received%this.observable.windowSize,0===this.received&&(this.scheduleDisposable=_.schedule(this,n))},e.prototype.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),t.prototype.dispose.call(this)},e}(u);return e}(i);return S.prototype.windowed=function(t){return new A(this,t)},o.pipe=function(t){var e=this.pausableBuffered();function n(){e.resume()}return t.addListener("drain",n),e.subscribe((function(n){!t.write(n)&&e.pause()}),(function(e){t.emit("error",e)}),(function(){!t._isStdio&&t.end(),t.removeListener("drain",n)})),e.resume(),t},n}))}).call(this,n(0)(t))},function(t,e,n){(function(t){var r,i;(function(o){var s={function:!0,object:!0};function u(t){return t&&t.Object===Object?t:null}var c=s[typeof e]&&e&&!e.nodeType?e:null,h=s[typeof t]&&t&&!t.nodeType?t:null,a=u(c&&h&&"object"==typeof global&&global),l=u(s[typeof self]&&self),p=u(s[typeof window]&&window),f=(h&&h.exports,u(s[typeof this]&&this)),d=a||p!==(f&&f.window)&&p||l||f||Function("return this")();r=[n(1)],void 0===(i=function(t,e){return o(d,e,t)}.apply(e,r))||(t.exports=i)}).call(this,(function(t,e,n,r){var i=n.Observable,o=n.ObservableBase,s=n.internals.AbstractObserver,u=n.CompositeDisposable,c=n.BinaryDisposable,h=n.RefCountDisposable,a=n.SingleAssignmentDisposable,l=n.SerialDisposable,p=n.Subject,f=i.prototype,d=i.empty,b=i.never,v=n.AnonymousObservable,_=n.internals.addRef,y=n.internals.inherits,w=n.internals.bindCallback,m=n.helpers.noop,g=n.helpers.isPromise,x=n.helpers.isFunction,C=i.fromPromise,E={e:{}};var D=n.internals.tryCatch=function(t){if(!x(t))throw new TypeError("fn must be a function");return e=t,function(){try{return e.apply(this,arguments)}catch(t){return E.e=t,E}};var e};var S=t.Map||function(){function t(){this.size=0,this._values=[],this._keys=[]}return t.prototype.delete=function(t){var e=this._keys.indexOf(t);return-1!==e&&(this._values.splice(e,1),this._keys.splice(e,1),this.size--,!0)},t.prototype.get=function(t){var e=this._keys.indexOf(t);return-1===e?r:this._values[e]},t.prototype.set=function(t,e){var n=this._keys.indexOf(t);return-1===n?(this._keys.push(t),this._values.push(e),this.size++):this._values[n]=e,this},t.prototype.forEach=function(t,e){for(var n=0;n0){n=r.q.shift();var o=new b;r.d.add(o),o.setDisposable(n.subscribe(new R(r,i,o))),e([r,i])}else r.isAcquired=!1}return g(e,t),e.prototype._ensureActive=function(t){var e=!1;t.q.length>0&&(e=!t.isAcquired,t.isAcquired=!0),e&&t.m.setDisposable(this._scheduler.scheduleRecursive([t,this],n))},e.prototype.subscribeCore=function(t){var e=new d,n=new f(e),r={q:[],m:e,d:n,activeCount:0,isAcquired:!1,o:t};return r.q.push(this.source),r.activeCount++,this._ensureActive(r),n},e}(s),R=function(t){function e(e,n,r){this._s=e,this._p=n,this._m1=r,t.call(this)}return g(e,t),e.prototype.next=function(t){this._s.o.onNext(t);var e=j(this._p._fn)(t);if(e===A)return this._s.o.onError(e.e);this._s.q.push(e),this._s.activeCount++,this._p._ensureActive(this._s)},e.prototype.error=function(t){this._s.o.onError(t)},e.prototype.completed=function(){this._s.d.remove(this._m1),this._s.activeCount--,0===this._s.activeCount&&this._s.o.onCompleted()},e}(u);function M(){for(var t=arguments.length,e=new Array(t),n=0;ne?1:t0){var s=n.now();(i=new Date(i.getTime()+o)).getTime()<=s&&(i=new Date(s+o))}r.onNext(t),e(t+1,new Date(i))}))}))}function k(t,e,n){return t===e?new c((function(t){return n.schedulePeriodic(0,e,(function(e){return t.onNext(e),e+1}))})):a((function(){return j(new Date(n.now()+t),e,n)}))}var q=s.interval=function(t,e){return k(t,t,D(e)?e:f)};s.timer=function(t,e,n){var i;return D(n)||(n=f),null!=e&&"number"==typeof e?i=e:D(e)&&(n=e),(t instanceof Date||"number"==typeof t)&&i===r?function(t,e){return new A(t,e)}(t,n):t instanceof Date&&i!==r?j(t,e,n):k(t,i,n)};function F(t,e,n){return new c((function(r){var i,o=!1,s=new b,u=null,c=[],h=!1;return i=t.materialize().timestamp(n).subscribe((function(t){var i,a;"E"===t.value.kind?((c=[]).push(t),u=t.value.error,a=!h):(c.push({value:t.value,timestamp:t.timestamp+e}),a=!o,o=!0),a&&(null!==u?r.onError(u):(i=new d,s.setDisposable(i),i.setDisposable(n.scheduleRecursiveFuture(null,e,(function(t,e){var i,s,a,l;if(null===u){h=!0;do{a=null,c.length>0&&c[0].timestamp-n.now()<=0&&(a=c.shift().value),null!==a&&a.accept(r)}while(null!==a);l=!1,s=0,c.length>0?(l=!0,s=Math.max(0,c[0].timestamp-n.now())):o=!1,h=!1,null!==(i=u)?r.onError(i):l&&e(null,s)}})))))})),new _(i,s)}),t)}function T(t,e,n){return a((function(){return F(t,e-n.now(),n)}))}function R(t,e,n){var r,i;return E(e)?i=e:(r=e,i=n),new c((function(e){var n=new v,o=!1,s=new b;function u(){s.setDisposable(t.subscribe((function(t){var r=O(i)(t);if(r===N)return e.onError(r.e);var o=new d;n.add(o),o.setDisposable(r.subscribe((function(){e.onNext(t),n.remove(o),c()}),(function(t){e.onError(t)}),(function(){e.onNext(t),n.remove(o),c()})))}),(function(t){e.onError(t)}),(function(){o=!0,s.dispose(),c()})))}function c(){o&&0===n.length&&e.onCompleted()}return r?s.setDisposable(r.subscribe(u,(function(t){e.onError(t)}),u)):u(),new _(s,n)}),t)}u.delay=function(){var t=arguments[0];if("number"==typeof t||t instanceof Date){var e=t,n=arguments[1];return D(n)||(n=f),e instanceof Date?T(this,e,n):F(this,e,n)}if(s.isObservable(t)||E(t))return R(this,t,arguments[1]);throw new Error("Invalid arguments")};var M=function(t){function e(e,n,r){D(r)||(r=f),this.source=e,this._dt=n,this._s=r,t.call(this)}return i(e,t),e.prototype.subscribeCore=function(t){var e=new b;return new _(this.source.subscribe(new P(t,this._dt,this._s,e)),e)},e}(h),P=function(t){function e(e,n,r,i){this._o=e,this._d=n,this._scheduler=r,this._c=i,this._v=null,this._hv=!1,this._id=0,t.call(this)}return i(e,t),e.prototype.next=function(t){this._hv=!0,this._v=t;var e=++this._id,n=new d;this._c.setDisposable(n),n.setDisposable(this._scheduler.scheduleFuture(this,this._d,(function(n,r){r._hv&&r._id===e&&r._o.onNext(t),r._hv=!1})))},e.prototype.error=function(t){this._c.dispose(),this._o.onError(t),this._hv=!1,this._id++},e.prototype.completed=function(){this._c.dispose(),this._hv&&this._o.onNext(this._v),this._o.onCompleted(),this._hv=!1,this._id++},e}(o);function L(t,e){return new c((function(n){var r,i=!1,o=new b,s=0,u=t.subscribe((function(t){var u=O(e)(t);if(u===N)return n.onError(u.e);C(u)&&(u=S(u)),i=!0,r=t;var c=++s,h=new d;o.setDisposable(h),h.setDisposable(u.subscribe((function(){i&&s===c&&n.onNext(r),i=!1,h.dispose()}),(function(t){n.onError(t)}),(function(){i&&s===c&&n.onNext(r),i=!1,h.dispose()})))}),(function(t){o.dispose(),n.onError(t),i=!1,s++}),(function(){o.dispose(),i&&n.onNext(r),n.onCompleted(),i=!1,s++}));return new _(u,o)}),t)}function z(t){return t.toArray()}function z(t){return t.toArray()}u.debounce=function(){if(E(arguments[0]))return L(this,arguments[0]);if("number"==typeof arguments[0])return new M(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},u.windowWithTime=u.windowTime=function(t,e,n){var r,i=this;return null==e&&(r=t),D(n)||(n=f),"number"==typeof e?r=e:D(e)&&(r=t,n=e),new c((function(e){var o,s,u=r,c=t,h=[],a=new b,l=0;return o=new v(a),s=new y(o),h.push(new w),e.onNext(m(h[0],s)),function t(){var i=new d,o=!1,p=!1;a.setDisposable(i),c===u?(o=!0,p=!0):c0&&e-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){for(var t=this._s.now();this._q.length>0&&t-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value);this._o.onCompleted()},e}(o);u.skipLastWithTime=function(t,e){return D(e)||(e=f),new Z(this,t,e)};var et=function(t){function e(e,n,r){this.source=e,this._d=n,this._s=r,t.call(this)}return i(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new nt(t,this._d,this._s))},e}(h),nt=function(t){function e(e,n,r){this._o=e,this._d=n,this._s=r,this._q=[],t.call(this)}return i(e,t),e.prototype.next=function(t){var e=this._s.now();for(this._q.push({interval:e,value:t});this._q.length>0&&e-this._q[0].interval>=this._d;)this._q.shift()},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){for(var t=this._s.now();this._q.length>0;){var e=this._q.shift();t-e.interval<=this._d&&this._o.onNext(e.value)}this._o.onCompleted()},e}(o);u.takeLastWithTime=function(t,e){return D(e)||(e=f),new et(this,t,e)},u.takeLastBufferWithTime=function(t,e){var n=this;return D(e)||(e=f),new c((function(r){var i=[];return n.subscribe((function(n){var r=e.now();for(i.push({interval:r,value:n});i.length>0&&r-i[0].interval>=t;)i.shift()}),(function(t){r.onError(t)}),(function(){for(var n=e.now(),o=[];i.length>0;){var s=i.shift();n-s.interval<=t&&o.push(s.value)}r.onNext(o),r.onCompleted()}))}),n)};var rt=function(t){function e(e,n,r){this.source=e,this._d=n,this._s=r,t.call(this)}function n(t,e){e.onCompleted()}return i(e,t),e.prototype.subscribeCore=function(t){return new _(this._s.scheduleFuture(t,this._d,n),this.source.subscribe(t))},e}(h);u.takeWithTime=function(t,e){return D(e)||(e=f),new rt(this,t,e)};var it=function(t){function e(e,n,r){this.source=e,this._d=n,this._s=r,this._open=!1,t.call(this)}function n(t,e){e._open=!0}return i(e,t),e.prototype.subscribeCore=function(t){return new _(this._s.scheduleFuture(this,this._d,n),this.source.subscribe(new ot(t,this)))},e}(h),ot=function(t){function e(e,n){this._o=e,this._p=n,t.call(this)}return i(e,t),e.prototype.next=function(t){this._p._open&&this._o.onNext(t)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(o);u.skipWithTime=function(t,e){return D(e)||(e=f),new it(this,t,e)};var st=function(t){function e(e,n,r){this.source=e,this._st=n,this._s=r,t.call(this)}function n(t,e){e._open=!0}return i(e,t),e.prototype.subscribeCore=function(t){return this._open=!1,new _(this._s.scheduleFuture(this,this._st,n),this.source.subscribe(new ut(t,this)))},e}(h),ut=function(t){function e(e,n){this._o=e,this._p=n,t.call(this)}return i(e,t),e.prototype.next=function(t){this._p._open&&this._o.onNext(t)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(o);return u.skipUntilWithTime=function(t,e){return D(e)||(e=f),new st(this,t,e)},u.takeUntilWithTime=function(t,e){D(e)||(e=f);var n=this;return new c((function(r){return new _(e.scheduleFuture(r,t,(function(t,e){e.onCompleted()})),n.subscribe(r))}),n)},u.throttle=function(t,e){D(e)||(e=f);var n=+t||0;if(n<=0)throw new RangeError("windowDuration cannot be less or equal zero.");var r=this;return new c((function(t){var i=0;return r.subscribe((function(r){var o=e.now();(0===i||o-i>=n)&&(i=o,t.onNext(r))}),(function(e){t.onError(e)}),(function(){t.onCompleted()}))}),r)},n}))}).call(this,n(0)(t))},function(t,e){t.exports=require("events")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(2),i=n(20),o=n(21),s=n(22),u=["mermaid","mmd","mscgen","msgenny","xu"];let c=null,h=null,a=null;e.PreviewSeqDiagDocumentContentProvider=class{constructor(){this._currentSnippet=i.DefaultCodeSnippet.instance}setCurrentWebViewPanel(t){h=t}getExtensionPath(t){a=t}update(t){u.indexOf(r.window.activeTextEditor.document.languageId)>-1&&this.refresh()}provideTextDocumentContent(t,e){return c}refresh(){let t=r.window.activeTextEditor;if(!t)return c;switch(t.document.languageId){case"mermaid":case"mmd":this._currentSnippet=s.MermaidCodeSnippet.instance;break;case"mscgen":case"msgenny":case"xu":this._currentSnippet=o.MscgenCodeSnippet.instance;break;default:this._currentSnippet=i.DefaultCodeSnippet.instance}this._currentSnippet.createCodeSnippet(t.document.languageId,a).then(t=>{c=t,h&&h.webview&&(h.webview.html=t)}).catch()}}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function u(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(s,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=n(2),o=n(3);class s{constructor(){}static get instance(){return this._instance||(this._instance=new s),this._instance}createCodeSnippet(t,e){return r(this,void 0,void 0,(function*(){return this.extractSnippet(t,e)}))}extractSnippet(t,e){return r(this,void 0,void 0,(function*(){let n=i.window.activeTextEditor.document.getText();return this.previewSnippet(t,e,n)}))}errorSnippet(t){return r(this,void 0,void 0,(function*(){return o.Misc.getFormattedHtml("",t)}))}previewSnippet(t,e,n){return r(this,void 0,void 0,(function*(){return o.Misc.getFormattedHtml("\n ",`\n ${n}\n `)}))}}e.DefaultCodeSnippet=s},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function u(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(s,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=n(2),o=n(3);var s,u;!function(t){t.Classic="classic",t.Cygne="cygne",t.Fountainpen="fountainpen",t.Lazy="lazy",t.Pegasse="pegasse"}(s||(s={})),function(t){t.Fixed="fixed",t.Stretch="stretch"}(u||(u={}));class c{}class h{constructor(){this._configMscgen=new c,this._configMscgen.fixedNamedStyle=s.Cygne,this._configMscgen.horizontalAlignment=u.Stretch;var t=i.workspace.getConfiguration("previewSeqDiag");if(t&&t.mscgen){switch(t.mscgen.fixedNamedStyle){case s.Classic:case s.Cygne:case s.Fountainpen:case s.Lazy:case s.Pegasse:this._configMscgen.fixedNamedStyle=t.mscgen.fixedNamedStyle}switch(t.mscgen.horizontalAlignment){case u.Fixed:this._configMscgen.horizontalAlignment=u.Fixed}}}static get instance(){return this._instance||(this._instance=new h),this._instance}createCodeSnippet(t,e){return r(this,void 0,void 0,(function*(){return this.extractSnippet(t,e)}))}extractSnippet(t,e){return r(this,void 0,void 0,(function*(){let n=i.window.activeTextEditor.document.getText();return this.previewSnippet(t,e,n)}))}errorSnippet(t){return r(this,void 0,void 0,(function*(){return o.Misc.getFormattedHtml("",t)}))}previewSnippet(t,e,n){return r(this,void 0,void 0,(function*(){return o.Misc.getFormattedHtml(`\n \r\n \r\n `\r\n + ((this._configMscgen.horizontalAlignment === Alignment.Stretch) ? `` : ``)\r\n ,\r\n `\r\n
\r\n \r\n ${payLoad}\r\n \r\n
\r\n \r\n `);\r\n }\r\n}\r\n","'use strict';\r\n\r\nimport * as vscode from 'vscode';\r\nimport * as fs from 'fs';\r\nimport * as Path from 'path';\r\nimport { workspace, window, commands, ExtensionContext } from 'vscode';\r\nimport { CodeSnippetInterface } from './codeSnippetInterface';\r\nimport { Misc } from './misc';\r\n\r\n\r\ntype StyleName = \"dark\" | \"forest\" | \"neutral\";\r\nnamespace StyleName{\r\n export const Dark = \"dark\"\r\n export const Forest = \"forest\"\r\n export const Neutral = \"neutral\"\r\n}\r\n\r\nconst BackgroundColorDefault = \"#fafaf6\";\r\n\r\nclass ConfigMermaid\r\n{\r\n public fixedStyle: StyleName;\r\n public fixedBackgroundColor: string;\r\n}\r\n\r\n\r\nexport class MermaidCodeSnippet implements CodeSnippetInterface\r\n{\r\n private static _instance:MermaidCodeSnippet;\r\n\r\n private _configMermaid: ConfigMermaid = null;\r\n\r\n private constructor()\r\n { \r\n this._configMermaid = new ConfigMermaid();\r\n\r\n // defaults\r\n this._configMermaid.fixedStyle = StyleName.Forest;\r\n this._configMermaid.fixedBackgroundColor = BackgroundColorDefault;\r\n\r\n var config = vscode.workspace.getConfiguration('previewSeqDiag');\r\n if(!!config && !!config.mermaid)\r\n {\r\n // fixedStyle\r\n switch(config.mermaid.fixedStyle)\r\n {\r\n case StyleName.Dark:\r\n case StyleName.Forest:\r\n case StyleName.Neutral:\r\n this._configMermaid.fixedStyle = config.mscgen.fixedNamedStyle;\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n // fixedBackgroundColor\r\n if(config.mermaid.fixedBackgroundColor != null)\r\n this._configMermaid.fixedBackgroundColor = config.mermaid.fixedBackgroundColor;\r\n }\r\n }\r\n\r\n public static get instance():MermaidCodeSnippet\r\n {\r\n if (!this._instance)\r\n this._instance = new MermaidCodeSnippet();\r\n \r\n return this._instance;\r\n }\r\n \r\n public async createCodeSnippet(languageId: string, extentiponPath:string): Promise\r\n {\r\n return this.extractSnippet(languageId, extentiponPath);\r\n }\r\n\r\n private async extractSnippet(languageId: string, extentiponPath:string): Promise\r\n {\r\n let editor = vscode.window.activeTextEditor;\r\n let text = editor.document.getText();\r\n\r\n try {\r\n text = text.replace(/%%[ \\t]+import[ \\t]?:[ \\t]?(.+)/g, (match, subsequenceFile) => {\r\n let dirname = editor.document.uri.fsPath\r\n .toString()\r\n .split(Path.sep);\r\n dirname.pop();\r\n const fileName = dirname.join(Path.sep) + Path.sep + subsequenceFile.trim();\r\n const importSequence = fs\r\n .readFileSync(fileName, 'utf8')\r\n .replace(/sequenceDiagram/g, '');\r\n return importSequence;\r\n });\r\n }\r\n catch (err) {\r\n console.error(err);\r\n }\r\n\r\n return this.previewSnippet(languageId, extentiponPath, text);\r\n }\r\n\r\n private async errorSnippet(error: string): Promise\r\n {\r\n return Misc.getFormattedHtml(\"\",error);\r\n }\r\n\r\n private async previewSnippet(languageId: string, extentiponPath:string, payLoad: string): Promise\r\n {\r\n return Misc.getFormattedHtml(\r\n `\r\n \r\n \r\n `,\r\n `\r\n
\r\n
${payLoad}
\r\n
\r\n \r\n `);\r\n }\r\n}\r\n","module.exports = require(\"fs\");"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index a69da95..9ed643c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "previewseqdiag-vscode", "displayName": "Preview Sequence Diagrams", "description": "An extension for vscode specialized for the preview function of mermaid, mscgen and other.", - "version": "0.2.1", + "version": "0.2.2", "publisher": "arichika", "author": "arichika.taniguchi @arichika", "license": "GPL-3.0", @@ -41,7 +41,7 @@ "onLanguage:msgenny", "onLanguage:xu" ], - "main": "./out/src/extension", + "main": "./dist/extension", "contributes": { "languages": [ { @@ -153,7 +153,10 @@ } }, "scripts": { - "vscode:prepublish": "tsc -p ./", + "vscode:prepublish": "webpack --mode production", + "webpack": "webpack --mode development", + "webpack-dev": "webpack --mode development --watch", + "test-compile": "tsc -p ./", "compile": "tsc -watch -p ./", "postinstall": "node ./node_modules/vscode/bin/install", "test": "node ./node_modules/vscode/bin/test" @@ -161,17 +164,20 @@ "dependencies": { "d3": "^4.13.0", "dagre-d3-renderer": "^0.5.8", - "mermaid": "^8.0.0", - "mscgenjs": "^3.0.0", - "mscgenjs-inpage": "^2.0.0", + "mermaid": "^8.4.4", + "mscgenjs": "^4.0.2", + "mscgenjs-inpage": "^2.0.12", "rx": "^4.1.0" }, "devDependencies": { - "@types/mocha": "^5.2.0", - "@types/node": "^8.10.17", + "@types/mocha": "^5.2.7", + "@types/node": "^8.10.59", "mocha": "^5.2.0", - "typescript": "^2.8.3", - "vscode": "^1.1.25" + "ts-loader": "^6.2.1", + "typescript": "^2.9.2", + "vscode": "^1.1.36", + "webpack": "^4.41.4", + "webpack-cli": "^3.3.10" }, "extensionDependencies": [ "mscgenjs.vscode-mscgen" diff --git a/previewseqdiag-vscode-0.2.2.vsix b/previewseqdiag-vscode-0.2.2.vsix new file mode 100644 index 0000000..8076f27 Binary files /dev/null and b/previewseqdiag-vscode-0.2.2.vsix differ diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..a76643b --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,41 @@ +//@ts-check + +'use strict'; + +const path = require('path'); + +/**@type {import('webpack').Configuration}*/ +const config = { + target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ + + entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ + output: { + // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ + path: path.resolve(__dirname, 'dist'), + filename: 'extension.js', + libraryTarget: 'commonjs2', + devtoolModuleFilenameTemplate: '../[resource-path]' + }, + devtool: 'source-map', + externals: { + vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ + }, + resolve: { + // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { + test: /\.ts$/, + exclude: /node_modules/, + use: [ + { + loader: 'ts-loader' + } + ] + } + ] + } +}; +module.exports = config; \ No newline at end of file