| /** |
| * swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API |
| * @version v2.1.4 |
| * @link http://swagger.io |
| * @license Apache-2.0 |
| */ |
| (function(){this["Handlebars"] = this["Handlebars"] || {}; |
| this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {}; |
| this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'><label for='input_apiKey_entry'>" |
| + escapeExpression(((helper = (helper = helpers.keyName || (depth0 != null ? depth0.keyName : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"keyName","hash":{},"data":data}) : helper))) |
| + "</label></div>\n <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n <div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#' data-sw-translate>apply</a></div>\n </div>\n</div>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\"><label for=\"input_username\" data-sw-translate>Username</label></div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\"><label for=\"password\" data-sw-translate>Password</label></div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"2":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <option value=\"" |
| + escapeExpression(lambda(depth0, depth0)) |
| + "\">"; |
| stack1 = lambda(depth0, depth0); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</option>\n"; |
| },"4":function(depth0,helpers,partials,data) { |
| return " <option value=\"application/json\">application/json</option>\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label data-sw-translate for=\"" |
| + escapeExpression(((helper = (helper = helpers.contentTypeId || (depth0 != null ? depth0.contentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"contentTypeId","hash":{},"data":data}) : helper))) |
| + "\">Response Content Type</label>\n<select name=\"contentType\" id=\"" |
| + escapeExpression(((helper = (helper = helpers.contentTypeId || (depth0 != null ? depth0.contentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"contentTypeId","hash":{},"data":data}) : helper))) |
| + "\">\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</select>\n"; |
| },"useData":true}); |
| 'use strict'; |
| |
| |
| $(function() { |
| |
| // Helper function for vertically aligning DOM elements |
| // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/ |
| $.fn.vAlign = function() { |
| return this.each(function(){ |
| var ah = $(this).height(); |
| var ph = $(this).parent().height(); |
| var mh = (ph - ah) / 2; |
| $(this).css('margin-top', mh); |
| }); |
| }; |
| |
| $.fn.stretchFormtasticInputWidthToParent = function() { |
| return this.each(function(){ |
| var p_width = $(this).closest("form").innerWidth(); |
| var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest('form').css('padding-right'), 10); |
| var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10); |
| $(this).css('width', p_width - p_padding - this_padding); |
| }); |
| }; |
| |
| $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent(); |
| |
| // Vertically center these paragraphs |
| // Parent may need a min-height for this to work.. |
| $('ul.downplayed li div.content p').vAlign(); |
| |
| // When a sandbox form is submitted.. |
| $("form.sandbox").submit(function(){ |
| |
| var error_free = true; |
| |
| // Cycle through the forms required inputs |
| $(this).find("input.required").each(function() { |
| |
| // Remove any existing error styles from the input |
| $(this).removeClass('error'); |
| |
| // Tack the error style on if the input is empty.. |
| if ($(this).val() === '') { |
| $(this).addClass('error'); |
| $(this).wiggle(); |
| error_free = false; |
| } |
| |
| }); |
| |
| return error_free; |
| }); |
| |
| }); |
| |
| function clippyCopiedCallback() { |
| $('#api_key_copied').fadeIn().delay(1000).fadeOut(); |
| |
| // var b = $("#clippy_tooltip_" + a); |
| // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() { |
| // b.attr("title", "copy to clipboard") |
| // }, |
| // 500)) |
| } |
| |
| // Logging function that accounts for browsers that don't have window.console |
| function log(){ |
| log.history = log.history || []; |
| log.history.push(arguments); |
| if(this.console){ |
| console.log( Array.prototype.slice.call(arguments)[0] ); |
| } |
| } |
| |
| // Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913) |
| if (Function.prototype.bind && console && typeof console.log === "object") { |
| [ |
| "log","info","warn","error","assert","dir","clear","profile","profileEnd" |
| ].forEach(function (method) { |
| console[method] = this.bind(console[method], console); |
| }, Function.prototype.call); |
| } |
| |
| window.Docs = { |
| |
| shebang: function() { |
| |
| // If shebang has an operation nickname in it.. |
| // e.g. /docs/#!/words/get_search |
| var fragments = $.param.fragment().split('/'); |
| fragments.shift(); // get rid of the bang |
| |
| switch (fragments.length) { |
| case 1: |
| if (fragments[0].length > 0) { // prevent matching "#/" |
| // Expand all operations for the resource and scroll to it |
| var dom_id = 'resource_' + fragments[0]; |
| |
| Docs.expandEndpointListForResource(fragments[0]); |
| $("#"+dom_id).slideto({highlight: false}); |
| } |
| break; |
| case 2: |
| // Refer to the endpoint DOM element, e.g. #words_get_search |
| |
| // Expand Resource |
| Docs.expandEndpointListForResource(fragments[0]); |
| $("#"+dom_id).slideto({highlight: false}); |
| |
| // Expand operation |
| var li_dom_id = fragments.join('_'); |
| var li_content_dom_id = li_dom_id + "_content"; |
| |
| |
| Docs.expandOperation($('#'+li_content_dom_id)); |
| $('#'+li_dom_id).slideto({highlight: false}); |
| break; |
| } |
| }, |
| |
| toggleEndpointListForResource: function(resource) { |
| var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints'); |
| if (elem.is(':visible')) { |
| $.bbq.pushState('#/', 2); |
| Docs.collapseEndpointListForResource(resource); |
| } else { |
| $.bbq.pushState('#/' + resource, 2); |
| Docs.expandEndpointListForResource(resource); |
| } |
| }, |
| |
| // Expand resource |
| expandEndpointListForResource: function(resource) { |
| var resource = Docs.escapeResourceName(resource); |
| if (resource == '') { |
| $('.resource ul.endpoints').slideDown(); |
| return; |
| } |
| |
| $('li#resource_' + resource).addClass('active'); |
| |
| var elem = $('li#resource_' + resource + ' ul.endpoints'); |
| elem.slideDown(); |
| }, |
| |
| // Collapse resource and mark as explicitly closed |
| collapseEndpointListForResource: function(resource) { |
| var resource = Docs.escapeResourceName(resource); |
| if (resource == '') { |
| $('.resource ul.endpoints').slideUp(); |
| return; |
| } |
| |
| $('li#resource_' + resource).removeClass('active'); |
| |
| var elem = $('li#resource_' + resource + ' ul.endpoints'); |
| elem.slideUp(); |
| }, |
| |
| expandOperationsForResource: function(resource) { |
| // Make sure the resource container is open.. |
| Docs.expandEndpointListForResource(resource); |
| |
| if (resource == '') { |
| $('.resource ul.endpoints li.operation div.content').slideDown(); |
| return; |
| } |
| |
| $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() { |
| Docs.expandOperation($(this)); |
| }); |
| }, |
| |
| collapseOperationsForResource: function(resource) { |
| // Make sure the resource container is open.. |
| Docs.expandEndpointListForResource(resource); |
| |
| if (resource == '') { |
| $('.resource ul.endpoints li.operation div.content').slideUp(); |
| return; |
| } |
| |
| $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() { |
| Docs.collapseOperation($(this)); |
| }); |
| }, |
| |
| escapeResourceName: function(resource) { |
| return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&"); |
| }, |
| |
| expandOperation: function(elem) { |
| elem.slideDown(); |
| }, |
| |
| collapseOperation: function(elem) { |
| elem.slideUp(); |
| } |
| }; |
| |
| 'use strict'; |
| |
| Handlebars.registerHelper('sanitize', function(html) { |
| // Strip the script tags from the html, and return it as a Handlebars.SafeString |
| html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ''); |
| return new Handlebars.SafeString(html); |
| }); |
| |
| Handlebars.registerHelper('renderTextParam', function(param) { |
| var result, type = 'text', idAtt = ''; |
| var paramType = param.type || param.schema.type || ''; |
| var isArray = paramType.toLowerCase() === 'array' || param.allowMultiple; |
| var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default; |
| |
| var dataVendorExtensions = Object.keys(param).filter(function(property) { |
| // filter X-data- properties |
| return property.match(/^X-data-/i) !== null; |
| }).reduce(function(result, property) { |
| // remove X- from property name, so it results in html attributes like data-foo='bar' |
| return result += ' ' + property.substring(2, property.length) + '=\'' + param[property] + '\''; |
| }, ''); |
| |
| if (typeof defaultValue === 'undefined') { |
| defaultValue = ''; |
| } |
| |
| if(param.format && param.format === 'password') { |
| type = 'password'; |
| } |
| |
| if(param.valueId) { |
| idAtt = ' id=\'' + param.valueId + '\''; |
| } |
| |
| if (typeof defaultValue === 'string' || defaultValue instanceof String) { |
| defaultValue = defaultValue.replace(/'/g,'''); |
| } |
| |
| if(isArray) { |
| result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions; |
| result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>'; |
| result += defaultValue + '</textarea>'; |
| } else { |
| var parameterClass = 'parameter'; |
| if(param.required) { |
| parameterClass += ' required'; |
| } |
| result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\''; |
| result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt + dataVendorExtensions; |
| result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>'; |
| } |
| return new Handlebars.SafeString(result); |
| }); |
| |
| this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div class=\"info_title\">" |
| + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0)) |
| + "</div>\n <div class=\"info_description markdown\">"; |
| stack1 = lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1), depth0); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</div>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.externalDocs : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += " "; |
| stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n "; |
| stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), {"name":"if","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n "; |
| stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n "; |
| stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n "; |
| stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1), {"name":"if","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "\n"; |
| },"2":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return " <p>" |
| + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.description : stack1), depth0)) |
| + "</p>\n <a href=\"" |
| + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1), depth0)) |
| + "\" target=\"_blank\">" |
| + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1), depth0)) |
| + "</a>\n"; |
| },"4":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return "<div class=\"info_tos\"><a href=\"" |
| + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), depth0)) |
| + "\" data-sw-translate>Terms of service</a></div>"; |
| },"6":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return "<div class='info_name' data-sw-translate>Created by " |
| + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), depth0)) |
| + "</div>"; |
| },"8":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return "<div class='info_url' data-sw-translate>See more at <a href=\"" |
| + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0)) |
| + "\">" |
| + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), depth0)) |
| + "</a></div>"; |
| },"10":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return "<div class='info_email'><a href=\"mailto:" |
| + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), depth0)) |
| + "?subject=" |
| + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0)) |
| + "\" data-sw-translate>Contact the developer</a></div>"; |
| },"12":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return "<div class='info_license'><a href='" |
| + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.url : stack1), depth0)) |
| + "'>" |
| + escapeExpression(lambda(((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.name : stack1), depth0)) |
| + "</a></div>"; |
| },"14":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return " , <span style=\"font-variant: small-caps\" data-sw-translate>api version</span>: " |
| + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), depth0)) |
| + "\n "; |
| },"16":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <span style=\"float:right\"><a href=\"" |
| + escapeExpression(((helper = (helper = helpers.validatorUrl || (depth0 != null ? depth0.validatorUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"validatorUrl","hash":{},"data":data}) : helper))) |
| + "/debug?url=" |
| + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper))) |
| + "\"><img id=\"validator\" src=\"" |
| + escapeExpression(((helper = (helper = helpers.validatorUrl || (depth0 != null ? depth0.validatorUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"validatorUrl","hash":{},"data":data}) : helper))) |
| + "?url=" |
| + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper))) |
| + "\"></a>\n </span>\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class='info' id='api_info'>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.info : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: " |
| + escapeExpression(((helper = (helper = helpers.basePath || (depth0 != null ? depth0.basePath : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"basePath","hash":{},"data":data}) : helper))) |
| + "\n"; |
| stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), {"name":"if","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "]\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.validatorUrl : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + " </h4>\n </div>\n</div>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| return "deprecated"; |
| },"3":function(depth0,helpers,partials,data) { |
| return " <h4><span data-sw-translate>Warning: Deprecated</span></h4>\n"; |
| },"5":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " <h4><span data-sw-translate>Implementation Notes</span></h4>\n <div class=\"markdown\">"; |
| stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</div>\n"; |
| },"7":function(depth0,helpers,partials,data) { |
| return " <div class=\"auth\">\n <span class=\"api-ic ic-error\">"; |
| },"9":function(depth0,helpers,partials,data) { |
| var stack1, buffer = " <div class=\"api_information_panel\">\n"; |
| stack1 = helpers.each.call(depth0, depth0, {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + " </div>\n"; |
| },"10":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <div title='"; |
| stack1 = lambda((depth0 != null ? depth0.description : depth0), depth0); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "'>" |
| + escapeExpression(lambda((depth0 != null ? depth0.scope : depth0), depth0)) |
| + "</div>\n"; |
| },"12":function(depth0,helpers,partials,data) { |
| return "</span></div>"; |
| },"14":function(depth0,helpers,partials,data) { |
| return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n"; |
| },"16":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> " |
| + escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper))) |
| + ")</h4>\n "; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.successDescription : depth0), {"name":"if","hash":{},"fn":this.program(17, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n\n"; |
| },"17":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = "<div class=\"markdown\">"; |
| stack1 = ((helper = (helper = helpers.successDescription || (depth0 != null ? depth0.successDescription : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successDescription","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</div>"; |
| },"19":function(depth0,helpers,partials,data) { |
| var stack1, buffer = " <h4 data-sw-translate>Headers</h4>\n <table class=\"headers\">\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Header</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Description</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Type</th>\n <th style=\"width: 320px; max-width: 320px\" data-sw-translate>Other</th>\n </tr>\n </thead>\n <tbody>\n"; |
| stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"each","hash":{},"fn":this.program(20, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + " </tbody>\n </table>\n"; |
| },"20":function(depth0,helpers,partials,data) { |
| var lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return " <tr>\n <td>" |
| + escapeExpression(lambda((data && data.key), depth0)) |
| + "</td>\n <td>" |
| + escapeExpression(lambda((depth0 != null ? depth0.description : depth0), depth0)) |
| + "</td>\n <td>" |
| + escapeExpression(lambda((depth0 != null ? depth0.type : depth0), depth0)) |
| + "</td>\n <td>" |
| + escapeExpression(lambda((depth0 != null ? depth0.other : depth0), depth0)) |
| + "</td>\n </tr>\n"; |
| },"22":function(depth0,helpers,partials,data) { |
| return " <h4 data-sw-translate>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n"; |
| },"24":function(depth0,helpers,partials,data) { |
| return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n </tbody>\n </table>\n"; |
| },"26":function(depth0,helpers,partials,data) { |
| return ""; |
| },"28":function(depth0,helpers,partials,data) { |
| return " <div class='sandbox_header'>\n <input class='submit' type='submit' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n"; |
| },"30":function(depth0,helpers,partials,data) { |
| return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='" |
| + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper))) |
| + " operation' id='" |
| + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper))) |
| + "_" |
| + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) |
| + "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/" |
| + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper))) |
| + "/" |
| + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) |
| + "' class=\"toggleOperation\">" |
| + escapeExpression(((helper = (helper = helpers.method || (depth0 != null ? depth0.method : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"method","hash":{},"data":data}) : helper))) |
| + "</a>\n </span>\n <span class='path'>\n <a href='#!/" |
| + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper))) |
| + "/" |
| + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) |
| + "' class=\"toggleOperation "; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.deprecated : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\">" |
| + escapeExpression(((helper = (helper = helpers.path || (depth0 != null ? depth0.path : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"path","hash":{},"data":data}) : helper))) |
| + "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/" |
| + escapeExpression(((helper = (helper = helpers.encodedParentId || (depth0 != null ? depth0.encodedParentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"encodedParentId","hash":{},"data":data}) : helper))) |
| + "/" |
| + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) |
| + "' class=\"toggleOperation\">"; |
| stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"summary","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</a>\n </li>\n </ul>\n </div>\n <div class='content' id='" |
| + escapeExpression(((helper = (helper = helpers.parentId || (depth0 != null ? depth0.parentId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parentId","hash":{},"data":data}) : helper))) |
| + "_" |
| + escapeExpression(((helper = (helper = helpers.nickname || (depth0 != null ? depth0.nickname : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"nickname","hash":{},"data":data}) : helper))) |
| + "_content' style='display:none'>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.deprecated : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.description : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); |
| if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); } |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n"; |
| stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.oauth : depth0), {"name":"each","hash":{},"fn":this.program(9, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += " "; |
| stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); |
| if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); } |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n"; |
| stack1 = ((helper = (helper = helpers.oauth || (depth0 != null ? depth0.oauth : depth0)) != null ? helper : helperMissing),(options={"name":"oauth","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); |
| if (!helpers.oauth) { stack1 = blockHelperMissing.call(depth0, stack1, options); } |
| if (stack1 != null) { buffer += stack1; } |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"if","hash":{},"fn":this.program(19, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(24, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(26, data),"inverse":this.program(28, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += " </form>\n <div class='response' style='display:none'>\n <h4 class='curl'>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(30, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + " <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["param_list"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| return " required"; |
| },"3":function(depth0,helpers,partials,data) { |
| return " multiple=\"multiple\""; |
| },"5":function(depth0,helpers,partials,data) { |
| return " required "; |
| },"7":function(depth0,helpers,partials,data) { |
| var stack1, buffer = " <option "; |
| stack1 = helpers.unless.call(depth0, (depth0 != null ? depth0.hasDefault : depth0), {"name":"unless","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + " value=''></option>\n"; |
| },"8":function(depth0,helpers,partials,data) { |
| return " selected=\"\" "; |
| },"10":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "\n <option "; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += " value='" |
| + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper))) |
| + "'> " |
| + escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper))) |
| + " "; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isDefault : depth0), {"name":"if","hash":{},"fn":this.program(13, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + " </option>\n\n"; |
| },"11":function(depth0,helpers,partials,data) { |
| return " selected=\"\" "; |
| },"13":function(depth0,helpers,partials,data) { |
| return " (default) "; |
| },"15":function(depth0,helpers,partials,data) { |
| return "<strong>"; |
| },"17":function(depth0,helpers,partials,data) { |
| return "</strong>"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "'><label for='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'>" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "</label></td>\n<td>\n <select "; |
| stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data})); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += " class=\"parameter "; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\" name=\"" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "\" id=\"" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "\">\n\n"; |
| stack1 = helpers.unless.call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"unless","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n"; |
| stack1 = helpers.each.call(depth0, ((stack1 = (depth0 != null ? depth0.allowableValues : depth0)) != null ? stack1.descriptiveValues : stack1), {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n </select>\n</td>\n<td class=\"markdown\">"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(15, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.required : depth0), {"name":"if","hash":{},"fn":this.program(17, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</td>\n<td>"; |
| stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["param_readonly_required"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'>" |
| + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) |
| + "</textarea>\n"; |
| },"3":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"4":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " " |
| + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) |
| + "\n"; |
| },"6":function(depth0,helpers,partials,data) { |
| return " (empty)\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'><label for='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'>" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "</label></td>\n<td>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</td>\n<td class=\"markdown\">"; |
| stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</td>\n<td>"; |
| stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["param_readonly"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <textarea class='body-textarea' readonly='readonly' name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'>" |
| + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) |
| + "</textarea>\n <div class=\"parameter-content-type\" />\n"; |
| },"3":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"4":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " " |
| + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) |
| + "\n"; |
| },"6":function(depth0,helpers,partials,data) { |
| return " (empty)\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'><label for='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'>" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "</label></td>\n<td>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</td>\n<td class=\"markdown\">"; |
| stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</td>\n<td>"; |
| stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["param_required"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"2":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <input type=\"file\" name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'/>\n"; |
| },"4":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"5":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <div class=\"editor_holder\"></div>\n <textarea class='body-textarea required' placeholder='(required)' name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id=\"" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "\">" |
| + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) |
| + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n"; |
| },"7":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <textarea class='body-textarea required' placeholder='(required)' name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n"; |
| },"9":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.program(12, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"10":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <input class='parameter' class='required' type='file' name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'/>\n"; |
| },"12":function(depth0,helpers,partials,data) { |
| var stack1, helperMissing=helpers.helperMissing, buffer = ""; |
| stack1 = ((helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helperMissing).call(depth0, depth0, {"name":"renderTextParam","hash":{},"fn":this.program(13, data),"inverse":this.noop,"data":data})); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"13":function(depth0,helpers,partials,data) { |
| return ""; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code required'><label for='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'>" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "</label></td>\n<td>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(9, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</td>\n<td>\n <strong><span class=\"markdown\">"; |
| stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</span></strong>\n</td>\n<td>"; |
| stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</td>\n<td><span class=\"model-signature\"></span></td>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["param"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"2":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <input type=\"file\" name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'/>\n <div class=\"parameter-content-type\" />\n"; |
| },"4":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"5":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <div class=\"editor_holder\"></div>\n <textarea class='body-textarea' name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'>" |
| + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) |
| + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n"; |
| },"7":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <textarea class='body-textarea' name='" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "' id='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n"; |
| },"9":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isFile : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(10, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"10":function(depth0,helpers,partials,data) { |
| var stack1, helperMissing=helpers.helperMissing, buffer = ""; |
| stack1 = ((helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helperMissing).call(depth0, depth0, {"name":"renderTextParam","hash":{},"fn":this.program(11, data),"inverse":this.noop,"data":data})); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"11":function(depth0,helpers,partials,data) { |
| return ""; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td class='code'><label for='" |
| + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) |
| + "'>" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "</label></td>\n<td>\n\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isBody : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(9, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n</td>\n<td class=\"markdown\">"; |
| stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</td>\n<td>"; |
| stack1 = ((helper = (helper = helpers.paramType || (depth0 != null ? depth0.paramType : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"paramType","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["parameter_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.consumes : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"2":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <option value=\"" |
| + escapeExpression(lambda(depth0, depth0)) |
| + "\">"; |
| stack1 = lambda(depth0, depth0); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</option>\n"; |
| },"4":function(depth0,helpers,partials,data) { |
| return " <option value=\"application/json\">application/json</option>\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label for=\"" |
| + escapeExpression(((helper = (helper = helpers.parameterContentTypeId || (depth0 != null ? depth0.parameterContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parameterContentTypeId","hash":{},"data":data}) : helper))) |
| + "\" data-sw-translate>Parameter content type:</label>\n<select name=\"parameterContentType\" id=\"" |
| + escapeExpression(((helper = (helper = helpers.parameterContentTypeId || (depth0 != null ? depth0.parameterContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"parameterContentTypeId","hash":{},"data":data}) : helper))) |
| + "\">\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.consumes : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</select>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["resource"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| return " : "; |
| },"3":function(depth0,helpers,partials,data) { |
| var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; |
| return " <li>\n <a href='" |
| + escapeExpression(((helper = (helper = helpers.url || (depth0 != null ? depth0.url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"url","hash":{},"data":data}) : helper))) |
| + "' data-sw-translate>Raw</a>\n </li>\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "<div class='heading'>\n <h2>\n <a href='#!/" |
| + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) |
| + "' class=\"toggleEndpointList\" data-id=\"" |
| + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) |
| + "\">" |
| + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) |
| + "</a> "; |
| stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(options={"name":"summary","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); |
| if (!helpers.summary) { stack1 = blockHelperMissing.call(depth0, stack1, options); } |
| if (stack1 != null) { buffer += stack1; } |
| stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"summary","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/" |
| + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) |
| + "' id='endpointListTogger_" |
| + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) |
| + "' class=\"toggleEndpointList\" data-id=\"" |
| + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) |
| + "\" data-sw-translate>Show/Hide</a>\n </li>\n <li>\n <a href='#' class=\"collapseResource\" data-id=\"" |
| + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) |
| + "\" data-sw-translate>\n List Operations\n </a>\n </li>\n <li>\n <a href='#' class=\"expandResource\" data-id=\"" |
| + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) |
| + "\" data-sw-translate>\n Expand Operations\n </a>\n </li>\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.url : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + " </ul>\n</div>\n<ul class='endpoints' id='" |
| + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) |
| + "_endpoint_list' style='display:none'>\n\n</ul>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["response_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var stack1, buffer = ""; |
| stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer; |
| },"2":function(depth0,helpers,partials,data) { |
| var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <option value=\"" |
| + escapeExpression(lambda(depth0, depth0)) |
| + "\">"; |
| stack1 = lambda(depth0, depth0); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</option>\n"; |
| },"4":function(depth0,helpers,partials,data) { |
| return " <option value=\"application/json\">application/json</option>\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<label data-sw-translate for=\"" |
| + escapeExpression(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"responseContentTypeId","hash":{},"data":data}) : helper))) |
| + "\">Response Content Type</label>\n<select name=\"responseContentType\" id=\"" |
| + escapeExpression(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"responseContentTypeId","hash":{},"data":data}) : helper))) |
| + "\">\n"; |
| stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.produces : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(4, data),"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "</select>\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["signature"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\" data-sw-translate>Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\" data-sw-translate>Model Schema</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n "; |
| stack1 = ((helper = (helper = helpers.signature || (depth0 != null ? depth0.signature : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signature","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + "\n </div>\n\n <div class=\"snippet\">\n <pre><code>" |
| + escapeExpression(((helper = (helper = helpers.sampleJSON || (depth0 != null ? depth0.sampleJSON : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"sampleJSON","hash":{},"data":data}) : helper))) |
| + "</code></pre>\n <small class=\"notice\" data-sw-translate></small>\n </div>\n</div>\n\n"; |
| },"useData":true}); |
| this["Handlebars"]["templates"]["status_code"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { |
| var lambda=this.lambda, escapeExpression=this.escapeExpression; |
| return " <tr>\n <td>" |
| + escapeExpression(lambda((data && data.key), depth0)) |
| + "</td>\n <td>" |
| + escapeExpression(lambda((depth0 != null ? depth0.description : depth0), depth0)) |
| + "</td>\n <td>" |
| + escapeExpression(lambda((depth0 != null ? depth0.type : depth0), depth0)) |
| + "</td>\n </tr>\n"; |
| },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { |
| var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<td width='15%' class='code'>" |
| + escapeExpression(((helper = (helper = helpers.code || (depth0 != null ? depth0.code : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"code","hash":{},"data":data}) : helper))) |
| + "</td>\n<td class=\"markdown\">"; |
| stack1 = ((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"message","hash":{},"data":data}) : helper)); |
| if (stack1 != null) { buffer += stack1; } |
| buffer += "</td>\n<td width='50%'><span class=\"model-signature\" /></td>\n<td class=\"headers\">\n <table>\n <tbody>\n"; |
| stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"each","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); |
| if (stack1 != null) { buffer += stack1; } |
| return buffer + " </tbody>\n </table>\n</td>"; |
| },"useData":true}); |
| /** |
| * swagger-client - swagger-client is a javascript client for use with swaggering APIs. |
| * @version v2.1.10 |
| * @link http://swagger.io |
| * @license Apache-2.0 |
| */ |
| (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SwaggerClient = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
| 'use strict'; |
| |
| var auth = require('./lib/auth'); |
| var helpers = require('./lib/helpers'); |
| var SwaggerClient = require('./lib/client'); |
| var deprecationWrapper = function (url, options) { |
| helpers.log('This is deprecated, use "new SwaggerClient" instead.'); |
| |
| return new SwaggerClient(url, options); |
| }; |
| |
| /* Here for IE8 Support */ |
| if (!Array.prototype.indexOf) { |
| Array.prototype.indexOf = function(obj, start) { |
| for (var i = (start || 0), j = this.length; i < j; i++) { |
| if (this[i] === obj) { return i; } |
| } |
| return -1; |
| }; |
| } |
| |
| /* Here for IE8 Support */ |
| if (!String.prototype.trim) { |
| String.prototype.trim = function () { |
| return this.replace(/^\s+|\s+$/g, ''); |
| }; |
| } |
| |
| /* Here for node 10.x support */ |
| if (!String.prototype.endsWith) { |
| String.prototype.endsWith = function(suffix) { |
| return this.indexOf(suffix, this.length - suffix.length) !== -1; |
| }; |
| } |
| |
| module.exports = SwaggerClient; |
| |
| SwaggerClient.ApiKeyAuthorization = auth.ApiKeyAuthorization; |
| SwaggerClient.PasswordAuthorization = auth.PasswordAuthorization; |
| SwaggerClient.CookieAuthorization = auth.CookieAuthorization; |
| SwaggerClient.SwaggerApi = deprecationWrapper; |
| SwaggerClient.SwaggerClient = deprecationWrapper; |
| SwaggerClient.SchemaMarkup = require('./lib/schema-markup'); |
| |
| },{"./lib/auth":2,"./lib/client":3,"./lib/helpers":4,"./lib/schema-markup":7}],2:[function(require,module,exports){ |
| 'use strict'; |
| |
| var helpers = require('./helpers'); |
| var btoa = require('btoa'); // jshint ignore:line |
| var CookieJar = require('cookiejar').CookieJar; |
| var _ = { |
| each: require('lodash-compat/collection/each'), |
| includes: require('lodash-compat/collection/includes'), |
| isObject: require('lodash-compat/lang/isObject'), |
| isArray: require('lodash-compat/lang/isArray') |
| }; |
| |
| /** |
| * SwaggerAuthorizations applys the correct authorization to an operation being executed |
| */ |
| var SwaggerAuthorizations = module.exports.SwaggerAuthorizations = function (authz) { |
| this.authz = authz || {}; |
| }; |
| |
| /** |
| * Add auths to the hash |
| * Will overwrite any existing |
| * |
| */ |
| SwaggerAuthorizations.prototype.add = function (name, auth) { |
| if(_.isObject(name)) { |
| for (var key in name) { |
| this.authz[key] = name[key]; |
| } |
| } else if(typeof name === 'string' ){ |
| this.authz[name] = auth; |
| } |
| |
| return auth; |
| }; |
| |
| SwaggerAuthorizations.prototype.remove = function (name) { |
| return delete this.authz[name]; |
| }; |
| |
| SwaggerAuthorizations.prototype.apply = function (obj, securities) { |
| var status = true; |
| var applyAll = !securities; |
| var flattenedSecurities = []; |
| |
| // Securities could be [ {} ] |
| _.each(securities, function (obj, key) { |
| |
| // Make sure we account for securities being [ str ] |
| if(typeof key === 'string') { |
| flattenedSecurities.push(key); |
| } |
| |
| // Flatten keys in to our array |
| _.each(obj, function (val, key) { |
| flattenedSecurities.push(key); |
| }); |
| }); |
| |
| _.each(this.authz, function (auth, authName) { |
| if(applyAll || _.includes(flattenedSecurities, authName)) { |
| var newStatus = auth.apply(obj); |
| status = status && !!newStatus; // logical ORs regarding status |
| } |
| }); |
| |
| return status; |
| }; |
| |
| /** |
| * ApiKeyAuthorization allows a query param or header to be injected |
| */ |
| var ApiKeyAuthorization = module.exports.ApiKeyAuthorization = function (name, value, type) { |
| this.name = name; |
| this.value = value; |
| this.type = type; |
| }; |
| |
| ApiKeyAuthorization.prototype.apply = function (obj) { |
| if (this.type === 'query') { |
| // see if already applied. If so, don't do it again |
| |
| var qp; |
| if (obj.url.indexOf('?') > 0) { |
| qp = obj.url.substring(obj.url.indexOf('?') + 1); |
| var parts = qp.split('&'); |
| if(parts && parts.length > 0) { |
| for(var i = 0; i < parts.length; i++) { |
| var kv = parts[i].split('='); |
| if(kv && kv.length > 0) { |
| if (kv[0] === this.name) { |
| // skip it |
| return false; |
| } |
| } |
| } |
| } |
| } |
| |
| if (obj.url.indexOf('?') > 0) { |
| obj.url = obj.url + '&' + this.name + '=' + this.value; |
| } else { |
| obj.url = obj.url + '?' + this.name + '=' + this.value; |
| } |
| |
| return true; |
| } else if (this.type === 'header') { |
| if(typeof obj.headers[this.name] === 'undefined') { |
| obj.headers[this.name] = this.value; |
| } |
| |
| return true; |
| } |
| }; |
| |
| var CookieAuthorization = module.exports.CookieAuthorization = function (cookie) { |
| this.cookie = cookie; |
| }; |
| |
| CookieAuthorization.prototype.apply = function (obj) { |
| obj.cookieJar = obj.cookieJar || new CookieJar(); |
| obj.cookieJar.setCookie(this.cookie); |
| |
| return true; |
| }; |
| |
| /** |
| * Password Authorization is a basic auth implementation |
| */ |
| var PasswordAuthorization = module.exports.PasswordAuthorization = function (username, password) { |
| if (arguments.length === 3) { |
| helpers.log('PasswordAuthorization: the \'name\' argument has been removed, pass only username and password'); |
| username = arguments[1]; |
| password = arguments[2]; |
| } |
| this.username = username; |
| this.password = password; |
| }; |
| |
| PasswordAuthorization.prototype.apply = function (obj) { |
| if(typeof obj.headers.Authorization === 'undefined') { |
| obj.headers.Authorization = 'Basic ' + btoa(this.username + ':' + this.password); |
| } |
| |
| return true; |
| }; |
| |
| },{"./helpers":4,"btoa":14,"cookiejar":19,"lodash-compat/collection/each":56,"lodash-compat/collection/includes":59,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isObject":148}],3:[function(require,module,exports){ |
| 'use strict'; |
| |
| var _ = { |
| bind: require('lodash-compat/function/bind'), |
| cloneDeep: require('lodash-compat/lang/cloneDeep'), |
| find: require('lodash-compat/collection/find'), |
| forEach: require('lodash-compat/collection/forEach'), |
| indexOf: require('lodash-compat/array/indexOf'), |
| isArray: require('lodash-compat/lang/isArray'), |
| isObject: require('lodash-compat/lang/isObject'), |
| isFunction: require('lodash-compat/lang/isFunction'), |
| isPlainObject: require('lodash-compat/lang/isPlainObject'), |
| isUndefined: require('lodash-compat/lang/isUndefined') |
| }; |
| var auth = require('./auth'); |
| var helpers = require('./helpers'); |
| var Model = require('./types/model'); |
| var Operation = require('./types/operation'); |
| var OperationGroup = require('./types/operationGroup'); |
| var Resolver = require('./resolver'); |
| var SwaggerHttp = require('./http'); |
| var SwaggerSpecConverter = require('./spec-converter'); |
| var Q = require('q'); |
| |
| // We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the |
| // following usage: 'client.{tagName}' |
| var reservedClientTags = [ |
| 'apis', |
| 'authorizationScheme', |
| 'authorizations', |
| 'basePath', |
| 'build', |
| 'buildFrom1_1Spec', |
| 'buildFrom1_2Spec', |
| 'buildFromSpec', |
| 'clientAuthorizations', |
| 'convertInfo', |
| 'debug', |
| 'defaultErrorCallback', |
| 'defaultSuccessCallback', |
| 'enableCookies', |
| 'fail', |
| 'failure', |
| 'finish', |
| 'help', |
| 'idFromOp', |
| 'info', |
| 'initialize', |
| 'isBuilt', |
| 'isValid', |
| 'modelPropertyMacro', |
| 'models', |
| 'modelsArray', |
| 'options', |
| 'parameterMacro', |
| 'parseUri', |
| 'progress', |
| 'resourceCount', |
| 'sampleModels', |
| 'selfReflect', |
| 'setConsolidatedModels', |
| 'spec', |
| 'supportedSubmitMethods', |
| 'swaggerRequestHeaders', |
| 'tagFromLabel', |
| 'title', |
| 'url', |
| 'useJQuery' |
| ]; |
| // We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the |
| // following usage: 'client.apis.{tagName}' |
| var reservedApiTags = [ |
| 'apis', |
| 'asCurl', |
| 'description', |
| 'externalDocs', |
| 'help', |
| 'label', |
| 'name', |
| 'operation', |
| 'operations', |
| 'operationsArray', |
| 'path', |
| 'tag' |
| ]; |
| var supportedOperationMethods = ['delete', 'get', 'head', 'options', 'patch', 'post', 'put']; |
| var SwaggerClient = module.exports = function (url, options) { |
| this.authorizations = null; |
| this.authorizationScheme = null; |
| this.basePath = null; |
| this.debug = false; |
| this.enableCookies = false; |
| this.info = null; |
| this.isBuilt = false; |
| this.isValid = false; |
| this.modelsArray = []; |
| this.resourceCount = 0; |
| this.url = null; |
| this.useJQuery = false; |
| this.swaggerObject = {}; |
| this.deferredClient = Q.defer(); |
| |
| this.clientAuthorizations = new auth.SwaggerAuthorizations(); |
| |
| if (typeof url !== 'undefined') { |
| return this.initialize(url, options); |
| } else { |
| return this; |
| } |
| }; |
| |
| SwaggerClient.prototype.initialize = function (url, options) { |
| this.models = {}; |
| this.sampleModels = {}; |
| |
| if (typeof url === 'string') { |
| this.url = url; |
| } else if (_.isObject(url)) { |
| options = url; |
| this.url = options.url; |
| } |
| |
| options = options || {}; |
| this.clientAuthorizations.add(options.authorizations); |
| this.swaggerRequestHeaders = options.swaggerRequestHeaders || 'application/json;charset=utf-8,*/*'; |
| this.defaultSuccessCallback = options.defaultSuccessCallback || null; |
| this.defaultErrorCallback = options.defaultErrorCallback || null; |
| this.modelPropertyMacro = options.modelPropertyMacro || null; |
| this.parameterMacro = options.parameterMacro || null; |
| this.usePromise = options.usePromise || null; |
| |
| if (typeof options.success === 'function') { |
| this.success = options.success; |
| } |
| |
| if (options.useJQuery) { |
| this.useJQuery = options.useJQuery; |
| } |
| |
| if (options.enableCookies) { |
| this.enableCookies = options.enableCookies; |
| } |
| |
| this.options = options || {}; |
| |
| this.supportedSubmitMethods = options.supportedSubmitMethods || []; |
| this.failure = options.failure || function (err) { throw err; }; |
| this.progress = options.progress || function () {}; |
| this.spec = _.cloneDeep(options.spec); // Clone so we do not alter the provided document |
| |
| if (options.scheme) { |
| this.scheme = options.scheme; |
| } |
| |
| if (this.usePromise || typeof options.success === 'function') { |
| this.ready = true; |
| return this.build(); |
| } |
| }; |
| |
| SwaggerClient.prototype.build = function (mock) { |
| if (this.isBuilt) { |
| return this; |
| } |
| |
| var self = this; |
| |
| this.progress('fetching resource list: ' + this.url + '; Please wait.'); |
| |
| var obj = { |
| useJQuery: this.useJQuery, |
| url: this.url, |
| method: 'get', |
| headers: { |
| accept: this.swaggerRequestHeaders |
| }, |
| on: { |
| error: function (response) { |
| if (self.url.substring(0, 4) !== 'http') { |
| return self.fail('Please specify the protocol for ' + self.url); |
| } else if (response.status === 0) { |
| return self.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.'); |
| } else if (response.status === 404) { |
| return self.fail('Can\'t read swagger JSON from ' + self.url); |
| } else { |
| return self.fail(response.status + ' : ' + response.statusText + ' ' + self.url); |
| } |
| }, |
| response: function (resp) { |
| |
| var responseObj = resp.obj; |
| if(!responseObj) { |
| return self.fail('failed to parse JSON/YAML response'); |
| } |
| |
| self.swaggerVersion = responseObj.swaggerVersion; |
| self.swaggerObject = responseObj; |
| |
| if (responseObj.swagger && parseInt(responseObj.swagger) === 2) { |
| self.swaggerVersion = responseObj.swagger; |
| |
| new Resolver().resolve(responseObj, self.url, self.buildFromSpec, self); |
| |
| self.isValid = true; |
| } else { |
| var converter = new SwaggerSpecConverter(); |
| self.oldSwaggerObject = self.swaggerObject; |
| |
| converter.setDocumentationLocation(self.url); |
| converter.convert(responseObj, self.clientAuthorizations, self.options, function(spec) { |
| self.swaggerObject = spec; |
| new Resolver().resolve(spec, self.url, self.buildFromSpec, self); |
| self.isValid = true; |
| }); |
| } |
| } |
| } |
| }; |
| |
| if (this.spec) { |
| self.swaggerObject = this.spec; |
| setTimeout(function () { |
| new Resolver().resolve(self.spec, self.buildFromSpec, self); |
| }, 10); |
| } else { |
| this.clientAuthorizations.apply(obj); |
| |
| if (mock) { |
| return obj; |
| } |
| |
| new SwaggerHttp().execute(obj, this.options); |
| } |
| |
| return (this.usePromise) ? this.deferredClient.promise : this; |
| }; |
| |
| SwaggerClient.prototype.buildFromSpec = function (response) { |
| if (this.isBuilt) { |
| return this; |
| } |
| |
| this.apis = {}; |
| this.apisArray = []; |
| this.basePath = response.basePath || ''; |
| this.consumes = response.consumes; |
| this.host = response.host || ''; |
| this.info = response.info || {}; |
| this.produces = response.produces; |
| this.schemes = response.schemes || []; |
| this.securityDefinitions = response.securityDefinitions; |
| this.title = response.title || ''; |
| |
| if (response.externalDocs) { |
| this.externalDocs = response.externalDocs; |
| } |
| |
| // legacy support |
| this.authSchemes = response.securityDefinitions; |
| |
| var definedTags = {}; |
| var k; |
| |
| if (Array.isArray(response.tags)) { |
| definedTags = {}; |
| |
| for (k = 0; k < response.tags.length; k++) { |
| var t = response.tags[k]; |
| definedTags[t.name] = t; |
| } |
| } |
| |
| var location; |
| |
| if (typeof this.url === 'string') { |
| location = this.parseUri(this.url); |
| if (typeof this.scheme === 'undefined' && typeof this.schemes === 'undefined' || this.schemes.length === 0) { |
| this.scheme = location.scheme || 'http'; |
| } else if (typeof this.scheme === 'undefined') { |
| this.scheme = this.schemes[0] || location.scheme; |
| } |
| |
| if (typeof this.host === 'undefined' || this.host === '') { |
| this.host = location.host; |
| |
| if (location.port) { |
| this.host = this.host + ':' + location.port; |
| } |
| } |
| } |
| else { |
| if (typeof this.schemes === 'undefined' || this.schemes.length === 0) { |
| this.scheme = 'http'; |
| } |
| else if (typeof this.scheme === 'undefined') { |
| this.scheme = this.schemes[0]; |
| } |
| } |
| |
| this.definitions = response.definitions; |
| |
| var key; |
| |
| for (key in this.definitions) { |
| var model = new Model(key, this.definitions[key], this.models, this.modelPropertyMacro); |
| |
| if (model) { |
| this.models[key] = model; |
| } |
| } |
| |
| // get paths, create functions for each operationId |
| var self = this; |
| |
| // Bind help to 'client.apis' |
| self.apis.help = _.bind(self.help, self); |
| |
| _.forEach(response.paths, function (pathObj, path) { |
| // Only process a path if it's an object |
| if (!_.isPlainObject(pathObj)) { |
| return; |
| } |
| |
| _.forEach(supportedOperationMethods, function (method) { |
| var operation = pathObj[method]; |
| |
| if (_.isUndefined(operation)) { |
| // Operation does not exist |
| return; |
| } else if (!_.isPlainObject(operation)) { |
| // Operation exists but it is not an Operation Object. Since this is invalid, log it. |
| helpers.log('The \'' + method + '\' operation for \'' + path + '\' path is not an Operation Object'); |
| |
| return; |
| } |
| |
| var tags = operation.tags; |
| |
| if (_.isUndefined(tags) || !_.isArray(tags) || tags.length === 0) { |
| tags = operation.tags = [ 'default' ]; |
| } |
| |
| var operationId = self.idFromOp(path, method, operation); |
| |
| var operationObject = new Operation(self, |
| operation.scheme, |
| operationId, |
| method, |
| path, |
| operation, |
| self.definitions, |
| self.models, |
| self.clientAuthorizations); |
| |
| // bind self operation's execute command to the api |
| _.forEach(tags, function (tag) { |
| var clientProperty = _.indexOf(reservedClientTags, tag) > -1 ? '_' + tag : tag; |
| var apiProperty = _.indexOf(reservedApiTags, tag) > -1 ? '_' + tag : tag; |
| var operationGroup = self[clientProperty]; |
| |
| if (clientProperty !== tag) { |
| helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient function/property name. Use \'client.' + |
| clientProperty + '\' or \'client.apis.' + tag + '\' instead of \'client.' + tag + '\'.'); |
| } |
| |
| if (apiProperty !== tag) { |
| helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient operation function/property name. Use ' + |
| '\'client.apis.' + apiProperty + '\' instead of \'client.apis.' + tag + '\'.'); |
| } |
| |
| if (_.indexOf(reservedApiTags, operationId) > -1) { |
| helpers.log('The \'' + operationId + '\' operationId conflicts with a SwaggerClient operation ' + |
| 'function/property name. Use \'client.apis.' + apiProperty + '._' + operationId + |
| '\' instead of \'client.apis.' + apiProperty + '.' + operationId + '\'.'); |
| |
| operationId = '_' + operationId; |
| operationObject.nickname = operationId; // So 'client.apis.[tag].operationId.help() works properly |
| } |
| |
| if (_.isUndefined(operationGroup)) { |
| operationGroup = self[clientProperty] = self.apis[apiProperty] = {}; |
| |
| operationGroup.operations = {}; |
| operationGroup.label = apiProperty; |
| operationGroup.apis = {}; |
| |
| var tagDef = definedTags[tag]; |
| |
| if (!_.isUndefined(tagDef)) { |
| operationGroup.description = tagDef.description; |
| operationGroup.externalDocs = tagDef.externalDocs; |
| } |
| |
| self[clientProperty].help = _.bind(self.help, operationGroup); |
| self.apisArray.push(new OperationGroup(tag, operationGroup.description, operationGroup.externalDocs, operationObject)); |
| } |
| |
| operationId = self.makeUniqueOperationId(operationId, self.apis[apiProperty]); |
| |
| // Bind tag help |
| if (!_.isFunction(operationGroup.help)) { |
| operationGroup.help = _.bind(self.help, operationGroup); |
| } |
| |
| // bind to the apis object |
| self.apis[apiProperty][operationId] = operationGroup[operationId] = _.bind(operationObject.execute, |
| operationObject); |
| self.apis[apiProperty][operationId].help = operationGroup[operationId].help = _.bind(operationObject.help, |
| operationObject); |
| self.apis[apiProperty][operationId].asCurl = operationGroup[operationId].asCurl = _.bind(operationObject.asCurl, |
| operationObject); |
| |
| operationGroup.apis[operationId] = operationGroup.operations[operationId] = operationObject; |
| |
| // legacy UI feature |
| var api = _.find(self.apisArray, function (api) { |
| return api.tag === tag; |
| }); |
| |
| if (api) { |
| api.operationsArray.push(operationObject); |
| } |
| }); |
| }); |
| }); |
| |
| this.isBuilt = true; |
| |
| if (this.usePromise) { |
| this.isValid = true; |
| this.isBuilt = true; |
| this.deferredClient.resolve(this); |
| |
| return this.deferredClient.promise; |
| } |
| |
| if (this.success) { |
| this.success(); |
| } |
| |
| return this; |
| }; |
| |
| SwaggerClient.prototype.makeUniqueOperationId = function(operationId, api) { |
| var count = 0; |
| var name = operationId; |
| |
| // make unique across this operation group |
| while(true) { |
| var matched = false; |
| _.forEach(api.operations, function (operation) { |
| if(operation.nickname === name) { |
| matched = true; |
| } |
| }); |
| if(!matched) { |
| return name; |
| } |
| name = operationId + '_' + count; |
| count ++; |
| } |
| |
| return operationId; |
| }; |
| |
| SwaggerClient.prototype.parseUri = function (uri) { |
| var urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/; |
| var parts = urlParseRE.exec(uri); |
| |
| return { |
| scheme: parts[4] ? parts[4].replace(':','') : undefined, |
| host: parts[11], |
| port: parts[12], |
| path: parts[15] |
| }; |
| }; |
| |
| SwaggerClient.prototype.help = function (dontPrint) { |
| var output = ''; |
| |
| if (this instanceof SwaggerClient) { |
| _.forEach(this.apis, function (api, name) { |
| if (_.isPlainObject(api)) { |
| output += 'operations for the \'' + name + '\' tag\n'; |
| |
| _.forEach(api.operations, function (operation, name) { |
| output += ' * ' + name + ': ' + operation.summary + '\n'; |
| }); |
| } |
| }); |
| } else if (this instanceof OperationGroup || _.isPlainObject(this)) { |
| output += 'operations for the \'' + this.label + '\' tag\n'; |
| |
| _.forEach(this.apis, function (operation, name) { |
| output += ' * ' + name + ': ' + operation.summary + '\n'; |
| }); |
| } |
| |
| if (dontPrint) { |
| return output; |
| } else { |
| helpers.log(output); |
| |
| return output; |
| } |
| }; |
| |
| SwaggerClient.prototype.tagFromLabel = function (label) { |
| return label; |
| }; |
| |
| SwaggerClient.prototype.idFromOp = function (path, httpMethod, op) { |
| if(!op || !op.operationId) { |
| op = op || {}; |
| op.operationId = httpMethod + '_' + path; |
| } |
| var opId = op.operationId.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_') || (path.substring(1) + '_' + httpMethod); |
| |
| opId = opId.replace(/((_){2,})/g, '_'); |
| opId = opId.replace(/^(_)*/g, ''); |
| opId = opId.replace(/([_])*$/g, ''); |
| |
| return opId; |
| }; |
| |
| SwaggerClient.prototype.setHost = function (host) { |
| this.host = host; |
| |
| if(this.apis) { |
| _.forEach(this.apis, function(api) { |
| if(api.operations) { |
| _.forEach(api.operations, function(operation) { |
| operation.host = host; |
| }); |
| } |
| }); |
| } |
| }; |
| |
| SwaggerClient.prototype.setBasePath = function (basePath) { |
| this.basePath = basePath; |
| |
| if(this.apis) { |
| _.forEach(this.apis, function(api) { |
| if(api.operations) { |
| _.forEach(api.operations, function(operation) { |
| operation.basePath = basePath; |
| }); |
| } |
| }); |
| } |
| }; |
| |
| SwaggerClient.prototype.fail = function (message) { |
| if (this.usePromise) { |
| this.deferredClient.reject(message); |
| return this.deferredClient.promise; |
| } else { |
| if (this.failure) { |
| this.failure(message); |
| } |
| else { |
| this.failure(message); |
| } |
| } |
| }; |
| |
| },{"./auth":2,"./helpers":4,"./http":5,"./resolver":6,"./spec-converter":8,"./types/model":9,"./types/operation":10,"./types/operationGroup":11,"lodash-compat/array/indexOf":53,"lodash-compat/collection/find":57,"lodash-compat/collection/forEach":58,"lodash-compat/function/bind":62,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isFunction":146,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isUndefined":152,"q":161}],4:[function(require,module,exports){ |
| (function (process){ |
| 'use strict'; |
| |
| var _ = { |
| isPlainObject: require('lodash-compat/lang/isPlainObject'), |
| indexOf: require('lodash-compat/array/indexOf') |
| }; |
| |
| module.exports.__bind = function (fn, me) { |
| return function(){ |
| return fn.apply(me, arguments); |
| }; |
| }; |
| |
| var log = module.exports.log = function() { |
| // Only log if available and we're not testing |
| if (console && process.env.NODE_ENV !== 'test') { |
| console.log(Array.prototype.slice.call(arguments)[0]); |
| } |
| }; |
| |
| module.exports.fail = function (message) { |
| log(message); |
| }; |
| |
| var optionHtml = module.exports.optionHtml = function (label, value) { |
| return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>'; |
| }; |
| |
| var resolveSchema = module.exports.resolveSchema = function (schema) { |
| if (_.isPlainObject(schema.schema)) { |
| schema = resolveSchema(schema.schema); |
| } |
| |
| return schema; |
| }; |
| |
| var simpleRef = module.exports.simpleRef = function (name) { |
| if (typeof name === 'undefined') { |
| return null; |
| } |
| |
| if (name.indexOf('#/definitions/') === 0) { |
| return name.substring('#/definitions/'.length); |
| } else { |
| return name; |
| } |
| }; |
| |
| |
| }).call(this,require('_process')) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9oZWxwZXJzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiJnZW5lcmF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuXG52YXIgXyA9IHtcbiAgaXNQbGFpbk9iamVjdDogcmVxdWlyZSgnbG9kYXNoLWNvbXBhdC9sYW5nL2lzUGxhaW5PYmplY3QnKSxcbiAgaW5kZXhPZjogcmVxdWlyZSgnbG9kYXNoLWNvbXBhdC9hcnJheS9pbmRleE9m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ID0gZnVuY3Rpb24gKG5hbWUpIHtcbiAgaWYgKHR5cGVvZiBuYW1lID09PSAndW5kZWZpbmVkJykge1xuICAgIHJldHVybiBudWxsO1xuICB9XG5cbiAgaWYgKG5hbWUuaW5kZXhPZignIy9kZWZpbml0aW9ucy8nKSA9PT0gMCkge1xuICAgIHJldHVybiBuYW1lLnN1YnN0cmluZygnIy9kZWZpbml0aW9ucy8nLmxlbmd0aCk7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIG5hbWU7XG4gIH1cbn07XG5cbiJdfQ== |
| },{"_process":13,"lodash-compat/array/indexOf":53,"lodash-compat/lang/isPlainObject":149}],5:[function(require,module,exports){ |
| 'use strict'; |
| |
| var helpers = require('./helpers'); |
| var request = require('superagent'); |
| var jsyaml = require('js-yaml'); |
| var _ = { |
| isObject: require('lodash-compat/lang/isObject') |
| }; |
| |
| /* |
| * JQueryHttpClient is a light-weight, node or browser HTTP client |
| */ |
| var JQueryHttpClient = function () {}; |
| |
| /* |
| * SuperagentHttpClient is a light-weight, node or browser HTTP client |
| */ |
| var SuperagentHttpClient = function () {}; |
| |
| /** |
| * SwaggerHttp is a wrapper for executing requests |
| */ |
| var SwaggerHttp = module.exports = function () {}; |
| |
| SwaggerHttp.prototype.execute = function (obj, opts) { |
| var client; |
| |
| if(opts && opts.client) { |
| client = opts.client; |
| } |
| else { |
| client = new SuperagentHttpClient(opts); |
| } |
| client.opts = opts || {}; |
| |
| // legacy support |
| var hasJQuery = false; |
| if(typeof window !== 'undefined') { |
| if(typeof window.jQuery !== 'undefined') { |
| hasJQuery = true; |
| } |
| } |
| if(this.isInternetExplorer() && (obj.useJQuery === false || !hasJQuery )) { |
| throw new Error('Unsupported configuration! JQuery is required but not available'); |
| } |
| if ((obj && obj.useJQuery === true) || this.isInternetExplorer() && hasJQuery) { |
| client = new JQueryHttpClient(opts); |
| } |
| |
| var success = obj.on.response; |
| |
| var requestInterceptor = function(data) { |
| if(opts && opts.requestInterceptor) { |
| data = opts.requestInterceptor.apply(data); |
| } |
| return data; |
| }; |
| |
| var responseInterceptor = function(data) { |
| if(opts && opts.responseInterceptor) { |
| data = opts.responseInterceptor.apply(data); |
| } |
| return success(data); |
| }; |
| |
| obj.on.response = function(data) { |
| responseInterceptor(data); |
| }; |
| |
| |
| if (_.isObject(obj) && _.isObject(obj.body)) { |
| // special processing for file uploads via jquery |
| if (obj.body.type && obj.body.type === 'formData'){ |
| obj.contentType = false; |
| obj.processData = false; |
| |
| delete obj.headers['Content-Type']; |
| } else { |
| obj.body = JSON.stringify(obj.body); |
| } |
| } |
| |
| client.execute(requestInterceptor(obj)); |
| |
| return (obj.deferred) ? obj.deferred.promise : obj; |
| }; |
| |
| SwaggerHttp.prototype.isInternetExplorer = function () { |
| var detectedIE = false; |
| |
| if (typeof navigator !== 'undefined' && navigator.userAgent) { |
| var nav = navigator.userAgent.toLowerCase(); |
| |
| if (nav.indexOf('msie') !== -1) { |
| var version = parseInt(nav.split('msie')[1]); |
| |
| if (version <= 8) { |
| detectedIE = true; |
| } |
| } |
| } |
| |
| return detectedIE; |
| }; |
| |
| JQueryHttpClient.prototype.execute = function (obj) { |
| var jq = this.jQuery || window.jQuery; |
| var cb = obj.on; |
| var request = obj; |
| |
| obj.type = obj.method; |
| obj.cache = false; |
| delete obj.useJQuery; |
| |
| /* |
| obj.beforeSend = function (xhr) { |
| var key, results; |
| if (obj.headers) { |
| results = []; |
| for (key in obj.headers) { |
| if (key.toLowerCase() === 'content-type') { |
| results.push(obj.contentType = obj.headers[key]); |
| } else if (key.toLowerCase() === 'accept') { |
| results.push(obj.accepts = obj.headers[key]); |
| } else { |
| results.push(xhr.setRequestHeader(key, obj.headers[key])); |
| } |
| } |
| return results; |
| } |
| };*/ |
| |
| obj.data = obj.body; |
| |
| delete obj.body; |
| |
| obj.complete = function (response) { |
| var headers = {}; |
| var headerArray = response.getAllResponseHeaders().split('\n'); |
| |
| for (var i = 0; i < headerArray.length; i++) { |
| var toSplit = headerArray[i].trim(); |
| |
| if (toSplit.length === 0) { |
| continue; |
| } |
| |
| var separator = toSplit.indexOf(':'); |
| |
| if (separator === -1) { |
| // Name but no value in the header |
| headers[toSplit] = null; |
| |
| continue; |
| } |
| |
| var name = toSplit.substring(0, separator).trim(); |
| var value = toSplit.substring(separator + 1).trim(); |
| |
| headers[name] = value; |
| } |
| |
| var out = { |
| url: request.url, |
| method: request.method, |
| status: response.status, |
| statusText: response.statusText, |
| data: response.responseText, |
| headers: headers |
| }; |
| |
| try { |
| var possibleObj = response.responseJSON || jsyaml.safeLoad(response.responseText); |
| out.obj = (typeof possibleObj === 'string') ? {} : possibleObj; |
| } catch (ex) { |
| // do not set out.obj |
| helpers.log('unable to parse JSON/YAML content'); |
| } |
| |
| // I can throw, or parse null? |
| out.obj = out.obj || null; |
| |
| if (response.status >= 200 && response.status < 300) { |
| cb.response(out); |
| } else if (response.status === 0 || (response.status >= 400 && response.status < 599)) { |
| cb.error(out); |
| } else { |
| return cb.response(out); |
| } |
| }; |
| |
| jq.support.cors = true; |
| |
| return jq.ajax(obj); |
| }; |
| |
| SuperagentHttpClient.prototype.execute = function (obj) { |
| var method = obj.method.toLowerCase(); |
| |
| if (method === 'delete') { |
| method = 'del'; |
| } |
| var headers = obj.headers || {}; |
| var r = request[method](obj.url); |
| var name; |
| for (name in headers) { |
| r.set(name, headers[name]); |
| } |
| |
| if (obj.enableCookies) { |
| r.withCredentials(); |
| } |
| |
| if (obj.body) { |
| r.send(obj.body); |
| } |
| |
| if(typeof r.buffer === 'function') { |
| r.buffer(); // force superagent to populate res.text with the raw response data |
| } |
| |
| r.end(function (err, res) { |
| res = res || { |
| status: 0, |
| headers: {error: 'no response from server'} |
| }; |
| var response = { |
| url: obj.url, |
| method: obj.method, |
| headers: res.headers |
| }; |
| var cb; |
| |
| if (!err && res.error) { |
| err = res.error; |
| } |
| |
| if (err && obj.on && obj.on.error) { |
| response.errObj = err; |
| response.status = res ? res.status : 500; |
| response.statusText = res ? res.text : err.message; |
| if(res.headers && res.headers['content-type']) { |
| if(res.headers['content-type'].indexOf('application/json') >= 0) { |
| try { |
| response.obj = JSON.parse(response.statusText); |
| } |
| catch (e) { |
| response.obj = null; |
| } |
| } |
| } |
| cb = obj.on.error; |
| } else if (res && obj.on && obj.on.response) { |
| var possibleObj; |
| |
| // Already parsed by by superagent? |
| if(res.body && Object.keys(res.body).length > 0) { |
| possibleObj = res.body; |
| } else { |
| try { |
| possibleObj = jsyaml.safeLoad(res.text); |
| // can parse into a string... which we don't need running around in the system |
| possibleObj = (typeof possibleObj === 'string') ? null : possibleObj; |
| } catch(e) { |
| helpers.log('cannot parse JSON/YAML content'); |
| } |
| } |
| |
| // null means we can't parse into object |
| response.obj = (typeof possibleObj === 'object') ? possibleObj : null; |
| |
| response.status = res.status; |
| response.statusText = res.text; |
| cb = obj.on.response; |
| } |
| response.data = response.statusText; |
| |
| if (cb) { |
| cb(response); |
| } |
| }); |
| }; |
| |
| },{"./helpers":4,"js-yaml":20,"lodash-compat/lang/isObject":148,"superagent":162}],6:[function(require,module,exports){ |
| 'use strict'; |
| |
| var SwaggerHttp = require('./http'); |
| var _ = { |
| isObject: require('lodash-compat/lang/isObject'), |
| cloneDeep: require('lodash-compat/lang/cloneDeep'), |
| isArray: require('lodash-compat/lang/isArray') |
| }; |
| |
| |
| /** |
| * Resolves a spec's remote references |
| */ |
| var Resolver = module.exports = function () {}; |
| |
| Resolver.prototype.processAllOf = function(root, name, definition, resolutionTable, unresolvedRefs, spec) { |
| var i, location, property; |
| |
| definition['x-resolved-from'] = [ '#/definitions/' + name ]; |
| var allOf = definition.allOf; |
| // the refs go first |
| allOf.sort(function(a, b) { |
| if(a.$ref && b.$ref) { return 0; } |
| else if(a.$ref) { return -1; } |
| else { return 1; } |
| }); |
| for (i = 0; i < allOf.length; i++) { |
| property = allOf[i]; |
| location = '/definitions/' + name + '/allOf'; |
| this.resolveInline(root, spec, property, resolutionTable, unresolvedRefs, location); |
| } |
| }; |
| |
| Resolver.prototype.resolve = function (spec, arg1, arg2, arg3) { |
| this.spec = spec; |
| var root = arg1, callback = arg2, scope = arg3, opts = {}, location, i; |
| if(typeof arg1 === 'function') { |
| root = null; |
| callback = arg1; |
| scope = arg2; |
| } |
| var _root = root; |
| this.scope = (scope || this); |
| this.iteration = this.iteration || 0; |
| |
| if(this.scope.options && this.scope.options.requestInterceptor){ |
| opts.requestInterceptor = this.scope.options.requestInterceptor; |
| } |
| |
| if(this.scope.options && this.scope.options.responseInterceptor){ |
| opts.responseInterceptor = this.scope.options.responseInterceptor; |
| } |
| |
| var name, path, property, propertyName; |
| var processedCalls = 0, resolvedRefs = {}, unresolvedRefs = {}; |
| var resolutionTable = []; // store objects for dereferencing |
| |
| spec.definitions = spec.definitions || {}; |
| // definitions |
| for (name in spec.definitions) { |
| var definition = spec.definitions[name]; |
| for (propertyName in definition.properties) { |
| property = definition.properties[propertyName]; |
| if(_.isArray(property.allOf)) { |
| this.processAllOf(root, name, property, resolutionTable, unresolvedRefs, spec); |
| } |
| else { |
| this.resolveTo(root, property, resolutionTable, '/definitions'); |
| } |
| } |
| |
| if(definition.allOf) { |
| this.processAllOf(root, name, definition, resolutionTable, unresolvedRefs, spec); |
| } |
| } |
| |
| // operations |
| for (name in spec.paths) { |
| var method, operation, responseCode; |
| path = spec.paths[name]; |
| |
| for (method in path) { |
| // operation reference |
| if(method === '$ref') { |
| // location = path[method]; |
| location = '/paths' + name; |
| this.resolveInline(root, spec, path, resolutionTable, unresolvedRefs, location); |
| } |
| else { |
| operation = path[method]; |
| var sharedParameters = path.parameters || []; |
| var parameters = operation.parameters || []; |
| |
| for (i in sharedParameters) { |
| var parameter = sharedParameters[i]; |
| parameters.unshift(parameter); |
| } |
| if(method !== 'parameters' && _.isObject(operation)) { |
| operation.parameters = operation.parameters || parameters; |
| } |
| |
| for (i in parameters) { |
| var parameter = parameters[i]; |
| location = '/paths' + name + '/' + method + '/parameters'; |
| |
| if (parameter.in === 'body' && parameter.schema) { |
| if(_.isArray(parameter.schema.allOf)) { |
| // move to a definition |
| var modelName = 'inline_model'; |
| var name = modelName; |
| var done = false; var counter = 0; |
| while(!done) { |
| if(typeof spec.definitions[name] === 'undefined') { |
| done = true; |
| break; |
| } |
| name = modelName + '_' + counter; |
| counter ++; |
| } |
| spec.definitions[name] = { allOf: parameter.schema.allOf }; |
| delete parameter.schema.allOf; |
| parameter.schema.$ref = '#/definitions/' + name; |
| this.processAllOf(root, name, spec.definitions[name], resolutionTable, unresolvedRefs, spec); |
| } |
| else { |
| this.resolveTo(root, parameter.schema, resolutionTable, location); |
| } |
| } |
| |
| if (parameter.$ref) { |
| // parameter reference |
| this.resolveInline(root, spec, parameter, resolutionTable, unresolvedRefs, parameter.$ref); |
| } |
| } |
| |
| for (responseCode in operation.responses) { |
| var response = operation.responses[responseCode]; |
| location = '/paths' + name + '/' + method + '/responses/' + responseCode; |
| |
| if(_.isObject(response)) { |
| if(response.$ref) { |
| // response reference |
| this.resolveInline(root, spec, response, resolutionTable, unresolvedRefs, location); |
| } |
| if (response.schema) { |
| this.resolveTo(root, response.schema, resolutionTable, location); |
| } |
| } |
| } |
| } |
| } |
| // clear them out to avoid multiple resolutions |
| path.parameters = []; |
| } |
| |
| var expectedCalls = 0, toResolve = []; |
| // if the root is same as obj[i].root we can resolve locally |
| var all = resolutionTable; |
| |
| var parts; |
| for(i = 0; i < all.length; i++) { |
| var a = all[i]; |
| if(root === a.root) { |
| if(a.resolveAs === 'ref') { |
| // resolve any path walking |
| var joined = ((a.root || '') + '/' + a.key).split('/'); |
| var normalized = []; |
| var url = ''; |
| var k; |
| |
| if(a.key.indexOf('../') >= 0) { |
| for(var j = 0; j < joined.length; j++) { |
| if(joined[j] === '..') { |
| normalized = normalized.slice(0, normalized.length-1); |
| } |
| else { |
| normalized.push(joined[j]); |
| } |
| } |
| for(k = 0; k < normalized.length; k ++) { |
| if(k > 0) { |
| url += '/'; |
| } |
| url += normalized[k]; |
| } |
| // we now have to remote resolve this because the path has changed |
| a.root = url; |
| toResolve.push(a); |
| } |
| else { |
| parts = a.key.split('#'); |
| if(parts.length === 2) { |
| if(parts[0].indexOf('http://') === 0 || parts[0].indexOf('https://') === 0) { |
| a.root = parts[0]; |
| } |
| location = parts[1].split('/'); |
| var r; |
| var s = spec; |
| for(k = 0; k < location.length; k++) { |
| var part = location[k]; |
| if(part !== '') { |
| s = s[part]; |
| if(typeof s !== 'undefined') { |
| r = s; |
| } |
| else { |
| r = null; |
| break; |
| } |
| } |
| } |
| if(r === null) { |
| // must resolve this too |
| toResolve.push(a); |
| } |
| } |
| } |
| } |
| else { |
| if (a.resolveAs === 'inline') { |
| if(a.key && a.key.indexOf('#') === -1 && a.key.charAt(0) !== '/') { |
| // handle relative schema |
| parts = a.root.split('/'); |
| location = ''; |
| for(i = 0; i < parts.length - 1; i++) { |
| location += parts[i] + '/'; |
| } |
| location += a.key; |
| a.root = location; |
| a.location = ''; |
| } |
| toResolve.push(a); |
| } |
| } |
| } |
| else { |
| toResolve.push(a); |
| } |
| } |
| expectedCalls = toResolve.length; |
| |
| // resolve anything that is local |
| for(var ii = 0; ii < toResolve.length; ii++) { |
| (function(item, spec, self) { |
| if(item.root === null || item.root === root) { |
| // local resolve |
| self.resolveItem(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, item); |
| processedCalls += 1; |
| |
| if(processedCalls === expectedCalls) { |
| self.finish(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback, true); |
| } |
| } |
| else { |
| var obj = { |
| useJQuery: false, // TODO |
| url: item.root, |
| method: 'get', |
| headers: { |
| accept: self.scope.swaggerRequestHeaders || 'application/json' |
| }, |
| on: { |
| error: function (error) { |
| processedCalls += 1; |
| unresolvedRefs[item.key] = { |
| root: item.root, |
| location: item.location |
| }; |
| |
| if (processedCalls === expectedCalls) { |
| self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback); |
| } |
| }, // jshint ignore:line |
| response: function (response) { |
| var swagger = response.obj; |
| self.resolveItem(swagger, item.root, resolutionTable, resolvedRefs, unresolvedRefs, item); |
| processedCalls += 1; |
| |
| if (processedCalls === expectedCalls) { |
| self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback); |
| } |
| } |
| } // jshint ignore:line |
| }; |
| |
| if (scope && scope.clientAuthorizations) { |
| scope.clientAuthorizations.apply(obj); |
| } |
| |
| new SwaggerHttp().execute(obj, opts); |
| } |
| }(toResolve[ii], spec, this)); |
| } |
| |
| if (Object.keys(toResolve).length === 0) { |
| this.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback); |
| } |
| }; |
| |
| Resolver.prototype.resolveItem = function(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, item) { |
| var path = item.location; |
| var location = spec, parts = path.split('/'); |
| if(path !== '') { |
| for (var j = 0; j < parts.length; j++) { |
| var segment = parts[j]; |
| if (segment.indexOf('~1') !== -1) { |
| segment = parts[j].replace(/~0/g, '~').replace(/~1/g, '/'); |
| if (segment.charAt(0) !== '/') { |
| segment = '/' + segment; |
| } |
| } |
| if (typeof location === 'undefined' || location === null) { |
| break; |
| } |
| if (segment === '' && j === (parts.length - 1) && parts.length > 1) { |
| location = null; |
| break; |
| } |
| if (segment.length > 0) { |
| location = location[segment]; |
| } |
| } |
| } |
| var resolved = item.key; |
| parts = item.key.split('/'); |
| var resolvedName = parts[parts.length-1]; |
| |
| if(resolvedName.indexOf('#') >= 0) { |
| resolvedName = resolvedName.split('#')[1]; |
| } |
| |
| if (location !== null && typeof location !== 'undefined') { |
| resolvedRefs[resolved] = { |
| name: resolvedName, |
| obj: location, |
| key: item.key, |
| root: item.root |
| }; |
| } else { |
| unresolvedRefs[resolved] = { |
| root: item.root, |
| location: item.location |
| }; |
| } |
| }; |
| |
| Resolver.prototype.finish = function (spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback, localResolve) { |
| // walk resolution table and replace with resolved refs |
| var ref; |
| for (ref in resolutionTable) { |
| var item = resolutionTable[ref]; |
| |
| var key = item.key; |
| var resolvedTo = resolvedRefs[key]; |
| if (resolvedTo) { |
| spec.definitions = spec.definitions || {}; |
| if (item.resolveAs === 'ref') { |
| if (localResolve !== true) { |
| // don't retain root for local definitions |
| for (key in resolvedTo.obj) { |
| var abs = this.retainRoot(resolvedTo.obj[key], item.root); |
| } |
| } |
| spec.definitions[resolvedTo.name] = resolvedTo.obj; |
| item.obj.$ref = '#/definitions/' + resolvedTo.name; |
| } else if (item.resolveAs === 'inline') { |
| var targetObj = item.obj; |
| targetObj['x-resolved-from'] = [ item.key ]; |
| delete targetObj.$ref; |
| |
| for (key in resolvedTo.obj) { |
| var abs = resolvedTo.obj[key]; |
| |
| if (localResolve !== true) { |
| // don't retain root for local definitions |
| abs = this.retainRoot(resolvedTo.obj[key], item.root); |
| } |
| targetObj[key] = abs; |
| } |
| } |
| } |
| } |
| var existingUnresolved = this.countUnresolvedRefs(spec); |
| |
| if(existingUnresolved === 0 || this.iteration > 5) { |
| this.resolveAllOf(spec.definitions); |
| callback.call(this.scope, spec, unresolvedRefs); |
| } |
| else { |
| this.iteration += 1; |
| this.resolve(spec, root, callback, this.scope); |
| } |
| }; |
| |
| Resolver.prototype.countUnresolvedRefs = function(spec) { |
| var i; |
| var refs = this.getRefs(spec); |
| var keys = []; |
| var unresolvedKeys = []; |
| for(i in refs) { |
| if(i.indexOf('#') === 0) { |
| keys.push(i.substring(1)); |
| } |
| else { |
| unresolvedKeys.push(i); |
| } |
| } |
| |
| // verify possible keys |
| for (i = 0; i < keys.length; i++) { |
| var part = keys[i]; |
| var parts = part.split('/'); |
| var obj = spec; |
| |
| for (var k = 0; k < parts.length; k++) { |
| var key = parts[k]; |
| if(key !== '') { |
| obj = obj[key]; |
| if(typeof obj === 'undefined') { |
| unresolvedKeys.push(part); |
| break; |
| } |
| } |
| } |
| } |
| return unresolvedKeys.length; |
| }; |
| |
| Resolver.prototype.getRefs = function(spec, obj) { |
| obj = obj || spec; |
| var output = {}; |
| for(var key in obj) { |
| if (!obj.hasOwnProperty(key)) { |
| continue; |
| } |
| var item = obj[key]; |
| if(key === '$ref' && typeof item === 'string') { |
| output[item] = null; |
| } |
| else if(_.isObject(item)) { |
| var o = this.getRefs(item); |
| for(var k in o) { |
| output[k] = null; |
| } |
| } |
| } |
| return output; |
| }; |
| |
| Resolver.prototype.retainRoot = function(obj, root) { |
| // walk object and look for relative $refs |
| for(var key in obj) { |
| var item = obj[key]; |
| if(key === '$ref' && typeof item === 'string') { |
| // stop and inspect |
| if(item.indexOf('http://') !== 0 && item.indexOf('https://') !== 0) { |
| if(item.indexOf('#') !== 0) { |
| item = '#' + item; |
| } |
| item = (root || '') + item; |
| obj[key] = item; |
| } |
| } |
| else if(_.isObject(item)) { |
| this.retainRoot(item, root); |
| } |
| } |
| return obj; |
| }; |
| |
| /** |
| * immediately in-lines local refs, queues remote refs |
| * for inline resolution |
| */ |
| Resolver.prototype.resolveInline = function (root, spec, property, resolutionTable, unresolvedRefs, location) { |
| var key = property.$ref, ref = property.$ref, i, p, p2, rs; |
| var rootTrimmed = false; |
| if (ref) { |
| if(ref.indexOf('../') === 0) { |
| // reset root |
| p = ref.split('../'); |
| p2 = root.split('/'); |
| ref = ''; |
| for(i = 0; i < p.length; i++) { |
| if(p[i] === '') { |
| p2 = p2.slice(0, p2.length-1); |
| } |
| else { |
| ref += p[i]; |
| } |
| } |
| root = ''; |
| for(i = 0; i < p2.length - 1; i++) { |
| if(i > 0) { root += '/'; } |
| root += p2[i]; |
| } |
| rootTrimmed = true; |
| } |
| if(ref.indexOf('#') >= 0) { |
| if(ref.indexOf('/') === 0) { |
| rs = ref.split('#'); |
| p = root.split('//'); |
| p2 = p[1].split('/'); |
| root = p[0] + '//' + p2[0] + rs[0]; |
| location = rs[1]; |
| } |
| else { |
| rs = ref.split('#'); |
| if(rs[0] !== '') { |
| p2 = root.split('/'); |
| p2 = p2.slice(0, p2.length - 1); |
| if(!rootTrimmed) { |
| root = ''; |
| for (var k = 0; k < p2.length; k++) { |
| if(k > 0) { root += '/'; } |
| root += p2[k]; |
| } |
| } |
| root += '/' + ref.split('#')[0]; |
| } |
| location = rs[1]; |
| } |
| } |
| if (ref.indexOf('http') === 0) { |
| if(ref.indexOf('#') >= 0) { |
| root = ref.split('#')[0]; |
| location = ref.split('#')[1]; |
| } |
| else { |
| root = ref; |
| location = ''; |
| } |
| resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location}); |
| } else if (ref.indexOf('#') === 0) { |
| location = ref.split('#')[1]; |
| resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location}); |
| } |
| else { |
| resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location}); |
| } |
| } |
| else if (property.type === 'array') { |
| this.resolveTo(root, property.items, resolutionTable, location); |
| } |
| }; |
| |
| Resolver.prototype.resolveTo = function (root, property, resolutionTable, location) { |
| var sp, i; |
| var ref = property.$ref; |
| var lroot = root; |
| if (typeof ref !== 'undefined') { |
| if(ref.indexOf('#') >= 0) { |
| var parts = ref.split('#'); |
| |
| // #/definitions/foo |
| // foo.json#/bar |
| if(parts[0] && ref.indexOf('/') === 0) { |
| |
| } |
| else if(parts[0] && parts[0].indexOf('http') === 0) { |
| lroot = parts[0]; |
| ref = parts[1]; |
| } |
| else if(parts[0] && parts[0].length > 0) { |
| // relative file |
| sp = root.split('/'); |
| lroot = ''; |
| for(i = 0; i < sp.length - 1; i++) { |
| lroot += sp[i] + '/'; |
| } |
| lroot += parts[0]; |
| } |
| else { |
| |
| } |
| |
| location = parts[1]; |
| } |
| else if (ref.indexOf('http://') === 0 || ref.indexOf('https://') === 0) { |
| lroot = ref; |
| location = ''; |
| } |
| else { |
| // relative file |
| sp = root.split('/'); |
| lroot = ''; |
| for(i = 0; i < sp.length - 1; i++) { |
| lroot += sp[i] + '/'; |
| } |
| lroot += ref; |
| location = ''; |
| } |
| resolutionTable.push({ |
| obj: property, resolveAs: 'ref', root: lroot, key: ref, location: location |
| }); |
| } else if (property.type === 'array') { |
| var items = property.items; |
| this.resolveTo(root, items, resolutionTable, location); |
| } else { |
| if(property && property.properties) { |
| var name = this.uniqueName('inline_model'); |
| this.spec.definitions[name] = _.cloneDeep(property); |
| property['$ref'] = '#/definitions/' + name; |
| delete property.type; |
| delete property.properties; |
| } |
| } |
| }; |
| |
| Resolver.prototype.uniqueName = function(base) { |
| var name = base; |
| var count = 0; |
| while(true) { |
| if(!_.isObject(this.spec.definitions[name])) { |
| return name; |
| } |
| name = base + '_' + count; |
| count++; |
| } |
| }; |
| |
| Resolver.prototype.resolveAllOf = function(spec, obj, depth) { |
| depth = depth || 0; |
| obj = obj || spec; |
| var name; |
| for(var key in obj) { |
| if (!obj.hasOwnProperty(key)) { |
| continue; |
| } |
| var item = obj[key]; |
| if(item === null) { |
| throw new TypeError('Swagger 2.0 does not support null types (' + obj + '). See https://github.com/swagger-api/swagger-spec/issues/229.'); |
| } |
| if(typeof item === 'object') { |
| this.resolveAllOf(spec, item, depth + 1); |
| } |
| if(item && typeof item.allOf !== 'undefined') { |
| var allOf = item.allOf; |
| if(_.isArray(allOf)) { |
| var output = _.cloneDeep(item); |
| delete output.allOf; |
| |
| output['x-composed'] = true; |
| if (typeof item['x-resolved-from'] !== 'undefined') { |
| output['x-resolved-from'] = item['x-resolved-from']; |
| } |
| |
| for(var i = 0; i < allOf.length; i++) { |
| var component = allOf[i]; |
| var source = 'self'; |
| if(typeof component['x-resolved-from'] !== 'undefined') { |
| source = component['x-resolved-from'][0]; |
| } |
| |
| for(var part in component) { |
| if(!output.hasOwnProperty(part)) { |
| output[part] = _.cloneDeep(component[part]); |
| if(part === 'properties') { |
| for(name in output[part]) { |
| output[part][name]['x-resolved-from'] = source; |
| } |
| } |
| } |
| else { |
| if(part === 'properties') { |
| var properties = component[part]; |
| for(name in properties) { |
| output.properties[name] = _.cloneDeep(properties[name]); |
| var resolvedFrom = properties[name]['x-resolved-from']; |
| if (typeof resolvedFrom === 'undefined' || resolvedFrom === 'self') { |
| resolvedFrom = source; |
| } |
| output.properties[name]['x-resolved-from'] = resolvedFrom; |
| } |
| } |
| else if(part === 'required') { |
| // merge & dedup the required array |
| var a = output.required.concat(component[part]); |
| for(var k = 0; k < a.length; ++k) { |
| for(var j = k + 1; j < a.length; ++j) { |
| if(a[k] === a[j]) { a.splice(j--, 1); } |
| } |
| } |
| output.required = a; |
| } |
| else if(part === 'x-resolved-from') { |
| output['x-resolved-from'].push(source); |
| } |
| else { |
| // TODO: need to merge this property |
| // console.log('what to do with ' + part) |
| } |
| } |
| } |
| } |
| obj[key] = output; |
| } |
| } |
| if(_.isObject(item)) { |
| this.resolveAllOf(spec, item, depth + 1); |
| } |
| } |
| }; |
| |
| },{"./http":5,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isObject":148}],7:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Helpers = require('./helpers'); |
| |
| var _ = { |
| isPlainObject: require('lodash-compat/lang/isPlainObject'), |
| isUndefined: require('lodash-compat/lang/isUndefined'), |
| isArray: require('lodash-compat/lang/isArray'), |
| isObject: require('lodash-compat/lang/isObject'), |
| isEmpty: require('lodash-compat/lang/isEmpty'), |
| map: require('lodash-compat/collection/map'), |
| indexOf: require('lodash-compat/array/indexOf'), |
| cloneDeep: require('lodash-compat/lang/cloneDeep'), |
| keys: require('lodash-compat/object/keys'), |
| forEach: require('lodash-compat/collection/forEach') |
| }; |
| |
| module.exports.optionHtml = optionHtml; |
| module.exports.typeFromJsonSchema = typeFromJsonSchema; |
| module.exports.getStringSignature = getStringSignature; |
| module.exports.schemaToHTML = schemaToHTML; |
| module.exports.schemaToJSON = schemaToJSON; |
| |
| function optionHtml(label, value) { |
| return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>'; |
| } |
| |
| function typeFromJsonSchema(type, format) { |
| var str; |
| |
| if (type === 'integer' && format === 'int32') { |
| str = 'integer'; |
| } else if (type === 'integer' && format === 'int64') { |
| str = 'long'; |
| } else if (type === 'integer' && typeof format === 'undefined') { |
| str = 'long'; |
| } else if (type === 'string' && format === 'date-time') { |
| str = 'date-time'; |
| } else if (type === 'string' && format === 'date') { |
| str = 'date'; |
| } else if (type === 'number' && format === 'float') { |
| str = 'float'; |
| } else if (type === 'number' && format === 'double') { |
| str = 'double'; |
| } else if (type === 'number' && typeof format === 'undefined') { |
| str = 'double'; |
| } else if (type === 'boolean') { |
| str = 'boolean'; |
| } else if (type === 'string') { |
| str = 'string'; |
| } |
| |
| return str; |
| } |
| |
| function getStringSignature(obj, baseComponent) { |
| var str = ''; |
| |
| if (typeof obj.$ref !== 'undefined') { |
| str += Helpers.simpleRef(obj.$ref); |
| } else if (typeof obj.type === 'undefined') { |
| str += 'object'; |
| } else if (obj.type === 'array') { |
| if (baseComponent) { |
| str += getStringSignature((obj.items || obj.$ref || {})); |
| } else { |
| str += 'Array['; |
| str += getStringSignature((obj.items || obj.$ref || {})); |
| str += ']'; |
| } |
| } else if (obj.type === 'integer' && obj.format === 'int32') { |
| str += 'integer'; |
| } else if (obj.type === 'integer' && obj.format === 'int64') { |
| str += 'long'; |
| } else if (obj.type === 'integer' && typeof obj.format === 'undefined') { |
| str += 'long'; |
| } else if (obj.type === 'string' && obj.format === 'date-time') { |
| str += 'date-time'; |
| } else if (obj.type === 'string' && obj.format === 'date') { |
| str += 'date'; |
| } else if (obj.type === 'string' && typeof obj.format === 'undefined') { |
| str += 'string'; |
| } else if (obj.type === 'number' && obj.format === 'float') { |
| str += 'float'; |
| } else if (obj.type === 'number' && obj.format === 'double') { |
| str += 'double'; |
| } else if (obj.type === 'number' && typeof obj.format === 'undefined') { |
| str += 'double'; |
| } else if (obj.type === 'boolean') { |
| str += 'boolean'; |
| } else if (obj.$ref) { |
| str += Helpers.simpleRef(obj.$ref); |
| } else { |
| str += obj.type; |
| } |
| |
| return str; |
| } |
| |
| function schemaToJSON(schema, models, modelsToIgnore, modelPropertyMacro) { |
| // Resolve the schema (Handle nested schemas) |
| schema = Helpers.resolveSchema(schema); |
| |
| if(typeof modelPropertyMacro !== 'function') { |
| modelPropertyMacro = function(prop){ |
| return (prop || {}).default; |
| }; |
| } |
| |
| modelsToIgnore= modelsToIgnore || {}; |
| |
| var type = schema.type || 'object'; |
| var format = schema.format; |
| var model; |
| var output; |
| |
| if (!_.isUndefined(schema.example)) { |
| output = schema.example; |
| } else if (_.isUndefined(schema.items) && _.isArray(schema.enum)) { |
| output = schema.enum[0]; |
| } |
| |
| if (_.isUndefined(output)) { |
| if (schema.$ref) { |
| model = models[Helpers.simpleRef(schema.$ref)]; |
| |
| if (!_.isUndefined(model)) { |
| if (_.isUndefined(modelsToIgnore[model.name])) { |
| modelsToIgnore[model.name] = model; |
| output = schemaToJSON(model.definition, models, modelsToIgnore, modelPropertyMacro); |
| delete modelsToIgnore[model.name]; |
| } else { |
| if (model.type === 'array') { |
| output = []; |
| } else { |
| output = {}; |
| } |
| } |
| } |
| } else if (!_.isUndefined(schema.default)) { |
| output = schema.default; |
| } else if (type === 'string') { |
| if (format === 'date-time') { |
| output = new Date().toISOString(); |
| } else if (format === 'date') { |
| output = new Date().toISOString().split('T')[0]; |
| } else { |
| output = 'string'; |
| } |
| } else if (type === 'integer') { |
| output = 0; |
| } else if (type === 'number') { |
| output = 0.0; |
| } else if (type === 'boolean') { |
| output = true; |
| } else if (type === 'object') { |
| output = {}; |
| |
| _.forEach(schema.properties, function (property, name) { |
| var cProperty = _.cloneDeep(property); |
| |
| // Allow macro to set the default value |
| cProperty.default = modelPropertyMacro(property); |
| |
| output[name] = schemaToJSON(cProperty, models, modelsToIgnore, modelPropertyMacro); |
| }); |
| } else if (type === 'array') { |
| output = []; |
| |
| if (_.isArray(schema.items)) { |
| _.forEach(schema.items, function (item) { |
| output.push(schemaToJSON(item, models, modelsToIgnore, modelPropertyMacro)); |
| }); |
| } else if (_.isPlainObject(schema.items)) { |
| output.push(schemaToJSON(schema.items, models, modelsToIgnore, modelPropertyMacro)); |
| } else if (_.isUndefined(schema.items)) { |
| output.push({}); |
| } else { |
| Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process'); |
| } |
| } |
| } |
| |
| return output; |
| } |
| |
| function schemaToHTML(name, schema, models, modelPropertyMacro) { |
| |
| var strongOpen = '<span class="strong">'; |
| var strongClose = '</span>'; |
| |
| // Allow for ignoring the 'name' argument.... shifting the rest |
| if(_.isObject(arguments[0])) { |
| name = void 0; |
| schema = arguments[0]; |
| models = arguments[1]; |
| modelPropertyMacro = arguments[2]; |
| } |
| |
| models = models || {}; |
| |
| // Resolve the schema (Handle nested schemas) |
| schema = Helpers.resolveSchema(schema); |
| |
| // Return for empty object |
| if(_.isEmpty(schema)) { |
| return strongOpen + 'Empty' + strongClose; |
| } |
| |
| // Dereference $ref from 'models' |
| if(typeof schema.$ref === 'string') { |
| name = Helpers.simpleRef(schema.$ref); |
| schema = models[name]; |
| if(typeof schema === 'undefined') |
| { |
| return strongOpen + name + ' is not defined!' + strongClose; |
| } |
| } |
| |
| if(typeof name !== 'string') { |
| name = schema.title || 'Inline Model'; |
| } |
| |
| // If we are a Model object... adjust accordingly |
| if(schema.definition) { |
| schema = schema.definition; |
| } |
| |
| if(typeof modelPropertyMacro !== 'function') { |
| modelPropertyMacro = function(prop){ |
| return (prop || {}).default; |
| }; |
| } |
| |
| var references = {}; |
| var seenModels = []; |
| var inlineModels = 0; |
| |
| |
| |
| // Generate current HTML |
| var html = processModel(schema, name); |
| |
| // Generate references HTML |
| while (_.keys(references).length > 0) { |
| /* jshint ignore:start */ |
| _.forEach(references, function (schema, name) { |
| var seenModel = _.indexOf(seenModels, name) > -1; |
| |
| delete references[name]; |
| |
| if (!seenModel) { |
| seenModels.push(name); |
| |
| html += '<br />' + processModel(schema, name); |
| } |
| }); |
| /* jshint ignore:end */ |
| } |
| |
| return html; |
| |
| ///////////////////////////////// |
| |
| function addReference(schema, name, skipRef) { |
| var modelName = name; |
| var model; |
| |
| if (schema.$ref) { |
| modelName = schema.title || Helpers.simpleRef(schema.$ref); |
| model = models[Helpers.simpleRef(schema.$ref)]; |
| } else if (_.isUndefined(name)) { |
| modelName = schema.title || 'Inline Model ' + (++inlineModels); |
| model = {definition: schema}; |
| } |
| |
| if (skipRef !== true) { |
| references[modelName] = _.isUndefined(model) ? {} : model.definition; |
| } |
| |
| return modelName; |
| } |
| |
| function primitiveToHTML(schema) { |
| var html = '<span class="propType">'; |
| var type = schema.type || 'object'; |
| |
| if (schema.$ref) { |
| html += addReference(schema, Helpers.simpleRef(schema.$ref)); |
| } else if (type === 'object') { |
| if (!_.isUndefined(schema.properties)) { |
| html += addReference(schema); |
| } else { |
| html += 'object'; |
| } |
| } else if (type === 'array') { |
| html += 'Array['; |
| |
| if (_.isArray(schema.items)) { |
| html += _.map(schema.items, addReference).join(','); |
| } else if (_.isPlainObject(schema.items)) { |
| if (_.isUndefined(schema.items.$ref)) { |
| if (!_.isUndefined(schema.items.type) && _.indexOf(['array', 'object'], schema.items.type) === -1) { |
| html += schema.items.type; |
| } else { |
| html += addReference(schema.items); |
| } |
| } else { |
| html += addReference(schema.items, Helpers.simpleRef(schema.items.$ref)); |
| } |
| } else { |
| Helpers.log('Array type\'s \'items\' schema is not an array or an object, cannot process'); |
| html += 'object'; |
| } |
| |
| html += ']'; |
| } else { |
| html += schema.type; |
| } |
| |
| html += '</span>'; |
| |
| return html; |
| } |
| |
| function primitiveToOptionsHTML(schema, html) { |
| var options = ''; |
| var type = schema.type || 'object'; |
| var isArray = type === 'array'; |
| |
| if (isArray) { |
| if (_.isPlainObject(schema.items) && !_.isUndefined(schema.items.type)) { |
| type = schema.items.type; |
| } else { |
| type = 'object'; |
| } |
| } |
| |
| if (!_.isUndefined(schema.default)) { |
| options += optionHtml('Default', schema.default); |
| } |
| |
| switch (type) { |
| case 'string': |
| if (schema.minLength) { |
| options += optionHtml('Min. Length', schema.minLength); |
| } |
| |
| if (schema.maxLength) { |
| options += optionHtml('Max. Length', schema.maxLength); |
| } |
| |
| if (schema.pattern) { |
| options += optionHtml('Reg. Exp.', schema.pattern); |
| } |
| break; |
| case 'integer': |
| case 'number': |
| if (schema.minimum) { |
| options += optionHtml('Min. Value', schema.minimum); |
| } |
| |
| if (schema.exclusiveMinimum) { |
| options += optionHtml('Exclusive Min.', 'true'); |
| } |
| |
| if (schema.maximum) { |
| options += optionHtml('Max. Value', schema.maximum); |
| } |
| |
| if (schema.exclusiveMaximum) { |
| options += optionHtml('Exclusive Max.', 'true'); |
| } |
| |
| if (schema.multipleOf) { |
| options += optionHtml('Multiple Of', schema.multipleOf); |
| } |
| |
| break; |
| } |
| |
| if (isArray) { |
| if (schema.minItems) { |
| options += optionHtml('Min. Items', schema.minItems); |
| } |
| |
| if (schema.maxItems) { |
| options += optionHtml('Max. Items', schema.maxItems); |
| } |
| |
| if (schema.uniqueItems) { |
| options += optionHtml('Unique Items', 'true'); |
| } |
| |
| if (schema.collectionFormat) { |
| options += optionHtml('Coll. Format', schema.collectionFormat); |
| } |
| } |
| |
| if (_.isUndefined(schema.items)) { |
| if (_.isArray(schema.enum)) { |
| var enumString; |
| |
| if (type === 'number' || type === 'integer') { |
| enumString = schema.enum.join(', '); |
| } else { |
| enumString = '"' + schema.enum.join('", "') + '"'; |
| } |
| |
| options += optionHtml('Enum', enumString); |
| } |
| } |
| |
| if (options.length > 0) { |
| html = '<span class="propWrap">' + html + '<table class="optionsWrapper"><tr><th colspan="2">' + type + '</th></tr>' + options + '</table></span>'; |
| } |
| |
| return html; |
| } |
| |
| function processModel(schema, name) { |
| var type = schema.type || 'object'; |
| var isArray = schema.type === 'array'; |
| var html = strongOpen + name + ' ' + (isArray ? '[' : '{') + strongClose; |
| |
| if (name) { |
| seenModels.push(name); |
| } |
| |
| if (isArray) { |
| if (_.isArray(schema.items)) { |
| html += '<div>' + _.map(schema.items, function (item) { |
| var type = item.type || 'object'; |
| |
| if (_.isUndefined(item.$ref)) { |
| if (_.indexOf(['array', 'object'], type) > -1) { |
| if (type === 'object' && _.isUndefined(item.properties)) { |
| return 'object'; |
| } else { |
| return addReference(item); |
| } |
| } else { |
| return primitiveToOptionsHTML(item, type); |
| } |
| } else { |
| return addReference(item, Helpers.simpleRef(item.$ref)); |
| } |
| }).join(',</div><div>'); |
| } else if (_.isPlainObject(schema.items)) { |
| if (_.isUndefined(schema.items.$ref)) { |
| if (_.indexOf(['array', 'object'], schema.items.type || 'object') > -1) { |
| if ((_.isUndefined(schema.items.type) || schema.items.type === 'object') && _.isUndefined(schema.items.properties)) { |
| html += '<div>object</div>'; |
| } else { |
| html += '<div>' + addReference(schema.items) + '</div>'; |
| } |
| } else { |
| html += '<div>' + primitiveToOptionsHTML(schema.items, schema.items.type) + '</div>'; |
| } |
| } else { |
| html += '<div>' + addReference(schema.items, Helpers.simpleRef(schema.items.$ref)) + '</div>'; |
| } |
| } else { |
| Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process'); |
| html += '<div>object</div>'; |
| } |
| } else { |
| if (schema.$ref) { |
| html += '<div>' + addReference(schema, name) + '</div>'; |
| } else if (type === 'object') { |
| if (_.isPlainObject(schema.properties)) { |
| var contents = _.map(schema.properties, function (property, name) { |
| var propertyIsRequired = (_.indexOf(schema.required, name) >= 0); |
| var cProperty = _.cloneDeep(property); |
| |
| var requiredClass = propertyIsRequired ? 'required' : ''; |
| var html = '<div' + (property.readOnly ? ' class="readOnly"' : '') + '><span class="propName ' + requiredClass + '">' + name + '</span> ('; |
| var model; |
| var propDescription; |
| |
| // Allow macro to set the default value |
| cProperty.default = modelPropertyMacro(cProperty); |
| |
| // Resolve the schema (Handle nested schemas) |
| cProperty = Helpers.resolveSchema(cProperty); |
| |
| propDescription = property.description || cProperty.description; |
| |
| // We need to handle property references to primitives (Issue 339) |
| if (!_.isUndefined(cProperty.$ref)) { |
| model = models[Helpers.simpleRef(cProperty.$ref)]; |
| |
| if (!_.isUndefined(model) && _.indexOf([undefined, 'array', 'object'], model.definition.type) === -1) { |
| // Use referenced schema |
| cProperty = Helpers.resolveSchema(model.definition); |
| } |
| } |
| |
| html += primitiveToHTML(cProperty); |
| |
| if(!propertyIsRequired) { |
| html += ', <span class="propOptKey">optional</span>'; |
| } |
| |
| if(property.readOnly) { |
| html += ', <span class="propReadOnly">read only</span>'; |
| } |
| |
| html += ')'; |
| |
| if (!_.isUndefined(propDescription)) { |
| html += ': ' + '<span class="propDesc">' + propDescription + '</span>'; |
| } |
| |
| if (cProperty.enum) { |
| html += ' = <span class="propVals">[\'' + cProperty.enum.join('\', \'') + '\']</span>'; |
| } |
| |
| return primitiveToOptionsHTML(cProperty, html); |
| }).join(',</div>'); |
| } |
| |
| if (contents) { |
| html += contents + '</div>'; |
| } |
| } else { |
| html += '<div>' + primitiveToOptionsHTML(schema, type) + '</div>'; |
| } |
| } |
| |
| return html + strongOpen + (isArray ? ']' : '}') + strongClose; |
| } |
| } |
| |
| },{"./helpers":4,"lodash-compat/array/indexOf":53,"lodash-compat/collection/forEach":58,"lodash-compat/collection/map":60,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isArray":144,"lodash-compat/lang/isEmpty":145,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isUndefined":152,"lodash-compat/object/keys":153}],8:[function(require,module,exports){ |
| 'use strict'; |
| |
| var SwaggerHttp = require('./http'); |
| var _ = { |
| isObject: require('lodash-compat/lang/isObject') |
| }; |
| |
| var SwaggerSpecConverter = module.exports = function () { |
| this.errors = []; |
| this.warnings = []; |
| this.modelMap = {}; |
| }; |
| |
| SwaggerSpecConverter.prototype.setDocumentationLocation = function (location) { |
| this.docLocation = location; |
| }; |
| |
| /** |
| * converts a resource listing OR api declaration |
| **/ |
| SwaggerSpecConverter.prototype.convert = function (obj, clientAuthorizations, opts, callback) { |
| // not a valid spec |
| if(!obj || !Array.isArray(obj.apis)) { |
| return this.finish(callback, null); |
| } |
| this.clientAuthorizations = clientAuthorizations; |
| |
| // create a new swagger object to return |
| var swagger = { swagger: '2.0' }; |
| |
| swagger.originalVersion = obj.swaggerVersion; |
| |
| // add the info |
| this.apiInfo(obj, swagger); |
| |
| // add security definitions |
| this.securityDefinitions(obj, swagger); |
| |
| // take basePath into account |
| if (obj.basePath) { |
| this.setDocumentationLocation(obj.basePath); |
| } |
| |
| // see if this is a single-file swagger definition |
| var isSingleFileSwagger = false; |
| var i; |
| for(i = 0; i < obj.apis.length; i++) { |
| var api = obj.apis[i]; |
| if(Array.isArray(api.operations)) { |
| isSingleFileSwagger = true; |
| } |
| } |
| if(isSingleFileSwagger) { |
| this.declaration(obj, swagger); |
| this.finish(callback, swagger); |
| } |
| else { |
| this.resourceListing(obj, swagger, opts, callback); |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.declaration = function(obj, swagger) { |
| var name, i, p, pos; |
| if(!obj.apis) { |
| return; |
| } |
| |
| if (obj.basePath.indexOf('http://') === 0) { |
| p = obj.basePath.substring('http://'.length); |
| pos = p.indexOf('/'); |
| if (pos > 0) { |
| swagger.host = p.substring(0, pos); |
| swagger.basePath = p.substring(pos); |
| } |
| else { |
| swagger.host = p; |
| swagger.basePath = '/'; |
| } |
| } else if (obj.basePath.indexOf('https://') === 0) { |
| p = obj.basePath.substring('https://'.length); |
| pos = p.indexOf('/'); |
| if (pos > 0) { |
| swagger.host = p.substring(0, pos); |
| swagger.basePath = p.substring(pos); |
| } |
| else { |
| swagger.host = p; |
| swagger.basePath = '/'; |
| } |
| } else { |
| swagger.basePath = obj.basePath; |
| } |
| |
| var resourceLevelAuth; |
| if(obj.authorizations) { |
| resourceLevelAuth = obj.authorizations; |
| } |
| if(obj.consumes) { |
| swagger.consumes = obj.consumes; |
| } |
| if(obj.produces) { |
| swagger.produces = obj.produces; |
| } |
| |
| // build a mapping of id to name for 1.0 model resolutions |
| if(_.isObject(obj)) { |
| for(name in obj.models) { |
| var existingModel = obj.models[name]; |
| var key = (existingModel.id || name); |
| this.modelMap[key] = name; |
| } |
| } |
| |
| for(i = 0; i < obj.apis.length; i++) { |
| var api = obj.apis[i]; |
| var path = api.path; |
| var operations = api.operations; |
| this.operations(path, obj.resourcePath, operations, resourceLevelAuth, swagger); |
| } |
| |
| var models = obj.models || {}; |
| this.models(models, swagger); |
| }; |
| |
| SwaggerSpecConverter.prototype.models = function(obj, swagger) { |
| if(!_.isObject(obj)) { |
| return; |
| } |
| var name; |
| |
| swagger.definitions = swagger.definitions || {}; |
| for(name in obj) { |
| var existingModel = obj[name]; |
| var _enum = []; |
| var schema = { properties: {}}; |
| var propertyName; |
| for(propertyName in existingModel.properties) { |
| var existingProperty = existingModel.properties[propertyName]; |
| var property = {}; |
| this.dataType(existingProperty, property); |
| if(existingProperty.description) { |
| property.description = existingProperty.description; |
| } |
| if(existingProperty['enum']) { |
| property['enum'] = existingProperty['enum']; |
| } |
| if(typeof existingProperty.required === 'boolean' && existingProperty.required === true) { |
| _enum.push(propertyName); |
| } |
| if(typeof existingProperty.required === 'string' && existingProperty.required === 'true') { |
| _enum.push(propertyName); |
| } |
| schema.properties[propertyName] = property; |
| } |
| if(_enum.length > 0) { |
| schema['enum'] = _enum; |
| } |
| |
| schema.required = existingModel.required; |
| swagger.definitions[name] = schema; |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.extractTag = function(resourcePath) { |
| var pathString = resourcePath || 'default'; |
| if(pathString.indexOf('http:') === 0 || pathString.indexOf('https:') === 0) { |
| pathString = pathString.split(['/']); |
| pathString = pathString[pathString.length -1].substring(); |
| } |
| if(pathString.endsWith('.json')) { |
| pathString = pathString.substring(0, pathString.length - '.json'.length); |
| } |
| return pathString.replace('/',''); |
| }; |
| |
| SwaggerSpecConverter.prototype.operations = function(path, resourcePath, obj, resourceLevelAuth, swagger) { |
| if(!Array.isArray(obj)) { |
| return; |
| } |
| var i; |
| |
| if(!swagger.paths) { |
| swagger.paths = {}; |
| } |
| |
| var pathObj = swagger.paths[path] || {}; |
| var tag = this.extractTag(resourcePath); |
| swagger.tags = swagger.tags || []; |
| var matched = false; |
| for(i = 0; i < swagger.tags.length; i++) { |
| var tagObject = swagger.tags[i]; |
| if(tagObject.name === tag) { |
| matched = true; |
| } |
| } |
| if(!matched) { |
| swagger.tags.push({name: tag}); |
| } |
| |
| for(i = 0; i < obj.length; i++) { |
| var existingOperation = obj[i]; |
| var method = (existingOperation.method || existingOperation.httpMethod).toLowerCase(); |
| var operation = {tags: [tag]}; |
| var existingAuthorizations = existingOperation.authorizations; |
| |
| if(existingAuthorizations && Object.keys(existingAuthorizations).length === 0) { |
| existingAuthorizations = resourceLevelAuth; |
| } |
| |
| if(typeof existingAuthorizations !== 'undefined') { |
| var scopesObject; |
| for(var key in existingAuthorizations) { |
| operation.security = operation.security || []; |
| var scopes = existingAuthorizations[key]; |
| if(scopes) { |
| var securityScopes = []; |
| for(var j in scopes) { |
| securityScopes.push(scopes[j].scope); |
| } |
| scopesObject = {}; |
| scopesObject[key] = securityScopes; |
| operation.security.push(scopesObject); |
| } |
| else { |
| scopesObject = {}; |
| scopesObject[key] = []; |
| operation.security.push(scopesObject); |
| } |
| } |
| } |
| |
| if(existingOperation.consumes) { |
| operation.consumes = existingOperation.consumes; |
| } |
| else if(swagger.consumes) { |
| operation.consumes = swagger.consumes; |
| } |
| if(existingOperation.produces) { |
| operation.produces = existingOperation.produces; |
| } |
| else if(swagger.produces) { |
| operation.produces = swagger.produces; |
| } |
| if(existingOperation.summary) { |
| operation.summary = existingOperation.summary; |
| } |
| if(existingOperation.notes) { |
| operation.description = existingOperation.notes; |
| } |
| if(existingOperation.nickname) { |
| operation.operationId = existingOperation.nickname; |
| } |
| if(existingOperation.deprecated) { |
| operation.deprecated = existingOperation.deprecated; |
| } |
| |
| this.authorizations(existingAuthorizations, swagger); |
| this.parameters(operation, existingOperation.parameters, swagger); |
| this.responseMessages(operation, existingOperation, swagger); |
| |
| pathObj[method] = operation; |
| } |
| |
| swagger.paths[path] = pathObj; |
| }; |
| |
| SwaggerSpecConverter.prototype.responseMessages = function(operation, existingOperation) { |
| if(!_.isObject(existingOperation)) { |
| return; |
| } |
| // build default response from the operation (1.x) |
| var defaultResponse = {}; |
| this.dataType(existingOperation, defaultResponse); |
| // TODO: look into the real problem of rendering responses in swagger-ui |
| // ....should reponseType have an implicit schema? |
| if(!defaultResponse.schema && defaultResponse.type) { |
| defaultResponse = {schema: defaultResponse}; |
| } |
| |
| operation.responses = operation.responses || {}; |
| |
| // grab from responseMessages (1.2) |
| var has200 = false; |
| if(Array.isArray(existingOperation.responseMessages)) { |
| var i; |
| var existingResponses = existingOperation.responseMessages; |
| for(i = 0; i < existingResponses.length; i++) { |
| var existingResponse = existingResponses[i]; |
| var response = { description: existingResponse.message }; |
| if(existingResponse.code === 200) { |
| has200 = true; |
| } |
| // Convert responseModel -> schema{$ref: responseModel} |
| if(existingResponse.responseModel) { |
| response.schema = {'$ref': '#/definitions/' + existingResponse.responseModel}; |
| } |
| operation.responses['' + existingResponse.code] = response; |
| } |
| } |
| |
| if(has200) { |
| operation.responses['default'] = defaultResponse; |
| } |
| else { |
| operation.responses['200'] = defaultResponse; |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.authorizations = function(obj) { |
| // TODO |
| if(!_.isObject(obj)) { |
| return; |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.parameters = function(operation, obj) { |
| if(!Array.isArray(obj)) { |
| return; |
| } |
| var i; |
| for(i = 0; i < obj.length; i++) { |
| var existingParameter = obj[i]; |
| var parameter = {}; |
| parameter.name = existingParameter.name; |
| parameter.description = existingParameter.description; |
| parameter.required = existingParameter.required; |
| parameter.in = existingParameter.paramType; |
| |
| // per #168 |
| if(parameter.in === 'body') { |
| parameter.name = 'body'; |
| } |
| if(parameter.in === 'form') { |
| parameter.in = 'formData'; |
| } |
| |
| if(existingParameter.enum) { |
| parameter.enum = existingParameter.enum; |
| } |
| |
| if(existingParameter.allowMultiple === true || existingParameter.allowMultiple === 'true') { |
| var innerType = {}; |
| this.dataType(existingParameter, innerType); |
| parameter.type = 'array'; |
| parameter.items = innerType; |
| |
| if(existingParameter.allowableValues) { |
| var av = existingParameter.allowableValues; |
| if(av.valueType === 'LIST') { |
| parameter['enum'] = av.values; |
| } |
| } |
| } |
| else { |
| this.dataType(existingParameter, parameter); |
| } |
| if(typeof existingParameter.defaultValue !== 'undefined') { |
| parameter.default = existingParameter.defaultValue; |
| } |
| |
| operation.parameters = operation.parameters || []; |
| operation.parameters.push(parameter); |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.dataType = function(source, target) { |
| if(!_.isObject(source)) { |
| return; |
| } |
| |
| if(source.minimum) { |
| target.minimum = source.minimum; |
| } |
| if(source.maximum) { |
| target.maximum = source.maximum; |
| } |
| if (source.format) { |
| target.format = source.format; |
| } |
| |
| // default can be 'false' |
| if(typeof source.defaultValue !== 'undefined') { |
| target.default = source.defaultValue; |
| } |
| |
| var jsonSchemaType = this.toJsonSchema(source); |
| if(jsonSchemaType) { |
| target = target || {}; |
| if(jsonSchemaType.type) { |
| target.type = jsonSchemaType.type; |
| } |
| if(jsonSchemaType.format) { |
| target.format = jsonSchemaType.format; |
| } |
| if(jsonSchemaType.$ref) { |
| target.schema = {$ref: jsonSchemaType.$ref}; |
| } |
| if(jsonSchemaType.items) { |
| target.items = jsonSchemaType.items; |
| } |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.toJsonSchema = function(source) { |
| if(!source) { |
| return 'object'; |
| } |
| var detectedType = (source.type || source.dataType || source.responseClass || ''); |
| var lcType = detectedType.toLowerCase(); |
| var format = (source.format || '').toLowerCase(); |
| |
| if(lcType.indexOf('list[') === 0) { |
| var innerType = detectedType.substring(5, detectedType.length - 1); |
| var jsonType = this.toJsonSchema({type: innerType}); |
| return {type: 'array', items: jsonType}; |
| } else if(lcType === 'int' || (lcType === 'integer' && format === 'int32')) { |
| {return {type: 'integer', format: 'int32'};} |
| } else if(lcType === 'long' || (lcType === 'integer' && format === 'int64')) { |
| {return {type: 'integer', format: 'int64'};} |
| } else if(lcType === 'integer') { |
| {return {type: 'integer', format: 'int64'};} |
| } else if(lcType === 'float' || (lcType === 'number' && format === 'float')) { |
| {return {type: 'number', format: 'float'};} |
| } else if(lcType === 'double' || (lcType === 'number' && format === 'double')) { |
| {return {type: 'number', format: 'double'};} |
| } else if((lcType === 'string' && format === 'date-time') || (lcType === 'date')) { |
| {return {type: 'string', format: 'date-time'};} |
| } else if(lcType === 'string') { |
| {return {type: 'string'};} |
| } else if(lcType === 'file') { |
| {return {type: 'file'};} |
| } else if(lcType === 'boolean') { |
| {return {type: 'boolean'};} |
| } else if(lcType === 'boolean') { |
| {return {type: 'boolean'};} |
| } else if(lcType === 'array' || lcType === 'list') { |
| if(source.items) { |
| var it = this.toJsonSchema(source.items); |
| return {type: 'array', items: it}; |
| } |
| else { |
| return {type: 'array', items: {type: 'object'}}; |
| } |
| } else if(source.$ref) { |
| return {$ref: this.modelMap[source.$ref] ? '#/definitions/' + this.modelMap[source.$ref] : source.$ref}; |
| } else if(lcType === 'void' || lcType === '') { |
| {return {};} |
| } else if (this.modelMap[source.type]) { |
| // If this a model using `type` instead of `$ref`, that's fine. |
| return {$ref: '#/definitions/' + this.modelMap[source.type]}; |
| } else { |
| // Unknown model type or 'object', pass it along. |
| return {type: source.type}; |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.resourceListing = function(obj, swagger, opts, callback) { |
| var i; |
| var processedCount = 0; // jshint ignore:line |
| var self = this; // jshint ignore:line |
| var expectedCount = obj.apis.length; |
| var _swagger = swagger; // jshint ignore:line |
| var _opts = {}; |
| |
| if(opts && opts.requestInterceptor){ |
| _opts.requestInterceptor = opts.requestInterceptor; |
| } |
| |
| if(opts && opts.responseInterceptor){ |
| _opts.responseInterceptor = opts.responseInterceptor; |
| } |
| |
| if(expectedCount === 0) { |
| this.finish(callback, swagger); |
| } |
| |
| for(i = 0; i < expectedCount; i++) { |
| var api = obj.apis[i]; |
| var path = api.path; |
| var absolutePath = this.getAbsolutePath(obj.swaggerVersion, this.docLocation, path); |
| |
| if(api.description) { |
| swagger.tags = swagger.tags || []; |
| swagger.tags.push({ |
| name : this.extractTag(api.path), |
| description : api.description || '' |
| }); |
| } |
| var http = { |
| url: absolutePath, |
| headers: {accept: 'application/json'}, |
| on: {}, |
| method: 'get' |
| }; |
| /* jshint ignore:start */ |
| http.on.response = function(data) { |
| processedCount += 1; |
| var obj = data.obj; |
| if(obj) { |
| self.declaration(obj, _swagger); |
| } |
| if(processedCount === expectedCount) { |
| self.finish(callback, _swagger); |
| } |
| }; |
| http.on.error = function(data) { |
| console.error(data); |
| processedCount += 1; |
| if(processedCount === expectedCount) { |
| self.finish(callback, _swagger); |
| } |
| }; |
| /* jshint ignore:end */ |
| |
| if(this.clientAuthorizations && typeof this.clientAuthorizations.apply === 'function') { |
| this.clientAuthorizations.apply(http); |
| } |
| |
| new SwaggerHttp().execute(http, _opts); |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.getAbsolutePath = function(version, docLocation, path) { |
| if(version === '1.0') { |
| if(docLocation.endsWith('.json')) { |
| // get root path |
| var pos = docLocation.lastIndexOf('/'); |
| if(pos > 0) { |
| docLocation = docLocation.substring(0, pos); |
| } |
| } |
| } |
| |
| var location = docLocation; |
| if(path.indexOf('http://') === 0 || path.indexOf('https://') === 0) { |
| location = path; |
| } |
| else { |
| if(docLocation.endsWith('/')) { |
| location = docLocation.substring(0, docLocation.length - 1); |
| } |
| location += path; |
| } |
| location = location.replace('{format}', 'json'); |
| return location; |
| }; |
| |
| SwaggerSpecConverter.prototype.securityDefinitions = function(obj, swagger) { |
| if(obj.authorizations) { |
| var name; |
| for(name in obj.authorizations) { |
| var isValid = false; |
| var securityDefinition = {}; |
| var definition = obj.authorizations[name]; |
| if(definition.type === 'apiKey') { |
| securityDefinition.type = 'apiKey'; |
| securityDefinition.in = definition.passAs; |
| securityDefinition.name = definition.keyname || name; |
| isValid = true; |
| } |
| else if(definition.type === 'basicAuth') { |
| securityDefinition.type = 'basicAuth'; |
| isValid = true; |
| } |
| else if(definition.type === 'oauth2') { |
| var existingScopes = definition.scopes || []; |
| var scopes = {}; |
| var i; |
| for(i in existingScopes) { |
| var scope = existingScopes[i]; |
| scopes[scope.scope] = scope.description; |
| } |
| securityDefinition.type = 'oauth2'; |
| if(i > 0) { |
| securityDefinition.scopes = scopes; |
| } |
| if(definition.grantTypes) { |
| if(definition.grantTypes.implicit) { |
| var implicit = definition.grantTypes.implicit; |
| securityDefinition.flow = 'implicit'; |
| securityDefinition.authorizationUrl = implicit.loginEndpoint; |
| isValid = true; |
| } |
| /* jshint ignore:start */ |
| if(definition.grantTypes['authorization_code']) { |
| if(!securityDefinition.flow) { |
| // cannot set if flow is already defined |
| var authCode = definition.grantTypes['authorization_code']; |
| securityDefinition.flow = 'accessCode'; |
| securityDefinition.authorizationUrl = authCode.tokenRequestEndpoint.url; |
| securityDefinition.tokenUrl = authCode.tokenEndpoint.url; |
| isValid = true; |
| } |
| } |
| /* jshint ignore:end */ |
| } |
| } |
| if(isValid) { |
| swagger.securityDefinitions = swagger.securityDefinitions || {}; |
| swagger.securityDefinitions[name] = securityDefinition; |
| } |
| } |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.apiInfo = function(obj, swagger) { |
| // info section |
| if(obj.info) { |
| var info = obj.info; |
| swagger.info = {}; |
| |
| if(info.contact) { |
| swagger.info.contact = {}; |
| swagger.info.contact.email = info.contact; |
| } |
| if(info.description) { |
| swagger.info.description = info.description; |
| } |
| if(info.title) { |
| swagger.info.title = info.title; |
| } |
| if(info.termsOfServiceUrl) { |
| swagger.info.termsOfService = info.termsOfServiceUrl; |
| } |
| if(info.license || info.licenseUrl) { |
| swagger.license = {}; |
| if(info.license) { |
| swagger.license.name = info.license; |
| } |
| if(info.licenseUrl) { |
| swagger.license.url = info.licenseUrl; |
| } |
| } |
| } |
| else { |
| this.warnings.push('missing info section'); |
| } |
| }; |
| |
| SwaggerSpecConverter.prototype.finish = function (callback, obj) { |
| callback(obj); |
| }; |
| |
| },{"./http":5,"lodash-compat/lang/isObject":148}],9:[function(require,module,exports){ |
| 'use strict'; |
| |
| var _ = { |
| isPlainObject: require('lodash-compat/lang/isPlainObject'), |
| isString: require('lodash-compat/lang/isString'), |
| }; |
| |
| var SchemaMarkup = require('../schema-markup.js'); |
| var jsyaml = require('js-yaml'); |
| |
| var Model = module.exports = function (name, definition, models, modelPropertyMacro) { |
| this.definition = definition || {}; |
| this.isArray = definition.type === 'array'; |
| this.models = models || {}; |
| this.name = definition.title || name || 'Inline Model'; |
| this.modelPropertyMacro = modelPropertyMacro || function (property) { |
| return property.default; |
| }; |
| |
| return this; |
| }; |
| |
| Model.prototype.createJSONSample = Model.prototype.getSampleValue = function (modelsToIgnore) { |
| modelsToIgnore = modelsToIgnore || {}; |
| |
| modelsToIgnore[this.name] = this; |
| |
| // Response support |
| if (this.examples && _.isPlainObject(this.examples) && this.examples['application/json']) { |
| this.definition.example = this.examples['application/json']; |
| |
| if (_.isString(this.definition.example)) { |
| this.definition.example = jsyaml.safeLoad(this.definition.example); |
| } |
| } else if (!this.definition.example) { |
| this.definition.example = this.examples; |
| } |
| |
| return SchemaMarkup.schemaToJSON(this.definition, this.models, modelsToIgnore, this.modelPropertyMacro); |
| }; |
| |
| Model.prototype.getMockSignature = function () { |
| return SchemaMarkup.schemaToHTML(this.name, this.definition, this.models, this.modelPropertyMacro); |
| }; |
| |
| },{"../schema-markup.js":7,"js-yaml":20,"lodash-compat/lang/isPlainObject":149,"lodash-compat/lang/isString":150}],10:[function(require,module,exports){ |
| 'use strict'; |
| |
| var _ = { |
| cloneDeep: require('lodash-compat/lang/cloneDeep'), |
| isUndefined: require('lodash-compat/lang/isUndefined'), |
| isEmpty: require('lodash-compat/lang/isEmpty'), |
| isObject: require('lodash-compat/lang/isObject') |
| }; |
| var helpers = require('../helpers'); |
| var Model = require('./model'); |
| var SwaggerHttp = require('../http'); |
| var Q = require('q'); |
| |
| var Operation = module.exports = function (parent, scheme, operationId, httpMethod, path, args, definitions, models, clientAuthorizations) { |
| var errors = []; |
| |
| parent = parent || {}; |
| args = args || {}; |
| |
| if(parent && parent.options) { |
| this.client = parent.options.client || null; |
| this.requestInterceptor = parent.options.requestInterceptor || null; |
| this.responseInterceptor = parent.options.responseInterceptor || null; |
| } |
| this.authorizations = args.security; |
| this.basePath = parent.basePath || '/'; |
| this.clientAuthorizations = clientAuthorizations; |
| this.consumes = args.consumes || parent.consumes || ['application/json']; |
| this.produces = args.produces || parent.produces || ['application/json']; |
| this.deprecated = args.deprecated; |
| this.description = args.description; |
| this.host = parent.host || 'localhost'; |
| this.method = (httpMethod || errors.push('Operation ' + operationId + ' is missing method.')); |
| this.models = models || {}; |
| this.nickname = (operationId || errors.push('Operations must have a nickname.')); |
| this.operation = args; |
| this.operations = {}; |
| this.parameters = args !== null ? (args.parameters || []) : {}; |
| this.parent = parent; |
| this.path = (path || errors.push('Operation ' + this.nickname + ' is missing path.')); |
| this.responses = (args.responses || {}); |
| this.scheme = scheme || parent.scheme || 'http'; |
| this.schemes = args.schemes || parent.schemes; |
| this.security = args.security; |
| this.summary = args.summary || ''; |
| this.type = null; |
| this.useJQuery = parent.useJQuery; |
| this.enableCookies = parent.enableCookies; |
| this.parameterMacro = parent.parameterMacro || function (operation, parameter) { |
| return parameter.default; |
| }; |
| |
| this.inlineModels = []; |
| |
| if (typeof this.deprecated === 'string') { |
| switch(this.deprecated.toLowerCase()) { |
| case 'true': case 'yes': case '1': { |
| this.deprecated = true; |
| break; |
| } |
| |
| case 'false': case 'no': case '0': case null: { |
| this.deprecated = false; |
| break; |
| } |
| |
| default: this.deprecated = Boolean(this.deprecated); |
| } |
| } |
| |
| var i, model; |
| |
| if (definitions) { |
| // add to global models |
| var key; |
| |
| for (key in definitions) { |
| model = new Model(key, definitions[key], this.models, parent.modelPropertyMacro); |
| |
| if (model) { |
| this.models[key] = model; |
| } |
| } |
| } |
| else { |
| definitions = {}; |
| } |
| |
| for (i = 0; i < this.parameters.length; i++) { |
| var param = this.parameters[i]; |
| |
| // Allow macro to set the default value |
| param.default = this.parameterMacro(this, param); |
| |
| if (param.type === 'array') { |
| param.isList = true; |
| param.allowMultiple = true; |
| // the enum can be defined at the items level |
| //if (param.items && param.items.enum) { |
| // param['enum'] = param.items.enum; |
| //} |
| } |
| |
| var innerType = this.getType(param); |
| |
| if (innerType && innerType.toString().toLowerCase() === 'boolean') { |
| param.allowableValues = {}; |
| param.isList = true; |
| param['enum'] = [true, false]; // use actual primitives |
| } |
| |
| if(typeof param['x-example'] !== 'undefined') { |
| var d = param['x-example']; |
| param.default = d; |
| } |
| if(param['x-examples']) { |
| var d = param['x-examples'].default; |
| if(typeof d !== 'undefined') { |
| param.default = d; |
| } |
| } |
| |
| if (typeof param['enum'] !== 'undefined') { |
| var id; |
| |
| param.allowableValues = {}; |
| param.allowableValues.values = []; |
| param.allowableValues.descriptiveValues = []; |
| |
| for (id = 0; id < param['enum'].length; id++) { |
| var value = param['enum'][id]; |
| var isDefault = (value === param.default || value+'' === param.default); |
| |
| param.allowableValues.values.push(value); |
| // Always have string for descriptive values.... |
| param.allowableValues.descriptiveValues.push({value : value+'', isDefault: isDefault}); |
| } |
| } |
| |
| if (param.type === 'array') { |
| innerType = [innerType]; |
| |
| if (typeof param.allowableValues === 'undefined') { |
| // can't show as a list if no values to select from |
| delete param.isList; |
| delete param.allowMultiple; |
| } |
| } |
| |
| param.signature = this.getModelSignature(innerType, this.models).toString(); |
| param.sampleJSON = this.getModelSampleJSON(innerType, this.models); |
| param.responseClassSignature = param.signature; |
| } |
| |
| var defaultResponseCode, response, responses = this.responses; |
| |
| if (responses['200']) { |
| response = responses['200']; |
| defaultResponseCode = '200'; |
| } else if (responses['201']) { |
| response = responses['201']; |
| defaultResponseCode = '201'; |
| } else if (responses['202']) { |
| response = responses['202']; |
| defaultResponseCode = '202'; |
| } else if (responses['203']) { |
| response = responses['203']; |
| defaultResponseCode = '203'; |
| } else if (responses['204']) { |
| response = responses['204']; |
| defaultResponseCode = '204'; |
| } else if (responses['205']) { |
| response = responses['205']; |
| defaultResponseCode = '205'; |
| } else if (responses['206']) { |
| response = responses['206']; |
| defaultResponseCode = '206'; |
| } else if (responses['default']) { |
| response = responses['default']; |
| defaultResponseCode = 'default'; |
| } |
| |
| if (response && response.schema) { |
| var resolvedModel = this.resolveModel(response.schema, definitions); |
| var successResponse; |
| |
| delete responses[defaultResponseCode]; |
| |
| if (resolvedModel) { |
| this.successResponse = {}; |
| successResponse = this.successResponse[defaultResponseCode] = resolvedModel; |
| } else if (!response.schema.type || response.schema.type === 'object' || response.schema.type === 'array') { |
| // Inline model |
| this.successResponse = {}; |
| successResponse = this.successResponse[defaultResponseCode] = new Model(undefined, response.schema || {}, this.models, parent.modelPropertyMacro); |
| } else { |
| // Primitive |
| this.successResponse = {}; |
| successResponse = this.successResponse[defaultResponseCode] = response.schema; |
| } |
| |
| if (successResponse) { |
| // Attach response properties |
| if (response.description) { |
| successResponse.description = response.description; |
| } |
| |
| if (response.examples) { |
| successResponse.examples = response.examples; |
| } |
| |
| if (response.headers) { |
| successResponse.headers = response.headers; |
| } |
| } |
| |
| this.type = response; |
| } |
| |
| if (errors.length > 0) { |
| if (this.resource && this.resource.api && this.resource.api.fail) { |
| this.resource.api.fail(errors); |
| } |
| } |
| |
| return this; |
| }; |
| |
| Operation.prototype.isDefaultArrayItemValue = function(value, param) { |
| if (param.default && Array.isArray(param.default)) { |
| return param.default.indexOf(value) !== -1; |
| } |
| return value === param.default; |
| }; |
| |
| Operation.prototype.getType = function (param) { |
| var type = param.type; |
| var format = param.format; |
| var isArray = false; |
| var str; |
| |
| if (type === 'integer' && format === 'int32') { |
| str = 'integer'; |
| } else if (type === 'integer' && format === 'int64') { |
| str = 'long'; |
| } else if (type === 'integer') { |
| str = 'integer'; |
| } else if (type === 'string') { |
| if (format === 'date-time') { |
| str = 'date-time'; |
| } else if (format === 'date') { |
| str = 'date'; |
| } else { |
| str = 'string'; |
| } |
| } else if (type === 'number' && format === 'float') { |
| str = 'float'; |
| } else if (type === 'number' && format === 'double') { |
| str = 'double'; |
| } else if (type === 'number') { |
| str = 'double'; |
| } else if (type === 'boolean') { |
| str = 'boolean'; |
| } else if (type === 'array') { |
| isArray = true; |
| |
| if (param.items) { |
| str = this.getType(param.items); |
| } |
| } else if (type === 'file') { |
| str = 'file'; |
| } |
| |
| if (param.$ref) { |
| str = helpers.simpleRef(param.$ref); |
| } |
| |
| var schema = param.schema; |
| |
| if (schema) { |
| var ref = schema.$ref; |
| |
| if (ref) { |
| ref = helpers.simpleRef(ref); |
| |
| if (isArray) { |
| return [ ref ]; |
| } else { |
| return ref; |
| } |
| } else { |
| // If inline schema, we add it our interal hash -> which gives us it's ID (int) |
| if(schema.type === 'object') { |
| return this.addInlineModel(schema); |
| } |
| return this.getType(schema); |
| } |
| } |
| if (isArray) { |
| return [ str ]; |
| } else { |
| return str; |
| } |
| }; |
| |
| /** |
| * adds an inline schema (model) to a hash, where we can ref it later |
| * @param {object} schema a schema |
| * @return {number} the ID of the schema being added, or null |
| **/ |
| Operation.prototype.addInlineModel = function (schema) { |
| var len = this.inlineModels.length; |
| var model = this.resolveModel(schema, {}); |
| if(model) { |
| this.inlineModels.push(model); |
| return 'Inline Model '+len; // return string ref of the inline model (used with #getInlineModel) |
| } |
| return null; // report errors? |
| }; |
| |
| /** |
| * gets the internal ref to an inline model |
| * @param {string} inline_str a string reference to an inline model |
| * @return {Model} the model being referenced. Or null |
| **/ |
| Operation.prototype.getInlineModel = function(inlineStr) { |
| if(/^Inline Model \d+$/.test(inlineStr)) { |
| var id = parseInt(inlineStr.substr('Inline Model'.length).trim(),10); // |
| var model = this.inlineModels[id]; |
| return model; |
| } |
| // I'm returning null here, should I rather throw an error? |
| return null; |
| }; |
| |
| Operation.prototype.resolveModel = function (schema, definitions) { |
| if (typeof schema.$ref !== 'undefined') { |
| var ref = schema.$ref; |
| |
| if (ref.indexOf('#/definitions/') === 0) { |
| ref = ref.substring('#/definitions/'.length); |
| } |
| |
| if (definitions[ref]) { |
| return new Model(ref, definitions[ref], this.models, this.parent.modelPropertyMacro); |
| } |
| // schema must at least be an object to get resolved to an inline Model |
| } else if (schema && typeof schema === 'object' && |
| (schema.type === 'object' || _.isUndefined(schema.type))) { |
| return new Model(undefined, schema, this.models, this.parent.modelPropertyMacro); |
| } |
| |
| return null; |
| }; |
| |
| Operation.prototype.help = function (dontPrint) { |
| var out = this.nickname + ': ' + this.summary + '\n'; |
| |
| for (var i = 0; i < this.parameters.length; i++) { |
| var param = this.parameters[i]; |
| var typeInfo = param.signature; |
| |
| out += '\n * ' + param.name + ' (' + typeInfo + '): ' + param.description; |
| } |
| |
| if (typeof dontPrint === 'undefined') { |
| helpers.log(out); |
| } |
| |
| return out; |
| }; |
| |
| Operation.prototype.getModelSignature = function (type, definitions) { |
| var isPrimitive, listType; |
| |
| if (type instanceof Array) { |
| listType = true; |
| type = type[0]; |
| } |
| |
| // Convert undefined to string of 'undefined' |
| if (typeof type === 'undefined') { |
| type = 'undefined'; |
| isPrimitive = true; |
| |
| } else if (definitions[type]){ |
| // a model def exists? |
| type = definitions[type]; /* Model */ |
| isPrimitive = false; |
| |
| } else if (this.getInlineModel(type)) { |
| type = this.getInlineModel(type); /* Model */ |
| isPrimitive = false; |
| |
| } else { |
| // We default to primitive |
| isPrimitive = true; |
| } |
| |
| if (isPrimitive) { |
| if (listType) { |
| return 'Array[' + type + ']'; |
| } else { |
| return type.toString(); |
| } |
| } else { |
| if (listType) { |
| return 'Array[' + type.getMockSignature() + ']'; |
| } else { |
| return type.getMockSignature(); |
| } |
| } |
| }; |
| |
| Operation.prototype.supportHeaderParams = function () { |
| return true; |
| }; |
| |
| Operation.prototype.supportedSubmitMethods = function () { |
| return this.parent.supportedSubmitMethods; |
| }; |
| |
| Operation.prototype.getHeaderParams = function (args) { |
| var headers = this.setContentTypes(args, {}); |
| |
| for (var i = 0; i < this.parameters.length; i++) { |
| var param = this.parameters[i]; |
| |
| if (typeof args[param.name] !== 'undefined') { |
| if (param.in === 'header') { |
| var value = args[param.name]; |
| |
| if (Array.isArray(value)) { |
| value = value.toString(); |
| } |
| |
| headers[param.name] = value; |
| } |
| } |
| } |
| |
| return headers; |
| }; |
| |
| Operation.prototype.urlify = function (args) { |
| var formParams = {}; |
| var requestUrl = this.path; |
| var querystring = ''; // grab params from the args, build the querystring along the way |
| |
| for (var i = 0; i < this.parameters.length; i++) { |
| var param = this.parameters[i]; |
| |
| if (typeof args[param.name] !== 'undefined') { |
| if (param.in === 'path') { |
| var reg = new RegExp('\{' + param.name + '\}', 'gi'); |
| var value = args[param.name]; |
| |
| if (Array.isArray(value)) { |
| value = this.encodePathCollection(param.collectionFormat, param.name, value); |
| } else { |
| value = this.encodePathParam(value); |
| } |
| |
| requestUrl = requestUrl.replace(reg, value); |
| } else if (param.in === 'query' && typeof args[param.name] !== 'undefined') { |
| if (querystring === '') { |
| querystring += '?'; |
| } else { |
| querystring += '&'; |
| } |
| |
| if (typeof param.collectionFormat !== 'undefined') { |
| var qp = args[param.name]; |
| |
| if (Array.isArray(qp)) { |
| querystring += this.encodeQueryCollection(param.collectionFormat, param.name, qp); |
| } else { |
| querystring += this.encodeQueryParam(param.name) + '=' + this.encodeQueryParam(args[param.name]); |
| } |
| } else { |
| querystring += this.encodeQueryParam(param.name) + '=' + this.encodeQueryParam(args[param.name]); |
| } |
| } else if (param.in === 'formData') { |
| formParams[param.name] = args[param.name]; |
| } |
| } |
| } |
| var url = this.scheme + '://' + this.host; |
| |
| if (this.basePath !== '/') { |
| url += this.basePath; |
| } |
| return url + requestUrl + querystring; |
| }; |
| |
| Operation.prototype.getMissingParams = function (args) { |
| var missingParams = []; // check required params, track the ones that are missing |
| var i; |
| |
| for (i = 0; i < this.parameters.length; i++) { |
| var param = this.parameters[i]; |
| |
| if (param.required === true) { |
| if (typeof args[param.name] === 'undefined') { |
| missingParams = param.name; |
| } |
| } |
| } |
| |
| return missingParams; |
| }; |
| |
| Operation.prototype.getBody = function (headers, args, opts) { |
| var formParams = {}, hasFormParams, body, key, value, hasBody = false; |
| |
| // look at each param and put form params in an object |
| for (var i = 0; i < this.parameters.length; i++) { |
| var param = this.parameters[i]; |
| if (typeof args[param.name] !== 'undefined') { |
| if (param.in === 'body') { |
| body = args[param.name]; |
| } else if (param.in === 'formData') { |
| formParams[param.name] = args[param.name]; |
| hasFormParams = true; |
| } |
| } |
| else { |
| if(param.in === 'body') { |
| hasBody = true; |
| } |
| } |
| } |
| |
| // if body is null and hasBody is true, AND a JSON body is requested, send empty {} |
| if(hasBody && typeof body === 'undefined') { |
| var contentType = headers['Content-Type']; |
| if(contentType && contentType.indexOf('application/json') === 0) { |
| body = '{}'; |
| } |
| } |
| |
| var isMultiPart = false; |
| if(headers['Content-Type'] && headers['Content-Type'].indexOf('multipart/form-data') >= 0) { |
| isMultiPart = true; |
| } |
| |
| // handle form params |
| if (hasFormParams && !isMultiPart) { |
| var encoded = ''; |
| |
| for (key in formParams) { |
| value = formParams[key]; |
| |
| if (typeof value !== 'undefined') { |
| if (encoded !== '') { |
| encoded += '&'; |
| } |
| |
| encoded += encodeURIComponent(key) + '=' + encodeURIComponent(value); |
| } |
| } |
| |
| body = encoded; |
| } else if (isMultiPart) { |
| if (opts.useJQuery) { |
| var bodyParam = new FormData(); |
| |
| bodyParam.type = 'formData'; |
| |
| for (key in formParams) { |
| value = args[key]; |
| |
| if (typeof value !== 'undefined') { |
| // required for jquery file upload |
| if (value.type === 'file' && value.value) { |
| delete headers['Content-Type']; |
| |
| bodyParam.append(key, value.value); |
| } else { |
| bodyParam.append(key, value); |
| } |
| } |
| } |
| |
| body = bodyParam; |
| } |
| } |
| |
| return body; |
| }; |
| |
| /** |
| * gets sample response for a single operation |
| **/ |
| Operation.prototype.getModelSampleJSON = function (type, models) { |
| var listType, sampleJson, innerType; |
| models = models || {}; |
| |
| listType = (type instanceof Array); |
| innerType = listType ? type[0] : type; |
| |
| if(models[innerType]) { |
| sampleJson = models[innerType].createJSONSample(); |
| } else if (this.getInlineModel(innerType)){ |
| sampleJson = this.getInlineModel(innerType).createJSONSample(); // may return null, if type isn't correct |
| } |
| |
| |
| if (sampleJson) { |
| sampleJson = listType ? [sampleJson] : sampleJson; |
| |
| if (typeof sampleJson === 'string') { |
| return sampleJson; |
| } else if (_.isObject(sampleJson)) { |
| var t = sampleJson; |
| |
| if (sampleJson instanceof Array && sampleJson.length > 0) { |
| t = sampleJson[0]; |
| } |
| |
| if (t.nodeName && typeof t === 'Node') { |
| var xmlString = new XMLSerializer().serializeToString(t); |
| |
| return this.formatXml(xmlString); |
| } else { |
| return JSON.stringify(sampleJson, null, 2); |
| } |
| } else { |
| return sampleJson; |
| } |
| } |
| }; |
| |
| /** |
| * legacy binding |
| **/ |
| Operation.prototype.do = function (args, opts, callback, error, parent) { |
| return this.execute(args, opts, callback, error, parent); |
| }; |
| |
| /** |
| * executes an operation |
| **/ |
| Operation.prototype.execute = function (arg1, arg2, arg3, arg4, parent) { |
| var args = arg1 || {}; |
| var opts = {}, success, error, deferred; |
| |
| if (_.isObject(arg2)) { |
| opts = arg2; |
| success = arg3; |
| error = arg4; |
| } |
| |
| if(this.client) { |
| opts.client = this.client; |
| } |
| |
| // add the request interceptor from parent, if none sent from client |
| if(!opts.requestInterceptor && this.requestInterceptor ) { |
| opts.requestInterceptor = this.requestInterceptor ; |
| } |
| |
| if(!opts.responseInterceptor && this.responseInterceptor) { |
| opts.responseInterceptor = this.responseInterceptor; |
| } |
| |
| if (typeof arg2 === 'function') { |
| success = arg2; |
| error = arg3; |
| } |
| |
| if (this.parent.usePromise) { |
| deferred = Q.defer(); |
| } else { |
| success = (success || this.parent.defaultSuccessCallback || helpers.log); |
| error = (error || this.parent.defaultErrorCallback || helpers.log); |
| } |
| |
| |
| if (typeof opts.useJQuery === 'undefined') { |
| opts.useJQuery = this.useJQuery; |
| } |
| |
| if (typeof opts.enableCookies === 'undefined') { |
| opts.enableCookies = this.enableCookies; |
| } |
| |
| var missingParams = this.getMissingParams(args); |
| |
| if (missingParams.length > 0) { |
| var message = 'missing required params: ' + missingParams; |
| |
| helpers.fail(message); |
| |
| if (this.parent.usePromise) { |
| deferred.reject(message); |
| return deferred.promise; |
| } else { |
| error(message, parent); |
| return {}; |
| } |
| } |
| |
| var allHeaders = this.getHeaderParams(args); |
| var contentTypeHeaders = this.setContentTypes(args, opts); |
| var headers = {}, attrname; |
| |
| for (attrname in allHeaders) { headers[attrname] = allHeaders[attrname]; } |
| for (attrname in contentTypeHeaders) { headers[attrname] = contentTypeHeaders[attrname]; } |
| |
| var body = this.getBody(contentTypeHeaders, args, opts); |
| var url = this.urlify(args); |
| |
| if(url.indexOf('.{format}') > 0) { |
| if(headers) { |
| var format = headers.Accept || headers.accept; |
| if(format && format.indexOf('json') > 0) { |
| url = url.replace('.{format}', '.json'); |
| } |
| else if(format && format.indexOf('xml') > 0) { |
| url = url.replace('.{format}', '.xml'); |
| } |
| } |
| } |
| |
| var obj = { |
| url: url, |
| method: this.method.toUpperCase(), |
| body: body, |
| enableCookies: opts.enableCookies, |
| useJQuery: opts.useJQuery, |
| deferred: deferred, |
| headers: headers, |
| on: { |
| response: function (response) { |
| if (deferred) { |
| deferred.resolve(response); |
| return deferred.promise; |
| } else { |
| return success(response, parent); |
| } |
| }, |
| error: function (response) { |
| if (deferred) { |
| deferred.reject(response); |
| return deferred.promise; |
| } else { |
| return error(response, parent); |
| } |
| } |
| } |
| }; |
| |
| this.clientAuthorizations.apply(obj, this.operation.security); |
| if (opts.mock === true) { |
| return obj; |
| } else { |
| return new SwaggerHttp().execute(obj, opts); |
| } |
| }; |
| |
| function itemByPriority(col, itemPriority) { |
| |
| // No priorities? return first... |
| if(_.isEmpty(itemPriority)) { |
| return col[0]; |
| } |
| |
| for (var i = 0, len = itemPriority.length; i < len; i++) { |
| if(col.indexOf(itemPriority[i]) > -1) { |
| return itemPriority[i]; |
| } |
| } |
| |
| // Otherwise return first |
| return col[0]; |
| } |
| |
| Operation.prototype.setContentTypes = function (args, opts) { |
| // default type |
| var allDefinedParams = this.parameters; |
| var body; |
| var consumes = args.parameterContentType || itemByPriority(this.consumes, ['application/json', 'application/yaml']); |
| var accepts = opts.responseContentType || itemByPriority(this.produces, ['application/json', 'application/yaml']); |
| var definedFileParams = []; |
| var definedFormParams = []; |
| var headers = {}; |
| var i; |
| |
| // get params from the operation and set them in definedFileParams, definedFormParams, headers |
| for (i = 0; i < allDefinedParams.length; i++) { |
| var param = allDefinedParams[i]; |
| |
| if (param.in === 'formData') { |
| if (param.type === 'file') { |
| definedFileParams.push(param); |
| } else { |
| definedFormParams.push(param); |
| } |
| } else if (param.in === 'header' && opts) { |
| var key = param.name; |
| var headerValue = opts[param.name]; |
| |
| if (typeof opts[param.name] !== 'undefined') { |
| headers[key] = headerValue; |
| } |
| } else if (param.in === 'body' && typeof args[param.name] !== 'undefined') { |
| body = args[param.name]; |
| } |
| } |
| |
| // if there's a body, need to set the consumes header via requestContentType |
| if (this.method === 'post' || this.method === 'put' || this.method === 'patch' || |
| ((this.method === 'delete' || this.method === 'get') && body) ) { |
| if (opts.requestContentType) { |
| consumes = opts.requestContentType; |
| } |
| // if any form params, content type must be set |
| if (definedFormParams.length > 0) { |
| if (opts.requestContentType) { // override if set |
| consumes = opts.requestContentType; |
| } else if (definedFileParams.length > 0) { // if a file, must be multipart/form-data |
| consumes = 'multipart/form-data'; |
| } else { // default to x-www-from-urlencoded |
| consumes = 'application/x-www-form-urlencoded'; |
| } |
| } |
| } |
| else { |
| consumes = null; |
| } |
| |
| if (consumes && this.consumes) { |
| if (this.consumes.indexOf(consumes) === -1) { |
| helpers.log('server doesn\'t consume ' + consumes + ', try ' + JSON.stringify(this.consumes)); |
| } |
| } |
| |
| if (!this.matchesAccept(accepts)) { |
| helpers.log('server can\'t produce ' + accepts); |
| } |
| |
| if ((consumes && body !== '') || (consumes === 'application/x-www-form-urlencoded')) { |
| headers['Content-Type'] = consumes; |
| } |
| |
| if (accepts) { |
| headers.Accept = accepts; |
| } |
| |
| return headers; |
| }; |
| |
| /** |
| * Returns true if the request accepts header matches anything in this.produces. |
| * If this.produces contains * / *, ignore the accept header. |
| * @param {string=} accepts The client request accept header. |
| * @return {boolean} |
| */ |
| Operation.prototype.matchesAccept = function(accepts) { |
| // no accepts or produces, no problem! |
| if (!accepts || !this.produces) { |
| return true; |
| } |
| return this.produces.indexOf(accepts) !== -1 || this.produces.indexOf('*/*') !== -1; |
| }; |
| |
| Operation.prototype.asCurl = function (args1, args2) { |
| var opts = {mock: true}; |
| if (typeof args2 === 'object') { |
| for (var argKey in args2) { |
| opts[argKey] = args2[argKey]; |
| } |
| } |
| var obj = this.execute(args1, opts); |
| |
| this.clientAuthorizations.apply(obj, this.operation.security); |
| |
| var results = []; |
| |
| results.push('-X ' + this.method.toUpperCase()); |
| |
| if (typeof obj.headers !== 'undefined') { |
| var key; |
| |
| for (key in obj.headers) { |
| var value = obj.headers[key]; |
| if(typeof value === 'string'){ |
| value = value.replace(/\'/g, '\\u0027'); |
| } |
| results.push('--header \'' + key + ': ' + value + '\''); |
| } |
| } |
| |
| if (obj.body) { |
| var body; |
| |
| if (_.isObject(obj.body)) { |
| body = JSON.stringify(obj.body); |
| } else { |
| body = obj.body; |
| } |
| |
| results.push('-d \'' + body.replace(/\'/g, '\\u0027') + '\''); |
| } |
| |
| return 'curl ' + (results.join(' ')) + ' \'' + obj.url + '\''; |
| }; |
| |
| Operation.prototype.encodePathCollection = function (type, name, value) { |
| var encoded = ''; |
| var i; |
| var separator = ''; |
| |
| if (type === 'ssv') { |
| separator = '%20'; |
| } else if (type === 'tsv') { |
| separator = '\\t'; |
| } else if (type === 'pipes') { |
| separator = '|'; |
| } else { |
| separator = ','; |
| } |
| |
| for (i = 0; i < value.length; i++) { |
| if (i === 0) { |
| encoded = this.encodeQueryParam(value[i]); |
| } else { |
| encoded += separator + this.encodeQueryParam(value[i]); |
| } |
| } |
| |
| return encoded; |
| }; |
| |
| Operation.prototype.encodeQueryCollection = function (type, name, value) { |
| var encoded = ''; |
| var i; |
| |
| if (type === 'default' || type === 'multi') { |
| for (i = 0; i < value.length; i++) { |
| if (i > 0) {encoded += '&';} |
| |
| encoded += this.encodeQueryParam(name) + '=' + this.encodeQueryParam(value[i]); |
| } |
| } else { |
| var separator = ''; |
| |
| if (type === 'csv') { |
| separator = ','; |
| } else if (type === 'ssv') { |
| separator = '%20'; |
| } else if (type === 'tsv') { |
| separator = '\\t'; |
| } else if (type === 'pipes') { |
| separator = '|'; |
| } else if (type === 'brackets') { |
| for (i = 0; i < value.length; i++) { |
| if (i !== 0) { |
| encoded += '&'; |
| } |
| |
| encoded += this.encodeQueryParam(name) + '[]=' + this.encodeQueryParam(value[i]); |
| } |
| } |
| |
| if (separator !== '') { |
| for (i = 0; i < value.length; i++) { |
| if (i === 0) { |
| encoded = this.encodeQueryParam(name) + '=' + this.encodeQueryParam(value[i]); |
| } else { |
| encoded += separator + this.encodeQueryParam(value[i]); |
| } |
| } |
| } |
| } |
| |
| return encoded; |
| }; |
| |
| Operation.prototype.encodeQueryParam = function (arg) { |
| return encodeURIComponent(arg); |
| }; |
| |
| /** |
| * TODO revisit, might not want to leave '/' |
| **/ |
| Operation.prototype.encodePathParam = function (pathParam) { |
| return encodeURIComponent(pathParam); |
| }; |
| |
| },{"../helpers":4,"../http":5,"./model":9,"lodash-compat/lang/cloneDeep":142,"lodash-compat/lang/isEmpty":145,"lodash-compat/lang/isObject":148,"lodash-compat/lang/isUndefined":152,"q":161}],11:[function(require,module,exports){ |
| 'use strict'; |
| |
| var OperationGroup = module.exports = function (tag, description, externalDocs, operation) { |
| this.description = description; |
| this.externalDocs = externalDocs; |
| this.name = tag; |
| this.operation = operation; |
| this.operationsArray = []; |
| this.path = tag; |
| this.tag = tag; |
| }; |
| |
| OperationGroup.prototype.sort = function () { |
| |
| }; |
| |
| |
| },{}],12:[function(require,module,exports){ |
| |
| },{}],13:[function(require,module,exports){ |
| // shim for using process in browser |
| |
| var process = module.exports = {}; |
| var queue = []; |
| var draining = false; |
| |
| function drainQueue() { |
| if (draining) { |
| return; |
| } |
| draining = true; |
| var currentQueue; |
| var len = queue.length; |
| while(len) { |
| currentQueue = queue; |
| queue = []; |
| var i = -1; |
| while (++i < len) { |
| currentQueue[i](); |
| } |
| len = queue.length; |
| } |
| draining = false; |
| } |
| process.nextTick = function (fun) { |
| queue.push(fun); |
| if (!draining) { |
| setTimeout(drainQueue, 0); |
| } |
| }; |
| |
| process.title = 'browser'; |
| process.browser = true; |
| process.env = {}; |
| process.argv = []; |
| process.version = ''; // empty string to avoid regexp issues |
| process.versions = {}; |
| |
| function noop() {} |
| |
| process.on = noop; |
| process.addListener = noop; |
| process.once = noop; |
| process.off = noop; |
| process.removeListener = noop; |
| process.removeAllListeners = noop; |
| process.emit = noop; |
| |
| process.binding = function (name) { |
| throw new Error('process.binding is not supported'); |
| }; |
| |
| // TODO(shtylman) |
| process.cwd = function () { return '/' }; |
| process.chdir = function (dir) { |
| throw new Error('process.chdir is not supported'); |
| }; |
| process.umask = function() { return 0; }; |
| |
| },{}],14:[function(require,module,exports){ |
| (function (Buffer){ |
| (function () { |
| "use strict"; |
| |
| function btoa(str) { |
| var buffer |
| ; |
| |
| if (str instanceof Buffer) { |
| buffer = str; |
| } else { |
| buffer = new Buffer(str.toString(), 'binary'); |
| } |
| |
| return buffer.toString('base64'); |
| } |
| |
| module.exports = btoa; |
| }()); |
| |
| }).call(this,require("buffer").Buffer) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9idG9hL2luZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiJnZW5lcmF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc0NvbnRlbnQiOlsiKGZ1bmN0aW9uICgpIHtcbiAgXCJ1c2Ugc3RyaWN0XCI7XG5cbiAgZnVuY3Rpb24gYnRvYShzdHIpIHtcbiAgICB2YXIgYnVmZmVyXG4gICAgICA7XG5cbiAgICBpZiAoc3RyIGluc3RhbmNlb2YgQnVmZmVyKSB7XG4gICAgICBidWZmZXIgPSBzdHI7XG4gICAgfSBlbHNlIHtcbiAgICAgIGJ1ZmZlciA9IG5ldyBCdWZmZXIoc3RyLnRvU3RyaW5nKCksICdiaW5hcnknKTtcbiAgICB9XG5cbiAgICByZXR1cm4gYnVmZmVyLnRvU3RyaW5nKCdiYXNlNjQnKTtcbiAgfVxuXG4gIG1vZHVsZS5leHBvcnRzID0gYnRvYTtcbn0oKSk7XG4iXX0= |
| },{"buffer":15}],15:[function(require,module,exports){ |
| /*! |
| * The buffer module from node.js, for the browser. |
| * |
| * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> |
| * @license MIT |
| */ |
| |
| var base64 = require('base64-js') |
| var ieee754 = require('ieee754') |
| var isArray = require('is-array') |
| |
| exports.Buffer = Buffer |
| exports.SlowBuffer = SlowBuffer |
| exports.INSPECT_MAX_BYTES = 50 |
| Buffer.poolSize = 8192 // not used by this implementation |
| |
| var rootParent = {} |
| |
| /** |
| * If `Buffer.TYPED_ARRAY_SUPPORT`: |
| * === true Use Uint8Array implementation (fastest) |
| * === false Use Object implementation (most compatible, even IE6) |
| * |
| * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, |
| * Opera 11.6+, iOS 4.2+. |
| * |
| * Due to various browser bugs, sometimes the Object implementation will be used even |
| * when the browser supports typed arrays. |
| * |
| * Note: |
| * |
| * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, |
| * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. |
| * |
| * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property |
| * on objects. |
| * |
| * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. |
| * |
| * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of |
| * incorrect length in some situations. |
| |
| * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they |
| * get the Object implementation, which is slower but behaves correctly. |
| */ |
| Buffer.TYPED_ARRAY_SUPPORT = (function () { |
| function Bar () {} |
| try { |
| var arr = new Uint8Array(1) |
| arr.foo = function () { return 42 } |
| arr.constructor = Bar |
| return arr.foo() === 42 && // typed array instances can be augmented |
| arr.constructor === Bar && // constructor can be set |
| typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` |
| arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` |
| } catch (e) { |
| return false |
| } |
| })() |
| |
| function kMaxLength () { |
| return Buffer.TYPED_ARRAY_SUPPORT |
| ? 0x7fffffff |
| : 0x3fffffff |
| } |
| |
| /** |
| * Class: Buffer |
| * ============= |
| * |
| * The Buffer constructor returns instances of `Uint8Array` that are augmented |
| * with function properties for all the node `Buffer` API functions. We use |
| * `Uint8Array` so that square bracket notation works as expected -- it returns |
| * a single octet. |
| * |
| * By augmenting the instances, we can avoid modifying the `Uint8Array` |
| * prototype. |
| */ |
| function Buffer (arg) { |
| if (!(this instanceof Buffer)) { |
| // Avoid going through an ArgumentsAdaptorTrampoline in the common case. |
| if (arguments.length > 1) return new Buffer(arg, arguments[1]) |
| return new Buffer(arg) |
| } |
| |
| this.length = 0 |
| this.parent = undefined |
| |
| // Common case. |
| if (typeof arg === 'number') { |
| return fromNumber(this, arg) |
| } |
| |
| // Slightly less common case. |
| if (typeof arg === 'string') { |
| return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') |
| } |
| |
| // Unusual. |
| return fromObject(this, arg) |
| } |
| |
| function fromNumber (that, length) { |
| that = allocate(that, length < 0 ? 0 : checked(length) | 0) |
| if (!Buffer.TYPED_ARRAY_SUPPORT) { |
| for (var i = 0; i < length; i++) { |
| that[i] = 0 |
| } |
| } |
| return that |
| } |
| |
| function fromString (that, string, encoding) { |
| if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8' |
| |
| // Assumption: byteLength() return value is always < kMaxLength. |
| var length = byteLength(string, encoding) | 0 |
| that = allocate(that, length) |
| |
| that.write(string, encoding) |
| return that |
| } |
| |
| function fromObject (that, object) { |
| if (Buffer.isBuffer(object)) return fromBuffer(that, object) |
| |
| if (isArray(object)) return fromArray(that, object) |
| |
| if (object == null) { |
| throw new TypeError('must start with number, buffer, array or string') |
| } |
| |
| if (typeof ArrayBuffer !== 'undefined') { |
| if (object.buffer instanceof ArrayBuffer) { |
| return fromTypedArray(that, object) |
| } |
| if (object instanceof ArrayBuffer) { |
| return fromArrayBuffer(that, object) |
| } |
| } |
| |
| if (object.length) return fromArrayLike(that, object) |
| |
| return fromJsonObject(that, object) |
| } |
| |
| function fromBuffer (that, buffer) { |
| var length = checked(buffer.length) | 0 |
| that = allocate(that, length) |
| buffer.copy(that, 0, 0, length) |
| return that |
| } |
| |
| function fromArray (that, array) { |
| var length = checked(array.length) | 0 |
| that = allocate(that, length) |
| for (var i = 0; i < length; i += 1) { |
| that[i] = array[i] & 255 |
| } |
| return that |
| } |
| |
| // Duplicate of fromArray() to keep fromArray() monomorphic. |
| function fromTypedArray (that, array) { |
| var length = checked(array.length) | 0 |
| that = allocate(that, length) |
| // Truncating the elements is probably not what people expect from typed |
| // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior |
| // of the old Buffer constructor. |
| for (var i = 0; i < length; i += 1) { |
| that[i] = array[i] & 255 |
| } |
| return that |
| } |
| |
| function fromArrayBuffer (that, array) { |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| // Return an augmented `Uint8Array` instance, for best performance |
| array.byteLength |
| that = Buffer._augment(new Uint8Array(array)) |
| } else { |
| // Fallback: Return an object instance of the Buffer class |
| that = fromTypedArray(that, new Uint8Array(array)) |
| } |
| return that |
| } |
| |
| function fromArrayLike (that, array) { |
| var length = checked(array.length) | 0 |
| that = allocate(that, length) |
| for (var i = 0; i < length; i += 1) { |
| that[i] = array[i] & 255 |
| } |
| return that |
| } |
| |
| // Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object. |
| // Returns a zero-length buffer for inputs that don't conform to the spec. |
| function fromJsonObject (that, object) { |
| var array |
| var length = 0 |
| |
| if (object.type === 'Buffer' && isArray(object.data)) { |
| array = object.data |
| length = checked(array.length) | 0 |
| } |
| that = allocate(that, length) |
| |
| for (var i = 0; i < length; i += 1) { |
| that[i] = array[i] & 255 |
| } |
| return that |
| } |
| |
| function allocate (that, length) { |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| // Return an augmented `Uint8Array` instance, for best performance |
| that = Buffer._augment(new Uint8Array(length)) |
| } else { |
| // Fallback: Return an object instance of the Buffer class |
| that.length = length |
| that._isBuffer = true |
| } |
| |
| var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1 |
| if (fromPool) that.parent = rootParent |
| |
| return that |
| } |
| |
| function checked (length) { |
| // Note: cannot use `length < kMaxLength` here because that fails when |
| // length is NaN (which is otherwise coerced to zero.) |
| if (length >= kMaxLength()) { |
| throw new RangeError('Attempt to allocate Buffer larger than maximum ' + |
| 'size: 0x' + kMaxLength().toString(16) + ' bytes') |
| } |
| return length | 0 |
| } |
| |
| function SlowBuffer (subject, encoding) { |
| if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding) |
| |
| var buf = new Buffer(subject, encoding) |
| delete buf.parent |
| return buf |
| } |
| |
| Buffer.isBuffer = function isBuffer (b) { |
| return !!(b != null && b._isBuffer) |
| } |
| |
| Buffer.compare = function compare (a, b) { |
| if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { |
| throw new TypeError('Arguments must be Buffers') |
| } |
| |
| if (a === b) return 0 |
| |
| var x = a.length |
| var y = b.length |
| |
| var i = 0 |
| var len = Math.min(x, y) |
| while (i < len) { |
| if (a[i] !== b[i]) break |
| |
| ++i |
| } |
| |
| if (i !== len) { |
| x = a[i] |
| y = b[i] |
| } |
| |
| if (x < y) return -1 |
| if (y < x) return 1 |
| return 0 |
| } |
| |
| Buffer.isEncoding = function isEncoding (encoding) { |
| switch (String(encoding).toLowerCase()) { |
| case 'hex': |
| case 'utf8': |
| case 'utf-8': |
| case 'ascii': |
| case 'binary': |
| case 'base64': |
| case 'raw': |
| case 'ucs2': |
| case 'ucs-2': |
| case 'utf16le': |
| case 'utf-16le': |
| return true |
| default: |
| return false |
| } |
| } |
| |
| Buffer.concat = function concat (list, length) { |
| if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.') |
| |
| if (list.length === 0) { |
| return new Buffer(0) |
| } |
| |
| var i |
| if (length === undefined) { |
| length = 0 |
| for (i = 0; i < list.length; i++) { |
| length += list[i].length |
| } |
| } |
| |
| var buf = new Buffer(length) |
| var pos = 0 |
| for (i = 0; i < list.length; i++) { |
| var item = list[i] |
| item.copy(buf, pos) |
| pos += item.length |
| } |
| return buf |
| } |
| |
| function byteLength (string, encoding) { |
| if (typeof string !== 'string') string = '' + string |
| |
| var len = string.length |
| if (len === 0) return 0 |
| |
| // Use a for loop to avoid recursion |
| var loweredCase = false |
| for (;;) { |
| switch (encoding) { |
| case 'ascii': |
| case 'binary': |
| // Deprecated |
| case 'raw': |
| case 'raws': |
| return len |
| case 'utf8': |
| case 'utf-8': |
| return utf8ToBytes(string).length |
| case 'ucs2': |
| case 'ucs-2': |
| case 'utf16le': |
| case 'utf-16le': |
| return len * 2 |
| case 'hex': |
| return len >>> 1 |
| case 'base64': |
| return base64ToBytes(string).length |
| default: |
| if (loweredCase) return utf8ToBytes(string).length // assume utf8 |
| encoding = ('' + encoding).toLowerCase() |
| loweredCase = true |
| } |
| } |
| } |
| Buffer.byteLength = byteLength |
| |
| // pre-set for values that may exist in the future |
| Buffer.prototype.length = undefined |
| Buffer.prototype.parent = undefined |
| |
| function slowToString (encoding, start, end) { |
| var loweredCase = false |
| |
| start = start | 0 |
| end = end === undefined || end === Infinity ? this.length : end | 0 |
| |
| if (!encoding) encoding = 'utf8' |
| if (start < 0) start = 0 |
| if (end > this.length) end = this.length |
| if (end <= start) return '' |
| |
| while (true) { |
| switch (encoding) { |
| case 'hex': |
| return hexSlice(this, start, end) |
| |
| case 'utf8': |
| case 'utf-8': |
| return utf8Slice(this, start, end) |
| |
| case 'ascii': |
| return asciiSlice(this, start, end) |
| |
| case 'binary': |
| return binarySlice(this, start, end) |
| |
| case 'base64': |
| return base64Slice(this, start, end) |
| |
| case 'ucs2': |
| case 'ucs-2': |
| case 'utf16le': |
| case 'utf-16le': |
| return utf16leSlice(this, start, end) |
| |
| default: |
| if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) |
| encoding = (encoding + '').toLowerCase() |
| loweredCase = true |
| } |
| } |
| } |
| |
| Buffer.prototype.toString = function toString () { |
| var length = this.length | 0 |
| if (length === 0) return '' |
| if (arguments.length === 0) return utf8Slice(this, 0, length) |
| return slowToString.apply(this, arguments) |
| } |
| |
| Buffer.prototype.equals = function equals (b) { |
| if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') |
| if (this === b) return true |
| return Buffer.compare(this, b) === 0 |
| } |
| |
| Buffer.prototype.inspect = function inspect () { |
| var str = '' |
| var max = exports.INSPECT_MAX_BYTES |
| if (this.length > 0) { |
| str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') |
| if (this.length > max) str += ' ... ' |
| } |
| return '<Buffer ' + str + '>' |
| } |
| |
| Buffer.prototype.compare = function compare (b) { |
| if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') |
| if (this === b) return 0 |
| return Buffer.compare(this, b) |
| } |
| |
| Buffer.prototype.indexOf = function indexOf (val, byteOffset) { |
| if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff |
| else if (byteOffset < -0x80000000) byteOffset = -0x80000000 |
| byteOffset >>= 0 |
| |
| if (this.length === 0) return -1 |
| if (byteOffset >= this.length) return -1 |
| |
| // Negative offsets start from the end of the buffer |
| if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) |
| |
| if (typeof val === 'string') { |
| if (val.length === 0) return -1 // special case: looking for empty string always fails |
| return String.prototype.indexOf.call(this, val, byteOffset) |
| } |
| if (Buffer.isBuffer(val)) { |
| return arrayIndexOf(this, val, byteOffset) |
| } |
| if (typeof val === 'number') { |
| if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { |
| return Uint8Array.prototype.indexOf.call(this, val, byteOffset) |
| } |
| return arrayIndexOf(this, [ val ], byteOffset) |
| } |
| |
| function arrayIndexOf (arr, val, byteOffset) { |
| var foundIndex = -1 |
| for (var i = 0; byteOffset + i < arr.length; i++) { |
| if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) { |
| if (foundIndex === -1) foundIndex = i |
| if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex |
| } else { |
| foundIndex = -1 |
| } |
| } |
| return -1 |
| } |
| |
| throw new TypeError('val must be string, number or Buffer') |
| } |
| |
| // `get` is deprecated |
| Buffer.prototype.get = function get (offset) { |
| console.log('.get() is deprecated. Access using array indexes instead.') |
| return this.readUInt8(offset) |
| } |
| |
| // `set` is deprecated |
| Buffer.prototype.set = function set (v, offset) { |
| console.log('.set() is deprecated. Access using array indexes instead.') |
| return this.writeUInt8(v, offset) |
| } |
| |
| function hexWrite (buf, string, offset, length) { |
| offset = Number(offset) || 0 |
| var remaining = buf.length - offset |
| if (!length) { |
| length = remaining |
| } else { |
| length = Number(length) |
| if (length > remaining) { |
| length = remaining |
| } |
| } |
| |
| // must be an even number of digits |
| var strLen = string.length |
| if (strLen % 2 !== 0) throw new Error('Invalid hex string') |
| |
| if (length > strLen / 2) { |
| length = strLen / 2 |
| } |
| for (var i = 0; i < length; i++) { |
| var parsed = parseInt(string.substr(i * 2, 2), 16) |
| if (isNaN(parsed)) throw new Error('Invalid hex string') |
| buf[offset + i] = parsed |
| } |
| return i |
| } |
| |
| function utf8Write (buf, string, offset, length) { |
| return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) |
| } |
| |
| function asciiWrite (buf, string, offset, length) { |
| return blitBuffer(asciiToBytes(string), buf, offset, length) |
| } |
| |
| function binaryWrite (buf, string, offset, length) { |
| return asciiWrite(buf, string, offset, length) |
| } |
| |
| function base64Write (buf, string, offset, length) { |
| return blitBuffer(base64ToBytes(string), buf, offset, length) |
| } |
| |
| function ucs2Write (buf, string, offset, length) { |
| return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) |
| } |
| |
| Buffer.prototype.write = function write (string, offset, length, encoding) { |
| // Buffer#write(string) |
| if (offset === undefined) { |
| encoding = 'utf8' |
| length = this.length |
| offset = 0 |
| // Buffer#write(string, encoding) |
| } else if (length === undefined && typeof offset === 'string') { |
| encoding = offset |
| length = this.length |
| offset = 0 |
| // Buffer#write(string, offset[, length][, encoding]) |
| } else if (isFinite(offset)) { |
| offset = offset | 0 |
| if (isFinite(length)) { |
| length = length | 0 |
| if (encoding === undefined) encoding = 'utf8' |
| } else { |
| encoding = length |
| length = undefined |
| } |
| // legacy write(string, encoding, offset, length) - remove in v0.13 |
| } else { |
| var swap = encoding |
| encoding = offset |
| offset = length | 0 |
| length = swap |
| } |
| |
| var remaining = this.length - offset |
| if (length === undefined || length > remaining) length = remaining |
| |
| if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { |
| throw new RangeError('attempt to write outside buffer bounds') |
| } |
| |
| if (!encoding) encoding = 'utf8' |
| |
| var loweredCase = false |
| for (;;) { |
| switch (encoding) { |
| case 'hex': |
| return hexWrite(this, string, offset, length) |
| |
| case 'utf8': |
| case 'utf-8': |
| return utf8Write(this, string, offset, length) |
| |
| case 'ascii': |
| return asciiWrite(this, string, offset, length) |
| |
| case 'binary': |
| return binaryWrite(this, string, offset, length) |
| |
| case 'base64': |
| // Warning: maxLength not taken into account in base64Write |
| return base64Write(this, string, offset, length) |
| |
| case 'ucs2': |
| case 'ucs-2': |
| case 'utf16le': |
| case 'utf-16le': |
| return ucs2Write(this, string, offset, length) |
| |
| default: |
| if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) |
| encoding = ('' + encoding).toLowerCase() |
| loweredCase = true |
| } |
| } |
| } |
| |
| Buffer.prototype.toJSON = function toJSON () { |
| return { |
| type: 'Buffer', |
| data: Array.prototype.slice.call(this._arr || this, 0) |
| } |
| } |
| |
| function base64Slice (buf, start, end) { |
| if (start === 0 && end === buf.length) { |
| return base64.fromByteArray(buf) |
| } else { |
| return base64.fromByteArray(buf.slice(start, end)) |
| } |
| } |
| |
| function utf8Slice (buf, start, end) { |
| end = Math.min(buf.length, end) |
| var res = [] |
| |
| var i = start |
| while (i < end) { |
| var firstByte = buf[i] |
| var codePoint = null |
| var bytesPerSequence = (firstByte > 0xEF) ? 4 |
| : (firstByte > 0xDF) ? 3 |
| : (firstByte > 0xBF) ? 2 |
| : 1 |
| |
| if (i + bytesPerSequence <= end) { |
| var secondByte, thirdByte, fourthByte, tempCodePoint |
| |
| switch (bytesPerSequence) { |
| case 1: |
| if (firstByte < 0x80) { |
| codePoint = firstByte |
| } |
| break |
| case 2: |
| secondByte = buf[i + 1] |
| if ((secondByte & 0xC0) === 0x80) { |
| tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) |
| if (tempCodePoint > 0x7F) { |
| codePoint = tempCodePoint |
| } |
| } |
| break |
| case 3: |
| secondByte = buf[i + 1] |
| thirdByte = buf[i + 2] |
| if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { |
| tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) |
| if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { |
| codePoint = tempCodePoint |
| } |
| } |
| break |
| case 4: |
| secondByte = buf[i + 1] |
| thirdByte = buf[i + 2] |
| fourthByte = buf[i + 3] |
| if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { |
| tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) |
| if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { |
| codePoint = tempCodePoint |
| } |
| } |
| } |
| } |
| |
| if (codePoint === null) { |
| // we did not generate a valid codePoint so insert a |
| // replacement char (U+FFFD) and advance only 1 byte |
| codePoint = 0xFFFD |
| bytesPerSequence = 1 |
| } else if (codePoint > 0xFFFF) { |
| // encode to utf16 (surrogate pair dance) |
| codePoint -= 0x10000 |
| res.push(codePoint >>> 10 & 0x3FF | 0xD800) |
| codePoint = 0xDC00 | codePoint & 0x3FF |
| } |
| |
| res.push(codePoint) |
| i += bytesPerSequence |
| } |
| |
| return decodeCodePointsArray(res) |
| } |
| |
| // Based on http://stackoverflow.com/a/22747272/680742, the browser with |
| // the lowest limit is Chrome, with 0x10000 args. |
| // We go 1 magnitude less, for safety |
| var MAX_ARGUMENTS_LENGTH = 0x1000 |
| |
| function decodeCodePointsArray (codePoints) { |
| var len = codePoints.length |
| if (len <= MAX_ARGUMENTS_LENGTH) { |
| return String.fromCharCode.apply(String, codePoints) // avoid extra slice() |
| } |
| |
| // Decode in chunks to avoid "call stack size exceeded". |
| var res = '' |
| var i = 0 |
| while (i < len) { |
| res += String.fromCharCode.apply( |
| String, |
| codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) |
| ) |
| } |
| return res |
| } |
| |
| function asciiSlice (buf, start, end) { |
| var ret = '' |
| end = Math.min(buf.length, end) |
| |
| for (var i = start; i < end; i++) { |
| ret += String.fromCharCode(buf[i] & 0x7F) |
| } |
| return ret |
| } |
| |
| function binarySlice (buf, start, end) { |
| var ret = '' |
| end = Math.min(buf.length, end) |
| |
| for (var i = start; i < end; i++) { |
| ret += String.fromCharCode(buf[i]) |
| } |
| return ret |
| } |
| |
| function hexSlice (buf, start, end) { |
| var len = buf.length |
| |
| if (!start || start < 0) start = 0 |
| if (!end || end < 0 || end > len) end = len |
| |
| var out = '' |
| for (var i = start; i < end; i++) { |
| out += toHex(buf[i]) |
| } |
| return out |
| } |
| |
| function utf16leSlice (buf, start, end) { |
| var bytes = buf.slice(start, end) |
| var res = '' |
| for (var i = 0; i < bytes.length; i += 2) { |
| res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) |
| } |
| return res |
| } |
| |
| Buffer.prototype.slice = function slice (start, end) { |
| var len = this.length |
| start = ~~start |
| end = end === undefined ? len : ~~end |
| |
| if (start < 0) { |
| start += len |
| if (start < 0) start = 0 |
| } else if (start > len) { |
| start = len |
| } |
| |
| if (end < 0) { |
| end += len |
| if (end < 0) end = 0 |
| } else if (end > len) { |
| end = len |
| } |
| |
| if (end < start) end = start |
| |
| var newBuf |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| newBuf = Buffer._augment(this.subarray(start, end)) |
| } else { |
| var sliceLen = end - start |
| newBuf = new Buffer(sliceLen, undefined) |
| for (var i = 0; i < sliceLen; i++) { |
| newBuf[i] = this[i + start] |
| } |
| } |
| |
| if (newBuf.length) newBuf.parent = this.parent || this |
| |
| return newBuf |
| } |
| |
| /* |
| * Need to make sure that buffer isn't trying to write out of bounds. |
| */ |
| function checkOffset (offset, ext, length) { |
| if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') |
| if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') |
| } |
| |
| Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { |
| offset = offset | 0 |
| byteLength = byteLength | 0 |
| if (!noAssert) checkOffset(offset, byteLength, this.length) |
| |
| var val = this[offset] |
| var mul = 1 |
| var i = 0 |
| while (++i < byteLength && (mul *= 0x100)) { |
| val += this[offset + i] * mul |
| } |
| |
| return val |
| } |
| |
| Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { |
| offset = offset | 0 |
| byteLength = byteLength | 0 |
| if (!noAssert) { |
| checkOffset(offset, byteLength, this.length) |
| } |
| |
| var val = this[offset + --byteLength] |
| var mul = 1 |
| while (byteLength > 0 && (mul *= 0x100)) { |
| val += this[offset + --byteLength] * mul |
| } |
| |
| return val |
| } |
| |
| Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 1, this.length) |
| return this[offset] |
| } |
| |
| Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 2, this.length) |
| return this[offset] | (this[offset + 1] << 8) |
| } |
| |
| Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 2, this.length) |
| return (this[offset] << 8) | this[offset + 1] |
| } |
| |
| Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 4, this.length) |
| |
| return ((this[offset]) | |
| (this[offset + 1] << 8) | |
| (this[offset + 2] << 16)) + |
| (this[offset + 3] * 0x1000000) |
| } |
| |
| Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 4, this.length) |
| |
| return (this[offset] * 0x1000000) + |
| ((this[offset + 1] << 16) | |
| (this[offset + 2] << 8) | |
| this[offset + 3]) |
| } |
| |
| Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { |
| offset = offset | 0 |
| byteLength = byteLength | 0 |
| if (!noAssert) checkOffset(offset, byteLength, this.length) |
| |
| var val = this[offset] |
| var mul = 1 |
| var i = 0 |
| while (++i < byteLength && (mul *= 0x100)) { |
| val += this[offset + i] * mul |
| } |
| mul *= 0x80 |
| |
| if (val >= mul) val -= Math.pow(2, 8 * byteLength) |
| |
| return val |
| } |
| |
| Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { |
| offset = offset | 0 |
| byteLength = byteLength | 0 |
| if (!noAssert) checkOffset(offset, byteLength, this.length) |
| |
| var i = byteLength |
| var mul = 1 |
| var val = this[offset + --i] |
| while (i > 0 && (mul *= 0x100)) { |
| val += this[offset + --i] * mul |
| } |
| mul *= 0x80 |
| |
| if (val >= mul) val -= Math.pow(2, 8 * byteLength) |
| |
| return val |
| } |
| |
| Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 1, this.length) |
| if (!(this[offset] & 0x80)) return (this[offset]) |
| return ((0xff - this[offset] + 1) * -1) |
| } |
| |
| Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 2, this.length) |
| var val = this[offset] | (this[offset + 1] << 8) |
| return (val & 0x8000) ? val | 0xFFFF0000 : val |
| } |
| |
| Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 2, this.length) |
| var val = this[offset + 1] | (this[offset] << 8) |
| return (val & 0x8000) ? val | 0xFFFF0000 : val |
| } |
| |
| Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 4, this.length) |
| |
| return (this[offset]) | |
| (this[offset + 1] << 8) | |
| (this[offset + 2] << 16) | |
| (this[offset + 3] << 24) |
| } |
| |
| Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 4, this.length) |
| |
| return (this[offset] << 24) | |
| (this[offset + 1] << 16) | |
| (this[offset + 2] << 8) | |
| (this[offset + 3]) |
| } |
| |
| Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 4, this.length) |
| return ieee754.read(this, offset, true, 23, 4) |
| } |
| |
| Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 4, this.length) |
| return ieee754.read(this, offset, false, 23, 4) |
| } |
| |
| Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 8, this.length) |
| return ieee754.read(this, offset, true, 52, 8) |
| } |
| |
| Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { |
| if (!noAssert) checkOffset(offset, 8, this.length) |
| return ieee754.read(this, offset, false, 52, 8) |
| } |
| |
| function checkInt (buf, value, offset, ext, max, min) { |
| if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') |
| if (value > max || value < min) throw new RangeError('value is out of bounds') |
| if (offset + ext > buf.length) throw new RangeError('index out of range') |
| } |
| |
| Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { |
| value = +value |
| offset = offset | 0 |
| byteLength = byteLength | 0 |
| if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) |
| |
| var mul = 1 |
| var i = 0 |
| this[offset] = value & 0xFF |
| while (++i < byteLength && (mul *= 0x100)) { |
| this[offset + i] = (value / mul) & 0xFF |
| } |
| |
| return offset + byteLength |
| } |
| |
| Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { |
| value = +value |
| offset = offset | 0 |
| byteLength = byteLength | 0 |
| if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) |
| |
| var i = byteLength - 1 |
| var mul = 1 |
| this[offset + i] = value & 0xFF |
| while (--i >= 0 && (mul *= 0x100)) { |
| this[offset + i] = (value / mul) & 0xFF |
| } |
| |
| return offset + byteLength |
| } |
| |
| Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) |
| if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) |
| this[offset] = value |
| return offset + 1 |
| } |
| |
| function objectWriteUInt16 (buf, value, offset, littleEndian) { |
| if (value < 0) value = 0xffff + value + 1 |
| for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { |
| buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> |
| (littleEndian ? i : 1 - i) * 8 |
| } |
| } |
| |
| Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| this[offset] = value |
| this[offset + 1] = (value >>> 8) |
| } else { |
| objectWriteUInt16(this, value, offset, true) |
| } |
| return offset + 2 |
| } |
| |
| Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| this[offset] = (value >>> 8) |
| this[offset + 1] = value |
| } else { |
| objectWriteUInt16(this, value, offset, false) |
| } |
| return offset + 2 |
| } |
| |
| function objectWriteUInt32 (buf, value, offset, littleEndian) { |
| if (value < 0) value = 0xffffffff + value + 1 |
| for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { |
| buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff |
| } |
| } |
| |
| Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| this[offset + 3] = (value >>> 24) |
| this[offset + 2] = (value >>> 16) |
| this[offset + 1] = (value >>> 8) |
| this[offset] = value |
| } else { |
| objectWriteUInt32(this, value, offset, true) |
| } |
| return offset + 4 |
| } |
| |
| Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| this[offset] = (value >>> 24) |
| this[offset + 1] = (value >>> 16) |
| this[offset + 2] = (value >>> 8) |
| this[offset + 3] = value |
| } else { |
| objectWriteUInt32(this, value, offset, false) |
| } |
| return offset + 4 |
| } |
| |
| Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) { |
| var limit = Math.pow(2, 8 * byteLength - 1) |
| |
| checkInt(this, value, offset, byteLength, limit - 1, -limit) |
| } |
| |
| var i = 0 |
| var mul = 1 |
| var sub = value < 0 ? 1 : 0 |
| this[offset] = value & 0xFF |
| while (++i < byteLength && (mul *= 0x100)) { |
| this[offset + i] = ((value / mul) >> 0) - sub & 0xFF |
| } |
| |
| return offset + byteLength |
| } |
| |
| Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) { |
| var limit = Math.pow(2, 8 * byteLength - 1) |
| |
| checkInt(this, value, offset, byteLength, limit - 1, -limit) |
| } |
| |
| var i = byteLength - 1 |
| var mul = 1 |
| var sub = value < 0 ? 1 : 0 |
| this[offset + i] = value & 0xFF |
| while (--i >= 0 && (mul *= 0x100)) { |
| this[offset + i] = ((value / mul) >> 0) - sub & 0xFF |
| } |
| |
| return offset + byteLength |
| } |
| |
| Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) |
| if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) |
| if (value < 0) value = 0xff + value + 1 |
| this[offset] = value |
| return offset + 1 |
| } |
| |
| Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| this[offset] = value |
| this[offset + 1] = (value >>> 8) |
| } else { |
| objectWriteUInt16(this, value, offset, true) |
| } |
| return offset + 2 |
| } |
| |
| Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| this[offset] = (value >>> 8) |
| this[offset + 1] = value |
| } else { |
| objectWriteUInt16(this, value, offset, false) |
| } |
| return offset + 2 |
| } |
| |
| Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| this[offset] = value |
| this[offset + 1] = (value >>> 8) |
| this[offset + 2] = (value >>> 16) |
| this[offset + 3] = (value >>> 24) |
| } else { |
| objectWriteUInt32(this, value, offset, true) |
| } |
| return offset + 4 |
| } |
| |
| Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { |
| value = +value |
| offset = offset | 0 |
| if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) |
| if (value < 0) value = 0xffffffff + value + 1 |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| this[offset] = (value >>> 24) |
| this[offset + 1] = (value >>> 16) |
| this[offset + 2] = (value >>> 8) |
| this[offset + 3] = value |
| } else { |
| objectWriteUInt32(this, value, offset, false) |
| } |
| return offset + 4 |
| } |
| |
| function checkIEEE754 (buf, value, offset, ext, max, min) { |
| if (value > max || value < min) throw new RangeError('value is out of bounds') |
| if (offset + ext > buf.length) throw new RangeError('index out of range') |
| if (offset < 0) throw new RangeError('index out of range') |
| } |
| |
| function writeFloat (buf, value, offset, littleEndian, noAssert) { |
| if (!noAssert) { |
| checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) |
| } |
| ieee754.write(buf, value, offset, littleEndian, 23, 4) |
| return offset + 4 |
| } |
| |
| Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { |
| return writeFloat(this, value, offset, true, noAssert) |
| } |
| |
| Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { |
| return writeFloat(this, value, offset, false, noAssert) |
| } |
| |
| function writeDouble (buf, value, offset, littleEndian, noAssert) { |
| if (!noAssert) { |
| checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) |
| } |
| ieee754.write(buf, value, offset, littleEndian, 52, 8) |
| return offset + 8 |
| } |
| |
| Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { |
| return writeDouble(this, value, offset, true, noAssert) |
| } |
| |
| Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { |
| return writeDouble(this, value, offset, false, noAssert) |
| } |
| |
| // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) |
| Buffer.prototype.copy = function copy (target, targetStart, start, end) { |
| if (!start) start = 0 |
| if (!end && end !== 0) end = this.length |
| if (targetStart >= target.length) targetStart = target.length |
| if (!targetStart) targetStart = 0 |
| if (end > 0 && end < start) end = start |
| |
| // Copy 0 bytes; we're done |
| if (end === start) return 0 |
| if (target.length === 0 || this.length === 0) return 0 |
| |
| // Fatal error conditions |
| if (targetStart < 0) { |
| throw new RangeError('targetStart out of bounds') |
| } |
| if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') |
| if (end < 0) throw new RangeError('sourceEnd out of bounds') |
| |
| // Are we oob? |
| if (end > this.length) end = this.length |
| if (target.length - targetStart < end - start) { |
| end = target.length - targetStart + start |
| } |
| |
| var len = end - start |
| var i |
| |
| if (this === target && start < targetStart && targetStart < end) { |
| // descending copy from end |
| for (i = len - 1; i >= 0; i--) { |
| target[i + targetStart] = this[i + start] |
| } |
| } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { |
| // ascending copy from start |
| for (i = 0; i < len; i++) { |
| target[i + targetStart] = this[i + start] |
| } |
| } else { |
| target._set(this.subarray(start, start + len), targetStart) |
| } |
| |
| return len |
| } |
| |
| // fill(value, start=0, end=buffer.length) |
| Buffer.prototype.fill = function fill (value, start, end) { |
| if (!value) value = 0 |
| if (!start) start = 0 |
| if (!end) end = this.length |
| |
| if (end < start) throw new RangeError('end < start') |
| |
| // Fill 0 bytes; we're done |
| if (end === start) return |
| if (this.length === 0) return |
| |
| if (start < 0 || start >= this.length) throw new RangeError('start out of bounds') |
| if (end < 0 || end > this.length) throw new RangeError('end out of bounds') |
| |
| var i |
| if (typeof value === 'number') { |
| for (i = start; i < end; i++) { |
| this[i] = value |
| } |
| } else { |
| var bytes = utf8ToBytes(value.toString()) |
| var len = bytes.length |
| for (i = start; i < end; i++) { |
| this[i] = bytes[i % len] |
| } |
| } |
| |
| return this |
| } |
| |
| /** |
| * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. |
| * Added in Node 0.12. Only available in browsers that support ArrayBuffer. |
| */ |
| Buffer.prototype.toArrayBuffer = function toArrayBuffer () { |
| if (typeof Uint8Array !== 'undefined') { |
| if (Buffer.TYPED_ARRAY_SUPPORT) { |
| return (new Buffer(this)).buffer |
| } else { |
| var buf = new Uint8Array(this.length) |
| for (var i = 0, len = buf.length; i < len; i += 1) { |
| buf[i] = this[i] |
| } |
| return buf.buffer |
| } |
| } else { |
| throw new TypeError('Buffer.toArrayBuffer not supported in this browser') |
| } |
| } |
| |
| // HELPER FUNCTIONS |
| // ================ |
| |
| var BP = Buffer.prototype |
| |
| /** |
| * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods |
| */ |
| Buffer._augment = function _augment (arr) { |
| arr.constructor = Buffer |
| arr._isBuffer = true |
| |
| // save reference to original Uint8Array set method before overwriting |
| arr._set = arr.set |
| |
| // deprecated |
| arr.get = BP.get |
| arr.set = BP.set |
| |
| arr.write = BP.write |
| arr.toString = BP.toString |
| arr.toLocaleString = BP.toString |
| arr.toJSON = BP.toJSON |
| arr.equals = BP.equals |
| arr.compare = BP.compare |
| arr.indexOf = BP.indexOf |
| arr.copy = BP.copy |
| arr.slice = BP.slice |
| arr.readUIntLE = BP.readUIntLE |
| arr.readUIntBE = BP.readUIntBE |
| arr.readUInt8 = BP.readUInt8 |
| arr.readUInt16LE = BP.readUInt16LE |
| arr.readUInt16BE = BP.readUInt16BE |
| arr.readUInt32LE = BP.readUInt32LE |
| arr.readUInt32BE = BP.readUInt32BE |
| arr.readIntLE = BP.readIntLE |
| arr.readIntBE = BP.readIntBE |
| arr.readInt8 = BP.readInt8 |
| arr.readInt16LE = BP.readInt16LE |
| arr.readInt16BE = BP.readInt16BE |
| arr.readInt32LE = BP.readInt32LE |
| arr.readInt32BE = BP.readInt32BE |
| arr.readFloatLE = BP.readFloatLE |
| arr.readFloatBE = BP.readFloatBE |
| arr.readDoubleLE = BP.readDoubleLE |
| arr.readDoubleBE = BP.readDoubleBE |
| arr.writeUInt8 = BP.writeUInt8 |
| arr.writeUIntLE = BP.writeUIntLE |
| arr.writeUIntBE = BP.writeUIntBE |
| arr.writeUInt16LE = BP.writeUInt16LE |
| arr.writeUInt16BE = BP.writeUInt16BE |
| arr.writeUInt32LE = BP.writeUInt32LE |
| arr.writeUInt32BE = BP.writeUInt32BE |
| arr.writeIntLE = BP.writeIntLE |
| arr.writeIntBE = BP.writeIntBE |
| arr.writeInt8 = BP.writeInt8 |
| arr.writeInt16LE = BP.writeInt16LE |
| arr.writeInt16BE = BP.writeInt16BE |
| arr.writeInt32LE = BP.writeInt32LE |
| arr.writeInt32BE = BP.writeInt32BE |
| arr.writeFloatLE = BP.writeFloatLE |
| arr.writeFloatBE = BP.writeFloatBE |
| arr.writeDoubleLE = BP.writeDoubleLE |
| arr.writeDoubleBE = BP.writeDoubleBE |
| arr.fill = BP.fill |
| arr.inspect = BP.inspect |
| arr.toArrayBuffer = BP.toArrayBuffer |
| |
| return arr |
| } |
| |
| var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g |
| |
| function base64clean (str) { |
| // Node strips out invalid characters like \n and \t from the string, base64-js does not |
| str = stringtrim(str).replace(INVALID_BASE64_RE, '') |
| // Node converts strings with length < 2 to '' |
| if (str.length < 2) return '' |
| // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not |
| while (str.length % 4 !== 0) { |
| str = str + '=' |
| } |
| return str |
| } |
| |
| function stringtrim (str) { |
| if (str.trim) return str.trim() |
| return str.replace(/^\s+|\s+$/g, '') |
| } |
| |
| function toHex (n) { |
| if (n < 16) return '0' + n.toString(16) |
| return n.toString(16) |
| } |
| |
| function utf8ToBytes (string, units) { |
| units = units || Infinity |
| var codePoint |
| var length = string.length |
| var leadSurrogate = null |
| var bytes = [] |
| |
| for (var i = 0; i < length; i++) { |
| codePoint = string.charCodeAt(i) |
| |
| // is surrogate component |
| if (codePoint > 0xD7FF && codePoint < 0xE000) { |
| // last char was a lead |
| if (!leadSurrogate) { |
| // no lead yet |
| if (codePoint > 0xDBFF) { |
| // unexpected trail |
| if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) |
| continue |
| } else if (i + 1 === length) { |
| // unpaired lead |
| if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) |
| continue |
| } |
| |
| // valid lead |
| leadSurrogate = codePoint |
| |
| continue |
| } |
| |
| // 2 leads in a row |
| if (codePoint < 0xDC00) { |
| if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) |
| leadSurrogate = codePoint |
| continue |
| } |
| |
| // valid surrogate pair |
| codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000 |
| } else if (leadSurrogate) { |
| // valid bmp char, but last char was a lead |
| if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) |
| } |
| |
| leadSurrogate = null |
| |
| // encode utf8 |
| if (codePoint < 0x80) { |
| if ((units -= 1) < 0) break |
| bytes.push(codePoint) |
| } else if (codePoint < 0x800) { |
| if ((units -= 2) < 0) break |
| bytes.push( |
| codePoint >> 0x6 | 0xC0, |
| codePoint & 0x3F | 0x80 |
| ) |
| } else if (codePoint < 0x10000) { |
| if ((units -= 3) < 0) break |
| bytes.push( |
| codePoint >> 0xC | 0xE0, |
| codePoint >> 0x6 & 0x3F | 0x80, |
| codePoint & 0x3F | 0x80 |
| ) |
| } else if (codePoint < 0x110000) { |
| if ((units -= 4) < 0) break |
| bytes.push( |
| codePoint >> 0x12 | 0xF0, |
| codePoint >> 0xC & 0x3F | 0x80, |
| codePoint >> 0x6 & 0x3F | 0x80, |
| codePoint & 0x3F | 0x80 |
| ) |
| } else { |
| throw new Error('Invalid code point') |
| } |
| } |
| |
| return bytes |
| } |
| |
| function asciiToBytes (str) { |
| var byteArray = [] |
| for (var i = 0; i < str.length; i++) { |
| // Node's code seems to be doing this and not & 0x7F.. |
| byteArray.push(str.charCodeAt(i) & 0xFF) |
| } |
| return byteArray |
| } |
| |
| function utf16leToBytes (str, units) { |
| var c, hi, lo |
| var byteArray = [] |
| for (var i = 0; i < str.length; i++) { |
| if ((units -= 2) < 0) break |
| |
| c = str.charCodeAt(i) |
| hi = c >> 8 |
| lo = c % 256 |
| byteArray.push(lo) |
| byteArray.push(hi) |
| } |
| |
| return byteArray |
| } |
| |
| function base64ToBytes (str) { |
| return base64.toByteArray(base64clean(str)) |
| } |
| |
| function blitBuffer (src, dst, offset, length) { |
| for (var i = 0; i < length; i++) { |
| if ((i + offset >= dst.length) || (i >= src.length)) break |
| dst[i + offset] = src[i] |
| } |
| return i |
| } |
| |
| },{"base64-js":16,"ieee754":17,"is-array":18}],16:[function(require,module,exports){ |
| var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; |
| |
| ;(function (exports) { |
| 'use strict'; |
| |
| var Arr = (typeof Uint8Array !== 'undefined') |
| ? Uint8Array |
| : Array |
| |
| var PLUS = '+'.charCodeAt(0) |
| var SLASH = '/'.charCodeAt(0) |
| var NUMBER = '0'.charCodeAt(0) |
| var LOWER = 'a'.charCodeAt(0) |
| var UPPER = 'A'.charCodeAt(0) |
| var PLUS_URL_SAFE = '-'.charCodeAt(0) |
| var SLASH_URL_SAFE = '_'.charCodeAt(0) |
| |
| function decode (elt) { |
| var code = elt.charCodeAt(0) |
| if (code === PLUS || |
| code === PLUS_URL_SAFE) |
| return 62 // '+' |
| if (code === SLASH || |
| code === SLASH_URL_SAFE) |
| return 63 // '/' |
| if (code < NUMBER) |
| return -1 //no match |
| if (code < NUMBER + 10) |
| return code - NUMBER + 26 + 26 |
| if (code < UPPER + 26) |
| return code - UPPER |
| if (code < LOWER + 26) |
| return code - LOWER + 26 |
| } |
| |
| function b64ToByteArray (b64) { |
| var i, j, l, tmp, placeHolders, arr |
| |
| if (b64.length % 4 > 0) { |
| throw new Error('Invalid string. Length must be a multiple of 4') |
| } |
| |
| // the number of equal signs (place holders) |
| // if there are two placeholders, than the two characters before it |
| // represent one byte |
| // if there is only one, then the three characters before it represent 2 bytes |
| // this is just a cheap hack to not do indexOf twice |
| var len = b64.length |
| placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 |
| |
| // base64 is 4/3 + up to two characters of the original data |
| arr = new Arr(b64.length * 3 / 4 - placeHolders) |
| |
| // if there are placeholders, only get up to the last complete 4 chars |
| l = placeHolders > 0 ? b64.length - 4 : b64.length |
| |
| var L = 0 |
| |
| function push (v) { |
| arr[L++] = v |
| } |
| |
| for (i = 0, j = 0; i < l; i += 4, j += 3) { |
| tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) |
| push((tmp & 0xFF0000) >> 16) |
| push((tmp & 0xFF00) >> 8) |
| push(tmp & 0xFF) |
| } |
| |
| if (placeHolders === 2) { |
| tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) |
| push(tmp & 0xFF) |
| } else if (placeHolders === 1) { |
| tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) |
| push((tmp >> 8) & 0xFF) |
| push(tmp & 0xFF) |
| } |
| |
| return arr |
| } |
| |
| function uint8ToBase64 (uint8) { |
| var i, |
| extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes |
| output = "", |
| temp, length |
| |
| function encode (num) { |
| return lookup.charAt(num) |
| } |
| |
| function tripletToBase64 (num) { |
| return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) |
| } |
| |
| // go through the array every three bytes, we'll deal with trailing stuff later |
| for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { |
| temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) |
| output += tripletToBase64(temp) |
| } |
| |
| // pad the end with zeros, but make sure to not forget the extra bytes |
| switch (extraBytes) { |
| case 1: |
| temp = uint8[uint8.length - 1] |
| output += encode(temp >> 2) |
| output += encode((temp << 4) & 0x3F) |
| output += '==' |
| break |
| case 2: |
| temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) |
| output += encode(temp >> 10) |
| output += encode((temp >> 4) & 0x3F) |
| output += encode((temp << 2) & 0x3F) |
| output += '=' |
| break |
| } |
| |
| return output |
| } |
| |
| exports.toByteArray = b64ToByteArray |
| exports.fromByteArray = uint8ToBase64 |
| }(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) |
| |
| },{}],17:[function(require,module,exports){ |
| exports.read = function (buffer, offset, isLE, mLen, nBytes) { |
| var e, m |
| var eLen = nBytes * 8 - mLen - 1 |
| var eMax = (1 << eLen) - 1 |
| var eBias = eMax >> 1 |
| var nBits = -7 |
| var i = isLE ? (nBytes - 1) : 0 |
| var d = isLE ? -1 : 1 |
| var s = buffer[offset + i] |
| |
| i += d |
| |
| e = s & ((1 << (-nBits)) - 1) |
| s >>= (-nBits) |
| nBits += eLen |
| for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} |
| |
| m = e & ((1 << (-nBits)) - 1) |
| e >>= (-nBits) |
| nBits += mLen |
| for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} |
| |
| if (e === 0) { |
| e = 1 - eBias |
| } else if (e === eMax) { |
| return m ? NaN : ((s ? -1 : 1) * Infinity) |
| } else { |
| m = m + Math.pow(2, mLen) |
| e = e - eBias |
| } |
| return (s ? -1 : 1) * m * Math.pow(2, e - mLen) |
| } |
| |
| exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { |
| var e, m, c |
| var eLen = nBytes * 8 - mLen - 1 |
| var eMax = (1 << eLen) - 1 |
| var eBias = eMax >> 1 |
| var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) |
| var i = isLE ? 0 : (nBytes - 1) |
| var d = isLE ? 1 : -1 |
| var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 |
| |
| value = Math.abs(value) |
| |
| if (isNaN(value) || value === Infinity) { |
| m = isNaN(value) ? 1 : 0 |
| e = eMax |
| } else { |
| e = Math.floor(Math.log(value) / Math.LN2) |
| if (value * (c = Math.pow(2, -e)) < 1) { |
| e-- |
| c *= 2 |
| } |
| if (e + eBias >= 1) { |
| value += rt / c |
| } else { |
| value += rt * Math.pow(2, 1 - eBias) |
| } |
| if (value * c >= 2) { |
| e++ |
| c /= 2 |
| } |
| |
| if (e + eBias >= eMax) { |
| m = 0 |
| e = eMax |
| } else if (e + eBias >= 1) { |
| m = (value * c - 1) * Math.pow(2, mLen) |
| e = e + eBias |
| } else { |
| m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) |
| e = 0 |
| } |
| } |
| |
| for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} |
| |
| e = (e << mLen) | m |
| eLen += mLen |
| for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} |
| |
| buffer[offset + i - d] |= s * 128 |
| } |
| |
| },{}],18:[function(require,module,exports){ |
| |
| /** |
| * isArray |
| */ |
| |
| var isArray = Array.isArray; |
| |
| /** |
| * toString |
| */ |
| |
| var str = Object.prototype.toString; |
| |
| /** |
| * Whether or not the given `val` |
| * is an array. |
| * |
| * example: |
| * |
| * isArray([]); |
| * // > true |
| * isArray(arguments); |
| * // > false |
| * isArray(''); |
| * // > false |
| * |
| * @param {mixed} val |
| * @return {bool} |
| */ |
| |
| module.exports = isArray || function (val) { |
| return !! val && '[object Array]' == str.call(val); |
| }; |
| |
| },{}],19:[function(require,module,exports){ |
| /* jshint node: true */ |
| (function () { |
| "use strict"; |
| |
| function CookieAccessInfo(domain, path, secure, script) { |
| if (this instanceof CookieAccessInfo) { |
| this.domain = domain || undefined; |
| this.path = path || "/"; |
| this.secure = !!secure; |
| this.script = !!script; |
| return this; |
| } |
| return new CookieAccessInfo(domain, path, secure, script); |
| } |
| exports.CookieAccessInfo = CookieAccessInfo; |
| |
| function Cookie(cookiestr, request_domain, request_path) { |
| if (cookiestr instanceof Cookie) { |
| return cookiestr; |
| } |
| if (this instanceof Cookie) { |
| this.name = null; |
| this.value = null; |
| this.expiration_date = Infinity; |
| this.path = String(request_path || "/"); |
| this.explicit_path = false; |
| this.domain = request_domain || null; |
| this.explicit_domain = false; |
| this.secure = false; //how to define default? |
| this.noscript = false; //httponly |
| if (cookiestr) { |
| this.parse(cookiestr, request_domain, request_path); |
| } |
| return this; |
| } |
| return new Cookie(cookiestr, request_domain, request_path); |
| } |
| exports.Cookie = Cookie; |
| |
| Cookie.prototype.toString = function toString() { |
| var str = [this.name + "=" + this.value]; |
| if (this.expiration_date !== Infinity) { |
| str.push("expires=" + (new Date(this.expiration_date)).toGMTString()); |
| } |
| if (this.domain) { |
| str.push("domain=" + this.domain); |
| } |
| if (this.path) { |
| str.push("path=" + this.path); |
| } |
| if (this.secure) { |
| str.push("secure"); |
| } |
| if (this.noscript) { |
| str.push("httponly"); |
| } |
| return str.join("; "); |
| }; |
| |
| Cookie.prototype.toValueString = function toValueString() { |
| return this.name + "=" + this.value; |
| }; |
| |
| var cookie_str_splitter = /[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g; |
| Cookie.prototype.parse = function parse(str, request_domain, request_path) { |
| if (this instanceof Cookie) { |
| var parts = str.split(";").filter(function (value) { |
| return !!value; |
| }), |
| pair = parts[0].match(/([^=]+)=([\s\S]*)/), |
| key = pair[1], |
| value = pair[2], |
| i; |
| this.name = key; |
| this.value = value; |
| |
| for (i = 1; i < parts.length; i += 1) { |
| pair = parts[i].match(/([^=]+)(?:=([\s\S]*))?/); |
| key = pair[1].trim().toLowerCase(); |
| value = pair[2]; |
| switch (key) { |
| case "httponly": |
| this.noscript = true; |
| break; |
| case "expires": |
| this.expiration_date = value ? |
| Number(Date.parse(value)) : |
| Infinity; |
| break; |
| case "path": |
| this.path = value ? |
| value.trim() : |
| ""; |
| this.explicit_path = true; |
| break; |
| case "domain": |
| this.domain = value ? |
| value.trim() : |
| ""; |
| this.explicit_domain = !!this.domain; |
| break; |
| case "secure": |
| this.secure = true; |
| break; |
| } |
| } |
| |
| if (!this.explicit_path) { |
| this.path = request_path || "/"; |
| } |
| if (!this.explicit_domain) { |
| this.domain = request_domain; |
| } |
| |
| return this; |
| } |
| return new Cookie().parse(str, request_domain, request_path); |
| }; |
| |
| Cookie.prototype.matches = function matches(access_info) { |
| if (this.noscript && access_info.script || |
| this.secure && !access_info.secure || |
| !this.collidesWith(access_info)) { |
| return false; |
| } |
| return true; |
| }; |
| |
| Cookie.prototype.collidesWith = function collidesWith(access_info) { |
| if ((this.path && !access_info.path) || (this.domain && !access_info.domain)) { |
| return false; |
| } |
| if (this.path && access_info.path.indexOf(this.path) !== 0) { |
| return false; |
| } |
| if (this.explicit_path && access_info.path.indexOf( this.path ) !== 0) { |
| return false; |
| } |
| var access_domain = access_info.domain && access_info.domain.replace(/^[\.]/,''); |
| var cookie_domain = this.domain && this.domain.replace(/^[\.]/,''); |
| if (cookie_domain === access_domain) { |
| return true; |
| } |
| if (cookie_domain) { |
| if (!this.explicit_domain) { |
| return false; // we already checked if the domains were exactly the same |
| } |
| var wildcard = access_domain.indexOf(cookie_domain); |
| if (wildcard === -1 || wildcard !== access_domain.length - cookie_domain.length) { |
| return false; |
| } |
| return true; |
| } |
| return true; |
| }; |
| |
| function CookieJar() { |
| var cookies, cookies_list, collidable_cookie; |
| if (this instanceof CookieJar) { |
| cookies = Object.create(null); //name: [Cookie] |
| |
| this.setCookie = function setCookie(cookie, request_domain, request_path) { |
| var remove, i; |
| cookie = new Cookie(cookie, request_domain, request_path); |
| //Delete the cookie if the set is past the current time |
| remove = cookie.expiration_date <= Date.now(); |
| if (cookies[cookie.name] !== undefined) { |
| cookies_list = cookies[cookie.name]; |
| for (i = 0; i < cookies_list.length; i += 1) { |
| collidable_cookie = cookies_list[i]; |
| if (collidable_cookie.collidesWith(cookie)) { |
| if (remove) { |
| cookies_list.splice(i, 1); |
| if (cookies_list.length === 0) { |
| delete cookies[cookie.name]; |
| } |
| return false; |
| } |
| cookies_list[i] = cookie; |
| return cookie; |
| } |
| } |
| if (remove) { |
| return false; |
| } |
| cookies_list.push(cookie); |
| return cookie; |
| } |
| if (remove) { |
| return false; |
| } |
| cookies[cookie.name] = [cookie]; |
| return cookies[cookie.name]; |
| }; |
| //returns a cookie |
| this.getCookie = function getCookie(cookie_name, access_info) { |
| var cookie, i; |
| cookies_list = cookies[cookie_name]; |
| if (!cookies_list) { |
| return; |
| } |
| for (i = 0; i < cookies_list.length; i += 1) { |
| cookie = cookies_list[i]; |
| if (cookie.expiration_date <= Date.now()) { |
| if (cookies_list.length === 0) { |
| delete cookies[cookie.name]; |
| } |
| continue; |
| } |
| |
| if (cookie.matches(access_info)) { |
| return cookie; |
| } |
| } |
| }; |
| //returns a list of cookies |
| this.getCookies = function getCookies(access_info) { |
| var matches = [], cookie_name, cookie; |
| for (cookie_name in cookies) { |
| cookie = this.getCookie(cookie_name, access_info); |
| if (cookie) { |
| matches.push(cookie); |
| } |
| } |
| matches.toString = function toString() { |
| return matches.join(":"); |
| }; |
| matches.toValueString = function toValueString() { |
| return matches.map(function (c) { |
| return c.toValueString(); |
| }).join(';'); |
| }; |
| return matches; |
| }; |
| |
| return this; |
| } |
| return new CookieJar(); |
| } |
| exports.CookieJar = CookieJar; |
| |
| //returns list of cookies that were set correctly. Cookies that are expired and removed are not returned. |
| CookieJar.prototype.setCookies = function setCookies(cookies, request_domain, request_path) { |
| cookies = Array.isArray(cookies) ? |
| cookies : |
| cookies.split(cookie_str_splitter); |
| var successful = [], |
| i, |
| cookie; |
| cookies = cookies.map(function(item){ |
| return new Cookie(item, request_domain, request_path); |
| }); |
| for (i = 0; i < cookies.length; i += 1) { |
| cookie = cookies[i]; |
| if (this.setCookie(cookie, request_domain, request_path)) { |
| successful.push(cookie); |
| } |
| } |
| return successful; |
| }; |
| }()); |
| |
| },{}],20:[function(require,module,exports){ |
| 'use strict'; |
| |
| |
| var yaml = require('./lib/js-yaml.js'); |
| |
| |
| module.exports = yaml; |
| |
| },{"./lib/js-yaml.js":21}],21:[function(require,module,exports){ |
| 'use strict'; |
| |
| |
| var loader = require('./js-yaml/loader'); |
| var dumper = require('./js-yaml/dumper'); |
| |
| |
| function deprecated(name) { |
| return function () { |
| throw new Error('Function ' + name + ' is deprecated and cannot be used.'); |
| }; |
| } |
| |
| |
| module.exports.Type = require('./js-yaml/type'); |
| module.exports.Schema = require('./js-yaml/schema'); |
| module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe'); |
| module.exports.JSON_SCHEMA = require('./js-yaml/schema/json'); |
| module.exports.CORE_SCHEMA = require('./js-yaml/schema/core'); |
| module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); |
| module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full'); |
| module.exports.load = loader.load; |
| module.exports.loadAll = loader.loadAll; |
| module.exports.safeLoad = loader.safeLoad; |
| module.exports.safeLoadAll = loader.safeLoadAll; |
| module.exports.dump = dumper.dump; |
| module.exports.safeDump = dumper.safeDump; |
| module.exports.YAMLException = require('./js-yaml/exception'); |
| |
| // Deprecated schema names from JS-YAML 2.0.x |
| module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe'); |
| module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); |
| module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full'); |
| |
| // Deprecated functions from JS-YAML 1.x.x |
| module.exports.scan = deprecated('scan'); |
| module.exports.parse = deprecated('parse'); |
| module.exports.compose = deprecated('compose'); |
| module.exports.addConstructor = deprecated('addConstructor'); |
| |
| },{"./js-yaml/dumper":23,"./js-yaml/exception":24,"./js-yaml/loader":25,"./js-yaml/schema":27,"./js-yaml/schema/core":28,"./js-yaml/schema/default_full":29,"./js-yaml/schema/default_safe":30,"./js-yaml/schema/failsafe":31,"./js-yaml/schema/json":32,"./js-yaml/type":33}],22:[function(require,module,exports){ |
| 'use strict'; |
| |
| |
| function isNothing(subject) { |
| return (typeof subject === 'undefined') || (null === subject); |
| } |
| |
| |
| function isObject(subject) { |
| return (typeof subject === 'object') && (null !== subject); |
| } |
| |
| |
| function toArray(sequence) { |
| if (Array.isArray(sequence)) { |
| return sequence; |
| } else if (isNothing(sequence)) { |
| return []; |
| } |
| return [ sequence ]; |
| } |
| |
| |
| function extend(target, source) { |
| var index, length, key, sourceKeys; |
| |
| if (source) { |
| sourceKeys = Object.keys(source); |
| |
| for (index = 0, length = sourceKeys.length; index < length; index += 1) { |
| key = sourceKeys[index]; |
| target[key] = source[key]; |
| } |
| } |
| |
| return target; |
| } |
| |
| |
| function repeat(string, count) { |
| var result = '', cycle; |
| |
| for (cycle = 0; cycle < count; cycle += 1) { |
| result += string; |
| } |
| |
| return result; |
| } |
| |
| |
| function isNegativeZero(number) { |
| return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number); |
| } |
| |
| |
| module.exports.isNothing = isNothing; |
| module.exports.isObject = isObject; |
| module.exports.toArray = toArray; |
| module.exports.repeat = repeat; |
| module.exports.isNegativeZero = isNegativeZero; |
| module.exports.extend = extend; |
| |
| },{}],23:[function(require,module,exports){ |
| 'use strict'; |
| |
| /*eslint-disable no-use-before-define*/ |
| |
| var common = require('./common'); |
| var YAMLException = require('./exception'); |
| var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); |
| var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); |
| |
| var _toString = Object.prototype.toString; |
| var _hasOwnProperty = Object.prototype.hasOwnProperty; |
| |
| var CHAR_TAB = 0x09; /* Tab */ |
| var CHAR_LINE_FEED = 0x0A; /* LF */ |
| var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ |
| var CHAR_SPACE = 0x20; /* Space */ |
| var CHAR_EXCLAMATION = 0x21; /* ! */ |
| var CHAR_DOUBLE_QUOTE = 0x22; /* " */ |
| var CHAR_SHARP = 0x23; /* # */ |
| var CHAR_PERCENT = 0x25; /* % */ |
| var CHAR_AMPERSAND = 0x26; /* & */ |
| var CHAR_SINGLE_QUOTE = 0x27; /* ' */ |
| var CHAR_ASTERISK = 0x2A; /* * */ |
| var CHAR_COMMA = 0x2C; /* , */ |
| var CHAR_MINUS = 0x2D; /* - */ |
| var CHAR_COLON = 0x3A; /* : */ |
| var CHAR_GREATER_THAN = 0x3E; /* > */ |
| var CHAR_QUESTION = 0x3F; /* ? */ |
| var CHAR_COMMERCIAL_AT = 0x40; /* @ */ |
| var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ |
| var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ |
| var CHAR_GRAVE_ACCENT = 0x60; /* ` */ |
| var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ |
| var CHAR_VERTICAL_LINE = 0x7C; /* | */ |
| var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ |
| |
| var ESCAPE_SEQUENCES = {}; |
| |
| ESCAPE_SEQUENCES[0x00] = '\\0'; |
| ESCAPE_SEQUENCES[0x07] = '\\a'; |
| ESCAPE_SEQUENCES[0x08] = '\\b'; |
| ESCAPE_SEQUENCES[0x09] = '\\t'; |
| ESCAPE_SEQUENCES[0x0A] = '\\n'; |
| ESCAPE_SEQUENCES[0x0B] = '\\v'; |
| ESCAPE_SEQUENCES[0x0C] = '\\f'; |
| ESCAPE_SEQUENCES[0x0D] = '\\r'; |
| ESCAPE_SEQUENCES[0x1B] = '\\e'; |
| ESCAPE_SEQUENCES[0x22] = '\\"'; |
| ESCAPE_SEQUENCES[0x5C] = '\\\\'; |
| ESCAPE_SEQUENCES[0x85] = '\\N'; |
| ESCAPE_SEQUENCES[0xA0] = '\\_'; |
| ESCAPE_SEQUENCES[0x2028] = '\\L'; |
| ESCAPE_SEQUENCES[0x2029] = '\\P'; |
| |
| var DEPRECATED_BOOLEANS_SYNTAX = [ |
| 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', |
| 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' |
| ]; |
| |
| function compileStyleMap(schema, map) { |
| var result, keys, index, length, tag, style, type; |
| |
| if (null === map) { |
| return {}; |
| } |
| |
| result = {}; |
| keys = Object.keys(map); |
| |
| for (index = 0, length = keys.length; index < length; index += 1) { |
| tag = keys[index]; |
| style = String(map[tag]); |
| |
| if ('!!' === tag.slice(0, 2)) { |
| tag = 'tag:yaml.org,2002:' + tag.slice(2); |
| } |
| |
| type = schema.compiledTypeMap[tag]; |
| |
| if (type && _hasOwnProperty.call(type.styleAliases, style)) { |
| style = type.styleAliases[style]; |
| } |
| |
| result[tag] = style; |
| } |
| |
| return result; |
| } |
| |
| function encodeHex(character) { |
| var string, handle, length; |
| |
| string = character.toString(16).toUpperCase(); |
| |
| if (character <= 0xFF) { |
| handle = 'x'; |
| length = 2; |
| } else if (character <= 0xFFFF) { |
| handle = 'u'; |
| length = 4; |
| } else if (character <= 0xFFFFFFFF) { |
| handle = 'U'; |
| length = 8; |
| } else { |
| throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); |
| } |
| |
| return '\\' + handle + common.repeat('0', length - string.length) + string; |
| } |
| |
| function State(options) { |
| this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; |
| this.indent = Math.max(1, (options['indent'] || 2)); |
| this.skipInvalid = options['skipInvalid'] || false; |
| this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); |
| this.styleMap = compileStyleMap(this.schema, options['styles'] || null); |
| this.sortKeys = options['sortKeys'] || false; |
| this.lineWidth = options['lineWidth'] || 80; |
| |
| this.implicitTypes = this.schema.compiledImplicit; |
| this.explicitTypes = this.schema.compiledExplicit; |
| |
| this.tag = null; |
| this.result = ''; |
| |
| this.duplicates = []; |
| this.usedDuplicates = null; |
| } |
| |
| function indentString(string, spaces) { |
| var ind = common.repeat(' ', spaces), |
| position = 0, |
| next = -1, |
| result = '', |
| line, |
| length = string.length; |
| |
| while (position < length) { |
| next = string.indexOf('\n', position); |
| if (next === -1) { |
| line = string.slice(position); |
| position = length; |
| } else { |
| line = string.slice(position, next + 1); |
| position = next + 1; |
| } |
| if (line.length && line !== '\n') { |
| result += ind; |
| } |
| result += line; |
| } |
| |
| return result; |
| } |
| |
| function generateNextLine(state, level) { |
| return '\n' + common.repeat(' ', state.indent * level); |
| } |
| |
| function testImplicitResolving(state, str) { |
| var index, length, type; |
| |
| for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { |
| type = state.implicitTypes[index]; |
| |
| if (type.resolve(str)) { |
| return true; |
| } |
| } |
| |
| return false; |
| } |
| |
| function StringBuilder(source) { |
| this.source = source; |
| this.result = ''; |
| this.checkpoint = 0; |
| } |
| |
| StringBuilder.prototype.takeUpTo = function (position) { |
| var er; |
| |
| if (position < this.checkpoint) { |
| er = new Error('position should be > checkpoint'); |
| er.position = position; |
| er.checkpoint = this.checkpoint; |
| throw er; |
| } |
| |
| this.result += this.source.slice(this.checkpoint, position); |
| this.checkpoint = position; |
| return this; |
| }; |
| |
| StringBuilder.prototype.escapeChar = function () { |
| var character, esc; |
| |
| character = this.source.charCodeAt(this.checkpoint); |
| esc = ESCAPE_SEQUENCES[character] || encodeHex(character); |
| this.result += esc; |
| this.checkpoint += 1; |
| |
| return this; |
| }; |
| |
| StringBuilder.prototype.finish = function () { |
| if (this.source.length > this.checkpoint) { |
| this.takeUpTo(this.source.length); |
| } |
| }; |
| |
| function writeScalar(state, object, level, iskey) { |
| var simple, first, spaceWrap, folded, literal, single, double, |
| sawLineFeed, linePosition, longestLine, indent, max, character, |
| position, escapeSeq, hexEsc, previous, lineLength, modifier, |
| trailingLineBreaks, result; |
| |
| if (0 === object.length) { |
| state.dump = "''"; |
| return; |
| } |
| |
| if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) { |
| state.dump = "'" + object + "'"; |
| return; |
| } |
| |
| simple = true; |
| first = object.length ? object.charCodeAt(0) : 0; |
| spaceWrap = (CHAR_SPACE === first || |
| CHAR_SPACE === object.charCodeAt(object.length - 1)); |
| |
| // Simplified check for restricted first characters |
| // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29 |
| if (CHAR_MINUS === first || |
| CHAR_QUESTION === first || |
| CHAR_COMMERCIAL_AT === first || |
| CHAR_GRAVE_ACCENT === first) { |
| simple = false; |
| } |
| |
| // can only use > and | if not wrapped in spaces or is not a key. |
| if (spaceWrap) { |
| simple = false; |
| folded = false; |
| literal = false; |
| } else { |
| folded = !iskey; |
| literal = !iskey; |
| } |
| |
| single = true; |
| double = new StringBuilder(object); |
| |
| sawLineFeed = false; |
| linePosition = 0; |
| longestLine = 0; |
| |
| indent = state.indent * level; |
| max = state.lineWidth; |
| if (max === -1) { |
| // Replace -1 with biggest ingeger number according to |
| // http://ecma262-5.com/ELS5_HTML.htm#Section_8.5 |
| max = 9007199254740991; |
| } |
| |
| if (indent < 40) { |
| max -= indent; |
| } else { |
| max = 40; |
| } |
| |
| for (position = 0; position < object.length; position++) { |
| character = object.charCodeAt(position); |
| if (simple) { |
| // Characters that can never appear in the simple scalar |
| if (!simpleChar(character)) { |
| simple = false; |
| } else { |
| // Still simple. If we make it all the way through like |
| // this, then we can just dump the string as-is. |
| continue; |
| } |
| } |
| |
| if (single && character === CHAR_SINGLE_QUOTE) { |
| single = false; |
| } |
| |
| escapeSeq = ESCAPE_SEQUENCES[character]; |
| hexEsc = needsHexEscape(character); |
| |
| if (!escapeSeq && !hexEsc) { |
| continue; |
| } |
| |
| if (character !== CHAR_LINE_FEED && |
| character !== CHAR_DOUBLE_QUOTE && |
| character !== CHAR_SINGLE_QUOTE) { |
| folded = false; |
| literal = false; |
| } else if (character === CHAR_LINE_FEED) { |
| sawLineFeed = true; |
| single = false; |
| if (position > 0) { |
| previous = object.charCodeAt(position - 1); |
| if (previous === CHAR_SPACE) { |
| literal = false; |
| folded = false; |
| } |
| } |
| if (folded) { |
| lineLength = position - linePosition; |
| linePosition = position; |
| if (lineLength > longestLine) { |
| longestLine = lineLength; |
| } |
| } |
| } |
| |
| if (character !== CHAR_DOUBLE_QUOTE) { |
| single = false; |
| } |
| |
| double.takeUpTo(position); |
| double.escapeChar(); |
| } |
| |
| if (simple && testImplicitResolving(state, object)) { |
| simple = false; |
| } |
| |
| modifier = ''; |
| if (folded || literal) { |
| trailingLineBreaks = 0; |
| if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) { |
| trailingLineBreaks += 1; |
| if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) { |
| trailingLineBreaks += 1; |
| } |
| } |
| |
| if (trailingLineBreaks === 0) { |
| modifier = '-'; |
| } else if (trailingLineBreaks === 2) { |
| modifier = '+'; |
| } |
| } |
| |
| if (literal && longestLine < max) { |
| folded = false; |
| } |
| |
| // If it's literally one line, then don't bother with the literal. |
| // We may still want to do a fold, though, if it's a super long line. |
| if (!sawLineFeed) { |
| literal = false; |
| } |
| |
| if (simple) { |
| state.dump = object; |
| } else if (single) { |
| state.dump = '\'' + object + '\''; |
| } else if (folded) { |
| result = fold(object, max); |
| state.dump = '>' + modifier + '\n' + indentString(result, indent); |
| } else if (literal) { |
| if (!modifier) { |
| object = object.replace(/\n$/, ''); |
| } |
| state.dump = '|' + modifier + '\n' + indentString(object, indent); |
| } else if (double) { |
| double.finish(); |
| state.dump = '"' + double.result + '"'; |
| } else { |
| throw new Error('Failed to dump scalar value'); |
| } |
| |
| return; |
| } |
| |
| // The `trailing` var is a regexp match of any trailing `\n` characters. |
| // |
| // There are three cases we care about: |
| // |
| // 1. One trailing `\n` on the string. Just use `|` or `>`. |
| // This is the assumed default. (trailing = null) |
| // 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end. |
| // 3. More than one trailing `\n` on the string. Use `|+` or `>+`. |
| // |
| // In the case of `>+`, these line breaks are *not* doubled (like the line |
| // breaks within the string), so it's important to only end with the exact |
| // same number as we started. |
| function fold(object, max) { |
| var result = '', |
| position = 0, |
| length = object.length, |
| trailing = /\n+$/.exec(object), |
| newLine; |
| |
| if (trailing) { |
| length = trailing.index + 1; |
| } |
| |
| while (position < length) { |
| newLine = object.indexOf('\n', position); |
| if (newLine > length || newLine === -1) { |
| if (result) { |
| result += '\n\n'; |
| } |
| result += foldLine(object.slice(position, length), max); |
| position = length; |
| } else { |
| if (result) { |
| result += '\n\n'; |
| } |
| result += foldLine(object.slice(position, newLine), max); |
| position = newLine + 1; |
| } |
| } |
| if (trailing && trailing[0] !== '\n') { |
| result += trailing[0]; |
| } |
| |
| return result; |
| } |
| |
| function foldLine(line, max) { |
| if (line === '') { |
| return line; |
| } |
| |
| var foldRe = /[^\s] [^\s]/g, |
| result = '', |
| prevMatch = 0, |
| foldStart = 0, |
| match = foldRe.exec(line), |
| index, |
| foldEnd, |
| folded; |
| |
| while (match) { |
| index = match.index; |
| |
| // when we cross the max len, if the previous match would've |
| // been ok, use that one, and carry on. If there was no previous |
| // match on this fold section, then just have a long line. |
| if (index - foldStart > max) { |
| if (prevMatch !== foldStart) { |
| foldEnd = prevMatch; |
| } else { |
| foldEnd = index; |
| } |
| |
| if (result) { |
| result += '\n'; |
| } |
| folded = line.slice(foldStart, foldEnd); |
| result += folded; |
| foldStart = foldEnd + 1; |
| } |
| prevMatch = index + 1; |
| match = foldRe.exec(line); |
| } |
| |
| if (result) { |
| result += '\n'; |
| } |
| |
| // if we end up with one last word at the end, then the last bit might |
| // be slightly bigger than we wanted, because we exited out of the loop. |
| if (foldStart !== prevMatch && line.length - foldStart > max) { |
| result += line.slice(foldStart, prevMatch) + '\n' + |
| line.slice(prevMatch + 1); |
| } else { |
| result += line.slice(foldStart); |
| } |
| |
| return result; |
| } |
| |
| // Returns true if character can be found in a simple scalar |
| function simpleChar(character) { |
| return CHAR_TAB !== character && |
| CHAR_LINE_FEED !== character && |
| CHAR_CARRIAGE_RETURN !== character && |
| CHAR_COMMA !== character && |
| CHAR_LEFT_SQUARE_BRACKET !== character && |
| CHAR_RIGHT_SQUARE_BRACKET !== character && |
| CHAR_LEFT_CURLY_BRACKET !== character && |
| CHAR_RIGHT_CURLY_BRACKET !== character && |
| CHAR_SHARP !== character && |
| CHAR_AMPERSAND !== character && |
| CHAR_ASTERISK !== character && |
| CHAR_EXCLAMATION !== character && |
| CHAR_VERTICAL_LINE !== character && |
| CHAR_GREATER_THAN !== character && |
| CHAR_SINGLE_QUOTE !== character && |
| CHAR_DOUBLE_QUOTE !== character && |
| CHAR_PERCENT !== character && |
| CHAR_COLON !== character && |
| !ESCAPE_SEQUENCES[character] && |
| !needsHexEscape(character); |
| } |
| |
| // Returns true if the character code needs to be escaped. |
| function needsHexEscape(character) { |
| return !((0x00020 <= character && character <= 0x00007E) || |
| (0x00085 === character) || |
| (0x000A0 <= character && character <= 0x00D7FF) || |
| (0x0E000 <= character && character <= 0x00FFFD) || |
| (0x10000 <= character && character <= 0x10FFFF)); |
| } |
| |
| function writeFlowSequence(state, level, object) { |
| var _result = '', |
| _tag = state.tag, |
| index, |
| length; |
| |
| for (index = 0, length = object.length; index < length; index += 1) { |
| // Write only valid elements. |
| if (writeNode(state, level, object[index], false, false)) { |
| if (0 !== index) { |
| _result += ', '; |
| } |
| _result += state.dump; |
| } |
| } |
| |
| state.tag = _tag; |
| state.dump = '[' + _result + ']'; |
| } |
| |
| function writeBlockSequence(state, level, object, compact) { |
| var _result = '', |
| _tag = state.tag, |
| index, |
| length; |
| |
| for (index = 0, length = object.length; index < length; index += 1) { |
| // Write only valid elements. |
| if (writeNode(state, level + 1, object[index], true, true)) { |
| if (!compact || 0 !== index) { |
| _result += generateNextLine(state, level); |
| } |
| _result += '- ' + state.dump; |
| } |
| } |
| |
| state.tag = _tag; |
| state.dump = _result || '[]'; // Empty sequence if no valid values. |
| } |
| |
| function writeFlowMapping(state, level, object) { |
| var _result = '', |
| _tag = state.tag, |
| objectKeyList = Object.keys(object), |
| index, |
| length, |
| objectKey, |
| objectValue, |
| pairBuffer; |
| |
| for (index = 0, length = objectKeyList.length; index < length; index += 1) { |
| pairBuffer = ''; |
| |
| if (0 !== index) { |
| pairBuffer += ', '; |
| } |
| |
| objectKey = objectKeyList[index]; |
| objectValue = object[objectKey]; |
| |
| if (!writeNode(state, level, objectKey, false, false)) { |
| continue; // Skip this pair because of invalid key; |
| } |
| |
| if (state.dump.length > 1024) { |
| pairBuffer += '? '; |
| } |
| |
| pairBuffer += state.dump + ': '; |
| |
| if (!writeNode(state, level, objectValue, false, false)) { |
| continue; // Skip this pair because of invalid value. |
| } |
| |
| pairBuffer += state.dump; |
| |
| // Both key and value are valid. |
| _result += pairBuffer; |
| } |
| |
| state.tag = _tag; |
| state.dump = '{' + _result + '}'; |
| } |
| |
| function writeBlockMapping(state, level, object, compact) { |
| var _result = '', |
| _tag = state.tag, |
| objectKeyList = Object.keys(object), |
| index, |
| length, |
| objectKey, |
| objectValue, |
| explicitPair, |
| pairBuffer; |
| |
| // Allow sorting keys so that the output file is deterministic |
| if (state.sortKeys === true) { |
| // Default sorting |
| objectKeyList.sort(); |
| } else if (typeof state.sortKeys === 'function') { |
| // Custom sort function |
| objectKeyList.sort(state.sortKeys); |
| } else if (state.sortKeys) { |
| // Something is wrong |
| throw new YAMLException('sortKeys must be a boolean or a function'); |
| } |
| |
| for (index = 0, length = objectKeyList.length; index < length; index += 1) { |
| pairBuffer = ''; |
| |
| if (!compact || 0 !== index) { |
| pairBuffer += generateNextLine(state, level); |
| } |
| |
| objectKey = objectKeyList[index]; |
| objectValue = object[objectKey]; |
| |
| if (!writeNode(state, level + 1, objectKey, true, true, true)) { |
| continue; // Skip this pair because of invalid key. |
| } |
| |
| explicitPair = (null !== state.tag && '?' !== state.tag) || |
| (state.dump && state.dump.length > 1024); |
| |
| if (explicitPair) { |
| if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { |
| pairBuffer += '?'; |
| } else { |
| pairBuffer += '? '; |
| } |
| } |
| |
| pairBuffer += state.dump; |
| |
| if (explicitPair) { |
| pairBuffer += generateNextLine(state, level); |
| } |
| |
| if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { |
| continue; // Skip this pair because of invalid value. |
| } |
| |
| if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { |
| pairBuffer += ':'; |
| } else { |
| pairBuffer += ': '; |
| } |
| |
| pairBuffer += state.dump; |
| |
| // Both key and value are valid. |
| _result += pairBuffer; |
| } |
| |
| state.tag = _tag; |
| state.dump = _result || '{}'; // Empty mapping if no valid pairs. |
| } |
| |
| function detectType(state, object, explicit) { |
| var _result, typeList, index, length, type, style; |
| |
| typeList = explicit ? state.explicitTypes : state.implicitTypes; |
| |
| for (index = 0, length = typeList.length; index < length; index += 1) { |
| type = typeList[index]; |
| |
| if ((type.instanceOf || type.predicate) && |
| (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) && |
| (!type.predicate || type.predicate(object))) { |
| |
| state.tag = explicit ? type.tag : '?'; |
| |
| if (type.represent) { |
| style = state.styleMap[type.tag] || type.defaultStyle; |
| |
| if ('[object Function]' === _toString.call(type.represent)) { |
| _result = type.represent(object, style); |
| } else if (_hasOwnProperty.call(type.represent, style)) { |
| _result = type.represent[style](object, style); |
| } else { |
| throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); |
| } |
| |
| state.dump = _result; |
| } |
| |
| return true; |
| } |
| } |
| |
| return false; |
| } |
| |
| // Serializes `object` and writes it to global `result`. |
| // Returns true on success, or false on invalid object. |
| // |
| function writeNode(state, level, object, block, compact, iskey) { |
| state.tag = null; |
| state.dump = object; |
| |
| if (!detectType(state, object, false)) { |
| detectType(state, object, true); |
| } |
| |
| var type = _toString.call(state.dump); |
| |
| if (block) { |
| block = (0 > state.flowLevel || state.flowLevel > level); |
| } |
| |
| var objectOrArray = '[object Object]' === type || '[object Array]' === type, |
| duplicateIndex, |
| duplicate; |
| |
| if (objectOrArray) { |
| duplicateIndex = state.duplicates.indexOf(object); |
| duplicate = duplicateIndex !== -1; |
| } |
| |
| if ((null !== state.tag && '?' !== state.tag) || duplicate || (2 !== state.indent && level > 0)) { |
| compact = false; |
| } |
| |
| if (duplicate && state.usedDuplicates[duplicateIndex]) { |
| state.dump = '*ref_' + duplicateIndex; |
| } else { |
| if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { |
| state.usedDuplicates[duplicateIndex] = true; |
| } |
| if ('[object Object]' === type) { |
| if (block && (0 !== Object.keys(state.dump).length)) { |
| writeBlockMapping(state, level, state.dump, compact); |
| if (duplicate) { |
| state.dump = '&ref_' + duplicateIndex + state.dump; |
| } |
| } else { |
| writeFlowMapping(state, level, state.dump); |
| if (duplicate) { |
| state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; |
| } |
| } |
| } else if ('[object Array]' === type) { |
| if (block && (0 !== state.dump.length)) { |
| writeBlockSequence(state, level, state.dump, compact); |
| if (duplicate) { |
| state.dump = '&ref_' + duplicateIndex + state.dump; |
| } |
| } else { |
| writeFlowSequence(state, level, state.dump); |
| if (duplicate) { |
| state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; |
| } |
| } |
| } else if ('[object String]' === type) { |
| if ('?' !== state.tag) { |
| writeScalar(state, state.dump, level, iskey); |
| } |
| } else { |
| if (state.skipInvalid) { |
| return false; |
| } |
| throw new YAMLException('unacceptable kind of an object to dump ' + type); |
| } |
| |
| if (null !== state.tag && '?' !== state.tag) { |
| state.dump = '!<' + state.tag + '> ' + state.dump; |
| } |
| } |
| |
| return true; |
| } |
| |
| function getDuplicateReferences(object, state) { |
| var objects = [], |
| duplicatesIndexes = [], |
| index, |
| length; |
| |
| inspectNode(object, objects, duplicatesIndexes); |
| |
| for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { |
| state.duplicates.push(objects[duplicatesIndexes[index]]); |
| } |
| state.usedDuplicates = new Array(length); |
| } |
| |
| function inspectNode(object, objects, duplicatesIndexes) { |
| var objectKeyList, |
| index, |
| length; |
| |
| if (null !== object && 'object' === typeof object) { |
| index = objects.indexOf(object); |
| if (-1 !== index) { |
| if (-1 === duplicatesIndexes.indexOf(index)) { |
| duplicatesIndexes.push(index); |
| } |
| } else { |
| objects.push(object); |
| |
| if (Array.isArray(object)) { |
| for (index = 0, length = object.length; index < length; index += 1) { |
| inspectNode(object[index], objects, duplicatesIndexes); |
| } |
| } else { |
| objectKeyList = Object.keys(object); |
| |
| for (index = 0, length = objectKeyList.length; index < length; index += 1) { |
| inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); |
| } |
| } |
| } |
| } |
| } |
| |
| function dump(input, options) { |
| options = options || {}; |
| |
| var state = new State(options); |
| |
| getDuplicateReferences(input, state); |
| |
| if (writeNode(state, 0, input, true, true)) { |
| return state.dump + '\n'; |
| } |
| return ''; |
| } |
| |
| function safeDump(input, options) { |
| return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); |
| } |
| |
| module.exports.dump = dump; |
| module.exports.safeDump = safeDump; |
| |
| },{"./common":22,"./exception":24,"./schema/default_full":29,"./schema/default_safe":30}],24:[function(require,module,exports){ |
| // YAML error class. http://stackoverflow.com/questions/8458984 |
| // |
| 'use strict'; |
| |
| |
| var inherits = require('inherit'); |
| |
| |
| function YAMLException(reason, mark) { |
| // Super constructor |
| Error.call(this); |
| |
| // Include stack trace in error object |
| if (Error.captureStackTrace) { |
| // Chrome and NodeJS |
| Error.captureStackTrace(this, this.constructor); |
| } else { |
| // FF, IE 10+ and Safari 6+. Fallback for others |
| this.stack = (new Error()).stack || ''; |
| } |
| |
| this.name = 'YAMLException'; |
| this.reason = reason; |
| this.mark = mark; |
| this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); |
| } |
| |
| |
| // Inherit from Error |
| inherits(YAMLException, Error); |
| |
| |
| YAMLException.prototype.toString = function toString(compact) { |
| var result = this.name + ': '; |
| |
| result += this.reason || '(unknown reason)'; |
| |
| if (!compact && this.mark) { |
| result += ' ' + this.mark.toString(); |
| } |
| |
| return result; |
| }; |
| |
| |
| module.exports = YAMLException; |
| |
| },{"inherit":51}],25:[function(require,module,exports){ |
| 'use strict'; |
| |
| /*eslint-disable max-len,no-use-before-define*/ |
| |
| var common = require('./common'); |
| var YAMLException = require('./exception'); |
| var Mark = require('./mark'); |
| var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); |
| var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); |
| |
| |
| var _hasOwnProperty = Object.prototype.hasOwnProperty; |
| |
| |
| var CONTEXT_FLOW_IN = 1; |
| var CONTEXT_FLOW_OUT = 2; |
| var CONTEXT_BLOCK_IN = 3; |
| var CONTEXT_BLOCK_OUT = 4; |
| |
| |
| var CHOMPING_CLIP = 1; |
| var CHOMPING_STRIP = 2; |
| var CHOMPING_KEEP = 3; |
| |
| |
| var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; |
| var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; |
| var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; |
| var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; |
| var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; |
| |
| |
| function is_EOL(c) { |
| return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); |
| } |
| |
| function is_WHITE_SPACE(c) { |
| return (c === 0x09/* Tab */) || (c === 0x20/* Space */); |
| } |
| |
| function is_WS_OR_EOL(c) { |
| return (c === 0x09/* Tab */) || |
| (c === 0x20/* Space */) || |
| (c === 0x0A/* LF */) || |
| (c === 0x0D/* CR */); |
| } |
| |
| function is_FLOW_INDICATOR(c) { |
| return 0x2C/* , */ === c || |
| 0x5B/* [ */ === c || |
| 0x5D/* ] */ === c || |
| 0x7B/* { */ === c || |
| 0x7D/* } */ === c; |
| } |
| |
| function fromHexCode(c) { |
| var lc; |
| |
| if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { |
| return c - 0x30; |
| } |
| |
| /*eslint-disable no-bitwise*/ |
| lc = c | 0x20; |
| |
| if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { |
| return lc - 0x61 + 10; |
| } |
| |
| return -1; |
| } |
| |
| function escapedHexLen(c) { |
| if (c === 0x78/* x */) { return 2; } |
| if (c === 0x75/* u */) { return 4; } |
| if (c === 0x55/* U */) { return 8; } |
| return 0; |
| } |
| |
| function fromDecimalCode(c) { |
| if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { |
| return c - 0x30; |
| } |
| |
| return -1; |
| } |
| |
| function simpleEscapeSequence(c) { |
| return (c === 0x30/* 0 */) ? '\x00' : |
| (c === 0x61/* a */) ? '\x07' : |
| (c === 0x62/* b */) ? '\x08' : |
| (c === 0x74/* t */) ? '\x09' : |
| (c === 0x09/* Tab */) ? '\x09' : |
| (c === 0x6E/* n */) ? '\x0A' : |
| (c === 0x76/* v */) ? '\x0B' : |
| (c === 0x66/* f */) ? '\x0C' : |
| (c === 0x72/* r */) ? '\x0D' : |
| (c === 0x65/* e */) ? '\x1B' : |
| (c === 0x20/* Space */) ? ' ' : |
| (c === 0x22/* " */) ? '\x22' : |
| (c === 0x2F/* / */) ? '/' : |
| (c === 0x5C/* \ */) ? '\x5C' : |
| (c === 0x4E/* N */) ? '\x85' : |
| (c === 0x5F/* _ */) ? '\xA0' : |
| (c === 0x4C/* L */) ? '\u2028' : |
| (c === 0x50/* P */) ? '\u2029' : ''; |
| } |
| |
| function charFromCodepoint(c) { |
| if (c <= 0xFFFF) { |
| return String.fromCharCode(c); |
| } |
| // Encode UTF-16 surrogate pair |
| // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF |
| return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800, |
| ((c - 0x010000) & 0x03FF) + 0xDC00); |
| } |
| |
| var simpleEscapeCheck = new Array(256); // integer, for fast access |
| var simpleEscapeMap = new Array(256); |
| for (var i = 0; i < 256; i++) { |
| simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; |
| simpleEscapeMap[i] = simpleEscapeSequence(i); |
| } |
| |
| |
| function State(input, options) { |
| this.input = input; |
| |
| this.filename = options['filename'] || null; |
| this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; |
| this.onWarning = options['onWarning'] || null; |
| this.legacy = options['legacy'] || false; |
| |
| this.implicitTypes = this.schema.compiledImplicit; |
| this.typeMap = this.schema.compiledTypeMap; |
| |
| this.length = input.length; |
| this.position = 0; |
| this.line = 0; |
| this.lineStart = 0; |
| this.lineIndent = 0; |
| |
| this.documents = []; |
| |
| /* |
| this.version; |
| this.checkLineBreaks; |
| this.tagMap; |
| this.anchorMap; |
| this.tag; |
| this.anchor; |
| this.kind; |
| this.result;*/ |
| |
| } |
| |
| |
| function generateError(state, message) { |
| return new YAMLException( |
| message, |
| new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); |
| } |
| |
| function throwError(state, message) { |
| throw generateError(state, message); |
| } |
| |
| function throwWarning(state, message) { |
| if (state.onWarning) { |
| state.onWarning.call(null, generateError(state, message)); |
| } |
| } |
| |
| |
| var directiveHandlers = { |
| |
| YAML: function handleYamlDirective(state, name, args) { |
| |
| var match, major, minor; |
| |
| if (null !== state.version) { |
| throwError(state, 'duplication of %YAML directive'); |
| } |
| |
| if (1 !== args.length) { |
| throwError(state, 'YAML directive accepts exactly one argument'); |
| } |
| |
| match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); |
| |
| if (null === match) { |
| throwError(state, 'ill-formed argument of the YAML directive'); |
| } |
| |
| major = parseInt(match[1], 10); |
| minor = parseInt(match[2], 10); |
| |
| if (1 !== major) { |
| throwError(state, 'unacceptable YAML version of the document'); |
| } |
| |
| state.version = args[0]; |
| state.checkLineBreaks = (minor < 2); |
| |
| if (1 !== minor && 2 !== minor) { |
| throwWarning(state, 'unsupported YAML version of the document'); |
| } |
| }, |
| |
| TAG: function handleTagDirective(state, name, args) { |
| |
| var handle, prefix; |
| |
| if (2 !== args.length) { |
| throwError(state, 'TAG directive accepts exactly two arguments'); |
| } |
| |
| handle = args[0]; |
| prefix = args[1]; |
| |
| if (!PATTERN_TAG_HANDLE.test(handle)) { |
| throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); |
| } |
| |
| if (_hasOwnProperty.call(state.tagMap, handle)) { |
| throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); |
| } |
| |
| if (!PATTERN_TAG_URI.test(prefix)) { |
| throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); |
| } |
| |
| state.tagMap[handle] = prefix; |
| } |
| }; |
| |
| |
| function captureSegment(state, start, end, checkJson) { |
| var _position, _length, _character, _result; |
| |
| if (start < end) { |
| _result = state.input.slice(start, end); |
| |
| if (checkJson) { |
| for (_position = 0, _length = _result.length; |
| _position < _length; |
| _position += 1) { |
| _character = _result.charCodeAt(_position); |
| if (!(0x09 === _character || |
| 0x20 <= _character && _character <= 0x10FFFF)) { |
| throwError(state, 'expected valid JSON character'); |
| } |
| } |
| } else if (PATTERN_NON_PRINTABLE.test(_result)) { |
| throwError(state, 'the stream contains non-printable characters'); |
| } |
| |
| state.result += _result; |
| } |
| } |
| |
| function mergeMappings(state, destination, source) { |
| var sourceKeys, key, index, quantity; |
| |
| if (!common.isObject(source)) { |
| throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); |
| } |
| |
| sourceKeys = Object.keys(source); |
| |
| for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { |
| key = sourceKeys[index]; |
| |
| if (!_hasOwnProperty.call(destination, key)) { |
| destination[key] = source[key]; |
| } |
| } |
| } |
| |
| function storeMappingPair(state, _result, keyTag, keyNode, valueNode) { |
| var index, quantity; |
| |
| keyNode = String(keyNode); |
| |
| if (null === _result) { |
| _result = {}; |
| } |
| |
| if ('tag:yaml.org,2002:merge' === keyTag) { |
| if (Array.isArray(valueNode)) { |
| for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { |
| mergeMappings(state, _result, valueNode[index]); |
| } |
| } else { |
| mergeMappings(state, _result, valueNode); |
| } |
| } else { |
| _result[keyNode] = valueNode; |
| } |
| |
| return _result; |
| } |
| |
| function readLineBreak(state) { |
| var ch; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (0x0A/* LF */ === ch) { |
| state.position++; |
| } else if (0x0D/* CR */ === ch) { |
| state.position++; |
| if (0x0A/* LF */ === state.input.charCodeAt(state.position)) { |
| state.position++; |
| } |
| } else { |
| throwError(state, 'a line break is expected'); |
| } |
| |
| state.line += 1; |
| state.lineStart = state.position; |
| } |
| |
| function skipSeparationSpace(state, allowComments, checkIndent) { |
| var lineBreaks = 0, |
| ch = state.input.charCodeAt(state.position); |
| |
| while (0 !== ch) { |
| while (is_WHITE_SPACE(ch)) { |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| if (allowComments && 0x23/* # */ === ch) { |
| do { |
| ch = state.input.charCodeAt(++state.position); |
| } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch); |
| } |
| |
| if (is_EOL(ch)) { |
| readLineBreak(state); |
| |
| ch = state.input.charCodeAt(state.position); |
| lineBreaks++; |
| state.lineIndent = 0; |
| |
| while (0x20/* Space */ === ch) { |
| state.lineIndent++; |
| ch = state.input.charCodeAt(++state.position); |
| } |
| } else { |
| break; |
| } |
| } |
| |
| if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) { |
| throwWarning(state, 'deficient indentation'); |
| } |
| |
| return lineBreaks; |
| } |
| |
| function testDocumentSeparator(state) { |
| var _position = state.position, |
| ch; |
| |
| ch = state.input.charCodeAt(_position); |
| |
| // Condition state.position === state.lineStart is tested |
| // in parent on each call, for efficiency. No needs to test here again. |
| if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) && |
| state.input.charCodeAt(_position + 1) === ch && |
| state.input.charCodeAt(_position + 2) === ch) { |
| |
| _position += 3; |
| |
| ch = state.input.charCodeAt(_position); |
| |
| if (ch === 0 || is_WS_OR_EOL(ch)) { |
| return true; |
| } |
| } |
| |
| return false; |
| } |
| |
| function writeFoldedLines(state, count) { |
| if (1 === count) { |
| state.result += ' '; |
| } else if (count > 1) { |
| state.result += common.repeat('\n', count - 1); |
| } |
| } |
| |
| |
| function readPlainScalar(state, nodeIndent, withinFlowCollection) { |
| var preceding, |
| following, |
| captureStart, |
| captureEnd, |
| hasPendingContent, |
| _line, |
| _lineStart, |
| _lineIndent, |
| _kind = state.kind, |
| _result = state.result, |
| ch; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (is_WS_OR_EOL(ch) || |
| is_FLOW_INDICATOR(ch) || |
| 0x23/* # */ === ch || |
| 0x26/* & */ === ch || |
| 0x2A/* * */ === ch || |
| 0x21/* ! */ === ch || |
| 0x7C/* | */ === ch || |
| 0x3E/* > */ === ch || |
| 0x27/* ' */ === ch || |
| 0x22/* " */ === ch || |
| 0x25/* % */ === ch || |
| 0x40/* @ */ === ch || |
| 0x60/* ` */ === ch) { |
| return false; |
| } |
| |
| if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) { |
| following = state.input.charCodeAt(state.position + 1); |
| |
| if (is_WS_OR_EOL(following) || |
| withinFlowCollection && is_FLOW_INDICATOR(following)) { |
| return false; |
| } |
| } |
| |
| state.kind = 'scalar'; |
| state.result = ''; |
| captureStart = captureEnd = state.position; |
| hasPendingContent = false; |
| |
| while (0 !== ch) { |
| if (0x3A/* : */ === ch) { |
| following = state.input.charCodeAt(state.position + 1); |
| |
| if (is_WS_OR_EOL(following) || |
| withinFlowCollection && is_FLOW_INDICATOR(following)) { |
| break; |
| } |
| |
| } else if (0x23/* # */ === ch) { |
| preceding = state.input.charCodeAt(state.position - 1); |
| |
| if (is_WS_OR_EOL(preceding)) { |
| break; |
| } |
| |
| } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || |
| withinFlowCollection && is_FLOW_INDICATOR(ch)) { |
| break; |
| |
| } else if (is_EOL(ch)) { |
| _line = state.line; |
| _lineStart = state.lineStart; |
| _lineIndent = state.lineIndent; |
| skipSeparationSpace(state, false, -1); |
| |
| if (state.lineIndent >= nodeIndent) { |
| hasPendingContent = true; |
| ch = state.input.charCodeAt(state.position); |
| continue; |
| } else { |
| state.position = captureEnd; |
| state.line = _line; |
| state.lineStart = _lineStart; |
| state.lineIndent = _lineIndent; |
| break; |
| } |
| } |
| |
| if (hasPendingContent) { |
| captureSegment(state, captureStart, captureEnd, false); |
| writeFoldedLines(state, state.line - _line); |
| captureStart = captureEnd = state.position; |
| hasPendingContent = false; |
| } |
| |
| if (!is_WHITE_SPACE(ch)) { |
| captureEnd = state.position + 1; |
| } |
| |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| captureSegment(state, captureStart, captureEnd, false); |
| |
| if (state.result) { |
| return true; |
| } |
| |
| state.kind = _kind; |
| state.result = _result; |
| return false; |
| } |
| |
| function readSingleQuotedScalar(state, nodeIndent) { |
| var ch, |
| captureStart, captureEnd; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (0x27/* ' */ !== ch) { |
| return false; |
| } |
| |
| state.kind = 'scalar'; |
| state.result = ''; |
| state.position++; |
| captureStart = captureEnd = state.position; |
| |
| while (0 !== (ch = state.input.charCodeAt(state.position))) { |
| if (0x27/* ' */ === ch) { |
| captureSegment(state, captureStart, state.position, true); |
| ch = state.input.charCodeAt(++state.position); |
| |
| if (0x27/* ' */ === ch) { |
| captureStart = captureEnd = state.position; |
| state.position++; |
| } else { |
| return true; |
| } |
| |
| } else if (is_EOL(ch)) { |
| captureSegment(state, captureStart, captureEnd, true); |
| writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); |
| captureStart = captureEnd = state.position; |
| |
| } else if (state.position === state.lineStart && testDocumentSeparator(state)) { |
| throwError(state, 'unexpected end of the document within a single quoted scalar'); |
| |
| } else { |
| state.position++; |
| captureEnd = state.position; |
| } |
| } |
| |
| throwError(state, 'unexpected end of the stream within a single quoted scalar'); |
| } |
| |
| function readDoubleQuotedScalar(state, nodeIndent) { |
| var captureStart, |
| captureEnd, |
| hexLength, |
| hexResult, |
| tmp, |
| ch; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (0x22/* " */ !== ch) { |
| return false; |
| } |
| |
| state.kind = 'scalar'; |
| state.result = ''; |
| state.position++; |
| captureStart = captureEnd = state.position; |
| |
| while (0 !== (ch = state.input.charCodeAt(state.position))) { |
| if (0x22/* " */ === ch) { |
| captureSegment(state, captureStart, state.position, true); |
| state.position++; |
| return true; |
| |
| } else if (0x5C/* \ */ === ch) { |
| captureSegment(state, captureStart, state.position, true); |
| ch = state.input.charCodeAt(++state.position); |
| |
| if (is_EOL(ch)) { |
| skipSeparationSpace(state, false, nodeIndent); |
| |
| // TODO: rework to inline fn with no type cast? |
| } else if (ch < 256 && simpleEscapeCheck[ch]) { |
| state.result += simpleEscapeMap[ch]; |
| state.position++; |
| |
| } else if ((tmp = escapedHexLen(ch)) > 0) { |
| hexLength = tmp; |
| hexResult = 0; |
| |
| for (; hexLength > 0; hexLength--) { |
| ch = state.input.charCodeAt(++state.position); |
| |
| if ((tmp = fromHexCode(ch)) >= 0) { |
| hexResult = (hexResult << 4) + tmp; |
| |
| } else { |
| throwError(state, 'expected hexadecimal character'); |
| } |
| } |
| |
| state.result += charFromCodepoint(hexResult); |
| |
| state.position++; |
| |
| } else { |
| throwError(state, 'unknown escape sequence'); |
| } |
| |
| captureStart = captureEnd = state.position; |
| |
| } else if (is_EOL(ch)) { |
| captureSegment(state, captureStart, captureEnd, true); |
| writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); |
| captureStart = captureEnd = state.position; |
| |
| } else if (state.position === state.lineStart && testDocumentSeparator(state)) { |
| throwError(state, 'unexpected end of the document within a double quoted scalar'); |
| |
| } else { |
| state.position++; |
| captureEnd = state.position; |
| } |
| } |
| |
| throwError(state, 'unexpected end of the stream within a double quoted scalar'); |
| } |
| |
| function readFlowCollection(state, nodeIndent) { |
| var readNext = true, |
| _line, |
| _tag = state.tag, |
| _result, |
| _anchor = state.anchor, |
| following, |
| terminator, |
| isPair, |
| isExplicitPair, |
| isMapping, |
| keyNode, |
| keyTag, |
| valueNode, |
| ch; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (ch === 0x5B/* [ */) { |
| terminator = 0x5D;/* ] */ |
| isMapping = false; |
| _result = []; |
| } else if (ch === 0x7B/* { */) { |
| terminator = 0x7D;/* } */ |
| isMapping = true; |
| _result = {}; |
| } else { |
| return false; |
| } |
| |
| if (null !== state.anchor) { |
| state.anchorMap[state.anchor] = _result; |
| } |
| |
| ch = state.input.charCodeAt(++state.position); |
| |
| while (0 !== ch) { |
| skipSeparationSpace(state, true, nodeIndent); |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (ch === terminator) { |
| state.position++; |
| state.tag = _tag; |
| state.anchor = _anchor; |
| state.kind = isMapping ? 'mapping' : 'sequence'; |
| state.result = _result; |
| return true; |
| } else if (!readNext) { |
| throwError(state, 'missed comma between flow collection entries'); |
| } |
| |
| keyTag = keyNode = valueNode = null; |
| isPair = isExplicitPair = false; |
| |
| if (0x3F/* ? */ === ch) { |
| following = state.input.charCodeAt(state.position + 1); |
| |
| if (is_WS_OR_EOL(following)) { |
| isPair = isExplicitPair = true; |
| state.position++; |
| skipSeparationSpace(state, true, nodeIndent); |
| } |
| } |
| |
| _line = state.line; |
| composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); |
| keyTag = state.tag; |
| keyNode = state.result; |
| skipSeparationSpace(state, true, nodeIndent); |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) { |
| isPair = true; |
| ch = state.input.charCodeAt(++state.position); |
| skipSeparationSpace(state, true, nodeIndent); |
| composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); |
| valueNode = state.result; |
| } |
| |
| if (isMapping) { |
| storeMappingPair(state, _result, keyTag, keyNode, valueNode); |
| } else if (isPair) { |
| _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode)); |
| } else { |
| _result.push(keyNode); |
| } |
| |
| skipSeparationSpace(state, true, nodeIndent); |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (0x2C/* , */ === ch) { |
| readNext = true; |
| ch = state.input.charCodeAt(++state.position); |
| } else { |
| readNext = false; |
| } |
| } |
| |
| throwError(state, 'unexpected end of the stream within a flow collection'); |
| } |
| |
| function readBlockScalar(state, nodeIndent) { |
| var captureStart, |
| folding, |
| chomping = CHOMPING_CLIP, |
| detectedIndent = false, |
| textIndent = nodeIndent, |
| emptyLines = 0, |
| atMoreIndented = false, |
| tmp, |
| ch; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (ch === 0x7C/* | */) { |
| folding = false; |
| } else if (ch === 0x3E/* > */) { |
| folding = true; |
| } else { |
| return false; |
| } |
| |
| state.kind = 'scalar'; |
| state.result = ''; |
| |
| while (0 !== ch) { |
| ch = state.input.charCodeAt(++state.position); |
| |
| if (0x2B/* + */ === ch || 0x2D/* - */ === ch) { |
| if (CHOMPING_CLIP === chomping) { |
| chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP; |
| } else { |
| throwError(state, 'repeat of a chomping mode identifier'); |
| } |
| |
| } else if ((tmp = fromDecimalCode(ch)) >= 0) { |
| if (tmp === 0) { |
| throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); |
| } else if (!detectedIndent) { |
| textIndent = nodeIndent + tmp - 1; |
| detectedIndent = true; |
| } else { |
| throwError(state, 'repeat of an indentation width identifier'); |
| } |
| |
| } else { |
| break; |
| } |
| } |
| |
| if (is_WHITE_SPACE(ch)) { |
| do { ch = state.input.charCodeAt(++state.position); } |
| while (is_WHITE_SPACE(ch)); |
| |
| if (0x23/* # */ === ch) { |
| do { ch = state.input.charCodeAt(++state.position); } |
| while (!is_EOL(ch) && (0 !== ch)); |
| } |
| } |
| |
| while (0 !== ch) { |
| readLineBreak(state); |
| state.lineIndent = 0; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| while ((!detectedIndent || state.lineIndent < textIndent) && |
| (0x20/* Space */ === ch)) { |
| state.lineIndent++; |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| if (!detectedIndent && state.lineIndent > textIndent) { |
| textIndent = state.lineIndent; |
| } |
| |
| if (is_EOL(ch)) { |
| emptyLines++; |
| continue; |
| } |
| |
| // End of the scalar. |
| if (state.lineIndent < textIndent) { |
| |
| // Perform the chomping. |
| if (chomping === CHOMPING_KEEP) { |
| state.result += common.repeat('\n', emptyLines); |
| } else if (chomping === CHOMPING_CLIP) { |
| if (detectedIndent) { // i.e. only if the scalar is not empty. |
| state.result += '\n'; |
| } |
| } |
| |
| // Break this `while` cycle and go to the funciton's epilogue. |
| break; |
| } |
| |
| // Folded style: use fancy rules to handle line breaks. |
| if (folding) { |
| |
| // Lines starting with white space characters (more-indented lines) are not folded. |
| if (is_WHITE_SPACE(ch)) { |
| atMoreIndented = true; |
| state.result += common.repeat('\n', emptyLines + 1); |
| |
| // End of more-indented block. |
| } else if (atMoreIndented) { |
| atMoreIndented = false; |
| state.result += common.repeat('\n', emptyLines + 1); |
| |
| // Just one line break - perceive as the same line. |
| } else if (0 === emptyLines) { |
| if (detectedIndent) { // i.e. only if we have already read some scalar content. |
| state.result += ' '; |
| } |
| |
| // Several line breaks - perceive as different lines. |
| } else { |
| state.result += common.repeat('\n', emptyLines); |
| } |
| |
| // Literal style: just add exact number of line breaks between content lines. |
| } else if (detectedIndent) { |
| // If current line isn't the first one - count line break from the last content line. |
| state.result += common.repeat('\n', emptyLines + 1); |
| } else { |
| // In case of the first content line - count only empty lines. |
| state.result += common.repeat('\n', emptyLines); |
| } |
| |
| detectedIndent = true; |
| emptyLines = 0; |
| captureStart = state.position; |
| |
| while (!is_EOL(ch) && (0 !== ch)) { |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| captureSegment(state, captureStart, state.position, false); |
| } |
| |
| return true; |
| } |
| |
| function readBlockSequence(state, nodeIndent) { |
| var _line, |
| _tag = state.tag, |
| _anchor = state.anchor, |
| _result = [], |
| following, |
| detected = false, |
| ch; |
| |
| if (null !== state.anchor) { |
| state.anchorMap[state.anchor] = _result; |
| } |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| while (0 !== ch) { |
| |
| if (0x2D/* - */ !== ch) { |
| break; |
| } |
| |
| following = state.input.charCodeAt(state.position + 1); |
| |
| if (!is_WS_OR_EOL(following)) { |
| break; |
| } |
| |
| detected = true; |
| state.position++; |
| |
| if (skipSeparationSpace(state, true, -1)) { |
| if (state.lineIndent <= nodeIndent) { |
| _result.push(null); |
| ch = state.input.charCodeAt(state.position); |
| continue; |
| } |
| } |
| |
| _line = state.line; |
| composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); |
| _result.push(state.result); |
| skipSeparationSpace(state, true, -1); |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) { |
| throwError(state, 'bad indentation of a sequence entry'); |
| } else if (state.lineIndent < nodeIndent) { |
| break; |
| } |
| } |
| |
| if (detected) { |
| state.tag = _tag; |
| state.anchor = _anchor; |
| state.kind = 'sequence'; |
| state.result = _result; |
| return true; |
| } |
| return false; |
| } |
| |
| function readBlockMapping(state, nodeIndent, flowIndent) { |
| var following, |
| allowCompact, |
| _line, |
| _tag = state.tag, |
| _anchor = state.anchor, |
| _result = {}, |
| keyTag = null, |
| keyNode = null, |
| valueNode = null, |
| atExplicitKey = false, |
| detected = false, |
| ch; |
| |
| if (null !== state.anchor) { |
| state.anchorMap[state.anchor] = _result; |
| } |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| while (0 !== ch) { |
| following = state.input.charCodeAt(state.position + 1); |
| _line = state.line; // Save the current line. |
| |
| // |
| // Explicit notation case. There are two separate blocks: |
| // first for the key (denoted by "?") and second for the value (denoted by ":") |
| // |
| if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) { |
| |
| if (0x3F/* ? */ === ch) { |
| if (atExplicitKey) { |
| storeMappingPair(state, _result, keyTag, keyNode, null); |
| keyTag = keyNode = valueNode = null; |
| } |
| |
| detected = true; |
| atExplicitKey = true; |
| allowCompact = true; |
| |
| } else if (atExplicitKey) { |
| // i.e. 0x3A/* : */ === character after the explicit key. |
| atExplicitKey = false; |
| allowCompact = true; |
| |
| } else { |
| throwError(state, 'incomplete explicit mapping pair; a key node is missed'); |
| } |
| |
| state.position += 1; |
| ch = following; |
| |
| // |
| // Implicit notation case. Flow-style node as the key first, then ":", and the value. |
| // |
| } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { |
| |
| if (state.line === _line) { |
| ch = state.input.charCodeAt(state.position); |
| |
| while (is_WHITE_SPACE(ch)) { |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| if (0x3A/* : */ === ch) { |
| ch = state.input.charCodeAt(++state.position); |
| |
| if (!is_WS_OR_EOL(ch)) { |
| throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); |
| } |
| |
| if (atExplicitKey) { |
| storeMappingPair(state, _result, keyTag, keyNode, null); |
| keyTag = keyNode = valueNode = null; |
| } |
| |
| detected = true; |
| atExplicitKey = false; |
| allowCompact = false; |
| keyTag = state.tag; |
| keyNode = state.result; |
| |
| } else if (detected) { |
| throwError(state, 'can not read an implicit mapping pair; a colon is missed'); |
| |
| } else { |
| state.tag = _tag; |
| state.anchor = _anchor; |
| return true; // Keep the result of `composeNode`. |
| } |
| |
| } else if (detected) { |
| throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); |
| |
| } else { |
| state.tag = _tag; |
| state.anchor = _anchor; |
| return true; // Keep the result of `composeNode`. |
| } |
| |
| } else { |
| break; // Reading is done. Go to the epilogue. |
| } |
| |
| // |
| // Common reading code for both explicit and implicit notations. |
| // |
| if (state.line === _line || state.lineIndent > nodeIndent) { |
| if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { |
| if (atExplicitKey) { |
| keyNode = state.result; |
| } else { |
| valueNode = state.result; |
| } |
| } |
| |
| if (!atExplicitKey) { |
| storeMappingPair(state, _result, keyTag, keyNode, valueNode); |
| keyTag = keyNode = valueNode = null; |
| } |
| |
| skipSeparationSpace(state, true, -1); |
| ch = state.input.charCodeAt(state.position); |
| } |
| |
| if (state.lineIndent > nodeIndent && (0 !== ch)) { |
| throwError(state, 'bad indentation of a mapping entry'); |
| } else if (state.lineIndent < nodeIndent) { |
| break; |
| } |
| } |
| |
| // |
| // Epilogue. |
| // |
| |
| // Special case: last mapping's node contains only the key in explicit notation. |
| if (atExplicitKey) { |
| storeMappingPair(state, _result, keyTag, keyNode, null); |
| } |
| |
| // Expose the resulting mapping. |
| if (detected) { |
| state.tag = _tag; |
| state.anchor = _anchor; |
| state.kind = 'mapping'; |
| state.result = _result; |
| } |
| |
| return detected; |
| } |
| |
| function readTagProperty(state) { |
| var _position, |
| isVerbatim = false, |
| isNamed = false, |
| tagHandle, |
| tagName, |
| ch; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (0x21/* ! */ !== ch) { |
| return false; |
| } |
| |
| if (null !== state.tag) { |
| throwError(state, 'duplication of a tag property'); |
| } |
| |
| ch = state.input.charCodeAt(++state.position); |
| |
| if (0x3C/* < */ === ch) { |
| isVerbatim = true; |
| ch = state.input.charCodeAt(++state.position); |
| |
| } else if (0x21/* ! */ === ch) { |
| isNamed = true; |
| tagHandle = '!!'; |
| ch = state.input.charCodeAt(++state.position); |
| |
| } else { |
| tagHandle = '!'; |
| } |
| |
| _position = state.position; |
| |
| if (isVerbatim) { |
| do { ch = state.input.charCodeAt(++state.position); } |
| while (0 !== ch && 0x3E/* > */ !== ch); |
| |
| if (state.position < state.length) { |
| tagName = state.input.slice(_position, state.position); |
| ch = state.input.charCodeAt(++state.position); |
| } else { |
| throwError(state, 'unexpected end of the stream within a verbatim tag'); |
| } |
| } else { |
| while (0 !== ch && !is_WS_OR_EOL(ch)) { |
| |
| if (0x21/* ! */ === ch) { |
| if (!isNamed) { |
| tagHandle = state.input.slice(_position - 1, state.position + 1); |
| |
| if (!PATTERN_TAG_HANDLE.test(tagHandle)) { |
| throwError(state, 'named tag handle cannot contain such characters'); |
| } |
| |
| isNamed = true; |
| _position = state.position + 1; |
| } else { |
| throwError(state, 'tag suffix cannot contain exclamation marks'); |
| } |
| } |
| |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| tagName = state.input.slice(_position, state.position); |
| |
| if (PATTERN_FLOW_INDICATORS.test(tagName)) { |
| throwError(state, 'tag suffix cannot contain flow indicator characters'); |
| } |
| } |
| |
| if (tagName && !PATTERN_TAG_URI.test(tagName)) { |
| throwError(state, 'tag name cannot contain such characters: ' + tagName); |
| } |
| |
| if (isVerbatim) { |
| state.tag = tagName; |
| |
| } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { |
| state.tag = state.tagMap[tagHandle] + tagName; |
| |
| } else if ('!' === tagHandle) { |
| state.tag = '!' + tagName; |
| |
| } else if ('!!' === tagHandle) { |
| state.tag = 'tag:yaml.org,2002:' + tagName; |
| |
| } else { |
| throwError(state, 'undeclared tag handle "' + tagHandle + '"'); |
| } |
| |
| return true; |
| } |
| |
| function readAnchorProperty(state) { |
| var _position, |
| ch; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (0x26/* & */ !== ch) { |
| return false; |
| } |
| |
| if (null !== state.anchor) { |
| throwError(state, 'duplication of an anchor property'); |
| } |
| |
| ch = state.input.charCodeAt(++state.position); |
| _position = state.position; |
| |
| while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| if (state.position === _position) { |
| throwError(state, 'name of an anchor node must contain at least one character'); |
| } |
| |
| state.anchor = state.input.slice(_position, state.position); |
| return true; |
| } |
| |
| function readAlias(state) { |
| var _position, alias, |
| ch; |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (0x2A/* * */ !== ch) { |
| return false; |
| } |
| |
| ch = state.input.charCodeAt(++state.position); |
| _position = state.position; |
| |
| while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| if (state.position === _position) { |
| throwError(state, 'name of an alias node must contain at least one character'); |
| } |
| |
| alias = state.input.slice(_position, state.position); |
| |
| if (!state.anchorMap.hasOwnProperty(alias)) { |
| throwError(state, 'unidentified alias "' + alias + '"'); |
| } |
| |
| state.result = state.anchorMap[alias]; |
| skipSeparationSpace(state, true, -1); |
| return true; |
| } |
| |
| function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { |
| var allowBlockStyles, |
| allowBlockScalars, |
| allowBlockCollections, |
| indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent |
| atNewLine = false, |
| hasContent = false, |
| typeIndex, |
| typeQuantity, |
| type, |
| flowIndent, |
| blockIndent; |
| |
| state.tag = null; |
| state.anchor = null; |
| state.kind = null; |
| state.result = null; |
| |
| allowBlockStyles = allowBlockScalars = allowBlockCollections = |
| CONTEXT_BLOCK_OUT === nodeContext || |
| CONTEXT_BLOCK_IN === nodeContext; |
| |
| if (allowToSeek) { |
| if (skipSeparationSpace(state, true, -1)) { |
| atNewLine = true; |
| |
| if (state.lineIndent > parentIndent) { |
| indentStatus = 1; |
| } else if (state.lineIndent === parentIndent) { |
| indentStatus = 0; |
| } else if (state.lineIndent < parentIndent) { |
| indentStatus = -1; |
| } |
| } |
| } |
| |
| if (1 === indentStatus) { |
| while (readTagProperty(state) || readAnchorProperty(state)) { |
| if (skipSeparationSpace(state, true, -1)) { |
| atNewLine = true; |
| allowBlockCollections = allowBlockStyles; |
| |
| if (state.lineIndent > parentIndent) { |
| indentStatus = 1; |
| } else if (state.lineIndent === parentIndent) { |
| indentStatus = 0; |
| } else if (state.lineIndent < parentIndent) { |
| indentStatus = -1; |
| } |
| } else { |
| allowBlockCollections = false; |
| } |
| } |
| } |
| |
| if (allowBlockCollections) { |
| allowBlockCollections = atNewLine || allowCompact; |
| } |
| |
| if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { |
| if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { |
| flowIndent = parentIndent; |
| } else { |
| flowIndent = parentIndent + 1; |
| } |
| |
| blockIndent = state.position - state.lineStart; |
| |
| if (1 === indentStatus) { |
| if (allowBlockCollections && |
| (readBlockSequence(state, blockIndent) || |
| readBlockMapping(state, blockIndent, flowIndent)) || |
| readFlowCollection(state, flowIndent)) { |
| hasContent = true; |
| } else { |
| if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || |
| readSingleQuotedScalar(state, flowIndent) || |
| readDoubleQuotedScalar(state, flowIndent)) { |
| hasContent = true; |
| |
| } else if (readAlias(state)) { |
| hasContent = true; |
| |
| if (null !== state.tag || null !== state.anchor) { |
| throwError(state, 'alias node should not have any properties'); |
| } |
| |
| } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { |
| hasContent = true; |
| |
| if (null === state.tag) { |
| state.tag = '?'; |
| } |
| } |
| |
| if (null !== state.anchor) { |
| state.anchorMap[state.anchor] = state.result; |
| } |
| } |
| } else if (0 === indentStatus) { |
| // Special case: block sequences are allowed to have same indentation level as the parent. |
| // http://www.yaml.org/spec/1.2/spec.html#id2799784 |
| hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); |
| } |
| } |
| |
| if (null !== state.tag && '!' !== state.tag) { |
| if ('?' === state.tag) { |
| for (typeIndex = 0, typeQuantity = state.implicitTypes.length; |
| typeIndex < typeQuantity; |
| typeIndex += 1) { |
| type = state.implicitTypes[typeIndex]; |
| |
| // Implicit resolving is not allowed for non-scalar types, and '?' |
| // non-specific tag is only assigned to plain scalars. So, it isn't |
| // needed to check for 'kind' conformity. |
| |
| if (type.resolve(state.result)) { // `state.result` updated in resolver if matched |
| state.result = type.construct(state.result); |
| state.tag = type.tag; |
| if (null !== state.anchor) { |
| state.anchorMap[state.anchor] = state.result; |
| } |
| break; |
| } |
| } |
| } else if (_hasOwnProperty.call(state.typeMap, state.tag)) { |
| type = state.typeMap[state.tag]; |
| |
| if (null !== state.result && type.kind !== state.kind) { |
| throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); |
| } |
| |
| if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched |
| throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); |
| } else { |
| state.result = type.construct(state.result); |
| if (null !== state.anchor) { |
| state.anchorMap[state.anchor] = state.result; |
| } |
| } |
| } else { |
| throwError(state, 'unknown tag !<' + state.tag + '>'); |
| } |
| } |
| |
| return null !== state.tag || null !== state.anchor || hasContent; |
| } |
| |
| function readDocument(state) { |
| var documentStart = state.position, |
| _position, |
| directiveName, |
| directiveArgs, |
| hasDirectives = false, |
| ch; |
| |
| state.version = null; |
| state.checkLineBreaks = state.legacy; |
| state.tagMap = {}; |
| state.anchorMap = {}; |
| |
| while (0 !== (ch = state.input.charCodeAt(state.position))) { |
| skipSeparationSpace(state, true, -1); |
| |
| ch = state.input.charCodeAt(state.position); |
| |
| if (state.lineIndent > 0 || 0x25/* % */ !== ch) { |
| break; |
| } |
| |
| hasDirectives = true; |
| ch = state.input.charCodeAt(++state.position); |
| _position = state.position; |
| |
| while (0 !== ch && !is_WS_OR_EOL(ch)) { |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| directiveName = state.input.slice(_position, state.position); |
| directiveArgs = []; |
| |
| if (directiveName.length < 1) { |
| throwError(state, 'directive name must not be less than one character in length'); |
| } |
| |
| while (0 !== ch) { |
| while (is_WHITE_SPACE(ch)) { |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| if (0x23/* # */ === ch) { |
| do { ch = state.input.charCodeAt(++state.position); } |
| while (0 !== ch && !is_EOL(ch)); |
| break; |
| } |
| |
| if (is_EOL(ch)) { |
| break; |
| } |
| |
| _position = state.position; |
| |
| while (0 !== ch && !is_WS_OR_EOL(ch)) { |
| ch = state.input.charCodeAt(++state.position); |
| } |
| |
| directiveArgs.push(state.input.slice(_position, state.position)); |
| } |
| |
| if (0 !== ch) { |
| readLineBreak(state); |
| } |
| |
| if (_hasOwnProperty.call(directiveHandlers, directiveName)) { |
| directiveHandlers[directiveName](state, directiveName, directiveArgs); |
| } else { |
| throwWarning(state, 'unknown document directive "' + directiveName + '"'); |
| } |
| } |
| |
| skipSeparationSpace(state, true, -1); |
| |
| if (0 === state.lineIndent && |
| 0x2D/* - */ === state.input.charCodeAt(state.position) && |
| 0x2D/* - */ === state.input.charCodeAt(state.position + 1) && |
| 0x2D/* - */ === state.input.charCodeAt(state.position + 2)) { |
| state.position += 3; |
| skipSeparationSpace(state, true, -1); |
| |
| } else if (hasDirectives) { |
| throwError(state, 'directives end mark is expected'); |
| } |
| |
| composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); |
| skipSeparationSpace(state, true, -1); |
| |
| if (state.checkLineBreaks && |
| PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { |
| throwWarning(state, 'non-ASCII line breaks are interpreted as content'); |
| } |
| |
| state.documents.push(state.result); |
| |
| if (state.position === state.lineStart && testDocumentSeparator(state)) { |
| |
| if (0x2E/* . */ === state.input.charCodeAt(state.position)) { |
| state.position += 3; |
| skipSeparationSpace(state, true, -1); |
| } |
| return; |
| } |
| |
| if (state.position < (state.length - 1)) { |
| throwError(state, 'end of the stream or a document separator is expected'); |
| } else { |
| return; |
| } |
| } |
| |
| |
| function loadDocuments(input, options) { |
| input = String(input); |
| options = options || {}; |
| |
| if (input.length !== 0) { |
| |
| // Add tailing `\n` if not exists |
| if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) && |
| 0x0D/* CR */ !== input.charCodeAt(input.length - 1)) { |
| input += '\n'; |
| } |
| |
| // Strip BOM |
| if (input.charCodeAt(0) === 0xFEFF) { |
| input = input.slice(1); |
| } |
| } |
| |
| var state = new State(input, options); |
| |
| // Use 0 as string terminator. That significantly simplifies bounds check. |
| state.input += '\0'; |
| |
| while (0x20/* Space */ === state.input.charCodeAt(state.position)) { |
| state.lineIndent += 1; |
| state.position += 1; |
| } |
| |
| while (state.position < (state.length - 1)) { |
| readDocument(state); |
| } |
| |
| return state.documents; |
| } |
| |
| |
| function loadAll(input, iterator, options) { |
| var documents = loadDocuments(input, options), index, length; |
| |
| for (index = 0, length = documents.length; index < length; index += 1) { |
| iterator(documents[index]); |
| } |
| } |
| |
| |
| function load(input, options) { |
| var documents = loadDocuments(input, options); |
| |
| if (0 === documents.length) { |
| /*eslint-disable no-undefined*/ |
| return undefined; |
| } else if (1 === documents.length) { |
| return documents[0]; |
| } |
| throw new YAMLException('expected a single document in the stream, but found more'); |
| } |
| |
| |
| function safeLoadAll(input, output, options) { |
| loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); |
| } |
| |
| |
| function safeLoad(input, options) { |
| return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); |
| } |
| |
| |
| module.exports.loadAll = loadAll; |
| module.exports.load = load; |
| module.exports.safeLoadAll = safeLoadAll; |
| module.exports.safeLoad = safeLoad; |
| |
| },{"./common":22,"./exception":24,"./mark":26,"./schema/default_full":29,"./schema/default_safe":30}],26:[function(require,module,exports){ |
| 'use strict'; |
| |
| |
| var common = require('./common'); |
| |
| |
| function Mark(name, buffer, position, line, column) { |
| this.name = name; |
| this.buffer = buffer; |
| this.position = position; |
| this.line = line; |
| this.column = column; |
| } |
| |
| |
| Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { |
| var head, start, tail, end, snippet; |
| |
| if (!this.buffer) { |
| return null; |
| } |
| |
| indent = indent || 4; |
| maxLength = maxLength || 75; |
| |
| head = ''; |
| start = this.position; |
| |
| while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) { |
| start -= 1; |
| if (this.position - start > (maxLength / 2 - 1)) { |
| head = ' ... '; |
| start += 5; |
| break; |
| } |
| } |
| |
| tail = ''; |
| end = this.position; |
| |
| while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) { |
| end += 1; |
| if (end - this.position > (maxLength / 2 - 1)) { |
| tail = ' ... '; |
| end -= 5; |
| break; |
| } |
| } |
| |
| snippet = this.buffer.slice(start, end); |
| |
| return common.repeat(' ', indent) + head + snippet + tail + '\n' + |
| common.repeat(' ', indent + this.position - start + head.length) + '^'; |
| }; |
| |
| |
| Mark.prototype.toString = function toString(compact) { |
| var snippet, where = ''; |
| |
| if (this.name) { |
| where += 'in "' + this.name + '" '; |
| } |
| |
| where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); |
| |
| if (!compact) { |
| snippet = this.getSnippet(); |
| |
| if (snippet) { |
| where += ':\n' + snippet; |
| } |
| } |
| |
| return where; |
| }; |
| |
| |
| module.exports = Mark; |
| |
| },{"./common":22}],27:[function(require,module,exports){ |
| 'use strict'; |
| |
| /*eslint-disable max-len*/ |
| |
| var common = require('./common'); |
| var YAMLException = require('./exception'); |
| var Type = require('./type'); |
| |
| |
| function compileList(schema, name, result) { |
| var exclude = []; |
| |
| schema.include.forEach(function (includedSchema) { |
| result = compileList(includedSchema, name, result); |
| }); |
| |
| schema[name].forEach(function (currentType) { |
| result.forEach(function (previousType, previousIndex) { |
| if (previousType.tag === currentType.tag) { |
| exclude.push(previousIndex); |
| } |
| }); |
| |
| result.push(currentType); |
| }); |
| |
| return result.filter(function (type, index) { |
| return -1 === exclude.indexOf(index); |
| }); |
| } |
| |
| |
| function compileMap(/* lists... */) { |
| var result = {}, index, length; |
| |
| function collectType(type) { |
| result[type.tag] = type; |
| } |
| |
| for (index = 0, length = arguments.length; index < length; index += 1) { |
| arguments[index].forEach(collectType); |
| } |
| |
| return result; |
| } |
| |
| |
| function Schema(definition) { |
| this.include = definition.include || []; |
| this.implicit = definition.implicit || []; |
| this.explicit = definition.explicit || []; |
| |
| this.implicit.forEach(function (type) { |
| if (type.loadKind && 'scalar' !== type.loadKind) { |
| throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); |
| } |
| }); |
| |
| this.compiledImplicit = compileList(this, 'implicit', []); |
| this.compiledExplicit = compileList(this, 'explicit', []); |
| this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); |
| } |
| |
| |
| Schema.DEFAULT = null; |
| |
| |
| Schema.create = function createSchema() { |
| var schemas, types; |
| |
| switch (arguments.length) { |
| case 1: |
| schemas = Schema.DEFAULT; |
| types = arguments[0]; |
| break; |
| |
| case 2: |
| schemas = arguments[0]; |
| types = arguments[1]; |
| break; |
| |
| default: |
| throw new YAMLException('Wrong number of arguments for Schema.create function'); |
| } |
| |
| schemas = common.toArray(schemas); |
| types = common.toArray(types); |
| |
| if (!schemas.every(function (schema) { return schema instanceof Schema; })) { |
| throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); |
| } |
| |
| if (!types.every(function (type) { return type instanceof Type; })) { |
| throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); |
| } |
| |
| return new Schema({ |
| include: schemas, |
| explicit: types |
| }); |
| }; |
| |
| |
| module.exports = Schema; |
| |
| },{"./common":22,"./exception":24,"./type":33}],28:[function(require,module,exports){ |
| // Standard YAML's Core schema. |
| // http://www.yaml.org/spec/1.2/spec.html#id2804923 |
| // |
| // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. |
| // So, Core schema has no distinctions from JSON schema is JS-YAML. |
| |
| |
| 'use strict'; |
| |
| |
| var Schema = require('../schema'); |
| |
| |
| module.exports = new Schema({ |
| include: [ |
| require('./json') |
| ] |
| }); |
| |
| },{"../schema":27,"./json":32}],29:[function(require,module,exports){ |
| // JS-YAML's default schema for `load` function. |
| // It is not described in the YAML specification. |
| // |
| // This schema is based on JS-YAML's default safe schema and includes |
| // JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. |
| // |
| // Also this schema is used as default base schema at `Schema.create` function. |
| |
| |
| 'use strict'; |
| |
| |
| var Schema = require('../schema'); |
| |
| |
| module.exports = Schema.DEFAULT = new Schema({ |
| include: [ |
| require('./default_safe') |
| ], |
| explicit: [ |
| require('../type/js/undefined'), |
| require('../type/js/regexp'), |
| require('../type/js/function') |
| ] |
| }); |
| |
| },{"../schema":27,"../type/js/function":38,"../type/js/regexp":39,"../type/js/undefined":40,"./default_safe":30}],30:[function(require,module,exports){ |
| // JS-YAML's default schema for `safeLoad` function. |
| // It is not described in the YAML specification. |
| // |
| // This schema is based on standard YAML's Core schema and includes most of |
| // extra types described at YAML tag repository. (http://yaml.org/type/) |
| |
| |
| 'use strict'; |
| |
| |
| var Schema = require('../schema'); |
| |
| |
| module.exports = new Schema({ |
| include: [ |
| require('./core') |
| ], |
| implicit: [ |
| require('../type/timestamp'), |
| require('../type/merge') |
| ], |
| explicit: [ |
| require('../type/binary'), |
| require('../type/omap'), |
| require('../type/pairs'), |
| require('../type/set') |
| ] |
| }); |
| |
| },{"../schema":27,"../type/binary":34,"../type/merge":42,"../type/omap":44,"../type/pairs":45,"../type/set":47,"../type/timestamp":49,"./core":28}],31:[function(require,module,exports){ |
| // Standard YAML's Failsafe schema. |
| // http://www.yaml.org/spec/1.2/spec.html#id2802346 |
| |
| |
| 'use strict'; |
| |
| |
| var Schema = require('../schema'); |
| |
| |
| module.exports = new Schema({ |
| explicit: [ |
| require('../type/str'), |
| require('../type/seq'), |
| require('../type/map') |
| ] |
| }); |
| |
| },{"../schema":27,"../type/map":41,"../type/seq":46,"../type/str":48}],32:[function(require,module,exports){ |
| // Standard YAML's JSON schema. |
| // http://www.yaml.org/spec/1.2/spec.html#id2803231 |
| // |
| // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. |
| // So, this schema is not such strict as defined in the YAML specification. |
| // It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. |
| |
| |
| 'use strict'; |
| |
| |
| var Schema = require('../schema'); |
| |
| |
| module.exports = new Schema({ |
| include: [ |
| require('./failsafe') |
| ], |
| implicit: [ |
| require('../type/null'), |
| require('../type/bool'), |
| require('../type/int'), |
| require('../type/float') |
| ] |
| }); |
| |
| },{"../schema":27,"../type/bool":35,"../type/float":36,"../type/int":37,"../type/null":43,"./failsafe":31}],33:[function(require,module,exports){ |
| 'use strict'; |
| |
| var YAMLException = require('./exception'); |
| |
| var TYPE_CONSTRUCTOR_OPTIONS = [ |
| 'kind', |
| 'resolve', |
| 'construct', |
| 'instanceOf', |
| 'predicate', |
| 'represent', |
| 'defaultStyle', |
| 'styleAliases' |
| ]; |
| |
| var YAML_NODE_KINDS = [ |
| 'scalar', |
| 'sequence', |
| 'mapping' |
| ]; |
| |
| function compileStyleAliases(map) { |
| var result = {}; |
| |
| if (null !== map) { |
| Object.keys(map).forEach(function (style) { |
| map[style].forEach(function (alias) { |
| result[String(alias)] = style; |
| }); |
| }); |
| } |
| |
| return result; |
| } |
| |
| function Type(tag, options) { |
| options = options || {}; |
| |
| Object.keys(options).forEach(function (name) { |
| if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) { |
| throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); |
| } |
| }); |
| |
| // TODO: Add tag format check. |
| this.tag = tag; |
| this.kind = options['kind'] || null; |
| this.resolve = options['resolve'] || function () { return true; }; |
| this.construct = options['construct'] || function (data) { return data; }; |
| this.instanceOf = options['instanceOf'] || null; |
| this.predicate = options['predicate'] || null; |
| this.represent = options['represent'] || null; |
| this.defaultStyle = options['defaultStyle'] || null; |
| this.styleAliases = compileStyleAliases(options['styleAliases'] || null); |
| |
| if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) { |
| throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); |
| } |
| } |
| |
| module.exports = Type; |
| |
| },{"./exception":24}],34:[function(require,module,exports){ |
| 'use strict'; |
| |
| /*eslint-disable no-bitwise*/ |
| |
| // A trick for browserified version. |
| // Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined |
| var NodeBuffer = require('buffer').Buffer; |
| var Type = require('../type'); |
| |
| |
| // [ 64, 65, 66 ] -> [ padding, CR, LF ] |
| var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; |
| |
| |
| function resolveYamlBinary(data) { |
| if (null === data) { |
| return false; |
| } |
| |
| var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; |
| |
| // Convert one by one. |
| for (idx = 0; idx < max; idx++) { |
| code = map.indexOf(data.charAt(idx)); |
| |
| // Skip CR/LF |
| if (code > 64) { continue; } |
| |
| // Fail on illegal characters |
| if (code < 0) { return false; } |
| |
| bitlen += 6; |
| } |
| |
| // If there are any bits left, source was corrupted |
| return (bitlen % 8) === 0; |
| } |
| |
| function constructYamlBinary(data) { |
| var idx, tailbits, |
| input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan |
| max = input.length, |
| map = BASE64_MAP, |
| bits = 0, |
| result = []; |
| |
| // Collect by 6*4 bits (3 bytes) |
| |
| for (idx = 0; idx < max; idx++) { |
| if ((idx % 4 === 0) && idx) { |
| result.push((bits >> 16) & 0xFF); |
| result.push((bits >> 8) & 0xFF); |
| result.push(bits & 0xFF); |
| } |
| |
| bits = (bits << 6) | map.indexOf(input.charAt(idx)); |
| } |
| |
| // Dump tail |
| |
| tailbits = (max % 4) * 6; |
| |
| if (tailbits === 0) { |
| result.push((bits >> 16) & 0xFF); |
| result.push((bits >> 8) & 0xFF); |
| result.push(bits & 0xFF); |
| } else if (tailbits === 18) { |
| result.push((bits >> 10) & 0xFF); |
| result.push((bits >> 2) & 0xFF); |
| } else if (tailbits === 12) { |
| result.push((bits >> 4) & 0xFF); |
| } |
| |
| // Wrap into Buffer for NodeJS and leave Array for browser |
| if (NodeBuffer) { |
| return new NodeBuffer(result); |
| } |
| |
| return result; |
| } |
| |
| function representYamlBinary(object /*, style*/) { |
| var result = '', bits = 0, idx, tail, |
| max = object.length, |
| map = BASE64_MAP; |
| |
| // Convert every three bytes to 4 ASCII characters. |
| |
| for (idx = 0; idx < max; idx++) { |
| if ((idx % 3 === 0) && idx) { |
| result += map[(bits >> 18) & 0x3F]; |
| result += map[(bits >> 12) & 0x3F]; |
| result += map[(bits >> 6) & 0x3F]; |
| result += map[bits & 0x3F]; |
| } |
| |
| bits = (bits << 8) + object[idx]; |
| } |
| |
| // Dump tail |
| |
| tail = max % 3; |
| |
| if (tail === 0) { |
| result += map[(bits >> 18) & 0x3F]; |
| result += map[(bits >> 12) & 0x3F]; |
| result += map[(bits >> 6) & 0x3F]; |
| result += map[bits & 0x3F]; |
| } else if (tail === 2) { |
| result += map[(bits >> 10) & 0x3F]; |
| result += map[(bits >> 4) & 0x3F]; |
| result += map[(bits << 2) & 0x3F]; |
| result += map[64]; |
| } else if (tail === 1) { |
| result += map[(bits >> 2) & 0x3F]; |
| result += map[(bits << 4) & 0x3F]; |
| result += map[64]; |
| result += map[64]; |
| } |
| |
| return result; |
| } |
| |
| function isBinary(object) { |
| return NodeBuffer && NodeBuffer.isBuffer(object); |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:binary', { |
| kind: 'scalar', |
| resolve: resolveYamlBinary, |
| construct: constructYamlBinary, |
| predicate: isBinary, |
| represent: representYamlBinary |
| }); |
| |
| },{"../type":33,"buffer":12}],35:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| function resolveYamlBoolean(data) { |
| if (null === data) { |
| return false; |
| } |
| |
| var max = data.length; |
| |
| return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || |
| (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); |
| } |
| |
| function constructYamlBoolean(data) { |
| return data === 'true' || |
| data === 'True' || |
| data === 'TRUE'; |
| } |
| |
| function isBoolean(object) { |
| return '[object Boolean]' === Object.prototype.toString.call(object); |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:bool', { |
| kind: 'scalar', |
| resolve: resolveYamlBoolean, |
| construct: constructYamlBoolean, |
| predicate: isBoolean, |
| represent: { |
| lowercase: function (object) { return object ? 'true' : 'false'; }, |
| uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, |
| camelcase: function (object) { return object ? 'True' : 'False'; } |
| }, |
| defaultStyle: 'lowercase' |
| }); |
| |
| },{"../type":33}],36:[function(require,module,exports){ |
| 'use strict'; |
| |
| var common = require('../common'); |
| var Type = require('../type'); |
| |
| var YAML_FLOAT_PATTERN = new RegExp( |
| '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' + |
| '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' + |
| '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + |
| '|[-+]?\\.(?:inf|Inf|INF)' + |
| '|\\.(?:nan|NaN|NAN))$'); |
| |
| function resolveYamlFloat(data) { |
| if (null === data) { |
| return false; |
| } |
| |
| if (!YAML_FLOAT_PATTERN.test(data)) { |
| return false; |
| } |
| return true; |
| } |
| |
| function constructYamlFloat(data) { |
| var value, sign, base, digits; |
| |
| value = data.replace(/_/g, '').toLowerCase(); |
| sign = '-' === value[0] ? -1 : 1; |
| digits = []; |
| |
| if (0 <= '+-'.indexOf(value[0])) { |
| value = value.slice(1); |
| } |
| |
| if ('.inf' === value) { |
| return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; |
| |
| } else if ('.nan' === value) { |
| return NaN; |
| |
| } else if (0 <= value.indexOf(':')) { |
| value.split(':').forEach(function (v) { |
| digits.unshift(parseFloat(v, 10)); |
| }); |
| |
| value = 0.0; |
| base = 1; |
| |
| digits.forEach(function (d) { |
| value += d * base; |
| base *= 60; |
| }); |
| |
| return sign * value; |
| |
| } |
| return sign * parseFloat(value, 10); |
| } |
| |
| |
| var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; |
| |
| function representYamlFloat(object, style) { |
| var res; |
| |
| if (isNaN(object)) { |
| switch (style) { |
| case 'lowercase': |
| return '.nan'; |
| case 'uppercase': |
| return '.NAN'; |
| case 'camelcase': |
| return '.NaN'; |
| } |
| } else if (Number.POSITIVE_INFINITY === object) { |
| switch (style) { |
| case 'lowercase': |
| return '.inf'; |
| case 'uppercase': |
| return '.INF'; |
| case 'camelcase': |
| return '.Inf'; |
| } |
| } else if (Number.NEGATIVE_INFINITY === object) { |
| switch (style) { |
| case 'lowercase': |
| return '-.inf'; |
| case 'uppercase': |
| return '-.INF'; |
| case 'camelcase': |
| return '-.Inf'; |
| } |
| } else if (common.isNegativeZero(object)) { |
| return '-0.0'; |
| } |
| |
| res = object.toString(10); |
| |
| // JS stringifier can build scientific format without dots: 5e-100, |
| // while YAML requres dot: 5.e-100. Fix it with simple hack |
| |
| return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; |
| } |
| |
| function isFloat(object) { |
| return ('[object Number]' === Object.prototype.toString.call(object)) && |
| (0 !== object % 1 || common.isNegativeZero(object)); |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:float', { |
| kind: 'scalar', |
| resolve: resolveYamlFloat, |
| construct: constructYamlFloat, |
| predicate: isFloat, |
| represent: representYamlFloat, |
| defaultStyle: 'lowercase' |
| }); |
| |
| },{"../common":22,"../type":33}],37:[function(require,module,exports){ |
| 'use strict'; |
| |
| var common = require('../common'); |
| var Type = require('../type'); |
| |
| function isHexCode(c) { |
| return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || |
| ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || |
| ((0x61/* a */ <= c) && (c <= 0x66/* f */)); |
| } |
| |
| function isOctCode(c) { |
| return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); |
| } |
| |
| function isDecCode(c) { |
| return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); |
| } |
| |
| function resolveYamlInteger(data) { |
| if (null === data) { |
| return false; |
| } |
| |
| var max = data.length, |
| index = 0, |
| hasDigits = false, |
| ch; |
| |
| if (!max) { return false; } |
| |
| ch = data[index]; |
| |
| // sign |
| if (ch === '-' || ch === '+') { |
| ch = data[++index]; |
| } |
| |
| if (ch === '0') { |
| // 0 |
| if (index + 1 === max) { return true; } |
| ch = data[++index]; |
| |
| // base 2, base 8, base 16 |
| |
| if (ch === 'b') { |
| // base 2 |
| index++; |
| |
| for (; index < max; index++) { |
| ch = data[index]; |
| if (ch === '_') { continue; } |
| if (ch !== '0' && ch !== '1') { |
| return false; |
| } |
| hasDigits = true; |
| } |
| return hasDigits; |
| } |
| |
| |
| if (ch === 'x') { |
| // base 16 |
| index++; |
| |
| for (; index < max; index++) { |
| ch = data[index]; |
| if (ch === '_') { continue; } |
| if (!isHexCode(data.charCodeAt(index))) { |
| return false; |
| } |
| hasDigits = true; |
| } |
| return hasDigits; |
| } |
| |
| // base 8 |
| for (; index < max; index++) { |
| ch = data[index]; |
| if (ch === '_') { continue; } |
| if (!isOctCode(data.charCodeAt(index))) { |
| return false; |
| } |
| hasDigits = true; |
| } |
| return hasDigits; |
| } |
| |
| // base 10 (except 0) or base 60 |
| |
| for (; index < max; index++) { |
| ch = data[index]; |
| if (ch === '_') { continue; } |
| if (ch === ':') { break; } |
| if (!isDecCode(data.charCodeAt(index))) { |
| return false; |
| } |
| hasDigits = true; |
| } |
| |
| if (!hasDigits) { return false; } |
| |
| // if !base60 - done; |
| if (ch !== ':') { return true; } |
| |
| // base60 almost not used, no needs to optimize |
| return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); |
| } |
| |
| function constructYamlInteger(data) { |
| var value = data, sign = 1, ch, base, digits = []; |
| |
| if (value.indexOf('_') !== -1) { |
| value = value.replace(/_/g, ''); |
| } |
| |
| ch = value[0]; |
| |
| if (ch === '-' || ch === '+') { |
| if (ch === '-') { sign = -1; } |
| value = value.slice(1); |
| ch = value[0]; |
| } |
| |
| if ('0' === value) { |
| return 0; |
| } |
| |
| if (ch === '0') { |
| if (value[1] === 'b') { |
| return sign * parseInt(value.slice(2), 2); |
| } |
| if (value[1] === 'x') { |
| return sign * parseInt(value, 16); |
| } |
| return sign * parseInt(value, 8); |
| |
| } |
| |
| if (value.indexOf(':') !== -1) { |
| value.split(':').forEach(function (v) { |
| digits.unshift(parseInt(v, 10)); |
| }); |
| |
| value = 0; |
| base = 1; |
| |
| digits.forEach(function (d) { |
| value += (d * base); |
| base *= 60; |
| }); |
| |
| return sign * value; |
| |
| } |
| |
| return sign * parseInt(value, 10); |
| } |
| |
| function isInteger(object) { |
| return ('[object Number]' === Object.prototype.toString.call(object)) && |
| (0 === object % 1 && !common.isNegativeZero(object)); |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:int', { |
| kind: 'scalar', |
| resolve: resolveYamlInteger, |
| construct: constructYamlInteger, |
| predicate: isInteger, |
| represent: { |
| binary: function (object) { return '0b' + object.toString(2); }, |
| octal: function (object) { return '0' + object.toString(8); }, |
| decimal: function (object) { return object.toString(10); }, |
| hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); } |
| }, |
| defaultStyle: 'decimal', |
| styleAliases: { |
| binary: [ 2, 'bin' ], |
| octal: [ 8, 'oct' ], |
| decimal: [ 10, 'dec' ], |
| hexadecimal: [ 16, 'hex' ] |
| } |
| }); |
| |
| },{"../common":22,"../type":33}],38:[function(require,module,exports){ |
| 'use strict'; |
| |
| var esprima; |
| |
| // Browserified version does not have esprima |
| // |
| // 1. For node.js just require module as deps |
| // 2. For browser try to require mudule via external AMD system. |
| // If not found - try to fallback to window.esprima. If not |
| // found too - then fail to parse. |
| // |
| try { |
| esprima = require('esprima'); |
| } catch (_) { |
| /*global window */ |
| if (typeof window !== 'undefined') { esprima = window.esprima; } |
| } |
| |
| var Type = require('../../type'); |
| |
| function resolveJavascriptFunction(data) { |
| if (null === data) { |
| return false; |
| } |
| |
| try { |
| var source = '(' + data + ')', |
| ast = esprima.parse(source, { range: true }); |
| |
| if ('Program' !== ast.type || |
| 1 !== ast.body.length || |
| 'ExpressionStatement' !== ast.body[0].type || |
| 'FunctionExpression' !== ast.body[0].expression.type) { |
| return false; |
| } |
| |
| return true; |
| } catch (err) { |
| return false; |
| } |
| } |
| |
| function constructJavascriptFunction(data) { |
| /*jslint evil:true*/ |
| |
| var source = '(' + data + ')', |
| ast = esprima.parse(source, { range: true }), |
| params = [], |
| body; |
| |
| if ('Program' !== ast.type || |
| 1 !== ast.body.length || |
| 'ExpressionStatement' !== ast.body[0].type || |
| 'FunctionExpression' !== ast.body[0].expression.type) { |
| throw new Error('Failed to resolve function'); |
| } |
| |
| ast.body[0].expression.params.forEach(function (param) { |
| params.push(param.name); |
| }); |
| |
| body = ast.body[0].expression.body.range; |
| |
| // Esprima's ranges include the first '{' and the last '}' characters on |
| // function expressions. So cut them out. |
| /*eslint-disable no-new-func*/ |
| return new Function(params, source.slice(body[0] + 1, body[1] - 1)); |
| } |
| |
| function representJavascriptFunction(object /*, style*/) { |
| return object.toString(); |
| } |
| |
| function isFunction(object) { |
| return '[object Function]' === Object.prototype.toString.call(object); |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:js/function', { |
| kind: 'scalar', |
| resolve: resolveJavascriptFunction, |
| construct: constructJavascriptFunction, |
| predicate: isFunction, |
| represent: representJavascriptFunction |
| }); |
| |
| },{"../../type":33,"esprima":50}],39:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../../type'); |
| |
| function resolveJavascriptRegExp(data) { |
| if (null === data) { |
| return false; |
| } |
| |
| if (0 === data.length) { |
| return false; |
| } |
| |
| var regexp = data, |
| tail = /\/([gim]*)$/.exec(data), |
| modifiers = ''; |
| |
| // if regexp starts with '/' it can have modifiers and must be properly closed |
| // `/foo/gim` - modifiers tail can be maximum 3 chars |
| if ('/' === regexp[0]) { |
| if (tail) { |
| modifiers = tail[1]; |
| } |
| |
| if (modifiers.length > 3) { return false; } |
| // if expression starts with /, is should be properly terminated |
| if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; } |
| |
| regexp = regexp.slice(1, regexp.length - modifiers.length - 1); |
| } |
| |
| try { |
| return true; |
| } catch (error) { |
| return false; |
| } |
| } |
| |
| function constructJavascriptRegExp(data) { |
| var regexp = data, |
| tail = /\/([gim]*)$/.exec(data), |
| modifiers = ''; |
| |
| // `/foo/gim` - tail can be maximum 4 chars |
| if ('/' === regexp[0]) { |
| if (tail) { |
| modifiers = tail[1]; |
| } |
| regexp = regexp.slice(1, regexp.length - modifiers.length - 1); |
| } |
| |
| return new RegExp(regexp, modifiers); |
| } |
| |
| function representJavascriptRegExp(object /*, style*/) { |
| var result = '/' + object.source + '/'; |
| |
| if (object.global) { |
| result += 'g'; |
| } |
| |
| if (object.multiline) { |
| result += 'm'; |
| } |
| |
| if (object.ignoreCase) { |
| result += 'i'; |
| } |
| |
| return result; |
| } |
| |
| function isRegExp(object) { |
| return '[object RegExp]' === Object.prototype.toString.call(object); |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:js/regexp', { |
| kind: 'scalar', |
| resolve: resolveJavascriptRegExp, |
| construct: constructJavascriptRegExp, |
| predicate: isRegExp, |
| represent: representJavascriptRegExp |
| }); |
| |
| },{"../../type":33}],40:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../../type'); |
| |
| function resolveJavascriptUndefined() { |
| return true; |
| } |
| |
| function constructJavascriptUndefined() { |
| /*eslint-disable no-undefined*/ |
| return undefined; |
| } |
| |
| function representJavascriptUndefined() { |
| return ''; |
| } |
| |
| function isUndefined(object) { |
| return 'undefined' === typeof object; |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:js/undefined', { |
| kind: 'scalar', |
| resolve: resolveJavascriptUndefined, |
| construct: constructJavascriptUndefined, |
| predicate: isUndefined, |
| represent: representJavascriptUndefined |
| }); |
| |
| },{"../../type":33}],41:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| module.exports = new Type('tag:yaml.org,2002:map', { |
| kind: 'mapping', |
| construct: function (data) { return null !== data ? data : {}; } |
| }); |
| |
| },{"../type":33}],42:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| function resolveYamlMerge(data) { |
| return '<<' === data || null === data; |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:merge', { |
| kind: 'scalar', |
| resolve: resolveYamlMerge |
| }); |
| |
| },{"../type":33}],43:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| function resolveYamlNull(data) { |
| if (null === data) { |
| return true; |
| } |
| |
| var max = data.length; |
| |
| return (max === 1 && data === '~') || |
| (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); |
| } |
| |
| function constructYamlNull() { |
| return null; |
| } |
| |
| function isNull(object) { |
| return null === object; |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:null', { |
| kind: 'scalar', |
| resolve: resolveYamlNull, |
| construct: constructYamlNull, |
| predicate: isNull, |
| represent: { |
| canonical: function () { return '~'; }, |
| lowercase: function () { return 'null'; }, |
| uppercase: function () { return 'NULL'; }, |
| camelcase: function () { return 'Null'; } |
| }, |
| defaultStyle: 'lowercase' |
| }); |
| |
| },{"../type":33}],44:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| var _hasOwnProperty = Object.prototype.hasOwnProperty; |
| var _toString = Object.prototype.toString; |
| |
| function resolveYamlOmap(data) { |
| if (null === data) { |
| return true; |
| } |
| |
| var objectKeys = [], index, length, pair, pairKey, pairHasKey, |
| object = data; |
| |
| for (index = 0, length = object.length; index < length; index += 1) { |
| pair = object[index]; |
| pairHasKey = false; |
| |
| if ('[object Object]' !== _toString.call(pair)) { |
| return false; |
| } |
| |
| for (pairKey in pair) { |
| if (_hasOwnProperty.call(pair, pairKey)) { |
| if (!pairHasKey) { |
| pairHasKey = true; |
| } else { |
| return false; |
| } |
| } |
| } |
| |
| if (!pairHasKey) { |
| return false; |
| } |
| |
| if (-1 === objectKeys.indexOf(pairKey)) { |
| objectKeys.push(pairKey); |
| } else { |
| return false; |
| } |
| } |
| |
| return true; |
| } |
| |
| function constructYamlOmap(data) { |
| return null !== data ? data : []; |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:omap', { |
| kind: 'sequence', |
| resolve: resolveYamlOmap, |
| construct: constructYamlOmap |
| }); |
| |
| },{"../type":33}],45:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| var _toString = Object.prototype.toString; |
| |
| function resolveYamlPairs(data) { |
| if (null === data) { |
| return true; |
| } |
| |
| var index, length, pair, keys, result, |
| object = data; |
| |
| result = new Array(object.length); |
| |
| for (index = 0, length = object.length; index < length; index += 1) { |
| pair = object[index]; |
| |
| if ('[object Object]' !== _toString.call(pair)) { |
| return false; |
| } |
| |
| keys = Object.keys(pair); |
| |
| if (1 !== keys.length) { |
| return false; |
| } |
| |
| result[index] = [ keys[0], pair[keys[0]] ]; |
| } |
| |
| return true; |
| } |
| |
| function constructYamlPairs(data) { |
| if (null === data) { |
| return []; |
| } |
| |
| var index, length, pair, keys, result, |
| object = data; |
| |
| result = new Array(object.length); |
| |
| for (index = 0, length = object.length; index < length; index += 1) { |
| pair = object[index]; |
| |
| keys = Object.keys(pair); |
| |
| result[index] = [ keys[0], pair[keys[0]] ]; |
| } |
| |
| return result; |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:pairs', { |
| kind: 'sequence', |
| resolve: resolveYamlPairs, |
| construct: constructYamlPairs |
| }); |
| |
| },{"../type":33}],46:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| module.exports = new Type('tag:yaml.org,2002:seq', { |
| kind: 'sequence', |
| construct: function (data) { return null !== data ? data : []; } |
| }); |
| |
| },{"../type":33}],47:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| var _hasOwnProperty = Object.prototype.hasOwnProperty; |
| |
| function resolveYamlSet(data) { |
| if (null === data) { |
| return true; |
| } |
| |
| var key, object = data; |
| |
| for (key in object) { |
| if (_hasOwnProperty.call(object, key)) { |
| if (null !== object[key]) { |
| return false; |
| } |
| } |
| } |
| |
| return true; |
| } |
| |
| function constructYamlSet(data) { |
| return null !== data ? data : {}; |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:set', { |
| kind: 'mapping', |
| resolve: resolveYamlSet, |
| construct: constructYamlSet |
| }); |
| |
| },{"../type":33}],48:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| module.exports = new Type('tag:yaml.org,2002:str', { |
| kind: 'scalar', |
| construct: function (data) { return null !== data ? data : ''; } |
| }); |
| |
| },{"../type":33}],49:[function(require,module,exports){ |
| 'use strict'; |
| |
| var Type = require('../type'); |
| |
| var YAML_TIMESTAMP_REGEXP = new RegExp( |
| '^([0-9][0-9][0-9][0-9])' + // [1] year |
| '-([0-9][0-9]?)' + // [2] month |
| '-([0-9][0-9]?)' + // [3] day |
| '(?:(?:[Tt]|[ \\t]+)' + // ... |
| '([0-9][0-9]?)' + // [4] hour |
| ':([0-9][0-9])' + // [5] minute |
| ':([0-9][0-9])' + // [6] second |
| '(?:\\.([0-9]*))?' + // [7] fraction |
| '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour |
| '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute |
| |
| function resolveYamlTimestamp(data) { |
| if (null === data) { |
| return false; |
| } |
| |
| if (YAML_TIMESTAMP_REGEXP.exec(data) === null) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| function constructYamlTimestamp(data) { |
| var match, year, month, day, hour, minute, second, fraction = 0, |
| delta = null, tz_hour, tz_minute, date; |
| |
| match = YAML_TIMESTAMP_REGEXP.exec(data); |
| |
| if (null === match) { |
| throw new Error('Date resolve error'); |
| } |
| |
| // match: [1] year [2] month [3] day |
| |
| year = +(match[1]); |
| month = +(match[2]) - 1; // JS month starts with 0 |
| day = +(match[3]); |
| |
| if (!match[4]) { // no hour |
| return new Date(Date.UTC(year, month, day)); |
| } |
| |
| // match: [4] hour [5] minute [6] second [7] fraction |
| |
| hour = +(match[4]); |
| minute = +(match[5]); |
| second = +(match[6]); |
| |
| if (match[7]) { |
| fraction = match[7].slice(0, 3); |
| while (fraction.length < 3) { // milli-seconds |
| fraction += '0'; |
| } |
| fraction = +fraction; |
| } |
| |
| // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute |
| |
| if (match[9]) { |
| tz_hour = +(match[10]); |
| tz_minute = +(match[11] || 0); |
| delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds |
| if ('-' === match[9]) { |
| delta = -delta; |
| } |
| } |
| |
| date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); |
| |
| if (delta) { |
| date.setTime(date.getTime() - delta); |
| } |
| |
| return date; |
| } |
| |
| function representYamlTimestamp(object /*, style*/) { |
| return object.toISOString(); |
| } |
| |
| module.exports = new Type('tag:yaml.org,2002:timestamp', { |
| kind: 'scalar', |
| resolve: resolveYamlTimestamp, |
| construct: constructYamlTimestamp, |
| instanceOf: Date, |
| represent: representYamlTimestamp |
| }); |
| |
| },{"../type":33}],50:[function(require,module,exports){ |
| /* |
| Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. |
| |
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions are met: |
| |
| * Redistributions of source code must retain the above copyright |
| notice, this list of conditions and the following disclaimer. |
| * Redistributions in binary form must reproduce the above copyright |
| notice, this list of conditions and the following disclaimer in the |
| documentation and/or other materials provided with the distribution. |
| |
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY |
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| |
| (function (root, factory) { |
| 'use strict'; |
| |
| // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, |
| // Rhino, and plain browser loading. |
| |
| /* istanbul ignore next */ |
| if (typeof define === 'function' && define.amd) { |
| define(['exports'], factory); |
| } else if (typeof exports !== 'undefined') { |
| factory(exports); |
| } else { |
| factory((root.esprima = {})); |
| } |
| }(this, function (exports) { |
| 'use strict'; |
| |
| var Token, |
| TokenName, |
| FnExprTokens, |
| Syntax, |
| PlaceHolders, |
| Messages, |
| Regex, |
| source, |
| strict, |
| index, |
| lineNumber, |
| lineStart, |
| hasLineTerminator, |
| lastIndex, |
| lastLineNumber, |
| lastLineStart, |
| startIndex, |
| startLineNumber, |
| startLineStart, |
| scanning, |
| length, |
| lookahead, |
| state, |
| extra, |
| isBindingElement, |
| isAssignmentTarget, |
| firstCoverInitializedNameError; |
| |
| Token = { |
| BooleanLiteral: 1, |
| EOF: 2, |
| Identifier: 3, |
| Keyword: 4, |
| NullLiteral: 5, |
| NumericLiteral: 6, |
| Punctuator: 7, |
| StringLiteral: 8, |
| RegularExpression: 9, |
| Template: 10 |
| }; |
| |
| TokenName = {}; |
| TokenName[Token.BooleanLiteral] = 'Boolean'; |
| TokenName[Token.EOF] = '<end>'; |
| TokenName[Token.Identifier] = 'Identifier'; |
| TokenName[Token.Keyword] = 'Keyword'; |
| TokenName[Token.NullLiteral] = 'Null'; |
| TokenName[Token.NumericLiteral] = 'Numeric'; |
| TokenName[Token.Punctuator] = 'Punctuator'; |
| TokenName[Token.StringLiteral] = 'String'; |
| TokenName[Token.RegularExpression] = 'RegularExpression'; |
| TokenName[Token.Template] = 'Template'; |
| |
| // A function following one of those tokens is an expression. |
| FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new', |
| 'return', 'case', 'delete', 'throw', 'void', |
| // assignment operators |
| '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=', |
| '&=', '|=', '^=', ',', |
| // binary/unary operators |
| '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&', |
| '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=', |
| '<=', '<', '>', '!=', '!==']; |
| |
| Syntax = { |
| AssignmentExpression: 'AssignmentExpression', |
| AssignmentPattern: 'AssignmentPattern', |
| ArrayExpression: 'ArrayExpression', |
| ArrayPattern: 'ArrayPattern', |
| ArrowFunctionExpression: 'ArrowFunctionExpression', |
| BlockStatement: 'BlockStatement', |
| BinaryExpression: 'BinaryExpression', |
| BreakStatement: 'BreakStatement', |
| CallExpression: 'CallExpression', |
| CatchClause: 'CatchClause', |
| ClassBody: 'ClassBody', |
| ClassDeclaration: 'ClassDeclaration', |
| ClassExpression: 'ClassExpression', |
| ConditionalExpression: 'ConditionalExpression', |
| ContinueStatement: 'ContinueStatement', |
| DoWhileStatement: 'DoWhileStatement', |
| DebuggerStatement: 'DebuggerStatement', |
| EmptyStatement: 'EmptyStatement', |
| ExportAllDeclaration: 'ExportAllDeclaration', |
| ExportDefaultDeclaration: 'ExportDefaultDeclaration', |
| ExportNamedDeclaration: 'ExportNamedDeclaration', |
| ExportSpecifier: 'ExportSpecifier', |
| ExpressionStatement: 'ExpressionStatement', |
| ForStatement: 'ForStatement', |
| ForOfStatement: 'ForOfStatement', |
| ForInStatement: 'ForInStatement', |
| FunctionDeclaration: 'FunctionDeclaration', |
| FunctionExpression: 'FunctionExpression', |
| Identifier: 'Identifier', |
| IfStatement: 'IfStatement', |
| ImportDeclaration: 'ImportDeclaration', |
| ImportDefaultSpecifier: 'ImportDefaultSpecifier', |
| ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', |
| ImportSpecifier: 'ImportSpecifier', |
| Literal: 'Literal', |
| LabeledStatement: 'LabeledStatement', |
| LogicalExpression: 'LogicalExpression', |
| MemberExpression: 'MemberExpression', |
| MetaProperty: 'MetaProperty', |
| MethodDefinition: 'MethodDefinition', |
| NewExpression: 'NewExpression', |
| ObjectExpression: 'ObjectExpression', |
| ObjectPattern: 'ObjectPattern', |
| Program: 'Program', |
| Property: 'Property', |
| RestElement: 'RestElement', |
| ReturnStatement: 'ReturnStatement', |
| SequenceExpression: 'SequenceExpression', |
| SpreadElement: 'SpreadElement', |
| Super: 'Super', |
| SwitchCase: 'SwitchCase', |
| SwitchStatement: 'SwitchStatement', |
| TaggedTemplateExpression: 'TaggedTemplateExpression', |
| TemplateElement: 'TemplateElement', |
| TemplateLiteral: 'TemplateLiteral', |
| ThisExpression: 'ThisExpression', |
| ThrowStatement: 'ThrowStatement', |
| TryStatement: 'TryStatement', |
| UnaryExpression: 'UnaryExpression', |
| UpdateExpression: 'UpdateExpression', |
| VariableDeclaration: 'VariableDeclaration', |
| VariableDeclarator: 'VariableDeclarator', |
| WhileStatement: 'WhileStatement', |
| WithStatement: 'WithStatement', |
| YieldExpression: 'YieldExpression' |
| }; |
| |
| PlaceHolders = { |
| ArrowParameterPlaceHolder: 'ArrowParameterPlaceHolder' |
| }; |
| |
| // Error messages should be identical to V8. |
| Messages = { |
| UnexpectedToken: 'Unexpected token %0', |
| UnexpectedNumber: 'Unexpected number', |
| UnexpectedString: 'Unexpected string', |
| UnexpectedIdentifier: 'Unexpected identifier', |
| UnexpectedReserved: 'Unexpected reserved word', |
| UnexpectedTemplate: 'Unexpected quasi %0', |
| UnexpectedEOS: 'Unexpected end of input', |
| NewlineAfterThrow: 'Illegal newline after throw', |
| InvalidRegExp: 'Invalid regular expression', |
| UnterminatedRegExp: 'Invalid regular expression: missing /', |
| InvalidLHSInAssignment: 'Invalid left-hand side in assignment', |
| InvalidLHSInForIn: 'Invalid left-hand side in for-in', |
| InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', |
| MultipleDefaultsInSwitch: 'More than one default clause in switch statement', |
| NoCatchOrFinally: 'Missing catch or finally after try', |
| UnknownLabel: 'Undefined label \'%0\'', |
| Redeclaration: '%0 \'%1\' has already been declared', |
| IllegalContinue: 'Illegal continue statement', |
| IllegalBreak: 'Illegal break statement', |
| IllegalReturn: 'Illegal return statement', |
| StrictModeWith: 'Strict mode code may not include a with statement', |
| StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', |
| StrictVarName: 'Variable name may not be eval or arguments in strict mode', |
| StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', |
| StrictParamDupe: 'Strict mode function may not have duplicate parameter names', |
| StrictFunctionName: 'Function name may not be eval or arguments in strict mode', |
| StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', |
| StrictDelete: 'Delete of an unqualified identifier in strict mode.', |
| StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', |
| StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', |
| StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', |
| StrictReservedWord: 'Use of future reserved word in strict mode', |
| TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', |
| ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', |
| DefaultRestParameter: 'Unexpected token =', |
| ObjectPatternAsRestParameter: 'Unexpected token {', |
| DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', |
| ConstructorSpecialMethod: 'Class constructor may not be an accessor', |
| DuplicateConstructor: 'A class may only have one constructor', |
| StaticPrototype: 'Classes may not have static property named prototype', |
| MissingFromClause: 'Unexpected token', |
| NoAsAfterImportNamespace: 'Unexpected token', |
| InvalidModuleSpecifier: 'Unexpected token', |
| IllegalImportDeclaration: 'Unexpected token', |
| IllegalExportDeclaration: 'Unexpected token', |
| DuplicateBinding: 'Duplicate binding %0' |
| }; |
| |
| // See also tools/generate-unicode-regex.js. |
| Regex = { |
| // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: |
| NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u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050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, |
| |
| // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: |
| NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35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u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ |
| }; |
| |
| // Ensure the condition is true, otherwise throw an error. |
| // This is only to have a better contract semantic, i.e. another safety net |
| // to catch a logic error. The condition shall be fulfilled in normal case. |
| // Do NOT use this to enforce a certain condition on any user input. |
| |
| function assert(condition, message) { |
| /* istanbul ignore if */ |
| if (!condition) { |
| throw new Error('ASSERT: ' + message); |
| } |
| } |
| |
| function isDecimalDigit(ch) { |
| return (ch >= 0x30 && ch <= 0x39); // 0..9 |
| } |
| |
| function isHexDigit(ch) { |
| return '0123456789abcdefABCDEF'.indexOf(ch) >= 0; |
| } |
| |
| function isOctalDigit(ch) { |
| return '01234567'.indexOf(ch) >= 0; |
| } |
| |
| function octalToDecimal(ch) { |
| // \0 is not octal escape sequence |
| var octal = (ch !== '0'), code = '01234567'.indexOf(ch); |
| |
| if (index < length && isOctalDigit(source[index])) { |
| octal = true; |
| code = code * 8 + '01234567'.indexOf(source[index++]); |
| |
| // 3 digits are only allowed when string starts |
| // with 0, 1, 2, 3 |
| if ('0123'.indexOf(ch) >= 0 && |
| index < length && |
| isOctalDigit(source[index])) { |
| code = code * 8 + '01234567'.indexOf(source[index++]); |
| } |
| } |
| |
| return { |
| code: code, |
| octal: octal |
| }; |
| } |
| |
| // ECMA-262 11.2 White Space |
| |
| function isWhiteSpace(ch) { |
| return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) || |
| (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0); |
| } |
| |
| // ECMA-262 11.3 Line Terminators |
| |
| function isLineTerminator(ch) { |
| return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029); |
| } |
| |
| // ECMA-262 11.6 Identifier Names and Identifiers |
| |
| function fromCodePoint(cp) { |
| return (cp < 0x10000) ? String.fromCharCode(cp) : |
| String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + |
| String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); |
| } |
| |
| function isIdentifierStart(ch) { |
| return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) |
| (ch >= 0x41 && ch <= 0x5A) || // A..Z |
| (ch >= 0x61 && ch <= 0x7A) || // a..z |
| (ch === 0x5C) || // \ (backslash) |
| ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch))); |
| } |
| |
| function isIdentifierPart(ch) { |
| return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) |
| (ch >= 0x41 && ch <= 0x5A) || // A..Z |
| (ch >= 0x61 && ch <= 0x7A) || // a..z |
| (ch >= 0x30 && ch <= 0x39) || // 0..9 |
| (ch === 0x5C) || // \ (backslash) |
| ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch))); |
| } |
| |
| // ECMA-262 11.6.2.2 Future Reserved Words |
| |
| function isFutureReservedWord(id) { |
| switch (id) { |
| case 'enum': |
| case 'export': |
| case 'import': |
| case 'super': |
| return true; |
| default: |
| return false; |
| } |
| } |
| |
| function isStrictModeReservedWord(id) { |
| switch (id) { |
| case 'implements': |
| case 'interface': |
| case 'package': |
| case 'private': |
| case 'protected': |
| case 'public': |
| case 'static': |
| case 'yield': |
| case 'let': |
| return true; |
| default: |
| return false; |
| } |
| } |
| |
| function isRestrictedWord(id) { |
| return id === 'eval' || id === 'arguments'; |
| } |
| |
| // ECMA-262 11.6.2.1 Keywords |
| |
| function isKeyword(id) { |
| switch (id.length) { |
| case 2: |
| return (id === 'if') || (id === 'in') || (id === 'do'); |
| case 3: |
| return (id === 'var') || (id === 'for') || (id === 'new') || |
| (id === 'try') || (id === 'let'); |
| case 4: |
| return (id === 'this') || (id === 'else') || (id === 'case') || |
| (id === 'void') || (id === 'with') || (id === 'enum'); |
| case 5: |
| return (id === 'while') || (id === 'break') || (id === 'catch') || |
| (id === 'throw') || (id === 'const') || (id === 'yield') || |
| (id === 'class') || (id === 'super'); |
| case 6: |
| return (id === 'return') || (id === 'typeof') || (id === 'delete') || |
| (id === 'switch') || (id === 'export') || (id === 'import'); |
| case 7: |
| return (id === 'default') || (id === 'finally') || (id === 'extends'); |
| case 8: |
| return (id === 'function') || (id === 'continue') || (id === 'debugger'); |
| case 10: |
| return (id === 'instanceof'); |
| default: |
| return false; |
| } |
| } |
| |
| // ECMA-262 11.4 Comments |
| |
| function addComment(type, value, start, end, loc) { |
| var comment; |
| |
| assert(typeof start === 'number', 'Comment must have valid position'); |
| |
| state.lastCommentStart = start; |
| |
| comment = { |
| type: type, |
| value: value |
| }; |
| if (extra.range) { |
| comment.range = [start, end]; |
| } |
| if (extra.loc) { |
| comment.loc = loc; |
| } |
| extra.comments.push(comment); |
| if (extra.attachComment) { |
| extra.leadingComments.push(comment); |
| extra.trailingComments.push(comment); |
| } |
| if (extra.tokenize) { |
| comment.type = comment.type + 'Comment'; |
| if (extra.delegate) { |
| comment = extra.delegate(comment); |
| } |
| extra.tokens.push(comment); |
| } |
| } |
| |
| function skipSingleLineComment(offset) { |
| var start, loc, ch, comment; |
| |
| start = index - offset; |
| loc = { |
| start: { |
| line: lineNumber, |
| column: index - lineStart - offset |
| } |
| }; |
| |
| while (index < length) { |
| ch = source.charCodeAt(index); |
| ++index; |
| if (isLineTerminator(ch)) { |
| hasLineTerminator = true; |
| if (extra.comments) { |
| comment = source.slice(start + offset, index - 1); |
| loc.end = { |
| line: lineNumber, |
| column: index - lineStart - 1 |
| }; |
| addComment('Line', comment, start, index - 1, loc); |
| } |
| if (ch === 13 && source.charCodeAt(index) === 10) { |
| ++index; |
| } |
| ++lineNumber; |
| lineStart = index; |
| return; |
| } |
| } |
| |
| if (extra.comments) { |
| comment = source.slice(start + offset, index); |
| loc.end = { |
| line: lineNumber, |
| column: index - lineStart |
| }; |
| addComment('Line', comment, start, index, loc); |
| } |
| } |
| |
| function skipMultiLineComment() { |
| var start, loc, ch, comment; |
| |
| if (extra.comments) { |
| start = index - 2; |
| loc = { |
| start: { |
| line: lineNumber, |
| column: index - lineStart - 2 |
| } |
| }; |
| } |
| |
| while (index < length) { |
| ch = source.charCodeAt(index); |
| if (isLineTerminator(ch)) { |
| if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) { |
| ++index; |
| } |
| hasLineTerminator = true; |
| ++lineNumber; |
| ++index; |
| lineStart = index; |
| } else if (ch === 0x2A) { |
| // Block comment ends with '*/'. |
| if (source.charCodeAt(index + 1) === 0x2F) { |
| ++index; |
| ++index; |
| if (extra.comments) { |
| comment = source.slice(start + 2, index - 2); |
| loc.end = { |
| line: lineNumber, |
| column: index - lineStart |
| }; |
| addComment('Block', comment, start, index, loc); |
| } |
| return; |
| } |
| ++index; |
| } else { |
| ++index; |
| } |
| } |
| |
| // Ran off the end of the file - the whole thing is a comment |
| if (extra.comments) { |
| loc.end = { |
| line: lineNumber, |
| column: index - lineStart |
| }; |
| comment = source.slice(start + 2, index); |
| addComment('Block', comment, start, index, loc); |
| } |
| tolerateUnexpectedToken(); |
| } |
| |
| function skipComment() { |
| var ch, start; |
| hasLineTerminator = false; |
| |
| start = (index === 0); |
| while (index < length) { |
| ch = source.charCodeAt(index); |
| |
| if (isWhiteSpace(ch)) { |
| ++index; |
| } else if (isLineTerminator(ch)) { |
| hasLineTerminator = true; |
| ++index; |
| if (ch === 0x0D && source.charCodeAt(index) === 0x0A) { |
| ++index; |
| } |
| ++lineNumber; |
| lineStart = index; |
| start = true; |
| } else if (ch === 0x2F) { // U+002F is '/' |
| ch = source.charCodeAt(index + 1); |
| if (ch === 0x2F) { |
| ++index; |
| ++index; |
| skipSingleLineComment(2); |
| start = true; |
| } else if (ch === 0x2A) { // U+002A is '*' |
| ++index; |
| ++index; |
| skipMultiLineComment(); |
| } else { |
| break; |
| } |
| } else if (start && ch === 0x2D) { // U+002D is '-' |
| // U+003E is '>' |
| if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) { |
| // '-->' is a single-line comment |
| index += 3; |
| skipSingleLineComment(3); |
| } else { |
| break; |
| } |
| } else if (ch === 0x3C) { // U+003C is '<' |
| if (source.slice(index + 1, index + 4) === '!--') { |
| ++index; // `<` |
| ++index; // `!` |
| ++index; // `-` |
| ++index; // `-` |
| skipSingleLineComment(4); |
| } else { |
| break; |
| } |
| } else { |
| break; |
| } |
| } |
| } |
| |
| function scanHexEscape(prefix) { |
| var i, len, ch, code = 0; |
| |
| len = (prefix === 'u') ? 4 : 2; |
| for (i = 0; i < len; ++i) { |
| if (index < length && isHexDigit(source[index])) { |
| ch = source[index++]; |
| code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); |
| } else { |
| return ''; |
| } |
| } |
| return String.fromCharCode(code); |
| } |
| |
| function scanUnicodeCodePointEscape() { |
| var ch, code; |
| |
| ch = source[index]; |
| code = 0; |
| |
| // At least, one hex digit is required. |
| if (ch === '}') { |
| throwUnexpectedToken(); |
| } |
| |
| while (index < length) { |
| ch = source[index++]; |
| if (!isHexDigit(ch)) { |
| break; |
| } |
| code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); |
| } |
| |
| if (code > 0x10FFFF || ch !== '}') { |
| throwUnexpectedToken(); |
| } |
| |
| return fromCodePoint(code); |
| } |
| |
| function codePointAt(i) { |
| var cp, first, second; |
| |
| cp = source.charCodeAt(i); |
| if (cp >= 0xD800 && cp <= 0xDBFF) { |
| second = source.charCodeAt(i + 1); |
| if (second >= 0xDC00 && second <= 0xDFFF) { |
| first = cp; |
| cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; |
| } |
| } |
| |
| return cp; |
| } |
| |
| function getComplexIdentifier() { |
| var cp, ch, id; |
| |
| cp = codePointAt(index); |
| id = fromCodePoint(cp); |
| index += id.length; |
| |
| // '\u' (U+005C, U+0075) denotes an escaped character. |
| if (cp === 0x5C) { |
| if (source.charCodeAt(index) !== 0x75) { |
| throwUnexpectedToken(); |
| } |
| ++index; |
| if (source[index] === '{') { |
| ++index; |
| ch = scanUnicodeCodePointEscape(); |
| } else { |
| ch = scanHexEscape('u'); |
| cp = ch.charCodeAt(0); |
| if (!ch || ch === '\\' || !isIdentifierStart(cp)) { |
| throwUnexpectedToken(); |
| } |
| } |
| id = ch; |
| } |
| |
| while (index < length) { |
| cp = codePointAt(index); |
| if (!isIdentifierPart(cp)) { |
| break; |
| } |
| ch = fromCodePoint(cp); |
| id += ch; |
| index += ch.length; |
| |
| // '\u' (U+005C, U+0075) denotes an escaped character. |
| if (cp === 0x5C) { |
| id = id.substr(0, id.length - 1); |
| if (source.charCodeAt(index) !== 0x75) { |
| throwUnexpectedToken(); |
| } |
| ++index; |
| if (source[index] === '{') { |
| ++index; |
| ch = scanUnicodeCodePointEscape(); |
| } else { |
| ch = scanHexEscape('u'); |
| cp = ch.charCodeAt(0); |
| if (!ch || ch === '\\' || !isIdentifierPart(cp)) { |
| throwUnexpectedToken(); |
| } |
| } |
| id += ch; |
| } |
| } |
| |
| return id; |
| } |
| |
| function getIdentifier() { |
| var start, ch; |
| |
| start = index++; |
| while (index < length) { |
| ch = source.charCodeAt(index); |
| if (ch === 0x5C) { |
| // Blackslash (U+005C) marks Unicode escape sequence. |
| index = start; |
| return getComplexIdentifier(); |
| } else if (ch >= 0xD800 && ch < 0xDFFF) { |
| // Need to handle surrogate pairs. |
| index = start; |
| return getComplexIdentifier(); |
| } |
| if (isIdentifierPart(ch)) { |
| ++index; |
| } else { |
| break; |
| } |
| } |
| |
| return source.slice(start, index); |
| } |
| |
| function scanIdentifier() { |
| var start, id, type; |
| |
| start = index; |
| |
| // Backslash (U+005C) starts an escaped character. |
| id = (source.charCodeAt(index) === 0x5C) ? getComplexIdentifier() : getIdentifier(); |
| |
| // There is no keyword or literal with only one character. |
| // Thus, it must be an identifier. |
| if (id.length === 1) { |
| type = Token.Identifier; |
| } else if (isKeyword(id)) { |
| type = Token.Keyword; |
| } else if (id === 'null') { |
| type = Token.NullLiteral; |
| } else if (id === 'true' || id === 'false') { |
| type = Token.BooleanLiteral; |
| } else { |
| type = Token.Identifier; |
| } |
| |
| return { |
| type: type, |
| value: id, |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: start, |
| end: index |
| }; |
| } |
| |
| |
| // ECMA-262 11.7 Punctuators |
| |
| function scanPunctuator() { |
| var token, str; |
| |
| token = { |
| type: Token.Punctuator, |
| value: '', |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: index, |
| end: index |
| }; |
| |
| // Check for most common single-character punctuators. |
| str = source[index]; |
| switch (str) { |
| |
| case '(': |
| if (extra.tokenize) { |
| extra.openParenToken = extra.tokenValues.length; |
| } |
| ++index; |
| break; |
| |
| case '{': |
| if (extra.tokenize) { |
| extra.openCurlyToken = extra.tokenValues.length; |
| } |
| state.curlyStack.push('{'); |
| ++index; |
| break; |
| |
| case '.': |
| ++index; |
| if (source[index] === '.' && source[index + 1] === '.') { |
| // Spread operator: ... |
| index += 2; |
| str = '...'; |
| } |
| break; |
| |
| case '}': |
| ++index; |
| state.curlyStack.pop(); |
| break; |
| case ')': |
| case ';': |
| case ',': |
| case '[': |
| case ']': |
| case ':': |
| case '?': |
| case '~': |
| ++index; |
| break; |
| |
| default: |
| // 4-character punctuator. |
| str = source.substr(index, 4); |
| if (str === '>>>=') { |
| index += 4; |
| } else { |
| |
| // 3-character punctuators. |
| str = str.substr(0, 3); |
| if (str === '===' || str === '!==' || str === '>>>' || |
| str === '<<=' || str === '>>=') { |
| index += 3; |
| } else { |
| |
| // 2-character punctuators. |
| str = str.substr(0, 2); |
| if (str === '&&' || str === '||' || str === '==' || str === '!=' || |
| str === '+=' || str === '-=' || str === '*=' || str === '/=' || |
| str === '++' || str === '--' || str === '<<' || str === '>>' || |
| str === '&=' || str === '|=' || str === '^=' || str === '%=' || |
| str === '<=' || str === '>=' || str === '=>') { |
| index += 2; |
| } else { |
| |
| // 1-character punctuators. |
| str = source[index]; |
| if ('<>=!+-*%&|^/'.indexOf(str) >= 0) { |
| ++index; |
| } |
| } |
| } |
| } |
| } |
| |
| if (index === token.start) { |
| throwUnexpectedToken(); |
| } |
| |
| token.end = index; |
| token.value = str; |
| return token; |
| } |
| |
| // ECMA-262 11.8.3 Numeric Literals |
| |
| function scanHexLiteral(start) { |
| var number = ''; |
| |
| while (index < length) { |
| if (!isHexDigit(source[index])) { |
| break; |
| } |
| number += source[index++]; |
| } |
| |
| if (number.length === 0) { |
| throwUnexpectedToken(); |
| } |
| |
| if (isIdentifierStart(source.charCodeAt(index))) { |
| throwUnexpectedToken(); |
| } |
| |
| return { |
| type: Token.NumericLiteral, |
| value: parseInt('0x' + number, 16), |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: start, |
| end: index |
| }; |
| } |
| |
| function scanBinaryLiteral(start) { |
| var ch, number; |
| |
| number = ''; |
| |
| while (index < length) { |
| ch = source[index]; |
| if (ch !== '0' && ch !== '1') { |
| break; |
| } |
| number += source[index++]; |
| } |
| |
| if (number.length === 0) { |
| // only 0b or 0B |
| throwUnexpectedToken(); |
| } |
| |
| if (index < length) { |
| ch = source.charCodeAt(index); |
| /* istanbul ignore else */ |
| if (isIdentifierStart(ch) || isDecimalDigit(ch)) { |
| throwUnexpectedToken(); |
| } |
| } |
| |
| return { |
| type: Token.NumericLiteral, |
| value: parseInt(number, 2), |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: start, |
| end: index |
| }; |
| } |
| |
| function scanOctalLiteral(prefix, start) { |
| var number, octal; |
| |
| if (isOctalDigit(prefix)) { |
| octal = true; |
| number = '0' + source[index++]; |
| } else { |
| octal = false; |
| ++index; |
| number = ''; |
| } |
| |
| while (index < length) { |
| if (!isOctalDigit(source[index])) { |
| break; |
| } |
| number += source[index++]; |
| } |
| |
| if (!octal && number.length === 0) { |
| // only 0o or 0O |
| throwUnexpectedToken(); |
| } |
| |
| if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) { |
| throwUnexpectedToken(); |
| } |
| |
| return { |
| type: Token.NumericLiteral, |
| value: parseInt(number, 8), |
| octal: octal, |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: start, |
| end: index |
| }; |
| } |
| |
| function isImplicitOctalLiteral() { |
| var i, ch; |
| |
| // Implicit octal, unless there is a non-octal digit. |
| // (Annex B.1.1 on Numeric Literals) |
| for (i = index + 1; i < length; ++i) { |
| ch = source[i]; |
| if (ch === '8' || ch === '9') { |
| return false; |
| } |
| if (!isOctalDigit(ch)) { |
| return true; |
| } |
| } |
| |
| return true; |
| } |
| |
| function scanNumericLiteral() { |
| var number, start, ch; |
| |
| ch = source[index]; |
| assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), |
| 'Numeric literal must start with a decimal digit or a decimal point'); |
| |
| start = index; |
| number = ''; |
| if (ch !== '.') { |
| number = source[index++]; |
| ch = source[index]; |
| |
| // Hex number starts with '0x'. |
| // Octal number starts with '0'. |
| // Octal number in ES6 starts with '0o'. |
| // Binary number in ES6 starts with '0b'. |
| if (number === '0') { |
| if (ch === 'x' || ch === 'X') { |
| ++index; |
| return scanHexLiteral(start); |
| } |
| if (ch === 'b' || ch === 'B') { |
| ++index; |
| return scanBinaryLiteral(start); |
| } |
| if (ch === 'o' || ch === 'O') { |
| return scanOctalLiteral(ch, start); |
| } |
| |
| if (isOctalDigit(ch)) { |
| if (isImplicitOctalLiteral()) { |
| return scanOctalLiteral(ch, start); |
| } |
| } |
| } |
| |
| while (isDecimalDigit(source.charCodeAt(index))) { |
| number += source[index++]; |
| } |
| ch = source[index]; |
| } |
| |
| if (ch === '.') { |
| number += source[index++]; |
| while (isDecimalDigit(source.charCodeAt(index))) { |
| number += source[index++]; |
| } |
| ch = source[index]; |
| } |
| |
| if (ch === 'e' || ch === 'E') { |
| number += source[index++]; |
| |
| ch = source[index]; |
| if (ch === '+' || ch === '-') { |
| number += source[index++]; |
| } |
| if (isDecimalDigit(source.charCodeAt(index))) { |
| while (isDecimalDigit(source.charCodeAt(index))) { |
| number += source[index++]; |
| } |
| } else { |
| throwUnexpectedToken(); |
| } |
| } |
| |
| if (isIdentifierStart(source.charCodeAt(index))) { |
| throwUnexpectedToken(); |
| } |
| |
| return { |
| type: Token.NumericLiteral, |
| value: parseFloat(number), |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: start, |
| end: index |
| }; |
| } |
| |
| // ECMA-262 11.8.4 String Literals |
| |
| function scanStringLiteral() { |
| var str = '', quote, start, ch, unescaped, octToDec, octal = false; |
| |
| quote = source[index]; |
| assert((quote === '\'' || quote === '"'), |
| 'String literal must starts with a quote'); |
| |
| start = index; |
| ++index; |
| |
| while (index < length) { |
| ch = source[index++]; |
| |
| if (ch === quote) { |
| quote = ''; |
| break; |
| } else if (ch === '\\') { |
| ch = source[index++]; |
| if (!ch || !isLineTerminator(ch.charCodeAt(0))) { |
| switch (ch) { |
| case 'u': |
| case 'x': |
| if (source[index] === '{') { |
| ++index; |
| str += scanUnicodeCodePointEscape(); |
| } else { |
| unescaped = scanHexEscape(ch); |
| if (!unescaped) { |
| throw throwUnexpectedToken(); |
| } |
| str += unescaped; |
| } |
| break; |
| case 'n': |
| str += '\n'; |
| break; |
| case 'r': |
| str += '\r'; |
| break; |
| case 't': |
| str += '\t'; |
| break; |
| case 'b': |
| str += '\b'; |
| break; |
| case 'f': |
| str += '\f'; |
| break; |
| case 'v': |
| str += '\x0B'; |
| break; |
| case '8': |
| case '9': |
| str += ch; |
| tolerateUnexpectedToken(); |
| break; |
| |
| default: |
| if (isOctalDigit(ch)) { |
| octToDec = octalToDecimal(ch); |
| |
| octal = octToDec.octal || octal; |
| str += String.fromCharCode(octToDec.code); |
| } else { |
| str += ch; |
| } |
| break; |
| } |
| } else { |
| ++lineNumber; |
| if (ch === '\r' && source[index] === '\n') { |
| ++index; |
| } |
| lineStart = index; |
| } |
| } else if (isLineTerminator(ch.charCodeAt(0))) { |
| break; |
| } else { |
| str += ch; |
| } |
| } |
| |
| if (quote !== '') { |
| throwUnexpectedToken(); |
| } |
| |
| return { |
| type: Token.StringLiteral, |
| value: str, |
| octal: octal, |
| lineNumber: startLineNumber, |
| lineStart: startLineStart, |
| start: start, |
| end: index |
| }; |
| } |
| |
| // ECMA-262 11.8.6 Template Literal Lexical Components |
| |
| function scanTemplate() { |
| var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped; |
| |
| terminated = false; |
| tail = false; |
| start = index; |
| head = (source[index] === '`'); |
| rawOffset = 2; |
| |
| ++index; |
| |
| while (index < length) { |
| ch = source[index++]; |
| if (ch === '`') { |
| rawOffset = 1; |
| tail = true; |
| terminated = true; |
| break; |
| } else if (ch === '$') { |
| if (source[index] === '{') { |
| state.curlyStack.push('${'); |
| ++index; |
| terminated = true; |
| break; |
| } |
| cooked += ch; |
| } else if (ch === '\\') { |
| ch = source[index++]; |
| if (!isLineTerminator(ch.charCodeAt(0))) { |
| switch (ch) { |
| case 'n': |
| cooked += '\n'; |
| break; |
| case 'r': |
| cooked += '\r'; |
| break; |
| case 't': |
| cooked += '\t'; |
| break; |
| case 'u': |
| case 'x': |
| if (source[index] === '{') { |
| ++index; |
| cooked += scanUnicodeCodePointEscape(); |
| } else { |
| restore = index; |
| unescaped = scanHexEscape(ch); |
| if (unescaped) { |
| cooked += unescaped; |
| } else { |
| index = restore; |
| cooked += ch; |
| } |
| } |
| break; |
| case 'b': |
| cooked += '\b'; |
| break; |
| case 'f': |
| cooked += '\f'; |
| break; |
| case 'v': |
| cooked += '\v'; |
| break; |
| |
| default: |
| if (ch === '0') { |
| if (isDecimalDigit(source.charCodeAt(index))) { |
| // Illegal: \01 \02 and so on |
| throwError(Messages.TemplateOctalLiteral); |
| } |
| cooked += '\0'; |
| } else if (isOctalDigit(ch)) { |
| // Illegal: \1 \2 |
| throwError(Messages.TemplateOctalLiteral); |
| } else { |
| cooked += ch; |
| } |
| break; |
| } |
| } else { |
| ++lineNumber; |
| if (ch === '\r' && source[index] === '\n') { |
| ++index; |
| } |
| lineStart = index; |
| } |
| } else if (isLineTerminator(ch.charCodeAt(0))) { |
| ++lineNumber; |
| if (ch === '\r' && source[index] === '\n') { |
| ++index; |
| } |
| lineStart = index; |
| cooked += '\n'; |
| } else { |
| cooked += ch; |
| } |
| } |
| |
| if (!terminated) { |
| throwUnexpectedToken(); |
| } |
| |
| if (!head) { |
| state.curlyStack.pop(); |
| } |
| |
| return { |
| type: Token.Template, |
| value: { |
| cooked: cooked, |
| raw: source.slice(start + 1, index - rawOffset) |
| }, |
| head: head, |
| tail: tail, |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: start, |
| end: index |
| }; |
| } |
| |
| // ECMA-262 11.8.5 Regular Expression Literals |
| |
| function testRegExp(pattern, flags) { |
| // The BMP character to use as a replacement for astral symbols when |
| // translating an ES6 "u"-flagged pattern to an ES5-compatible |
| // approximation. |
| // Note: replacing with '\uFFFF' enables false positives in unlikely |
| // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid |
| // pattern that would not be detected by this substitution. |
| var astralSubstitute = '\uFFFF', |
| tmp = pattern; |
| |
| if (flags.indexOf('u') >= 0) { |
| tmp = tmp |
| // Replace every Unicode escape sequence with the equivalent |
| // BMP character or a constant ASCII code point in the case of |
| // astral symbols. (See the above note on `astralSubstitute` |
| // for more information.) |
| .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) { |
| var codePoint = parseInt($1 || $2, 16); |
| if (codePoint > 0x10FFFF) { |
| throwUnexpectedToken(null, Messages.InvalidRegExp); |
| } |
| if (codePoint <= 0xFFFF) { |
| return String.fromCharCode(codePoint); |
| } |
| return astralSubstitute; |
| }) |
| // Replace each paired surrogate with a single ASCII symbol to |
| // avoid throwing on regular expressions that are only valid in |
| // combination with the "u" flag. |
| .replace( |
| /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, |
| astralSubstitute |
| ); |
| } |
| |
| // First, detect invalid regular expressions. |
| try { |
| RegExp(tmp); |
| } catch (e) { |
| throwUnexpectedToken(null, Messages.InvalidRegExp); |
| } |
| |
| // Return a regular expression object for this pattern-flag pair, or |
| // `null` in case the current environment doesn't support the flags it |
| // uses. |
| try { |
| return new RegExp(pattern, flags); |
| } catch (exception) { |
| return null; |
| } |
| } |
| |
| function scanRegExpBody() { |
| var ch, str, classMarker, terminated, body; |
| |
| ch = source[index]; |
| assert(ch === '/', 'Regular expression literal must start with a slash'); |
| str = source[index++]; |
| |
| classMarker = false; |
| terminated = false; |
| while (index < length) { |
| ch = source[index++]; |
| str += ch; |
| if (ch === '\\') { |
| ch = source[index++]; |
| // ECMA-262 7.8.5 |
| if (isLineTerminator(ch.charCodeAt(0))) { |
| throwUnexpectedToken(null, Messages.UnterminatedRegExp); |
| } |
| str += ch; |
| } else if (isLineTerminator(ch.charCodeAt(0))) { |
| throwUnexpectedToken(null, Messages.UnterminatedRegExp); |
| } else if (classMarker) { |
| if (ch === ']') { |
| classMarker = false; |
| } |
| } else { |
| if (ch === '/') { |
| terminated = true; |
| break; |
| } else if (ch === '[') { |
| classMarker = true; |
| } |
| } |
| } |
| |
| if (!terminated) { |
| throwUnexpectedToken(null, Messages.UnterminatedRegExp); |
| } |
| |
| // Exclude leading and trailing slash. |
| body = str.substr(1, str.length - 2); |
| return { |
| value: body, |
| literal: str |
| }; |
| } |
| |
| function scanRegExpFlags() { |
| var ch, str, flags, restore; |
| |
| str = ''; |
| flags = ''; |
| while (index < length) { |
| ch = source[index]; |
| if (!isIdentifierPart(ch.charCodeAt(0))) { |
| break; |
| } |
| |
| ++index; |
| if (ch === '\\' && index < length) { |
| ch = source[index]; |
| if (ch === 'u') { |
| ++index; |
| restore = index; |
| ch = scanHexEscape('u'); |
| if (ch) { |
| flags += ch; |
| for (str += '\\u'; restore < index; ++restore) { |
| str += source[restore]; |
| } |
| } else { |
| index = restore; |
| flags += 'u'; |
| str += '\\u'; |
| } |
| tolerateUnexpectedToken(); |
| } else { |
| str += '\\'; |
| tolerateUnexpectedToken(); |
| } |
| } else { |
| flags += ch; |
| str += ch; |
| } |
| } |
| |
| return { |
| value: flags, |
| literal: str |
| }; |
| } |
| |
| function scanRegExp() { |
| var start, body, flags, value; |
| scanning = true; |
| |
| lookahead = null; |
| skipComment(); |
| start = index; |
| |
| body = scanRegExpBody(); |
| flags = scanRegExpFlags(); |
| value = testRegExp(body.value, flags.value); |
| scanning = false; |
| if (extra.tokenize) { |
| return { |
| type: Token.RegularExpression, |
| value: value, |
| regex: { |
| pattern: body.value, |
| flags: flags.value |
| }, |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: start, |
| end: index |
| }; |
| } |
| |
| return { |
| literal: body.literal + flags.literal, |
| value: value, |
| regex: { |
| pattern: body.value, |
| flags: flags.value |
| }, |
| start: start, |
| end: index |
| }; |
| } |
| |
| function collectRegex() { |
| var pos, loc, regex, token; |
| |
| skipComment(); |
| |
| pos = index; |
| loc = { |
| start: { |
| line: lineNumber, |
| column: index - lineStart |
| } |
| }; |
| |
| regex = scanRegExp(); |
| |
| loc.end = { |
| line: lineNumber, |
| column: index - lineStart |
| }; |
| |
| /* istanbul ignore next */ |
| if (!extra.tokenize) { |
| // Pop the previous token, which is likely '/' or '/=' |
| if (extra.tokens.length > 0) { |
| token = extra.tokens[extra.tokens.length - 1]; |
| if (token.range[0] === pos && token.type === 'Punctuator') { |
| if (token.value === '/' || token.value === '/=') { |
| extra.tokens.pop(); |
| } |
| } |
| } |
| |
| extra.tokens.push({ |
| type: 'RegularExpression', |
| value: regex.literal, |
| regex: regex.regex, |
| range: [pos, index], |
| loc: loc |
| }); |
| } |
| |
| return regex; |
| } |
| |
| function isIdentifierName(token) { |
| return token.type === Token.Identifier || |
| token.type === Token.Keyword || |
| token.type === Token.BooleanLiteral || |
| token.type === Token.NullLiteral; |
| } |
| |
| // Using the following algorithm: |
| // https://github.com/mozilla/sweet.js/wiki/design |
| |
| function advanceSlash() { |
| var regex, previous, check; |
| |
| function testKeyword(value) { |
| return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z'); |
| } |
| |
| previous = extra.tokenValues[extra.tokens.length - 1]; |
| regex = (previous !== null); |
| |
| switch (previous) { |
| case 'this': |
| case ']': |
| regex = false; |
| break; |
| |
| case ')': |
| check = extra.tokenValues[extra.openParenToken - 1]; |
| regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with'); |
| break; |
| |
| case '}': |
| // Dividing a function by anything makes little sense, |
| // but we have to check for that. |
| regex = false; |
| if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) { |
| // Anonymous function, e.g. function(){} /42 |
| check = extra.tokenValues[extra.openCurlyToken - 4]; |
| regex = check ? (FnExprTokens.indexOf(check) < 0) : false; |
| } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) { |
| // Named function, e.g. function f(){} /42/ |
| check = extra.tokenValues[extra.openCurlyToken - 5]; |
| regex = check ? (FnExprTokens.indexOf(check) < 0) : true; |
| } |
| } |
| |
| return regex ? collectRegex() : scanPunctuator(); |
| } |
| |
| function advance() { |
| var cp, token; |
| |
| if (index >= length) { |
| return { |
| type: Token.EOF, |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| start: index, |
| end: index |
| }; |
| } |
| |
| cp = source.charCodeAt(index); |
| |
| if (isIdentifierStart(cp)) { |
| token = scanIdentifier(); |
| if (strict && isStrictModeReservedWord(token.value)) { |
| token.type = Token.Keyword; |
| } |
| return token; |
| } |
| |
| // Very common: ( and ) and ; |
| if (cp === 0x28 || cp === 0x29 || cp === 0x3B) { |
| return scanPunctuator(); |
| } |
| |
| // String literal starts with single quote (U+0027) or double quote (U+0022). |
| if (cp === 0x27 || cp === 0x22) { |
| return scanStringLiteral(); |
| } |
| |
| // Dot (.) U+002E can also start a floating-point number, hence the need |
| // to check the next character. |
| if (cp === 0x2E) { |
| if (isDecimalDigit(source.charCodeAt(index + 1))) { |
| return scanNumericLiteral(); |
| } |
| return scanPunctuator(); |
| } |
| |
| if (isDecimalDigit(cp)) { |
| return scanNumericLiteral(); |
| } |
| |
| // Slash (/) U+002F can also start a regex. |
| if (extra.tokenize && cp === 0x2F) { |
| return advanceSlash(); |
| } |
| |
| // Template literals start with ` (U+0060) for template head |
| // or } (U+007D) for template middle or template tail. |
| if (cp === 0x60 || (cp === 0x7D && state.curlyStack[state.curlyStack.length - 1] === '${')) { |
| return scanTemplate(); |
| } |
| |
| // Possible identifier start in a surrogate pair. |
| if (cp >= 0xD800 && cp < 0xDFFF) { |
| cp = codePointAt(index); |
| if (isIdentifierStart(cp)) { |
| return scanIdentifier(); |
| } |
| } |
| |
| return scanPunctuator(); |
| } |
| |
| function collectToken() { |
| var loc, token, value, entry; |
| |
| loc = { |
| start: { |
| line: lineNumber, |
| column: index - lineStart |
| } |
| }; |
| |
| token = advance(); |
| loc.end = { |
| line: lineNumber, |
| column: index - lineStart |
| }; |
| |
| if (token.type !== Token.EOF) { |
| value = source.slice(token.start, token.end); |
| entry = { |
| type: TokenName[token.type], |
| value: value, |
| range: [token.start, token.end], |
| loc: loc |
| }; |
| if (token.regex) { |
| entry.regex = { |
| pattern: token.regex.pattern, |
| flags: token.regex.flags |
| }; |
| } |
| if (extra.tokenValues) { |
| extra.tokenValues.push((entry.type === 'Punctuator' || entry.type === 'Keyword') ? entry.value : null); |
| } |
| if (extra.tokenize) { |
| if (!extra.range) { |
| delete entry.range; |
| } |
| if (!extra.loc) { |
| delete entry.loc; |
| } |
| if (extra.delegate) { |
| entry = extra.delegate(entry); |
| } |
| } |
| extra.tokens.push(entry); |
| } |
| |
| return token; |
| } |
| |
| function lex() { |
| var token; |
| scanning = true; |
| |
| lastIndex = index; |
| lastLineNumber = lineNumber; |
| lastLineStart = lineStart; |
| |
| skipComment(); |
| |
| token = lookahead; |
| |
| startIndex = index; |
| startLineNumber = lineNumber; |
| startLineStart = lineStart; |
| |
| lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); |
| scanning = false; |
| return token; |
| } |
| |
| function peek() { |
| scanning = true; |
| |
| skipComment(); |
| |
| lastIndex = index; |
| lastLineNumber = lineNumber; |
| lastLineStart = lineStart; |
| |
| startIndex = index; |
| startLineNumber = lineNumber; |
| startLineStart = lineStart; |
| |
| lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); |
| scanning = false; |
| } |
| |
| function Position() { |
| this.line = startLineNumber; |
| this.column = startIndex - startLineStart; |
| } |
| |
| function SourceLocation() { |
| this.start = new Position(); |
| this.end = null; |
| } |
| |
| function WrappingSourceLocation(startToken) { |
| this.start = { |
| line: startToken.lineNumber, |
| column: startToken.start - startToken.lineStart |
| }; |
| this.end = null; |
| } |
| |
| function Node() { |
| if (extra.range) { |
| this.range = [startIndex, 0]; |
| } |
| if (extra.loc) { |
| this.loc = new SourceLocation(); |
| } |
| } |
| |
| function WrappingNode(startToken) { |
| if (extra.range) { |
| this.range = [startToken.start, 0]; |
| } |
| if (extra.loc) { |
| this.loc = new WrappingSourceLocation(startToken); |
| } |
| } |
| |
| WrappingNode.prototype = Node.prototype = { |
| |
| processComment: function () { |
| var lastChild, |
| innerComments, |
| leadingComments, |
| trailingComments, |
| bottomRight = extra.bottomRightStack, |
| i, |
| comment, |
| last = bottomRight[bottomRight.length - 1]; |
| |
| if (this.type === Syntax.Program) { |
| if (this.body.length > 0) { |
| return; |
| } |
| } |
| /** |
| * patch innnerComments for properties empty block |
| * `function a() {/** comments **\/}` |
| */ |
| |
| if (this.type === Syntax.BlockStatement && this.body.length === 0) { |
| innerComments = []; |
| for (i = extra.leadingComments.length - 1; i >= 0; --i) { |
| comment = extra.leadingComments[i]; |
| if (this.range[1] >= comment.range[1]) { |
| innerComments.unshift(comment); |
| extra.leadingComments.splice(i, 1); |
| extra.trailingComments.splice(i, 1); |
| } |
| } |
| if (innerComments.length) { |
| this.innerComments = innerComments; |
| //bottomRight.push(this); |
| return; |
| } |
| } |
| |
| if (extra.trailingComments.length > 0) { |
| trailingComments = []; |
| for (i = extra.trailingComments.length - 1; i >= 0; --i) { |
| comment = extra.trailingComments[i]; |
| if (comment.range[0] >= this.range[1]) { |
| trailingComments.unshift(comment); |
| extra.trailingComments.splice(i, 1); |
| } |
| } |
| extra.trailingComments = []; |
| } else { |
| if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) { |
| trailingComments = last.trailingComments; |
| delete last.trailingComments; |
| } |
| } |
| |
| // Eating the stack. |
| while (last && last.range[0] >= this.range[0]) { |
| lastChild = bottomRight.pop(); |
| last = bottomRight[bottomRight.length - 1]; |
| } |
| |
| if (lastChild) { |
| if (lastChild.leadingComments) { |
| leadingComments = []; |
| for (i = lastChild.leadingComments.length - 1; i >= 0; --i) { |
| comment = lastChild.leadingComments[i]; |
| if (comment.range[1] <= this.range[0]) { |
| leadingComments.unshift(comment); |
| lastChild.leadingComments.splice(i, 1); |
| } |
| } |
| |
| if (!lastChild.leadingComments.length) { |
| lastChild.leadingComments = undefined; |
| } |
| } |
| } else if (extra.leadingComments.length > 0) { |
| leadingComments = []; |
| for (i = extra.leadingComments.length - 1; i >= 0; --i) { |
| comment = extra.leadingComments[i]; |
| if (comment.range[1] <= this.range[0]) { |
| leadingComments.unshift(comment); |
| extra.leadingComments.splice(i, 1); |
| } |
| } |
| } |
| |
| |
| if (leadingComments && leadingComments.length > 0) { |
| this.leadingComments = leadingComments; |
| } |
| if (trailingComments && trailingComments.length > 0) { |
| this.trailingComments = trailingComments; |
| } |
| |
| bottomRight.push(this); |
| }, |
| |
| finish: function () { |
| if (extra.range) { |
| this.range[1] = lastIndex; |
| } |
| if (extra.loc) { |
| this.loc.end = { |
| line: lastLineNumber, |
| column: lastIndex - lastLineStart |
| }; |
| if (extra.source) { |
| this.loc.source = extra.source; |
| } |
| } |
| |
| if (extra.attachComment) { |
| this.processComment(); |
| } |
| }, |
| |
| finishArrayExpression: function (elements) { |
| this.type = Syntax.ArrayExpression; |
| this.elements = elements; |
| this.finish(); |
| return this; |
| }, |
| |
| finishArrayPattern: function (elements) { |
| this.type = Syntax.ArrayPattern; |
| this.elements = elements; |
| this.finish(); |
| return this; |
| }, |
| |
| finishArrowFunctionExpression: function (params, defaults, body, expression) { |
| this.type = Syntax.ArrowFunctionExpression; |
| this.id = null; |
| this.params = params; |
| this.defaults = defaults; |
| this.body = body; |
| this.generator = false; |
| this.expression = expression; |
| this.finish(); |
| return this; |
| }, |
| |
| finishAssignmentExpression: function (operator, left, right) { |
| this.type = Syntax.AssignmentExpression; |
| this.operator = operator; |
| this.left = left; |
| this.right = right; |
| this.finish(); |
| return this; |
| }, |
| |
| finishAssignmentPattern: function (left, right) { |
| this.type = Syntax.AssignmentPattern; |
| this.left = left; |
| this.right = right; |
| this.finish(); |
| return this; |
| }, |
| |
| finishBinaryExpression: function (operator, left, right) { |
| this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression; |
| this.operator = operator; |
| this.left = left; |
| this.right = right; |
| this.finish(); |
| return this; |
| }, |
| |
| finishBlockStatement: function (body) { |
| this.type = Syntax.BlockStatement; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishBreakStatement: function (label) { |
| this.type = Syntax.BreakStatement; |
| this.label = label; |
| this.finish(); |
| return this; |
| }, |
| |
| finishCallExpression: function (callee, args) { |
| this.type = Syntax.CallExpression; |
| this.callee = callee; |
| this.arguments = args; |
| this.finish(); |
| return this; |
| }, |
| |
| finishCatchClause: function (param, body) { |
| this.type = Syntax.CatchClause; |
| this.param = param; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishClassBody: function (body) { |
| this.type = Syntax.ClassBody; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishClassDeclaration: function (id, superClass, body) { |
| this.type = Syntax.ClassDeclaration; |
| this.id = id; |
| this.superClass = superClass; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishClassExpression: function (id, superClass, body) { |
| this.type = Syntax.ClassExpression; |
| this.id = id; |
| this.superClass = superClass; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishConditionalExpression: function (test, consequent, alternate) { |
| this.type = Syntax.ConditionalExpression; |
| this.test = test; |
| this.consequent = consequent; |
| this.alternate = alternate; |
| this.finish(); |
| return this; |
| }, |
| |
| finishContinueStatement: function (label) { |
| this.type = Syntax.ContinueStatement; |
| this.label = label; |
| this.finish(); |
| return this; |
| }, |
| |
| finishDebuggerStatement: function () { |
| this.type = Syntax.DebuggerStatement; |
| this.finish(); |
| return this; |
| }, |
| |
| finishDoWhileStatement: function (body, test) { |
| this.type = Syntax.DoWhileStatement; |
| this.body = body; |
| this.test = test; |
| this.finish(); |
| return this; |
| }, |
| |
| finishEmptyStatement: function () { |
| this.type = Syntax.EmptyStatement; |
| this.finish(); |
| return this; |
| }, |
| |
| finishExpressionStatement: function (expression) { |
| this.type = Syntax.ExpressionStatement; |
| this.expression = expression; |
| this.finish(); |
| return this; |
| }, |
| |
| finishForStatement: function (init, test, update, body) { |
| this.type = Syntax.ForStatement; |
| this.init = init; |
| this.test = test; |
| this.update = update; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishForOfStatement: function (left, right, body) { |
| this.type = Syntax.ForOfStatement; |
| this.left = left; |
| this.right = right; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishForInStatement: function (left, right, body) { |
| this.type = Syntax.ForInStatement; |
| this.left = left; |
| this.right = right; |
| this.body = body; |
| this.each = false; |
| this.finish(); |
| return this; |
| }, |
| |
| finishFunctionDeclaration: function (id, params, defaults, body, generator) { |
| this.type = Syntax.FunctionDeclaration; |
| this.id = id; |
| this.params = params; |
| this.defaults = defaults; |
| this.body = body; |
| this.generator = generator; |
| this.expression = false; |
| this.finish(); |
| return this; |
| }, |
| |
| finishFunctionExpression: function (id, params, defaults, body, generator) { |
| this.type = Syntax.FunctionExpression; |
| this.id = id; |
| this.params = params; |
| this.defaults = defaults; |
| this.body = body; |
| this.generator = generator; |
| this.expression = false; |
| this.finish(); |
| return this; |
| }, |
| |
| finishIdentifier: function (name) { |
| this.type = Syntax.Identifier; |
| this.name = name; |
| this.finish(); |
| return this; |
| }, |
| |
| finishIfStatement: function (test, consequent, alternate) { |
| this.type = Syntax.IfStatement; |
| this.test = test; |
| this.consequent = consequent; |
| this.alternate = alternate; |
| this.finish(); |
| return this; |
| }, |
| |
| finishLabeledStatement: function (label, body) { |
| this.type = Syntax.LabeledStatement; |
| this.label = label; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishLiteral: function (token) { |
| this.type = Syntax.Literal; |
| this.value = token.value; |
| this.raw = source.slice(token.start, token.end); |
| if (token.regex) { |
| this.regex = token.regex; |
| } |
| this.finish(); |
| return this; |
| }, |
| |
| finishMemberExpression: function (accessor, object, property) { |
| this.type = Syntax.MemberExpression; |
| this.computed = accessor === '['; |
| this.object = object; |
| this.property = property; |
| this.finish(); |
| return this; |
| }, |
| |
| finishMetaProperty: function (meta, property) { |
| this.type = Syntax.MetaProperty; |
| this.meta = meta; |
| this.property = property; |
| this.finish(); |
| return this; |
| }, |
| |
| finishNewExpression: function (callee, args) { |
| this.type = Syntax.NewExpression; |
| this.callee = callee; |
| this.arguments = args; |
| this.finish(); |
| return this; |
| }, |
| |
| finishObjectExpression: function (properties) { |
| this.type = Syntax.ObjectExpression; |
| this.properties = properties; |
| this.finish(); |
| return this; |
| }, |
| |
| finishObjectPattern: function (properties) { |
| this.type = Syntax.ObjectPattern; |
| this.properties = properties; |
| this.finish(); |
| return this; |
| }, |
| |
| finishPostfixExpression: function (operator, argument) { |
| this.type = Syntax.UpdateExpression; |
| this.operator = operator; |
| this.argument = argument; |
| this.prefix = false; |
| this.finish(); |
| return this; |
| }, |
| |
| finishProgram: function (body, sourceType) { |
| this.type = Syntax.Program; |
| this.body = body; |
| this.sourceType = sourceType; |
| this.finish(); |
| return this; |
| }, |
| |
| finishProperty: function (kind, key, computed, value, method, shorthand) { |
| this.type = Syntax.Property; |
| this.key = key; |
| this.computed = computed; |
| this.value = value; |
| this.kind = kind; |
| this.method = method; |
| this.shorthand = shorthand; |
| this.finish(); |
| return this; |
| }, |
| |
| finishRestElement: function (argument) { |
| this.type = Syntax.RestElement; |
| this.argument = argument; |
| this.finish(); |
| return this; |
| }, |
| |
| finishReturnStatement: function (argument) { |
| this.type = Syntax.ReturnStatement; |
| this.argument = argument; |
| this.finish(); |
| return this; |
| }, |
| |
| finishSequenceExpression: function (expressions) { |
| this.type = Syntax.SequenceExpression; |
| this.expressions = expressions; |
| this.finish(); |
| return this; |
| }, |
| |
| finishSpreadElement: function (argument) { |
| this.type = Syntax.SpreadElement; |
| this.argument = argument; |
| this.finish(); |
| return this; |
| }, |
| |
| finishSwitchCase: function (test, consequent) { |
| this.type = Syntax.SwitchCase; |
| this.test = test; |
| this.consequent = consequent; |
| this.finish(); |
| return this; |
| }, |
| |
| finishSuper: function () { |
| this.type = Syntax.Super; |
| this.finish(); |
| return this; |
| }, |
| |
| finishSwitchStatement: function (discriminant, cases) { |
| this.type = Syntax.SwitchStatement; |
| this.discriminant = discriminant; |
| this.cases = cases; |
| this.finish(); |
| return this; |
| }, |
| |
| finishTaggedTemplateExpression: function (tag, quasi) { |
| this.type = Syntax.TaggedTemplateExpression; |
| this.tag = tag; |
| this.quasi = quasi; |
| this.finish(); |
| return this; |
| }, |
| |
| finishTemplateElement: function (value, tail) { |
| this.type = Syntax.TemplateElement; |
| this.value = value; |
| this.tail = tail; |
| this.finish(); |
| return this; |
| }, |
| |
| finishTemplateLiteral: function (quasis, expressions) { |
| this.type = Syntax.TemplateLiteral; |
| this.quasis = quasis; |
| this.expressions = expressions; |
| this.finish(); |
| return this; |
| }, |
| |
| finishThisExpression: function () { |
| this.type = Syntax.ThisExpression; |
| this.finish(); |
| return this; |
| }, |
| |
| finishThrowStatement: function (argument) { |
| this.type = Syntax.ThrowStatement; |
| this.argument = argument; |
| this.finish(); |
| return this; |
| }, |
| |
| finishTryStatement: function (block, handler, finalizer) { |
| this.type = Syntax.TryStatement; |
| this.block = block; |
| this.guardedHandlers = []; |
| this.handlers = handler ? [handler] : []; |
| this.handler = handler; |
| this.finalizer = finalizer; |
| this.finish(); |
| return this; |
| }, |
| |
| finishUnaryExpression: function (operator, argument) { |
| this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression; |
| this.operator = operator; |
| this.argument = argument; |
| this.prefix = true; |
| this.finish(); |
| return this; |
| }, |
| |
| finishVariableDeclaration: function (declarations) { |
| this.type = Syntax.VariableDeclaration; |
| this.declarations = declarations; |
| this.kind = 'var'; |
| this.finish(); |
| return this; |
| }, |
| |
| finishLexicalDeclaration: function (declarations, kind) { |
| this.type = Syntax.VariableDeclaration; |
| this.declarations = declarations; |
| this.kind = kind; |
| this.finish(); |
| return this; |
| }, |
| |
| finishVariableDeclarator: function (id, init) { |
| this.type = Syntax.VariableDeclarator; |
| this.id = id; |
| this.init = init; |
| this.finish(); |
| return this; |
| }, |
| |
| finishWhileStatement: function (test, body) { |
| this.type = Syntax.WhileStatement; |
| this.test = test; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishWithStatement: function (object, body) { |
| this.type = Syntax.WithStatement; |
| this.object = object; |
| this.body = body; |
| this.finish(); |
| return this; |
| }, |
| |
| finishExportSpecifier: function (local, exported) { |
| this.type = Syntax.ExportSpecifier; |
| this.exported = exported || local; |
| this.local = local; |
| this.finish(); |
| return this; |
| }, |
| |
| finishImportDefaultSpecifier: function (local) { |
| this.type = Syntax.ImportDefaultSpecifier; |
| this.local = local; |
| this.finish(); |
| return this; |
| }, |
| |
| finishImportNamespaceSpecifier: function (local) { |
| this.type = Syntax.ImportNamespaceSpecifier; |
| this.local = local; |
| this.finish(); |
| return this; |
| }, |
| |
| finishExportNamedDeclaration: function (declaration, specifiers, src) { |
| this.type = Syntax.ExportNamedDeclaration; |
| this.declaration = declaration; |
| this.specifiers = specifiers; |
| this.source = src; |
| this.finish(); |
| return this; |
| }, |
| |
| finishExportDefaultDeclaration: function (declaration) { |
| this.type = Syntax.ExportDefaultDeclaration; |
| this.declaration = declaration; |
| this.finish(); |
| return this; |
| }, |
| |
| finishExportAllDeclaration: function (src) { |
| this.type = Syntax.ExportAllDeclaration; |
| this.source = src; |
| this.finish(); |
| return this; |
| }, |
| |
| finishImportSpecifier: function (local, imported) { |
| this.type = Syntax.ImportSpecifier; |
| this.local = local || imported; |
| this.imported = imported; |
| this.finish(); |
| return this; |
| }, |
| |
| finishImportDeclaration: function (specifiers, src) { |
| this.type = Syntax.ImportDeclaration; |
| this.specifiers = specifiers; |
| this.source = src; |
| this.finish(); |
| return this; |
| }, |
| |
| finishYieldExpression: function (argument, delegate) { |
| this.type = Syntax.YieldExpression; |
| this.argument = argument; |
| this.delegate = delegate; |
| this.finish(); |
| return this; |
| } |
| }; |
| |
| |
| function recordError(error) { |
| var e, existing; |
| |
| for (e = 0; e < extra.errors.length; e++) { |
| existing = extra.errors[e]; |
| // Prevent duplicated error. |
| /* istanbul ignore next */ |
| if (existing.index === error.index && existing.message === error.message) { |
| return; |
| } |
| } |
| |
| extra.errors.push(error); |
| } |
| |
| function constructError(msg, column) { |
| var error = new Error(msg); |
| try { |
| throw error; |
| } catch (base) { |
| /* istanbul ignore else */ |
| if (Object.create && Object.defineProperty) { |
| error = Object.create(base); |
| Object.defineProperty(error, 'column', { value: column }); |
| } |
| } finally { |
| return error; |
| } |
| } |
| |
| function createError(line, pos, description) { |
| var msg, column, error; |
| |
| msg = 'Line ' + line + ': ' + description; |
| column = pos - (scanning ? lineStart : lastLineStart) + 1; |
| error = constructError(msg, column); |
| error.lineNumber = line; |
| error.description = description; |
| error.index = pos; |
| return error; |
| } |
| |
| // Throw an exception |
| |
| function throwError(messageFormat) { |
| var args, msg; |
| |
| args = Array.prototype.slice.call(arguments, 1); |
| msg = messageFormat.replace(/%(\d)/g, |
| function (whole, idx) { |
| assert(idx < args.length, 'Message reference must be in range'); |
| return args[idx]; |
| } |
| ); |
| |
| throw createError(lastLineNumber, lastIndex, msg); |
| } |
| |
| function tolerateError(messageFormat) { |
| var args, msg, error; |
| |
| args = Array.prototype.slice.call(arguments, 1); |
| /* istanbul ignore next */ |
| msg = messageFormat.replace(/%(\d)/g, |
| function (whole, idx) { |
| assert(idx < args.length, 'Message reference must be in range'); |
| return args[idx]; |
| } |
| ); |
| |
| error = createError(lineNumber, lastIndex, msg); |
| if (extra.errors) { |
| recordError(error); |
| } else { |
| throw error; |
| } |
| } |
| |
| // Throw an exception because of the token. |
| |
| function unexpectedTokenError(token, message) { |
| var value, msg = message || Messages.UnexpectedToken; |
| |
| if (token) { |
| if (!message) { |
| msg = (token.type === Token.EOF) ? Messages.UnexpectedEOS : |
| (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier : |
| (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber : |
| (token.type === Token.StringLiteral) ? Messages.UnexpectedString : |
| (token.type === Token.Template) ? Messages.UnexpectedTemplate : |
| Messages.UnexpectedToken; |
| |
| if (token.type === Token.Keyword) { |
| if (isFutureReservedWord(token.value)) { |
| msg = Messages.UnexpectedReserved; |
| } else if (strict && isStrictModeReservedWord(token.value)) { |
| msg = Messages.StrictReservedWord; |
| } |
| } |
| } |
| |
| value = (token.type === Token.Template) ? token.value.raw : token.value; |
| } else { |
| value = 'ILLEGAL'; |
| } |
| |
| msg = msg.replace('%0', value); |
| |
| return (token && typeof token.lineNumber === 'number') ? |
| createError(token.lineNumber, token.start, msg) : |
| createError(scanning ? lineNumber : lastLineNumber, scanning ? index : lastIndex, msg); |
| } |
| |
| function throwUnexpectedToken(token, message) { |
| throw unexpectedTokenError(token, message); |
| } |
| |
| function tolerateUnexpectedToken(token, message) { |
| var error = unexpectedTokenError(token, message); |
| if (extra.errors) { |
| recordError(error); |
| } else { |
| throw error; |
| } |
| } |
| |
| // Expect the next token to match the specified punctuator. |
| // If not, an exception will be thrown. |
| |
| function expect(value) { |
| var token = lex(); |
| if (token.type !== Token.Punctuator || token.value !== value) { |
| throwUnexpectedToken(token); |
| } |
| } |
| |
| /** |
| * @name expectCommaSeparator |
| * @description Quietly expect a comma when in tolerant mode, otherwise delegates |
| * to <code>expect(value)</code> |
| * @since 2.0 |
| */ |
| function expectCommaSeparator() { |
| var token; |
| |
| if (extra.errors) { |
| token = lookahead; |
| if (token.type === Token.Punctuator && token.value === ',') { |
| lex(); |
| } else if (token.type === Token.Punctuator && token.value === ';') { |
| lex(); |
| tolerateUnexpectedToken(token); |
| } else { |
| tolerateUnexpectedToken(token, Messages.UnexpectedToken); |
| } |
| } else { |
| expect(','); |
| } |
| } |
| |
| // Expect the next token to match the specified keyword. |
| // If not, an exception will be thrown. |
| |
| function expectKeyword(keyword) { |
| var token = lex(); |
| if (token.type !== Token.Keyword || token.value !== keyword) { |
| throwUnexpectedToken(token); |
| } |
| } |
| |
| // Return true if the next token matches the specified punctuator. |
| |
| function match(value) { |
| return lookahead.type === Token.Punctuator && lookahead.value === value; |
| } |
| |
| // Return true if the next token matches the specified keyword |
| |
| function matchKeyword(keyword) { |
| return lookahead.type === Token.Keyword && lookahead.value === keyword; |
| } |
| |
| // Return true if the next token matches the specified contextual keyword |
| // (where an identifier is sometimes a keyword depending on the context) |
| |
| function matchContextualKeyword(keyword) { |
| return lookahead.type === Token.Identifier && lookahead.value === keyword; |
| } |
| |
| // Return true if the next token is an assignment operator |
| |
| function matchAssign() { |
| var op; |
| |
| if (lookahead.type !== Token.Punctuator) { |
| return false; |
| } |
| op = lookahead.value; |
| return op === '=' || |
| op === '*=' || |
| op === '/=' || |
| op === '%=' || |
| op === '+=' || |
| op === '-=' || |
| op === '<<=' || |
| op === '>>=' || |
| op === '>>>=' || |
| op === '&=' || |
| op === '^=' || |
| op === '|='; |
| } |
| |
| function consumeSemicolon() { |
| // Catch the very common case first: immediately a semicolon (U+003B). |
| if (source.charCodeAt(startIndex) === 0x3B || match(';')) { |
| lex(); |
| return; |
| } |
| |
| if (hasLineTerminator) { |
| return; |
| } |
| |
| // FIXME(ikarienator): this is seemingly an issue in the previous location info convention. |
| lastIndex = startIndex; |
| lastLineNumber = startLineNumber; |
| lastLineStart = startLineStart; |
| |
| if (lookahead.type !== Token.EOF && !match('}')) { |
| throwUnexpectedToken(lookahead); |
| } |
| } |
| |
| // Cover grammar support. |
| // |
| // When an assignment expression position starts with an left parenthesis, the determination of the type |
| // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) |
| // or the first comma. This situation also defers the determination of all the expressions nested in the pair. |
| // |
| // There are three productions that can be parsed in a parentheses pair that needs to be determined |
| // after the outermost pair is closed. They are: |
| // |
| // 1. AssignmentExpression |
| // 2. BindingElements |
| // 3. AssignmentTargets |
| // |
| // In order to avoid exponential backtracking, we use two flags to denote if the production can be |
| // binding element or assignment target. |
| // |
| // The three productions have the relationship: |
| // |
| // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression |
| // |
| // with a single exception that CoverInitializedName when used directly in an Expression, generates |
| // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the |
| // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. |
| // |
| // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not |
| // effect the current flags. This means the production the parser parses is only used as an expression. Therefore |
| // the CoverInitializedName check is conducted. |
| // |
| // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates |
| // the flags outside of the parser. This means the production the parser parses is used as a part of a potential |
| // pattern. The CoverInitializedName check is deferred. |
| function isolateCoverGrammar(parser) { |
| var oldIsBindingElement = isBindingElement, |
| oldIsAssignmentTarget = isAssignmentTarget, |
| oldFirstCoverInitializedNameError = firstCoverInitializedNameError, |
| result; |
| isBindingElement = true; |
| isAssignmentTarget = true; |
| firstCoverInitializedNameError = null; |
| result = parser(); |
| if (firstCoverInitializedNameError !== null) { |
| throwUnexpectedToken(firstCoverInitializedNameError); |
| } |
| isBindingElement = oldIsBindingElement; |
| isAssignmentTarget = oldIsAssignmentTarget; |
| firstCoverInitializedNameError = oldFirstCoverInitializedNameError; |
| return result; |
| } |
| |
| function inheritCoverGrammar(parser) { |
| var oldIsBindingElement = isBindingElement, |
| oldIsAssignmentTarget = isAssignmentTarget, |
| oldFirstCoverInitializedNameError = firstCoverInitializedNameError, |
| result; |
| isBindingElement = true; |
| isAssignmentTarget = true; |
| firstCoverInitializedNameError = null; |
| result = parser(); |
| isBindingElement = isBindingElement && oldIsBindingElement; |
| isAssignmentTarget = isAssignmentTarget && oldIsAssignmentTarget; |
| firstCoverInitializedNameError = oldFirstCoverInitializedNameError || firstCoverInitializedNameError; |
| return result; |
| } |
| |
| // ECMA-262 13.3.3 Destructuring Binding Patterns |
| |
| function parseArrayPattern(params, kind) { |
| var node = new Node(), elements = [], rest, restNode; |
| expect('['); |
| |
| while (!match(']')) { |
| if (match(',')) { |
| lex(); |
| elements.push(null); |
| } else { |
| if (match('...')) { |
| restNode = new Node(); |
| lex(); |
| params.push(lookahead); |
| rest = parseVariableIdentifier(kind); |
| elements.push(restNode.finishRestElement(rest)); |
| break; |
| } else { |
| elements.push(parsePatternWithDefault(params, kind)); |
| } |
| if (!match(']')) { |
| expect(','); |
| } |
| } |
| |
| } |
| |
| expect(']'); |
| |
| return node.finishArrayPattern(elements); |
| } |
| |
| function parsePropertyPattern(params, kind) { |
| var node = new Node(), key, keyToken, computed = match('['), init; |
| if (lookahead.type === Token.Identifier) { |
| keyToken = lookahead; |
| key = parseVariableIdentifier(); |
| if (match('=')) { |
| params.push(keyToken); |
| lex(); |
| init = parseAssignmentExpression(); |
| |
| return node.finishProperty( |
| 'init', key, false, |
| new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, false); |
| } else if (!match(':')) { |
| params.push(keyToken); |
| return node.finishProperty('init', key, false, key, false, true); |
| } |
| } else { |
| key = parseObjectPropertyKey(); |
| } |
| expect(':'); |
| init = parsePatternWithDefault(params, kind); |
| return node.finishProperty('init', key, computed, init, false, false); |
| } |
| |
| function parseObjectPattern(params, kind) { |
| var node = new Node(), properties = []; |
| |
| expect('{'); |
| |
| while (!match('}')) { |
| properties.push(parsePropertyPattern(params, kind)); |
| if (!match('}')) { |
| expect(','); |
| } |
| } |
| |
| lex(); |
| |
| return node.finishObjectPattern(properties); |
| } |
| |
| function parsePattern(params, kind) { |
| if (match('[')) { |
| return parseArrayPattern(params, kind); |
| } else if (match('{')) { |
| return parseObjectPattern(params, kind); |
| } else if (matchKeyword('let')) { |
| if (kind === 'const' || kind === 'let') { |
| tolerateUnexpectedToken(lookahead, Messages.UnexpectedToken); |
| } |
| } |
| |
| params.push(lookahead); |
| return parseVariableIdentifier(kind); |
| } |
| |
| function parsePatternWithDefault(params, kind) { |
| var startToken = lookahead, pattern, previousAllowYield, right; |
| pattern = parsePattern(params, kind); |
| if (match('=')) { |
| lex(); |
| previousAllowYield = state.allowYield; |
| state.allowYield = true; |
| right = isolateCoverGrammar(parseAssignmentExpression); |
| state.allowYield = previousAllowYield; |
| pattern = new WrappingNode(startToken).finishAssignmentPattern(pattern, right); |
| } |
| return pattern; |
| } |
| |
| // ECMA-262 12.2.5 Array Initializer |
| |
| function parseArrayInitializer() { |
| var elements = [], node = new Node(), restSpread; |
| |
| expect('['); |
| |
| while (!match(']')) { |
| if (match(',')) { |
| lex(); |
| elements.push(null); |
| } else if (match('...')) { |
| restSpread = new Node(); |
| lex(); |
| restSpread.finishSpreadElement(inheritCoverGrammar(parseAssignmentExpression)); |
| |
| if (!match(']')) { |
| isAssignmentTarget = isBindingElement = false; |
| expect(','); |
| } |
| elements.push(restSpread); |
| } else { |
| elements.push(inheritCoverGrammar(parseAssignmentExpression)); |
| |
| if (!match(']')) { |
| expect(','); |
| } |
| } |
| } |
| |
| lex(); |
| |
| return node.finishArrayExpression(elements); |
| } |
| |
| // ECMA-262 12.2.6 Object Initializer |
| |
| function parsePropertyFunction(node, paramInfo, isGenerator) { |
| var previousStrict, body; |
| |
| isAssignmentTarget = isBindingElement = false; |
| |
| previousStrict = strict; |
| body = isolateCoverGrammar(parseFunctionSourceElements); |
| |
| if (strict && paramInfo.firstRestricted) { |
| tolerateUnexpectedToken(paramInfo.firstRestricted, paramInfo.message); |
| } |
| if (strict && paramInfo.stricted) { |
| tolerateUnexpectedToken(paramInfo.stricted, paramInfo.message); |
| } |
| |
| strict = previousStrict; |
| return node.finishFunctionExpression(null, paramInfo.params, paramInfo.defaults, body, isGenerator); |
| } |
| |
| function parsePropertyMethodFunction() { |
| var params, method, node = new Node(), |
| previousAllowYield = state.allowYield; |
| |
| state.allowYield = false; |
| params = parseParams(); |
| state.allowYield = previousAllowYield; |
| |
| state.allowYield = false; |
| method = parsePropertyFunction(node, params, false); |
| state.allowYield = previousAllowYield; |
| |
| return method; |
| } |
| |
| function parseObjectPropertyKey() { |
| var token, node = new Node(), expr; |
| |
| token = lex(); |
| |
| // Note: This function is called only from parseObjectProperty(), where |
| // EOF and Punctuator tokens are already filtered out. |
| |
| switch (token.type) { |
| case Token.StringLiteral: |
| case Token.NumericLiteral: |
| if (strict && token.octal) { |
| tolerateUnexpectedToken(token, Messages.StrictOctalLiteral); |
| } |
| return node.finishLiteral(token); |
| case Token.Identifier: |
| case Token.BooleanLiteral: |
| case Token.NullLiteral: |
| case Token.Keyword: |
| return node.finishIdentifier(token.value); |
| case Token.Punctuator: |
| if (token.value === '[') { |
| expr = isolateCoverGrammar(parseAssignmentExpression); |
| expect(']'); |
| return expr; |
| } |
| break; |
| } |
| throwUnexpectedToken(token); |
| } |
| |
| function lookaheadPropertyName() { |
| switch (lookahead.type) { |
| case Token.Identifier: |
| case Token.StringLiteral: |
| case Token.BooleanLiteral: |
| case Token.NullLiteral: |
| case Token.NumericLiteral: |
| case Token.Keyword: |
| return true; |
| case Token.Punctuator: |
| return lookahead.value === '['; |
| } |
| return false; |
| } |
| |
| // This function is to try to parse a MethodDefinition as defined in 14.3. But in the case of object literals, |
| // it might be called at a position where there is in fact a short hand identifier pattern or a data property. |
| // This can only be determined after we consumed up to the left parentheses. |
| // |
| // In order to avoid back tracking, it returns `null` if the position is not a MethodDefinition and the caller |
| // is responsible to visit other options. |
| function tryParseMethodDefinition(token, key, computed, node) { |
| var value, options, methodNode, params, |
| previousAllowYield = state.allowYield; |
| |
| if (token.type === Token.Identifier) { |
| // check for `get` and `set`; |
| |
| if (token.value === 'get' && lookaheadPropertyName()) { |
| computed = match('['); |
| key = parseObjectPropertyKey(); |
| methodNode = new Node(); |
| expect('('); |
| expect(')'); |
| |
| state.allowYield = false; |
| value = parsePropertyFunction(methodNode, { |
| params: [], |
| defaults: [], |
| stricted: null, |
| firstRestricted: null, |
| message: null |
| }, false); |
| state.allowYield = previousAllowYield; |
| |
| return node.finishProperty('get', key, computed, value, false, false); |
| } else if (token.value === 'set' && lookaheadPropertyName()) { |
| computed = match('['); |
| key = parseObjectPropertyKey(); |
| methodNode = new Node(); |
| expect('('); |
| |
| options = { |
| params: [], |
| defaultCount: 0, |
| defaults: [], |
| firstRestricted: null, |
| paramSet: {} |
| }; |
| if (match(')')) { |
| tolerateUnexpectedToken(lookahead); |
| } else { |
| state.allowYield = false; |
| parseParam(options); |
| state.allowYield = previousAllowYield; |
| if (options.defaultCount === 0) { |
| options.defaults = []; |
| } |
| } |
| expect(')'); |
| |
| state.allowYield = false; |
| value = parsePropertyFunction(methodNode, options, false); |
| state.allowYield = previousAllowYield; |
| |
| return node.finishProperty('set', key, computed, value, false, false); |
| } |
| } else if (token.type === Token.Punctuator && token.value === '*' && lookaheadPropertyName()) { |
| computed = match('['); |
| key = parseObjectPropertyKey(); |
| methodNode = new Node(); |
| |
| state.allowYield = true; |
| params = parseParams(); |
| state.allowYield = previousAllowYield; |
| |
| state.allowYield = false; |
| value = parsePropertyFunction(methodNode, params, true); |
| state.allowYield = previousAllowYield; |
| |
| return node.finishProperty('init', key, computed, value, true, false); |
| } |
| |
| if (key && match('(')) { |
| value = parsePropertyMethodFunction(); |
| return node.finishProperty('init', key, computed, value, true, false); |
| } |
| |
| // Not a MethodDefinition. |
| return null; |
| } |
| |
| function parseObjectProperty(hasProto) { |
| var token = lookahead, node = new Node(), computed, key, maybeMethod, proto, value; |
| |
| computed = match('['); |
| if (match('*')) { |
| lex(); |
| } else { |
| key = parseObjectPropertyKey(); |
| } |
| maybeMethod = tryParseMethodDefinition(token, key, computed, node); |
| if (maybeMethod) { |
| return maybeMethod; |
| } |
| |
| if (!key) { |
| throwUnexpectedToken(lookahead); |
| } |
| |
| // Check for duplicated __proto__ |
| if (!computed) { |
| proto = (key.type === Syntax.Identifier && key.name === '__proto__') || |
| (key.type === Syntax.Literal && key.value === '__proto__'); |
| if (hasProto.value && proto) { |
| tolerateError(Messages.DuplicateProtoProperty); |
| } |
| hasProto.value |= proto; |
| } |
| |
| if (match(':')) { |
| lex(); |
| value = inheritCoverGrammar(parseAssignmentExpression); |
| return node.finishProperty('init', key, computed, value, false, false); |
| } |
| |
| if (token.type === Token.Identifier) { |
| if (match('=')) { |
| firstCoverInitializedNameError = lookahead; |
| lex(); |
| value = isolateCoverGrammar(parseAssignmentExpression); |
| return node.finishProperty('init', key, computed, |
| new WrappingNode(token).finishAssignmentPattern(key, value), false, true); |
| } |
| return node.finishProperty('init', key, computed, key, false, true); |
| } |
| |
| throwUnexpectedToken(lookahead); |
| } |
| |
| function parseObjectInitializer() { |
| var properties = [], hasProto = {value: false}, node = new Node(); |
| |
| expect('{'); |
| |
| while (!match('}')) { |
| properties.push(parseObjectProperty(hasProto)); |
| |
| if (!match('}')) { |
| expectCommaSeparator(); |
| } |
| } |
| |
| expect('}'); |
| |
| return node.finishObjectExpression(properties); |
| } |
| |
| function reinterpretExpressionAsPattern(expr) { |
| var i; |
| switch (expr.type) { |
| case Syntax.Identifier: |
| case Syntax.MemberExpression: |
| case Syntax.RestElement: |
| case Syntax.AssignmentPattern: |
| break; |
| case Syntax.SpreadElement: |
| expr.type = Syntax.RestElement; |
| reinterpretExpressionAsPattern(expr.argument); |
| break; |
| case Syntax.ArrayExpression: |
| expr.type = Syntax.ArrayPattern; |
| for (i = 0; i < expr.elements.length; i++) { |
| if (expr.elements[i] !== null) { |
| reinterpretExpressionAsPattern(expr.elements[i]); |
| } |
| } |
| break; |
| case Syntax.ObjectExpression: |
| expr.type = Syntax.ObjectPattern; |
| for (i = 0; i < expr.properties.length; i++) { |
| reinterpretExpressionAsPattern(expr.properties[i].value); |
| } |
| break; |
| case Syntax.AssignmentExpression: |
| expr.type = Syntax.AssignmentPattern; |
| reinterpretExpressionAsPattern(expr.left); |
| break; |
| default: |
| // Allow other node type for tolerant parsing. |
| break; |
| } |
| } |
| |
| // ECMA-262 12.2.9 Template Literals |
| |
| function parseTemplateElement(option) { |
| var node, token; |
| |
| if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) { |
| throwUnexpectedToken(); |
| } |
| |
| node = new Node(); |
| token = lex(); |
| |
| return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail); |
| } |
| |
| function parseTemplateLiteral() { |
| var quasi, quasis, expressions, node = new Node(); |
| |
| quasi = parseTemplateElement({ head: true }); |
| quasis = [quasi]; |
| expressions = []; |
| |
| while (!quasi.tail) { |
| expressions.push(parseExpression()); |
| quasi = parseTemplateElement({ head: false }); |
| quasis.push(quasi); |
| } |
| |
| return node.finishTemplateLiteral(quasis, expressions); |
| } |
| |
| // ECMA-262 12.2.10 The Grouping Operator |
| |
| function parseGroupExpression() { |
| var expr, expressions, startToken, i, params = []; |
| |
| expect('('); |
| |
| if (match(')')) { |
| lex(); |
| if (!match('=>')) { |
| expect('=>'); |
| } |
| return { |
| type: PlaceHolders.ArrowParameterPlaceHolder, |
| params: [], |
| rawParams: [] |
| }; |
| } |
| |
| startToken = lookahead; |
| if (match('...')) { |
| expr = parseRestElement(params); |
| expect(')'); |
| if (!match('=>')) { |
| expect('=>'); |
| } |
| return { |
| type: PlaceHolders.ArrowParameterPlaceHolder, |
| params: [expr] |
| }; |
| } |
| |
| isBindingElement = true; |
| expr = inheritCoverGrammar(parseAssignmentExpression); |
| |
| if (match(',')) { |
| isAssignmentTarget = false; |
| expressions = [expr]; |
| |
| while (startIndex < length) { |
| if (!match(',')) { |
| break; |
| } |
| lex(); |
| |
| if (match('...')) { |
| if (!isBindingElement) { |
| throwUnexpectedToken(lookahead); |
| } |
| expressions.push(parseRestElement(params)); |
| expect(')'); |
| if (!match('=>')) { |
| expect('=>'); |
| } |
| isBindingElement = false; |
| for (i = 0; i < expressions.length; i++) { |
| reinterpretExpressionAsPattern(expressions[i]); |
| } |
| return { |
| type: PlaceHolders.ArrowParameterPlaceHolder, |
| params: expressions |
| }; |
| } |
| |
| expressions.push(inheritCoverGrammar(parseAssignmentExpression)); |
| } |
| |
| expr = new WrappingNode(startToken).finishSequenceExpression(expressions); |
| } |
| |
| |
| expect(')'); |
| |
| if (match('=>')) { |
| if (expr.type === Syntax.Identifier && expr.name === 'yield') { |
| return { |
| type: PlaceHolders.ArrowParameterPlaceHolder, |
| params: [expr] |
| }; |
| } |
| |
| if (!isBindingElement) { |
| throwUnexpectedToken(lookahead); |
| } |
| |
| if (expr.type === Syntax.SequenceExpression) { |
| for (i = 0; i < expr.expressions.length; i++) { |
| reinterpretExpressionAsPattern(expr.expressions[i]); |
| } |
| } else { |
| reinterpretExpressionAsPattern(expr); |
| } |
| |
| expr = { |
| type: PlaceHolders.ArrowParameterPlaceHolder, |
| params: expr.type === Syntax.SequenceExpression ? expr.expressions : [expr] |
| }; |
| } |
| isBindingElement = false; |
| return expr; |
| } |
| |
| |
| // ECMA-262 12.2 Primary Expressions |
| |
| function parsePrimaryExpression() { |
| var type, token, expr, node; |
| |
| if (match('(')) { |
| isBindingElement = false; |
| return inheritCoverGrammar(parseGroupExpression); |
| } |
| |
| if (match('[')) { |
| return inheritCoverGrammar(parseArrayInitializer); |
| } |
| |
| if (match('{')) { |
| return inheritCoverGrammar(parseObjectInitializer); |
| } |
| |
| type = lookahead.type; |
| node = new Node(); |
| |
| if (type === Token.Identifier) { |
| if (state.sourceType === 'module' && lookahead.value === 'await') { |
| tolerateUnexpectedToken(lookahead); |
| } |
| expr = node.finishIdentifier(lex().value); |
| } else if (type === Token.StringLiteral || type === Token.NumericLiteral) { |
| isAssignmentTarget = isBindingElement = false; |
| if (strict && lookahead.octal) { |
| tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral); |
| } |
| expr = node.finishLiteral(lex()); |
| } else if (type === Token.Keyword) { |
| if (!strict && state.allowYield && matchKeyword('yield')) { |
| return parseNonComputedProperty(); |
| } |
| if (!strict && matchKeyword('let')) { |
| return node.finishIdentifier(lex().value); |
| } |
| isAssignmentTarget = isBindingElement = false; |
| if (matchKeyword('function')) { |
| return parseFunctionExpression(); |
| } |
| if (matchKeyword('this')) { |
| lex(); |
| return node.finishThisExpression(); |
| } |
| if (matchKeyword('class')) { |
| return parseClassExpression(); |
| } |
| throwUnexpectedToken(lex()); |
| } else if (type === Token.BooleanLiteral) { |
| isAssignmentTarget = isBindingElement = false; |
| token = lex(); |
| token.value = (token.value === 'true'); |
| expr = node.finishLiteral(token); |
| } else if (type === Token.NullLiteral) { |
| isAssignmentTarget = isBindingElement = false; |
| token = lex(); |
| token.value = null; |
| expr = node.finishLiteral(token); |
| } else if (match('/') || match('/=')) { |
| isAssignmentTarget = isBindingElement = false; |
| index = startIndex; |
| |
| if (typeof extra.tokens !== 'undefined') { |
| token = collectRegex(); |
| } else { |
| token = scanRegExp(); |
| } |
| lex(); |
| expr = node.finishLiteral(token); |
| } else if (type === Token.Template) { |
| expr = parseTemplateLiteral(); |
| } else { |
| throwUnexpectedToken(lex()); |
| } |
| |
| return expr; |
| } |
| |
| // ECMA-262 12.3 Left-Hand-Side Expressions |
| |
| function parseArguments() { |
| var args = [], expr; |
| |
| expect('('); |
| |
| if (!match(')')) { |
| while (startIndex < length) { |
| if (match('...')) { |
| expr = new Node(); |
| lex(); |
| expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression)); |
| } else { |
| expr = isolateCoverGrammar(parseAssignmentExpression); |
| } |
| args.push(expr); |
| if (match(')')) { |
| break; |
| } |
| expectCommaSeparator(); |
| } |
| } |
| |
| expect(')'); |
| |
| return args; |
| } |
| |
| function parseNonComputedProperty() { |
| var token, node = new Node(); |
| |
| token = lex(); |
| |
| if (!isIdentifierName(token)) { |
| throwUnexpectedToken(token); |
| } |
| |
| return node.finishIdentifier(token.value); |
| } |
| |
| function parseNonComputedMember() { |
| expect('.'); |
| |
| return parseNonComputedProperty(); |
| } |
| |
| function parseComputedMember() { |
| var expr; |
| |
| expect('['); |
| |
| expr = isolateCoverGrammar(parseExpression); |
| |
| expect(']'); |
| |
| return expr; |
| } |
| |
| // ECMA-262 12.3.3 The new Operator |
| |
| function parseNewExpression() { |
| var callee, args, node = new Node(); |
| |
| expectKeyword('new'); |
| |
| if (match('.')) { |
| lex(); |
| if (lookahead.type === Token.Identifier && lookahead.value === 'target') { |
| if (state.inFunctionBody) { |
| lex(); |
| return node.finishMetaProperty('new', 'target'); |
| } |
| } |
| throwUnexpectedToken(lookahead); |
| } |
| |
| callee = isolateCoverGrammar(parseLeftHandSideExpression); |
| args = match('(') ? parseArguments() : []; |
| |
| isAssignmentTarget = isBindingElement = false; |
| |
| return node.finishNewExpression(callee, args); |
| } |
| |
| // ECMA-262 12.3.4 Function Calls |
| |
| function parseLeftHandSideExpressionAllowCall() { |
| var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn; |
| |
| startToken = lookahead; |
| state.allowIn = true; |
| |
| if (matchKeyword('super') && state.inFunctionBody) { |
| expr = new Node(); |
| lex(); |
| expr = expr.finishSuper(); |
| if (!match('(') && !match('.') && !match('[')) { |
| throwUnexpectedToken(lookahead); |
| } |
| } else { |
| expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression); |
| } |
| |
| for (;;) { |
| if (match('.')) { |
| isBindingElement = false; |
| isAssignmentTarget = true; |
| property = parseNonComputedMember(); |
| expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); |
| } else if (match('(')) { |
| isBindingElement = false; |
| isAssignmentTarget = false; |
| args = parseArguments(); |
| expr = new WrappingNode(startToken).finishCallExpression(expr, args); |
| } else if (match('[')) { |
| isBindingElement = false; |
| isAssignmentTarget = true; |
| property = parseComputedMember(); |
| expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); |
| } else if (lookahead.type === Token.Template && lookahead.head) { |
| quasi = parseTemplateLiteral(); |
| expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi); |
| } else { |
| break; |
| } |
| } |
| state.allowIn = previousAllowIn; |
| |
| return expr; |
| } |
| |
| // ECMA-262 12.3 Left-Hand-Side Expressions |
| |
| function parseLeftHandSideExpression() { |
| var quasi, expr, property, startToken; |
| assert(state.allowIn, 'callee of new expression always allow in keyword.'); |
| |
| startToken = lookahead; |
| |
| if (matchKeyword('super') && state.inFunctionBody) { |
| expr = new Node(); |
| lex(); |
| expr = expr.finishSuper(); |
| if (!match('[') && !match('.')) { |
| throwUnexpectedToken(lookahead); |
| } |
| } else { |
| expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression); |
| } |
| |
| for (;;) { |
| if (match('[')) { |
| isBindingElement = false; |
| isAssignmentTarget = true; |
| property = parseComputedMember(); |
| expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); |
| } else if (match('.')) { |
| isBindingElement = false; |
| isAssignmentTarget = true; |
| property = parseNonComputedMember(); |
| expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); |
| } else if (lookahead.type === Token.Template && lookahead.head) { |
| quasi = parseTemplateLiteral(); |
| expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi); |
| } else { |
| break; |
| } |
| } |
| return expr; |
| } |
| |
| // ECMA-262 12.4 Postfix Expressions |
| |
| function parsePostfixExpression() { |
| var expr, token, startToken = lookahead; |
| |
| expr = inheritCoverGrammar(parseLeftHandSideExpressionAllowCall); |
| |
| if (!hasLineTerminator && lookahead.type === Token.Punctuator) { |
| if (match('++') || match('--')) { |
| // ECMA-262 11.3.1, 11.3.2 |
| if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { |
| tolerateError(Messages.StrictLHSPostfix); |
| } |
| |
| if (!isAssignmentTarget) { |
| tolerateError(Messages.InvalidLHSInAssignment); |
| } |
| |
| isAssignmentTarget = isBindingElement = false; |
| |
| token = lex(); |
| expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr); |
| } |
| } |
| |
| return expr; |
| } |
| |
| // ECMA-262 12.5 Unary Operators |
| |
| function parseUnaryExpression() { |
| var token, expr, startToken; |
| |
| if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { |
| expr = parsePostfixExpression(); |
| } else if (match('++') || match('--')) { |
| startToken = lookahead; |
| token = lex(); |
| expr = inheritCoverGrammar(parseUnaryExpression); |
| // ECMA-262 11.4.4, 11.4.5 |
| if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { |
| tolerateError(Messages.StrictLHSPrefix); |
| } |
| |
| if (!isAssignmentTarget) { |
| tolerateError(Messages.InvalidLHSInAssignment); |
| } |
| expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); |
| isAssignmentTarget = isBindingElement = false; |
| } else if (match('+') || match('-') || match('~') || match('!')) { |
| startToken = lookahead; |
| token = lex(); |
| expr = inheritCoverGrammar(parseUnaryExpression); |
| expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); |
| isAssignmentTarget = isBindingElement = false; |
| } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { |
| startToken = lookahead; |
| token = lex(); |
| expr = inheritCoverGrammar(parseUnaryExpression); |
| expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); |
| if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { |
| tolerateError(Messages.StrictDelete); |
| } |
| isAssignmentTarget = isBindingElement = false; |
| } else { |
| expr = parsePostfixExpression(); |
| } |
| |
| return expr; |
| } |
| |
| function binaryPrecedence(token, allowIn) { |
| var prec = 0; |
| |
| if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { |
| return 0; |
| } |
| |
| switch (token.value) { |
| case '||': |
| prec = 1; |
| break; |
| |
| case '&&': |
| prec = 2; |
| break; |
| |
| case '|': |
| prec = 3; |
| break; |
| |
| case '^': |
| prec = 4; |
| break; |
| |
| case '&': |
| prec = 5; |
| break; |
| |
| case '==': |
| case '!=': |
| case '===': |
| case '!==': |
| prec = 6; |
| break; |
| |
| case '<': |
| case '>': |
| case '<=': |
| case '>=': |
| case 'instanceof': |
| prec = 7; |
| break; |
| |
| case 'in': |
| prec = allowIn ? 7 : 0; |
| break; |
| |
| case '<<': |
| case '>>': |
| case '>>>': |
| prec = 8; |
| break; |
| |
| case '+': |
| case '-': |
| prec = 9; |
| break; |
| |
| case '*': |
| case '/': |
| case '%': |
| prec = 11; |
| break; |
| |
| default: |
| break; |
| } |
| |
| return prec; |
| } |
| |
| // ECMA-262 12.6 Multiplicative Operators |
| // ECMA-262 12.7 Additive Operators |
| // ECMA-262 12.8 Bitwise Shift Operators |
| // ECMA-262 12.9 Relational Operators |
| // ECMA-262 12.10 Equality Operators |
| // ECMA-262 12.11 Binary Bitwise Operators |
| // ECMA-262 12.12 Binary Logical Operators |
| |
| function parseBinaryExpression() { |
| var marker, markers, expr, token, prec, stack, right, operator, left, i; |
| |
| marker = lookahead; |
| left = inheritCoverGrammar(parseUnaryExpression); |
| |
| token = lookahead; |
| prec = binaryPrecedence(token, state.allowIn); |
| if (prec === 0) { |
| return left; |
| } |
| isAssignmentTarget = isBindingElement = false; |
| token.prec = prec; |
| lex(); |
| |
| markers = [marker, lookahead]; |
| right = isolateCoverGrammar(parseUnaryExpression); |
| |
| stack = [left, token, right]; |
| |
| while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) { |
| |
| // Reduce: make a binary expression from the three topmost entries. |
| while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { |
| right = stack.pop(); |
| operator = stack.pop().value; |
| left = stack.pop(); |
| markers.pop(); |
| expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right); |
| stack.push(expr); |
| } |
| |
| // Shift. |
| token = lex(); |
| token.prec = prec; |
| stack.push(token); |
| markers.push(lookahead); |
| expr = isolateCoverGrammar(parseUnaryExpression); |
| stack.push(expr); |
| } |
| |
| // Final reduce to clean-up the stack. |
| i = stack.length - 1; |
| expr = stack[i]; |
| markers.pop(); |
| while (i > 1) { |
| expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr); |
| i -= 2; |
| } |
| |
| return expr; |
| } |
| |
| |
| // ECMA-262 12.13 Conditional Operator |
| |
| function parseConditionalExpression() { |
| var expr, previousAllowIn, consequent, alternate, startToken; |
| |
| startToken = lookahead; |
| |
| expr = inheritCoverGrammar(parseBinaryExpression); |
| if (match('?')) { |
| lex(); |
| previousAllowIn = state.allowIn; |
| state.allowIn = true; |
| consequent = isolateCoverGrammar(parseAssignmentExpression); |
| state.allowIn = previousAllowIn; |
| expect(':'); |
| alternate = isolateCoverGrammar(parseAssignmentExpression); |
| |
| expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate); |
| isAssignmentTarget = isBindingElement = false; |
| } |
| |
| return expr; |
| } |
| |
| // ECMA-262 14.2 Arrow Function Definitions |
| |
| function parseConciseBody() { |
| if (match('{')) { |
| return parseFunctionSourceElements(); |
| } |
| return isolateCoverGrammar(parseAssignmentExpression); |
| } |
| |
| function checkPatternParam(options, param) { |
| var i; |
| switch (param.type) { |
| case Syntax.Identifier: |
| validateParam(options, param, param.name); |
| break; |
| case Syntax.RestElement: |
| checkPatternParam(options, param.argument); |
| break; |
| case Syntax.AssignmentPattern: |
| checkPatternParam(options, param.left); |
| break; |
| case Syntax.ArrayPattern: |
| for (i = 0; i < param.elements.length; i++) { |
| if (param.elements[i] !== null) { |
| checkPatternParam(options, param.elements[i]); |
| } |
| } |
| break; |
| case Syntax.YieldExpression: |
| break; |
| default: |
| assert(param.type === Syntax.ObjectPattern, 'Invalid type'); |
| for (i = 0; i < param.properties.length; i++) { |
| checkPatternParam(options, param.properties[i].value); |
| } |
| break; |
| } |
| } |
| function reinterpretAsCoverFormalsList(expr) { |
| var i, len, param, params, defaults, defaultCount, options, token; |
| |
| defaults = []; |
| defaultCount = 0; |
| params = [expr]; |
| |
| switch (expr.type) { |
| case Syntax.Identifier: |
| break; |
| case PlaceHolders.ArrowParameterPlaceHolder: |
| params = expr.params; |
| break; |
| default: |
| return null; |
| } |
| |
| options = { |
| paramSet: {} |
| }; |
| |
| for (i = 0, len = params.length; i < len; i += 1) { |
| param = params[i]; |
| switch (param.type) { |
| case Syntax.AssignmentPattern: |
| params[i] = param.left; |
| if (param.right.type === Syntax.YieldExpression) { |
| if (param.right.argument) { |
| throwUnexpectedToken(lookahead); |
| } |
| param.right.type = Syntax.Identifier; |
| param.right.name = 'yield'; |
| delete param.right.argument; |
| delete param.right.delegate; |
| } |
| defaults.push(param.right); |
| ++defaultCount; |
| checkPatternParam(options, param.left); |
| break; |
| default: |
| checkPatternParam(options, param); |
| params[i] = param; |
| defaults.push(null); |
| break; |
| } |
| } |
| |
| if (strict || !state.allowYield) { |
| for (i = 0, len = params.length; i < len; i += 1) { |
| param = params[i]; |
| if (param.type === Syntax.YieldExpression) { |
| throwUnexpectedToken(lookahead); |
| } |
| } |
| } |
| |
| if (options.message === Messages.StrictParamDupe) { |
| token = strict ? options.stricted : options.firstRestricted; |
| throwUnexpectedToken(token, options.message); |
| } |
| |
| if (defaultCount === 0) { |
| defaults = []; |
| } |
| |
| return { |
| params: params, |
| defaults: defaults, |
| stricted: options.stricted, |
| firstRestricted: options.firstRestricted, |
| message: options.message |
| }; |
| } |
| |
| function parseArrowFunctionExpression(options, node) { |
| var previousStrict, previousAllowYield, body; |
| |
| if (hasLineTerminator) { |
| tolerateUnexpectedToken(lookahead); |
| } |
| expect('=>'); |
| |
| previousStrict = strict; |
| previousAllowYield = state.allowYield; |
| state.allowYield = true; |
| |
| body = parseConciseBody(); |
| |
| if (strict && options.firstRestricted) { |
| throwUnexpectedToken(options.firstRestricted, options.message); |
| } |
| if (strict && options.stricted) { |
| tolerateUnexpectedToken(options.stricted, options.message); |
| } |
| |
| strict = previousStrict; |
| state.allowYield = previousAllowYield; |
| |
| return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement); |
| } |
| |
| // ECMA-262 14.4 Yield expression |
| |
| function parseYieldExpression() { |
| var argument, expr, delegate, previousAllowYield; |
| |
| argument = null; |
| expr = new Node(); |
| delegate = false; |
| |
| expectKeyword('yield'); |
| |
| if (!hasLineTerminator) { |
| previousAllowYield = state.allowYield; |
| state.allowYield = false; |
| delegate = match('*'); |
| if (delegate) { |
| lex(); |
| argument = parseAssignmentExpression(); |
| } else { |
| if (!match(';') && !match('}') && !match(')') && lookahead.type !== Token.EOF) { |
| argument = parseAssignmentExpression(); |
| } |
| } |
| state.allowYield = previousAllowYield; |
| } |
| |
| return expr.finishYieldExpression(argument, delegate); |
| } |
| |
| // ECMA-262 12.14 Assignment Operators |
| |
| function parseAssignmentExpression() { |
| var token, expr, right, list, startToken; |
| |
| startToken = lookahead; |
| token = lookahead; |
| |
| if (!state.allowYield && matchKeyword('yield')) { |
| return parseYieldExpression(); |
| } |
| |
| expr = parseConditionalExpression(); |
| |
| if (expr.type === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) { |
| isAssignmentTarget = isBindingElement = false; |
| list = reinterpretAsCoverFormalsList(expr); |
| |
| if (list) { |
| firstCoverInitializedNameError = null; |
| return parseArrowFunctionExpression(list, new WrappingNode(startToken)); |
| } |
| |
| return expr; |
| } |
| |
| if (matchAssign()) { |
| if (!isAssignmentTarget) { |
| tolerateError(Messages.InvalidLHSInAssignment); |
| } |
| |
| // ECMA-262 12.1.1 |
| if (strict && expr.type === Syntax.Identifier) { |
| if (isRestrictedWord(expr.name)) { |
| tolerateUnexpectedToken(token, Messages.StrictLHSAssignment); |
| } |
| if (isStrictModeReservedWord(expr.name)) { |
| tolerateUnexpectedToken(token, Messages.StrictReservedWord); |
| } |
| } |
| |
| if (!match('=')) { |
| isAssignmentTarget = isBindingElement = false; |
| } else { |
| reinterpretExpressionAsPattern(expr); |
| } |
| |
| token = lex(); |
| right = isolateCoverGrammar(parseAssignmentExpression); |
| expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right); |
| firstCoverInitializedNameError = null; |
| } |
| |
| return expr; |
| } |
| |
| // ECMA-262 12.15 Comma Operator |
| |
| function parseExpression() { |
| var expr, startToken = lookahead, expressions; |
| |
| expr = isolateCoverGrammar(parseAssignmentExpression); |
| |
| if (match(',')) { |
| expressions = [expr]; |
| |
| while (startIndex < length) { |
| if (!match(',')) { |
| break; |
| } |
| lex(); |
| expressions.push(isolateCoverGrammar(parseAssignmentExpression)); |
| } |
| |
| expr = new WrappingNode(startToken).finishSequenceExpression(expressions); |
| } |
| |
| return expr; |
| } |
| |
| // ECMA-262 13.2 Block |
| |
| function parseStatementListItem() { |
| if (lookahead.type === Token.Keyword) { |
| switch (lookahead.value) { |
| case 'export': |
| if (state.sourceType !== 'module') { |
| tolerateUnexpectedToken(lookahead, Messages.IllegalExportDeclaration); |
| } |
| return parseExportDeclaration(); |
| case 'import': |
| if (state.sourceType !== 'module') { |
| tolerateUnexpectedToken(lookahead, Messages.IllegalImportDeclaration); |
| } |
| return parseImportDeclaration(); |
| case 'const': |
| return parseLexicalDeclaration({inFor: false}); |
| case 'function': |
| return parseFunctionDeclaration(new Node()); |
| case 'class': |
| return parseClassDeclaration(); |
| } |
| } |
| |
| if (matchKeyword('let') && isLexicalDeclaration()) { |
| return parseLexicalDeclaration({inFor: false}); |
| } |
| |
| return parseStatement(); |
| } |
| |
| function parseStatementList() { |
| var list = []; |
| while (startIndex < length) { |
| if (match('}')) { |
| break; |
| } |
| list.push(parseStatementListItem()); |
| } |
| |
| return list; |
| } |
| |
| function parseBlock() { |
| var block, node = new Node(); |
| |
| expect('{'); |
| |
| block = parseStatementList(); |
| |
| expect('}'); |
| |
| return node.finishBlockStatement(block); |
| } |
| |
| // ECMA-262 13.3.2 Variable Statement |
| |
| function parseVariableIdentifier(kind) { |
| var token, node = new Node(); |
| |
| token = lex(); |
| |
| if (token.type === Token.Keyword && token.value === 'yield') { |
| if (strict) { |
| tolerateUnexpectedToken(token, Messages.StrictReservedWord); |
| } if (!state.allowYield) { |
| throwUnexpectedToken(token); |
| } |
| } else if (token.type !== Token.Identifier) { |
| if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) { |
| tolerateUnexpectedToken(token, Messages.StrictReservedWord); |
| } else { |
| if (strict || token.value !== 'let' || kind !== 'var') { |
| throwUnexpectedToken(token); |
| } |
| } |
| } else if (state.sourceType === 'module' && token.type === Token.Identifier && token.value === 'await') { |
| tolerateUnexpectedToken(token); |
| } |
| |
| return node.finishIdentifier(token.value); |
| } |
| |
| function parseVariableDeclaration(options) { |
| var init = null, id, node = new Node(), params = []; |
| |
| id = parsePattern(params, 'var'); |
| |
| // ECMA-262 12.2.1 |
| if (strict && isRestrictedWord(id.name)) { |
| tolerateError(Messages.StrictVarName); |
| } |
| |
| if (match('=')) { |
| lex(); |
| init = isolateCoverGrammar(parseAssignmentExpression); |
| } else if (id.type !== Syntax.Identifier && !options.inFor) { |
| expect('='); |
| } |
| |
| return node.finishVariableDeclarator(id, init); |
| } |
| |
| function parseVariableDeclarationList(options) { |
| var opt, list; |
| |
| opt = { inFor: options.inFor }; |
| list = [parseVariableDeclaration(opt)]; |
| |
| while (match(',')) { |
| lex(); |
| list.push(parseVariableDeclaration(opt)); |
| } |
| |
| return list; |
| } |
| |
| function parseVariableStatement(node) { |
| var declarations; |
| |
| expectKeyword('var'); |
| |
| declarations = parseVariableDeclarationList({ inFor: false }); |
| |
| consumeSemicolon(); |
| |
| return node.finishVariableDeclaration(declarations); |
| } |
| |
| // ECMA-262 13.3.1 Let and Const Declarations |
| |
| function parseLexicalBinding(kind, options) { |
| var init = null, id, node = new Node(), params = []; |
| |
| id = parsePattern(params, kind); |
| |
| // ECMA-262 12.2.1 |
| if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) { |
| tolerateError(Messages.StrictVarName); |
| } |
| |
| if (kind === 'const') { |
| if (!matchKeyword('in') && !matchContextualKeyword('of')) { |
| expect('='); |
| init = isolateCoverGrammar(parseAssignmentExpression); |
| } |
| } else if ((!options.inFor && id.type !== Syntax.Identifier) || match('=')) { |
| expect('='); |
| init = isolateCoverGrammar(parseAssignmentExpression); |
| } |
| |
| return node.finishVariableDeclarator(id, init); |
| } |
| |
| function parseBindingList(kind, options) { |
| var list = [parseLexicalBinding(kind, options)]; |
| |
| while (match(',')) { |
| lex(); |
| list.push(parseLexicalBinding(kind, options)); |
| } |
| |
| return list; |
| } |
| |
| |
| function tokenizerState() { |
| return { |
| index: index, |
| lineNumber: lineNumber, |
| lineStart: lineStart, |
| hasLineTerminator: hasLineTerminator, |
| lastIndex: lastIndex, |
| lastLineNumber: lastLineNumber, |
| lastLineStart: lastLineStart, |
| startIndex: startIndex, |
| startLineNumber: startLineNumber, |
| startLineStart: startLineStart, |
| lookahead: lookahead, |
| tokenCount: extra.tokens ? extra.tokens.length : 0 |
| }; |
| } |
| |
| function resetTokenizerState(ts) { |
| index = ts.index; |
| lineNumber = ts.lineNumber; |
| lineStart = ts.lineStart; |
| hasLineTerminator = ts.hasLineTerminator; |
| lastIndex = ts.lastIndex; |
| lastLineNumber = ts.lastLineNumber; |
| lastLineStart = ts.lastLineStart; |
| startIndex = ts.startIndex; |
| startLineNumber = ts.startLineNumber; |
| startLineStart = ts.startLineStart; |
| lookahead = ts.lookahead; |
| if (extra.tokens) { |
| extra.tokens.splice(ts.tokenCount, extra.tokens.length); |
| } |
| } |
| |
| function isLexicalDeclaration() { |
| var lexical, ts; |
| |
| ts = tokenizerState(); |
| |
| lex(); |
| lexical = (lookahead.type === Token.Identifier) || match('[') || match('{') || |
| matchKeyword('let') || matchKeyword('yield'); |
| |
| resetTokenizerState(ts); |
| |
| return lexical; |
| } |
| |
| function parseLexicalDeclaration(options) { |
| var kind, declarations, node = new Node(); |
| |
| kind = lex().value; |
| assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); |
| |
| declarations = parseBindingList(kind, options); |
| |
| consumeSemicolon(); |
| |
| return node.finishLexicalDeclaration(declarations, kind); |
| } |
| |
| function parseRestElement(params) { |
| var param, node = new Node(); |
| |
| lex(); |
| |
| if (match('{')) { |
| throwError(Messages.ObjectPatternAsRestParameter); |
| } |
| |
| params.push(lookahead); |
| |
| param = parseVariableIdentifier(); |
| |
| if (match('=')) { |
| throwError(Messages.DefaultRestParameter); |
| } |
| |
| if (!match(')')) { |
| throwError(Messages.ParameterAfterRestParameter); |
| } |
| |
| return node.finishRestElement(param); |
| } |
| |
| // ECMA-262 13.4 Empty Statement |
| |
| function parseEmptyStatement(node) { |
| expect(';'); |
| return node.finishEmptyStatement(); |
| } |
| |
| // ECMA-262 12.4 Expression Statement |
| |
| function parseExpressionStatement(node) { |
| var expr = parseExpression(); |
| consumeSemicolon(); |
| return node.finishExpressionStatement(expr); |
| } |
| |
| // ECMA-262 13.6 If statement |
| |
| function parseIfStatement(node) { |
| var test, consequent, alternate; |
| |
| expectKeyword('if'); |
| |
| expect('('); |
| |
| test = parseExpression(); |
| |
| expect(')'); |
| |
| consequent = parseStatement(); |
| |
| if (matchKeyword('else')) { |
| lex(); |
| alternate = parseStatement(); |
| } else { |
| alternate = null; |
| } |
| |
| return node.finishIfStatement(test, consequent, alternate); |
| } |
| |
| // ECMA-262 13.7 Iteration Statements |
| |
| function parseDoWhileStatement(node) { |
| var body, test, oldInIteration; |
| |
| expectKeyword('do'); |
| |
| oldInIteration = state.inIteration; |
| state.inIteration = true; |
| |
| body = parseStatement(); |
| |
| state.inIteration = oldInIteration; |
| |
| expectKeyword('while'); |
| |
| expect('('); |
| |
| test = parseExpression(); |
| |
| expect(')'); |
| |
| if (match(';')) { |
| lex(); |
| } |
| |
| return node.finishDoWhileStatement(body, test); |
| } |
| |
| function parseWhileStatement(node) { |
| var test, body, oldInIteration; |
| |
| expectKeyword('while'); |
| |
| expect('('); |
| |
| test = parseExpression(); |
| |
| expect(')'); |
| |
| oldInIteration = state.inIteration; |
| state.inIteration = true; |
| |
| body = parseStatement(); |
| |
| state.inIteration = oldInIteration; |
| |
| return node.finishWhileStatement(test, body); |
| } |
| |
| function parseForStatement(node) { |
| var init, forIn, initSeq, initStartToken, test, update, left, right, kind, declarations, |
| body, oldInIteration, previousAllowIn = state.allowIn; |
| |
| init = test = update = null; |
| forIn = true; |
| |
| expectKeyword('for'); |
| |
| expect('('); |
| |
| if (match(';')) { |
| lex(); |
| } else { |
| if (matchKeyword('var')) { |
| init = new Node(); |
| lex(); |
| |
| state.allowIn = false; |
| declarations = parseVariableDeclarationList({ inFor: true }); |
| state.allowIn = previousAllowIn; |
| |
| if (declarations.length === 1 && matchKeyword('in')) { |
| init = init.finishVariableDeclaration(declarations); |
| lex(); |
| left = init; |
| right = parseExpression(); |
| init = null; |
| } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) { |
| init = init.finishVariableDeclaration(declarations); |
| lex(); |
| left = init; |
| right = parseAssignmentExpression(); |
| init = null; |
| forIn = false; |
| } else { |
| init = init.finishVariableDeclaration(declarations); |
| expect(';'); |
| } |
| } else if (matchKeyword('const') || matchKeyword('let')) { |
| init = new Node(); |
| kind = lex().value; |
| |
| if (!strict && lookahead.value === 'in') { |
| init = init.finishIdentifier(kind); |
| lex(); |
| left = init; |
| right = parseExpression(); |
| init = null; |
| } else { |
| state.allowIn = false; |
| declarations = parseBindingList(kind, {inFor: true}); |
| state.allowIn = previousAllowIn; |
| |
| if (declarations.length === 1 && declarations[0].init === null && matchKeyword('in')) { |
| init = init.finishLexicalDeclaration(declarations, kind); |
| lex(); |
| left = init; |
| right = parseExpression(); |
| init = null; |
| } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) { |
| init = init.finishLexicalDeclaration(declarations, kind); |
| lex(); |
| left = init; |
| right = parseAssignmentExpression(); |
| init = null; |
| forIn = false; |
| } else { |
| consumeSemicolon(); |
| init = init.finishLexicalDeclaration(declarations, kind); |
| } |
| } |
| } else { |
| initStartToken = lookahead; |
| state.allowIn = false; |
| init = inheritCoverGrammar(parseAssignmentExpression); |
| state.allowIn = previousAllowIn; |
| |
| if (matchKeyword('in')) { |
| if (!isAssignmentTarget) { |
| tolerateError(Messages.InvalidLHSInForIn); |
| } |
| |
| lex(); |
| reinterpretExpressionAsPattern(init); |
| left = init; |
| right = parseExpression(); |
| init = null; |
| } else if (matchContextualKeyword('of')) { |
| if (!isAssignmentTarget) { |
| tolerateError(Messages.InvalidLHSInForLoop); |
| } |
| |
| lex(); |
| reinterpretExpressionAsPattern(init); |
| left = init; |
| right = parseAssignmentExpression(); |
| init = null; |
| forIn = false; |
| } else { |
| if (match(',')) { |
| initSeq = [init]; |
| while (match(',')) { |
| lex(); |
| initSeq.push(isolateCoverGrammar(parseAssignmentExpression)); |
| } |
| init = new WrappingNode(initStartToken).finishSequenceExpression(initSeq); |
| } |
| expect(';'); |
| } |
| } |
| } |
| |
| if (typeof left === 'undefined') { |
| |
| if (!match(';')) { |
| test = parseExpression(); |
| } |
| expect(';'); |
| |
| if (!match(')')) { |
| update = parseExpression(); |
| } |
| } |
| |
| expect(')'); |
| |
| oldInIteration = state.inIteration; |
| state.inIteration = true; |
| |
| body = isolateCoverGrammar(parseStatement); |
| |
| state.inIteration = oldInIteration; |
| |
| return (typeof left === 'undefined') ? |
| node.finishForStatement(init, test, update, body) : |
| forIn ? node.finishForInStatement(left, right, body) : |
| node.finishForOfStatement(left, right, body); |
| } |
| |
| // ECMA-262 13.8 The continue statement |
| |
| function parseContinueStatement(node) { |
| var label = null, key; |
| |
| expectKeyword('continue'); |
| |
| // Optimize the most common form: 'continue;'. |
| if (source.charCodeAt(startIndex) === 0x3B) { |
| lex(); |
| |
| if (!state.inIteration) { |
| throwError(Messages.IllegalContinue); |
| } |
| |
| return node.finishContinueStatement(null); |
| } |
| |
| if (hasLineTerminator) { |
| if (!state.inIteration) { |
| throwError(Messages.IllegalContinue); |
| } |
| |
| return node.finishContinueStatement(null); |
| } |
| |
| if (lookahead.type === Token.Identifier) { |
| label = parseVariableIdentifier(); |
| |
| key = '$' + label.name; |
| if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { |
| throwError(Messages.UnknownLabel, label.name); |
| } |
| } |
| |
| consumeSemicolon(); |
| |
| if (label === null && !state.inIteration) { |
| throwError(Messages.IllegalContinue); |
| } |
| |
| return node.finishContinueStatement(label); |
| } |
| |
| // ECMA-262 13.9 The break statement |
| |
| function parseBreakStatement(node) { |
| var label = null, key; |
| |
| expectKeyword('break'); |
| |
| // Catch the very common case first: immediately a semicolon (U+003B). |
| if (source.charCodeAt(lastIndex) === 0x3B) { |
| lex(); |
| |
| if (!(state.inIteration || state.inSwitch)) { |
| throwError(Messages.IllegalBreak); |
| } |
| |
| return node.finishBreakStatement(null); |
| } |
| |
| if (hasLineTerminator) { |
| if (!(state.inIteration || state.inSwitch)) { |
| throwError(Messages.IllegalBreak); |
| } |
| } else if (lookahead.type === Token.Identifier) { |
| label = parseVariableIdentifier(); |
| |
| key = '$' + label.name; |
| if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { |
| throwError(Messages.UnknownLabel, label.name); |
| } |
| } |
| |
| consumeSemicolon(); |
| |
| if (label === null && !(state.inIteration || state.inSwitch)) { |
| throwError(Messages.IllegalBreak); |
| } |
| |
| return node.finishBreakStatement(label); |
| } |
| |
| // ECMA-262 13.10 The return statement |
| |
| function parseReturnStatement(node) { |
| var argument = null; |
| |
| expectKeyword('return'); |
| |
| if (!state.inFunctionBody) { |
| tolerateError(Messages.IllegalReturn); |
| } |
| |
| // 'return' followed by a space and an identifier is very common. |
| if (source.charCodeAt(lastIndex) === 0x20) { |
| if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) { |
| argument = parseExpression(); |
| consumeSemicolon(); |
| return node.finishReturnStatement(argument); |
| } |
| } |
| |
| if (hasLineTerminator) { |
| // HACK |
| return node.finishReturnStatement(null); |
| } |
| |
| if (!match(';')) { |
| if (!match('}') && lookahead.type !== Token.EOF) { |
| argument = parseExpression(); |
| } |
| } |
| |
| consumeSemicolon(); |
| |
| return node.finishReturnStatement(argument); |
| } |
| |
| // ECMA-262 13.11 The with statement |
| |
| function parseWithStatement(node) { |
| var object, body; |
| |
| if (strict) { |
| tolerateError(Messages.StrictModeWith); |
| } |
| |
| expectKeyword('with'); |
| |
| expect('('); |
| |
| object = parseExpression(); |
| |
| expect(')'); |
| |
| body = parseStatement(); |
| |
| return node.finishWithStatement(object, body); |
| } |
| |
| // ECMA-262 13.12 The switch statement |
| |
| function parseSwitchCase() { |
| var test, consequent = [], statement, node = new Node(); |
| |
| if (matchKeyword('default')) { |
| lex(); |
| test = null; |
| } else { |
| expectKeyword('case'); |
| test = parseExpression(); |
| } |
| expect(':'); |
| |
| while (startIndex < length) { |
| if (match('}') || matchKeyword('default') || matchKeyword('case')) { |
| break; |
| } |
| statement = parseStatementListItem(); |
| consequent.push(statement); |
| } |
| |
| return node.finishSwitchCase(test, consequent); |
| } |
| |
| function parseSwitchStatement(node) { |
| var discriminant, cases, clause, oldInSwitch, defaultFound; |
| |
| expectKeyword('switch'); |
| |
| expect('('); |
| |
| discriminant = parseExpression(); |
| |
| expect(')'); |
| |
| expect('{'); |
| |
| cases = []; |
| |
| if (match('}')) { |
| lex(); |
| return node.finishSwitchStatement(discriminant, cases); |
| } |
| |
| oldInSwitch = state.inSwitch; |
| state.inSwitch = true; |
| defaultFound = false; |
| |
| while (startIndex < length) { |
| if (match('}')) { |
| break; |
| } |
| clause = parseSwitchCase(); |
| if (clause.test === null) { |
| if (defaultFound) { |
| throwError(Messages.MultipleDefaultsInSwitch); |
| } |
| defaultFound = true; |
| } |
| cases.push(clause); |
| } |
| |
| state.inSwitch = oldInSwitch; |
| |
| expect('}'); |
| |
| return node.finishSwitchStatement(discriminant, cases); |
| } |
| |
| // ECMA-262 13.14 The throw statement |
| |
| function parseThrowStatement(node) { |
| var argument; |
| |
| expectKeyword('throw'); |
| |
| if (hasLineTerminator) { |
| throwError(Messages.NewlineAfterThrow); |
| } |
| |
| argument = parseExpression(); |
| |
| consumeSemicolon(); |
| |
| return node.finishThrowStatement(argument); |
| } |
| |
| // ECMA-262 13.15 The try statement |
| |
| function parseCatchClause() { |
| var param, params = [], paramMap = {}, key, i, body, node = new Node(); |
| |
| expectKeyword('catch'); |
| |
| expect('('); |
| if (match(')')) { |
| throwUnexpectedToken(lookahead); |
| } |
| |
| param = parsePattern(params); |
| for (i = 0; i < params.length; i++) { |
| key = '$' + params[i].value; |
| if (Object.prototype.hasOwnProperty.call(paramMap, key)) { |
| tolerateError(Messages.DuplicateBinding, params[i].value); |
| } |
| paramMap[key] = true; |
| } |
| |
| // ECMA-262 12.14.1 |
| if (strict && isRestrictedWord(param.name)) { |
| tolerateError(Messages.StrictCatchVariable); |
| } |
| |
| expect(')'); |
| body = parseBlock(); |
| return node.finishCatchClause(param, body); |
| } |
| |
| function parseTryStatement(node) { |
| var block, handler = null, finalizer = null; |
| |
| expectKeyword('try'); |
| |
| block = parseBlock(); |
| |
| if (matchKeyword('catch')) { |
| handler = parseCatchClause(); |
| } |
| |
| if (matchKeyword('finally')) { |
| lex(); |
| finalizer = parseBlock(); |
| } |
| |
| if (!handler && !finalizer) { |
| throwError(Messages.NoCatchOrFinally); |
| } |
| |
| return node.finishTryStatement(block, handler, finalizer); |
| } |
| |
| // ECMA-262 13.16 The debugger statement |
| |
| function parseDebuggerStatement(node) { |
| expectKeyword('debugger'); |
| |
| consumeSemicolon(); |
| |
| return node.finishDebuggerStatement(); |
| } |
| |
| // 13 Statements |
| |
| function parseStatement() { |
| var type = lookahead.type, |
| expr, |
| labeledBody, |
| key, |
| node; |
| |
| if (type === Token.EOF) { |
| throwUnexpectedToken(lookahead); |
| } |
| |
| if (type === Token.Punctuator && lookahead.value === '{') { |
| return parseBlock(); |
| } |
| isAssignmentTarget = isBindingElement = true; |
| node = new Node(); |
| |
| if (type === Token.Punctuator) { |
| switch (lookahead.value) { |
| case ';': |
| return parseEmptyStatement(node); |
| case '(': |
| return parseExpressionStatement(node); |
| default: |
| break; |
| } |
| } else if (type === Token.Keyword) { |
| switch (lookahead.value) { |
| case 'break': |
| return parseBreakStatement(node); |
| case 'continue': |
| return parseContinueStatement(node); |
| case 'debugger': |
| return parseDebuggerStatement(node); |
| case 'do': |
| return parseDoWhileStatement(node); |
| case 'for': |
| return parseForStatement(node); |
| case 'function': |
| return parseFunctionDeclaration(node); |
| case 'if': |
| return parseIfStatement(node); |
| case 'return': |
| return parseReturnStatement(node); |
| case 'switch': |
| return parseSwitchStatement(node); |
| case 'throw': |
| return parseThrowStatement(node); |
| case 'try': |
| return parseTryStatement(node); |
| case 'var': |
| return parseVariableStatement(node); |
| case 'while': |
| return parseWhileStatement(node); |
| case 'with': |
| return parseWithStatement(node); |
| default: |
| break; |
| } |
| } |
| |
| expr = parseExpression(); |
| |
| // ECMA-262 12.12 Labelled Statements |
| if ((expr.type === Syntax.Identifier) && match(':')) { |
| lex(); |
| |
| key = '$' + expr.name; |
| if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) { |
| throwError(Messages.Redeclaration, 'Label', expr.name); |
| } |
| |
| state.labelSet[key] = true; |
| labeledBody = parseStatement(); |
| delete state.labelSet[key]; |
| return node.finishLabeledStatement(expr, labeledBody); |
| } |
| |
| consumeSemicolon(); |
| |
| return node.finishExpressionStatement(expr); |
| } |
| |
| // ECMA-262 14.1 Function Definition |
| |
| function parseFunctionSourceElements() { |
| var statement, body = [], token, directive, firstRestricted, |
| oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount, |
| node = new Node(); |
| |
| expect('{'); |
| |
| while (startIndex < length) { |
| if (lookahead.type !== Token.StringLiteral) { |
| break; |
| } |
| token = lookahead; |
| |
| statement = parseStatementListItem(); |
| body.push(statement); |
| if (statement.expression.type !== Syntax.Literal) { |
| // this is not directive |
| break; |
| } |
| directive = source.slice(token.start + 1, token.end - 1); |
| if (directive === 'use strict') { |
| strict = true; |
| if (firstRestricted) { |
| tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral); |
| } |
| } else { |
| if (!firstRestricted && token.octal) { |
| firstRestricted = token; |
| } |
| } |
| } |
| |
| oldLabelSet = state.labelSet; |
| oldInIteration = state.inIteration; |
| oldInSwitch = state.inSwitch; |
| oldInFunctionBody = state.inFunctionBody; |
| oldParenthesisCount = state.parenthesizedCount; |
| |
| state.labelSet = {}; |
| state.inIteration = false; |
| state.inSwitch = false; |
| state.inFunctionBody = true; |
| state.parenthesizedCount = 0; |
| |
| while (startIndex < length) { |
| if (match('}')) { |
| break; |
| } |
| body.push(parseStatementListItem()); |
| } |
| |
| expect('}'); |
| |
| state.labelSet = oldLabelSet; |
| state.inIteration = oldInIteration; |
| state.inSwitch = oldInSwitch; |
| state.inFunctionBody = oldInFunctionBody; |
| state.parenthesizedCount = oldParenthesisCount; |
| |
| return node.finishBlockStatement(body); |
| } |
| |
| function validateParam(options, param, name) { |
| var key = '$' + name; |
| if (strict) { |
| if (isRestrictedWord(name)) { |
| options.stricted = param; |
| options.message = Messages.StrictParamName; |
| } |
| if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { |
| options.stricted = param; |
| options.message = Messages.StrictParamDupe; |
| } |
| } else if (!options.firstRestricted) { |
| if (isRestrictedWord(name)) { |
| options.firstRestricted = param; |
| options.message = Messages.StrictParamName; |
| } else if (isStrictModeReservedWord(name)) { |
| options.firstRestricted = param; |
| options.message = Messages.StrictReservedWord; |
| } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { |
| options.stricted = param; |
| options.message = Messages.StrictParamDupe; |
| } |
| } |
| options.paramSet[key] = true; |
| } |
| |
| function parseParam(options) { |
| var token, param, params = [], i, def; |
| |
| token = lookahead; |
| if (token.value === '...') { |
| param = parseRestElement(params); |
| validateParam(options, param.argument, param.argument.name); |
| options.params.push(param); |
| options.defaults.push(null); |
| return false; |
| } |
| |
| param = parsePatternWithDefault(params); |
| for (i = 0; i < params.length; i++) { |
| validateParam(options, params[i], params[i].value); |
| } |
| |
| if (param.type === Syntax.AssignmentPattern) { |
| def = param.right; |
| param = param.left; |
| ++options.defaultCount; |
| } |
| |
| options.params.push(param); |
| options.defaults.push(def); |
| |
| return !match(')'); |
| } |
| |
| function parseParams(firstRestricted) { |
| var options; |
| |
| options = { |
| params: [], |
| defaultCount: 0, |
| defaults: [], |
| firstRestricted: firstRestricted |
| }; |
| |
| expect('('); |
| |
| if (!match(')')) { |
| options.paramSet = {}; |
| while (startIndex < length) { |
| if (!parseParam(options)) { |
| break; |
| } |
| expect(','); |
| } |
| } |
| |
| expect(')'); |
| |
| if (options.defaultCount === 0) { |
| options.defaults = []; |
| } |
| |
| return { |
| params: options.params, |
| defaults: options.defaults, |
| stricted: options.stricted, |
| firstRestricted: options.firstRestricted, |
| message: options.message |
| }; |
| } |
| |
| function parseFunctionDeclaration(node, identifierIsOptional) { |
| var id = null, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, |
| isGenerator, previousAllowYield; |
| |
| previousAllowYield = state.allowYield; |
| |
| expectKeyword('function'); |
| |
| isGenerator = match('*'); |
| if (isGenerator) { |
| lex(); |
| } |
| |
| if (!identifierIsOptional || !match('(')) { |
| token = lookahead; |
| id = parseVariableIdentifier(); |
| if (strict) { |
| if (isRestrictedWord(token.value)) { |
| tolerateUnexpectedToken(token, Messages.StrictFunctionName); |
| } |
| } else { |
| if (isRestrictedWord(token.value)) { |
| firstRestricted = token; |
| message = Messages.StrictFunctionName; |
| } else if (isStrictModeReservedWord(token.value)) { |
| firstRestricted = token; |
| message = Messages.StrictReservedWord; |
| } |
| } |
| } |
| |
| state.allowYield = !isGenerator; |
| tmp = parseParams(firstRestricted); |
| params = tmp.params; |
| defaults = tmp.defaults; |
| stricted = tmp.stricted; |
| firstRestricted = tmp.firstRestricted; |
| if (tmp.message) { |
| message = tmp.message; |
| } |
| |
| |
| previousStrict = strict; |
| body = parseFunctionSourceElements(); |
| if (strict && firstRestricted) { |
| throwUnexpectedToken(firstRestricted, message); |
| } |
| if (strict && stricted) { |
| tolerateUnexpectedToken(stricted, message); |
| } |
| |
| strict = previousStrict; |
| state.allowYield = previousAllowYield; |
| |
| return node.finishFunctionDeclaration(id, params, defaults, body, isGenerator); |
| } |
| |
| function parseFunctionExpression() { |
| var token, id = null, stricted, firstRestricted, message, tmp, |
| params = [], defaults = [], body, previousStrict, node = new Node(), |
| isGenerator, previousAllowYield; |
| |
| previousAllowYield = state.allowYield; |
| |
| expectKeyword('function'); |
| |
| isGenerator = match('*'); |
| if (isGenerator) { |
| lex(); |
| } |
| |
| state.allowYield = !isGenerator; |
| if (!match('(')) { |
| token = lookahead; |
| id = (!strict && !isGenerator && matchKeyword('yield')) ? parseNonComputedProperty() : parseVariableIdentifier(); |
| if (strict) { |
| if (isRestrictedWord(token.value)) { |
| tolerateUnexpectedToken(token, Messages.StrictFunctionName); |
| } |
| } else { |
| if (isRestrictedWord(token.value)) { |
| firstRestricted = token; |
| message = Messages.StrictFunctionName; |
| } else if (isStrictModeReservedWord(token.value)) { |
| firstRestricted = token; |
| message = Messages.StrictReservedWord; |
| } |
| } |
| } |
| |
| tmp = parseParams(firstRestricted); |
| params = tmp.params; |
| defaults = tmp.defaults; |
| stricted = tmp.stricted; |
| firstRestricted = tmp.firstRestricted; |
| if (tmp.message) { |
| message = tmp.message; |
| } |
| |
| previousStrict = strict; |
| body = parseFunctionSourceElements(); |
| if (strict && firstRestricted) { |
| throwUnexpectedToken(firstRestricted, message); |
| } |
| if (strict && stricted) { |
| tolerateUnexpectedToken(stricted, message); |
| } |
| strict = previousStrict; |
| state.allowYield = previousAllowYield; |
| |
| return node.finishFunctionExpression(id, params, defaults, body, isGenerator); |
| } |
| |
| // ECMA-262 14.5 Class Definitions |
| |
| function parseClassBody() { |
| var classBody, token, isStatic, hasConstructor = false, body, method, computed, key; |
| |
| classBody = new Node(); |
| |
| expect('{'); |
| body = []; |
| while (!match('}')) { |
| if (match(';')) { |
| lex(); |
| } else { |
| method = new Node(); |
| token = lookahead; |
| isStatic = false; |
| computed = match('['); |
| if (match('*')) { |
| lex(); |
| } else { |
| key = parseObjectPropertyKey(); |
| if (key.name === 'static' && (lookaheadPropertyName() || match('*'))) { |
| token = lookahead; |
| isStatic = true; |
| computed = match('['); |
| if (match('*')) { |
| lex(); |
| } else { |
| key = parseObjectPropertyKey(); |
| } |
| } |
| } |
| method = tryParseMethodDefinition(token, key, computed, method); |
| if (method) { |
| method['static'] = isStatic; // jscs:ignore requireDotNotation |
| if (method.kind === 'init') { |
| method.kind = 'method'; |
| } |
| if (!isStatic) { |
| if (!method.computed && (method.key.name || method.key.value.toString()) === 'constructor') { |
| if (method.kind !== 'method' || !method.method || method.value.generator) { |
| throwUnexpectedToken(token, Messages.ConstructorSpecialMethod); |
| } |
| if (hasConstructor) { |
| throwUnexpectedToken(token, Messages.DuplicateConstructor); |
| } else { |
| hasConstructor = true; |
| } |
| method.kind = 'constructor'; |
| } |
| } else { |
| if (!method.computed && (method.key.name || method.key.value.toString()) === 'prototype') { |
| throwUnexpectedToken(token, Messages.StaticPrototype); |
| } |
| } |
| method.type = Syntax.MethodDefinition; |
| delete method.method; |
| delete method.shorthand; |
| body.push(method); |
| } else { |
| throwUnexpectedToken(lookahead); |
| } |
| } |
| } |
| lex(); |
| return classBody.finishClassBody(body); |
| } |
| |
| function parseClassDeclaration(identifierIsOptional) { |
| var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict; |
| strict = true; |
| |
| expectKeyword('class'); |
| |
| if (!identifierIsOptional || lookahead.type === Token.Identifier) { |
| id = parseVariableIdentifier(); |
| } |
| |
| if (matchKeyword('extends')) { |
| lex(); |
| superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall); |
| } |
| classBody = parseClassBody(); |
| strict = previousStrict; |
| |
| return classNode.finishClassDeclaration(id, superClass, classBody); |
| } |
| |
| function parseClassExpression() { |
| var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict; |
| strict = true; |
| |
| expectKeyword('class'); |
| |
| if (lookahead.type === Token.Identifier) { |
| id = parseVariableIdentifier(); |
| } |
| |
| if (matchKeyword('extends')) { |
| lex(); |
| superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall); |
| } |
| classBody = parseClassBody(); |
| strict = previousStrict; |
| |
| return classNode.finishClassExpression(id, superClass, classBody); |
| } |
| |
| // ECMA-262 15.2 Modules |
| |
| function parseModuleSpecifier() { |
| var node = new Node(); |
| |
| if (lookahead.type !== Token.StringLiteral) { |
| throwError(Messages.InvalidModuleSpecifier); |
| } |
| return node.finishLiteral(lex()); |
| } |
| |
| // ECMA-262 15.2.3 Exports |
| |
| function parseExportSpecifier() { |
| var exported, local, node = new Node(), def; |
| if (matchKeyword('default')) { |
| // export {default} from 'something'; |
| def = new Node(); |
| lex(); |
| local = def.finishIdentifier('default'); |
| } else { |
| local = parseVariableIdentifier(); |
| } |
| if (matchContextualKeyword('as')) { |
| lex(); |
| exported = parseNonComputedProperty(); |
| } |
| return node.finishExportSpecifier(local, exported); |
| } |
| |
| function parseExportNamedDeclaration(node) { |
| var declaration = null, |
| isExportFromIdentifier, |
| src = null, specifiers = []; |
| |
| // non-default export |
| if (lookahead.type === Token.Keyword) { |
| // covers: |
| // export var f = 1; |
| switch (lookahead.value) { |
| case 'let': |
| case 'const': |
| declaration = parseLexicalDeclaration({inFor: false}); |
| return node.finishExportNamedDeclaration(declaration, specifiers, null); |
| case 'var': |
| case 'class': |
| case 'function': |
| declaration = parseStatementListItem(); |
| return node.finishExportNamedDeclaration(declaration, specifiers, null); |
| } |
| } |
| |
| expect('{'); |
| while (!match('}')) { |
| isExportFromIdentifier = isExportFromIdentifier || matchKeyword('default'); |
| specifiers.push(parseExportSpecifier()); |
| if (!match('}')) { |
| expect(','); |
| if (match('}')) { |
| break; |
| } |
| } |
| } |
| expect('}'); |
| |
| if (matchContextualKeyword('from')) { |
| // covering: |
| // export {default} from 'foo'; |
| // export {foo} from 'foo'; |
| lex(); |
| src = parseModuleSpecifier(); |
| consumeSemicolon(); |
| } else if (isExportFromIdentifier) { |
| // covering: |
| // export {default}; // missing fromClause |
| throwError(lookahead.value ? |
| Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); |
| } else { |
| // cover |
| // export {foo}; |
| consumeSemicolon(); |
| } |
| return node.finishExportNamedDeclaration(declaration, specifiers, src); |
| } |
| |
| function parseExportDefaultDeclaration(node) { |
| var declaration = null, |
| expression = null; |
| |
| // covers: |
| // export default ... |
| expectKeyword('default'); |
| |
| if (matchKeyword('function')) { |
| // covers: |
| // export default function foo () {} |
| // export default function () {} |
| declaration = parseFunctionDeclaration(new Node(), true); |
| return node.finishExportDefaultDeclaration(declaration); |
| } |
| if (matchKeyword('class')) { |
| declaration = parseClassDeclaration(true); |
| return node.finishExportDefaultDeclaration(declaration); |
| } |
| |
| if (matchContextualKeyword('from')) { |
| throwError(Messages.UnexpectedToken, lookahead.value); |
| } |
| |
| // covers: |
| // export default {}; |
| // export default []; |
| // export default (1 + 2); |
| if (match('{')) { |
| expression = parseObjectInitializer(); |
| } else if (match('[')) { |
| expression = parseArrayInitializer(); |
| } else { |
| expression = parseAssignmentExpression(); |
| } |
| consumeSemicolon(); |
| return node.finishExportDefaultDeclaration(expression); |
| } |
| |
| function parseExportAllDeclaration(node) { |
| var src; |
| |
| // covers: |
| // export * from 'foo'; |
| expect('*'); |
| if (!matchContextualKeyword('from')) { |
| throwError(lookahead.value ? |
| Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); |
| } |
| lex(); |
| src = parseModuleSpecifier(); |
| consumeSemicolon(); |
| |
| return node.finishExportAllDeclaration(src); |
| } |
| |
| function parseExportDeclaration() { |
| var node = new Node(); |
| if (state.inFunctionBody) { |
| throwError(Messages.IllegalExportDeclaration); |
| } |
| |
| expectKeyword('export'); |
| |
| if (matchKeyword('default')) { |
| return parseExportDefaultDeclaration(node); |
| } |
| if (match('*')) { |
| return parseExportAllDeclaration(node); |
| } |
| return parseExportNamedDeclaration(node); |
| } |
| |
| // ECMA-262 15.2.2 Imports |
| |
| function parseImportSpecifier() { |
| // import {<foo as bar>} ...; |
| var local, imported, node = new Node(); |
| |
| imported = parseNonComputedProperty(); |
| if (matchContextualKeyword('as')) { |
| lex(); |
| local = parseVariableIdentifier(); |
| } |
| |
| return node.finishImportSpecifier(local, imported); |
| } |
| |
| function parseNamedImports() { |
| var specifiers = []; |
| // {foo, bar as bas} |
| expect('{'); |
| while (!match('}')) { |
| specifiers.push(parseImportSpecifier()); |
| if (!match('}')) { |
| expect(','); |
| if (match('}')) { |
| break; |
| } |
| } |
| } |
| expect('}'); |
| return specifiers; |
| } |
| |
| function parseImportDefaultSpecifier() { |
| // import <foo> ...; |
| var local, node = new Node(); |
| |
| local = parseNonComputedProperty(); |
| |
| return node.finishImportDefaultSpecifier(local); |
| } |
| |
| function parseImportNamespaceSpecifier() { |
| // import <* as foo> ...; |
| var local, node = new Node(); |
| |
| expect('*'); |
| if (!matchContextualKeyword('as')) { |
| throwError(Messages.NoAsAfterImportNamespace); |
| } |
| lex(); |
| local = parseNonComputedProperty(); |
| |
| return node.finishImportNamespaceSpecifier(local); |
| } |
| |
| function parseImportDeclaration() { |
| var specifiers = [], src, node = new Node(); |
| |
| if (state.inFunctionBody) { |
| throwError(Messages.IllegalImportDeclaration); |
| } |
| |
| expectKeyword('import'); |
| |
| if (lookahead.type === Token.StringLiteral) { |
| // import 'foo'; |
| src = parseModuleSpecifier(); |
| } else { |
| |
| if (match('{')) { |
| // import {bar} |
| specifiers = specifiers.concat(parseNamedImports()); |
| } else if (match('*')) { |
| // import * as foo |
| specifiers.push(parseImportNamespaceSpecifier()); |
| } else if (isIdentifierName(lookahead) && !matchKeyword('default')) { |
| // import foo |
| specifiers.push(parseImportDefaultSpecifier()); |
| if (match(',')) { |
| lex(); |
| if (match('*')) { |
| // import foo, * as foo |
| specifiers.push(parseImportNamespaceSpecifier()); |
| } else if (match('{')) { |
| // import foo, {bar} |
| specifiers = specifiers.concat(parseNamedImports()); |
| } else { |
| throwUnexpectedToken(lookahead); |
| } |
| } |
| } else { |
| throwUnexpectedToken(lex()); |
| } |
| |
| if (!matchContextualKeyword('from')) { |
| throwError(lookahead.value ? |
| Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); |
| } |
| lex(); |
| src = parseModuleSpecifier(); |
| } |
| |
| consumeSemicolon(); |
| return node.finishImportDeclaration(specifiers, src); |
| } |
| |
| // ECMA-262 15.1 Scripts |
| |
| function parseScriptBody() { |
| var statement, body = [], token, directive, firstRestricted; |
| |
| while (startIndex < length) { |
| token = lookahead; |
| if (token.type !== Token.StringLiteral) { |
| break; |
| } |
| |
| statement = parseStatementListItem(); |
| body.push(statement); |
| if (statement.expression.type !== Syntax.Literal) { |
| // this is not directive |
| break; |
| } |
| directive = source.slice(token.start + 1, token.end - 1); |
| if (directive === 'use strict') { |
| strict = true; |
| if (firstRestricted) { |
| tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral); |
| } |
| } else { |
| if (!firstRestricted && token.octal) { |
| firstRestricted = token; |
| } |
| } |
| } |
| |
| while (startIndex < length) { |
| statement = parseStatementListItem(); |
| /* istanbul ignore if */ |
| if (typeof statement === 'undefined') { |
| break; |
| } |
| body.push(statement); |
| } |
| return body; |
| } |
| |
| function parseProgram() { |
| var body, node; |
| |
| peek(); |
| node = new Node(); |
| |
| body = parseScriptBody(); |
| return node.finishProgram(body, state.sourceType); |
| } |
| |
| function filterTokenLocation() { |
| var i, entry, token, tokens = []; |
| |
| for (i = 0; i < extra.tokens.length; ++i) { |
| entry = extra.tokens[i]; |
| token = { |
| type: entry.type, |
| value: entry.value |
| }; |
| if (entry.regex) { |
| token.regex = { |
| pattern: entry.regex.pattern, |
| flags: entry.regex.flags |
| }; |
| } |
| if (extra.range) { |
| token.range = entry.range; |
| } |
| if (extra.loc) { |
| token.loc = entry.loc; |
| } |
| tokens.push(token); |
| } |
| |
| extra.tokens = tokens; |
| } |
| |
| function tokenize(code, options, delegate) { |
| var toString, |
| tokens; |
| |
| toString = String; |
| if (typeof code !== 'string' && !(code instanceof String)) { |
| code = toString(code); |
| } |
| |
| source = code; |
| index = 0; |
| lineNumber = (source.length > 0) ? 1 : 0; |
| lineStart = 0; |
| startIndex = index; |
| startLineNumber = lineNumber; |
| startLineStart = lineStart; |
| length = source.length; |
| lookahead = null; |
| state = { |
| allowIn: true, |
| allowYield: true, |
| labelSet: {}, |
| inFunctionBody: false, |
| inIteration: false, |
| inSwitch: false, |
| lastCommentStart: -1, |
| curlyStack: [] |
| }; |
| |
| extra = {}; |
| |
| // Options matching. |
| options = options || {}; |
| |
| // Of course we collect tokens here. |
| options.tokens = true; |
| extra.tokens = []; |
| extra.tokenValues = []; |
| extra.tokenize = true; |
| extra.delegate = delegate; |
| |
| // The following two fields are necessary to compute the Regex tokens. |
| extra.openParenToken = -1; |
| extra.openCurlyToken = -1; |
| |
| extra.range = (typeof options.range === 'boolean') && options.range; |
| extra.loc = (typeof options.loc === 'boolean') && options.loc; |
| |
| if (typeof options.comment === 'boolean' && options.comment) { |
| extra.comments = []; |
| } |
| if (typeof options.tolerant === 'boolean' && options.tolerant) { |
| extra.errors = []; |
| } |
| |
| try { |
| peek(); |
| if (lookahead.type === Token.EOF) { |
| return extra.tokens; |
| } |
| |
| lex(); |
| while (lookahead.type !== Token.EOF) { |
| try { |
| lex(); |
| } catch (lexError) { |
| if (extra.errors) { |
| recordError(lexError); |
| // We have to break on the first error |
| // to avoid infinite loops. |
| break; |
| } else { |
| throw lexError; |
| } |
| } |
| } |
| |
| tokens = extra.tokens; |
| if (typeof extra.errors !== 'undefined') { |
| tokens.errors = extra.errors; |
| } |
| } catch (e) { |
| throw e; |
| } finally { |
| extra = {}; |
| } |
| return tokens; |
| } |
| |
| function parse(code, options) { |
| var program, toString; |
| |
| toString = String; |
| if (typeof code !== 'string' && !(code instanceof String)) { |
| code = toString(code); |
| } |
| |
| source = code; |
| index = 0; |
| lineNumber = (source.length > 0) ? 1 : 0; |
| lineStart = 0; |
| startIndex = index; |
| startLineNumber = lineNumber; |
| startLineStart = lineStart; |
| length = source.length; |
| lookahead = null; |
| state = { |
| allowIn: true, |
| allowYield: true, |
| labelSet: {}, |
| inFunctionBody: false, |
| inIteration: false, |
| inSwitch: false, |
| lastCommentStart: -1, |
| curlyStack: [], |
| sourceType: 'script' |
| }; |
| strict = false; |
| |
| extra = {}; |
| if (typeof options !== 'undefined') { |
| extra.range = (typeof options.range === 'boolean') && options.range; |
| extra.loc = (typeof options.loc === 'boolean') && options.loc; |
| extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment; |
| |
| if (extra.loc && options.source !== null && options.source !== undefined) { |
| extra.source = toString(options.source); |
| } |
| |
| if (typeof options.tokens === 'boolean' && options.tokens) { |
| extra.tokens = []; |
| } |
| if (typeof options.comment === 'boolean' && options.comment) { |
| extra.comments = []; |
| } |
| if (typeof options.tolerant === 'boolean' && options.tolerant) { |
| extra.errors = []; |
| } |
| if (extra.attachComment) { |
| extra.range = true; |
| extra.comments = []; |
| extra.bottomRightStack = []; |
| extra.trailingComments = []; |
| extra.leadingComments = []; |
| } |
| if (options.sourceType === 'module') { |
| // very restrictive condition for now |
| state.sourceType = options.sourceType; |
| strict = true; |
| } |
| } |
| |
| try { |
| program = parseProgram(); |
| if (typeof extra.comments !== 'undefined') { |
| program.comments = extra.comments; |
| } |
| if (typeof extra.tokens !== 'undefined') { |
| filterTokenLocation(); |
| program.tokens = extra.tokens; |
| } |
| if (typeof extra.errors !== 'undefined') { |
| program.errors = extra.errors; |
| } |
| } catch (e) { |
| throw e; |
| } finally { |
| extra = {}; |
| } |
| |
| return program; |
| } |
| |
| // Sync with *.json manifests. |
| exports.version = '2.7.1'; |
| |
| exports.tokenize = tokenize; |
| |
| exports.parse = parse; |
| |
| // Deep copy. |
| /* istanbul ignore next */ |
| exports.Syntax = (function () { |
| var name, types = {}; |
| |
| if (typeof Object.create === 'function') { |
| types = Object.create(null); |
| } |
| |
| for (name in Syntax) { |
| if (Syntax.hasOwnProperty(name)) { |
| types[name] = Syntax[name]; |
| } |
| } |
| |
| if (typeof Object.freeze === 'function') { |
| Object.freeze(types); |
| } |
| |
| return types; |
| }()); |
| |
| })); |
| /* vim: set sw=4 ts=4 et tw=80 : */ |
| |
| },{}],51:[function(require,module,exports){ |
| /*! |
| * node-inherit |
| * Copyright(c) 2011 Dmitry Filatov <dfilatov@yandex-team.ru> |
| * MIT Licensed |
| */ |
| |
| module.exports = require('./lib/inherit'); |
| |
| },{"./lib/inherit":52}],52:[function(require,module,exports){ |
| /** |
| * @module inherit |
| * @version 2.2.2 |
| * @author Filatov Dmitry <dfilatov@yandex-team.ru> |
| * @description This module provides some syntax sugar for "class" declarations, constructors, mixins, "super" calls and static members. |
| */ |
| |
| (function(global) { |
| |
| var hasIntrospection = (function(){'_';}).toString().indexOf('_') > -1, |
| emptyBase = function() {}, |
| hasOwnProperty = Object.prototype.hasOwnProperty, |
| objCreate = Object.create || function(ptp) { |
| var inheritance = function() {}; |
| inheritance.prototype = ptp; |
| return new inheritance(); |
| }, |
| objKeys = Object.keys || function(obj) { |
| var res = []; |
| for(var i in obj) { |
| hasOwnProperty.call(obj, i) && res.push(i); |
| } |
| return res; |
| }, |
| extend = function(o1, o2) { |
| for(var i in o2) { |
| hasOwnProperty.call(o2, i) && (o1[i] = o2[i]); |
| } |
| |
| return o1; |
| }, |
| toStr = Object.prototype.toString, |
| isArray = Array.isArray || function(obj) { |
| return toStr.call(obj) === '[object Array]'; |
| }, |
| isFunction = function(obj) { |
| return toStr.call(obj) === '[object Function]'; |
| }, |
| noOp = function() {}, |
| needCheckProps = true, |
| testPropObj = { toString : '' }; |
| |
| for(var i in testPropObj) { // fucking ie hasn't toString, valueOf in for |
| testPropObj.hasOwnProperty(i) && (needCheckProps = false); |
| } |
| |
| var specProps = needCheckProps? ['toString', 'valueOf'] : null; |
| |
| function getPropList(obj) { |
| var res = objKeys(obj); |
| if(needCheckProps) { |
| var specProp, i = 0; |
| while(specProp = specProps[i++]) { |
| obj.hasOwnProperty(specProp) && res.push(specProp); |
| } |
| } |
| |
| return res; |
| } |
| |
| function override(base, res, add) { |
| var addList = getPropList(add), |
| j = 0, len = addList.length, |
| name, prop; |
| while(j < len) { |
| if((name = addList[j++]) === '__self') { |
| continue; |
| } |
| prop = add[name]; |
| if(isFunction(prop) && |
| (!hasIntrospection || prop.toString().indexOf('.__base') > -1)) { |
| res[name] = (function(name, prop) { |
| var baseMethod = base[name]? |
| base[name] : |
| name === '__constructor'? // case of inheritance from plane function |
| res.__self.__parent : |
| noOp; |
| return function() { |
| var baseSaved = this.__base; |
| this.__base = baseMethod; |
| var res = prop.apply(this, arguments); |
| this.__base = baseSaved; |
| return res; |
| }; |
| })(name, prop); |
| } else { |
| res[name] = prop; |
| } |
| } |
| } |
| |
| function applyMixins(mixins, res) { |
| var i = 1, mixin; |
| while(mixin = mixins[i++]) { |
| res? |
| isFunction(mixin)? |
| inherit.self(res, mixin.prototype, mixin) : |
| inherit.self(res, mixin) : |
| res = isFunction(mixin)? |
| inherit(mixins[0], mixin.prototype, mixin) : |
| inherit(mixins[0], mixin); |
| } |
| return res || mixins[0]; |
| } |
| |
| /** |
| * Creates class |
| * @exports |
| * @param {Function|Array} [baseClass|baseClassAndMixins] class (or class and mixins) to inherit from |
| * @param {Object} prototypeFields |
| * @param {Object} [staticFields] |
| * @returns {Function} class |
| */ |
| function inherit() { |
| var args = arguments, |
| withMixins = isArray(args[0]), |
| hasBase = withMixins || isFunction(args[0]), |
| base = hasBase? withMixins? applyMixins(args[0]) : args[0] : emptyBase, |
| props = args[hasBase? 1 : 0] || {}, |
| staticProps = args[hasBase? 2 : 1], |
| res = props.__constructor || (hasBase && base.prototype.__constructor)? |
| function() { |
| return this.__constructor.apply(this, arguments); |
| } : |
| hasBase? |
| function() { |
| return base.apply(this, arguments); |
| } : |
| function() {}; |
| |
| if(!hasBase) { |
| res.prototype = props; |
| res.prototype.__self = res.prototype.constructor = res; |
| return extend(res, staticProps); |
| } |
| |
| extend(res, base); |
| |
| res.__parent = base; |
| |
| var basePtp = base.prototype, |
| resPtp = res.prototype = objCreate(basePtp); |
| |
| resPtp.__self = resPtp.constructor = res; |
| |
| props && override(basePtp, resPtp, props); |
| staticProps && override(base, res, staticProps); |
| |
| return res; |
| } |
| |
| inherit.self = function() { |
| var args = arguments, |
| withMixins = isArray(args[0]), |
| base = withMixins? applyMixins(args[0], args[0][0]) : args[0], |
| props = args[1], |
| staticProps = args[2], |
| basePtp = base.prototype; |
| |
| props && override(basePtp, basePtp, props); |
| staticProps && override(base, base, staticProps); |
| |
| return base; |
| }; |
| |
| var defineAsGlobal = true; |
| if(typeof exports === 'object') { |
| module.exports = inherit; |
| defineAsGlobal = false; |
| } |
| |
| if(typeof modules === 'object') { |
| modules.define('inherit', function(provide) { |
| provide(inherit); |
| }); |
| defineAsGlobal = false; |
| } |
| |
| if(typeof define === 'function') { |
| define(function(require, exports, module) { |
| module.exports = inherit; |
| }); |
| defineAsGlobal = false; |
| } |
| |
| defineAsGlobal && (global.inherit = inherit); |
| |
| })(this); |
| |
| },{}],53:[function(require,module,exports){ |
| var baseIndexOf = require('../internal/baseIndexOf'), |
| binaryIndex = require('../internal/binaryIndex'); |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMax = Math.max; |
| |
| /** |
| * Gets the index at which the first occurrence of `value` is found in `array` |
| * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) |
| * for equality comparisons. If `fromIndex` is negative, it's used as the offset |
| * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` |
| * performs a faster binary search. |
| * |
| * @static |
| * @memberOf _ |
| * @category Array |
| * @param {Array} array The array to search. |
| * @param {*} value The value to search for. |
| * @param {boolean|number} [fromIndex=0] The index to search from or `true` |
| * to perform a binary search on a sorted array. |
| * @returns {number} Returns the index of the matched value, else `-1`. |
| * @example |
| * |
| * _.indexOf([1, 2, 1, 2], 2); |
| * // => 1 |
| * |
| * // using `fromIndex` |
| * _.indexOf([1, 2, 1, 2], 2, 2); |
| * // => 3 |
| * |
| * // performing a binary search |
| * _.indexOf([1, 1, 2, 2], 2, true); |
| * // => 2 |
| */ |
| function indexOf(array, value, fromIndex) { |
| var length = array ? array.length : 0; |
| if (!length) { |
| return -1; |
| } |
| if (typeof fromIndex == 'number') { |
| fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; |
| } else if (fromIndex) { |
| var index = binaryIndex(array, value); |
| if (index < length && |
| (value === value ? (value === array[index]) : (array[index] !== array[index]))) { |
| return index; |
| } |
| return -1; |
| } |
| return baseIndexOf(array, value, fromIndex || 0); |
| } |
| |
| module.exports = indexOf; |
| |
| },{"../internal/baseIndexOf":82,"../internal/binaryIndex":96}],54:[function(require,module,exports){ |
| /** |
| * Gets the last element of `array`. |
| * |
| * @static |
| * @memberOf _ |
| * @category Array |
| * @param {Array} array The array to query. |
| * @returns {*} Returns the last element of `array`. |
| * @example |
| * |
| * _.last([1, 2, 3]); |
| * // => 3 |
| */ |
| function last(array) { |
| var length = array ? array.length : 0; |
| return length ? array[length - 1] : undefined; |
| } |
| |
| module.exports = last; |
| |
| },{}],55:[function(require,module,exports){ |
| var LazyWrapper = require('../internal/LazyWrapper'), |
| LodashWrapper = require('../internal/LodashWrapper'), |
| baseLodash = require('../internal/baseLodash'), |
| isArray = require('../lang/isArray'), |
| isObjectLike = require('../internal/isObjectLike'), |
| wrapperClone = require('../internal/wrapperClone'); |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** |
| * Creates a `lodash` object which wraps `value` to enable implicit chaining. |
| * Methods that operate on and return arrays, collections, and functions can |
| * be chained together. Methods that retrieve a single value or may return a |
| * primitive value will automatically end the chain returning the unwrapped |
| * value. Explicit chaining may be enabled using `_.chain`. The execution of |
| * chained methods is lazy, that is, execution is deferred until `_#value` |
| * is implicitly or explicitly called. |
| * |
| * Lazy evaluation allows several methods to support shortcut fusion. Shortcut |
| * fusion is an optimization strategy which merge iteratee calls; this can help |
| * to avoid the creation of intermediate data structures and greatly reduce the |
| * number of iteratee executions. |
| * |
| * Chaining is supported in custom builds as long as the `_#value` method is |
| * directly or indirectly included in the build. |
| * |
| * In addition to lodash methods, wrappers have `Array` and `String` methods. |
| * |
| * The wrapper `Array` methods are: |
| * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, |
| * `splice`, and `unshift` |
| * |
| * The wrapper `String` methods are: |
| * `replace` and `split` |
| * |
| * The wrapper methods that support shortcut fusion are: |
| * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, |
| * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, |
| * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, |
| * and `where` |
| * |
| * The chainable wrapper methods are: |
| * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, |
| * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, |
| * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, |
| * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`, |
| * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, |
| * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, |
| * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, |
| * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, |
| * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`, |
| * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`, |
| * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`, |
| * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, |
| * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, |
| * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, |
| * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, |
| * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`, |
| * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith` |
| * |
| * The wrapper methods that are **not** chainable by default are: |
| * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, |
| * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, |
| * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, |
| * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, |
| * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, |
| * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`, |
| * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, |
| * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, |
| * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`, |
| * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`, |
| * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`, |
| * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, |
| * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, |
| * `unescape`, `uniqueId`, `value`, and `words` |
| * |
| * The wrapper method `sample` will return a wrapped value when `n` is provided, |
| * otherwise an unwrapped value is returned. |
| * |
| * @name _ |
| * @constructor |
| * @category Chain |
| * @param {*} value The value to wrap in a `lodash` instance. |
| * @returns {Object} Returns the new `lodash` wrapper instance. |
| * @example |
| * |
| * var wrapped = _([1, 2, 3]); |
| * |
| * // returns an unwrapped value |
| * wrapped.reduce(function(total, n) { |
| * return total + n; |
| * }); |
| * // => 6 |
| * |
| * // returns a wrapped value |
| * var squares = wrapped.map(function(n) { |
| * return n * n; |
| * }); |
| * |
| * _.isArray(squares); |
| * // => false |
| * |
| * _.isArray(squares.value()); |
| * // => true |
| */ |
| function lodash(value) { |
| if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { |
| if (value instanceof LodashWrapper) { |
| return value; |
| } |
| if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { |
| return wrapperClone(value); |
| } |
| } |
| return new LodashWrapper(value); |
| } |
| |
| // Ensure wrappers are instances of `baseLodash`. |
| lodash.prototype = baseLodash.prototype; |
| |
| module.exports = lodash; |
| |
| },{"../internal/LazyWrapper":64,"../internal/LodashWrapper":65,"../internal/baseLodash":86,"../internal/isObjectLike":130,"../internal/wrapperClone":141,"../lang/isArray":144}],56:[function(require,module,exports){ |
| module.exports = require('./forEach'); |
| |
| },{"./forEach":58}],57:[function(require,module,exports){ |
| var baseEach = require('../internal/baseEach'), |
| createFind = require('../internal/createFind'); |
| |
| /** |
| * Iterates over elements of `collection`, returning the first element |
| * `predicate` returns truthy for. The predicate is bound to `thisArg` and |
| * invoked with three arguments: (value, index|key, collection). |
| * |
| * If a property name is provided for `predicate` the created `_.property` |
| * style callback returns the property value of the given element. |
| * |
| * If a value is also provided for `thisArg` the created `_.matchesProperty` |
| * style callback returns `true` for elements that have a matching property |
| * value, else `false`. |
| * |
| * If an object is provided for `predicate` the created `_.matches` style |
| * callback returns `true` for elements that have the properties of the given |
| * object, else `false`. |
| * |
| * @static |
| * @memberOf _ |
| * @alias detect |
| * @category Collection |
| * @param {Array|Object|string} collection The collection to search. |
| * @param {Function|Object|string} [predicate=_.identity] The function invoked |
| * per iteration. |
| * @param {*} [thisArg] The `this` binding of `predicate`. |
| * @returns {*} Returns the matched element, else `undefined`. |
| * @example |
| * |
| * var users = [ |
| * { 'user': 'barney', 'age': 36, 'active': true }, |
| * { 'user': 'fred', 'age': 40, 'active': false }, |
| * { 'user': 'pebbles', 'age': 1, 'active': true } |
| * ]; |
| * |
| * _.result(_.find(users, function(chr) { |
| * return chr.age < 40; |
| * }), 'user'); |
| * // => 'barney' |
| * |
| * // using the `_.matches` callback shorthand |
| * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); |
| * // => 'pebbles' |
| * |
| * // using the `_.matchesProperty` callback shorthand |
| * _.result(_.find(users, 'active', false), 'user'); |
| * // => 'fred' |
| * |
| * // using the `_.property` callback shorthand |
| * _.result(_.find(users, 'active'), 'user'); |
| * // => 'barney' |
| */ |
| var find = createFind(baseEach); |
| |
| module.exports = find; |
| |
| },{"../internal/baseEach":75,"../internal/createFind":106}],58:[function(require,module,exports){ |
| var arrayEach = require('../internal/arrayEach'), |
| baseEach = require('../internal/baseEach'), |
| createForEach = require('../internal/createForEach'); |
| |
| /** |
| * Iterates over elements of `collection` invoking `iteratee` for each element. |
| * The `iteratee` is bound to `thisArg` and invoked with three arguments: |
| * (value, index|key, collection). Iteratee functions may exit iteration early |
| * by explicitly returning `false`. |
| * |
| * **Note:** As with other "Collections" methods, objects with a "length" property |
| * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` |
| * may be used for object iteration. |
| * |
| * @static |
| * @memberOf _ |
| * @alias each |
| * @category Collection |
| * @param {Array|Object|string} collection The collection to iterate over. |
| * @param {Function} [iteratee=_.identity] The function invoked per iteration. |
| * @param {*} [thisArg] The `this` binding of `iteratee`. |
| * @returns {Array|Object|string} Returns `collection`. |
| * @example |
| * |
| * _([1, 2]).forEach(function(n) { |
| * console.log(n); |
| * }).value(); |
| * // => logs each value from left to right and returns the array |
| * |
| * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { |
| * console.log(n, key); |
| * }); |
| * // => logs each value-key pair and returns the object (iteration order is not guaranteed) |
| */ |
| var forEach = createForEach(arrayEach, baseEach); |
| |
| module.exports = forEach; |
| |
| },{"../internal/arrayEach":67,"../internal/baseEach":75,"../internal/createForEach":107}],59:[function(require,module,exports){ |
| var baseIndexOf = require('../internal/baseIndexOf'), |
| getLength = require('../internal/getLength'), |
| isArray = require('../lang/isArray'), |
| isIterateeCall = require('../internal/isIterateeCall'), |
| isLength = require('../internal/isLength'), |
| isString = require('../lang/isString'), |
| values = require('../object/values'); |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMax = Math.max; |
| |
| /** |
| * Checks if `target` is in `collection` using |
| * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) |
| * for equality comparisons. If `fromIndex` is negative, it's used as the offset |
| * from the end of `collection`. |
| * |
| * @static |
| * @memberOf _ |
| * @alias contains, include |
| * @category Collection |
| * @param {Array|Object|string} collection The collection to search. |
| * @param {*} target The value to search for. |
| * @param {number} [fromIndex=0] The index to search from. |
| * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. |
| * @returns {boolean} Returns `true` if a matching element is found, else `false`. |
| * @example |
| * |
| * _.includes([1, 2, 3], 1); |
| * // => true |
| * |
| * _.includes([1, 2, 3], 1, 2); |
| * // => false |
| * |
| * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); |
| * // => true |
| * |
| * _.includes('pebbles', 'eb'); |
| * // => true |
| */ |
| function includes(collection, target, fromIndex, guard) { |
| var length = collection ? getLength(collection) : 0; |
| if (!isLength(length)) { |
| collection = values(collection); |
| length = collection.length; |
| } |
| if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { |
| fromIndex = 0; |
| } else { |
| fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); |
| } |
| return (typeof collection == 'string' || !isArray(collection) && isString(collection)) |
| ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) |
| : (!!length && baseIndexOf(collection, target, fromIndex) > -1); |
| } |
| |
| module.exports = includes; |
| |
| },{"../internal/baseIndexOf":82,"../internal/getLength":116,"../internal/isIterateeCall":126,"../internal/isLength":129,"../lang/isArray":144,"../lang/isString":150,"../object/values":156}],60:[function(require,module,exports){ |
| var arrayMap = require('../internal/arrayMap'), |
| baseCallback = require('../internal/baseCallback'), |
| baseMap = require('../internal/baseMap'), |
| isArray = require('../lang/isArray'); |
| |
| /** |
| * Creates an array of values by running each element in `collection` through |
| * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three |
| * arguments: (value, index|key, collection). |
| * |
| * If a property name is provided for `iteratee` the created `_.property` |
| * style callback returns the property value of the given element. |
| * |
| * If a value is also provided for `thisArg` the created `_.matchesProperty` |
| * style callback returns `true` for elements that have a matching property |
| * value, else `false`. |
| * |
| * If an object is provided for `iteratee` the created `_.matches` style |
| * callback returns `true` for elements that have the properties of the given |
| * object, else `false`. |
| * |
| * Many lodash methods are guarded to work as iteratees for methods like |
| * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. |
| * |
| * The guarded methods are: |
| * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, |
| * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, |
| * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, |
| * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, |
| * `sum`, `uniq`, and `words` |
| * |
| * @static |
| * @memberOf _ |
| * @alias collect |
| * @category Collection |
| * @param {Array|Object|string} collection The collection to iterate over. |
| * @param {Function|Object|string} [iteratee=_.identity] The function invoked |
| * per iteration. |
| * @param {*} [thisArg] The `this` binding of `iteratee`. |
| * @returns {Array} Returns the new mapped array. |
| * @example |
| * |
| * function timesThree(n) { |
| * return n * 3; |
| * } |
| * |
| * _.map([1, 2], timesThree); |
| * // => [3, 6] |
| * |
| * _.map({ 'a': 1, 'b': 2 }, timesThree); |
| * // => [3, 6] (iteration order is not guaranteed) |
| * |
| * var users = [ |
| * { 'user': 'barney' }, |
| * { 'user': 'fred' } |
| * ]; |
| * |
| * // using the `_.property` callback shorthand |
| * _.map(users, 'user'); |
| * // => ['barney', 'fred'] |
| */ |
| function map(collection, iteratee, thisArg) { |
| var func = isArray(collection) ? arrayMap : baseMap; |
| iteratee = baseCallback(iteratee, thisArg, 3); |
| return func(collection, iteratee); |
| } |
| |
| module.exports = map; |
| |
| },{"../internal/arrayMap":68,"../internal/baseCallback":71,"../internal/baseMap":87,"../lang/isArray":144}],61:[function(require,module,exports){ |
| var getNative = require('../internal/getNative'); |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeNow = getNative(Date, 'now'); |
| |
| /** |
| * Gets the number of milliseconds that have elapsed since the Unix epoch |
| * (1 January 1970 00:00:00 UTC). |
| * |
| * @static |
| * @memberOf _ |
| * @category Date |
| * @example |
| * |
| * _.defer(function(stamp) { |
| * console.log(_.now() - stamp); |
| * }, _.now()); |
| * // => logs the number of milliseconds it took for the deferred function to be invoked |
| */ |
| var now = nativeNow || function() { |
| return new Date().getTime(); |
| }; |
| |
| module.exports = now; |
| |
| },{"../internal/getNative":118}],62:[function(require,module,exports){ |
| var createWrapper = require('../internal/createWrapper'), |
| replaceHolders = require('../internal/replaceHolders'), |
| restParam = require('./restParam'); |
| |
| /** Used to compose bitmasks for wrapper metadata. */ |
| var BIND_FLAG = 1, |
| PARTIAL_FLAG = 32; |
| |
| /** |
| * Creates a function that invokes `func` with the `this` binding of `thisArg` |
| * and prepends any additional `_.bind` arguments to those provided to the |
| * bound function. |
| * |
| * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, |
| * may be used as a placeholder for partially applied arguments. |
| * |
| * **Note:** Unlike native `Function#bind` this method does not set the "length" |
| * property of bound functions. |
| * |
| * @static |
| * @memberOf _ |
| * @category Function |
| * @param {Function} func The function to bind. |
| * @param {*} thisArg The `this` binding of `func`. |
| * @param {...*} [partials] The arguments to be partially applied. |
| * @returns {Function} Returns the new bound function. |
| * @example |
| * |
| * var greet = function(greeting, punctuation) { |
| * return greeting + ' ' + this.user + punctuation; |
| * }; |
| * |
| * var object = { 'user': 'fred' }; |
| * |
| * var bound = _.bind(greet, object, 'hi'); |
| * bound('!'); |
| * // => 'hi fred!' |
| * |
| * // using placeholders |
| * var bound = _.bind(greet, object, _, '!'); |
| * bound('hi'); |
| * // => 'hi fred!' |
| */ |
| var bind = restParam(function(func, thisArg, partials) { |
| var bitmask = BIND_FLAG; |
| if (partials.length) { |
| var holders = replaceHolders(partials, bind.placeholder); |
| bitmask |= PARTIAL_FLAG; |
| } |
| return createWrapper(func, bitmask, thisArg, partials, holders); |
| }); |
| |
| // Assign default placeholders. |
| bind.placeholder = {}; |
| |
| module.exports = bind; |
| |
| },{"../internal/createWrapper":110,"../internal/replaceHolders":136,"./restParam":63}],63:[function(require,module,exports){ |
| /** Used as the `TypeError` message for "Functions" methods. */ |
| var FUNC_ERROR_TEXT = 'Expected a function'; |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMax = Math.max; |
| |
| /** |
| * Creates a function that invokes `func` with the `this` binding of the |
| * created function and arguments from `start` and beyond provided as an array. |
| * |
| * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters). |
| * |
| * @static |
| * @memberOf _ |
| * @category Function |
| * @param {Function} func The function to apply a rest parameter to. |
| * @param {number} [start=func.length-1] The start position of the rest parameter. |
| * @returns {Function} Returns the new function. |
| * @example |
| * |
| * var say = _.restParam(function(what, names) { |
| * return what + ' ' + _.initial(names).join(', ') + |
| * (_.size(names) > 1 ? ', & ' : '') + _.last(names); |
| * }); |
| * |
| * say('hello', 'fred', 'barney', 'pebbles'); |
| * // => 'hello fred, barney, & pebbles' |
| */ |
| function restParam(func, start) { |
| if (typeof func != 'function') { |
| throw new TypeError(FUNC_ERROR_TEXT); |
| } |
| start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); |
| return function() { |
| var args = arguments, |
| index = -1, |
| length = nativeMax(args.length - start, 0), |
| rest = Array(length); |
| |
| while (++index < length) { |
| rest[index] = args[start + index]; |
| } |
| switch (start) { |
| case 0: return func.call(this, rest); |
| case 1: return func.call(this, args[0], rest); |
| case 2: return func.call(this, args[0], args[1], rest); |
| } |
| var otherArgs = Array(start + 1); |
| index = -1; |
| while (++index < start) { |
| otherArgs[index] = args[index]; |
| } |
| otherArgs[start] = rest; |
| return func.apply(this, otherArgs); |
| }; |
| } |
| |
| module.exports = restParam; |
| |
| },{}],64:[function(require,module,exports){ |
| var baseCreate = require('./baseCreate'), |
| baseLodash = require('./baseLodash'); |
| |
| /** Used as references for `-Infinity` and `Infinity`. */ |
| var POSITIVE_INFINITY = Number.POSITIVE_INFINITY; |
| |
| /** |
| * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. |
| * |
| * @private |
| * @param {*} value The value to wrap. |
| */ |
| function LazyWrapper(value) { |
| this.__wrapped__ = value; |
| this.__actions__ = []; |
| this.__dir__ = 1; |
| this.__filtered__ = false; |
| this.__iteratees__ = []; |
| this.__takeCount__ = POSITIVE_INFINITY; |
| this.__views__ = []; |
| } |
| |
| LazyWrapper.prototype = baseCreate(baseLodash.prototype); |
| LazyWrapper.prototype.constructor = LazyWrapper; |
| |
| module.exports = LazyWrapper; |
| |
| },{"./baseCreate":74,"./baseLodash":86}],65:[function(require,module,exports){ |
| var baseCreate = require('./baseCreate'), |
| baseLodash = require('./baseLodash'); |
| |
| /** |
| * The base constructor for creating `lodash` wrapper objects. |
| * |
| * @private |
| * @param {*} value The value to wrap. |
| * @param {boolean} [chainAll] Enable chaining for all wrapper methods. |
| * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. |
| */ |
| function LodashWrapper(value, chainAll, actions) { |
| this.__wrapped__ = value; |
| this.__actions__ = actions || []; |
| this.__chain__ = !!chainAll; |
| } |
| |
| LodashWrapper.prototype = baseCreate(baseLodash.prototype); |
| LodashWrapper.prototype.constructor = LodashWrapper; |
| |
| module.exports = LodashWrapper; |
| |
| },{"./baseCreate":74,"./baseLodash":86}],66:[function(require,module,exports){ |
| /** |
| * Copies the values of `source` to `array`. |
| * |
| * @private |
| * @param {Array} source The array to copy values from. |
| * @param {Array} [array=[]] The array to copy values to. |
| * @returns {Array} Returns `array`. |
| */ |
| function arrayCopy(source, array) { |
| var index = -1, |
| length = source.length; |
| |
| array || (array = Array(length)); |
| while (++index < length) { |
| array[index] = source[index]; |
| } |
| return array; |
| } |
| |
| module.exports = arrayCopy; |
| |
| },{}],67:[function(require,module,exports){ |
| /** |
| * A specialized version of `_.forEach` for arrays without support for callback |
| * shorthands and `this` binding. |
| * |
| * @private |
| * @param {Array} array The array to iterate over. |
| * @param {Function} iteratee The function invoked per iteration. |
| * @returns {Array} Returns `array`. |
| */ |
| function arrayEach(array, iteratee) { |
| var index = -1, |
| length = array.length; |
| |
| while (++index < length) { |
| if (iteratee(array[index], index, array) === false) { |
| break; |
| } |
| } |
| return array; |
| } |
| |
| module.exports = arrayEach; |
| |
| },{}],68:[function(require,module,exports){ |
| /** |
| * A specialized version of `_.map` for arrays without support for callback |
| * shorthands and `this` binding. |
| * |
| * @private |
| * @param {Array} array The array to iterate over. |
| * @param {Function} iteratee The function invoked per iteration. |
| * @returns {Array} Returns the new mapped array. |
| */ |
| function arrayMap(array, iteratee) { |
| var index = -1, |
| length = array.length, |
| result = Array(length); |
| |
| while (++index < length) { |
| result[index] = iteratee(array[index], index, array); |
| } |
| return result; |
| } |
| |
| module.exports = arrayMap; |
| |
| },{}],69:[function(require,module,exports){ |
| /** |
| * A specialized version of `_.some` for arrays without support for callback |
| * shorthands and `this` binding. |
| * |
| * @private |
| * @param {Array} array The array to iterate over. |
| * @param {Function} predicate The function invoked per iteration. |
| * @returns {boolean} Returns `true` if any element passes the predicate check, |
| * else `false`. |
| */ |
| function arraySome(array, predicate) { |
| var index = -1, |
| length = array.length; |
| |
| while (++index < length) { |
| if (predicate(array[index], index, array)) { |
| return true; |
| } |
| } |
| return false; |
| } |
| |
| module.exports = arraySome; |
| |
| },{}],70:[function(require,module,exports){ |
| var baseCopy = require('./baseCopy'), |
| keys = require('../object/keys'); |
| |
| /** |
| * The base implementation of `_.assign` without support for argument juggling, |
| * multiple sources, and `customizer` functions. |
| * |
| * @private |
| * @param {Object} object The destination object. |
| * @param {Object} source The source object. |
| * @returns {Object} Returns `object`. |
| */ |
| function baseAssign(object, source) { |
| return source == null |
| ? object |
| : baseCopy(source, keys(source), object); |
| } |
| |
| module.exports = baseAssign; |
| |
| },{"../object/keys":153,"./baseCopy":73}],71:[function(require,module,exports){ |
| var baseMatches = require('./baseMatches'), |
| baseMatchesProperty = require('./baseMatchesProperty'), |
| bindCallback = require('./bindCallback'), |
| identity = require('../utility/identity'), |
| property = require('../utility/property'); |
| |
| /** |
| * The base implementation of `_.callback` which supports specifying the |
| * number of arguments to provide to `func`. |
| * |
| * @private |
| * @param {*} [func=_.identity] The value to convert to a callback. |
| * @param {*} [thisArg] The `this` binding of `func`. |
| * @param {number} [argCount] The number of arguments to provide to `func`. |
| * @returns {Function} Returns the callback. |
| */ |
| function baseCallback(func, thisArg, argCount) { |
| var type = typeof func; |
| if (type == 'function') { |
| return thisArg === undefined |
| ? func |
| : bindCallback(func, thisArg, argCount); |
| } |
| if (func == null) { |
| return identity; |
| } |
| if (type == 'object') { |
| return baseMatches(func); |
| } |
| return thisArg === undefined |
| ? property(func) |
| : baseMatchesProperty(func, thisArg); |
| } |
| |
| module.exports = baseCallback; |
| |
| },{"../utility/identity":158,"../utility/property":160,"./baseMatches":88,"./baseMatchesProperty":89,"./bindCallback":98}],72:[function(require,module,exports){ |
| var arrayCopy = require('./arrayCopy'), |
| arrayEach = require('./arrayEach'), |
| baseAssign = require('./baseAssign'), |
| baseForOwn = require('./baseForOwn'), |
| initCloneArray = require('./initCloneArray'), |
| initCloneByTag = require('./initCloneByTag'), |
| initCloneObject = require('./initCloneObject'), |
| isArray = require('../lang/isArray'), |
| isHostObject = require('./isHostObject'), |
| isObject = require('../lang/isObject'); |
| |
| /** `Object#toString` result references. */ |
| var argsTag = '[object Arguments]', |
| arrayTag = '[object Array]', |
| boolTag = '[object Boolean]', |
| dateTag = '[object Date]', |
| errorTag = '[object Error]', |
| funcTag = '[object Function]', |
| mapTag = '[object Map]', |
| numberTag = '[object Number]', |
| objectTag = '[object Object]', |
| regexpTag = '[object RegExp]', |
| setTag = '[object Set]', |
| stringTag = '[object String]', |
| weakMapTag = '[object WeakMap]'; |
| |
| var arrayBufferTag = '[object ArrayBuffer]', |
| float32Tag = '[object Float32Array]', |
| float64Tag = '[object Float64Array]', |
| int8Tag = '[object Int8Array]', |
| int16Tag = '[object Int16Array]', |
| int32Tag = '[object Int32Array]', |
| uint8Tag = '[object Uint8Array]', |
| uint8ClampedTag = '[object Uint8ClampedArray]', |
| uint16Tag = '[object Uint16Array]', |
| uint32Tag = '[object Uint32Array]'; |
| |
| /** Used to identify `toStringTag` values supported by `_.clone`. */ |
| var cloneableTags = {}; |
| cloneableTags[argsTag] = cloneableTags[arrayTag] = |
| cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = |
| cloneableTags[dateTag] = cloneableTags[float32Tag] = |
| cloneableTags[float64Tag] = cloneableTags[int8Tag] = |
| cloneableTags[int16Tag] = cloneableTags[int32Tag] = |
| cloneableTags[numberTag] = cloneableTags[objectTag] = |
| cloneableTags[regexpTag] = cloneableTags[stringTag] = |
| cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = |
| cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; |
| cloneableTags[errorTag] = cloneableTags[funcTag] = |
| cloneableTags[mapTag] = cloneableTags[setTag] = |
| cloneableTags[weakMapTag] = false; |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** |
| * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) |
| * of values. |
| */ |
| var objToString = objectProto.toString; |
| |
| /** |
| * The base implementation of `_.clone` without support for argument juggling |
| * and `this` binding `customizer` functions. |
| * |
| * @private |
| * @param {*} value The value to clone. |
| * @param {boolean} [isDeep] Specify a deep clone. |
| * @param {Function} [customizer] The function to customize cloning values. |
| * @param {string} [key] The key of `value`. |
| * @param {Object} [object] The object `value` belongs to. |
| * @param {Array} [stackA=[]] Tracks traversed source objects. |
| * @param {Array} [stackB=[]] Associates clones with source counterparts. |
| * @returns {*} Returns the cloned value. |
| */ |
| function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { |
| var result; |
| if (customizer) { |
| result = object ? customizer(value, key, object) : customizer(value); |
| } |
| if (result !== undefined) { |
| return result; |
| } |
| if (!isObject(value)) { |
| return value; |
| } |
| var isArr = isArray(value); |
| if (isArr) { |
| result = initCloneArray(value); |
| if (!isDeep) { |
| return arrayCopy(value, result); |
| } |
| } else { |
| var tag = objToString.call(value), |
| isFunc = tag == funcTag; |
| |
| if (tag == objectTag || tag == argsTag || (isFunc && !object)) { |
| if (isHostObject(value)) { |
| return object ? value : {}; |
| } |
| result = initCloneObject(isFunc ? {} : value); |
| if (!isDeep) { |
| return baseAssign(result, value); |
| } |
| } else { |
| return cloneableTags[tag] |
| ? initCloneByTag(value, tag, isDeep) |
| : (object ? value : {}); |
| } |
| } |
| // Check for circular references and return its corresponding clone. |
| stackA || (stackA = []); |
| stackB || (stackB = []); |
| |
| var length = stackA.length; |
| while (length--) { |
| if (stackA[length] == value) { |
| return stackB[length]; |
| } |
| } |
| // Add the source value to the stack of traversed objects and associate it with its clone. |
| stackA.push(value); |
| stackB.push(result); |
| |
| // Recursively populate clone (susceptible to call stack limits). |
| (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { |
| result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); |
| }); |
| return result; |
| } |
| |
| module.exports = baseClone; |
| |
| },{"../lang/isArray":144,"../lang/isObject":148,"./arrayCopy":66,"./arrayEach":67,"./baseAssign":70,"./baseForOwn":80,"./initCloneArray":120,"./initCloneByTag":121,"./initCloneObject":122,"./isHostObject":124}],73:[function(require,module,exports){ |
| /** |
| * Copies properties of `source` to `object`. |
| * |
| * @private |
| * @param {Object} source The object to copy properties from. |
| * @param {Array} props The property names to copy. |
| * @param {Object} [object={}] The object to copy properties to. |
| * @returns {Object} Returns `object`. |
| */ |
| function baseCopy(source, props, object) { |
| object || (object = {}); |
| |
| var index = -1, |
| length = props.length; |
| |
| while (++index < length) { |
| var key = props[index]; |
| object[key] = source[key]; |
| } |
| return object; |
| } |
| |
| module.exports = baseCopy; |
| |
| },{}],74:[function(require,module,exports){ |
| var isObject = require('../lang/isObject'); |
| |
| /** |
| * The base implementation of `_.create` without support for assigning |
| * properties to the created object. |
| * |
| * @private |
| * @param {Object} prototype The object to inherit from. |
| * @returns {Object} Returns the new object. |
| */ |
| var baseCreate = (function() { |
| function object() {} |
| return function(prototype) { |
| if (isObject(prototype)) { |
| object.prototype = prototype; |
| var result = new object; |
| object.prototype = undefined; |
| } |
| return result || {}; |
| }; |
| }()); |
| |
| module.exports = baseCreate; |
| |
| },{"../lang/isObject":148}],75:[function(require,module,exports){ |
| var baseForOwn = require('./baseForOwn'), |
| createBaseEach = require('./createBaseEach'); |
| |
| /** |
| * The base implementation of `_.forEach` without support for callback |
| * shorthands and `this` binding. |
| * |
| * @private |
| * @param {Array|Object|string} collection The collection to iterate over. |
| * @param {Function} iteratee The function invoked per iteration. |
| * @returns {Array|Object|string} Returns `collection`. |
| */ |
| var baseEach = createBaseEach(baseForOwn); |
| |
| module.exports = baseEach; |
| |
| },{"./baseForOwn":80,"./createBaseEach":102}],76:[function(require,module,exports){ |
| /** |
| * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, |
| * without support for callback shorthands and `this` binding, which iterates |
| * over `collection` using the provided `eachFunc`. |
| * |
| * @private |
| * @param {Array|Object|string} collection The collection to search. |
| * @param {Function} predicate The function invoked per iteration. |
| * @param {Function} eachFunc The function to iterate over `collection`. |
| * @param {boolean} [retKey] Specify returning the key of the found element |
| * instead of the element itself. |
| * @returns {*} Returns the found element or its key, else `undefined`. |
| */ |
| function baseFind(collection, predicate, eachFunc, retKey) { |
| var result; |
| eachFunc(collection, function(value, key, collection) { |
| if (predicate(value, key, collection)) { |
| result = retKey ? key : value; |
| return false; |
| } |
| }); |
| return result; |
| } |
| |
| module.exports = baseFind; |
| |
| },{}],77:[function(require,module,exports){ |
| /** |
| * The base implementation of `_.findIndex` and `_.findLastIndex` without |
| * support for callback shorthands and `this` binding. |
| * |
| * @private |
| * @param {Array} array The array to search. |
| * @param {Function} predicate The function invoked per iteration. |
| * @param {boolean} [fromRight] Specify iterating from right to left. |
| * @returns {number} Returns the index of the matched value, else `-1`. |
| */ |
| function baseFindIndex(array, predicate, fromRight) { |
| var length = array.length, |
| index = fromRight ? length : -1; |
| |
| while ((fromRight ? index-- : ++index < length)) { |
| if (predicate(array[index], index, array)) { |
| return index; |
| } |
| } |
| return -1; |
| } |
| |
| module.exports = baseFindIndex; |
| |
| },{}],78:[function(require,module,exports){ |
| var createBaseFor = require('./createBaseFor'); |
| |
| /** |
| * The base implementation of `baseForIn` and `baseForOwn` which iterates |
| * over `object` properties returned by `keysFunc` invoking `iteratee` for |
| * each property. Iteratee functions may exit iteration early by explicitly |
| * returning `false`. |
| * |
| * @private |
| * @param {Object} object The object to iterate over. |
| * @param {Function} iteratee The function invoked per iteration. |
| * @param {Function} keysFunc The function to get the keys of `object`. |
| * @returns {Object} Returns `object`. |
| */ |
| var baseFor = createBaseFor(); |
| |
| module.exports = baseFor; |
| |
| },{"./createBaseFor":103}],79:[function(require,module,exports){ |
| var baseFor = require('./baseFor'), |
| keysIn = require('../object/keysIn'); |
| |
| /** |
| * The base implementation of `_.forIn` without support for callback |
| * shorthands and `this` binding. |
| * |
| * @private |
| * @param {Object} object The object to iterate over. |
| * @param {Function} iteratee The function invoked per iteration. |
| * @returns {Object} Returns `object`. |
| */ |
| function baseForIn(object, iteratee) { |
| return baseFor(object, iteratee, keysIn); |
| } |
| |
| module.exports = baseForIn; |
| |
| },{"../object/keysIn":154,"./baseFor":78}],80:[function(require,module,exports){ |
| var baseFor = require('./baseFor'), |
| keys = require('../object/keys'); |
| |
| /** |
| * The base implementation of `_.forOwn` without support for callback |
| * shorthands and `this` binding. |
| * |
| * @private |
| * @param {Object} object The object to iterate over. |
| * @param {Function} iteratee The function invoked per iteration. |
| * @returns {Object} Returns `object`. |
| */ |
| function baseForOwn(object, iteratee) { |
| return baseFor(object, iteratee, keys); |
| } |
| |
| module.exports = baseForOwn; |
| |
| },{"../object/keys":153,"./baseFor":78}],81:[function(require,module,exports){ |
| var toObject = require('./toObject'); |
| |
| /** |
| * The base implementation of `get` without support for string paths |
| * and default values. |
| * |
| * @private |
| * @param {Object} object The object to query. |
| * @param {Array} path The path of the property to get. |
| * @param {string} [pathKey] The key representation of path. |
| * @returns {*} Returns the resolved value. |
| */ |
| function baseGet(object, path, pathKey) { |
| if (object == null) { |
| return; |
| } |
| object = toObject(object); |
| if (pathKey !== undefined && pathKey in object) { |
| path = [pathKey]; |
| } |
| var index = 0, |
| length = path.length; |
| |
| while (object != null && index < length) { |
| object = toObject(object)[path[index++]]; |
| } |
| return (index && index == length) ? object : undefined; |
| } |
| |
| module.exports = baseGet; |
| |
| },{"./toObject":139}],82:[function(require,module,exports){ |
| var indexOfNaN = require('./indexOfNaN'); |
| |
| /** |
| * The base implementation of `_.indexOf` without support for binary searches. |
| * |
| * @private |
| * @param {Array} array The array to search. |
| * @param {*} value The value to search for. |
| * @param {number} fromIndex The index to search from. |
| * @returns {number} Returns the index of the matched value, else `-1`. |
| */ |
| function baseIndexOf(array, value, fromIndex) { |
| if (value !== value) { |
| return indexOfNaN(array, fromIndex); |
| } |
| var index = fromIndex - 1, |
| length = array.length; |
| |
| while (++index < length) { |
| if (array[index] === value) { |
| return index; |
| } |
| } |
| return -1; |
| } |
| |
| module.exports = baseIndexOf; |
| |
| },{"./indexOfNaN":119}],83:[function(require,module,exports){ |
| var baseIsEqualDeep = require('./baseIsEqualDeep'), |
| isObject = require('../lang/isObject'), |
| isObjectLike = require('./isObjectLike'); |
| |
| /** |
| * The base implementation of `_.isEqual` without support for `this` binding |
| * `customizer` functions. |
| * |
| * @private |
| * @param {*} value The value to compare. |
| * @param {*} other The other value to compare. |
| * @param {Function} [customizer] The function to customize comparing values. |
| * @param {boolean} [isLoose] Specify performing partial comparisons. |
| * @param {Array} [stackA] Tracks traversed `value` objects. |
| * @param {Array} [stackB] Tracks traversed `other` objects. |
| * @returns {boolean} Returns `true` if the values are equivalent, else `false`. |
| */ |
| function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { |
| if (value === other) { |
| return true; |
| } |
| if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { |
| return value !== value && other !== other; |
| } |
| return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); |
| } |
| |
| module.exports = baseIsEqual; |
| |
| },{"../lang/isObject":148,"./baseIsEqualDeep":84,"./isObjectLike":130}],84:[function(require,module,exports){ |
| var equalArrays = require('./equalArrays'), |
| equalByTag = require('./equalByTag'), |
| equalObjects = require('./equalObjects'), |
| isArray = require('../lang/isArray'), |
| isHostObject = require('./isHostObject'), |
| isTypedArray = require('../lang/isTypedArray'); |
| |
| /** `Object#toString` result references. */ |
| var argsTag = '[object Arguments]', |
| arrayTag = '[object Array]', |
| objectTag = '[object Object]'; |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** |
| * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) |
| * of values. |
| */ |
| var objToString = objectProto.toString; |
| |
| /** |
| * A specialized version of `baseIsEqual` for arrays and objects which performs |
| * deep comparisons and tracks traversed objects enabling objects with circular |
| * references to be compared. |
| * |
| * @private |
| * @param {Object} object The object to compare. |
| * @param {Object} other The other object to compare. |
| * @param {Function} equalFunc The function to determine equivalents of values. |
| * @param {Function} [customizer] The function to customize comparing objects. |
| * @param {boolean} [isLoose] Specify performing partial comparisons. |
| * @param {Array} [stackA=[]] Tracks traversed `value` objects. |
| * @param {Array} [stackB=[]] Tracks traversed `other` objects. |
| * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
| */ |
| function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { |
| var objIsArr = isArray(object), |
| othIsArr = isArray(other), |
| objTag = arrayTag, |
| othTag = arrayTag; |
| |
| if (!objIsArr) { |
| objTag = objToString.call(object); |
| if (objTag == argsTag) { |
| objTag = objectTag; |
| } else if (objTag != objectTag) { |
| objIsArr = isTypedArray(object); |
| } |
| } |
| if (!othIsArr) { |
| othTag = objToString.call(other); |
| if (othTag == argsTag) { |
| othTag = objectTag; |
| } else if (othTag != objectTag) { |
| othIsArr = isTypedArray(other); |
| } |
| } |
| var objIsObj = objTag == objectTag && !isHostObject(object), |
| othIsObj = othTag == objectTag && !isHostObject(other), |
| isSameTag = objTag == othTag; |
| |
| if (isSameTag && !(objIsArr || objIsObj)) { |
| return equalByTag(object, other, objTag); |
| } |
| if (!isLoose) { |
| var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), |
| othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); |
| |
| if (objIsWrapped || othIsWrapped) { |
| return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); |
| } |
| } |
| if (!isSameTag) { |
| return false; |
| } |
| // Assume cyclic values are equal. |
| // For more information on detecting circular references see https://es5.github.io/#JO. |
| stackA || (stackA = []); |
| stackB || (stackB = []); |
| |
| var length = stackA.length; |
| while (length--) { |
| if (stackA[length] == object) { |
| return stackB[length] == other; |
| } |
| } |
| // Add `object` and `other` to the stack of traversed objects. |
| stackA.push(object); |
| stackB.push(other); |
| |
| var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); |
| |
| stackA.pop(); |
| stackB.pop(); |
| |
| return result; |
| } |
| |
| module.exports = baseIsEqualDeep; |
| |
| },{"../lang/isArray":144,"../lang/isTypedArray":151,"./equalArrays":111,"./equalByTag":112,"./equalObjects":113,"./isHostObject":124}],85:[function(require,module,exports){ |
| var baseIsEqual = require('./baseIsEqual'), |
| toObject = require('./toObject'); |
| |
| /** |
| * The base implementation of `_.isMatch` without support for callback |
| * shorthands and `this` binding. |
| * |
| * @private |
| * @param {Object} object The object to inspect. |
| * @param {Array} matchData The propery names, values, and compare flags to match. |
| * @param {Function} [customizer] The function to customize comparing objects. |
| * @returns {boolean} Returns `true` if `object` is a match, else `false`. |
| */ |
| function baseIsMatch(object, matchData, customizer) { |
| var index = matchData.length, |
| length = index, |
| noCustomizer = !customizer; |
| |
| if (object == null) { |
| return !length; |
| } |
| object = toObject(object); |
| while (index--) { |
| var data = matchData[index]; |
| if ((noCustomizer && data[2]) |
| ? data[1] !== object[data[0]] |
| : !(data[0] in object) |
| ) { |
| return false; |
| } |
| } |
| while (++index < length) { |
| data = matchData[index]; |
| var key = data[0], |
| objValue = object[key], |
| srcValue = data[1]; |
| |
| if (noCustomizer && data[2]) { |
| if (objValue === undefined && !(key in object)) { |
| return false; |
| } |
| } else { |
| var result = customizer ? customizer(objValue, srcValue, key) : undefined; |
| if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { |
| return false; |
| } |
| } |
| } |
| return true; |
| } |
| |
| module.exports = baseIsMatch; |
| |
| },{"./baseIsEqual":83,"./toObject":139}],86:[function(require,module,exports){ |
| /** |
| * The function whose prototype all chaining wrappers inherit from. |
| * |
| * @private |
| */ |
| function baseLodash() { |
| // No operation performed. |
| } |
| |
| module.exports = baseLodash; |
| |
| },{}],87:[function(require,module,exports){ |
| var baseEach = require('./baseEach'), |
| isArrayLike = require('./isArrayLike'); |
| |
| /** |
| * The base implementation of `_.map` without support for callback shorthands |
| * and `this` binding. |
| * |
| * @private |
| * @param {Array|Object|string} collection The collection to iterate over. |
| * @param {Function} iteratee The function invoked per iteration. |
| * @returns {Array} Returns the new mapped array. |
| */ |
| function baseMap(collection, iteratee) { |
| var index = -1, |
| result = isArrayLike(collection) ? Array(collection.length) : []; |
| |
| baseEach(collection, function(value, key, collection) { |
| result[++index] = iteratee(value, key, collection); |
| }); |
| return result; |
| } |
| |
| module.exports = baseMap; |
| |
| },{"./baseEach":75,"./isArrayLike":123}],88:[function(require,module,exports){ |
| var baseIsMatch = require('./baseIsMatch'), |
| getMatchData = require('./getMatchData'), |
| toObject = require('./toObject'); |
| |
| /** |
| * The base implementation of `_.matches` which does not clone `source`. |
| * |
| * @private |
| * @param {Object} source The object of property values to match. |
| * @returns {Function} Returns the new function. |
| */ |
| function baseMatches(source) { |
| var matchData = getMatchData(source); |
| if (matchData.length == 1 && matchData[0][2]) { |
| var key = matchData[0][0], |
| value = matchData[0][1]; |
| |
| return function(object) { |
| if (object == null) { |
| return false; |
| } |
| object = toObject(object); |
| return object[key] === value && (value !== undefined || (key in object)); |
| }; |
| } |
| return function(object) { |
| return baseIsMatch(object, matchData); |
| }; |
| } |
| |
| module.exports = baseMatches; |
| |
| },{"./baseIsMatch":85,"./getMatchData":117,"./toObject":139}],89:[function(require,module,exports){ |
| var baseGet = require('./baseGet'), |
| baseIsEqual = require('./baseIsEqual'), |
| baseSlice = require('./baseSlice'), |
| isArray = require('../lang/isArray'), |
| isKey = require('./isKey'), |
| isStrictComparable = require('./isStrictComparable'), |
| last = require('../array/last'), |
| toObject = require('./toObject'), |
| toPath = require('./toPath'); |
| |
| /** |
| * The base implementation of `_.matchesProperty` which does not clone `srcValue`. |
| * |
| * @private |
| * @param {string} path The path of the property to get. |
| * @param {*} srcValue The value to compare. |
| * @returns {Function} Returns the new function. |
| */ |
| function baseMatchesProperty(path, srcValue) { |
| var isArr = isArray(path), |
| isCommon = isKey(path) && isStrictComparable(srcValue), |
| pathKey = (path + ''); |
| |
| path = toPath(path); |
| return function(object) { |
| if (object == null) { |
| return false; |
| } |
| var key = pathKey; |
| object = toObject(object); |
| if ((isArr || !isCommon) && !(key in object)) { |
| object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); |
| if (object == null) { |
| return false; |
| } |
| key = last(path); |
| object = toObject(object); |
| } |
| return object[key] === srcValue |
| ? (srcValue !== undefined || (key in object)) |
| : baseIsEqual(srcValue, object[key], undefined, true); |
| }; |
| } |
| |
| module.exports = baseMatchesProperty; |
| |
| },{"../array/last":54,"../lang/isArray":144,"./baseGet":81,"./baseIsEqual":83,"./baseSlice":93,"./isKey":127,"./isStrictComparable":131,"./toObject":139,"./toPath":140}],90:[function(require,module,exports){ |
| var toObject = require('./toObject'); |
| |
| /** |
| * The base implementation of `_.property` without support for deep paths. |
| * |
| * @private |
| * @param {string} key The key of the property to get. |
| * @returns {Function} Returns the new function. |
| */ |
| function baseProperty(key) { |
| return function(object) { |
| return object == null ? undefined : toObject(object)[key]; |
| }; |
| } |
| |
| module.exports = baseProperty; |
| |
| },{"./toObject":139}],91:[function(require,module,exports){ |
| var baseGet = require('./baseGet'), |
| toPath = require('./toPath'); |
| |
| /** |
| * A specialized version of `baseProperty` which supports deep paths. |
| * |
| * @private |
| * @param {Array|string} path The path of the property to get. |
| * @returns {Function} Returns the new function. |
| */ |
| function basePropertyDeep(path) { |
| var pathKey = (path + ''); |
| path = toPath(path); |
| return function(object) { |
| return baseGet(object, path, pathKey); |
| }; |
| } |
| |
| module.exports = basePropertyDeep; |
| |
| },{"./baseGet":81,"./toPath":140}],92:[function(require,module,exports){ |
| var identity = require('../utility/identity'), |
| metaMap = require('./metaMap'); |
| |
| /** |
| * The base implementation of `setData` without support for hot loop detection. |
| * |
| * @private |
| * @param {Function} func The function to associate metadata with. |
| * @param {*} data The metadata. |
| * @returns {Function} Returns `func`. |
| */ |
| var baseSetData = !metaMap ? identity : function(func, data) { |
| metaMap.set(func, data); |
| return func; |
| }; |
| |
| module.exports = baseSetData; |
| |
| },{"../utility/identity":158,"./metaMap":133}],93:[function(require,module,exports){ |
| /** |
| * The base implementation of `_.slice` without an iteratee call guard. |
| * |
| * @private |
| * @param {Array} array The array to slice. |
| * @param {number} [start=0] The start position. |
| * @param {number} [end=array.length] The end position. |
| * @returns {Array} Returns the slice of `array`. |
| */ |
| function baseSlice(array, start, end) { |
| var index = -1, |
| length = array.length; |
| |
| start = start == null ? 0 : (+start || 0); |
| if (start < 0) { |
| start = -start > length ? 0 : (length + start); |
| } |
| end = (end === undefined || end > length) ? length : (+end || 0); |
| if (end < 0) { |
| end += length; |
| } |
| length = start > end ? 0 : ((end - start) >>> 0); |
| start >>>= 0; |
| |
| var result = Array(length); |
| while (++index < length) { |
| result[index] = array[index + start]; |
| } |
| return result; |
| } |
| |
| module.exports = baseSlice; |
| |
| },{}],94:[function(require,module,exports){ |
| /** |
| * Converts `value` to a string if it's not one. An empty string is returned |
| * for `null` or `undefined` values. |
| * |
| * @private |
| * @param {*} value The value to process. |
| * @returns {string} Returns the string. |
| */ |
| function baseToString(value) { |
| return value == null ? '' : (value + ''); |
| } |
| |
| module.exports = baseToString; |
| |
| },{}],95:[function(require,module,exports){ |
| /** |
| * The base implementation of `_.values` and `_.valuesIn` which creates an |
| * array of `object` property values corresponding to the property names |
| * of `props`. |
| * |
| * @private |
| * @param {Object} object The object to query. |
| * @param {Array} props The property names to get values for. |
| * @returns {Object} Returns the array of property values. |
| */ |
| function baseValues(object, props) { |
| var index = -1, |
| length = props.length, |
| result = Array(length); |
| |
| while (++index < length) { |
| result[index] = object[props[index]]; |
| } |
| return result; |
| } |
| |
| module.exports = baseValues; |
| |
| },{}],96:[function(require,module,exports){ |
| var binaryIndexBy = require('./binaryIndexBy'), |
| identity = require('../utility/identity'); |
| |
| /** Used as references for the maximum length and index of an array. */ |
| var MAX_ARRAY_LENGTH = 4294967295, |
| HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; |
| |
| /** |
| * Performs a binary search of `array` to determine the index at which `value` |
| * should be inserted into `array` in order to maintain its sort order. |
| * |
| * @private |
| * @param {Array} array The sorted array to inspect. |
| * @param {*} value The value to evaluate. |
| * @param {boolean} [retHighest] Specify returning the highest qualified index. |
| * @returns {number} Returns the index at which `value` should be inserted |
| * into `array`. |
| */ |
| function binaryIndex(array, value, retHighest) { |
| var low = 0, |
| high = array ? array.length : low; |
| |
| if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { |
| while (low < high) { |
| var mid = (low + high) >>> 1, |
| computed = array[mid]; |
| |
| if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { |
| low = mid + 1; |
| } else { |
| high = mid; |
| } |
| } |
| return high; |
| } |
| return binaryIndexBy(array, value, identity, retHighest); |
| } |
| |
| module.exports = binaryIndex; |
| |
| },{"../utility/identity":158,"./binaryIndexBy":97}],97:[function(require,module,exports){ |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeFloor = Math.floor, |
| nativeMin = Math.min; |
| |
| /** Used as references for the maximum length and index of an array. */ |
| var MAX_ARRAY_LENGTH = 4294967295, |
| MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; |
| |
| /** |
| * This function is like `binaryIndex` except that it invokes `iteratee` for |
| * `value` and each element of `array` to compute their sort ranking. The |
| * iteratee is invoked with one argument; (value). |
| * |
| * @private |
| * @param {Array} array The sorted array to inspect. |
| * @param {*} value The value to evaluate. |
| * @param {Function} iteratee The function invoked per iteration. |
| * @param {boolean} [retHighest] Specify returning the highest qualified index. |
| * @returns {number} Returns the index at which `value` should be inserted |
| * into `array`. |
| */ |
| function binaryIndexBy(array, value, iteratee, retHighest) { |
| value = iteratee(value); |
| |
| var low = 0, |
| high = array ? array.length : 0, |
| valIsNaN = value !== value, |
| valIsNull = value === null, |
| valIsUndef = value === undefined; |
| |
| while (low < high) { |
| var mid = nativeFloor((low + high) / 2), |
| computed = iteratee(array[mid]), |
| isDef = computed !== undefined, |
| isReflexive = computed === computed; |
| |
| if (valIsNaN) { |
| var setLow = isReflexive || retHighest; |
| } else if (valIsNull) { |
| setLow = isReflexive && isDef && (retHighest || computed != null); |
| } else if (valIsUndef) { |
| setLow = isReflexive && (retHighest || isDef); |
| } else if (computed == null) { |
| setLow = false; |
| } else { |
| setLow = retHighest ? (computed <= value) : (computed < value); |
| } |
| if (setLow) { |
| low = mid + 1; |
| } else { |
| high = mid; |
| } |
| } |
| return nativeMin(high, MAX_ARRAY_INDEX); |
| } |
| |
| module.exports = binaryIndexBy; |
| |
| },{}],98:[function(require,module,exports){ |
| var identity = require('../utility/identity'); |
| |
| /** |
| * A specialized version of `baseCallback` which only supports `this` binding |
| * and specifying the number of arguments to provide to `func`. |
| * |
| * @private |
| * @param {Function} func The function to bind. |
| * @param {*} thisArg The `this` binding of `func`. |
| * @param {number} [argCount] The number of arguments to provide to `func`. |
| * @returns {Function} Returns the callback. |
| */ |
| function bindCallback(func, thisArg, argCount) { |
| if (typeof func != 'function') { |
| return identity; |
| } |
| if (thisArg === undefined) { |
| return func; |
| } |
| switch (argCount) { |
| case 1: return function(value) { |
| return func.call(thisArg, value); |
| }; |
| case 3: return function(value, index, collection) { |
| return func.call(thisArg, value, index, collection); |
| }; |
| case 4: return function(accumulator, value, index, collection) { |
| return func.call(thisArg, accumulator, value, index, collection); |
| }; |
| case 5: return function(value, other, key, object, source) { |
| return func.call(thisArg, value, other, key, object, source); |
| }; |
| } |
| return function() { |
| return func.apply(thisArg, arguments); |
| }; |
| } |
| |
| module.exports = bindCallback; |
| |
| },{"../utility/identity":158}],99:[function(require,module,exports){ |
| (function (global){ |
| /** Native method references. */ |
| var ArrayBuffer = global.ArrayBuffer, |
| Uint8Array = global.Uint8Array; |
| |
| /** |
| * Creates a clone of the given array buffer. |
| * |
| * @private |
| * @param {ArrayBuffer} buffer The array buffer to clone. |
| * @returns {ArrayBuffer} Returns the cloned array buffer. |
| */ |
| function bufferClone(buffer) { |
| var result = new ArrayBuffer(buffer.byteLength), |
| view = new Uint8Array(result); |
| |
| view.set(new Uint8Array(buffer)); |
| return result; |
| } |
| |
| module.exports = bufferClone; |
| |
| }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2J1ZmZlckNsb25lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBOYXRpdmUgbWV0aG9kIHJlZmVyZW5jZXMuICovXG52YXIgQXJyYXlCdWZmZXIgPSBnbG9iYWwuQXJyYXlCdWZmZXIsXG4gICAgVWludDhBcnJheSA9IGdsb2JhbC5VaW50OEFycmF5O1xuXG4vKipcbiAqIENyZWF0ZXMgYSBjbG9uZSBvZiB0aGUgZ2l2ZW4gYXJyYXkgYnVmZmVyLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5QnVmZmVyfSBidWZmZXIgVGhlIGFycmF5IGJ1ZmZlciB0byBjbG9uZS5cbiAqIEByZXR1cm5zIHtBcnJheUJ1ZmZlcn0gUmV0dXJucyB0aGUgY2xvbmVkIGFycmF5IGJ1ZmZlci5cbiAqL1xuZnVuY3Rpb24gYnVmZmVyQ2xvbmUoYnVmZmVyKSB7XG4gIHZhciByZXN1bHQgPSBuZXcgQXJyYXlCdWZmZXIoYnVmZmVyLmJ5dGVMZW5ndGgpLFxuICAgICAgdmlldyA9IG5ldyBVaW50OEFycmF5KHJlc3VsdCk7XG5cbiAgdmlldy5zZXQobmV3IFVpbnQ4QXJyYXkoYnVmZmVyKSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYnVmZmVyQ2xvbmU7XG4iXX0= |
| },{}],100:[function(require,module,exports){ |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMax = Math.max; |
| |
| /** |
| * Creates an array that is the composition of partially applied arguments, |
| * placeholders, and provided arguments into a single array of arguments. |
| * |
| * @private |
| * @param {Array|Object} args The provided arguments. |
| * @param {Array} partials The arguments to prepend to those provided. |
| * @param {Array} holders The `partials` placeholder indexes. |
| * @returns {Array} Returns the new array of composed arguments. |
| */ |
| function composeArgs(args, partials, holders) { |
| var holdersLength = holders.length, |
| argsIndex = -1, |
| argsLength = nativeMax(args.length - holdersLength, 0), |
| leftIndex = -1, |
| leftLength = partials.length, |
| result = Array(leftLength + argsLength); |
| |
| while (++leftIndex < leftLength) { |
| result[leftIndex] = partials[leftIndex]; |
| } |
| while (++argsIndex < holdersLength) { |
| result[holders[argsIndex]] = args[argsIndex]; |
| } |
| while (argsLength--) { |
| result[leftIndex++] = args[argsIndex++]; |
| } |
| return result; |
| } |
| |
| module.exports = composeArgs; |
| |
| },{}],101:[function(require,module,exports){ |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMax = Math.max; |
| |
| /** |
| * This function is like `composeArgs` except that the arguments composition |
| * is tailored for `_.partialRight`. |
| * |
| * @private |
| * @param {Array|Object} args The provided arguments. |
| * @param {Array} partials The arguments to append to those provided. |
| * @param {Array} holders The `partials` placeholder indexes. |
| * @returns {Array} Returns the new array of composed arguments. |
| */ |
| function composeArgsRight(args, partials, holders) { |
| var holdersIndex = -1, |
| holdersLength = holders.length, |
| argsIndex = -1, |
| argsLength = nativeMax(args.length - holdersLength, 0), |
| rightIndex = -1, |
| rightLength = partials.length, |
| result = Array(argsLength + rightLength); |
| |
| while (++argsIndex < argsLength) { |
| result[argsIndex] = args[argsIndex]; |
| } |
| var offset = argsIndex; |
| while (++rightIndex < rightLength) { |
| result[offset + rightIndex] = partials[rightIndex]; |
| } |
| while (++holdersIndex < holdersLength) { |
| result[offset + holders[holdersIndex]] = args[argsIndex++]; |
| } |
| return result; |
| } |
| |
| module.exports = composeArgsRight; |
| |
| },{}],102:[function(require,module,exports){ |
| var getLength = require('./getLength'), |
| isLength = require('./isLength'), |
| toObject = require('./toObject'); |
| |
| /** |
| * Creates a `baseEach` or `baseEachRight` function. |
| * |
| * @private |
| * @param {Function} eachFunc The function to iterate over a collection. |
| * @param {boolean} [fromRight] Specify iterating from right to left. |
| * @returns {Function} Returns the new base function. |
| */ |
| function createBaseEach(eachFunc, fromRight) { |
| return function(collection, iteratee) { |
| var length = collection ? getLength(collection) : 0; |
| if (!isLength(length)) { |
| return eachFunc(collection, iteratee); |
| } |
| var index = fromRight ? length : -1, |
| iterable = toObject(collection); |
| |
| while ((fromRight ? index-- : ++index < length)) { |
| if (iteratee(iterable[index], index, iterable) === false) { |
| break; |
| } |
| } |
| return collection; |
| }; |
| } |
| |
| module.exports = createBaseEach; |
| |
| },{"./getLength":116,"./isLength":129,"./toObject":139}],103:[function(require,module,exports){ |
| var toObject = require('./toObject'); |
| |
| /** |
| * Creates a base function for `_.forIn` or `_.forInRight`. |
| * |
| * @private |
| * @param {boolean} [fromRight] Specify iterating from right to left. |
| * @returns {Function} Returns the new base function. |
| */ |
| function createBaseFor(fromRight) { |
| return function(object, iteratee, keysFunc) { |
| var iterable = toObject(object), |
| props = keysFunc(object), |
| length = props.length, |
| index = fromRight ? length : -1; |
| |
| while ((fromRight ? index-- : ++index < length)) { |
| var key = props[index]; |
| if (iteratee(iterable[key], key, iterable) === false) { |
| break; |
| } |
| } |
| return object; |
| }; |
| } |
| |
| module.exports = createBaseFor; |
| |
| },{"./toObject":139}],104:[function(require,module,exports){ |
| (function (global){ |
| var createCtorWrapper = require('./createCtorWrapper'); |
| |
| /** |
| * Creates a function that wraps `func` and invokes it with the `this` |
| * binding of `thisArg`. |
| * |
| * @private |
| * @param {Function} func The function to bind. |
| * @param {*} [thisArg] The `this` binding of `func`. |
| * @returns {Function} Returns the new bound function. |
| */ |
| function createBindWrapper(func, thisArg) { |
| var Ctor = createCtorWrapper(func); |
| |
| function wrapper() { |
| var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func; |
| return fn.apply(thisArg, arguments); |
| } |
| return wrapper; |
| } |
| |
| module.exports = createBindWrapper; |
| |
| }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2NyZWF0ZUJpbmRXcmFwcGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QU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VCaW5kV3JhcHBlcjtcbiJdfQ== |
| },{"./createCtorWrapper":105}],105:[function(require,module,exports){ |
| var baseCreate = require('./baseCreate'), |
| isObject = require('../lang/isObject'); |
| |
| /** |
| * Creates a function that produces an instance of `Ctor` regardless of |
| * whether it was invoked as part of a `new` expression or by `call` or `apply`. |
| * |
| * @private |
| * @param {Function} Ctor The constructor to wrap. |
| * @returns {Function} Returns the new wrapped function. |
| */ |
| function createCtorWrapper(Ctor) { |
| return function() { |
| // Use a `switch` statement to work with class constructors. |
| // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist |
| // for more details. |
| var args = arguments; |
| switch (args.length) { |
| case 0: return new Ctor; |
| case 1: return new Ctor(args[0]); |
| case 2: return new Ctor(args[0], args[1]); |
| case 3: return new Ctor(args[0], args[1], args[2]); |
| case 4: return new Ctor(args[0], args[1], args[2], args[3]); |
| case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); |
| case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); |
| case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); |
| } |
| var thisBinding = baseCreate(Ctor.prototype), |
| result = Ctor.apply(thisBinding, args); |
| |
| // Mimic the constructor's `return` behavior. |
| // See https://es5.github.io/#x13.2.2 for more details. |
| return isObject(result) ? result : thisBinding; |
| }; |
| } |
| |
| module.exports = createCtorWrapper; |
| |
| },{"../lang/isObject":148,"./baseCreate":74}],106:[function(require,module,exports){ |
| var baseCallback = require('./baseCallback'), |
| baseFind = require('./baseFind'), |
| baseFindIndex = require('./baseFindIndex'), |
| isArray = require('../lang/isArray'); |
| |
| /** |
| * Creates a `_.find` or `_.findLast` function. |
| * |
| * @private |
| * @param {Function} eachFunc The function to iterate over a collection. |
| * @param {boolean} [fromRight] Specify iterating from right to left. |
| * @returns {Function} Returns the new find function. |
| */ |
| function createFind(eachFunc, fromRight) { |
| return function(collection, predicate, thisArg) { |
| predicate = baseCallback(predicate, thisArg, 3); |
| if (isArray(collection)) { |
| var index = baseFindIndex(collection, predicate, fromRight); |
| return index > -1 ? collection[index] : undefined; |
| } |
| return baseFind(collection, predicate, eachFunc); |
| }; |
| } |
| |
| module.exports = createFind; |
| |
| },{"../lang/isArray":144,"./baseCallback":71,"./baseFind":76,"./baseFindIndex":77}],107:[function(require,module,exports){ |
| var bindCallback = require('./bindCallback'), |
| isArray = require('../lang/isArray'); |
| |
| /** |
| * Creates a function for `_.forEach` or `_.forEachRight`. |
| * |
| * @private |
| * @param {Function} arrayFunc The function to iterate over an array. |
| * @param {Function} eachFunc The function to iterate over a collection. |
| * @returns {Function} Returns the new each function. |
| */ |
| function createForEach(arrayFunc, eachFunc) { |
| return function(collection, iteratee, thisArg) { |
| return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) |
| ? arrayFunc(collection, iteratee) |
| : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); |
| }; |
| } |
| |
| module.exports = createForEach; |
| |
| },{"../lang/isArray":144,"./bindCallback":98}],108:[function(require,module,exports){ |
| (function (global){ |
| var arrayCopy = require('./arrayCopy'), |
| composeArgs = require('./composeArgs'), |
| composeArgsRight = require('./composeArgsRight'), |
| createCtorWrapper = require('./createCtorWrapper'), |
| isLaziable = require('./isLaziable'), |
| reorder = require('./reorder'), |
| replaceHolders = require('./replaceHolders'), |
| setData = require('./setData'); |
| |
| /** Used to compose bitmasks for wrapper metadata. */ |
| var BIND_FLAG = 1, |
| BIND_KEY_FLAG = 2, |
| CURRY_BOUND_FLAG = 4, |
| CURRY_FLAG = 8, |
| CURRY_RIGHT_FLAG = 16, |
| PARTIAL_FLAG = 32, |
| PARTIAL_RIGHT_FLAG = 64, |
| ARY_FLAG = 128; |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMax = Math.max; |
| |
| /** |
| * Creates a function that wraps `func` and invokes it with optional `this` |
| * binding of, partial application, and currying. |
| * |
| * @private |
| * @param {Function|string} func The function or method name to reference. |
| * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. |
| * @param {*} [thisArg] The `this` binding of `func`. |
| * @param {Array} [partials] The arguments to prepend to those provided to the new function. |
| * @param {Array} [holders] The `partials` placeholder indexes. |
| * @param {Array} [partialsRight] The arguments to append to those provided to the new function. |
| * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. |
| * @param {Array} [argPos] The argument positions of the new function. |
| * @param {number} [ary] The arity cap of `func`. |
| * @param {number} [arity] The arity of `func`. |
| * @returns {Function} Returns the new wrapped function. |
| */ |
| function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { |
| var isAry = bitmask & ARY_FLAG, |
| isBind = bitmask & BIND_FLAG, |
| isBindKey = bitmask & BIND_KEY_FLAG, |
| isCurry = bitmask & CURRY_FLAG, |
| isCurryBound = bitmask & CURRY_BOUND_FLAG, |
| isCurryRight = bitmask & CURRY_RIGHT_FLAG, |
| Ctor = isBindKey ? undefined : createCtorWrapper(func); |
| |
| function wrapper() { |
| // Avoid `arguments` object use disqualifying optimizations by |
| // converting it to an array before providing it to other functions. |
| var length = arguments.length, |
| index = length, |
| args = Array(length); |
| |
| while (index--) { |
| args[index] = arguments[index]; |
| } |
| if (partials) { |
| args = composeArgs(args, partials, holders); |
| } |
| if (partialsRight) { |
| args = composeArgsRight(args, partialsRight, holdersRight); |
| } |
| if (isCurry || isCurryRight) { |
| var placeholder = wrapper.placeholder, |
| argsHolders = replaceHolders(args, placeholder); |
| |
| length -= argsHolders.length; |
| if (length < arity) { |
| var newArgPos = argPos ? arrayCopy(argPos) : undefined, |
| newArity = nativeMax(arity - length, 0), |
| newsHolders = isCurry ? argsHolders : undefined, |
| newHoldersRight = isCurry ? undefined : argsHolders, |
| newPartials = isCurry ? args : undefined, |
| newPartialsRight = isCurry ? undefined : args; |
| |
| bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); |
| bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); |
| |
| if (!isCurryBound) { |
| bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); |
| } |
| var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity], |
| result = createHybridWrapper.apply(undefined, newData); |
| |
| if (isLaziable(func)) { |
| setData(result, newData); |
| } |
| result.placeholder = placeholder; |
| return result; |
| } |
| } |
| var thisBinding = isBind ? thisArg : this, |
| fn = isBindKey ? thisBinding[func] : func; |
| |
| if (argPos) { |
| args = reorder(args, argPos); |
| } |
| if (isAry && ary < args.length) { |
| args.length = ary; |
| } |
| if (this && this !== global && this instanceof wrapper) { |
| fn = Ctor || createCtorWrapper(func); |
| } |
| return fn.apply(thisBinding, args); |
| } |
| return wrapper; |
| } |
| |
| module.exports = createHybridWrapper; |
| |
| }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2NyZWF0ZUh5YnJpZFdyYXBwZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FB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ICAgICBpZiAoaXNMYXppYWJsZShmdW5jKSkge1xuICAgICAgICAgIHNldERhdGEocmVzdWx0LCBuZXdEYXRhKTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQucGxhY2Vob2xkZXIgPSBwbGFjZWhvbGRlcjtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cbiAgICB9XG4gICAgdmFyIHRoaXNCaW5kaW5nID0gaXNCaW5kID8gdGhpc0FyZyA6IHRoaXMsXG4gICAgICAgIGZuID0gaXNCaW5kS2V5ID8gdGhpc0JpbmRpbmdbZnVuY10gOiBmdW5jO1xuXG4gICAgaWYgKGFyZ1Bvcykge1xuICAgICAgYXJncyA9IHJlb3JkZXIoYXJncywgYXJnUG9zKTtcbiAgICB9XG4gICAgaWYgKGlzQXJ5ICYmIGFyeSA8IGFyZ3MubGVuZ3RoKSB7XG4gICAgICBhcmdzLmxlbmd0aCA9IGFyeTtcbiAgICB9XG4gICAgaWYgKHRoaXMgJiYgdGhpcyAhPT0gZ2xvYmFsICYmIHRoaXMgaW5zdGFuY2VvZiB3cmFwcGVyKSB7XG4gICAgICBmbiA9IEN0b3IgfHwgY3JlYXRlQ3RvcldyYXBwZXIoZnVuYyk7XG4gICAgfVxuICAgIHJldHVybiBmbi5hcHBseSh0aGlzQmluZGluZywgYXJncyk7XG4gIH1cbiAgcmV0dXJuIHdyYXBwZXI7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY3JlYXRlSHlicmlkV3JhcHBlcjtcbiJdfQ== |
| },{"./arrayCopy":66,"./composeArgs":100,"./composeArgsRight":101,"./createCtorWrapper":105,"./isLaziable":128,"./reorder":135,"./replaceHolders":136,"./setData":137}],109:[function(require,module,exports){ |
| (function (global){ |
| var createCtorWrapper = require('./createCtorWrapper'); |
| |
| /** Used to compose bitmasks for wrapper metadata. */ |
| var BIND_FLAG = 1; |
| |
| /** |
| * Creates a function that wraps `func` and invokes it with the optional `this` |
| * binding of `thisArg` and the `partials` prepended to those provided to |
| * the wrapper. |
| * |
| * @private |
| * @param {Function} func The function to partially apply arguments to. |
| * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. |
| * @param {*} thisArg The `this` binding of `func`. |
| * @param {Array} partials The arguments to prepend to those provided to the new function. |
| * @returns {Function} Returns the new bound function. |
| */ |
| function createPartialWrapper(func, bitmask, thisArg, partials) { |
| var isBind = bitmask & BIND_FLAG, |
| Ctor = createCtorWrapper(func); |
| |
| function wrapper() { |
| // Avoid `arguments` object use disqualifying optimizations by |
| // converting it to an array before providing it `func`. |
| var argsIndex = -1, |
| argsLength = arguments.length, |
| leftIndex = -1, |
| leftLength = partials.length, |
| args = Array(leftLength + argsLength); |
| |
| while (++leftIndex < leftLength) { |
| args[leftIndex] = partials[leftIndex]; |
| } |
| while (argsLength--) { |
| args[leftIndex++] = arguments[++argsIndex]; |
| } |
| var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func; |
| return fn.apply(isBind ? thisArg : this, args); |
| } |
| return wrapper; |
| } |
| |
| module.exports = createPartialWrapper; |
| |
| }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2NyZWF0ZVBhcnRpYWxXcmFwcGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0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TtcbiAgfVxuICByZXR1cm4gd3JhcHBlcjtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjcmVhdGVQYXJ0aWFsV3JhcHBlcjtcbiJdfQ== |
| },{"./createCtorWrapper":105}],110:[function(require,module,exports){ |
| var baseSetData = require('./baseSetData'), |
| createBindWrapper = require('./createBindWrapper'), |
| createHybridWrapper = require('./createHybridWrapper'), |
| createPartialWrapper = require('./createPartialWrapper'), |
| getData = require('./getData'), |
| mergeData = require('./mergeData'), |
| setData = require('./setData'); |
| |
| /** Used to compose bitmasks for wrapper metadata. */ |
| var BIND_FLAG = 1, |
| BIND_KEY_FLAG = 2, |
| PARTIAL_FLAG = 32, |
| PARTIAL_RIGHT_FLAG = 64; |
| |
| /** Used as the `TypeError` message for "Functions" methods. */ |
| var FUNC_ERROR_TEXT = 'Expected a function'; |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMax = Math.max; |
| |
| /** |
| * Creates a function that either curries or invokes `func` with optional |
| * `this` binding and partially applied arguments. |
| * |
| * @private |
| * @param {Function|string} func The function or method name to reference. |
| * @param {number} bitmask The bitmask of flags. |
| * The bitmask may be composed of the following flags: |
| * 1 - `_.bind` |
| * 2 - `_.bindKey` |
| * 4 - `_.curry` or `_.curryRight` of a bound function |
| * 8 - `_.curry` |
| * 16 - `_.curryRight` |
| * 32 - `_.partial` |
| * 64 - `_.partialRight` |
| * 128 - `_.rearg` |
| * 256 - `_.ary` |
| * @param {*} [thisArg] The `this` binding of `func`. |
| * @param {Array} [partials] The arguments to be partially applied. |
| * @param {Array} [holders] The `partials` placeholder indexes. |
| * @param {Array} [argPos] The argument positions of the new function. |
| * @param {number} [ary] The arity cap of `func`. |
| * @param {number} [arity] The arity of `func`. |
| * @returns {Function} Returns the new wrapped function. |
| */ |
| function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { |
| var isBindKey = bitmask & BIND_KEY_FLAG; |
| if (!isBindKey && typeof func != 'function') { |
| throw new TypeError(FUNC_ERROR_TEXT); |
| } |
| var length = partials ? partials.length : 0; |
| if (!length) { |
| bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); |
| partials = holders = undefined; |
| } |
| length -= (holders ? holders.length : 0); |
| if (bitmask & PARTIAL_RIGHT_FLAG) { |
| var partialsRight = partials, |
| holdersRight = holders; |
| |
| partials = holders = undefined; |
| } |
| var data = isBindKey ? undefined : getData(func), |
| newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; |
| |
| if (data) { |
| mergeData(newData, data); |
| bitmask = newData[1]; |
| arity = newData[9]; |
| } |
| newData[9] = arity == null |
| ? (isBindKey ? 0 : func.length) |
| : (nativeMax(arity - length, 0) || 0); |
| |
| if (bitmask == BIND_FLAG) { |
| var result = createBindWrapper(newData[0], newData[2]); |
| } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { |
| result = createPartialWrapper.apply(undefined, newData); |
| } else { |
| result = createHybridWrapper.apply(undefined, newData); |
| } |
| var setter = data ? baseSetData : setData; |
| return setter(result, newData); |
| } |
| |
| module.exports = createWrapper; |
| |
| },{"./baseSetData":92,"./createBindWrapper":104,"./createHybridWrapper":108,"./createPartialWrapper":109,"./getData":114,"./mergeData":132,"./setData":137}],111:[function(require,module,exports){ |
| var arraySome = require('./arraySome'); |
| |
| /** |
| * A specialized version of `baseIsEqualDeep` for arrays with support for |
| * partial deep comparisons. |
| * |
| * @private |
| * @param {Array} array The array to compare. |
| * @param {Array} other The other array to compare. |
| * @param {Function} equalFunc The function to determine equivalents of values. |
| * @param {Function} [customizer] The function to customize comparing arrays. |
| * @param {boolean} [isLoose] Specify performing partial comparisons. |
| * @param {Array} [stackA] Tracks traversed `value` objects. |
| * @param {Array} [stackB] Tracks traversed `other` objects. |
| * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. |
| */ |
| function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { |
| var index = -1, |
| arrLength = array.length, |
| othLength = other.length; |
| |
| if (arrLength != othLength && !(isLoose && othLength > arrLength)) { |
| return false; |
| } |
| // Ignore non-index properties. |
| while (++index < arrLength) { |
| var arrValue = array[index], |
| othValue = other[index], |
| result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; |
| |
| if (result !== undefined) { |
| if (result) { |
| continue; |
| } |
| return false; |
| } |
| // Recursively compare arrays (susceptible to call stack limits). |
| if (isLoose) { |
| if (!arraySome(other, function(othValue) { |
| return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); |
| })) { |
| return false; |
| } |
| } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { |
| return false; |
| } |
| } |
| return true; |
| } |
| |
| module.exports = equalArrays; |
| |
| },{"./arraySome":69}],112:[function(require,module,exports){ |
| /** `Object#toString` result references. */ |
| var boolTag = '[object Boolean]', |
| dateTag = '[object Date]', |
| errorTag = '[object Error]', |
| numberTag = '[object Number]', |
| regexpTag = '[object RegExp]', |
| stringTag = '[object String]'; |
| |
| /** |
| * A specialized version of `baseIsEqualDeep` for comparing objects of |
| * the same `toStringTag`. |
| * |
| * **Note:** This function only supports comparing values with tags of |
| * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. |
| * |
| * @private |
| * @param {Object} object The object to compare. |
| * @param {Object} other The other object to compare. |
| * @param {string} tag The `toStringTag` of the objects to compare. |
| * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
| */ |
| function equalByTag(object, other, tag) { |
| switch (tag) { |
| case boolTag: |
| case dateTag: |
| // Coerce dates and booleans to numbers, dates to milliseconds and booleans |
| // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. |
| return +object == +other; |
| |
| case errorTag: |
| return object.name == other.name && object.message == other.message; |
| |
| case numberTag: |
| // Treat `NaN` vs. `NaN` as equal. |
| return (object != +object) |
| ? other != +other |
| : object == +other; |
| |
| case regexpTag: |
| case stringTag: |
| // Coerce regexes to strings and treat strings primitives and string |
| // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. |
| return object == (other + ''); |
| } |
| return false; |
| } |
| |
| module.exports = equalByTag; |
| |
| },{}],113:[function(require,module,exports){ |
| var keys = require('../object/keys'); |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** |
| * A specialized version of `baseIsEqualDeep` for objects with support for |
| * partial deep comparisons. |
| * |
| * @private |
| * @param {Object} object The object to compare. |
| * @param {Object} other The other object to compare. |
| * @param {Function} equalFunc The function to determine equivalents of values. |
| * @param {Function} [customizer] The function to customize comparing values. |
| * @param {boolean} [isLoose] Specify performing partial comparisons. |
| * @param {Array} [stackA] Tracks traversed `value` objects. |
| * @param {Array} [stackB] Tracks traversed `other` objects. |
| * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
| */ |
| function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { |
| var objProps = keys(object), |
| objLength = objProps.length, |
| othProps = keys(other), |
| othLength = othProps.length; |
| |
| if (objLength != othLength && !isLoose) { |
| return false; |
| } |
| var index = objLength; |
| while (index--) { |
| var key = objProps[index]; |
| if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { |
| return false; |
| } |
| } |
| var skipCtor = isLoose; |
| while (++index < objLength) { |
| key = objProps[index]; |
| var objValue = object[key], |
| othValue = other[key], |
| result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; |
| |
| // Recursively compare objects (susceptible to call stack limits). |
| if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { |
| return false; |
| } |
| skipCtor || (skipCtor = key == 'constructor'); |
| } |
| if (!skipCtor) { |
| var objCtor = object.constructor, |
| othCtor = other.constructor; |
| |
| // Non `Object` object instances with different constructors are not equal. |
| if (objCtor != othCtor && |
| ('constructor' in object && 'constructor' in other) && |
| !(typeof objCtor == 'function' && objCtor instanceof objCtor && |
| typeof othCtor == 'function' && othCtor instanceof othCtor)) { |
| return false; |
| } |
| } |
| return true; |
| } |
| |
| module.exports = equalObjects; |
| |
| },{"../object/keys":153}],114:[function(require,module,exports){ |
| var metaMap = require('./metaMap'), |
| noop = require('../utility/noop'); |
| |
| /** |
| * Gets metadata for `func`. |
| * |
| * @private |
| * @param {Function} func The function to query. |
| * @returns {*} Returns the metadata for `func`. |
| */ |
| var getData = !metaMap ? noop : function(func) { |
| return metaMap.get(func); |
| }; |
| |
| module.exports = getData; |
| |
| },{"../utility/noop":159,"./metaMap":133}],115:[function(require,module,exports){ |
| var realNames = require('./realNames'); |
| |
| /** |
| * Gets the name of `func`. |
| * |
| * @private |
| * @param {Function} func The function to query. |
| * @returns {string} Returns the function name. |
| */ |
| function getFuncName(func) { |
| var result = (func.name + ''), |
| array = realNames[result], |
| length = array ? array.length : 0; |
| |
| while (length--) { |
| var data = array[length], |
| otherFunc = data.func; |
| if (otherFunc == null || otherFunc == func) { |
| return data.name; |
| } |
| } |
| return result; |
| } |
| |
| module.exports = getFuncName; |
| |
| },{"./realNames":134}],116:[function(require,module,exports){ |
| var baseProperty = require('./baseProperty'); |
| |
| /** |
| * Gets the "length" property value of `object`. |
| * |
| * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) |
| * that affects Safari on at least iOS 8.1-8.3 ARM64. |
| * |
| * @private |
| * @param {Object} object The object to query. |
| * @returns {*} Returns the "length" value. |
| */ |
| var getLength = baseProperty('length'); |
| |
| module.exports = getLength; |
| |
| },{"./baseProperty":90}],117:[function(require,module,exports){ |
| var isStrictComparable = require('./isStrictComparable'), |
| pairs = require('../object/pairs'); |
| |
| /** |
| * Gets the propery names, values, and compare flags of `object`. |
| * |
| * @private |
| * @param {Object} object The object to query. |
| * @returns {Array} Returns the match data of `object`. |
| */ |
| function getMatchData(object) { |
| var result = pairs(object), |
| length = result.length; |
| |
| while (length--) { |
| result[length][2] = isStrictComparable(result[length][1]); |
| } |
| return result; |
| } |
| |
| module.exports = getMatchData; |
| |
| },{"../object/pairs":155,"./isStrictComparable":131}],118:[function(require,module,exports){ |
| var isNative = require('../lang/isNative'); |
| |
| /** |
| * Gets the native function at `key` of `object`. |
| * |
| * @private |
| * @param {Object} object The object to query. |
| * @param {string} key The key of the method to get. |
| * @returns {*} Returns the function if it's native, else `undefined`. |
| */ |
| function getNative(object, key) { |
| var value = object == null ? undefined : object[key]; |
| return isNative(value) ? value : undefined; |
| } |
| |
| module.exports = getNative; |
| |
| },{"../lang/isNative":147}],119:[function(require,module,exports){ |
| /** |
| * Gets the index at which the first occurrence of `NaN` is found in `array`. |
| * |
| * @private |
| * @param {Array} array The array to search. |
| * @param {number} fromIndex The index to search from. |
| * @param {boolean} [fromRight] Specify iterating from right to left. |
| * @returns {number} Returns the index of the matched `NaN`, else `-1`. |
| */ |
| function indexOfNaN(array, fromIndex, fromRight) { |
| var length = array.length, |
| index = fromIndex + (fromRight ? 0 : -1); |
| |
| while ((fromRight ? index-- : ++index < length)) { |
| var other = array[index]; |
| if (other !== other) { |
| return index; |
| } |
| } |
| return -1; |
| } |
| |
| module.exports = indexOfNaN; |
| |
| },{}],120:[function(require,module,exports){ |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** |
| * Initializes an array clone. |
| * |
| * @private |
| * @param {Array} array The array to clone. |
| * @returns {Array} Returns the initialized clone. |
| */ |
| function initCloneArray(array) { |
| var length = array.length, |
| result = new array.constructor(length); |
| |
| // Add array properties assigned by `RegExp#exec`. |
| if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { |
| result.index = array.index; |
| result.input = array.input; |
| } |
| return result; |
| } |
| |
| module.exports = initCloneArray; |
| |
| },{}],121:[function(require,module,exports){ |
| (function (global){ |
| var bufferClone = require('./bufferClone'); |
| |
| /** `Object#toString` result references. */ |
| var boolTag = '[object Boolean]', |
| dateTag = '[object Date]', |
| numberTag = '[object Number]', |
| regexpTag = '[object RegExp]', |
| stringTag = '[object String]'; |
| |
| var arrayBufferTag = '[object ArrayBuffer]', |
| float32Tag = '[object Float32Array]', |
| float64Tag = '[object Float64Array]', |
| int8Tag = '[object Int8Array]', |
| int16Tag = '[object Int16Array]', |
| int32Tag = '[object Int32Array]', |
| uint8Tag = '[object Uint8Array]', |
| uint8ClampedTag = '[object Uint8ClampedArray]', |
| uint16Tag = '[object Uint16Array]', |
| uint32Tag = '[object Uint32Array]'; |
| |
| /** Used to match `RegExp` flags from their coerced string values. */ |
| var reFlags = /\w*$/; |
| |
| /** Native method references. */ |
| var Uint8Array = global.Uint8Array; |
| |
| /** Used to lookup a type array constructors by `toStringTag`. */ |
| var ctorByTag = {}; |
| ctorByTag[float32Tag] = global.Float32Array; |
| ctorByTag[float64Tag] = global.Float64Array; |
| ctorByTag[int8Tag] = global.Int8Array; |
| ctorByTag[int16Tag] = global.Int16Array; |
| ctorByTag[int32Tag] = global.Int32Array; |
| ctorByTag[uint8Tag] = Uint8Array; |
| ctorByTag[uint8ClampedTag] = global.Uint8ClampedArray; |
| ctorByTag[uint16Tag] = global.Uint16Array; |
| ctorByTag[uint32Tag] = global.Uint32Array; |
| |
| /** |
| * Initializes an object clone based on its `toStringTag`. |
| * |
| * **Note:** This function only supports cloning values with tags of |
| * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. |
| * |
| * @private |
| * @param {Object} object The object to clone. |
| * @param {string} tag The `toStringTag` of the object to clone. |
| * @param {boolean} [isDeep] Specify a deep clone. |
| * @returns {Object} Returns the initialized clone. |
| */ |
| function initCloneByTag(object, tag, isDeep) { |
| var Ctor = object.constructor; |
| switch (tag) { |
| case arrayBufferTag: |
| return bufferClone(object); |
| |
| case boolTag: |
| case dateTag: |
| return new Ctor(+object); |
| |
| case float32Tag: case float64Tag: |
| case int8Tag: case int16Tag: case int32Tag: |
| case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: |
| // Safari 5 mobile incorrectly has `Object` as the constructor of typed arrays. |
| if (Ctor instanceof Ctor) { |
| Ctor = ctorByTag[tag]; |
| } |
| var buffer = object.buffer; |
| return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); |
| |
| case numberTag: |
| case stringTag: |
| return new Ctor(object); |
| |
| case regexpTag: |
| var result = new Ctor(object.source, reFlags.exec(object)); |
| result.lastIndex = object.lastIndex; |
| } |
| return result; |
| } |
| |
| module.exports = initCloneByTag; |
| |
| }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL2luaXRDbG9uZUJ5VGFnLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUN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3RvciBpbnN0YW5jZW9mIEN0b3IpIHtcbiAgICAgICAgQ3RvciA9IGN0b3JCeVRhZ1t0YWddO1xuICAgICAgfVxuICAgICAgdmFyIGJ1ZmZlciA9IG9iamVjdC5idWZmZXI7XG4gICAgICByZXR1cm4gbmV3IEN0b3IoaXNEZWVwID8gYnVmZmVyQ2xvbmUoYnVmZmVyKSA6IGJ1ZmZlciwgb2JqZWN0LmJ5dGVPZmZzZXQsIG9iamVjdC5sZW5ndGgpO1xuXG4gICAgY2FzZSBudW1iZXJUYWc6XG4gICAgY2FzZSBzdHJpbmdUYWc6XG4gICAgICByZXR1cm4gbmV3IEN0b3Iob2JqZWN0KTtcblxuICAgIGNhc2UgcmVnZXhwVGFnOlxuICAgICAgdmFyIHJlc3VsdCA9IG5ldyBDdG9yKG9iamVjdC5zb3VyY2UsIHJlRmxhZ3MuZXhlYyhvYmplY3QpKTtcbiAgICAgIHJlc3VsdC5sYXN0SW5kZXggPSBvYmplY3QubGFzdEluZGV4O1xuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaW5pdENsb25lQnlUYWc7XG4iXX0= |
| },{"./bufferClone":99}],122:[function(require,module,exports){ |
| /** |
| * Initializes an object clone. |
| * |
| * @private |
| * @param {Object} object The object to clone. |
| * @returns {Object} Returns the initialized clone. |
| */ |
| function initCloneObject(object) { |
| var Ctor = object.constructor; |
| if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { |
| Ctor = Object; |
| } |
| return new Ctor; |
| } |
| |
| module.exports = initCloneObject; |
| |
| },{}],123:[function(require,module,exports){ |
| var getLength = require('./getLength'), |
| isLength = require('./isLength'); |
| |
| /** |
| * Checks if `value` is array-like. |
| * |
| * @private |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is array-like, else `false`. |
| */ |
| function isArrayLike(value) { |
| return value != null && isLength(getLength(value)); |
| } |
| |
| module.exports = isArrayLike; |
| |
| },{"./getLength":116,"./isLength":129}],124:[function(require,module,exports){ |
| /** |
| * Checks if `value` is a host object in IE < 9. |
| * |
| * @private |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is a host object, else `false`. |
| */ |
| var isHostObject = (function() { |
| try { |
| Object({ 'toString': 0 } + ''); |
| } catch(e) { |
| return function() { return false; }; |
| } |
| return function(value) { |
| // IE < 9 presents many host objects as `Object` objects that can coerce |
| // to strings despite having improperly defined `toString` methods. |
| return typeof value.toString != 'function' && typeof (value + '') == 'string'; |
| }; |
| }()); |
| |
| module.exports = isHostObject; |
| |
| },{}],125:[function(require,module,exports){ |
| /** Used to detect unsigned integer values. */ |
| var reIsUint = /^\d+$/; |
| |
| /** |
| * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) |
| * of an array-like value. |
| */ |
| var MAX_SAFE_INTEGER = 9007199254740991; |
| |
| /** |
| * Checks if `value` is a valid array-like index. |
| * |
| * @private |
| * @param {*} value The value to check. |
| * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. |
| * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. |
| */ |
| function isIndex(value, length) { |
| value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; |
| length = length == null ? MAX_SAFE_INTEGER : length; |
| return value > -1 && value % 1 == 0 && value < length; |
| } |
| |
| module.exports = isIndex; |
| |
| },{}],126:[function(require,module,exports){ |
| var isArrayLike = require('./isArrayLike'), |
| isIndex = require('./isIndex'), |
| isObject = require('../lang/isObject'); |
| |
| /** |
| * Checks if the provided arguments are from an iteratee call. |
| * |
| * @private |
| * @param {*} value The potential iteratee value argument. |
| * @param {*} index The potential iteratee index or key argument. |
| * @param {*} object The potential iteratee object argument. |
| * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. |
| */ |
| function isIterateeCall(value, index, object) { |
| if (!isObject(object)) { |
| return false; |
| } |
| var type = typeof index; |
| if (type == 'number' |
| ? (isArrayLike(object) && isIndex(index, object.length)) |
| : (type == 'string' && index in object)) { |
| var other = object[index]; |
| return value === value ? (value === other) : (other !== other); |
| } |
| return false; |
| } |
| |
| module.exports = isIterateeCall; |
| |
| },{"../lang/isObject":148,"./isArrayLike":123,"./isIndex":125}],127:[function(require,module,exports){ |
| var isArray = require('../lang/isArray'), |
| toObject = require('./toObject'); |
| |
| /** Used to match property names within property paths. */ |
| var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, |
| reIsPlainProp = /^\w*$/; |
| |
| /** |
| * Checks if `value` is a property name and not a property path. |
| * |
| * @private |
| * @param {*} value The value to check. |
| * @param {Object} [object] The object to query keys on. |
| * @returns {boolean} Returns `true` if `value` is a property name, else `false`. |
| */ |
| function isKey(value, object) { |
| var type = typeof value; |
| if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { |
| return true; |
| } |
| if (isArray(value)) { |
| return false; |
| } |
| var result = !reIsDeepProp.test(value); |
| return result || (object != null && value in toObject(object)); |
| } |
| |
| module.exports = isKey; |
| |
| },{"../lang/isArray":144,"./toObject":139}],128:[function(require,module,exports){ |
| var LazyWrapper = require('./LazyWrapper'), |
| getData = require('./getData'), |
| getFuncName = require('./getFuncName'), |
| lodash = require('../chain/lodash'); |
| |
| /** |
| * Checks if `func` has a lazy counterpart. |
| * |
| * @private |
| * @param {Function} func The function to check. |
| * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. |
| */ |
| function isLaziable(func) { |
| var funcName = getFuncName(func), |
| other = lodash[funcName]; |
| |
| if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { |
| return false; |
| } |
| if (func === other) { |
| return true; |
| } |
| var data = getData(other); |
| return !!data && func === data[0]; |
| } |
| |
| module.exports = isLaziable; |
| |
| },{"../chain/lodash":55,"./LazyWrapper":64,"./getData":114,"./getFuncName":115}],129:[function(require,module,exports){ |
| /** |
| * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) |
| * of an array-like value. |
| */ |
| var MAX_SAFE_INTEGER = 9007199254740991; |
| |
| /** |
| * Checks if `value` is a valid array-like length. |
| * |
| * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). |
| * |
| * @private |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. |
| */ |
| function isLength(value) { |
| return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; |
| } |
| |
| module.exports = isLength; |
| |
| },{}],130:[function(require,module,exports){ |
| /** |
| * Checks if `value` is object-like. |
| * |
| * @private |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is object-like, else `false`. |
| */ |
| function isObjectLike(value) { |
| return !!value && typeof value == 'object'; |
| } |
| |
| module.exports = isObjectLike; |
| |
| },{}],131:[function(require,module,exports){ |
| var isObject = require('../lang/isObject'); |
| |
| /** |
| * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. |
| * |
| * @private |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` if suitable for strict |
| * equality comparisons, else `false`. |
| */ |
| function isStrictComparable(value) { |
| return value === value && !isObject(value); |
| } |
| |
| module.exports = isStrictComparable; |
| |
| },{"../lang/isObject":148}],132:[function(require,module,exports){ |
| var arrayCopy = require('./arrayCopy'), |
| composeArgs = require('./composeArgs'), |
| composeArgsRight = require('./composeArgsRight'), |
| replaceHolders = require('./replaceHolders'); |
| |
| /** Used to compose bitmasks for wrapper metadata. */ |
| var BIND_FLAG = 1, |
| CURRY_BOUND_FLAG = 4, |
| CURRY_FLAG = 8, |
| ARY_FLAG = 128, |
| REARG_FLAG = 256; |
| |
| /** Used as the internal argument placeholder. */ |
| var PLACEHOLDER = '__lodash_placeholder__'; |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMin = Math.min; |
| |
| /** |
| * Merges the function metadata of `source` into `data`. |
| * |
| * Merging metadata reduces the number of wrappers required to invoke a function. |
| * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` |
| * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` |
| * augment function arguments, making the order in which they are executed important, |
| * preventing the merging of metadata. However, we make an exception for a safe |
| * common case where curried functions have `_.ary` and or `_.rearg` applied. |
| * |
| * @private |
| * @param {Array} data The destination metadata. |
| * @param {Array} source The source metadata. |
| * @returns {Array} Returns `data`. |
| */ |
| function mergeData(data, source) { |
| var bitmask = data[1], |
| srcBitmask = source[1], |
| newBitmask = bitmask | srcBitmask, |
| isCommon = newBitmask < ARY_FLAG; |
| |
| var isCombo = |
| (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) || |
| (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) || |
| (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG); |
| |
| // Exit early if metadata can't be merged. |
| if (!(isCommon || isCombo)) { |
| return data; |
| } |
| // Use source `thisArg` if available. |
| if (srcBitmask & BIND_FLAG) { |
| data[2] = source[2]; |
| // Set when currying a bound function. |
| newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; |
| } |
| // Compose partial arguments. |
| var value = source[3]; |
| if (value) { |
| var partials = data[3]; |
| data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); |
| data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); |
| } |
| // Compose partial right arguments. |
| value = source[5]; |
| if (value) { |
| partials = data[5]; |
| data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); |
| data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); |
| } |
| // Use source `argPos` if available. |
| value = source[7]; |
| if (value) { |
| data[7] = arrayCopy(value); |
| } |
| // Use source `ary` if it's smaller. |
| if (srcBitmask & ARY_FLAG) { |
| data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); |
| } |
| // Use source `arity` if one is not provided. |
| if (data[9] == null) { |
| data[9] = source[9]; |
| } |
| // Use source `func` and merge bitmasks. |
| data[0] = source[0]; |
| data[1] = newBitmask; |
| |
| return data; |
| } |
| |
| module.exports = mergeData; |
| |
| },{"./arrayCopy":66,"./composeArgs":100,"./composeArgsRight":101,"./replaceHolders":136}],133:[function(require,module,exports){ |
| (function (global){ |
| var getNative = require('./getNative'); |
| |
| /** Native method references. */ |
| var WeakMap = getNative(global, 'WeakMap'); |
| |
| /** Used to store function metadata. */ |
| var metaMap = WeakMap && new WeakMap; |
| |
| module.exports = metaMap; |
| |
| }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gtY29tcGF0L2ludGVybmFsL21ldGFNYXAuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0TmF0aXZlID0gcmVxdWlyZSgnLi9nZXROYXRpdmUnKTtcblxuLyoqIE5hdGl2ZSBtZXRob2QgcmVmZXJlbmNlcy4gKi9cbnZhciBXZWFrTWFwID0gZ2V0TmF0aXZlKGdsb2JhbCwgJ1dlYWtNYXAnKTtcblxuLyoqIFVzZWQgdG8gc3RvcmUgZnVuY3Rpb24gbWV0YWRhdGEuICovXG52YXIgbWV0YU1hcCA9IFdlYWtNYXAgJiYgbmV3IFdlYWtNYXA7XG5cbm1vZHVsZS5leHBvcnRzID0gbWV0YU1hcDtcbiJdfQ== |
| },{"./getNative":118}],134:[function(require,module,exports){ |
| /** Used to lookup unminified function names. */ |
| var realNames = {}; |
| |
| module.exports = realNames; |
| |
| },{}],135:[function(require,module,exports){ |
| var arrayCopy = require('./arrayCopy'), |
| isIndex = require('./isIndex'); |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeMin = Math.min; |
| |
| /** |
| * Reorder `array` according to the specified indexes where the element at |
| * the first index is assigned as the first element, the element at |
| * the second index is assigned as the second element, and so on. |
| * |
| * @private |
| * @param {Array} array The array to reorder. |
| * @param {Array} indexes The arranged array indexes. |
| * @returns {Array} Returns `array`. |
| */ |
| function reorder(array, indexes) { |
| var arrLength = array.length, |
| length = nativeMin(indexes.length, arrLength), |
| oldArray = arrayCopy(array); |
| |
| while (length--) { |
| var index = indexes[length]; |
| array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; |
| } |
| return array; |
| } |
| |
| module.exports = reorder; |
| |
| },{"./arrayCopy":66,"./isIndex":125}],136:[function(require,module,exports){ |
| /** Used as the internal argument placeholder. */ |
| var PLACEHOLDER = '__lodash_placeholder__'; |
| |
| /** |
| * Replaces all `placeholder` elements in `array` with an internal placeholder |
| * and returns an array of their indexes. |
| * |
| * @private |
| * @param {Array} array The array to modify. |
| * @param {*} placeholder The placeholder to replace. |
| * @returns {Array} Returns the new array of placeholder indexes. |
| */ |
| function replaceHolders(array, placeholder) { |
| var index = -1, |
| length = array.length, |
| resIndex = -1, |
| result = []; |
| |
| while (++index < length) { |
| if (array[index] === placeholder) { |
| array[index] = PLACEHOLDER; |
| result[++resIndex] = index; |
| } |
| } |
| return result; |
| } |
| |
| module.exports = replaceHolders; |
| |
| },{}],137:[function(require,module,exports){ |
| var baseSetData = require('./baseSetData'), |
| now = require('../date/now'); |
| |
| /** Used to detect when a function becomes hot. */ |
| var HOT_COUNT = 150, |
| HOT_SPAN = 16; |
| |
| /** |
| * Sets metadata for `func`. |
| * |
| * **Note:** If this function becomes hot, i.e. is invoked a lot in a short |
| * period of time, it will trip its breaker and transition to an identity function |
| * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) |
| * for more details. |
| * |
| * @private |
| * @param {Function} func The function to associate metadata with. |
| * @param {*} data The metadata. |
| * @returns {Function} Returns `func`. |
| */ |
| var setData = (function() { |
| var count = 0, |
| lastCalled = 0; |
| |
| return function(key, value) { |
| var stamp = now(), |
| remaining = HOT_SPAN - (stamp - lastCalled); |
| |
| lastCalled = stamp; |
| if (remaining > 0) { |
| if (++count >= HOT_COUNT) { |
| return key; |
| } |
| } else { |
| count = 0; |
| } |
| return baseSetData(key, value); |
| }; |
| }()); |
| |
| module.exports = setData; |
| |
| },{"../date/now":61,"./baseSetData":92}],138:[function(require,module,exports){ |
| var isArguments = require('../lang/isArguments'), |
| isArray = require('../lang/isArray'), |
| isIndex = require('./isIndex'), |
| isLength = require('./isLength'), |
| isString = require('../lang/isString'), |
| keysIn = require('../object/keysIn'); |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** |
| * A fallback implementation of `Object.keys` which creates an array of the |
| * own enumerable property names of `object`. |
| * |
| * @private |
| * @param {Object} object The object to query. |
| * @returns {Array} Returns the array of property names. |
| */ |
| function shimKeys(object) { |
| var props = keysIn(object), |
| propsLength = props.length, |
| length = propsLength && object.length; |
| |
| var allowIndexes = !!length && isLength(length) && |
| (isArray(object) || isArguments(object) || isString(object)); |
| |
| var index = -1, |
| result = []; |
| |
| while (++index < propsLength) { |
| var key = props[index]; |
| if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { |
| result.push(key); |
| } |
| } |
| return result; |
| } |
| |
| module.exports = shimKeys; |
| |
| },{"../lang/isArguments":143,"../lang/isArray":144,"../lang/isString":150,"../object/keysIn":154,"./isIndex":125,"./isLength":129}],139:[function(require,module,exports){ |
| var isObject = require('../lang/isObject'), |
| isString = require('../lang/isString'), |
| support = require('../support'); |
| |
| /** |
| * Converts `value` to an object if it's not one. |
| * |
| * @private |
| * @param {*} value The value to process. |
| * @returns {Object} Returns the object. |
| */ |
| function toObject(value) { |
| if (support.unindexedChars && isString(value)) { |
| var index = -1, |
| length = value.length, |
| result = Object(value); |
| |
| while (++index < length) { |
| result[index] = value.charAt(index); |
| } |
| return result; |
| } |
| return isObject(value) ? value : Object(value); |
| } |
| |
| module.exports = toObject; |
| |
| },{"../lang/isObject":148,"../lang/isString":150,"../support":157}],140:[function(require,module,exports){ |
| var baseToString = require('./baseToString'), |
| isArray = require('../lang/isArray'); |
| |
| /** Used to match property names within property paths. */ |
| var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; |
| |
| /** Used to match backslashes in property paths. */ |
| var reEscapeChar = /\\(\\)?/g; |
| |
| /** |
| * Converts `value` to property path array if it's not one. |
| * |
| * @private |
| * @param {*} value The value to process. |
| * @returns {Array} Returns the property path array. |
| */ |
| function toPath(value) { |
| if (isArray(value)) { |
| return value; |
| } |
| var result = []; |
| baseToString(value).replace(rePropName, function(match, number, quote, string) { |
| result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); |
| }); |
| return result; |
| } |
| |
| module.exports = toPath; |
| |
| },{"../lang/isArray":144,"./baseToString":94}],141:[function(require,module,exports){ |
| var LazyWrapper = require('./LazyWrapper'), |
| LodashWrapper = require('./LodashWrapper'), |
| arrayCopy = require('./arrayCopy'); |
| |
| /** |
| * Creates a clone of `wrapper`. |
| * |
| * @private |
| * @param {Object} wrapper The wrapper to clone. |
| * @returns {Object} Returns the cloned wrapper. |
| */ |
| function wrapperClone(wrapper) { |
| return wrapper instanceof LazyWrapper |
| ? wrapper.clone() |
| : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__)); |
| } |
| |
| module.exports = wrapperClone; |
| |
| },{"./LazyWrapper":64,"./LodashWrapper":65,"./arrayCopy":66}],142:[function(require,module,exports){ |
| var baseClone = require('../internal/baseClone'), |
| bindCallback = require('../internal/bindCallback'); |
| |
| /** |
| * Creates a deep clone of `value`. If `customizer` is provided it's invoked |
| * to produce the cloned values. If `customizer` returns `undefined` cloning |
| * is handled by the method instead. The `customizer` is bound to `thisArg` |
| * and invoked with up to three argument; (value [, index|key, object]). |
| * |
| * **Note:** This method is loosely based on the |
| * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). |
| * The enumerable properties of `arguments` objects and objects created by |
| * constructors other than `Object` are cloned to plain `Object` objects. An |
| * empty object is returned for uncloneable values such as functions, DOM nodes, |
| * Maps, Sets, and WeakMaps. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to deep clone. |
| * @param {Function} [customizer] The function to customize cloning values. |
| * @param {*} [thisArg] The `this` binding of `customizer`. |
| * @returns {*} Returns the deep cloned value. |
| * @example |
| * |
| * var users = [ |
| * { 'user': 'barney' }, |
| * { 'user': 'fred' } |
| * ]; |
| * |
| * var deep = _.cloneDeep(users); |
| * deep[0] === users[0]; |
| * // => false |
| * |
| * // using a customizer callback |
| * var el = _.cloneDeep(document.body, function(value) { |
| * if (_.isElement(value)) { |
| * return value.cloneNode(true); |
| * } |
| * }); |
| * |
| * el === document.body |
| * // => false |
| * el.nodeName |
| * // => BODY |
| * el.childNodes.length; |
| * // => 20 |
| */ |
| function cloneDeep(value, customizer, thisArg) { |
| return typeof customizer == 'function' |
| ? baseClone(value, true, bindCallback(customizer, thisArg, 3)) |
| : baseClone(value, true); |
| } |
| |
| module.exports = cloneDeep; |
| |
| },{"../internal/baseClone":72,"../internal/bindCallback":98}],143:[function(require,module,exports){ |
| var isArrayLike = require('../internal/isArrayLike'), |
| isObjectLike = require('../internal/isObjectLike'); |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** Native method references. */ |
| var propertyIsEnumerable = objectProto.propertyIsEnumerable; |
| |
| /** |
| * Checks if `value` is classified as an `arguments` object. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. |
| * @example |
| * |
| * _.isArguments(function() { return arguments; }()); |
| * // => true |
| * |
| * _.isArguments([1, 2, 3]); |
| * // => false |
| */ |
| function isArguments(value) { |
| return isObjectLike(value) && isArrayLike(value) && |
| hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); |
| } |
| |
| module.exports = isArguments; |
| |
| },{"../internal/isArrayLike":123,"../internal/isObjectLike":130}],144:[function(require,module,exports){ |
| var getNative = require('../internal/getNative'), |
| isLength = require('../internal/isLength'), |
| isObjectLike = require('../internal/isObjectLike'); |
| |
| /** `Object#toString` result references. */ |
| var arrayTag = '[object Array]'; |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** |
| * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) |
| * of values. |
| */ |
| var objToString = objectProto.toString; |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeIsArray = getNative(Array, 'isArray'); |
| |
| /** |
| * Checks if `value` is classified as an `Array` object. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. |
| * @example |
| * |
| * _.isArray([1, 2, 3]); |
| * // => true |
| * |
| * _.isArray(function() { return arguments; }()); |
| * // => false |
| */ |
| var isArray = nativeIsArray || function(value) { |
| return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; |
| }; |
| |
| module.exports = isArray; |
| |
| },{"../internal/getNative":118,"../internal/isLength":129,"../internal/isObjectLike":130}],145:[function(require,module,exports){ |
| var isArguments = require('./isArguments'), |
| isArray = require('./isArray'), |
| isArrayLike = require('../internal/isArrayLike'), |
| isFunction = require('./isFunction'), |
| isObjectLike = require('../internal/isObjectLike'), |
| isString = require('./isString'), |
| keys = require('../object/keys'); |
| |
| /** |
| * Checks if `value` is empty. A value is considered empty unless it's an |
| * `arguments` object, array, string, or jQuery-like collection with a length |
| * greater than `0` or an object with own enumerable properties. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {Array|Object|string} value The value to inspect. |
| * @returns {boolean} Returns `true` if `value` is empty, else `false`. |
| * @example |
| * |
| * _.isEmpty(null); |
| * // => true |
| * |
| * _.isEmpty(true); |
| * // => true |
| * |
| * _.isEmpty(1); |
| * // => true |
| * |
| * _.isEmpty([1, 2, 3]); |
| * // => false |
| * |
| * _.isEmpty({ 'a': 1 }); |
| * // => false |
| */ |
| function isEmpty(value) { |
| if (value == null) { |
| return true; |
| } |
| if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || |
| (isObjectLike(value) && isFunction(value.splice)))) { |
| return !value.length; |
| } |
| return !keys(value).length; |
| } |
| |
| module.exports = isEmpty; |
| |
| },{"../internal/isArrayLike":123,"../internal/isObjectLike":130,"../object/keys":153,"./isArguments":143,"./isArray":144,"./isFunction":146,"./isString":150}],146:[function(require,module,exports){ |
| var isObject = require('./isObject'); |
| |
| /** `Object#toString` result references. */ |
| var funcTag = '[object Function]'; |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** |
| * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) |
| * of values. |
| */ |
| var objToString = objectProto.toString; |
| |
| /** |
| * Checks if `value` is classified as a `Function` object. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. |
| * @example |
| * |
| * _.isFunction(_); |
| * // => true |
| * |
| * _.isFunction(/abc/); |
| * // => false |
| */ |
| function isFunction(value) { |
| // The use of `Object#toString` avoids issues with the `typeof` operator |
| // in older versions of Chrome and Safari which return 'function' for regexes |
| // and Safari 8 which returns 'object' for typed array constructors. |
| return isObject(value) && objToString.call(value) == funcTag; |
| } |
| |
| module.exports = isFunction; |
| |
| },{"./isObject":148}],147:[function(require,module,exports){ |
| var isFunction = require('./isFunction'), |
| isHostObject = require('../internal/isHostObject'), |
| isObjectLike = require('../internal/isObjectLike'); |
| |
| /** Used to detect host constructors (Safari > 5). */ |
| var reIsHostCtor = /^\[object .+?Constructor\]$/; |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** Used to resolve the decompiled source of functions. */ |
| var fnToString = Function.prototype.toString; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** Used to detect if a method is native. */ |
| var reIsNative = RegExp('^' + |
| fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') |
| .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' |
| ); |
| |
| /** |
| * Checks if `value` is a native function. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is a native function, else `false`. |
| * @example |
| * |
| * _.isNative(Array.prototype.push); |
| * // => true |
| * |
| * _.isNative(_); |
| * // => false |
| */ |
| function isNative(value) { |
| if (value == null) { |
| return false; |
| } |
| if (isFunction(value)) { |
| return reIsNative.test(fnToString.call(value)); |
| } |
| return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); |
| } |
| |
| module.exports = isNative; |
| |
| },{"../internal/isHostObject":124,"../internal/isObjectLike":130,"./isFunction":146}],148:[function(require,module,exports){ |
| /** |
| * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. |
| * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is an object, else `false`. |
| * @example |
| * |
| * _.isObject({}); |
| * // => true |
| * |
| * _.isObject([1, 2, 3]); |
| * // => true |
| * |
| * _.isObject(1); |
| * // => false |
| */ |
| function isObject(value) { |
| // Avoid a V8 JIT bug in Chrome 19-20. |
| // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. |
| var type = typeof value; |
| return !!value && (type == 'object' || type == 'function'); |
| } |
| |
| module.exports = isObject; |
| |
| },{}],149:[function(require,module,exports){ |
| var baseForIn = require('../internal/baseForIn'), |
| isArguments = require('./isArguments'), |
| isHostObject = require('../internal/isHostObject'), |
| isObjectLike = require('../internal/isObjectLike'), |
| support = require('../support'); |
| |
| /** `Object#toString` result references. */ |
| var objectTag = '[object Object]'; |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** |
| * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) |
| * of values. |
| */ |
| var objToString = objectProto.toString; |
| |
| /** |
| * Checks if `value` is a plain object, that is, an object created by the |
| * `Object` constructor or one with a `[[Prototype]]` of `null`. |
| * |
| * **Note:** This method assumes objects created by the `Object` constructor |
| * have no inherited enumerable properties. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. |
| * @example |
| * |
| * function Foo() { |
| * this.a = 1; |
| * } |
| * |
| * _.isPlainObject(new Foo); |
| * // => false |
| * |
| * _.isPlainObject([1, 2, 3]); |
| * // => false |
| * |
| * _.isPlainObject({ 'x': 0, 'y': 0 }); |
| * // => true |
| * |
| * _.isPlainObject(Object.create(null)); |
| * // => true |
| */ |
| function isPlainObject(value) { |
| var Ctor; |
| |
| // Exit early for non `Object` objects. |
| if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isHostObject(value) && !isArguments(value)) || |
| (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { |
| return false; |
| } |
| // IE < 9 iterates inherited properties before own properties. If the first |
| // iterated property is an object's own property then there are no inherited |
| // enumerable properties. |
| var result; |
| if (support.ownLast) { |
| baseForIn(value, function(subValue, key, object) { |
| result = hasOwnProperty.call(object, key); |
| return false; |
| }); |
| return result !== false; |
| } |
| // In most environments an object's own properties are iterated before |
| // its inherited properties. If the last iterated property is an object's |
| // own property then there are no inherited enumerable properties. |
| baseForIn(value, function(subValue, key) { |
| result = key; |
| }); |
| return result === undefined || hasOwnProperty.call(value, result); |
| } |
| |
| module.exports = isPlainObject; |
| |
| },{"../internal/baseForIn":79,"../internal/isHostObject":124,"../internal/isObjectLike":130,"../support":157,"./isArguments":143}],150:[function(require,module,exports){ |
| var isObjectLike = require('../internal/isObjectLike'); |
| |
| /** `Object#toString` result references. */ |
| var stringTag = '[object String]'; |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** |
| * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) |
| * of values. |
| */ |
| var objToString = objectProto.toString; |
| |
| /** |
| * Checks if `value` is classified as a `String` primitive or object. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. |
| * @example |
| * |
| * _.isString('abc'); |
| * // => true |
| * |
| * _.isString(1); |
| * // => false |
| */ |
| function isString(value) { |
| return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); |
| } |
| |
| module.exports = isString; |
| |
| },{"../internal/isObjectLike":130}],151:[function(require,module,exports){ |
| var isLength = require('../internal/isLength'), |
| isObjectLike = require('../internal/isObjectLike'); |
| |
| /** `Object#toString` result references. */ |
| var argsTag = '[object Arguments]', |
| arrayTag = '[object Array]', |
| boolTag = '[object Boolean]', |
| dateTag = '[object Date]', |
| errorTag = '[object Error]', |
| funcTag = '[object Function]', |
| mapTag = '[object Map]', |
| numberTag = '[object Number]', |
| objectTag = '[object Object]', |
| regexpTag = '[object RegExp]', |
| setTag = '[object Set]', |
| stringTag = '[object String]', |
| weakMapTag = '[object WeakMap]'; |
| |
| var arrayBufferTag = '[object ArrayBuffer]', |
| float32Tag = '[object Float32Array]', |
| float64Tag = '[object Float64Array]', |
| int8Tag = '[object Int8Array]', |
| int16Tag = '[object Int16Array]', |
| int32Tag = '[object Int32Array]', |
| uint8Tag = '[object Uint8Array]', |
| uint8ClampedTag = '[object Uint8ClampedArray]', |
| uint16Tag = '[object Uint16Array]', |
| uint32Tag = '[object Uint32Array]'; |
| |
| /** Used to identify `toStringTag` values of typed arrays. */ |
| var typedArrayTags = {}; |
| typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = |
| typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = |
| typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = |
| typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = |
| typedArrayTags[uint32Tag] = true; |
| typedArrayTags[argsTag] = typedArrayTags[arrayTag] = |
| typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = |
| typedArrayTags[dateTag] = typedArrayTags[errorTag] = |
| typedArrayTags[funcTag] = typedArrayTags[mapTag] = |
| typedArrayTags[numberTag] = typedArrayTags[objectTag] = |
| typedArrayTags[regexpTag] = typedArrayTags[setTag] = |
| typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; |
| |
| /** Used for native method references. */ |
| var objectProto = Object.prototype; |
| |
| /** |
| * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) |
| * of values. |
| */ |
| var objToString = objectProto.toString; |
| |
| /** |
| * Checks if `value` is classified as a typed array. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. |
| * @example |
| * |
| * _.isTypedArray(new Uint8Array); |
| * // => true |
| * |
| * _.isTypedArray([]); |
| * // => false |
| */ |
| function isTypedArray(value) { |
| return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; |
| } |
| |
| module.exports = isTypedArray; |
| |
| },{"../internal/isLength":129,"../internal/isObjectLike":130}],152:[function(require,module,exports){ |
| /** |
| * Checks if `value` is `undefined`. |
| * |
| * @static |
| * @memberOf _ |
| * @category Lang |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. |
| * @example |
| * |
| * _.isUndefined(void 0); |
| * // => true |
| * |
| * _.isUndefined(null); |
| * // => false |
| */ |
| function isUndefined(value) { |
| return value === undefined; |
| } |
| |
| module.exports = isUndefined; |
| |
| },{}],153:[function(require,module,exports){ |
| var getNative = require('../internal/getNative'), |
| isArrayLike = require('../internal/isArrayLike'), |
| isObject = require('../lang/isObject'), |
| shimKeys = require('../internal/shimKeys'), |
| support = require('../support'); |
| |
| /* Native method references for those with the same name as other `lodash` methods. */ |
| var nativeKeys = getNative(Object, 'keys'); |
| |
| /** |
| * Creates an array of the own enumerable property names of `object`. |
| * |
| * **Note:** Non-object values are coerced to objects. See the |
| * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) |
| * for more details. |
| * |
| * @static |
| * @memberOf _ |
| * @category Object |
| * @param {Object} object The object to query. |
| * @returns {Array} Returns the array of property names. |
| * @example |
| * |
| * function Foo() { |
| * this.a = 1; |
| * this.b = 2; |
| * } |
| * |
| * Foo.prototype.c = 3; |
| * |
| * _.keys(new Foo); |
| * // => ['a', 'b'] (iteration order is not guaranteed) |
| * |
| * _.keys('hi'); |
| * // => ['0', '1'] |
| */ |
| var keys = !nativeKeys ? shimKeys : function(object) { |
| var Ctor = object == null ? undefined : object.constructor; |
| if ((typeof Ctor == 'function' && Ctor.prototype === object) || |
| (typeof object == 'function' ? support.enumPrototypes : isArrayLike(object))) { |
| return shimKeys(object); |
| } |
| return isObject(object) ? nativeKeys(object) : []; |
| }; |
| |
| module.exports = keys; |
| |
| },{"../internal/getNative":118,"../internal/isArrayLike":123,"../internal/shimKeys":138,"../lang/isObject":148,"../support":157}],154:[function(require,module,exports){ |
| var arrayEach = require('../internal/arrayEach'), |
| isArguments = require('../lang/isArguments'), |
| isArray = require('../lang/isArray'), |
| isFunction = require('../lang/isFunction'), |
| isIndex = require('../internal/isIndex'), |
| isLength = require('../internal/isLength'), |
| isObject = require('../lang/isObject'), |
| isString = require('../lang/isString'), |
| support = require('../support'); |
| |
| /** `Object#toString` result references. */ |
| var arrayTag = '[object Array]', |
| boolTag = '[object Boolean]', |
| dateTag = '[object Date]', |
| errorTag = '[object Error]', |
| funcTag = '[object Function]', |
| numberTag = '[object Number]', |
| objectTag = '[object Object]', |
| regexpTag = '[object RegExp]', |
| stringTag = '[object String]'; |
| |
| /** Used to fix the JScript `[[DontEnum]]` bug. */ |
| var shadowProps = [ |
| 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', |
| 'toLocaleString', 'toString', 'valueOf' |
| ]; |
| |
| /** Used for native method references. */ |
| var errorProto = Error.prototype, |
| objectProto = Object.prototype, |
| stringProto = String.prototype; |
| |
| /** Used to check objects for own properties. */ |
| var hasOwnProperty = objectProto.hasOwnProperty; |
| |
| /** |
| * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) |
| * of values. |
| */ |
| var objToString = objectProto.toString; |
| |
| /** Used to avoid iterating over non-enumerable properties in IE < 9. */ |
| var nonEnumProps = {}; |
| nonEnumProps[arrayTag] = nonEnumProps[dateTag] = nonEnumProps[numberTag] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; |
| nonEnumProps[boolTag] = nonEnumProps[stringTag] = { 'constructor': true, 'toString': true, 'valueOf': true }; |
| nonEnumProps[errorTag] = nonEnumProps[funcTag] = nonEnumProps[regexpTag] = { 'constructor': true, 'toString': true }; |
| nonEnumProps[objectTag] = { 'constructor': true }; |
| |
| arrayEach(shadowProps, function(key) { |
| for (var tag in nonEnumProps) { |
| if (hasOwnProperty.call(nonEnumProps, tag)) { |
| var props = nonEnumProps[tag]; |
| props[key] = hasOwnProperty.call(props, key); |
| } |
| } |
| }); |
| |
| /** |
| * Creates an array of the own and inherited enumerable property names of `object`. |
| * |
| * **Note:** Non-object values are coerced to objects. |
| * |
| * @static |
| * @memberOf _ |
| * @category Object |
| * @param {Object} object The object to query. |
| * @returns {Array} Returns the array of property names. |
| * @example |
| * |
| * function Foo() { |
| * this.a = 1; |
| * this.b = 2; |
| * } |
| * |
| * Foo.prototype.c = 3; |
| * |
| * _.keysIn(new Foo); |
| * // => ['a', 'b', 'c'] (iteration order is not guaranteed) |
| */ |
| function keysIn(object) { |
| if (object == null) { |
| return []; |
| } |
| if (!isObject(object)) { |
| object = Object(object); |
| } |
| var length = object.length; |
| |
| length = (length && isLength(length) && |
| (isArray(object) || isArguments(object) || isString(object)) && length) || 0; |
| |
| var Ctor = object.constructor, |
| index = -1, |
| proto = (isFunction(Ctor) && Ctor.prototype) || objectProto, |
| isProto = proto === object, |
| result = Array(length), |
| skipIndexes = length > 0, |
| skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error), |
| skipProto = support.enumPrototypes && isFunction(object); |
| |
| while (++index < length) { |
| result[index] = (index + ''); |
| } |
| // lodash skips the `constructor` property when it infers it's iterating |
| // over a `prototype` object because IE < 9 can't set the `[[Enumerable]]` |
| // attribute of an existing property and the `constructor` property of a |
| // prototype defaults to non-enumerable. |
| for (var key in object) { |
| if (!(skipProto && key == 'prototype') && |
| !(skipErrorProps && (key == 'message' || key == 'name')) && |
| !(skipIndexes && isIndex(key, length)) && |
| !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { |
| result.push(key); |
| } |
| } |
| if (support.nonEnumShadows && object !== objectProto) { |
| var tag = object === stringProto ? stringTag : (object === errorProto ? errorTag : objToString.call(object)), |
| nonEnums = nonEnumProps[tag] || nonEnumProps[objectTag]; |
| |
| if (tag == objectTag) { |
| proto = objectProto; |
| } |
| length = shadowProps.length; |
| while (length--) { |
| key = shadowProps[length]; |
| var nonEnum = nonEnums[key]; |
| if (!(isProto && nonEnum) && |
| (nonEnum ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) { |
| result.push(key); |
| } |
| } |
| } |
| return result; |
| } |
| |
| module.exports = keysIn; |
| |
| },{"../internal/arrayEach":67,"../internal/isIndex":125,"../internal/isLength":129,"../lang/isArguments":143,"../lang/isArray":144,"../lang/isFunction":146,"../lang/isObject":148,"../lang/isString":150,"../support":157}],155:[function(require,module,exports){ |
| var keys = require('./keys'), |
| toObject = require('../internal/toObject'); |
| |
| /** |
| * Creates a two dimensional array of the key-value pairs for `object`, |
| * e.g. `[[key1, value1], [key2, value2]]`. |
| * |
| * @static |
| * @memberOf _ |
| * @category Object |
| * @param {Object} object The object to query. |
| * @returns {Array} Returns the new array of key-value pairs. |
| * @example |
| * |
| * _.pairs({ 'barney': 36, 'fred': 40 }); |
| * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) |
| */ |
| function pairs(object) { |
| object = toObject(object); |
| |
| var index = -1, |
| props = keys(object), |
| length = props.length, |
| result = Array(length); |
| |
| while (++index < length) { |
| var key = props[index]; |
| result[index] = [key, object[key]]; |
| } |
| return result; |
| } |
| |
| module.exports = pairs; |
| |
| },{"../internal/toObject":139,"./keys":153}],156:[function(require,module,exports){ |
| var baseValues = require('../internal/baseValues'), |
| keys = require('./keys'); |
| |
| /** |
| * Creates an array of the own enumerable property values of `object`. |
| * |
| * **Note:** Non-object values are coerced to objects. |
| * |
| * @static |
| * @memberOf _ |
| * @category Object |
| * @param {Object} object The object to query. |
| * @returns {Array} Returns the array of property values. |
| * @example |
| * |
| * function Foo() { |
| * this.a = 1; |
| * this.b = 2; |
| * } |
| * |
| * Foo.prototype.c = 3; |
| * |
| * _.values(new Foo); |
| * // => [1, 2] (iteration order is not guaranteed) |
| * |
| * _.values('hi'); |
| * // => ['h', 'i'] |
| */ |
| function values(object) { |
| return baseValues(object, keys(object)); |
| } |
| |
| module.exports = values; |
| |
| },{"../internal/baseValues":95,"./keys":153}],157:[function(require,module,exports){ |
| /** Used for native method references. */ |
| var arrayProto = Array.prototype, |
| errorProto = Error.prototype, |
| objectProto = Object.prototype; |
| |
| /** Native method references. */ |
| var propertyIsEnumerable = objectProto.propertyIsEnumerable, |
| splice = arrayProto.splice; |
| |
| /** |
| * An object environment feature flags. |
| * |
| * @static |
| * @memberOf _ |
| * @type Object |
| */ |
| var support = {}; |
| |
| (function(x) { |
| var Ctor = function() { this.x = x; }, |
| object = { '0': x, 'length': x }, |
| props = []; |
| |
| Ctor.prototype = { 'valueOf': x, 'y': x }; |
| for (var key in new Ctor) { props.push(key); } |
| |
| /** |
| * Detect if `name` or `message` properties of `Error.prototype` are |
| * enumerable by default (IE < 9, Safari < 5.1). |
| * |
| * @memberOf _.support |
| * @type boolean |
| */ |
| support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || |
| propertyIsEnumerable.call(errorProto, 'name'); |
| |
| /** |
| * Detect if `prototype` properties are enumerable by default. |
| * |
| * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 |
| * (if the prototype or a property on the prototype has been set) |
| * incorrectly set the `[[Enumerable]]` value of a function's `prototype` |
| * property to `true`. |
| * |
| * @memberOf _.support |
| * @type boolean |
| */ |
| support.enumPrototypes = propertyIsEnumerable.call(Ctor, 'prototype'); |
| |
| /** |
| * Detect if properties shadowing those on `Object.prototype` are non-enumerable. |
| * |
| * In IE < 9 an object's own properties, shadowing non-enumerable ones, |
| * are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug). |
| * |
| * @memberOf _.support |
| * @type boolean |
| */ |
| support.nonEnumShadows = !/valueOf/.test(props); |
| |
| /** |
| * Detect if own properties are iterated after inherited properties (IE < 9). |
| * |
| * @memberOf _.support |
| * @type boolean |
| */ |
| support.ownLast = props[0] != 'x'; |
| |
| /** |
| * Detect if `Array#shift` and `Array#splice` augment array-like objects |
| * correctly. |
| * |
| * Firefox < 10, compatibility modes of IE 8, and IE < 9 have buggy Array |
| * `shift()` and `splice()` functions that fail to remove the last element, |
| * `value[0]`, of array-like objects even though the "length" property is |
| * set to `0`. The `shift()` method is buggy in compatibility modes of IE 8, |
| * while `splice()` is buggy regardless of mode in IE < 9. |
| * |
| * @memberOf _.support |
| * @type boolean |
| */ |
| support.spliceObjects = (splice.call(object, 0, 1), !object[0]); |
| |
| /** |
| * Detect lack of support for accessing string characters by index. |
| * |
| * IE < 8 can't access characters by index. IE 8 can only access characters |
| * by index on string literals, not string objects. |
| * |
| * @memberOf _.support |
| * @type boolean |
| */ |
| support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx'; |
| }(1, 0)); |
| |
| module.exports = support; |
| |
| },{}],158:[function(require,module,exports){ |
| /** |
| * This method returns the first argument provided to it. |
| * |
| * @static |
| * @memberOf _ |
| * @category Utility |
| * @param {*} value Any value. |
| * @returns {*} Returns `value`. |
| * @example |
| * |
| * var object = { 'user': 'fred' }; |
| * |
| * _.identity(object) === object; |
| * // => true |
| */ |
| function identity(value) { |
| return value; |
| } |
| |
| module.exports = identity; |
| |
| },{}],159:[function(require,module,exports){ |
| /** |
| * A no-operation function that returns `undefined` regardless of the |
| * arguments it receives. |
| * |
| * @static |
| * @memberOf _ |
| * @category Utility |
| * @example |
| * |
| * var object = { 'user': 'fred' }; |
| * |
| * _.noop(object) === undefined; |
| * // => true |
| */ |
| function noop() { |
| // No operation performed. |
| } |
| |
| module.exports = noop; |
| |
| },{}],160:[function(require,module,exports){ |
| var baseProperty = require('../internal/baseProperty'), |
| basePropertyDeep = require('../internal/basePropertyDeep'), |
| isKey = require('../internal/isKey'); |
| |
| /** |
| * Creates a function that returns the property value at `path` on a |
| * given object. |
| * |
| * @static |
| * @memberOf _ |
| * @category Utility |
| * @param {Array|string} path The path of the property to get. |
| * @returns {Function} Returns the new function. |
| * @example |
| * |
| * var objects = [ |
| * { 'a': { 'b': { 'c': 2 } } }, |
| * { 'a': { 'b': { 'c': 1 } } } |
| * ]; |
| * |
| * _.map(objects, _.property('a.b.c')); |
| * // => [2, 1] |
| * |
| * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); |
| * // => [1, 2] |
| */ |
| function property(path) { |
| return isKey(path) ? baseProperty(path) : basePropertyDeep(path); |
| } |
| |
| module.exports = property; |
| |
| },{"../internal/baseProperty":90,"../internal/basePropertyDeep":91,"../internal/isKey":127}],161:[function(require,module,exports){ |
| (function (process){ |
| // vim:ts=4:sts=4:sw=4: |
| /*! |
| * |
| * Copyright 2009-2012 Kris Kowal under the terms of the MIT |
| * license found at http://github.com/kriskowal/q/raw/master/LICENSE |
| * |
| * With parts by Tyler Close |
| * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found |
| * at http://www.opensource.org/licenses/mit-license.html |
| * Forked at ref_send.js version: 2009-05-11 |
| * |
| * With parts by Mark Miller |
| * Copyright (C) 2011 Google Inc. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| * |
| */ |
| |
| (function (definition) { |
| "use strict"; |
| |
| // This file will function properly as a <script> tag, or a module |
| // using CommonJS and NodeJS or RequireJS module formats. In |
| // Common/Node/RequireJS, the module exports the Q API and when |
| // executed as a simple <script>, it creates a Q global instead. |
| |
| // Montage Require |
| if (typeof bootstrap === "function") { |
| bootstrap("promise", definition); |
| |
| // CommonJS |
| } else if (typeof exports === "object" && typeof module === "object") { |
| module.exports = definition(); |
| |
| // RequireJS |
| } else if (typeof define === "function" && define.amd) { |
| define(definition); |
| |
| // SES (Secure EcmaScript) |
| } else if (typeof ses !== "undefined") { |
| if (!ses.ok()) { |
| return; |
| } else { |
| ses.makeQ = definition; |
| } |
| |
| // <script> |
| } else if (typeof window !== "undefined" || typeof self !== "undefined") { |
| // Prefer window over self for add-on scripts. Use self for |
| // non-windowed contexts. |
| var global = typeof window !== "undefined" ? window : self; |
| |
| // Get the `window` object, save the previous Q global |
| // and initialize Q as a global. |
| var previousQ = global.Q; |
| global.Q = definition(); |
| |
| // Add a noConflict function so Q can be removed from the |
| // global namespace. |
| global.Q.noConflict = function () { |
| global.Q = previousQ; |
| return this; |
| }; |
| |
| } else { |
| throw new Error("This environment was not anticipated by Q. Please file a bug."); |
| } |
| |
| })(function () { |
| "use strict"; |
| |
| var hasStacks = false; |
| try { |
| throw new Error(); |
| } catch (e) { |
| hasStacks = !!e.stack; |
| } |
| |
| // All code after this point will be filtered from stack traces reported |
| // by Q. |
| var qStartingLine = captureLine(); |
| var qFileName; |
| |
| // shims |
| |
| // used for fallback in "allResolved" |
| var noop = function () {}; |
| |
| // Use the fastest possible means to execute a task in a future turn |
| // of the event loop. |
| var nextTick =(function () { |
| // linked list of tasks (single, with head node) |
| var head = {task: void 0, next: null}; |
| var tail = head; |
| var flushing = false; |
| var requestTick = void 0; |
| var isNodeJS = false; |
| // queue for late tasks, used by unhandled rejection tracking |
| var laterQueue = []; |
| |
| function flush() { |
| /* jshint loopfunc: true */ |
| var task, domain; |
| |
| while (head.next) { |
| head = head.next; |
| task = head.task; |
| head.task = void 0; |
| domain = head.domain; |
| |
| if (domain) { |
| head.domain = void 0; |
| domain.enter(); |
| } |
| runSingle(task, domain); |
| |
| } |
| while (laterQueue.length) { |
| task = laterQueue.pop(); |
| runSingle(task); |
| } |
| flushing = false; |
| } |
| // runs a single function in the async queue |
| function runSingle(task, domain) { |
| try { |
| task(); |
| |
| } catch (e) { |
| if (isNodeJS) { |
| // In node, uncaught exceptions are considered fatal errors. |
| // Re-throw them synchronously to interrupt flushing! |
| |
| // Ensure continuation if the uncaught exception is suppressed |
| // listening "uncaughtException" events (as domains does). |
| // Continue in next event to avoid tick recursion. |
| if (domain) { |
| domain.exit(); |
| } |
| setTimeout(flush, 0); |
| if (domain) { |
| domain.enter(); |
| } |
| |
| throw e; |
| |
| } else { |
| // In browsers, uncaught exceptions are not fatal. |
| // Re-throw them asynchronously to avoid slow-downs. |
| setTimeout(function () { |
| throw e; |
| }, 0); |
| } |
| } |
| |
| if (domain) { |
| domain.exit(); |
| } |
| } |
| |
| nextTick = function (task) { |
| tail = tail.next = { |
| task: task, |
| domain: isNodeJS && process.domain, |
| next: null |
| }; |
| |
| if (!flushing) { |
| flushing = true; |
| requestTick(); |
| } |
| }; |
| |
| if (typeof process === "object" && |
| process.toString() === "[object process]" && process.nextTick) { |
| // Ensure Q is in a real Node environment, with a `process.nextTick`. |
| // To see through fake Node environments: |
| // * Mocha test runner - exposes a `process` global without a `nextTick` |
| // * Browserify - exposes a `process.nexTick` function that uses |
| // `setTimeout`. In this case `setImmediate` is preferred because |
| // it is faster. Browserify's `process.toString()` yields |
| // "[object Object]", while in a real Node environment |
| // `process.nextTick()` yields "[object process]". |
| isNodeJS = true; |
| |
| requestTick = function () { |
| process.nextTick(flush); |
| }; |
| |
| } else if (typeof setImmediate === "function") { |
| // In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate |
| if (typeof window !== "undefined") { |
| requestTick = setImmediate.bind(window, flush); |
| } else { |
| requestTick = function () { |
| setImmediate(flush); |
| }; |
| } |
| |
| } else if (typeof MessageChannel !== "undefined") { |
| // modern browsers |
| // http://www.nonblocking.io/2011/06/windownexttick.html |
| var channel = new MessageChannel(); |
| // At least Safari Version 6.0.5 (8536.30.1) intermittently cannot create |
| // working message ports the first time a page loads. |
| channel.port1.onmessage = function () { |
| requestTick = requestPortTick; |
| channel.port1.onmessage = flush; |
| flush(); |
| }; |
| var requestPortTick = function () { |
| // Opera requires us to provide a message payload, regardless of |
| // whether we use it. |
| channel.port2.postMessage(0); |
| }; |
| requestTick = function () { |
| setTimeout(flush, 0); |
| requestPortTick(); |
| }; |
| |
| } else { |
| // old browsers |
| requestTick = function () { |
| setTimeout(flush, 0); |
| }; |
| } |
| // runs a task after all other tasks have been run |
| // this is useful for unhandled rejection tracking that needs to happen |
| // after all `then`d tasks have been run. |
| nextTick.runAfter = function (task) { |
| laterQueue.push(task); |
| if (!flushing) { |
| flushing = true; |
| requestTick(); |
| } |
| }; |
| return nextTick; |
| })(); |
| |
| // Attempt to make generics safe in the face of downstream |
| // modifications. |
| // There is no situation where this is necessary. |
| // If you need a security guarantee, these primordials need to be |
| // deeply frozen anyway, and if you don’t need a security guarantee, |
| // this is just plain paranoid. |
| // However, this **might** have the nice side-effect of reducing the size of |
| // the minified code by reducing x.call() to merely x() |
| // See Mark Miller’s explanation of what this does. |
| // http://wiki.ecmascript.org/doku.php?id=conventions:safe_meta_programming |
| var call = Function.call; |
| function uncurryThis(f) { |
| return function () { |
| return call.apply(f, arguments); |
| }; |
| } |
| // This is equivalent, but slower: |
| // uncurryThis = Function_bind.bind(Function_bind.call); |
| // http://jsperf.com/uncurrythis |
| |
| var array_slice = uncurryThis(Array.prototype.slice); |
| |
| var array_reduce = uncurryThis( |
| Array.prototype.reduce || function (callback, basis) { |
| var index = 0, |
| length = this.length; |
| // concerning the initial value, if one is not provided |
| if (arguments.length === 1) { |
| // seek to the first value in the array, accounting |
| // for the possibility that is is a sparse array |
| do { |
| if (index in this) { |
| basis = this[index++]; |
| break; |
| } |
| if (++index >= length) { |
| throw new TypeError(); |
| } |
| } while (1); |
| } |
| // reduce |
| for (; index < length; index++) { |
| // account for the possibility that the array is sparse |
| if (index in this) { |
| basis = callback(basis, this[index], index); |
| } |
| } |
| return basis; |
| } |
| ); |
| |
| var array_indexOf = uncurryThis( |
| Array.prototype.indexOf || function (value) { |
| // not a very good shim, but good enough for our one use of it |
| for (var i = 0; i < this.length; i++) { |
| if (this[i] === value) { |
| return i; |
| } |
| } |
| return -1; |
| } |
| ); |
| |
| var array_map = uncurryThis( |
| Array.prototype.map || function (callback, thisp) { |
| var self = this; |
| var collect = []; |
| array_reduce(self, function (undefined, value, index) { |
| collect.push(callback.call(thisp, value, index, self)); |
| }, void 0); |
| return collect; |
| } |
| ); |
| |
| var object_create = Object.create || function (prototype) { |
| function Type() { } |
| Type.prototype = prototype; |
| return new Type(); |
| }; |
| |
| var object_hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty); |
| |
| var object_keys = Object.keys || function (object) { |
| var keys = []; |
| for (var key in object) { |
| if (object_hasOwnProperty(object, key)) { |
| keys.push(key); |
| } |
| } |
| return keys; |
| }; |
| |
| var object_toString = uncurryThis(Object.prototype.toString); |
| |
| function isObject(value) { |
| return value === Object(value); |
| } |
| |
| // generator related shims |
| |
| // FIXME: Remove this function once ES6 generators are in SpiderMonkey. |
| function isStopIteration(exception) { |
| return ( |
| object_toString(exception) === "[object StopIteration]" || |
| exception instanceof QReturnValue |
| ); |
| } |
| |
| // FIXME: Remove this helper and Q.return once ES6 generators are in |
| // SpiderMonkey. |
| var QReturnValue; |
| if (typeof ReturnValue !== "undefined") { |
| QReturnValue = ReturnValue; |
| } else { |
| QReturnValue = function (value) { |
| this.value = value; |
| }; |
| } |
| |
| // long stack traces |
| |
| var STACK_JUMP_SEPARATOR = "From previous event:"; |
| |
| function makeStackTraceLong(error, promise) { |
| // If possible, transform the error stack trace by removing Node and Q |
| // cruft, then concatenating with the stack trace of `promise`. See #57. |
| if (hasStacks && |
| promise.stack && |
| typeof error === "object" && |
| error !== null && |
| error.stack && |
| error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1 |
| ) { |
| var stacks = []; |
| for (var p = promise; !!p; p = p.source) { |
| if (p.stack) { |
| stacks.unshift(p.stack); |
| } |
| } |
| stacks.unshift(error.stack); |
| |
| var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n"); |
| error.stack = filterStackString(concatedStacks); |
| } |
| } |
| |
| function filterStackString(stackString) { |
| var lines = stackString.split("\n"); |
| var desiredLines = []; |
| for (var i = 0; i < lines.length; ++i) { |
| var line = lines[i]; |
| |
| if (!isInternalFrame(line) && !isNodeFrame(line) && line) { |
| desiredLines.push(line); |
| } |
| } |
| return desiredLines.join("\n"); |
| } |
| |
| function isNodeFrame(stackLine) { |
| return stackLine.indexOf("(module.js:") !== -1 || |
| stackLine.indexOf("(node.js:") !== -1; |
| } |
| |
| function getFileNameAndLineNumber(stackLine) { |
| // Named functions: "at functionName (filename:lineNumber:columnNumber)" |
| // In IE10 function name can have spaces ("Anonymous function") O_o |
| var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine); |
| if (attempt1) { |
| return [attempt1[1], Number(attempt1[2])]; |
| } |
| |
| // Anonymous functions: "at filename:lineNumber:columnNumber" |
| var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine); |
| if (attempt2) { |
| return [attempt2[1], Number(attempt2[2])]; |
| } |
| |
| // Firefox style: "function@filename:lineNumber or @filename:lineNumber" |
| var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine); |
| if (attempt3) { |
| return [attempt3[1], Number(attempt3[2])]; |
| } |
| } |
| |
| function isInternalFrame(stackLine) { |
| var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine); |
| |
| if (!fileNameAndLineNumber) { |
| return false; |
| } |
| |
| var fileName = fileNameAndLineNumber[0]; |
| var lineNumber = fileNameAndLineNumber[1]; |
| |
| return fileName === qFileName && |
| lineNumber >= qStartingLine && |
| lineNumber <= qEndingLine; |
| } |
| |
| // discover own file name and line number range for filtering stack |
| // traces |
| function captureLine() { |
| if (!hasStacks) { |
| return; |
| } |
| |
| try { |
| throw new Error(); |
| } catch (e) { |
| var lines = e.stack.split("\n"); |
| var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2]; |
| var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine); |
| if (!fileNameAndLineNumber) { |
| return; |
| } |
| |
| qFileName = fileNameAndLineNumber[0]; |
| return fileNameAndLineNumber[1]; |
| } |
| } |
| |
| function deprecate(callback, name, alternative) { |
| return function () { |
| if (typeof console !== "undefined" && |
| typeof console.warn === "function") { |
| console.warn(name + " is deprecated, use " + alternative + |
| " instead.", new Error("").stack); |
| } |
| return callback.apply(callback, arguments); |
| }; |
| } |
| |
| // end of shims |
| // beginning of real work |
| |
| /** |
| * Constructs a promise for an immediate reference, passes promises through, or |
| * coerces promises from different systems. |
| * @param value immediate reference or promise |
| */ |
| function Q(value) { |
| // If the object is already a Promise, return it directly. This enables |
| // the resolve function to both be used to created references from objects, |
| // but to tolerably coerce non-promises to promises. |
| if (value instanceof Promise) { |
| return value; |
| } |
| |
| // assimilate thenables |
| if (isPromiseAlike(value)) { |
| return coerce(value); |
| } else { |
| return fulfill(value); |
| } |
| } |
| Q.resolve = Q; |
| |
| /** |
| * Performs a task in a future turn of the event loop. |
| * @param {Function} task |
| */ |
| Q.nextTick = nextTick; |
| |
| /** |
| * Controls whether or not long stack traces will be on |
| */ |
| Q.longStackSupport = false; |
| |
| // enable long stacks if Q_DEBUG is set |
| if (typeof process === "object" && process && process.env && process.env.Q_DEBUG) { |
| Q.longStackSupport = true; |
| } |
| |
| /** |
| * Constructs a {promise, resolve, reject} object. |
| * |
| * `resolve` is a callback to invoke with a more resolved value for the |
| * promise. To fulfill the promise, invoke `resolve` with any value that is |
| * not a thenable. To reject the promise, invoke `resolve` with a rejected |
| * thenable, or invoke `reject` with the reason directly. To resolve the |
| * promise to another thenable, thus putting it in the same state, invoke |
| * `resolve` with that other thenable. |
| */ |
| Q.defer = defer; |
| function defer() { |
| // if "messages" is an "Array", that indicates that the promise has not yet |
| // been resolved. If it is "undefined", it has been resolved. Each |
| // element of the messages array is itself an array of complete arguments to |
| // forward to the resolved promise. We coerce the resolution value to a |
| // promise using the `resolve` function because it handles both fully |
| // non-thenable values and other thenables gracefully. |
| var messages = [], progressListeners = [], resolvedPromise; |
| |
| var deferred = object_create(defer.prototype); |
| var promise = object_create(Promise.prototype); |
| |
| promise.promiseDispatch = function (resolve, op, operands) { |
| var args = array_slice(arguments); |
| if (messages) { |
| messages.push(args); |
| if (op === "when" && operands[1]) { // progress operand |
| progressListeners.push(operands[1]); |
| } |
| } else { |
| Q.nextTick(function () { |
| resolvedPromise.promiseDispatch.apply(resolvedPromise, args); |
| }); |
| } |
| }; |
| |
| // XXX deprecated |
| promise.valueOf = function () { |
| if (messages) { |
| return promise; |
| } |
| var nearerValue = nearer(resolvedPromise); |
| if (isPromise(nearerValue)) { |
| resolvedPromise = nearerValue; // shorten chain |
| } |
| return nearerValue; |
| }; |
| |
| promise.inspect = function () { |
| if (!resolvedPromise) { |
| return { state: "pending" }; |
| } |
| return resolvedPromise.inspect(); |
| }; |
| |
| if (Q.longStackSupport && hasStacks) { |
| try { |
| throw new Error(); |
| } catch (e) { |
| // NOTE: don't try to use `Error.captureStackTrace` or transfer the |
| // accessor around; that causes memory leaks as per GH-111. Just |
| // reify the stack trace as a string ASAP. |
| // |
| // At the same time, cut off the first line; it's always just |
| // "[object Promise]\n", as per the `toString`. |
| promise.stack = e.stack.substring(e.stack.indexOf("\n") + 1); |
| } |
| } |
| |
| // NOTE: we do the checks for `resolvedPromise` in each method, instead of |
| // consolidating them into `become`, since otherwise we'd create new |
| // promises with the lines `become(whatever(value))`. See e.g. GH-252. |
| |
| function become(newPromise) { |
| resolvedPromise = newPromise; |
| promise.source = newPromise; |
| |
| array_reduce(messages, function (undefined, message) { |
| Q.nextTick(function () { |
| newPromise.promiseDispatch.apply(newPromise, message); |
| }); |
| }, void 0); |
| |
| messages = void 0; |
| progressListeners = void 0; |
| } |
| |
| deferred.promise = promise; |
| deferred.resolve = function (value) { |
| if (resolvedPromise) { |
| return; |
| } |
| |
| become(Q(value)); |
| }; |
| |
| deferred.fulfill = function (value) { |
| if (resolvedPromise) { |
| return; |
| } |
| |
| become(fulfill(value)); |
| }; |
| deferred.reject = function (reason) { |
| if (resolvedPromise) { |
| return; |
| } |
| |
| become(reject(reason)); |
| }; |
| deferred.notify = function (progress) { |
| if (resolvedPromise) { |
| return; |
| } |
| |
| array_reduce(progressListeners, function (undefined, progressListener) { |
| Q.nextTick(function () { |
| progressListener(progress); |
| }); |
| }, void 0); |
| }; |
| |
| return deferred; |
| } |
| |
| /** |
| * Creates a Node-style callback that will resolve or reject the deferred |
| * promise. |
| * @returns a nodeback |
| */ |
| defer.prototype.makeNodeResolver = function () { |
| var self = this; |
| return function (error, value) { |
| if (error) { |
| self.reject(error); |
| } else if (arguments.length > 2) { |
| self.resolve(array_slice(arguments, 1)); |
| } else { |
| self.resolve(value); |
| } |
| }; |
| }; |
| |
| /** |
| * @param resolver {Function} a function that returns nothing and accepts |
| * the resolve, reject, and notify functions for a deferred. |
| * @returns a promise that may be resolved with the given resolve and reject |
| * functions, or rejected by a thrown exception in resolver |
| */ |
| Q.Promise = promise; // ES6 |
| Q.promise = promise; |
| function promise(resolver) { |
| if (typeof resolver !== "function") { |
| throw new TypeError("resolver must be a function."); |
| } |
| var deferred = defer(); |
| try { |
| resolver(deferred.resolve, deferred.reject, deferred.notify); |
| } catch (reason) { |
| deferred.reject(reason); |
| } |
| return deferred.promise; |
| } |
| |
| promise.race = race; // ES6 |
| promise.all = all; // ES6 |
| promise.reject = reject; // ES6 |
| promise.resolve = Q; // ES6 |
| |
| // XXX experimental. This method is a way to denote that a local value is |
| // serializable and should be immediately dispatched to a remote upon request, |
| // instead of passing a reference. |
| Q.passByCopy = function (object) { |
| //freeze(object); |
| //passByCopies.set(object, true); |
| return object; |
| }; |
| |
| Promise.prototype.passByCopy = function () { |
| //freeze(object); |
| //passByCopies.set(object, true); |
| return this; |
| }; |
| |
| /** |
| * If two promises eventually fulfill to the same value, promises that value, |
| * but otherwise rejects. |
| * @param x {Any*} |
| * @param y {Any*} |
| * @returns {Any*} a promise for x and y if they are the same, but a rejection |
| * otherwise. |
| * |
| */ |
| Q.join = function (x, y) { |
| return Q(x).join(y); |
| }; |
| |
| Promise.prototype.join = function (that) { |
| return Q([this, that]).spread(function (x, y) { |
| if (x === y) { |
| // TODO: "===" should be Object.is or equiv |
| return x; |
| } else { |
| throw new Error("Can't join: not the same: " + x + " " + y); |
| } |
| }); |
| }; |
| |
| /** |
| * Returns a promise for the first of an array of promises to become settled. |
| * @param answers {Array[Any*]} promises to race |
| * @returns {Any*} the first promise to be settled |
| */ |
| Q.race = race; |
| function race(answerPs) { |
| return promise(function (resolve, reject) { |
| // Switch to this once we can assume at least ES5 |
| // answerPs.forEach(function (answerP) { |
| // Q(answerP).then(resolve, reject); |
| // }); |
| // Use this in the meantime |
| for (var i = 0, len = answerPs.length; i < len; i++) { |
| Q(answerPs[i]).then(resolve, reject); |
| } |
| }); |
| } |
| |
| Promise.prototype.race = function () { |
| return this.then(Q.race); |
| }; |
| |
| /** |
| * Constructs a Promise with a promise descriptor object and optional fallback |
| * function. The descriptor contains methods like when(rejected), get(name), |
| * set(name, value), post(name, args), and delete(name), which all |
| * return either a value, a promise for a value, or a rejection. The fallback |
| * accepts the operation name, a resolver, and any further arguments that would |
| * have been forwarded to the appropriate method above had a method been |
| * provided with the proper name. The API makes no guarantees about the nature |
| * of the returned object, apart from that it is usable whereever promises are |
| * bought and sold. |
| */ |
| Q.makePromise = Promise; |
| function Promise(descriptor, fallback, inspect) { |
| if (fallback === void 0) { |
| fallback = function (op) { |
| return reject(new Error( |
| "Promise does not support operation: " + op |
| )); |
| }; |
| } |
| if (inspect === void 0) { |
| inspect = function () { |
| return {state: "unknown"}; |
| }; |
| } |
| |
| var promise = object_create(Promise.prototype); |
| |
| promise.promiseDispatch = function (resolve, op, args) { |
| var result; |
| try { |
| if (descriptor[op]) { |
| result = descriptor[op].apply(promise, args); |
| } else { |
| result = fallback.call(promise, op, args); |
| } |
| } catch (exception) { |
| result = reject(exception); |
| } |
| if (resolve) { |
| resolve(result); |
| } |
| }; |
| |
| promise.inspect = inspect; |
| |
| // XXX deprecated `valueOf` and `exception` support |
| if (inspect) { |
| var inspected = inspect(); |
| if (inspected.state === "rejected") { |
| promise.exception = inspected.reason; |
| } |
| |
| promise.valueOf = function () { |
| var inspected = inspect(); |
| if (inspected.state === "pending" || |
| inspected.state === "rejected") { |
| return promise; |
| } |
| return inspected.value; |
| }; |
| } |
| |
| return promise; |
| } |
| |
| Promise.prototype.toString = function () { |
| return "[object Promise]"; |
| }; |
| |
| Promise.prototype.then = function (fulfilled, rejected, progressed) { |
| var self = this; |
| var deferred = defer(); |
| var done = false; // ensure the untrusted promise makes at most a |
| // single call to one of the callbacks |
| |
| function _fulfilled(value) { |
| try { |
| return typeof fulfilled === "function" ? fulfilled(value) : value; |
| } catch (exception) { |
| return reject(exception); |
| } |
| } |
| |
| function _rejected(exception) { |
| if (typeof rejected === "function") { |
| makeStackTraceLong(exception, self); |
| try { |
| return rejected(exception); |
| } catch (newException) { |
| return reject(newException); |
| } |
| } |
| return reject(exception); |
| } |
| |
| function _progressed(value) { |
| return typeof progressed === "function" ? progressed(value) : value; |
| } |
| |
| Q.nextTick(function () { |
| self.promiseDispatch(function (value) { |
| if (done) { |
| return; |
| } |
| done = true; |
| |
| deferred.resolve(_fulfilled(value)); |
| }, "when", [function (exception) { |
| if (done) { |
| return; |
| } |
| done = true; |
| |
| deferred.resolve(_rejected(exception)); |
| }]); |
| }); |
| |
| // Progress propagator need to be attached in the current tick. |
| self.promiseDispatch(void 0, "when", [void 0, function (value) { |
| var newValue; |
| var threw = false; |
| try { |
| newValue = _progressed(value); |
| } catch (e) { |
| threw = true; |
| if (Q.onerror) { |
| Q.onerror(e); |
| } else { |
| throw e; |
| } |
| } |
| |
| if (!threw) { |
| deferred.notify(newValue); |
| } |
| }]); |
| |
| return deferred.promise; |
| }; |
| |
| Q.tap = function (promise, callback) { |
| return Q(promise).tap(callback); |
| }; |
| |
| /** |
| * Works almost like "finally", but not called for rejections. |
| * Original resolution value is passed through callback unaffected. |
| * Callback may return a promise that will be awaited for. |
| * @param {Function} callback |
| * @returns {Q.Promise} |
| * @example |
| * doSomething() |
| * .then(...) |
| * .tap(console.log) |
| * .then(...); |
| */ |
| Promise.prototype.tap = function (callback) { |
| callback = Q(callback); |
| |
| return this.then(function (value) { |
| return callback.fcall(value).thenResolve(value); |
| }); |
| }; |
| |
| /** |
| * Registers an observer on a promise. |
| * |
| * Guarantees: |
| * |
| * 1. that fulfilled and rejected will be called only once. |
| * 2. that either the fulfilled callback or the rejected callback will be |
| * called, but not both. |
| * 3. that fulfilled and rejected will not be called in this turn. |
| * |
| * @param value promise or immediate reference to observe |
| * @param fulfilled function to be called with the fulfilled value |
| * @param rejected function to be called with the rejection exception |
| * @param progressed function to be called on any progress notifications |
| * @return promise for the return value from the invoked callback |
| */ |
| Q.when = when; |
| function when(value, fulfilled, rejected, progressed) { |
| return Q(value).then(fulfilled, rejected, progressed); |
| } |
| |
| Promise.prototype.thenResolve = function (value) { |
| return this.then(function () { return value; }); |
| }; |
| |
| Q.thenResolve = function (promise, value) { |
| return Q(promise).thenResolve(value); |
| }; |
| |
| Promise.prototype.thenReject = function (reason) { |
| return this.then(function () { throw reason; }); |
| }; |
| |
| Q.thenReject = function (promise, reason) { |
| return Q(promise).thenReject(reason); |
| }; |
| |
| /** |
| * If an object is not a promise, it is as "near" as possible. |
| * If a promise is rejected, it is as "near" as possible too. |
| * If it’s a fulfilled promise, the fulfillment value is nearer. |
| * If it’s a deferred promise and the deferred has been resolved, the |
| * resolution is "nearer". |
| * @param object |
| * @returns most resolved (nearest) form of the object |
| */ |
| |
| // XXX should we re-do this? |
| Q.nearer = nearer; |
| function nearer(value) { |
| if (isPromise(value)) { |
| var inspected = value.inspect(); |
| if (inspected.state === "fulfilled") { |
| return inspected.value; |
| } |
| } |
| return value; |
| } |
| |
| /** |
| * @returns whether the given object is a promise. |
| * Otherwise it is a fulfilled value. |
| */ |
| Q.isPromise = isPromise; |
| function isPromise(object) { |
| return object instanceof Promise; |
| } |
| |
| Q.isPromiseAlike = isPromiseAlike; |
| function isPromiseAlike(object) { |
| return isObject(object) && typeof object.then === "function"; |
| } |
| |
| /** |
| * @returns whether the given object is a pending promise, meaning not |
| * fulfilled or rejected. |
| */ |
| Q.isPending = isPending; |
| function isPending(object) { |
| return isPromise(object) && object.inspect().state === "pending"; |
| } |
| |
| Promise.prototype.isPending = function () { |
| return this.inspect().state === "pending"; |
| }; |
| |
| /** |
| * @returns whether the given object is a value or fulfilled |
| * promise. |
| */ |
| Q.isFulfilled = isFulfilled; |
| function isFulfilled(object) { |
| return !isPromise(object) || object.inspect().state === "fulfilled"; |
| } |
| |
| Promise.prototype.isFulfilled = function () { |
| return this.inspect().state === "fulfilled"; |
| }; |
| |
| /** |
| * @returns whether the given object is a rejected promise. |
| */ |
| Q.isRejected = isRejected; |
| function isRejected(object) { |
| return isPromise(object) && object.inspect().state === "rejected"; |
| } |
| |
| Promise.prototype.isRejected = function () { |
| return this.inspect().state === "rejected"; |
| }; |
| |
| //// BEGIN UNHANDLED REJECTION TRACKING |
| |
| // This promise library consumes exceptions thrown in handlers so they can be |
| // handled by a subsequent promise. The exceptions get added to this array when |
| // they are created, and removed when they are handled. Note that in ES6 or |
| // shimmed environments, this would naturally be a `Set`. |
| var unhandledReasons = []; |
| var unhandledRejections = []; |
| var reportedUnhandledRejections = []; |
| var trackUnhandledRejections = true; |
| |
| function resetUnhandledRejections() { |
| unhandledReasons.length = 0; |
| unhandledRejections.length = 0; |
| |
| if (!trackUnhandledRejections) { |
| trackUnhandledRejections = true; |
| } |
| } |
| |
| function trackRejection(promise, reason) { |
| if (!trackUnhandledRejections) { |
| return; |
| } |
| if (typeof process === "object" && typeof process.emit === "function") { |
| Q.nextTick.runAfter(function () { |
| if (array_indexOf(unhandledRejections, promise) !== -1) { |
| process.emit("unhandledRejection", reason, promise); |
| reportedUnhandledRejections.push(promise); |
| } |
| }); |
| } |
| |
| unhandledRejections.push(promise); |
| if (reason && typeof reason.stack !== "undefined") { |
| unhandledReasons.push(reason.stack); |
| } else { |
| unhandledReasons.push("(no stack) " + reason); |
| } |
| } |
| |
| function untrackRejection(promise) { |
| if (!trackUnhandledRejections) { |
| return; |
| } |
| |
| var at = array_indexOf(unhandledRejections, promise); |
| if (at !== -1) { |
| if (typeof process === "object" && typeof process.emit === "function") { |
| Q.nextTick.runAfter(function () { |
| var atReport = array_indexOf(reportedUnhandledRejections, promise); |
| if (atReport !== -1) { |
| process.emit("rejectionHandled", unhandledReasons[at], promise); |
| reportedUnhandledRejections.splice(atReport, 1); |
| } |
| }); |
| } |
| unhandledRejections.splice(at, 1); |
| unhandledReasons.splice(at, 1); |
| } |
| } |
| |
| Q.resetUnhandledRejections = resetUnhandledRejections; |
| |
| Q.getUnhandledReasons = function () { |
| // Make a copy so that consumers can't interfere with our internal state. |
| return unhandledReasons.slice(); |
| }; |
| |
| Q.stopUnhandledRejectionTracking = function () { |
| resetUnhandledRejections(); |
| trackUnhandledRejections = false; |
| }; |
| |
| resetUnhandledRejections(); |
| |
| //// END UNHANDLED REJECTION TRACKING |
| |
| /** |
| * Constructs a rejected promise. |
| * @param reason value describing the failure |
| */ |
| Q.reject = reject; |
| function reject(reason) { |
| var rejection = Promise({ |
| "when": function (rejected) { |
| // note that the error has been handled |
| if (rejected) { |
| untrackRejection(this); |
| } |
| return rejected ? rejected(reason) : this; |
| } |
| }, function fallback() { |
| return this; |
| }, function inspect() { |
| return { state: "rejected", reason: reason }; |
| }); |
| |
| // Note that the reason has not been handled. |
| trackRejection(rejection, reason); |
| |
| return rejection; |
| } |
| |
| /** |
| * Constructs a fulfilled promise for an immediate reference. |
| * @param value immediate reference |
| */ |
| Q.fulfill = fulfill; |
| function fulfill(value) { |
| return Promise({ |
| "when": function () { |
| return value; |
| }, |
| "get": function (name) { |
| return value[name]; |
| }, |
| "set": function (name, rhs) { |
| value[name] = rhs; |
| }, |
| "delete": function (name) { |
| delete value[name]; |
| }, |
| "post": function (name, args) { |
| // Mark Miller proposes that post with no name should apply a |
| // promised function. |
| if (name === null || name === void 0) { |
| return value.apply(void 0, args); |
| } else { |
| return value[name].apply(value, args); |
| } |
| }, |
| "apply": function (thisp, args) { |
| return value.apply(thisp, args); |
| }, |
| "keys": function () { |
| return object_keys(value); |
| } |
| }, void 0, function inspect() { |
| return { state: "fulfilled", value: value }; |
| }); |
| } |
| |
| /** |
| * Converts thenables to Q promises. |
| * @param promise thenable promise |
| * @returns a Q promise |
| */ |
| function coerce(promise) { |
| var deferred = defer(); |
| Q.nextTick(function () { |
| try { |
| promise.then(deferred.resolve, deferred.reject, deferred.notify); |
| } catch (exception) { |
| deferred.reject(exception); |
| } |
| }); |
| return deferred.promise; |
| } |
| |
| /** |
| * Annotates an object such that it will never be |
| * transferred away from this process over any promise |
| * communication channel. |
| * @param object |
| * @returns promise a wrapping of that object that |
| * additionally responds to the "isDef" message |
| * without a rejection. |
| */ |
| Q.master = master; |
| function master(object) { |
| return Promise({ |
| "isDef": function () {} |
| }, function fallback(op, args) { |
| return dispatch(object, op, args); |
| }, function () { |
| return Q(object).inspect(); |
| }); |
| } |
| |
| /** |
| * Spreads the values of a promised array of arguments into the |
| * fulfillment callback. |
| * @param fulfilled callback that receives variadic arguments from the |
| * promised array |
| * @param rejected callback that receives the exception if the promise |
| * is rejected. |
| * @returns a promise for the return value or thrown exception of |
| * either callback. |
| */ |
| Q.spread = spread; |
| function spread(value, fulfilled, rejected) { |
| return Q(value).spread(fulfilled, rejected); |
| } |
| |
| Promise.prototype.spread = function (fulfilled, rejected) { |
| return this.all().then(function (array) { |
| return fulfilled.apply(void 0, array); |
| }, rejected); |
| }; |
| |
| /** |
| * The async function is a decorator for generator functions, turning |
| * them into asynchronous generators. Although generators are only part |
| * of the newest ECMAScript 6 drafts, this code does not cause syntax |
| * errors in older engines. This code should continue to work and will |
| * in fact improve over time as the language improves. |
| * |
| * ES6 generators are currently part of V8 version 3.19 with the |
| * --harmony-generators runtime flag enabled. SpiderMonkey has had them |
| * for longer, but under an older Python-inspired form. This function |
| * works on both kinds of generators. |
| * |
| * Decorates a generator function such that: |
| * - it may yield promises |
| * - execution will continue when that promise is fulfilled |
| * - the value of the yield expression will be the fulfilled value |
| * - it returns a promise for the return value (when the generator |
| * stops iterating) |
| * - the decorated function returns a promise for the return value |
| * of the generator or the first rejected promise among those |
| * yielded. |
| * - if an error is thrown in the generator, it propagates through |
| * every following yield until it is caught, or until it escapes |
| * the generator function altogether, and is translated into a |
| * rejection for the promise returned by the decorated generator. |
| */ |
| Q.async = async; |
| function async(makeGenerator) { |
| return function () { |
| // when verb is "send", arg is a value |
| // when verb is "throw", arg is an exception |
| function continuer(verb, arg) { |
| var result; |
| |
| // Until V8 3.19 / Chromium 29 is released, SpiderMonkey is the only |
| // engine that has a deployed base of browsers that support generators. |
| // However, SM's generators use the Python-inspired semantics of |
| // outdated ES6 drafts. We would like to support ES6, but we'd also |
| // like to make it possible to use generators in deployed browsers, so |
| // we also support Python-style generators. At some point we can remove |
| // this block. |
| |
| if (typeof StopIteration === "undefined") { |
| // ES6 Generators |
| try { |
| result = generator[verb](arg); |
| } catch (exception) { |
| return reject(exception); |
| } |
| if (result.done) { |
| return Q(result.value); |
| } else { |
| return when(result.value, callback, errback); |
| } |
| } else { |
| // SpiderMonkey Generators |
| // FIXME: Remove this case when SM does ES6 generators. |
| try { |
| result = generator[verb](arg); |
| } catch (exception) { |
| if (isStopIteration(exception)) { |
| return Q(exception.value); |
| } else { |
| return reject(exception); |
| } |
| } |
| return when(result, callback, errback); |
| } |
| } |
| var generator = makeGenerator.apply(this, arguments); |
| var callback = continuer.bind(continuer, "next"); |
| var errback = continuer.bind(continuer, "throw"); |
| return callback(); |
| }; |
| } |
| |
| /** |
| * The spawn function is a small wrapper around async that immediately |
| * calls the generator and also ends the promise chain, so that any |
| * unhandled errors are thrown instead of forwarded to the error |
| * handler. This is useful because it's extremely common to run |
| * generators at the top-level to work with libraries. |
| */ |
| Q.spawn = spawn; |
| function spawn(makeGenerator) { |
| Q.done(Q.async(makeGenerator)()); |
| } |
| |
| // FIXME: Remove this interface once ES6 generators are in SpiderMonkey. |
| /** |
| * Throws a ReturnValue exception to stop an asynchronous generator. |
| * |
| * This interface is a stop-gap measure to support generator return |
| * values in older Firefox/SpiderMonkey. In browsers that support ES6 |
| * generators like Chromium 29, just use "return" in your generator |
| * functions. |
| * |
| * @param value the return value for the surrounding generator |
| * @throws ReturnValue exception with the value. |
| * @example |
| * // ES6 style |
| * Q.async(function* () { |
| * var foo = yield getFooPromise(); |
| * var bar = yield getBarPromise(); |
| * return foo + bar; |
| * }) |
| * // Older SpiderMonkey style |
| * Q.async(function () { |
| * var foo = yield getFooPromise(); |
| * var bar = yield getBarPromise(); |
| * Q.return(foo + bar); |
| * }) |
| */ |
| Q["return"] = _return; |
| function _return(value) { |
| throw new QReturnValue(value); |
| } |
| |
| /** |
| * The promised function decorator ensures that any promise arguments |
| * are settled and passed as values (`this` is also settled and passed |
| * as a value). It will also ensure that the result of a function is |
| * always a promise. |
| * |
| * @example |
| * var add = Q.promised(function (a, b) { |
| * return a + b; |
| * }); |
| * add(Q(a), Q(B)); |
| * |
| * @param {function} callback The function to decorate |
| * @returns {function} a function that has been decorated. |
| */ |
| Q.promised = promised; |
| function promised(callback) { |
| return function () { |
| return spread([this, all(arguments)], function (self, args) { |
| return callback.apply(self, args); |
| }); |
| }; |
| } |
| |
| /** |
| * sends a message to a value in a future turn |
| * @param object* the recipient |
| * @param op the name of the message operation, e.g., "when", |
| * @param args further arguments to be forwarded to the operation |
| * @returns result {Promise} a promise for the result of the operation |
| */ |
| Q.dispatch = dispatch; |
| function dispatch(object, op, args) { |
| return Q(object).dispatch(op, args); |
| } |
| |
| Promise.prototype.dispatch = function (op, args) { |
| var self = this; |
| var deferred = defer(); |
| Q.nextTick(function () { |
| self.promiseDispatch(deferred.resolve, op, args); |
| }); |
| return deferred.promise; |
| }; |
| |
| /** |
| * Gets the value of a property in a future turn. |
| * @param object promise or immediate reference for target object |
| * @param name name of property to get |
| * @return promise for the property value |
| */ |
| Q.get = function (object, key) { |
| return Q(object).dispatch("get", [key]); |
| }; |
| |
| Promise.prototype.get = function (key) { |
| return this.dispatch("get", [key]); |
| }; |
| |
| /** |
| * Sets the value of a property in a future turn. |
| * @param object promise or immediate reference for object object |
| * @param name name of property to set |
| * @param value new value of property |
| * @return promise for the return value |
| */ |
| Q.set = function (object, key, value) { |
| return Q(object).dispatch("set", [key, value]); |
| }; |
| |
| Promise.prototype.set = function (key, value) { |
| return this.dispatch("set", [key, value]); |
| }; |
| |
| /** |
| * Deletes a property in a future turn. |
| * @param object promise or immediate reference for target object |
| * @param name name of property to delete |
| * @return promise for the return value |
| */ |
| Q.del = // XXX legacy |
| Q["delete"] = function (object, key) { |
| return Q(object).dispatch("delete", [key]); |
| }; |
| |
| Promise.prototype.del = // XXX legacy |
| Promise.prototype["delete"] = function (key) { |
| return this.dispatch("delete", [key]); |
| }; |
| |
| /** |
| * Invokes a method in a future turn. |
| * @param object promise or immediate reference for target object |
| * @param name name of method to invoke |
| * @param value a value to post, typically an array of |
| * invocation arguments for promises that |
| * are ultimately backed with `resolve` values, |
| * as opposed to those backed with URLs |
| * wherein the posted value can be any |
| * JSON serializable object. |
| * @return promise for the return value |
| */ |
| // bound locally because it is used by other methods |
| Q.mapply = // XXX As proposed by "Redsandro" |
| Q.post = function (object, name, args) { |
| return Q(object).dispatch("post", [name, args]); |
| }; |
| |
| Promise.prototype.mapply = // XXX As proposed by "Redsandro" |
| Promise.prototype.post = function (name, args) { |
| return this.dispatch("post", [name, args]); |
| }; |
| |
| /** |
| * Invokes a method in a future turn. |
| * @param object promise or immediate reference for target object |
| * @param name name of method to invoke |
| * @param ...args array of invocation arguments |
| * @return promise for the return value |
| */ |
| Q.send = // XXX Mark Miller's proposed parlance |
| Q.mcall = // XXX As proposed by "Redsandro" |
| Q.invoke = function (object, name /*...args*/) { |
| return Q(object).dispatch("post", [name, array_slice(arguments, 2)]); |
| }; |
| |
| Promise.prototype.send = // XXX Mark Miller's proposed parlance |
| Promise.prototype.mcall = // XXX As proposed by "Redsandro" |
| Promise.prototype.invoke = function (name /*...args*/) { |
| return this.dispatch("post", [name, array_slice(arguments, 1)]); |
| }; |
| |
| /** |
| * Applies the promised function in a future turn. |
| * @param object promise or immediate reference for target function |
| * @param args array of application arguments |
| */ |
| Q.fapply = function (object, args) { |
| return Q(object).dispatch("apply", [void 0, args]); |
| }; |
| |
| Promise.prototype.fapply = function (args) { |
| return this.dispatch("apply", [void 0, args]); |
| }; |
| |
| /** |
| * Calls the promised function in a future turn. |
| * @param object promise or immediate reference for target function |
| * @param ...args array of application arguments |
| */ |
| Q["try"] = |
| Q.fcall = function (object /* ...args*/) { |
| return Q(object).dispatch("apply", [void 0, array_slice(arguments, 1)]); |
| }; |
| |
| Promise.prototype.fcall = function (/*...args*/) { |
| return this.dispatch("apply", [void 0, array_slice(arguments)]); |
| }; |
| |
| /** |
| * Binds the promised function, transforming return values into a fulfilled |
| * promise and thrown errors into a rejected one. |
| * @param object promise or immediate reference for target function |
| * @param ...args array of application arguments |
| */ |
| Q.fbind = function (object /*...args*/) { |
| var promise = Q(object); |
| var args = array_slice(arguments, 1); |
| return function fbound() { |
| return promise.dispatch("apply", [ |
| this, |
| args.concat(array_slice(arguments)) |
| ]); |
| }; |
| }; |
| Promise.prototype.fbind = function (/*...args*/) { |
| var promise = this; |
| var args = array_slice(arguments); |
| return function fbound() { |
| return promise.dispatch("apply", [ |
| this, |
| args.concat(array_slice(arguments)) |
| ]); |
| }; |
| }; |
| |
| /** |
| * Requests the names of the owned properties of a promised |
| * object in a future turn. |
| * @param object promise or immediate reference for target object |
| * @return promise for the keys of the eventually settled object |
| */ |
| Q.keys = function (object) { |
| return Q(object).dispatch("keys", []); |
| }; |
| |
| Promise.prototype.keys = function () { |
| return this.dispatch("keys", []); |
| }; |
| |
| /** |
| * Turns an array of promises into a promise for an array. If any of |
| * the promises gets rejected, the whole array is rejected immediately. |
| * @param {Array*} an array (or promise for an array) of values (or |
| * promises for values) |
| * @returns a promise for an array of the corresponding values |
| */ |
| // By Mark Miller |
| // http://wiki.ecmascript.org/doku.php?id=strawman:concurrency&rev=1308776521#allfulfilled |
| Q.all = all; |
| function all(promises) { |
| return when(promises, function (promises) { |
| var pendingCount = 0; |
| var deferred = defer(); |
| array_reduce(promises, function (undefined, promise, index) { |
| var snapshot; |
| if ( |
| isPromise(promise) && |
| (snapshot = promise.inspect()).state === "fulfilled" |
| ) { |
| promises[index] = snapshot.value; |
| } else { |
| ++pendingCount; |
| when( |
| promise, |
| function (value) { |
| promises[index] = value; |
| if (--pendingCount === 0) { |
| deferred.resolve(promises); |
| } |
| }, |
| deferred.reject, |
| function (progress) { |
| deferred.notify({ index: index, value: progress }); |
| } |
| ); |
| } |
| }, void 0); |
| if (pendingCount === 0) { |
| deferred.resolve(promises); |
| } |
| return deferred.promise; |
| }); |
| } |
| |
| Promise.prototype.all = function () { |
| return all(this); |
| }; |
| |
| /** |
| * Returns the first resolved promise of an array. Prior rejected promises are |
| * ignored. Rejects only if all promises are rejected. |
| * @param {Array*} an array containing values or promises for values |
| * @returns a promise fulfilled with the value of the first resolved promise, |
| * or a rejected promise if all promises are rejected. |
| */ |
| Q.any = any; |
| |
| function any(promises) { |
| if (promises.length === 0) { |
| return Q.resolve(); |
| } |
| |
| var deferred = Q.defer(); |
| var pendingCount = 0; |
| array_reduce(promises, function (prev, current, index) { |
| var promise = promises[index]; |
| |
| pendingCount++; |
| |
| when(promise, onFulfilled, onRejected, onProgress); |
| function onFulfilled(result) { |
| deferred.resolve(result); |
| } |
| function onRejected() { |
| pendingCount--; |
| if (pendingCount === 0) { |
| deferred.reject(new Error( |
| "Can't get fulfillment value from any promise, all " + |
| "promises were rejected." |
| )); |
| } |
| } |
| function onProgress(progress) { |
| deferred.notify({ |
| index: index, |
| value: progress |
| }); |
| } |
| }, undefined); |
| |
| return deferred.promise; |
| } |
| |
| Promise.prototype.any = function () { |
| return any(this); |
| }; |
| |
| /** |
| * Waits for all promises to be settled, either fulfilled or |
| * rejected. This is distinct from `all` since that would stop |
| * waiting at the first rejection. The promise returned by |
| * `allResolved` will never be rejected. |
| * @param promises a promise for an array (or an array) of promises |
| * (or values) |
| * @return a promise for an array of promises |
| */ |
| Q.allResolved = deprecate(allResolved, "allResolved", "allSettled"); |
| function allResolved(promises) { |
| return when(promises, function (promises) { |
| promises = array_map(promises, Q); |
| return when(all(array_map(promises, function (promise) { |
| return when(promise, noop, noop); |
| })), function () { |
| return promises; |
| }); |
| }); |
| } |
| |
| Promise.prototype.allResolved = function () { |
| return allResolved(this); |
| }; |
| |
| /** |
| * @see Promise#allSettled |
| */ |
| Q.allSettled = allSettled; |
| function allSettled(promises) { |
| return Q(promises).allSettled(); |
| } |
| |
| /** |
| * Turns an array of promises into a promise for an array of their states (as |
| * returned by `inspect`) when they have all settled. |
| * @param {Array[Any*]} values an array (or promise for an array) of values (or |
| * promises for values) |
| * @returns {Array[State]} an array of states for the respective values. |
| */ |
| Promise.prototype.allSettled = function () { |
| return this.then(function (promises) { |
| return all(array_map(promises, function (promise) { |
| promise = Q(promise); |
| function regardless() { |
| return promise.inspect(); |
| } |
| return promise.then(regardless, regardless); |
| })); |
| }); |
| }; |
| |
| /** |
| * Captures the failure of a promise, giving an oportunity to recover |
| * with a callback. If the given promise is fulfilled, the returned |
| * promise is fulfilled. |
| * @param {Any*} promise for something |
| * @param {Function} callback to fulfill the returned promise if the |
| * given promise is rejected |
| * @returns a promise for the return value of the callback |
| */ |
| Q.fail = // XXX legacy |
| Q["catch"] = function (object, rejected) { |
| return Q(object).then(void 0, rejected); |
| }; |
| |
| Promise.prototype.fail = // XXX legacy |
| Promise.prototype["catch"] = function (rejected) { |
| return this.then(void 0, rejected); |
| }; |
| |
| /** |
| * Attaches a listener that can respond to progress notifications from a |
| * promise's originating deferred. This listener receives the exact arguments |
| * passed to ``deferred.notify``. |
| * @param {Any*} promise for something |
| * @param {Function} callback to receive any progress notifications |
| * @returns the given promise, unchanged |
| */ |
| Q.progress = progress; |
| function progress(object, progressed) { |
| return Q(object).then(void 0, void 0, progressed); |
| } |
| |
| Promise.prototype.progress = function (progressed) { |
| return this.then(void 0, void 0, progressed); |
| }; |
| |
| /** |
| * Provides an opportunity to observe the settling of a promise, |
| * regardless of whether the promise is fulfilled or rejected. Forwards |
| * the resolution to the returned promise when the callback is done. |
| * The callback can return a promise to defer completion. |
| * @param {Any*} promise |
| * @param {Function} callback to observe the resolution of the given |
| * promise, takes no arguments. |
| * @returns a promise for the resolution of the given promise when |
| * ``fin`` is done. |
| */ |
| Q.fin = // XXX legacy |
| Q["finally"] = function (object, callback) { |
| return Q(object)["finally"](callback); |
| }; |
| |
| Promise.prototype.fin = // XXX legacy |
| Promise.prototype["finally"] = function (callback) { |
| callback = Q(callback); |
| return this.then(function (value) { |
| return callback.fcall().then(function () { |
| return value; |
| }); |
| }, function (reason) { |
| // TODO attempt to recycle the rejection with "this". |
| return callback.fcall().then(function () { |
| throw reason; |
| }); |
| }); |
| }; |
| |
| /** |
| * Terminates a chain of promises, forcing rejections to be |
| * thrown as exceptions. |
| * @param {Any*} promise at the end of a chain of promises |
| * @returns nothing |
| */ |
| Q.done = function (object, fulfilled, rejected, progress) { |
| return Q(object).done(fulfilled, rejected, progress); |
| }; |
| |
| Promise.prototype.done = function (fulfilled, rejected, progress) { |
| var onUnhandledError = function (error) { |
| // forward to a future turn so that ``when`` |
| // does not catch it and turn it into a rejection. |
| Q.nextTick(function () { |
| makeStackTraceLong(error, promise); |
| if (Q.onerror) { |
| Q.onerror(error); |
| } else { |
| throw error; |
| } |
| }); |
| }; |
| |
| // Avoid unnecessary `nextTick`ing via an unnecessary `when`. |
| var promise = fulfilled || rejected || progress ? |
| this.then(fulfilled, rejected, progress) : |
| this; |
| |
| if (typeof process === "object" && process && process.domain) { |
| onUnhandledError = process.domain.bind(onUnhandledError); |
| } |
| |
| promise.then(void 0, onUnhandledError); |
| }; |
| |
| /** |
| * Causes a promise to be rejected if it does not get fulfilled before |
| * some milliseconds time out. |
| * @param {Any*} promise |
| * @param {Number} milliseconds timeout |
| * @param {Any*} custom error message or Error object (optional) |
| * @returns a promise for the resolution of the given promise if it is |
| * fulfilled before the timeout, otherwise rejected. |
| */ |
| Q.timeout = function (object, ms, error) { |
| return Q(object).timeout(ms, error); |
| }; |
| |
| Promise.prototype.timeout = function (ms, error) { |
| var deferred = defer(); |
| var timeoutId = setTimeout(function () { |
| if (!error || "string" === typeof error) { |
| error = new Error(error || "Timed out after " + ms + " ms"); |
| error.code = "ETIMEDOUT"; |
| } |
| deferred.reject(error); |
| }, ms); |
| |
| this.then(function (value) { |
| clearTimeout(timeoutId); |
| deferred.resolve(value); |
| }, function (exception) { |
| clearTimeout(timeoutId); |
| deferred.reject(exception); |
| }, deferred.notify); |
| |
| return deferred.promise; |
| }; |
| |
| /** |
| * Returns a promise for the given value (or promised value), some |
| * milliseconds after it resolved. Passes rejections immediately. |
| * @param {Any*} promise |
| * @param {Number} milliseconds |
| * @returns a promise for the resolution of the given promise after milliseconds |
| * time has elapsed since the resolution of the given promise. |
| * If the given promise rejects, that is passed immediately. |
| */ |
| Q.delay = function (object, timeout) { |
| if (timeout === void 0) { |
| timeout = object; |
| object = void 0; |
| } |
| return Q(object).delay(timeout); |
| }; |
| |
| Promise.prototype.delay = function (timeout) { |
| return this.then(function (value) { |
| var deferred = defer(); |
| setTimeout(function () { |
| deferred.resolve(value); |
| }, timeout); |
| return deferred.promise; |
| }); |
| }; |
| |
| /** |
| * Passes a continuation to a Node function, which is called with the given |
| * arguments provided as an array, and returns a promise. |
| * |
| * Q.nfapply(FS.readFile, [__filename]) |
| * .then(function (content) { |
| * }) |
| * |
| */ |
| Q.nfapply = function (callback, args) { |
| return Q(callback).nfapply(args); |
| }; |
| |
| Promise.prototype.nfapply = function (args) { |
| var deferred = defer(); |
| var nodeArgs = array_slice(args); |
| nodeArgs.push(deferred.makeNodeResolver()); |
| this.fapply(nodeArgs).fail(deferred.reject); |
| return deferred.promise; |
| }; |
| |
| /** |
| * Passes a continuation to a Node function, which is called with the given |
| * arguments provided individually, and returns a promise. |
| * @example |
| * Q.nfcall(FS.readFile, __filename) |
| * .then(function (content) { |
| * }) |
| * |
| */ |
| Q.nfcall = function (callback /*...args*/) { |
| var args = array_slice(arguments, 1); |
| return Q(callback).nfapply(args); |
| }; |
| |
| Promise.prototype.nfcall = function (/*...args*/) { |
| var nodeArgs = array_slice(arguments); |
| var deferred = defer(); |
| nodeArgs.push(deferred.makeNodeResolver()); |
| this.fapply(nodeArgs).fail(deferred.reject); |
| return deferred.promise; |
| }; |
| |
| /** |
| * Wraps a NodeJS continuation passing function and returns an equivalent |
| * version that returns a promise. |
| * @example |
| * Q.nfbind(FS.readFile, __filename)("utf-8") |
| * .then(console.log) |
| * .done() |
| */ |
| Q.nfbind = |
| Q.denodeify = function (callback /*...args*/) { |
| var baseArgs = array_slice(arguments, 1); |
| return function () { |
| var nodeArgs = baseArgs.concat(array_slice(arguments)); |
| var deferred = defer(); |
| nodeArgs.push(deferred.makeNodeResolver()); |
| Q(callback).fapply(nodeArgs).fail(deferred.reject); |
| return deferred.promise; |
| }; |
| }; |
| |
| Promise.prototype.nfbind = |
| Promise.prototype.denodeify = function (/*...args*/) { |
| var args = array_slice(arguments); |
| args.unshift(this); |
| return Q.denodeify.apply(void 0, args); |
| }; |
| |
| Q.nbind = function (callback, thisp /*...args*/) { |
| var baseArgs = array_slice(arguments, 2); |
| return function () { |
| var nodeArgs = baseArgs.concat(array_slice(arguments)); |
| var deferred = defer(); |
| nodeArgs.push(deferred.makeNodeResolver()); |
| function bound() { |
| return callback.apply(thisp, arguments); |
| } |
| Q(bound).fapply(nodeArgs).fail(deferred.reject); |
| return deferred.promise; |
| }; |
| }; |
| |
| Promise.prototype.nbind = function (/*thisp, ...args*/) { |
| var args = array_slice(arguments, 0); |
| args.unshift(this); |
| return Q.nbind.apply(void 0, args); |
| }; |
| |
| /** |
| * Calls a method of a Node-style object that accepts a Node-style |
| * callback with a given array of arguments, plus a provided callback. |
| * @param object an object that has the named method |
| * @param {String} name name of the method of object |
| * @param {Array} args arguments to pass to the method; the callback |
| * will be provided by Q and appended to these arguments. |
| * @returns a promise for the value or error |
| */ |
| Q.nmapply = // XXX As proposed by "Redsandro" |
| Q.npost = function (object, name, args) { |
| return Q(object).npost(name, args); |
| }; |
| |
| Promise.prototype.nmapply = // XXX As proposed by "Redsandro" |
| Promise.prototype.npost = function (name, args) { |
| var nodeArgs = array_slice(args || []); |
| var deferred = defer(); |
| nodeArgs.push(deferred.makeNodeResolver()); |
| this.dispatch("post", [name, nodeArgs]).fail(deferred.reject); |
| return deferred.promise; |
| }; |
| |
| /** |
| * Calls a method of a Node-style object that accepts a Node-style |
| * callback, forwarding the given variadic arguments, plus a provided |
| * callback argument. |
| * @param object an object that has the named method |
| * @param {String} name name of the method of object |
| * @param ...args arguments to pass to the method; the callback will |
| * be provided by Q and appended to these arguments. |
| * @returns a promise for the value or error |
| */ |
| Q.nsend = // XXX Based on Mark Miller's proposed "send" |
| Q.nmcall = // XXX Based on "Redsandro's" proposal |
| Q.ninvoke = function (object, name /*...args*/) { |
| var nodeArgs = array_slice(arguments, 2); |
| var deferred = defer(); |
| nodeArgs.push(deferred.makeNodeResolver()); |
| Q(object).dispatch("post", [name, nodeArgs]).fail(deferred.reject); |
| return deferred.promise; |
| }; |
| |
| Promise.prototype.nsend = // XXX Based on Mark Miller's proposed "send" |
| Promise.prototype.nmcall = // XXX Based on "Redsandro's" proposal |
| Promise.prototype.ninvoke = function (name /*...args*/) { |
| var nodeArgs = array_slice(arguments, 1); |
| var deferred = defer(); |
| nodeArgs.push(deferred.makeNodeResolver()); |
| this.dispatch("post", [name, nodeArgs]).fail(deferred.reject); |
| return deferred.promise; |
| }; |
| |
| /** |
| * If a function would like to support both Node continuation-passing-style and |
| * promise-returning-style, it can end its internal promise chain with |
| * `nodeify(nodeback)`, forwarding the optional nodeback argument. If the user |
| * elects to use a nodeback, the result will be sent there. If they do not |
| * pass a nodeback, they will receive the result promise. |
| * @param object a result (or a promise for a result) |
| * @param {Function} nodeback a Node.js-style callback |
| * @returns either the promise or nothing |
| */ |
| Q.nodeify = nodeify; |
| function nodeify(object, nodeback) { |
| return Q(object).nodeify(nodeback); |
| } |
| |
| Promise.prototype.nodeify = function (nodeback) { |
| if (nodeback) { |
| this.then(function (value) { |
| Q.nextTick(function () { |
| nodeback(null, value); |
| }); |
| }, function (error) { |
| Q.nextTick(function () { |
| nodeback(error); |
| }); |
| }); |
| } else { |
| return this; |
| } |
| }; |
| |
| Q.noConflict = function() { |
| throw new Error("Q.noConflict only works when Q is used as a global"); |
| }; |
| |
| // All code before this point will be filtered from stack traces. |
| var qEndingLine = captureLine(); |
| |
| return Q; |
| |
| }); |
| |
| }).call(this,require('_process')) |
| //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9xL3EuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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yBkb2VzKS5cbiAgICAgICAgICAgICAgICAvLyBDb250aW51ZSBpbiBuZXh0IGV2ZW50IHRvIGF2b2lkIHRpY2sgcmVjdXJzaW9uLlxuICAgICAgICAgICAgICAgIGlmIChkb21haW4pIHtcbiAgICAgICAgICAgICAgICAgICAgZG9tYWluLmV4aXQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmbHVzaCwgMCk7XG4gICAgICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICAgICAgICBkb21haW4uZW50ZXIoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aHJvdyBlO1xuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIEluIGJyb3dzZXJzLCB1bmNhdWdodCBleGNlcHRpb25zIGFyZSBub3QgZmF0YWwuXG4gICAgICAgICAgICAgICAgLy8gUmUtdGhyb3cgdGhlbSBhc3luY2hyb25vdXNseSB0byBhdm9pZCBzbG93LWRvd25zLlxuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICAgICAgICAgIH0sIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgZG9tYWluLmV4aXQoKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5leHRUaWNrID0gZnVuY3Rpb24gKHRhc2spIHtcbiAgICAgICAgdGFpbCA9IHRhaWwubmV4dCA9IHtcbiAgICAgICAgICAgIHRhc2s6IHRhc2ssXG4gICAgICAgICAgICBkb21haW46IGlzTm9kZUpTICYmIHByb2Nlc3MuZG9tYWluLFxuICAgICAgICAgICAgbmV4dDogbnVsbFxuICAgICAgICB9O1xuXG4gICAgICAgIGlmICghZmx1c2hpbmcpIHtcbiAgICAgICAgICAgI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ZW9mIGVycm9yID09PSBcIm9iamVjdFwiICYmXG4gICAgICAgIGVycm9yICE9PSBudWxsICYmXG4gICAgICAgIGVycm9yLnN0YWNrICYmXG4gICAgICAgIGVycm9yLnN0YWNrLmluZGV4T2YoU1RBQ0tfSlVNUF9TRVBBUkFUT1IpID09PSAtMVxuICAgICkge1xuICAgICAgICB2YXIgc3RhY2tzID0gW107XG4gICAgICAgIGZvciAodmFyIHAgPSBwcm9taXNlOyAhIXA7IHAgPSBwLnNvdXJjZSkge1xuICAgICAgICAgICAgaWYgKHAuc3RhY2spIHtcbiAgICAgICAgICAgICAgICBzdGFja3MudW5zaGlmdChwLnN0YWNrKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdGFja3MudW5zaGlmdChlcnJvci5zdGFjayk7XG5cbiAgICAgICAgdmFyIGNvbmNhdGVkU3RhY2tzID0gc3RhY2tzLmpvaW4oXCJcXG5cIiArIFNUQUNLX0pVTVBfU0VQQVJBVE9SICsgXCJcXG5cIik7XG4gICAgICAgIGVycm9yLnN0YWNrID0gZmlsdGVyU3RhY2tTdHJpbmcoY29uY2F0ZWRTdGFja3MpO1xuICAgIH1cbn1cblxuZnVuY3Rpb24gZmlsdGVyU3RhY2tTdHJpbmcoc3RhY2tTdHJpbmcpIHtcbiAgICB2YXIgbGluZXMgPSBzdGFja1N0cmluZy5zcGxpdChcIlxcblwiKTtcbiAgICB2YXIgZGVzaXJlZExpbmVzID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsaW5lcy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgbGluZSA9IGxpbmVzW2ldO1xuXG4gICAgICAgIGlmICghaXNJbnRlcm5hbEZyYW1lKGxpbmUpICYmICFpc05vZGVGcmFtZShsaW5lKSAmJiBsaW5lKSB7XG4gICAgICAgICAgICBkZXNpcmVkTGluZXMucHVzaChsaW5lKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZGVzaXJlZ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hZ2UpIHtcbiAgICAgICAgICAgIFEubmV4dFRpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIG5ld1Byb21pc2UucHJvbWlzZURpc3BhdGNoLmFwcGx5KG5ld1Byb21pc2UsIG1lc3NhZ2UpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sIHZvaWQgMCk7XG5cbiAgICAgICAgbWVzc2FnZXMgPSB2b2lkIDA7XG4gICAgICAgIHByb2dyZXNzTGlzdGVuZXJzID0gdm9pZCAwO1xuICAgIH1cblxuICAgIGRlZmVycmVkLnByb21pc2UgPSBwcm9taXNlO1xuICAgIGRlZmVycmVkLnJlc29sdmUgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgaWYgKHJlc29sdmVkUHJvbWlzZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgYmVjb21lKFEodmFsdWUpKTtcbiAgICB9O1xuXG4gICAgZGVmZXJyZWQuZnVsZmlsbCA9IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICBpZiAocmVzb2x2ZWRQcm9taXNlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBiZWNvbWUoZnVsZmlsbCh2YWx1ZSkpO1xuICAgIH07XG4gICAgZGVmZXJyZWQucmVqZWN0ID0gZnVuY3Rpb24gKHJlYXNvbikge1xuICAgICAgICBpZiAocmVzb2x2ZWRQcm9taXNlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBiZWNvbWUocmVqZWN0KHJlYXNvbikpO1xuICAgIH07XG4gICAgZGVmZXJyZWQubm90aWZ5ID0gZnVuY3Rpb24gKHByb2dyZXNzKSB7XG4gICAgICAgIGlmIChyZXNvbHZlZFByb21pc2UpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGFycmF5X3JlZHVjZShwcm9ncmVzc0xp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Y3Rpb24gX2Z1bGZpbGxlZCh2YWx1ZSkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiBmdWxmaWxsZWQgPT09IFwiZnVuY3Rpb25cIiA/IGZ1bGZpbGxlZCh2YWx1ZSkgOiB2YWx1ZTtcbiAgICAgICAgfSBjYXRjaCAoZXhjZXB0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gcmVqZWN0KGV4Y2VwdGlvbik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBfcmVqZWN0ZWQoZXhjZXB0aW9uKSB7XG4gICAgICAgIGlmICh0eXBlb2YgcmVqZWN0ZWQgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgbWFrZVN0YWNrVHJhY2VMb25nKGV4Y2VwdGlvbiwgc2VsZik7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHJldHVybiByZWplY3RlZChleGNlcHRpb24pO1xuICAgICAgICAgICAgfSBjYXRjaCAobmV3RXhjZXB0aW9uKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChuZXdFeGNlcHRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZWplY3QoZXhjZXB0aW9uKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBfcHJvZ3Jlc3NlZCh2YWx1ZSkge1xuICAgICAgICByZXR1cm4gdHlwZW9mIHByb2dyZXNzZWQgPT09IFwiZnVuY3Rpb25cIiA/IHByb2dyZXNzZWQodmFsdWUpIDogdmFsdWU7XG4gICAgfVxuXG4gICAgUS5uZXh0VGljayhmdW5jdGlvbiAoKSB7XG4gICAgICAgIHNlbGYucHJvbWlzZURpc3BhdGNoKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb25lID0gdHJ1ZTtcblxuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShfZnVsZmlsbGVkKHZhbHVlKSk7XG4gICAgICAgIH0sIFwid2hlblwiLCBbZnVuY3Rpb24gKGV4Y2VwdGlvbikge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb25lID0gdHJ1ZTtcblxuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShfcmVqZWN0ZWQoZXhjZXB0aW9uKSk7XG4gICAgICAgIH1dKTtcbiAgICB9KTtcblxuICAgIC8vIFByb2dyZXNzIHByb3BhZ2F0b3IgbmVlZCB0byBiZSBhdHRhY2hlZCBpbiB0aGUgY3VycmVudCB0aWNrLlxuICAgIHNlbGYucHJvbWlzZURpc3BhdGNoKHZvaWQgMCwgXCJ3aGVuXCIsIFt2b2lkIDAsIGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICB2YXIgbmV3VmFsdWU7XG4gICAgICAgIHZhciB0aHJldyA9IGZhbHNlO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgbmV3VmFsdWUgPSBfcHJvZ3Jlc3NlZCh2YWx1ZSk7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHRocmV3ID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChRLm9uZXJyb3IpIHtcbiAgICAgICAgICAgICAgICBRLm9uZXJyb3IoZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRocmV3KSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5ub3RpZnkobmV3VmFsdWUpO1xuICAgICAgICB9XG4gICAgfV0pO1xuXG4gICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG59O1xuXG5RLn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KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBRKHJlc3VsdC52YWx1ZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdoZW4ocmVzdWx0LnZhbHVlLCBjYWxsYmFjaywgZXJyYmFjayk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBTcGlkZXJNb25rZXkgR2VuZXJhdG9yc1xuICAgICAgICAgICAgICAgIC8vIEZJWE1FOiBSZW1vdmUgdGhpcyBjYXNlIHdoZW4gU00gZG9lcyBFUzYgZ2VuZXJhdG9ycy5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBnZW5lcmF0b3JbdmVyYl0oYXJnKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChleGNlcHRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzU3RvcEl0ZXJhdGlvbihleGNlcHRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUShleGNlcHRpb24udmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChleGNlcHRpb24pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB3aGVuKHJlc3VsdCwgY2FsbGJhY2ssIGVycmJhY2spO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBnZW5lcmF0b3IgPSBtYWtlR2VuZXJhdG9yLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIHZhciBjYWxsYmFjayA9IGNvbnRpbnVlci5iaW5kKGNvbnRpbnVlciwgXCJuZXh0XCIpO1xuICAgICAgICB2YXIgZXJyYmFjayA9IGNv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MgKG9yXG4gKiBwcm9taXNlcyBmb3IgdmFsdWVzKVxuICogQHJldHVybnMgYSBwcm9taXNlIGZvciBhbiBhcnJheSBvZiB0aGUgY29ycmVzcG9uZGluZyB2YWx1ZXNcbiAqL1xuLy8gQnkgTWFyayBNaWxsZXJcbi8vIGh0dHA6Ly93aWtpLmVjbWFzY3JpcHQub3JnL2Rva3UucGhwP2lkPXN0cmF3bWFuOmNvbmN1cnJlbmN5JnJldj0xMzA4Nzc2NTIxI2FsbGZ1bGZpbGxlZFxuUS5hbGwgPSBhbGw7XG5mdW5jdGlvbiBhbGwocHJvbWlzZXMpIHtcbiAgICByZXR1cm4gd2hlbihwcm9taXNlcywgZnVuY3Rpb24gKHByb21pc2VzKSB7XG4gICAgICAgIHZhciBwZW5kaW5nQ291bnQgPSAwO1xuICAgICAgICB2YXIgZGVmZXJyZWQgPSBkZWZlcigpO1xuICAgICAgICBhcnJheV9yZWR1Y2UocHJvbWlzZXMsIGZ1bmN0aW9uICh1bmRlZmluZWQsIHByb21pc2UsIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgc25hcHNob3Q7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgaXNQcm9taXNlKHByb21pc2UpICYmXG4gICAgICAgICAgICAgICAgKHNuYXBzaG90ID0gcHJvbWlzZS5pbnNwZWN0KCkpLnN0YXRlID09PSBcImZ1bGZpbGxlZFwiXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBwcm9taXNlc1tpbmRleF0gPSBzbmFwc2hvdC52YWx1ZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgKytwZW5kaW5nQ291bnQ7XG4gICAgICAgICAgICAgICAgd2hlbihcbiAgICAgICAgICAgICAgICAgICAgcHJvbWlzZSxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9taXNlc1tpbmRleF0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgtLXBlbmRpbmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUocHJvbWlzZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QsXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChwcm9ncmVzcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQubm90aWZ5KHsgaW5kZXg6IGluZGV4LCB2YWx1ZTogcHJvZ3Jlc3MgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LCB2b2lkIDApO1xuICAgICAgICBpZiAocGVuZGluZ0NvdW50ID09PSAwKSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHByb21pc2VzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICB9KTtcbn1cblxuUHJvbWlzZS5wcm90b3R5cGUuYWxsID0gZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiBhbGwodGhpcyk7XG59O1xuXG4vKipcbiAqIFJldHVybnMgdGhlIGZpcnN0IHJlc29sdmVkIHByb21pc2Ugb2YgYW4gYXJyYXkuIFByaW9yIHJlamVjdGVkIHByb21pc2VzIGFyZVxuICogaWdub3JlZC4gIFJlamVjdHMgb25seSBpZiBhbGwgcHJvbWlzZXMgYXJlIHJlamVjdGVkLlxuICogQHBhcmFtIHtBcnJheSp9IGFuIGFycmF5IGNvbnRhaW5pbmcgdmFsdWVzIG9yIHByb21pc2VzIGZvciB2YWx1ZXNcbiAqIEByZXR1cm5zIGEgcHJvbWlzZSBmdWxmaWxsZWQgd2l0aCB0aGUgdmFsdWUgb2YgdGhlIGZpcnN0IHJlc29sdmVkIHByb21pc2UsXG4gKiBvciBhIHJlamVjdGVkIHByb21pc2UgaWYgYWxsIHByb21pc2VzIGFyZSByZWplY3RlZC5cbiAqL1xuUS5hbnkgPSBhbnk7XG5cbmZ1bmN0aW9uIGFueShwcm9taXNlcykge1xuICAgIGlmIChwcm9taXNlcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgcmV0dXJuIFEucmVzb2x2ZSgpO1xuICAgIH1cblxuICAgIHZhciBkZWZlcnJlZCA9IFEuZGVmZXIoKTtcbiAgICB2YXIgcGVuZGluZ0NvdW50ID0gMDtcbiAgICBhcnJheV9yZWR1Y2UocHJvbWlzZXMsIGZ1bmN0aW9uIChwcmV2LCBjdXJyZW50LCBpbmRleCkge1xuICAgICAgICB2YXIgcHJvbWlzZSA9IHByb21pc2VzW2luZGV4XTtcblxuICAgICAgICBwZW5kaW5nQ291bnQrKztcblxuICAgICAgICB3aGVuKHByb21pc2UsIG9uRnVsZmlsbGVkLCBvblJlamVjdGVkLCBvblByb2dyZXNzKTtcbiAgICAgICAgZnVuY3Rpb24gb25GdWxmaWxsZWQocmVzdWx0KSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gb25SZWplY3RlZCgpIHtcbiAgICAgICAgICAgIHBlbmRpbmdDb3VudC0tO1xuICAgICAgICAgICAgaWYgKHBlbmRpbmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgIFwiQ2FuJ3QgZ2V0IGZ1bGZpbGxtZW50IHZhbHVlIGZyb20gYW55IHByb21pc2UsIGFsbCBcIiArXG4gICAgICAgICAgICAgICAgICAgIFwicHJvbWlzZXMgd2VyZSByZWplY3RlZC5cIlxuICAgICAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgfVx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GwsIHZhbHVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LCBmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgIFEubmV4dFRpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIG5vZGViYWNrKGVycm9yKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG59O1xuXG5RLm5vQ29uZmxpY3QgPSBmdW5jdGlvbigpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoXCJRLm5vQ29uZmxpY3Qgb25seSB3b3JrcyB3aGVuIFEgaXMgdXNlZCBhcyBhIGdsb2JhbFwiKTtcbn07XG5cbi8vIEFsbCBjb2RlIGJlZm9yZSB0aGlzIHBvaW50IHdpbGwgYmUgZmlsdGVyZWQgZnJvbSBzdGFjayB0cmFjZXMuXG52YXIgcUVuZGluZ0xpbmUgPSBjYXB0dXJlTGluZSgpO1xuXG5yZXR1cm4gUTtcblxufSk7XG4iXX0= |
| },{"_process":13}],162:[function(require,module,exports){ |
| /** |
| * Module dependencies. |
| */ |
| |
| var Emitter = require('emitter'); |
| var reduce = require('reduce'); |
| |
| /** |
| * Root reference for iframes. |
| */ |
| |
| var root; |
| if (typeof window !== 'undefined') { // Browser window |
| root = window; |
| } else if (typeof self !== 'undefined') { // Web Worker |
| root = self; |
| } else { // Other environments |
| root = this; |
| } |
| |
| /** |
| * Noop. |
| */ |
| |
| function noop(){}; |
| |
| /** |
| * Check if `obj` is a host object, |
| * we don't want to serialize these :) |
| * |
| * TODO: future proof, move to compoent land |
| * |
| * @param {Object} obj |
| * @return {Boolean} |
| * @api private |
| */ |
| |
| function isHost(obj) { |
| var str = {}.toString.call(obj); |
| |
| switch (str) { |
| case '[object File]': |
| case '[object Blob]': |
| case '[object FormData]': |
| return true; |
| default: |
| return false; |
| } |
| } |
| |
| /** |
| * Determine XHR. |
| */ |
| |
| request.getXHR = function () { |
| if (root.XMLHttpRequest |
| && (!root.location || 'file:' != root.location.protocol |
| || !root.ActiveXObject)) { |
| return new XMLHttpRequest; |
| } else { |
| try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {} |
| try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {} |
| try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {} |
| try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {} |
| } |
| return false; |
| }; |
| |
| /** |
| * Removes leading and trailing whitespace, added to support IE. |
| * |
| * @param {String} s |
| * @return {String} |
| * @api private |
| */ |
| |
| var trim = ''.trim |
| ? function(s) { return s.trim(); } |
| : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); }; |
| |
| /** |
| * Check if `obj` is an object. |
| * |
| * @param {Object} obj |
| * @return {Boolean} |
| * @api private |
| */ |
| |
| function isObject(obj) { |
| return obj === Object(obj); |
| } |
| |
| /** |
| * Serialize the given `obj`. |
| * |
| * @param {Object} obj |
| * @return {String} |
| * @api private |
| */ |
| |
| function serialize(obj) { |
| if (!isObject(obj)) return obj; |
| var pairs = []; |
| for (var key in obj) { |
| if (null != obj[key]) { |
| pushEncodedKeyValuePair(pairs, key, obj[key]); |
| } |
| } |
| return pairs.join('&'); |
| } |
| |
| /** |
| * Helps 'serialize' with serializing arrays. |
| * Mutates the pairs array. |
| * |
| * @param {Array} pairs |
| * @param {String} key |
| * @param {Mixed} val |
| */ |
| |
| function pushEncodedKeyValuePair(pairs, key, val) { |
| if (Array.isArray(val)) { |
| return val.forEach(function(v) { |
| pushEncodedKeyValuePair(pairs, key, v); |
| }); |
| } |
| pairs.push(encodeURIComponent(key) |
| + '=' + encodeURIComponent(val)); |
| } |
| |
| /** |
| * Expose serialization method. |
| */ |
| |
| request.serializeObject = serialize; |
| |
| /** |
| * Parse the given x-www-form-urlencoded `str`. |
| * |
| * @param {String} str |
| * @return {Object} |
| * @api private |
| */ |
| |
| function parseString(str) { |
| var obj = {}; |
| var pairs = str.split('&'); |
| var parts; |
| var pair; |
| |
| for (var i = 0, len = pairs.length; i < len; ++i) { |
| pair = pairs[i]; |
| parts = pair.split('='); |
| obj[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); |
| } |
| |
| return obj; |
| } |
| |
| /** |
| * Expose parser. |
| */ |
| |
| request.parseString = parseString; |
| |
| /** |
| * Default MIME type map. |
| * |
| * superagent.types.xml = 'application/xml'; |
| * |
| */ |
| |
| request.types = { |
| html: 'text/html', |
| json: 'application/json', |
| xml: 'application/xml', |
| urlencoded: 'application/x-www-form-urlencoded', |
| 'form': 'application/x-www-form-urlencoded', |
| 'form-data': 'application/x-www-form-urlencoded' |
| }; |
| |
| /** |
| * Default serialization map. |
| * |
| * superagent.serialize['application/xml'] = function(obj){ |
| * return 'generated xml here'; |
| * }; |
| * |
| */ |
| |
| request.serialize = { |
| 'application/x-www-form-urlencoded': serialize, |
| 'application/json': JSON.stringify |
| }; |
| |
| /** |
| * Default parsers. |
| * |
| * superagent.parse['application/xml'] = function(str){ |
| * return { object parsed from str }; |
| * }; |
| * |
| */ |
| |
| request.parse = { |
| 'application/x-www-form-urlencoded': parseString, |
| 'application/json': JSON.parse |
| }; |
| |
| /** |
| * Parse the given header `str` into |
| * an object containing the mapped fields. |
| * |
| * @param {String} str |
| * @return {Object} |
| * @api private |
| */ |
| |
| function parseHeader(str) { |
| var lines = str.split(/\r?\n/); |
| var fields = {}; |
| var index; |
| var line; |
| var field; |
| var val; |
| |
| lines.pop(); // trailing CRLF |
| |
| for (var i = 0, len = lines.length; i < len; ++i) { |
| line = lines[i]; |
| index = line.indexOf(':'); |
| field = line.slice(0, index).toLowerCase(); |
| val = trim(line.slice(index + 1)); |
| fields[field] = val; |
| } |
| |
| return fields; |
| } |
| |
| /** |
| * Return the mime type for the given `str`. |
| * |
| * @param {String} str |
| * @return {String} |
| * @api private |
| */ |
| |
| function type(str){ |
| return str.split(/ *; */).shift(); |
| }; |
| |
| /** |
| * Return header field parameters. |
| * |
| * @param {String} str |
| * @return {Object} |
| * @api private |
| */ |
| |
| function params(str){ |
| return reduce(str.split(/ *; */), function(obj, str){ |
| var parts = str.split(/ *= */) |
| , key = parts.shift() |
| , val = parts.shift(); |
| |
| if (key && val) obj[key] = val; |
| return obj; |
| }, {}); |
| }; |
| |
| /** |
| * Initialize a new `Response` with the given `xhr`. |
| * |
| * - set flags (.ok, .error, etc) |
| * - parse header |
| * |
| * Examples: |
| * |
| * Aliasing `superagent` as `request` is nice: |
| * |
| * request = superagent; |
| * |
| * We can use the promise-like API, or pass callbacks: |
| * |
| * request.get('/').end(function(res){}); |
| * request.get('/', function(res){}); |
| * |
| * Sending data can be chained: |
| * |
| * request |
| * .post('/user') |
| * .send({ name: 'tj' }) |
| * .end(function(res){}); |
| * |
| * Or passed to `.send()`: |
| * |
| * request |
| * .post('/user') |
| * .send({ name: 'tj' }, function(res){}); |
| * |
| * Or passed to `.post()`: |
| * |
| * request |
| * .post('/user', { name: 'tj' }) |
| * .end(function(res){}); |
| * |
| * Or further reduced to a single call for simple cases: |
| * |
| * request |
| * .post('/user', { name: 'tj' }, function(res){}); |
| * |
| * @param {XMLHTTPRequest} xhr |
| * @param {Object} options |
| * @api private |
| */ |
| |
| function Response(req, options) { |
| options = options || {}; |
| this.req = req; |
| this.xhr = this.req.xhr; |
| // responseText is accessible only if responseType is '' or 'text' and on older browsers |
| this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined') |
| ? this.xhr.responseText |
| : null; |
| this.statusText = this.req.xhr.statusText; |
| this.setStatusProperties(this.xhr.status); |
| this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders()); |
| // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but |
| // getResponseHeader still works. so we get content-type even if getting |
| // other headers fails. |
| this.header['content-type'] = this.xhr.getResponseHeader('content-type'); |
| this.setHeaderProperties(this.header); |
| this.body = this.req.method != 'HEAD' |
| ? this.parseBody(this.text ? this.text : this.xhr.response) |
| : null; |
| } |
| |
| /** |
| * Get case-insensitive `field` value. |
| * |
| * @param {String} field |
| * @return {String} |
| * @api public |
| */ |
| |
| Response.prototype.get = function(field){ |
| return this.header[field.toLowerCase()]; |
| }; |
| |
| /** |
| * Set header related properties: |
| * |
| * - `.type` the content type without params |
| * |
| * A response of "Content-Type: text/plain; charset=utf-8" |
| * will provide you with a `.type` of "text/plain". |
| * |
| * @param {Object} header |
| * @api private |
| */ |
| |
| Response.prototype.setHeaderProperties = function(header){ |
| // content-type |
| var ct = this.header['content-type'] || ''; |
| this.type = type(ct); |
| |
| // params |
| var obj = params(ct); |
| for (var key in obj) this[key] = obj[key]; |
| }; |
| |
| /** |
| * Parse the given body `str`. |
| * |
| * Used for auto-parsing of bodies. Parsers |
| * are defined on the `superagent.parse` object. |
| * |
| * @param {String} str |
| * @return {Mixed} |
| * @api private |
| */ |
| |
| Response.prototype.parseBody = function(str){ |
| var parse = request.parse[this.type]; |
| return parse && str && (str.length || str instanceof Object) |
| ? parse(str) |
| : null; |
| }; |
| |
| /** |
| * Set flags such as `.ok` based on `status`. |
| * |
| * For example a 2xx response will give you a `.ok` of __true__ |
| * whereas 5xx will be __false__ and `.error` will be __true__. The |
| * `.clientError` and `.serverError` are also available to be more |
| * specific, and `.statusType` is the class of error ranging from 1..5 |
| * sometimes useful for mapping respond colors etc. |
| * |
| * "sugar" properties are also defined for common cases. Currently providing: |
| * |
| * - .noContent |
| * - .badRequest |
| * - .unauthorized |
| * - .notAcceptable |
| * - .notFound |
| * |
| * @param {Number} status |
| * @api private |
| */ |
| |
| Response.prototype.setStatusProperties = function(status){ |
| // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request |
| if (status === 1223) { |
| status = 204; |
| } |
| |
| var type = status / 100 | 0; |
| |
| // status / class |
| this.status = this.statusCode = status; |
| this.statusType = type; |
| |
| // basics |
| this.info = 1 == type; |
| this.ok = 2 == type; |
| this.clientError = 4 == type; |
| this.serverError = 5 == type; |
| this.error = (4 == type || 5 == type) |
| ? this.toError() |
| : false; |
| |
| // sugar |
| this.accepted = 202 == status; |
| this.noContent = 204 == status; |
| this.badRequest = 400 == status; |
| this.unauthorized = 401 == status; |
| this.notAcceptable = 406 == status; |
| this.notFound = 404 == status; |
| this.forbidden = 403 == status; |
| }; |
| |
| /** |
| * Return an `Error` representative of this response. |
| * |
| * @return {Error} |
| * @api public |
| */ |
| |
| Response.prototype.toError = function(){ |
| var req = this.req; |
| var method = req.method; |
| var url = req.url; |
| |
| var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')'; |
| var err = new Error(msg); |
| err.status = this.status; |
| err.method = method; |
| err.url = url; |
| |
| return err; |
| }; |
| |
| /** |
| * Expose `Response`. |
| */ |
| |
| request.Response = Response; |
| |
| /** |
| * Initialize a new `Request` with the given `method` and `url`. |
| * |
| * @param {String} method |
| * @param {String} url |
| * @api public |
| */ |
| |
| function Request(method, url) { |
| var self = this; |
| Emitter.call(this); |
| this._query = this._query || []; |
| this.method = method; |
| this.url = url; |
| this.header = {}; |
| this._header = {}; |
| this.on('end', function(){ |
| var err = null; |
| var res = null; |
| |
| try { |
| res = new Response(self); |
| } catch(e) { |
| err = new Error('Parser is unable to parse the response'); |
| err.parse = true; |
| err.original = e; |
| return self.callback(err); |
| } |
| |
| self.emit('response', res); |
| |
| if (err) { |
| return self.callback(err, res); |
| } |
| |
| if (res.status >= 200 && res.status < 300) { |
| return self.callback(err, res); |
| } |
| |
| var new_err = new Error(res.statusText || 'Unsuccessful HTTP response'); |
| new_err.original = err; |
| new_err.response = res; |
| new_err.status = res.status; |
| |
| self.callback(new_err, res); |
| }); |
| } |
| |
| /** |
| * Mixin `Emitter`. |
| */ |
| |
| Emitter(Request.prototype); |
| |
| /** |
| * Allow for extension |
| */ |
| |
| Request.prototype.use = function(fn) { |
| fn(this); |
| return this; |
| } |
| |
| /** |
| * Set timeout to `ms`. |
| * |
| * @param {Number} ms |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.timeout = function(ms){ |
| this._timeout = ms; |
| return this; |
| }; |
| |
| /** |
| * Clear previous timeout. |
| * |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.clearTimeout = function(){ |
| this._timeout = 0; |
| clearTimeout(this._timer); |
| return this; |
| }; |
| |
| /** |
| * Abort the request, and clear potential timeout. |
| * |
| * @return {Request} |
| * @api public |
| */ |
| |
| Request.prototype.abort = function(){ |
| if (this.aborted) return; |
| this.aborted = true; |
| this.xhr.abort(); |
| this.clearTimeout(); |
| this.emit('abort'); |
| return this; |
| }; |
| |
| /** |
| * Set header `field` to `val`, or multiple fields with one object. |
| * |
| * Examples: |
| * |
| * req.get('/') |
| * .set('Accept', 'application/json') |
| * .set('X-API-Key', 'foobar') |
| * .end(callback); |
| * |
| * req.get('/') |
| * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' }) |
| * .end(callback); |
| * |
| * @param {String|Object} field |
| * @param {String} val |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.set = function(field, val){ |
| if (isObject(field)) { |
| for (var key in field) { |
| this.set(key, field[key]); |
| } |
| return this; |
| } |
| this._header[field.toLowerCase()] = val; |
| this.header[field] = val; |
| return this; |
| }; |
| |
| /** |
| * Remove header `field`. |
| * |
| * Example: |
| * |
| * req.get('/') |
| * .unset('User-Agent') |
| * .end(callback); |
| * |
| * @param {String} field |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.unset = function(field){ |
| delete this._header[field.toLowerCase()]; |
| delete this.header[field]; |
| return this; |
| }; |
| |
| /** |
| * Get case-insensitive header `field` value. |
| * |
| * @param {String} field |
| * @return {String} |
| * @api private |
| */ |
| |
| Request.prototype.getHeader = function(field){ |
| return this._header[field.toLowerCase()]; |
| }; |
| |
| /** |
| * Set Content-Type to `type`, mapping values from `request.types`. |
| * |
| * Examples: |
| * |
| * superagent.types.xml = 'application/xml'; |
| * |
| * request.post('/') |
| * .type('xml') |
| * .send(xmlstring) |
| * .end(callback); |
| * |
| * request.post('/') |
| * .type('application/xml') |
| * .send(xmlstring) |
| * .end(callback); |
| * |
| * @param {String} type |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.type = function(type){ |
| this.set('Content-Type', request.types[type] || type); |
| return this; |
| }; |
| |
| /** |
| * Force given parser |
| * |
| * Sets the body parser no matter type. |
| * |
| * @param {Function} |
| * @api public |
| */ |
| |
| Request.prototype.parse = function(fn){ |
| this._parser = fn; |
| return this; |
| }; |
| |
| /** |
| * Set Accept to `type`, mapping values from `request.types`. |
| * |
| * Examples: |
| * |
| * superagent.types.json = 'application/json'; |
| * |
| * request.get('/agent') |
| * .accept('json') |
| * .end(callback); |
| * |
| * request.get('/agent') |
| * .accept('application/json') |
| * .end(callback); |
| * |
| * @param {String} accept |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.accept = function(type){ |
| this.set('Accept', request.types[type] || type); |
| return this; |
| }; |
| |
| /** |
| * Set Authorization field value with `user` and `pass`. |
| * |
| * @param {String} user |
| * @param {String} pass |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.auth = function(user, pass){ |
| var str = btoa(user + ':' + pass); |
| this.set('Authorization', 'Basic ' + str); |
| return this; |
| }; |
| |
| /** |
| * Add query-string `val`. |
| * |
| * Examples: |
| * |
| * request.get('/shoes') |
| * .query('size=10') |
| * .query({ color: 'blue' }) |
| * |
| * @param {Object|String} val |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.query = function(val){ |
| if ('string' != typeof val) val = serialize(val); |
| if (val) this._query.push(val); |
| return this; |
| }; |
| |
| /** |
| * Write the field `name` and `val` for "multipart/form-data" |
| * request bodies. |
| * |
| * ``` js |
| * request.post('/upload') |
| * .field('foo', 'bar') |
| * .end(callback); |
| * ``` |
| * |
| * @param {String} name |
| * @param {String|Blob|File} val |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.field = function(name, val){ |
| if (!this._formData) this._formData = new root.FormData(); |
| this._formData.append(name, val); |
| return this; |
| }; |
| |
| /** |
| * Queue the given `file` as an attachment to the specified `field`, |
| * with optional `filename`. |
| * |
| * ``` js |
| * request.post('/upload') |
| * .attach(new Blob(['<a id="a"><b id="b">hey!</b></a>'], { type: "text/html"})) |
| * .end(callback); |
| * ``` |
| * |
| * @param {String} field |
| * @param {Blob|File} file |
| * @param {String} filename |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.attach = function(field, file, filename){ |
| if (!this._formData) this._formData = new root.FormData(); |
| this._formData.append(field, file, filename); |
| return this; |
| }; |
| |
| /** |
| * Send `data`, defaulting the `.type()` to "json" when |
| * an object is given. |
| * |
| * Examples: |
| * |
| * // querystring |
| * request.get('/search') |
| * .end(callback) |
| * |
| * // multiple data "writes" |
| * request.get('/search') |
| * .send({ search: 'query' }) |
| * .send({ range: '1..5' }) |
| * .send({ order: 'desc' }) |
| * .end(callback) |
| * |
| * // manual json |
| * request.post('/user') |
| * .type('json') |
| * .send('{"name":"tj"}') |
| * .end(callback) |
| * |
| * // auto json |
| * request.post('/user') |
| * .send({ name: 'tj' }) |
| * .end(callback) |
| * |
| * // manual x-www-form-urlencoded |
| * request.post('/user') |
| * .type('form') |
| * .send('name=tj') |
| * .end(callback) |
| * |
| * // auto x-www-form-urlencoded |
| * request.post('/user') |
| * .type('form') |
| * .send({ name: 'tj' }) |
| * .end(callback) |
| * |
| * // defaults to x-www-form-urlencoded |
| * request.post('/user') |
| * .send('name=tobi') |
| * .send('species=ferret') |
| * .end(callback) |
| * |
| * @param {String|Object} data |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.send = function(data){ |
| var obj = isObject(data); |
| var type = this.getHeader('Content-Type'); |
| |
| // merge |
| if (obj && isObject(this._data)) { |
| for (var key in data) { |
| this._data[key] = data[key]; |
| } |
| } else if ('string' == typeof data) { |
| if (!type) this.type('form'); |
| type = this.getHeader('Content-Type'); |
| if ('application/x-www-form-urlencoded' == type) { |
| this._data = this._data |
| ? this._data + '&' + data |
| : data; |
| } else { |
| this._data = (this._data || '') + data; |
| } |
| } else { |
| this._data = data; |
| } |
| |
| if (!obj || isHost(data)) return this; |
| if (!type) this.type('json'); |
| return this; |
| }; |
| |
| /** |
| * Invoke the callback with `err` and `res` |
| * and handle arity check. |
| * |
| * @param {Error} err |
| * @param {Response} res |
| * @api private |
| */ |
| |
| Request.prototype.callback = function(err, res){ |
| var fn = this._callback; |
| this.clearTimeout(); |
| fn(err, res); |
| }; |
| |
| /** |
| * Invoke callback with x-domain error. |
| * |
| * @api private |
| */ |
| |
| Request.prototype.crossDomainError = function(){ |
| var err = new Error('Origin is not allowed by Access-Control-Allow-Origin'); |
| err.crossDomain = true; |
| this.callback(err); |
| }; |
| |
| /** |
| * Invoke callback with timeout error. |
| * |
| * @api private |
| */ |
| |
| Request.prototype.timeoutError = function(){ |
| var timeout = this._timeout; |
| var err = new Error('timeout of ' + timeout + 'ms exceeded'); |
| err.timeout = timeout; |
| this.callback(err); |
| }; |
| |
| /** |
| * Enable transmission of cookies with x-domain requests. |
| * |
| * Note that for this to work the origin must not be |
| * using "Access-Control-Allow-Origin" with a wildcard, |
| * and also must set "Access-Control-Allow-Credentials" |
| * to "true". |
| * |
| * @api public |
| */ |
| |
| Request.prototype.withCredentials = function(){ |
| this._withCredentials = true; |
| return this; |
| }; |
| |
| /** |
| * Initiate request, invoking callback `fn(res)` |
| * with an instanceof `Response`. |
| * |
| * @param {Function} fn |
| * @return {Request} for chaining |
| * @api public |
| */ |
| |
| Request.prototype.end = function(fn){ |
| var self = this; |
| var xhr = this.xhr = request.getXHR(); |
| var query = this._query.join('&'); |
| var timeout = this._timeout; |
| var data = this._formData || this._data; |
| |
| // store callback |
| this._callback = fn || noop; |
| |
| // state change |
| xhr.onreadystatechange = function(){ |
| if (4 != xhr.readyState) return; |
| |
| // In IE9, reads to any property (e.g. status) off of an aborted XHR will |
| // result in the error "Could not complete the operation due to error c00c023f" |
| var status; |
| try { status = xhr.status } catch(e) { status = 0; } |
| |
| if (0 == status) { |
| if (self.timedout) return self.timeoutError(); |
| if (self.aborted) return; |
| return self.crossDomainError(); |
| } |
| self.emit('end'); |
| }; |
| |
| // progress |
| var handleProgress = function(e){ |
| if (e.total > 0) { |
| e.percent = e.loaded / e.total * 100; |
| } |
| self.emit('progress', e); |
| }; |
| if (this.hasListeners('progress')) { |
| xhr.onprogress = handleProgress; |
| } |
| try { |
| if (xhr.upload && this.hasListeners('progress')) { |
| xhr.upload.onprogress = handleProgress; |
| } |
| } catch(e) { |
| // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist. |
| // Reported here: |
| // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context |
| } |
| |
| // timeout |
| if (timeout && !this._timer) { |
| this._timer = setTimeout(function(){ |
| self.timedout = true; |
| self.abort(); |
| }, timeout); |
| } |
| |
| // querystring |
| if (query) { |
| query = request.serializeObject(query); |
| this.url += ~this.url.indexOf('?') |
| ? '&' + query |
| : '?' + query; |
| } |
| |
| // initiate request |
| xhr.open(this.method, this.url, true); |
| |
| // CORS |
| if (this._withCredentials) xhr.withCredentials = true; |
| |
| // body |
| if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !isHost(data)) { |
| // serialize stuff |
| var contentType = this.getHeader('Content-Type'); |
| var serialize = this._parser || request.serialize[contentType ? contentType.split(';')[0] : '']; |
| if (serialize) data = serialize(data); |
| } |
| |
| // set header fields |
| for (var field in this.header) { |
| if (null == this.header[field]) continue; |
| xhr.setRequestHeader(field, this.header[field]); |
| } |
| |
| // send stuff |
| this.emit('request', this); |
| |
| // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing) |
| // We need null here if data is undefined |
| xhr.send(typeof data !== 'undefined' ? data : null); |
| return this; |
| }; |
| |
| /** |
| * Faux promise support |
| * |
| * @param {Function} fulfill |
| * @param {Function} reject |
| * @return {Request} |
| */ |
| |
| Request.prototype.then = function (fulfill, reject) { |
| return this.end(function(err, res) { |
| err ? reject(err) : fulfill(res); |
| }); |
| } |
| |
| /** |
| * Expose `Request`. |
| */ |
| |
| request.Request = Request; |
| |
| /** |
| * Issue a request: |
| * |
| * Examples: |
| * |
| * request('GET', '/users').end(callback) |
| * request('/users').end(callback) |
| * request('/users', callback) |
| * |
| * @param {String} method |
| * @param {String|Function} url or callback |
| * @return {Request} |
| * @api public |
| */ |
| |
| function request(method, url) { |
| // callback |
| if ('function' == typeof url) { |
| return new Request('GET', method).end(url); |
| } |
| |
| // url first |
| if (1 == arguments.length) { |
| return new Request('GET', method); |
| } |
| |
| return new Request(method, url); |
| } |
| |
| /** |
| * GET `url` with optional callback `fn(res)`. |
| * |
| * @param {String} url |
| * @param {Mixed|Function} data or fn |
| * @param {Function} fn |
| * @return {Request} |
| * @api public |
| */ |
| |
| request.get = function(url, data, fn){ |
| var req = request('GET', url); |
| if ('function' == typeof data) fn = data, data = null; |
| if (data) req.query(data); |
| if (fn) req.end(fn); |
| return req; |
| }; |
| |
| /** |
| * HEAD `url` with optional callback `fn(res)`. |
| * |
| * @param {String} url |
| * @param {Mixed|Function} data or fn |
| * @param {Function} fn |
| * @return {Request} |
| * @api public |
| */ |
| |
| request.head = function(url, data, fn){ |
| var req = request('HEAD', url); |
| if ('function' == typeof data) fn = data, data = null; |
| if (data) req.send(data); |
| if (fn) req.end(fn); |
| return req; |
| }; |
| |
| /** |
| * DELETE `url` with optional callback `fn(res)`. |
| * |
| * @param {String} url |
| * @param {Function} fn |
| * @return {Request} |
| * @api public |
| */ |
| |
| function del(url, fn){ |
| var req = request('DELETE', url); |
| if (fn) req.end(fn); |
| return req; |
| }; |
| |
| request.del = del; |
| request.delete = del; |
| |
| /** |
| * PATCH `url` with optional `data` and callback `fn(res)`. |
| * |
| * @param {String} url |
| * @param {Mixed} data |
| * @param {Function} fn |
| * @return {Request} |
| * @api public |
| */ |
| |
| request.patch = function(url, data, fn){ |
| var req = request('PATCH', url); |
| if ('function' == typeof data) fn = data, data = null; |
| if (data) req.send(data); |
| if (fn) req.end(fn); |
| return req; |
| }; |
| |
| /** |
| * POST `url` with optional `data` and callback `fn(res)`. |
| * |
| * @param {String} url |
| * @param {Mixed} data |
| * @param {Function} fn |
| * @return {Request} |
| * @api public |
| */ |
| |
| request.post = function(url, data, fn){ |
| var req = request('POST', url); |
| if ('function' == typeof data) fn = data, data = null; |
| if (data) req.send(data); |
| if (fn) req.end(fn); |
| return req; |
| }; |
| |
| /** |
| * PUT `url` with optional `data` and callback `fn(res)`. |
| * |
| * @param {String} url |
| * @param {Mixed|Function} data or fn |
| * @param {Function} fn |
| * @return {Request} |
| * @api public |
| */ |
| |
| request.put = function(url, data, fn){ |
| var req = request('PUT', url); |
| if ('function' == typeof data) fn = data, data = null; |
| if (data) req.send(data); |
| if (fn) req.end(fn); |
| return req; |
| }; |
| |
| /** |
| * Expose `request`. |
| */ |
| |
| module.exports = request; |
| |
| },{"emitter":163,"reduce":164}],163:[function(require,module,exports){ |
| |
| /** |
| * Expose `Emitter`. |
| */ |
| |
| module.exports = Emitter; |
| |
| /** |
| * Initialize a new `Emitter`. |
| * |
| * @api public |
| */ |
| |
| function Emitter(obj) { |
| if (obj) return mixin(obj); |
| }; |
| |
| /** |
| * Mixin the emitter properties. |
| * |
| * @param {Object} obj |
| * @return {Object} |
| * @api private |
| */ |
| |
| function mixin(obj) { |
| for (var key in Emitter.prototype) { |
| obj[key] = Emitter.prototype[key]; |
| } |
| return obj; |
| } |
| |
| /** |
| * Listen on the given `event` with `fn`. |
| * |
| * @param {String} event |
| * @param {Function} fn |
| * @return {Emitter} |
| * @api public |
| */ |
| |
| Emitter.prototype.on = |
| Emitter.prototype.addEventListener = function(event, fn){ |
| this._callbacks = this._callbacks || {}; |
| (this._callbacks[event] = this._callbacks[event] || []) |
| .push(fn); |
| return this; |
| }; |
| |
| /** |
| * Adds an `event` listener that will be invoked a single |
| * time then automatically removed. |
| * |
| * @param {String} event |
| * @param {Function} fn |
| * @return {Emitter} |
| * @api public |
| */ |
| |
| Emitter.prototype.once = function(event, fn){ |
| var self = this; |
| this._callbacks = this._callbacks || {}; |
| |
| function on() { |
| self.off(event, on); |
| fn.apply(this, arguments); |
| } |
| |
| on.fn = fn; |
| this.on(event, on); |
| return this; |
| }; |
| |
| /** |
| * Remove the given callback for `event` or all |
| * registered callbacks. |
| * |
| * @param {String} event |
| * @param {Function} fn |
| * @return {Emitter} |
| * @api public |
| */ |
| |
| Emitter.prototype.off = |
| Emitter.prototype.removeListener = |
| Emitter.prototype.removeAllListeners = |
| Emitter.prototype.removeEventListener = function(event, fn){ |
| this._callbacks = this._callbacks || {}; |
| |
| // all |
| if (0 == arguments.length) { |
| this._callbacks = {}; |
| return this; |
| } |
| |
| // specific event |
| var callbacks = this._callbacks[event]; |
| if (!callbacks) return this; |
| |
| // remove all handlers |
| if (1 == arguments.length) { |
| delete this._callbacks[event]; |
| return this; |
| } |
| |
| // remove specific handler |
| var cb; |
| for (var i = 0; i < callbacks.length; i++) { |
| cb = callbacks[i]; |
| if (cb === fn || cb.fn === fn) { |
| callbacks.splice(i, 1); |
| break; |
| } |
| } |
| return this; |
| }; |
| |
| /** |
| * Emit `event` with the given args. |
| * |
| * @param {String} event |
| * @param {Mixed} ... |
| * @return {Emitter} |
| */ |
| |
| Emitter.prototype.emit = function(event){ |
| this._callbacks = this._callbacks || {}; |
| var args = [].slice.call(arguments, 1) |
| , callbacks = this._callbacks[event]; |
| |
| if (callbacks) { |
| callbacks = callbacks.slice(0); |
| for (var i = 0, len = callbacks.length; i < len; ++i) { |
| callbacks[i].apply(this, args); |
| } |
| } |
| |
| return this; |
| }; |
| |
| /** |
| * Return array of callbacks for `event`. |
| * |
| * @param {String} event |
| * @return {Array} |
| * @api public |
| */ |
| |
| Emitter.prototype.listeners = function(event){ |
| this._callbacks = this._callbacks || {}; |
| return this._callbacks[event] || []; |
| }; |
| |
| /** |
| * Check if this emitter has `event` handlers. |
| * |
| * @param {String} event |
| * @return {Boolean} |
| * @api public |
| */ |
| |
| Emitter.prototype.hasListeners = function(event){ |
| return !! this.listeners(event).length; |
| }; |
| |
| },{}],164:[function(require,module,exports){ |
| |
| /** |
| * Reduce `arr` with `fn`. |
| * |
| * @param {Array} arr |
| * @param {Function} fn |
| * @param {Mixed} initial |
| * |
| * TODO: combatible error handling? |
| */ |
| |
| module.exports = function(arr, fn, initial){ |
| var idx = 0; |
| var len = arr.length; |
| var curr = arguments.length == 3 |
| ? initial |
| : arr[idx++]; |
| |
| while (idx < len) { |
| curr = fn.call(null, curr, arr[idx], ++idx, arr); |
| } |
| |
| return curr; |
| }; |
| },{}]},{},[1])(1) |
| }); |
| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJpbmRleC5qcyIsImxpYi9hdXRoLmpzIiwibGliL2NsaWVudC5qcyIsImxpYi9oZWxwZXJzLmpzIiwibGliL2h0dHAuanMiLCJsaWIvcmVzb2x2ZXIuanMiLCJsaWIvc2NoZW1hLW1hcmt1cC5qcyIsImxpYi9zcGVjLWNvbnZlcnRlci5qcyIsImxpYi90eXBlcy9tb2RlbC5qcyIsImxpYi90eXBlcy9vcGVyYXRpb24uanMiLCJsaWIvdHlwZXMvb3BlcmF0aW9uR3JvdXAuanMiLCJub2RlX21vZHVsZXMvYnJvd3NlcmlmeS9ub2RlX21vZHVsZXMvYnJvd3Nlci1yZXNvbHZlL2VtcHR5LmpzIiwibm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnkvbm9kZV9tb2R1bGVzL3Byb2Nlc3MvYnJvd3Nlci5qcyIsIm5vZGVfbW9kdWxlcy9idG9hL2luZGV4LmpzIiwibm9kZV9tb2R1bGVzL2J1ZmZlci9pbm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uZ3RoID4gMCkge1xuICAgICAgICAgICAgaWYgKGt2WzBdID09PSB0aGlzLm5hbWUpIHtcbiAgICAgICAgICAgICAgLy8gc2tpcCBpdFxuICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKG9iai51cmwuaW5kZXhPZignPycpID4gMCkge1xuICAgICAgb2JqLnVybCA9IG9iai51cmwgKyAnJicgKyB0aGlzLm5hbWUgKyAnPScgKyB0aGlzLnZhbHVlO1xuICAgIH0gZWxzZSB7XG4gICAgICBvYmoudXJsID0gb2JqLnVybCArICc/JyArIHRoaXMubmFtZSArICc9JyArIHRoaXMudmFsdWU7XG4gICAgfVxuXG4gICAgcmV0dXJuIHRydWU7XG4gIH0gZWxzZSBpZiAodGhpcy50eXBlID09PSAnaGVhZGVyJykge1xuICAgIGlmKHR5cGVvZiBvYmouaGVhZGVyc1t0aGlzLm5hbWVdID09PSAndW5kZWZpbmVkJykge1xuICAgICAgb2JqLmhlYWRlcnNbdGhpcy5uYW1lXSA9IHRoaXMudmFsdWU7XG4gICAgfVxuXG4gICAgcmV0dXJuIHRydWU7XG4gIH1cbn07XG5cbnZhciBDb29raWVBdXRob3JpemF0aW9uID0gbW9kdWxlLmV4cG9ydHMuQ29va2llQXV0aG9yaXphdGlvbiA9IGZ1bmN0aW9uIChjb29raWUpIHtcbiAgdGhpcy5jb29raWUgPSBjb29raWU7XG59O1xuXG5Db29raWVBdXRob3JpemF0aW9uLnByb3RvdHlwZS5hcHBseSA9IGZ1bmN0aW9uIChvYmopIHtcbiAgb2JqLmNvb2tpZUphciA9IG9iai5jb29raWVKYXIgfHwgbmV3IENvb2tpZUphcigpO1xuICBvYmouY29va2llSmFyLnNldENvb2tpZSh0aGlzLmNvb2tpZSk7XG5cbiAgcmV0dXJuIHRydWU7XG59O1xuXG4vKipcbiAqIFBhc3N3b3JkIEF1dGhvcml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W5jdGlvbihvcGVyYXRpb25Hcm91cC5oZWxwKSkge1xuICAgICAgICAgIG9wZXJhdGlvbkdyb3VwLmhlbHAgPSBfLmJpbmQoc2VsZi5oZWxwLCBvcGVyYXRpb25Hcm91cCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBiaW5kIHRvIHRoZSBhcGlzIG9iamVjdFxuICAgICAgICBzZWxmLmFwaXNbYXBpUHJvcGVydHldW29wZXJhdGlvbklkXSA9IG9wZXJhdGlvbkdyb3VwW29wZXJhdGlvbklkXSA9IF8uYmluZChvcGVyYXRpb25PYmplY3QuZXhlY3V0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25PYmplY3QpO1xuICAgICAgICBzZWxmLmFwaXNbYXBpUHJvcGVydHldW29wZXJhdGlvbklkXS5oZWxwID0gb3BlcmF0aW9uR3JvdXBbb3BlcmF0aW9uSWRdLmhlbHAgPSBfLmJpbmQob3BlcmF0aW9uT2JqZWN0LmhlbHAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25PYmplY3QpO1xuICAgICAgICBzZWxmLmFwaXNbYXBpUHJvcGVydHldW29wZXJhdGlvbklkXS5hc0N1cmwgPSBvcGVyYXRpb25Hcm91cFtvcGVyYXRpb25JZF0uYXNDdXJsID0gXy5iaW5kKG9wZXJhdGlvbk9iamVjdC5hc0N1cmwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uT2JqZWN0KTtcblxuICAgICAgICBvcGVyYXRpb25Hcm91cC5hcGlzW29wZXJhdGlvbklkXSA9IG9wZXJhdGlv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iAgICAgIHJlc3BvbnNlLnN0YXR1cyA9IHJlcyA/IHJlcy5zdGF0dXMgOiA1MDA7XG4gICAgICByZXNwb25zZS5zdGF0dXNUZXh0ID0gcmVzID8gcmVzLnRleHQgOiBlcnIubWVzc2FnZTtcbiAgICAgIGlmKHJlcy5oZWFkZXJzICYmIHJlcy5oZWFkZXJzWydjb250ZW50LXR5cGUnXSkge1xuICAgICAgICBpZihyZXMuaGVhZGVyc1snY29udGVudC10eXBlJ10uaW5kZXhPZignYXBwbGljYXRpb24vanNvbicpID49IDApIHtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmVzcG9uc2Uub2JqID0gSlNPTi5wYXJzZShyZXNwb25zZS5zdGF0dXNUZXh0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHJlc3BvbnNlLm9iaiA9IG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBjYiA9IG9iai5vbi5lcnJvcjtcbiAgICB9IGVsc2UgaWYgKHJlcyAmJiBvYmoub24gJiYgb2JqLm9uLnJlc3BvbnNlKSB7XG4gICAgICB2YXIgcG9zc2libGVPYmo7XG5cbiAgICAgIC8vIEFscmVhZHkgcGFyc2VkIGJ5IGJ5IHN1cGVyYWdlbnQ/XG4gICAgICBpZihyZXMuYm9keSAmJiBPYmplY3Qua2V5cyhyZXMuYm9keSkubGVuZ3RoID4gMCkge1xuICAgICAgICBwb3NzaWJsZU9iaiA9IHJlcy5ib2R5O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgcG9zc2libGVPYmogPSBqc3lhbWwuc2FmZUxvYWQocmVzLnRleHQpO1xuICAgICAgICAgICAgLy8gY2FuIHBhcnNlIGludG8gYSBzdHJpbmcuLi4gd2hpY2ggd2UgZG9uJ3QgbmVlZCBydW5uaW5nIGFyb3VuZCBpbiB0aGUgc3lzdGVtXG4gICAgICAg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saW5lX21vZGVsJztcbiAgICAgICAgICAgICAgdmFyIG5hbWUgPSBtb2RlbE5hbWU7XG4gICAgICAgICAgICAgIHZhciBkb25lID0gZmFsc2U7IHZhciBjb3VudGVyID0gMDtcbiAgICAgICAgICAgICAgd2hpbGUoIWRvbmUpIHtcbiAgICAgICAgICAgICAgICBpZih0eXBlb2Ygc3BlYy5kZWZpbml0aW9uc1tuYW1lXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5hbWUgPSBtb2RlbE5hbWUgKyAnXycgKyBjb3VudGVyO1xuICAgICAgICAgICAgICAgIGNvdW50ZXIgKys7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgc3BlYy5kZWZpbml0aW9uc1tuYW1lXSA9IHsgYWxsT2Y6IHBhcmFtZXRlci5zY2hlbWEuYWxsT2YgfTtcbiAgICAgICAgICAgICAgZGVsZXRlIHBhcmFtZXRlci5zY2hlbWEuYWxsT2Y7XG4gICAgICAgICAgICAgIHBhcmFtZXRlci5zY2hlbWEuJHJlZiA9ICcjL2RlZmluaXRpb25zLycgKyBuYW1lO1xuICAgICAgICAgICAgICB0aGlzLnByb2Nlc3NBbGxPZihyb290LCBuYW1lLCBzcGVjLmRlZmluaXRpb25zW25hbWVdLCByZXNvbHV0aW9uVGFibGUsIHVucmVzb2x2ZWRSZWZzLCBzcGVjKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLnJlc29sdmVUbyhyb290LCBwYXJhbWV0ZXIuc2NoZW1hLCByZXNvbHV0aW9uVGFibGUsIGxvY2F0aW9uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAocGFyYW1ldGVyLiRyZWYpIHtcbiAgICAgICA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iAgfVxuXG4gIHZhciBleHBlY3RlZENhbGxzID0gMCwgdG9SZXNvbHZlID0gW107XG4gIC8vIGlmIHRoZSByb290IGlzIHNhbWUgYXMgb2JqW2ldLnJvb3Qgd2UgY2FuIHJlc29sdmUgbG9jYWxseVxuICB2YXIgYWxsID0gcmVzb2x1dGlvblRhYmxlO1xuXG4gIHZhciBwYXJ0cztcbiAgZm9yKGkgPSAwOyBpIDwgYWxsLmxlbmd0aDsgaSsrKSB7XG4gICAgdmFyIGEgPSBhbGxbaV07XG4gICAgaWYocm9vdCA9PT0gYS5yb290KSB7XG4gICAgICBpZihhLnJlc29sdmVBcyA9PT0gJ3JlZicpIHtcbiAgICAgICAgLy8gcmVzb2x2ZSBhbnkgcGF0aCB3YWxraW5nXG4gICAgICAgIHZhciBqb2luZWQgPSAoKGEucm9vdCB8fCAnJykgKyAnLycgKyBhLmtleSkuc3BsaXQoJy8nKTtcbiAgICAgICAgdmFyIG5vcm1hbGl6ZWQgPSBbXTtcbiAgICAgICAgdmFyIHVybCA9ICcnO1xuICAgICAgICB2YXIgaztcblxuICAgICAgICBpZihhLmtleS5pbmRleE9mKCcuLi8nKSA+PSAwKSB7XG4gICAgICAgICAgZm9yKHZhciBqID0gMDsgaiA8IGpvaW5lZC5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgaWYoam9pbmVkW2pdID09PSAnLi4nKSB7XG4gICAgICAgICAgICAgIG5vcm1hbGl6ZWQgPSBub3JtYWxpemVkLnNsaWNlKDAsIG5vcm1hbGl6ZWQubGVuZ3RoLTEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIG5vcm1hbGl6ZWQucHVzaChqb2luZWRbal0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBmb3IoayA9IDA7IGsgPCBub3JtYWxpemVkLmxlbmd0aDsgayArKykge1xuICAgICAgICAgICAgaWYoayA+IDApIHtcbiAgICAgICAgICAgICAgdXJsICs9ICcvJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHVybCArPSBub3JtYWxpemVkW2tdO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLyB3ZSBub3cgaGF2ZSB0byByZW1vdGUgcmVzb2x2ZSB0aGlzIGJlY2F1c2UgdGhlIHBhdGggaGFzIGNoYW5nZWRcbiAgICAgICAgICBhLnJvb3QgPSB1cmw7XG4gICAgICAgICAgdG9SZXNvbHZlLnB1c2goYSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgcGFydHMgPSBhLmtleS5zcGxpdCgnIycpO1xuICAgICAgICAgIGlmKHBhcnRzLmxlbmd0aCA9PT0gMikge1xuICAgICAgICAgICAgaWYocGFydHNbMF0uaW5kZXhPZignaHR0cDovLycpID09PSAwIHx8IHBhcnRzWzBdLmluZGV4T2YoJ2h0dHBzOi8vJykgPT09IDApIHtcbiAgICAgICAgICAgICAgYS5yb290ID0gcGFydHNbMF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsb2NhdGlvbiA9IHBhcnRzWzFdLnNwbGl0KCcvJyk7XG4gICAgICAgICAgICB2YXIgcjtcbiAgICAgICAgICAgIHZhciBzID0gc3BlYztcbiAgICAgICAgICAgIGZvcihrID0gMDsgayA8IGxvY2F0aW9uLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgIHZhciBwYXJ0ID0gbG9jYXRpb25ba107XG4gICAgICAgICAgICAgIGlmKHBhcnQgIT09ICcnKSB7XG4gICAgICAgICAgICAgICAgcyA9IHNbcGFydF07XG4gICAgICAgICAgICAgICAgaWYodHlwZW9mIHMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICByID0gcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICByID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYociA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAvLyBtdXN0IHJlc29sdmUgdGhpcyB0b29cbiAgICAgICAgICAgICAgdG9SZXNvbHZlLnB1c2goYSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgaWYgKGEucmVzb2x2ZUFzID09PSAnaW5saW5lJykge1xuICAgICAgICAgIGlmKGEua2V5ICYmIGEua2V5LmluZGV4T2YoJyMnKSA9PT0gLTEgJiYgYS5rZXkuY2hhckF0KDApICE9PSAnLycpIHtcbiAgICAgICAgICAgIC8vIGhhbmRsZSByZWxhdGl2ZSBzY2hlbWFcbiAgICAgICAgICAgIHBhcnRzID0gYS5yb290LnNwbGl0KCcvJyk7XG4gICAgICAgICAgICBsb2NhdGlvbiA9ICcnO1xuICAgICAgICAgICAgZm9yKGkgPSAwOyBpIDwgcGFydHMubGVuZ3RoIC0gMTsgaSsrKSB7XG4gICAgICAgICAgICAgIGxvY2F0aW9uICs9IHBhcnRzW2ldICsgJy8nO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbG9jYXRpb24gKz0gYS5rZXk7XG4gICAgICAgICAgICBhLnJvb3QgPSBsb2NhdGlvbjtcbiAgICAgICAgICAgIGEubG9jYXRpb24gPSAnJztcbiAgICAgICAgICB9XG4gICAgICAgICAgdG9SZXNvbHZlLnB1c2goYSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICB0b1Jlc29sdmUucHVzaChhKTtcbiAgICB9XG4gIH1cbiAgZXhwZWN0ZWRDYWxscyA9IHRvUmVzb2x2ZS5sZW5ndGg7XG5cbiAgLy8gcmVzb2x2ZSBhbnl0aGluZyB0aGF0IGlzIGxvY2FsXG4gIGZvcih2YXIgaWkgPSAwOyBpaSA8IHRvUmV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uICAgICAgICAgICAgICAgIGxvY2F0aW9uOiBpdGVtLmxvY2F0aW9uXG4gICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgaWYgKHByb2Nlc3NlZENhbGxzID09PSBleHBlY3RlZENhbGxzKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5maW5pc2goc3BlYywgX3Jvb3QsIHJlc29sdXRpb25UYWJsZSwgcmVzb2x2ZWRSZWZzLCB1bnJlc29sdmVkUmVmcywgY2FsbGJhY2spO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCAgLy8ganNoaW50IGlnbm9yZTpsaW5lXG4gICAgICAgICAgICByZXNwb25zZTogZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgIHZhciBzd2FnZ2VyID0gcmVzcG9uc2Uub2JqO1xuICAgICAgICAgICAgICBzZWxmLnJlc29sdmVJdGVtKHN3YWdnZXIsIGl0ZW0ucm9vdCwgcmVzb2x1dGlvblRhYmxlLCByZXNvbHZlZFJlZnMsIHVucmVzb2x2ZWRSZWZzLCBpdGVtKTtcbiAgICAgICAgICAgICAgcHJvY2Vzc2VkQ2FsbHMgKz0gMTtcblxuICAgICAgICAgICAgICBpZiAocHJvY2Vzc2VkQ2FsbHMgPT09IGV4cGVjdGVkQ2FsbHMpIHtcbiAgICAgICAgICAgICAgICBzZWxmLmZpbmlzaChzcGVjLCBfcm9vdCwgcmVzb2x1dGlvblRhYmxlLCByZXNvbHZlZFJlZnMsIHVucmVzb2x2ZWRSZWZzLCBjYWxsYmFjayk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IC8vIGpzaGludCBpZ25vcmU6bGluZVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChzY29wZSAmJiBzY29wZS5jbGllbnRBdXRob3JpemF0aW9ucykge1xuICAgICAgICAgIHNjb3BlLmNsaWVudEF1dGhvcml6YXRpb25zLmFwcGx5KG9iaik7XG4gICAgICAgIH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HZhciB1bnJlc29sdmVkS2V5cyA9IFtdO1xuICBmb3IoaSBpbiByZWZzKSB7XG4gICAgaWYoaS5pbmRleE9mKCcjJykgPT09IDApIHtcbiAgICAgIGtleXMucHVzaChpLnN1YnN0cmluZygxKSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgdW5yZXNvbHZlZEtleXMucHVzaChpKTtcbiAgICB9XG4gIH1cblxuICAvLyB2ZXJpZnkgcG9zc2libGUga2V5c1xuICBmb3IgKGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgIHZhciBwYXJ0ID0ga2V5c1tpXTtcbiAgICB2YXIgcGFydHMgPSBwYXJ0LnNwbGl0KCcvJyk7XG4gICAgdmFyIG9iaiA9IHNwZWM7XG5cbiAgICBmb3IgKHZhciBrID0gMDsgayA8IHBhcnRzLmxlbmd0aDsgaysrKSB7XG4gICAgICB2YXIga2V5ID0gcGFydHNba107XG4gICAgICBpZihrZXkgIT09ICcnKSB7XG4gICAgICAgIG9iaiA9IG9ialtrZXldO1xuICAgICAgICBpZih0eXBlb2Ygb2JqID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgIHVucmVzb2x2ZWRLZXlzLnB1c2gocGFydCk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgcmV0dXJuIHVucmVzb2x2ZWRLZXlzLmxlbmd0aDtcbn07XG5cblJlc29sdmVyLnByb3RvdHlwZS5nZXRSZWZzID0gZnVuY3Rpb24oc3BlYywgb2JqKSB7XG4gIG9iaiA9IG9iaiB8fCBzcGVjO1xuICB2YXIgb3V0cHV0ID0ge307XG4gIGZvcih2YXIga2V5IGluIG9iaikge1xuICAgIGlmICghb2JqLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgIGNvbnRpbnVlO1xuICAgIH1cbiAgICB2YXIgaXRlbSA9IG9ialtrZXldO1xuICAgIGlmKGtleSA9PT0gJyRyZWYnICYmI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lZi5zcGxpdCgnIycpO1xuICAgICAgICBwICA9IHJvb3Quc3BsaXQoJy8vJyk7XG4gICAgICAgIHAyID0gcFsxXS5zcGxpdCgnLycpO1xuICAgICAgICByb290ID0gcFswXSArICcvLycgKyBwMlswXSArIHJzWzBdO1xuICAgICAgICBsb2NhdGlvbiA9IHJzWzFdO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIHJzID0gcmVmLnNwbGl0KCcjJyk7XG4gICAgICAgIGlmKHJzWzBdICE9PSAnJykge1xuICAgICAgICAgIHAyID0gcm9vdC5zcGxpdCgnLycpO1xuICAgICAgICAgIHAyID0gcDIuc2xpY2UoMCwgcDIubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgaWYoIXJvb3RUcmltbWVkKSB7XG4gICAgICAgICAgICByb290ID0gJyc7XG4gICAgICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IHAyLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgIGlmKGsgPiAwKSB7IHJvb3QgKz0gJy8nOyB9XG4gICAgICAgICAgICAgIHJvb3QgKz0gcDJba107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJvb3QgKz0gJy8nICsgcmVmLnNwbGl0KCcjJylbMF07XG4gICAgICAgIH1cbiAgICAgICAgbG9jYXRpb24gPSByc1sxXTtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKHJlZi5pbmRleE9mKCdodHRwJykgPT09IDApIHtcbiAgICAgIGlmKHJlZi5pbmRleE9mKCcjJykgPj0gMCkge1xuICAgICAgICByb290ID0gcmVmLnNwbGl0KCcjJylbMF07XG4gICAgICAgIGxvY2F0aW9uID0gcmVmLnNwbGl0KCcjJylbMV07XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgcm9vdCA9IHJlZjtcbiAgICAgICAgbG9jYXRpb24gPSAnJztcbiAgICAgIH1cbiAgICAgIHJlc29sdXRpb25UYWJsZS5wdXNoKHtvYmo6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4gICAgICBpZihwYXJ0c1swXSAmJiByZWYuaW5kZXhPZignLycpID09PSAwKSB7XG5cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYocGFydHNbMF0gJiYgcGFydHNbMF0uaW5kZXhPZignaHR0cCcpID09PSAwKSB7XG4gICAgICAgIGxyb290ID0gcGFydHNbMF07XG4gICAgICAgIHJlZiA9IHBhcnRzWzFdO1xuICAgICAgfVxuICAgICAgZWxzZSBpZihwYXJ0c1swXSAmJiBwYXJ0c1swXS5sZW5ndGggPiAwKSB7XG4gICAgICAgIC8vIHJlbGF0aXZlIGZpbGVcbiAgICAgICAgc3AgPSByb290LnNwbGl0KCcvJyk7XG4gICAgICAgIGxyb290ID0gJyc7XG4gICAgICAgIGZvcihpID0gMDsgaSA8IHNwLmxlbmd0aCAtIDE7IGkrKykge1xuICAgICAgICAgIGxyb290ICs9IHNwW2ldICsgJy8nO1xuICAgICAgICB9XG4gICAgICAgIGxyb290ICs9IHBhcnRzWzBdO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG5cbiAgICAgIH1cblxuICAgICAgbG9jYXRpb24gPSBwYXJ0c1sxXTtcbiAgICB9XG4gICAgZWxzZSBpZiAocmVmLmluZGV4T2YoJ2h0dHA6Ly8nKSA9PT0gMCB8fCByZWYuaW5kZXhPZignaHR0cHM6Ly8nKSA9PT0gMCkge1xuICAgICAgbHJvb3QgPSByZWY7XG4gICAgICBsb2NhdGlvbiA9ICcnO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIC8vIHJlbGF0aXZlIGZpbGVcbiAgICAgIHNwID0gcm9vdC5zcGxpdCgnLycpO1xuICAgICAgbHJvb3QgPSAnJztcbiAgICAgIGZvcihpID0gMDsgaSA8IHNwLmxlbmd0aCAtIDE7IGkrKykge1xuICAgICAgICBscm9vdCArPSBzcFtpXSArICcvJztcbiAgICAgIH1cbiAgICAgIGxyb290ICs9IHJlZjtcbiAgICAgIGxvY2F0aW9uID0gJyc7XG4gICAgfVxuICAgIHJl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tcmVzb2x2ZWQtZnJvbSddO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IGFsbE9mLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgdmFyIGNvbXBvbmVudCA9IGFsbE9mW2ldO1xuICAgICAgICAgIHZhciBzb3VyY2UgPSAnc2VsZic7XG4gICAgICAgICAgaWYodHlwZW9mIGNvbXBvbmVudFsneC1yZXNvbHZlZC1mcm9tJ10gIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBzb3VyY2UgPSBjb21wb25lbnRbJ3gtcmVzb2x2ZWQtZnJvbSddWzBdO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGZvcih2YXIgcGFydCBpbiBjb21wb25lbnQpIHtcbiAgICAgICAgICAgIGlmKCFvdXRwdXQuaGFzT3duUHJvcGVydHkocGFydCkpIHtcbiAgICAgICAgICAgICAgb3V0cHV0W3BhcnRdID0gXy5jbG9uZURlZXAoY29tcG9uZW50W3BhcnRdKTtcbiAgICAgICAgICAgICAgaWYocGFydCA9PT0gJ3Byb3BlcnRpZXMnKSB7XG4gICAgICAgICAgICAgICAgZm9yKG5hbWUgaW4gb3V0cHV0W3BhcnRdKSB7XG4gICAgICAgICAgICAgICAgICBvdXRwdXRbcGFydF1bbmFtZV1bJ3gtcmVzb2x2ZWQtZnJvbSddID0gc291cmNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIGlmKHBhcnQgPT09ICdwcm9wZXJ0aWVzJykge1xuICAgICAgICAgICAgICAgIHZhciBwcm9wZXJ0aWVzID0gY29tcG9uZW50W3BhcnRdO1xuICAgICAgICAgICAgICAgIGZvcihuYW1lIGluIHByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgICAgICAgIG91dHB1dC5wcm9wZXJ0aWVzW25hbWVdID0gXy5jbG9uZURlZXAocHJvcGVydGllc1tuYW1lXSk7XG4gICAgICAgICAgICAgICAgICB2YXIgcmVzb2x2ZWRGcm9tID0gcHJvcGVydGllc1tuYW1lXVsneC1yZXNvbHZlZC1mcm9tJ107XG4gICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc29sdmVkRnJvbSA9PT0gJ3VuZGVmaW5lZCcgfHwgcmVzb2x2ZWRGcm9tID09PSAnc2VsZicpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZWRGcm9tID0gc291cmNlO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgb3V0cHV0LnByb3BlcnRpZXNbbmFtZV1bJ3gtcmVzb2x2ZWQtZnJvbSddID0gcmVzb2x2ZWRGcm9tO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIGlmKHBhcnQgPT09ICdyZXF1aXJlZCcpIHtcbiAgICAgICAgICAgICAgICAvLyBtZXJnZSAmIGRlZHVwIHRoZSByZXF1aXJlZCBhcnJheVxuICAgICAgICAgICAgICAgIHZhciBhID0gb3V0cHV0LnJlcXVpcmVkLmNvbmNhdChjb21wb25lbnRbcGFydF0pO1xuICAgICAgICAgICAgICAgIGZvcih2YXIgayA9IDA7IGsgPCBhLmxlbmd0aDsgKytrKSB7XG4gICAgICAgICAgICAgICAgICBmb3IodmFyIGogPSBrICsgMTsgaiA8IGEubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICAgICAgaWYoYVtrXSA9PT0gYVtqXSkgeyBhLnNwbGljZShqLS0sIDEpOyB9XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG91dHB1dC5yZXF1aXJlZCA9IGE7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSBpZihwYXJ0ID09PSAneC1yZXNvbHZlZC1mcm9tJykge1xuICAgICAgICAgICAgICAgIG91dHB1dFsneC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XJ0eS4kcmVmKV07XG5cbiAgICAgICAgICAgICAgaWYgKCFfLmlzVW5kZWZpbmVkKG1vZGVsKSAmJiBfLmluZGV4T2YoW3VuZGVmaW5lZCwgJ2FycmF5JywgJ29iamVjdCddLCBtb2RlbC5kZWZpbml0aW9uLnR5cGUpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIC8vIFVzZSByZWZlcmVuY2VkIHNjaGVtYVxuICAgICAgICAgICAgICAgIGNQcm9wZXJ0eSA9IEhlbHBlcnMucmVzb2x2ZVNjaGVtYShtb2RlbC5kZWZpbml0aW9uKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBodG1sICs9IHByaW1pdGl2ZVRvSFRNTChjUHJvcGVydHkpO1xuXG4gICAgICAgICAgICBpZighcHJvcGVydHlJc1JlcXVpcmVkKSB7XG4gICAgICAgICAgICAgIGh0bWwgKz0gJywgPHNwYW4gY2xhc3M9XCJwcm9wT3B0S2V5XCI+b3B0aW9uYWw8L3NwYW4+JztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYocHJvcGVydHkucmVhZE9ubHkpIHtcbiAgICAgICAgICAgICAgICBodG1sICs9ICcsIDxzcGFuIGNsYXNzPVwicHJvcFJlYWRPbmx5XCI+cmVhZCBvbmx5PC9zcGFuPic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGh0bWwgKz0gJyknO1xuXG4gICAgICAgICAgICBpZiAoIV8uaXNVbmRlZmluZWQocHJvcERlc2NyaXB0aW9uKSkge1xuICAgICAgICAgICAgICBodG1sICs9ICc6ICcgKyAnPHNwYW4gY2xhc3M9XCJwcm9wRGVzY1wiPicgKyBwcm9wRGVzY3JpcHRpb24gKyAnPC9zcGFuPic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjUHJvcGVydHkuZW51bSkge1xuICAgICAgICAgICAgICBodG1sICs9ICcgPSA8c3BhbiBjbGFzcz1cInByb3BWYWxz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ljaXQ7XG4gICAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24uZmxvdyA9ICdpbXBsaWNpdCc7XG4gICAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24uYXV0aG9yaXphdGlvblVybCA9IGltcGxpY2l0LmxvZ2luRW5kcG9pbnQ7XG4gICAgICAgICAgICBpc1ZhbGlkID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgLyoganNoaW50IGlnbm9yZTpzdGFydCAqL1xuICAgICAgICAgIGlmKGRlZmluaXRpb24uZ3JhbnRUeXBlc1snYXV0aG9yaXphdGlvbl9jb2RlJ10pIHtcbiAgICAgICAgICAgIGlmKCFzZWN1cml0eURlZmluaXRpb24uZmxvdykge1xuICAgICAgICAgICAgICAvLyBjYW5ub3Qgc2V0IGlmIGZsb3cgaXMgYWxyZWFkeSBkZWZpbmVkXG4gICAgICAgICAgICAgIHZhciBhdXRoQ29kZSA9IGRlZmluaXRpb24uZ3JhbnRUeXBlc1snYXV0aG9yaXphdGlvbl9jb2RlJ107XG4gICAgICAgICAgICAgIHNlY3VyaXR5RGVmaW5pdGlvbi5mbG93ID0gJ2FjY2Vzc0NvZGUnO1xuICAgICAgICAgICAgICBzZWN1cml0eURlZmluaXRpb24uYXV0aG9yaXphdGlvblVybCA9IGF1dGhDb2RlLnRva2VuUmVxdWVzdEVuZHBvaW50LnVybDtcbiAgICAgICAgICAgICAgc2VjdXJpdHlEZWZpbml0aW9uLnRva2VuVXJsID0gYXV0aENvZGUudG9rZW5FbmRwb2ludC51cmw7XG4gICAgICAgICAgICAgIGlzVmFsaWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICAvKiBqc2hpbnQgaWdub3JlOmVuZCAqL1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZihpc1ZhbGlkKSB7XG4gICAgICAgIHN3YWdnZXIuc2VjdXJpdHlEZWZpbml0aW9ucyA9IHN3YWdnZXIuc2VjdXJpdHl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VxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgc2Vjb25kQnl0ZSA9IGJ1ZltpICsgMV1cbiAgICAgICAgICBpZiAoKHNlY29uZEJ5dGUgJiAweEMwKSA9PT0gMHg4MCkge1xuICAgICAgICAgICAgdGVtcENvZGVQb2ludCA9IChmaXJzdEJ5dGUgJiAweDFGKSA8PCAweDYgfCAoc2Vjb25kQnl0ZSAmIDB4M0YpXG4gICAgICAgICAgICBpZiAodGVtcENvZGVQb2ludCA+IDB4N0YpIHtcbiAgICAgICAgICAgICAgY29kZVBvaW50ID0gdGVtcENvZGVQb2ludFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgc2Vjb25kQnl0ZSA9IGJ1ZltpICsgMV1cbiAgICAgICAgICB0aGlyZEJ5dGUgPSBidWZbaSArIDJdXG4gICAgICAgICAgaWYgKChzZWNvbmRCeXRlICYgMHhDMCkgPT09IDB4ODAgJiYgKHRoaXJkQnl0ZSAmIDB4QzApID09PSAweDgwKSB7XG4gICAgICAgICAgICB0ZW1wQ29kZVBvaW50ID0gKGZpcnN0Qnl0ZSAmIDB4RikgPDwgMHhDIHwgKHNlY29uZEJ5dGUgJiAweDNGKSA8PCAweDYgfCAodGhpcmRCeXRlICYgMHgzRilcbiAgICAgICAgICAgIGlmICh0ZW1wQ29kZVBvaW50ID4gMHg3RkYgJiYgKHRlbXBDb2RlUG9pbnQgPCAweEQ4MDAgfHwgdGVtcENvZGVQb2ludCA+IDB4REZGRikpIHtcbiAgICAgICAgICAgICAgY29kZVBvaW50ID0gdGVtcENvZGVQb2ludFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgc2Vjb25kQnl0ZSA9IGJ1ZltpICsgMV1cbiAgICAgICAgICB0aGlyZE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iB0b1N0cmluZygpIHtcbiAgICAgICAgdmFyIHN0ciA9IFt0aGlzLm5hbWUgKyBcIj1cIiArIHRoaXMudmFsdWVdO1xuICAgICAgICBpZiAodGhpcy5leHBpcmF0aW9uX2RhdGUgIT09IEluZmluaXR5KSB7XG4gICAgICAgICAgICBzdHIucHVzaChcImV4cGlyZXM9XCIgKyAobmV3IERhdGUodGhpcy5leHBpcmF0aW9uX2RhdGUpKS50b0dNVFN0cmluZygpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5kb21haW4pIHtcbiAgICAgICAgICAgIHN0ci5wdXNoKFwiZG9tYWluPVwiICsgdGhpcy5kb21haW4pO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLnBhdGgpIHtcbiAgICAgICAgICAgIHN0ci5wdXNoKFwicGF0aD1cIiArIHRoaXMucGF0aCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuc2VjdXJlKSB7XG4gICAgICAgICAgICBzdHIucHVzaChcInNlY3VyZVwiKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5ub3NjcmlwdCkge1xuICAgICAgICAgICAgc3RyLnB1c2goXCJodHRwb25seVwiKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3RyLmpvaW4oXCI7IFwiKTtcbiAgICB9O1xuXG4gICAgQ29va2llLnByb3RvdHlwZS50b1ZhbHVlU3RyaW5nID0gZnVuY3Rpb24gdG9WYWx1ZVN0cmluZygpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubmFtZSArIFwiPVwiICsgdGhpcy52YWx1ZTtcbiAgICB9O1xuXG4gICAgdmFyIGNvb2tpZV9zdHJfc3BsaXR0ZXIgPSAvWzpdKD89XFxzKlthLXpBLVowLTlfXFwtXStcXHMqWz1dKS9nO1xuICAgIENvb2tpZS5wcm90b3R5cGUucGFyc2UgPSBmdW5jdGlvbiBwYXJzZShzdHIsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpIHtcbiAgICAgICAgaWYgKHRoaXMgaW5zdGFuY2VvZiBDb29raWUpIHtcbiAgICAgICAgICAgIHZhciBwYXJ0cyA9IHN0ci5zcGxpdChcIjtcIikuZmlsdGVyKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gISF2YWx1ZTtcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICBwYWlyID0gcGFydHNbMF0ubWF0Y2goLyhbXj1dKyk9KFtcXHNcXFNdKikvKSxcbiAgICAgICAgICAgICAgICBrZXkgPSBwYWlyWzFdLFxuICAgICAgICAgICAgICAgIHZhbHVlID0gcGFpclsyXSxcbiAgICAgICAgICAgICAgICBpO1xuICAgICAgICAgICAgdGhpcy5uYW1lID0ga2V5O1xuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IHZhbHVlO1xuXG4gICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgcGFydHMubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICAgICAgICBwYWlyID0gcGFydHNbaV0ubWF0Y2goLyhbXj1dKykoPzo9KFtcXHNcXFNdKikpPy8pO1xuICAgICAgICAgICAgICAgIGtleSA9IHBhaXJbMV0udHJpbSgpLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBwYWlyWzJdO1xuICAgICAgICAgICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICAgICAgY2FzZSBcImh0dHBvbmx5XCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubm9zY3JpcHQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwiZXhwaXJlc1wiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLmV4cGlyYXRpb25fZGF0ZSA9IHZhbHVlID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBOdW1iZXIoRGF0ZS5wYXJzZSh2YWx1ZSkpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbmZpbml0eTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBcInBhdGhcIjpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoID0gdmFsdWUgP1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnRyaW0oKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5leHBsaWNpdF9wYXRoID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBcImRvbWFpblwiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRvbWFpbiA9IHZhbHVlID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS50cmltKCkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZXhwbGljaXRfZG9tYWluID0gISF0aGlzLmRvbWFpbjtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBcInNlY3VyZVwiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNlY3VyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF0aGlzLmV4cGxpY2l0X3BhdGgpIHtcbiAgICAgICAgICAgICAgIHRoaXMucGF0aCA9IHJlcXVlc3RfcGF0aCB8fCBcIi9cIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghdGhpcy5leHBsaWNpdF9kb21haW4pIHtcbiAgICAgICAgICAgICAgIHRoaXMuZG9tYWluID0gcmVxdWVzdF9kb21haW47XG4gICAgICAgICAgICB9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iAgICAgICAgdmFyIGFjY2Vzc19kb21haW4gPSBhY2Nlc3NfaW5mby5kb21haW4gJiYgYWNjZXNzX2luZm8uZG9tYWluLnJlcGxhY2UoL15bXFwuXS8sJycpO1xuICAgICAgICB2YXIgY29va2llX2RvbWFpbiA9IHRoaXMuZG9tYWluICYmIHRoaXMuZG9tYWluLnJlcGxhY2UoL15bXFwuXS8sJycpO1xuICAgICAgICBpZiAoY29va2llX2RvbWFpbiA9PT0gYWNjZXNzX2RvbWFpbikge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb2tpZV9kb21haW4pIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5leHBsaWNpdF9kb21haW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7IC8vIHdlIGFscmVhZHkgY2hlY2tlZCBpZiB0aGUgZG9tYWlucyB3ZXJlIGV4YWN0bHkgdGhlIHNhbWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB3aWxkY2FyZCA9IGFjY2Vzc19kb21haW4uaW5kZXhPZihjb29raWVfZG9tYWluKTtcbiAgICAgICAgICAgIGlmICh3aWxkY2FyZCA9PT0gLTEgfHwgd2lsZGNhcmQgIT09IGFjY2Vzc19kb21haW4ubGVuZ3RoIC0gY29va2llX2RvbWFpbi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gQ29va2llSmFyKCkge1xuICAgICAgICB2YXIgY29va2llcywgY29va2llc19saXN0LCBjb2xsaWRhYmxlX2Nvb2tpZTtcbiAgICAgICAgaWYgKHRoaXMgaW5zdGFuY2VvZiBDb29raWVKYXIpIHtcbiAgICAgICAgICAgIGNvb2tpZXMgPSBPYmplY3QuY3JlYXRlKG51bGwpOyAvL25hbWU6IFtDb29raWVdXG5cbiAgICAgICAgICAgIHRoaXMuc2V0Q29va2llID0gZnVuY3Rpb24gc2V0Q29va2llKGNvb2tpZSwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciByZW1vdmUsIGk7XG4gICAgICAgICAgICAgICAgY29va2llID0gbmV3IENvb2tpZShjb29raWUsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpO1xuICAgICAgICAgICAgICAgIC8vRGVsZXRlIHRoZSBjb29raWUgaWYgdGhlIHNldCBpcyBwYXN0IHRoZSBjdXJyZW50IHRpbWVcbiAgICAgICAgICAgICAgICByZW1vdmUgPSBjb29raWUuZXhwaXJhdGlvbl9kYXRlIDw9IERhdGUubm93KCk7XG4gICAgICAgICAgICAgICAgaWYgKGNvb2tpZXNbY29va2llLm5hbWVdICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29va2llc19saXN0ID0gY29va2llc1tjb29raWUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb29raWVzX2xpc3QubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbGxpZGFibGVfY29va2llID0gY29va2llc19saXN0W2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbGxpZGFibGVfY29va2llLmNvbGxpZGVzV2l0aChjb29raWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbW92ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWVzX2xpc3Quc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llc19saXN0Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvb2tpZXNbY29va2llLm5hbWVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llc19saXN0W2ldID0gY29va2llO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb29raWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlbW92ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvb2tpZXNfbGlzdC5wdXNoKGNvb2tpZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjb29raWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChyZW1vdmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb29raWVzW2Nvb2tpZS5uYW1lXSA9IFtjb29raWVdO1xuICAgICAgICAgICAgICAgIHJldHVybiBjb29raWVzW2Nvb2tpZS5uYW1lXTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICAvL3JldHVybnMgYSBjb29raWVcbiAgICAgICAgICAgIHRoaXMuZ2V0Q29va2llID0gZnVuY3Rpb24gZ2V0Q29va2llKGNvb2tpZV9uYW1lLCBhY2Nlc3NfaW5mbykge1xuICAgICAgICAgICAgICAgIHZhciBjb29raWUsIGk7XG4gICAgICAgICAgICAgICAgY29va2llc19saXN0ID0gY29va2llc1tjb29raWVfbmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKCFjb29raWVzX2xpc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29va2llc19saXN0Lmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvb2tpZSA9IGNvb2tpZXNfbGlzdFtpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZS5leHBpcmF0aW9uX2RhdGUgPD0gRGF0ZS5ub3coKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZXNfbGlzdC5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29va2llc1tjb29raWUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUubWF0Y2hlcyhhY2Nlc3NfaW5mbykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb29raWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy9yZXR1cm5zIGEgbGlzdCBvZiBjb29raWVzXG4gICAgICAgICAgICB0aGlzLmdldENvb2tpZXMgPSBmdW5jdGlvbiBnZXRDb29raWVzKGFjY2Vzc19pbmZvKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoZXMgPSBbXSwgY29va2llX25hbWUsIGNvb2tpZTtcbiAgICAgICAgICAgICAgICBmb3IgKGNvb2tpZV9uYW1lIGluIGNvb2tpZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29va2llID0gdGhpcy5nZXRDb29raWUoY29va2llX25hbWUsIGFjY2Vzc19pbmZvKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hlcy5wdXNoKGNvb2tpZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbWF0Y2hlcy50b1N0cmluZyA9IGZ1bmN0aW9uIHRvU3RyaW5nKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hlcy5qb2luKFwiOlwiKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG1hdGNoZXMudG9WYWx1ZVN0cmluZyA9IGZ1bmN0aW9uIHRvVmFsdWVTdHJpbmcoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaGVzLm1hcChmdW5jdGlvbiAoYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGMudG9WYWx1ZVN0cmluZygpO1xuICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCc7Jyk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hlcztcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXcgQ29va2llSmFyKCk7XG4gICAgfVxuICAgIGV4cG9ydHMuQ29va2llSmFyID0gQ29va2llSmFyO1xuXG4gICAgLy9yZXR1cm5zIGxpc3Qgb2YgY29va2llcyB0aGF0IHdlcmUgc2V0IGNvcnJlY3RseS4gQ29va2llcyB0aGF0IGFyZSBleHBpcmVkIGFuZCByZW1vdmVkIGFyZSBub3QgcmV0dXJuZWQuXG4gICAgQ29va2llSmFyLnByb3RvdHlwZS5zZXRDb29raWVzID0gZnVuY3Rpb24gc2V0Q29va2llcyhjb29raWVzLCByZXF1ZXN0X2RvbWFpbiwgcmVxdWVzdF9wYXRoKSB7XG4gICAgICAgIGNvb2tpZXMgPSBBcnJheS5pc0FycmF5KGNvb2tpZXMpID9cbiAgICAgIC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lLmtpbmQsXG4gICAgICBfcmVzdWx0ID0gc3RhdGUucmVzdWx0LFxuICAgICAgY2g7XG5cbiAgY2ggPSBzdGF0ZS5pbnB1dC5jaGFyQ29kZUF0KHN0YXRlLnBvc2l0aW9uKTtcblxuICBpZiAoaXNfV1NfT1JfRU9MKGNoKSAgICAgICAgICAgICB8fFxuICAgICAgaXNfRkxPV19JTkRJQ0FUT1IoY2gpICAgICAgICB8fFxuICAgICAgMHgyMy8qICMgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyNi8qICYgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyQS8qICogKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyMS8qICEgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHg3Qy8qIHwgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgzRS8qID4gKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyNy8qICcgKi8gICAgICAgICAgID09PSBjaCB8fFxuICAgICAgMHgyMi8qIFwiICovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4MjUvKiAlICovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4NDAvKiBAICovICAgICAgICAgICA9PT0gY2ggfHxcbiAgICAgIDB4NjAvKiBgICovICAgICAgICAgICA9PT0gY2gpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBpZiAoMHgzRi8qID8gKi8gPT09IGNoIHx8IDB4MkQvKiAtICovID09PSBjaCkge1xuICAgIGZvbGxvd2luZyA9IHN0YXRlLmlucHV0LmNoYXJDb2RlQXQoc3RhdGUucG9zaXRpb24gKyAxKTtcblxuICAgIGlmIChpc19XU19PUl9FT0woZm9sbG93aW5nKSB8fFxuICAgICAgICB3aXRoaW5GbG93Q29sbGVjdGlvbiAmJiBpc19GTE9XX0lORElDQVRPUihmb2xsb3dpbmcpKSB7XG4gICAgICByZXR1cm4gZmFs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G4gICAgICBoYXNEaWdpdHMgPSBmYWxzZSxcbiAgICAgIGNoO1xuXG4gIGlmICghbWF4KSB7IHJldHVybiBmYWxzZTsgfVxuXG4gIGNoID0gZGF0YVtpbmRleF07XG5cbiAgLy8gc2lnblxuICBpZiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnKSB7XG4gICAgY2ggPSBkYXRhWysraW5kZXhdO1xuICB9XG5cbiAgaWYgKGNoID09PSAnMCcpIHtcbiAgICAvLyAwXG4gICAgaWYgKGluZGV4ICsgMSA9PT0gbWF4KSB7IHJldHVybiB0cnVlOyB9XG4gICAgY2ggPSBkYXRhWysraW5kZXhdO1xuXG4gICAgLy8gYmFzZSAyLCBiYXNlIDgsIGJhc2UgMTZcblxuICAgIGlmIChjaCA9PT0gJ2InKSB7XG4gICAgICAvLyBiYXNlIDJcbiAgICAgIGluZGV4Kys7XG5cbiAgICAgIGZvciAoOyBpbmRleCA8IG1heDsgaW5kZXgrKykge1xuICAgICAgICBjaCA9IGRhdGFbaW5kZXhdO1xuICAgICAgICBpZiAoY2ggPT09ICdfJykgeyBjb250aW51ZTsgfVxuICAgICAgICBpZiAoY2ggIT09ICcwJyAmJiBjaCAhPT0gJzEnKSB7XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGhhc0RpZ2l0cyA9IHRydWU7XG4gICAgICB9XG4gICAgICByZXR1cm4gaGFzRGlnaXRzO1xuICAgIH1cblxuXG4gICAgaWYgKGNoID09PSAneCcpIHtcbiAgICAgIC8vIGJhc2UgMTZcbiAgICAgIGluZGV4Kys7XG5cbiAgICAgIGZvciAoOyBpbmRleCA8IG1heDsgaW5kZXgrKykge1xuICAgICAgICBjaCA9IGRhdGFbaW5kZXhdO1xuICAgICAgICBpZiAoY2ggPT09ICdfJykgeyBjb250aW51ZTsgfVxuICAgICAgICBpZiAoIWlzSGV4Q29kZShkYXRhLmNoYXJDb2RlQXQoaW5kZXgpKSkge1xuICAgICAgICAg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FxuICAgICAgICBhc3QgICAgPSBlc3ByaW1hLnBhcnNlKHNvdXJjZSwgeyByYW5nZTogdHJ1ZSB9KTtcblxuICAgIGlmICgnUHJvZ3JhbScgICAgICAgICAgICAgIT09IGFzdC50eXBlICAgICAgICAgfHxcbiAgICAgICAgMSAgICAgICAgICAgICAgICAgICAgICE9PSBhc3QuYm9keS5sZW5ndGggIHx8XG4gICAgICAgICdFeHByZXNzaW9uU3RhdGVtZW50JyAhPT0gYXN0LmJvZHlbMF0udHlwZSB8fFxuICAgICAgICAnRnVuY3Rpb25FeHByZXNzaW9uJyAgIT09IGFzdC5ib2R5WzBdLmV4cHJlc3Npb24udHlwZSkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIHJldHVybiB0cnVlO1xuICB9IGNhdGNoIChlcnIpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbn1cblxuZnVuY3Rpb24gY29uc3RydWN0SmF2YXNjcmlwdEZ1bmN0aW9uKGRhdGEpIHtcbiAgLypqc2xpbnQgZXZpbDp0cnVlKi9cblxuICB2YXIgc291cmNlID0gJygnICsgZGF0YSArICcpJyxcbiAgICAgIGFzdCAgICA9IGVzcHJpbWEucGFyc2Uoc291cmNlLCB7IHJhbmdlOiB0cnVlIH0pLFxuICAgICAgcGFyYW1zID0gW10sXG4gICAgICBib2R5O1xuXG4gIGlmICgnUHJvZ3JhbScgICAgICAgICAgICAgIT09IGFzdC50eXBlICAgICAgICAgfHxcbiAgICAgIDEgICAgICAgICAgICAgICAgICAgICAhPT0gYXN0LmJvZHkubGVuZ3RoICB8fFxuICAgICAgJ0V4cHJlc3Npb25TdGF0ZW1lbnQnICE9PSBhc3QuYm9keVswXS50eXBlIHx8XG4gICAgICAnRnVuY3Rpb25FeHByZXNzaW9uJyAgIT09IGFzdC5ib2R5WzBdLmV4cHJlc3Npb24udHlwZSkge1xuICAgIHRocm93IG5ldyBFcnJvcignRmFpbGVkIHRvIHJlc29sdmUgZnVuY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ciwgcGFpcktleSwgcGFpckhhc0tleSxcbiAgICAgIG9iamVjdCA9IGRhdGE7XG5cbiAgZm9yIChpbmRleCA9IDAsIGxlbmd0aCA9IG9iamVjdC5sZW5ndGg7IGluZGV4IDwgbGVuZ3RoOyBpbmRleCArPSAxKSB7XG4gICAgcGFpciA9IG9iamVjdFtpbmRleF07XG4gICAgcGFpckhhc0tleSA9IGZhbHNlO1xuXG4gICAgaWYgKCdbb2JqZWN0IE9iamVjdF0nICE9PSBfdG9TdHJpbmcuY2FsbChwYWlyKSkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGZvciAocGFpcktleSBpbiBwYWlyKSB7XG4gICAgICBpZiAoX2hhc093blByb3BlcnR5LmNhbGwocGFpciwgcGFpcktleSkpIHtcbiAgICAgICAgaWYgKCFwYWlySGFzS2V5KSB7XG4gICAgICAgICAgcGFpckhhc0tleSA9IHRydWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKCFwYWlySGFzS2V5KSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgaWYgKC0xID09PSBvYmplY3RLZXlzLmluZGV4T2YocGFpcktleSkpIHtcbiAgICAgIG9iamVjdEtleXMucHVzaChwYWlyS2V5KTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufVxuXG5mdW5jdGlvbiBjb25zdHJ1Y3RZYW1sT21hcChkYXRhKSB7XG4gIHJldHVybiBudWxsICE9PSBkYXRhID8gZGF0YSA6IFtdO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IG5ldyBUeXBlKCd0YWc6eWFtbC5vcmcsMjAwMjpvbWFwJywge1xuICBraW5kOiAnc2VxdWVuY2UnLFxuICByZXNvbHZlOiByZXNvbHZl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SBtb250aFxuICAnLShbMC05XVswLTldPyknICAgICAgICAgICAgICAgICAgICsgLy8gWzNdIGRheVxuICAnKD86KD86W1R0XXxbIFxcXFx0XSspJyAgICAgICAgICAgICAgKyAvLyAuLi5cbiAgJyhbMC05XVswLTldPyknICAgICAgICAgICAgICAgICAgICArIC8vIFs0XSBob3VyXG4gICc6KFswLTldWzAtOV0pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNV0gbWludXRlXG4gICc6KFswLTldWzAtOV0pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNl0gc2Vjb25kXG4gICcoPzpcXFxcLihbMC05XSopKT8nICAgICAgICAgICAgICAgICArIC8vIFs3XSBmcmFjdGlvblxuICAnKD86WyBcXFxcdF0qKFp8KFstK10pKFswLTldWzAtOV0/KScgKyAvLyBbOF0gdHogWzldIHR6X3NpZ24gWzEwXSB0el9ob3VyXG4gICcoPzo6KFswLTldWzAtOV0pKT8pKT8pPyQnKTsgICAgICAgICAvLyBbMTFdIHR6X21pbnV0ZVxuXG5mdW5jdGlvbiByZXNvbHZlWWFtbFRpbWVzdGFtcChkYXRhKSB7XG4gIGlmIChudWxsID09PSBkYXRhKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgaWYgKFlBTUxfVElNRVNUQU1QX1JFR0VYUC5leGVjKGRhdGEpID09PSBudWxsKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgcmV0dXJuIHRydWU7XG59XG5cbmZ1bmN0aW9uIGNvbnN0cnVjdFlhbWxUaW1lc3RhbXAoZGF0YSkge1xuICB2YXIgbWF0Y2gsIHllYXIsIG1vbnRoLCBkYXksIGhvdXIsIG1pbnV0ZSwgc2Vjb25kLCBmcmFjdGlvbiA9IDAsXG4gICAgICBkZWx0YSA9IG51bGwsIHR6X2hvdXIsIHR6X21pbnV0ZSwgZGF0ZTtcblxuICBtYXRjaCA9IFlBTUxfVElNRVNUQU1QX1JFR0VYUC5leGVjKGRhdG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cblxuICAgIHZhciBUb2tlbixcbiAgICAgICAgVG9rZW5OYW1lLFxuICAgICAgICBGbkV4cHJUb2tlbnMsXG4gICAgICAgIFN5bnRheCxcbiAgICAgICAgUGxhY2VIb2xkZXJzLFxuICAgICAgICBNZXNzYWdlcyxcbiAgICAgICAgUmVnZXgsXG4gICAgICAgIHNvdXJjZSxcbiAgICAgICAgc3RyaWN0LFxuICAgICAgICBpbmRleCxcbiAgICAgICAgbGluZU51bWJlcixcbiAgICAgICAgbGluZVN0YXJ0LFxuICAgICAgICBoYXNMaW5lVGVybWluYXRvcixcbiAgICAgICAgbGFzdEluZGV4LFxuICAgICAgICBsYXN0TGluZU51bWJlcixcbiAgICAgICAgbGFzdExpbmVTdGFydCxcbiAgICAgICAgc3RhcnRJbmRleCxcbiAgICAgICAgc3RhcnRMaW5lTnVtYmVyLFxuICAgICAgICBzdGFydExpbmVTdGFydCxcbiAgICAgICAgc2Nhbm5pbmcsXG4gICAgICAgIGxlbmd0aCxcbiAgICAgICAgbG9va2FoZWFkLFxuICAgICAgICBzdGF0ZSxcbiAgICAgICAgZXh0cmEsXG4gICAgICAgIGlzQmluZGluZ0VsZW1lbnQsXG4gICAgICAgIGlzQXNzaWdubWVudFRhcmdldCxcbiAgICAgICAgZmlyc3RDb3ZlckluaXRpYWxpemVkTmFtZUVycm9yO1xuXG4gICAgVG9rZW4gPSB7XG4gICAgICAgIEJvb2xlYW5MaXRlcmFsOiAxLFxuICAgICAgICBFT0Y6IDIsXG4gICAgICAgIElkZW50aWZpZXI6IDMsXG4gICAgICAgIEtleXdvcmQ6IDQsXG4gICAgICAgIE51bGxMaXRlcmFsOiA1LFxuICAgICAgICBOdW1lcmljTGl0ZXJhbDogNixcbiAgICAgICAgUHVuY3R1YXRvcjogNyxcbiAgICAgICAgU3RyaW5nTGl0ZXJhbDogOCxcbiAgICAgICAgUmVndWxhckV4cHJlc3Npb246IDksXG4gICAgICAgIFRlbXBsYXRlOiAxMFxuICAgIH07XG5cbiAgIC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0nLFxuICAgICAgICAgICAgICAgICAgICAnJj0nLCAnfD0nLCAnXj0nLCAnLCcsXG4gICAgICAgICAgICAgICAgICAgIC8vIGJpbmFyeS91bmFyeSBvcGVyYXRvcnNcbiAgICAgICAgICAgICAgICAgICAgJysnLCAnLScsICcqJywgJy8nLCAnJScsICcrKycsICctLScsICc8PCcsICc+PicsICc+Pj4nLCAnJicsXG4gICAgICAgICAgICAgICAgICAgICd8JywgJ14nLCAnIScsICd+JywgJyYmJywgJ3x8JywgJz8nLCAnOicsICc9PT0nLCAnPT0nLCAnPj0nLFxuICAgICAgICAgICAgICAgICAgICAnPD0nLCAnPCcsICc+JywgJyE9JywgJyE9PSddO1xuXG4gICAgU3ludGF4ID0ge1xuICAgICAgICBBc3NpZ25tZW50RXhwcmVzc2lvbjogJ0Fzc2lnbm1lbnRFeHByZXNzaW9uJyxcbiAgICAgICAgQXNzaWdubWVudFBhdHRlcm46ICdBc3NpZ25tZW50UGF0dGVybicsXG4gICAgICAgIEFycmF5RXhwcmVzc2lvbjogJ0FycmF5RXhwcmVzc2lvbicsXG4gICAgICAgIEFycmF5UGF0dGVybjogJ0FycmF5UGF0dGVybicsXG4gICAgICAgIEFycm93RnVuY3Rpb25FeHByZXNzaW9uOiAnQXJyb3dGdW5jdGlvbkV4cHJlc3Npb24nLFxuICAgICAgICBCbG9ja1N0YXRlbWVudDogJ0Jsb2NrU3RhdGVtZW50JyxcbiAgICAgICAgQmluYXJ5RXhwcmVzc2lvbjogJ0JpbmFyeUV4cHJlc3Npb24nLFxuICAgICAgICBCcmVha1N0YXRlbWVudDogJ0JyZWFrU3RhdGVtZW50JyxcbiAgICAgICAgQ2FsbEV4cHJlc3Npb246ICdDYWxsRXhwcmVzc2lvbicsXG4gICAgICAgIENhdGNoQ2xhdXNlOiAnQ2F0Y2hDbGF1c2UnLFxuICAgICAgICBDbGFzc0JvZHk6ICdDbGFzc0JvZHknLFxuICAgICAgICBDbGFzc0RlY2xhcmF0aW9uOiAnQ2xh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EMS1cXHVERkQ1XXxcXHVEODAxW1xcdURDMDAtXFx1REM5RFxcdUREMDAtXFx1REQyN1xcdUREMzAtXFx1REQ2M1xcdURFMDAtXFx1REYzNlxcdURGNDAtXFx1REY1NVxcdURGNjAtXFx1REY2N118XFx1RDgwMltcXHVEQzAwLVxcdURDMDVcXHVEQzA4XFx1REMwQS1cXHVEQzM1XFx1REMzN1xcdURDMzhcXHVEQzNDXFx1REMzRi1cXHVEQzU1XFx1REM2MC1cXHVEQzc2XFx1REM4MC1cXHVEQzlFXFx1REQwMC1cXHVERDE1XFx1REQyMC1cXHVERDM5XFx1REQ4MC1cXHVEREI3XFx1RERCRVxcdUREQkZcXHVERTAwXFx1REUxMC1cXHVERTEzXFx1REUxNS1cXHVERTE3XFx1REUxOS1cXHVERTMzXFx1REU2MC1cXHVERTdDXFx1REU4MC1cXHVERTlDXFx1REVDMC1cXHVERUM3XFx1REVDOS1cXHVERUU0XFx1REYwMC1cXHVERjM1XFx1REY0MC1cXHVERjU1XFx1REY2MC1cXHVERjcyXFx1REY4MC1cXHVERjkxXXxcXHVEODAzW1xcdURDMDAtXFx1REM0OF18XFx1RDgwNFtcXHVEQzAzLVxcdURDMzdcXHVEQzgzLVxcdURDQUZcXHVEQ0QwLVxcdURDRThcXHVERDAzLVxcdUREMjZcXHVERDUwLVxcdURENzJcXHVERDc2XFx1REQ4My1cXHVEREIyXFx1RERDMS1cXHVEREM0XFx1REREQVxcdURFMDAtXFx1REUxMVxcdURFMTMtXFx1REUyQlxcdURFQjAtXFx1REVERVxcdURGMDUtXFx1REYwQ1xcdURGMEZcXHVERjEwXFx1REYxMy1cXHVERjI4XFx1REYyQS1cXHVERjMwXFx1REYzMlxcdURGMzNcXHVERjM1LVxcdURGMzlcXHVERjNEXFx1REY1RC1cXHVERjYxXXxcXHVEODA1W1xcdURDODAtXFx1RENBRlxcdURDQzRcXHVEQ0M1XFx1RENDN1xcdUREODAtXFx1RERBRVxcdURFMDAtXFx1REUyRlxcdURFND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0ItXFx1REQzRVxcdURENDAtXFx1REQ0NFxcdURENDZcXHVERDRBLVxcdURENTBcXHVERDUyLVxcdURFQTVcXHVERUE4LVxcdURFQzBcXHVERUMyLVxcdURFREFcXHVERURDLVxcdURFRkFcXHVERUZDLVxcdURGMTRcXHVERjE2LVxcdURGMzRcXHVERjM2LVxcdURGNEVcXHVERjUwLVxcdURGNkVcXHVERjcwLVxcdURGODhcXHVERjhBLVxcdURGQThcXHVERkFBLVxcdURGQzJcXHVERkM0LVxcdURGQ0JcXHVERkNFLVxcdURGRkZdfFxcdUQ4M0FbXFx1REMwMC1cXHVEQ0M0XFx1RENEMC1cXHVEQ0Q2XXxcXHVEODNCW1xcdURFMDAtXFx1REUwM1xcdURFMDUtXFx1REUxRlxcdURFMjFcXHVERTIyXFx1REUyNFxcdURFMjdcXHVERTI5LVxcdURFMzJcXHVERTM0LVxcdURFMzdcXHVERTM5XFx1REUzQlxcdURFNDJcXHVERTQ3XFx1REU0OVxcdURFNEJcXHVERTRELVxcdURFNEZcXHVERTUxXFx1REU1MlxcdURFNTRcXHVERTU3XFx1REU1OVxcdURFNUJcXHVERTVEXFx1REU1RlxcdURFNjFcXHVERTYyXFx1REU2NFxcdURFNjctXFx1REU2QVxcdURFNkMtXFx1REU3MlxcdURFNzQtXFx1REU3N1xcdURFNzktXFx1REU3Q1xcdURFN0VcXHVERTgwLVxcdURFODlcXHVERThCLVxcdURFOUJcXHVERUExLVxcdURFQTNcXHVERUE1LVxcdURFQTlcXHVERUFCLVxcdURFQkJdfFxcdUQ4NjlbXFx1REMwMC1cXHVERUQ2XFx1REYwMC1cXHVERkZGXXxcXHVEODZEW1xcdURDMDAtXFx1REYzNFxcdURGNDAtXFx1REZGRl18XFx1RDg2RVtcXHVEQzAwLVxcdURDMURdfFxcdUQ4N0VbXFx1REMwMC1cXHVERTFEXXxcXHVEQjQwW1xcdUREMDAtXFx1RERFRl0vXG4gICAgfTtcblxuICAgIC8vIEVuc3VyZSB0aGUgY29uZGl0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mNlXG4gICAgICAgIHZhciBvY3RhbCA9IChjaCAhPT0gJzAnKSwgY29kZSA9ICcwMTIzNDU2NycuaW5kZXhPZihjaCk7XG5cbiAgICAgICAgaWYgKGluZGV4IDwgbGVuZ3RoICYmIGlzT2N0YWxEaWdpdChzb3VyY2VbaW5kZXhdKSkge1xuICAgICAgICAgICAgb2N0YWwgPSB0cnVlO1xuICAgICAgICAgICAgY29kZSA9IGNvZGUgKiA4ICsgJzAxMjM0NTY3Jy5pbmRleE9mKHNvdXJjZVtpbmRleCsrXSk7XG5cbiAgICAgICAgICAgIC8vIDMgZGlnaXRzIGFyZSBvbmx5IGFsbG93ZWQgd2hlbiBzdHJpbmcgc3RhcnRzXG4gICAgICAgICAgICAvLyB3aXRoIDAsIDEsIDIsIDNcbiAgICAgICAgICAgIGlmICgnMDEyMycuaW5kZXhPZihjaCkgPj0gMCAmJlxuICAgICAgICAgICAgICAgICAgICBpbmRleCA8IGxlbmd0aCAmJlxuICAgICAgICAgICAgICAgICAgICBpc09jdGFsRGlnaXQoc291cmNlW2luZGV4XSkpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZSAqIDggKyAnMDEyMzQ1NjcnLmluZGV4T2Yoc291cmNlW2luZGV4KytdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBjb2RlOiBjb2RlLFxuICAgICAgICAgICAgb2N0YWw6IG9jdGFsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTEuMiBXaGl0ZSBTcGFjZVxuXG4gICAgZnVuY3Rpb24gaXNXaGl0ZVNwYWNlKGNoKSB7XG4gICAgICAgIHJldHVybiAoY2ggPT09IDB4MjApIHx8IChjaCA9PT0gMHgwOSkgfHwgKGNoID09PSAweDBCKSB8fCAoY2ggPT09IDB4MEMpIHx8IChjaCA9PT0gMHhBMCkgfHxcbiAgICAgICAgICAgIChjaCA+PSAweDE2ODAg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ggPj0gMHg2MSAmJiBjaCA8PSAweDdBKSB8fCAgICAgICAgIC8vIGEuLnpcbiAgICAgICAgICAgIChjaCA9PT0gMHg1QykgfHwgICAgICAgICAgICAgICAgICAgICAgLy8gXFwgKGJhY2tzbGFzaClcbiAgICAgICAgICAgICgoY2ggPj0gMHg4MCkgJiYgUmVnZXguTm9uQXNjaWlJZGVudGlmaWVyU3RhcnQudGVzdChmcm9tQ29kZVBvaW50KGNoKSkpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzSWRlbnRpZmllclBhcnQoY2gpIHtcbiAgICAgICAgcmV0dXJuIChjaCA9PT0gMHgyNCkgfHwgKGNoID09PSAweDVGKSB8fCAgLy8gJCAoZG9sbGFyKSBhbmQgXyAodW5kZXJzY29yZSlcbiAgICAgICAgICAgIChjaCA+PSAweDQxICYmIGNoIDw9IDB4NUEpIHx8ICAgICAgICAgLy8gQS4uWlxuICAgICAgICAgICAgKGNoID49IDB4NjEgJiYgY2ggPD0gMHg3QSkgfHwgICAgICAgICAvLyBhLi56XG4gICAgICAgICAgICAoY2ggPj0gMHgzMCAmJiBjaCA8PSAweDM5KSB8fCAgICAgICAgIC8vIDAuLjlcbiAgICAgICAgICAgIChjaCA9PT0gMHg1QykgfHwgICAgICAgICAgICAgICAgICAgICAgLy8gXFwgKGJhY2tzbGFzaClcbiAgICAgICAgICAgICgoY2ggPj0gMHg4MCkgJiYgUmVnZXguTm9uQXNjaWlJZGVudGlmaWVyUGFydC50ZXN0KGZyb21Db2RlUG9pbnQoY2gpKSk7XG4gICAgfVxuXG4gICAgLy8gRUNNQS0yNjIgMTEuNi4yLjIgRnV0dXJlIFJlc2VydmVkIFdvcmRzXG5cbiAgICBmdW5jdGlvbiBpc0Z1dHVyZVJlc2VydmVkV29yZChpZCkge1xuICAgICAgICBzd2l0Y2ggKGlkKSB7XG4gICAgICAgIGNhc2UgJ2VudW0nOlxuICAgICAgICBjYXNlICdleHBvcnQnOlxuICAgICAgICBjYXNlICdpb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lkID09PSAnZGVidWdnZXInKTtcbiAgICAgICAgY2FzZSAxMDpcbiAgICAgICAgICAgIHJldHVybiAoaWQgPT09ICdpbnN0YW5jZW9mJyk7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMS40IENvbW1lbnRzXG5cbiAgICBmdW5jdGlvbiBhZGRDb21tZW50KHR5cGUsIHZhbHVlLCBzdGFydCwgZW5kLCBsb2MpIHtcbiAgICAgICAgdmFyIGNvbW1lbnQ7XG5cbiAgICAgICAgYXNzZXJ0KHR5cGVvZiBzdGFydCA9PT0gJ251bWJlcicsICdDb21tZW50IG11c3QgaGF2ZSB2YWxpZCBwb3NpdGlvbicpO1xuXG4gICAgICAgIHN0YXRlLmxhc3RDb21tZW50U3RhcnQgPSBzdGFydDtcblxuICAgICAgICBjb21tZW50ID0ge1xuICAgICAgICAgICAgdHlwZTogdHlwZSxcbiAgICAgICAgICAgIHZhbHVlOiB2YWx1ZVxuICAgICAgICB9O1xuICAgICAgICBpZiAoZXh0cmEucmFuZ2UpIHtcbiAgICAgICAgICAgIGNvbW1lbnQucmFuZ2UgPSBbc3RhcnQsIGVuZF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dHJhLmxvYykge1xuICAgICAgICAgICAgY29tbWVudC5sb2MgPSBsb2M7XG4gICAgICAgIH1cbiAgICAgICAgZXh0cmEuY29tbWVudHMucHVzaChjb21tZW50KTtcbiAgICAgICAgaWYgKGV4dHJhLmF0dGFjaENvbW1lbnQpIHtcbiAgICAgICAgICAgIGV4dHJhLmxlYWRpbmdDb21tZW50cy5wdXNoKGNvbW1lbnQpO1xuICAgICAgICAgICAgZXh0cmEudHJhaWxpbmdDb21tZW50cy5wdXNoKGNvbW1lbnQpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChleHRyYS50b2tlbml6ZSkge1xuICAgICAgICAgICAgY29tbWVudC50eXBlID0gY29tbWVudC50eXBlICsgJ0NvbW1lbnQnO1xuICAgICAgICAgICAgaWYgKGV4dHJhLmRlbGVnYXRlKSB7XG4gICAgICAgICAgICAgICAgY29tbWVudCA9IGV4dHJhLmRlbGVnYXRlKGNvbW1lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXh0cmEudG9rZW5zLnB1c2goY29tbWVudCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBza2lwU2luZ2xlTGluZUNvbW1lbnQob2Zmc2V0KSB7XG4gICAgICAgIHZhciBzdGFydCwgbG9jLCBjaCwgY29tbWVudDtcblxuICAgICAgICBzdGFydCA9IGluZGV4IC0gb2Zmc2V0O1xuICAgICAgICBsb2MgPSB7XG4gICAgICAgICAgICBzdGFydDoge1xuICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgY29sdW1uOiBpbmRleCAtIGxpbmVTdGFydCAtIG9mZnNldFxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgaWYgKGlzTGluZVRlcm1pbmF0b3IoY2gpKSB7XG4gICAgICAgICAgICAgICAgaGFzTGluZVRlcm1pbmF0b3IgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGlmIChleHRyYS5jb21tZW50cykge1xuICAgICAgICAgICAgICAgICAgICBjb21tZW50ID0gc291cmNlLnNsaWNlKHN0YXJ0ICsgb2Zmc2V0LCBpbmRleCAtIDEpO1xuICAgICAgICAgICAgICAgICAgICBsb2MuZW5kID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnQgLSAxXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIGFkZENvbW1lbnQoJ0xpbmUnLCBjb21tZW50LCBzdGFydCwgaW5kZXggLSAxLCBsb2MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09IDEzICYmIHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSA9PT0gMTApIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKytsaW5lTnVtYmVyO1xuICAgICAgICAgICAgICAgIGxpbmVTdGFydCA9IGluZGV4O1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChleHRyYS5jb21tZW50cykge1xuICAgICAgICAgICAgY29tbWVudCA9IHNvdXJjZS5zbGljZShzdGFydCArIG9mZnNldCwgaW5kZXgpO1xuICAgICAgICAgICAgbG9jLmVuZCA9IHtcbiAgICAgICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnRcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhZGRDb21tZW50KCdMaW5lJywgY29tbWVudCwgc3RhcnQsIGluZGV4LCBsb2MpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2tpcE11bHRpTGluZUNvbW1lbnQoKSB7XG4gICAgICAgIHZhciBzdGFydCwgbG9jLCBjaCwgY29tbWVudDtcblxuICAgICAgICBpZiAoZXh0cmEuY29tbWVudHMpIHtcbiAgICAgICAgICAgIHN0YXJ0ID0gaW5kZXggLSAyO1xuICAgICAgICAgICAgbG9jID0ge1xuICAgICAgICAgICAgICAgIHN0YXJ0OiB7XG4gICAgICAgICAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnQgLSAyXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG4gICAgICAgICAgICBpZiAoaXNMaW5lVGVybWluYXRvcihjaCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09IDB4MEQgJiYgc291cmNlLmNoYXJDb2RlQXQoaW5kZXggKyAxKSA9PT0gMHgwQSkge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBoYXNMaW5lVGVybWluYXRvciA9IHRydWU7XG4gICAgICAgICAgICAgICAgKytsaW5lTnVtYmVyO1xuICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgbGluZVN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAweDJBKSB7XG4gICAgICAgICAgICAgICAgLy8gQmxvY2sgY29tbWVudCBlbmRzIHdpdGggJyovJy5cbiAgICAgICAgICAgICAgICBpZiAoc291cmNlLmNoYXJDb2RlQXQoaW5kZXggKyAxKSA9PT0gMHgyRikge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXh0cmEuY29tbWVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1lbnQgPSBzb3VyY2Uuc2xpY2Uoc3RhcnQgKyAyLCBpbmRleCAtIDIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbG9jLmVuZCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRDb21tZW50KCdCbG9jaycsIGNvbW1lbnQsIHN0YXJ0LCBpbmRleCwgbG9jKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBSYW4gb2ZmIHRoZSBlbmQgb2YgdGhlIGZpbGUgLSB0aGUgd2hvbGUgdGhpbmcgaXMgYSBjb21tZW50XG4gICAgICAgIGlmIChleHRyYS5jb21tZW50cykge1xuICAgICAgICAgICAgbG9jLmVuZCA9IHtcbiAgICAgICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnRcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBjb21tZW50ID0gc291cmNlLnNsaWNlKHN0YXJ0ICsgMiwgaW5kZXgpO1xuICAgICAgICAgICAgYWRkQ29tbWVudCgnQmxvY2snLCBjb21tZW50LCBzdGFydCwgaW5kZXgsIGxvYyk7XG4gICAgICAgIH1cbiAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBza2lwQ29tbWVudCgpIHtcbiAgICAgICAgdmFyIGNoLCBzdGFydDtcbiAgICAgICAgaGFzTGluZVRlcm1pbmF0b3IgPSBmYWxzZTtcblxuICAgICAgICBzdGFydCA9IChpbmRleCA9PT0gMCk7XG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG5cbiAgICAgICAgICAgIGlmIChpc1doaXRlU3BhY2UoY2gpKSB7XG4gICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNMaW5lVGVybWluYXRvcihjaCkpIHtcbiAgICAgICAgICAgICAgICBoYXNMaW5lVGVybWluYXRvciA9IHRydWU7XG4gICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09IDB4MEQgJiYgc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpID09PSAweDBBKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICsrbGluZU51bWJlcjtcbiAgICAgICAgICAgICAgICBsaW5lU3RhcnQgPSBpbmRleDtcbiAgICAgICAgICAgICAgICBzdGFydCA9IHRydWU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAweDJGKSB7IC8vIFUrMDAyRiBpcyAnLydcbiAgICAgICAgICAgICAgICBjaCA9IHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4ICsgMSk7XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAweDJGKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHNraXBTaW5nbGVMaW5lQ29tbWVudCgyKTtcbiAgICAgICAgICAgICAgICAgICAgc3RhcnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09IDB4MkEpIHsgIC8vIFUrMDAyQSBpcyAnKidcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgc2tpcE11bHRpTGluZUNvbW1lbnQoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXJ0ICYmIGNoID09PSAweDJEKSB7IC8vIFUrMDAyRCBpcyAnLSdcbiAgICAgICAgICAgICAgICAvLyBVKzAwM0UgaXMgJz4nXG4gICAgICAgICAgICAgICAgaWYgKChzb3VyY2UuY2hhckNvZGVBdChpbmRleCArIDEpID09PSAweDJEKSAmJiAoc291cmNlLmNoYXJDb2RlQXQoaW5kZXggKyAyKSA9PT0gMHgzRSkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gJy0tPicgaXMgYSBzaW5nbGUtbGluZSBjb21tZW50XG4gICAgICAgICAgICAgICAgICAgIGluZGV4ICs9IDM7XG4gICAgICAgICAgICAgICAgICAgIHNraXBTaW5nbGVMaW5lQ29tbWVudCgzKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAweDNDKSB7IC8vIFUrMDAzQyBpcyAnPCdcbiAgICAgICAgICAgICAgICBpZiAoc291cmNlLnNsaWNlKGluZGV4ICsgMSwgaW5kZXggKyA0KSA9PT0gJyEtLScpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDsgLy8gYDxgXG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7IC8vIGAhYFxuICAgICAgICAgICAgICAgICAgICArK2luZGV4OyAvLyBgLWBcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDsgLy8gYC1gXG4gICAgICAgICAgICAgICAgICAgIHNraXBTaW5nbGVMaW5lQ29tbWVudCg0KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2NhbkhleEVzY2FwZShwcmVmaXgpIHtcbiAgICAgICAgdmFyIGksIGxlbiwgY2gsIGNvZGUgPSAwO1xuXG4gICAgICAgIGxlbiA9IChwcmVmaXggPT09ICd1JykgPyA0IDogMjtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbjsgKytpKSB7XG4gICAgICAgICAgICBpZiAoaW5kZXggPCBsZW5ndGggJiYgaXNIZXhEaWdpdChzb3VyY2VbaW5kZXhdKSkge1xuICAgICAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlICogMTYgKyAnMDEyMzQ1Njc4OWFiY2RlZicuaW5kZXhPZihjaC50b0xvd2VyQ2FzZSgpKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBTdHJpbmcuZnJvbUNoYXJDb2RlKGNvZGUpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5Vbmljb2RlQ29kZVBvaW50RXNjYXBlKCkge1xuICAgICAgICB2YXIgY2gsIGNvZGU7XG5cbiAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICBjb2RlID0gMDtcblxuICAgICAgICAvLyBBdCBsZWFzdCwgb25lIGhleCBkaWdpdCBpcyByZXF1aXJlZC5cbiAgICAgICAgaWYgKGNoID09PSAnfScpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgaWYgKCFpc0hleERpZ2l0KGNoKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29kZSA9IGNvZGUgKiAxNiArICcwMTIzNDU2Nzg5YWJjZGVmJy5pbmRleE9mKGNoLnRvTG93ZXJDYXNlKCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvZGUgPiAweDEwRkZGRiB8fCBjaCAhPT0gJ30nKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGZyb21Db2RlUG9pbnQoY29kZSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY29kZVBvaW50QXQoaSkge1xuICAgICAgICB2YXIgY3AsIGZpcnN0LCBzZWNvbmQ7XG5cbiAgICAgICAgY3AgPSBzb3VyY2UuY2hhckNvZGVBdChpKTtcbiAgICAgICAgaWYgKGNwID49IDB4RDgwMCAmJiBjcCA8PSAweERCRkYpIHtcbiAgICAgICAgICAgIHNlY29uZCA9IHNvdXJjZS5jaGFyQ29kZUF0KGkgKyAxKTtcbiAgICAgICAgICAgIGlmIChzZWNvbmQgPj0gMHhEQzAwICYmIHNlY29uZCA8PSAweERGRkYpIHtcbiAgICAgICAgICAgICAgICBmaXJzdCA9IGNwO1xuICAgICAgICAgICAgICAgIGNwID0gKGZpcnN0IC0gMHhEODAwKSAqIDB4NDAwICsgc2Vjb25kIC0gMHhEQzAwICsgMHgxMDAwMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjcDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRDb21wbGV4SWRlbnRpZmllcigpIHtcbiAgICAgICAgdmFyIGNwLCBjaCwgaWQ7XG5cbiAgICAgICAgY3AgPSBjb2RlUG9pbnRBdChpbmRleCk7XG4gICAgICAgIGlkID0gZnJvbUNvZGVQb2ludChjcCk7XG4gICAgICAgIGluZGV4ICs9IGlkLmxlbmd0aDtcblxuICAgICAgICAvLyAnXFx1JyAoVSswMDVDLCBVKzAwNzUpIGRlbm90ZXMgYW4gZXNjYXBlZCBjaGFyYWN0ZXIuXG4gICAgICAgIGlmIChjcCA9PT0gMHg1Qykge1xuICAgICAgICAgICAgaWYgKHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSAhPT0gMHg3NSkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgaWYgKHNvdXJjZVtpbmRleF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgY2ggPSBzY2FuVW5pY29kZUNvZGVQb2ludEVzY2FwZSgpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjaCA9IHNjYW5IZXhFc2NhcGUoJ3UnKTtcbiAgICAgICAgICAgICAgICBjcCA9IGNoLmNoYXJDb2RlQXQoMCk7XG4gICAgICAgICAgICAgICAgaWYgKCFjaCB8fCBjaCA9PT0gJ1xcXFwnIHx8ICFpc0lkZW50aWZpZXJTdGFydChjcCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZCA9IGNoO1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjcCA9IGNvZGVQb2ludEF0KGluZGV4KTtcbiAgICAgICAgICAgIGlmICghaXNJZGVudGlmaWVyUGFydChjcCkpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNoID0gZnJvbUNvZGVQb2ludChjcCk7XG4gICAgICAgICAgICBpZCArPSBjaDtcbiAgICAgICAgICAgIGluZGV4ICs9IGNoLmxlbmd0aDtcblxuICAgICAgICAgICAgLy8gJ1xcdScgKFUrMDA1QywgVSswMDc1KSBkZW5vdGVzIGFuIGVzY2FwZWQgY2hhcmFjdGVyLlxuICAgICAgICAgICAgaWYgKGNwID09PSAweDVDKSB7XG4gICAgICAgICAgICAgICAgaWQgPSBpZC5zdWJzdHIoMCwgaWQubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgICAgICAgaWYgKHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSAhPT0gMHg3NSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgIGlmIChzb3VyY2VbaW5kZXhdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgY2ggPSBzY2FuVW5pY29kZUNvZGVQb2ludEVzY2FwZSgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNoID0gc2NhbkhleEVzY2FwZSgndScpO1xuICAgICAgICAgICAgICAgICAgICBjcCA9IGNoLmNoYXJDb2RlQXQoMCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY2ggfHwgY2ggPT09ICdcXFxcJyB8fCAhaXNJZGVudGlmaWVyUGFydChjcCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWQgKz0gY2g7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaWQ7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0SWRlbnRpZmllcigpIHtcbiAgICAgICAgdmFyIHN0YXJ0LCBjaDtcblxuICAgICAgICBzdGFydCA9IGluZGV4Kys7XG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG4gICAgICAgICAgICBpZiAoY2ggPT09IDB4NUMpIHtcbiAgICAgICAgICAgICAgICAvLyBCbGFja3NsYXNoIChVKzAwNUMpIG1hcmtzIFVuaWNvZGUgZXNjYXBlIHNlcXVlbmNlLlxuICAgICAgICAgICAgICAgIGluZGV4ID0gc3RhcnQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdldENvbXBsZXhJZGVudGlmaWVyKCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoID49IDB4RDgwMCAmJiBjaCA8IDB4REZGRikge1xuICAgICAgICAgICAgICAgIC8vIE5lZWQgdG8gaGFuZGxlIHN1cnJvZ2F0ZSBwYWlycy5cbiAgICAgICAgICAgICAgICBpbmRleCA9IHN0YXJ0O1xuICAgICAgICAgICAgICAgIHJldHVybiBnZXRDb21wbGV4SWRlbnRpZmllcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzSWRlbnRpZmllclBhcnQoY2gpKSB7XG4gICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gc291cmNlLnNsaWNlKHN0YXJ0LCBpbmRleCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2NhbklkZW50aWZpZXIoKSB7XG4gICAgICAgIHZhciBzdGFydCwgaWQsIHR5cGU7XG5cbiAgICAgICAgc3RhcnQgPSBpbmRleDtcblxuICAgICAgICAvLyBCYWNrc2xhc2ggKFUrMDA1Qykgc3RhcnRzIGFuIGVzY2FwZWQgY2hhcmFjdGVyLlxuICAgICAgICBpZCA9IChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkgPT09IDB4NUMpID8gZ2V0Q29tcGxleElkZW50aWZpZXIoKSA6IGdldElkZW50aWZpZXIoKTtcblxuICAgICAgICAvLyBUaGVyZSBpcyBubyBrZXl3b3JkIG9yIGxpdGVyYWwgd2l0aCBvbmx5IG9uZSBjaGFyYWN0ZXIuXG4gICAgICAgIC8vIFRodXMsIGl0IG11c3QgYmUgYW4gaWRlbnRpZmllci5cbiAgICAgICAgaWYgKGlkLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgdHlwZSA9IFRva2VuLklkZW50aWZpZXI7XG4gICAgICAgIH0gZWxzZSBpZiAoaXNLZXl3b3JkKGlkKSkge1xuICAgICAgICAgICAgdHlwZSA9IFRva2VuLktleXdvcmQ7XG4gICAgICAgIH0gZWxzZSBpZiAoaWQgPT09ICdudWxsJykge1xuICAgICAgICAgICAgdHlwZSA9IFRva2VuLk51bGxMaXRlcmFsO1xuICAgICAgICB9IGVsc2UgaWYgKGlkID09PSAndHJ1ZScgfHwgaWQgPT09ICdmYWxzZScpIHtcbiAgICAgICAgICAgIHR5cGUgPSBUb2tlbi5Cb29sZWFuTGl0ZXJhbDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHR5cGUgPSBUb2tlbi5JZGVudGlmaWVyO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgICAgICB2YWx1ZTogaWQsXG4gICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICBzdGFydDogc3RhcnQsXG4gICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgIH07XG4gICAgfVxuXG5cbiAgICAvLyBFQ01BLTI2MiAxMS43IFB1bmN0dWF0b3JzXG5cbiAgICBmdW5jdGlvbiBzY2FuUHVuY3R1YXRvcigpIHtcbiAgICAgICAgdmFyIHRva2VuLCBzdHI7XG5cbiAgICAgICAgdG9rZW4gPSB7XG4gICAgICAgICAgICB0eXBlOiBUb2tlbi5QdW5jdHVhdG9yLFxuICAgICAgICAgICAgdmFsdWU6ICcnLFxuICAgICAgICAgICAgbGluZU51bWJlcjogbGluZU51bWJlcixcbiAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgc3RhcnQ6IGluZGV4LFxuICAgICAgICAgICAgZW5kOiBpbmRleFxuICAgICAgICB9O1xuXG4gICAgICAgIC8vIENoZWNrIGZvciBtb3N0IGNvbW1vbiBzaW5nbGUtY2hhcmFjdGVyIHB1bmN0dWF0b3JzLlxuICAgICAgICBzdHIgPSBzb3VyY2VbaW5kZXhdO1xuICAgICAgICBzd2l0Y2ggKHN0cikge1xuXG4gICAgICAgIGNhc2UgJygnOlxuICAgICAgICAgICAgaWYgKGV4dHJhLnRva2VuaXplKSB7XG4gICAgICAgICAgICAgICAgZXh0cmEub3BlblBhcmVuVG9rZW4gPSBleHRyYS50b2tlblZhbHVlcy5sZW5ndGg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAneyc6XG4gICAgICAgICAgICBpZiAoZXh0cmEudG9rZW5pemUpIHtcbiAgICAgICAgICAgICAgICBleHRyYS5vcGVuQ3VybHlUb2tlbiA9IGV4dHJhLnRva2VuVmFsdWVzLmxlbmd0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN0YXRlLmN1cmx5U3RhY2sucHVzaCgneycpO1xuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJy4nOlxuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIGlmIChzb3VyY2VbaW5kZXhdID09PSAnLicgJiYgc291cmNlW2luZGV4ICsgMV0gPT09ICcuJykge1xuICAgICAgICAgICAgICAgIC8vIFNwcmVhZCBvcGVyYXRvcjogLi4uXG4gICAgICAgICAgICAgICAgaW5kZXggKz0gMjtcbiAgICAgICAgICAgICAgICBzdHIgPSAnLi4uJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ30nOlxuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIHN0YXRlLmN1cmx5U3RhY2sucG9wKCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnKSc6XG4gICAgICAgIGNhc2UgJzsnOlxuICAgICAgICBjYXNlICcsJzpcbiAgICAgICAgY2FzZSAnWyc6XG4gICAgICAgIGNhc2UgJ10nOlxuICAgICAgICBjYXNlICc6JzpcbiAgICAgICAgY2FzZSAnPyc6XG4gICAgICAgIGNhc2UgJ34nOlxuICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAvLyA0LWNoYXJhY3RlciBwdW5jdHVhdG9yLlxuICAgICAgICAgICAgc3RyID0gc291cmNlLnN1YnN0cihpbmRleCwgNCk7XG4gICAgICAgICAgICBpZiAoc3RyID09PSAnPj4+PScpIHtcbiAgICAgICAgICAgICAgICBpbmRleCArPSA0O1xuICAgICAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgICAgIC8vIDMtY2hhcmFjdGVyIHB1bmN0dWF0b3JzLlxuICAgICAgICAgICAgICAgIHN0ciA9IHN0ci5zdWJzdHIoMCwgMyk7XG4gICAgICAgICAgICAgICAgaWYgKHN0ciA9PT0gJz09PScgfHwgc3RyID09PSAnIT09JyB8fCBzdHIgPT09ICc+Pj4nIHx8XG4gICAgICAgICAgICAgICAgICAgIHN0ciA9PT0gJzw8PScgfHwgc3RyID09PSAnPj49Jykge1xuICAgICAgICAgICAgICAgICAgICBpbmRleCArPSAzO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gMi1jaGFyYWN0ZXIgcHVuY3R1YXRvcnMuXG4gICAgICAgICAgICAgICAgICAgIHN0ciA9IHN0ci5zdWJzdHIoMCwgMik7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzdHIgPT09ICcmJicgfHwgc3RyID09PSAnfHwnIHx8IHN0ciA9PT0gJz09JyB8fCBzdHIgPT09ICchPScgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA9PT0gJys9JyB8fCBzdHIgPT09ICctPScgfHwgc3RyID09PSAnKj0nIHx8IHN0ciA9PT0gJy89JyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RyID09PSAnKysnIHx8IHN0ciA9PT0gJy0tJyB8fCBzdHIgPT09ICc8PCcgfHwgc3RyID09PSAnPj4nIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgPT09ICcmPScgfHwgc3RyID09PSAnfD0nIHx8IHN0ciA9PT0gJ149JyB8fCBzdHIgPT09ICclPScgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA9PT0gJzw9JyB8fCBzdHIgPT09ICc+PScgfHwgc3RyID09PSAnPT4nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleCArPSAyO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAxLWNoYXJhY3RlciBwdW5jdHVhdG9ycy5cbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJzw+PSErLSolJnxeLycuaW5kZXhPZihzdHIpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGluZGV4ID09PSB0b2tlbi5zdGFydCkge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRva2VuLmVuZCA9IGluZGV4O1xuICAgICAgICB0b2tlbi52YWx1ZSA9IHN0cjtcbiAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDExLjguMyBOdW1lcmljIExpdGVyYWxzXG5cbiAgICBmdW5jdGlvbiBzY2FuSGV4TGl0ZXJhbChzdGFydCkge1xuICAgICAgICB2YXIgbnVtYmVyID0gJyc7XG5cbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoIWlzSGV4RGlnaXQoc291cmNlW2luZGV4XSkpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobnVtYmVyLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHR5cGU6IFRva2VuLk51bWVyaWNMaXRlcmFsLFxuICAgICAgICAgICAgdmFsdWU6IHBhcnNlSW50KCcweCcgKyBudW1iZXIsIDE2KSxcbiAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuQmluYXJ5TGl0ZXJhbChzdGFydCkge1xuICAgICAgICB2YXIgY2gsIG51bWJlcjtcblxuICAgICAgICBudW1iZXIgPSAnJztcblxuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgICAgIGlmIChjaCAhPT0gJzAnICYmIGNoICE9PSAnMScpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobnVtYmVyLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgLy8gb25seSAwYiBvciAwQlxuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG4gICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgaWYgKGlzSWRlbnRpZmllclN0YXJ0KGNoKSB8fCBpc0RlY2ltYWxEaWdpdChjaCkpIHtcbiAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHR5cGU6IFRva2VuLk51bWVyaWNMaXRlcmFsLFxuICAgICAgICAgICAgdmFsdWU6IHBhcnNlSW50KG51bWJlciwgMiksXG4gICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICBzdGFydDogc3RhcnQsXG4gICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2Nhbk9jdGFsTGl0ZXJhbChwcmVmaXgsIHN0YXJ0KSB7XG4gICAgICAgIHZhciBudW1iZXIsIG9jdGFsO1xuXG4gICAgICAgIGlmIChpc09jdGFsRGlnaXQocHJlZml4KSkge1xuICAgICAgICAgICAgb2N0YWwgPSB0cnVlO1xuICAgICAgICAgICAgbnVtYmVyID0gJzAnICsgc291cmNlW2luZGV4KytdO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb2N0YWwgPSBmYWxzZTtcbiAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICBudW1iZXIgPSAnJztcbiAgICAgICAgfVxuXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKCFpc09jdGFsRGlnaXQoc291cmNlW2luZGV4XSkpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIW9jdGFsICYmIG51bWJlci5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIC8vIG9ubHkgMG8gb3IgME9cbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaXNJZGVudGlmaWVyU3RhcnQoc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpKSB8fCBpc0RlY2ltYWxEaWdpdChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHR5cGU6IFRva2VuLk51bWVyaWNMaXRlcmFsLFxuICAgICAgICAgICAgdmFsdWU6IHBhcnNlSW50KG51bWJlciwgOCksXG4gICAgICAgICAgICBvY3RhbDogb2N0YWwsXG4gICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICBzdGFydDogc3RhcnQsXG4gICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNJbXBsaWNpdE9jdGFsTGl0ZXJhbCgpIHtcbiAgICAgICAgdmFyIGksIGNoO1xuXG4gICAgICAgIC8vIEltcGxpY2l0IG9jdGFsLCB1bmxlc3MgdGhlcmUgaXMgYSBub24tb2N0YWwgZGlnaXQuXG4gICAgICAgIC8vIChBbm5leCBCLjEuMSBvbiBOdW1lcmljIExpdGVyYWxzKVxuICAgICAgICBmb3IgKGkgPSBpbmRleCArIDE7IGkgPCBsZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgY2ggPSBzb3VyY2VbaV07XG4gICAgICAgICAgICBpZiAoY2ggPT09ICc4JyB8fCBjaCA9PT0gJzknKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFpc09jdGFsRGlnaXQoY2gpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuTnVtZXJpY0xpdGVyYWwoKSB7XG4gICAgICAgIHZhciBudW1iZXIsIHN0YXJ0LCBjaDtcblxuICAgICAgICBjaCA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgIGFzc2VydChpc0RlY2ltYWxEaWdpdChjaC5jaGFyQ29kZUF0KDApKSB8fCAoY2ggPT09ICcuJyksXG4gICAgICAgICAgICAnTnVtZXJpYyBsaXRlcmFsIG11c3Qgc3RhcnQgd2l0aCBhIGRlY2ltYWwgZGlnaXQgb3IgYSBkZWNpbWFsIHBvaW50Jyk7XG5cbiAgICAgICAgc3RhcnQgPSBpbmRleDtcbiAgICAgICAgbnVtYmVyID0gJyc7XG4gICAgICAgIGlmIChjaCAhPT0gJy4nKSB7XG4gICAgICAgICAgICBudW1iZXIgPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleF07XG5cbiAgICAgICAgICAgIC8vIEhleCBudW1iZXIgc3RhcnRzIHdpdGggJzB4Jy5cbiAgICAgICAgICAgIC8vIE9jdGFsIG51bWJlciBzdGFydHMgd2l0aCAnMCcuXG4gICAgICAgICAgICAvLyBPY3RhbCBudW1iZXIgaW4gRVM2IHN0YXJ0cyB3aXRoICcwbycuXG4gICAgICAgICAgICAvLyBCaW5hcnkgbnVtYmVyIGluIEVTNiBzdGFydHMgd2l0aCAnMGInLlxuICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gJzAnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAneCcgfHwgY2ggPT09ICdYJykge1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NhbkhleExpdGVyYWwoc3RhcnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICdiJyB8fCBjaCA9PT0gJ0InKSB7XG4gICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzY2FuQmluYXJ5TGl0ZXJhbChzdGFydCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ28nIHx8IGNoID09PSAnTycpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjYW5PY3RhbExpdGVyYWwoY2gsIHN0YXJ0KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoaXNPY3RhbERpZ2l0KGNoKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNJbXBsaWNpdE9jdGFsTGl0ZXJhbCgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2Nhbk9jdGFsTGl0ZXJhbChjaCwgc3RhcnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB3aGlsZSAoaXNEZWNpbWFsRGlnaXQoc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY2ggPT09ICcuJykge1xuICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgIHdoaWxlIChpc0RlY2ltYWxEaWdpdChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgbnVtYmVyICs9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjaCA9PT0gJ2UnIHx8IGNoID09PSAnRScpIHtcbiAgICAgICAgICAgIG51bWJlciArPSBzb3VyY2VbaW5kZXgrK107XG5cbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gJysnIHx8IGNoID09PSAnLScpIHtcbiAgICAgICAgICAgICAgICBudW1iZXIgKz0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzRGVjaW1hbERpZ2l0KHNvdXJjZS5jaGFyQ29kZUF0KGluZGV4KSkpIHtcbiAgICAgICAgICAgICAgICB3aGlsZSAoaXNEZWNpbWFsRGlnaXQoc291cmNlLmNoYXJDb2RlQXQoaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgICAgICBudW1iZXIgKz0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHR5cGU6IFRva2VuLk51bWVyaWNMaXRlcmFsLFxuICAgICAgICAgICAgdmFsdWU6IHBhcnNlRmxvYXQobnVtYmVyKSxcbiAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgIGVuZDogaW5kZXhcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMS44LjQgU3RyaW5nIExpdGVyYWxzXG5cbiAgICBmdW5jdGlvbiBzY2FuU3RyaW5nTGl0ZXJhbCgpIHtcbiAgICAgICAgdmFyIHN0ciA9ICcnLCBxdW90ZSwgc3RhcnQsIGNoLCB1bmVzY2FwZWQsIG9jdFRvRGVjLCBvY3RhbCA9IGZhbHNlO1xuXG4gICAgICAgIHF1b3RlID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgYXNzZXJ0KChxdW90ZSA9PT0gJ1xcJycgfHwgcXVvdGUgPT09ICdcIicpLFxuICAgICAgICAgICAgJ1N0cmluZyBsaXRlcmFsIG11c3Qgc3RhcnRzIHdpdGggYSBxdW90ZScpO1xuXG4gICAgICAgIHN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICsraW5kZXg7XG5cbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleCsrXTtcblxuICAgICAgICAgICAgaWYgKGNoID09PSBxdW90ZSkge1xuICAgICAgICAgICAgICAgIHF1b3RlID0gJyc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnXFxcXCcpIHtcbiAgICAgICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgICAgICBpZiAoIWNoIHx8ICFpc0xpbmVUZXJtaW5hdG9yKGNoLmNoYXJDb2RlQXQoMCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoY2gpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAndSc6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3gnOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvdXJjZVtpbmRleF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9IHNjYW5Vbmljb2RlQ29kZVBvaW50RXNjYXBlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuZXNjYXBlZCA9IHNjYW5IZXhFc2NhcGUoY2gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdW5lc2NhcGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSB1bmVzY2FwZWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnbic6XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJ1xcbic7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAncic6XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJ1xccic7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAndCc6XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJ1xcdCc7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnYic6XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJ1xcYic7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnZic6XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJ1xcZic7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAndic6XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJ1xceDBCJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICc4JzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnOSc6XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gY2g7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc09jdGFsRGlnaXQoY2gpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2N0VG9EZWMgPSBvY3RhbFRvRGVjaW1hbChjaCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvY3RhbCA9IG9jdFRvRGVjLm9jdGFsIHx8IG9jdGFsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKG9jdFRvRGVjLmNvZGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gY2g7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICsrbGluZU51bWJlcjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09PSAnXFxyJyAmJiBzb3VyY2VbaW5kZXhdID09PSAnXFxuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsaW5lU3RhcnQgPSBpbmRleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzTGluZVRlcm1pbmF0b3IoY2guY2hhckNvZGVBdCgwKSkpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3RyICs9IGNoO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYg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cbiAgICAgICAgICAgICAgICB0ZXJtaW5hdGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09ICckJykge1xuICAgICAgICAgICAgICAgIGlmIChzb3VyY2VbaW5kZXhdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUuY3VybHlTdGFjay5wdXNoKCckeycpO1xuICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICB0ZXJtaW5hdGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvb2tlZCArPSBjaDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT09ICdcXFxcJykge1xuICAgICAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4KytdO1xuICAgICAgICAgICAgICAgIGlmICghaXNMaW5lVGVybWluYXRvcihjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ24nOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXG4nO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3InOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXHInO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3QnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9ICdcXHQnO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3UnOlxuICAgICAgICAgICAgICAgICAgICBjYXNlICd4JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2VbaW5kZXhdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSBzY2FuVW5pY29kZUNvZGVQb2ludEVzY2FwZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN0b3JlID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5lc2NhcGVkID0gc2NhbkhleEVzY2FwZShjaCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVuZXNjYXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29rZWQgKz0gdW5lc2NhcGVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gcmVzdG9yZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9IGNoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdiJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSAnXFxiJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdmJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSAnXFxmJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICd2JzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSAnXFx2JztcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICcwJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0RlY2ltYWxEaWdpdChzb3VyY2UuY2hhckNvZGVBdChpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElsbGVnYWw6IFxcMDEgXFwwMiBhbmQgc28gb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dFcnJvcihNZXNzYWdlcy5UZW1wbGF0ZU9jdGFsTGl0ZXJhbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tlZCArPSAnXFwwJztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNPY3RhbERpZ2l0KGNoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElsbGVnYWw6IFxcMSBcXDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLlRlbXBsYXRlT2N0YWxMaXRlcmFsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2VkICs9IGNoO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICArK2xpbmVOdW1iZXI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ1xccicgJiYgc291cmNlW2luZGV4XSA9PT0gJ1xcbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICsraW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbGluZVN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChpc0xpbmVUZXJtaW5hdG9yKGNoLmNoYXJDb2RlQXQoMCkpKSB7XG4gICAgICAgICAgICAgICAgKytsaW5lTnVtYmVyO1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ1xccicgJiYgc291cmNlW2luZGV4XSA9PT0gJ1xcbicpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGluZVN0YXJ0ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgY29va2VkICs9ICdcXG4nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb29rZWQgKz0gY2g7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRlcm1pbmF0ZWQpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWhlYWQpIHtcbiAgICAgICAgICAgIHN0YXRlLmN1cmx5U3RhY2sucG9wKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdHlwZTogVG9rZW4uVGVtcGxhdGUsXG4gICAgICAgICAgICB2YWx1ZToge1xuICAgICAgICAgICAgICAgIGNvb2tlZDogY29va2VkLFxuICAgICAgICAgICAgICAgIHJhdzogc291cmNlLnNsaWNlKHN0YXJ0ICsgMSwgaW5kZXggLSByYXdPZmZzZXQpXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaGVhZDogaGVhZCxcbiAgICAgICAgICAgIHRhaWw6IHRhaWwsXG4gICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgbGluZVN0YXJ0OiBsaW5lU3RhcnQsXG4gICAgICAgICAgICBzdGFydDogc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cG9pbnQgaW4gdGhlIGNhc2Ugb2ZcbiAgICAgICAgICAgICAgICAvLyBhc3RyYWwgc3ltYm9scy4gKFNlZSB0aGUgYWJvdmUgbm90ZSBvbiBgYXN0cmFsU3Vic3RpdHV0ZWBcbiAgICAgICAgICAgICAgICAvLyBmb3IgbW9yZSBpbmZvcm1hdGlvbi4pXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL1xcXFx1XFx7KFswLTlhLWZBLUZdKylcXH18XFxcXHUoW2EtZkEtRjAtOV17NH0pL2csIGZ1bmN0aW9uICgkMCwgJDEsICQyKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSBwYXJzZUludCgkMSB8fCAkMiwgMTYpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29kZVBvaW50ID4gMHgxMEZGRkYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKG51bGwsIE1lc3NhZ2VzLkludmFsaWRSZWdFeHApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPD0gMHhGRkZGKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhc3RyYWxTdWJzdGl0dXRlO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLy8gUmVwbGFjZSBlYWNoIHBhaXJlZCBzdXJyb2dhdGUgd2l0aCBhIHNpbmdsZSBBU0NJSSBzeW1ib2wgdG9cbiAgICAgICAgICAgICAgICAvLyBhdm9pZCB0aHJvd2luZyBvbiByZWd1bGFyIGV4cHJlc3Npb25zIHRoYXQgYXJlIG9ubHkgdmFsaWQgaW5cbiAgICAgICAgICAgICAgICAvLyBjb21iaW5hdGlvbiB3aXRoIHRoZSBcInVcIiBmbGFnLlxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKFxuICAgICAgICAgICAgICAgICAgICAvW1xcdUQ4MDAtXFx1REJGRl1bXFx1REMwMC1cXHVERkZGXS9nLFxuICAgICAgICAgICAgICAgICAgICBhc3RyYWxTdWJzdGl0dXRlXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZpcnN0LCBkZXRlY3QgaW52YWxpZCByZWd1bGFyIGV4cHJlc3Npb25zLlxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgUmVnRXhwKHRtcCk7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKG51bGwsIE1lc3NhZ2VzLkludmFsaWRSZWdFeHApO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gUmV0dXJuIGEgcmVndWxhciBleHByZXNzaW9uIG9iamVjdCBmb3IgdGhpcyBwYXR0ZXJuLWZsYWcgcGFpciwgb3JcbiAgICAgICAgLy8gYG51bGxgIGluIGNhc2UgdGhlIGN1cnJlbnQgZW52aXJvbm1lbnQgZG9lc24ndCBzdXBwb3J0IHRoZSBmbGFncyBpdFxuICAgICAgICAvLyB1c2VzLlxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBSZWdFeHAocGF0dGVybiwgZmxhZ3MpO1xuICAgICAgICB9IGNhdGNoIChleGNlcHRpb24pIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2NhblJlZ0V4cEJvZHkoKSB7XG4gICAgICAgIHZhciBjaCwgc3RyLCBjbGFzc01hcmtlciwgdGVybWluYXRlZCwgYm9keTtcblxuICAgICAgICBjaCA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgIGFzc2VydChjaCA9PT0gJy8nLCAnUmVndWxhciBleHByZXNzaW9uIGxpdGVyYWwgbXVzdCBzdGFydCB3aXRoIGEgc2xhc2gnKTtcbiAgICAgICAgc3RyID0gc291cmNlW2luZGV4KytdO1xuXG4gICAgICAgIGNsYXNzTWFya2VyID0gZmFsc2U7XG4gICAgICAgIHRlcm1pbmF0ZWQgPSBmYWxzZTtcbiAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleCsrXTtcbiAgICAgICAgICAgIHN0ciArPSBjaDtcbiAgICAgICAgICAgIGlmIChjaCA9PT0gJ1xcXFwnKSB7XG4gICAgICAgICAgICAgICAgY2ggPSBzb3VyY2VbaW5kZXgrK107XG4gICAgICAgICAgICAgICAgLy8gRUNNQS0yNjIgNy44LjVcbiAgICAgICAgICAgICAgICBpZiAoaXNMaW5lVGVybWluYXRvcihjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbihudWxsLCBNZXNzYWdlcy5VbnRlcm1pbmF0ZWRSZWdFeHApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzdHIgKz0gY2g7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzTGluZVRlcm1pbmF0b3IoY2guY2hhckNvZGVBdCgwKSkpIHtcbiAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbihudWxsLCBNZXNzYWdlcy5VbnRlcm1pbmF0ZWRSZWdFeHApO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjbGFzc01hcmtlcikge1xuICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTWFya2VyID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICcvJykge1xuICAgICAgICAgICAgICAgICAgICB0ZXJtaW5hdGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gJ1snKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTWFya2VyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRlcm1pbmF0ZWQpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKG51bGwsIE1lc3NhZ2VzLlVudGVybWluYXRlZFJlZ0V4cCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBFeGNsdWRlIGxlYWRpbmcgYW5kIHRyYWlsaW5nIHNsYXNoLlxuICAgICAgICBib2R5ID0gc3RyLnN1YnN0cigxLCBzdHIubGVuZ3RoIC0gMik7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB2YWx1ZTogYm9keSxcbiAgICAgICAgICAgIGxpdGVyYWw6IHN0clxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNjYW5SZWdFeHBGbGFncygpIHtcbiAgICAgICAgdmFyIGNoLCBzdHIsIGZsYWdzLCByZXN0b3JlO1xuXG4gICAgICAgIHN0ciA9ICcnO1xuICAgICAgICBmbGFncyA9ICcnO1xuICAgICAgICB3aGlsZSAoaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGNoID0gc291cmNlW2luZGV4XTtcbiAgICAgICAgICAgIGlmICghaXNJZGVudGlmaWVyUGFydChjaC5jaGFyQ29kZUF0KDApKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICArK2luZGV4O1xuICAgICAgICAgICAgaWYgKGNoID09PSAnXFxcXCcgJiYgaW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBjaCA9IHNvdXJjZVtpbmRleF07XG4gICAgICAgICAgICAgICAgaWYgKGNoID09PSAndScpIHtcbiAgICAgICAgICAgICAgICAgICAgKytpbmRleDtcbiAgICAgICAgICAgICAgICAgICAgcmVzdG9yZSA9IGluZGV4O1xuICAgICAgICAgICAgICAgICAgICBjaCA9IHNjYW5IZXhFc2NhcGUoJ3UnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmbGFncyArPSBjaDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc3RyICs9ICdcXFxcdSc7IHJlc3RvcmUgPCBpbmRleDsgKytyZXN0b3JlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyICs9IHNvdXJjZVtyZXN0b3JlXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gcmVzdG9yZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzICs9ICd1JztcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAnXFxcXHUnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgc3RyICs9ICdcXFxcJztcbiAgICAgICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4oKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZsYWdzICs9IGNoO1xuICAgICAgICAgICAgICAgIHN0ciArPSBjaDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB2YWx1ZTogZmxhZ3MsXG4gICAgICAgICAgICBsaXRlcmFsOiBzdHJcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzY2FuUmVnRXhwKCkge1xuICAgICAgICB2YXIgc3RhcnQsIGJvZHksIGZsYWdzLCB2YWx1ZTtcbiAgICAgICAgc2Nhbm5pbmcgPSB0cnVlO1xuXG4gICAgICAgIGxvb2thaGVhZCA9IG51bGw7XG4gICAgICAgIHNraXBDb21tZW50KCk7XG4gICAgICAgIHN0YXJ0ID0gaW5kZXg7XG5cbiAgICAgICAgYm9keSA9IHNjYW5SZWdFeHBCb2R5KCk7XG4gICAgICAgIGZsYWdzID0gc2NhblJlZ0V4cEZsYWdzKCk7XG4gICAgICAgIHZhbHVlID0gdGVzdFJlZ0V4cChib2R5LnZhbHVlLCBmbGFncy52YWx1ZSk7XG4gICAgICAgIHNjYW5uaW5nID0gZmFsc2U7XG4gICAgICAgIGlmIChleHRyYS50b2tlbml6ZSkge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBUb2tlbi5SZWd1bGFyRXhwcmVzc2lvbixcbiAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUsXG4gICAgICAgICAgICAgICAgcmVnZXg6IHtcbiAgICAgICAgICAgICAgICAgICAgcGF0dGVybjogYm9keS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3M6IGZsYWdzLnZhbHVlXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBzdGFydCxcbiAgICAgICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGxpdGVyYWw6IGJvZHkubGl0ZXJhbCArIGZsYWdzLmxpdGVyYWwsXG4gICAgICAgICAgICB2YWx1ZTogdmFsdWUsXG4gICAgICAgICAgICByZWdleDoge1xuICAgICAgICAgICAgICAgIHBhdHRlcm46IGJvZHkudmFsdWUsXG4gICAgICAgICAgICAgICAgZmxhZ3M6IGZsYWdzLnZhbHVlXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LFxuICAgICAgICAgICAgZW5kOiBpbmRleFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbGxlY3RSZWdleCgpIHtcbiAgICAgICAgdmFyIHBvcywgbG9jLCByZWdleCwgdG9rZW47XG5cbiAgICAgICAgc2tpcENvbW1lbnQoKTtcblxuICAgICAgICBwb3MgPSBpbmRleDtcbiAgICAgICAgbG9jID0ge1xuICAgICAgICAgICAgc3RhcnQ6IHtcbiAgICAgICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICByZWdleCA9IHNjYW5SZWdFeHAoKTtcblxuICAgICAgICBsb2MuZW5kID0ge1xuICAgICAgICAgICAgbGluZTogbGluZU51bWJlcixcbiAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnRcbiAgICAgICAgfTtcblxuICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgICAgICBpZiAoIWV4dHJhLnRva2VuaXplKSB7XG4gICAgICAgICAgICAvLyBQb3AgdGhlIHByZXZpb3VzIHRva2VuLCB3aGljaCBpcyBsaWtlbHkgJy8nIG9yICcvPSdcbiAgICAgICAgICAgIGlmIChleHRyYS50b2tlbnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHRva2VuID0gZXh0cmEudG9rZW5zW2V4dHJhLnRva2Vucy5sZW5ndGggLSAxXTtcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4ucmFuZ2VbMF0gPT09IHBvcyAmJiB0b2tlbi50eXBlID09PSAnUHVuY3R1YXRvcicpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRva2VuLnZhbHVlID09PSAnLycgfHwgdG9rZW4udmFsdWUgPT09ICcvPScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLnRva2Vucy5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZXh0cmEudG9rZW5zLnB1c2goe1xuICAgICAgICAgICAgICAgIHR5cGU6ICdSZWd1bGFyRXhwcmVzc2lvbicsXG4gICAgICAgICAgICAgICAgdmFsdWU6IHJlZ2V4LmxpdGVyYWwsXG4gICAgICAgICAgICAgICAgcmVnZXg6IHJlZ2V4LnJlZ2V4LFxuICAgICAgICAgICAgICAgIHJhbmdlOiBbcG9zLCBpbmRleF0sXG4gICAgICAgICAgICAgICAgbG9jOiBsb2NcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlZ2V4O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzSWRlbnRpZmllck5hbWUodG9rZW4pIHtcbiAgICAgICAgcmV0dXJuIHRva2VuLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIgfHxcbiAgICAgICAgICAgIHRva2VuLnR5cGUgPT09IFRva2VuLktleXdvcmQgfHxcbiAgICAgICAgICAgIHRva2VuLnR5cGUgPT09IFRva2VuLkJvb2xlYW5MaXRlcmFsIHx8XG4gICAgICAgICAgICB0b2tlbi50eXBlID09PSBUb2tlbi5OdWxsTGl0ZXJhbDtcbiAgICB9XG5cbiAgICAvLyBVc2luZyB0aGUgZm9sbG93aW5nIGFsZ29yaXRobTpcbiAgICAvLyBodHRwczovL2dpdGh1Yi5jb20vbW96aWxsYS9zd2VldC5qcy93aWtpL2Rlc2lnblxuXG4gICAgZnVuY3Rpb24gYWR2YW5jZVNsYXNoKCkge1xuICAgICAgICB2YXIgcmVnZXgsIHByZXZpb3VzLCBjaGVjaztcblxuICAgICAgICBmdW5jdGlvbiB0ZXN0S2V5d29yZCh2YWx1ZSkge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlICYmICh2YWx1ZS5sZW5ndGggPiAxKSAmJiAodmFsdWVbMF0gPj0gJ2EnKSAmJiAodmFsdWVbMF0gPD0gJ3onKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHByZXZpb3VzID0gZXh0cmEudG9rZW5WYWx1ZXNbZXh0cmEudG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICByZWdleCA9IChwcmV2aW91cyAhPT0gbnVsbCk7XG5cbiAgICAgICAgc3dpdGNoIChwcmV2aW91cykge1xuICAgICAgICBjYXNlICd0aGlzJzpcbiAgICAgICAgY2FzZSAnXSc6XG4gICAgICAgICAgICByZWdleCA9IGZhbHNlO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnKSc6XG4gICAgICAgICAgICBjaGVjayA9IGV4dHJhLnRva2VuVmFsdWVzW2V4dHJhLm9wZW5QYXJlblRva2VuIC0gMV07XG4gICAgICAgICAgICByZWdleCA9IChjaGVjayA9PT0gJ2lmJyB8fCBjaGVjayA9PT0gJ3doaWxlJyB8fCBjaGVjayA9PT0gJ2ZvcicgfHwgY2hlY2sgPT09ICd3aXRoJyk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICd9JzpcbiAgICAgICAgICAgIC8vIERpdmlkaW5nIGEgZnVuY3Rpb24gYnkgYW55dGhpbmcgbWFrZXMgbGl0dGxlIHNlbnNlLFxuICAgICAgICAgICAgLy8gYnV0IHdlIGhhdmUgdG8gY2hlY2sgZm9yIHRoYXQuXG4gICAgICAgICAgICByZWdleCA9IGZhbHNlO1xuICAgICAgICAgICAgaWYgKHRlc3RLZXl3b3JkKGV4dHJhLnRva2VuVmFsdWVzW2V4dHJhLm9wZW5DdXJseVRva2VuIC0gM10pKSB7XG4gICAgICAgICAgICAgICAgLy8gQW5vbnltb3VzIGZ1bmN0aW9uLCBlLmcuIGZ1bmN0aW9uKCl7fSAvNDJcbiAgICAgICAgICAgICAgICBjaGVjayA9IGV4dHJhLnRva2VuVmFsdWVzW2V4dHJhLm9wZW5DdXJseVRva2VuIC0gNF07XG4gICAgICAgICAgICAgICAgcmVnZXggPSBjaGVjayA/IChGbkV4cHJUb2tlbnMuaW5kZXhPZihjaGVjaykgPCAwKSA6IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0ZXN0S2V5d29yZChleHRyYS50b2tlblZhbHVlc1tleHRyYS5vcGVuQ3VybHlUb2tlbiAtIDRdKSkge1xuICAgICAgICAgICAgICAgIC8vIE5hbWVkIGZ1bmN0aW9uLCBlLmcuIGZ1bmN0aW9uIGYoKXt9IC80Mi9cbiAgICAgICAgICAgICAgICBjaGVjayA9IGV4dHJhLnRva2VuVmFsdWVzW2V4dHJhLm9wZW5DdXJseVRva2VuIC0gNV07XG4gICAgICAgICAgICAgICAgcmVnZXggPSBjaGVjayA/IChGbkV4cHJUb2tlbnMuaW5kZXhPZihjaGVjaykgPCAwKSA6IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVnZXggPyBjb2xsZWN0UmVnZXgoKSA6IHNjYW5QdW5jdHVhdG9yKCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gYWR2YW5jZSgpIHtcbiAgICAgICAgdmFyIGNwLCB0b2tlbjtcblxuICAgICAgICBpZiAoaW5kZXggPj0gbGVuZ3RoKSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHR5cGU6IFRva2VuLkVPRixcbiAgICAgICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbmRleCxcbiAgICAgICAgICAgICAgICBlbmQ6IGluZGV4XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgY3AgPSBzb3VyY2UuY2hhckNvZGVBdChpbmRleCk7XG5cbiAgICAgICAgaWYgKGlzSWRlbnRpZmllclN0YXJ0KGNwKSkge1xuICAgICAgICAgICAgdG9rZW4gPSBzY2FuSWRlbnRpZmllcigpO1xuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiBpc1N0cmljdE1vZGVSZXNlcnZlZFdvcmQodG9rZW4udmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4udHlwZSA9IFRva2VuLktleXdvcmQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdG9rZW47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBWZXJ5IGNvbW1vbjogKCBhbmQgKSBhbmQgO1xuICAgICAgICBpZiAoY3AgPT09IDB4MjggfHwgY3AgPT09IDB4MjkgfHwgY3AgPT09IDB4M0IpIHtcbiAgICAgICAgICAgIHJldHVybiBzY2FuUHVuY3R1YXRvcigpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU3RyaW5nIGxpdGVyYWwgc3RhcnRzIHdpdGggc2luZ2xlIHF1b3RlIChVKzAwMjcpIG9yIGRvdWJsZSBxdW90ZSAoVSswMDIyKS5cbiAgICAgICAgaWYgKGNwID09PSAweDI3IHx8IGNwID09PSAweDIyKSB7XG4gICAgICAgICAgICByZXR1cm4gc2NhblN0cmluZ0xpdGVyYWwoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIERvdCAoLikgVSswMDJFIGNhbiBhbHNvIHN0YXJ0IGEgZmxvYXRpbmctcG9pbnQgbnVtYmVyLCBoZW5jZSB0aGUgbmVlZFxuICAgICAgICAvLyB0byBjaGVjayB0aGUgbmV4dCBjaGFyYWN0ZXIuXG4gICAgICAgIGlmIChjcCA9PT0gMHgyRSkge1xuICAgICAgICAgICAgaWY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gICAgICBpZiAoaXNJZGVudGlmaWVyU3RhcnQoY3ApKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNjYW5JZGVudGlmaWVyKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gc2NhblB1bmN0dWF0b3IoKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb2xsZWN0VG9rZW4oKSB7XG4gICAgICAgIHZhciBsb2MsIHRva2VuLCB2YWx1ZSwgZW50cnk7XG5cbiAgICAgICAgbG9jID0ge1xuICAgICAgICAgICAgc3RhcnQ6IHtcbiAgICAgICAgICAgICAgICBsaW5lOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGNvbHVtbjogaW5kZXggLSBsaW5lU3RhcnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICB0b2tlbiA9IGFkdmFuY2UoKTtcbiAgICAgICAgbG9jLmVuZCA9IHtcbiAgICAgICAgICAgIGxpbmU6IGxpbmVOdW1iZXIsXG4gICAgICAgICAgICBjb2x1bW46IGluZGV4IC0gbGluZVN0YXJ0XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKHRva2VuLnR5cGUgIT09IFRva2VuLkVPRikge1xuICAgICAgICAgICAgdmFsdWUgPSBzb3VyY2Uuc2xpY2UodG9rZW4uc3RhcnQsIHRva2VuLmVuZCk7XG4gICAgICAgICAgICBlbnRyeSA9IHtcbiAgICAgICAgICAgICAgICB0eXBlOiBUb2tlbk5hbWVbdG9rZW4udHlwZV0sXG4gICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLFxuICAgICAgICAgICAgICAgIHJhbmdlOiBbdG9rZW4uc3RhcnQsIHRva2VuLmVuZF0sXG4gICAgICAgICAgICAgICAgbG9jOiBsb2NcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAodG9rZW4ucmVnZXgpIHtcbiAgICAgICAgICAgICAgICBlbnRyeS5yZWdleCA9IHtcbiAgICAgICAgICAgICAgICAgICAgcGF0dGVybjogdG9rZW4ucmVnZXgucGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3M6IHRva2VuLnJlZ2V4LmZsYWdzXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChleHRyYS50b2tlblZhbHVlcykge1xuICAgICAgICAgICAgICAgIGV4dHJhLnRva2VuVmFsdWVzLnB1c2goKGVudHJ5LnR5cGUgPT09ICdQdW5jdHVhdG9yJyB8fCBlbnRyeS50eXBlID09PSAnS2V5d29yZCcpID8gZW50cnkudmFsdWUgOiBudWxsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChleHRyYS50b2tlbml6ZSkge1xuICAgICAgICAgICAgICAgIGlmICghZXh0cmEucmFuZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGVudHJ5LnJhbmdlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIWV4dHJhLmxvYykge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgZW50cnkubG9jO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoZXh0cmEuZGVsZWdhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgZW50cnkgPSBleHRyYS5kZWxlZ2F0ZShlbnRyeSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXh0cmEudG9rZW5zLnB1c2goZW50cnkpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRva2VuO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxleCgpIHtcbiAgICAgICAgdmFyIHRva2VuO1xuICAgICAgICBzY2FubmluZyA9IHRydWU7XG5cbiAgICAgICAgbGFzdEluZGV4ID0gaW5kZXg7XG4gICAgICAgIGxhc3RMaW5lTnVtYmVyID0gbGluZU51bWJlcjtcbiAgICAgICAgbGF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LnByb3RvdHlwZSA9IHtcblxuICAgICAgICBwcm9jZXNzQ29tbWVudDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGxhc3RDaGlsZCxcbiAgICAgICAgICAgICAgICBpbm5lckNvbW1lbnRzLFxuICAgICAgICAgICAgICAgIGxlYWRpbmdDb21tZW50cyxcbiAgICAgICAgICAgICAgICB0cmFpbGluZ0NvbW1lbnRzLFxuICAgICAgICAgICAgICAgIGJvdHRvbVJpZ2h0ID0gZXh0cmEuYm90dG9tUmlnaHRTdGFjayxcbiAgICAgICAgICAgICAgICBpLFxuICAgICAgICAgICAgICAgIGNvbW1lbnQsXG4gICAgICAgICAgICAgICAgbGFzdCA9IGJvdHRvbVJpZ2h0W2JvdHRvbVJpZ2h0Lmxlbmd0aCAtIDFdO1xuXG4gICAgICAgICAgICBpZiAodGhpcy50eXBlID09PSBTeW50YXguUHJvZ3JhbSkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmJvZHkubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBwYXRjaCBpbm5uZXJDb21tZW50cyBmb3IgcHJvcGVydGllcyBlbXB0eSBibG9ja1xuICAgICAgICAgICAgICogYGZ1bmN0aW9uIGEoKSB7LyoqIGNvbW1lbnRzICoqXFwvfWBcbiAgICAgICAgICAgICAqL1xuXG4gICAgICAgICAgICBpZiAodGhpcy50eXBlID09PSBTeW50YXguQmxvY2tTdGF0ZW1lbnQgJiYgdGhpcy5ib2R5Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGlubmVyQ29tbWVudHMgPSBbXTtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSBleHRyYS5sZWFkaW5nQ29tbWVudHMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tbWVudCA9IGV4dHJhLmxlYWRpbmdDb21tZW50c1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucmFuZ2VbMV0gPj0gY29tbWVudC5yYW5nZVsxXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5uZXJDb21tZW50cy51bnNoaWZ0KGNvbW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEubGVhZGluZ0NvbW1lbnRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLnRyYWlsaW5nQ29tbWVudHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpbm5lckNvbW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmlubmVyQ29tbWVudHMgPSBpbm5lckNvbW1lbnRzO1xuICAgICAgICAgICAgICAgICAgICAvL2JvdHRvbVJpZ2h0LnB1c2godGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChleHRyYS50cmFpbGluZ0NvbW1lbnRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICB0cmFpbGluZ0NvbW1lbnRzID0gW107XG4gICAgICAgICAgICAgICAgZm9yIChpID0gZXh0cmEudHJhaWxpbmdDb21tZW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICAgICAgICAgICAgICBjb21tZW50ID0gZXh0cmEudHJhaWxpbmdDb21tZW50c1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1lbnQucmFuZ2VbMF0gPj0gdGhpcy5yYW5nZVsxXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhaWxpbmdDb21tZW50cy51bnNoaWZ0KGNvbW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEudHJhaWxpbmdDb21tZW50cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZXh0cmEudHJhaWxpbmdDb21tZW50cyA9IFtdO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAobGFzdCAmJiBsYXN0LnRyYWlsaW5nQ29tbWVudHMgJiYgbGFzdC50cmFpbGluZ0NvbW1lbnRzWzBdLnJhbmdlWzBdID49IHRoaXMucmFuZ2VbMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhaWxpbmdDb21tZW50cyA9IGxhc3QudHJhaWxpbmdDb21tZW50cztcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGxhc3QudHJhaWxpbmdDb21tZW50cztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEVhdGluZyB0aGUgc3RhY2suXG4gICAgICAgICAgICB3aGlsZSAobGFzdCAmJiBsYXN0LnJhbmdlWzBdID49IHRoaXMucmFuZ2VbMF0pIHtcbiAgICAgICAgICAgICAgICBsYXN0Q2hpbGQgPSBib3R0b21SaWdodC5wb3AoKTtcbiAgICAgICAgICAgICAgICBsYXN0ID0gYm90dG9tUmlnaHRbYm90dG9tUmlnaHQubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChsYXN0Q2hpbGQpIHtcbiAgICAgICAgICAgICAgICBpZiAobGFzdENoaWxkLmxlYWRpbmdDb21tZW50cykge1xuICAgICAgICAgICAgICAgICAgICBsZWFkaW5nQ29tbWVudHMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gbGFzdENoaWxkLmxlYWRpbmdDb21tZW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29tbWVudCA9IGxhc3RDaGlsZC5sZWFkaW5nQ29tbWVudHNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWVudC5yYW5nZVsxXSA8PSB0aGlzLnJhbmdlWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVhZGluZ0NvbW1lbnRzLnVuc2hpZnQoY29tbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdENoaWxkLmxlYWRpbmdDb21tZW50cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAoIWxhc3RDaGlsZC5sZWFkaW5nQ29tbWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXN0Q2hpbGQubGVhZGluZ0NvbW1lbnRzID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChleHRyYS5sZWFkaW5nQ29tbWVudHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGxlYWRpbmdDb21tZW50cyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IGV4dHJhLmxlYWRpbmdDb21tZW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICAgICAgICAgICAgICBjb21tZW50ID0gZXh0cmEubGVhZGluZ0NvbW1lbnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWVudC5yYW5nZVsxXSA8PSB0aGlzLnJhbmdlWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZWFkaW5nQ29tbWVudHMudW5zaGlmdChjb21tZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmxlYWRpbmdDb21tZW50cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgaWYgKGxlYWRpbmdDb21tZW50cyAmJiBsZWFkaW5nQ29tbWVudHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMubGVhZGluZ0NvbW1lbnRzID0gbGVhZGluZ0NvbW1lbnRzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRyYWlsaW5nQ29tbWVudHMgJiYgdHJhaWxpbmdDb21tZW50cy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy50cmFpbGluZ0NvbW1lbnRzID0gdHJhaWxpbmdDb21tZW50cztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYm90dG9tUmlnaHQucHVzaCh0aGlzKTtcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2g6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmIChleHRyYS5yYW5nZSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmFuZ2VbMV0gPSBsYXN0SW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXh0cmEubG9jKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sb2MuZW5kID0ge1xuICAgICAgICAgICAgICAgICAgICBsaW5lOiBsYXN0TGluZU51bWJlcixcbiAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBsYXN0SW5kZXggLSBsYXN0TGluZVN0YXJ0XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoZXh0cmEuc291cmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubG9jLnNvdXJjZSA9IGV4dHJhLnNvdXJjZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChleHRyYS5hdHRhY2hDb21tZW50KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5wcm9jZXNzQ29tbWVudCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEFycmF5RXhwcmVzc2lvbjogZnVuY3Rpb24gKGVsZW1lbnRzKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQXJyYXlFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5lbGVtZW50cyA9IGVsZW1lbnRzO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEFycmF5UGF0dGVybjogZnVuY3Rpb24gKGVsZW1lbnRzKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQXJyYXlQYXR0ZXJuO1xuICAgICAgICAgICAgdGhpcy5lbGVtZW50cyA9IGVsZW1lbnRzO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEFycm93RnVuY3Rpb25FeHByZXNzaW9uOiBmdW5jdGlvbiAocGFyYW1zLCBkZWZhdWx0cywgYm9keSwgZXhwcmVzc2lvbikge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5pZCA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLnBhcmFtcyA9IHBhcmFtcztcbiAgICAgICAgICAgIHRoaXMuZGVmYXVsdHMgPSBkZWZhdWx0cztcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmdlbmVyYXRvciA9IGZhbHNlO1xuICAgICAgICAgICAgdGhpcy5leHByZXNzaW9uID0gZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hBc3NpZ25tZW50RXhwcmVzc2lvbjogZnVuY3Rpb24gKG9wZXJhdG9yLCBsZWZ0LCByaWdodCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkFzc2lnbm1lbnRFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5vcGVyYXRvciA9IG9wZXJhdG9yO1xuICAgICAgICAgICAgdGhpcy5sZWZ0ID0gbGVmdDtcbiAgICAgICAgICAgIHRoaXMucmlnaHQgPSByaWdodDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hBc3NpZ25tZW50UGF0dGVybjogZnVuY3Rpb24gKGxlZnQsIHJpZ2h0KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQXNzaWdubWVudFBhdHRlcm47XG4gICAgICAgICAgICB0aGlzLmxlZnQgPSBsZWZ0O1xuICAgICAgICAgICAgdGhpcy5yaWdodCA9IHJpZ2h0O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEJpbmFyeUV4cHJlc3Npb246IGZ1bmN0aW9uIChvcGVyYXRvciwgbGVmdCwgcmlnaHQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IChvcGVyYXRvciA9PT0gJ3x8JyB8fCBvcGVyYXRvciA9PT0gJyYmJykgPyBTeW50YXguTG9naWNhbEV4cHJlc3Npb24gOiBTeW50YXguQmluYXJ5RXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMub3BlcmF0b3IgPSBvcGVyYXRvcjtcbiAgICAgICAgICAgIHRoaXMubGVmdCA9IGxlZnQ7XG4gICAgICAgICAgICB0aGlzLnJpZ2h0ID0gcmlnaHQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQmxvY2tTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChib2R5KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQmxvY2tTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmJvZHkgPSBib2R5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEJyZWFrU3RhdGVtZW50OiBmdW5jdGlvbiAobGFiZWwpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5CcmVha1N0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMubGFiZWwgPSBsYWJlbDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDYWxsRXhwcmVzc2lvbjogZnVuY3Rpb24gKGNhbGxlZSwgYXJncykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkNhbGxFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5jYWxsZWUgPSBjYWxsZWU7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50cyA9IGFyZ3M7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQ2F0Y2hDbGF1c2U6IGZ1bmN0aW9uIChwYXJhbSwgYm9keSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkNhdGNoQ2xhdXNlO1xuICAgICAgICAgICAgdGhpcy5wYXJhbSA9IHBhcmFtO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDbGFzc0JvZHk6IGZ1bmN0aW9uIChib2R5KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguQ2xhc3NCb2R5O1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDbGFzc0RlY2xhcmF0aW9uOiBmdW5jdGlvbiAoaWQsIHN1cGVyQ2xhc3MsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5DbGFzc0RlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5pZCA9IGlkO1xuICAgICAgICAgICAgdGhpcy5zdXBlckNsYXNzID0gc3VwZXJDbGFzcztcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoQ2xhc3NFeHByZXNzaW9uOiBmdW5jdGlvbiAoaWQsIHN1cGVyQ2xhc3MsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5DbGFzc0V4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLmlkID0gaWQ7XG4gICAgICAgICAgICB0aGlzLnN1cGVyQ2xhc3MgPSBzdXBlckNsYXNzO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hDb25kaXRpb25hbEV4cHJlc3Npb246IGZ1bmN0aW9uICh0ZXN0LCBjb25zZXF1ZW50LCBhbHRlcm5hdGUpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Db25kaXRpb25hbEV4cHJlc3Npb247XG4gICAgICAgICAgICB0aGlzLnRlc3QgPSB0ZXN0O1xuICAgICAgICAgICAgdGhpcy5jb25zZXF1ZW50ID0gY29uc2VxdWVudDtcbiAgICAgICAgICAgIHRoaXMuYWx0ZXJuYXRlID0gYWx0ZXJuYXRlO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaENvbnRpbnVlU3RhdGVtZW50OiBmdW5jdGlvbiAobGFiZWwpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Db250aW51ZVN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMubGFiZWwgPSBsYWJlbDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hEZWJ1Z2dlclN0YXRlbWVudDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkRlYnVnZ2VyU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaERvV2hpbGVTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChib2R5LCB0ZXN0KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRG9XaGlsZVN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMuYm9keSA9IGJvZHk7XG4gICAgICAgICAgICB0aGlzLnRlc3QgPSB0ZXN0O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEVtcHR5U3RhdGVtZW50OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguRW1wdHlTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRXhwcmVzc2lvblN0YXRlbWVudDogZnVuY3Rpb24gKGV4cHJlc3Npb24pIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5FeHByZXNzaW9uU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5leHByZXNzaW9uID0gZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hGb3JTdGF0ZW1lbnQ6IGZ1bmN0aW9uIChpbml0LCB0ZXN0LCB1cGRhdGUsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Gb3JTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmluaXQgPSBpbml0O1xuICAgICAgICAgICAgdGhpcy50ZXN0ID0gdGVzdDtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlID0gdXBkYXRlO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hGb3JPZlN0YXRlbWVudDogZnVuY3Rpb24gKGxlZnQsIHJpZ2h0LCBib2R5KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50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gICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRnVuY3Rpb25FeHByZXNzaW9uOiBmdW5jdGlvbiAoaWQsIHBhcmFtcywgZGVmYXVsdHMsIGJvZHksIGdlbmVyYXRvcikge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkZ1bmN0aW9uRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuaWQgPSBpZDtcbiAgICAgICAgICAgIHRoaXMucGFyYW1zID0gcGFyYW1zO1xuICAgICAgICAgICAgdGhpcy5kZWZhdWx0cyA9IGRlZmF1bHRzO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZ2VuZXJhdG9yID0gZ2VuZXJhdG9yO1xuICAgICAgICAgICAgdGhpcy5leHByZXNzaW9uID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoSWRlbnRpZmllcjogZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5JZGVudGlmaWVyO1xuICAgICAgICAgICAgdGhpcy5uYW1lID0gbmFtZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hJZlN0YXRlbWVudDogZnVuY3Rpb24gKHRlc3QsIGNvbnNlcXVlbnQsIGFsdGVybmF0ZSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LklmU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy50ZXN0ID0gdGVzdDtcbiAgICAgICAgICAgIHRoaXMuY29uc2VxdWVudCA9IGNvbnNlcXVlbnQ7XG4gICAgICAgICAgICB0aGlzLmFsdGVybmF0ZSA9IGFsdGVybmF0ZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hMYWJlbGVkU3RhdGVtZW50OiBmdW5jdGlvbiAobGFiZWwsIGJvZHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5MYWJlbGVkU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5sYWJlbCA9IGxhYmVsO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hMaXRlcmFsOiBmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5MaXRlcmFsO1xuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IHRva2VuLnZhbHVlO1xuICAgICAgICAgICAgdGhpcy5yYXcgPSBzb3VyY2Uuc2xpY2UodG9rZW4uc3RhcnQsIHRva2VuLmVuZCk7XG4gICAgICAgICAgICBpZiAodG9rZW4ucmVnZXgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlZ2V4ID0gdG9rZW4ucmVnZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoTWVtYmVyRXhwcmVzc2lvbjogZnVuY3Rpb24gKGFjY2Vzc29yLCBvYmplY3QsIHByb3BlcnR5KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguTWVtYmVyRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuY29tcHV0ZWQgPSBhY2Nlc3NvciA9PT0gJ1snO1xuICAgICAgICAgICAgdGhpcy5vYmplY3QgPSBvYmplY3Q7XG4gICAgICAgICAgICB0aGlzLnByb3BlcnR5ID0gcHJvcGVydHk7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoTWV0YVByb3BlcnR5OiBmdW5jdGlvbiAobWV0YSwgcHJvcGVydHkpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5NZXRhUHJvcGVydHk7XG4gICAgICAgICAgICB0aGlzLm1ldGEgPSBtZXRhO1xuICAgICAgICAgICAgdGhpcy5wcm9wZXJ0eSA9IHByb3BlcnR5O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaE5ld0V4cHJlc3Npb246IGZ1bmN0aW9uIChjYWxsZWUsIGFyZ3MpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5OZXdFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5jYWxsZWUgPSBjYWxsZWU7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50cyA9IGFyZ3M7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoT2JqZWN0RXhwcmVzc2lvbjogZnVuY3Rpb24gKHByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5PYmplY3RFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5wcm9wZXJ0aWVzID0gcHJvcGVydGllcztcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hPYmplY3RQYXR0ZXJuOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4Lk9iamVjdFBhdHRlcm47XG4gICAgICAgICAgICB0aGlzLnByb3BlcnRpZXMgPSBwcm9wZXJ0aWVzO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFBvc3RmaXhFeHByZXNzaW9uOiBmdW5jdGlvbiAob3BlcmF0b3IsIGFyZ3VtZW50KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVXBkYXRlRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMub3BlcmF0b3IgPSBvcGVyYXRvcjtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnQgPSBhcmd1bWVudDtcbiAgICAgICAgICAgIHRoaXMucHJlZml4ID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoUHJvZ3JhbTogZnVuY3Rpb24gKGJvZHksIHNvdXJjZVR5cGUpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Qcm9ncmFtO1xuICAgICAgICAgICAgdGhpcy5ib2R5ID0gYm9keTtcbiAgICAgICAgICAgIHRoaXMuc291cmNlVHlwZSA9IHNvdXJjZVR5cGU7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoUHJvcGVydHk6IGZ1bmN0aW9uIChraW5kLCBrZXksIGNvbXB1dGVkLCB2YWx1ZSwgbWV0aG9kLCBzaG9ydGhhbmQpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5Qcm9wZXJ0eTtcbiAgICAgICAgICAgIHRoaXMua2V5ID0ga2V5O1xuICAgICAgICAgICAgdGhpcy5jb21wdXRlZCA9IGNvbXB1dGVkO1xuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy5raW5kID0ga2luZDtcbiAgICAgICAgICAgIHRoaXMubWV0aG9kID0gbWV0aG9kO1xuICAgICAgICAgICAgdGhpcy5zaG9ydGhhbmQgPSBzaG9ydGhhbmQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoUmVzdEVsZW1lbnQ6IGZ1bmN0aW9uIChhcmd1bWVudCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlJlc3RFbGVtZW50O1xuICAgICAgICAgICAgdGhpcy5hcmd1bWVudCA9IGFyZ3VtZW50O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFJldHVyblN0YXRlbWVudDogZnVuY3Rpb24gKGFyZ3VtZW50KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguUmV0dXJuU3RhdGVtZW50O1xuICAgICAgICAgICAgdGhpcy5hcmd1bWVudCA9IGFyZ3VtZW50O1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFNlcXVlbmNlRXhwcmVzc2lvbjogZnVuY3Rpb24gKGV4cHJlc3Npb25zKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguU2VxdWVuY2VFeHByZXNzaW9uO1xuICAgICAgICAgICAgdGhpcy5leHBy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Q7XG4gICAgICAgICAgICB0aGlzLmNhc2VzID0gY2FzZXM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoVGFnZ2VkVGVtcGxhdGVFeHByZXNzaW9uOiBmdW5jdGlvbiAodGFnLCBxdWFzaSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlRhZ2dlZFRlbXBsYXRlRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMudGFnID0gdGFnO1xuICAgICAgICAgICAgdGhpcy5xdWFzaSA9IHF1YXNpO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFRlbXBsYXRlRWxlbWVudDogZnVuY3Rpb24gKHZhbHVlLCB0YWlsKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVGVtcGxhdGVFbGVtZW50O1xuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IHZhbHVlO1xuICAgICAgICAgICAgdGhpcy50YWlsID0gdGFpbDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hUZW1wbGF0ZUxpdGVyYWw6IGZ1bmN0aW9uIChxdWFzaXMsIGV4cHJlc3Npb25zKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVGVtcGxhdGVMaXRlcmFsO1xuICAgICAgICAgICAgdGhpcy5xdWFzaXMgPSBxdWFzaXM7XG4gICAgICAgICAgICB0aGlzLmV4cHJlc3Npb25zID0gZXhwcmVzc2lvbnM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoVGhpc0V4cHJlc3Npb246IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5UaGlzRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hUaHJvd1N0YXRlbWVudDogZnVuY3Rpb24gKGFyZ3VtZW50KSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVGhyb3dTdGF0ZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmFyZ3VtZW50ID0gYXJndW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoVHJ5U3RhdGVtZW50OiBmdW5jdGlvbiAoYmxvY2ssIGhhbmRsZXIsIGZpbmFsaXplcikge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LlRyeVN0YXRlbWVudDtcbiAgICAgICAgICAgIHRoaXMuYmxvY2sgPSBibG9jaztcbiAgICAgICAgICAgIHRoaXMuZ3VhcmRlZEhhbmRsZXJzID0gW107XG4gICAgICAgICAgICB0aGlzLmhhbmRsZXJzID0gaGFuZGxlciA/IFtoYW5kbGVyXSA6IFtdO1xuICAgICAgICAgICAgdGhpcy5oYW5kbGVyID0gaGFuZGxlcjtcbiAgICAgICAgICAgIHRoaXMuZmluYWxpemVyID0gZmluYWxpemVyO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFVuYXJ5RXhwcmVzc2lvbjogZnVuY3Rpb24gKG9wZXJhdG9yLCBhcmd1bWVudCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gKG9wZXJhdG9yID09PSAnKysnIHx8IG9wZXJhdG9yID09PSAnLS0nKSA/IFN5bnRheC5VcGRhdGVFeHByZXNzaW9uIDogU3ludGF4LlVuYXJ5RXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMub3BlcmF0b3IgPSBvcGVyYXRvcjtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnQgPSBhcmd1bWVudDtcbiAgICAgICAgICAgIHRoaXMucHJlZml4ID0gdHJ1ZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hWYXJpYWJsZURlY2xhcmF0aW9uOiBmdW5jdGlvbiAoZGVjbGFyYXRpb25zKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVmFyaWFibGVEZWNsYXJhdGlvbjtcbiAgICAgICAgICAgIHRoaXMuZGVjbGFyYXRpb25zID0gZGVjbGFyYXRpb25zO1xuICAgICAgICAgICAgdGhpcy5raW5kID0gJ3Zhcic7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoTGV4aWNhbERlY2xhcmF0aW9uOiBmdW5jdGlvbiAoZGVjbGFyYXRpb25zLCBraW5kKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguVmFyaWFibGVEZWNsYXJhdGlvbjtcbiAgICAgICAgICAgIHRoaXMuZGVjbGFyYXRpb25zID0gZGVjbGFyYXRpb25zO1xuICAgICAgICAgICAgdGhpcy5raW5kID0ga2luZDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hWYXJpYWJsZURlY2xhcmF0b3I6IGZ1bmN0aW9uIChpZCwgaW5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XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoSW1wb3J0RGVmYXVsdFNwZWNpZmllcjogZnVuY3Rpb24gKGxvY2FsKSB7XG4gICAgICAgICAgICB0aGlzLnR5cGUgPSBTeW50YXguSW1wb3J0RGVmYXVsdFNwZWNpZmllcjtcbiAgICAgICAgICAgIHRoaXMubG9jYWwgPSBsb2NhbDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hJbXBvcnROYW1lc3BhY2VTcGVjaWZpZXI6IGZ1bmN0aW9uIChsb2NhbCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkltcG9ydE5hbWVzcGFjZVNwZWNpZmllcjtcbiAgICAgICAgICAgIHRoaXMubG9jYWwgPSBsb2NhbDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hFeHBvcnROYW1lZERlY2xhcmF0aW9uOiBmdW5jdGlvbiAoZGVjbGFyYXRpb24sIHNwZWNpZmllcnMsIHNyYykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkV4cG9ydE5hbWVkRGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLmRlY2xhcmF0aW9uID0gZGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLnNwZWNpZmllcnMgPSBzcGVjaWZpZXJzO1xuICAgICAgICAgICAgdGhpcy5zb3VyY2UgPSBzcmM7XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uOiBmdW5jdGlvbiAoZGVjbGFyYXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5FeHBvcnREZWZhdWx0RGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLmRlY2xhcmF0aW9uID0gZGVjbGFyYXRpb247XG4gICAgICAgICAgICB0aGlzLmZpbmlzaCgpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZmluaXNoRXhwb3J0QWxsRGVjbGFyYXRpb246IGZ1bmN0aW9uIChzcmMpIHtcbiAgICAgICAgICAgIHRoaXMudHlwZSA9IFN5bnRheC5FeHBvcnRBbGxEZWNsYXJhdGlvbjtcbiAgICAgICAgICAgIHRoaXMuc291cmNlID0gc3JjO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaEltcG9ydFNwZWNpZmllcjogZnVuY3Rpb24gKGxvY2FsLCBpbXBvcnRlZCkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkltcG9ydFNwZWNpZmllcjtcbiAgICAgICAgICAgIHRoaXMubG9jYWwgPSBsb2NhbCB8fCBpbXBvcnRlZDtcbiAgICAgICAgICAgIHRoaXMuaW1wb3J0ZWQgPSBpbXBvcnRlZDtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSxcblxuICAgICAgICBmaW5pc2hJbXBvcnREZWNsYXJhdGlvbjogZnVuY3Rpb24gKHNwZWNpZmllcnMsIHNyYykge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LkltcG9ydERlY2xhcmF0aW9uO1xuICAgICAgICAgICAgdGhpcy5zcGVjaWZpZXJzID0gc3BlY2lmaWVycztcbiAgICAgICAgICAgIHRoaXMuc291cmNlID0gc3JjO1xuICAgICAgICAgICAgdGhpcy5maW5pc2goKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9LFxuXG4gICAgICAgIGZpbmlzaFlpZWxkRXhwcmVzc2lvbjogZnVuY3Rpb24gKGFyZ3VtZW50LCBkZWxlZ2F0ZSkge1xuICAgICAgICAgICAgdGhpcy50eXBlID0gU3ludGF4LllpZWxkRXhwcmVzc2lvbjtcbiAgICAgICAgICAgIHRoaXMuYXJndW1lbnQgPSBhcmd1bWVudDtcbiAgICAgICAgICAgIHRoaXMuZGVsZWdhdGUgPSBkZWxlZ2F0ZTtcbiAgICAgICAgICAgIHRoaXMuZmluaXNoKCk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgIH07XG5cblxuICAgIGZ1bmN0aW9uIHJlY29yZEVycm9yKGVycm9yKSB7XG4gICAgICAgIHZhciBlLCBleGlzdGluZztcblxuICAgICAgICBmb3IgKGUgPSAwOyBlIDwgZXh0cmEuZXJyb3JzLmxlbmd0aDsgZSsrKSB7XG4gICAgICAgICAgICBleGlzdGluZyA9IGV4dHJhLmVycm9yc1tlXTtcbiAgICAgICAgICAgIC8vIFByZXZlbnQgZHVwbGljYXRlZCBlcnJvci5cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICBpZiAoZXhpc3RpbmcuaW5kZXggPT09IGVycm9yLmluZGV4ICYmIGV4aXN0aW5nLm1lc3NhZ2UgPT09IGVycm9yLm1lc3NhZ2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHRyYS5lcnJvcnMucHVzaChlcnJvcik7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY29uc3RydWN0RXJyb3IobXNnLCBjb2x1bW4pIHtcbiAgICAgICAgdmFyIGVycm9yID0gbmV3IEVycm9yKG1zZyk7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICB0aHJvdyBlcnJvcjtcbiAgICAgICAgfSBjYXRjaCAoYmFzZSkge1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICAgICAgICAgIGlmIChPYmplY3QuY3JlYXRlICYmIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSkge1xuICAgICAgICAgICAgICAgIGVycm9yID0gT2JqZWN0LmNyZWF0ZShiYXNlKTtcbiAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZXJyb3IsICdjb2x1bW4nLCB7IHZhbHVlOiBjb2x1bW4gfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgICByZXR1cm4gZXJyb3I7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjcmVhdGVFcnJvcihsaW5lLCBwb3MsIGRlc2NyaXB0aW9uKSB7XG4gICAgICAgIHZhciBtc2csIGNvbHVtbiwgZXJyb3I7XG5cbiAgICAgICAgbXNnID0gJ0xpbmUgJyArIGxpbmUgKyAnOiAnICsgZGVzY3JpcHRpb247XG4gICAgICAgIGNvbHVtbiA9IHBvcyAtIChzY2FubmluZyA/IGxpbmVTdGFydCA6IGxhc3RMaW5lU3RhcnQpICsgMTtcbiAgICAgICAgZXJyb3IgPSBjb25zdHJ1Y3RFcnJvcihtc2csIGNvbHVtbik7XG4gICAgICAgIGVycm9yLmxpbmVOdW1iZXIgPSBsaW5lO1xuICAgICAgICBlcnJvci5kZXNjcmlwdGlvbiA9IGRlc2NyaXB0aW9uO1xuICAgICAgICBlcnJvci5pbmRleCA9IHBvcztcbiAgICAgICAgcmV0dXJuIGVycm9yO1xuICAgIH1cblxuICAgIC8vIFRocm93IGFuIGV4Y2VwdGlvblxuXG4gICAgZnVuY3Rpb24gdGhyb3dFcnJvcihtZXNzYWdlRm9ybWF0KSB7XG4gICAgICAgIHZhciBhcmd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ICAgaWYgKGV4dHJhLmVycm9ycykge1xuICAgICAgICAgICAgcmVjb3JkRXJyb3IoZXJyb3IpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgZXJyb3I7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBUaHJvdyBhbiBleGNlcHRpb24gYmVjYXVzZSBvZiB0aGUgdG9rZW4uXG5cbiAgICBmdW5jdGlvbiB1bmV4cGVjdGVkVG9rZW5FcnJvcih0b2tlbiwgbWVzc2FnZSkge1xuICAgICAgICB2YXIgdmFsdWUsIG1zZyA9IG1lc3NhZ2UgfHwgTWVzc2FnZXMuVW5leHBlY3RlZFRva2VuO1xuXG4gICAgICAgIGlmICh0b2tlbikge1xuICAgICAgICAgICAgaWYgKCFtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgbXNnID0gKHRva2VuLnR5cGUgPT09IFRva2VuLkVPRikgPyBNZXNzYWdlcy5VbmV4cGVjdGVkRU9TIDpcbiAgICAgICAgICAgICAgICAgICAgKHRva2VuLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIpID8gTWVzc2FnZXMuVW5leHBlY3RlZElkZW50aWZpZXIgOlxuICAgICAgICAgICAgICAgICAgICAodG9rZW4udHlwZSA9PT0gVG9rZW4uTnVtZXJpY0xpdGVyYWwpID8gTWVzc2FnZXMuVW5leHBlY3RlZE51bWJlciA6XG4gICAgICAgICAgICAgICAgICAgICh0b2tlbi50eXBlID09PSBUb2tlbi5TdHJpbmdMaXRlcmFsKSA/IE1lc3NhZ2VzLlVuZXhwZWN0ZWRTdHJpbmcgOlxuICAgICAgICAgICAgICAgICAgICAodG9rZW4udHlwZSA9PT0gVG9rZW4uVGVtcGxhdGUpID8gTWVzc2FnZXMuVW5leHBlY3RlZFRlbXBsYXRlIDpcbiAgICAgICAgICAgICAgICAgICAgTWVzc2FnZXMuVW5leHBlY3RlZFRva2VuO1xuXG4gICAgICAgICAgICAgICAgaWYgKHRva2VuLnR5cGUgPT09IFRva2VuLktleXdvcmQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRnV0dXJlUmVzZXJ2ZWRXb3JkKHRva2VuLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbXNnID0gTWVzc2FnZXMuVW5leHBlY3RlZFJlc2VydmVkO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0cmljdCAmJiBpc1N0cmljdE1vZGVSZXNlcnZlZFdvcmQodG9rZW4udmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtc2cgPSBNZXNzYWdlcy5TdHJpY3RSZXNlcnZlZFdvcmQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhbHVlID0gKHRva2VuLnR5cGUgPT09IFRva2VuLlRlbXBsYXRlKSA/IHRva2VuLnZhbHVlLnJhdyA6IHRva2VuLnZhbHVlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWUgPSAnSUxMRUdBTCc7XG4gICAgICAgIH1cblxuICAgICAgICBtc2cgPSBtc2cucmVwbGFjZSgnJTAnLCB2YWx1ZSk7XG5cbiAgICAgICAgcmV0dXJuICh0b2tlbiAmJiB0eXBlb2YgdG9rZW4ubGluZU51bWJlciA9PT0gJ251bWJlcicpID9cbiAgICAgICAgICAgIGNyZWF0ZUVycm9yKHRva2VuLmxpbmVOdW1iZXIsIHRva2VuLnN0YXJ0LCBtc2cpIDpcbiAgICAgICAgICAgIGNyZWF0ZUVycm9yKHNjYW5uaW5nID8gbGluZU51bWJlciA6IGxhc3RMaW5lTnVtYmVyLCBzY2FubmluZyA/IGluZGV4IDogbGFzdEluZGV4LCBtc2cpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRocm93VW5leHBlY3RlZFRva2VuKHRva2VuLCBtZXNzYWdlKSB7XG4gICAgICAgIHRocm93IHVuZXhwZWN0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xuICAgICAgICB2YXIgdG9rZW47XG5cbiAgICAgICAgaWYgKGV4dHJhLmVycm9ycykge1xuICAgICAgICAgICAgdG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gVG9rZW4uUHVuY3R1YXRvciAmJiB0b2tlbi52YWx1ZSA9PT0gJywnKSB7XG4gICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRva2VuLnR5cGUgPT09IFRva2VuLlB1bmN0dWF0b3IgJiYgdG9rZW4udmFsdWUgPT09ICc7Jykge1xuICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKHRva2VuKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdG9sZXJhdGVVbmV4cGVjdGVkVG9rZW4odG9rZW4sIE1lc3NhZ2VzLlVuZXhwZWN0ZWRUb2tlbik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBleHBlY3QoJywnKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIEV4cGVjdCB0aGUgbmV4dCB0b2tlbiB0byBtYXRjaCB0aGUgc3BlY2lmaWVkIGtleXdvcmQuXG4gICAgLy8gSWYgbm90LCBhbiBleGNlcHRpb24gd2lsbCBiZSB0aHJvd24uXG5cbiAgICBmdW5jdGlvbiBleHBlY3RLZXl3b3JkKGtleXdvcmQpIHtcbiAgICAgICAgdmFyIHRva2VuID0gbGV4KCk7XG4gICAgICAgIGlmICh0b2tlbi50eXBlICE9PSBUb2tlbi5LZXl3b3JkIHx8IHRva2VuLnZhbHVlICE9PSBrZXl3b3JkKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbih0b2tlbik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBSZXR1cm4gdHJ1ZSBpZ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SB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgb3AgPSBsb29rYWhlYWQudmFsdWU7XG4gICAgICAgIHJldHVybiBvcCA9PT0gJz0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJyo9JyB8fFxuICAgICAgICAgICAgb3AgPT09ICcvPScgfHxcbiAgICAgICAgICAgIG9wID09PSAnJT0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJys9JyB8fFxuICAgICAgICAgICAgb3AgPT09ICctPScgfHxcbiAgICAgICAgICAgIG9wID09PSAnPDw9JyB8fFxuICAgICAgICAgICAgb3AgPT09ICc+Pj0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJz4+Pj0nIHx8XG4gICAgICAgICAgICBvcCA9PT0gJyY9JyB8fFxuICAgICAgICAgICAgb3AgPT09ICdePScgfHxcbiAgICAgICAgICAgIG9wID09PSAnfD0nO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbnN1bWVTZW1pY29sb24oKSB7XG4gICAgICAgIC8vIENhdGNoIHRoZSB2ZXJ5IGNvbW1vbiBjYXNlIGZpcnN0OiBpbW1lZGlhdGVseSBhIHNlbWljb2xvbiAoVSswMDNCKS5cbiAgICAgICAgaWYgKHNvdXJjZS5jaGFyQ29kZUF0KHN0YXJ0SW5kZXgpID09PSAweDNCIHx8IG1hdGNoKCc7JykpIHtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhhc0xpbmVUZXJtaW5hdG9yKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBGSVhNRShpa2FyaWVuYXRvcik6IHRoaXMgaXMgc2VlbWluZ2x5IGFuIGlzc3VlIGluIHRoZSBwcmV2aW91cyBsb2NhdGlvbiBpbmZvIGNvbnZlbnRpb24uXG4gICAgICAgIGxhc3RJbmRleCA9IHN0YXJ0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ICAgICAgICAgICBlbGVtZW50cy5wdXNoKHJlc3ROb2RlLmZpbmlzaFJlc3RFbGVtZW50KHJlc3QpKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudHMucHVzaChwYXJzZVBhdHRlcm5XaXRoRGVmYXVsdChwYXJhbXMsIGtpbmQpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFtYXRjaCgnXScpKSB7XG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdCgnLCcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICB9XG5cbiAgICAgICAgZXhwZWN0KCddJyk7XG5cbiAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoQXJyYXlQYXR0ZXJuKGVsZW1lbnRzKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZVByb3BlcnR5UGF0dGVybihwYXJhbXMsIGtpbmQpIHtcbiAgICAgICAgdmFyIG5vZGUgPSBuZXcgTm9kZSgpLCBrZXksIGtleVRva2VuLCBjb21wdXRlZCA9IG1hdGNoKCdbJyksIGluaXQ7XG4gICAgICAgIGlmIChsb29rYWhlYWQudHlwZSA9PT0gVG9rZW4uSWRlbnRpZmllcikge1xuICAgICAgICAgICAga2V5VG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgICAgICBrZXkgPSBwYXJzZVZhcmlhYmxlSWRlbnRpZmllcigpO1xuICAgICAgICAgICAgaWYgKG1hdGNoKCc9JykpIHtcbiAgICAgICAgICAgICAgICBwYXJhbXMucHVzaChrZXlUb2tlbik7XG4gICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgaW5pdCA9IHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24oKTtcblxuICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaFByb3BlcnR5KFxuICAgICAgICAgICAgICAgICAgICAnaW5pdCcsIGtleSwgZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIG5ldyBXcmFwcGluZ05vZGUoa2V5VG9rZW4pLmZpbmlzaEFzc2lnbm1lbnRQYXR0ZXJuKGtleSwgaW5pdCksIGZhbHNlLCBmYWxzZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCFtYXRjaCgnOicpKSB7XG4gICAgICAgICAgICAgICAgcGFyYW1zLnB1c2goa2V5VG9rZW4pO1xuICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaFByb3BlcnR5KCdpbml0Jywga2V5LCBmYWxzZSwga2V5LCBmYWxzZSwgdHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSBwYXJzZU9iamVjdFByb3BlcnR5S2V5KCk7XG4gICAgICAgIH1cbiAgICAgICAgZXhwZWN0KCc6Jyk7XG4gICAgICAgIGluaXQgPSBwYXJzZVBhdHRlcm5XaXRoRGVmYXVsdChwYXJhbXMsIGtpbmQpO1xuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9wZXJ0eSgnaW5pdCcsIGtleSwgY29tcHV0ZWQsIGluaXQsIGZhbHNlLCBmYWxzZSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VPYmplY3RQYXR0ZXJuKHBhcmFtcywga2luZCkge1xuICAgICAgICB2YXIgbm9kZSA9IG5ldyBOb2RlKCksIHByb3BlcnRpZXMgPSBbXTtcblxuICAgICAgICBleHBlY3QoJ3snKTtcblxuICAgICAgICB3aGlsZSAoIW1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgIHByb3BlcnRpZXMucHVzaChwYXJzZVByb3BlcnR5UGF0dGVybihwYXJhbXMsIGtpbmQpKTtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgICAgIGV4cGVjdCgnLCcpO1xuICAg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GQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHBhcnNlUHJvcGVydHlGdW5jdGlvbihtZXRob2ROb2RlLCB7XG4gICAgICAgICAgICAgICAgICAgIHBhcmFtczogW10sXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHRzOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgc3RyaWN0ZWQ6IG51bGwsXG4gICAgICAgICAgICAgICAgICAgIGZpcnN0UmVzdHJpY3RlZDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbnVsbFxuICAgICAgICAgICAgICAgIH0sIGZhbHNlKTtcbiAgICAgICAgICAgICAgICBzdGF0ZS5hbGxvd1lpZWxkID0gcHJldmlvdXNBbGxvd1lpZWxkO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvcGVydHkoJ2dldCcsIGtleSwgY29tcHV0ZWQsIHZhbHVlLCBmYWxzZSwgZmFsc2UpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0b2tlbi52YWx1ZSA9PT0gJ3NldCcgJiYgbG9va2FoZWFkUHJvcGVydHlOYW1lKCkpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlZCA9IG1hdGNoKCdbJyk7XG4gICAgICAgICAgICAgICAga2V5ID0gcGFyc2VPYmplY3RQcm9wZXJ0eUtleSgpO1xuICAgICAgICAgICAgICAgIG1ldGhvZE5vZGUgPSBuZXcgTm9kZSgpO1xuICAgICAgICAgICAgICAgIGV4cGVjdCgnKCcpO1xuXG4gICAgICAgICAgICAgICAgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdENvdW50OiAwLFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0czogW10sXG4gICAgICAgICAgICAgICAgICAgIGZpcnN0UmVzdHJpY3RlZDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1TZXQ6IHt9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2goJyknKSkge1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93WWllbGQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VQYXJhbShvcHRpb25zKTtcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dZaWVsZCA9IHByZXZpb3VzQWxsb3dZaWVsZDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZGVmYXVsdENvdW50ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmRlZmF1bHRzID0gW107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZXhwZWN0KCcpJyk7XG5cbiAgICAgICAgICAgICAgICBzdGF0ZS5hbGxvd1lpZWxkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBwYXJzZVByb3BlcnR5RnVuY3Rpb24obWV0aG9kTm9kZSwgb3B0aW9ucywgZmFsc2UpO1xuICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93WWllbGQgPSBwcmV2aW91c0FsbG93WWllbGQ7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hQcm9wZXJ0eSgnc2V0Jywga2V5LCBjb21wdXRlZCwgdmFsdWUsIGZhbHNlLCBmYWxzZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAodG9rZW4udHlwZSA9PT0gVG9rZW4uUHVuY3R1YXRvciAmJiB0b2tlbi52YWx1ZSA9PT0gJyonICYmIGxvb2thaGVhZFByb3BlcnR5TmFtZSgpKSB7XG4gICAgICAgICAgICBjb21wdXRlZCA9IG1hdGNoKCdbJyk7XG4gICAgICAgICAgICBrZXkgPSBwYXJzZU9iamVjdFByb3BlcnR5S2V5KCk7XG4gICAgICAgICAgICBtZXRob2ROb2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICAgICAgc3RhdGUuYWxsb3dZaWVsZCA9IHRydWU7XG4gICAgICAgICAgICBwYXJhbXMgPSBwYXJzZVBhcmFtcygpO1xuICAgICAgICAgICAgc3RhdGUuYWxsb3dZaWVsZCA9IHByZXZpb3VzQWxsb3dZaWVsZDtcblxuICAgICAgICAgICAgc3RhdGUuYWxsb3dZaWVsZCA9IGZhbHNlO1xuICAgICAgICAgICAgdmFsdWUgPSBwYXJzZVByb3BlcnR5RnVuY3Rpb24obWV0aG9kTm9kZSwgcGFyYW1zLCB0cnVlKTtcbiAgICAgICAgICAgIHN0YXRlLmFsbG93WWllbGQgPSBwcmV2aW91c0FsbG93WWllbGQ7XG5cbiAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaFByb3BlcnR5KCdpbml0Jywga2V5LCBjb21wdXRlZCwgdmFsdWUsIHRydWUsIGZhbHNlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChrZXkgJiYgbWF0Y2goJygnKSkge1xuICAgICAgICAgICAgdmFsdWUgPSBwYXJzZVByb3BlcnR5TWV0aG9kRnVuY3Rpb24oKTtcbiAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaFByb3BlcnR5KCdpbml0Jywga2V5LCBjb21wdXRlZCwgdmFsdWUsIHRydWUsIGZhbHNlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIE5vdCBhIE1ldGhvZERlZmluaXRpb24uXG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlT2JqZWN0UHJvcGVydHkoaGFzUHJvdG8pIHtcbiAgICAgICAgdmFyIHRva2VuID0gbG9va2FoZWFkLCBub2RlID0gbmV3IE5vZGUoKSwgY29tcHV0ZWQsIGtleSwgbWF5YmVNZXRob2QsIHByb3RvLCB2YWx1ZTtcblxuICAgICAgICBjb21wdXRlZCA9IG1hdGNoKCdbJyk7XG4gICAgICAgIGlmIChtYXRjaCgnKicpKSB7XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9IHBhcnNlT2JqZWN0UHJvcGVydHlLZXkoKTtcbiAgICAgICAgfVxuICAgICAgICBtYXliZU1ldGhvZCA9IHRyeVBhcnNlTWV0aG9kRGVmaW5pdGlvbih0b2tlbiwga2V5LCBjb21wdXRlZCwgbm9kZSk7XG4gICAgICAgIGlmIChtYXliZU1ldGhvZCkge1xuICAgICAgICAgICAgcmV0dXJuIG1heWJlTWV0aG9kO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFrZXkpIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBDaGVjayBmb3IgZHVwbGljYXRlZCBfX3Byb3RvX19cbiAgICAgICAgaWYgKCFjb21wdXRlZCkge1xuICAgICAgICAgICAgcHJvdG8gPSAoa2V5LnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyICYmIGtleS5uYW1lID09PSAnX19wcm90b19fJykgfHxcbiAgICAgICAgICAgICAgICAoa2V5LnR5cGUgPT09IFN5bnRheC5MaXRlcmFsICYmIGtleS52YWx1ZSA9PT0gJ19fcHJvdG9fXycpO1xuICAgICAgICAgICAgaWYgKGhhc1Byb3RvLnZhbHVlICYmIHByb3RvKSB7XG4gICAgICAgICAgICAgICAgdG9sZXJhdGVFcnJvcihNZXNzYWdlcy5EdXBsaWNhdGVQcm90b1Byb3BlcnR5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhhc1Byb3RvLnZhbHVlIHw9IHByb3RvO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1hdGNoKCc6JykpIHtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgdmFsdWUgPSBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pO1xuICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvcGVydHkoJ2luaXQnLCBrZXksIGNvbXB1dGVkLCB2YWx1ZSwgZmFsc2UsIGZhbHNlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0b2tlbi50eXBlID09PSBUb2tlbi5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICBpZiAobWF0Y2goJz0nKSkge1xuICAgICAgICAgICAgICAgIGZpcnN0Q292ZXJJbml0aWFsaXplZE5hbWVFcnJvciA9IGxvb2thaGVhZDtcbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvcGVydHkoJ2luaXQnLCBrZXksIGNvbXB1dGVkLFxuICAgICAgICAgICAgICAgICAgICBuZXcgV3JhcHBpbmdOb2RlKHRva2VuKS5maW5pc2hBc3NpZ25tZW50UGF0dGVybihrZXksIHZhbHVlKSwgZmFsc2UsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvcGVydHkoJ2luaXQnLCBrZXksIGNvbXB1dGVkLCBrZXksIGZhbHNlLCB0cnVlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VPYmplY3RJbml0aWFsaXplcigpIHtcbiAgICAgICAgdmFyIHByb3BlcnRpZXMgPSBbXSwgaGFzUHJvdG8gPSB7dmFsdWU6IGZhbHNlfSwgbm9kZSA9IG5ldyBOb2RlKCk7XG5cbiAgICAgICAgZXhwZWN0KCd7Jyk7XG5cbiAgICAgICAgd2hpbGUgKCFtYXRjaCgnfScpKSB7XG4gICAgICAgICAgICBwcm9wZXJ0aWVzLnB1c2gocGFyc2VPYmplY3RQcm9wZXJ0eShoYXNQcm90bykpO1xuXG4gICAgICAgICAgICBpZiAoIW1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgICAgICBleHBlY3RDb21tYVNlcGFyYXRvcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZXhwZWN0KCd9Jyk7XG5cbiAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoT2JqZWN0RXhwcmVzc2lvbihwcm9wZXJ0aWVzKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwcikge1xuICAgICAgICB2YXIgaTtcbiAgICAgICAgc3dpdGNoIChleHByLnR5cGUpIHtcbiAgICAgICAgY2FzZSBTeW50YXguSWRlbnRpZmllcjpcbiAgICAgICAgY2FzZSBTeW50YXguTWVtYmVyRXhwcmVzc2lvbjpcbiAgICAgICAgY2FzZSBTeW50YXguUmVzdEVsZW1lbnQ6XG4gICAgICAgIGNhc2UgU3ludGF4LkFzc2lnbm1lbnRQYXR0ZXJuOlxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgU3ludGF4LlNwcmVhZEVsZW1lbnQ6XG4gICAgICAgICAgICBleHByLnR5cGUgPSBTeW50YXguUmVzdEVsZW1lbnQ7XG4gICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwci5hcmd1bWVudCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBTeW50YXguQXJyYXlFeHByZXNzaW9uOlxuICAgICAgICAgICAgZXhwci50eXBlID0gU3ludGF4LkFycmF5UGF0dGVybjtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBleHByLmVsZW1lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGV4cHIuZWxlbWVudHNbaV0gIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRFeHByZXNzaW9uQXNQYXR0ZXJuKGV4cHIuZWxlbWVudHNbaV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFN5bnRheC5PYmplY3RFeHByZXNzaW9uOlxuICAgICAgICAgICAgZXhwci50eXBlID0gU3ludGF4Lk9iamVjdFBhdHRlcm47XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZXhwci5wcm9wZXJ0aWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgcmVpbnRlcnByZXRFeHByZXNzaW9uQXNQYXR0ZXJuKGV4cHIucHJvcGVydGllc1tpXS52YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBTeW50YXguQXNzaWdubWVudEV4cHJlc3Npb246XG4gICAgICAgICAgICBleHByLnR5cGUgPSBTeW50YXguQXNzaWdubWVudFBhdHRlcm47XG4gICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwci5sZWZ0KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgLy8gQWxsb3cgb3RoZXIgbm9kZSB0eXBlIGZvciB0b2xlcmFudCBwYXJzaW5nLlxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMi4yLjkgVGVtcGxhdGUgTGl0ZXJhbHNcblxuICAgIGZ1bmN0aW9uIHBhcnNlVGVtcGxhdGVFbGVtZW50KG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VDTUEtMjYyIDEyLjIuMTAgVGhlIEdyb3VwaW5nIE9wZXJhdG9yXG5cbiAgICBmdW5jdGlvbiBwYXJzZUdyb3VwRXhwcmVzc2lvbigpIHtcbiAgICAgICAgdmFyIGV4cHIsIGV4cHJlc3Npb25zLCBzdGFydFRva2VuLCBpLCBwYXJhbXMgPSBbXTtcblxuICAgICAgICBleHBlY3QoJygnKTtcblxuICAgICAgICBpZiAobWF0Y2goJyknKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBpZiAoIW1hdGNoKCc9PicpKSB7XG4gICAgICAgICAgICAgICAgZXhwZWN0KCc9PicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlcixcbiAgICAgICAgICAgICAgICBwYXJhbXM6IFtdLFxuICAgICAgICAgICAgICAgIHJhd1BhcmFtczogW11cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICBzdGFydFRva2VuID0gbG9va2FoZWFkO1xuICAgICAgICBpZiAobWF0Y2goJy4uLicpKSB7XG4gICAgICAgICAgICBleHByID0gcGFyc2VSZXN0RWxlbWVudChwYXJhbXMpO1xuICAgICAgICAgICAgZXhwZWN0KCcpJyk7XG4gICAgICAgICAgICBpZiAoIW1hdGNoKCc9PicpKSB7XG4gICAgICAgICAgICAgICAgZXhwZWN0KCc9PicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB0eXBlOiBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlcixcbiAgICAgICAgICAgICAgICBwYXJhbXM6IFtleHByXVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSB0cnVlO1xuICAgICAgICBleHByID0gaW5oZXJpdENvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKTtcblxuICAgICAgICBpZiAobWF0Y2goJywnKSkge1xuICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gZmFsc2U7XG4gICAgICAgICAgICBleHByZXNzaW9ucyA9IFtleHByXTtcblxuICAgICAgICAgICAgd2hpbGUgKHN0YXJ0SW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIW1hdGNoKCcsJykpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxleCgpO1xuXG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoKCcuLi4nKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzQmluZGluZ0VsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZXhwcmVzc2lvbnMucHVzaChwYXJzZVJlc3RFbGVtZW50KHBhcmFtcykpO1xuICAgICAgICAgICAgICAgICAgICBleHBlY3QoJyknKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFtYXRjaCgnPT4nKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0KCc9PicpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGV4cHJlc3Npb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwcmVzc2lvbnNbaV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlcixcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtczogZXhwcmVzc2lvbnNcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9ucy5wdXNoKGluaGVyaXRDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbikpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hTZXF1ZW5jZUV4cHJlc3Npb24oZXhwcmVzc2lvbnMpO1xuICAgICAgICB9XG5cblxuICAgICAgICBleHBlY3QoJyknKTtcblxuICAgICAgICBpZiAobWF0Y2goJz0+JykpIHtcbiAgICAgICAgICAgIGlmIChleHByLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyICYmIGV4cHIubmFtZSA9PT0gJ3lpZWxkJykge1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IFBsYWNlSG9sZGVycy5BcnJvd1BhcmFtZXRlclBsYWNlSG9sZGVyLFxuICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IFtleHByXVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghaXNCaW5kaW5nRWxlbWVudCkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChleHByLnR5cGUgPT09IFN5bnRheC5TZXF1ZW5jZUV4cHJlc3Npb24pIHtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZXhwci5leHByZXNzaW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwci5leHByZXNzaW9uc1tpXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oZXhwcik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGV4cHIgPSB7XG4gICAgICAgICAgICAgICAgdHlwZTogUGxhY2VIb2xkZXJzLkFycm93UGFyYW1ldGVyUGxhY2VIb2xkZXIsXG4gICAgICAgICAgICAgICAgcGFyYW1zOiBleHByLnR5cGUgPT09IFN5bnRheC5TZXF1ZW5jZUV4cHJlc3Npb24gPyBleHByLmV4cHJlc3Npb25zIDogW2V4cHJdXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgcmV0dXJuIGV4cHI7XG4gICAgfVxuXG5cbiAgICAvLyBFQ01BLTI2MiAxMi4yIFByaW1hcnkgRXhwcmVzc2lvbnNcblxuICAgIGZ1bmN0aW9uIHBhcnNlUHJpbWFyeUV4cHJlc3Npb24oKSB7XG4gICAgICAgIHZhciB0eXBlLCB0b2tlbiwgZXhwciwgbm9kZTtcblxuICAgICAgICBpZiAobWF0Y2goJygnKSkge1xuICAgICAgICAgICAgaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgcmV0dXJuIGluaGVyaXRDb3ZlckdyYW1tYXIocGFyc2VHcm91cEV4cHJlc3Npb24pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1hdGNoKCdbJykpIHtcbiAgICAgICAgICAgIHJldHVybiBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlQXJyYXlJbml0aWFsaXplcik7XG4gICAgICAgIH1cblxuICAgICA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XdvcmQoJ3lpZWxkJykpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VOb25Db21wdXRlZFByb3BlcnR5KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIXN0cmljdCAmJiBtYXRjaEtleXdvcmQoJ2xldCcpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoSWRlbnRpZmllcihsZXgoKS52YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdmdW5jdGlvbicpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRnVuY3Rpb25FeHByZXNzaW9uKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCd0aGlzJykpIHtcbiAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hUaGlzRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1hdGNoS2V5d29yZCgnY2xhc3MnKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUNsYXNzRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obGV4KCkpO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09IFRva2VuLkJvb2xlYW5MaXRlcmFsKSB7XG4gICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgICAgICB0b2tlbiA9IGxleCgpO1xuICAgICAgICAgICAgdG9rZW4udmFsdWUgPSAodG9rZW4udmFsdWUgPT09ICd0cnVlJyk7XG4gICAgICAgICAgICBleHByID0gbm9kZS5maW5pc2hMaXRlcmFsKHRva2VuKTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSBUb2tlbi5OdWxsTGl0ZXJhbCkge1xuICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgdG9rZW4gPSBsZXgoKTtcbiAgICAgICAgICAgIHRva2VuLnZhbHVlID0gbnVsbDtcbiAgICAgICAgICAgIGV4cHIgPSBub2RlLmZpbmlzaExpdGVyYWwodG9rZW4pO1xuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCcvJykgfHwgbWF0Y2goJy89JykpIHtcbiAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgIGluZGV4ID0gc3RhcnRJbmRleDtcblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBleHRyYS50b2tlbnMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBjb2xsZWN0UmVnZXgoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSBzY2FuUmVnRXhwKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgIGV4cHIgPSBub2RlLmZpbmlzaExpdGVyYWwodG9rZW4pO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09IFRva2VuLlRlbXBsYXRlKSB7XG4gICAgICAgICAgICBleHByID0gcGFyc2VUZW1wbGF0ZUxpdGVyYWwoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxleCgpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDEyLjMgTGVmdC1IYW5kLVNpZGUgRXhwcmVzc2lvbnNcblxuICAgIGZ1bmN0aW9uIHBhcnNlQXJndW1lbnRzKCkge1xuICAgICAgICB2YXIgYXJncyA9IFtdLCBleHByO1xuXG4gICAgICAgIGV4cGVjdCgnKCcpO1xuXG4gICAgICAgIGlmICghbWF0Y2goJyknKSkge1xuICAgICAgICAgICAgd2hpbGUgKHN0YXJ0SW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2goJy4uLicpKSB7XG4gICAgICAgICAgICAgICAgICAgIGV4cHIgPSBuZXcgTm9kZSgpO1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgZXhwci5maW5pc2hTcHJlYWRFbGVtZW50KGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbikpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGV4cHIgPSBpc29sYXRlQ292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBhcmdzLnB1c2goZXhwcik7XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoKCcpJykpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGV4cGVjdENvbW1hU2VwYXJhdG9yKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3QoJyknKTtcblxuICAgICAgICByZXR1cm4gYXJncztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZU5vbkNvbXB1dGVkUHJvcGVydHkoKSB7XG4gICAgICAgIHZhciB0b2tlbiwgbm9kZSA9IG5ldyBOb2RlKCk7XG5cbiAgICAgICAgdG9rZW4gPSBsZXgoKTtcblxuICAgICAgICBpZiAoIWlzSWRlbnRpZmllck5hbWUodG9rZW4pKSB7XG4gICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbih0b2tlbik7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hJZGVudGlmaWVyKHRva2VuLnZhbHVlKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZU5vbkNvbXB1dGVkTWVtYmVyKCkge1xuICAgICAgICBleHBlY3QoJy4nKTtcblxuICAgICAgICByZXR1cm4gcGFyc2VOb25Db21wdXRlZFByb3BlcnR5KCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VDb21wdXRlZE1lbWJlcigpIHtcbiAgICAgICAgdmFyIGV4cHI7XG5cbiAgICAgICAgZXhwZWN0KCdbJyk7XG5cbiAgICAgICAgZXhwciA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VFeHByZXNzaW9uKTtcblxuICAgICAgICBleHBlY3QoJ10nKTtcblxuICAgICAgICByZXR1cm4gZXhwcjtcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMi4zLjMgVGhlIG5ldyBPcGVyYXRvclxuXG4gICAgZnVuY3Rpb24gcGFyc2VOZXdFeHByZXNzaW9uKCkge1xuICAgICAgICB2YXIgY2FsbGVlLCBhcmdzLCBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBleHBlY3RLZXl3b3JkKCduZXcnKTtcblxuICAgICAgICBpZiAobWF0Y2goJy4nKSkge1xuICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICBpZiAobG9va2FoZWFkLnR5cGUgPT09IFRva2VuLklkZW50aWZpZXIgJiYgbG9va2FoZWFkLnZhbHVlID09PSAndGFyZ2V0Jykge1xuICAgICAgICAgICAgICAgIGlmIChzdGF0ZS5pbkZ1bmN0aW9uQm9keSkge1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICA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2goJy4nKSAmJiAhbWF0Y2goJ1snKSkge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBleHByID0gaW5oZXJpdENvdmVyR3JhbW1hcihtYXRjaEtleXdvcmQoJ25ldycpID8gcGFyc2VOZXdFeHByZXNzaW9uIDogcGFyc2VQcmltYXJ5RXhwcmVzc2lvbik7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKDs7KSB7XG4gICAgICAgICAgICBpZiAobWF0Y2goJy4nKSkge1xuICAgICAgICAgICAgICAgIGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHByb3BlcnR5ID0gcGFyc2VOb25Db21wdXRlZE1lbWJlcigpO1xuICAgICAgICAgICAgICAgIGV4cHIgPSBuZXcgV3JhcHBpbmdOb2RlKHN0YXJ0VG9rZW4pLmZpbmlzaE1lbWJlckV4cHJlc3Npb24oJy4nLCBleHByLCBwcm9wZXJ0eSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCcoJykpIHtcbiAgICAgICAgICAgICAgICBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgYXJncyA9IHBhcnNlQXJndW1lbnRzKCk7XG4gICAgICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoQ2FsbEV4cHJlc3Npb24oZXhwciwgYXJncyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCdbJykpIHtcbiAgICAgICAgICAgICAgICBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7X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cbiAgICAgICAgaWYgKG1hdGNoS2V5d29yZCgnc3VwZXInKSAmJiBzdGF0ZS5pbkZ1bmN0aW9uQm9keSkge1xuICAgICAgICAgICAgZXhwciA9IG5ldyBOb2RlKCk7XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgIGV4cHIgPSBleHByLmZpbmlzaFN1cGVyKCk7XG4gICAgICAgICAgICBpZiAoIW1hdGNoKCdbJykgJiYgIW1hdGNoKCcuJykpIHtcbiAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbihsb29rYWhlYWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZXhwciA9IGluaGVyaXRDb3ZlckdyYW1tYXIobWF0Y2hLZXl3b3JkKCduZXcnKSA/IHBhcnNlTmV3RXhwcmVzc2lvbiA6IHBhcnNlUHJpbWFyeUV4cHJlc3Npb24pO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgICAgaWYgKG1hdGNoKCdbJykpIHtcbiAgICAgICAgICAgICAgICBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgaXNBc3NpZ25tZW50VGFyZ2V0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0eSA9IHBhcnNlQ29tcHV0ZWRNZW1iZXIoKTtcbiAgICAgICAgICAgICAgICBleHByID0gbmV3IFdyYXBwaW5nTm9kZShzdGFydFRva2VuKS5maW5pc2hNZW1iZXJFeHByZXNzaW9uKCdbJywgZXhwciwgcHJvcGVydHkpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRjaCgnLicpKSB7XG4gICAgICAgICAgICAgICAgaXNCaW5kaW5nRWxlbWVudCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IHRydWU7XG4gICAgICAgICAgICAgICAgcHJvcGVydHkgPSBwYXJzZU5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fCBtYXRjaCgnLS0nKSkge1xuICAgICAgICAgICAgc3RhcnRUb2tlbiA9IGxvb2thaGVhZDtcbiAgICAgICAgICAgIHRva2VuID0gbGV4KCk7XG4gICAgICAgICAgICBleHByID0gaW5oZXJpdENvdmVyR3JhbW1hcihwYXJzZVVuYXJ5RXhwcmVzc2lvbik7XG4gICAgICAgICAgICAvLyBFQ01BLTI2MiAxMS40LjQsIDExLjQuNVxuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiBleHByLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyICYmIGlzUmVzdHJpY3RlZFdvcmQoZXhwci5uYW1lKSkge1xuICAgICAgICAgICAgICAgIHRvbGVyYXRlRXJyb3IoTWVzc2FnZXMuU3RyaWN0TEhTUHJlZml4KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFpc0Fzc2lnbm1lbnRUYXJnZXQpIHtcbiAgICAgICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLkludmFsaWRMSFNJbkFzc2lnbm1lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoVW5hcnlFeHByZXNzaW9uKHRva2VuLnZhbHVlLCBleHByKTtcbiAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgfSBlbHNlIGlmIChtYXRjaCgnKycpIHx8IG1hdGNoKCctJykgfHwgbWF0Y2goJ34nKSB8fCBtYXRjaCgnIScpKSB7XG4gICAgICAgICAgICBzdGFydFRva2VuID0gbG9va2FoZWFkO1xuICAgICAgICAgICAgdG9rZW4gPSBsZXgoKTtcbiAgICAgICAgICAgIGV4cHIgPSBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlVW5hcnlFeHByZXNzaW9uKTtcbiAgICAgICAgICAgIGV4cHIgPSBu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wgYWxsb3dJbikge1xuICAgICAgICB2YXIgcHJlYyA9IDA7XG5cbiAgICAgICAgaWYgKHRva2VuLnR5cGUgIT09IFRva2VuLlB1bmN0dWF0b3IgJiYgdG9rZW4udHlwZSAhPT0gVG9rZW4uS2V5d29yZCkge1xuICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgIH1cblxuICAgICAgICBzd2l0Y2ggKHRva2VuLnZhbHVlKSB7XG4gICAgICAgIGNhc2UgJ3x8JzpcbiAgICAgICAgICAgIHByZWMgPSAxO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnJiYnOlxuICAgICAgICAgICAgcHJlYyA9IDI7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICd8JzpcbiAgICAgICAgICAgIHByZWMgPSAzO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnXic6XG4gICAgICAgICAgICBwcmVjID0gNDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJyYnOlxuICAgICAgICAgICAgcHJlYyA9IDU7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICc9PSc6XG4gICAgICAgIGNhc2UgJyE9JzpcbiAgICAgICAgY2FzZSAnPT09JzpcbiAgICAgICAgY2FzZSAnIT09JzpcbiAgICAgICAgICAgIHByZWMgPSA2O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnPCc6XG4gICAgICAgIGNhc2UgJz4nOlxuICAgICAgICBjYXNlICc8PSc6XG4gICAgICAgIGNhc2UgJz49JzpcbiAgICAgICAgY2FzZSAnaW5zdGFuY2VvZic6XG4gICAgICAgICAgICBwcmVjID0gNztcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ2luJzpcbiAgICAgICAgICAgIHByZWMgPSBhbGxvd0luID8gNyA6IDA7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBj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b2thaGVhZDtcbiAgICAgICAgbGVmdCA9IGluaGVyaXRDb3ZlckdyYW1tYXIocGFyc2VVbmFyeUV4cHJlc3Npb24pO1xuXG4gICAgICAgIHRva2VuID0gbG9va2FoZWFkO1xuICAgICAgICBwcmVjID0gYmluYXJ5UHJlY2VkZW5jZSh0b2tlbiwgc3RhdGUuYWxsb3dJbik7XG4gICAgICAgIGlmIChwcmVjID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gbGVmdDtcbiAgICAgICAgfVxuICAgICAgICBpc0Fzc2lnbm1lbnRUYXJnZXQgPSBpc0JpbmRpbmdFbGVtZW50ID0gZmFsc2U7XG4gICAgICAgIHRva2VuLnByZWMgPSBwcmVjO1xuICAgICAgICBsZXgoKTtcblxuICAgICAgICBtYXJrZXJzID0gW21hcmtlciwgbG9va2FoZWFkXTtcbiAgICAgICAgcmlnaHQgPSBpc29sYXRlQ292ZXJHcmFtbWFyKHBhcnNlVW5hcnlFeHByZXNzaW9uKTtcblxuICAgICAgICBzdGFjayA9IFtsZWZ0LCB0b2tlbiwgcmlnaHRdO1xuXG4gICAgICAgIHdoaWxlICgocHJlYyA9IGJpbmFyeVByZWNlZGVuY2UobG9va2FoZWFkLCBzdGF0ZS5hbGxvd0luKSkgPiAwKSB7XG5cbiAgICAgICAgICAgIC8vIFJlZHVjZTogbWFrZSBhIGJpbmFyeSBleHByZXNzaW9uIGZyb20gdGhlIHRocmVlIHRvcG1vc3QgZW50cmllcy5cbiAgICAgICAgICAgIHdoaWxlICgoc3RhY2subGVuZ3RoID4gMikgJiYgKHByZWMgPD0gc3RhY2tbc3RhY2subGVuZ3RoIC0gMl0ucHJlYykpIHtcbiAgICAgICAgICAgICAgICByaWdodCA9IHN0YWNrLnBvcCgpO1xuICAgICAgICAgICAgICAgIG9wZXJhdG9yID0gc3RhY2sucG9wKCkudmFsdWU7XG4gICAgICAgICAgICAgICAgbGVmdCA9IHN0YWNrLnBvcCgpO1xuICAgICAgICAgICAgICAgIG1hcmtlcnMucG9wKCk7XG4gICAgICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUobWFya2Vyc1ttYXJrZXJzLmxlbmd0aCAtIDFdKS5maW5pc2hCaW5hcnlFeHByZXNzaW9uKG9wZXJhdG9yLCBsZWZ0LCByaWdodCk7XG4gICAgICAgICAgICAgICAgc3RhY2sucHVzaChleHByKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gU2hpZnQuXG4gICAgICAgICAgICB0b2tlbiA9IGxleCgpO1xuICAgICAgICAgICAgdG9rZW4ucHJlYyA9IHByZWM7XG4gICAgICAgICAgICBzdGFjay5wdXNoKHRva2VuKTtcbiAgICAgICAgICAgIG1hcmtlcnMucHVzaChsb29rYWhlYWQpO1xuICAgICAgICAgICAgZXhwciA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VVbmFyeUV4cHJlc3Npb24pO1xuICAgICAgICAgICAgc3RhY2sucHVzaChleHByKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZpbmFsIHJlZHVjZSB0byBjbGVhbi11cCB0aGUgc3RhY2suXG4gICAgICAgIGkgPSBzdGFjay5sZW5ndGggLSAxO1xuICAgICAgICBleHByID0gc3RhY2tbaV07XG4gICAgICAgIG1hcmtlcnMucG9wKCk7XG4gICAgICAgIHdoaWxlIChpID4gMSkge1xuICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUobWFya2Vycy5wb3AoKSkuZmluaXNoQmluYXJ5RXhwcmVzc2lvbihzdGFja1tpIC0gMV0udmFsdWUsIHN0YWNrW2kgLSAyXSwgZXhwcik7XG4gICAgICAgICAgICBpIC09IDI7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZXhwcjtcbiAgICB9XG5cblxuICAgIC8vIEVDTUEtMjYyIDEyLjEzIENvbmRpdGlvbmFsIE9wZXJhdG9yXG5cbiAgICBmdW5jdGlvbiBwYXJzZUNvbmRpdGlvbmFsRXhwcmVz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CgneycpKSB7XG4gICAgICAgICAgICByZXR1cm4gcGFyc2VGdW5jdGlvblNvdXJjZUVsZW1lbnRzKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY2hlY2tQYXR0ZXJuUGFyYW0ob3B0aW9ucywgcGFyYW0pIHtcbiAgICAgICAgdmFyIGk7XG4gICAgICAgIHN3aXRjaCAocGFyYW0udHlwZSkge1xuICAgICAgICBjYXNlIFN5bnRheC5JZGVudGlmaWVyOlxuICAgICAgICAgICAgdmFsaWRhdGVQYXJhbShvcHRpb25zLCBwYXJhbSwgcGFyYW0ubmFtZSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBTeW50YXguUmVzdEVsZW1lbnQ6XG4gICAgICAgICAgICBjaGVja1BhdHRlcm5QYXJhbShvcHRpb25zLCBwYXJhbS5hcmd1bWVudCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBTeW50YXguQXNzaWdubWVudFBhdHRlcm46XG4gICAgICAgICAgICBjaGVja1BhdHRlcm5QYXJhbShvcHRpb25zLCBwYXJhbS5sZWZ0KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFN5bnRheC5BcnJheVBhdHRlcm46XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcGFyYW0uZWxlbWVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAocGFyYW0uZWxlbWVudHNbaV0gIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgY2hlY2tQYXR0ZXJuUGFyYW0ob3B0aW9ucywgcGFyYW0uZWxlbWVudHNbaV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFN5bnRheC5ZaWVsZEV4cHJlc3Npb246XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGFzc2VydChwYXJhbS50eXBlID09PSBTeW50YXguT2JqZWN0UGF0dGVybiwgJ0ludmFsaWQgdHlwZScpO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBhcmFtLnByb3BlcnRpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBjaGVja1BhdHRlcm5QYXJhbShvcHRpb25zLCBwYXJhbS5wcm9wZXJ0aWVzW2ldLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlaW50ZXJwcmV0QXNDb3ZlckZvcm1hbHNMaXN0KGV4cHIpIHtcbiAgICAgICAgdmFyIGksIGxlbiwgcGFyYW0sIHBhcmFtcywgZGVmYXVsdHMsIGRlZmF1bHRDb3VudCwgb3B0aW9ucywgdG9rZW47XG5cbiAgICAgICAgZGVmYXVsdHMgPSBbXTtcbiAgICAgICAgZGVmYXVsdENvdW50ID0gMDtcbiAgICAgICAgcGFyYW1zID0gW2V4cHJdO1xuXG4gICAgICAgIHN3aXRjaCAoZXhwci50eXBlKSB7XG4gICAgICAgIGNhc2UgU3ludGF4LklkZW50aWZpZXI6XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBQbGFjZUhvbGRlcnMuQXJyb3dQYXJhbWV0ZXJQbGFjZUhvbGRlcjpcbiAgICAgICAgICAgIHBhcmFtcyA9IGV4cHIucGFyYW1zO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICBwYXJhbVNldDoge31cbiAgICAgICAgfTtcblxuICAgICAgICBmb3IgKGkgPSAwLCBsZW4gPSBwYXJhbXMubGVuZ3RoOyBpIDwgbGVuOyBpICs9IDEpIHtcbiAgICAgICAgICAgIHBhcmFtID0gcGFyYW1zW2ldO1xuICAgICAgICAgICAgc3dpdGNoIChwYXJhbS50eXBlKSB7XG4gICAgICAgICAgICBjYXNlIFN5bnRheC5Bc3NpZ25tZW50UGF0dGVybjpcbiAgICAgICAgICAgICAgICBwYXJhbXNbaV0gPSBwYXJhbS5sZWZ0O1xuICAgICAgICAgICAgICAgIGlmIChwYXJhbS5yaWdodC50eXBlID09PSBTeW50YXguWWllbGRFeHByZXNzaW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbS5yaWdodC5hcmd1bWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBwYXJhbS5yaWdodC50eXBlID0gU3ludGF4LklkZW50aWZpZXI7XG4gICAgICAgICAgICAgICAgICAgIHBhcmFtLnJpZ2h0Lm5hbWUgPSAneWllbGQnO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcGFyYW0ucmlnaHQuYXJndW1lbnQ7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBwYXJhbS5yaWdodC5kZWxlZ2F0ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZGVmYXVsdHMucHVzaChwYXJhbS5yaWdodCk7XG4gICAgICAgICAgICAgICAgKytkZWZhdWx0Q291bnQ7XG4gICAgICAgICAgICAgICAgY2hlY2tQYXR0ZXJuUGFyYW0ob3B0aW9ucywgcGFyYW0ubGVmdCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGNoZWNrUGF0dGVyblBhcmFtKG9wdGlvbnMsIHBhcmFtKTtcbiAgICAgICAgICAgICAgICBwYXJhbXNbaV0gPSBwYXJhbTtcbiAgICAgICAgICAgICAgICBkZWZhdWx0cy5wdXNoKG51bGwpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHN0cmljdCB8fCAhc3RhdGUuYWxsb3dZaWVsZCkge1xuICAgICAgICAgICAgZm9yIChpID0gMCwgbGVuID0gcGFyYW1zLmxlbmd0aDsgaSA8IGxlbjsgaSArPSAxKSB7XG4gICAgICAgICAgICAgICAgcGFyYW0gPSBwYXJhbXNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLnR5cGUgPT09IFN5bnRheC5ZaWVsZEV4cHJlc3Npb24pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4obG9va2FoZWFkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAob3B0aW9ucy5tZXNzYWdlID09PSBNZXNzYWdlcy5TdHJpY3RQYXJhbUR1cGUpIHtcbiAgICAgICAgICAgIHRva2VuID0gc3RyaWN0ID8gb3B0aW9ucy5zdHJpY3RlZCA6IG9wdGlvbnMuZmlyc3RSZXN0cmljdGVkO1xuICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4odG9rZW4sIG9wdGlvbnMubWVzc2FnZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVmYXVsdENvdW50ID09PSAwKSB7XG4gICAgICAgICAgICBkZWZhdWx0cyA9IFtdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHBhcmFtczogcGFyYW1zLFxuICAgICAgICAgICAgZGVmYXVsdHM6IGRlZmF1bHRzLFxuICAgICAgICAgICAgc3RyaWN0ZWQ6IG9wdGlvbnMuc3RyaWN0ZWQsXG4gICAgICAgICAgICBmaXJzdFJlc3Ry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ICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUFycm93RnVuY3Rpb25FeHByZXNzaW9uKGxpc3QsIG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gZXhwcjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtYXRjaEFzc2lnbigpKSB7XG4gICAgICAgICAgICBpZiAoIWlzQXNzaWdubWVudFRhcmdldCkge1xuICAgICAgICAgICAgICAgIHRvbGVyYXRlRXJyb3IoTWVzc2FnZXMuSW52YWxpZExIU0luQXNzaWdubWVudCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEVDTUEtMjYyIDEyLjEuMVxuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiBleHByLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzUmVzdHJpY3RlZFdvcmQoZXhwci5uYW1lKSkge1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbih0b2tlbiwgTWVzc2FnZXMuU3RyaWN0TEhTQXNzaWdubWVudCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc1N0cmljdE1vZGVSZXNlcnZlZFdvcmQoZXhwci5uYW1lKSkge1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbih0b2tlbiwgTWVzc2FnZXMuU3RyaWN0UmVzZXJ2ZWRXb3JkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghbWF0Y2goJz0nKSkge1xuICAgICAgICAgICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSBmYWxzZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVpbnRlcnByZXRFeHByZXNzaW9uQXNQYXR0ZXJuKGV4cHIpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0b2tlbiA9IGxleCgpO1xuICAgICAgICAgICAgcmlnaHQgPSBpc29sYXRlQ292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pO1xuICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoQXNzaWdubWVudEV4cHJlc3Npb24odG9rZW4udmFsdWUsIGV4cHIsIHJpZ2h0KTtcbiAgICAgICAgICAgIGZpcnN0Q292ZXJJbml0aWFsaXplZE5hbWVFcnJvciA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZXhwcjtcbiAgICB9XG5cbiAgICAvLyBFQ01BLTI2MiAxMi4xNSBDb21tYSBPcGVyYXRvclxuXG4gICAgZnVuY3Rpb24gcGFyc2VFeHByZXNzaW9uKCkge1xuICAgICAgICB2YXIgZXhwciwgc3RhcnRUb2tlbiA9IGxvb2thaGVhZCwgZXhwcmVzc2lvbnM7XG5cbiAgICAgICAgZXhwciA9IGlzb2xhdGVDb3ZlckdyYW1tYXIocGFyc2VBc3NpZ25tZW50RXhwcmVzc2lvbik7XG5cbiAgICAgICAgaWYgKG1hdGNoKCcsJykpIHtcbiAgICAgICAgICAgIGV4cHJlc3Npb25zID0gW2V4cHJdO1xuXG4gICAgICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGlmICghbWF0Y2goJywnKSkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbnMucHVzaChpc29sYXRlQ292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZXhwciA9IG5ldyBXcmFwcGluZ05vZGUoc3RhcnRUb2tlbikuZmluaXNoU2VxdWVuY2VFeHByZXNzaW9uKGV4cHJlc3Npb25zKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBleHByO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDEzLjIgQmxvY2tcblxuICAgIGZ1bmN0aW9uIHBhcnNlU3RhdGVtZW50TGlzdEl0ZW0oKSB7XG4gICAgICAgIGlmIChsb29rYWhlYWQudHlwZSA9PT0gVG9rZW4uS2V5d29yZCkge1xuICAgICAgICAgICAgc3dpdGNoIChsb29rYWhlYWQudmFsdWUpIHtcbiAgICAgICAgICAgIGNhc2UgJ2V4cG9ydCc6XG4gICAgICAgICAgICAgICAgaWYgKHN0YXRlLnNvdXJjZVR5cGUgIT09ICdtb2R1bGUnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCwgTWVzc2FnZXMuSWxsZWdhbEV4cG9ydERlY2xhcmF0aW9uKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRXhwb3J0RGVjbGFyYXRpb24oKTtcbiAgICAgICAgICAgIGNhc2UgJ2ltcG9ydCc6XG4gICAgICAgICAgICAgICAgaWYgKHN0YXRlLnNvdXJjZVR5cGUgIT09ICdtb2R1bGUnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCwgTWVzc2FnZXMuSWxsZWdhbEltcG9ydERlY2xhcmF0aW9uKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlSW1wb3J0RGVjbGFyYXRpb24oKTtcbiAgICAgICAgICAgIGNhc2UgJ2NvbnN0JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VMZXhpY2FsRGVjbGFyYXRpb24oe2luRm9yOiBmYWxzZX0pO1xuICAgICAgICAgICAgY2FzZSAnZnVuY3Rpb24nOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUZ1bmN0aW9uRGVjbGFyYXRpb24obmV3IE5vZGUoKSk7XG4gICAgICAgICAgICBjYXNlICdjbGFzcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlQ2xhc3NEZWNsYXJhdGlvbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1hdGNoS2V5d29yZCgnbGV0JykgJiYgaXNMZXhpY2FsRGVjbGFyYXRpb24oKSkge1xuICAgICAgICAgICAgcmV0dXJuIHBhcnNlTGV4aWNhbERlY2xhcmF0aW9uKHtpbkZvcjogZmFsc2V9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBwYXJzZVN0YXRlbWVudCgpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlU3RhdGVtZW50TGlzdCgpIHtcbiAgICAgICAgdmFyIGxpc3QgPSBbXTtcbiAgICAgICAgd2hpbGUgKHN0YXJ0SW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIGlmIChtYXRjaCgnfScpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsaXN0LnB1c2gocGFyc2VTdGF0ZW1lbnRMaXN0SXRlbSgpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBsaXN0O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlQmxvY2soKSB7XG4gICAgICAgIHZhciBibG9jaywgbm9kZSA9IG5ldyBOb2RlKCk7XG5cbiAgICAgICAgZXhwZWN0KCd7Jyk7XG5cbiAgICAgICAgYmxvY2sgPSBwYXJzZVN0YXRlbWVudExpc3QoKTtcblxuICAgICAgICBleHBlY3QoJ30nKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW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ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgZGVjbGFyYXRpb25zID0gcGFyc2VWYXJpYWJsZURlY2xhcmF0aW9uTGlzdCh7IGluRm9yOiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93SW4gPSBwcmV2aW91c0FsbG93SW47XG5cbiAgICAgICAgICAgICAgICBpZiAoZGVjbGFyYXRpb25zLmxlbmd0aCA9PT0gMSAmJiBtYXRjaEtleXdvcmQoJ2luJykpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5pdCA9IGluaXQuZmluaXNoVmFyaWFibGVEZWNsYXJhdGlvbihkZWNsYXJhdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgbGVmdCA9IGluaXQ7XG4gICAgICAgICAgICAgICAgICAgIHJpZ2h0ID0gcGFyc2VFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGluaXQgPSBudWxsO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGVjbGFyYXRpb25zLmxlbmd0aCA9PT0gMSAmJiBkZWNsYXJhdGlvbnNbMF0uaW5pdCA9PT0gbnVsbCAmJiBtYXRjaENvbnRleHR1YWxLZXl3b3JkKCdvZicpKSB7XG4gICAgICAgICAgICAgICAgICAgIGluaXQgPSBpbml0LmZpbmlzaFZhcmlhYmxlRGVjbGFyYXRpb24oZGVjbGFyYXRpb25zKTtcbiAgICAgICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgICAgICAgICAgaW5pdCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGZvckluID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaW5pdCA9IGluaXQuZmluaXNoVmFyaWFibGVEZWNsYXJhdGlvbihkZWNsYXJhdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICBleHBlY3QoJzsnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoS2V5d29yZCgnY29uc3QnKSB8fCBtYXRjaEtleXdvcmQoJ2xldCcpKSB7XG4gICAgICAgICAgICAgICAgaW5pdCA9IG5ldyBOb2RlKCk7XG4gICAgICAgICAgICAgICAga2luZCA9IGxleCgpLnZhbHVlO1xuXG4gICAgICAgICAgICAgICAgaWYgKCFzdHJpY3QgJiYgbG9va2FoZWFkLnZhbHVlID09PSAnaW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIGluaXQgPSBpbml0LmZpbmlzaElkZW50aWZpZXIoa2luZCk7XG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gaW5pdDtcbiAgICAgICAgICAgICAgICAgICAgcmlnaHQgPSBwYXJzZUV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgICAgICAgICAgaW5pdCA9IG51bGw7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dJbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBkZWNsYXJhdGlvbnMgPSBwYXJzZUJpbmRpbmdMaXN0KGtpbmQsIHtpbkZvcjogdHJ1ZX0pO1xuICAgICAgICAgICAgICAgICAgICBzdGF0ZS5hbGxvd0luID0gcHJldmlvdXNBbGxvd0luO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChkZWNsYXJhdGlvbnMubGVuZ3RoID09PSAxICYmIGRlY2xhcmF0aW9uc1swXS5pbml0ID09PSBudWxsICYmIG1hdGNoS2V5d29yZCgnaW4nKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdCA9IGluaXQuZmluaXNoTGV4aWNhbERlY2xhcmF0aW9uKGRlY2xhcmF0aW9ucywga2luZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQgPSBwYXJzZUV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaXQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGRlY2xhcmF0aW9ucy5sZW5ndGggPT09IDEgJiYgZGVjbGFyYXRpb25zWzBdLmluaXQgPT09IG51bGwgJiYgbWF0Y2hDb250ZXh0dWFsS2V5d29yZCgnb2YnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdCA9IGluaXQuZmluaXNoTGV4aWNhbERlY2xhcmF0aW9uKGRlY2xhcmF0aW9ucywga2luZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQgPSBwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvckluID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdW1lU2VtaWNvbG9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0ID0gaW5pdC5maW5pc2hMZXhpY2FsRGVjbGFyYXRpb24oZGVjbGFyYXRpb25zLCBraW5kKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaW5pdFN0YXJ0VG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgICAgICAgICAgc3RhdGUuYWxsb3dJbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGluaXQgPSBpbmhlcml0Q292ZXJHcmFtbWFyKHBhcnNlQXNzaWdubWVudEV4cHJlc3Npb24pO1xuICAgICAgICAgICAgICAgIHN0YXRlLmFsbG93SW4gPSBwcmV2aW91c0FsbG93SW47XG5cbiAgICAgICAgICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdpbicpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghaXNBc3NpZ25tZW50VGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLkludmFsaWRMSFNJbkZvckluKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICByZWludGVycHJldEV4cHJlc3Npb25Bc1BhdHRlcm4oaW5pdCk7XG4gICAgICAgICAgICAgICAgICAgIGxlZnQgPSBpbml0O1xuICAgICAgICAgICAgICAgICAgICByaWdodCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgICAgICBpbml0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoQ29udGV4dHVhbEtleXdvcmQoJ29mJykpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0Fzc2lnbm1lbnRUYXJnZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvbGVyYXRlRXJyb3IoTWVzc2FnZXMuSW52YWxpZExIU0luRm9yTG9vcCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRFeHByZXNzaW9uQXNQYXR0ZXJuKGluaXQpO1xuICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gaW5pdDtcbiAgICAgICAgICAgICAgICAgICAgcmlnaHQgPSBwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIGluaXQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICBmb3JJbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaCgnLCcpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0U2VxID0gW2luaXRdO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG1hdGNoKCcsJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0U2VxLnB1c2goaXNvbGF0ZUNvdmVyR3JhbW1hcihwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0ID0gbmV3IFdyYXBwaW5nTm9kZShpbml0U3RhcnRUb2tlbikuZmluaXNoU2VxdWVuY2VFeHByZXNzaW9uKGluaXRTZXEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdCgnOycpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgbGVmdCA9PT0gJ3VuZGVmaW5lZCcpIHtcblxuICAgICAgICAgICAgaWYgKCFtYXRjaCgnOycpKSB7XG4gICAgICAgICAgICAgICAgdGVzdCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwZWN0KCc7Jyk7XG5cbiAgICAgICAgICAgIGlmICghbWF0Y2goJyknKSkge1xuICAgICAgICAgICAgICAgIHVwZGF0ZSA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgfVxuICAgICAg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XJyb3IoTWVzc2FnZXMuSWxsZWdhbENvbnRpbnVlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoQ29udGludWVTdGF0ZW1lbnQobnVsbCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaGFzTGluZVRlcm1pbmF0b3IpIHtcbiAgICAgICAgICAgIGlmICghc3RhdGUuaW5JdGVyYXRpb24pIHtcbiAgICAgICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLklsbGVnYWxDb250aW51ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaENvbnRpbnVlU3RhdGVtZW50KG51bGwpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICBsYWJlbCA9IHBhcnNlVmFyaWFibGVJZGVudGlmaWVyKCk7XG5cbiAgICAgICAgICAgIGtleSA9ICckJyArIGxhYmVsLm5hbWU7XG4gICAgICAgICAgICBpZiAoIU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzdGF0ZS5sYWJlbFNldCwga2V5KSkge1xuICAgICAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuVW5rbm93bkxhYmVsLCBsYWJlbC5uYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcblxuICAgICAgICBpZiAobGFiZWwgPT09IG51bGwgJiYgIXN0YXRlLmluSXRlcmF0aW9uKSB7XG4gICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLklsbGVnYWxDb250aW51ZSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hDb250aW51ZVN0YXRlbWVudChsYWJlbCk7XG4gICAgfVxuXG4gICAgLy8gR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WVudCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuICAgICAgICAgICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hSZXR1cm5TdGF0ZW1lbnQoYXJndW1lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhhc0xpbmVUZXJtaW5hdG9yKSB7XG4gICAgICAgICAgICAvLyBIQUNLXG4gICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hSZXR1cm5TdGF0ZW1lbnQobnVsbCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIW1hdGNoKCc7JykpIHtcbiAgICAgICAgICAgIGlmICghbWF0Y2goJ30nKSAmJiBsb29rYWhlYWQudHlwZSAhPT0gVG9rZW4uRU9GKSB7XG4gICAgICAgICAgICAgICAgYXJndW1lbnQgPSBwYXJzZUV4cHJlc3Npb24oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hSZXR1cm5TdGF0ZW1lbnQoYXJndW1lbnQpO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDEzLjExIFRoZSB3aXRoIHN0YXRlbWVudFxuXG4gICAgZnVuY3Rpb24gcGFyc2VXaXRoU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdmFyIG9iamVjdCwgYm9keTtcblxuICAgICAgICBpZiAoc3RyaWN0KSB7XG4gICAgICAgICAgICB0b2xlcmF0ZUVycm9yKE1lc3NhZ2VzLlN0cmljdE1vZGVXaXRoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGV4cGVjdEtleXdvcmQoJ3dpdGgnKTtcblxuICAgICAgICBleHBlY3QoJygnKTtcblxuICAgICAgICBvYmplY3QgPSBwYXJzZUV4cHJlc3Npb24oKTtcblxuICAgICAgICBleHBlY3Qo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Qobm9kZSkge1xuICAgICAgICB2YXIgZGlzY3JpbWluYW50LCBjYXNlcywgY2xhdXNlLCBvbGRJblN3aXRjaCwgZGVmYXVsdEZvdW5kO1xuXG4gICAgICAgIGV4cGVjdEtleXdvcmQoJ3N3aXRjaCcpO1xuXG4gICAgICAgIGV4cGVjdCgnKCcpO1xuXG4gICAgICAgIGRpc2NyaW1pbmFudCA9IHBhcnNlRXhwcmVzc2lvbigpO1xuXG4gICAgICAgIGV4cGVjdCgnKScpO1xuXG4gICAgICAgIGV4cGVjdCgneycpO1xuXG4gICAgICAgIGNhc2VzID0gW107XG5cbiAgICAgICAgaWYgKG1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoU3dpdGNoU3RhdGVtZW50KGRpc2NyaW1pbmFudCwgY2FzZXMpO1xuICAgICAgICB9XG5cbiAgICAgICAgb2xkSW5Td2l0Y2ggPSBzdGF0ZS5pblN3aXRjaDtcbiAgICAgICAgc3RhdGUuaW5Td2l0Y2ggPSB0cnVlO1xuICAgICAgICBkZWZhdWx0Rm91bmQgPSBmYWxzZTtcblxuICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKG1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNsYXVzZSA9IHBhcnNlU3dpdGNoQ2FzZSgpO1xuICAgICAgICAgICAgaWYgKGNsYXVzZS50ZXN0ID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaWYgKGRlZmF1bHRGb3VuZCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLk11bHRpcGxlRGVmYXVsdHNJblN3aXRjaCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRlZmF1bHRGb3VuZCA9IHRydWU7XG4gICAg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oZWFkKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlID09PSBUb2tlbi5QdW5jdHVhdG9yICYmIGxvb2thaGVhZC52YWx1ZSA9PT0gJ3snKSB7XG4gICAgICAgICAgICByZXR1cm4gcGFyc2VCbG9jaygpO1xuICAgICAgICB9XG4gICAgICAgIGlzQXNzaWdubWVudFRhcmdldCA9IGlzQmluZGluZ0VsZW1lbnQgPSB0cnVlO1xuICAgICAgICBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBpZiAodHlwZSA9PT0gVG9rZW4uUHVuY3R1YXRvcikge1xuICAgICAgICAgICAgc3dpdGNoIChsb29rYWhlYWQudmFsdWUpIHtcbiAgICAgICAgICAgIGNhc2UgJzsnOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUVtcHR5U3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnKCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRXhwcmVzc2lvblN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gVG9rZW4uS2V5d29yZCkge1xuICAgICAgICAgICAgc3dpdGNoIChsb29rYWhlYWQudmFsdWUpIHtcbiAgICAgICAgICAgIGNhc2UgJ2JyZWFrJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VCcmVha1N0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ2NvbnRpbnVlJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VDb250aW51ZVN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ2RlYnVnZ2VyJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VEZWJ1Z2dlclN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ2RvJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VEb1doaWxlU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnZm9yJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VGb3JTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICdmdW5jdGlvbic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlRnVuY3Rpb25EZWNsYXJhdGlvbihub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ2lmJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJZlN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ3JldHVybic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlUmV0dXJuU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgY2FzZSAnc3dpdGNoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VTd2l0Y2hTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICd0aHJvdyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlVGhyb3dTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICd0cnknOlxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZVRyeVN0YXRlbWVudChub2RlKTtcbiAgICAgICAgICAgIGNhc2UgJ3Zhcic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlVmFyaWFibGVTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICd3aGlsZSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlV2hpbGVTdGF0ZW1lbnQobm9kZSk7XG4gICAgICAgICAgICBjYXNlICd3aXRoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VXaXRoU3RhdGVtZW50KG5vZGUpO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGV4cHIgPSBwYXJzZUV4cHJlc3Npb24oKTtcblxuICAgICAgICAvLyBFQ01BLTI2MiAxMi4xMiBMYWJlbGxlZCBTdGF0ZW1lbnRzXG4gICAgICAgIGlmICgoZXhwci50eXBlID09PSBTeW50YXguSWRlbnRpZmllcikgJiYgbWF0Y2goJzonKSkge1xuICAgICAgICAgICAgbGV4KCk7XG5cbiAgICAgICAgICAgIGtleSA9ICckJyArIGV4cHIubmFtZTtcbiAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoc3RhdGUubGFiZWxTZXQsIGtleSkpIHtcbiAgICAgICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLlJlZGVjbGFyYXRpb24sICdMYWJlbCcsIGV4cHIubmFtZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHN0YXRlLmxhYmVsU2V0W2tleV0gPSB0cnVlO1xuICAgICAgICAgICAgbGFiZWxlZEJvZHkgPSBwYXJzZVN0YXRlbWVudCgpO1xuICAgICAgICAgICAgZGVsZXRlIHN0YXRlLmxhYmVsU2V0W2tleV07XG4gICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hMYWJlbGVkU3RhdGVtZW50KGV4cHIsIGxhYmVsZWRCb2R5KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hFeHByZXNzaW9uU3RhdGVtZW50KGV4cHIpO1xuICAgIH1cblxuICAgIC8vIEVDTUEtMjYyIDE0LjEgRnVuY3Rpb24gRGVmaW5pdGlvblxuXG4gICAgZnVuY3Rpb24gcGFyc2VGdW5jdGlvblNvdXJjZUVsZW1lbnRzKCkge1xuICAgICAgICB2YXIgc3RhdGVtZW50LCBib2R5ID0gW10sIH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aWN0ZWQsIE1lc3NhZ2VzLlN0cmljdE9jdGFsTGl0ZXJhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIWZpcnN0UmVzdHJpY3RlZCAmJiB0b2tlbi5vY3RhbCkge1xuICAgICAgICAgICAgICAgICAgICBmaXJzdFJlc3RyaWN0ZWQgPSB0b2tlbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBvbGRMYWJlbFNldCA9IHN0YXRlLmxhYmVsU2V0O1xuICAgICAgICBvbGRJbkl0ZXJhdGlvbiA9IHN0YXRlLmluSXRlcmF0aW9uO1xuICAgICAgICBvbGRJblN3aXRjaCA9IHN0YXRlLmluU3dpdGNoO1xuICAgICAgICBvbGRJbkZ1bmN0aW9uQm9keSA9IHN0YXRlLmluRnVuY3Rpb25Cb2R5O1xuICAgICAgICBvbGRQYXJlbnRoZXNpc0NvdW50ID0gc3RhdGUucGFyZW50aGVzaXplZENvdW50O1xuXG4gICAgICAgIHN0YXRlLmxhYmVsU2V0ID0ge307XG4gICAgICAgIHN0YXRlLmluSXRlcmF0aW9uID0gZmFsc2U7XG4gICAgICAgIHN0YXRlLmluU3dpdGNoID0gZmFsc2U7XG4gICAgICAgIHN0YXRlLmluRnVuY3Rpb25Cb2R5ID0gdHJ1ZTtcbiAgICAgICAgc3RhdGUucGFyZW50aGVzaXplZENvdW50ID0gMDtcblxuICAgICAgICB3aGlsZSAoc3RhcnRJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKG1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJvZHkucHVzaChwYXJzZVN0YXRlbWVudExpc3RJdGVtKCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgZXhwZWN0KCd9Jyk7XG5cbiAgICAgICAgc3RhdGUub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ICAgb3B0aW9ucy5wYXJhbXMucHVzaChwYXJhbSk7XG4gICAgICAgICAgICBvcHRpb25zLmRlZmF1bHRzLnB1c2gobnVsbCk7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBwYXJhbSA9IHBhcnNlUGF0dGVybldpdGhEZWZhdWx0KHBhcmFtcyk7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBwYXJhbXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhbGlkYXRlUGFyYW0ob3B0aW9ucywgcGFyYW1zW2ldLCBwYXJhbXNbaV0udmFsdWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHBhcmFtLnR5cGUgPT09IFN5bnRheC5Bc3NpZ25tZW50UGF0dGVybikge1xuICAgICAgICAgICAgZGVmID0gcGFyYW0ucmlnaHQ7XG4gICAgICAgICAgICBwYXJhbSA9IHBhcmFtLmxlZnQ7XG4gICAgICAgICAgICArK29wdGlvbnMuZGVmYXVsdENvdW50O1xuICAgICAgICB9XG5cbiAgICAgICAgb3B0aW9ucy5wYXJhbXMucHVzaChwYXJhbSk7XG4gICAgICAgIG9wdGlvbnMuZGVmYXVsdHMucHVzaChkZWYpO1xuXG4gICAgICAgIHJldHVybiAhbWF0Y2goJyknKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZVBhcmFtcyhmaXJzdFJlc3RyaWN0ZWQpIHtcbiAgICAgICAgdmFyIG9wdGlvbnM7XG5cbiAgICAgICAgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgIHBhcmFtczogW10sXG4gICAgICAgICAgICBkZWZhdWx0Q291bnQ6IDAsXG4gICAgICAgICAgICBkZWZhdWx0czogW10sXG4gICAgICAgICAgICBmaXJzdFJlc3RyaWN0ZWQ6IGZpcnN0UmVzdHJpY3RlZFxuICAgICAgICB9O1xuXG4gICAgICAgIGV4cGVjdCgnKCcpO1xuXG4gICAgICAgIGlmICghbWF0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XG5cbiAgICAgICAgcHJldmlvdXNBbGxvd1lpZWxkID0gc3RhdGUuYWxsb3dZaWVsZDtcblxuICAgICAgICBleHBlY3RLZXl3b3JkKCdmdW5jdGlvbicpO1xuXG4gICAgICAgIGlzR2VuZXJhdG9yID0gbWF0Y2goJyonKTtcbiAgICAgICAgaWYgKGlzR2VuZXJhdG9yKSB7XG4gICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghaWRlbnRpZmllcklzT3B0aW9uYWwgfHwgIW1hdGNoKCcoJykpIHtcbiAgICAgICAgICAgIHRva2VuID0gbG9va2FoZWFkO1xuICAgICAgICAgICAgaWQgPSBwYXJzZVZhcmlhYmxlSWRlbnRpZmllcigpO1xuICAgICAgICAgICAgaWYgKHN0cmljdCkge1xuICAgICAgICAgICAgICAgIGlmIChpc1Jlc3RyaWN0ZWRXb3JkKHRva2VuLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICB0b2xlcmF0ZVVuZXhwZWN0ZWRUb2tlbih0b2tlbiwgTWVzc2FnZXMuU3RyaWN0RnVuY3Rpb25OYW1lKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChpc1Jlc3RyaWN0ZWRXb3JkKHRva2VuLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICBmaXJzdFJlc3RyaWN0ZWQgPSB0b2tlbjtcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9IE1lc3NhZ2VzLlN0cmljdEZ1bmN0aW9uTmFtZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlzU3RyaWN0TW9kZVJlc2VydmVkV29yZCh0b2tlbi52YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgZmlyc3RSZXN0cmljdGVkID0gdG9rZW47XG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSBNZXNzYWdlcy5TdHJpY3RSZXNlcn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G4gICAgICAgICAgICAgICAgaWYgKG1hdGNoKCcqJykpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV4KCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAga2V5ID0gcGFyc2VPYmplY3RQcm9wZXJ0eUtleSgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoa2V5Lm5hbWUgPT09ICdzdGF0aWMnICYmIChsb29rYWhlYWRQcm9wZXJ0eU5hbWUoKSB8fCBtYXRjaCgnKicpKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSBsb29rYWhlYWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBpc1N0YXRpYyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlZCA9IG1hdGNoKCdbJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2goJyonKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSBwYXJzZU9iamVjdFByb3BlcnR5S2V5KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbWV0aG9kID0gdHJ5UGFyc2VNZXRob2REZWZpbml0aW9uKHRva2VuLCBrZXksIGNvbXB1dGVkLCBtZXRob2QpO1xuICAgICAgICAgICAgICAgIGlmIChtZXRob2QpIHtcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kWydzdGF0aWMnXSA9IGlzU3RhdGljOyAvLyBqc2NzOmlnbm9yZSByZXF1aXJlRG90Tm90YXRpb25cbiAgICAgICAgICAgICAgICAgICAgaWYgKG1ldGhvZC5raW5kID09PSAnaW5pdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZC5raW5kID0gJ21ldGhvZCc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1N0YXRpYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtZXRob2QuY29tcHV0ZWQgJiYgKG1ldGhvZC5rZXkubmFtZSB8fCBtZXRob2Qua2V5LnZhbHVlLnRvU3RyaW5nKCkpID09PSAnY29uc3RydWN0b3InKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1ldGhvZC5raW5kICE9PSAnbWV0aG9kJyB8fCAhbWV0aG9kLm1ldGhvZCB8fCBtZXRob2QudmFsdWUuZ2VuZXJhdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKHRva2VuLCBNZXNzYWdlcy5Db25zdHJ1Y3RvclNwZWNpYWxNZXRob2QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzQ29uc3RydWN0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3dVbmV4cGVjdGVkVG9rZW4odG9rZW4sIE1lc3NhZ2VzLkR1cGxpY2F0ZUNvbnN0cnVjdG9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNDb25zdHJ1Y3RvciA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZC5raW5kID0gJ2NvbnN0cnVjdG9yJztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbWV0aG9kLmNvbXB1dGVkICYmIChtZXRob2Qua2V5Lm5hbWUgfHwgbWV0aG9kLmtleS52YWx1ZS50b1N0cmluZygpKSA9PT0gJ3Byb3RvdHlwZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvd1VuZXhwZWN0ZWRUb2tlbih0b2tlbiwgTWVzc2FnZXMuU3RhdGljUHJvdG90eXBlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBtZXRob2QudHlwZSA9IFN5bnRheC5NZXRob2REZWZpbml0aW9uO1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgbWV0aG9kLm1ldGhvZDtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG1ldGhvZC5zaG9ydGhhbmQ7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkucHVzaChtZXRob2QpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxleCgpO1xuICAgICAgICByZXR1cm4gY2xhc3NCb2R5LmZpbmlzaENsYXNzQm9keShib2R5KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZUNsYXNzRGVjbGFyYXRpb24oaWRlbnRpZmllcklzT3B0aW9uYWwpIHtcbiAgICAgICAgdmFyIGlkID0gbnVsbCwgc3VwZXJDbGFzcyA9IG51bGwsIGNsYXNzTm9kZSA9IG5ldyBOb2RlKCksIGNsYXNzQm9keSwgcHJldmlvdXNTdHJpY3QgPSBzdHJpY3Q7XG4gICAgICAgIHN0cmljdCA9IHRydWU7XG5cbiAgICAgICAgZXhwZWN0S2V5d29yZCgnY2xhc3MnKTtcblxuICAgICAgICBpZiAoIWlkZW50aWZpZXJJc09wdGlvbmFsIHx8IGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5JZGVudGlmaWV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VJZGVudGlmaWVyKCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hdGNoQ29udGV4dHVhbEtleXdvcmQoJ2FzJykpIHtcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgZXhwb3J0ZWQgPSBwYXJzZU5vbkNvbXB1dGVkUHJvcGVydHkoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hFeHBvcnRTcGVjaWZpZXIobG9jYWwsIGV4cG9ydGVkKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZUV4cG9ydE5hbWVkRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB2YXIgZGVjbGFyYXRpb24gPSBudWxsLFxuICAgICAgICAgICAgaXNFeHBvcnRGcm9tSWRlbnRpZmllcixcbiAgICAgICAgICAgIHNyYyA9IG51bGwsIHNwZWNpZmllcnMgPSBbXTtcblxuICAgICAgICAvLyBub24tZGVmYXVsdCBleHBvcnRcbiAgICAgICAgaWYgKGxvb2thaGVhZC50eXBlID09PSBUb2tlbi5LZXl3b3JkKSB7XG4gICAgICAgICAgICAvLyBjb3ZlcnM6XG4gICAgICAgICAgICAvLyBleHBvcnQgdmFyIGYgPSAxO1xuICAgICAgICAgICAgc3dpdGNoIChsb29rYWhlYWQudmFsdWUpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdsZXQnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2NvbnN0JzpcbiAgICAgICAgICAgICAgICAgICAgZGVjbGFyYXRpb24gPSBwYXJzZUxleGljYWxEZWNsYXJhdGlvbih7aW5Gb3I6IGZhbHNlfSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaEV4cG9ydE5hbWVkRGVjbGFyYXRpb24oZGVjbGFyYXRpb24sIHNwZWNpZmllcnMsIG51bGwpO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3Zhcic6XG4gICAgICAgICAgICAgICAgY2FzZSAnY2xhc3MnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2Z1bmN0aW9uJzpcbiAgICAgICAgICAgICAgICAgICAgZGVjbGFyYXRpb24gPSBwYXJzZVN0YXRlbWVudExpc3RJdGVtKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmZpbmlzaEV4cG9ydE5hbWVkRGVjbGFyYXRpb24oZGVjbGFyYXRpb24sIHNwZWNpZmllcnMsIG51bGwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZXhwZWN0KCd7Jyk7XG4gICAgICAgIHdoaWxlICghbWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgaXNFeHBvcnRGcm9tSWRlbnRpZmllciA9IGlzRXhwb3J0RnJvbUlkZW50aWZpZXIgfHwgbWF0Y2hLZXl3b3JkKCdkZWZhdWx0Jyk7XG4gICAgICAgICAgICBzcGVjaWZpZXJzLnB1c2gocGFyc2VFeHBvcnRTcGVjaWZpZXIoKSk7XG4gICAgICAgICAgICBpZiAoIW1hdGNoKCd9JykpIHtcbiAgICAgICAgICAgICAgICBleHBlY3QoJywnKTtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2goJ30nKSkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZXhwZWN0KCd9Jyk7XG5cbiAgICAgICAgaWYgKG1hdGNoQ29udGV4dHVhbEtleXdvcmQoJ2Zyb20nKSkge1xuICAgICAgICAgICAgLy8gY292ZXJpbmc6XG4gICAgICAgICAgICAvLyBleHBvcnQge2RlZmF1bHR9IGZyb20gJ2Zvbyc7XG4gICAgICAgICAgICAvLyBleHBvcnQge2Zvb30gZnJvbSAnZm9vJztcbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgc3JjID0gcGFyc2VNb2R1bGVTcGVjaWZpZXIoKTtcbiAgICAgICAgICAgIGNvbnN1bWVTZW1pY29sb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uICAgICAgICAgICAgZGVjbGFyYXRpb24gPSBwYXJzZUZ1bmN0aW9uRGVjbGFyYXRpb24obmV3IE5vZGUoKSwgdHJ1ZSk7XG4gICAgICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hFeHBvcnREZWZhdWx0RGVjbGFyYXRpb24oZGVjbGFyYXRpb24pO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXRjaEtleXdvcmQoJ2NsYXNzJykpIHtcbiAgICAgICAgICAgIGRlY2xhcmF0aW9uID0gcGFyc2VDbGFzc0RlY2xhcmF0aW9uKHRydWUpO1xuICAgICAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uKGRlY2xhcmF0aW9uKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtYXRjaENvbnRleHR1YWxLZXl3b3JkKCdmcm9tJykpIHtcbiAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuVW5leHBlY3RlZFRva2VuLCBsb29rYWhlYWQudmFsdWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gY292ZXJzOlxuICAgICAgICAvLyBleHBvcnQgZGVmYXVsdCB7fTtcbiAgICAgICAgLy8gZXhwb3J0IGRlZmF1bHQgW107XG4gICAgICAgIC8vIGV4cG9ydCBkZWZhdWx0ICgxICsgMik7XG4gICAgICAgIGlmIChtYXRjaCgneycpKSB7XG4gICAgICAgICAgICBleHByZXNzaW9uID0gcGFyc2VPYmplY3RJbml0aWFsaXplcigpO1xuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCdbJykpIHtcbiAgICAgICAgICAgIGV4cHJlc3Npb24gPSBwYXJzZUFycmF5SW5pdGlhbGl6ZXIoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGV4cHJlc3Npb24gPSBwYXJzZUFzc2lnbm1lbnRFeHByZXNzaW9uKCk7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3VtZVNlbWljb2xvbigpO1xuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hFeHBvcnREZWZhdWx0RGVjbGFyYXRpb24oZXhwcmVzc2lvbik7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VFeHBvcnRBbGxEZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIHZhciBzcmM7XG5cbiAgICAgICAgLy8gY292ZXJzOlxuICAgICAgICAvLyBleHBvcnQgKiBmcm9tICdmb28nO1xuICAgICAgICBleHBlY3QoJyonKTtcbiAgICAgICAgaWYgKCFtYXRjaENvbnRleHR1YWxLZXl3b3JkKCdmcm9tJykpIHtcbiAgICAgICAgICAgIHRocm93RXJyb3IobG9va2FoZWFkLnZhbHVlID9cbiAgICAgICAgICAgICAgICAgICAgTWVzc2FnZXMuVW5leHBlY3RlZFRva2VuIDogTWVzc2FnZXMuTWlzc2luZ0Zyb21DbGF1c2UsIGxvb2thaGVhZC52YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV4KCk7XG4gICAgICAgIHNyYyA9IHBhcnNlTW9kdWxlU3BlY2lmaWVyKCk7XG4gICAgICAgIGNvbnN1bWVTZW1pY29sb24oKTtcblxuICAgICAgICByZXR1cm4gbm9kZS5maW5pc2hFeHBvcnRBbGxEZWNsYXJhdGlvbihzcmMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlRXhwb3J0RGVjbGFyYXRpb24oKSB7XG4gICAgICAgIHZhciBub2RlID0gbmV3IE5vZGUoKTtcbiAgICAgICAgaWYgKHN0YXRlLmluRnVuY3Rpb25Cb2R5KSB7XG4gICAgICAgICAgICB0aHJvd0Vycm9yKE1lc3NhZ2VzLklsbGVnYWxFeHBvcnREZWNsYXJhdGlvbik7XG4gICAgICAgIH1cblxuICAgICAgICBleHBlY3RLZXl3b3JkKCdleHBvcnQnKTtcblxuICAgICAgICBpZiAobWF0Y2hLZXl3b3JkKCdkZWZhdWx0JykpIHtcbiAgICAgICAgICAgIHJldHVybi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cGFyc2VJbXBvcnREZWNsYXJhdGlvbigpIHtcbiAgICAgICAgdmFyIHNwZWNpZmllcnMgPSBbXSwgc3JjLCBub2RlID0gbmV3IE5vZGUoKTtcblxuICAgICAgICBpZiAoc3RhdGUuaW5GdW5jdGlvbkJvZHkpIHtcbiAgICAgICAgICAgIHRocm93RXJyb3IoTWVzc2FnZXMuSWxsZWdhbEltcG9ydERlY2xhcmF0aW9uKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGV4cGVjdEtleXdvcmQoJ2ltcG9ydCcpO1xuXG4gICAgICAgIGlmIChsb29rYWhlYWQudHlwZSA9PT0gVG9rZW4uU3RyaW5nTGl0ZXJhbCkge1xuICAgICAgICAgICAgLy8gaW1wb3J0ICdmb28nO1xuICAgICAgICAgICAgc3JjID0gcGFyc2VNb2R1bGVTcGVjaWZpZXIoKTtcbiAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgaWYgKG1hdGNoKCd7JykpIHtcbiAgICAgICAgICAgICAgICAvLyBpbXBvcnQge2Jhcn1cbiAgICAgICAgICAgICAgICBzcGVjaWZpZXJzID0gc3BlY2lmaWVycy5jb25jYXQocGFyc2VOYW1lZEltcG9ydHMoKSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoKCcqJykpIHtcbiAgICAgICAgICAgICAgICAvLyBpbXBvcnQgKiBhcyBmb29cbiAgICAgICAgICAgICAgICBzcGVjaWZpZXJzLnB1c2gocGFyc2VJbXBvcnROYW1lc3BhY2VTcGVjaWZpZXIoKSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzSWRlbnRpZmllck5hbWUobG9va2FoZWFkKSAmJiAhbWF0Y2hLZXl3b3JkKCdkZWZhdWx0JykpIHtcbiAgICAgICAgICAgICAgICAvLyBpbXBvcnQgZm9vXG4gICAgICAgICAgICAgICAgc3BlY2lmaWVycy5wdXNoKHBhcnNlSW1wb3J0RGVmYXVsdFNwZWNpZmllcigpKTtcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2goJywnKSkge1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hdGNoKCcqJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGltcG9ydCBmb28sICogYXMgZm9vXG4gICAgICAgICAgICAgICAgICAgICAgICBzcGVjaWZpZXJzLnB1c2gocGFyc2VJbXBvcnROYW1lc3BhY2VTcGVjaWZpZXIoKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2goJ3snKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW1wb3J0IGZvbywge2Jhcn1cbiAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNpZmllcnMgPSBzcGVjaWZpZXJzLmNvbmNhdChwYXJzZU5hbWVkSW1wb3J0cygpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93VW5leHBlY3RlZFRva2VuKGxleCgpKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFtYXRjaENvbnRleHR1YWxLZXl3b3JkKCdmcm9tJykpIHtcbiAgICAgICAgICAgICAgICB0aHJvd0Vycm9yKGxvb2thaGVhZC52YWx1ZSA/XG4gICAgICAgICAgICAgICAgICAgICAgICBNZXNzYWdlcy5VbmV4cGVjdGVkVG9rZW4gOiBNZXNzYWdlcy5NaXNzaW5nRnJvbUNsYXVzZSwgbG9va2FoZWFkLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgc3JjID0gcGFyc2VNb2R1bGVTcGVjaWZpZXIoKTtcbiAgICAgICAg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ICAgICAgICAgICAgICAgIHRvbGVyYXRlVW5leHBlY3RlZFRva2VuKGZpcnN0UmVzdHJpY3RlZCwgTWVzc2FnZXMuU3RyaWN0T2N0YWxMaXRlcmFsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghZmlyc3RSZXN0cmljdGVkICYmIHRva2VuLm9jdGFsKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpcnN0UmVzdHJpY3RlZCA9IHRva2VuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHdoaWxlIChzdGFydEluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBzdGF0ZW1lbnQgPSBwYXJzZVN0YXRlbWVudExpc3RJdGVtKCk7XG4gICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgaWYgKi9cbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc3RhdGVtZW50ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYm9keS5wdXNoKHN0YXRlbWVudCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGJvZHk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcGFyc2VQcm9ncmFtKCkge1xuICAgICAgICB2YXIgYm9keSwgbm9kZTtcblxuICAgICAgICBwZWVrKCk7XG4gICAgICAgIG5vZGUgPSBuZXcgTm9kZSgpO1xuXG4gICAgICAgIGJvZHkgPSBwYXJzZVNjcmlwdEJvZHkoKTtcbiAgICAgICAgcmV0dXJuIG5vZGUuZmluaXNoUHJvZ3JhbShib2R5LCBzdGF0ZS5zb3VyY2VUeXBlKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBmaWx0ZXJUb2tlbkxvY2F0aW9uKCkge1xuICAgICAgICB2YXIgaSwgZW50cnksIHRva2VuLCB0b2tlbnMgPSBbXTtcblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZXh0cmEudG9rZW5zLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICBlbnRyeSA9IGV4dHJhLnRva2Vuc1tpXTtcbiAgICAgICAgICAgIHRva2VuID0ge1xuICAgICAgICAgICAgICAgIHR5cGU6IGVudHJ5LnR5cGUsXG4gICAgICAgICAgICAgICAgdmFsdWU6IGVudHJ5LnZhbHVlXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGVudHJ5LnJlZ2V4KSB7XG4gICAgICAgICAgICAgICAgdG9rZW4ucmVnZXggPSB7XG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm46IGVudHJ5LnJlZ2V4LnBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIGZsYWdzOiBlbnRyeS5yZWdleC5mbGFnc1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXh0cmEucmFuZ2UpIHtcbiAgICAgICAgICAgICAgICB0b2tlbi5yYW5nZSA9IGVudHJ5LnJhbmdlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4dHJhLmxvYykge1xuICAgICAgICAgICAgICAgIHRva2VuLmxvYyA9IGVudHJ5LmxvYztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRva2Vucy5wdXNoKHRva2VuKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGV4dHJhLnRva2VucyA9IHRva2VucztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiB0b2tlbml6ZShjb2RlLCBvcHRpb25zLCBkZWxlZ2F0ZSkge1xuICAgICAgICB2YXIgdG9TdHJpbmcsXG4gICAgICAgICAgICB0b2tlbnM7XG5cbiAgICAgICAgdG9TdHJpbmcgPSBTdHJpbmc7XG4gICAgICAgIGlmICh0eXBlb2YgY29kZSAhPT0gJ3N0cmluZycgJiYgIShjb2RlIGluc3RhbmNlb2YgU3RyaW5nKSkge1xuICAgICAgICAgICAgY29kZSA9IHRvU3RyaW5nKGNvZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgc291cmNlID0gY29kZTtcbiAgICAgICAgaW5kZXggPSAwO1xuICAgICAgICBsaW5lTnVtYmVyID0gKHNvdXJjZS5sZW5ndGggPiAwKSA/IDEgOiAwO1xuICAgICAgICBsaW5lU3RhcnQgPSAwO1xuICAgICAgICBzdGFydEluZGV4ID0gaW5kZXg7XG4gICAgICAgIHN0YXJ0TGluZU51bWJlciA9IGxpbmVOdW1iZXI7XG4gICAgICAgIHN0YXJ0TGluZVN0YXJ0ID0gbGluZVN0YXJ0O1xuICAgICAgICBsZW5ndGggPSBzb3VyY2UubGVuZ3RoO1xuICAgICAgICBsb29rYWhlYWQgPSBudWxsO1xuICAgICAgICBzdGF0ZSA9IHtcbiAgICAgICAgICAgIGFsbG93SW46IHRydWUsXG4gICAgICAgICAgICBhbGxvd1lpZWxkOiB0cnVlLFxuICAgICAgICAgICAgbGFiZWxTZXQ6IHt9LFxuICAgICAgICAgICAgaW5GdW5jdGlvbkJvZHk6IGZhbHNlLFxuICAgICAgICAgICAgaW5JdGVyYXRpb246IGZhbHNlLFxuICAgICAgICAgICAgaW5Td2l0Y2g6IGZhbHNlLFxuICAgICAgICAgICAgbGFzdENvbW1lbnRTdGFydDogLTEsXG4gICAgICAgICAgICBjdXJseVN0YWNrOiBbXVxuICAgICAgICB9O1xuXG4gICAgICAgIGV4dHJhID0ge307XG5cbiAgICAgICAgLy8gT3B0aW9ucyBtYXRjaGluZy5cbiAgICAgICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge307XG5cbiAgICAgICAgLy8gT2YgY291cnNlIHdlIGNvbGxlY3QgdG9rZW5zIGhlcmUuXG4gICAgICAgIG9wdGlvbnMudG9rZW5zID0gdHJ1ZTtcbiAgICAgICAgZXh0cmEudG9rZW5zID0gW107XG4gICAgICAgIGV4dHJhLnRva2VuVmFsdWVzID0gW107XG4gICAgICAgIGV4dHJhLnRva2VuaXplID0gdHJ1ZTtcbiAgICAgICAgZXh0cmEuZGVsZWdhdGUgPSBkZWxlZ2F0ZTtcblxuICAgICAgICAvLyBUaGUgZm9sbG93aW5nIHR3byBmaWVsZHMgYXJlIG5lY2Vzc2FyeSB0byBjb21wdXRlIHRoZSBSZWdleCB0b2tlbnMuXG4gICAgICAgIGV4dHJhLm9wZW5QYXJlblRva2VuID0gLTE7XG4gICAgICAgIGV4dHJhLm9wZW5DdXJseVRva2VuID0gLTE7XG5cbiAgICAgICAgZXh0cmEucmFuZ2UgPSAodHlwZW9mIG9wdGlvbnMucmFuZ2UgPT09ICdib29sZWFuJykgJiYgb3B0aW9ucy5yYW5nZTtcbiAgICAgICAgZXh0cmEubG9jID0gKHR5cGVvZiBvcHRpb25zLmxvYyA9PT0gJ2Jvb2xlYW4nKSAmJiBvcHRpb25zLmxvYztcblxuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuY29tbWVudCA9PT0gJ2Jvb2xlYW4nICYmIG9wdGlvbnMuY29tbWVudCkge1xuICAgICAgICAgICAgZXh0cmEuY29tbWVudHMgPSBbXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMudG9sZXJhbnQgPT09ICdib29sZWFuJyAmJiBvcHRpb25zLnRvbGVyYW50KSB7XG4gICAgICAgICAgICBleHRyYS5lcnJvcnMgPSBbXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBwZWVrKCk7XG4gICAgICAgICAgICBpZiAobG9va2FoZWFkLnR5cGUgPT09IFRva2VuLkVPRikge1xuICAgICAgICAgICAgICAgIHJldHVybiBleHRyYS50b2tlbnM7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxleCgpO1xuICAgICAgICAgICAgd2hpbGUgKGxvb2thaGVhZC50eXBlICE9PSBUb2tlbi5FT0YpIHtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBsZXgoKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChsZXhFcnJvcikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXh0cmEuZXJyb3JzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWNvcmRFcnJvcihsZXhFcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIHRvIGJyZWFrIG9uIHRoZSBmaXJzdCBlcnJvclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG8gYXZvaWQgaW5maW5pdGUgbG9vcHMuXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IGxleEVycm9yO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0b2tlbnMgPSBleHRyYS50b2tlbnM7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGV4dHJhLmVycm9ycyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICB0b2tlbnMuZXJyb3JzID0gZXh0cmEuZXJyb3JzO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgZXh0cmEgPSB7fTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdG9rZW5zO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBhcnNlKGNvZGUsIG9wdGlvbnMpIHtcbiAgICAgICAgdmFyIHByb2dyYW0sIHRvU3RyaW5nO1xuXG4gICAgICAgIHRvU3RyaW5nID0gU3RyaW5nO1xuICAgICAgICBpZiAodHlwZW9mIGNvZGUgIT09ICdzdHJpbmcnICYmICEoY29kZSBpbnN0YW5jZW9mIFN0cmluZykpIHtcbiAgICAgICAgICAgIGNvZGUgPSB0b1N0cmluZyhjb2RlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHNvdXJjZSA9IGNvZGU7XG4gICAgICAgIGluZGV4ID0gMDtcbiAgICAgICAgbGluZU51bWJlciA9IChzb3VyY2UubGVuZ3RoID4gMCkgPyAxIDogMDtcbiAgICAgICAgbGluZVN0YXJ0ID0gMDtcbiAgICAgICAgc3RhcnRJbmRleCA9IGluZGV4O1xuICAgICAgICBzdGFydExpbmVOdW1iZXIgPSBsaW5lTnVtYmVyO1xuICAgICAgICBzdGFydExpbmVTdGFydCA9IGxpbmVTdGFydDtcbiAgICAgICAgbGVuZ3RoID0gc291cmNlLmxlbmd0aDtcbiAgICAgICAgbG9va2FoZWFkID0gbnVsbDtcbiAgICAgICAgc3RhdGUgPSB7XG4gICAgICAgICAgICBhbGxvd0luOiB0cnVlLFxuICAgICAgICAgICAgYWxsb3dZaWVsZDogdHJ1ZSxcbiAgICAgICAgICAgIGxhYmVsU2V0OiB7fSxcbiAgICAgICAgICAgIGluRnVuY3Rpb25Cb2R5OiBmYWxzZSxcbiAgICAgICAgICAgIGluSXRlcmF0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgIGluU3dpdGNoOiBmYWxzZSxcbiAgICAgICAgICAgIGxhc3RDb21tZW50U3RhcnQ6IC0xLFxuICAgICAgICAgICAgY3VybHlTdGFjazogW10sXG4gICAgICAgICAgICBzb3VyY2VUeXBlOiAnc2NyaXB0J1xuICAgICAgICB9O1xuICAgICAgICBzdHJpY3QgPSBmYWxzZTtcblxuICAgICAgICBleHRyYSA9IHt9O1xuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBleHRyYS5yYW5nZSA9ICh0eXBlb2Ygb3B0aW9ucy5yYW5nZSA9PT0gJ2Jvb2xlYW4nKSAmJiBvcHRpb25zLnJhbmdlO1xuICAgICAgICAgICAgZXh0cmEubG9jID0gKHR5cGVvZiBvcHRpb25zLmxvYyA9PT0gJ2Jvb2xlYW4nKSAmJiBvcHRpb25zLmxvYztcbiAgICAgICAgICAgIGV4dHJhLmF0dGFjaENvbW1lbnQgPSAodHlwZW9mIG9wdGlvbnMuYXR0YWNoQ29tbWVudCA9PT0gJ2Jvb2xlYW4nKSAmJiBvcHRpb25zLmF0dGFjaENvbW1lbnQ7XG5cbiAgICAgICAgICAgIGlmIChleHRyYS5sb2MgJiYgb3B0aW9ucy5zb3VyY2UgIT09IG51bGwgJiYgb3B0aW9ucy5zb3VyY2UgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGV4dHJhLnNvdXJjZSA9IHRvU3RyaW5nKG9wdGlvbnMuc291cmNlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLnRva2VucyA9PT0gJ2Jvb2xlYW4nICYmIG9wdGlvbnMudG9rZW5zKSB7XG4gICAgICAgICAgICAgICAgZXh0cmEudG9rZW5zID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMuY29tbWVudCA9PT0gJ2Jvb2xlYW4nICYmIG9wdGlvbnMuY29tbWVudCkge1xuICAgICAgICAgICAgICAgIGV4dHJhLmNvbW1lbnRzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMudG9sZXJhbnQgPT09ICdib29sZWFuJyAmJiBvcHRpb25zLnRvbGVyYW50KSB7XG4gICAgICAgICAgICAgICAgZXh0cmEuZXJyb3JzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXh0cmEuYXR0YWNoQ29tbWVudCkge1xuICAgICAgICAgICAgICAgIGV4dHJhLnJhbmdlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBleHRyYS5jb21tZW50cyA9IFtdO1xuICAgICAgICAgICAgICAgIGV4dHJhLmJvdHRvbVJpZ2h0U3RhY2sgPSBbXTtcbiAgICAgICAgICAgICAgICBleHRyYS50cmFpbGluZ0NvbW1lbnRzID0gW107XG4gICAgICAgICAgICAgICAgZXh0cmEubGVhZGluZ0NvbW1lbnRzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob3B0aW9ucy5zb3VyY2VUeXBlID09PSAnbW9kdWxlJykge1xuICAgICAgICAgICAgICAgIC8vIHZlcnkgcmVzdHJpY3RpdmUgY29uZGl0aW9uIGZvciBub3dcbiAgICAgICAgICAgICAgICBzdGF0ZS5zb3VyY2VUeXBlID0gb3B0aW9ucy5zb3VyY2VUeXBlO1xuICAgICAgICAgICAgICAgIHN0cmljdCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcHJvZ3JhbSA9IHBhcnNlUHJvZ3JhbSgpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBleHRyYS5jb21tZW50cyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBwcm9ncmFtLmNvbW1lbnRzID0gZXh0cmEuY29tbWVudHM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIGV4dHJhLnRva2VucyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWx0ZXJUb2tlbkxvY2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgcHJvZ3JhbS50b2tlbnMgPSBleHRyYS50b2tlbnM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIGV4dHJhLmVycm9ycyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBwcm9ncmFtLmVycm9ycyA9IGV4dHJhLmVycm9ycztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfSBmaW5hbGx5IHtcbi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9IG9iaktleXMob2JqKTtcbiAgICBpZihuZWVkQ2hlY2tQcm9wcykge1xuICAgICAgICB2YXIgc3BlY1Byb3AsIGkgPSAwO1xuICAgICAgICB3aGlsZShzcGVjUHJvcCA9IHNwZWNQcm9wc1tpKytdKSB7XG4gICAgICAgICAgICBvYmouaGFzT3duUHJvcGVydHkoc3BlY1Byb3ApICYmIHJlcy5wdXNoKHNwZWNQcm9wKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiByZXM7XG59XG5cbmZ1bmN0aW9uIG92ZXJyaWRlKGJhc2UsIHJlcywgYWRkKSB7XG4gICAgdmFyIGFkZExpc3QgPSBnZXRQcm9wTGlzdChhZGQpLFxuICAgICAgICBqID0gMCwgbGVuID0gYWRkTGlzdC5sZW5ndGgsXG4gICAgICAgIG5hbWUsIHByb3A7XG4gICAgd2hpbGUoaiA8IGxlbikge1xuICAgICAgICBpZigobmFtZSA9IGFkZExpc3RbaisrXSkgPT09ICdfX3NlbGYnKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBwcm9wID0gYWRkW25hbWVdO1xuICAgICAgICBpZihpc0Z1bmN0aW9uKHByb3ApICYmXG4gICAgICAgICAgICAgICAgKCFoYXNJbnRyb3NwZWN0aW9uIHx8IHByb3AudG9TdHJpbmcoKS5pbmRleE9mKCcuX19iYXNlJykgPiAtMSkpIHtcbiAgICAgICAgICAgIHJlc1tuYW1lXSA9IChmdW5jdGlvbihuYW1lLCBwcm9wKSB7XG4gICAgICAgICAgICAgICAgdmFyIGJhc2VNZXRob2QgPSBiYXNlW25hbWVdP1xuICAgICAgICAgICAgICAgICAgICAgICAgYmFzZVtuYW1lXSA6XG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lID09PSAnX19jb25zdHJ1Y3Rvcic/IC8vIGNhc2Ugb2YgaW5oZXJpdGFuY2UgZnJvbSBwbGFuZSBmdW5jdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5fX3NlbGYuX19wYXJlbnQgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vT3A7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYmFzZVNhdmVkID0gdGhpcy5fX2Jhc2U7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX19iYXNlID0gYmFzZU1ldGhvZDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IHByb3AuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fX2Jhc2UgPSBiYXNlU2F2ZWQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXM7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pKG5hbWUsIHByb3ApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzW25hbWVdID0gcHJvcDtcbiAgICAgICAgfVxuICAgIH1cbn1cblxuZnVuY3Rpb24gYXBwbHlNaXhpbnMobWl4aW5zLCByZXMpIHtcbiAgICB2YXIgaSA9IDEsIG1peGluO1xuICAgIHdoaWxlKG1peGluID0gbWl4aW5zW2krK10pIHtcbiAgICAgICAgcmVzP1xuICAgICAgICAgICAgaXNGdW5jdGlvbihtaXhpbik/XG4gICAgICAgICAgICAgICAgaW5oZXJpdC5zZWxmKHJlcywgbWl4aW4ucHJvdG90eXBlLCBtaXhpbikgOlxuICAgICAgICAgICAgICAgIGluaGVyaXQuc2VsZihyZXMsIG1peGluKSA6XG4gICAgICAgICAgICByZXMgPSBpc0Z1bmN0aW9uKG1peGluKT9cbiAgICAgICAgICAgICAgICBpbmhlcml0KG1peGluc1swXSwgbWl4aW4ucHJvdG90eXBlLCBtaXhpbikgOlxuICAgICAgICAgICAgICAgIGluaGVyaXQobWl4aW5zWzBdLCBtaXhpbik7XG4gICAgfVxuICAgIHJldHVybiByZXMgfHwgbWl4aW5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VldWUubGVuZ3RoKSB7XG4gICAgICAgICAgICB0YXNrID0gbGF0ZXJRdWV1ZS5wb3AoKTtcbiAgICAgICAgICAgIHJ1blNpbmdsZSh0YXNrKTtcbiAgICAgICAgfVxuICAgICAgICBmbHVzaGluZyA9IGZhbHNlO1xuICAgIH1cbiAgICAvLyBydW5zIGEgc2luZ2xlIGZ1bmN0aW9uIGluIHRoZSBhc3luYyBxdWV1ZVxuICAgIGZ1bmN0aW9uIHJ1blNpbmdsZSh0YXNrLCBkb21haW4pIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHRhc2soKTtcblxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAoaXNOb2RlSlMpIHtcbiAgICAgICAgICAgICAgICAvLyBJbiBub2RlLCB1bmNhdWdodCBleGNlcHRpb25zIGFyZSBjb25zaWRlcmVkIGZhdGFsIGVycm9ycy5cbiAgICAgICAgICAgICAgICAvLyBSZS10aHJvdyB0aGVtIHN5bmNocm9ub3VzbHkgdG8gaW50ZXJydXB0IGZsdXNoaW5nIVxuXG4gICAgICAgICAgICAgICAgLy8gRW5zdXJlIGNvbnRpbnVhdGlvbiBpZiB0aGUgdW5jYXVnaHQgZXhjZXB0aW9uIGlzIHN1cHByZXNzZWRcbiAgICAgICAgICAgICAgICAvLyBsaXN0ZW5pbmcgXCJ1bmNhdWdodEV4Y2VwdGlvblwiIGV2ZW50cyAoYXMgZG9tYWlucyBkb2VzKS5cbiAgICAgICAgICAgICAgICAvLyBDb250aW51ZSBpbiBuZXh0IGV2ZW50IHRvIGF2b2lkIHRpY2sgcmVjdXJzaW9uLlxuICAgICAgICAgICAgICAgIGlmIChkb21haW4pIHtcbiAgICAgICAgICAgICAgICAgICAgZG9tYWluLmV4aXQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmbHVzaCwgMCk7XG4gICAgICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICAgICAgICBkb21haW4uZW50ZXIoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aHJvdyBlO1xuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIEluIGJyb3dzZXJzLCB1bmNhdWdodCBleGNlcHRpb25zIGFyZSBub3QgZmF0YWwuXG4gICAgICAgICAgICAgICAgLy8gUmUtdGhyb3cgdGhlbSBhc3luY2hyb25vdXNseSB0byBhdm9pZCBzbG93LWRvd25zLlxuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICAgICAgICAgIH0sIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgZG9tYWluLmV4aXQoKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5leHRUaWNrID0gZnVuY3Rpb24gKHRhc2spIHtcbiAgICAgICAgdGFpbCA9IHRhaWwubmV4dCA9IHtcbiAgICAgICAgICAgIHRhc2s6IHRhc2ssXG4gICAgICAgICAgICBkb21haW46IGlzTm9kZUpTICYmIHByb2Nlc3MuZG9tYWluLFxuICAgICAgICAgICAgbmV4dDogbnVsbFxuICAgICAgICB9O1xuXG4gICAgICAgIGlmICghZmx1c2hpbmcpIHtcbiAgICAgICAgICAgIGZsdXNoaW5nID0gdHJ1ZTtcbiAgICAgICAgICAgIHJlcXVlc3RUaWNrKCk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgaWYgKHR5cGVvZiBwcm9jZXNzID09PSBcIm9iamVjdFwiICYmXG4gICAgICAgIHByb2Nlc3MudG9TdHJpbmcoKSA9PT0gXCJbb2JqZWN0IHByb2Nlc3NdXCIgJiYgcHJvY2Vzcy5uZXh0VGljaykge1xuICAgICAgICAvLyBFbnN1cmUgUSBpcyBpbiBhIHJlYWwgTm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7XG5cbnZhciBhcnJheV9yZWR1Y2UgPSB1bmN1cnJ5VGhpcyhcbiAgICBBcnJheS5wcm90b3R5cGUucmVkdWNlIHx8IGZ1bmN0aW9uIChjYWxsYmFjaywgYmFzaXMpIHtcbiAgICAgICAgdmFyIGluZGV4ID0gMCxcbiAgICAgICAgICAgIGxlbmd0aCA9IHRoaXMubGVuZ3RoO1xuICAgICAgICAvLyBjb25jZXJuaW5nIHRoZSBpbml0aWFsIHZhbHVlLCBpZiBvbmUgaXMgbm90IHByb3ZpZGVkXG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICAvLyBzZWVrIHRvIHRoZSBmaXJzdCB2YWx1ZSBpbiB0aGUgYXJyYXksIGFjY291bnRpbmdcbiAgICAgICAgICAgIC8vIGZvciB0aGUgcG9zc2liaWxpdHkgdGhhdCBpcyBpcyBhIHNwYXJzZSBhcnJheVxuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIGlmIChpbmRleCBpbiB0aGlzKSB7XG4gICAgICAgICAgICAgICAgICAgIGJhc2lzID0gdGhpc1tpbmRleCsrXTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgrK2luZGV4ID49IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSB3aGlsZSAoMSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gcmVkdWNlXG4gICAgICAgIGZvciAoOyBpbmRleCA8IGxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgLy8gYWNjb3VudCBmb3IgdGhlIHBvc3NpYmlsaXR5IHRoYXQgdGhlIGFycmF5IGlzIHNwYXJzZVxuICAgICAgICAgICAgaWYgKGluZGV4IGluIHRoaXMpIHtcbiAgICAgICAgICAgICAg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IH1cblxuICAgIGRlZmVycmVkLnByb21pc2UgPSBwcm9taXNlO1xuICAgIGRlZmVycmVkLnJlc29sdmUgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgaWYgKHJlc29sdmVkUHJvbWlzZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgYmVjb21lKFEodmFsdWUpKTtcbiAgICB9O1xuXG4gICAgZGVmZXJyZWQuZnVsZmlsbCA9IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICBpZiAocmVzb2x2ZWRQcm9taXNlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBiZWNvbWUoZnVsZmlsbCh2YWx1ZSkpO1xuICAgIH07XG4gICAgZGVmZXJyZWQucmVqZWN0ID0gZnVuY3Rpb24gKHJlYXNvbikge1xuICAgICAgICBpZiAocmVzb2x2ZWRQcm9taXNlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBiZWNvbWUocmVqZWN0KHJlYXNvbikpO1xuICAgIH07XG4gICAgZGVmZXJyZWQubm90aWZ5ID0gZnVuY3Rpb24gKHByb2dyZXNzKSB7XG4gICAgICAgIGlmIChyZXNvbHZlZFByb21pc2UpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGFycmF5X3JlZHVjZShwcm9ncmVzc0xpc3RlbmVycywgZnVuY3Rpb24gKHVuZGVmaW5lZCwgcHJvZ3Jlc3NMaXN0ZW5lcikge1xuICAgICAgICAgICAgUS5uZXh0VGljayhmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcHJvZ3Jlc3NMaXN0ZW5lcihwcm9ncmVzcyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSwgdm9pZCAwKTtcbiAgICB9O1xuXG4gICAgcmV0dXJuIGRlZmVycmVkO1xufVxuXG4vKipcbiAqIENyZWF0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mdW5jdGlvbiBfcmVqZWN0ZWQoZXhjZXB0aW9uKSB7XG4gICAgICAgIGlmICh0eXBlb2YgcmVqZWN0ZWQgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgbWFrZVN0YWNrVHJhY2VMb25nKGV4Y2VwdGlvbiwgc2VsZik7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHJldHVybiByZWplY3RlZChleGNlcHRpb24pO1xuICAgICAgICAgICAgfSBjYXRjaCAobmV3RXhjZXB0aW9uKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChuZXdFeGNlcHRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZWplY3QoZXhjZXB0aW9uKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBfcHJvZ3Jlc3NlZCh2YWx1ZSkge1xuICAgICAgICByZXR1cm4gdHlwZW9mIHByb2dyZXNzZWQgPT09IFwiZnVuY3Rpb25cIiA/IHByb2dyZXNzZWQodmFsdWUpIDogdmFsdWU7XG4gICAgfVxuXG4gICAgUS5uZXh0VGljayhmdW5jdGlvbiAoKSB7XG4gICAgICAgIHNlbGYucHJvbWlzZURpc3BhdGNoKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb25lID0gdHJ1ZTtcblxuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShfZnVsZmlsbGVkKHZhbHVlKSk7XG4gICAgICAgIH0sIFwid2hlblwiLCBbZnVuY3Rpb24gKGV4Y2VwdGlvbikge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb25lID0gdHJ1ZTtcblxuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x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1pbnNwaXJlZCBzZW1hbnRpY3Mgb2ZcbiAgICAgICAgICAgIC8vIG91dGRhdGVkIEVTNiBkcmFmdHMuICBXZSB3b3VsZCBsaWtlIHRvIHN1cHBvcnQgRVM2LCBidXQgd2UnZCBhbHNvXG4gICAgICAgICAgICAvLyBsaWtlIHRvIG1ha2UgaXQgcG9zc2libGUgdG8gdXNlIGdlbmVyYXRvcnMgaW4gZGVwbG95ZWQgYnJvd3NlcnMsIHNvXG4gICAgICAgICAgICAvLyB3ZSBhbHNvIHN1cHBvcnQgUHl0aG9uLXN0eWxlIGdlbmVyYXRvcnMuICBBdCBzb21lIHBvaW50IHdlIGNhbiByZW1vdmVcbiAgICAgICAgICAgIC8vIHRoaXMgYmxvY2suXG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgU3RvcEl0ZXJhdGlvbiA9PT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgICAgIC8vIEVTNiBHZW5lcmF0b3JzXG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZ2VuZXJhdG9yW3ZlcmJdKGFyZyk7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXhjZXB0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWplY3QoZXhjZXB0aW9uKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5kb25lKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBRKHJlc3VsdC52YWx1ZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdoZW4ocmVzdWx0LnZhbHVlLCBjYWxsYmFjaywgZXJyYmFjayk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBTcGlkZXJNb25rZXkgR2VuZXJhdG9yc1xuICAgICAgICAgICAgICAgIC8vIEZJWE1FOiBSZW1vdmUgdGhpcyBjYXNlIHdoZW4gU00gZG9lcyBFUzYgZ2VuZXJhdG9ycy5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBnZW5lcmF0b3JbdmVyYl0oYXJnKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChleGNlcHRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzU3RvcEl0ZXJhdGlvbihleGNlcHRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUShleGNlcHRpb24udmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChleGNlcHRpb24pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB3aGVuKHJlc3VsdCwgY2FsbGJhY2ssIGVycmJhY2spO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBnZW5lcmF0b3IgPSBtYWtlR2VuZXJhdG9yLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIHZhciBjYWxsYmFjayA9IGNvbnRpbnVlci5iaW5kKGNvbnRpbnVlciwgXCJuZXh0XCIpO1xuICAgICAgICB2YXIgZXJyYmFjayA9IGNvbnRpbnVlci5iaW5kKGNvbnRpbnVlciwgXCJ0aHJvd1wiKTtcbiAgICAgICAgcmV0dXJuIGNhbGxiYWNrKCk7XG4gICAgfTtcbn1cblxuLyoqXG4gKiBUaGUgc3Bhd24gZnVuY3Rpb24gaXMgYSBzbWFsbCB3cmFwcGVyIGFyb3VuZCBhc3luYyB0aGF0IGltbWVkaWF0ZWx5XG4gKiBjYWxscyB0aGUgZ2VuZXJhdG9yIGFuZCBhbHNvIGVuZHMgdGhlIHByb21pc2UgY2hhaW4sIHN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bGwgPSBhbGw7XG5mdW5jdGlvbiBhbGwocHJvbWlzZXMpIHtcbiAgICByZXR1cm4gd2hlbihwcm9taXNlcywgZnVuY3Rpb24gKHByb21pc2VzKSB7XG4gICAgICAgIHZhciBwZW5kaW5nQ291bnQgPSAwO1xuICAgICAgICB2YXIgZGVmZXJyZWQgPSBkZWZlcigpO1xuICAgICAgICBhcnJheV9yZWR1Y2UocHJvbWlzZXMsIGZ1bmN0aW9uICh1bmRlZmluZWQsIHByb21pc2UsIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgc25hcHNob3Q7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgaXNQcm9taXNlKHByb21pc2UpICYmXG4gICAgICAgICAgICAgICAgKHNuYXBzaG90ID0gcHJvbWlzZS5pbnNwZWN0KCkpLnN0YXRlID09PSBcImZ1bGZpbGxlZFwiXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBwcm9taXNlc1tpbmRleF0gPSBzbmFwc2hvdC52YWx1ZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgKytwZW5kaW5nQ291bnQ7XG4gICAgICAgICAgICAgICAgd2hlbihcbiAgICAgICAgICAgICAgICAgICAgcHJvbWlzZSxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9taXNlc1tpbmRleF0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgtLXBlbmRpbmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUocHJvbWlzZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QsXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChwcm9ncmVzcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQubm90aWZ5KHsgaW5kZXg6IGluZGV4LCB2YWx1ZTogcHJvZ3Jlc3MgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LCB2b2lkIDApO1xuICAgICAgICBpZiAocGVuZGluZ0NvdW50ID09PSAwKSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHByb21pc2VzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICB9KTtcbn1cblxuUHJvbWlzZS5wcm90b3R5cGUuYWxsID0gZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiBhbGwodGhpcyk7XG59O1xuXG4vKipcbiAqIFJldHVybnMgdGhlIGZpcnN0IHJlc29sdmVkIHByb21pc2Ugb2YgYW4gYXJyYXkuIFByaW9yIHJlamVjdGVkIHByb21pc2VzIGFyZVxuICogaWdub3JlZC4gIFJlamVjdHMgb25seSBpZiBhbGwgcHJvbWlzZXMgYXJlIHJlamVjdGVkLlxuICogQHBhcmFtIHtBcnJheSp9IGFuIGFycmF5IGNvbnRhaW5pbmcgdmFsdWVzIG9yIHByb21pc2VzIGZvciB2YWx1ZXNcbiAqIEByZXR1cm5zIGEgcHJvbWlzZSBmdWxmaWxsZWQgd2l0aCB0aGUgdmFsdWUgb2YgdGhlIGZpcnN0IHJlc29sdmVkIHByb21pc2UsXG4gKiBvciBhIHJlamVjdGVkIHByb21pc2UgaWYgYWxsIHByb21pc2VzIGFyZSByZWplY3RlZC5cbiAqL1xuUS5hbnkgPSBhbnk7XG5cbmZ1bmN0aW9uIGFueShwcm9taXNlcykge1xuICAgIGlmIChwcm9taXNlcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgcmV0dXJuIFEucmVzb2x2ZSgpO1xuICAgIH1cblxuICAgIHZhciBkZWZlcnJlZCA9IFEuZGVmZXIoKTtcbiAgICB2YXIgcGVuZGluZ0NvdW50ID0gMDtcbiAgICBhcnJheV9yZWR1Y2UocHJvbWlzZXMsIGZ1bmN0aW9uIChwcmV2LCBjdXJyZW50LCBpbmRleCkge1xuICAgICAgICB2YXIgcHJvbWlzZSA9IHByb21pc2VzW2luZGV4XTtcblxuICAgICAgICBwZW5kaW5nQ291bnQrKztcblxuICAgICAgICB3aGVuKHByb21pc2UsIG9uRnVsZmlsbGVkLCBvblJlamVjdGVkLCBvblByb2dyZXNzKTtcbiAgICAgICAgZnVuY3Rpb24gb25GdWxmaWxsZWQocmVzdWx0KSB7XG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gb25SZWplY3RlZCgpIHtcbiAgICAgICAgICAgIHBlbmRpbmdDb3VudC0tO1xuICAgICAgICAgICAgaWYgKHBlbmRpbmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgIFwiQ2FuJ3QgZ2V0IGZ1bGZpbGxtZW50IHZhbHVlIGZyb20gYW55IHByb21pc2UsIGFsbCBcIiArXG4gICAgICAgICAgICAgICAgICAgIFwicHJvbWlzZXMgd2VyZSByZWplY3RlZC5cIlxuICAgICAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIG9uUHJvZ3Jlc3MocHJvZ3Jlc3MpIHtcbiAgICAgICAgICAgIGRlZmVycmVkLm5vdGlmeSh7XG4gICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxuICAgICAgICAgICAgICAgIHZhbHVlOiBwcm9ncmVzc1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9LCB1bmRlZmluZWQpO1xuXG4gICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG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YW5nZTogJzEuLjUnIH0pXG4gKiAgICAgICAgIC5zZW5kKHsgb3JkZXI6ICdkZXNjJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIG1hbnVhbCBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2pzb24nKVxuICogICAgICAgICAuc2VuZCgne1wibmFtZVwiOlwidGpcIn0nKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8ganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIG1hbnVhbCB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKCduYW1lPXRqJylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gZGVmYXVsdHMgdG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAgKiAgICAgICAgLnNlbmQoJ25hbWU9dG9iaScpXG4gICogICAgICAgIC5zZW5kKCdzcGVjaWVzPWZlcnJldCcpXG4gICogICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlx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gIHdpdGggYGZuYC5cbiAqXG4gKiBAcGFyYW0ge0FycmF5fSBhcnJcbiAqIEBwYXJhbSB7RnVuY3Rpb259IGZuXG4gKiBAcGFyYW0ge01peGVkfSBpbml0aWFsXG4gKlxuICogVE9ETzogY29tYmF0aWJsZSBlcnJvciBoYW5kbGluZz9cbiAqL1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uKGFyciwgZm4sIGluaXRpYWwpeyAgXG4gIHZhciBpZHggPSAwO1xuICB2YXIgbGVuID0gYXJyLmxlbmd0aDtcbiAgdmFyIGN1cnIgPSBhcmd1bWVudHMubGVuZ3RoID09IDNcbiAgICA/IGluaXRpYWxcbiAgICA6IGFycltpZHgrK107XG5cbiAgd2hpbGUgKGlkeCA8IGxlbikge1xuICAgIGN1cnIgPSBmbi5jYWxsKG51bGwsIGN1cnIsIGFycltpZHhdLCArK2lkeCwgYXJyKTtcbiAgfVxuICBcbiAgcmV0dXJuIGN1cnI7XG59OyJdfQ== |
| |
| /*global JSONEditor*/ |
| 'use strict'; |
| |
| window.SwaggerUi = Backbone.Router.extend({ |
| |
| dom_id: 'swagger_ui', |
| |
| // Attributes |
| options: null, |
| api: null, |
| headerView: null, |
| mainView: null, |
| |
| // SwaggerUi accepts all the same options as SwaggerApi |
| initialize: function(options) { |
| options = options || {}; |
| |
| if (options.defaultModelRendering !== 'model') { |
| options.defaultModelRendering = 'schema'; |
| } |
| |
| if (!options.highlightSizeThreshold) { |
| options.highlightSizeThreshold = 100000; |
| } |
| |
| // Allow dom_id to be overridden |
| if (options.dom_id) { |
| this.dom_id = options.dom_id; |
| delete options.dom_id; |
| } |
| |
| if (!options.supportedSubmitMethods){ |
| options.supportedSubmitMethods = [ |
| 'get', |
| 'put', |
| 'post', |
| 'delete', |
| 'head', |
| 'options', |
| 'patch' |
| ]; |
| } |
| |
| if (typeof options.oauth2RedirectUrl === 'string') { |
| window.oAuthRedirectUrl = options.redirectUrl; |
| } |
| |
| // Create an empty div which contains the dom_id |
| if (! $('#' + this.dom_id).length){ |
| $('body').append('<div id="' + this.dom_id + '"></div>') ; |
| } |
| |
| this.options = options; |
| |
| // set marked options |
| marked.setOptions({gfm: true}); |
| |
| // Set the callbacks |
| var that = this; |
| this.options.success = function() { return that.render(); }; |
| this.options.progress = function(d) { return that.showMessage(d); }; |
| this.options.failure = function(d) { return that.onLoadFailure(d); }; |
| |
| // Create view to handle the header inputs |
| this.headerView = new SwaggerUi.Views.HeaderView({el: $('#header')}); |
| |
| // Event handler for when the baseUrl/apiKey is entered by user |
| this.headerView.on('update-swagger-ui', function(data) { |
| return that.updateSwaggerUi(data); |
| }); |
| |
| // JSon Editor custom theming |
| JSONEditor.defaults.iconlibs.swagger = JSONEditor.AbstractIconLib.extend({ |
| mapping: { |
| collapse: 'collapse', |
| expand: 'expand' |
| }, |
| icon_prefix: 'swagger-' |
| }); |
| |
| }, |
| |
| // Set an option after initializing |
| setOption: function(option, value) { |
| this.options[option] = value; |
| }, |
| |
| // Get the value of a previously set option |
| getOption: function(option) { |
| return this.options[option]; |
| }, |
| |
| // Event handler for when url/key is received from user |
| updateSwaggerUi: function(data){ |
| this.options.url = data.url; |
| this.load(); |
| }, |
| |
| // Create an api and render |
| load: function(){ |
| // Initialize the API object |
| if (this.mainView) { |
| this.mainView.clear(); |
| } |
| var url = this.options.url; |
| if (url && url.indexOf('http') !== 0) { |
| url = this.buildUrl(window.location.href.toString(), url); |
| } |
| if(this.api) { |
| this.options.authorizations = this.api.clientAuthorizations.authz; |
| } |
| this.options.url = url; |
| this.headerView.update(url); |
| |
| this.api = new SwaggerClient(this.options); |
| }, |
| |
| // collapse all sections |
| collapseAll: function(){ |
| Docs.collapseEndpointListForResource(''); |
| }, |
| |
| // list operations for all sections |
| listAll: function(){ |
| Docs.collapseOperationsForResource(''); |
| }, |
| |
| // expand operations for all sections |
| expandAll: function(){ |
| Docs.expandOperationsForResource(''); |
| }, |
| |
| // This is bound to success handler for SwaggerApi |
| // so it gets called when SwaggerApi completes loading |
| render: function(){ |
| this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...'); |
| this.mainView = new SwaggerUi.Views.MainView({ |
| model: this.api, |
| el: $('#' + this.dom_id), |
| swaggerOptions: this.options, |
| router: this |
| }).render(); |
| this.showMessage(); |
| switch (this.options.docExpansion) { |
| case 'full': |
| this.expandAll(); break; |
| case 'list': |
| this.listAll(); break; |
| default: |
| break; |
| } |
| this.renderGFM(); |
| |
| if (this.options.onComplete){ |
| this.options.onComplete(this.api, this); |
| } |
| |
| setTimeout(Docs.shebang.bind(this), 100); |
| }, |
| |
| buildUrl: function(base, url){ |
| if (url.indexOf('/') === 0) { |
| var parts = base.split('/'); |
| base = parts[0] + '//' + parts[2]; |
| return base + url; |
| } else { |
| var endOfPath = base.length; |
| |
| if (base.indexOf('?') > -1){ |
| endOfPath = Math.min(endOfPath, base.indexOf('?')); |
| } |
| |
| if (base.indexOf('#') > -1){ |
| endOfPath = Math.min(endOfPath, base.indexOf('#')); |
| } |
| |
| base = base.substring(0, endOfPath); |
| |
| if (base.indexOf('/', base.length - 1 ) !== -1){ |
| return base + url; |
| } |
| |
| return base + '/' + url; |
| } |
| }, |
| |
| // Shows message on topbar of the ui |
| showMessage: function(data){ |
| if (data === undefined) { |
| data = ''; |
| } |
| var $msgbar = $('#message-bar'); |
| $msgbar.removeClass('message-fail'); |
| $msgbar.addClass('message-success'); |
| $msgbar.text(data); |
| if(window.SwaggerTranslator) { |
| window.SwaggerTranslator.translate($msgbar); |
| } |
| }, |
| |
| // shows message in red |
| onLoadFailure: function(data){ |
| if (data === undefined) { |
| data = ''; |
| } |
| $('#message-bar').removeClass('message-success'); |
| $('#message-bar').addClass('message-fail'); |
| |
| var val = $('#message-bar').text(data); |
| |
| if (this.options.onFailure) { |
| this.options.onFailure(data); |
| } |
| |
| return val; |
| }, |
| |
| // Renders GFM for elements with 'markdown' class |
| renderGFM: function(){ |
| $('.markdown').each(function(){ |
| $(this).html(marked($(this).html())); |
| }); |
| |
| $('.propDesc', '.model-signature .description').each(function () { |
| $(this).html(marked($(this).html())).addClass('markdown'); |
| }); |
| } |
| |
| }); |
| |
| window.SwaggerUi.Views = {}; |
| |
| // don't break backward compatibility with previous versions and warn users to upgrade their code |
| (function(){ |
| window.authorizations = { |
| add: function() { |
| warn('Using window.authorizations is deprecated. Please use SwaggerUi.api.clientAuthorizations.add().'); |
| |
| if (typeof window.swaggerUi === 'undefined') { |
| throw new TypeError('window.swaggerUi is not defined'); |
| } |
| |
| if (window.swaggerUi instanceof SwaggerUi) { |
| window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations, arguments); |
| } |
| } |
| }; |
| |
| window.ApiKeyAuthorization = function() { |
| warn('window.ApiKeyAuthorization is deprecated. Please use SwaggerClient.ApiKeyAuthorization.'); |
| SwaggerClient.ApiKeyAuthorization.apply(window, arguments); |
| }; |
| |
| window.PasswordAuthorization = function() { |
| warn('window.PasswordAuthorization is deprecated. Please use SwaggerClient.PasswordAuthorization.'); |
| SwaggerClient.PasswordAuthorization.apply(window, arguments); |
| }; |
| |
| function warn(message) { |
| if ('console' in window && typeof window.console.warn === 'function') { |
| console.warn(message); |
| } |
| } |
| })(); |
| |
| |
| // UMD |
| (function (root, factory) { |
| if (typeof define === 'function' && define.amd) { |
| // AMD. Register as an anonymous module. |
| define(['b'], function (b) { |
| return (root.SwaggerUi = factory(b)); |
| }); |
| } else if (typeof exports === 'object') { |
| // Node. Does not work with strict CommonJS, but |
| // only CommonJS-like environments that support module.exports, |
| // like Node. |
| module.exports = factory(require('b')); |
| } else { |
| // Browser globals |
| root.SwaggerUi = factory(root.b); |
| } |
| }(this, function () { |
| return SwaggerUi; |
| })); |
| |
| 'use strict'; |
| |
| SwaggerUi.Views.ApiKeyButton = Backbone.View.extend({ // TODO: append this to global SwaggerUi |
| |
| events:{ |
| 'click #apikey_button' : 'toggleApiKeyContainer', |
| 'click #apply_api_key' : 'applyApiKey' |
| }, |
| |
| initialize: function(opts){ |
| this.options = opts || {}; |
| this.router = this.options.router; |
| }, |
| |
| render: function(){ |
| var template = this.template(); |
| $(this.el).html(template(this.model)); |
| |
| return this; |
| }, |
| |
| |
| applyApiKey: function(){ |
| var keyAuth = new SwaggerClient.ApiKeyAuthorization( |
| this.model.name, |
| $('#input_apiKey_entry').val(), |
| this.model.in |
| ); |
| this.router.api.clientAuthorizations.add(this.model.name, keyAuth); |
| this.router.load(); |
| $('#apikey_container').show(); |
| }, |
| |
| toggleApiKeyContainer: function(){ |
| if ($('#apikey_container').length) { |
| |
| var elem = $('#apikey_container').first(); |
| |
| if (elem.is(':visible')){ |
| elem.hide(); |
| } else { |
| |
| // hide others |
| $('.auth_container').hide(); |
| elem.show(); |
| } |
| } |
| }, |
| |
| template: function(){ |
| return Handlebars.templates.apikey_button_view; |
| } |
| |
| }); |
| 'use strict'; |
| |
| SwaggerUi.Views.BasicAuthButton = Backbone.View.extend({ |
| |
| |
| initialize: function (opts) { |
| this.options = opts || {}; |
| this.router = this.options.router; |
| }, |
| |
| render: function(){ |
| var template = this.template(); |
| $(this.el).html(template(this.model)); |
| |
| return this; |
| }, |
| |
| events: { |
| 'click #basic_auth_button' : 'togglePasswordContainer', |
| 'click #apply_basic_auth' : 'applyPassword' |
| }, |
| |
| applyPassword: function(event){ |
| event.preventDefault(); |
| var username = $('#input_username').val(); |
| var password = $('#input_password').val(); |
| var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password); |
| this.router.api.clientAuthorizations.add(this.model.type, basicAuth); |
| this.router.load(); |
| $('#basic_auth_container').hide(); |
| }, |
| |
| togglePasswordContainer: function(){ |
| if ($('#basic_auth_container').length) { |
| var elem = $('#basic_auth_container').show(); |
| if (elem.is(':visible')){ |
| elem.slideUp(); |
| } else { |
| // hide others |
| $('.auth_container').hide(); |
| elem.show(); |
| } |
| } |
| }, |
| |
| template: function(){ |
| return Handlebars.templates.basic_auth_button_view; |
| } |
| |
| }); |
| 'use strict'; |
| |
| SwaggerUi.Views.ContentTypeView = Backbone.View.extend({ |
| initialize: function() {}, |
| |
| render: function(){ |
| this.model.contentTypeId = 'ct' + Math.random(); |
| $(this.el).html(Handlebars.templates.content_type(this.model)); |
| return this; |
| } |
| }); |
| 'use strict'; |
| |
| SwaggerUi.Views.HeaderView = Backbone.View.extend({ |
| events: { |
| 'click #show-pet-store-icon' : 'showPetStore', |
| 'click #explore' : 'showCustom', |
| 'keyup #input_baseUrl' : 'showCustomOnKeyup', |
| 'keyup #input_apiKey' : 'showCustomOnKeyup' |
| }, |
| |
| initialize: function(){}, |
| |
| showPetStore: function(){ |
| this.trigger('update-swagger-ui', { |
| url:'http://petstore.swagger.io/v2/swagger.json' |
| }); |
| }, |
| |
| showCustomOnKeyup: function(e){ |
| if (e.keyCode === 13) { |
| this.showCustom(); |
| } |
| }, |
| |
| showCustom: function(e){ |
| if (e) { |
| e.preventDefault(); |
| } |
| |
| this.trigger('update-swagger-ui', { |
| url: $('#input_baseUrl').val(), |
| apiKey: $('#input_apiKey').val() |
| }); |
| }, |
| |
| update: function(url, apiKey, trigger){ |
| if (trigger === undefined) { |
| trigger = false; |
| } |
| |
| $('#input_baseUrl').val(url); |
| |
| //$('#input_apiKey').val(apiKey); |
| if (trigger) { |
| this.trigger('update-swagger-ui', {url:url}); |
| } |
| } |
| }); |
| |
| 'use strict'; |
| |
| SwaggerUi.Views.MainView = Backbone.View.extend({ |
| apisSorter : { |
| alpha : function(a,b){ return a.name.localeCompare(b.name); } |
| }, |
| operationsSorters : { |
| alpha : function(a,b){ return a.path.localeCompare(b.path); }, |
| method : function(a,b){ return a.method.localeCompare(b.method); } |
| }, |
| initialize: function(opts){ |
| var sorterOption, sorterFn, key, value; |
| opts = opts || {}; |
| |
| this.router = opts.router; |
| |
| // Sort APIs |
| if (opts.swaggerOptions.apisSorter) { |
| sorterOption = opts.swaggerOptions.apisSorter; |
| if (_.isFunction(sorterOption)) { |
| sorterFn = sorterOption; |
| } else { |
| sorterFn = this.apisSorter[sorterOption]; |
| } |
| if (_.isFunction(sorterFn)) { |
| this.model.apisArray.sort(sorterFn); |
| } |
| } |
| // Sort operations of each API |
| if (opts.swaggerOptions.operationsSorter) { |
| sorterOption = opts.swaggerOptions.operationsSorter; |
| if (_.isFunction(sorterOption)) { |
| sorterFn = sorterOption; |
| } else { |
| sorterFn = this.operationsSorters[sorterOption]; |
| } |
| if (_.isFunction(sorterFn)) { |
| for (key in this.model.apisArray) { |
| this.model.apisArray[key].operationsArray.sort(sorterFn); |
| } |
| } |
| } |
| |
| // set up the UI for input |
| this.model.auths = []; |
| |
| for (key in this.model.securityDefinitions) { |
| value = this.model.securityDefinitions[key]; |
| |
| this.model.auths.push({ |
| name: key, |
| type: value.type, |
| value: value |
| }); |
| } |
| |
| if ('validatorUrl' in opts.swaggerOptions) { |
| // Validator URL specified explicitly |
| this.model.validatorUrl = opts.swaggerOptions.validatorUrl; |
| } else if (this.model.url.indexOf('localhost') > 0) { |
| // Localhost override |
| this.model.validatorUrl = null; |
| } else { |
| // Default validator |
| if(window.location.protocol === 'https:') { |
| this.model.validatorUrl = 'https://online.swagger.io/validator'; |
| } |
| else { |
| this.model.validatorUrl = 'http://online.swagger.io/validator'; |
| } |
| } |
| |
| // JSonEditor requires type='object' to be present on defined types, we add it if it's missing |
| // is there any valid case were it should not be added ? |
| var def; |
| for(def in this.model.definitions){ |
| if (!this.model.definitions[def].type){ |
| this.model.definitions[def].type = 'object'; |
| } |
| } |
| |
| }, |
| |
| render: function(){ |
| if (this.model.securityDefinitions) { |
| for (var name in this.model.securityDefinitions) { |
| var auth = this.model.securityDefinitions[name]; |
| var button; |
| |
| if (auth.type === 'apiKey' && $('#apikey_button').length === 0) { |
| button = new SwaggerUi.Views.ApiKeyButton({model: auth, router: this.router}).render().el; |
| $('.auth_main_container').append(button); |
| } |
| |
| if (auth.type === 'basicAuth' && $('#basic_auth_button').length === 0) { |
| button = new SwaggerUi.Views.BasicAuthButton({model: auth, router: this.router}).render().el; |
| $('.auth_main_container').append(button); |
| } |
| } |
| } |
| |
| // Render the outer container for resources |
| $(this.el).html(Handlebars.templates.main(this.model)); |
| |
| // Render each resource |
| |
| var resources = {}; |
| var counter = 0; |
| for (var i = 0; i < this.model.apisArray.length; i++) { |
| var resource = this.model.apisArray[i]; |
| var id = resource.name; |
| while (typeof resources[id] !== 'undefined') { |
| id = id + '_' + counter; |
| counter += 1; |
| } |
| resource.id = id; |
| resources[id] = resource; |
| this.addResource(resource, this.model.auths); |
| } |
| |
| $('.propWrap').hover(function onHover(){ |
| $('.optionsWrapper', $(this)).show(); |
| }, function offhover(){ |
| $('.optionsWrapper', $(this)).hide(); |
| }); |
| return this; |
| }, |
| |
| addResource: function(resource, auths){ |
| // Render a resource and add it to resources li |
| resource.id = resource.id.replace(/\s/g, '_'); |
| |
| // Make all definitions available at the root of the resource so that they can |
| // be loaded by the JSonEditor |
| resource.definitions = this.model.definitions; |
| |
| var resourceView = new SwaggerUi.Views.ResourceView({ |
| model: resource, |
| router: this.router, |
| tagName: 'li', |
| id: 'resource_' + resource.id, |
| className: 'resource', |
| auths: auths, |
| swaggerOptions: this.options.swaggerOptions |
| }); |
| $('#resources', this.el).append(resourceView.render().el); |
| }, |
| |
| clear: function(){ |
| $(this.el).html(''); |
| } |
| }); |
| |
| 'use strict'; |
| |
| SwaggerUi.Views.OperationView = Backbone.View.extend({ |
| invocationUrl: null, |
| |
| events: { |
| 'submit .sandbox' : 'submitOperation', |
| 'click .submit' : 'submitOperation', |
| 'click .response_hider' : 'hideResponse', |
| 'click .toggleOperation' : 'toggleOperationContent', |
| 'mouseenter .api-ic' : 'mouseEnter', |
| 'dblclick .curl' : 'selectText', |
| }, |
| |
| initialize: function(opts) { |
| opts = opts || {}; |
| this.router = opts.router; |
| this.auths = opts.auths; |
| this.parentId = this.model.parentId; |
| this.nickname = this.model.nickname; |
| this.model.encodedParentId = encodeURIComponent(this.parentId); |
| |
| if (opts.swaggerOptions) { |
| this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering; |
| |
| if (opts.swaggerOptions.showRequestHeaders) { |
| this.model.showRequestHeaders = true; |
| } |
| } |
| return this; |
| }, |
| |
| selectText: function(event) { |
| var doc = document, |
| text = event.target.firstChild, |
| range, |
| selection; |
| if (doc.body.createTextRange) { |
| range = document.body.createTextRange(); |
| range.moveToElementText(text); |
| range.select(); |
| } else if (window.getSelection) { |
| selection = window.getSelection(); |
| range = document.createRange(); |
| range.selectNodeContents(text); |
| selection.removeAllRanges(); |
| selection.addRange(range); |
| } |
| }, |
| |
| mouseEnter: function(e) { |
| var elem = $(this.el).find('.content'); |
| var x = e.pageX; |
| var y = e.pageY; |
| var scX = $(window).scrollLeft(); |
| var scY = $(window).scrollTop(); |
| var scMaxX = scX + $(window).width(); |
| var scMaxY = scY + $(window).height(); |
| var wd = elem.width(); |
| var hgh = elem.height(); |
| |
| if (x + wd > scMaxX) { |
| x = scMaxX - wd; |
| } |
| |
| if (x < scX) { |
| x = scX; |
| } |
| |
| if (y + hgh > scMaxY) { |
| y = scMaxY - hgh; |
| } |
| |
| if (y < scY) { |
| y = scY; |
| } |
| |
| var pos = {}; |
| pos.top = y; |
| pos.left = x; |
| elem.css(pos); |
| }, |
| |
| // Note: copied from CoffeeScript compiled file |
| // TODO: redactor |
| render: function() { |
| var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, l, len, len1, len2, len3, len4, m, modelAuths, n, o, p, param, q, ref, ref1, ref2, ref3, ref4, ref5, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successResponse, type, v, value; |
| isMethodSubmissionSupported = jQuery.inArray(this.model.method, this.model.supportedSubmitMethods()) >= 0; |
| if (!isMethodSubmissionSupported) { |
| this.model.isReadOnly = true; |
| } |
| this.model.description = this.model.description || this.model.notes; |
| this.model.oauth = null; |
| modelAuths = this.model.authorizations || this.model.security; |
| if (modelAuths) { |
| if (Array.isArray(modelAuths)) { |
| for (l = 0, len = modelAuths.length; l < len; l++) { |
| auths = modelAuths[l]; |
| for (key in auths) { |
| for (a in this.auths) { |
| auth = this.auths[a]; |
| if (key === auth.name) { |
| if (auth.type === 'oauth2') { |
| this.model.oauth = {}; |
| this.model.oauth.scopes = []; |
| ref1 = auth.value.scopes; |
| for (k in ref1) { |
| v = ref1[k]; |
| scopeIndex = auths[key].indexOf(k); |
| if (scopeIndex >= 0) { |
| o = { |
| scope: k, |
| description: v |
| }; |
| this.model.oauth.scopes.push(o); |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } else { |
| for (k in modelAuths) { |
| v = modelAuths[k]; |
| if (k === 'oauth2') { |
| if (this.model.oauth === null) { |
| this.model.oauth = {}; |
| } |
| if (this.model.oauth.scopes === void 0) { |
| this.model.oauth.scopes = []; |
| } |
| for (m = 0, len1 = v.length; m < len1; m++) { |
| o = v[m]; |
| this.model.oauth.scopes.push(o); |
| } |
| } |
| } |
| } |
| } |
| if (typeof this.model.responses !== 'undefined') { |
| this.model.responseMessages = []; |
| ref2 = this.model.responses; |
| for (code in ref2) { |
| value = ref2[code]; |
| schema = null; |
| schemaObj = this.model.responses[code].schema; |
| if (schemaObj && schemaObj.$ref) { |
| schema = schemaObj.$ref; |
| if (schema.indexOf('#/definitions/') !== -1) { |
| schema = schema.replace(/^.*#\/definitions\//, ''); |
| } |
| } |
| this.model.responseMessages.push({ |
| code: code, |
| message: value.description, |
| responseModel: schema, |
| headers: value.headers |
| }); |
| } |
| } |
| if (typeof this.model.responseMessages === 'undefined') { |
| this.model.responseMessages = []; |
| } |
| signatureModel = null; |
| if (this.model.successResponse) { |
| successResponse = this.model.successResponse; |
| for (key in successResponse) { |
| value = successResponse[key]; |
| this.model.successCode = key; |
| if (typeof value === 'object' && typeof value.createJSONSample === 'function') { |
| this.model.successDescription = value.description; |
| this.model.headers = this.parseResponseHeaders(value.headers); |
| signatureModel = { |
| sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2), |
| isParam: false, |
| signature: value.getMockSignature() |
| }; |
| } |
| } |
| } else if (this.model.responseClassSignature && this.model.responseClassSignature !== 'string') { |
| signatureModel = { |
| sampleJSON: this.model.responseSampleJSON, |
| isParam: false, |
| signature: this.model.responseClassSignature |
| }; |
| } |
| $(this.el).html(Handlebars.templates.operation(this.model)); |
| if (signatureModel) { |
| signatureModel.defaultRendering = this.model.defaultRendering; |
| responseSignatureView = new SwaggerUi.Views.SignatureView({ |
| model: signatureModel, |
| router: this.router, |
| tagName: 'div' |
| }); |
| $('.model-signature', $(this.el)).append(responseSignatureView.render().el); |
| } else { |
| this.model.responseClassSignature = 'string'; |
| $('.model-signature', $(this.el)).html(this.model.type); |
| } |
| contentTypeModel = { |
| isParam: false |
| }; |
| contentTypeModel.consumes = this.model.consumes; |
| contentTypeModel.produces = this.model.produces; |
| ref3 = this.model.parameters; |
| for (n = 0, len2 = ref3.length; n < len2; n++) { |
| param = ref3[n]; |
| type = param.type || param.dataType || ''; |
| if (typeof type === 'undefined') { |
| schema = param.schema; |
| if (schema && schema.$ref) { |
| ref = schema.$ref; |
| if (ref.indexOf('#/definitions/') === 0) { |
| type = ref.substring('#/definitions/'.length); |
| } else { |
| type = ref; |
| } |
| } |
| } |
| if (type && type.toLowerCase() === 'file') { |
| if (!contentTypeModel.consumes) { |
| contentTypeModel.consumes = 'multipart/form-data'; |
| } |
| } |
| param.type = type; |
| } |
| responseContentTypeView = new SwaggerUi.Views.ResponseContentTypeView({ |
| model: contentTypeModel, |
| router: this.router |
| }); |
| $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el); |
| ref4 = this.model.parameters; |
| for (p = 0, len3 = ref4.length; p < len3; p++) { |
| param = ref4[p]; |
| this.addParameter(param, contentTypeModel.consumes); |
| } |
| ref5 = this.model.responseMessages; |
| for (q = 0, len4 = ref5.length; q < len4; q++) { |
| statusCode = ref5[q]; |
| this.addStatusCode(statusCode); |
| } |
| return this; |
| }, |
| |
| parseResponseHeaders: function (data) { |
| var HEADERS_SEPARATOR = '; '; |
| var headers = _.clone(data); |
| |
| _.forEach(headers, function (header) { |
| var other = []; |
| _.forEach(header, function (value, key) { |
| var properties = ['type', 'description']; |
| if (properties.indexOf(key.toLowerCase()) === -1) { |
| other.push(key + ': ' + value); |
| } |
| }); |
| |
| other.join(HEADERS_SEPARATOR); |
| header.other = other; |
| }); |
| |
| return headers; |
| }, |
| |
| addParameter: function(param, consumes) { |
| // Render a parameter |
| param.consumes = consumes; |
| param.defaultRendering = this.model.defaultRendering; |
| |
| // Copy this param JSON spec so that it will be available for JsonEditor |
| if(param.schema){ |
| $.extend(true, param.schema, this.model.definitions[param.type]); |
| param.schema.definitions = this.model.definitions; |
| // This is required for JsonEditor to display the root properly |
| if(!param.schema.type){ |
| param.schema.type = 'object'; |
| } |
| // This is the title that will be used by JsonEditor for the root |
| // Since we already display the parameter's name in the Parameter column |
| // We set this to space, we can't set it to null or space otherwise JsonEditor |
| // will replace it with the text "root" which won't look good on screen |
| if(!param.schema.title){ |
| param.schema.title = ' '; |
| } |
| } |
| |
| var paramView = new SwaggerUi.Views.ParameterView({ |
| model: param, |
| tagName: 'tr', |
| readOnly: this.model.isReadOnly, |
| swaggerOptions: this.options.swaggerOptions |
| }); |
| $('.operation-params', $(this.el)).append(paramView.render().el); |
| }, |
| |
| addStatusCode: function(statusCode) { |
| // Render status codes |
| statusCode.defaultRendering = this.model.defaultRendering; |
| var statusCodeView = new SwaggerUi.Views.StatusCodeView({ |
| model: statusCode, |
| tagName: 'tr', |
| router: this.router |
| }); |
| $('.operation-status', $(this.el)).append(statusCodeView.render().el); |
| }, |
| |
| // Note: copied from CoffeeScript compiled file |
| // TODO: redactor |
| submitOperation: function(e) { |
| var error_free, form, isFileUpload, map, opts; |
| if (e !== null) { |
| e.preventDefault(); |
| } |
| form = $('.sandbox', $(this.el)); |
| error_free = true; |
| form.find('input.required').each(function() { |
| $(this).removeClass('error'); |
| if (jQuery.trim($(this).val()) === '') { |
| $(this).addClass('error'); |
| $(this).wiggle({ |
| callback: (function(_this) { |
| return function() { |
| $(_this).focus(); |
| }; |
| })(this) |
| }); |
| error_free = false; |
| } |
| }); |
| form.find('textarea.required:visible').each(function() { |
| $(this).removeClass('error'); |
| if (jQuery.trim($(this).val()) === '') { |
| $(this).addClass('error'); |
| $(this).wiggle({ |
| callback: (function(_this) { |
| return function() { |
| return $(_this).focus(); |
| }; |
| })(this) |
| }); |
| error_free = false; |
| } |
| }); |
| form.find('select.required').each(function() { |
| $(this).removeClass('error'); |
| if (this.selectedIndex === -1) { |
| $(this).addClass('error'); |
| $(this).wiggle({ |
| callback: (function(_this) { |
| return function() { |
| $(_this).focus(); |
| }; |
| })(this) |
| }); |
| error_free = false; |
| } |
| }); |
| if (error_free) { |
| map = this.getInputMap(form); |
| isFileUpload = this.isFileUpload(form); |
| opts = { |
| parent: this |
| }; |
| if (this.options.swaggerOptions) { |
| for(var key in this.options.swaggerOptions) { |
| opts[key] = this.options.swaggerOptions[key]; |
| } |
| } |
| |
| var pi; |
| for(pi = 0; pi < this.model.parameters.length; pi++){ |
| var p = this.model.parameters[pi]; |
| if( p.jsonEditor && p.jsonEditor.isEnabled()){ |
| var json = p.jsonEditor.getValue(); |
| map[p.name] = JSON.stringify(json); |
| } |
| } |
| |
| opts.responseContentType = $('div select[name=responseContentType]', $(this.el)).val(); |
| opts.requestContentType = $('div select[name=parameterContentType]', $(this.el)).val(); |
| $('.response_throbber', $(this.el)).show(); |
| if (isFileUpload) { |
| $('.request_url', $(this.el)).html('<pre></pre>'); |
| $('.request_url pre', $(this.el)).text(this.invocationUrl); |
| |
| opts.useJQuery = true; |
| map.parameterContentType = 'multipart/form-data'; |
| this.map = map; |
| return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this); |
| } else { |
| this.map = map; |
| return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this); |
| } |
| } |
| }, |
| |
| getInputMap: function (form) { |
| var map, ref1, l, len, o, ref2, m, len1, val, ref3, n, len2; |
| map = {}; |
| ref1 = form.find('input'); |
| for (l = 0, len = ref1.length; l < len; l++) { |
| o = ref1[l]; |
| if ((o.value !== null) && jQuery.trim(o.value).length > 0) { |
| map[o.name] = o.value; |
| } |
| if (o.type === 'file') { |
| map[o.name] = o.files[0]; |
| } |
| } |
| ref2 = form.find('textarea'); |
| for (m = 0, len1 = ref2.length; m < len1; m++) { |
| o = ref2[m]; |
| val = this.getTextAreaValue(o); |
| if ((val !== null) && jQuery.trim(val).length > 0) { |
| map[o.name] = val; |
| } |
| } |
| ref3 = form.find('select'); |
| for (n = 0, len2 = ref3.length; n < len2; n++) { |
| o = ref3[n]; |
| val = this.getSelectedValue(o); |
| if ((val !== null) && jQuery.trim(val).length > 0) { |
| map[o.name] = val; |
| } |
| } |
| return map; |
| }, |
| |
| isFileUpload: function (form) { |
| var ref1, l, len, o; |
| var isFileUpload = false; |
| ref1 = form.find('input'); |
| for (l = 0, len = ref1.length; l < len; l++) { |
| o = ref1[l]; |
| if (o.type === 'file') { |
| isFileUpload = true; |
| } |
| } |
| return isFileUpload; |
| }, |
| |
| success: function(response, parent) { |
| parent.showCompleteStatus(response); |
| }, |
| |
| // wraps a jquery response as a shred response |
| wrap: function(data) { |
| var h, headerArray, headers, i, l, len, o; |
| headers = {}; |
| headerArray = data.getAllResponseHeaders().split('\r'); |
| for (l = 0, len = headerArray.length; l < len; l++) { |
| i = headerArray[l]; |
| h = i.match(/^([^:]*?):(.*)$/); |
| if (!h) { |
| h = []; |
| } |
| h.shift(); |
| if (h[0] !== void 0 && h[1] !== void 0) { |
| headers[h[0].trim()] = h[1].trim(); |
| } |
| } |
| o = {}; |
| o.content = {}; |
| o.content.data = data.responseText; |
| o.headers = headers; |
| o.request = {}; |
| o.request.url = this.invocationUrl; |
| o.status = data.status; |
| return o; |
| }, |
| |
| getSelectedValue: function(select) { |
| if (!select.multiple) { |
| return select.value; |
| } else { |
| var options = []; |
| for (var l = 0, len = select.options.length; l < len; l++) { |
| var opt = select.options[l]; |
| if (opt.selected) { |
| options.push(opt.value); |
| } |
| } |
| if (options.length > 0) { |
| return options; |
| } else { |
| return null; |
| } |
| } |
| }, |
| |
| // handler for hide response link |
| hideResponse: function(e) { |
| if (e) { e.preventDefault(); } |
| $('.response', $(this.el)).slideUp(); |
| $('.response_hider', $(this.el)).fadeOut(); |
| }, |
| |
| // Show response from server |
| showResponse: function(response) { |
| var prettyJson = JSON.stringify(response, null, '\t').replace(/\n/g, '<br>'); |
| $('.response_body', $(this.el)).html(_.escape(prettyJson)); |
| }, |
| |
| // Show error from server |
| showErrorStatus: function(data, parent) { |
| parent.showStatus(data); |
| }, |
| |
| // show the status codes |
| showCompleteStatus: function(data, parent){ |
| parent.showStatus(data); |
| }, |
| |
| // Adapted from http://stackoverflow.com/a/2893259/454004 |
| // Note: directly ported from CoffeeScript |
| // TODO: Cleanup CoffeeScript artifacts |
| formatXml: function(xml) { |
| var contexp, fn, formatted, indent, l, lastType, len, lines, ln, pad, reg, transitions, wsexp; |
| reg = /(>)(<)(\/*)/g; |
| wsexp = /[ ]*(.*)[ ]+\n/g; |
| contexp = /(<.+>)(.+\n)/g; |
| xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2'); |
| pad = 0; |
| formatted = ''; |
| lines = xml.split('\n'); |
| indent = 0; |
| lastType = 'other'; |
| transitions = { |
| 'single->single': 0, |
| 'single->closing': -1, |
| 'single->opening': 0, |
| 'single->other': 0, |
| 'closing->single': 0, |
| 'closing->closing': -1, |
| 'closing->opening': 0, |
| 'closing->other': 0, |
| 'opening->single': 1, |
| 'opening->closing': 0, |
| 'opening->opening': 1, |
| 'opening->other': 1, |
| 'other->single': 0, |
| 'other->closing': -1, |
| 'other->opening': 0, |
| 'other->other': 0 |
| }; |
| fn = function(ln) { |
| var fromTo, j, key, padding, type, types, value; |
| types = { |
| single: Boolean(ln.match(/<.+\/>/)), |
| closing: Boolean(ln.match(/<\/.+>/)), |
| opening: Boolean(ln.match(/<[^!?].*>/)) |
| }; |
| type = ((function() { |
| var results; |
| results = []; |
| for (key in types) { |
| value = types[key]; |
| if (value) { |
| results.push(key); |
| } |
| } |
| return results; |
| })())[0]; |
| type = type === void 0 ? 'other' : type; |
| fromTo = lastType + '->' + type; |
| lastType = type; |
| padding = ''; |
| indent += transitions[fromTo]; |
| padding = ((function() { |
| var m, ref1, results; |
| results = []; |
| for (j = m = 0, ref1 = indent; 0 <= ref1 ? m < ref1 : m > ref1; j = 0 <= ref1 ? ++m : --m) { |
| results.push(' '); |
| } |
| return results; |
| })()).join(''); |
| if (fromTo === 'opening->closing') { |
| formatted = formatted.substr(0, formatted.length - 1) + ln + '\n'; |
| } else { |
| formatted += padding + ln + '\n'; |
| } |
| }; |
| for (l = 0, len = lines.length; l < len; l++) { |
| ln = lines[l]; |
| fn(ln); |
| } |
| return formatted; |
| }, |
| |
| // puts the response data in UI |
| showStatus: function(response) { |
| var url, content; |
| if (response.content === undefined) { |
| content = response.data; |
| url = response.url; |
| } else { |
| content = response.content.data; |
| url = response.request.url; |
| } |
| var headers = response.headers; |
| content = jQuery.trim(content); |
| |
| // if server is nice, and sends content-type back, we can use it |
| var contentType = null; |
| if (headers) { |
| contentType = headers['Content-Type'] || headers['content-type']; |
| if (contentType) { |
| contentType = contentType.split(';')[0].trim(); |
| } |
| } |
| $('.response_body', $(this.el)).removeClass('json'); |
| $('.response_body', $(this.el)).removeClass('xml'); |
| |
| var supportsAudioPlayback = function(contentType){ |
| var audioElement = document.createElement('audio'); |
| return !!(audioElement.canPlayType && audioElement.canPlayType(contentType).replace(/no/, '')); |
| }; |
| |
| var pre; |
| var code; |
| if (!content) { |
| code = $('<code />').text('no content'); |
| pre = $('<pre class="json" />').append(code); |
| |
| // JSON |
| } else if (contentType === 'application/json' || /\+json$/.test(contentType)) { |
| var json = null; |
| try { |
| json = JSON.stringify(JSON.parse(content), null, ' '); |
| } catch (_error) { |
| json = 'can\'t parse JSON. Raw result:\n\n' + content; |
| } |
| code = $('<code />').text(json); |
| pre = $('<pre class="json" />').append(code); |
| |
| // XML |
| } else if (contentType === 'application/xml' || /\+xml$/.test(contentType)) { |
| code = $('<code />').text(this.formatXml(content)); |
| pre = $('<pre class="xml" />').append(code); |
| |
| // HTML |
| } else if (contentType === 'text/html') { |
| code = $('<code />').html(_.escape(content)); |
| pre = $('<pre class="xml" />').append(code); |
| |
| // Plain Text |
| } else if (/text\/plain/.test(contentType)) { |
| code = $('<code />').text(content); |
| pre = $('<pre class="plain" />').append(code); |
| |
| |
| // Image |
| } else if (/^image\//.test(contentType)) { |
| pre = $('<img>').attr('src', url); |
| |
| // Audio |
| } else if (/^audio\//.test(contentType) && supportsAudioPlayback(contentType)) { |
| pre = $('<audio controls>').append($('<source>').attr('src', url).attr('type', contentType)); |
| |
| // Download |
| } else if (headers['Content-Disposition'] && (/attachment/).test(headers['Content-Disposition']) || |
| headers['content-disposition'] && (/attachment/).test(headers['content-disposition']) || |
| headers['Content-Description'] && (/File Transfer/).test(headers['Content-Description']) || |
| headers['content-description'] && (/File Transfer/).test(headers['content-description'])) { |
| |
| if ('Blob' in window) { |
| var type = contentType || 'text/html'; |
| var blob = new Blob([content], {type: type}); |
| var a = document.createElement('a'); |
| var href = window.URL.createObjectURL(blob); |
| var fileName = response.url.substr(response.url.lastIndexOf('/') + 1); |
| var download = [type, fileName, href].join(':'); |
| |
| a.setAttribute('href', href); |
| a.setAttribute('download', download); |
| a.innerText = 'Download ' + fileName; |
| |
| pre = $('<div/>').append(a); |
| } else { |
| pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).'); |
| } |
| |
| // Location header based redirect download |
| } else if(headers.location || headers.Location) { |
| window.location = response.url; |
| |
| // Anything else (CORS) |
| } else { |
| code = $('<code />').text(content); |
| pre = $('<pre class="json" />').append(code); |
| } |
| var response_body = pre; |
| $('.request_url', $(this.el)).html('<pre></pre>'); |
| $('.request_url pre', $(this.el)).text(url); |
| $('.response_code', $(this.el)).html('<pre>' + response.status + '</pre>'); |
| $('.response_body', $(this.el)).html(response_body); |
| $('.response_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(response.headers, null, ' ')).replace(/\n/g, '<br>') + '</pre>'); |
| $('.response', $(this.el)).slideDown(); |
| $('.response_hider', $(this.el)).show(); |
| $('.response_throbber', $(this.el)).hide(); |
| |
| |
| // adds curl output |
| var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType}); |
| curlCommand = curlCommand.replace('!', '!'); |
| $( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>'); |
| |
| // only highlight the response if response is less than threshold, default state is highlight response |
| var opts = this.options.swaggerOptions; |
| |
| if (opts.showRequestHeaders) { |
| var form = $('.sandbox', $(this.el)), |
| map = this.getInputMap(form), |
| requestHeaders = this.model.getHeaderParams(map); |
| delete requestHeaders['Content-Type']; |
| $('.request_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(requestHeaders, null, ' ')).replace(/\n/g, '<br>') + '</pre>'); |
| } |
| |
| var response_body_el = $('.response_body', $(this.el))[0]; |
| // only highlight the response if response is less than threshold, default state is highlight response |
| if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold) { |
| return response_body_el; |
| } else { |
| return hljs.highlightBlock(response_body_el); |
| } |
| }, |
| |
| toggleOperationContent: function (event) { |
| var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content')); |
| if (elem.is(':visible')){ |
| $.bbq.pushState('#/', 2); |
| event.preventDefault(); |
| Docs.collapseOperation(elem); |
| } else { |
| Docs.expandOperation(elem); |
| } |
| }, |
| |
| getTextAreaValue: function(textArea) { |
| var param, parsed, result, i; |
| if (textArea.value === null || jQuery.trim(textArea.value).length === 0) { |
| return null; |
| } |
| param = this.getParamByName(textArea.name); |
| if (param && param.type && param.type.toLowerCase() === 'array') { |
| parsed = textArea.value.split('\n'); |
| result = []; |
| for (i = 0; i < parsed.length; i++) { |
| if (parsed[i] !== null && jQuery.trim(parsed[i]).length > 0) { |
| result.push(parsed[i]); |
| } |
| } |
| return result.length > 0 ? result : null; |
| } else { |
| return textArea.value; |
| } |
| }, |
| |
| getParamByName: function(name) { |
| var i; |
| if (this.model.parameters) { |
| for(i = 0; i < this.model.parameters.length; i++) { |
| if (this.model.parameters[i].name === name) { |
| return this.model.parameters[i]; |
| } |
| } |
| } |
| return null; |
| } |
| |
| }); |
| |
| 'use strict'; |
| |
| SwaggerUi.Views.ParameterContentTypeView = Backbone.View.extend({ |
| initialize: function () {}, |
| |
| render: function(){ |
| this.model.parameterContentTypeId = 'pct' + Math.random(); |
| $(this.el).html(Handlebars.templates.parameter_content_type(this.model)); |
| return this; |
| } |
| |
| }); |
| 'use strict'; |
| |
| SwaggerUi.Views.ParameterView = Backbone.View.extend({ |
| initialize: function(){ |
| Handlebars.registerHelper('isArray', function(param, opts) { |
| if (param.type.toLowerCase() === 'array' || param.allowMultiple) { |
| return opts.fn(this); |
| } else { |
| return opts.inverse(this); |
| } |
| }); |
| }, |
| |
| render: function() { |
| var type = this.model.type || this.model.dataType; |
| |
| if (typeof type === 'undefined') { |
| var schema = this.model.schema; |
| if (schema && schema.$ref) { |
| var ref = schema.$ref; |
| if (ref.indexOf('#/definitions/') === 0) { |
| type = ref.substring('#/definitions/'.length); |
| } else { |
| type = ref; |
| } |
| } |
| } |
| |
| this.model.type = type; |
| this.model.paramType = this.model.in || this.model.paramType; |
| this.model.isBody = this.model.paramType === 'body' || this.model.in === 'body'; |
| this.model.isFile = type && type.toLowerCase() === 'file'; |
| |
| // Allow for default === false |
| if(typeof this.model.default === 'undefined') { |
| this.model.default = this.model.defaultValue; |
| } |
| |
| this.model.hasDefault = (typeof this.model.default !== 'undefined'); |
| this.model.valueId = 'm' + this.model.name + Math.random(); |
| |
| if (this.model.allowableValues) { |
| this.model.isList = true; |
| } |
| |
| var template = this.template(); |
| $(this.el).html(template(this.model)); |
| |
| var signatureModel = { |
| sampleJSON: this.model.sampleJSON, |
| isParam: true, |
| signature: this.model.signature, |
| defaultRendering: this.model.defaultRendering |
| }; |
| |
| if (this.model.sampleJSON) { |
| var signatureView = new SwaggerUi.Views.SignatureView({model: signatureModel, tagName: 'div'}); |
| $('.model-signature', $(this.el)).append(signatureView.render().el); |
| } |
| else { |
| $('.model-signature', $(this.el)).html(this.model.signature); |
| } |
| |
| var isParam = false; |
| |
| if( this.options.swaggerOptions.jsonEditor && this.model.isBody && this.model.schema){ |
| var $self = $(this.el); |
| this.model.jsonEditor = |
| /* global JSONEditor */ |
| new JSONEditor($('.editor_holder', $self)[0], |
| {schema: this.model.schema, startval : this.model.default, |
| ajax:true, |
| disable_properties:true, |
| disable_edit_json:true, |
| iconlib: 'swagger' }); |
| // This is so that the signature can send back the sample to the json editor |
| // TODO: SignatureView should expose an event "onSampleClicked" instead |
| signatureModel.jsonEditor = this.model.jsonEditor; |
| $('.body-textarea', $self).hide(); |
| $('.editor_holder', $self).show(); |
| $('.parameter-content-type', $self) |
| .change(function(e){ |
| if(e.target.value === 'application/xml'){ |
| $('.body-textarea', $self).show(); |
| $('.editor_holder', $self).hide(); |
| this.model.jsonEditor.disable(); |
| } |
| else { |
| $('.body-textarea', $self).hide(); |
| $('.editor_holder', $self).show(); |
| this.model.jsonEditor.enable(); |
| } |
| }); |
| } |
| |
| |
| if (this.model.isBody) { |
| isParam = true; |
| } |
| |
| var contentTypeModel = { |
| isParam: isParam |
| }; |
| |
| contentTypeModel.consumes = this.model.consumes; |
| |
| if (isParam) { |
| var parameterContentTypeView = new SwaggerUi.Views.ParameterContentTypeView({model: contentTypeModel}); |
| $('.parameter-content-type', $(this.el)).append(parameterContentTypeView.render().el); |
| } |
| |
| else { |
| var responseContentTypeView = new SwaggerUi.Views.ResponseContentTypeView({model: contentTypeModel}); |
| $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el); |
| } |
| |
| return this; |
| }, |
| |
| // Return an appropriate template based on if the parameter is a list, readonly, required |
| template: function(){ |
| if (this.model.isList) { |
| return Handlebars.templates.param_list; |
| } else { |
| if (this.options.readOnly) { |
| if (this.model.required) { |
| return Handlebars.templates.param_readonly_required; |
| } else { |
| return Handlebars.templates.param_readonly; |
| } |
| } else { |
| if (this.model.required) { |
| return Handlebars.templates.param_required; |
| } else { |
| return Handlebars.templates.param; |
| } |
| } |
| } |
| } |
| }); |
| |
| 'use strict'; |
| |
| SwaggerUi.Views.ResourceView = Backbone.View.extend({ |
| initialize: function(opts) { |
| opts = opts || {}; |
| this.router = opts.router; |
| this.auths = opts.auths; |
| if ('' === this.model.description) { |
| this.model.description = null; |
| } |
| if (this.model.description) { |
| this.model.summary = this.model.description; |
| } |
| }, |
| |
| render: function(){ |
| var methods = {}; |
| |
| |
| $(this.el).html(Handlebars.templates.resource(this.model)); |
| |
| // Render each operation |
| for (var i = 0; i < this.model.operationsArray.length; i++) { |
| var operation = this.model.operationsArray[i]; |
| var counter = 0; |
| var id = operation.nickname; |
| |
| while (typeof methods[id] !== 'undefined') { |
| id = id + '_' + counter; |
| counter += 1; |
| } |
| |
| methods[id] = operation; |
| |
| operation.nickname = id; |
| operation.parentId = this.model.id; |
| operation.definitions = this.model.definitions; // make Json Schema available for JSonEditor in this operation |
| this.addOperation(operation); |
| } |
| |
| $('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource')); |
| $('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource')); |
| $('.expandResource', this.el).click(this.callDocs.bind(this, 'expandOperationsForResource')); |
| |
| return this; |
| }, |
| |
| addOperation: function(operation) { |
| |
| operation.number = this.number; |
| |
| // Render an operation and add it to operations li |
| var operationView = new SwaggerUi.Views.OperationView({ |
| model: operation, |
| router: this.router, |
| tagName: 'li', |
| className: 'endpoint', |
| swaggerOptions: this.options.swaggerOptions, |
| auths: this.auths |
| }); |
| |
| $('.endpoints', $(this.el)).append(operationView.render().el); |
| |
| this.number++; |
| |
| }, |
| // Generic Event handler (`Docs` is global) |
| |
| |
| callDocs: function(fnName, e) { |
| e.preventDefault(); |
| Docs[fnName](e.currentTarget.getAttribute('data-id')); |
| } |
| }); |
| 'use strict'; |
| |
| SwaggerUi.Views.ResponseContentTypeView = Backbone.View.extend({ |
| initialize: function(){}, |
| |
| render: function(){ |
| this.model.responseContentTypeId = 'rct' + Math.random(); |
| $(this.el).html(Handlebars.templates.response_content_type(this.model)); |
| return this; |
| } |
| }); |
| 'use strict'; |
| |
| SwaggerUi.Views.SignatureView = Backbone.View.extend({ |
| events: { |
| 'click a.description-link' : 'switchToDescription', |
| 'click a.snippet-link' : 'switchToSnippet', |
| 'mousedown .snippet' : 'snippetToTextArea' |
| }, |
| |
| initialize: function () { |
| |
| }, |
| |
| render: function(){ |
| |
| $(this.el).html(Handlebars.templates.signature(this.model)); |
| |
| if (this.model.defaultRendering === 'model') { |
| this.switchToDescription(); |
| } else { |
| this.switchToSnippet(); |
| } |
| |
| this.isParam = this.model.isParam; |
| |
| if (this.isParam) { |
| $('.notice', $(this.el)).text('Click to set as parameter value'); |
| } |
| |
| return this; |
| }, |
| |
| // handler for show signature |
| switchToDescription: function(e){ |
| if (e) { e.preventDefault(); } |
| |
| $('.snippet', $(this.el)).hide(); |
| $('.description', $(this.el)).show(); |
| $('.description-link', $(this.el)).addClass('selected'); |
| $('.snippet-link', $(this.el)).removeClass('selected'); |
| }, |
| |
| // handler for show sample |
| switchToSnippet: function(e){ |
| if (e) { e.preventDefault(); } |
| |
| $('.description', $(this.el)).hide(); |
| $('.snippet', $(this.el)).show(); |
| $('.snippet-link', $(this.el)).addClass('selected'); |
| $('.description-link', $(this.el)).removeClass('selected'); |
| }, |
| |
| // handler for snippet to text area |
| snippetToTextArea: function(e) { |
| if (this.isParam) { |
| if (e) { e.preventDefault(); } |
| |
| var textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode)); |
| |
| // Fix for bug in IE 10/11 which causes placeholder text to be copied to "value" |
| if ($.trim(textArea.val()) === '' || textArea.prop('placeholder') === textArea.val()) { |
| textArea.val(this.model.sampleJSON); |
| // TODO move this code outside of the view and expose an event instead |
| if( this.model.jsonEditor && this.model.jsonEditor.isEnabled()){ |
| this.model.jsonEditor.setValue(JSON.parse(this.model.sampleJSON)); |
| } |
| } |
| } |
| } |
| }); |
| 'use strict'; |
| |
| SwaggerUi.Views.StatusCodeView = Backbone.View.extend({ |
| initialize: function (opts) { |
| this.options = opts || {}; |
| this.router = this.options.router; |
| }, |
| |
| render: function(){ |
| $(this.el).html(Handlebars.templates.status_code(this.model)); |
| |
| if (this.router.api.models.hasOwnProperty(this.model.responseModel)) { |
| var responseModel = { |
| sampleJSON: JSON.stringify(this.router.api.models[this.model.responseModel].createJSONSample(), null, 2), |
| isParam: false, |
| signature: this.router.api.models[this.model.responseModel].getMockSignature(), |
| defaultRendering: this.model.defaultRendering |
| }; |
| |
| var responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'}); |
| $('.model-signature', this.$el).append(responseModelView.render().el); |
| } else { |
| $('.model-signature', this.$el).html(''); |
| } |
| return this; |
| } |
| });}).call(this); |