All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.butterfaces-dist-bundle-js.butterfaces-js-bundle.min.js Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
!function(){var t=!1,e=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(n){function i(){!t&&this.init&&this.init.apply(this,arguments)}var o=this.prototype;t=!0;var s=new this;t=!1;for(var r in n)s[r]="function"==typeof n[r]&&"function"==typeof o[r]&&e.test(n[r])?function(t,e){return function(){var n=this._super;this._super=o[t];var i=e.apply(this,arguments);return this._super=n,i}}(r,n[r]):n[r];return i.prototype=s,i.prototype.constructor=i,i.extend=arguments.callee,i}}(),function(t){t.fn._butterAutoCompleteInit=function(){return this.each(function(){new e(this)})};var e=Class.extend({init:function(e){this.SEARCH_REQUEST_DELAY=300;var n=t(e);this.$input=n.prev(),this.$input.parent().css({position:"relative"}),this.autocompleteId=n.attr("id"),this.$selectedOption=null,this.ignoreKeyupEvent=!1,this.requestDelayTimerId=null,this.isRequestRunning=!1,this.areChangesMadeWhileRequestWasRunning=!1,this._keyCodes={tab:9,enter:13,shift:16,ctrl:17,alt:18,pause:19,caps_lock:20,escape:27,page_up:33,page_down:34,end:35,home:36,arrow_left:37,arrow_up:38,arrow_right:39,arrow_down:40,insert:45,delete_key:46,left_window_key:91,right_window_key:92,select_key:93,num_lock:144,scroll_lock:145};var i=this;i.$input.on("keydown",function(t){t.which===i._keyCodes.enter?i._handleEnterKeyDown(t):t.which===i._keyCodes.arrow_up||t.which===i._keyCodes.arrow_down?i._handleArrowUpAndDownKeyDown(t):t.which===i._keyCodes.escape&&i._handleEscapeKeyDown(t)}).on("keyup",function(t){for(keyName in i._keyCodes)if(i._keyCodes[keyName]===t.which)return void i._stopEvent(t);return i.ignoreKeyupEvent?(i._stopEvent(t),void(i.ignoreKeyupEvent=!1)):0===i.$input.val().length?(i._stopEvent(t),void i._hideAutocompleteResultList()):void i._trySendJsfAjaxRequest()}).on("blur",function(t){window.setTimeout(function(){i._hideAutocompleteResultList()},100)})},_handleEnterKeyDown:function(t){null!==this.$selectedOption&&(this._stopEvent(t),this._setSelectedValue())},_handleArrowUpAndDownKeyDown:function(t){this._stopEvent(t);var e=this._getAutocompleteElement();!e.is(":visible")&&this.$input.val().length>0?this._trySendJsfAjaxRequest():e.is(":visible")&&e.find("li").length>0&&(null===this.$selectedOption?this._selectResultOptionElement(e.find("li")[0]):this._moveResultOptionElementSelectionCursor(e,t.which===this._keyCodes.arrow_up?-1:1))},_handleEscapeKeyDown:function(t){this._stopEvent(t),this._hideAutocompleteResultList()},_trySendJsfAjaxRequest:function(){var t=this;t.isRequestRunning&&(t.areChangesMadeWhileRequestWasRunning=!0),null!==t.requestDelayTimerId&&window.clearTimeout(t.requestDelayTimerId),t.requestDelayTimerId=window.setTimeout(function(){t.requestDelayTimerId=null,t._sendJsfAjaxRequest()},t.SEARCH_REQUEST_DELAY)},_sendJsfAjaxRequest:function(){var t=this;if(!t.isRequestRunning){t.isRequestRunning=!0,t.areChangesMadeWhileRequestWasRunning=!1,t._showLoadingSpinner();var e=t.$input.parent().parent().attr("id");jsf.ajax.request(e,"autocomplete",{"javax.faces.behavior.event":"autocomplete",render:t.autocompleteId,params:t.$input.val(),onevent:function(e){"success"===e.status&&(t.$input.is(":focus")&&t._handleAutocompleteResultListVisibility(),t._hideLoadingSpinner(),t.isRequestRunning=!1,t.areChangesMadeWhileRequestWasRunning&&t._sendJsfAjaxRequest())}})}},_handleAutocompleteResultListVisibility:function(){var t=this;t._getAutocompleteElement().find("li").length>0?t._initAndShowAutocompleteResultList():t._hideAutocompleteResultList()},_showLoadingSpinner:function(){t('
').appendTo(this.$input.parent())},_hideLoadingSpinner:function(){this.$input.parent().find(".butter-dropdownlist-spinner").remove()},_initAndShowAutocompleteResultList:function(){var t=this,e=t._getAutocompleteElement();e.show().css({width:t.$input.innerWidth()}).highlight(t.$input.val()),e.find("ul").on("mouseleave",function(){t._clearResultOptionSelection()}),e.find("li").on("mousedown",function(){t._setSelectedValue()}).on("mouseenter",function(){t._selectResultOptionElement(this)})},_selectResultOptionElement:function(e){this._clearResultOptionSelection();var n=t(e);n.addClass("butter-dropdownlist-resultItem-selected"),this.$selectedOption=n},_clearResultOptionSelection:function(){this.$selectedOption=null,this._getAutocompleteElement().find(".butter-dropdownlist-resultItem-selected").removeClass("butter-dropdownlist-resultItem-selected")},_moveResultOptionElementSelectionCursor:function(t,e){if(e>0){var n=this.$selectedOption.next();n.length>0?this._selectResultOptionElement(n[0]):this._selectResultOptionElement(t.find("li")[0])}else{var i=this.$selectedOption.prev();if(i.length>0)this._selectResultOptionElement(i[0]);else{var o=t.find("li");this._selectResultOptionElement(o[o.length-1])}}},_setSelectedValue:function(){null!==this.$selectedOption&&(this.ignoreKeyupEvent=!0,this.$input.val(this.$selectedOption.attr("data-select-value")).change().focus().keyup(),this._hideAutocompleteResultList())},_hideAutocompleteResultList:function(){null!==this.requestDelayTimerId&&window.clearTimeout(this.requestDelayTimerId),this.$selectedOption=null,this._getAutocompleteElement().hide()},_getAutocompleteElement:function(){return t(document.getElementById(this.autocompleteId))},_stopEvent:function(t){t.stopPropagation(),t.preventDefault()}})}(jQuery),function(t){t.fn.fixBootstrapDropDown=function(){return this.each(function(){t(".dropdown-menu").on("click",function(e){t(this).hasClass("dropdown-menu-form")&&e.stopPropagation()})})}}(jQuery),function(t){var e=function(){var t=0;return function(e,n){clearTimeout(t),t=setTimeout(e,n)}}();t.fn.butterItemFilterField=function(n){return this.each(function(){var i=t(this);i.keyup(function(){e(function(){var e,o=i.val();if(n)e=t(n);else{var s=i.attr("data-filterable-item-container");e=t(s)}e.find(".filterable-item").each(function(){var e=t(this);e.is(":containsIgnoreCase("+o+")")?(e.removeClass("hidden"),e.highlight(o)):e.addClass("hidden")})},300)})})}}(jQuery),function(t){t.expr[":"].containsIgnoreCase=t.expr.createPseudo(function(e){return function(n){return!e||t(n).text().toUpperCase().indexOf(e.toUpperCase())>=0}})}(jQuery),function(t){var e=null;t.fn.startDots=function(){return this.each(function(){var n=t(this);n.html(""),e=setInterval(function(){n.append("."),n.html().length>5&&n.html("")},200)})},t.fn.stopDots=function(){return this.each(function(){t(this).html(""),window.clearInterval(e)})}}(jQuery),function(t){t.fn.highlight=function(e){var n=new RegExp(e,"gi"),i=this.find("*");return this.each(function(){i.push(this),t(this).find(".search-highlighted").contents().unwrap(),this.normalize()}),i.each(function(){var i=t(this);e&&""!==e&&i.contents().filter(function(){return 3===this.nodeType&&n.test(this.nodeValue)}).replaceWith(function(){return(this.nodeValue||"").replace(n,function(t){return''+t+""})})})}}(jQuery),function(t){t.fn.markdownReadonly=function(){var e=t(this).find(".butter-component-value-readonly-wrapper"),n=e.html().replace("&","&").replace("<","<").replace(">",">"),i=(new showdown.Converter).makeHtml(n);e.empty(),e.append(i)}}(jQuery),"undefined"==typeof butter&&(butter={}),butter.modal={},butter.modal.open=function(t){$(".butter-modal[data-modal-id="+t+"]").modal({show:!0,keyboard:!1,backdrop:"static"})},butter.modal.close=function(t){$(".butter-modal[data-modal-id="+t+"]").modal("hide")},function(t){t.fn.butterNumberSpinner=function(t){return this.each(function(){new e(this,t)})};var e=Class.extend({init:function(e,n){this.$input=t(e).find("input"),this._initInput(),this._initOptions(n),this._counter=null,this.setCounter(0),this._isValueSet=!1,this._initButtons(),this._initArrowKeys(),this._initMouseWheel()},_initInput:function(){var t=this;this.$input.addClass("butter-component-number-input").blur(function(){t._setValueOnBlur()}).parent().addClass("input-group")},_initOptions:function(e){var n={step:1,disabled:!1};this._options=t.extend({},n,e),void 0!==this._options.step&&(this._options.step=1*this._options.step),void 0!==this._options.min&&(this._options.min=1*this._options.min),void 0!==this._options.max&&(this._options.max=1*this._options.max)},_initButtons:function(){var e=t("
").addClass("input-group-append").insertAfter(this.$input),n=t("").addClass("input-group-text").addClass("butter-component-number-buttons").appendTo(e),i=this;t("").addClass("glyphicon glyphicon-chevron-up").addClass("butter-component-number-button").addClass(function(){return i._options.disabled?"disabled":""}).click(function(){i._options.disabled||i.increaseCounter()}).appendTo(n),t("").addClass("glyphicon glyphicon-chevron-down").addClass("butter-component-number-button").addClass(function(){return i._options.disabled?"disabled":""}).click(function(){i._options.disabled||i.decreaseCounter()}).appendTo(n)},_initArrowKeys:function(){var t=this;this.$input.keydown(function(e){38===e.which?(e.stopPropagation(),e.preventDefault(),t.increaseCounter()):40===e.which&&(e.stopPropagation(),e.preventDefault(),t.decreaseCounter())})},_initMouseWheel:function(){var t=this;this.$input.on("mousewheel DOMMouseScroll",function(e){if(t.$input.is(":focus")){var n=e.originalEvent.wheelDelta||-e.originalEvent.deltaY||-e.originalEvent.detail;e.stopPropagation(),e.preventDefault(),n<0?t.decreaseCounter():t.increaseCounter()}})},_setValueOnBlur:function(){var t=this.$input.val();if(this._isStringEmpty(t))this.$input.val(""),this.setCounter(0),this._isValueSet=!1;else{var e=parseInt(t);isNaN(e)?this._isValueSet?this.$input.val(this._counter):(this.$input.val(""),this.setCounter(0),this._isValueSet=!1):(this.setCounter(e),this.$input.val(this._counter),this._isValueSet=!0)}},increaseCounter:function(){this._isValueSet?this.setCounter(this._counter+this._options.step):this._isValueSet=!0,this.$input.val(this._counter),this.$input.change()},decreaseCounter:function(){this._isValueSet?this.setCounter(this._counter-this._options.step):this._isValueSet=!0,this.$input.val(this._counter),this.$input.change()},_isStringEmpty:function(t){return 0===t.length||!t.trim()},setCounter:function(t){void 0!==this._options.min&&tthis._options.max?this._counter=this._options.max:this._counter=t}})}(jQuery),"undefined"==typeof butter&&(butter={}),butter.prettyprint={},butter.prettyprint.cleanup=function(){prettyPrint(),jQuery(".butter-component-prettyprint").each(function(){var t=jQuery(this).find("pre span").first(),e=jQuery(this).find("pre span").last();void 0!==t.html()&&(t.html().trim()||t.remove()),void 0!==e.html()&&(e.html().trim()||e.remove())})},function(t){t.fn.butterScrollToFirst=function(e){var n=void 0===e?t(this).first().offset().top:t(this).first().offset().top+e;t("html, body").animate({scrollTop:n+"px"},"fast")},t.fn.butterScrollToLast=function(e){var n=void 0===e?t(this).last().offset().top:t(this).last().offset().top+e;t("html, body").animate({scrollTop:n+"px"},"fast")}}(jQuery),function(t){t.fn.toggleColumnVisibilty=function(e,n){function i(e){var n=[];return e.find(".butter-table-toolbar-column-option input[type=checkbox]").each(function(e,i){var o=t(i).parent(".butter-table-toolbar-column-option");n.push({identifier:o.attr("data-column-model-identifier"),visible:o.find("input[type=checkbox]").is(":checked")})}),n}return this.each(function(){var o=t(this),s=JSON.stringify(i(o));ButterFaces.Ajax.sendRequest(o.attr("id"),"toggle",e,s,n)})},t.fn.orderColumn=function(e,n,i,o){function s(e){var n=[];return e.find(".butter-table-toolbar-column-option input[type=checkbox]").each(function(e,i){var o=t(i).parent(".butter-table-toolbar-column-option");n.push({identifier:o.attr("data-column-model-identifier"),position:e})}),n}function r(t,e){var n=t.find('li[data-original-column="'+e+'"]'),i=n.prev(),o=n.detach();i.before(o)}function u(t,e){var n=t.find('li[data-original-column="'+e+'"]'),i=n.next(),o=n.detach();i.after(o)}return this.each(function(){var a=t(this);i?r(a,o):u(a,o);var l=JSON.stringify(s(a));ButterFaces.Ajax.sendRequest(a.attr("id"),"order",e,l,n)})}}(jQuery),function(t){t.fn._butterTooltip=function(e){var n=t(this),i=jQuery("[name="+e.contentByName+"]"),o={trigger:e.trigger,title:e.title,placement:e.placement,placementFunction:e.placementFunction,minVerticalOffset:e.minVerticalOffset,minHorizontalOffset:e.minHorizontalOffset,content:i.html().trim()};i.remove(),n.butterTooltip(o)},t.fn.butterTooltip=function(e){return this.each(function(){var n=t(this),i=e.trigger?e.trigger:"hover";e.minVerticalOffset&&n.attr("data-tooltip-min-vertical-offset",e.minVerticalOffset),e.minHorizontalOffset&&n.attr("data-tooltip-min-horizontal-offset",e.minHorizontalOffset),n.next().hasClass("popover")&&n.next().remove(),n.popover({trigger:i,placement:function(t,n){return e.placement?e.placement:e.placementFunction?e.placementFunction:(new ButterFaces.Tooltip).calculateTooltipPosition(t,n)},title:e.title,html:!0,content:e.content,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gICAgICAgICAgICAgIHRoaXMuX3N1cGVyID0gX3N1cGVyW25hbWVdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIG1ldGhvZCBvbmx5IG5lZWQgdG8gYmUgYm91bmQgdGVtcG9yYXJpbHksIHNvIHdlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIGl0IHdoZW4gd2UncmUgZG9uZSBleGVjdXRpbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmV0ID0gZm4uYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9zdXBlciA9IHRtcDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9KShuYW1lLCBwcm9wW25hbWVdKSA6XG4gICAgICAgICAgICAgICAgICAgIHByb3BbbmFtZV07XG4gICAgICAgIH1cblxuICAgICAgICAvLyBUaGUgZHVtbXkgY2xhc3MgY29uc3RydWN0b3JcbiAgICAgICAgZnVuY3Rpb24gQ2xhc3MoKSB7XG4gICAgICAgICAgICAvLyBBbGwgY29uc3RydWN0aW9uIGlzIGFjdHVhbGx5IGRvbmUgaW4gdGhlIGluaXQgbWV0aG9kXG4gICAgICAgICAgICBpZiAoICFpbml0aWFsaXppbmcgJiYgdGhpcy5pbml0IClcbiAgICAgICAgICAgICAgICB0aGlzLmluaXQuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFBvcHVsYXRlIG91ciBjb25zdHJ1Y3RlZCBwcm90b3R5cGUgb2JqZWN0XG4gICAgICAgIENsYXNzLnByb3RvdHlwZSA9IHByb3RvdHlwZTtcblxuICAgICAgICAvLyBFbmZvcmNlIHRoZSBjb25zdHJ1Y3RvciB0byBiZSB3aGF0IHdlIGV4cGVjdF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DI3LFxuICAgICAgICAgICAgICAgIHBhZ2VfdXA6IDMzLFxuICAgICAgICAgICAgICAgIHBhZ2VfZG93bjogMzQsXG4gICAgICAgICAgICAgICAgZW5kOiAzNSxcbiAgICAgICAgICAgICAgICBob21lOiAzNixcbiAgICAgICAgICAgICAgICBhcnJvd19sZWZ0OiAzNyxcbiAgICAgICAgICAgICAgICBhcnJvd191cDogMzgsXG4gICAgICAgICAgICAgICAgYXJyb3dfcmlnaHQ6IDM5LFxuICAgICAgICAgICAgICAgIGFycm93X2Rvd246IDQwLFxuICAgICAgICAgICAgICAgIGluc2VydDogNDUsXG4gICAgICAgICAgICAgICAgLy8gJ2RlbGV0ZScgaXMgYSByZXNlcnZlZCBrZXkgd29yZFxuICAgICAgICAgICAgICAgIGRlbGV0ZV9rZXk6IDQ2LFxuICAgICAgICAgICAgICAgIGxlZnRfd2luZG93X2tleTogOTEsXG4gICAgICAgICAgICAgICAgcmlnaHRfd2luZG93X2tleTogOTIsXG4gICAgICAgICAgICAgICAgc2VsZWN0X2tleTogOTMsXG4gICAgICAgICAgICAgICAgbnVtX2xvY2s6IDE0NCxcbiAgICAgICAgICAgICAgICBzY3JvbGxfbG9jazogMTQ1XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICBzZWxmLiRpbnB1dFxuICAgICAgICAgICAgICAgICAgICAub24oXCJrZXlkb3duXCIsIGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50LndoaWNoID09PSBzZWxmLl9rZXlDb2Rlcy5lbnRlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2hhbmRsZUVudGVyS2V5RG93bihldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LndoaWNoID09PSBzZWxmLl9rZXlDb2Rlcy5hcnJvd191cFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBldmVudC53aGljaCA9PT0gc2VsZi5fa2V5Q29kZXMuYXJyb3dfZG93bikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2hhbmRsZUFycm93VXBBbmREb3duS2V5RG93bihldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LndoaWNoID09PSBzZWxmLl9rZXlDb2Rlcy5lc2NhcGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9oYW5kbGVFc2NhcGVLZXlEb3duKGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLm9uKFwia2V5dXBcIiwgZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCBoYW5kbGUgb3RoZXIga2V5cyB0aGFuIGNoYXJhY3RlciBrZXlzXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGtleU5hbWUgaW4gc2VsZi5fa2V5Q29kZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5fa2V5Q29kZXNba2V5TmFtZV0gPT09IGV2ZW50LndoaWNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX3N0b3BFdmVudChldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLmlnbm9yZUtleXVwRXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9zdG9wRXZlbnQoZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuaWdub3JlS2V5dXBFdmVudCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuJGlucHV0LnZhbCgpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX3N0b3BFdmVudChldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGlkZUF1dG9jb21wbGV0ZVJlc3VsdExpc3QoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX3RyeVNlbmRKc2ZBamF4UmVxdWVzdCgpO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAub24oXCJibHVyXCIsIGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LnNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2hpZGVBdXRvY29tcGxldGVSZXN1bHRMaXN0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDApO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaGFuZGxlRW50ZXJLZXlEb3duOiBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLiRzZWxlY3RlZE9wdGlvbiAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3N0b3BFdmVudChldmVudCk7XG4gICAgICAgICAgICAgICAgdGhpcy5fc2V0U2VsZWN0ZWRWYWx1ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9oYW5kbGVBcnJvd1VwQW5kRG93bktleURvd246IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgdGhpcy5fc3RvcEV2ZW50KGV2ZW50KTtcbiAgICAgICAgICAgIHZhciAkYXV0b2NvbXBsZXRlID0gdGhpcy5fZ2V0QXV0b2NvbXBsZXRlRWxlbWVudCgpO1xuICAgICAgICAgICAgaWYgKCEkYXV0b2NvbXBsZXRlLmlzKFwiOnZpc2libGVcIikgJiYgdGhpcy4kaW5wdXQudmFsKCkubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3RyeVNlbmRKc2ZBamF4UmVxdWVzdCgpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgkYXV0b2NvbXBsZXRlLmlzKFwiOnZpc2libGVcIikgJiYgJGF1dG9jb21wbGV0ZS5maW5kKFwibGlcIikubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLiRzZWxlY3RlZE9wdGlvbiA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3RSZXN1bHRPcHRpb25FbGVtZW50KCRhdXRvY29tcGxldGUuZmluZChcImxpXCIpWzBdKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9tb3ZlUmVzdWx0T3B0aW9uRWxlbWVudFNlbGVjdGlvbkN1cnNvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYXV0b2NvbXBsZXRlLCBldmVudC53aGljaCA9PT0gdGhpcy5fa2V5Q29kZXMuYXJyb3dfdXAgPyAtMSA6IDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBfaGFuZGxlRXNjYXBlS2V5RG93bjogZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICB0aGlzLl9zdG9wRXZlbnQoZXZlbnQpO1xuICAgICAgICAgICAgdGhpcy5faGlkZUF1dG9jb21wbG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gICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwicmVxdWVzdCBpcyBydW5uaW5nLCBhYm9ydFwiKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzZWxmLmlzUmVxdWVzdFJ1bm5pbmcgPSB0cnVlO1xuXG4gICAgICAgICAgICBzZWxmLmFyZUNoYW5nZXNNYWRlV2hpbGVSZXF1ZXN0V2FzUnVubmluZyA9IGZhbHNlO1xuICAgICAgICAgICAgc2VsZi5fc2hvd0xvYWRpbmdTcGlubmVyKCk7XG5cbiAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwic3RhcnRpbmcgcmVxdWVzdFwiKTtcblxuICAgICAgICAgICAgdmFyIGlkID0gc2VsZi4kaW5wdXQucGFyZW50KCkucGFyZW50KCkuYXR0cignaWQnKTtcblxuICAgICAgICAgICAganNmLmFqYXgucmVxdWVzdChpZCwgXCJhdXRvY29tcGxldGVcIiwge1xuICAgICAgICAgICAgICAgIFwiamF2YXguZmFjZXMuYmVoYXZpb3IuZXZlbnRcIjogXCJhdXRvY29tcGxldGVcIixcbiAgICAgICAgICAgICAgICByZW5kZXI6IHNlbGYuYXV0b2NvbXBsZXRlSWQsXG4gICAgICAgICAgICAgICAgcGFyYW1zOiBzZWxmLiRpbnB1dC52YWwoKSxcbiAgICAgICAgICAgICAgICBvbmV2ZW50OiBmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YS5zdGF0dXMgPT09IFwic3VjY2Vzc1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcInJlcXVlc3QgZmluaXNoZWRcIik7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgc2hvdyByZXN1bHQgaWYgaW5wdXQgZmllbGQgc3RpbGwgaGFzIGZvY3VzXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi4kaW5wdXQuaXMoXCI6Zm9jdXNcIikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9oYW5kbGVBdXRvY29tcGxldGVSZXN1bHRMaXN0VmlzaWJpbGl0eSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGlkZUxvYWRpbmdTcGlubmVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmlzUmVxdWVzdFJ1bm5pbmcgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuYXJlQ2hhbmdlc01hZGVXaGlsZVJlcXVlc3RXYXNSdW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJjaGFuZ2VzIG1hZGUgd2hpbGUgcmVxdWVzdCB3YXMgcnVubmluZywgc3RhcnQgbmV3IHJlcXVlc3QgYXV0b21hdGljYWxseVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9zZW5kSnNmQWpheFJlcXVlc3QoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9oYW5kbGVBdXRvY29tcGxldGVSZXN1bHRMaXN0VmlzaWJpbGl0eTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdmFyICRhdXRvY29tcGxldGUgPSBzZWxmLl9nZXRBdXRvY29tcGxldGVFbGVtZW50KCk7XG5cbiAgICAgICAgICAgIGlmICgkYXV0b2NvbXBsZXRlLmZpbmQoXCJsaVwiKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5faW5pdEFuZFNob3dBdXRvY29tcGxldGVSZXN1bHRMaXN0KCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNlbGYuX2hpZGVBdXRvY29tcGxldGVSZXN1bHRMaXN0KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgX3Nob3dMb2FkaW5nU3Bpbm5lcjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgJCgnPGRpdiBjbGFzcz1cImJ1dHRlci1kcm9wZG93bmxpc3Qtc3Bpbm5lci1jb250YWluZXJcIj48ZGl2IGNsYXNzPVwiYnV0dGVyLWRyb3Bkb3dubGlzdC1zcGlubmVyXCI+PC9kaXY+PC9kaXY+JylcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZFRvKHRoaXMuJGlucHV0LnBhcmVudCgpKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaGlkZUxvYWRpbmdTcGlubmVyOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC5wYXJlbnQoKS5maW5kKFwiLmJ1dHRlci1kcm9wZG93bmxpc3Qtc3Bpbm5lclwiKS5yZW1vdmUoKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaW5pdEFuZFNob3dBdXRvY29tcGxldGVSZXN1bHRMaXN0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgJGF1dG9jb21wbGV0ZSA9IHNlbGYuX2dldEF1dG9jb21wbGV0ZUVsZW1lbnQoKTtcbiAgICAgICAgICAgICRhdXRvY29tcGxldGVcbiAgICAgICAgICAgICAgICAgICAgLnNob3coKVxuICAgICAgICAgICAgICAgICAgICAuY3NzKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBzZWxmLiRpbnB1dC5pbm5lcldpZHRoKClcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmhpZ2hsaWdodChzZWxmLiRpbnB1dC52YWwoKSk7XG5cbiAgICAgICAgICAgICRhdXRvY29tcGxldGUuZmluZChcInVsXCIpXG4gICAgICAgICAgICAgICAgICAgIC5vbihcIm1vdXNlbGVhdmVcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fY2xlYXJSZXN1bHRPcHRpb25TZWxlY3Rpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICRhdXRvY29tcGxldGUuZmluZChcImxpXCIpXG4gICAgICAgICAgICAgICAgICAgIC5vbihcIm1vdXNlZG93blwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9zZXRTZWxlY3RlZFZhbHVlKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5vbihcIm1vdXNlZW50ZXJcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fc2VsZWN0UmVzdWx0T3B0aW9uRWxlbWVudCh0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQ6IGZ1bmN0aW9uIChvcHRpb25FbGVtZW50KSB7XG4gICAgICAgICAgICB0aGlzLl9jbGVhclJlc3VsdE9wdGlvblNlbGVjdGlvbigpO1xuICAgICAgICAgICAgdmFyICRzZWxlY3RlZE9wdGlvbkVsZW1lbnQgPSAkKG9wdGlvbkVsZW1lbnQpO1xuICAgICAgICAgICAgJHNlbGVjdGVkT3B0aW9uRWxlbWVudC5hZGRDbGFzcyhcImJ1dHRlci1kcm9wZG93bmxpc3QtcmVzdWx0SXRlbS1zZWxlY3RlZFwiKTtcbiAgICAgICAgICAgIHRoaXMuJHNlbGVjdGVkT3B0aW9uID0gJHNlbGVjdGVkT3B0aW9uRWxlbWVudDtcbiAgICAgICAgfSxcblxuICAgICAgICBfY2xlYXJSZXN1bHRPcHRpb25TZWxlY3Rpb246IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHRoaXMuJHNlbGVjdGVkT3B0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIHRoaXMuX2dldEF1dG9jb21wbGV0ZUVsZW1lbnQoKVxuICAgICAgICAgICAgICAgICAgICAuZmluZChcIi5idXR0ZXItZHJvcGRvd25saXN0LXJlc3VsdEl0ZW0tc2VsZWN0ZWRcIilcbiAgICAgICAgICAgICAgICAgICAgLnJlbW92ZUNsYXNzKFwiYnV0dGVyLWRyb3Bkb3dubGlzdC1yZXN1bHRJdGVtLXNlbGVjdGVkXCIpO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9tb3ZlUmVzdWx0T3B0aW9uRWxlbWVudFNlbGVjdGlvbkN1cnNvcjogZnVuY3Rpb24gKCRhdXRvY29tcGxldGUsIGRpcmVjdGlvbikge1xuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiA+IDApIHtcbiAgICAgICAgICAgICAgICB2YXIgJG5leHQgPSB0aGlzLiRzZWxlY3RlZE9wdGlvbi5uZXh0KCk7XG4gICAgICAgICAgICAgICAgaWYgKCRuZXh0Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VsZWN0UmVzdWx0T3B0aW9uRWxlbWVudCgkbmV4dFswXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy90aGVyZSBpcyBubyBuZXh0XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQoJGF1dG9jb21wbGV0ZS5maW5kKFwibGlcIilbMF0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyICRwcmV2ID0gdGhpcy4kc2VsZWN0ZWRPcHRpb24ucHJldigpO1xuICAgICAgICAgICAgICAgIGlmICgkcHJldi5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQoJHByZXZbMF0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vdGhlcmUgaXMgbm8gcHJldmlvdXNcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdExpc3RPcHRpb25zID0gJGF1dG9jb21wbGV0ZS5maW5kKFwibGlcIik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQocmVzdWx0TGlzdE9wdGlvbnNbcmVzdWx0TGlzdE9wdGlvbnMubGVuZ3RoIC0gMV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBfc2V0U2VsZWN0ZWRWYWx1ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuJHNlbGVjdGVkT3B0aW9uICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5pZ25vcmVLZXl1cEV2ZW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLiRpbnB1dFxuICAgICAgICAgICAgICAgICAgICAgICAgLnZhbCh0aGlzLiRzZWxlY3RlZE9wdGlvbi5hdHRyKFwiZGF0YS1zZWxlY3QtdmFsdWVcIikpXG4gICAgICAgICAgICAgICAgICAgICAgICAuY2hhbmdlKClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5mb2N1cygpXG4gICAgICAgICAgICAgICAgICAgICAgICAua2V5dXAoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9oaWRlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9oaWRlQXV0b2NvbXBsZXRlUmVzdWx0TGl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CdkYXRhLWZpbHRlcmFibGUtaXRlbS1jb250YWluZXInKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICRmaWx0ZXJhYmxlSXRlbUNvbnRhaW5lciA9ICQoY29udGFpbmVyU2VsZWN0b3IpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgJGZpbHRlcmFibGVJdGVtQ29udGFpbmVyLmZpbmQoJy5maWx0ZXJhYmxlLWl0ZW0nKS5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciAkZmlsdGVyYWJsZUl0ZW0gPSAkKHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRmaWx0ZXJhYmxlSXRlbS5pcygnOmNvbnRhaW5zSWdub3JlQ2FzZSgnICsgZmlsdGVyVmFsdWUgKyAnKScpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGZpbHRlcmFibGVJdGVtLnJlbW92ZUNsYXNzKFwiaGlkZGVuXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRmaWx0ZXJhYmxlSXRlbS5oaWdobGlnaHQoZmlsdGVyVmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZmlsdGVyYWJsZUl0ZW0uYWRkQ2xhc3MoXCJoaWRkZW5cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSwgMzAwKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xufShqUXVlcnkpKTtcblxuKGZ1bmN0aW9uICgkKSB7XG4gICAgJC5leHByW1wiOlwiXS5jb250YWluc0lnbm9yZUNhc2UgPSAkLmV4cHIuY3JlYXRlUHNldWRvKGZ1bmN0aW9uIChhcmcpIHtcbiAgICAgICAgcmV0dXJuI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uJyArIGhpZ2hsaWdodENsYXNzTmFtZSkuY29udGVudHMoKS51bndyYXAoKTtcbiAgICAgICAgICAgIHRoaXMubm9ybWFsaXplKCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBlbGVtZW50cy5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAkdGhpcyA9ICQodGhpcyk7XG5cbiAgICAgICAgICAgIGlmIChzZWFyY2hTdHJpbmcgJiYgc2VhcmNoU3RyaW5nICE9PSAnJykge1xuICAgICAgICAgICAgICAgICR0aGlzLmNvbnRlbnRzKClcbiAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5ub2RlVHlwZSA9PT0gMyAmJiByZWdleC50ZXN0KHRoaXMubm9kZVZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2VXaXRoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAodGhpcy5ub2RlVmFsdWUgfHwgXCJcIikucmVwbGFjZShyZWdleCwgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwiPHNwYW4gY2xhc3M9XFxcIlwiICsgaGlnaGxpZ2h0Q2xhc3NOYW1lICsgXCJcXFwiPlwiICsgbWF0Y2ggKyBcIjwvc3Bhbj5cIjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbn0oalF1ZXJ5KSk7IiwiKGZ1bmN0aW9uICgkKSB7XG4gICAgLy8gZXh0ZW5kIGpRdWVyeSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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0tLS0tLS0tLS0tLS0tLS0tLS1cbiAgICB2YXIgTnVtYmVyU3Bpbm5lciA9IENsYXNzLmV4dGVuZCh7XG4gICAgICAgIGluaXQ6IGZ1bmN0aW9uIChlbGVtZW50LCBvcHRpb25zKSB7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dCA9ICQoZWxlbWVudCkuZmluZChcImlucHV0XCIpO1xuICAgICAgICAgICAgdGhpcy5faW5pdElucHV0KCk7XG4gICAgICAgICAgICB0aGlzLl9pbml0T3B0aW9ucyhvcHRpb25zKTtcbiAgICAgICAgICAgIHRoaXMuX2NvdW50ZXIgPSBudWxsO1xuICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKDApO1xuICAgICAgICAgICAgdGhpcy5faXNWYWx1ZVNldCA9IGZhbHNlO1xuICAgICAgICAgICAgdGhpcy5faW5pdEJ1dHRvbnMoKTtcbiAgICAgICAgICAgIHRoaXMuX2luaXRBcnJvd0tleXMoKTtcbiAgICAgICAgICAgIHRoaXMuX2luaXRNb3VzZVdoZWVsKCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2luaXRJbnB1dDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdGhpcy4kaW5wdXRcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJidXR0ZXItY29tcG9uZW50LW51bWJlci1pbnB1dFwiKVxuICAgICAgICAgICAgICAgIC5ibHVyKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5fc2V0VmFsdWVPbkJsdXIoKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5wYXJlbnQoKS5hZGRDbGFzcyhcImlucHV0LWdyb3VwXCIpO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0T3B0aW9uczogZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgICAgIHZhciBkZWZhdWx0T3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgICBzdGVwOiAxLFxuICAgICAgICAgICAgICAgIGRpc2FibGVkOiBmYWxzZVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRoaXMuX29wdGlvbnMgPSAkLmV4dGVuZCh7fSwgZGVmYXVsdE9wdGlvbnMsIG9wdGlvbnMpO1xuXG4gICAgICAgICAgICAvLyBlbnN1cmUgdGhhdCB0aGlzIHZhbHVlcyBhcmUgbnVtYmVyc1xuICAgICAgICAgICAgaWYgKHRoaXMuX29wdGlvbnMuc3RlcCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fb3B0aW9ucy5zdGVwID0gdGhpcy5fb3B0aW9ucy5zdGVwICogMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLl9vcHRpb25zLm1pbiAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fb3B0aW9ucy5taW4gPSB0aGlzLl9vcHRpb25zLm1pbiAqIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGhpcy5fb3B0aW9ucy5tYXggIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX29wdGlvbnMubWF4ID0gdGhpcy5fb3B0aW9ucy5tYXggKiAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0QnV0dG9uczogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyICRvdXRlckFkZG9uID0gJChcIjxkaXY+XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiaW5wdXQtZ3JvdXAtYXBwZW5kXCIpXG4gICAgICAgICAgICAgICAgLmluc2VydEFmdGVyKHRoaXMuJGlucHV0KTtcblxuICAgICAgICAgICAgdmFyICRhZGRvbiA9ICQoXCI8c3Bhbj5cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJpbnB1dC1ncm91cC10ZXh0XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYnV0dGVyLWNvbXBvbmVudC1udW1iZXItYnV0dG9uc1wiKVxuICAgICAgICAgICAgICAgIC5hcHBlbmRUbygkb3V0ZXJBZGRvbik7XG5cbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgICQoXCI8c3Bhbj5cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJnbHlwaGljb24gZ2x5cGhpY29uLWNoZXZyb24tdXBcIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJidXR0ZXItY29tcG9uZW50LW51bWJlci1idXR0b25cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZi5fb3B0aW9ucy5kaXNhYmxlZCA/IFwiZGlzYWJsZWRcIiA6IFwiXCI7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2xpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXNlbGYuX29wdGlvbnMuZGlzYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuaW5jcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5hcHBlbmRUbygkYWRkb24pO1xuXG4gICAgICAgICAgICAkKFwiPHNwYW4+XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiZ2x5cGhpY29uIGdseXBoaWNvbi1jaGV2cm9uLWRvd25cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJidXR0ZXItY29tcG9uZW50LW51bWJlci1idXR0b25cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZi5fb3B0aW9ucy5kaXNhYmxlZCA/IFwiZGlzYWJsZWRcIiA6IFwiXCI7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2xpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXNlbGYuX29wdGlvbnMuZGlzYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZGVjcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5hcHBlbmRUbygkYWRkb24pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0QXJyb3dLZXlzOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC5rZXlkb3duKGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgIGlmIChldmVudC53aGljaCA9PT0gMzgpIHtcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuaW5jcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC53aGljaCA9PT0gNDApIHtcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuZGVjcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2luaXRNb3VzZVdoZWVsOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC5vbihcIm1vdXNld2hlZWwgRE9NTW91c2VTY3JvbGxcIiwgZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFzZWxmLiRpbnB1dC5pcygnOmZvY3VzJykpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IGV2ZW50Lm9yaWdpbmFsRXZlbnQud2hlZWxEZWx0YSB8fCAtZXZlbnQub3JpZ2luYWxFdmVudC5kZWx0YVkgfHwgLWV2ZW50Lm9yaWdpbmFsRXZlbnQuZGV0YWlsO1xuXG4gICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICAgICAgICAgIGlmIChkZWx0YSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5kZWNyZWFzZUNvdW50ZXIoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmluY3JlYXNlQ291bnRlcigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9zZXRWYWx1ZU9uQmx1cjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gdGhpcy4kaW5wdXQudmFsKCk7XG4gICAgICAgICAgICBpZiAodGhpcy5faXNTdHJpbmdFbXB0eSh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRpbnB1dC52YWwoXCJcIik7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKDApO1xuICAgICAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSBmYWxzZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhcnNlZEludCA9IHBhcnNlSW50KHZhbHVlKTtcbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4ocGFyc2VkSW50KSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5faXNWYWx1ZVNldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy4kaW5wdXQudmFsKHRoaXMuX2NvdW50ZXIpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy4kaW5wdXQudmFsKFwiXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5faXNWYWx1ZVNldCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKHBhcnNlZEludCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGlucHV0LnZhbCh0aGlzLl9jb3VudGVyKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5faXNWYWx1ZVNldCA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIGluY3JlYXNlQ291bnRlcjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuX2lzVmFsdWVTZXQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNldENvdW50ZXIodGhpcy5fY291bnRlciArIHRoaXMuX29wdGlvbnMuc3RlcCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy4kaW5wdXQudmFsKHRoaXMuX2NvdW50ZXIpO1xuICAgICAgICAgICAgdGhpcy4kaW5wdXQuY2hhbmdlKCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZGVjcmVhc2VDb3VudGVyOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5faXNWYWx1ZVNldCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0Q291bnRlcih0aGlzLl9jb3VudGVyIC0gdGhpcy5fb3B0aW9ucy5zdGVwKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5faXNWYWx1ZVNldCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC52YWwodGhpcy5fY291bnRlcik7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC5jaGFuZ2UoKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaXNTdHJpbmdFbXB0eTogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICByZXR1cm4gKHZhbHVlLmxlbmd0aCA9PT0gMCB8fCAhdmFsdWUudHJpbSgpKTtcbiAgICAgICAgfSxcblxuICAgICAgICBzZXRDb3VudGVyOiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLl9vcHRpb25zLm1pbiAhPT0gdW5kZWZpbmVkICYmIHZhbHVlIDwgdGhpcy5fb3B0aW9ucy5taW4pIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9jb3VudGVyID0gdGhpcy5fb3B0aW9ucy5taW47XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX29wdGlvbnMubWF4ICE9PSB1bmRlZmluZWQgJiYgdmFsdWUgPiB0aGlzLl9vcHRpb25zLm1heCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2NvdW50ZXIgPSB0aGlzLl9vcHRpb25zLm1heDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fY291bnRlciA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSk7XG59KGpRdWVyeSkpOyIsImlmICh0eXBlb2YgYnV0dGVyID09PSAndW5kZWZpbmVkJykge1xuICAgIGJ1dHRlciA9IHt9O1xufVxuYnV0dGVyLnByZXR0eXByaW50ID0ge307XG5cbi8qKlxuICogY2FsbHMgcHJldHR5IHByaW50IGphdmFzY3JpcHQgZnJhbWV3b3JrIGFuZCByZW1vdmVzIGZpcnN0IGFuZCBsYXN0IGVtcHR5IGNoaWxkcmVuLlxuICovXG5idXR0ZXIucHJldHR5cHJpbnQuY2xlYW51cCA9IGZ1bmN0aW9uKCkge1xuICAgIHByZXR0eVByaW50KCk7XG5cbiAgICBqUXVlcnkoJy5idXR0ZXItY29tcG9uZW50LXByZXR0eXByaW50JykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkZmlyc3RQcmVDaGlsZCA9IGpRdWVyeSh0aGlzKS5maW5kKFwicHJlIHNwYW5cIikuZmlyc3QoKTtcbiAgICAgICAgdmFyICRsYXN0UHJlQ2hpbGQgPSBqUXVlcnkodGhpcykuZmluZChcInByZSBzcGFuXCIpLmxhc3QoKTtcblxuXG4gICAgICAgIGlmICghKHR5cGVvZiAkZmlyc3RQcmVDaGlsZC5odG1sKCkgPT09IFwidW5kZWZpbmVkXCIpKSB7XG4gICAgICAgICAgICBpZiAoISRmaXJzdFByZUNoaWxkLmh0bWwoKS50cmltKCkpIHtcbiAgICAgICAgICAgICAgICAkZmlyc3RQcmVDaGlsZC5yZW1vdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoISh0eXBlb2YgJGxhc3RQcmVDaGlsZC5odG1sKCkgPT09IFwidW5kZWZpbmVkXCIpKSB7XG4gICAgICAgICAgICBpZiAoISRsYXN0UHJlQ2hpbGQuaHRtbCgpLnRyaW0oKSkge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bGJhcikge1xuICAgICAgICAgICAgdmFyIGNvbHVtbnMgPSBbXTtcblxuICAgICAgICAgICAgJHRvb2xiYXIuZmluZCgnLmJ1dHRlci10YWJsZS10b29sYmFyLWNvbHVtbi1vcHRpb24gaW5wdXRbdHlwZT1jaGVja2JveF0nKS5lYWNoKGZ1bmN0aW9uIChpbmRleCwgY2hlY2tib3gpIHtcbiAgICAgICAgICAgICAgICB2YXIgJGNoZWNrYm94ID0gJChjaGVja2JveCkucGFyZW50KCcuYnV0dGVyLXRhYmxlLXRvb2xiYXItY29sdW1uLW9wdGlvbicpO1xuICAgICAgICAgICAgICAgIGNvbHVtbnMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGlkZW50aWZpZXI6ICRjaGVja2JveC5hdHRyKCdkYXRhLWNvbHVtbi1tb2RlbC1pZGVudGlmaWVyJyksXG4gICAgICAgICAgICAgICAgICAgIHZpc2libGU6ICRjaGVja2JveC5maW5kKCdpbnB1dFt0eXBlPWNoZWNrYm94XScpLmlzKCc6Y2hlY2tlZCcpXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIGNvbHVtbnM7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgJC5mbi5vcmRlckNvbHVtbiA9IGZ1bmN0aW9uIChyZW5kZXJJZHMsIGRpc2FibGVSZW5kZXJJZHMsIHRvTGVmdCwgY29sdW1uTnVtYmVyKSB7XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgJHRvb2xiYXIgPSAkKHRoaXMpO1xuXG4gICAgICAgICAgICBpZiAodG9MZWZ0KSB7XG4gICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZygnb3JkZXIgY29sdW1uICcgKyBjb2x1bW5OdW1iZXIgKyAnIHRvIGxlZnQnKTtcbiAgICAgICAgICAgICAgICBvcmRlckNvbHVtbkxlZnQoJHRvb2xiYXIsIGNvbHVtbk51bWJlcik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ29yZGVyIGNvbHVtbiAnICsgY29sdW1uTnVtYmVyICsgJyB0byByaWdodCcpO1xuICAgICAgICAgICAgICAgIG9yZGVyQ29sdW1uUmlnaHQoJHRvb2xiYXIsIGNvbHVtbk51bWJlcik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBqc29uID0gSlNPTi5zdHJpbmdpZnkoY3JlYXRlQ29sdW1uT3JkZXIoJHRvb2xiYXIpKTtcbiAgICAgICAgICAgIEJ1dHRlckZhY2VzLkFqYXguc2VuZFJlcXVlc3QoJHRvb2xiYXIuYXR0cignaWQnKSwgJ29yZGVyJywgcmVuZGVySWRzLCBqc29uLCBkaXNhYmxlUmVuZGVySWRzKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgZnVuY3Rpb24gY3JlYXRlQ29sdW1uT3JkZXIoJHRvb2xiYXIpIHtcbiAgICAgICAgICAgIHZhciBjb2x1bW5zID0gW107XG5cbiAgICAgICAgICAgICR0b29sYmFyLmZpbmQoJy5idXR0ZXItdGFibGUtdG9vbGJhci1jb2x1bW4tb3B0aW9uIGlucHV0W3R5cGU9Y2hlY2tib3hdJykuZWFjaChmdW5jdGlvbiAoaW5kZXgsIGNoZWNrYm94KSB7XG4gICAgICAgICAgICAgICAgdmFyICRjaGVja2JveCA9ICQoY2hlY2tib3gpLnBhcmVudCgnLmJ1dHRlci10YWJsZS10b29sYmFyLWNvbHVtbi1vcHRpb24nKTtcbiAgICAgICAgICAgICAgICBjb2x1bW5zLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBpZGVudGlmaWVyOiAkY2hlY2tib3guYXR0cignZGF0YS1jb2x1bW4tbW9kZWwtaWRlbnRpZmllcicpLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogaW5kZXhcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gY29sdW1ucztcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIG9yZGVyQ29sdW1uTGVmdCgvKiBqcXVlcnkgdG9vbGJhciAqLyAkdG9vbGJhciwgY29sdW1uTnVtYmVyKSB7XG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKCR0b29sYmFyKTtcblxuICAgICAgICAgICAgdmFyICRjb2x1bW4gPSAkdG9vbGJhci5maW5kKCdsaVtkYXRhLW9yaWdpbmFsLWNvbHVtbj1cIicgKyBjb2x1bW5OdW1iZXIgKyAnXCJdJyk7XG4gICAgICAgICAgICB2YXIgJG5leHRDb2x1bW4gPSAkY29sdW1uLnByZXYoKTtcblxuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygkY29sdW1uKTtcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJG5leHRDb2x1bW4pO1xuXG4gICAgICAgICAgICB2YXIgJGRldGFjaHRlZENvbHVtbiA9ICRjb2x1bW4uZGV0YWNoKCk7XG4gICAgICAgICAgICAkbmV4dENvbHVtbi5iZWZvcmUoJGRldGFjaHRlZENvbHVtbik7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBvcmRlckNvbHVtblJpZ2h0KC8qIGpxdWVyeSB0b29sYmFyICovICR0b29sYmFyLCBjb2x1bW5OdW1iZXIpIHtcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJHRvb2xiYXIpO1xuXG4gICAgICAgICAgICB2YXIgJGNvbHVtbiA9ICR0b29sYmFyLmZpbmQoJ2xpW2RhdGEtb3JpZ2luYWwtY29sdW1uPVwiJyArIGNvbHVtbk51bWJlciArICdcIl0nKTtcbiAgICAgICAgICAgIHZhciAkbmV4dENvbHVtbiA9ICRjb2x1bW4ubmV4dCgpO1xuXG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKCRjb2x1bW4pO1xuICAgICAgICAgICAgLy9jb25zb2xlLmxvZ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AkLmZuLmJ1dHRlclRvb2x0aXAgPSBmdW5jdGlvbiAoLyogb2JqZWN0ICovIGRhdGEpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgcm9vdCA9ICQodGhpcyk7XG4gICAgICAgICAgICB2YXIgdHJpZ2dlciA9IGRhdGEudHJpZ2dlciA/IGRhdGEudHJpZ2dlciA6ICdob3Zlcic7XG5cbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coZGF0YSk7XG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKCdwbGFjZW1lbnQ6ICcgKyBwbGFjZW1lbnQpO1xuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygndHJpZ2dlcjogJyArIHRyaWdnZXIpO1xuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygndmlld3BvcnQ6ICcgKyBkYXRhLnZpZXdwb3J0KTtcblxuICAgICAgICAgICAgaWYgKGRhdGEubWluVmVydGljYWxPZmZzZXQpIHtcbiAgICAgICAgICAgICAgICByb290LmF0dHIoJ2RhdGEtdG9vbHRpcC1taW4tdmVydGljYWwtb2Zmc2V0JywgZGF0YS5taW5WZXJ0aWNhbE9mZnNldCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZGF0YS5taW5Ib3Jpem9udGFsT2Zmc2V0KSB7XG4gICAgICAgICAgICAgICAgcm9vdC5hdHRyKCdkYXRhLXRvb2x0aXAtbWluLWhvcml6b250YWwtb2Zmc2V0JywgZGF0YS5taW5Ib3Jpem9udGFsT2Zmc2V0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChyb290Lm5leHQoKS5oYXNDbGFzcygncG9wb3ZlcicpKSB7XG4gICAgICAgICAgICAgICAgcm9vdC5uZXh0KCkucmVtb3ZlKCk7XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgcm9vdC5wb3BvdmVyKHtcbiAgICAgICAgICAgICAgICB0cmlnZ2VyOiB0cmlnZ2VyLFxuICAgICAgICAgICAgICAgIHBsYWNlbWVudDogZnVuY3Rpb24ocG9wb3Zlciwgc291cmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXRhLnBsYWNlbWVudCA/IGRhdGEucGxhY2VtZW50IDogKGRhdGEucGxhY2VtZW50RnVuY3Rpb24gPyBkYXRhLnBsYWNlbWVudEZ1bmN0aW9uIDogbmV3IEJ1dHRlckZhY2VzLlRvb2x0aXAoKS5jYWxjdWxhdGVUb29sdGlwUG9zaXRpb24ocG9wb3Zlciwgc291cmNlKSk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB0aXRsZTogZGF0YS50aXRsZSxcbiAgICAgICAgICAgICAgICBodG1sOiB0cnVlLFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGRhdGEuY29udGVudCxcbiAgICAgICAgICAgICAgICB2aWV3cG9ydDogZGF0YS52aWV3cG9ydFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH07XG59KGpRdWVyeSkpOyJdfQ==




© 2015 - 2024 Weber Informatics LLC | Privacy Policy