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 s=!1,u=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(t){var o=this.prototype;s=!0;var e=new this;for(var n in s=!1,t)e[n]="function"==typeof t[n]&&"function"==typeof o[n]&&u.test(t[n])?function(n,i){return function(){var t=this._super;this._super=o[n];var e=i.apply(this,arguments);return this._super=t,e}}(n,t[n]):t[n];function i(){!s&&this.init&&this.init.apply(this,arguments)}return((i.prototype=e).constructor=i).extend=arguments.callee,i}}(),function(i){i.fn._butterAutoCompleteInit=function(){return this.each(function(){new t(this)})};var t=Class.extend({init:function(t){this.SEARCH_REQUEST_DELAY=300;var e=i(t);this.$input=e.prev(),this.$input.parent().css({position:"relative"}),this.autocompleteId=e.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 n=this;n.$input.on("keydown",function(t){t.which===n._keyCodes.enter?n._handleEnterKeyDown(t):t.which===n._keyCodes.arrow_up||t.which===n._keyCodes.arrow_down?n._handleArrowUpAndDownKeyDown(t):t.which===n._keyCodes.escape&&n._handleEscapeKeyDown(t)}).on("keyup",function(t){for(keyName in n._keyCodes)if(n._keyCodes[keyName]===t.which)return void n._stopEvent(t);return n.ignoreKeyupEvent?(n._stopEvent(t),void(n.ignoreKeyupEvent=!1)):0===n.$input.val().length?(n._stopEvent(t),void n._hideAutocompleteResultList()):void n._trySendJsfAjaxRequest()}).on("blur",function(t){window.setTimeout(function(){n._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")&&0
').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(t){this._clearResultOptionSelection();var e=i(t);e.addClass("butter-dropdownlist-resultItem-selected"),this.$selectedOption=e},_clearResultOptionSelection:function(){this.$selectedOption=null,this._getAutocompleteElement().find(".butter-dropdownlist-resultItem-selected").removeClass("butter-dropdownlist-resultItem-selected")},_moveResultOptionElementSelectionCursor:function(t,e){var n,i,o;0'+t+""})})})}}(jQuery),function(i){i.fn.markdownReadonly=function(){var t=i(this).find(".butter-component-value-readonly-wrapper"),e=t.html().replace("&","&").replace("<","<").replace(">",">"),n=(new showdown.Converter).makeHtml(e);t.empty(),t.append(n)}}(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(i){i.fn.butterNumberSpinner=function(t){return this.each(function(){new e(this,t)})};var e=Class.extend({init:function(t,e){this.$input=i(t).find("input"),this._initInput(),this._initOptions(e),this._initCounter(),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(t){this._options=i.extend({},{step:1,disabled:!1},t),void 0!==this._options.step&&(this._options.step=+this._options.step),void 0!==this._options.min&&(this._options.min=+this._options.min),void 0!==this._options.max&&(this._options.max=+this._options.max)},_initButtons:function(){var t=i("
").addClass("input-group-append").insertAfter(this.$input),e=i("").addClass("input-group-text").addClass("butter-component-number-buttons").appendTo(t),n=this;i("").addClass("glyphicon glyphicon-chevron-up").addClass("butter-component-number-button").addClass(function(){return n._options.disabled?"disabled":""}).click(function(){n._options.disabled||n.increaseCounter()}).appendTo(e),i("").addClass("glyphicon glyphicon-chevron-down").addClass("butter-component-number-button").addClass(function(){return n._options.disabled?"disabled":""}).click(function(){n._options.disabled||n.decreaseCounter()}).appendTo(e)},_initArrowKeys:function(){var e=this;this.$input.keydown(function(t){38===t.which?(t.stopPropagation(),t.preventDefault(),e.increaseCounter()):40===t.which&&(t.stopPropagation(),t.preventDefault(),e.decreaseCounter())})},_initMouseWheel:function(){var n=this;this.$input.on("mousewheel DOMMouseScroll",function(t){var e;n.$input.is(":focus")&&(e=t.originalEvent.wheelDelta||-t.originalEvent.deltaY||-t.originalEvent.detail,t.stopPropagation(),t.preventDefault(),e<0?n.decreaseCounter():n.increaseCounter())})},_initCounter:function(){this._counter=null,this._isValueSet=!1;var t,e=this.$input.val();this._isStringEmpty(e)||(t=parseInt(e),isNaN(t)||(this.setCounter(t),this._isValueSet=!0)),this._isValueSet||this.setCounter(0)},_setValueOnBlur:function(){var t,e=this.$input.val();this._isStringEmpty(e)?(this.$input.val(""),this.setCounter(0),this._isValueSet=!1):(t=parseInt(e),isNaN(t)?this._isValueSet?this.$input.val(this._counter):(this.$input.val(""),this.setCounter(0),this._isValueSet=!1):(this.setCounter(t),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(n){n.fn.butterScrollToFirst=function(t){var e=void 0===t?n(this).first().offset().top:n(this).first().offset().top+t;n("html, body").animate({scrollTop:e+"px"},"fast")},n.fn.butterScrollToLast=function(t){var e=void 0===t?n(this).last().offset().top:n(this).last().offset().top+t;n("html, body").animate({scrollTop:e+"px"},"fast")}}(jQuery),function(m){m.fn.toggleColumnVisibilty=function(n,o){return this.each(function(){var i,t=m(this),e=JSON.stringify((i=[],t.find(".butter-table-toolbar-column-option input[type=checkbox]").each(function(t,e){var n=m(e).parent(".butter-table-toolbar-column-option");i.push({identifier:n.attr("data-column-model-identifier"),visible:n.find("input[type=checkbox]").is(":checked")})}),i));ButterFaces.Ajax.sendRequest(t.attr("id"),"toggle",n,e,o)})},m.fn.orderColumn=function(p,h,d,f){return this.each(function(){var t,e,n,i,o,s,u,r,a=m(this);d?(o=f,s=a.find('li[data-original-column="'+o+'"]'),u=s.prev(),r=s.detach(),u.before(r)):(t=f,e=a.find('li[data-original-column="'+t+'"]'),n=e.next(),i=e.detach(),n.after(i));var l,c=JSON.stringify((l=[],a.find(".butter-table-toolbar-column-option input[type=checkbox]").each(function(t,e){var n=m(e).parent(".butter-table-toolbar-column-option");l.push({identifier:n.attr("data-column-model-identifier"),position:t})}),l));ButterFaces.Ajax.sendRequest(a.attr("id"),"order",p,c,h)})}}(jQuery),function(o){o.fn._closePopoverOnBlur=function(t){return this.each(function(){var t=o(this);t.find(".butter-input-component").on("blur",function(){t.popover("hide")})})},o.fn._butterTooltip=function(t){var e=o(this),n=jQuery("[name="+t.contentByName+"]"),i={trigger:t.trigger,title:t.title,placement:t.placement,placementFunction:t.placementFunction,minVerticalOffset:t.minVerticalOffset,minHorizontalOffset:t.minHorizontalOffset,content:n.html().trim()};n.remove(),e.butterTooltip(i)},o.fn.butterTooltip=function(n){return this.each(function(){var t=o(this),e=n.trigger?n.trigger:"hover";n.minVerticalOffset&&t.attr("data-tooltip-min-vertical-offset",n.minVerticalOffset),n.minHorizontalOffset&&t.attr("data-tooltip-min-horizontal-offset",n.minHorizontalOffset),t.next().hasClass("popover")&&t.next().remove(),t.popover({trigger:e,placement:function(t,e){return n.placement?n.placement:n.placementFunction?n.placementFunction:(new ButterFaces.Tooltip).calculateTooltipPosition(t,e)},title:n.title,html:!0,content:n.content,viewport:n.viewport})})}}(jQuery); //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLTAxLWJhc2VDbGFzcy5qcyIsImJ1dHRlcmZhY2VzLWF1dG9jb21wbGV0ZS5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy1ib290c3RyYXAtZml4ZXMuanF1ZXJ5LmpzIiwiYnV0dGVyZmFjZXMtY2xpZW50U2lkZUZpbHRlci5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy1kb3RzLmpxdWVyeS5qcyIsImJ1dHRlcmZhY2VzLWhpZ2hsaWdodC5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy1tYXJrZG93bi5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy1tb2RhbC5qcyIsImJ1dHRlcmZhY2VzLW51bWJlclNwaW5uZXIuanF1ZXJ5LmpzIiwiYnV0dGVyZmFjZXMtcHJldHR5cHJpbnQuanMiLCJidXR0ZXJmYWNlcy1zY3JvbGwuanF1ZXJ5LmpzIiwiYnV0dGVyZmFjZXMtdGFibGUtdG9vbGJhci5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy10b29sdGlwLmpxdWVyeS5qcyJdLCJuYW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W1lIGluIHByb3ApIHtcbiAgICAgICAgICAgIC8vIENoZWNrIGlmIHdlJ3JlIG92ZXJ3cml0aW5nIGFuIGV4aXN0aW5nIGZ1bmN0aW9uXG4gICAgICAgICAgICBwcm90b3R5cGVbbmFtZV0gPSB0eXBlb2YgcHJvcFtuYW1lXSA9PSBcImZ1bmN0aW9uXCIgJiZcbiAgICAgICAgICAgIHR5cGVvZiBfc3VwZXJbbmFtZV0gPT0gXCJmdW5jdGlvblwiICYmIGZuVGVzdC50ZXN0KHByb3BbbmFtZV0pID9cbiAgICAgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKG5hbWUsIGZuKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG1wID0gdGhpcy5fc3VwZXI7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGQgYSBuZXcgLl9zdXBlcigpIG1ldGhvZCB0aGF0IGlzIHRoZSBzYW1lIG1ldGhvZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJ1dCBvbiB0aGUgc3VwZXItY2xhc3NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9zdXBlciA9IF9zdXBlcltuYW1lXTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBtZXRob2Qgb25seSBuZWVkIHRvIGJlIGJvdW5kIHRlbXBvcmFyaWx5LCBzbyB3ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBpdCB3aGVuIHdlJ3JlIGRvbmUgZXhlY3V0aW5nXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJldCA9IGZuLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fc3VwZXIgPSB0bXA7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC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AgICAgICAgICB0aGlzLiRzZWxlY3RlZE9wdGlvbiA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLmlnbm9yZUtleXVwRXZlbnQgPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMucmVxdWVzdERlbGF5VGltZXJJZCA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLmlzUmVxdWVzdFJ1bm5pbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuYXJlQ2hhbmdlc01hZGVXaGlsZVJlcXVlc3RXYXNSdW5uaW5nID0gZmFsc2U7XG5cbiAgICAgICAgICAgIHRoaXMuX2tleUNvZGVzID0ge1xuICAgICAgICAgICAgICAgIC8vYmFja3NwYWNlOiA4LFxuICAgICAgICAgICAgICAgIHRhYjogOSxcbiAgICAgICAgICAgICAgICBlbnRlcjogMTMsXG4gICAgICAgICAgICAgICAgc2hpZnQ6IDE2LFxuICAgICAgICAgICAgICAgIGN0cmw6IDE3LFxuICAgICAgICAgICAgICAgIGFsdDogMTgsXG4gICAgICAgICAgICAgICAgcGF1c2U6IDE5LFxuICAgICAgICAgICAgICAgIGNhcHNfbG9jazogMjAsXG4gICAgICAgICAgICAgICAgZXNjYXBlOiAyNyxcbiAgICAgICAgICAgICAgICBwYWdlX3VwOiAzMyxcbiAgICAgICAgICAgICAgICBwYWdlX2Rvd246IDM0LFxuICAgICAgICAgICAgICAgIGVuZDogMzUsXG4gICAgICAgICAgICAgICAgaG9tZTogMzYsXG4gICAgICAgICAgICAgICAgYXJyb3dfbGVmdDogMzcsXG4gICAgICAgICAgICAgICAgYXJyb3dfdXA6IDM4LFxuICAgICAgICAgICAgICAgIGFycm93X3JpZ2h0OiAzOSxcbiAgICAgICAgICAgICAgICBhcnJvd19kb3duOiA0MCxcbiAgICAgICAgICAgICAgICBpbnNlcnQ6IDQ1LFxuICAgICAgICAgICAgICAgIC8vICdkZWxldGUnIGlzIGEgcmVzZXJ2ZWQga2V5IHdvcmRcbiAgICAgICAgICAgICAgICBkZWxldGVfa2V5OiA0NixcbiAgICAgICAgICAgICAgICBsZWZ0X3dpbmRvd19rZXk6IDkxLFxuICAgICAgICAgICAgICAgIHJpZ2h0X3dpbmRvd19rZXk6IDkyLFxuICAgICAgICAgICAgICAgIHNlbGVjdF9rZXk6IDkzLFxuICAgICAgICAgICAgICAgIG51bV9sb2NrOiAxNDQsXG4gICAgICAgICAgICAgICAgc2Nyb2xsX2xvY2s6IDE0NVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgc2VsZi4kaW5wdXRcbiAgICAgICAgICAgICAgICAgICAgLm9uKFwia2V5ZG93blwiLCBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldmVudC53aGljaCA9PT0gc2VsZi5fa2V5Q29kZXMuZW50ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9oYW5kbGVFbnRlcktleURvd24oZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC53aGljaCA9PT0gc2VsZi5fa2V5Q29kZXMuYXJyb3dfdXBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZXZlbnQud2hpY2ggPT09IHNlbGYuX2tleUNvZGVzLmFycm93X2Rvd24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9oYW5kbGVBcnJvd1VwQW5kRG93bktleURvd24oZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC53aGljaCA9PT0gc2VsZi5fa2V5Q29kZXMuZXNjYXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGFuZGxlRXNjYXBlS2V5RG93bihldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5vbihcImtleXVwXCIsIGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgaGFuZGxlIG90aGVyIGtleXMgdGhhbiBjaGFyYWN0ZXIga2V5c1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChrZXlOYW1lIGluIHNlbGYuX2tleUNvZGVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuX2tleUNvZGVzW2tleU5hbWVdID09PSBldmVudC53aGljaCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9zdG9wRXZlbnQoZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5pZ25vcmVLZXl1cEV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fc3RvcEV2ZW50KGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmlnbm9yZUtleXVwRXZlbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLiRpbnB1dC52YWwoKS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9zdG9wRXZlbnQoZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2hpZGVBdXRvY29tcGxldGVSZXN1bHRMaXN0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl90cnlTZW5kSnNmQWpheFJlcXVlc3QoKTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLm9uKFwiYmx1clwiLCBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9oaWRlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAwKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2hhbmRsZUVudGVyS2V5RG93bjogZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICBpZiAodGhpcy4kc2VsZWN0ZWRPcHRpb24gIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9zdG9wRXZlbnQoZXZlbnQpO1xuICAgICAgICAgICAgICAgIHRoaXMuX3NldFNlbGVjdGVkVmFsdWUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBfaGFuZGxlQXJyb3dVcEFuZERvd25LZXlEb3duOiBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgIHRoaXMuX3N0b3BFdmVudChldmVudCk7XG4gICAgICAgICAgICB2YXIgJGF1dG9jb21wbGV0ZSA9IHRoaXMuX2dldEF1dG9jb21wbGV0ZUVsZW1lbnQoKTtcbiAgICAgICAgICAgIGlmICghJGF1dG9jb21wbGV0ZS5pcyhcIjp2aXNpYmxlXCIpICYmIHRoaXMuJGlucHV0LnZhbCgpLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLl90cnlTZW5kSnNmQWpheFJlcXVlc3QoKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJGF1dG9jb21wbGV0ZS5pcyhcIjp2aXNpYmxlXCIpICYmICRhdXRvY29tcGxldGUuZmluZChcImxpXCIpLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy4kc2VsZWN0ZWRPcHRpb24gPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VsZWN0UmVzdWx0T3B0aW9uRWxlbWVudCgkYXV0b2NvbXBsZXRlLmZpbmQoXCJsaVwiKVswXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbW92ZVJlc3VsdE9wdGlvbkVsZW1lbnRTZWxlY3Rpb25DdXJzb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGF1dG9jb21wbGV0ZSwgZXZlbnQud2hpY2ggPT09IHRoaXMuX2tleUNvZGVzLmFycm93X3VwID8gLTEgOiAxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2hhbmRsZUVzY2FwZUtleURvd246IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgdGhpcy5fc3RvcEV2ZW50KGV2ZW50KTtcbiAgICAgICAgICAgIHRoaXMuX2hpZGVBdXRvY29tcGxldGVSZXN1bHRMaXN0KCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX3RyeVNlbmRKc2ZBamF4UmVxdWVzdDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuXG4gICAgICAgICAgICBpZiAoc2VsZi5pc1JlcXVlc3RSdW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJyZXF1ZXN0IGlzIGFjdGl2ZSwgc28gcmVtZW1iZXIgdGhhdCBjaGFuZ2VzIGhhcyBiZWVuIG1hZGUgd2hpbGUgcmVxdWVzdCB3YXMgcnVubmluZ1wiKTtcbiAgICAgICAgICAgICAgICBzZWxmLmFyZUNo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AgICAgICAgICAgIHZhciBpZCA9IHNlbGYuJGlucHV0LnBhcmVudCgpLnBhcmVudCgpLmF0dHIoJ2lkJyk7XG4gICAgICAgICAgICB2YXIgcGFyYW1zID0gc2VsZi4kaW5wdXQudmFsKCk7XG5cbiAgICAgICAgICAgIGpzZi5hamF4LnJlcXVlc3QoaWQsIFwiYXV0b2NvbXBsZXRlXCIsIHtcbiAgICAgICAgICAgICAgICBcImphdmF4LmZhY2VzLmJlaGF2aW9yLmV2ZW50XCI6IFwiYXV0b2NvbXBsZXRlXCIsXG4gICAgICAgICAgICAgICAgcmVuZGVyOiBzZWxmLmF1dG9jb21wbGV0ZUlkLFxuICAgICAgICAgICAgICAgIHBhcmFtczogcGFyYW1zLFxuICAgICAgICAgICAgICAgIFwiYnV0dGVyZmFjZXMucGFyYW1zXCI6IHBhcmFtcyxcbiAgICAgICAgICAgICAgICBvbmV2ZW50OiBmdW5jdGlvbiAoZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YS5zdGF0dXMgPT09IFwic3VjY2Vzc1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcInJlcXVlc3QgZmluaXNoZWRcIik7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgc2hvdyByZXN1bHQgaWYgaW5wdXQgZmllbGQgc3RpbGwgaGFzIGZvY3VzXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi4kaW5wdXQuaXMoXCI6Zm9jdXNcIikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9oYW5kbGVBdXRvY29tcGxldGVSZXN1bHRMaXN0VmlzaWJpbGl0eSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGlkZUxvYWRpbmdTcGlubmVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmlzUmVxdWVzdFJ1bm5pbmcgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuYXJlQ2hhbmdlc01hZGVXaGlsZVJlcXVlc3RXYXNSdW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJjaGFuZ2VzIG1hZGUgd2hpbGUgcmVxdWVzdCB3YXMgcnVubmluZywgc3RhcnQgbmV3IHJlcXVlc3QgYXV0b21hdGljYWxseVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9zZW5kSnNmQWpheFJlcXVlc3QoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9oYW5kbGVBdXRvY29tcGxldGVSZXN1bHRMaXN0VmlzaWJpbGl0eTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdmFyICRhdXRvY29tcGxldGUgPSBzZWxmLl9nZXRBdXRvY29tcGxldGVFbGVtZW50KCk7XG5cbiAgICAgICAgICAgIGlmICgkYXV0b2NvbXBsZXRlLmZpbmQoXCJsaVwiKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5faW5pdEFuZFNob3dBdXRvY29tcGxldGVSZXN1bHRMaXN0KCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNlbGYuX2hpZGVBdXRvY29tcGxldGVSZXN1bHRMaXN0KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgX3Nob3dMb2FkaW5nU3Bpbm5lcjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgJCgnPGRpdiBjbGFzcz1cImJ1dHRlci1kcm9wZG93bmxpc3Qtc3Bpbm5lci1jb250YWluZXJcIj48ZGl2IGNsYXNzPVwiYnV0dGVyLWRyb3Bkb3dubGlzdC1zcGlubmVyXCI+PC9kaXY+PC9kaXY+JylcbiAgICAgICAgICAgICAgICAgICAgLmFwcGVuZFRvKHRoaXMuJGlucHV0LnBhcmVudCgpKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaGlkZUxvYWRpbmdTcGlubmVyOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC5wYXJlbnQoKS5maW5kKFwiLmJ1dHRlci1kcm9wZG93bmxpc3Qtc3Bpbm5lclwiKS5yZW1vdmUoKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaW5pdEFuZFNob3dBdXRvY29tcGxldGVSZXN1bHRMaXN0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgJGF1dG9jb21wbGV0ZSA9IHNlbGYuX2dldEF1dG9jb21wbGV0ZUVsZW1lbnQoKTtcbiAgICAgICAgICAgICRhdXRvY29tcGxldGVcbiAgICAgICAgICAgICAgICAgICAgLnNob3coKVxuICAgICAgICAgICAgICAgICAgICAuY3NzKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBzZWxmLiRpbnB1dC5pbm5lcldpZHRoKClcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmhpZ2hsaWdodChzZWxmLiRpbnB1dC52YWwoKSk7XG5cbiAgICAgICAgICAgICRhdXRvY29tcGxldGUuZmluZChcInVsXCIpXG4gICAgICAgICAgICAgICAgICAgIC5vbihcIm1vdXNlbGVhdmVcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fY2xlYXJSZXN1bHRPcHRpb25TZWxlY3Rpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICRhdXRvY29tcGxldGUuZmluZChcImxpXCIpXG4gICAgICAgICAgICAgICAgICAgIC5vbihcIm1vdXNlZG93blwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9zZXRTZWxlY3RlZFZhbHVlKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5vbihcIm1vdXNlZW50ZXJcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fc2VsZWN0UmVzdWx0T3B0aW9uRWxlbWVudCh0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQ6IGZ1bmN0aW9uIChvcHRpb25FbGVtZW50KSB7XG4gICAgICAgICAgICB0aGlzLl9jbGVhclJlc3VsdE9wdGlvblNlbGVjdGlvbigpO1xuICAgICAgICAgICAgdmFyICRzZWxlY3RlZE9wdGlvbkVsZW1lbnQgPSAkKG9wdGlvbkVsZW1lbnQpO1xuICAgICAgICAgICAgJHNlbGVjdGVkT3B0aW9uRWxlbWVudC5hZGRDbGFzcyhcImJ1dHRlci1kcm9wZG93bmxpc3QtcmVzdWx0SXRlbS1zZWxlY3RlZFwiKTtcbiAgICAgICAgICAgIHRoaXMuJHNlbGVjdGVkT3B0aW9uID0gJHNlbGVjdGVkT3B0aW9uRWxlbWVudDtcbiAgICAgICAgfSxcblxuICAgICAgICBfY2xlYXJSZXN1bHRPcHRpb25TZWxlY3Rpb246IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHRoaXMuJHNlbGVjdGVkT3B0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIHRoaXMuX2dldEF1dG9jb21wbGV0ZUVsZW1lbnQoKVxuICAgICAgICAgICAgICAgICAgICAuZmluZChcIi5idXR0ZXItZHJvcGRvd25saXN0LXJlc3VsdEl0ZW0tc2VsZWN0ZWRcIilcbiAgICAgICAgICAgICAgICAgICAgLnJlbW92ZUNsYXNzKFwiYnV0dGVyLWRyb3Bkb3dubGlzdC1yZXN1bHRJdGVtLXNlbGVjdGVkXCIpO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9tb3ZlUmVzdWx0T3B0aW9uRWxlbWVudFNlbGVjdGlvbkN1cnNvcjogZnVuY3Rpb24gKCRhdXRvY29tcGxldGUsIGRpcmVjdGlvbikge1xuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiA+IDApIHtcbiAgICAgICAgICAgICAgICB2YXIgJG5leHQgPSB0aGlzLiRzZWxlY3RlZE9wdGlvbi5uZXh0KCk7XG4gICAgICAgICAgICAgICAgaWYgKCRuZXh0Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VsZWN0UmVzdWx0T3B0aW9uRWxlbWVudCgkbmV4dFswXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy90aGVyZSBpcyBubyBuZXh0XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQoJGF1dG9jb21wbGV0ZS5maW5kKFwibGlcIilbMF0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyICRwcmV2ID0gdGhpcy4kc2VsZWN0ZWRPcHRpb24ucHJldigpO1xuICAgICAgICAgICAgICAgIGlmICgkcHJldi5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQoJHByZXZbMF0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vdGhlcmUgaXMgbm8gcHJldmlvdXNcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdExpc3RPcHRpb25zID0gJGF1dG9jb21wbGV0ZS5maW5kKFwibGlcIik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQocmVzdWx0TGlzdE9wdGlvbnNbcmVzdWx0TGlzdE9wdGlvbnMubGVuZ3RoIC0gMV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBfc2V0U2VsZWN0ZWRWYWx1ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuJHNlbGVjdGVkT3B0aW9uICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5pZ25vcmVLZXl1cEV2ZW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLiRpbnB1dFxuICAgICAgICAgICAgICAgICAgICAgICAgLnZhbCh0aGlzLiRzZWxlY3RlZE9wdGlvbi5hdHRyKFwiZGF0YS1zZWxlY3QtdmFsdWVcIikpXG4gICAgICAgICAgICAgICAgICAgICAgICAuY2hhbmdlKClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5mb2N1cygpXG4gICAgICAgICAgICAgICAgICAgICAgICAua2V5dXAoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9oaWRlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9oaWRlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucmVxdWVzdERlbGF5VGltZXJJZCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHdpbmRvdy5jbGVhclRpbWVvdXQodGhpcy5yZXF1ZXN0RGVsYXlUaW1lcklkKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy4kc2VsZWN0ZWRPcHRpb24gPSBudWxsO1xuICAgICAgICAgICAgdGhpcy5fZ2V0Q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0gZnVuY3Rpb24gKGZpbHRlcmFibGVJdGVtQ29udGFpbmVyU2VsZWN0b3IpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgJHRoaXMgPSAkKHRoaXMpO1xuICAgICAgICAgICAgJHRoaXMua2V5dXAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGRlbGF5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZpbHRlclZhbHVlID0gJHRoaXMudmFsKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gZmluZCBjb250YWluZXIgYWdhaW4gZXZlcnkgdGltZSwgYmVjYXVzZSBpdCBjb3VsZCBoYXZlIGJlZW4gcmVyZW5kZXJlZC5cbiAgICAgICAgICAgICAgICAgICAgdmFyICRmaWx0ZXJhYmxlSXRlbUNvbnRhaW5lcjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbHRlcmFibGVJdGVtQ29udGFpbmVyU2VsZWN0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICRmaWx0ZXJhYmxlSXRlbUNvbnRhaW5lciA9ICQoZmlsdGVyYWJsZUl0ZW1Db250YWluZXJTZWxlY3Rvcik7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udGFpbmVyU2VsZWN0b3IgPSAkdGhpcy5hdHRyKCdkYXRhLWZpbHRlcmFibGUtaXRlbS1jb250YWluZXInKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICRmaWx0ZXJhYmxlSXRlbUNvbnRhaW5lciA9ICQoY29udGFpbmVyU2VsZWN0b3IpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGZpbHRlcmFibGVJdGVtcyA9ICRmaWx0ZXJhYmxlSXRlbUNvbnRhaW5lci5maW5kKCcuZmlsdGVyYWJsZS1pdGVtJyk7XG5cbiAgICAgICAgICAgICAgICAgICAgZmlsdGVyYWJsZUl0ZW1zLmVhY2goZnVuY3Rpb24gKGksIGVsZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciAkZmlsdGVyYWJsZUl0ZW0gPSAkKGVsZW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRmaWx0ZXJhYmxlSXRlbS5pcygnOmNvbnRhaW5zSWdub3JlQ2FzZSgnICsgZmlsdGVyVmFsdWUgKyAnKScpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGZpbHRlcmFibGVJdGVtLnJlbW92ZUF0dHIoXCJoaWRkZW5cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJGZpbHRlcmFibGVJdGVtLmhpZ2hsaWdodChmaWx0ZXJWYWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRmaWx0ZXJhYmxlSXRlbS5hdHRyKFwiaGlkZGVuXCIsIFwiaGlkZGVuXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0sIDMwMCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcbn0oalF1ZXJ5KSk7XG5cbihmdW5jdGlvbiAoJCkge1xuICAgICQuZXhwcltcIjpcIl0uY29udGFpbnNJZ25vcmVDYXNlID0gJC5leHByLmNyZWF0ZVBzZXVkbyhmdW5jdGlvbiAoYXJnKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoZWxlbSkge1xuICAgICAgICAgICAgcmV0dXJuICFhcmcgfHwgJChlbGVtKS50ZXh0KCkudG9VcHBlckNhc2UoKS5pbmRleE9mKGFyZy50b1VwcGVyQ2FzZSgpKSA+PSAwO1xuICAgICAgICB9O1xuICAgIH0pO1xufShqUXV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WwoKS5sZW5ndGggPiA1KSB7XG4gICAgICAgICAgICAgICAgICAgICRvcmlnaW5hbEVsZW1lbnQuaHRtbCgnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgMjAwKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgICQuZm4uc3RvcERvdHMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyICRvcmlnaW5hbEVsZW1lbnQgPSAkKHRoaXMpO1xuXG4gICAgICAgICAgICAkb3JpZ2luYWxFbGVtZW50Lmh0bWwoJycpO1xuICAgICAgICAgICAgd2luZG93LmNsZWFySW50ZXJ2YWwoaW50ZXJ2YWxUcmlnZ2VyKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxufShqUXVlcnkpKTsiLCIoZnVuY3Rpb24gKCQpIHtcbiAgICAkLmZuLmhpZ2hsaWdodCA9IGZ1bmN0aW9uIChzZWFyY2hTdHJpbmcpIHtcbiAgICAgICAgdmFyIGhpZ2hsaWdodENsYXNzTmFtZSA9IFwic2VhcmNoLWhpZ2hsaWdodGVkXCI7XG4gICAgICAgIHZhciByZWdleCA9IG5ldyBSZWdFeHAoc2VhcmNoU3RyaW5nLCBcImdpXCIpO1xuXG4gICAgICAgIHZhciBlbGVtZW50cyA9IHRoaXMuZmluZCgnKicpO1xuICAgICAgICB0aGlzLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgZWxlbWVudHMucHVzaCh0aGlzKTtcbiAgICAgICAgICAgICQodGhpcykuZmluZCgnLicgKyBoaWdobGlnaHRDbGFzc05hbWUpLmNvbnRlbnRzKCkudW53cmFwKCk7XG4gICAgICAgICAgICB0aGlzLm5vcm1hbGl6ZSgpO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gZWxlbWVudHMuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgJHRoaXMgPSAkKHRoaXMpO1xuXG4gICAgICAgICAgICBpZiAoc2VhcmNoU3RyaW5nICYmIHNlYXJjaFN0cmluZyAhPT0gJycpIHtcbiAgICAgICAgICAgICAgICAkdGhpcy5jb250ZW50cygpXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubm9kZVR5cGUgPT09IDMgJiYgcmVnZXgudGVzdCh0aGlzLm5vZGVWYWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlV2l0aChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRoaXMubm9kZVZhbHVlIHx8IFwiXCIpLnJlcGxhY2UocmVnZXgsIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcIjxzcGFuIGNsYXNzPVxcXCJcIiArIGhpZ2hsaWdodENsYXNzTmFtZSArIFwiXFxcIj5cIiArIG1hdGNoICsgXCI8L3NwYW4+XCI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH07XG59KGpRdWVyeSkpOyIsIihmdW5jdGlvbiAoJCkge1xuICAgIC8vIGV4dGVuZCBqUXVlcnkgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cbiAgICAkLmZuLm1hcmtkb3duUmVhZG9ubHkgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciByb290ID0gJCh0aGlzKTtcblxuICAgICAgICB2YXIgJHJlYWRvbmx5TWFya2Rvd24gPSByb290LmZpbmQoJy5idXR0ZXItY29tcG9uZ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pLmZpbmQoXCJpbnB1dFwiKTtcbiAgICAgICAgICAgIHRoaXMuX2luaXRJbnB1dCgpO1xuICAgICAgICAgICAgdGhpcy5faW5pdE9wdGlvbnMob3B0aW9ucyk7XG4gICAgICAgICAgICB0aGlzLl9pbml0Q291bnRlcigpO1xuICAgICAgICAgICAgdGhpcy5faW5pdEJ1dHRvbnMoKTtcbiAgICAgICAgICAgIHRoaXMuX2luaXRBcnJvd0tleXMoKTtcbiAgICAgICAgICAgIHRoaXMuX2luaXRNb3VzZVdoZWVsKCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2luaXRJbnB1dDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdGhpcy4kaW5wdXRcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJidXR0ZXItY29tcG9uZW50LW51bWJlci1pbnB1dFwiKVxuICAgICAgICAgICAgICAgIC5ibHVyKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5fc2V0VmFsdWVPbkJsdXIoKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5wYXJlbnQoKS5hZGRDbGFzcyhcImlucHV0LWdyb3VwXCIpO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0T3B0aW9uczogZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgICAgIHZhciBkZWZhdWx0T3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgICBzdGVwOiAxLFxuICAgICAgICAgICAgICAgIGRpc2FibGVkOiBmYWxzZVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRoaXMuX29wdGlvbnMgPSAkLmV4dGVuZCh7fSwgZGVmYXVsdE9wdGlvbnMsIG9wdGlvbnMpO1xuXG4gICAgICAgICAgICAvLyBlbnN1cmUgdGhhdCB0aGlzIHZhbHVlcyBhcmUgbnVtYmVyc1xuICAgICAgICAgICAgaWYgKHRoaXMuX29wdGlvbnMuc3RlcCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fb3B0aW9ucy5zdGVwID0gdGhpcy5fb3B0aW9ucy5zdGVwICogMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLl9vcHRpb25zLm1pbiAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fb3B0aW9ucy5taW4gPSB0aGlzLl9vcHRpb25zLm1pbiAqIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGhpcy5fb3B0aW9ucy5tYXggIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX29wdGlvbnMubWF4ID0gdGhpcy5fb3B0aW9ucy5tYXggKiAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0QnV0dG9uczogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyICRvdXRlckFkZG9uID0gJChcIjxkaXY+XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiaW5wdXQtZ3JvdXAtYXBwZW5kXCIpXG4gICAgICAgICAgICAgICAgLmluc2VydEFmdGVyKHRoaXMuJGlucHV0KTtcblxuICAgICAgICAgICAgdmFyICRhZGRvbiA9ICQoXCI8c3Bhbj5cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJpbnB1dC1ncm91cC10ZXh0XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYnV0dGVyLWNvbXBvbmVudC1udW1iZXItYnV0dG9uc1wiKVxuICAgICAgICAgICAgICAgIC5hcHBlbmRUbygkb3V0ZXJBZGRvbik7XG5cbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgICQoXCI8c3Bhbj5cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJnbHlwaGljb24gZ2x5cGhpY29uLWNoZXZyb24tdXBcIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJidXR0ZXItY29tcG9uZW50LW51bWJlci1idXR0b25cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZi5fb3B0aW9ucy5kaXNhYmxlZCA/IFwiZGlzYWJsZWRcIiA6IFwiXCI7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2xpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXNlbGYuX29wdGlvbnMuZGlzYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuaW5jcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5hcHBlbmRUbygkYWRkb24pO1xuXG4gICAgICAgICAgICAkKFwiPHNwYW4+XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiZ2x5cGhpY29uIGdseXBoaWNvbi1jaGV2cm9uLWRvd25cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJidXR0ZXItY29tcG9uZW50LW51bWJlci1idXR0b25cIilcbiAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZi5fb3B0aW9ucy5kaXNhYmxlZCA/IFwiZGlzYWJsZWRcIiA6IFwiXCI7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2xpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXNlbGYuX29wdGlvbnMuZGlzYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZGVjcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5hcHBlbmRUbygkYWRkb24pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0QXJyb3dLZXlzOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC5rZXlkb3duKGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgIGlmIChldmVudC53aGljaCA9PT0gMzgpIHtcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuaW5jcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC53aGljaCA9PT0gNDApIHtcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuZGVjcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2luaXRNb3VzZVdoZWVsOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC5vbihcIm1vdXNld2hlZWwgRE9NTW91c2VTY3JvbGxcIiwgZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFzZWxmLiRpbnB1dC5pcygnOmZvY3VzJykpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IGV2ZW50Lm9yaWdpbmFsRXZlbnQud2hlZWxEZWx0YSB8fCAtZXZlbnQub3JpZ2luYWxFdmVudC5kZWx0YVkgfHwgLWV2ZW50Lm9yaWdpbmFsRXZlbnQuZGV0YWlsO1xuXG4gICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICAgICAgICAgIGlmIChkZWx0YSA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5kZWNyZWFzZUNvdW50ZXIoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmluY3JlYXNlQ291bnRlcigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0Q291bnRlcjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB0aGlzLl9jb3VudGVyID0gbnVsbDtcbiAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSBmYWxzZTtcblxuICAgICAgICAgICAgdmFyIHZhbHVlID0gdGhpcy4kaW5wdXQudmFsKCk7XG4gICAgICAgICAgICBpZiAoIXRoaXMuX2lzU3RyaW5nRW1wdHkodmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhcnNlZEludCA9IHBhcnNlSW50KHZhbHVlKTtcbiAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKHBhcnNlZEludCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKHBhcnNlZEludCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF0aGlzLl9pc1ZhbHVlU2V0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9zZXRWYWx1ZU9uQmx1cjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gdGhpcy4kaW5wdXQudmFsKCk7XG4gICAgICAgICAgICBpZiAodGhpcy5faXNTdHJpbmdFbXB0eSh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRpbnB1dC52YWwoXCJcIik7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKDApO1xuICAgICAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSBmYWxzZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhcnNlZEludCA9IHBhcnNlSW50KHZhbHVlKTtcbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4ocGFyc2VkSW50KSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5faXNWYWx1ZVNldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy4kaW5wdXQudmFsKHRoaXMuX2NvdW50ZXIpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy4kaW5wdXQudmFsKFwiXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5faXNWYWx1ZVNldCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKHBhcnNlZEludCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJGlucHV0LnZhbCh0aGlzLl9jb3VudGVyKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5faXNWYWx1ZVNldCA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIGluY3JlYXNlQ291bnRlcjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuX2lzVmFsdWVTZXQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNldENvdW50ZXIodGhpcy5fY291bnRlciArIHRoaXMuX29wdGlvbnMuc3RlcCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy4kaW5wdXQudmFsKHRoaXMuX2NvdW50ZXIpO1xuICAgICAgICAgICAgdGhpcy4kaW5wdXQuY2hhbmdlKCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZGVjcmVhc2VDb3VudGVyOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5faXNWYWx1ZVNldCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0Q291bnRlcih0aGlzLl9jb3VudGVyIC0gdGhpcy5fb3B0aW9ucy5zdGVwKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5faXNWYWx1ZVNldCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC52YWwodGhpcy5fY291bnRlcik7XG4gICAgICAgICAgICB0aGlzLiRpbnB1dC5jaGFuZ2UoKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaXNTdHJpbmdFbXB0eTogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICByZXR1cm4gKHZhbHVlLmxlbmd0aCA9PT0gMCB8fCAhdmFsdWUudHJpbSgpKTtcbiAgICAgICAgfSxcblxuICAgICAgICBzZXRDb3VudGVyOiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLl9vcHRpb25zLm1pbiAhPT0gdW5kZWZpbmVkICYmIHZhbHVlIDwgdGhpcy5fb3B0aW9ucy5taW4pIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9jb3VudGVyID0gdGhpcy5fb3B0aW9ucy5taW47XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX29wdGlvbnMubWF4ICE9PSB1bmRlZmluZWQgJiYgdmFsdWUgPiB0aGlzLl9vcHRpb25zLm1heCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2NvdW50ZXIgPSB0aGlzLl9vcHRpb25zLm1heDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fY291bnRlciA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSk7XG59KGpRdWVyeSkpOyIsImlmICh0eXBlb2YgYnV0dGVyID09PSAndW5kZWZpbmVkJykge1xuICAgIGJ1dHRlciA9IHt9O1xufVxuYnV0dGVyLnByZXR0eXByaW50ID0ge307XG5cbi8qKlxuICogY2FsbHMgcHJldHR5IHByaW50IGphdmFzY3JpcHQgZnJhbWV3b3JrIGFuZCByZW1vdmVzIGZpcnN0IGFuZCBsYXN0IGVtcHR5IGNoaWxkcmVuLlxuICovXG5idXR0ZXIucHJldHR5cHJpbnQuY2xlYW51cCA9IGZ1bmN0aW9uKCkge1xuICAgIHByZXR0eVByaW50KCk7XG5cbiAgICBqUXVlcnkoJy5idXR0ZXItY29tcG9uZW50LXByZXR0eXByaW50JykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkZmlyc3RQcmVDaGlsZCA9IGpRdWVyeSh0aGlzKS5maW5kKFwicHJlIHNwYW5cIikuZmlyc3QoKTtcbiAgICAgICAgdmFyICRsYXN0UHJlQ2hpbGQgPSBqUXVlcnkodGhpcykuZmluZChcInByZSBzcGFuXCIpLmxhc3Qo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VhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyICR0b29sYmFyID0gJCh0aGlzKTtcblxuICAgICAgICAgICAgdmFyIGpzb24gPSBKU09OLnN0cmluZ2lmeShjcmVhdGVDb2x1bW5WaXNpYmlsdHkoJHRvb2xiYXIpKTtcbiAgICAgICAgICAgIEJ1dHRlckZhY2VzLkFqYXguc2VuZFJlcXVlc3QoJHRvb2xiYXIuYXR0cignaWQnKSwgJ3RvZ2dsZScsIHJlbmRlcklkcywganNvbiwgZGlzYWJsZVJlbmRlcklkcyk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGZ1bmN0aW9uIGNyZWF0ZUNvbHVtblZpc2liaWx0eSgkdG9vbGJhcikge1xuICAgICAgICAgICAgdmFyIGNvbHVtbnMgPSBbXTtcblxuICAgICAgICAgICAgJHRvb2xiYXIuZmluZCgnLmJ1dHRlci10YWJsZS10b29sYmFyLWNvbHVtbi1vcHRpb24gaW5wdXRbdHlwZT1jaGVja2JveF0nKS5lYWNoKGZ1bmN0aW9uIChpbmRleCwgY2hlY2tib3gpIHtcbiAgICAgICAgICAgICAgICB2YXIgJGNoZWNrYm94ID0gJChjaGVja2JveCkucGFyZW50KCcuYnV0dGVyLXRhYmxlLXRvb2xiYXItY29sdW1uLW9wdGlvbicpO1xuICAgICAgICAgICAgICAgIGNvbHVtbnMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIGlkZW50aWZpZXI6ICRjaGVja2JveC5hdHRyKCdkYXRhLWNvbHVtbi1tb2RlbC1pZGVudGlmaWVyJyksXG4gICAgICAgICAgICAgICAgICAgIHZpc2libGU6ICRjaGVja2JveC5maW5kKCdpbnB1dFt0eXBlPWNoZWNrYm94XScpLmlzKCc6Y2hlY2tlZCcpXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIGNvbHVtbnM7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgJC5mbi5vcm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U9Y2hlY2tib3hdJykuZWFjaChmdW5jdGlvbiAoaW5kZXgsIGNoZWNrYm94KSB7XG4gICAgICAgICAgICAgICAgdmFyICRjaGVja2JveCA9ICQoY2hlY2tib3gpLnBhcmVudCgnLmJ1dHRlci10YWJsZS10b29sYmFyLWNvbHVtbi1vcHRpb24nKTtcbiAgICAgICAgICAgICAgICBjb2x1bW5zLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBpZGVudGlmaWVyOiAkY2hlY2tib3guYXR0cignZGF0YS1jb2x1bW4tbW9kZWwtaWRlbnRpZmllcicpLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogaW5kZXhcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gY29sdW1ucztcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIG9yZGVyQ29sdW1uTGVmdCgvKiBqcXVlcnkgdG9vbGJhciAqLyAkdG9vbGJhciwgY29sdW1uTnVtYmVyKSB7XG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKCR0b29sYmFyKTtcblxuICAgICAgICAgICAgdmFyICRjb2x1bW4gPSAkdG9vbGJhci5maW5kKCdsaVtkYXRhLW9yaWdpbmFsLWNvbHVtbj1cIicgKyBjb2x1bW5OdW1iZXIgKyAnXCJdJyk7XG4gICAgICAgICAgICB2YXIgJG5leHRDb2x1bW4gPSAkY29sdW1uLnByZXYoKTtcblxuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygkY29sdW1uKTtcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJG5leHRDb2x1bW4pO1xuXG4gICAgICAgICAgICB2YXIgJGRldGFjaHRlZENvbHVtbiA9ICRjb2x1bW4uZGV0YWNoKCk7XG4gICAgICAgICAgICAkbmV4dENvbHVtbi5iZWZvcmUoJGRldGFjaHRlZENvbHVtbik7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBvcmRlckNvbH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290ID0gJCh0aGlzKTtcblxuICAgICAgICAvL2NvbnNvbGUubG9nKGRhdGEpO1xuXG4gICAgICAgIHZhciBjb250ZW50ID0galF1ZXJ5KCdbbmFtZT0nICsgZGF0YS5jb250ZW50QnlOYW1lICsgJ10nKTtcblxuICAgICAgICB2YXIgbmV3RGF0YSA9IHtcbiAgICAgICAgICAgIHRyaWdnZXI6IGRhdGEudHJpZ2dlcixcbiAgICAgICAgICAgIHRpdGxlOiBkYXRhLnRpdGxlLFxuICAgICAgICAgICAgcGxhY2VtZW50OiBkYXRhLnBsYWNlbWVudCxcbiAgICAgICAgICAgIHBsYWNlbWVudEZ1bmN0aW9uOiBkYXRhLnBsYWNlbWVudEZ1bmN0aW9uLFxuICAgICAgICAgICAgbWluVmVydGljYWxPZmZzZXQ6IGRhdGEubWluVmVydGljYWxPZmZzZXQsXG4gICAgICAgICAgICBtaW5Ib3Jpem9udGFsT2Zmc2V0OiBkYXRhLm1pbkhvcml6b250YWxPZmZzZXQsXG4gICAgICAgICAgICBjb250ZW50OiBjb250ZW50Lmh0bWwoKS50cmltKClcbiAgICAgICAgfTtcblxuICAgICAgICAvL2NvbnNvbGUubG9nKG5ld0RhdGEpO1xuXG4gICAgICAgIGNvbnRlbnQucmVtb3ZlKCk7XG5cbiAgICAgICAgcm9vdC5idXR0ZXJUb29sdGlwKG5ld0RhdGEpO1xuICAgIH07XG5cbiAgICAkLmZuLmJ1dHRlclRvb2x0aXAgPSBmdW5jdGlvbiAoLyogb2JqZWN0ICovIGRhdGEpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgcm9vdCA9ICQodGhpcyk7XG4gICAgICAgICAgICB2YXIgdHJpZ2dlciA9IGRhdGEudHJpZ2dlciA/IGRhdGEudHJpZ2dlciA6ICdob3Zlcic7XG5cbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coZGF0YSk7XG4gICAgICAgICAgICAvL2NvbnNvb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ZXIsIHNvdXJjZSkpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgdGl0bGU6IGRhdGEudGl0bGUsXG4gICAgICAgICAgICAgICAgaHRtbDogdHJ1ZSxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBkYXRhLmNvbnRlbnQsXG4gICAgICAgICAgICAgICAgdmlld3BvcnQ6IGRhdGEudmlld3BvcnRcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xufShqUXVlcnkpKTsiXX0=



© 2015 - 2024 Weber Informatics LLC | Privacy Policy